@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,526 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PASS_BANNED_EVIDENCE_KINDS
|
|
3
|
+
} from "./chunk-GCMH5P4W.js";
|
|
4
|
+
|
|
5
|
+
// src/workflow-agent-runtime-bridge.ts
|
|
6
|
+
var ELIGIBLE_SLICE_STATUSES = /* @__PURE__ */ new Set(["queued", "created", "sleeping"]);
|
|
7
|
+
var SAFE_CONTEXT_REF_KINDS = /* @__PURE__ */ new Set([
|
|
8
|
+
"evidence",
|
|
9
|
+
"workspace_cache",
|
|
10
|
+
"file",
|
|
11
|
+
"architecture"
|
|
12
|
+
]);
|
|
13
|
+
function decideWorkflowStepCapability(input) {
|
|
14
|
+
if (!input.target) {
|
|
15
|
+
return { ok: false, reason: "missing structured targetRuntime" };
|
|
16
|
+
}
|
|
17
|
+
if (containsRawCommand(input.target)) {
|
|
18
|
+
return { ok: false, reason: "raw command strings are rejected by the workflow bridge" };
|
|
19
|
+
}
|
|
20
|
+
if (input.permissionMode === "plan" && input.target.mutating) {
|
|
21
|
+
return {
|
|
22
|
+
ok: false,
|
|
23
|
+
reason: "plan mode cannot produce executable mutating workflow proposals"
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
if (!input.request) {
|
|
27
|
+
return {
|
|
28
|
+
ok: false,
|
|
29
|
+
reason: "targetRuntime is outside the D.14H-C bridge allowlist"
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
if (input.target.mutating && !input.phaseStopPointConfirmed) {
|
|
33
|
+
return {
|
|
34
|
+
ok: false,
|
|
35
|
+
reason: "phase stopPoint must be confirmed before a mutating request becomes runnable"
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
return { ok: true, reason: "workflow step is executable through the existing main chain" };
|
|
39
|
+
}
|
|
40
|
+
function bridgeWorkflowPlanToMainChainRequests(plan, options = {}) {
|
|
41
|
+
const phases = plan.phases;
|
|
42
|
+
const currentPhase = selectCurrentPhase(phases, plan.currentPhaseId, options.currentPhaseId);
|
|
43
|
+
const currentPhaseId = currentPhase?.id ?? options.currentPhaseId ?? plan.currentPhaseId ?? "";
|
|
44
|
+
const runningCap = normalizeRunningCap(options.runningCap ?? plan.budget.maxRunningAgents) ?? deriveBridgeRunningCap(currentPhase);
|
|
45
|
+
const confirmedStopPoints = new Set(options.confirmedPhaseStopPoints ?? []);
|
|
46
|
+
const phaseStopPointConfirmed = confirmedStopPoints.has(currentPhaseId);
|
|
47
|
+
const phaseStatuses = phases.map((phase) => ({
|
|
48
|
+
phaseId: phase.id,
|
|
49
|
+
status: phase.status,
|
|
50
|
+
current: phase.id === currentPhaseId
|
|
51
|
+
}));
|
|
52
|
+
if (!currentPhase) {
|
|
53
|
+
return {
|
|
54
|
+
workflowId: plan.id,
|
|
55
|
+
currentPhaseId,
|
|
56
|
+
runningCap,
|
|
57
|
+
runnableSlots: 0,
|
|
58
|
+
phaseStopPointConfirmed,
|
|
59
|
+
requests: [],
|
|
60
|
+
phaseStatuses,
|
|
61
|
+
summary: emptySummary()
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
let runnableSlots = Math.max(
|
|
65
|
+
0,
|
|
66
|
+
runningCap - currentPhase.slices.filter((slice) => slice.status === "running").length
|
|
67
|
+
);
|
|
68
|
+
if (options.blockedProviderKeys && options.blockedProviderKeys.size > 0) {
|
|
69
|
+
runnableSlots = Math.min(runnableSlots, 1);
|
|
70
|
+
}
|
|
71
|
+
const initialRunnableSlots = runnableSlots;
|
|
72
|
+
const requests = currentPhase.slices.map((slice) => {
|
|
73
|
+
const contextRefs = createContextRefs(plan, slice);
|
|
74
|
+
const target = slice.targetRuntime;
|
|
75
|
+
const safety = createSafety(slice.role, target);
|
|
76
|
+
const base = {
|
|
77
|
+
id: `${plan.id}:${currentPhase.id}:${slice.id}`,
|
|
78
|
+
proposalOnly: true,
|
|
79
|
+
workflowId: plan.id,
|
|
80
|
+
phaseId: currentPhase.id,
|
|
81
|
+
sliceId: slice.id,
|
|
82
|
+
handoffProposal: contextRefs
|
|
83
|
+
};
|
|
84
|
+
const blockedReason = getBlockedReason(phases, currentPhase.id, slice.id);
|
|
85
|
+
if (blockedReason) {
|
|
86
|
+
return createProposal(base, {
|
|
87
|
+
status: "blocked",
|
|
88
|
+
reason: blockedReason,
|
|
89
|
+
executable: false,
|
|
90
|
+
request: null,
|
|
91
|
+
safety,
|
|
92
|
+
phase: currentPhase.title,
|
|
93
|
+
sliceTitle: slice.title,
|
|
94
|
+
nextAction: slice.nextAction ?? blockedReason,
|
|
95
|
+
contextRefs
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
if (!ELIGIBLE_SLICE_STATUSES.has(slice.status)) {
|
|
99
|
+
return createProposal(base, {
|
|
100
|
+
status: "status_only",
|
|
101
|
+
reason: `slice status is ${slice.status}; bridge does not convert it into execution`,
|
|
102
|
+
executable: false,
|
|
103
|
+
request: null,
|
|
104
|
+
safety,
|
|
105
|
+
phase: currentPhase.title,
|
|
106
|
+
sliceTitle: slice.title,
|
|
107
|
+
nextAction: slice.nextAction ?? "Inspect status before requesting another action.",
|
|
108
|
+
contextRefs
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
const request = createMainChainRequest(plan, currentPhase.id, currentPhase.title, slice);
|
|
112
|
+
const capability = decideWorkflowStepCapability({
|
|
113
|
+
permissionMode: plan.permissionMode,
|
|
114
|
+
phaseStopPointConfirmed,
|
|
115
|
+
target,
|
|
116
|
+
request
|
|
117
|
+
});
|
|
118
|
+
if (!capability.ok && capability.reason === "missing structured targetRuntime") {
|
|
119
|
+
return createProposal(base, {
|
|
120
|
+
status: "blocked",
|
|
121
|
+
reason: capability.reason,
|
|
122
|
+
executable: false,
|
|
123
|
+
request: null,
|
|
124
|
+
safety,
|
|
125
|
+
phase: currentPhase.title,
|
|
126
|
+
sliceTitle: slice.title,
|
|
127
|
+
nextAction: slice.nextAction ?? "Add a structured main-chain target.",
|
|
128
|
+
contextRefs
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
if (!capability.ok && capability.reason.includes("raw command strings")) {
|
|
132
|
+
return createProposal(base, {
|
|
133
|
+
status: "blocked",
|
|
134
|
+
reason: capability.reason,
|
|
135
|
+
executable: false,
|
|
136
|
+
request: null,
|
|
137
|
+
safety,
|
|
138
|
+
phase: currentPhase.title,
|
|
139
|
+
sliceTitle: slice.title,
|
|
140
|
+
nextAction: "Replace raw command text with a structured main-chain target.",
|
|
141
|
+
contextRefs
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
if (!capability.ok && capability.reason.includes("plan mode")) {
|
|
145
|
+
return createProposal(base, {
|
|
146
|
+
status: "blocked",
|
|
147
|
+
reason: capability.reason,
|
|
148
|
+
executable: false,
|
|
149
|
+
request: null,
|
|
150
|
+
safety,
|
|
151
|
+
phase: currentPhase.title,
|
|
152
|
+
sliceTitle: slice.title,
|
|
153
|
+
nextAction: "Leave plan mode through the existing approval path before mutating actions.",
|
|
154
|
+
contextRefs
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
if (!capability.ok && capability.reason.includes("allowlist")) {
|
|
158
|
+
return createProposal(base, {
|
|
159
|
+
status: "blocked",
|
|
160
|
+
reason: capability.reason,
|
|
161
|
+
executable: false,
|
|
162
|
+
request: null,
|
|
163
|
+
safety,
|
|
164
|
+
phase: currentPhase.title,
|
|
165
|
+
sliceTitle: slice.title,
|
|
166
|
+
nextAction: "Use /job create|run|status|report, /fork, /agents list|show, verification, or details.",
|
|
167
|
+
contextRefs
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
if (!capability.ok && capability.reason.includes("stopPoint")) {
|
|
171
|
+
return createProposal(base, {
|
|
172
|
+
status: "start_gate_needed",
|
|
173
|
+
reason: capability.reason,
|
|
174
|
+
executable: false,
|
|
175
|
+
request,
|
|
176
|
+
safety,
|
|
177
|
+
phase: currentPhase.title,
|
|
178
|
+
sliceTitle: slice.title,
|
|
179
|
+
nextAction: slice.nextAction ?? currentPhase.stopPoint.reason,
|
|
180
|
+
contextRefs,
|
|
181
|
+
startGateProposal: {
|
|
182
|
+
kind: "start-gate-proposal",
|
|
183
|
+
reason: currentPhase.stopPoint.reason,
|
|
184
|
+
scope: `${currentPhase.title} / ${slice.title}`,
|
|
185
|
+
requiresExactConfirmation: true,
|
|
186
|
+
doesNotReplacePermissionPipeline: true
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
if (!target) {
|
|
191
|
+
return createProposal(base, {
|
|
192
|
+
status: "blocked",
|
|
193
|
+
reason: "missing structured targetRuntime",
|
|
194
|
+
executable: false,
|
|
195
|
+
request: null,
|
|
196
|
+
safety,
|
|
197
|
+
phase: currentPhase.title,
|
|
198
|
+
sliceTitle: slice.title,
|
|
199
|
+
nextAction: slice.nextAction ?? "Add a structured main-chain target.",
|
|
200
|
+
contextRefs
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
if (target.mutating && hasArchitectureBoundaryRisk(plan, slice)) {
|
|
204
|
+
return createProposal(base, {
|
|
205
|
+
status: "blocked",
|
|
206
|
+
reason: "architecture boundary risk blocks mutating workflow step",
|
|
207
|
+
executable: false,
|
|
208
|
+
request: null,
|
|
209
|
+
safety,
|
|
210
|
+
phase: currentPhase.title,
|
|
211
|
+
sliceTitle: slice.title,
|
|
212
|
+
nextAction: "Review architecture findings before running the mutating step.",
|
|
213
|
+
contextRefs
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
if (target.mutating && runnableSlots <= 0) {
|
|
217
|
+
return createProposal(base, {
|
|
218
|
+
status: "queued",
|
|
219
|
+
reason: `running cap ${runningCap} reached; slice remains queued/sleeping`,
|
|
220
|
+
executable: false,
|
|
221
|
+
request: null,
|
|
222
|
+
safety,
|
|
223
|
+
phase: currentPhase.title,
|
|
224
|
+
sliceTitle: slice.title,
|
|
225
|
+
nextAction: "Wait for an existing agent/job to finish or inspect /agents and /job status.",
|
|
226
|
+
contextRefs
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
if (target.mutating) {
|
|
230
|
+
runnableSlots -= 1;
|
|
231
|
+
}
|
|
232
|
+
return createProposal(base, {
|
|
233
|
+
status: target.mutating ? "runnable" : "readonly",
|
|
234
|
+
reason: target.mutating ? "eligible slice converted into a proposal for the existing main chain" : "readonly target converted into a readonly main-chain proposal",
|
|
235
|
+
executable: true,
|
|
236
|
+
request,
|
|
237
|
+
safety,
|
|
238
|
+
phase: currentPhase.title,
|
|
239
|
+
sliceTitle: slice.title,
|
|
240
|
+
nextAction: slice.nextAction ?? "Hand this proposal to the existing main-chain dispatcher.",
|
|
241
|
+
contextRefs
|
|
242
|
+
});
|
|
243
|
+
});
|
|
244
|
+
return {
|
|
245
|
+
workflowId: plan.id,
|
|
246
|
+
currentPhaseId,
|
|
247
|
+
runningCap,
|
|
248
|
+
runnableSlots: initialRunnableSlots,
|
|
249
|
+
phaseStopPointConfirmed,
|
|
250
|
+
requests,
|
|
251
|
+
phaseStatuses,
|
|
252
|
+
summary: summarizeRequests(requests)
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
function createProposal(base, input) {
|
|
256
|
+
const permissionProposal = input.safety.requiresPermissionPipeline || input.safety.requiredPermissionAction !== "none" ? {
|
|
257
|
+
kind: "permission-proposal",
|
|
258
|
+
requiredPermissionAction: input.safety.requiredPermissionAction,
|
|
259
|
+
via: "decidePermission-or-pendingLocalApproval",
|
|
260
|
+
bypassed: false
|
|
261
|
+
} : void 0;
|
|
262
|
+
return {
|
|
263
|
+
...base,
|
|
264
|
+
status: input.status,
|
|
265
|
+
reason: input.reason,
|
|
266
|
+
executable: input.executable,
|
|
267
|
+
request: input.request,
|
|
268
|
+
safety: input.safety,
|
|
269
|
+
startGateProposal: input.startGateProposal,
|
|
270
|
+
permissionProposal,
|
|
271
|
+
backgroundProjection: createBackgroundProjection(input),
|
|
272
|
+
taskSurfaceInput: {
|
|
273
|
+
phaseId: base.phaseId,
|
|
274
|
+
sliceId: base.sliceId,
|
|
275
|
+
requestStatus: input.status,
|
|
276
|
+
tokenEstimate: getRequestTokenEstimate(input.request),
|
|
277
|
+
durationEstimateMs: getRequestDurationEstimate(input.request),
|
|
278
|
+
evidenceRefs: input.contextRefs.evidenceRefs.map((ref) => ref.ref),
|
|
279
|
+
nextAction: input.nextAction
|
|
280
|
+
}
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
function createBackgroundProjection(input) {
|
|
284
|
+
const kind = input.request?.mainChain === "job" ? "job" : input.request?.mainChain === "fork" ? "agent" : input.request?.mainChain === "agents" || input.request?.mainChain === "workflows" ? "verification" : "verification";
|
|
285
|
+
return {
|
|
286
|
+
source: "background-task-projection",
|
|
287
|
+
kind,
|
|
288
|
+
jobAgentStatus: mapRequestStatusToJobAgentStatus(input.status),
|
|
289
|
+
userVisibleSummary: `${input.phase} / ${input.sliceTitle}: ${input.status}`,
|
|
290
|
+
nextAction: input.nextAction
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
function createMainChainRequest(plan, phaseId, phaseTitle, slice) {
|
|
294
|
+
const target = slice.targetRuntime;
|
|
295
|
+
if (!target) return null;
|
|
296
|
+
if (target.kind === "slash" && target.slash === "/job") {
|
|
297
|
+
if (!["list", "create", "run", "status", "report", "logs", "pause", "resume", "cancel"].includes(
|
|
298
|
+
target.action
|
|
299
|
+
))
|
|
300
|
+
return null;
|
|
301
|
+
const action = target.action;
|
|
302
|
+
const mutating = ["create", "run", "pause", "resume", "cancel"].includes(target.action);
|
|
303
|
+
return {
|
|
304
|
+
mainChain: "job",
|
|
305
|
+
action: target.action,
|
|
306
|
+
workflowId: plan.id,
|
|
307
|
+
phaseId,
|
|
308
|
+
sliceId: slice.id,
|
|
309
|
+
goal: mutating ? slice.nextAction ?? slice.title : void 0,
|
|
310
|
+
jobRef: target.action === "status" || target.action === "report" || target.action === "logs" || target.action === "pause" || target.action === "resume" || target.action === "cancel" ? slice.nextAction ?? "latest" : void 0,
|
|
311
|
+
phase: phaseTitle,
|
|
312
|
+
target: "workflow-agent-runtime-bridge",
|
|
313
|
+
requestedAgents: slice.budget?.requestedAgents,
|
|
314
|
+
runningCap: slice.budget?.maxRunningAgents,
|
|
315
|
+
maxTokens: slice.budget?.maxTokens,
|
|
316
|
+
maxDurationMs: slice.budget?.maxDurationMs
|
|
317
|
+
};
|
|
318
|
+
}
|
|
319
|
+
if (target.kind === "slash" && target.slash === "/fork") {
|
|
320
|
+
return {
|
|
321
|
+
mainChain: "fork",
|
|
322
|
+
role: target.role,
|
|
323
|
+
task: slice.nextAction ?? slice.title,
|
|
324
|
+
workflowId: plan.id,
|
|
325
|
+
phaseId,
|
|
326
|
+
sliceId: slice.id,
|
|
327
|
+
contextRefs: createContextRefs(plan, slice)
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
if (target.kind === "slash" && target.slash === "/agents") {
|
|
331
|
+
if (!["list", "show", "cancel"].includes(target.action)) return null;
|
|
332
|
+
return {
|
|
333
|
+
mainChain: "agents",
|
|
334
|
+
action: target.action,
|
|
335
|
+
workflowId: plan.id,
|
|
336
|
+
phaseId,
|
|
337
|
+
sliceId: slice.id,
|
|
338
|
+
agentRef: target.action === "show" || target.action === "cancel" ? slice.nextAction : void 0
|
|
339
|
+
};
|
|
340
|
+
}
|
|
341
|
+
if (target.kind === "slash" && target.slash === "/workflows") {
|
|
342
|
+
if (!["list", "start_gate"].includes(target.action)) return null;
|
|
343
|
+
return {
|
|
344
|
+
mainChain: "workflows",
|
|
345
|
+
action: target.action,
|
|
346
|
+
workflowId: plan.id,
|
|
347
|
+
phaseId,
|
|
348
|
+
sliceId: slice.id,
|
|
349
|
+
goal: target.action === "start_gate" ? slice.nextAction ?? slice.title : void 0
|
|
350
|
+
};
|
|
351
|
+
}
|
|
352
|
+
if (target.kind === "verification") {
|
|
353
|
+
return {
|
|
354
|
+
mainChain: "verification",
|
|
355
|
+
level: target.level,
|
|
356
|
+
workflowId: plan.id,
|
|
357
|
+
phaseId,
|
|
358
|
+
sliceId: slice.id,
|
|
359
|
+
evidenceRefs: slice.evidence.map((item) => item.ref)
|
|
360
|
+
};
|
|
361
|
+
}
|
|
362
|
+
if (target.kind === "details") {
|
|
363
|
+
return {
|
|
364
|
+
mainChain: "details",
|
|
365
|
+
view: target.view,
|
|
366
|
+
workflowId: plan.id,
|
|
367
|
+
phaseId,
|
|
368
|
+
sliceId: slice.id,
|
|
369
|
+
refs: slice.references.map((ref) => ref.ref)
|
|
370
|
+
};
|
|
371
|
+
}
|
|
372
|
+
return null;
|
|
373
|
+
}
|
|
374
|
+
function createSafety(role, target) {
|
|
375
|
+
const mutating = Boolean(target?.mutating);
|
|
376
|
+
return {
|
|
377
|
+
readonly: !mutating,
|
|
378
|
+
mutating,
|
|
379
|
+
requiresStartGate: mutating,
|
|
380
|
+
requiresPermissionPipeline: mutating,
|
|
381
|
+
requiredPermissionAction: inferPermissionAction(role, target),
|
|
382
|
+
evidencePolicy: "neverTreatCompletionAsPass"
|
|
383
|
+
};
|
|
384
|
+
}
|
|
385
|
+
function hasArchitectureBoundaryRisk(plan, slice) {
|
|
386
|
+
if (slice.evidence.some(
|
|
387
|
+
(item) => item.passEvidence === false && isArchitectureRiskText(`${item.kind} ${item.ref} ${item.claim}`)
|
|
388
|
+
)) {
|
|
389
|
+
return true;
|
|
390
|
+
}
|
|
391
|
+
return [...slice.references, ...plan.references ?? []].some(
|
|
392
|
+
(item) => isArchitectureRiskReference(`${item.kind} ${item.ref} ${item.summary ?? ""}`)
|
|
393
|
+
);
|
|
394
|
+
}
|
|
395
|
+
function isArchitectureRiskReference(value) {
|
|
396
|
+
if (/\b(?:no architecture risk|no risk|passed|pass|clean|ok)\b/iu.test(value)) return false;
|
|
397
|
+
if (/无风险|已通过|通过|未发现(?:架构)?风险/u.test(value)) return false;
|
|
398
|
+
return isArchitectureRiskText(value);
|
|
399
|
+
}
|
|
400
|
+
function isArchitectureRiskText(value) {
|
|
401
|
+
return /architecture/iu.test(value) && /\b(?:risk|violation|boundary|god-file|code-blob|large-file)\b/iu.test(value);
|
|
402
|
+
}
|
|
403
|
+
function inferPermissionAction(role, target) {
|
|
404
|
+
if (!target?.mutating) return "none";
|
|
405
|
+
if (target.kind === "slash" && target.slash === "/fork" && role === "worker") return "Write";
|
|
406
|
+
return "none";
|
|
407
|
+
}
|
|
408
|
+
function createContextRefs(plan, slice) {
|
|
409
|
+
const refs = [...plan.references ?? [], ...slice.references];
|
|
410
|
+
const boundedRefs = refs.filter((ref) => SAFE_CONTEXT_REF_KINDS.has(ref.kind)).map((ref) => ({
|
|
411
|
+
kind: ref.kind,
|
|
412
|
+
ref: truncateText(ref.ref, 240),
|
|
413
|
+
summary: ref.summary ? truncateText(ref.summary, 300) : void 0
|
|
414
|
+
})).slice(0, 20);
|
|
415
|
+
const droppedRefKinds = Array.from(
|
|
416
|
+
new Set(refs.filter((ref) => !SAFE_CONTEXT_REF_KINDS.has(ref.kind)).map((ref) => ref.kind))
|
|
417
|
+
);
|
|
418
|
+
const workspaceCacheRefs = boundedRefs.filter((ref) => ref.kind === "workspace_cache").map((ref) => ref.ref);
|
|
419
|
+
const keyFilesSummary = boundedRefs.filter((ref) => ref.kind === "file").map((ref) => ref.summary ?? ref.ref).slice(0, 8);
|
|
420
|
+
const evidenceRefs = [...plan.evidence ?? [], ...slice.evidence].map((item) => ({
|
|
421
|
+
ref: truncateText(item.ref, 240),
|
|
422
|
+
kind: item.kind,
|
|
423
|
+
claim: truncateText(item.claim, 300),
|
|
424
|
+
passEvidenceAllowed: item.passEvidence === true && !PASS_BANNED_EVIDENCE_KINDS.has(item.kind)
|
|
425
|
+
})).slice(0, 20);
|
|
426
|
+
return {
|
|
427
|
+
boundedRefs,
|
|
428
|
+
workspaceCacheRefs,
|
|
429
|
+
evidenceRefs,
|
|
430
|
+
keyFilesSummary,
|
|
431
|
+
droppedRefKinds,
|
|
432
|
+
notIncluded: [
|
|
433
|
+
"full transcript",
|
|
434
|
+
"full source",
|
|
435
|
+
"full index",
|
|
436
|
+
"full log",
|
|
437
|
+
"provider/env/key/model route changes"
|
|
438
|
+
]
|
|
439
|
+
};
|
|
440
|
+
}
|
|
441
|
+
function selectCurrentPhase(phases, planCurrentPhaseId, explicitPhaseId) {
|
|
442
|
+
const phaseId = explicitPhaseId ?? planCurrentPhaseId;
|
|
443
|
+
return phases.find((phase) => phase.id === phaseId) ?? phases.find((phase) => phase.status === "running" || phase.status === "blocked") ?? phases[0];
|
|
444
|
+
}
|
|
445
|
+
function getBlockedReason(phases, phaseId, sliceId) {
|
|
446
|
+
const phase = phases.find((item) => item.id === phaseId);
|
|
447
|
+
const slice = phase?.slices.find((item) => item.id === sliceId);
|
|
448
|
+
if (!phase || !slice) return "unknown phase or slice";
|
|
449
|
+
const phaseDeps = phase.dependsOnPhaseIds ?? [];
|
|
450
|
+
const unsatisfiedPhaseDep = phaseDeps.find(
|
|
451
|
+
(depId) => phases.find((item) => item.id === depId)?.status !== "completed"
|
|
452
|
+
);
|
|
453
|
+
if (unsatisfiedPhaseDep) {
|
|
454
|
+
return `phase dependency not satisfied: ${unsatisfiedPhaseDep}`;
|
|
455
|
+
}
|
|
456
|
+
const allSlices = new Map(phases.flatMap((item) => item.slices.map((s) => [s.id, s])));
|
|
457
|
+
const unsatisfiedSliceDep = (slice.dependsOnSliceIds ?? []).find((depId) => {
|
|
458
|
+
const status = allSlices.get(depId)?.status;
|
|
459
|
+
return status !== "completed" && status !== "partial";
|
|
460
|
+
});
|
|
461
|
+
return unsatisfiedSliceDep ? `slice dependency not satisfied: ${unsatisfiedSliceDep}` : null;
|
|
462
|
+
}
|
|
463
|
+
function containsRawCommand(value) {
|
|
464
|
+
if (!value || typeof value !== "object") return false;
|
|
465
|
+
if (Array.isArray(value)) return value.some(containsRawCommand);
|
|
466
|
+
return Object.entries(value).some(([key, child]) => {
|
|
467
|
+
const lowered = key.toLowerCase();
|
|
468
|
+
if ((lowered === "command" || lowered === "rawcommand") && typeof child === "string") {
|
|
469
|
+
return true;
|
|
470
|
+
}
|
|
471
|
+
return containsRawCommand(child);
|
|
472
|
+
});
|
|
473
|
+
}
|
|
474
|
+
function mapRequestStatusToJobAgentStatus(status) {
|
|
475
|
+
if (status === "runnable" || status === "readonly") return "queued";
|
|
476
|
+
if (status === "queued" || status === "start_gate_needed") return "queued";
|
|
477
|
+
if (status === "blocked") return "blocked";
|
|
478
|
+
return "created";
|
|
479
|
+
}
|
|
480
|
+
function getRequestTokenEstimate(request) {
|
|
481
|
+
return request?.mainChain === "job" ? request.maxTokens : void 0;
|
|
482
|
+
}
|
|
483
|
+
function getRequestDurationEstimate(request) {
|
|
484
|
+
return request?.mainChain === "job" ? request.maxDurationMs : void 0;
|
|
485
|
+
}
|
|
486
|
+
function normalizeRunningCap(value) {
|
|
487
|
+
if (!Number.isFinite(value) || value === void 0 || value < 1) {
|
|
488
|
+
return void 0;
|
|
489
|
+
}
|
|
490
|
+
return Math.max(1, Math.floor(value));
|
|
491
|
+
}
|
|
492
|
+
function deriveBridgeRunningCap(phase) {
|
|
493
|
+
if (!phase) return 1;
|
|
494
|
+
return Math.max(1, phase.slices.length);
|
|
495
|
+
}
|
|
496
|
+
function summarizeRequests(requests) {
|
|
497
|
+
return requests.reduce((summary, request) => {
|
|
498
|
+
if (request.status === "runnable") summary.runnable += 1;
|
|
499
|
+
if (request.status === "readonly") summary.readonly += 1;
|
|
500
|
+
if (request.status === "start_gate_needed") summary.startGateNeeded += 1;
|
|
501
|
+
if (request.status === "blocked") summary.blocked += 1;
|
|
502
|
+
if (request.status === "queued") summary.queued += 1;
|
|
503
|
+
if (request.status === "status_only") summary.statusOnly += 1;
|
|
504
|
+
return summary;
|
|
505
|
+
}, emptySummary());
|
|
506
|
+
}
|
|
507
|
+
function emptySummary() {
|
|
508
|
+
return {
|
|
509
|
+
runnable: 0,
|
|
510
|
+
readonly: 0,
|
|
511
|
+
startGateNeeded: 0,
|
|
512
|
+
blocked: 0,
|
|
513
|
+
queued: 0,
|
|
514
|
+
statusOnly: 0
|
|
515
|
+
};
|
|
516
|
+
}
|
|
517
|
+
function truncateText(text, max) {
|
|
518
|
+
const compact = text.replace(/\s+/gu, " ").trim();
|
|
519
|
+
if (compact.length <= max) return compact;
|
|
520
|
+
return `${compact.slice(0, Math.max(0, max - 1))}\u2026`;
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
export {
|
|
524
|
+
decideWorkflowStepCapability,
|
|
525
|
+
bridgeWorkflowPlanToMainChainRequests
|
|
526
|
+
};
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createShellTheme
|
|
3
|
+
} from "./chunk-GC55DMZV.js";
|
|
4
|
+
import {
|
|
5
|
+
fitText,
|
|
6
|
+
wrapText
|
|
7
|
+
} from "./chunk-APJIC2O5.js";
|
|
8
|
+
|
|
9
|
+
// src/shell/components/ConfigPanel.tsx
|
|
10
|
+
import { Box, Text, useInput } from "@linghun/ink-runtime";
|
|
11
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
+
var MAX_VISIBLE = 10;
|
|
13
|
+
var MIN_PANEL_WIDTH = 64;
|
|
14
|
+
var MAX_PANEL_WIDTH = 108;
|
|
15
|
+
var HINT_TEXT = {
|
|
16
|
+
"zh-CN": {
|
|
17
|
+
list: "\u2191\u2193 \u9009\u62E9 \xB7 Enter \u8FDB\u5165 \xB7 Esc \u5173\u95ED",
|
|
18
|
+
detail: "\u2191\u2193 \u9009\u62E9 \xB7 Enter \u6267\u884C \xB7 Esc \u8FD4\u56DE",
|
|
19
|
+
count: (start, end, total) => `\u7B2C ${start}-${end} \u9879\uFF0C\u5171 ${total} \u9879`
|
|
20
|
+
},
|
|
21
|
+
"en-US": {
|
|
22
|
+
list: "\u2191\u2193 select \xB7 Enter open \xB7 Esc close",
|
|
23
|
+
detail: "\u2191\u2193 select \xB7 Enter dispatch \xB7 Esc back",
|
|
24
|
+
count: (start, end, total) => `${start}-${end} of ${total}`
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
function ConfigPanel({
|
|
28
|
+
panel,
|
|
29
|
+
controller: _controller,
|
|
30
|
+
width,
|
|
31
|
+
noColor,
|
|
32
|
+
language
|
|
33
|
+
}) {
|
|
34
|
+
const theme = createShellTheme(noColor);
|
|
35
|
+
const hint = HINT_TEXT[language] ?? HINT_TEXT["zh-CN"];
|
|
36
|
+
useInput(() => void 0, { isActive: false });
|
|
37
|
+
const panelWidth = Math.max(
|
|
38
|
+
40,
|
|
39
|
+
Math.max(Math.min(width - 2, MIN_PANEL_WIDTH), Math.min(width - 2, MAX_PANEL_WIDTH))
|
|
40
|
+
);
|
|
41
|
+
const innerWidth = Math.max(36, panelWidth - 4);
|
|
42
|
+
if (panel.phase === "panel_list") {
|
|
43
|
+
const total2 = panel.panels.length;
|
|
44
|
+
const maxOffset2 = Math.max(0, total2 - MAX_VISIBLE);
|
|
45
|
+
const scrollOffset2 = Math.max(0, Math.min(panel.scrollOffset, maxOffset2));
|
|
46
|
+
const visible2 = panel.panels.slice(scrollOffset2, scrollOffset2 + MAX_VISIBLE);
|
|
47
|
+
const visibleEnd2 = Math.min(scrollOffset2 + MAX_VISIBLE, total2);
|
|
48
|
+
const titleWidth = Math.min(
|
|
49
|
+
18,
|
|
50
|
+
Math.max(8, ...panel.panels.map((p) => [...p.title].length)) + 2
|
|
51
|
+
);
|
|
52
|
+
const summaryWidth = Math.max(16, innerWidth - titleWidth - 5);
|
|
53
|
+
return /* @__PURE__ */ jsxs(
|
|
54
|
+
Box,
|
|
55
|
+
{
|
|
56
|
+
flexDirection: "column",
|
|
57
|
+
paddingX: 1,
|
|
58
|
+
marginTop: 1,
|
|
59
|
+
width: panelWidth,
|
|
60
|
+
borderStyle: "round",
|
|
61
|
+
borderColor: theme.panel ?? theme.border,
|
|
62
|
+
children: [
|
|
63
|
+
/* @__PURE__ */ jsxs(Box, { paddingX: 2, children: [
|
|
64
|
+
/* @__PURE__ */ jsx(Text, { color: theme.accent, bold: true, children: "CONFIG" }),
|
|
65
|
+
/* @__PURE__ */ jsx(Text, { color: theme.dim ?? theme.muted, dimColor: true, children: fitText(
|
|
66
|
+
` /config ${total2 > 0 ? hint.count(scrollOffset2 + 1, visibleEnd2, total2) : ""}`,
|
|
67
|
+
innerWidth - 6
|
|
68
|
+
) })
|
|
69
|
+
] }),
|
|
70
|
+
/* @__PURE__ */ jsx(Box, { paddingX: 2, children: /* @__PURE__ */ jsx(Text, { color: theme.muted, children: fitText(hint.list, innerWidth) }) }),
|
|
71
|
+
/* @__PURE__ */ jsx(Box, { flexDirection: "column", marginTop: 1, paddingX: 2, children: visible2.map((p, vi) => {
|
|
72
|
+
const realIdx = scrollOffset2 + vi;
|
|
73
|
+
const active = realIdx === panel.cursor;
|
|
74
|
+
const titleCol = p.title.padEnd(titleWidth);
|
|
75
|
+
return /* @__PURE__ */ jsxs(Box, { marginTop: vi > 0 ? 1 : 0, children: [
|
|
76
|
+
/* @__PURE__ */ jsx(Text, { color: active ? theme.accent : theme.dim ?? theme.muted, bold: active, children: active ? "\u258C " : " " }),
|
|
77
|
+
/* @__PURE__ */ jsx(Text, { color: active ? theme.accent : void 0, bold: active, children: fitText(titleCol, titleWidth) }),
|
|
78
|
+
/* @__PURE__ */ jsx(Text, { color: active ? void 0 : theme.dim ?? theme.muted, children: fitText(p.summary, summaryWidth) })
|
|
79
|
+
] }, p.id);
|
|
80
|
+
}) })
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
const actions = panel.actions;
|
|
86
|
+
const total = actions.length;
|
|
87
|
+
const maxOffset = Math.max(0, total - MAX_VISIBLE);
|
|
88
|
+
const scrollOffset = Math.max(0, Math.min(panel.scrollOffset, maxOffset));
|
|
89
|
+
const visible = actions.slice(scrollOffset, scrollOffset + MAX_VISIBLE);
|
|
90
|
+
const visibleEnd = Math.min(scrollOffset + MAX_VISIBLE, total);
|
|
91
|
+
return /* @__PURE__ */ jsxs(
|
|
92
|
+
Box,
|
|
93
|
+
{
|
|
94
|
+
flexDirection: "column",
|
|
95
|
+
paddingX: 1,
|
|
96
|
+
marginTop: 1,
|
|
97
|
+
width: panelWidth,
|
|
98
|
+
borderStyle: "round",
|
|
99
|
+
borderColor: theme.panel ?? theme.border,
|
|
100
|
+
children: [
|
|
101
|
+
/* @__PURE__ */ jsxs(Box, { paddingX: 2, children: [
|
|
102
|
+
/* @__PURE__ */ jsx(Text, { color: theme.accent, bold: true, children: fitText(panel.panel.title.toUpperCase(), Math.max(8, Math.floor(innerWidth * 0.45))) }),
|
|
103
|
+
/* @__PURE__ */ jsx(Text, { color: theme.dim ?? theme.muted, dimColor: true, children: fitText(
|
|
104
|
+
` /config \xB7 ${panel.panel.title}`,
|
|
105
|
+
Math.max(8, innerWidth - panel.panel.title.length - 2)
|
|
106
|
+
) })
|
|
107
|
+
] }),
|
|
108
|
+
/* @__PURE__ */ jsx(Box, { flexDirection: "column", marginTop: 1, paddingX: 2, children: wrapText(panel.panel.summary, innerWidth).map((line, idx) => /* @__PURE__ */ jsx(Text, { color: theme.muted, children: line }, `summary-${idx}-${line}`)) }),
|
|
109
|
+
/* @__PURE__ */ jsx(Box, { paddingX: 2, children: /* @__PURE__ */ jsx(Text, { color: theme.muted, children: fitText(
|
|
110
|
+
[total > 0 ? hint.count(scrollOffset + 1, visibleEnd, total) : "", hint.detail].filter(Boolean).join(" \xB7 "),
|
|
111
|
+
innerWidth
|
|
112
|
+
) }) }),
|
|
113
|
+
/* @__PURE__ */ jsx(Box, { flexDirection: "column", marginTop: 1, paddingX: 2, children: visible.map((a, vi) => {
|
|
114
|
+
const realIdx = scrollOffset + vi;
|
|
115
|
+
const active = realIdx === panel.actionCursor;
|
|
116
|
+
return /* @__PURE__ */ jsx(Box, { flexDirection: "column", marginTop: vi > 0 ? 1 : 0, children: wrapText(`${active ? "\u258C " : " "}${a.label}`, innerWidth).map((part, lineIdx) => /* @__PURE__ */ jsx(
|
|
117
|
+
Text,
|
|
118
|
+
{
|
|
119
|
+
color: active ? theme.accent : void 0,
|
|
120
|
+
bold: active,
|
|
121
|
+
children: lineIdx === 0 ? part : ` ${fitText(part, Math.max(8, innerWidth - 2))}`
|
|
122
|
+
},
|
|
123
|
+
`${a.id}-${lineIdx}`
|
|
124
|
+
)) }, a.id);
|
|
125
|
+
}) })
|
|
126
|
+
]
|
|
127
|
+
}
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export {
|
|
132
|
+
ConfigPanel
|
|
133
|
+
};
|