@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,43 @@
|
|
|
1
|
+
// src/shell/hyperlink-utils.ts
|
|
2
|
+
var OSC8_START = "\x1B]8;;";
|
|
3
|
+
var OSC8_END = "\x07";
|
|
4
|
+
function supportsHyperlinks() {
|
|
5
|
+
const term = process.env.TERM || "";
|
|
6
|
+
const termProgram = process.env.TERM_PROGRAM || "";
|
|
7
|
+
const knownSupported = [
|
|
8
|
+
"iTerm.app",
|
|
9
|
+
"WezTerm",
|
|
10
|
+
"vscode",
|
|
11
|
+
"Hyper",
|
|
12
|
+
"Tabby"
|
|
13
|
+
];
|
|
14
|
+
if (knownSupported.includes(termProgram)) {
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
if (process.env.WT_SESSION) {
|
|
18
|
+
return true;
|
|
19
|
+
}
|
|
20
|
+
if (process.env.VTE_VERSION) {
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
23
|
+
return term.includes("256color");
|
|
24
|
+
}
|
|
25
|
+
function createHyperlink(url, content) {
|
|
26
|
+
if (!supportsHyperlinks()) {
|
|
27
|
+
return url;
|
|
28
|
+
}
|
|
29
|
+
const displayText = content ?? url;
|
|
30
|
+
const blueColor = "\x1B[34m";
|
|
31
|
+
const resetColor = "\x1B[0m";
|
|
32
|
+
const coloredText = `${blueColor}${displayText}${resetColor}`;
|
|
33
|
+
return `${OSC8_START}${url}${OSC8_END}${coloredText}${OSC8_START}${OSC8_END}`;
|
|
34
|
+
}
|
|
35
|
+
var URL_PATTERN = /https?:\/\/[^\s"'<>\\]+/g;
|
|
36
|
+
function linkifyUrlsInText(content) {
|
|
37
|
+
return content.replace(URL_PATTERN, (url) => createHyperlink(url));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export {
|
|
41
|
+
createHyperlink,
|
|
42
|
+
linkifyUrlsInText
|
|
43
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
// src/shell/models/command-transcript-presenter.ts
|
|
2
|
+
var COMMAND_TRANSCRIPT_PREFIX = "\u276F";
|
|
3
|
+
var COMMAND_TRANSCRIPT_ID_PREFIX = "cmd:";
|
|
4
|
+
function normalizeCommandTitle(command) {
|
|
5
|
+
return command.trim();
|
|
6
|
+
}
|
|
7
|
+
function buildCommandBlockId(sequence, command) {
|
|
8
|
+
const trimmed = normalizeCommandTitle(command);
|
|
9
|
+
const head = trimmed.split(/\s+/, 1)[0] ?? trimmed;
|
|
10
|
+
const slug = head.replace(/[^A-Za-z0-9/_-]/g, "").replace(/^\//, "") || "anon";
|
|
11
|
+
return `${COMMAND_TRANSCRIPT_ID_PREFIX}${sequence}:${slug}`;
|
|
12
|
+
}
|
|
13
|
+
function createCommandBlock(sequence, command) {
|
|
14
|
+
const title = normalizeCommandTitle(command);
|
|
15
|
+
return {
|
|
16
|
+
id: buildCommandBlockId(sequence, title),
|
|
17
|
+
kind: "command",
|
|
18
|
+
status: "info",
|
|
19
|
+
title,
|
|
20
|
+
summary: "",
|
|
21
|
+
keep: true
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
function getCommandTranscriptText(block) {
|
|
25
|
+
if (block.kind !== "command") return "";
|
|
26
|
+
return `${COMMAND_TRANSCRIPT_PREFIX} ${block.title}`;
|
|
27
|
+
}
|
|
28
|
+
function isCommandBlock(block) {
|
|
29
|
+
return block.kind === "command";
|
|
30
|
+
}
|
|
31
|
+
var USER_TEXT_TRANSCRIPT_PREFIX = "\u203A";
|
|
32
|
+
var USER_TEXT_TRANSCRIPT_ID_PREFIX = "usr:";
|
|
33
|
+
function buildUserTextBlockId(sequence, _text) {
|
|
34
|
+
return `${USER_TEXT_TRANSCRIPT_ID_PREFIX}${sequence}`;
|
|
35
|
+
}
|
|
36
|
+
function createUserTextBlock(sequence, text, timestamp) {
|
|
37
|
+
const trimmed = text.trim();
|
|
38
|
+
const firstLine = trimmed.split("\n").find((line) => line.trim()) ?? trimmed;
|
|
39
|
+
return {
|
|
40
|
+
id: buildUserTextBlockId(sequence, trimmed),
|
|
41
|
+
kind: "user",
|
|
42
|
+
status: "info",
|
|
43
|
+
title: firstLine,
|
|
44
|
+
summary: "",
|
|
45
|
+
keep: true,
|
|
46
|
+
fullText: trimmed,
|
|
47
|
+
messageKind: "user_text",
|
|
48
|
+
timestamp
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export {
|
|
53
|
+
COMMAND_TRANSCRIPT_PREFIX,
|
|
54
|
+
COMMAND_TRANSCRIPT_ID_PREFIX,
|
|
55
|
+
normalizeCommandTitle,
|
|
56
|
+
buildCommandBlockId,
|
|
57
|
+
createCommandBlock,
|
|
58
|
+
getCommandTranscriptText,
|
|
59
|
+
isCommandBlock,
|
|
60
|
+
USER_TEXT_TRANSCRIPT_PREFIX,
|
|
61
|
+
USER_TEXT_TRANSCRIPT_ID_PREFIX,
|
|
62
|
+
buildUserTextBlockId,
|
|
63
|
+
createUserTextBlock
|
|
64
|
+
};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import {
|
|
2
|
+
fitText
|
|
3
|
+
} from "./chunk-APJIC2O5.js";
|
|
4
|
+
|
|
5
|
+
// src/shell/components/StatusFooter.tsx
|
|
6
|
+
import { Box, Text } from "@linghun/ink-runtime";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
function StatusFooter({
|
|
9
|
+
footer,
|
|
10
|
+
theme,
|
|
11
|
+
width,
|
|
12
|
+
language,
|
|
13
|
+
modelDim = false,
|
|
14
|
+
cacheTone = "default",
|
|
15
|
+
gitBranch
|
|
16
|
+
}) {
|
|
17
|
+
void language;
|
|
18
|
+
const rightSegments = [
|
|
19
|
+
{ key: "model", text: footer.model, tone: modelDim ? "dim" : "default", priority: 2 },
|
|
20
|
+
{
|
|
21
|
+
key: "cache",
|
|
22
|
+
text: footer.cache,
|
|
23
|
+
tone: cacheTone === "warning" ? "warning" : cacheTone === "dim" ? "dim" : "default",
|
|
24
|
+
priority: 4
|
|
25
|
+
},
|
|
26
|
+
{ key: "index", text: footer.index, tone: "default", priority: 3 }
|
|
27
|
+
];
|
|
28
|
+
if (gitBranch) rightSegments.push({ key: "branch", text: `\u2387 ${gitBranch}`, tone: "dim", priority: 5 });
|
|
29
|
+
if (footer.contextUsage)
|
|
30
|
+
rightSegments.push({ key: "context", text: footer.contextUsage, tone: "dim", priority: 6 });
|
|
31
|
+
if (footer.reasoning) rightSegments.push({ key: "reasoning", text: footer.reasoning, priority: 7 });
|
|
32
|
+
const narrow = width < 80;
|
|
33
|
+
const remoteSegment = footer.isRemoteMode ? [{ key: "remote", text: "\u25CF remote", tone: "dim", priority: 1 }] : [];
|
|
34
|
+
const visibleRight = narrow ? rightSegments.filter((seg) => seg.priority <= 3) : rightSegments;
|
|
35
|
+
if (narrow) {
|
|
36
|
+
return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", width, paddingX: 2, paddingTop: 1, children: [
|
|
37
|
+
/* @__PURE__ */ jsxs(Text, { children: [
|
|
38
|
+
/* @__PURE__ */ jsx(Text, { color: footer.permissionModeColor || void 0, dimColor: footer.isRemoteMode, children: footer.permissionMode }),
|
|
39
|
+
/* @__PURE__ */ jsx(Text, { color: theme.dim ?? theme.muted, dimColor: true, children: footer.cyclePermHint })
|
|
40
|
+
] }),
|
|
41
|
+
/* @__PURE__ */ jsxs(Text, { children: [
|
|
42
|
+
remoteSegment.map((seg, idx) => /* @__PURE__ */ jsxs(Text, { color: pickColor(theme, seg.tone), dimColor: seg.tone === "dim", children: [
|
|
43
|
+
idx > 0 ? /* @__PURE__ */ jsx(Text, { dimColor: true, children: " \xB7 " }) : null,
|
|
44
|
+
seg.text
|
|
45
|
+
] }, seg.key)),
|
|
46
|
+
visibleRight.map((seg, idx) => /* @__PURE__ */ jsxs(Text, { color: pickColor(theme, seg.tone), dimColor: seg.tone === "dim", children: [
|
|
47
|
+
remoteSegment.length > 0 || idx > 0 ? /* @__PURE__ */ jsx(Text, { dimColor: true, children: " \xB7 " }) : null,
|
|
48
|
+
seg.text
|
|
49
|
+
] }, seg.key))
|
|
50
|
+
] })
|
|
51
|
+
] });
|
|
52
|
+
}
|
|
53
|
+
const hasStatusLine = !!(footer.workspaceStatus || footer.runtimeStatus);
|
|
54
|
+
const allRightSegments = [...remoteSegment, ...visibleRight];
|
|
55
|
+
const reservedRight = allRightSegments.reduce(
|
|
56
|
+
(acc, seg, idx) => acc + (seg.text?.length ?? 0) + (idx > 0 ? 3 : 0),
|
|
57
|
+
0
|
|
58
|
+
);
|
|
59
|
+
const leftBudget = Math.max(20, width - 4 - reservedRight - 2);
|
|
60
|
+
const left = `${footer.permissionMode}${footer.cyclePermHint}`;
|
|
61
|
+
const fittedLeft = left.length > leftBudget ? fitText(left, leftBudget) : left;
|
|
62
|
+
return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", width, paddingX: 2, paddingTop: 1, children: [
|
|
63
|
+
hasStatusLine ? /* @__PURE__ */ jsxs(Box, { width: "100%", flexShrink: 0, children: [
|
|
64
|
+
footer.workspaceStatus ? /* @__PURE__ */ jsx(Text, { dimColor: true, children: shortenProtectionText(fitText(footer.workspaceStatus, width - 4)) }) : null,
|
|
65
|
+
footer.runtimeStatus ? /* @__PURE__ */ jsx(Text, { dimColor: true, children: shortenProtectionText(fitText(footer.runtimeStatus, width - 4)) }) : null
|
|
66
|
+
] }) : null,
|
|
67
|
+
/* @__PURE__ */ jsxs(Box, { width: "100%", children: [
|
|
68
|
+
/* @__PURE__ */ jsx(Box, { flexGrow: 1, flexShrink: 1, children: /* @__PURE__ */ jsxs(Text, { children: [
|
|
69
|
+
/* @__PURE__ */ jsx(Text, { color: footer.permissionModeColor || void 0, dimColor: footer.isRemoteMode, children: footer.permissionMode }),
|
|
70
|
+
/* @__PURE__ */ jsx(Text, { color: theme.dim ?? theme.muted, dimColor: true, children: fittedLeft.slice(footer.permissionMode.length) })
|
|
71
|
+
] }) }),
|
|
72
|
+
/* @__PURE__ */ jsx(Box, { flexShrink: 0, children: /* @__PURE__ */ jsx(Text, { children: allRightSegments.map((seg, idx) => /* @__PURE__ */ jsxs(Text, { color: pickColor(theme, seg.tone), dimColor: seg.tone === "dim", children: [
|
|
73
|
+
idx > 0 ? /* @__PURE__ */ jsx(Text, { dimColor: true, children: " \xB7 " }) : null,
|
|
74
|
+
seg.text
|
|
75
|
+
] }, seg.key)) }) })
|
|
76
|
+
] })
|
|
77
|
+
] });
|
|
78
|
+
}
|
|
79
|
+
function shortenProtectionText(text) {
|
|
80
|
+
return text.replace(/读取保护已启用/gu, "\u8BFB\u4FDD\u62A4").replace(/文件保护已启用/gu, "\u6587\u4EF6\u4FDD\u62A4").replace(/文件保护成功/gu, "\u2713 \u4FDD\u62A4").replace(/scope drift/giu, "\u8303\u56F4\u53D8\u5316").replace(/architecture drift/giu, "\u67B6\u6784\u53D8\u5316").replace(/Read protection enabled/giu, "read-protect").replace(/File protection enabled/giu, "file-protect");
|
|
81
|
+
}
|
|
82
|
+
function pickColor(theme, tone) {
|
|
83
|
+
if (tone === "warning") return theme.warning ?? theme.status.fail;
|
|
84
|
+
if (tone === "dim") return theme.dim ?? theme.muted;
|
|
85
|
+
return theme.brand;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export {
|
|
89
|
+
StatusFooter
|
|
90
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// src/shell/components/UnseenMessagePill.tsx
|
|
2
|
+
import { Box, Text } from "@linghun/ink-runtime";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
function UnseenMessagePill({
|
|
5
|
+
count,
|
|
6
|
+
language
|
|
7
|
+
}) {
|
|
8
|
+
if (count <= 0) return null;
|
|
9
|
+
const label = language === "zh-CN" ? `\u2193 ${count} \u6761\u65B0\u6D88\u606F` : `\u2193 ${count} new messages`;
|
|
10
|
+
return /* @__PURE__ */ jsx(Box, { justifyContent: "center", children: /* @__PURE__ */ jsx(Text, { bold: true, dimColor: true, children: label }) });
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export {
|
|
14
|
+
UnseenMessagePill
|
|
15
|
+
};
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import {
|
|
2
|
+
sanitizeDiagnosticText
|
|
3
|
+
} from "./chunk-OMZYPQVA.js";
|
|
4
|
+
|
|
5
|
+
// src/mcp-sse-runtime.ts
|
|
6
|
+
var MCP_SSE_TIMEOUT_MS = 15e3;
|
|
7
|
+
var MCP_SSE_TOOL_LIST_CACHE_TTL_MS = 5e3;
|
|
8
|
+
var nextJsonRpcId = 1;
|
|
9
|
+
var toolListCache = /* @__PURE__ */ new Map();
|
|
10
|
+
async function runMcpSseToolCall(server, toolName, params, timeoutMs = MCP_SSE_TIMEOUT_MS) {
|
|
11
|
+
if (!server.url) {
|
|
12
|
+
return { ok: false, summary: "MCP SSE server url is missing", errorCode: "MCP_SSE_URL_MISSING" };
|
|
13
|
+
}
|
|
14
|
+
const list = await getMcpSseToolNames(server.url, timeoutMs);
|
|
15
|
+
if (!list.ok) return list;
|
|
16
|
+
const toolNames = list.toolNames;
|
|
17
|
+
if (!toolNames.includes(toolName)) {
|
|
18
|
+
return {
|
|
19
|
+
ok: false,
|
|
20
|
+
summary: `tools/list does not contain ${toolName} (server published ${toolNames.length} tools); refusing tools/call`,
|
|
21
|
+
errorCode: "MCP_TOOL_NOT_FOUND"
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
const result = await mcpSseRequest(
|
|
25
|
+
server.url,
|
|
26
|
+
"tools/call",
|
|
27
|
+
{ name: toolName, arguments: params },
|
|
28
|
+
timeoutMs
|
|
29
|
+
);
|
|
30
|
+
if (!result.ok) return result;
|
|
31
|
+
return { ok: true, summary: `tools/call ${toolName} ok`, data: result.data };
|
|
32
|
+
}
|
|
33
|
+
async function getMcpSseToolNames(url, timeoutMs) {
|
|
34
|
+
const cached = toolListCache.get(url);
|
|
35
|
+
const now = Date.now();
|
|
36
|
+
if (cached && cached.expiresAt > now) {
|
|
37
|
+
return { ok: true, toolNames: [...cached.toolNames] };
|
|
38
|
+
}
|
|
39
|
+
const list = await mcpSseRequest(url, "tools/list", {}, timeoutMs);
|
|
40
|
+
if (!list.ok) {
|
|
41
|
+
return { ok: false, summary: list.summary, errorCode: list.errorCode };
|
|
42
|
+
}
|
|
43
|
+
const toolNames = extractMcpToolNames(list.data);
|
|
44
|
+
toolListCache.set(url, {
|
|
45
|
+
expiresAt: now + MCP_SSE_TOOL_LIST_CACHE_TTL_MS,
|
|
46
|
+
toolNames
|
|
47
|
+
});
|
|
48
|
+
return { ok: true, toolNames };
|
|
49
|
+
}
|
|
50
|
+
async function mcpSseRequest(url, method, params, timeoutMs) {
|
|
51
|
+
const controller = new AbortController();
|
|
52
|
+
const timer = setTimeout(() => controller.abort(), timeoutMs);
|
|
53
|
+
const id = nextMcpSseRequestId();
|
|
54
|
+
try {
|
|
55
|
+
const response = await fetch(url, {
|
|
56
|
+
method: "POST",
|
|
57
|
+
headers: { "content-type": "application/json", accept: "text/event-stream, application/json" },
|
|
58
|
+
body: JSON.stringify({ jsonrpc: "2.0", id, method, params }),
|
|
59
|
+
signal: controller.signal
|
|
60
|
+
});
|
|
61
|
+
if (!response.ok) {
|
|
62
|
+
return { ok: false, summary: `MCP SSE HTTP ${response.status}`, errorCode: "MCP_SSE_HTTP_ERROR" };
|
|
63
|
+
}
|
|
64
|
+
const contentType = response.headers.get("content-type") ?? "";
|
|
65
|
+
if (contentType.includes("json")) {
|
|
66
|
+
const json = await response.json();
|
|
67
|
+
return unwrapJsonRpc(json, id);
|
|
68
|
+
}
|
|
69
|
+
const text = await response.text();
|
|
70
|
+
return unwrapJsonRpc(parseSseJsonFrame(text, id), id);
|
|
71
|
+
} catch (error) {
|
|
72
|
+
return {
|
|
73
|
+
ok: false,
|
|
74
|
+
summary: `MCP SSE error: ${sanitizeDiagnosticText(error instanceof Error ? error.message : String(error))}`,
|
|
75
|
+
errorCode: error instanceof Error && error.name === "AbortError" ? "ETIMEDOUT" : "MCP_SSE_ERROR"
|
|
76
|
+
};
|
|
77
|
+
} finally {
|
|
78
|
+
clearTimeout(timer);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
function nextMcpSseRequestId() {
|
|
82
|
+
const id = nextJsonRpcId;
|
|
83
|
+
nextJsonRpcId = nextJsonRpcId >= Number.MAX_SAFE_INTEGER ? 1 : nextJsonRpcId + 1;
|
|
84
|
+
return id;
|
|
85
|
+
}
|
|
86
|
+
function unwrapJsonRpc(value, expectedId) {
|
|
87
|
+
if (Array.isArray(value)) {
|
|
88
|
+
return { ok: false, summary: "MCP SSE returned a JSON-RPC batch; expected one response object", errorCode: "MCP_SSE_BATCH_UNSUPPORTED" };
|
|
89
|
+
}
|
|
90
|
+
if (!value || typeof value !== "object") {
|
|
91
|
+
return { ok: false, summary: "MCP SSE returned an invalid JSON-RPC frame" };
|
|
92
|
+
}
|
|
93
|
+
const frame = value;
|
|
94
|
+
if (frame.jsonrpc !== "2.0" || frame.id !== expectedId) {
|
|
95
|
+
return {
|
|
96
|
+
ok: false,
|
|
97
|
+
summary: "MCP SSE JSON-RPC response id/version mismatch",
|
|
98
|
+
errorCode: "MCP_SSE_ID_MISMATCH"
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
if (frame.error) {
|
|
102
|
+
return {
|
|
103
|
+
ok: false,
|
|
104
|
+
summary: sanitizeDiagnosticText(frame.error.message ?? "MCP SSE JSON-RPC error"),
|
|
105
|
+
errorCode: String(frame.error.code ?? "MCP_SSE_JSONRPC_ERROR")
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
return { ok: true, summary: "MCP SSE ok", data: frame.result };
|
|
109
|
+
}
|
|
110
|
+
function parseSseJsonFrame(text, expectedId) {
|
|
111
|
+
const parsedFrames = [];
|
|
112
|
+
const data = text.split(/\r?\n/u).filter((line) => line.startsWith("data:")).map((line) => line.slice("data:".length).trim()).filter((line) => line && line !== "[DONE]");
|
|
113
|
+
for (const frame of data) {
|
|
114
|
+
const parsed = JSON.parse(frame);
|
|
115
|
+
if (Array.isArray(parsed)) {
|
|
116
|
+
return parsed;
|
|
117
|
+
}
|
|
118
|
+
if (parsed && typeof parsed === "object" && parsed.id === expectedId) {
|
|
119
|
+
return parsed;
|
|
120
|
+
}
|
|
121
|
+
parsedFrames.push(parsed);
|
|
122
|
+
}
|
|
123
|
+
return parsedFrames[0];
|
|
124
|
+
}
|
|
125
|
+
function extractMcpToolNames(listResult) {
|
|
126
|
+
if (!listResult || typeof listResult !== "object") return [];
|
|
127
|
+
const tools = listResult.tools;
|
|
128
|
+
if (!Array.isArray(tools)) return [];
|
|
129
|
+
return tools.map(
|
|
130
|
+
(tool) => tool && typeof tool === "object" && typeof tool.name === "string" ? tool.name : ""
|
|
131
|
+
).filter(Boolean);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export {
|
|
135
|
+
runMcpSseToolCall
|
|
136
|
+
};
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
import {
|
|
2
|
+
truncateDisplay
|
|
3
|
+
} from "./chunk-OMZYPQVA.js";
|
|
4
|
+
|
|
5
|
+
// src/agent-completion-finalizer.ts
|
|
6
|
+
import { randomUUID } from "crypto";
|
|
7
|
+
var MAX_AGENT_COMPLETION_NOTICES = 80;
|
|
8
|
+
var MAX_AGENT_COMPLETION_BATCHES = 24;
|
|
9
|
+
var MAX_REPORTED_NOTICE_IDS = 200;
|
|
10
|
+
var NOTIFICATION_COOLDOWN_MS = 1500;
|
|
11
|
+
function createAgentCompletionState() {
|
|
12
|
+
return {
|
|
13
|
+
notices: [],
|
|
14
|
+
batchSummaries: [],
|
|
15
|
+
lastNotificationAt: {},
|
|
16
|
+
reportedNoticeIds: []
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
function enqueueAgentCompletionNotice(context, input) {
|
|
20
|
+
const state = ensureAgentCompletionState(context);
|
|
21
|
+
const now = input.now ?? (/* @__PURE__ */ new Date()).toISOString();
|
|
22
|
+
const existing = state.notices.find((notice2) => notice2.agentId === input.agent.id);
|
|
23
|
+
const notice = {
|
|
24
|
+
id: existing?.id ?? randomUUID(),
|
|
25
|
+
agentId: input.agent.id,
|
|
26
|
+
agentType: input.agent.type,
|
|
27
|
+
agentRole: input.agent.role,
|
|
28
|
+
...input.agent.displayName ? { displayName: input.agent.displayName } : {},
|
|
29
|
+
...input.agent.teamName ? { teamName: input.agent.teamName } : {},
|
|
30
|
+
...input.parentSessionId ?? input.agent.parentSessionId ? { parentSessionId: input.parentSessionId ?? input.agent.parentSessionId } : {},
|
|
31
|
+
...input.workflowRunId ?? input.task?.workflowRunId ? { workflowRunId: input.workflowRunId ?? input.task?.workflowRunId } : {},
|
|
32
|
+
task: input.agent.task,
|
|
33
|
+
status: input.status,
|
|
34
|
+
validity: classifyAgentCompletionValidity(input.status, input.evidenceRefs ?? []),
|
|
35
|
+
summary: truncateDisplay(input.summary.replace(/\s+/g, " ").trim(), 220),
|
|
36
|
+
evidenceRefs: Array.from(new Set(input.evidenceRefs ?? [])),
|
|
37
|
+
nextAction: formatNoticeNextAction(context, input.status, input.agent.id),
|
|
38
|
+
createdAt: existing?.createdAt ?? now,
|
|
39
|
+
updatedAt: now,
|
|
40
|
+
...existing?.reportedAt ? { reportedAt: existing.reportedAt } : {}
|
|
41
|
+
};
|
|
42
|
+
if (existing) {
|
|
43
|
+
Object.assign(existing, notice);
|
|
44
|
+
} else {
|
|
45
|
+
state.notices.unshift(notice);
|
|
46
|
+
}
|
|
47
|
+
state.notices = state.notices.slice(0, MAX_AGENT_COMPLETION_NOTICES);
|
|
48
|
+
refreshAgentCompletionBatchSummaries(context, now);
|
|
49
|
+
pushAgentCompletionNotification(context, notice);
|
|
50
|
+
return notice;
|
|
51
|
+
}
|
|
52
|
+
function collectPendingAgentCompletionNotices(context) {
|
|
53
|
+
const state = ensureAgentCompletionState(context);
|
|
54
|
+
const reported = new Set(state.reportedNoticeIds);
|
|
55
|
+
return state.notices.filter((notice) => !notice.reportedAt && !reported.has(notice.id));
|
|
56
|
+
}
|
|
57
|
+
function markAgentCompletionNoticeReported(context, noticeId, now = (/* @__PURE__ */ new Date()).toISOString()) {
|
|
58
|
+
const state = ensureAgentCompletionState(context);
|
|
59
|
+
const notice = state.notices.find((item) => item.id === noticeId);
|
|
60
|
+
if (notice) notice.reportedAt = now;
|
|
61
|
+
state.reportedNoticeIds = [
|
|
62
|
+
noticeId,
|
|
63
|
+
...state.reportedNoticeIds.filter((id) => id !== noticeId)
|
|
64
|
+
].slice(0, MAX_REPORTED_NOTICE_IDS);
|
|
65
|
+
}
|
|
66
|
+
function formatAgentCompletionDigest(context) {
|
|
67
|
+
const pending = collectPendingAgentCompletionNotices(context);
|
|
68
|
+
if (pending.length === 0) return null;
|
|
69
|
+
const state = ensureAgentCompletionState(context);
|
|
70
|
+
const latestBatch = state.batchSummaries[0];
|
|
71
|
+
const isEn = context.language === "en-US";
|
|
72
|
+
const counts = summarizeNotices(pending);
|
|
73
|
+
const lines = [
|
|
74
|
+
isEn ? `Agent results returned: ${pending.length} pending notice(s).` : `\u667A\u80FD\u4F53\u7ED3\u679C\uFF1A${pending.length} \u6761\u5F85\u5904\u7406\u901A\u77E5\u3002`,
|
|
75
|
+
isEn ? `Trust: ${counts.valid} valid, ${counts.partial} partial, ${counts.invalid} invalid; source evidence is tracked separately from verification.` : `\u53EF\u4FE1\u5EA6\uFF1A${counts.valid} \u4E2A\u6709\u6548\uFF0C${counts.partial} \u4E2A\u90E8\u5206\u6709\u6548\uFF0C${counts.invalid} \u4E2A\u65E0\u6548\uFF1B\u6E90\u7801/\u6267\u884C\u8BC1\u636E\u4E0E\u9A8C\u8BC1\u7ED3\u8BBA\u5206\u5F00\u6807\u8BB0\u3002`
|
|
76
|
+
];
|
|
77
|
+
if (latestBatch) {
|
|
78
|
+
lines.push(isEn ? `Latest batch: ${latestBatch.summary}` : `\u6700\u8FD1\u6279\u6B21\uFF1A${latestBatch.summary}`);
|
|
79
|
+
}
|
|
80
|
+
for (const notice of pending.slice(0, 5)) {
|
|
81
|
+
lines.push(
|
|
82
|
+
`- ${formatAgentLabel(notice)}: ${notice.status}/${notice.validity}; ${notice.summary}`
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
if (pending.length > 5) {
|
|
86
|
+
lines.push(
|
|
87
|
+
isEn ? `- ...and ${pending.length - 5} more.` : `- \u2026\u2026\u53E6\u6709 ${pending.length - 5} \u6761\u3002`
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
lines.push(
|
|
91
|
+
isEn ? "Next: inspect /agents or /background before claiming all work passed." : "\u4E0B\u4E00\u6B65\uFF1A\u67E5\u770B /agents \u6216 /background\uFF1B\u4E0D\u8981\u628A\u7ED3\u679C\u76F4\u63A5\u7B49\u540C\u4E8E\u5168\u90E8\u901A\u8FC7\u3002"
|
|
92
|
+
);
|
|
93
|
+
return lines.join("\n");
|
|
94
|
+
}
|
|
95
|
+
function refreshAgentCompletionBatchSummaries(context, now = (/* @__PURE__ */ new Date()).toISOString()) {
|
|
96
|
+
const state = ensureAgentCompletionState(context);
|
|
97
|
+
const groups = /* @__PURE__ */ new Map();
|
|
98
|
+
for (const notice of state.notices) {
|
|
99
|
+
const key = getNoticeScopeKey(notice);
|
|
100
|
+
const group = groups.get(key) ?? [];
|
|
101
|
+
group.push(notice);
|
|
102
|
+
groups.set(key, group);
|
|
103
|
+
}
|
|
104
|
+
const batches = Array.from(groups.entries()).map(([scopeKey, notices]) => createBatchSummary(context, scopeKey, notices, now)).sort((a, b) => Date.parse(b.createdAt) - Date.parse(a.createdAt)).slice(0, MAX_AGENT_COMPLETION_BATCHES);
|
|
105
|
+
state.batchSummaries = batches;
|
|
106
|
+
return batches;
|
|
107
|
+
}
|
|
108
|
+
function ensureAgentCompletionState(context) {
|
|
109
|
+
context.agentCompletions ??= createAgentCompletionState();
|
|
110
|
+
return context.agentCompletions;
|
|
111
|
+
}
|
|
112
|
+
function classifyAgentCompletionValidity(status, evidenceRefs) {
|
|
113
|
+
if (status === "completed") return evidenceRefs.length > 0 ? "valid" : "partial";
|
|
114
|
+
if (status === "blocked" || status === "stale") return "partial";
|
|
115
|
+
return "invalid";
|
|
116
|
+
}
|
|
117
|
+
function formatNoticeNextAction(context, status, agentId) {
|
|
118
|
+
const isEn = context.language === "en-US";
|
|
119
|
+
if (status === "completed") {
|
|
120
|
+
return isEn ? `Review /agents show ${agentId}.` : `\u67E5\u770B /agents show ${agentId}\u3002`;
|
|
121
|
+
}
|
|
122
|
+
if (status === "stale") {
|
|
123
|
+
return isEn ? `Resume or cancel /agents show ${agentId}.` : `\u6062\u590D\u6216\u53D6\u6D88 /agents show ${agentId}\u3002`;
|
|
124
|
+
}
|
|
125
|
+
return isEn ? `Inspect /agents show ${agentId} before retrying.` : `\u91CD\u8BD5\u524D\u67E5\u770B /agents show ${agentId}\u3002`;
|
|
126
|
+
}
|
|
127
|
+
function pushAgentCompletionNotification(context, notice) {
|
|
128
|
+
const state = ensureAgentCompletionState(context);
|
|
129
|
+
const now = Date.now();
|
|
130
|
+
const key = `agent-completion:${notice.agentId}:${notice.status}`;
|
|
131
|
+
if (now - (state.lastNotificationAt[key] ?? 0) < NOTIFICATION_COOLDOWN_MS) return;
|
|
132
|
+
state.lastNotificationAt[key] = now;
|
|
133
|
+
const text = formatNotificationText(context, notice);
|
|
134
|
+
if (context.pushNotification) {
|
|
135
|
+
context.pushNotification(text, notice.validity === "invalid" ? "warning" : "success");
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
context.notifications ??= [];
|
|
139
|
+
context.notifications.push({
|
|
140
|
+
key,
|
|
141
|
+
text,
|
|
142
|
+
priority: notice.validity === "invalid" ? "immediate" : "medium",
|
|
143
|
+
timeoutMs: 7e3,
|
|
144
|
+
createdAt: now,
|
|
145
|
+
tone: notice.validity === "invalid" ? "warning" : "success"
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
function formatNotificationText(context, notice) {
|
|
149
|
+
const label = formatAgentLabel(notice);
|
|
150
|
+
const summary = notice.summary ? `: ${notice.summary}` : "";
|
|
151
|
+
if (context.language === "en-US") {
|
|
152
|
+
const verb2 = notice.status === "completed" ? "completed" : notice.status === "failed" ? "failed" : notice.status === "blocked" ? "is blocked" : notice.status === "cancelled" ? "was cancelled" : "finished";
|
|
153
|
+
return truncateDisplay(`Agent ${label} ${verb2}${summary}`, 150);
|
|
154
|
+
}
|
|
155
|
+
const verb = notice.status === "completed" ? "\u5DF2\u5B8C\u6210" : notice.status === "failed" ? "\u5931\u8D25" : notice.status === "blocked" ? "\u88AB\u963B\u585E" : notice.status === "cancelled" ? "\u5DF2\u53D6\u6D88" : "\u5DF2\u7ED3\u675F";
|
|
156
|
+
return truncateDisplay(`\u5B50\u667A\u80FD\u4F53 ${label} ${verb}${summary}`, 150);
|
|
157
|
+
}
|
|
158
|
+
function createBatchSummary(context, scopeKey, notices, now) {
|
|
159
|
+
const counts = summarizeNotices(notices);
|
|
160
|
+
const first = notices[0];
|
|
161
|
+
const evidenceRefs = Array.from(new Set(notices.flatMap((notice) => notice.evidenceRefs))).slice(
|
|
162
|
+
0,
|
|
163
|
+
20
|
|
164
|
+
);
|
|
165
|
+
return {
|
|
166
|
+
id: `batch:${scopeKey}`,
|
|
167
|
+
scopeKey,
|
|
168
|
+
...first?.teamName ? { teamName: first.teamName } : {},
|
|
169
|
+
...first?.parentSessionId ? { parentSessionId: first.parentSessionId } : {},
|
|
170
|
+
...first?.workflowRunId ? { workflowRunId: first.workflowRunId } : {},
|
|
171
|
+
total: notices.length,
|
|
172
|
+
valid: counts.valid,
|
|
173
|
+
partial: counts.partial,
|
|
174
|
+
invalid: counts.invalid,
|
|
175
|
+
completed: counts.completed,
|
|
176
|
+
failed: counts.failed,
|
|
177
|
+
blocked: counts.blocked,
|
|
178
|
+
stale: counts.stale,
|
|
179
|
+
cancelled: counts.cancelled,
|
|
180
|
+
evidenceRefs,
|
|
181
|
+
summary: formatBatchSummaryText(context, counts, evidenceRefs.length),
|
|
182
|
+
createdAt: now
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
function summarizeNotices(notices) {
|
|
186
|
+
const counts = {
|
|
187
|
+
valid: 0,
|
|
188
|
+
partial: 0,
|
|
189
|
+
invalid: 0,
|
|
190
|
+
completed: 0,
|
|
191
|
+
failed: 0,
|
|
192
|
+
blocked: 0,
|
|
193
|
+
stale: 0,
|
|
194
|
+
cancelled: 0
|
|
195
|
+
};
|
|
196
|
+
for (const notice of notices) {
|
|
197
|
+
counts[notice.validity] += 1;
|
|
198
|
+
counts[notice.status] += 1;
|
|
199
|
+
}
|
|
200
|
+
return counts;
|
|
201
|
+
}
|
|
202
|
+
function formatBatchSummaryText(context, counts, evidenceCount) {
|
|
203
|
+
if (context.language === "en-US") {
|
|
204
|
+
return `${counts.completed} completed, ${counts.blocked} blocked, ${counts.failed} failed, ${counts.stale} stale, ${counts.cancelled} cancelled; ${evidenceCount} evidence ref(s).`;
|
|
205
|
+
}
|
|
206
|
+
return `${counts.completed} \u4E2A\u5B8C\u6210\uFF0C${counts.blocked} \u4E2A\u963B\u585E\uFF0C${counts.failed} \u4E2A\u5931\u8D25\uFF0C${counts.stale} \u4E2A stale\uFF0C${counts.cancelled} \u4E2A\u53D6\u6D88\uFF1B${evidenceCount} \u6761\u8BC1\u636E\u5F15\u7528\u3002`;
|
|
207
|
+
}
|
|
208
|
+
function getNoticeScopeKey(notice) {
|
|
209
|
+
return notice.workflowRunId ? `workflow:${notice.workflowRunId}` : notice.teamName ? `team:${notice.teamName}` : notice.parentSessionId ? `session:${notice.parentSessionId}` : `agent:${notice.agentId}`;
|
|
210
|
+
}
|
|
211
|
+
function formatAgentLabel(notice) {
|
|
212
|
+
return notice.displayName ?? notice.agentType ?? notice.agentId;
|
|
213
|
+
}
|
|
214
|
+
async function appendAgentCompletionSystemEvent(context, input) {
|
|
215
|
+
const level = input.status === "failed" || input.status === "cancelled" ? "warning" : "info";
|
|
216
|
+
const message = `agent_completion:${input.agentId}; status=${input.status}; label=${input.label}; summary=${truncateDisplay(input.summary, 120)}`;
|
|
217
|
+
try {
|
|
218
|
+
await context.store.appendEvent(input.targetSession, {
|
|
219
|
+
type: "system_event",
|
|
220
|
+
id: randomUUID(),
|
|
221
|
+
level,
|
|
222
|
+
message,
|
|
223
|
+
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
224
|
+
});
|
|
225
|
+
return { written: true };
|
|
226
|
+
} catch (error) {
|
|
227
|
+
const reason = error instanceof Error ? error.message : String(error);
|
|
228
|
+
const fallbackMessage = `agent_completion_write_failed:${input.agentId}; target=${input.targetSession}; error=${truncateDisplay(reason, 100)}`;
|
|
229
|
+
const fallbackTarget = input.fallbackSession ?? input.targetSession;
|
|
230
|
+
context.store.appendEvent(fallbackTarget, {
|
|
231
|
+
type: "system_event",
|
|
232
|
+
id: randomUUID(),
|
|
233
|
+
level: "warning",
|
|
234
|
+
message: fallbackMessage,
|
|
235
|
+
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
236
|
+
}).catch(() => {
|
|
237
|
+
});
|
|
238
|
+
return { written: false, fallbackWarning: fallbackMessage };
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
export {
|
|
243
|
+
createAgentCompletionState,
|
|
244
|
+
enqueueAgentCompletionNotice,
|
|
245
|
+
collectPendingAgentCompletionNotices,
|
|
246
|
+
markAgentCompletionNoticeReported,
|
|
247
|
+
formatAgentCompletionDigest,
|
|
248
|
+
refreshAgentCompletionBatchSummaries,
|
|
249
|
+
appendAgentCompletionSystemEvent
|
|
250
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// src/ghost-text.ts
|
|
2
|
+
function computeGhostText(input, candidates) {
|
|
3
|
+
if (!input || !input.startsWith("/")) return void 0;
|
|
4
|
+
if (input.includes(" ")) return void 0;
|
|
5
|
+
const matches = candidates.filter((c) => c.slash.startsWith(input));
|
|
6
|
+
if (matches.length !== 1) return void 0;
|
|
7
|
+
const suffix = matches[0].slash.slice(input.length);
|
|
8
|
+
return suffix.length > 0 ? suffix : void 0;
|
|
9
|
+
}
|
|
10
|
+
function acceptGhostText(input, ghost) {
|
|
11
|
+
return input + ghost + " ";
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export {
|
|
15
|
+
computeGhostText,
|
|
16
|
+
acceptGhostText
|
|
17
|
+
};
|