@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,502 @@
|
|
|
1
|
+
// src/remote-inbound-bridge-runtime.ts
|
|
2
|
+
import { createHash } from "crypto";
|
|
3
|
+
import { randomBytes } from "crypto";
|
|
4
|
+
function getRemoteBridgeDoctor(remote, channelId, now = /* @__PURE__ */ new Date()) {
|
|
5
|
+
const channel = remote.channels.find((item) => item.id === normalizeBridgeChannelId(channelId));
|
|
6
|
+
if (!channel) {
|
|
7
|
+
return {
|
|
8
|
+
channel: channelId,
|
|
9
|
+
platform: "feishu",
|
|
10
|
+
readiness: "needs-app-setup",
|
|
11
|
+
capabilities: ["notification-only"],
|
|
12
|
+
now: now.toISOString(),
|
|
13
|
+
canRunLocalFixture: false,
|
|
14
|
+
inboundPath: "unknown channel",
|
|
15
|
+
nextAction: "Run /remote bridge doctor feishu|dingtalk|wecom.",
|
|
16
|
+
missing: ["known channel"]
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
return describeBridgeChannel(channel, now);
|
|
20
|
+
}
|
|
21
|
+
function formatRemoteBridgeDoctor(report) {
|
|
22
|
+
return [
|
|
23
|
+
`Remote bridge doctor\uFF1A${report.channel}`,
|
|
24
|
+
`- now: ${report.now}`,
|
|
25
|
+
`- readiness: ${report.readiness}`,
|
|
26
|
+
`- capabilities: ${report.capabilities.join(", ")}`,
|
|
27
|
+
`- inbound path: ${report.inboundPath}`,
|
|
28
|
+
`- local fixture: ${report.canRunLocalFixture ? "available" : "not available"}`,
|
|
29
|
+
`- missing: ${report.missing.length ? report.missing.join(", ") : "none"}`,
|
|
30
|
+
`- next: ${report.nextAction}`,
|
|
31
|
+
"- webhook path remains notification-only; fixture PASS is not real mobile inbound."
|
|
32
|
+
].join("\n");
|
|
33
|
+
}
|
|
34
|
+
function createSignedRemoteInboundFixture(channel, input) {
|
|
35
|
+
const nowMs = input.nowMs ?? Date.now();
|
|
36
|
+
const messageId = input.messageId ?? `fixture-${channel.id}-${input.kind}`;
|
|
37
|
+
const nonce = input.nonce ?? stableFixtureNonce(channel.id, input.kind, messageId);
|
|
38
|
+
return {
|
|
39
|
+
kind: input.kind,
|
|
40
|
+
channel: channel.id,
|
|
41
|
+
messageId,
|
|
42
|
+
nonce,
|
|
43
|
+
source: channel.config.trustedSources[0] ?? `${channel.id}-fixture-source`,
|
|
44
|
+
bindingUserId: channel.config.bindingUserId ?? `${channel.id}-fixture-user`,
|
|
45
|
+
bindingDeviceId: channel.config.bindingDeviceId,
|
|
46
|
+
signature: `mock:inbound:${messageId}:${nonce}`,
|
|
47
|
+
expiresAt: new Date(nowMs + 6e4).toISOString(),
|
|
48
|
+
receivedAt: new Date(nowMs).toISOString(),
|
|
49
|
+
origin: "fixture",
|
|
50
|
+
eventId: input.eventId,
|
|
51
|
+
approve: input.approve,
|
|
52
|
+
text: input.text
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
function createRemotePairing(remote, channel, projectPath, sessionId, nowMs = Date.now(), code = createPairingCode()) {
|
|
56
|
+
const pairing = {
|
|
57
|
+
code,
|
|
58
|
+
channel: channel.id,
|
|
59
|
+
source: `${channel.id}-pairing`,
|
|
60
|
+
projectPath,
|
|
61
|
+
sessionId,
|
|
62
|
+
createdAt: new Date(nowMs).toISOString(),
|
|
63
|
+
expiresAt: new Date(nowMs + 5 * 60 * 1e3).toISOString(),
|
|
64
|
+
consumedMessageIds: [],
|
|
65
|
+
status: "pending"
|
|
66
|
+
};
|
|
67
|
+
remote.pairings = [pairing, ...remote.pairings.filter((item) => item.status === "pending")].slice(
|
|
68
|
+
0,
|
|
69
|
+
5
|
|
70
|
+
);
|
|
71
|
+
return {
|
|
72
|
+
status: "created",
|
|
73
|
+
summary: `remote pairing code created for ${channel.id}`,
|
|
74
|
+
pairing,
|
|
75
|
+
qr: `linghun://remote-bind?channel=${encodeURIComponent(channel.id)}&code=${code}`,
|
|
76
|
+
fallback: `/bind ${code}`
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
function formatRemotePairing(pairing) {
|
|
80
|
+
if (pairing.status !== "created") {
|
|
81
|
+
return pairing.summary;
|
|
82
|
+
}
|
|
83
|
+
return [
|
|
84
|
+
`Remote pairing\uFF1A${pairing.pairing.channel}`,
|
|
85
|
+
`- code: ${pairing.pairing.code}`,
|
|
86
|
+
`- expiresAt: ${pairing.pairing.expiresAt}`,
|
|
87
|
+
`- phone fallback: ${pairing.fallback}`,
|
|
88
|
+
`- QR payload: ${pairing.qr}`,
|
|
89
|
+
"- QR render: not available in this terminal; please copy the fallback command.",
|
|
90
|
+
"- webhook URL / secret / endpoint are not included."
|
|
91
|
+
].join("\n");
|
|
92
|
+
}
|
|
93
|
+
function formatRemotePairingStatus(remote) {
|
|
94
|
+
const active = remote.pairings.filter((item) => item.status === "pending");
|
|
95
|
+
if (active.length === 0) return "Remote pairing\uFF1Ano active pairing code.";
|
|
96
|
+
return [
|
|
97
|
+
"Remote pairing status",
|
|
98
|
+
...active.map(
|
|
99
|
+
(item) => `- ${item.channel}: ${item.code}; expiresAt=${item.expiresAt}; source=${item.source}`
|
|
100
|
+
)
|
|
101
|
+
].join("\n");
|
|
102
|
+
}
|
|
103
|
+
function cancelRemotePairing(remote, channelId) {
|
|
104
|
+
const normalized = channelId ? normalizeBridgeChannelId(channelId) : void 0;
|
|
105
|
+
const target = remote.pairings.find(
|
|
106
|
+
(item) => item.status === "pending" && (!normalized || item.channel === normalized)
|
|
107
|
+
);
|
|
108
|
+
if (!target) return { status: "unknown", summary: "no active pairing code to cancel" };
|
|
109
|
+
target.status = "cancelled";
|
|
110
|
+
return { status: "cancelled", summary: `remote pairing cancelled for ${target.channel}` };
|
|
111
|
+
}
|
|
112
|
+
function processRemoteBindCommand(remote, channel, message, nowMs = Date.now()) {
|
|
113
|
+
if (!parseBindCode(message.text ?? "")) return void 0;
|
|
114
|
+
const validation = validateRemotePairingCode(remote, channel, message, nowMs);
|
|
115
|
+
if (validation.status !== "valid") return validation;
|
|
116
|
+
const pairing = validation.pairing;
|
|
117
|
+
pairing.consumedMessageIds.unshift(message.messageId);
|
|
118
|
+
pairing.status = "bound";
|
|
119
|
+
channel.config.bindingUserId = message.bindingUserId;
|
|
120
|
+
if (message.bindingDeviceId) channel.config.bindingDeviceId = message.bindingDeviceId;
|
|
121
|
+
if (!channel.config.trustedSources.includes(message.source)) {
|
|
122
|
+
channel.config.trustedSources.push(message.source);
|
|
123
|
+
}
|
|
124
|
+
channel.runtimeStatus = "ready";
|
|
125
|
+
channel.bindingStatus = "bound";
|
|
126
|
+
channel.lastError = void 0;
|
|
127
|
+
channel.nextAction = `/remote bridge test-inbound ${channel.id}`;
|
|
128
|
+
return {
|
|
129
|
+
status: "bound",
|
|
130
|
+
summary: "remote pairing bound; mobile control remains summary-only and permission-aware",
|
|
131
|
+
pairing
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
function validateRemotePairingCode(remote, channel, message, nowMs = Date.now()) {
|
|
135
|
+
const code = parseBindCode(message.text ?? "");
|
|
136
|
+
const pairing = code ? remote.pairings.find((item) => item.code === code && item.status !== "cancelled") : void 0;
|
|
137
|
+
if (!pairing) return { status: "unknown", summary: "pairing code is unknown" };
|
|
138
|
+
if (pairing.status !== "pending") {
|
|
139
|
+
return { status: "replayed", summary: "pairing code was already used" };
|
|
140
|
+
}
|
|
141
|
+
if (pairing.channel !== channel.id) {
|
|
142
|
+
return { status: "channel_mismatch", summary: "pairing code belongs to another channel" };
|
|
143
|
+
}
|
|
144
|
+
if (Date.parse(pairing.expiresAt) <= nowMs) {
|
|
145
|
+
pairing.status = "expired";
|
|
146
|
+
return { status: "expired", summary: "pairing code expired" };
|
|
147
|
+
}
|
|
148
|
+
if (pairing.consumedMessageIds.includes(message.messageId)) {
|
|
149
|
+
return { status: "replayed", summary: "pairing bind message replayed" };
|
|
150
|
+
}
|
|
151
|
+
return { status: "valid", pairing };
|
|
152
|
+
}
|
|
153
|
+
function decideRemoteInbox(remote, message, turn, nowMs = Date.now()) {
|
|
154
|
+
if (message.kind === "status_query") {
|
|
155
|
+
return { status: "status_only", summary: formatRemoteStatusSummary(remote, turn) };
|
|
156
|
+
}
|
|
157
|
+
if (message.kind === "approval_response") {
|
|
158
|
+
return { status: "approval_only", message };
|
|
159
|
+
}
|
|
160
|
+
const text = (message.text ?? "").trim();
|
|
161
|
+
const busy = Boolean(
|
|
162
|
+
turn.activeModelTurn || turn.activeJob || turn.toolRunning || turn.pendingApproval
|
|
163
|
+
);
|
|
164
|
+
if (!busy) {
|
|
165
|
+
return { status: "route", reason: "idle", message };
|
|
166
|
+
}
|
|
167
|
+
const priority = hasInterruptIntent(text) ? "interrupt" : "normal";
|
|
168
|
+
const item = {
|
|
169
|
+
id: `rinbox-${stableFixtureNonce(message.channel, message.kind, message.messageId)}`,
|
|
170
|
+
channel: message.channel,
|
|
171
|
+
messageId: message.messageId,
|
|
172
|
+
source: message.source,
|
|
173
|
+
bindingUserId: message.bindingUserId,
|
|
174
|
+
text,
|
|
175
|
+
priority,
|
|
176
|
+
reason: priority === "interrupt" ? "explicit interrupt intent" : "active local turn",
|
|
177
|
+
createdAt: new Date(nowMs).toISOString(),
|
|
178
|
+
sessionId: turn.sessionId
|
|
179
|
+
};
|
|
180
|
+
remote.inbox.unshift(item);
|
|
181
|
+
remote.inbox = remote.inbox.slice(0, 20);
|
|
182
|
+
return { status: "queued", reason: item.reason, item };
|
|
183
|
+
}
|
|
184
|
+
function formatRemoteInbox(remote) {
|
|
185
|
+
if (remote.inbox.length === 0) return "Remote inbox\uFF1Aempty.";
|
|
186
|
+
return [
|
|
187
|
+
"Remote inbox\uFF08summary-only\uFF09",
|
|
188
|
+
...remote.inbox.slice(0, 20).map(
|
|
189
|
+
(item) => `- ${item.id}: ${item.channel}; priority=${item.priority}; source=${item.source}; text=${redactMobileText(item.text)}`
|
|
190
|
+
)
|
|
191
|
+
].join("\n");
|
|
192
|
+
}
|
|
193
|
+
function clearRemoteInbox(remote) {
|
|
194
|
+
const count = remote.inbox.length;
|
|
195
|
+
remote.inbox = [];
|
|
196
|
+
return count;
|
|
197
|
+
}
|
|
198
|
+
function rejectRemoteInboxItem(remote, id) {
|
|
199
|
+
const before = remote.inbox.length;
|
|
200
|
+
remote.inbox = remote.inbox.filter((item) => item.id !== id);
|
|
201
|
+
return remote.inbox.length !== before;
|
|
202
|
+
}
|
|
203
|
+
function drainRemoteInbox(remote) {
|
|
204
|
+
const drained = [...remote.inbox].reverse();
|
|
205
|
+
remote.inbox = [];
|
|
206
|
+
return drained;
|
|
207
|
+
}
|
|
208
|
+
function formatRemoteStatusSummary(remote, turn) {
|
|
209
|
+
const busy = Boolean(turn.activeModelTurn || turn.activeJob || turn.toolRunning);
|
|
210
|
+
return [
|
|
211
|
+
`Linghun / remote / ${busy ? "busy" : "idle"}`,
|
|
212
|
+
`status_query \xB7 pendingApproval=${turn.pendingApproval ? "yes" : "no"} \xB7 inbox=${remote.inbox.length}`,
|
|
213
|
+
`Next: ${busy ? "wait or send explicit interrupt" : "send a short instruction"}`
|
|
214
|
+
].join("\n");
|
|
215
|
+
}
|
|
216
|
+
function feishuBridgeAdapter(event) {
|
|
217
|
+
return adaptBridgeEvent(event, "feishu");
|
|
218
|
+
}
|
|
219
|
+
function feishuReceiveMessageToBridgeEvent(event, nowMs = Date.now()) {
|
|
220
|
+
const messageId = event.message?.message_id;
|
|
221
|
+
const senderId = event.sender?.sender_id;
|
|
222
|
+
const source = senderId?.open_id ?? senderId?.user_id ?? senderId?.union_id;
|
|
223
|
+
if (!messageId) {
|
|
224
|
+
throw new Error("Feishu receive message event missing message_id");
|
|
225
|
+
}
|
|
226
|
+
if (!source) {
|
|
227
|
+
throw new Error("Feishu receive message event missing sender id");
|
|
228
|
+
}
|
|
229
|
+
const text = parseFeishuTextContent(event.message?.content);
|
|
230
|
+
return {
|
|
231
|
+
platform: "feishu",
|
|
232
|
+
source,
|
|
233
|
+
userId: source,
|
|
234
|
+
kind: classifyFeishuInboundKind(text),
|
|
235
|
+
text,
|
|
236
|
+
approve: classifyFeishuApprove(text),
|
|
237
|
+
eventId: parseFeishuApprovalEventId(text),
|
|
238
|
+
messageId,
|
|
239
|
+
nonce: event.event_id ?? messageId,
|
|
240
|
+
signature: "ref:feishu-long-connection",
|
|
241
|
+
expiresAt: new Date(nowMs + 6e4).toISOString(),
|
|
242
|
+
receivedAt: new Date(nowMs).toISOString()
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
function dingtalkBridgeAdapter(event) {
|
|
246
|
+
return adaptBridgeEvent(event, "dingtalk");
|
|
247
|
+
}
|
|
248
|
+
function dingtalkStreamFrameToBridgeEvent(frame, nowMs = Date.now()) {
|
|
249
|
+
const topic = frame.headers?.topic;
|
|
250
|
+
if (topic !== "/v1.0/im/bot/messages/get") {
|
|
251
|
+
throw new Error("DingTalk Stream frame topic is not a bot message");
|
|
252
|
+
}
|
|
253
|
+
const data = parseDingTalkStreamData(frame.data);
|
|
254
|
+
const messageId = stringValue(data.msgId) ?? frame.headers?.messageId;
|
|
255
|
+
const source = stringValue(data.senderId) ?? stringValue(data.senderStaffId);
|
|
256
|
+
if (!messageId) {
|
|
257
|
+
throw new Error("DingTalk Stream bot message missing msgId");
|
|
258
|
+
}
|
|
259
|
+
if (!source) {
|
|
260
|
+
throw new Error("DingTalk Stream bot message missing sender id");
|
|
261
|
+
}
|
|
262
|
+
const text = typeof data.text?.content === "string" ? data.text.content.trim() : "";
|
|
263
|
+
return {
|
|
264
|
+
platform: "dingtalk",
|
|
265
|
+
source,
|
|
266
|
+
userId: source,
|
|
267
|
+
kind: classifyPlainTextInboundKind(text),
|
|
268
|
+
text,
|
|
269
|
+
approve: classifyPlainTextApprove(text),
|
|
270
|
+
eventId: parsePlainTextApprovalEventId(text),
|
|
271
|
+
messageId,
|
|
272
|
+
nonce: frame.headers?.messageId ?? messageId,
|
|
273
|
+
signature: "ref:dingtalk-stream",
|
|
274
|
+
expiresAt: new Date(nowMs + 6e4).toISOString(),
|
|
275
|
+
receivedAt: new Date(nowMs).toISOString()
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
function wecomBridgeAdapter(event) {
|
|
279
|
+
return adaptBridgeEvent(event, "wecom");
|
|
280
|
+
}
|
|
281
|
+
function adaptBridgeEvent(event, expectedPlatform) {
|
|
282
|
+
if (event.platform !== expectedPlatform) {
|
|
283
|
+
throw new Error(`remote bridge adapter expected ${expectedPlatform}`);
|
|
284
|
+
}
|
|
285
|
+
return {
|
|
286
|
+
kind: event.kind,
|
|
287
|
+
channel: normalizeBridgeChannelId(expectedPlatform),
|
|
288
|
+
messageId: event.messageId,
|
|
289
|
+
nonce: event.nonce,
|
|
290
|
+
source: event.source,
|
|
291
|
+
bindingUserId: event.userId,
|
|
292
|
+
bindingDeviceId: event.deviceId,
|
|
293
|
+
signature: event.signature,
|
|
294
|
+
expiresAt: event.expiresAt,
|
|
295
|
+
receivedAt: event.receivedAt,
|
|
296
|
+
origin: "adapter",
|
|
297
|
+
eventId: event.eventId,
|
|
298
|
+
approve: event.approve,
|
|
299
|
+
text: event.text
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
function describeBridgeChannel(channel, now) {
|
|
303
|
+
const missing = bridgeMissingFields(channel);
|
|
304
|
+
const webhookOnly = channel.config.transport === "webhook" || channel.config.transport === "webhook_mock";
|
|
305
|
+
if (webhookOnly) {
|
|
306
|
+
return baseReport(channel, now, {
|
|
307
|
+
readiness: "notification-only",
|
|
308
|
+
capabilities: ["notification-only"],
|
|
309
|
+
canRunLocalFixture: false,
|
|
310
|
+
inboundPath: "outbound webhook only",
|
|
311
|
+
missing,
|
|
312
|
+
nextAction: "Use webhook for short status notifications only; configure an official app/CLI bridge for inbound."
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
const capabilities = platformBridgeCapabilities(channel.config.type);
|
|
316
|
+
const needsApp = missing.some((item) => item.includes("credentials")) || missing.includes("trusted source");
|
|
317
|
+
const needsDaemon = isFeishuLongConnection(channel) ? false : channel.config.inboundMode === "poll" ? !channel.config.cliPath : channel.config.inboundMode === "callback" && !channel.config.callbackEndpoint;
|
|
318
|
+
const readiness = needsApp ? platformNeedsAppReadiness(channel.config.type) : needsDaemon ? "needs-daemon" : isFeishuLongConnection(channel) ? "ready-to-start" : "fixture-ready";
|
|
319
|
+
return baseReport(channel, now, {
|
|
320
|
+
readiness,
|
|
321
|
+
capabilities,
|
|
322
|
+
canRunLocalFixture: !needsApp,
|
|
323
|
+
inboundPath: bridgeInboundPath(channel),
|
|
324
|
+
missing,
|
|
325
|
+
nextAction: bridgeNextAction(channel, readiness)
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
function baseReport(channel, now, partial) {
|
|
329
|
+
return {
|
|
330
|
+
channel: channel.id,
|
|
331
|
+
platform: channel.config.type,
|
|
332
|
+
now: now.toISOString(),
|
|
333
|
+
...partial
|
|
334
|
+
};
|
|
335
|
+
}
|
|
336
|
+
function bridgeMissingFields(channel) {
|
|
337
|
+
const missing = [];
|
|
338
|
+
const config = channel.config;
|
|
339
|
+
if (!config.bindingUserId) missing.push("binding user");
|
|
340
|
+
if (config.trustedSources.length === 0) missing.push("trusted source");
|
|
341
|
+
if (config.transport === "official_cli" && !config.cliPath) missing.push("cli path");
|
|
342
|
+
if (config.transport === "official_cli" && (!config.inboundMode || config.inboundMode === "none")) {
|
|
343
|
+
missing.push("inbound mode");
|
|
344
|
+
}
|
|
345
|
+
if (config.inboundMode === "callback" && !config.callbackEndpoint)
|
|
346
|
+
missing.push("callback endpoint");
|
|
347
|
+
if (config.type === "feishu" || config.type === "lark") {
|
|
348
|
+
if (!config.appIdRef || !config.appSecretRef) missing.push("app credentials");
|
|
349
|
+
if (config.inboundMode === "callback" && config.callbackEndpoint !== "feishu-long-connection" && (!config.encryptKeyRef || !config.verificationTokenRef)) {
|
|
350
|
+
missing.push("callback verification refs");
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
if (config.type === "dingtalk" && !config.appIdRef && !config.tokenRef) {
|
|
354
|
+
missing.push("dingtalk app credentials");
|
|
355
|
+
}
|
|
356
|
+
if ((config.type === "wecom" || config.type === "enterprise-wechat") && !config.appIdRef && !config.tokenRef) {
|
|
357
|
+
missing.push("wecom app credentials");
|
|
358
|
+
}
|
|
359
|
+
return [...new Set(missing)];
|
|
360
|
+
}
|
|
361
|
+
function platformBridgeCapabilities(type) {
|
|
362
|
+
if (type === "feishu" || type === "lark") {
|
|
363
|
+
return ["full-mobile-control-capable", "app-callback-capable"];
|
|
364
|
+
}
|
|
365
|
+
if (type === "dingtalk") {
|
|
366
|
+
return ["approval-capable", "stream-callback-capable"];
|
|
367
|
+
}
|
|
368
|
+
return ["natural-language-inbound-capable", "app-callback-capable"];
|
|
369
|
+
}
|
|
370
|
+
function bridgeInboundPath(channel) {
|
|
371
|
+
if (channel.config.inboundMode === "callback") {
|
|
372
|
+
return channel.config.callbackEndpoint ? "app callback endpoint configured" : "app callback endpoint needed";
|
|
373
|
+
}
|
|
374
|
+
if (channel.config.inboundMode === "poll") {
|
|
375
|
+
return channel.config.localBridgePort ? `local bridge daemon on port ${channel.config.localBridgePort}` : "official CLI poll/stream daemon needed";
|
|
376
|
+
}
|
|
377
|
+
return "inbound disabled";
|
|
378
|
+
}
|
|
379
|
+
function bridgeNextAction(channel, readiness) {
|
|
380
|
+
if (readiness === "fixture-ready") {
|
|
381
|
+
return `/remote bridge test-inbound ${channel.id}; real mobile inbound still needs platform credentials and callback/daemon.`;
|
|
382
|
+
}
|
|
383
|
+
if (readiness === "ready-to-start") {
|
|
384
|
+
return `/remote bridge start ${channel.id}`;
|
|
385
|
+
}
|
|
386
|
+
if (readiness === "needs-daemon") {
|
|
387
|
+
return "Start/configure the official CLI poll/stream daemon or provide a callback endpoint.";
|
|
388
|
+
}
|
|
389
|
+
if (readiness === "needs-app-setup") {
|
|
390
|
+
return "Configure Feishu/Lark app refs and an inbound path before full mobile control is ready.";
|
|
391
|
+
}
|
|
392
|
+
if (readiness === "needs-dingtalk-app") {
|
|
393
|
+
return "Configure a DingTalk app/Stream callback before approval inbound is ready.";
|
|
394
|
+
}
|
|
395
|
+
if (readiness === "needs-wecom-app") {
|
|
396
|
+
return "Configure a WeCom app callback before natural-language inbound is ready.";
|
|
397
|
+
}
|
|
398
|
+
return "Keep webhook as notification-only.";
|
|
399
|
+
}
|
|
400
|
+
function isFeishuLongConnection(channel) {
|
|
401
|
+
return (channel.config.type === "feishu" || channel.config.type === "lark") && channel.config.transport === "official_cli" && channel.config.inboundMode === "callback" && channel.config.callbackEndpoint === "feishu-long-connection";
|
|
402
|
+
}
|
|
403
|
+
function platformNeedsAppReadiness(type) {
|
|
404
|
+
if (type === "dingtalk") return "needs-dingtalk-app";
|
|
405
|
+
if (type === "wecom" || type === "enterprise-wechat") return "needs-wecom-app";
|
|
406
|
+
return "needs-app-setup";
|
|
407
|
+
}
|
|
408
|
+
function normalizeBridgeChannelId(value) {
|
|
409
|
+
const normalized = value.trim().toLowerCase();
|
|
410
|
+
if (normalized === "lark") return "feishu";
|
|
411
|
+
if (normalized === "enterprise-wechat") return "wecom";
|
|
412
|
+
return normalized;
|
|
413
|
+
}
|
|
414
|
+
function parseFeishuTextContent(content) {
|
|
415
|
+
if (!content) return "";
|
|
416
|
+
try {
|
|
417
|
+
const parsed = JSON.parse(content);
|
|
418
|
+
return typeof parsed.text === "string" ? parsed.text.trim() : "";
|
|
419
|
+
} catch {
|
|
420
|
+
return "";
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
function classifyFeishuInboundKind(text) {
|
|
424
|
+
return classifyPlainTextInboundKind(text);
|
|
425
|
+
}
|
|
426
|
+
function classifyPlainTextInboundKind(text) {
|
|
427
|
+
const normalized = text.trim().toLowerCase();
|
|
428
|
+
if (normalized === "\u72B6\u6001" || normalized === "status" || normalized === "/status") {
|
|
429
|
+
return "status_query";
|
|
430
|
+
}
|
|
431
|
+
if (/^(approve|deny)\b/i.test(normalized)) {
|
|
432
|
+
return "approval_response";
|
|
433
|
+
}
|
|
434
|
+
return "natural_language_message";
|
|
435
|
+
}
|
|
436
|
+
function classifyFeishuApprove(text) {
|
|
437
|
+
return classifyPlainTextApprove(text);
|
|
438
|
+
}
|
|
439
|
+
function classifyPlainTextApprove(text) {
|
|
440
|
+
if (/^approve\b/i.test(text.trim())) return true;
|
|
441
|
+
if (/^deny\b/i.test(text.trim())) return false;
|
|
442
|
+
return void 0;
|
|
443
|
+
}
|
|
444
|
+
function parseFeishuApprovalEventId(text) {
|
|
445
|
+
return parsePlainTextApprovalEventId(text);
|
|
446
|
+
}
|
|
447
|
+
function parsePlainTextApprovalEventId(text) {
|
|
448
|
+
const match = text.trim().match(/(?:event|eventId|approval)[:=]\s*([A-Za-z0-9_-]+)/i);
|
|
449
|
+
return match?.[1];
|
|
450
|
+
}
|
|
451
|
+
function parseDingTalkStreamData(data) {
|
|
452
|
+
if (!data) return {};
|
|
453
|
+
if (typeof data === "string") {
|
|
454
|
+
const parsed = JSON.parse(data);
|
|
455
|
+
return parsed;
|
|
456
|
+
}
|
|
457
|
+
return data;
|
|
458
|
+
}
|
|
459
|
+
function stringValue(value) {
|
|
460
|
+
return typeof value === "string" && value.trim() ? value.trim() : void 0;
|
|
461
|
+
}
|
|
462
|
+
function createPairingCode() {
|
|
463
|
+
const alphabet = "ABCDEFGHJKLMNPQRSTUVWXYZ23456789";
|
|
464
|
+
const bytes = randomBytes(6);
|
|
465
|
+
return Array.from(bytes, (byte) => alphabet[byte % alphabet.length]).join("");
|
|
466
|
+
}
|
|
467
|
+
function parseBindCode(text) {
|
|
468
|
+
const match = text.trim().match(/^\/bind\s+([A-Z0-9]{6})$/i);
|
|
469
|
+
return match?.[1]?.toUpperCase();
|
|
470
|
+
}
|
|
471
|
+
function hasInterruptIntent(text) {
|
|
472
|
+
return /插队|立即处理|暂停当前任务|interrupt/i.test(text);
|
|
473
|
+
}
|
|
474
|
+
function redactMobileText(text) {
|
|
475
|
+
return text.replace(/(secret|token|api[_-]?key|authorization)\s*[:=]\s*\S+/gi, "$1=[REDACTED]");
|
|
476
|
+
}
|
|
477
|
+
function stableFixtureNonce(channelId, kind, messageId) {
|
|
478
|
+
return createHash("sha256").update(`${channelId}:${kind}:${messageId}`).digest("hex").slice(0, 16);
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
export {
|
|
482
|
+
getRemoteBridgeDoctor,
|
|
483
|
+
formatRemoteBridgeDoctor,
|
|
484
|
+
createSignedRemoteInboundFixture,
|
|
485
|
+
createRemotePairing,
|
|
486
|
+
formatRemotePairing,
|
|
487
|
+
formatRemotePairingStatus,
|
|
488
|
+
cancelRemotePairing,
|
|
489
|
+
processRemoteBindCommand,
|
|
490
|
+
validateRemotePairingCode,
|
|
491
|
+
decideRemoteInbox,
|
|
492
|
+
formatRemoteInbox,
|
|
493
|
+
clearRemoteInbox,
|
|
494
|
+
rejectRemoteInboxItem,
|
|
495
|
+
drainRemoteInbox,
|
|
496
|
+
formatRemoteStatusSummary,
|
|
497
|
+
feishuBridgeAdapter,
|
|
498
|
+
feishuReceiveMessageToBridgeEvent,
|
|
499
|
+
dingtalkBridgeAdapter,
|
|
500
|
+
dingtalkStreamFrameToBridgeEvent,
|
|
501
|
+
wecomBridgeAdapter
|
|
502
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createShellTheme
|
|
3
|
+
} from "./chunk-GC55DMZV.js";
|
|
4
|
+
import {
|
|
5
|
+
fitText
|
|
6
|
+
} from "./chunk-APJIC2O5.js";
|
|
7
|
+
|
|
8
|
+
// src/shell/components/TaskSuggestionBar.tsx
|
|
9
|
+
import { Box, Text } from "@linghun/ink-runtime";
|
|
10
|
+
import { jsx } from "react/jsx-runtime";
|
|
11
|
+
function TaskSuggestionBar({
|
|
12
|
+
suggestions,
|
|
13
|
+
cursor,
|
|
14
|
+
width,
|
|
15
|
+
noColor
|
|
16
|
+
}) {
|
|
17
|
+
if (!suggestions || suggestions.length === 0) return null;
|
|
18
|
+
const theme = createShellTheme(noColor);
|
|
19
|
+
const innerWidth = Math.max(20, width - 4);
|
|
20
|
+
return /* @__PURE__ */ jsx(Box, { flexDirection: "column", paddingX: 2, marginTop: 1, children: suggestions.map((s, index) => {
|
|
21
|
+
const cmd = s.action.kind === "slash" ? s.action.command : "";
|
|
22
|
+
const marker = index === cursor ? ">" : " ";
|
|
23
|
+
const key = `${index + 1}.`;
|
|
24
|
+
const head = cmd ? `${marker} ${key} ${s.label} (${cmd})` : `${marker} ${key} ${s.label}`;
|
|
25
|
+
const line = s.hint ? `${head} \u2014 ${s.hint}` : head;
|
|
26
|
+
return /* @__PURE__ */ jsx(Text, { color: index === cursor ? theme.accent : theme.muted, children: fitText(line, innerWidth) }, s.id);
|
|
27
|
+
}) });
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export {
|
|
31
|
+
TaskSuggestionBar
|
|
32
|
+
};
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
// src/verification-level.ts
|
|
2
|
+
var LEVEL_ORDER = {
|
|
3
|
+
mock: 0,
|
|
4
|
+
source: 1,
|
|
5
|
+
local: 2,
|
|
6
|
+
build: 3,
|
|
7
|
+
"real-smoke": 4
|
|
8
|
+
};
|
|
9
|
+
var LEVEL_MATURITY_THRESHOLD = "real-smoke";
|
|
10
|
+
var LEVEL_PASS_THRESHOLD = "build";
|
|
11
|
+
function classifyVerificationLevel(input, verificationRoute) {
|
|
12
|
+
const level = inferLevel(input);
|
|
13
|
+
const levelOrder = LEVEL_ORDER[level];
|
|
14
|
+
const canClaimMature = levelOrder >= LEVEL_ORDER[LEVEL_MATURITY_THRESHOLD];
|
|
15
|
+
let canClaimPass = levelOrder >= LEVEL_ORDER[LEVEL_PASS_THRESHOLD];
|
|
16
|
+
const upgradeBlocked = hasUpgradeBlocker(input);
|
|
17
|
+
if (verificationRoute?.conservativeNoPass) {
|
|
18
|
+
canClaimPass = false;
|
|
19
|
+
}
|
|
20
|
+
return {
|
|
21
|
+
level,
|
|
22
|
+
isRealSmoke: level === "real-smoke",
|
|
23
|
+
canClaimMature: canClaimMature && !upgradeBlocked,
|
|
24
|
+
canClaimPass: canClaimPass && !upgradeBlocked,
|
|
25
|
+
upgradeBlocked,
|
|
26
|
+
blockReason: upgradeBlocked ? getBlockReason(input) : void 0,
|
|
27
|
+
requiredForMature: getRequiredForMature(level, input)
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
function isNonUpgradeableStatus(status) {
|
|
31
|
+
const lower = status.toLowerCase();
|
|
32
|
+
return lower.includes("partial") || lower.includes("simulated") || lower.includes("fallback") || lower.includes("mocked") || lower.includes("source-only") || lower.includes("node_fallback") || lower === "skipped" || lower === "stale";
|
|
33
|
+
}
|
|
34
|
+
function detectVerificationInflation(claimedStatus, actualLevel) {
|
|
35
|
+
const claimedLower = claimedStatus.toLowerCase();
|
|
36
|
+
const isMatureClaim = claimedLower.includes("mature") || claimedLower.includes("ready") || claimedLower.includes("production");
|
|
37
|
+
const isPassClaim = claimedLower === "pass" || claimedLower.includes("pass");
|
|
38
|
+
if (isMatureClaim && LEVEL_ORDER[actualLevel] < LEVEL_ORDER[LEVEL_MATURITY_THRESHOLD]) {
|
|
39
|
+
return `Verification inflation: claimed "${claimedStatus}" but actual level is "${actualLevel}". Real smoke required for mature/ready claims.`;
|
|
40
|
+
}
|
|
41
|
+
if (isPassClaim && LEVEL_ORDER[actualLevel] < LEVEL_ORDER[LEVEL_PASS_THRESHOLD]) {
|
|
42
|
+
return `Verification inflation: claimed "${claimedStatus}" but actual level is "${actualLevel}". At least build-level verification required for PASS.`;
|
|
43
|
+
}
|
|
44
|
+
return void 0;
|
|
45
|
+
}
|
|
46
|
+
function classifyRunnerVerificationLevel(adapter, status, fallbackReason) {
|
|
47
|
+
if (adapter === "node" || fallbackReason) {
|
|
48
|
+
return classifyVerificationLevel({
|
|
49
|
+
fallbackUsed: true,
|
|
50
|
+
localTestRunner: true,
|
|
51
|
+
runnerAdapter: adapter,
|
|
52
|
+
runnerStatus: status
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
if (status === "completed") {
|
|
56
|
+
return classifyVerificationLevel({
|
|
57
|
+
realProcessObserved: true,
|
|
58
|
+
runnerAdapter: adapter,
|
|
59
|
+
runnerStatus: status
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
return classifyVerificationLevel({
|
|
63
|
+
localTestRunner: true,
|
|
64
|
+
simulatedOrPartial: status !== "running",
|
|
65
|
+
runnerAdapter: adapter,
|
|
66
|
+
runnerStatus: status
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
function classifyProviderVerificationLevel(input) {
|
|
70
|
+
return classifyVerificationLevel({
|
|
71
|
+
realProviderHit: input.realEndpointHit && !input.fallbackUsed && !input.mockUsed,
|
|
72
|
+
mockUsed: input.mockUsed,
|
|
73
|
+
fallbackUsed: input.fallbackUsed || input.cooldownActive,
|
|
74
|
+
simulatedOrPartial: input.cooldownActive
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
function formatVerificationLevel(classification) {
|
|
78
|
+
const parts = [`level=${classification.level}`];
|
|
79
|
+
if (classification.upgradeBlocked) {
|
|
80
|
+
parts.push(`blocked=${classification.blockReason ?? "upgrade-blocked"}`);
|
|
81
|
+
}
|
|
82
|
+
if (!classification.canClaimPass) {
|
|
83
|
+
parts.push("pass=not-claimable");
|
|
84
|
+
}
|
|
85
|
+
if (!classification.canClaimMature) {
|
|
86
|
+
parts.push(`mature-requires=${classification.requiredForMature}`);
|
|
87
|
+
}
|
|
88
|
+
return parts.join("; ");
|
|
89
|
+
}
|
|
90
|
+
function compareVerificationLevels(a, b) {
|
|
91
|
+
return LEVEL_ORDER[a] - LEVEL_ORDER[b];
|
|
92
|
+
}
|
|
93
|
+
function inferLevel(input) {
|
|
94
|
+
if (input.mockUsed || input.fallbackUsed || input.simulatedOrPartial) {
|
|
95
|
+
if (input.localTestRunner && input.mockUsed && !input.fallbackUsed && !input.simulatedOrPartial) {
|
|
96
|
+
return "source";
|
|
97
|
+
}
|
|
98
|
+
return "mock";
|
|
99
|
+
}
|
|
100
|
+
if (input.realProcessObserved || input.realProviderHit || input.realTuiRendered) {
|
|
101
|
+
return "real-smoke";
|
|
102
|
+
}
|
|
103
|
+
if (input.buildPassed) {
|
|
104
|
+
return "build";
|
|
105
|
+
}
|
|
106
|
+
if (input.localTestRunner) {
|
|
107
|
+
return "local";
|
|
108
|
+
}
|
|
109
|
+
if (input.sourceOnlyAnalysis) {
|
|
110
|
+
return "source";
|
|
111
|
+
}
|
|
112
|
+
return "source";
|
|
113
|
+
}
|
|
114
|
+
function hasUpgradeBlocker(input) {
|
|
115
|
+
return Boolean(input.fallbackUsed || input.simulatedOrPartial || input.mockUsed);
|
|
116
|
+
}
|
|
117
|
+
function getBlockReason(input) {
|
|
118
|
+
if (input.fallbackUsed) return "fallback-path-used";
|
|
119
|
+
if (input.simulatedOrPartial) return "simulated-or-partial";
|
|
120
|
+
if (input.mockUsed) return "mock-used";
|
|
121
|
+
return "unknown-blocker";
|
|
122
|
+
}
|
|
123
|
+
function getRequiredForMature(currentLevel, input) {
|
|
124
|
+
if (currentLevel === "real-smoke") return "already-mature";
|
|
125
|
+
const needs = [];
|
|
126
|
+
if (!input.realProcessObserved && !input.realProviderHit && !input.realTuiRendered) {
|
|
127
|
+
needs.push("real-smoke-observation");
|
|
128
|
+
}
|
|
129
|
+
if (input.fallbackUsed) {
|
|
130
|
+
needs.push("main-path-execution");
|
|
131
|
+
}
|
|
132
|
+
if (input.mockUsed) {
|
|
133
|
+
needs.push("real-dependency-verification");
|
|
134
|
+
}
|
|
135
|
+
return needs.length > 0 ? needs.join("+") : "real-smoke-required";
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export {
|
|
139
|
+
classifyVerificationLevel,
|
|
140
|
+
isNonUpgradeableStatus,
|
|
141
|
+
detectVerificationInflation,
|
|
142
|
+
classifyRunnerVerificationLevel,
|
|
143
|
+
classifyProviderVerificationLevel,
|
|
144
|
+
formatVerificationLevel,
|
|
145
|
+
compareVerificationLevels
|
|
146
|
+
};
|