@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,157 @@
|
|
|
1
|
+
// src/shell/models/wheel-acceleration.ts
|
|
2
|
+
var WINDOW_MS = 40;
|
|
3
|
+
var MAX_HISTORY = 10;
|
|
4
|
+
var TRACKPAD_AVG_THRESHOLD_MS = 10;
|
|
5
|
+
var MAX_STEP_FALLBACK = 10;
|
|
6
|
+
var TRACKPAD_BURST_GAP_MS = 5;
|
|
7
|
+
var TRACKPAD_BURST_COUNT_THRESHOLD = 5;
|
|
8
|
+
var WHEEL_BOUNCE_GAP_MAX_MS = 200;
|
|
9
|
+
var WHEEL_MODE_IDLE_DISENGAGE_MS = 1500;
|
|
10
|
+
var WHEEL_MODE_STEP = 15;
|
|
11
|
+
var WHEEL_MODE_CAP = 15;
|
|
12
|
+
var WHEEL_MODE_RAMP = 3;
|
|
13
|
+
var WHEEL_DECAY_HALFLIFE_MS = 150;
|
|
14
|
+
var WHEEL_DECAY_STEP = 5;
|
|
15
|
+
var WHEEL_DECAY_GAP_MS = 80;
|
|
16
|
+
var WHEEL_DECAY_CAP_SLOW = 3;
|
|
17
|
+
var WHEEL_DECAY_CAP_FAST = 6;
|
|
18
|
+
var WHEEL_DECAY_IDLE_MS = 500;
|
|
19
|
+
var WHEEL_DECAY_KICK = 2;
|
|
20
|
+
var WHEEL_ACCEL_STEP = 0.3;
|
|
21
|
+
var WHEEL_ACCEL_MAX = 6;
|
|
22
|
+
var WheelAccelerator = class {
|
|
23
|
+
timestamps = [];
|
|
24
|
+
base;
|
|
25
|
+
terminalType;
|
|
26
|
+
// Wheel mode state (native only, sticky after bounce confirmed)
|
|
27
|
+
wheelMode = false;
|
|
28
|
+
wheelModeMult = 1;
|
|
29
|
+
lastWheelModeTime = 0;
|
|
30
|
+
// Direction flip debounce (native only)
|
|
31
|
+
lastDir = 0;
|
|
32
|
+
pendingFlip = null;
|
|
33
|
+
// Trackpad burst detection
|
|
34
|
+
burstCount = 0;
|
|
35
|
+
// xterm.js exponential decay state
|
|
36
|
+
xtermMult = 1;
|
|
37
|
+
xtermFrac = 0;
|
|
38
|
+
// carried fractional scroll
|
|
39
|
+
lastXtermTime = 0;
|
|
40
|
+
constructor(options = {}) {
|
|
41
|
+
this.base = options.base ?? 1;
|
|
42
|
+
this.terminalType = options.terminalType ?? "native";
|
|
43
|
+
}
|
|
44
|
+
recordEvent(timestamp, direction, viewportHeight) {
|
|
45
|
+
const dir = direction === "up" ? 1 : -1;
|
|
46
|
+
if (this.terminalType === "xterm.js") {
|
|
47
|
+
return this.recordEventXtermJs(timestamp, dir);
|
|
48
|
+
}
|
|
49
|
+
return this.recordEventNative(timestamp, dir, viewportHeight);
|
|
50
|
+
}
|
|
51
|
+
reset() {
|
|
52
|
+
this.timestamps = [];
|
|
53
|
+
this.wheelMode = false;
|
|
54
|
+
this.wheelModeMult = 1;
|
|
55
|
+
this.lastWheelModeTime = 0;
|
|
56
|
+
this.lastDir = 0;
|
|
57
|
+
this.pendingFlip = null;
|
|
58
|
+
this.burstCount = 0;
|
|
59
|
+
this.xtermMult = 1;
|
|
60
|
+
this.xtermFrac = 0;
|
|
61
|
+
this.lastXtermTime = 0;
|
|
62
|
+
}
|
|
63
|
+
recordEventXtermJs(timestamp, dir) {
|
|
64
|
+
const gap = this.lastXtermTime > 0 ? timestamp - this.lastXtermTime : WHEEL_DECAY_IDLE_MS + 1;
|
|
65
|
+
this.lastXtermTime = timestamp;
|
|
66
|
+
if (gap > WHEEL_DECAY_IDLE_MS) {
|
|
67
|
+
this.xtermMult = WHEEL_DECAY_KICK;
|
|
68
|
+
this.xtermFrac = 0;
|
|
69
|
+
} else {
|
|
70
|
+
const momentum = Math.pow(0.5, gap / WHEEL_DECAY_HALFLIFE_MS);
|
|
71
|
+
const target = 1 + WHEEL_DECAY_STEP * momentum / (1 - momentum);
|
|
72
|
+
const cap = gap >= WHEEL_DECAY_GAP_MS ? WHEEL_DECAY_CAP_SLOW : WHEEL_DECAY_CAP_FAST;
|
|
73
|
+
this.xtermMult = Math.min(target, cap);
|
|
74
|
+
}
|
|
75
|
+
const exact = this.xtermMult + this.xtermFrac;
|
|
76
|
+
const step = Math.floor(exact);
|
|
77
|
+
this.xtermFrac = exact - step;
|
|
78
|
+
return step;
|
|
79
|
+
}
|
|
80
|
+
recordEventNative(timestamp, dir, viewportHeight) {
|
|
81
|
+
this.timestamps.push(timestamp);
|
|
82
|
+
if (this.timestamps.length > MAX_HISTORY) {
|
|
83
|
+
this.timestamps = this.timestamps.slice(-MAX_HISTORY);
|
|
84
|
+
}
|
|
85
|
+
if (this.wheelMode && timestamp - this.lastWheelModeTime > WHEEL_MODE_IDLE_DISENGAGE_MS) {
|
|
86
|
+
this.wheelMode = false;
|
|
87
|
+
this.wheelModeMult = this.base;
|
|
88
|
+
this.burstCount = 0;
|
|
89
|
+
}
|
|
90
|
+
if (this.pendingFlip) {
|
|
91
|
+
const flipGap = timestamp - this.pendingFlip.time;
|
|
92
|
+
if (dir === this.lastDir && flipGap <= WHEEL_BOUNCE_GAP_MAX_MS) {
|
|
93
|
+
this.wheelMode = true;
|
|
94
|
+
this.wheelModeMult = this.base;
|
|
95
|
+
this.lastWheelModeTime = timestamp;
|
|
96
|
+
this.burstCount = 0;
|
|
97
|
+
this.pendingFlip = null;
|
|
98
|
+
} else {
|
|
99
|
+
this.lastDir = this.pendingFlip.dir;
|
|
100
|
+
this.wheelModeMult = this.base;
|
|
101
|
+
this.burstCount = 0;
|
|
102
|
+
this.pendingFlip = null;
|
|
103
|
+
this.lastDir = dir;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
if (this.lastDir !== 0 && dir !== this.lastDir && !this.pendingFlip) {
|
|
107
|
+
this.pendingFlip = { dir, time: timestamp };
|
|
108
|
+
return 0;
|
|
109
|
+
}
|
|
110
|
+
this.lastDir = dir;
|
|
111
|
+
const windowStart = timestamp - WINDOW_MS;
|
|
112
|
+
const recent = this.timestamps.filter((t) => t >= windowStart);
|
|
113
|
+
if (recent.length >= 2) {
|
|
114
|
+
const lastGap = recent[recent.length - 1] - recent[recent.length - 2];
|
|
115
|
+
if (lastGap < TRACKPAD_BURST_GAP_MS) {
|
|
116
|
+
this.burstCount++;
|
|
117
|
+
} else {
|
|
118
|
+
this.burstCount = 0;
|
|
119
|
+
}
|
|
120
|
+
if (this.burstCount >= TRACKPAD_BURST_COUNT_THRESHOLD) {
|
|
121
|
+
this.wheelMode = false;
|
|
122
|
+
this.wheelModeMult = this.base;
|
|
123
|
+
return this.base;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
if (recent.length >= 2) {
|
|
127
|
+
const intervals = [];
|
|
128
|
+
for (let i = 1; i < recent.length; i++) {
|
|
129
|
+
intervals.push(recent[i] - recent[i - 1]);
|
|
130
|
+
}
|
|
131
|
+
const avgInterval = intervals.reduce((a, b) => a + b, 0) / intervals.length;
|
|
132
|
+
if (avgInterval < TRACKPAD_AVG_THRESHOLD_MS) {
|
|
133
|
+
return this.base;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
if (this.wheelMode) {
|
|
137
|
+
const gap = timestamp - this.lastWheelModeTime;
|
|
138
|
+
this.lastWheelModeTime = timestamp;
|
|
139
|
+
const momentum = Math.pow(0.5, gap / WHEEL_DECAY_HALFLIFE_MS);
|
|
140
|
+
const target = this.base + WHEEL_MODE_STEP * momentum / (1 - momentum);
|
|
141
|
+
const cappedTarget = Math.min(target, WHEEL_MODE_CAP);
|
|
142
|
+
if (cappedTarget > this.wheelModeMult) {
|
|
143
|
+
this.wheelModeMult = Math.min(this.wheelModeMult + WHEEL_MODE_RAMP, cappedTarget);
|
|
144
|
+
} else {
|
|
145
|
+
this.wheelModeMult = cappedTarget;
|
|
146
|
+
}
|
|
147
|
+
return Math.round(this.wheelModeMult);
|
|
148
|
+
}
|
|
149
|
+
const maxStep = viewportHeight ? Math.max(1, Math.floor(viewportHeight / 2)) : MAX_STEP_FALLBACK;
|
|
150
|
+
const rampMult = this.base + Math.min(recent.length, maxStep / this.base) * WHEEL_ACCEL_STEP;
|
|
151
|
+
return Math.min(Math.round(rampMult), WHEEL_ACCEL_MAX);
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
export {
|
|
156
|
+
WheelAccelerator
|
|
157
|
+
};
|
|
@@ -0,0 +1,515 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ensureSession,
|
|
3
|
+
showCommandPanel
|
|
4
|
+
} from "./chunk-JO5ANTMR.js";
|
|
5
|
+
import {
|
|
6
|
+
decidePermission
|
|
7
|
+
} from "./chunk-DDXS2RDZ.js";
|
|
8
|
+
import {
|
|
9
|
+
appendSystemEvent,
|
|
10
|
+
budgetToolResultTranscriptContent,
|
|
11
|
+
createEvidenceRecord,
|
|
12
|
+
rememberEvidence
|
|
13
|
+
} from "./chunk-64MJP6FK.js";
|
|
14
|
+
import {
|
|
15
|
+
sanitizeDiagnosticText,
|
|
16
|
+
truncateDisplay,
|
|
17
|
+
writeLine
|
|
18
|
+
} from "./chunk-OMZYPQVA.js";
|
|
19
|
+
|
|
20
|
+
// src/capability-runtime.ts
|
|
21
|
+
import { randomUUID } from "crypto";
|
|
22
|
+
import { basename } from "path";
|
|
23
|
+
var TRANSPORT_PRIORITY = [
|
|
24
|
+
"desktop_bridge",
|
|
25
|
+
"websocket",
|
|
26
|
+
"http",
|
|
27
|
+
"mcp",
|
|
28
|
+
"plugin",
|
|
29
|
+
"mock"
|
|
30
|
+
];
|
|
31
|
+
var registry = /* @__PURE__ */ new Map();
|
|
32
|
+
var providers = /* @__PURE__ */ new Map();
|
|
33
|
+
var externalConnectionResolver;
|
|
34
|
+
function registerCapability(definition, options = {}) {
|
|
35
|
+
const entries = registry.get(definition.id) ?? [];
|
|
36
|
+
const next = entries.filter((entry) => entry.projectPath !== options.projectPath);
|
|
37
|
+
next.push({ definition, projectPath: options.projectPath });
|
|
38
|
+
registry.set(definition.id, next);
|
|
39
|
+
}
|
|
40
|
+
function unregisterCapabilitiesByApp(appId, options = {}) {
|
|
41
|
+
for (const [id, entries] of registry.entries()) {
|
|
42
|
+
const next = entries.filter((entry) => {
|
|
43
|
+
if (entry.definition.appId !== appId) return true;
|
|
44
|
+
return options.projectPath !== void 0 && entry.projectPath !== options.projectPath;
|
|
45
|
+
});
|
|
46
|
+
if (next.length === 0) {
|
|
47
|
+
registry.delete(id);
|
|
48
|
+
} else {
|
|
49
|
+
registry.set(id, next);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
function listCapabilities(context) {
|
|
54
|
+
return [...registry.values()].map((entries) => selectCapabilityEntry(entries, context)).filter((entry) => Boolean(entry)).map((entry) => entry.definition).sort((a, b) => a.id.localeCompare(b.id));
|
|
55
|
+
}
|
|
56
|
+
function findCapability(id, context) {
|
|
57
|
+
const entries = registry.get(id);
|
|
58
|
+
const entry = entries ? selectCapabilityEntry(entries, context) : void 0;
|
|
59
|
+
if (!entry) return void 0;
|
|
60
|
+
return entry.definition;
|
|
61
|
+
}
|
|
62
|
+
function resolveCapabilityConnection(definition, context) {
|
|
63
|
+
const external = externalConnectionResolver?.(definition, context);
|
|
64
|
+
if (external) return external;
|
|
65
|
+
const transport = TRANSPORT_PRIORITY.includes(definition.transport) ? definition.transport : definition.transport;
|
|
66
|
+
if (transport === "mock") {
|
|
67
|
+
return {
|
|
68
|
+
capabilityId: definition.id,
|
|
69
|
+
transport,
|
|
70
|
+
status: "connected",
|
|
71
|
+
summary: "mock provider ready"
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
const needsAuth = definition.auth !== "none";
|
|
75
|
+
return {
|
|
76
|
+
capabilityId: definition.id,
|
|
77
|
+
transport,
|
|
78
|
+
status: needsAuth ? "needs_configuration" : "not_connected",
|
|
79
|
+
summary: needsAuth ? "connector reserved; auth is not configured in this MVP" : "connector reserved; no live connection in this MVP"
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
async function executeCapability(request, context) {
|
|
83
|
+
const definition = findCapability(request.capabilityId, context);
|
|
84
|
+
if (!definition) {
|
|
85
|
+
return {
|
|
86
|
+
ok: false,
|
|
87
|
+
capabilityId: request.capabilityId,
|
|
88
|
+
summary: "Capability not found.",
|
|
89
|
+
metadata: {
|
|
90
|
+
transport: "mock",
|
|
91
|
+
auth: "none",
|
|
92
|
+
permission: "read",
|
|
93
|
+
riskLevel: "low",
|
|
94
|
+
connectionStatus: "unsupported"
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
const schemaError = validateCapabilityInput(definition, request.input);
|
|
99
|
+
if (schemaError) {
|
|
100
|
+
return buildFailedCapabilityResult(definition, schemaError, "unsupported");
|
|
101
|
+
}
|
|
102
|
+
const connection = resolveCapabilityConnection(definition, context);
|
|
103
|
+
if (connection.status !== "connected") {
|
|
104
|
+
return buildFailedCapabilityResult(definition, connection.summary, connection.status);
|
|
105
|
+
}
|
|
106
|
+
const permission = await checkCapabilityPermission(definition, request, context);
|
|
107
|
+
if (permission.decision !== "allow") {
|
|
108
|
+
return buildFailedCapabilityResult(
|
|
109
|
+
definition,
|
|
110
|
+
permission.decision === "deny" ? `Permission denied: ${permission.reason}` : `Permission required: ${permission.reason}`,
|
|
111
|
+
connection.status
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
const provider = providers.get(definition.transport);
|
|
115
|
+
if (!provider) {
|
|
116
|
+
return buildFailedCapabilityResult(
|
|
117
|
+
definition,
|
|
118
|
+
"Capability provider unavailable.",
|
|
119
|
+
"unsupported"
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
const result = await provider.execute(definition, request, context);
|
|
123
|
+
const sessionId = await ensureSession(context);
|
|
124
|
+
const outcome = result.ok ? "succeeded" : "failed";
|
|
125
|
+
const evidence = createEvidenceRecord(
|
|
126
|
+
"command_output",
|
|
127
|
+
`capability ${outcome} ${definition.id}: ${truncateDisplay(result.summary, 120)}`,
|
|
128
|
+
`capability:${definition.id}`,
|
|
129
|
+
[
|
|
130
|
+
"capability_execution",
|
|
131
|
+
definition.id,
|
|
132
|
+
definition.permission,
|
|
133
|
+
definition.transport,
|
|
134
|
+
"not_verification_pass",
|
|
135
|
+
result.ok ? "capability_success" : "capability_failure"
|
|
136
|
+
]
|
|
137
|
+
);
|
|
138
|
+
if (result.artifactRef) {
|
|
139
|
+
evidence.fullOutputPath = result.artifactRef;
|
|
140
|
+
evidence.outputPath = result.artifactRef;
|
|
141
|
+
}
|
|
142
|
+
rememberEvidence(context, evidence);
|
|
143
|
+
await context.store.appendEvent(sessionId, {
|
|
144
|
+
type: "evidence_record",
|
|
145
|
+
...evidence
|
|
146
|
+
});
|
|
147
|
+
await appendSystemEvent(
|
|
148
|
+
context,
|
|
149
|
+
sessionId,
|
|
150
|
+
[
|
|
151
|
+
`capability ${outcome} id=${definition.id}`,
|
|
152
|
+
`transport=${definition.transport}`,
|
|
153
|
+
`permission=${definition.permission}`,
|
|
154
|
+
`risk=${definition.riskLevel}`,
|
|
155
|
+
`evidence=${evidence.id}`,
|
|
156
|
+
result.artifactRef ? `artifact=${basename(result.artifactRef)}` : "artifact=none",
|
|
157
|
+
"verification=not_pass"
|
|
158
|
+
].join(" "),
|
|
159
|
+
result.ok ? "info" : "warning"
|
|
160
|
+
);
|
|
161
|
+
return {
|
|
162
|
+
...result,
|
|
163
|
+
evidenceId: evidence.id,
|
|
164
|
+
metadata: {
|
|
165
|
+
...result.metadata,
|
|
166
|
+
connectionStatus: connection.status
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
function capabilityEntryVisible(entry, context) {
|
|
171
|
+
if (!entry.projectPath) return true;
|
|
172
|
+
return context?.projectPath === entry.projectPath;
|
|
173
|
+
}
|
|
174
|
+
function selectCapabilityEntry(entries, context) {
|
|
175
|
+
const projectEntry = context ? entries.find((entry) => entry.projectPath === context.projectPath) : void 0;
|
|
176
|
+
if (projectEntry) return projectEntry;
|
|
177
|
+
return entries.find((entry) => capabilityEntryVisible(entry, context));
|
|
178
|
+
}
|
|
179
|
+
function formatCapabilityDoctor(language = "zh-CN", context) {
|
|
180
|
+
const isEn = language === "en-US";
|
|
181
|
+
const lines = [
|
|
182
|
+
isEn ? "Capability doctor" : "Capability doctor",
|
|
183
|
+
isEn ? "- Runtime: Capability Runtime with mock provider and project-scoped Local HTTP connectors." : "- \u8FD0\u884C\u65F6\uFF1ACapability Runtime\uFF1Bmock provider \u5168\u5C40\u53EF\u7528\uFF0CLocal HTTP connector \u6309\u9879\u76EE\u9694\u79BB\u3002"
|
|
184
|
+
];
|
|
185
|
+
for (const item of listCapabilities(context)) {
|
|
186
|
+
const connection = resolveCapabilityConnection(item, context);
|
|
187
|
+
lines.push(
|
|
188
|
+
sanitizeCapabilityDisplayText(
|
|
189
|
+
`- ${item.id}: availability=${formatCapabilityAvailability(item, connection)}; ${connection.status}; transport=${item.transport}; auth=${item.auth}; permission=${item.permission}; ${connection.summary}`
|
|
190
|
+
)
|
|
191
|
+
);
|
|
192
|
+
}
|
|
193
|
+
return lines.join("\n");
|
|
194
|
+
}
|
|
195
|
+
function formatCapabilityAvailability(definition, connection) {
|
|
196
|
+
if (connection.status === "unsupported") {
|
|
197
|
+
return "not_implemented/unsupported (not a usable capability)";
|
|
198
|
+
}
|
|
199
|
+
if (definition.transport === "mock") {
|
|
200
|
+
return "mock/demo (diagnostic only; not a real external capability)";
|
|
201
|
+
}
|
|
202
|
+
if (connection.status === "connected") {
|
|
203
|
+
return "real/connected";
|
|
204
|
+
}
|
|
205
|
+
if (connection.status === "needs_configuration") {
|
|
206
|
+
return "reserved/needs_configuration (not usable until configured)";
|
|
207
|
+
}
|
|
208
|
+
return "reserved/not_connected (not usable until connected)";
|
|
209
|
+
}
|
|
210
|
+
function registerCapabilityProvider(provider) {
|
|
211
|
+
providers.set(provider.transport, provider);
|
|
212
|
+
}
|
|
213
|
+
function setCapabilityConnectionResolver(resolver) {
|
|
214
|
+
externalConnectionResolver = resolver;
|
|
215
|
+
}
|
|
216
|
+
function formatCapabilityList(language = "zh-CN", context) {
|
|
217
|
+
const isEn = language === "en-US";
|
|
218
|
+
const lines = [isEn ? "Capabilities" : "Capabilities"];
|
|
219
|
+
for (const item of listCapabilities(context)) {
|
|
220
|
+
lines.push(sanitizeCapabilityDisplayText(`- ${item.title}: ${item.description}`));
|
|
221
|
+
}
|
|
222
|
+
lines.push(isEn ? "Details: /capabilities doctor" : "\u8BE6\u60C5\uFF1A/capabilities doctor");
|
|
223
|
+
return lines.join("\n");
|
|
224
|
+
}
|
|
225
|
+
function formatCapabilityResult(result, language = "zh-CN") {
|
|
226
|
+
const isEn = language === "en-US";
|
|
227
|
+
const summary = [
|
|
228
|
+
sanitizeCapabilityDisplayText(result.summary),
|
|
229
|
+
result.artifactRef ? isEn ? "Artifact ref recorded; use details to inspect it." : "Artifact ref \u5DF2\u8BB0\u5F55\uFF1B\u9700\u8981\u65F6\u770B details\u3002" : isEn ? "No artifact was created." : "\u672A\u521B\u5EFA artifact\u3002",
|
|
230
|
+
result.ok ? isEn ? "Capability execution is not verification PASS." : "Capability execution \u4E0D\u7B49\u4E8E\u9A8C\u8BC1\u901A\u8FC7\u3002" : isEn ? "Capability failed; failure is not verification PASS." : "Capability failed\uFF1B\u5931\u8D25\u4E0D\u7B49\u4E8E\u9A8C\u8BC1\u901A\u8FC7\u3002"
|
|
231
|
+
];
|
|
232
|
+
const details = [
|
|
233
|
+
`capability: ${result.capabilityId}`,
|
|
234
|
+
`transport: ${result.metadata.transport}`,
|
|
235
|
+
`auth: ${result.metadata.auth}`,
|
|
236
|
+
`permission: ${result.metadata.permission}`,
|
|
237
|
+
`risk: ${result.metadata.riskLevel}`,
|
|
238
|
+
`connection: ${result.metadata.connectionStatus}`,
|
|
239
|
+
result.evidenceId ? `evidence: ${result.evidenceId}` : void 0,
|
|
240
|
+
result.artifactRef ? `artifact: ${result.artifactRef}` : void 0,
|
|
241
|
+
result.rollbackRef ? `rollbackRef: ${result.rollbackRef}` : void 0,
|
|
242
|
+
result.previewRef ? `previewRef: ${result.previewRef}` : void 0,
|
|
243
|
+
result.details
|
|
244
|
+
].filter((line) => Boolean(line));
|
|
245
|
+
return { summary, detailsText: sanitizeCapabilityDisplayText(details.join("\n")) };
|
|
246
|
+
}
|
|
247
|
+
async function handleCapabilitiesCommand(args, context, output) {
|
|
248
|
+
const action = args[0] ?? "list";
|
|
249
|
+
if (action === "list") {
|
|
250
|
+
showCommandPanel(context, output, {
|
|
251
|
+
title: "/capabilities",
|
|
252
|
+
tone: "neutral",
|
|
253
|
+
summary: formatCapabilityList(context.language, context).split("\n"),
|
|
254
|
+
actions: ["/capabilities doctor", "/capabilities run <capabilityId> <json>"],
|
|
255
|
+
detailsText: listCapabilities(context).map(
|
|
256
|
+
(item) => sanitizeCapabilityDisplayText(
|
|
257
|
+
`${item.id}
|
|
258
|
+
- app: ${item.appId}
|
|
259
|
+
- transport: ${item.transport}
|
|
260
|
+
- auth: ${item.auth}
|
|
261
|
+
- permission: ${item.permission}
|
|
262
|
+
- risk: ${item.riskLevel}`
|
|
263
|
+
)
|
|
264
|
+
).join("\n\n")
|
|
265
|
+
});
|
|
266
|
+
return;
|
|
267
|
+
}
|
|
268
|
+
if (action === "doctor") {
|
|
269
|
+
showCommandPanel(context, output, {
|
|
270
|
+
title: "/capabilities doctor",
|
|
271
|
+
tone: "neutral",
|
|
272
|
+
summary: formatCapabilityDoctor(context.language, context).split("\n").slice(0, 6),
|
|
273
|
+
actions: ["/capabilities list", "/capabilities run <capabilityId> <json>"],
|
|
274
|
+
detailsText: formatCapabilityDoctor(context.language, context)
|
|
275
|
+
});
|
|
276
|
+
return;
|
|
277
|
+
}
|
|
278
|
+
if (action === "run") {
|
|
279
|
+
const capabilityId = args[1];
|
|
280
|
+
const json = args.slice(2).join(" ");
|
|
281
|
+
if (!capabilityId || !json) {
|
|
282
|
+
writeLine(output, "\u7528\u6CD5\uFF1A/capabilities run <capabilityId> <json>");
|
|
283
|
+
return;
|
|
284
|
+
}
|
|
285
|
+
const parsed = parseCapabilityInput(json);
|
|
286
|
+
if (!parsed.ok) {
|
|
287
|
+
writeLine(output, `Capability input JSON \u65E0\u6548\uFF1A${parsed.error}`);
|
|
288
|
+
return;
|
|
289
|
+
}
|
|
290
|
+
const result = await executeCapability(
|
|
291
|
+
{ capabilityId, input: parsed.value, source: "slash" },
|
|
292
|
+
context
|
|
293
|
+
);
|
|
294
|
+
const formatted = formatCapabilityResult(result, context.language);
|
|
295
|
+
showCommandPanel(context, output, {
|
|
296
|
+
title: "/capabilities run",
|
|
297
|
+
tone: result.ok ? "neutral" : "warning",
|
|
298
|
+
summary: formatted.summary,
|
|
299
|
+
actions: ["/capabilities doctor", "/details evidence <id>"],
|
|
300
|
+
detailsText: formatted.detailsText
|
|
301
|
+
});
|
|
302
|
+
return;
|
|
303
|
+
}
|
|
304
|
+
writeLine(
|
|
305
|
+
output,
|
|
306
|
+
"\u7528\u6CD5\uFF1A/capabilities list | /capabilities doctor | /capabilities run <capabilityId> <json>"
|
|
307
|
+
);
|
|
308
|
+
}
|
|
309
|
+
function sanitizeCapabilityDisplayText(text) {
|
|
310
|
+
return sanitizeDiagnosticText(text).replace(
|
|
311
|
+
/(api[_-]?key|apiKey|token|Authorization)(\s*[:=]\s*)(Bearer\s+)?[^\s;&,)}\]]+/giu,
|
|
312
|
+
"$1$2***"
|
|
313
|
+
).replace(/sk-[A-Za-z0-9_-]+/gu, "sk-***");
|
|
314
|
+
}
|
|
315
|
+
function parseCapabilityInput(json) {
|
|
316
|
+
try {
|
|
317
|
+
const value = JSON.parse(json);
|
|
318
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
319
|
+
return { ok: false, error: "input must be a JSON object" };
|
|
320
|
+
}
|
|
321
|
+
return { ok: true, value };
|
|
322
|
+
} catch (error) {
|
|
323
|
+
return { ok: false, error: error instanceof Error ? error.message : String(error) };
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
function validateCapabilityInput(definition, input) {
|
|
327
|
+
const required = definition.inputSchema.required;
|
|
328
|
+
if (!Array.isArray(required)) return void 0;
|
|
329
|
+
for (const key of required) {
|
|
330
|
+
if (typeof key === "string" && !(key in input)) {
|
|
331
|
+
return `Missing required input: ${key}`;
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
return void 0;
|
|
335
|
+
}
|
|
336
|
+
async function checkCapabilityPermission(definition, request, context) {
|
|
337
|
+
const sessionId = await ensureSession(context);
|
|
338
|
+
const toolName = capabilityPermissionToolName(definition.permission);
|
|
339
|
+
return decidePermission(
|
|
340
|
+
toolName,
|
|
341
|
+
buildPermissionInput(definition, request.input, toolName),
|
|
342
|
+
context,
|
|
343
|
+
sessionId
|
|
344
|
+
);
|
|
345
|
+
}
|
|
346
|
+
function capabilityPermissionToolName(permission) {
|
|
347
|
+
if (permission === "read") return "Read";
|
|
348
|
+
if (permission === "bash") return "Bash";
|
|
349
|
+
if (permission === "network") return "Bash";
|
|
350
|
+
return "Write";
|
|
351
|
+
}
|
|
352
|
+
function buildPermissionInput(definition, input, toolName) {
|
|
353
|
+
if (toolName === "Read") {
|
|
354
|
+
return { path: definition.id };
|
|
355
|
+
}
|
|
356
|
+
if (toolName === "Bash") {
|
|
357
|
+
return {
|
|
358
|
+
command: definition.permission === "network" ? `capability network ${definition.id}` : `capability bash ${definition.id}`
|
|
359
|
+
};
|
|
360
|
+
}
|
|
361
|
+
return {
|
|
362
|
+
path: `.linghun/capabilities/${definition.id}.json`,
|
|
363
|
+
content: JSON.stringify({ capabilityId: definition.id, inputKeys: Object.keys(input) })
|
|
364
|
+
};
|
|
365
|
+
}
|
|
366
|
+
function buildFailedCapabilityResult(definition, summary, status) {
|
|
367
|
+
return {
|
|
368
|
+
ok: false,
|
|
369
|
+
capabilityId: definition.id,
|
|
370
|
+
summary,
|
|
371
|
+
metadata: {
|
|
372
|
+
transport: definition.transport,
|
|
373
|
+
auth: definition.auth,
|
|
374
|
+
permission: definition.permission,
|
|
375
|
+
riskLevel: definition.riskLevel,
|
|
376
|
+
connectionStatus: status
|
|
377
|
+
}
|
|
378
|
+
};
|
|
379
|
+
}
|
|
380
|
+
registerCapabilityProvider({
|
|
381
|
+
transport: "mock",
|
|
382
|
+
async execute(definition, request, context) {
|
|
383
|
+
if (definition.id === "mock.echo.read") {
|
|
384
|
+
const text = typeof request.input.text === "string" ? request.input.text : "";
|
|
385
|
+
return {
|
|
386
|
+
ok: true,
|
|
387
|
+
capabilityId: definition.id,
|
|
388
|
+
summary: `Echo ready: ${truncateDisplay(text.replace(/\s+/g, " "), 120)}`,
|
|
389
|
+
metadata: {
|
|
390
|
+
transport: definition.transport,
|
|
391
|
+
auth: definition.auth,
|
|
392
|
+
permission: definition.permission,
|
|
393
|
+
riskLevel: definition.riskLevel,
|
|
394
|
+
connectionStatus: "connected"
|
|
395
|
+
}
|
|
396
|
+
};
|
|
397
|
+
}
|
|
398
|
+
if (definition.id === "mock.canvas.create") {
|
|
399
|
+
const title = typeof request.input.title === "string" ? request.input.title : "Untitled";
|
|
400
|
+
return {
|
|
401
|
+
ok: true,
|
|
402
|
+
capabilityId: definition.id,
|
|
403
|
+
summary: `Canvas created: ${truncateDisplay(title, 80)}`,
|
|
404
|
+
previewRef: `mock-preview:${randomUUID()}`,
|
|
405
|
+
rollbackRef: `mock-rollback:${randomUUID()}`,
|
|
406
|
+
metadata: {
|
|
407
|
+
transport: definition.transport,
|
|
408
|
+
auth: definition.auth,
|
|
409
|
+
permission: definition.permission,
|
|
410
|
+
riskLevel: definition.riskLevel,
|
|
411
|
+
connectionStatus: "connected"
|
|
412
|
+
}
|
|
413
|
+
};
|
|
414
|
+
}
|
|
415
|
+
if (definition.id === "mock.canvas.export") {
|
|
416
|
+
const payload = `mock canvas export
|
|
417
|
+
${"x".repeat(6e4)}`;
|
|
418
|
+
const sessionId = await ensureSession(context);
|
|
419
|
+
const budgeted = await budgetToolResultTranscriptContent(
|
|
420
|
+
context,
|
|
421
|
+
sessionId,
|
|
422
|
+
`capability-${definition.id}`,
|
|
423
|
+
payload
|
|
424
|
+
);
|
|
425
|
+
const artifact = context.evidence.find(
|
|
426
|
+
(item) => item.supportsClaims.includes(`toolUseId:capability-${definition.id}`)
|
|
427
|
+
);
|
|
428
|
+
return {
|
|
429
|
+
ok: true,
|
|
430
|
+
capabilityId: definition.id,
|
|
431
|
+
summary: typeof budgeted === "string" && budgeted.startsWith("<persisted-tool-result>") ? "Canvas export prepared; large output stored as artifact ref." : "Canvas export prepared.",
|
|
432
|
+
artifactRef: artifact?.fullOutputPath ?? artifact?.outputPath ?? "mock-artifact:canvas-export",
|
|
433
|
+
details: "Export payload is represented by summary plus artifact/ref only.",
|
|
434
|
+
metadata: {
|
|
435
|
+
transport: definition.transport,
|
|
436
|
+
auth: definition.auth,
|
|
437
|
+
permission: definition.permission,
|
|
438
|
+
riskLevel: definition.riskLevel,
|
|
439
|
+
connectionStatus: "connected"
|
|
440
|
+
}
|
|
441
|
+
};
|
|
442
|
+
}
|
|
443
|
+
return buildFailedCapabilityResult(
|
|
444
|
+
definition,
|
|
445
|
+
"Mock capability not implemented.",
|
|
446
|
+
"unsupported"
|
|
447
|
+
);
|
|
448
|
+
}
|
|
449
|
+
});
|
|
450
|
+
registerCapability({
|
|
451
|
+
id: "mock.echo.read",
|
|
452
|
+
appId: "mock.echo",
|
|
453
|
+
title: "Mock Echo Read",
|
|
454
|
+
description: "Read-only echo capability for runtime checks.",
|
|
455
|
+
category: "diagnostic",
|
|
456
|
+
intents: ["echo", "read capability", "capability smoke"],
|
|
457
|
+
keywords: ["echo", "read", "mock", "capability"],
|
|
458
|
+
transport: "mock",
|
|
459
|
+
auth: "none",
|
|
460
|
+
permission: "read",
|
|
461
|
+
riskLevel: "low",
|
|
462
|
+
inputSchema: { type: "object", required: ["text"] },
|
|
463
|
+
outputSchema: { type: "object", required: ["summary"] },
|
|
464
|
+
supportsRollback: false,
|
|
465
|
+
supportsPreview: false
|
|
466
|
+
});
|
|
467
|
+
registerCapability({
|
|
468
|
+
id: "mock.canvas.create",
|
|
469
|
+
appId: "mock.canvas",
|
|
470
|
+
title: "Mock Canvas Create",
|
|
471
|
+
description: "Simulates creating a canvas in an external app.",
|
|
472
|
+
category: "canvas",
|
|
473
|
+
intents: ["create canvas", "draw", "external app"],
|
|
474
|
+
keywords: ["canvas", "draw", "\u753B\u5E03", "\u753B\u56FE", "external app"],
|
|
475
|
+
transport: "mock",
|
|
476
|
+
auth: "none",
|
|
477
|
+
permission: "external_app",
|
|
478
|
+
riskLevel: "medium",
|
|
479
|
+
inputSchema: { type: "object", required: ["title"] },
|
|
480
|
+
outputSchema: { type: "object", required: ["summary"] },
|
|
481
|
+
supportsRollback: true,
|
|
482
|
+
supportsPreview: true
|
|
483
|
+
});
|
|
484
|
+
registerCapability({
|
|
485
|
+
id: "mock.canvas.export",
|
|
486
|
+
appId: "mock.canvas",
|
|
487
|
+
title: "Mock Canvas Export",
|
|
488
|
+
description: "Simulates exporting a canvas artifact ref.",
|
|
489
|
+
category: "canvas",
|
|
490
|
+
intents: ["export canvas", "artifact", "external app"],
|
|
491
|
+
keywords: ["canvas", "export", "artifact", "\u5BFC\u51FA", "\u753B\u5E03"],
|
|
492
|
+
transport: "mock",
|
|
493
|
+
auth: "none",
|
|
494
|
+
permission: "external_app",
|
|
495
|
+
riskLevel: "medium",
|
|
496
|
+
inputSchema: { type: "object", required: ["format"] },
|
|
497
|
+
outputSchema: { type: "object", required: ["summary", "artifactRef"] },
|
|
498
|
+
supportsRollback: false,
|
|
499
|
+
supportsPreview: false
|
|
500
|
+
});
|
|
501
|
+
|
|
502
|
+
export {
|
|
503
|
+
registerCapability,
|
|
504
|
+
unregisterCapabilitiesByApp,
|
|
505
|
+
listCapabilities,
|
|
506
|
+
findCapability,
|
|
507
|
+
resolveCapabilityConnection,
|
|
508
|
+
executeCapability,
|
|
509
|
+
formatCapabilityDoctor,
|
|
510
|
+
registerCapabilityProvider,
|
|
511
|
+
setCapabilityConnectionResolver,
|
|
512
|
+
formatCapabilityList,
|
|
513
|
+
formatCapabilityResult,
|
|
514
|
+
handleCapabilitiesCommand
|
|
515
|
+
};
|