@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,215 @@
|
|
|
1
|
+
import {
|
|
2
|
+
MessageResponse
|
|
3
|
+
} from "./chunk-L5GOCMZP.js";
|
|
4
|
+
import {
|
|
5
|
+
CtrlOToExpand
|
|
6
|
+
} from "./chunk-MOJL4X4L.js";
|
|
7
|
+
import {
|
|
8
|
+
MessageMarkdown
|
|
9
|
+
} from "./chunk-DTK5NBTV.js";
|
|
10
|
+
import {
|
|
11
|
+
getStatusMarker
|
|
12
|
+
} from "./chunk-GC55DMZV.js";
|
|
13
|
+
import {
|
|
14
|
+
fitText,
|
|
15
|
+
wrapText
|
|
16
|
+
} from "./chunk-APJIC2O5.js";
|
|
17
|
+
|
|
18
|
+
// src/shell/components/ProductBlock.tsx
|
|
19
|
+
import { Box, Text } from "@linghun/ink-runtime";
|
|
20
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
21
|
+
function isMeaningfulTitle(value) {
|
|
22
|
+
if (!value) return false;
|
|
23
|
+
const trimmed = value.trim();
|
|
24
|
+
if (!trimmed) return false;
|
|
25
|
+
if (trimmed.toLowerCase() === "unknown") return false;
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
function isMessageKind(kind) {
|
|
29
|
+
if (!kind) return false;
|
|
30
|
+
return kind === "assistant_text" || kind === "assistant_thinking" || kind === "local_command_output" || kind === "tool_result_success" || kind === "tool_result_error" || kind === "tool_result_cancelled" || kind === "tool_result_rejected" || kind === "diagnostic";
|
|
31
|
+
}
|
|
32
|
+
function hasHiddenContent(block, renderedBody) {
|
|
33
|
+
const fullText = (block.fullText ?? "").trim();
|
|
34
|
+
const summary = (block.summary ?? "").trim();
|
|
35
|
+
if (!fullText) return false;
|
|
36
|
+
if (renderedBody?.trim() === fullText) return false;
|
|
37
|
+
if (!summary) return fullText.length > 0;
|
|
38
|
+
const nonEmptyLines = fullText.split(/\r?\n/u).filter((line) => line.trim().length > 0).length;
|
|
39
|
+
return nonEmptyLines >= 2 || fullText.length > summary.length + 16;
|
|
40
|
+
}
|
|
41
|
+
function visibleNextAction(block, renderedBody) {
|
|
42
|
+
if (!block.nextAction) return void 0;
|
|
43
|
+
if (!/Ctrl\+O/i.test(block.nextAction)) return block.nextAction;
|
|
44
|
+
return hasHiddenContent(block, renderedBody) ? block.nextAction : void 0;
|
|
45
|
+
}
|
|
46
|
+
function messageBody(block, nextAction) {
|
|
47
|
+
if (nextAction && /Ctrl\+O/i.test(nextAction) && block.ctrlOCollapsed) {
|
|
48
|
+
return (block.summary ?? "").trim();
|
|
49
|
+
}
|
|
50
|
+
return (block.fullText ?? block.summary ?? "").trim();
|
|
51
|
+
}
|
|
52
|
+
function ProductBlock({
|
|
53
|
+
block,
|
|
54
|
+
theme,
|
|
55
|
+
width,
|
|
56
|
+
language = "zh-CN"
|
|
57
|
+
}) {
|
|
58
|
+
const compact = width < 60;
|
|
59
|
+
const nextAction = visibleNextAction(block);
|
|
60
|
+
if (block.kind === "user" || block.kind === "command" && block.messageKind === "user_text") {
|
|
61
|
+
const body = (block.fullText ?? block.title ?? "").trim();
|
|
62
|
+
if (!body) return null;
|
|
63
|
+
return /* @__PURE__ */ jsxs(Box, { marginTop: 1, marginBottom: 1, flexDirection: "row", children: [
|
|
64
|
+
/* @__PURE__ */ jsx(Text, { color: theme.inactive ?? theme.muted, children: "\u2502 " }),
|
|
65
|
+
/* @__PURE__ */ jsx(Box, { flexDirection: "column", children: wrapText(body, Math.max(8, width - 2)).map((line, idx) => /* @__PURE__ */ jsx(
|
|
66
|
+
Text,
|
|
67
|
+
{
|
|
68
|
+
backgroundColor: theme.mode === "no-color" ? void 0 : theme.userBackground,
|
|
69
|
+
children: line
|
|
70
|
+
},
|
|
71
|
+
`${idx}-${line}`
|
|
72
|
+
)) })
|
|
73
|
+
] });
|
|
74
|
+
}
|
|
75
|
+
if (block.kind === "command") {
|
|
76
|
+
return /* @__PURE__ */ jsx(Box, { marginTop: 1, marginBottom: 0, children: /* @__PURE__ */ jsxs(Text, { children: [
|
|
77
|
+
/* @__PURE__ */ jsx(Text, { color: theme.inactive ?? theme.muted, children: "\u276F " }),
|
|
78
|
+
/* @__PURE__ */ jsx(Text, { color: theme.accent, children: fitText(block.title, Math.max(8, width - 2)) })
|
|
79
|
+
] }) });
|
|
80
|
+
}
|
|
81
|
+
if (isMessageKind(block.messageKind) && block.messageKind !== "tool_result_error" && block.messageKind !== "assistant_thinking") {
|
|
82
|
+
const previewBody = messageBody(block, block.nextAction);
|
|
83
|
+
const nextAction2 = visibleNextAction(block, previewBody);
|
|
84
|
+
const body = messageBody(block, nextAction2);
|
|
85
|
+
if (!body) return null;
|
|
86
|
+
const isLocalOutput = block.messageKind === "local_command_output";
|
|
87
|
+
const isDiagnostic = block.messageKind === "diagnostic";
|
|
88
|
+
const isCancelled = block.messageKind === "tool_result_cancelled";
|
|
89
|
+
const isRejected = block.messageKind === "tool_result_rejected";
|
|
90
|
+
const dim = isCancelled || isRejected;
|
|
91
|
+
const tone = isDiagnostic ? "diagnostic" : "default";
|
|
92
|
+
const useMessageResponse = isLocalOutput || block.messageKind === "tool_result_success" || isDiagnostic;
|
|
93
|
+
return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", marginTop: 0, marginBottom: 1, children: [
|
|
94
|
+
useMessageResponse ? /* @__PURE__ */ jsx(MessageResponse, { width, children: /* @__PURE__ */ jsx(
|
|
95
|
+
MessageMarkdown,
|
|
96
|
+
{
|
|
97
|
+
text: body,
|
|
98
|
+
theme,
|
|
99
|
+
dim,
|
|
100
|
+
tone,
|
|
101
|
+
wrapWidth: Math.max(8, width - 4),
|
|
102
|
+
selectionLineIndexes: block.selectionLineIndexes,
|
|
103
|
+
selectionLineRanges: block.selectionLineRanges
|
|
104
|
+
}
|
|
105
|
+
) }) : /* @__PURE__ */ jsx(
|
|
106
|
+
MessageMarkdown,
|
|
107
|
+
{
|
|
108
|
+
text: body,
|
|
109
|
+
theme,
|
|
110
|
+
dim,
|
|
111
|
+
tone,
|
|
112
|
+
wrapWidth: Math.max(8, width),
|
|
113
|
+
selectionLineIndexes: block.selectionLineIndexes,
|
|
114
|
+
selectionLineRanges: block.selectionLineRanges
|
|
115
|
+
}
|
|
116
|
+
),
|
|
117
|
+
nextAction2 ? /* @__PURE__ */ jsx(CtrlOToExpand, { theme, hint: fitText(nextAction2, Math.max(8, width - 2)) }) : null
|
|
118
|
+
] });
|
|
119
|
+
}
|
|
120
|
+
if (block.messageKind === "assistant_thinking") {
|
|
121
|
+
const previewBody = messageBody(block, block.nextAction);
|
|
122
|
+
const nextAction2 = visibleNextAction(block, previewBody);
|
|
123
|
+
const body = messageBody(block, nextAction2);
|
|
124
|
+
if (!body) return null;
|
|
125
|
+
return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [
|
|
126
|
+
/* @__PURE__ */ jsx(Text, { color: theme.dim ?? theme.muted, italic: true, dimColor: true, children: "\u2234 " }),
|
|
127
|
+
/* @__PURE__ */ jsx(
|
|
128
|
+
MessageMarkdown,
|
|
129
|
+
{
|
|
130
|
+
text: body,
|
|
131
|
+
theme,
|
|
132
|
+
dim: true,
|
|
133
|
+
wrapWidth: Math.max(8, width),
|
|
134
|
+
selectionLineIndexes: block.selectionLineIndexes,
|
|
135
|
+
selectionLineRanges: block.selectionLineRanges
|
|
136
|
+
}
|
|
137
|
+
),
|
|
138
|
+
nextAction2 ? /* @__PURE__ */ jsx(CtrlOToExpand, { theme, hint: fitText(nextAction2, Math.max(8, width - 2)) }) : null
|
|
139
|
+
] });
|
|
140
|
+
}
|
|
141
|
+
if (block.messageKind === "compact_boundary") {
|
|
142
|
+
return /* @__PURE__ */ jsx(Box, { marginY: 1, children: /* @__PURE__ */ jsx(Text, { dimColor: true, children: `\u273B ${block.title}` }) });
|
|
143
|
+
}
|
|
144
|
+
const isAlert = block.kind === "permission" || block.kind === "error" || block.status === "fail" || block.messageKind === "tool_result_error";
|
|
145
|
+
const emphasized = block.kind === "permission" && !compact;
|
|
146
|
+
const borderColor = emphasized ? block.kind === "permission" ? theme.permission ?? theme.border : block.messageKind === "tool_result_error" ? theme.error ?? theme.status.fail : theme.status[block.status] ?? theme.border : void 0;
|
|
147
|
+
const innerWidth = Math.max(8, width - (emphasized ? 4 : 0));
|
|
148
|
+
if (block.messageKind === "tool_result_error") {
|
|
149
|
+
const previewBody = messageBody(block, block.nextAction);
|
|
150
|
+
const nextAction2 = visibleNextAction(block, previewBody);
|
|
151
|
+
const body = messageBody(block, nextAction2);
|
|
152
|
+
const showRetry = block.retrySeconds && block.retrySeconds > 0 && (block.retryAttempt ?? 0) >= 4;
|
|
153
|
+
const retryHint = showRetry ? language === "en-US" ? `Retrying in ${block.retrySeconds}s\u2026 (attempt ${block.retryAttempt}/${block.retryMax})` : `\u6B63\u5728\u91CD\u8BD5 ${block.retrySeconds}s \u540E\u2026 (\u7B2C ${block.retryAttempt}/${block.retryMax} \u6B21)` : void 0;
|
|
154
|
+
return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [
|
|
155
|
+
isMeaningfulTitle(block.title) ? /* @__PURE__ */ jsxs(Text, { children: [
|
|
156
|
+
/* @__PURE__ */ jsx(Text, { color: theme.error ?? theme.status.fail, children: getStatusMarker("fail", theme.mode === "no-color") }),
|
|
157
|
+
" ",
|
|
158
|
+
/* @__PURE__ */ jsx(Text, { color: theme.error ?? theme.status.fail, children: block.title })
|
|
159
|
+
] }) : null,
|
|
160
|
+
body ? /* @__PURE__ */ jsx(MessageResponse, { width, children: /* @__PURE__ */ jsx(
|
|
161
|
+
MessageMarkdown,
|
|
162
|
+
{
|
|
163
|
+
text: body,
|
|
164
|
+
theme,
|
|
165
|
+
tone: "error",
|
|
166
|
+
wrapWidth: Math.max(8, width - 4),
|
|
167
|
+
selectionLineIndexes: block.selectionLineIndexes,
|
|
168
|
+
selectionLineRanges: block.selectionLineRanges
|
|
169
|
+
}
|
|
170
|
+
) }) : null,
|
|
171
|
+
nextAction2 ? /* @__PURE__ */ jsx(CtrlOToExpand, { theme, hint: fitText(nextAction2, Math.max(8, width - 2)) }) : null,
|
|
172
|
+
retryHint ? /* @__PURE__ */ jsx(Text, { dimColor: true, children: retryHint }) : null
|
|
173
|
+
] });
|
|
174
|
+
}
|
|
175
|
+
const titleVisible = isMeaningfulTitle(block.title);
|
|
176
|
+
const summaryTrimmed = (block.summary ?? "").trim();
|
|
177
|
+
if (!titleVisible && !summaryTrimmed && !block.detail && !block.nextAction) {
|
|
178
|
+
return null;
|
|
179
|
+
}
|
|
180
|
+
if (!titleVisible && !summaryTrimmed && !block.detail && !nextAction) {
|
|
181
|
+
return null;
|
|
182
|
+
}
|
|
183
|
+
const summaryAsMarker = !titleVisible && summaryTrimmed.length > 0;
|
|
184
|
+
return /* @__PURE__ */ jsxs(
|
|
185
|
+
Box,
|
|
186
|
+
{
|
|
187
|
+
flexDirection: "column",
|
|
188
|
+
borderStyle: emphasized ? "round" : void 0,
|
|
189
|
+
borderColor,
|
|
190
|
+
borderLeft: false,
|
|
191
|
+
borderRight: false,
|
|
192
|
+
borderBottom: false,
|
|
193
|
+
paddingX: emphasized ? 1 : 0,
|
|
194
|
+
marginBottom: 1,
|
|
195
|
+
children: [
|
|
196
|
+
titleVisible ? /* @__PURE__ */ jsxs(Text, { children: [
|
|
197
|
+
/* @__PURE__ */ jsx(Text, { color: theme.status[block.status], children: getStatusMarker(block.status, theme.mode === "no-color") }),
|
|
198
|
+
" ",
|
|
199
|
+
block.title
|
|
200
|
+
] }) : summaryAsMarker ? /* @__PURE__ */ jsxs(Text, { color: theme.status[block.status], children: [
|
|
201
|
+
getStatusMarker(block.status, theme.mode === "no-color"),
|
|
202
|
+
" ",
|
|
203
|
+
block.summary
|
|
204
|
+
] }) : null,
|
|
205
|
+
!summaryAsMarker && summaryTrimmed ? /* @__PURE__ */ jsx(Text, { children: block.summary }) : null,
|
|
206
|
+
block.detail ? /* @__PURE__ */ jsx(Text, { color: theme.inactive ?? theme.muted, children: fitText(block.detail, innerWidth) }) : null,
|
|
207
|
+
nextAction ? /* @__PURE__ */ jsx(CtrlOToExpand, { theme, hint: fitText(nextAction, innerWidth) }) : null
|
|
208
|
+
]
|
|
209
|
+
}
|
|
210
|
+
);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
export {
|
|
214
|
+
ProductBlock
|
|
215
|
+
};
|
|
@@ -0,0 +1,420 @@
|
|
|
1
|
+
import {
|
|
2
|
+
formatProjectRulesContext
|
|
3
|
+
} from "./chunk-LQTVYUT3.js";
|
|
4
|
+
import {
|
|
5
|
+
isDeepCompactPacket
|
|
6
|
+
} from "./chunk-RMLTVKOY.js";
|
|
7
|
+
import {
|
|
8
|
+
createIndexStatusSnapshot,
|
|
9
|
+
formatIndexRuntimeRef
|
|
10
|
+
} from "./chunk-UT2TYK2A.js";
|
|
11
|
+
import {
|
|
12
|
+
isRecord
|
|
13
|
+
} from "./chunk-QLRTQHTR.js";
|
|
14
|
+
import {
|
|
15
|
+
getRuntimeStatusProvider
|
|
16
|
+
} from "./chunk-3LT6OWQ2.js";
|
|
17
|
+
import {
|
|
18
|
+
summarizeArchitectureCard
|
|
19
|
+
} from "./chunk-MVONSJEN.js";
|
|
20
|
+
|
|
21
|
+
// src/handoff-session-runtime.ts
|
|
22
|
+
import { randomUUID } from "crypto";
|
|
23
|
+
import { mkdir, writeFile } from "fs/promises";
|
|
24
|
+
import { join } from "path";
|
|
25
|
+
var COMPACT_PROJECTION_EVENT_PREFIX = "compact_projection:";
|
|
26
|
+
var HANDOFF_KEY_FILE_LIMIT = 12;
|
|
27
|
+
var DEFAULT_HANDOFF_KEY_FILES = [
|
|
28
|
+
"README.md",
|
|
29
|
+
"WHITEPAPER.md",
|
|
30
|
+
"docs/developers/capability-runtime-app-bridge.md",
|
|
31
|
+
"package.json",
|
|
32
|
+
"tsconfig.json"
|
|
33
|
+
];
|
|
34
|
+
function hydrateResumeContext(context, transcript) {
|
|
35
|
+
const latestTodo = [...transcript].reverse().find((event) => event.type === "todo_update");
|
|
36
|
+
if (latestTodo?.type === "todo_update") {
|
|
37
|
+
context.tools.todos = latestTodo.items.map((item) => ({ ...item }));
|
|
38
|
+
}
|
|
39
|
+
const latestVerification = [...transcript].reverse().find((event) => event.type === "verification_end");
|
|
40
|
+
if (latestVerification?.type === "verification_end") {
|
|
41
|
+
context.lastVerification = latestVerification.report;
|
|
42
|
+
}
|
|
43
|
+
const evidence = transcript.filter(
|
|
44
|
+
(event) => event.type === "evidence_record"
|
|
45
|
+
).slice(-10).map((event) => ({
|
|
46
|
+
id: event.id,
|
|
47
|
+
kind: event.kind,
|
|
48
|
+
summary: event.summary,
|
|
49
|
+
source: event.source,
|
|
50
|
+
supportsClaims: event.supportsClaims,
|
|
51
|
+
createdAt: event.createdAt
|
|
52
|
+
}));
|
|
53
|
+
context.evidence = [...evidence.reverse(), ...context.evidence].slice(0, 20);
|
|
54
|
+
restoreCheckpoints(context, transcript);
|
|
55
|
+
const handoff = [...transcript].reverse().find((event) => event.type === "handoff_packet");
|
|
56
|
+
if (handoff?.type === "handoff_packet" && isHandoffPacket(handoff.packet)) {
|
|
57
|
+
context.memory.lastHandoff = sanitizeHandoffPacket(handoff.packet);
|
|
58
|
+
}
|
|
59
|
+
restoreSessionAcceptedMemory(context, transcript);
|
|
60
|
+
restorePendingMemoryCandidates(context, transcript);
|
|
61
|
+
const deepCompact = [...transcript].reverse().find((event) => event.type === "deep_compact_packet");
|
|
62
|
+
if (deepCompact?.type === "deep_compact_packet" && isDeepCompactPacket(deepCompact.packet)) {
|
|
63
|
+
context.cache.compacted = true;
|
|
64
|
+
context.cache.deepCompact = deepCompact.packet;
|
|
65
|
+
}
|
|
66
|
+
const compactEvent = [...transcript].reverse().find(
|
|
67
|
+
(event) => event.type === "system_event" && event.message.startsWith(COMPACT_PROJECTION_EVENT_PREFIX)
|
|
68
|
+
);
|
|
69
|
+
if (compactEvent?.type === "system_event") {
|
|
70
|
+
const projection = parseCompactProjectionEvent(compactEvent.message);
|
|
71
|
+
if (projection) {
|
|
72
|
+
context.cache.compacted = true;
|
|
73
|
+
context.cache.compactProjection = projection;
|
|
74
|
+
if (!context.cache.compactBoundaries.some((boundary) => boundary.id === projection.boundaryId)) {
|
|
75
|
+
context.cache.compactBoundaries.push({
|
|
76
|
+
id: projection.boundaryId,
|
|
77
|
+
kind: "micro",
|
|
78
|
+
createdAt: projection.createdAt,
|
|
79
|
+
preCompactTokenEstimate: Math.ceil(projection.preCompactChars / 4),
|
|
80
|
+
postCompactTokenEstimate: Math.ceil(projection.postCompactChars / 4),
|
|
81
|
+
compactedToolResultIds: [],
|
|
82
|
+
preservedEvidenceRefs: projection.evidenceRefs,
|
|
83
|
+
preservedFiles: []
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
function restoreCheckpoints(context, transcript) {
|
|
90
|
+
const restoredIds = new Set(
|
|
91
|
+
transcript.filter((event) => {
|
|
92
|
+
return event.type === "checkpoint_restored";
|
|
93
|
+
}).map((event) => event.checkpointId)
|
|
94
|
+
);
|
|
95
|
+
context.checkpoints = context.checkpoints ?? [];
|
|
96
|
+
const known = new Set(context.checkpoints.map((checkpoint) => checkpoint.id));
|
|
97
|
+
const restored = transcript.filter((event) => {
|
|
98
|
+
return event.type === "checkpoint_created";
|
|
99
|
+
}).filter((event) => !restoredIds.has(event.checkpoint.id) && !known.has(event.checkpoint.id)).map((event) => {
|
|
100
|
+
const files = Array.isArray(event.checkpoint.files) ? event.checkpoint.files.filter(isCheckpointFile) : [];
|
|
101
|
+
const restorable = event.checkpoint.restorable === true && event.checkpoint.restoreKind === "snapshot" && files.length > 0;
|
|
102
|
+
return {
|
|
103
|
+
id: event.checkpoint.id,
|
|
104
|
+
sessionId: event.checkpoint.sessionId,
|
|
105
|
+
createdAt: event.checkpoint.createdAt,
|
|
106
|
+
reason: event.checkpoint.reason,
|
|
107
|
+
changedFiles: event.checkpoint.changedFiles,
|
|
108
|
+
restoreKind: event.checkpoint.restoreKind,
|
|
109
|
+
restorable,
|
|
110
|
+
restoreUnavailableReason: restorable ? void 0 : "checkpoint metadata was restored, but snapshot file contents are unavailable",
|
|
111
|
+
files
|
|
112
|
+
};
|
|
113
|
+
}).reverse();
|
|
114
|
+
if (restored.length > 0) {
|
|
115
|
+
context.checkpoints = [...restored, ...context.checkpoints].slice(0, 20);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
function isCheckpointFile(value) {
|
|
119
|
+
if (!isRecord(value)) return false;
|
|
120
|
+
if (typeof value.path !== "string" || typeof value.existed !== "boolean") return false;
|
|
121
|
+
return value.content === void 0 || typeof value.content === "string";
|
|
122
|
+
}
|
|
123
|
+
function restoreSessionAcceptedMemory(context, transcript) {
|
|
124
|
+
const finalActions = collectMemoryFinalActions(transcript);
|
|
125
|
+
const known = new Set(context.memory.accepted.map((item) => item.id));
|
|
126
|
+
const restored = [];
|
|
127
|
+
for (const event of transcript) {
|
|
128
|
+
if (event.type !== "memory_accepted") continue;
|
|
129
|
+
const memory = parseResumeAcceptedMemory(event.memory);
|
|
130
|
+
if (!memory) continue;
|
|
131
|
+
if (known.has(memory.id)) continue;
|
|
132
|
+
const finalAction = finalActions.get(memory.id);
|
|
133
|
+
if (finalAction && finalAction !== "accepted" && finalAction !== "rollback") continue;
|
|
134
|
+
restored.push(memory);
|
|
135
|
+
known.add(memory.id);
|
|
136
|
+
}
|
|
137
|
+
if (restored.length > 0) {
|
|
138
|
+
context.memory.accepted = [...restored.reverse(), ...context.memory.accepted];
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
function restorePendingMemoryCandidates(context, transcript) {
|
|
142
|
+
const processed = collectMemoryProcessedIds(transcript);
|
|
143
|
+
const known = new Set(
|
|
144
|
+
[
|
|
145
|
+
...context.memory.candidates,
|
|
146
|
+
...context.memory.accepted,
|
|
147
|
+
...context.memory.rejected,
|
|
148
|
+
...context.memory.disabled,
|
|
149
|
+
...context.memory.retired
|
|
150
|
+
].map((item) => item.id)
|
|
151
|
+
);
|
|
152
|
+
const restored = [];
|
|
153
|
+
for (const event of transcript) {
|
|
154
|
+
if (event.type !== "memory_candidate") continue;
|
|
155
|
+
const candidate = parseResumeMemoryCandidate(event.candidate);
|
|
156
|
+
if (!candidate) continue;
|
|
157
|
+
if (processed.has(candidate.id) || known.has(candidate.id)) continue;
|
|
158
|
+
restored.push(candidate);
|
|
159
|
+
known.add(candidate.id);
|
|
160
|
+
}
|
|
161
|
+
if (restored.length > 0) {
|
|
162
|
+
context.memory.candidates = [...restored.reverse(), ...context.memory.candidates];
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
function collectMemoryProcessedIds(transcript) {
|
|
166
|
+
const processed = /* @__PURE__ */ new Set();
|
|
167
|
+
for (const event of transcript) {
|
|
168
|
+
if (event.type === "memory_accepted") {
|
|
169
|
+
const id = readMemoryId(event.memory);
|
|
170
|
+
if (id) processed.add(id);
|
|
171
|
+
continue;
|
|
172
|
+
}
|
|
173
|
+
const lifecycle = parseMemoryLifecycleEvent(event);
|
|
174
|
+
if (lifecycle) processed.add(lifecycle.id);
|
|
175
|
+
}
|
|
176
|
+
return processed;
|
|
177
|
+
}
|
|
178
|
+
function collectMemoryFinalActions(transcript) {
|
|
179
|
+
const actions = /* @__PURE__ */ new Map();
|
|
180
|
+
for (const event of transcript) {
|
|
181
|
+
if (event.type === "memory_accepted") {
|
|
182
|
+
const id = readMemoryId(event.memory);
|
|
183
|
+
if (id) actions.set(id, "accepted");
|
|
184
|
+
continue;
|
|
185
|
+
}
|
|
186
|
+
const lifecycle = parseMemoryLifecycleEvent(event);
|
|
187
|
+
if (lifecycle) actions.set(lifecycle.id, lifecycle.action);
|
|
188
|
+
}
|
|
189
|
+
return actions;
|
|
190
|
+
}
|
|
191
|
+
function parseMemoryLifecycleEvent(event) {
|
|
192
|
+
if (event.type !== "system_event") return void 0;
|
|
193
|
+
const match = event.message.match(/\bmemory_lifecycle action=(\w+) id=([^\s]+)/u);
|
|
194
|
+
if (!match) return void 0;
|
|
195
|
+
const action = match[1];
|
|
196
|
+
if (action !== "accepted" && action !== "rejected" && action !== "disabled" && action !== "rollback" && action !== "deleted") {
|
|
197
|
+
return void 0;
|
|
198
|
+
}
|
|
199
|
+
return { action, id: match[2] };
|
|
200
|
+
}
|
|
201
|
+
function parseResumeMemoryCandidate(value) {
|
|
202
|
+
if (!isRecord(value)) return void 0;
|
|
203
|
+
if (typeof value.id !== "string" || typeof value.summary !== "string" || typeof value.source !== "string" || typeof value.createdAt !== "string") {
|
|
204
|
+
return void 0;
|
|
205
|
+
}
|
|
206
|
+
if (value.scope !== "project" && value.scope !== "user" && value.scope !== "session") {
|
|
207
|
+
return void 0;
|
|
208
|
+
}
|
|
209
|
+
if (value.status !== "candidate") {
|
|
210
|
+
return void 0;
|
|
211
|
+
}
|
|
212
|
+
const sourceRefs = Array.isArray(value.sourceRefs) ? value.sourceRefs.filter((item) => typeof item === "string") : [value.source];
|
|
213
|
+
return {
|
|
214
|
+
id: value.id,
|
|
215
|
+
scope: value.scope,
|
|
216
|
+
status: "candidate",
|
|
217
|
+
summary: value.summary,
|
|
218
|
+
source: value.source,
|
|
219
|
+
sourceRefs: sourceRefs.slice(0, 6),
|
|
220
|
+
risk: value.risk === "medium" || value.risk === "high" ? value.risk : "low",
|
|
221
|
+
inferred: value.inferred === true,
|
|
222
|
+
createdAt: value.createdAt
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
function readMemoryId(value) {
|
|
226
|
+
return isRecord(value) && typeof value.id === "string" ? value.id : void 0;
|
|
227
|
+
}
|
|
228
|
+
function parseResumeAcceptedMemory(value) {
|
|
229
|
+
if (!isRecord(value)) return void 0;
|
|
230
|
+
if (typeof value.id !== "string" || typeof value.summary !== "string" || typeof value.source !== "string" || typeof value.createdAt !== "string") {
|
|
231
|
+
return void 0;
|
|
232
|
+
}
|
|
233
|
+
if (value.scope !== "session") return void 0;
|
|
234
|
+
const sourceRefs = Array.isArray(value.sourceRefs) ? value.sourceRefs.filter((item) => typeof item === "string") : [value.source];
|
|
235
|
+
return {
|
|
236
|
+
id: value.id,
|
|
237
|
+
scope: "session",
|
|
238
|
+
status: "accepted",
|
|
239
|
+
summary: value.summary,
|
|
240
|
+
source: value.source,
|
|
241
|
+
sourceRefs: sourceRefs.slice(0, 6),
|
|
242
|
+
risk: value.risk === "medium" || value.risk === "high" ? value.risk : "low",
|
|
243
|
+
inferred: value.inferred === true,
|
|
244
|
+
createdAt: value.createdAt
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
function parseCompactProjectionEvent(message) {
|
|
248
|
+
try {
|
|
249
|
+
const parsed = JSON.parse(message.slice(COMPACT_PROJECTION_EVENT_PREFIX.length));
|
|
250
|
+
if (!isCompactProjection(parsed)) {
|
|
251
|
+
return void 0;
|
|
252
|
+
}
|
|
253
|
+
return parsed;
|
|
254
|
+
} catch {
|
|
255
|
+
return void 0;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
function isCompactProjection(value) {
|
|
259
|
+
return isRecord(value) && typeof value.boundaryId === "string" && typeof value.createdAt === "string" && typeof value.summary === "string" && typeof value.pressureRatio === "number" && typeof value.preCompactChars === "number" && typeof value.postCompactChars === "number" && typeof value.discardedRange === "string" && typeof value.toolPairingSafe === "boolean" && Array.isArray(value.risks) && Array.isArray(value.evidenceRefs);
|
|
260
|
+
}
|
|
261
|
+
async function loadOrCreateHandoffPacket(context, parentSessionId, sessionId = context.sessionId ?? "uncreated") {
|
|
262
|
+
if (context.memory.lastHandoff) {
|
|
263
|
+
const packet2 = sanitizeHandoffPacket(context.memory.lastHandoff);
|
|
264
|
+
packet2.solutionCompleteness = context.solutionCompleteness;
|
|
265
|
+
context.memory.lastHandoff = packet2;
|
|
266
|
+
await writeHandoffPacket(context, packet2);
|
|
267
|
+
return packet2;
|
|
268
|
+
}
|
|
269
|
+
const packet = createHandoffPacket(context, [], parentSessionId, sessionId);
|
|
270
|
+
context.memory.lastHandoff = packet;
|
|
271
|
+
await writeHandoffPacket(context, packet);
|
|
272
|
+
await context.store.appendEvent(sessionId, {
|
|
273
|
+
type: "handoff_packet",
|
|
274
|
+
packet,
|
|
275
|
+
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
276
|
+
});
|
|
277
|
+
return packet;
|
|
278
|
+
}
|
|
279
|
+
function createHandoffPacket(context, transcript, parentSessionId, sessionId = context.sessionId ?? "uncreated") {
|
|
280
|
+
const latestEvidence = context.evidence.slice(0, 8).map((item) => ({
|
|
281
|
+
id: item.id,
|
|
282
|
+
kind: item.kind,
|
|
283
|
+
source: item.source,
|
|
284
|
+
summary: item.summary
|
|
285
|
+
}));
|
|
286
|
+
const transcriptTodos = [...transcript].reverse().find((event) => event.type === "todo_update");
|
|
287
|
+
const todos = context.tools.todos.length > 0 ? context.tools.todos : transcriptTodos?.type === "todo_update" ? transcriptTodos.items : [];
|
|
288
|
+
return {
|
|
289
|
+
id: randomUUID(),
|
|
290
|
+
sessionId,
|
|
291
|
+
projectPath: context.projectPath,
|
|
292
|
+
...parentSessionId ? { parentSessionId } : {},
|
|
293
|
+
currentPhase: "Session handoff",
|
|
294
|
+
nextPhase: "Continue current user task",
|
|
295
|
+
phaseStatus: "in_progress",
|
|
296
|
+
goal: todos.find((item) => item.status !== "completed")?.content ?? "\u7EE7\u7EED\u5F53\u524D\u4F1A\u8BDD\u4EFB\u52A1\u3002",
|
|
297
|
+
completed: [],
|
|
298
|
+
pending: [],
|
|
299
|
+
mustNotDo: ["Do not claim completion, PASS, or verified results without recorded evidence."],
|
|
300
|
+
todos,
|
|
301
|
+
keyFiles: buildHandoffKeyFiles(context, latestEvidence),
|
|
302
|
+
changedFiles: [...new Set(context.tools.changedFiles)],
|
|
303
|
+
evidenceRefs: latestEvidence,
|
|
304
|
+
verdictEvidence: createEmptyVerdictEvidenceScope(),
|
|
305
|
+
verification: context.lastVerification ?? null,
|
|
306
|
+
risks: context.lastVerification ? context.lastVerification.risk : [],
|
|
307
|
+
indexStatus: createIndexStatusSnapshot(context.index),
|
|
308
|
+
permissionMode: context.permissionMode,
|
|
309
|
+
modelProvider: { provider: getRuntimeStatusProvider(context), model: context.model },
|
|
310
|
+
recentCommit: "unknown until git metadata is checked externally",
|
|
311
|
+
budgetUsage: "local validation only; no external provider calls; status bar does not show money",
|
|
312
|
+
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
313
|
+
generatedBy: "Linghun HandoffPacket",
|
|
314
|
+
solutionCompleteness: context.solutionCompleteness,
|
|
315
|
+
...context.currentArchitectureCard ? { currentArchitectureCard: summarizeArchitectureCard(context.currentArchitectureCard) } : {}
|
|
316
|
+
};
|
|
317
|
+
}
|
|
318
|
+
function buildHandoffKeyFiles(context, latestEvidence) {
|
|
319
|
+
const candidates = [
|
|
320
|
+
...context.tools.changedFiles,
|
|
321
|
+
...latestEvidence.map((item) => item.source),
|
|
322
|
+
...DEFAULT_HANDOFF_KEY_FILES
|
|
323
|
+
];
|
|
324
|
+
const keyFiles = [];
|
|
325
|
+
const seen = /* @__PURE__ */ new Set();
|
|
326
|
+
for (const candidate of candidates) {
|
|
327
|
+
const normalized = normalizeHandoffFileRef(candidate);
|
|
328
|
+
if (!normalized || seen.has(normalized)) continue;
|
|
329
|
+
seen.add(normalized);
|
|
330
|
+
keyFiles.push(normalized);
|
|
331
|
+
if (keyFiles.length >= HANDOFF_KEY_FILE_LIMIT) break;
|
|
332
|
+
}
|
|
333
|
+
return keyFiles;
|
|
334
|
+
}
|
|
335
|
+
function normalizeHandoffFileRef(value) {
|
|
336
|
+
const trimmed = value.trim().replaceAll("\\", "/");
|
|
337
|
+
if (!trimmed || trimmed.startsWith("[") || /^[a-z]+:/iu.test(trimmed)) return void 0;
|
|
338
|
+
if (trimmed.includes("\n") || trimmed.includes("\0")) return void 0;
|
|
339
|
+
const withoutLine = trimmed.replace(/:\d+(?::\d+)?$/u, "");
|
|
340
|
+
if (!withoutLine.includes("/") && !withoutLine.includes(".")) return void 0;
|
|
341
|
+
return withoutLine;
|
|
342
|
+
}
|
|
343
|
+
function sanitizeHandoffPacket(packet) {
|
|
344
|
+
const legacyPattern = /Runtime readiness evidence guard|Real-project Beta|Beta readiness|verdict gate|coverage matrix|systemic_gap|进入 Beta|后续路线图|readiness|blocked until explicit user confirmation/iu;
|
|
345
|
+
const sanitized = {
|
|
346
|
+
...packet,
|
|
347
|
+
currentPhase: legacyPattern.test(packet.currentPhase) ? "Session handoff" : packet.currentPhase,
|
|
348
|
+
nextPhase: legacyPattern.test(packet.nextPhase) ? "Continue current user task" : packet.nextPhase,
|
|
349
|
+
phaseStatus: legacyPattern.test(packet.currentPhase) ? "in_progress" : packet.phaseStatus,
|
|
350
|
+
goal: legacyPattern.test(packet.goal) ? "\u7EE7\u7EED\u5F53\u524D\u4F1A\u8BDD\u4EFB\u52A1\u3002" : packet.goal,
|
|
351
|
+
completed: packet.completed.filter((item) => !legacyPattern.test(item)),
|
|
352
|
+
pending: packet.pending.filter((item) => !legacyPattern.test(item)),
|
|
353
|
+
mustNotDo: packet.mustNotDo.filter((item) => !legacyPattern.test(item)),
|
|
354
|
+
risks: packet.risks.filter((item) => !legacyPattern.test(item)),
|
|
355
|
+
verdictEvidence: legacyPattern.test(JSON.stringify(packet.verdictEvidence)) ? createEmptyVerdictEvidenceScope() : packet.verdictEvidence
|
|
356
|
+
};
|
|
357
|
+
return sanitized;
|
|
358
|
+
}
|
|
359
|
+
function createEmptyVerdictEvidenceScope() {
|
|
360
|
+
return {
|
|
361
|
+
scope: "beta",
|
|
362
|
+
status: "PARTIAL",
|
|
363
|
+
evidenceRefs: [],
|
|
364
|
+
validationCommands: [],
|
|
365
|
+
uncoveredItems: [],
|
|
366
|
+
residualRisks: [],
|
|
367
|
+
nextAction: "Continue from current task evidence and runtime state."
|
|
368
|
+
};
|
|
369
|
+
}
|
|
370
|
+
function validateHandoffPacket(packet) {
|
|
371
|
+
const missing = [];
|
|
372
|
+
if (!packet.id) missing.push("id");
|
|
373
|
+
if (!packet.sessionId) missing.push("sessionId");
|
|
374
|
+
if (!packet.projectPath) missing.push("projectPath");
|
|
375
|
+
if (!packet.verification) missing.push("verification");
|
|
376
|
+
if (packet.evidenceRefs.length === 0) missing.push("evidenceRefs");
|
|
377
|
+
if (packet.mustNotDo.length === 0) missing.push("mustNotDo");
|
|
378
|
+
if (!packet.indexStatus.status || packet.indexStatus.status === "unknown")
|
|
379
|
+
missing.push("indexStatus");
|
|
380
|
+
return missing;
|
|
381
|
+
}
|
|
382
|
+
function isHandoffPacket(value) {
|
|
383
|
+
return isRecord(value) && typeof value.id === "string" && typeof value.sessionId === "string" && typeof value.projectPath === "string" && typeof value.currentPhase === "string" && typeof value.nextPhase === "string" && Array.isArray(value.mustNotDo) && Array.isArray(value.evidenceRefs);
|
|
384
|
+
}
|
|
385
|
+
function formatResumePacket(packet, missing, context) {
|
|
386
|
+
return [
|
|
387
|
+
"Resume context package\uFF08\u6458\u8981\uFF0C\u4E0D\u542B\u5B8C\u6574\u5386\u53F2\uFF09\uFF1A",
|
|
388
|
+
`- projectRules: ${formatProjectRulesContext(context)}`,
|
|
389
|
+
`- currentPhase: ${packet.currentPhase}`,
|
|
390
|
+
`- phaseStatus: ${packet.phaseStatus}`,
|
|
391
|
+
`- goal: ${packet.goal}`,
|
|
392
|
+
`- todos: ${packet.todos.length}`,
|
|
393
|
+
`- evidenceRefs: ${packet.evidenceRefs.length}`,
|
|
394
|
+
`- keyFiles: ${packet.keyFiles.join(", ")}`,
|
|
395
|
+
`- verification: ${packet.verification?.status ?? "missing"}`,
|
|
396
|
+
`- indexStatus: ${formatIndexRuntimeRef(packet.indexStatus)}`,
|
|
397
|
+
`- readonly: ${missing.length > 0 ? `yes (${missing.join(", ")})` : "no"}`,
|
|
398
|
+
context.memory.projectRulesError ? `- projectRules warning: ${context.memory.projectRulesError}` : "- projectRules warning: none",
|
|
399
|
+
missing.length > 0 ? "- \u4E0B\u4E00\u6B65\uFF1A\u8865\u9F50 handoff \u5173\u952E\u5B57\u6BB5\u6216\u5148\u53EA\u8BFB\u68C0\u67E5 /index status\u3001/memory review\u3001/verify last\u3002" : "- \u4E0B\u4E00\u6B65\uFF1A\u53EF\u57FA\u4E8E\u6458\u8981\u3001Todo\u3001\u8BC1\u636E\u548C\u5173\u952E\u6587\u4EF6\u7EE7\u7EED\u3002"
|
|
400
|
+
].join("\n");
|
|
401
|
+
}
|
|
402
|
+
async function writeHandoffPacket(context, packet) {
|
|
403
|
+
await mkdir(context.memory.sessionDir, { recursive: true });
|
|
404
|
+
await writeFile(
|
|
405
|
+
join(context.memory.sessionDir, "handoff-latest.json"),
|
|
406
|
+
`${JSON.stringify(packet, null, 2)}
|
|
407
|
+
`,
|
|
408
|
+
"utf8"
|
|
409
|
+
);
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
export {
|
|
413
|
+
hydrateResumeContext,
|
|
414
|
+
loadOrCreateHandoffPacket,
|
|
415
|
+
createHandoffPacket,
|
|
416
|
+
validateHandoffPacket,
|
|
417
|
+
isHandoffPacket,
|
|
418
|
+
formatResumePacket,
|
|
419
|
+
writeHandoffPacket
|
|
420
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// src/shell/components/CtrlOToExpand.tsx
|
|
2
|
+
import { Text } from "@linghun/ink-runtime";
|
|
3
|
+
import { createContext, useContext } from "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
var SubAgentContext = createContext(false);
|
|
6
|
+
var InVirtualListContext = createContext(false);
|
|
7
|
+
function useInSubAgent() {
|
|
8
|
+
return useContext(SubAgentContext);
|
|
9
|
+
}
|
|
10
|
+
function useInVirtualList() {
|
|
11
|
+
return useContext(InVirtualListContext);
|
|
12
|
+
}
|
|
13
|
+
function SubAgentProvider({
|
|
14
|
+
children
|
|
15
|
+
}) {
|
|
16
|
+
return /* @__PURE__ */ jsx(SubAgentContext.Provider, { value: true, children });
|
|
17
|
+
}
|
|
18
|
+
function VirtualListProvider({
|
|
19
|
+
children
|
|
20
|
+
}) {
|
|
21
|
+
return /* @__PURE__ */ jsx(InVirtualListContext.Provider, { value: true, children });
|
|
22
|
+
}
|
|
23
|
+
function CtrlOToExpand({
|
|
24
|
+
theme,
|
|
25
|
+
hint,
|
|
26
|
+
hidden = false
|
|
27
|
+
}) {
|
|
28
|
+
const inSubAgent = useInSubAgent();
|
|
29
|
+
const inVirtualList = useInVirtualList();
|
|
30
|
+
if (hidden || inSubAgent || inVirtualList) return null;
|
|
31
|
+
if (!hint || hint.trim().length === 0) return null;
|
|
32
|
+
return /* @__PURE__ */ jsx(Text, { color: theme.dim ?? theme.muted, dimColor: true, children: hint });
|
|
33
|
+
}
|
|
34
|
+
function ctrlOToExpandString(hint, suppressed = false) {
|
|
35
|
+
if (suppressed) return "";
|
|
36
|
+
if (!hint || hint.trim().length === 0) return "";
|
|
37
|
+
return hint;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export {
|
|
41
|
+
useInSubAgent,
|
|
42
|
+
useInVirtualList,
|
|
43
|
+
SubAgentProvider,
|
|
44
|
+
VirtualListProvider,
|
|
45
|
+
CtrlOToExpand,
|
|
46
|
+
ctrlOToExpandString
|
|
47
|
+
};
|