@daniel156161/prism 0.2.98 → 0.2.101

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.
Files changed (1188) hide show
  1. package/README.md +2 -2
  2. package/dist/pi/pi-env.d.ts +1 -1
  3. package/dist/pi/pi-env.js +1 -1
  4. package/dist/pi/pi-native.js +2 -1
  5. package/dist/pi/pi-native.js.map +1 -1
  6. package/dist/pi/pi-package-command.d.ts +1 -0
  7. package/dist/pi/pi-package-command.js +6 -0
  8. package/dist/pi/pi-package-command.js.map +1 -0
  9. package/node_modules/@earendil-works/pi-agent-core/dist/harness/skills.d.ts +3 -2
  10. package/node_modules/@earendil-works/pi-agent-core/dist/harness/skills.d.ts.map +1 -1
  11. package/node_modules/@earendil-works/pi-agent-core/dist/harness/skills.js +13 -3
  12. package/node_modules/@earendil-works/pi-agent-core/dist/harness/skills.js.map +1 -1
  13. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/edit.d.ts.map +1 -1
  14. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/edit.js +14 -1
  15. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/edit.js.map +1 -1
  16. package/node_modules/@earendil-works/pi-agent-core/package.json +4 -4
  17. package/node_modules/@earendil-works/pi-ai/README.md +5 -3
  18. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.d.ts.map +1 -1
  19. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js +34 -19
  20. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js.map +1 -1
  21. package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.d.ts +2 -0
  22. package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.d.ts.map +1 -1
  23. package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.js +9 -2
  24. package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.js.map +1 -1
  25. package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.d.ts.map +1 -1
  26. package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.js +131 -7
  27. package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.js.map +1 -1
  28. package/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.d.ts +2 -2
  29. package/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.d.ts.map +1 -1
  30. package/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.js +17 -13
  31. package/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.js.map +1 -1
  32. package/node_modules/@earendil-works/pi-ai/dist/api/google-shared.d.ts +5 -2
  33. package/node_modules/@earendil-works/pi-ai/dist/api/google-shared.d.ts.map +1 -1
  34. package/node_modules/@earendil-works/pi-ai/dist/api/google-shared.js +16 -0
  35. package/node_modules/@earendil-works/pi-ai/dist/api/google-shared.js.map +1 -1
  36. package/node_modules/@earendil-works/pi-ai/dist/api/google-vertex.d.ts +2 -2
  37. package/node_modules/@earendil-works/pi-ai/dist/api/google-vertex.d.ts.map +1 -1
  38. package/node_modules/@earendil-works/pi-ai/dist/api/google-vertex.js +15 -11
  39. package/node_modules/@earendil-works/pi-ai/dist/api/google-vertex.js.map +1 -1
  40. package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.d.ts.map +1 -1
  41. package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.js +6 -1
  42. package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.js.map +1 -1
  43. package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.d.ts.map +1 -1
  44. package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js +4 -1
  45. package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js.map +1 -1
  46. package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.d.ts +3 -2
  47. package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.d.ts.map +1 -1
  48. package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js +128 -86
  49. package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js.map +1 -1
  50. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.d.ts.map +1 -1
  51. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js +6 -2
  52. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js.map +1 -1
  53. package/node_modules/@earendil-works/pi-ai/dist/api/pi-messages.d.ts.map +1 -1
  54. package/node_modules/@earendil-works/pi-ai/dist/api/pi-messages.js +1 -1
  55. package/node_modules/@earendil-works/pi-ai/dist/api/pi-messages.js.map +1 -1
  56. package/node_modules/@earendil-works/pi-ai/dist/api/simple-options.d.ts +4 -0
  57. package/node_modules/@earendil-works/pi-ai/dist/api/simple-options.d.ts.map +1 -1
  58. package/node_modules/@earendil-works/pi-ai/dist/api/simple-options.js +17 -10
  59. package/node_modules/@earendil-works/pi-ai/dist/api/simple-options.js.map +1 -1
  60. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/device-code.d.ts +1 -0
  61. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/device-code.d.ts.map +1 -1
  62. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/device-code.js +1 -1
  63. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/device-code.js.map +1 -1
  64. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/github-copilot.d.ts.map +1 -1
  65. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/github-copilot.js +98 -34
  66. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/github-copilot.js.map +1 -1
  67. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/kimi-coding.d.ts.map +1 -1
  68. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/kimi-coding.js +1 -14
  69. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/kimi-coding.js.map +1 -1
  70. package/node_modules/@earendil-works/pi-ai/dist/index.d.ts +1 -1
  71. package/node_modules/@earendil-works/pi-ai/dist/index.d.ts.map +1 -1
  72. package/node_modules/@earendil-works/pi-ai/dist/index.js.map +1 -1
  73. package/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
  74. package/node_modules/@earendil-works/pi-ai/dist/providers/data/amazon-bedrock.json +1 -1
  75. package/node_modules/@earendil-works/pi-ai/dist/providers/data/anthropic.json +1 -1
  76. package/node_modules/@earendil-works/pi-ai/dist/providers/data/baseten.json +1 -1
  77. package/node_modules/@earendil-works/pi-ai/dist/providers/data/cerebras.json +1 -1
  78. package/node_modules/@earendil-works/pi-ai/dist/providers/data/cloudflare-ai-gateway.json +1 -1
  79. package/node_modules/@earendil-works/pi-ai/dist/providers/data/cloudflare-workers-ai.json +1 -1
  80. package/node_modules/@earendil-works/pi-ai/dist/providers/data/github-copilot.json +1 -1
  81. package/node_modules/@earendil-works/pi-ai/dist/providers/data/google-vertex.json +1 -1
  82. package/node_modules/@earendil-works/pi-ai/dist/providers/data/google.json +1 -1
  83. package/node_modules/@earendil-works/pi-ai/dist/providers/data/huggingface.json +1 -1
  84. package/node_modules/@earendil-works/pi-ai/dist/providers/data/nvidia.json +1 -1
  85. package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode-go.json +1 -1
  86. package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode.json +1 -1
  87. package/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -1
  88. package/node_modules/@earendil-works/pi-ai/dist/providers/data/qwen-token-plan-cn.json +1 -1
  89. package/node_modules/@earendil-works/pi-ai/dist/providers/data/qwen-token-plan-individual.json +1 -1
  90. package/node_modules/@earendil-works/pi-ai/dist/providers/data/qwen-token-plan.json +1 -1
  91. package/node_modules/@earendil-works/pi-ai/dist/providers/data/together.json +1 -1
  92. package/node_modules/@earendil-works/pi-ai/dist/providers/data/vercel-ai-gateway.json +1 -1
  93. package/node_modules/@earendil-works/pi-ai/dist/providers/data/xai.json +1 -1
  94. package/node_modules/@earendil-works/pi-ai/dist/providers/data/xiaomi-token-plan-ams.json +1 -1
  95. package/node_modules/@earendil-works/pi-ai/dist/providers/data/xiaomi-token-plan-cn.json +1 -1
  96. package/node_modules/@earendil-works/pi-ai/dist/providers/data/xiaomi-token-plan-sgp.json +1 -1
  97. package/node_modules/@earendil-works/pi-ai/dist/providers/data/xiaomi.json +1 -1
  98. package/node_modules/@earendil-works/pi-ai/dist/providers/data/zai-coding-cn.json +1 -1
  99. package/node_modules/@earendil-works/pi-ai/dist/providers/data/zai.json +1 -1
  100. package/node_modules/@earendil-works/pi-ai/dist/providers/xai.d.ts +1 -1
  101. package/node_modules/@earendil-works/pi-ai/dist/providers/xai.d.ts.map +1 -1
  102. package/node_modules/@earendil-works/pi-ai/dist/providers/xai.js +1 -5
  103. package/node_modules/@earendil-works/pi-ai/dist/providers/xai.js.map +1 -1
  104. package/node_modules/@earendil-works/pi-ai/dist/types.d.ts +29 -4
  105. package/node_modules/@earendil-works/pi-ai/dist/types.d.ts.map +1 -1
  106. package/node_modules/@earendil-works/pi-ai/dist/types.js.map +1 -1
  107. package/node_modules/@earendil-works/pi-ai/dist/utils/sleep.d.ts +2 -0
  108. package/node_modules/@earendil-works/pi-ai/dist/utils/sleep.d.ts.map +1 -0
  109. package/node_modules/@earendil-works/pi-ai/dist/utils/sleep.js +15 -0
  110. package/node_modules/@earendil-works/pi-ai/dist/utils/sleep.js.map +1 -0
  111. package/node_modules/@earendil-works/pi-ai/package.json +3 -4
  112. package/node_modules/@earendil-works/pi-client/CHANGELOG.md +4 -0
  113. package/node_modules/@earendil-works/pi-client/package.json +2 -2
  114. package/node_modules/@earendil-works/pi-coding-agent/CHANGELOG.md +83 -0
  115. package/node_modules/@earendil-works/pi-coding-agent/README.md +8 -4
  116. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/anthropic-messages-JWX2WP65.js +45 -0
  117. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/anthropic.js +75 -0
  118. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/azure-openai-responses-5ENVCQ7U.js +2 -0
  119. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/bedrock-converse-stream.js +74 -0
  120. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-4L3WN2XY.js +2 -0
  121. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-6CYCI3EJ.js +12 -0
  122. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-6R7UI4IY.js +2 -0
  123. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-AXIIZGTV.js +2 -0
  124. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-DRQDKNXA.js +2 -0
  125. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-E5KXRMZK.js +1547 -0
  126. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-GMWCTUPB.js +2 -0
  127. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-GPPBJGBU.js +50 -0
  128. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-JUUC5AZY.js +2 -0
  129. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-L2ZPNLYD.js +2 -0
  130. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-MNAIPA3J.js +2 -0
  131. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-NBBFIJUL.js +11 -0
  132. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-NUHFSC37.js +25 -0
  133. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-PGXDEOVV.js +2 -0
  134. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-PJACZCIR.js +2 -0
  135. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-PRRNXB7S.js +2 -0
  136. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-TEPMHNKQ.js +2 -0
  137. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-TRDNDS6A.js +4 -0
  138. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-UAQELI3K.js +2 -0
  139. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-XDUWOHPL.js +6 -0
  140. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-XNGRGP62.js +2 -0
  141. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/dist-RDWOYWHR.js +13 -0
  142. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/github-copilot.js +2 -0
  143. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/google-generative-ai-XDKMGBCJ.js +2 -0
  144. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/google-vertex-D5FGEO3Y.js +2 -0
  145. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/image-resize-worker.js +2 -0
  146. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/kimi-coding.js +2 -0
  147. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/lib-HGQMNYVT.js +9 -0
  148. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/mistral-conversations-YK73UAOZ.js +5 -0
  149. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/multipart-parser-SQ6GDJL7.js +3 -0
  150. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/openai-codex-responses-GJVBJXLB.js +8 -0
  151. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/openai-codex.js +75 -0
  152. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/openai-completions-JD4WAC3R.js +7 -0
  153. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/openai-responses-BSOJMSEV.js +2 -0
  154. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/openrouter-images-N4XVVFSD.js +2 -0
  155. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/openrouter.js +75 -0
  156. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/pi-messages-TPFH44NP.js +8 -0
  157. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/radius.js +75 -0
  158. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/src-UK77SYZE.js +4 -0
  159. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/xai.js +2 -0
  160. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/cli.js +3 -0
  161. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/client.js +2 -0
  162. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/index.js +2 -0
  163. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/rpc-entry.js +3 -0
  164. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/args.d.ts +1 -0
  165. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/args.d.ts.map +1 -1
  166. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/args.js +29 -9
  167. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/args.js.map +1 -1
  168. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/file-processor.d.ts.map +1 -1
  169. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/file-processor.js +2 -1
  170. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/file-processor.js.map +1 -1
  171. package/node_modules/@earendil-works/pi-coding-agent/dist/config.d.ts +4 -3
  172. package/node_modules/@earendil-works/pi-coding-agent/dist/config.d.ts.map +1 -1
  173. package/node_modules/@earendil-works/pi-coding-agent/dist/config.js +22 -14
  174. package/node_modules/@earendil-works/pi-coding-agent/dist/config.js.map +1 -1
  175. package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.d.ts +26 -7
  176. package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.d.ts.map +1 -1
  177. package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.js +163 -95
  178. package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.js.map +1 -1
  179. package/node_modules/@earendil-works/pi-coding-agent/dist/core/auth-storage.d.ts.map +1 -1
  180. package/node_modules/@earendil-works/pi-coding-agent/dist/core/auth-storage.js +6 -7
  181. package/node_modules/@earendil-works/pi-coding-agent/dist/core/auth-storage.js.map +1 -1
  182. package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/branch-summarization.d.ts.map +1 -1
  183. package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/branch-summarization.js +3 -0
  184. package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/branch-summarization.js.map +1 -1
  185. package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/compaction.d.ts +4 -3
  186. package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/compaction.d.ts.map +1 -1
  187. package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/compaction.js +41 -32
  188. package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/compaction.js.map +1 -1
  189. package/node_modules/@earendil-works/pi-coding-agent/dist/core/defaults.d.ts +1 -0
  190. package/node_modules/@earendil-works/pi-coding-agent/dist/core/defaults.d.ts.map +1 -1
  191. package/node_modules/@earendil-works/pi-coding-agent/dist/core/defaults.js +9 -0
  192. package/node_modules/@earendil-works/pi-coding-agent/dist/core/defaults.js.map +1 -1
  193. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/index.d.ts +2 -2
  194. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/index.d.ts.map +1 -1
  195. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/index.js +1 -1
  196. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/index.js.map +1 -1
  197. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/loader.d.ts.map +1 -1
  198. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/loader.js +115 -48
  199. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/loader.js.map +1 -1
  200. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/types.d.ts +38 -9
  201. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/types.d.ts.map +1 -1
  202. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/types.js +3 -0
  203. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/types.js.map +1 -1
  204. package/node_modules/@earendil-works/pi-coding-agent/dist/core/footer-data-provider.d.ts +1 -1
  205. package/node_modules/@earendil-works/pi-coding-agent/dist/core/footer-data-provider.d.ts.map +1 -1
  206. package/node_modules/@earendil-works/pi-coding-agent/dist/core/footer-data-provider.js +1 -1
  207. package/node_modules/@earendil-works/pi-coding-agent/dist/core/footer-data-provider.js.map +1 -1
  208. package/node_modules/@earendil-works/pi-coding-agent/dist/core/keybindings.d.ts +20 -19
  209. package/node_modules/@earendil-works/pi-coding-agent/dist/core/keybindings.d.ts.map +1 -1
  210. package/node_modules/@earendil-works/pi-coding-agent/dist/core/keybindings.js +26 -5
  211. package/node_modules/@earendil-works/pi-coding-agent/dist/core/keybindings.js.map +1 -1
  212. package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-config.d.ts +5 -0
  213. package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-config.d.ts.map +1 -1
  214. package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-config.js +3 -1
  215. package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-config.js.map +1 -1
  216. package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-resolver.d.ts +1 -0
  217. package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-resolver.d.ts.map +1 -1
  218. package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-resolver.js +14 -8
  219. package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-resolver.js.map +1 -1
  220. package/node_modules/@earendil-works/pi-coding-agent/dist/core/models-store.d.ts.map +1 -1
  221. package/node_modules/@earendil-works/pi-coding-agent/dist/core/models-store.js +2 -1
  222. package/node_modules/@earendil-works/pi-coding-agent/dist/core/models-store.js.map +1 -1
  223. package/node_modules/@earendil-works/pi-coding-agent/dist/core/package-manager.d.ts.map +1 -1
  224. package/node_modules/@earendil-works/pi-coding-agent/dist/core/package-manager.js +22 -14
  225. package/node_modules/@earendil-works/pi-coding-agent/dist/core/package-manager.js.map +1 -1
  226. package/node_modules/@earendil-works/pi-coding-agent/dist/core/pi-manifest.d.ts.map +1 -1
  227. package/node_modules/@earendil-works/pi-coding-agent/dist/core/pi-manifest.js +2 -1
  228. package/node_modules/@earendil-works/pi-coding-agent/dist/core/pi-manifest.js.map +1 -1
  229. package/node_modules/@earendil-works/pi-coding-agent/dist/core/remote-catalog-provider.d.ts.map +1 -1
  230. package/node_modules/@earendil-works/pi-coding-agent/dist/core/remote-catalog-provider.js +2 -1
  231. package/node_modules/@earendil-works/pi-coding-agent/dist/core/remote-catalog-provider.js.map +1 -1
  232. package/node_modules/@earendil-works/pi-coding-agent/dist/core/resource-loader.d.ts.map +1 -1
  233. package/node_modules/@earendil-works/pi-coding-agent/dist/core/resource-loader.js +3 -2
  234. package/node_modules/@earendil-works/pi-coding-agent/dist/core/resource-loader.js.map +1 -1
  235. package/node_modules/@earendil-works/pi-coding-agent/dist/core/sdk.d.ts +2 -2
  236. package/node_modules/@earendil-works/pi-coding-agent/dist/core/sdk.d.ts.map +1 -1
  237. package/node_modules/@earendil-works/pi-coding-agent/dist/core/sdk.js +10 -3
  238. package/node_modules/@earendil-works/pi-coding-agent/dist/core/sdk.js.map +1 -1
  239. package/node_modules/@earendil-works/pi-coding-agent/dist/core/session-export.d.ts +4 -0
  240. package/node_modules/@earendil-works/pi-coding-agent/dist/core/session-export.d.ts.map +1 -0
  241. package/node_modules/@earendil-works/pi-coding-agent/dist/core/session-export.js +32 -0
  242. package/node_modules/@earendil-works/pi-coding-agent/dist/core/session-export.js.map +1 -0
  243. package/node_modules/@earendil-works/pi-coding-agent/dist/core/session-manager.d.ts.map +1 -1
  244. package/node_modules/@earendil-works/pi-coding-agent/dist/core/session-manager.js +2 -1
  245. package/node_modules/@earendil-works/pi-coding-agent/dist/core/session-manager.js.map +1 -1
  246. package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-diagnostics.d.ts +9 -0
  247. package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-diagnostics.d.ts.map +1 -0
  248. package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-diagnostics.js +21 -0
  249. package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-diagnostics.js.map +1 -0
  250. package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-manager.d.ts +9 -0
  251. package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-manager.d.ts.map +1 -1
  252. package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-manager.js +52 -10
  253. package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-manager.js.map +1 -1
  254. package/node_modules/@earendil-works/pi-coding-agent/dist/core/skills.d.ts.map +1 -1
  255. package/node_modules/@earendil-works/pi-coding-agent/dist/core/skills.js +51 -33
  256. package/node_modules/@earendil-works/pi-coding-agent/dist/core/skills.js.map +1 -1
  257. package/node_modules/@earendil-works/pi-coding-agent/dist/core/slash-commands.d.ts.map +1 -1
  258. package/node_modules/@earendil-works/pi-coding-agent/dist/core/slash-commands.js +2 -1
  259. package/node_modules/@earendil-works/pi-coding-agent/dist/core/slash-commands.js.map +1 -1
  260. package/node_modules/@earendil-works/pi-coding-agent/dist/core/system-prompt.d.ts.map +1 -1
  261. package/node_modules/@earendil-works/pi-coding-agent/dist/core/system-prompt.js +11 -2
  262. package/node_modules/@earendil-works/pi-coding-agent/dist/core/system-prompt.js.map +1 -1
  263. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/bash.d.ts +14 -1
  264. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/bash.d.ts.map +1 -1
  265. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/bash.js +36 -20
  266. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/bash.js.map +1 -1
  267. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/edit-diff.d.ts +0 -5
  268. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/edit-diff.d.ts.map +1 -1
  269. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/edit-diff.js +2 -5
  270. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/edit-diff.js.map +1 -1
  271. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/edit.d.ts.map +1 -1
  272. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/edit.js +20 -4
  273. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/edit.js.map +1 -1
  274. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/index.d.ts +4 -1
  275. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/index.d.ts.map +1 -1
  276. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/index.js +18 -1
  277. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/index.js.map +1 -1
  278. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/powershell.d.ts +16 -0
  279. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/powershell.d.ts.map +1 -0
  280. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/powershell.js +39 -0
  281. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/powershell.js.map +1 -0
  282. package/node_modules/@earendil-works/pi-coding-agent/dist/core/trust-manager.d.ts.map +1 -1
  283. package/node_modules/@earendil-works/pi-coding-agent/dist/core/trust-manager.js +2 -1
  284. package/node_modules/@earendil-works/pi-coding-agent/dist/core/trust-manager.js.map +1 -1
  285. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/llama/index.d.ts.map +1 -1
  286. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/llama/index.js +2 -0
  287. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/llama/index.js.map +1 -1
  288. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/llama/provider.d.ts.map +1 -1
  289. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/llama/provider.js +6 -2
  290. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/llama/provider.js.map +1 -1
  291. package/node_modules/@earendil-works/pi-coding-agent/dist/index.d.ts +5 -5
  292. package/node_modules/@earendil-works/pi-coding-agent/dist/index.d.ts.map +1 -1
  293. package/node_modules/@earendil-works/pi-coding-agent/dist/index.js +4 -4
  294. package/node_modules/@earendil-works/pi-coding-agent/dist/index.js.map +1 -1
  295. package/node_modules/@earendil-works/pi-coding-agent/dist/main.d.ts +4 -0
  296. package/node_modules/@earendil-works/pi-coding-agent/dist/main.d.ts.map +1 -1
  297. package/node_modules/@earendil-works/pi-coding-agent/dist/main.js +18 -15
  298. package/node_modules/@earendil-works/pi-coding-agent/dist/main.js.map +1 -1
  299. package/node_modules/@earendil-works/pi-coding-agent/dist/migrations.d.ts.map +1 -1
  300. package/node_modules/@earendil-works/pi-coding-agent/dist/migrations.js +4 -3
  301. package/node_modules/@earendil-works/pi-coding-agent/dist/migrations.js.map +1 -1
  302. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/model-selector.d.ts +9 -3
  303. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
  304. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/model-selector.js +56 -12
  305. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/model-selector.js.map +1 -1
  306. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/settings-selector.d.ts +7 -2
  307. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  308. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/settings-selector.js +118 -56
  309. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/settings-selector.js.map +1 -1
  310. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/settings-submenu.d.ts +72 -0
  311. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/settings-submenu.d.ts.map +1 -0
  312. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/settings-submenu.js +165 -0
  313. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/settings-submenu.js.map +1 -0
  314. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/thinking-selector.d.ts +15 -3
  315. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -1
  316. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/thinking-selector.js +74 -17
  317. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/thinking-selector.js.map +1 -1
  318. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/external-editor.d.ts.map +1 -1
  319. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/external-editor.js +2 -1
  320. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/external-editor.js.map +1 -1
  321. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts +11 -0
  322. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  323. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.js +182 -112
  324. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
  325. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/session-share.d.ts +16 -0
  326. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/session-share.d.ts.map +1 -0
  327. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/session-share.js +188 -0
  328. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/session-share.js.map +1 -0
  329. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  330. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme.js +4 -3
  331. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme.js.map +1 -1
  332. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/json-event.d.ts +16 -13
  333. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/json-event.d.ts.map +1 -1
  334. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/json-event.js +20 -6
  335. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/json-event.js.map +1 -1
  336. package/node_modules/@earendil-works/pi-coding-agent/dist/package-manager-cli.d.ts +1 -0
  337. package/node_modules/@earendil-works/pi-coding-agent/dist/package-manager-cli.d.ts.map +1 -1
  338. package/node_modules/@earendil-works/pi-coding-agent/dist/package-manager-cli.js +186 -2
  339. package/node_modules/@earendil-works/pi-coding-agent/dist/package-manager-cli.js.map +1 -1
  340. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/frontmatter.d.ts.map +1 -1
  341. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/frontmatter.js +2 -1
  342. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/frontmatter.js.map +1 -1
  343. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/management-http.d.ts +5 -3
  344. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/management-http.d.ts.map +1 -1
  345. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/management-http.js +14 -10
  346. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/management-http.js.map +1 -1
  347. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/shell.d.ts +3 -0
  348. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/shell.d.ts.map +1 -1
  349. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/shell.js +17 -5
  350. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/shell.js.map +1 -1
  351. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/syntax-highlight.d.ts +1 -0
  352. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/syntax-highlight.d.ts.map +1 -1
  353. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/syntax-highlight.js +60 -1
  354. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/syntax-highlight.js.map +1 -1
  355. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/text.d.ts +8 -0
  356. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/text.d.ts.map +1 -0
  357. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/text.js +9 -0
  358. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/text.js.map +1 -0
  359. package/node_modules/@earendil-works/pi-coding-agent/docs/compaction.md +15 -0
  360. package/node_modules/@earendil-works/pi-coding-agent/docs/custom-provider.md +5 -2
  361. package/node_modules/@earendil-works/pi-coding-agent/docs/environment-variables.md +8 -8
  362. package/node_modules/@earendil-works/pi-coding-agent/docs/extensions.md +17 -7
  363. package/node_modules/@earendil-works/pi-coding-agent/docs/json.md +7 -2
  364. package/node_modules/@earendil-works/pi-coding-agent/docs/keybindings.md +8 -8
  365. package/node_modules/@earendil-works/pi-coding-agent/docs/llama-cpp.md +2 -0
  366. package/node_modules/@earendil-works/pi-coding-agent/docs/models.md +8 -2
  367. package/node_modules/@earendil-works/pi-coding-agent/docs/packages.md +2 -2
  368. package/node_modules/@earendil-works/pi-coding-agent/docs/rpc.md +9 -3
  369. package/node_modules/@earendil-works/pi-coding-agent/docs/sdk.md +7 -2
  370. package/node_modules/@earendil-works/pi-coding-agent/docs/settings.md +11 -3
  371. package/node_modules/@earendil-works/pi-coding-agent/docs/skills.md +4 -3
  372. package/node_modules/@earendil-works/pi-coding-agent/docs/terminal-setup.md +11 -9
  373. package/node_modules/@earendil-works/pi-coding-agent/docs/usage.md +6 -2
  374. package/node_modules/@earendil-works/pi-coding-agent/docs/windows.md +24 -2
  375. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/border-status-editor.ts +1 -1
  376. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  377. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/custom-provider-anthropic/package.json +1 -1
  378. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  379. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/git-checkpoint.ts +2 -2
  380. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/gondolin/package-lock.json +2 -2
  381. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/gondolin/package.json +1 -1
  382. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/notify.ts +3 -1
  383. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/sandbox/package-lock.json +2 -2
  384. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/sandbox/package.json +1 -1
  385. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/subagent/README.md +1 -1
  386. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/subagent/index.ts +6 -1
  387. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/titlebar-spinner.ts +1 -1
  388. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/with-deps/package-lock.json +2 -2
  389. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/with-deps/package.json +1 -1
  390. package/node_modules/@earendil-works/pi-coding-agent/examples/rpc-extension-ui.ts +1 -1
  391. package/node_modules/@earendil-works/pi-coding-agent/examples/sdk/06-extensions.ts +1 -1
  392. package/node_modules/@earendil-works/pi-coding-agent/examples/sdk/README.md +1 -1
  393. package/node_modules/@earendil-works/pi-coding-agent/package.json +12 -14
  394. package/node_modules/@earendil-works/pi-protocol/package.json +1 -1
  395. package/node_modules/@earendil-works/pi-telemetry/package.json +2 -2
  396. package/node_modules/@earendil-works/pi-tui/dist/components/markdown.d.ts.map +1 -1
  397. package/node_modules/@earendil-works/pi-tui/dist/components/markdown.js +9 -4
  398. package/node_modules/@earendil-works/pi-tui/dist/components/markdown.js.map +1 -1
  399. package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.d.ts +8 -2
  400. package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.d.ts.map +1 -1
  401. package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.js +24 -4
  402. package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.js.map +1 -1
  403. package/node_modules/@earendil-works/pi-tui/dist/components/text.d.ts.map +1 -1
  404. package/node_modules/@earendil-works/pi-tui/dist/components/text.js +5 -4
  405. package/node_modules/@earendil-works/pi-tui/dist/components/text.js.map +1 -1
  406. package/node_modules/@earendil-works/pi-tui/dist/keybindings.d.ts +2 -2
  407. package/node_modules/@earendil-works/pi-tui/dist/keybindings.d.ts.map +1 -1
  408. package/node_modules/@earendil-works/pi-tui/dist/keybindings.js +2 -2
  409. package/node_modules/@earendil-works/pi-tui/dist/keybindings.js.map +1 -1
  410. package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.d.ts.map +1 -1
  411. package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.js +2 -8
  412. package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.js.map +1 -1
  413. package/node_modules/@earendil-works/pi-tui/dist/native-module-path.d.ts +7 -0
  414. package/node_modules/@earendil-works/pi-tui/dist/native-module-path.d.ts.map +1 -0
  415. package/node_modules/@earendil-works/pi-tui/dist/native-module-path.js +19 -0
  416. package/node_modules/@earendil-works/pi-tui/dist/native-module-path.js.map +1 -0
  417. package/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts.map +1 -1
  418. package/node_modules/@earendil-works/pi-tui/dist/terminal.js +4 -10
  419. package/node_modules/@earendil-works/pi-tui/dist/terminal.js.map +1 -1
  420. package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.d.ts.map +1 -1
  421. package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.js +5 -1
  422. package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.js.map +1 -1
  423. package/node_modules/@earendil-works/pi-tui/package.json +1 -1
  424. package/node_modules/@types/node/README.md +1 -1
  425. package/node_modules/@types/node/buffer.buffer.d.ts +5 -5
  426. package/node_modules/@types/node/crypto.d.ts +2 -2
  427. package/node_modules/@types/node/http.d.ts +16 -0
  428. package/node_modules/@types/node/http2.d.ts +10 -2
  429. package/node_modules/@types/node/package.json +2 -2
  430. package/node_modules/@types/node/process.d.ts +52 -0
  431. package/node_modules/@types/node/quic.d.ts +210 -28
  432. package/node_modules/@types/node/sqlite.d.ts +6 -2
  433. package/node_modules/@types/node/test.d.ts +36 -0
  434. package/node_modules/brace-expansion/README.md +1 -2
  435. package/node_modules/brace-expansion/dist/commonjs/index.js +30 -4
  436. package/node_modules/brace-expansion/dist/commonjs/index.js.map +1 -1
  437. package/node_modules/brace-expansion/dist/esm/index.js +30 -4
  438. package/node_modules/brace-expansion/dist/esm/index.js.map +1 -1
  439. package/node_modules/brace-expansion/package.json +1 -1
  440. package/package.json +9 -9
  441. package/dist/prism-extensions/commands/voice-command.d.ts +0 -3
  442. package/dist/prism-extensions/commands/voice-command.js +0 -44
  443. package/dist/prism-extensions/commands/voice-command.js.map +0 -1
  444. package/dist/prism-extensions/core/voice-runtime.d.ts +0 -57
  445. package/dist/prism-extensions/core/voice-runtime.js +0 -313
  446. package/dist/prism-extensions/core/voice-runtime.js.map +0 -1
  447. package/dist/prism-extensions/core/voicebox-client.d.ts +0 -32
  448. package/dist/prism-extensions/core/voicebox-client.js +0 -194
  449. package/dist/prism-extensions/core/voicebox-client.js.map +0 -1
  450. package/dist/prism-extensions/core/voicebox-service.d.ts +0 -19
  451. package/dist/prism-extensions/core/voicebox-service.js +0 -122
  452. package/dist/prism-extensions/core/voicebox-service.js.map +0 -1
  453. package/dist/prism-extensions/integrations/honcho-memory.d.ts +0 -31
  454. package/dist/prism-extensions/integrations/honcho-memory.js +0 -281
  455. package/dist/prism-extensions/integrations/honcho-memory.js.map +0 -1
  456. package/node_modules/@opentelemetry/api/LICENSE +0 -201
  457. package/node_modules/@opentelemetry/api/README.md +0 -116
  458. package/node_modules/@opentelemetry/api/build/esm/api/context.d.ts +0 -41
  459. package/node_modules/@opentelemetry/api/build/esm/api/context.js +0 -110
  460. package/node_modules/@opentelemetry/api/build/esm/api/context.js.map +0 -1
  461. package/node_modules/@opentelemetry/api/build/esm/api/diag.d.ts +0 -30
  462. package/node_modules/@opentelemetry/api/build/esm/api/diag.js +0 -121
  463. package/node_modules/@opentelemetry/api/build/esm/api/diag.js.map +0 -1
  464. package/node_modules/@opentelemetry/api/build/esm/api/metrics.d.ts +0 -28
  465. package/node_modules/@opentelemetry/api/build/esm/api/metrics.js +0 -60
  466. package/node_modules/@opentelemetry/api/build/esm/api/metrics.js.map +0 -1
  467. package/node_modules/@opentelemetry/api/build/esm/api/propagation.d.ts +0 -49
  468. package/node_modules/@opentelemetry/api/build/esm/api/propagation.js +0 -89
  469. package/node_modules/@opentelemetry/api/build/esm/api/propagation.js.map +0 -1
  470. package/node_modules/@opentelemetry/api/build/esm/api/trace.d.ts +0 -40
  471. package/node_modules/@opentelemetry/api/build/esm/api/trace.js +0 -77
  472. package/node_modules/@opentelemetry/api/build/esm/api/trace.js.map +0 -1
  473. package/node_modules/@opentelemetry/api/build/esm/baggage/context-helpers.d.ts +0 -29
  474. package/node_modules/@opentelemetry/api/build/esm/baggage/context-helpers.js +0 -56
  475. package/node_modules/@opentelemetry/api/build/esm/baggage/context-helpers.js.map +0 -1
  476. package/node_modules/@opentelemetry/api/build/esm/baggage/internal/baggage-impl.d.ts +0 -12
  477. package/node_modules/@opentelemetry/api/build/esm/baggage/internal/baggage-impl.js +0 -98
  478. package/node_modules/@opentelemetry/api/build/esm/baggage/internal/baggage-impl.js.map +0 -1
  479. package/node_modules/@opentelemetry/api/build/esm/baggage/internal/symbol.d.ts +0 -5
  480. package/node_modules/@opentelemetry/api/build/esm/baggage/internal/symbol.js +0 -20
  481. package/node_modules/@opentelemetry/api/build/esm/baggage/internal/symbol.js.map +0 -1
  482. package/node_modules/@opentelemetry/api/build/esm/baggage/types.d.ts +0 -60
  483. package/node_modules/@opentelemetry/api/build/esm/baggage/types.js +0 -17
  484. package/node_modules/@opentelemetry/api/build/esm/baggage/types.js.map +0 -1
  485. package/node_modules/@opentelemetry/api/build/esm/baggage/utils.d.ts +0 -15
  486. package/node_modules/@opentelemetry/api/build/esm/baggage/utils.js +0 -47
  487. package/node_modules/@opentelemetry/api/build/esm/baggage/utils.js.map +0 -1
  488. package/node_modules/@opentelemetry/api/build/esm/common/Attributes.d.ts +0 -15
  489. package/node_modules/@opentelemetry/api/build/esm/common/Attributes.js +0 -17
  490. package/node_modules/@opentelemetry/api/build/esm/common/Attributes.js.map +0 -1
  491. package/node_modules/@opentelemetry/api/build/esm/common/Exception.d.ts +0 -26
  492. package/node_modules/@opentelemetry/api/build/esm/common/Exception.js +0 -17
  493. package/node_modules/@opentelemetry/api/build/esm/common/Exception.js.map +0 -1
  494. package/node_modules/@opentelemetry/api/build/esm/common/Time.d.ts +0 -20
  495. package/node_modules/@opentelemetry/api/build/esm/common/Time.js +0 -2
  496. package/node_modules/@opentelemetry/api/build/esm/common/Time.js.map +0 -1
  497. package/node_modules/@opentelemetry/api/build/esm/context/NoopContextManager.d.ts +0 -9
  498. package/node_modules/@opentelemetry/api/build/esm/context/NoopContextManager.js +0 -67
  499. package/node_modules/@opentelemetry/api/build/esm/context/NoopContextManager.js.map +0 -1
  500. package/node_modules/@opentelemetry/api/build/esm/context/context.d.ts +0 -6
  501. package/node_modules/@opentelemetry/api/build/esm/context/context.js +0 -52
  502. package/node_modules/@opentelemetry/api/build/esm/context/context.js.map +0 -1
  503. package/node_modules/@opentelemetry/api/build/esm/context/types.d.ts +0 -52
  504. package/node_modules/@opentelemetry/api/build/esm/context/types.js +0 -17
  505. package/node_modules/@opentelemetry/api/build/esm/context/types.js.map +0 -1
  506. package/node_modules/@opentelemetry/api/build/esm/context-api.d.ts +0 -4
  507. package/node_modules/@opentelemetry/api/build/esm/context-api.js +0 -21
  508. package/node_modules/@opentelemetry/api/build/esm/context-api.js.map +0 -1
  509. package/node_modules/@opentelemetry/api/build/esm/diag/ComponentLogger.d.ts +0 -20
  510. package/node_modules/@opentelemetry/api/build/esm/diag/ComponentLogger.js +0 -102
  511. package/node_modules/@opentelemetry/api/build/esm/diag/ComponentLogger.js.map +0 -1
  512. package/node_modules/@opentelemetry/api/build/esm/diag/consoleLogger.d.ts +0 -38
  513. package/node_modules/@opentelemetry/api/build/esm/diag/consoleLogger.js +0 -59
  514. package/node_modules/@opentelemetry/api/build/esm/diag/consoleLogger.js.map +0 -1
  515. package/node_modules/@opentelemetry/api/build/esm/diag/internal/logLevelLogger.d.ts +0 -3
  516. package/node_modules/@opentelemetry/api/build/esm/diag/internal/logLevelLogger.js +0 -41
  517. package/node_modules/@opentelemetry/api/build/esm/diag/internal/logLevelLogger.js.map +0 -1
  518. package/node_modules/@opentelemetry/api/build/esm/diag/internal/noopLogger.d.ts +0 -8
  519. package/node_modules/@opentelemetry/api/build/esm/diag/internal/noopLogger.js +0 -31
  520. package/node_modules/@opentelemetry/api/build/esm/diag/internal/noopLogger.js.map +0 -1
  521. package/node_modules/@opentelemetry/api/build/esm/diag/types.d.ts +0 -100
  522. package/node_modules/@opentelemetry/api/build/esm/diag/types.js +0 -41
  523. package/node_modules/@opentelemetry/api/build/esm/diag/types.js.map +0 -1
  524. package/node_modules/@opentelemetry/api/build/esm/diag-api.d.ts +0 -9
  525. package/node_modules/@opentelemetry/api/build/esm/diag-api.js +0 -26
  526. package/node_modules/@opentelemetry/api/build/esm/diag-api.js.map +0 -1
  527. package/node_modules/@opentelemetry/api/build/esm/experimental/index.d.ts +0 -3
  528. package/node_modules/@opentelemetry/api/build/esm/experimental/index.js +0 -17
  529. package/node_modules/@opentelemetry/api/build/esm/experimental/index.js.map +0 -1
  530. package/node_modules/@opentelemetry/api/build/esm/experimental/trace/SugaredOptions.d.ts +0 -13
  531. package/node_modules/@opentelemetry/api/build/esm/experimental/trace/SugaredOptions.js +0 -17
  532. package/node_modules/@opentelemetry/api/build/esm/experimental/trace/SugaredOptions.js.map +0 -1
  533. package/node_modules/@opentelemetry/api/build/esm/experimental/trace/SugaredTracer.d.ts +0 -64
  534. package/node_modules/@opentelemetry/api/build/esm/experimental/trace/SugaredTracer.js +0 -92
  535. package/node_modules/@opentelemetry/api/build/esm/experimental/trace/SugaredTracer.js.map +0 -1
  536. package/node_modules/@opentelemetry/api/build/esm/index.d.ts +0 -54
  537. package/node_modules/@opentelemetry/api/build/esm/index.js +0 -53
  538. package/node_modules/@opentelemetry/api/build/esm/index.js.map +0 -1
  539. package/node_modules/@opentelemetry/api/build/esm/internal/global-utils.d.ts +0 -18
  540. package/node_modules/@opentelemetry/api/build/esm/internal/global-utils.js +0 -59
  541. package/node_modules/@opentelemetry/api/build/esm/internal/global-utils.js.map +0 -1
  542. package/node_modules/@opentelemetry/api/build/esm/internal/semver.d.ts +0 -34
  543. package/node_modules/@opentelemetry/api/build/esm/internal/semver.js +0 -118
  544. package/node_modules/@opentelemetry/api/build/esm/internal/semver.js.map +0 -1
  545. package/node_modules/@opentelemetry/api/build/esm/metrics/Meter.d.ts +0 -110
  546. package/node_modules/@opentelemetry/api/build/esm/metrics/Meter.js +0 -17
  547. package/node_modules/@opentelemetry/api/build/esm/metrics/Meter.js.map +0 -1
  548. package/node_modules/@opentelemetry/api/build/esm/metrics/MeterProvider.d.ts +0 -17
  549. package/node_modules/@opentelemetry/api/build/esm/metrics/MeterProvider.js +0 -17
  550. package/node_modules/@opentelemetry/api/build/esm/metrics/MeterProvider.js.map +0 -1
  551. package/node_modules/@opentelemetry/api/build/esm/metrics/Metric.d.ts +0 -115
  552. package/node_modules/@opentelemetry/api/build/esm/metrics/Metric.js +0 -22
  553. package/node_modules/@opentelemetry/api/build/esm/metrics/Metric.js.map +0 -1
  554. package/node_modules/@opentelemetry/api/build/esm/metrics/NoopMeter.d.ts +0 -82
  555. package/node_modules/@opentelemetry/api/build/esm/metrics/NoopMeter.js +0 -181
  556. package/node_modules/@opentelemetry/api/build/esm/metrics/NoopMeter.js.map +0 -1
  557. package/node_modules/@opentelemetry/api/build/esm/metrics/NoopMeterProvider.d.ts +0 -11
  558. package/node_modules/@opentelemetry/api/build/esm/metrics/NoopMeterProvider.js +0 -31
  559. package/node_modules/@opentelemetry/api/build/esm/metrics/NoopMeterProvider.js.map +0 -1
  560. package/node_modules/@opentelemetry/api/build/esm/metrics/ObservableResult.d.ts +0 -31
  561. package/node_modules/@opentelemetry/api/build/esm/metrics/ObservableResult.js +0 -17
  562. package/node_modules/@opentelemetry/api/build/esm/metrics/ObservableResult.js.map +0 -1
  563. package/node_modules/@opentelemetry/api/build/esm/metrics-api.d.ts +0 -4
  564. package/node_modules/@opentelemetry/api/build/esm/metrics-api.js +0 -21
  565. package/node_modules/@opentelemetry/api/build/esm/metrics-api.js.map +0 -1
  566. package/node_modules/@opentelemetry/api/build/esm/platform/browser/globalThis.d.ts +0 -10
  567. package/node_modules/@opentelemetry/api/build/esm/platform/browser/globalThis.js +0 -35
  568. package/node_modules/@opentelemetry/api/build/esm/platform/browser/globalThis.js.map +0 -1
  569. package/node_modules/@opentelemetry/api/build/esm/platform/browser/index.d.ts +0 -2
  570. package/node_modules/@opentelemetry/api/build/esm/platform/browser/index.js +0 -17
  571. package/node_modules/@opentelemetry/api/build/esm/platform/browser/index.js.map +0 -1
  572. package/node_modules/@opentelemetry/api/build/esm/platform/index.d.ts +0 -2
  573. package/node_modules/@opentelemetry/api/build/esm/platform/index.js +0 -17
  574. package/node_modules/@opentelemetry/api/build/esm/platform/index.js.map +0 -1
  575. package/node_modules/@opentelemetry/api/build/esm/platform/node/globalThis.d.ts +0 -3
  576. package/node_modules/@opentelemetry/api/build/esm/platform/node/globalThis.js +0 -19
  577. package/node_modules/@opentelemetry/api/build/esm/platform/node/globalThis.js.map +0 -1
  578. package/node_modules/@opentelemetry/api/build/esm/platform/node/index.d.ts +0 -2
  579. package/node_modules/@opentelemetry/api/build/esm/platform/node/index.js +0 -17
  580. package/node_modules/@opentelemetry/api/build/esm/platform/node/index.js.map +0 -1
  581. package/node_modules/@opentelemetry/api/build/esm/propagation/NoopTextMapPropagator.d.ts +0 -13
  582. package/node_modules/@opentelemetry/api/build/esm/propagation/NoopTextMapPropagator.js +0 -34
  583. package/node_modules/@opentelemetry/api/build/esm/propagation/NoopTextMapPropagator.js.map +0 -1
  584. package/node_modules/@opentelemetry/api/build/esm/propagation/TextMapPropagator.d.ts +0 -84
  585. package/node_modules/@opentelemetry/api/build/esm/propagation/TextMapPropagator.js +0 -38
  586. package/node_modules/@opentelemetry/api/build/esm/propagation/TextMapPropagator.js.map +0 -1
  587. package/node_modules/@opentelemetry/api/build/esm/propagation-api.d.ts +0 -4
  588. package/node_modules/@opentelemetry/api/build/esm/propagation-api.js +0 -21
  589. package/node_modules/@opentelemetry/api/build/esm/propagation-api.js.map +0 -1
  590. package/node_modules/@opentelemetry/api/build/esm/trace/NonRecordingSpan.d.ts +0 -28
  591. package/node_modules/@opentelemetry/api/build/esm/trace/NonRecordingSpan.js +0 -68
  592. package/node_modules/@opentelemetry/api/build/esm/trace/NonRecordingSpan.js.map +0 -1
  593. package/node_modules/@opentelemetry/api/build/esm/trace/NoopTracer.d.ts +0 -14
  594. package/node_modules/@opentelemetry/api/build/esm/trace/NoopTracer.js +0 -76
  595. package/node_modules/@opentelemetry/api/build/esm/trace/NoopTracer.js.map +0 -1
  596. package/node_modules/@opentelemetry/api/build/esm/trace/NoopTracerProvider.d.ts +0 -13
  597. package/node_modules/@opentelemetry/api/build/esm/trace/NoopTracerProvider.js +0 -32
  598. package/node_modules/@opentelemetry/api/build/esm/trace/NoopTracerProvider.js.map +0 -1
  599. package/node_modules/@opentelemetry/api/build/esm/trace/ProxyTracer.d.ts +0 -27
  600. package/node_modules/@opentelemetry/api/build/esm/trace/ProxyTracer.js +0 -53
  601. package/node_modules/@opentelemetry/api/build/esm/trace/ProxyTracer.js.map +0 -1
  602. package/node_modules/@opentelemetry/api/build/esm/trace/ProxyTracerProvider.d.ts +0 -25
  603. package/node_modules/@opentelemetry/api/build/esm/trace/ProxyTracerProvider.js +0 -54
  604. package/node_modules/@opentelemetry/api/build/esm/trace/ProxyTracerProvider.js.map +0 -1
  605. package/node_modules/@opentelemetry/api/build/esm/trace/Sampler.d.ts +0 -31
  606. package/node_modules/@opentelemetry/api/build/esm/trace/Sampler.js +0 -17
  607. package/node_modules/@opentelemetry/api/build/esm/trace/Sampler.js.map +0 -1
  608. package/node_modules/@opentelemetry/api/build/esm/trace/SamplingResult.d.ts +0 -49
  609. package/node_modules/@opentelemetry/api/build/esm/trace/SamplingResult.js +0 -39
  610. package/node_modules/@opentelemetry/api/build/esm/trace/SamplingResult.js.map +0 -1
  611. package/node_modules/@opentelemetry/api/build/esm/trace/SpanOptions.d.ts +0 -23
  612. package/node_modules/@opentelemetry/api/build/esm/trace/SpanOptions.js +0 -17
  613. package/node_modules/@opentelemetry/api/build/esm/trace/SpanOptions.js.map +0 -1
  614. package/node_modules/@opentelemetry/api/build/esm/trace/attributes.d.ts +0 -10
  615. package/node_modules/@opentelemetry/api/build/esm/trace/attributes.js +0 -17
  616. package/node_modules/@opentelemetry/api/build/esm/trace/attributes.js.map +0 -1
  617. package/node_modules/@opentelemetry/api/build/esm/trace/context-utils.d.ts +0 -41
  618. package/node_modules/@opentelemetry/api/build/esm/trace/context-utils.js +0 -73
  619. package/node_modules/@opentelemetry/api/build/esm/trace/context-utils.js.map +0 -1
  620. package/node_modules/@opentelemetry/api/build/esm/trace/internal/tracestate-impl.d.ts +0 -22
  621. package/node_modules/@opentelemetry/api/build/esm/trace/internal/tracestate-impl.js +0 -102
  622. package/node_modules/@opentelemetry/api/build/esm/trace/internal/tracestate-impl.js.map +0 -1
  623. package/node_modules/@opentelemetry/api/build/esm/trace/internal/tracestate-validators.d.ts +0 -15
  624. package/node_modules/@opentelemetry/api/build/esm/trace/internal/tracestate-validators.js +0 -41
  625. package/node_modules/@opentelemetry/api/build/esm/trace/internal/tracestate-validators.js.map +0 -1
  626. package/node_modules/@opentelemetry/api/build/esm/trace/internal/utils.d.ts +0 -3
  627. package/node_modules/@opentelemetry/api/build/esm/trace/internal/utils.js +0 -20
  628. package/node_modules/@opentelemetry/api/build/esm/trace/internal/utils.js.map +0 -1
  629. package/node_modules/@opentelemetry/api/build/esm/trace/invalid-span-constants.d.ts +0 -5
  630. package/node_modules/@opentelemetry/api/build/esm/trace/invalid-span-constants.js +0 -24
  631. package/node_modules/@opentelemetry/api/build/esm/trace/invalid-span-constants.js.map +0 -1
  632. package/node_modules/@opentelemetry/api/build/esm/trace/link.d.ts +0 -26
  633. package/node_modules/@opentelemetry/api/build/esm/trace/link.js +0 -17
  634. package/node_modules/@opentelemetry/api/build/esm/trace/link.js.map +0 -1
  635. package/node_modules/@opentelemetry/api/build/esm/trace/span.d.ts +0 -120
  636. package/node_modules/@opentelemetry/api/build/esm/trace/span.js +0 -17
  637. package/node_modules/@opentelemetry/api/build/esm/trace/span.js.map +0 -1
  638. package/node_modules/@opentelemetry/api/build/esm/trace/span_context.d.ts +0 -53
  639. package/node_modules/@opentelemetry/api/build/esm/trace/span_context.js +0 -17
  640. package/node_modules/@opentelemetry/api/build/esm/trace/span_context.js.map +0 -1
  641. package/node_modules/@opentelemetry/api/build/esm/trace/span_kind.d.ts +0 -27
  642. package/node_modules/@opentelemetry/api/build/esm/trace/span_kind.js +0 -43
  643. package/node_modules/@opentelemetry/api/build/esm/trace/span_kind.js.map +0 -1
  644. package/node_modules/@opentelemetry/api/build/esm/trace/spancontext-utils.d.ts +0 -17
  645. package/node_modules/@opentelemetry/api/build/esm/trace/spancontext-utils.js +0 -42
  646. package/node_modules/@opentelemetry/api/build/esm/trace/spancontext-utils.js.map +0 -1
  647. package/node_modules/@opentelemetry/api/build/esm/trace/status.d.ts +0 -25
  648. package/node_modules/@opentelemetry/api/build/esm/trace/status.js +0 -20
  649. package/node_modules/@opentelemetry/api/build/esm/trace/status.js.map +0 -1
  650. package/node_modules/@opentelemetry/api/build/esm/trace/trace_flags.d.ts +0 -7
  651. package/node_modules/@opentelemetry/api/build/esm/trace/trace_flags.js +0 -23
  652. package/node_modules/@opentelemetry/api/build/esm/trace/trace_flags.js.map +0 -1
  653. package/node_modules/@opentelemetry/api/build/esm/trace/trace_state.d.ts +0 -38
  654. package/node_modules/@opentelemetry/api/build/esm/trace/trace_state.js +0 -17
  655. package/node_modules/@opentelemetry/api/build/esm/trace/trace_state.js.map +0 -1
  656. package/node_modules/@opentelemetry/api/build/esm/trace/tracer.d.ts +0 -71
  657. package/node_modules/@opentelemetry/api/build/esm/trace/tracer.js +0 -17
  658. package/node_modules/@opentelemetry/api/build/esm/trace/tracer.js.map +0 -1
  659. package/node_modules/@opentelemetry/api/build/esm/trace/tracer_options.d.ts +0 -10
  660. package/node_modules/@opentelemetry/api/build/esm/trace/tracer_options.js +0 -17
  661. package/node_modules/@opentelemetry/api/build/esm/trace/tracer_options.js.map +0 -1
  662. package/node_modules/@opentelemetry/api/build/esm/trace/tracer_provider.d.ts +0 -21
  663. package/node_modules/@opentelemetry/api/build/esm/trace/tracer_provider.js +0 -17
  664. package/node_modules/@opentelemetry/api/build/esm/trace/tracer_provider.js.map +0 -1
  665. package/node_modules/@opentelemetry/api/build/esm/trace-api.d.ts +0 -4
  666. package/node_modules/@opentelemetry/api/build/esm/trace-api.js +0 -21
  667. package/node_modules/@opentelemetry/api/build/esm/trace-api.js.map +0 -1
  668. package/node_modules/@opentelemetry/api/build/esm/version.d.ts +0 -2
  669. package/node_modules/@opentelemetry/api/build/esm/version.js +0 -18
  670. package/node_modules/@opentelemetry/api/build/esm/version.js.map +0 -1
  671. package/node_modules/@opentelemetry/api/build/esnext/api/context.d.ts +0 -41
  672. package/node_modules/@opentelemetry/api/build/esnext/api/context.js +0 -77
  673. package/node_modules/@opentelemetry/api/build/esnext/api/context.js.map +0 -1
  674. package/node_modules/@opentelemetry/api/build/esnext/api/diag.d.ts +0 -30
  675. package/node_modules/@opentelemetry/api/build/esnext/api/diag.js +0 -89
  676. package/node_modules/@opentelemetry/api/build/esnext/api/diag.js.map +0 -1
  677. package/node_modules/@opentelemetry/api/build/esnext/api/metrics.d.ts +0 -28
  678. package/node_modules/@opentelemetry/api/build/esnext/api/metrics.js +0 -57
  679. package/node_modules/@opentelemetry/api/build/esnext/api/metrics.js.map +0 -1
  680. package/node_modules/@opentelemetry/api/build/esnext/api/propagation.d.ts +0 -49
  681. package/node_modules/@opentelemetry/api/build/esnext/api/propagation.js +0 -85
  682. package/node_modules/@opentelemetry/api/build/esnext/api/propagation.js.map +0 -1
  683. package/node_modules/@opentelemetry/api/build/esnext/api/trace.d.ts +0 -40
  684. package/node_modules/@opentelemetry/api/build/esnext/api/trace.js +0 -75
  685. package/node_modules/@opentelemetry/api/build/esnext/api/trace.js.map +0 -1
  686. package/node_modules/@opentelemetry/api/build/esnext/baggage/context-helpers.d.ts +0 -29
  687. package/node_modules/@opentelemetry/api/build/esnext/baggage/context-helpers.js +0 -56
  688. package/node_modules/@opentelemetry/api/build/esnext/baggage/context-helpers.js.map +0 -1
  689. package/node_modules/@opentelemetry/api/build/esnext/baggage/internal/baggage-impl.d.ts +0 -12
  690. package/node_modules/@opentelemetry/api/build/esnext/baggage/internal/baggage-impl.js +0 -51
  691. package/node_modules/@opentelemetry/api/build/esnext/baggage/internal/baggage-impl.js.map +0 -1
  692. package/node_modules/@opentelemetry/api/build/esnext/baggage/internal/symbol.d.ts +0 -5
  693. package/node_modules/@opentelemetry/api/build/esnext/baggage/internal/symbol.js +0 -20
  694. package/node_modules/@opentelemetry/api/build/esnext/baggage/internal/symbol.js.map +0 -1
  695. package/node_modules/@opentelemetry/api/build/esnext/baggage/types.d.ts +0 -60
  696. package/node_modules/@opentelemetry/api/build/esnext/baggage/types.js +0 -17
  697. package/node_modules/@opentelemetry/api/build/esnext/baggage/types.js.map +0 -1
  698. package/node_modules/@opentelemetry/api/build/esnext/baggage/utils.d.ts +0 -15
  699. package/node_modules/@opentelemetry/api/build/esnext/baggage/utils.js +0 -46
  700. package/node_modules/@opentelemetry/api/build/esnext/baggage/utils.js.map +0 -1
  701. package/node_modules/@opentelemetry/api/build/esnext/common/Attributes.d.ts +0 -15
  702. package/node_modules/@opentelemetry/api/build/esnext/common/Attributes.js +0 -17
  703. package/node_modules/@opentelemetry/api/build/esnext/common/Attributes.js.map +0 -1
  704. package/node_modules/@opentelemetry/api/build/esnext/common/Exception.d.ts +0 -26
  705. package/node_modules/@opentelemetry/api/build/esnext/common/Exception.js +0 -17
  706. package/node_modules/@opentelemetry/api/build/esnext/common/Exception.js.map +0 -1
  707. package/node_modules/@opentelemetry/api/build/esnext/common/Time.d.ts +0 -20
  708. package/node_modules/@opentelemetry/api/build/esnext/common/Time.js +0 -2
  709. package/node_modules/@opentelemetry/api/build/esnext/common/Time.js.map +0 -1
  710. package/node_modules/@opentelemetry/api/build/esnext/context/NoopContextManager.d.ts +0 -9
  711. package/node_modules/@opentelemetry/api/build/esnext/context/NoopContextManager.js +0 -34
  712. package/node_modules/@opentelemetry/api/build/esnext/context/NoopContextManager.js.map +0 -1
  713. package/node_modules/@opentelemetry/api/build/esnext/context/context.d.ts +0 -6
  714. package/node_modules/@opentelemetry/api/build/esnext/context/context.js +0 -51
  715. package/node_modules/@opentelemetry/api/build/esnext/context/context.js.map +0 -1
  716. package/node_modules/@opentelemetry/api/build/esnext/context/types.d.ts +0 -52
  717. package/node_modules/@opentelemetry/api/build/esnext/context/types.js +0 -17
  718. package/node_modules/@opentelemetry/api/build/esnext/context/types.js.map +0 -1
  719. package/node_modules/@opentelemetry/api/build/esnext/context-api.d.ts +0 -4
  720. package/node_modules/@opentelemetry/api/build/esnext/context-api.js +0 -21
  721. package/node_modules/@opentelemetry/api/build/esnext/context-api.js.map +0 -1
  722. package/node_modules/@opentelemetry/api/build/esnext/diag/ComponentLogger.d.ts +0 -20
  723. package/node_modules/@opentelemetry/api/build/esnext/diag/ComponentLogger.js +0 -55
  724. package/node_modules/@opentelemetry/api/build/esnext/diag/ComponentLogger.js.map +0 -1
  725. package/node_modules/@opentelemetry/api/build/esnext/diag/consoleLogger.d.ts +0 -38
  726. package/node_modules/@opentelemetry/api/build/esnext/diag/consoleLogger.js +0 -53
  727. package/node_modules/@opentelemetry/api/build/esnext/diag/consoleLogger.js.map +0 -1
  728. package/node_modules/@opentelemetry/api/build/esnext/diag/internal/logLevelLogger.d.ts +0 -3
  729. package/node_modules/@opentelemetry/api/build/esnext/diag/internal/logLevelLogger.js +0 -41
  730. package/node_modules/@opentelemetry/api/build/esnext/diag/internal/logLevelLogger.js.map +0 -1
  731. package/node_modules/@opentelemetry/api/build/esnext/diag/internal/noopLogger.d.ts +0 -8
  732. package/node_modules/@opentelemetry/api/build/esnext/diag/internal/noopLogger.js +0 -31
  733. package/node_modules/@opentelemetry/api/build/esnext/diag/internal/noopLogger.js.map +0 -1
  734. package/node_modules/@opentelemetry/api/build/esnext/diag/types.d.ts +0 -100
  735. package/node_modules/@opentelemetry/api/build/esnext/diag/types.js +0 -41
  736. package/node_modules/@opentelemetry/api/build/esnext/diag/types.js.map +0 -1
  737. package/node_modules/@opentelemetry/api/build/esnext/diag-api.d.ts +0 -9
  738. package/node_modules/@opentelemetry/api/build/esnext/diag-api.js +0 -26
  739. package/node_modules/@opentelemetry/api/build/esnext/diag-api.js.map +0 -1
  740. package/node_modules/@opentelemetry/api/build/esnext/experimental/index.d.ts +0 -3
  741. package/node_modules/@opentelemetry/api/build/esnext/experimental/index.js +0 -17
  742. package/node_modules/@opentelemetry/api/build/esnext/experimental/index.js.map +0 -1
  743. package/node_modules/@opentelemetry/api/build/esnext/experimental/trace/SugaredOptions.d.ts +0 -13
  744. package/node_modules/@opentelemetry/api/build/esnext/experimental/trace/SugaredOptions.js +0 -17
  745. package/node_modules/@opentelemetry/api/build/esnext/experimental/trace/SugaredOptions.js.map +0 -1
  746. package/node_modules/@opentelemetry/api/build/esnext/experimental/trace/SugaredTracer.d.ts +0 -64
  747. package/node_modules/@opentelemetry/api/build/esnext/experimental/trace/SugaredTracer.js +0 -88
  748. package/node_modules/@opentelemetry/api/build/esnext/experimental/trace/SugaredTracer.js.map +0 -1
  749. package/node_modules/@opentelemetry/api/build/esnext/index.d.ts +0 -54
  750. package/node_modules/@opentelemetry/api/build/esnext/index.js +0 -53
  751. package/node_modules/@opentelemetry/api/build/esnext/index.js.map +0 -1
  752. package/node_modules/@opentelemetry/api/build/esnext/internal/global-utils.d.ts +0 -18
  753. package/node_modules/@opentelemetry/api/build/esnext/internal/global-utils.js +0 -58
  754. package/node_modules/@opentelemetry/api/build/esnext/internal/global-utils.js.map +0 -1
  755. package/node_modules/@opentelemetry/api/build/esnext/internal/semver.d.ts +0 -34
  756. package/node_modules/@opentelemetry/api/build/esnext/internal/semver.js +0 -118
  757. package/node_modules/@opentelemetry/api/build/esnext/internal/semver.js.map +0 -1
  758. package/node_modules/@opentelemetry/api/build/esnext/metrics/Meter.d.ts +0 -110
  759. package/node_modules/@opentelemetry/api/build/esnext/metrics/Meter.js +0 -17
  760. package/node_modules/@opentelemetry/api/build/esnext/metrics/Meter.js.map +0 -1
  761. package/node_modules/@opentelemetry/api/build/esnext/metrics/MeterProvider.d.ts +0 -17
  762. package/node_modules/@opentelemetry/api/build/esnext/metrics/MeterProvider.js +0 -17
  763. package/node_modules/@opentelemetry/api/build/esnext/metrics/MeterProvider.js.map +0 -1
  764. package/node_modules/@opentelemetry/api/build/esnext/metrics/Metric.d.ts +0 -115
  765. package/node_modules/@opentelemetry/api/build/esnext/metrics/Metric.js +0 -22
  766. package/node_modules/@opentelemetry/api/build/esnext/metrics/Metric.js.map +0 -1
  767. package/node_modules/@opentelemetry/api/build/esnext/metrics/NoopMeter.d.ts +0 -82
  768. package/node_modules/@opentelemetry/api/build/esnext/metrics/NoopMeter.js +0 -113
  769. package/node_modules/@opentelemetry/api/build/esnext/metrics/NoopMeter.js.map +0 -1
  770. package/node_modules/@opentelemetry/api/build/esnext/metrics/NoopMeterProvider.d.ts +0 -11
  771. package/node_modules/@opentelemetry/api/build/esnext/metrics/NoopMeterProvider.js +0 -27
  772. package/node_modules/@opentelemetry/api/build/esnext/metrics/NoopMeterProvider.js.map +0 -1
  773. package/node_modules/@opentelemetry/api/build/esnext/metrics/ObservableResult.d.ts +0 -31
  774. package/node_modules/@opentelemetry/api/build/esnext/metrics/ObservableResult.js +0 -17
  775. package/node_modules/@opentelemetry/api/build/esnext/metrics/ObservableResult.js.map +0 -1
  776. package/node_modules/@opentelemetry/api/build/esnext/metrics-api.d.ts +0 -4
  777. package/node_modules/@opentelemetry/api/build/esnext/metrics-api.js +0 -21
  778. package/node_modules/@opentelemetry/api/build/esnext/metrics-api.js.map +0 -1
  779. package/node_modules/@opentelemetry/api/build/esnext/platform/browser/globalThis.d.ts +0 -10
  780. package/node_modules/@opentelemetry/api/build/esnext/platform/browser/globalThis.js +0 -35
  781. package/node_modules/@opentelemetry/api/build/esnext/platform/browser/globalThis.js.map +0 -1
  782. package/node_modules/@opentelemetry/api/build/esnext/platform/browser/index.d.ts +0 -2
  783. package/node_modules/@opentelemetry/api/build/esnext/platform/browser/index.js +0 -17
  784. package/node_modules/@opentelemetry/api/build/esnext/platform/browser/index.js.map +0 -1
  785. package/node_modules/@opentelemetry/api/build/esnext/platform/index.d.ts +0 -2
  786. package/node_modules/@opentelemetry/api/build/esnext/platform/index.js +0 -17
  787. package/node_modules/@opentelemetry/api/build/esnext/platform/index.js.map +0 -1
  788. package/node_modules/@opentelemetry/api/build/esnext/platform/node/globalThis.d.ts +0 -3
  789. package/node_modules/@opentelemetry/api/build/esnext/platform/node/globalThis.js +0 -19
  790. package/node_modules/@opentelemetry/api/build/esnext/platform/node/globalThis.js.map +0 -1
  791. package/node_modules/@opentelemetry/api/build/esnext/platform/node/index.d.ts +0 -2
  792. package/node_modules/@opentelemetry/api/build/esnext/platform/node/index.js +0 -17
  793. package/node_modules/@opentelemetry/api/build/esnext/platform/node/index.js.map +0 -1
  794. package/node_modules/@opentelemetry/api/build/esnext/propagation/NoopTextMapPropagator.d.ts +0 -13
  795. package/node_modules/@opentelemetry/api/build/esnext/propagation/NoopTextMapPropagator.js +0 -30
  796. package/node_modules/@opentelemetry/api/build/esnext/propagation/NoopTextMapPropagator.js.map +0 -1
  797. package/node_modules/@opentelemetry/api/build/esnext/propagation/TextMapPropagator.d.ts +0 -84
  798. package/node_modules/@opentelemetry/api/build/esnext/propagation/TextMapPropagator.js +0 -38
  799. package/node_modules/@opentelemetry/api/build/esnext/propagation/TextMapPropagator.js.map +0 -1
  800. package/node_modules/@opentelemetry/api/build/esnext/propagation-api.d.ts +0 -4
  801. package/node_modules/@opentelemetry/api/build/esnext/propagation-api.js +0 -21
  802. package/node_modules/@opentelemetry/api/build/esnext/propagation-api.js.map +0 -1
  803. package/node_modules/@opentelemetry/api/build/esnext/trace/NonRecordingSpan.d.ts +0 -28
  804. package/node_modules/@opentelemetry/api/build/esnext/trace/NonRecordingSpan.js +0 -65
  805. package/node_modules/@opentelemetry/api/build/esnext/trace/NonRecordingSpan.js.map +0 -1
  806. package/node_modules/@opentelemetry/api/build/esnext/trace/NoopTracer.d.ts +0 -14
  807. package/node_modules/@opentelemetry/api/build/esnext/trace/NoopTracer.js +0 -71
  808. package/node_modules/@opentelemetry/api/build/esnext/trace/NoopTracer.js.map +0 -1
  809. package/node_modules/@opentelemetry/api/build/esnext/trace/NoopTracerProvider.d.ts +0 -13
  810. package/node_modules/@opentelemetry/api/build/esnext/trace/NoopTracerProvider.js +0 -28
  811. package/node_modules/@opentelemetry/api/build/esnext/trace/NoopTracerProvider.js.map +0 -1
  812. package/node_modules/@opentelemetry/api/build/esnext/trace/ProxyTracer.d.ts +0 -27
  813. package/node_modules/@opentelemetry/api/build/esnext/trace/ProxyTracer.js +0 -51
  814. package/node_modules/@opentelemetry/api/build/esnext/trace/ProxyTracer.js.map +0 -1
  815. package/node_modules/@opentelemetry/api/build/esnext/trace/ProxyTracerProvider.d.ts +0 -25
  816. package/node_modules/@opentelemetry/api/build/esnext/trace/ProxyTracerProvider.js +0 -50
  817. package/node_modules/@opentelemetry/api/build/esnext/trace/ProxyTracerProvider.js.map +0 -1
  818. package/node_modules/@opentelemetry/api/build/esnext/trace/Sampler.d.ts +0 -31
  819. package/node_modules/@opentelemetry/api/build/esnext/trace/Sampler.js +0 -17
  820. package/node_modules/@opentelemetry/api/build/esnext/trace/Sampler.js.map +0 -1
  821. package/node_modules/@opentelemetry/api/build/esnext/trace/SamplingResult.d.ts +0 -49
  822. package/node_modules/@opentelemetry/api/build/esnext/trace/SamplingResult.js +0 -39
  823. package/node_modules/@opentelemetry/api/build/esnext/trace/SamplingResult.js.map +0 -1
  824. package/node_modules/@opentelemetry/api/build/esnext/trace/SpanOptions.d.ts +0 -23
  825. package/node_modules/@opentelemetry/api/build/esnext/trace/SpanOptions.js +0 -17
  826. package/node_modules/@opentelemetry/api/build/esnext/trace/SpanOptions.js.map +0 -1
  827. package/node_modules/@opentelemetry/api/build/esnext/trace/attributes.d.ts +0 -10
  828. package/node_modules/@opentelemetry/api/build/esnext/trace/attributes.js +0 -17
  829. package/node_modules/@opentelemetry/api/build/esnext/trace/attributes.js.map +0 -1
  830. package/node_modules/@opentelemetry/api/build/esnext/trace/context-utils.d.ts +0 -41
  831. package/node_modules/@opentelemetry/api/build/esnext/trace/context-utils.js +0 -73
  832. package/node_modules/@opentelemetry/api/build/esnext/trace/context-utils.js.map +0 -1
  833. package/node_modules/@opentelemetry/api/build/esnext/trace/internal/tracestate-impl.d.ts +0 -22
  834. package/node_modules/@opentelemetry/api/build/esnext/trace/internal/tracestate-impl.js +0 -99
  835. package/node_modules/@opentelemetry/api/build/esnext/trace/internal/tracestate-impl.js.map +0 -1
  836. package/node_modules/@opentelemetry/api/build/esnext/trace/internal/tracestate-validators.d.ts +0 -15
  837. package/node_modules/@opentelemetry/api/build/esnext/trace/internal/tracestate-validators.js +0 -41
  838. package/node_modules/@opentelemetry/api/build/esnext/trace/internal/tracestate-validators.js.map +0 -1
  839. package/node_modules/@opentelemetry/api/build/esnext/trace/internal/utils.d.ts +0 -3
  840. package/node_modules/@opentelemetry/api/build/esnext/trace/internal/utils.js +0 -20
  841. package/node_modules/@opentelemetry/api/build/esnext/trace/internal/utils.js.map +0 -1
  842. package/node_modules/@opentelemetry/api/build/esnext/trace/invalid-span-constants.d.ts +0 -5
  843. package/node_modules/@opentelemetry/api/build/esnext/trace/invalid-span-constants.js +0 -24
  844. package/node_modules/@opentelemetry/api/build/esnext/trace/invalid-span-constants.js.map +0 -1
  845. package/node_modules/@opentelemetry/api/build/esnext/trace/link.d.ts +0 -26
  846. package/node_modules/@opentelemetry/api/build/esnext/trace/link.js +0 -17
  847. package/node_modules/@opentelemetry/api/build/esnext/trace/link.js.map +0 -1
  848. package/node_modules/@opentelemetry/api/build/esnext/trace/span.d.ts +0 -120
  849. package/node_modules/@opentelemetry/api/build/esnext/trace/span.js +0 -17
  850. package/node_modules/@opentelemetry/api/build/esnext/trace/span.js.map +0 -1
  851. package/node_modules/@opentelemetry/api/build/esnext/trace/span_context.d.ts +0 -53
  852. package/node_modules/@opentelemetry/api/build/esnext/trace/span_context.js +0 -17
  853. package/node_modules/@opentelemetry/api/build/esnext/trace/span_context.js.map +0 -1
  854. package/node_modules/@opentelemetry/api/build/esnext/trace/span_kind.d.ts +0 -27
  855. package/node_modules/@opentelemetry/api/build/esnext/trace/span_kind.js +0 -43
  856. package/node_modules/@opentelemetry/api/build/esnext/trace/span_kind.js.map +0 -1
  857. package/node_modules/@opentelemetry/api/build/esnext/trace/spancontext-utils.d.ts +0 -17
  858. package/node_modules/@opentelemetry/api/build/esnext/trace/spancontext-utils.js +0 -42
  859. package/node_modules/@opentelemetry/api/build/esnext/trace/spancontext-utils.js.map +0 -1
  860. package/node_modules/@opentelemetry/api/build/esnext/trace/status.d.ts +0 -25
  861. package/node_modules/@opentelemetry/api/build/esnext/trace/status.js +0 -20
  862. package/node_modules/@opentelemetry/api/build/esnext/trace/status.js.map +0 -1
  863. package/node_modules/@opentelemetry/api/build/esnext/trace/trace_flags.d.ts +0 -7
  864. package/node_modules/@opentelemetry/api/build/esnext/trace/trace_flags.js +0 -23
  865. package/node_modules/@opentelemetry/api/build/esnext/trace/trace_flags.js.map +0 -1
  866. package/node_modules/@opentelemetry/api/build/esnext/trace/trace_state.d.ts +0 -38
  867. package/node_modules/@opentelemetry/api/build/esnext/trace/trace_state.js +0 -17
  868. package/node_modules/@opentelemetry/api/build/esnext/trace/trace_state.js.map +0 -1
  869. package/node_modules/@opentelemetry/api/build/esnext/trace/tracer.d.ts +0 -71
  870. package/node_modules/@opentelemetry/api/build/esnext/trace/tracer.js +0 -17
  871. package/node_modules/@opentelemetry/api/build/esnext/trace/tracer.js.map +0 -1
  872. package/node_modules/@opentelemetry/api/build/esnext/trace/tracer_options.d.ts +0 -10
  873. package/node_modules/@opentelemetry/api/build/esnext/trace/tracer_options.js +0 -17
  874. package/node_modules/@opentelemetry/api/build/esnext/trace/tracer_options.js.map +0 -1
  875. package/node_modules/@opentelemetry/api/build/esnext/trace/tracer_provider.d.ts +0 -21
  876. package/node_modules/@opentelemetry/api/build/esnext/trace/tracer_provider.js +0 -17
  877. package/node_modules/@opentelemetry/api/build/esnext/trace/tracer_provider.js.map +0 -1
  878. package/node_modules/@opentelemetry/api/build/esnext/trace-api.d.ts +0 -4
  879. package/node_modules/@opentelemetry/api/build/esnext/trace-api.js +0 -21
  880. package/node_modules/@opentelemetry/api/build/esnext/trace-api.js.map +0 -1
  881. package/node_modules/@opentelemetry/api/build/esnext/version.d.ts +0 -2
  882. package/node_modules/@opentelemetry/api/build/esnext/version.js +0 -18
  883. package/node_modules/@opentelemetry/api/build/esnext/version.js.map +0 -1
  884. package/node_modules/@opentelemetry/api/build/src/api/context.d.ts +0 -41
  885. package/node_modules/@opentelemetry/api/build/src/api/context.js +0 -81
  886. package/node_modules/@opentelemetry/api/build/src/api/context.js.map +0 -1
  887. package/node_modules/@opentelemetry/api/build/src/api/diag.d.ts +0 -30
  888. package/node_modules/@opentelemetry/api/build/src/api/diag.js +0 -93
  889. package/node_modules/@opentelemetry/api/build/src/api/diag.js.map +0 -1
  890. package/node_modules/@opentelemetry/api/build/src/api/metrics.d.ts +0 -28
  891. package/node_modules/@opentelemetry/api/build/src/api/metrics.js +0 -61
  892. package/node_modules/@opentelemetry/api/build/src/api/metrics.js.map +0 -1
  893. package/node_modules/@opentelemetry/api/build/src/api/propagation.d.ts +0 -49
  894. package/node_modules/@opentelemetry/api/build/src/api/propagation.js +0 -89
  895. package/node_modules/@opentelemetry/api/build/src/api/propagation.js.map +0 -1
  896. package/node_modules/@opentelemetry/api/build/src/api/trace.d.ts +0 -40
  897. package/node_modules/@opentelemetry/api/build/src/api/trace.js +0 -79
  898. package/node_modules/@opentelemetry/api/build/src/api/trace.js.map +0 -1
  899. package/node_modules/@opentelemetry/api/build/src/baggage/context-helpers.d.ts +0 -29
  900. package/node_modules/@opentelemetry/api/build/src/baggage/context-helpers.js +0 -63
  901. package/node_modules/@opentelemetry/api/build/src/baggage/context-helpers.js.map +0 -1
  902. package/node_modules/@opentelemetry/api/build/src/baggage/internal/baggage-impl.d.ts +0 -12
  903. package/node_modules/@opentelemetry/api/build/src/baggage/internal/baggage-impl.js +0 -55
  904. package/node_modules/@opentelemetry/api/build/src/baggage/internal/baggage-impl.js.map +0 -1
  905. package/node_modules/@opentelemetry/api/build/src/baggage/internal/symbol.d.ts +0 -5
  906. package/node_modules/@opentelemetry/api/build/src/baggage/internal/symbol.js +0 -23
  907. package/node_modules/@opentelemetry/api/build/src/baggage/internal/symbol.js.map +0 -1
  908. package/node_modules/@opentelemetry/api/build/src/baggage/types.d.ts +0 -60
  909. package/node_modules/@opentelemetry/api/build/src/baggage/types.js +0 -18
  910. package/node_modules/@opentelemetry/api/build/src/baggage/types.js.map +0 -1
  911. package/node_modules/@opentelemetry/api/build/src/baggage/utils.d.ts +0 -15
  912. package/node_modules/@opentelemetry/api/build/src/baggage/utils.js +0 -51
  913. package/node_modules/@opentelemetry/api/build/src/baggage/utils.js.map +0 -1
  914. package/node_modules/@opentelemetry/api/build/src/common/Attributes.d.ts +0 -15
  915. package/node_modules/@opentelemetry/api/build/src/common/Attributes.js +0 -18
  916. package/node_modules/@opentelemetry/api/build/src/common/Attributes.js.map +0 -1
  917. package/node_modules/@opentelemetry/api/build/src/common/Exception.d.ts +0 -26
  918. package/node_modules/@opentelemetry/api/build/src/common/Exception.js +0 -18
  919. package/node_modules/@opentelemetry/api/build/src/common/Exception.js.map +0 -1
  920. package/node_modules/@opentelemetry/api/build/src/common/Time.d.ts +0 -20
  921. package/node_modules/@opentelemetry/api/build/src/common/Time.js +0 -3
  922. package/node_modules/@opentelemetry/api/build/src/common/Time.js.map +0 -1
  923. package/node_modules/@opentelemetry/api/build/src/context/NoopContextManager.d.ts +0 -9
  924. package/node_modules/@opentelemetry/api/build/src/context/NoopContextManager.js +0 -38
  925. package/node_modules/@opentelemetry/api/build/src/context/NoopContextManager.js.map +0 -1
  926. package/node_modules/@opentelemetry/api/build/src/context/context.d.ts +0 -6
  927. package/node_modules/@opentelemetry/api/build/src/context/context.js +0 -55
  928. package/node_modules/@opentelemetry/api/build/src/context/context.js.map +0 -1
  929. package/node_modules/@opentelemetry/api/build/src/context/types.d.ts +0 -52
  930. package/node_modules/@opentelemetry/api/build/src/context/types.js +0 -18
  931. package/node_modules/@opentelemetry/api/build/src/context/types.js.map +0 -1
  932. package/node_modules/@opentelemetry/api/build/src/context-api.d.ts +0 -4
  933. package/node_modules/@opentelemetry/api/build/src/context-api.js +0 -24
  934. package/node_modules/@opentelemetry/api/build/src/context-api.js.map +0 -1
  935. package/node_modules/@opentelemetry/api/build/src/diag/ComponentLogger.d.ts +0 -20
  936. package/node_modules/@opentelemetry/api/build/src/diag/ComponentLogger.js +0 -59
  937. package/node_modules/@opentelemetry/api/build/src/diag/ComponentLogger.js.map +0 -1
  938. package/node_modules/@opentelemetry/api/build/src/diag/consoleLogger.d.ts +0 -38
  939. package/node_modules/@opentelemetry/api/build/src/diag/consoleLogger.js +0 -57
  940. package/node_modules/@opentelemetry/api/build/src/diag/consoleLogger.js.map +0 -1
  941. package/node_modules/@opentelemetry/api/build/src/diag/internal/logLevelLogger.d.ts +0 -3
  942. package/node_modules/@opentelemetry/api/build/src/diag/internal/logLevelLogger.js +0 -45
  943. package/node_modules/@opentelemetry/api/build/src/diag/internal/logLevelLogger.js.map +0 -1
  944. package/node_modules/@opentelemetry/api/build/src/diag/internal/noopLogger.d.ts +0 -8
  945. package/node_modules/@opentelemetry/api/build/src/diag/internal/noopLogger.js +0 -35
  946. package/node_modules/@opentelemetry/api/build/src/diag/internal/noopLogger.js.map +0 -1
  947. package/node_modules/@opentelemetry/api/build/src/diag/types.d.ts +0 -100
  948. package/node_modules/@opentelemetry/api/build/src/diag/types.js +0 -44
  949. package/node_modules/@opentelemetry/api/build/src/diag/types.js.map +0 -1
  950. package/node_modules/@opentelemetry/api/build/src/diag-api.d.ts +0 -9
  951. package/node_modules/@opentelemetry/api/build/src/diag-api.js +0 -29
  952. package/node_modules/@opentelemetry/api/build/src/diag-api.js.map +0 -1
  953. package/node_modules/@opentelemetry/api/build/src/experimental/index.d.ts +0 -3
  954. package/node_modules/@opentelemetry/api/build/src/experimental/index.js +0 -22
  955. package/node_modules/@opentelemetry/api/build/src/experimental/index.js.map +0 -1
  956. package/node_modules/@opentelemetry/api/build/src/experimental/trace/SugaredOptions.d.ts +0 -13
  957. package/node_modules/@opentelemetry/api/build/src/experimental/trace/SugaredOptions.js +0 -18
  958. package/node_modules/@opentelemetry/api/build/src/experimental/trace/SugaredOptions.js.map +0 -1
  959. package/node_modules/@opentelemetry/api/build/src/experimental/trace/SugaredTracer.d.ts +0 -64
  960. package/node_modules/@opentelemetry/api/build/src/experimental/trace/SugaredTracer.js +0 -93
  961. package/node_modules/@opentelemetry/api/build/src/experimental/trace/SugaredTracer.js.map +0 -1
  962. package/node_modules/@opentelemetry/api/build/src/index.d.ts +0 -54
  963. package/node_modules/@opentelemetry/api/build/src/index.js +0 -81
  964. package/node_modules/@opentelemetry/api/build/src/index.js.map +0 -1
  965. package/node_modules/@opentelemetry/api/build/src/internal/global-utils.d.ts +0 -18
  966. package/node_modules/@opentelemetry/api/build/src/internal/global-utils.js +0 -64
  967. package/node_modules/@opentelemetry/api/build/src/internal/global-utils.js.map +0 -1
  968. package/node_modules/@opentelemetry/api/build/src/internal/semver.d.ts +0 -34
  969. package/node_modules/@opentelemetry/api/build/src/internal/semver.js +0 -122
  970. package/node_modules/@opentelemetry/api/build/src/internal/semver.js.map +0 -1
  971. package/node_modules/@opentelemetry/api/build/src/metrics/Meter.d.ts +0 -110
  972. package/node_modules/@opentelemetry/api/build/src/metrics/Meter.js +0 -18
  973. package/node_modules/@opentelemetry/api/build/src/metrics/Meter.js.map +0 -1
  974. package/node_modules/@opentelemetry/api/build/src/metrics/MeterProvider.d.ts +0 -17
  975. package/node_modules/@opentelemetry/api/build/src/metrics/MeterProvider.js +0 -18
  976. package/node_modules/@opentelemetry/api/build/src/metrics/MeterProvider.js.map +0 -1
  977. package/node_modules/@opentelemetry/api/build/src/metrics/Metric.d.ts +0 -115
  978. package/node_modules/@opentelemetry/api/build/src/metrics/Metric.js +0 -25
  979. package/node_modules/@opentelemetry/api/build/src/metrics/Metric.js.map +0 -1
  980. package/node_modules/@opentelemetry/api/build/src/metrics/NoopMeter.d.ts +0 -82
  981. package/node_modules/@opentelemetry/api/build/src/metrics/NoopMeter.js +0 -127
  982. package/node_modules/@opentelemetry/api/build/src/metrics/NoopMeter.js.map +0 -1
  983. package/node_modules/@opentelemetry/api/build/src/metrics/NoopMeterProvider.d.ts +0 -11
  984. package/node_modules/@opentelemetry/api/build/src/metrics/NoopMeterProvider.js +0 -31
  985. package/node_modules/@opentelemetry/api/build/src/metrics/NoopMeterProvider.js.map +0 -1
  986. package/node_modules/@opentelemetry/api/build/src/metrics/ObservableResult.d.ts +0 -31
  987. package/node_modules/@opentelemetry/api/build/src/metrics/ObservableResult.js +0 -18
  988. package/node_modules/@opentelemetry/api/build/src/metrics/ObservableResult.js.map +0 -1
  989. package/node_modules/@opentelemetry/api/build/src/metrics-api.d.ts +0 -4
  990. package/node_modules/@opentelemetry/api/build/src/metrics-api.js +0 -24
  991. package/node_modules/@opentelemetry/api/build/src/metrics-api.js.map +0 -1
  992. package/node_modules/@opentelemetry/api/build/src/platform/browser/globalThis.d.ts +0 -10
  993. package/node_modules/@opentelemetry/api/build/src/platform/browser/globalThis.js +0 -38
  994. package/node_modules/@opentelemetry/api/build/src/platform/browser/globalThis.js.map +0 -1
  995. package/node_modules/@opentelemetry/api/build/src/platform/browser/index.d.ts +0 -2
  996. package/node_modules/@opentelemetry/api/build/src/platform/browser/index.js +0 -29
  997. package/node_modules/@opentelemetry/api/build/src/platform/browser/index.js.map +0 -1
  998. package/node_modules/@opentelemetry/api/build/src/platform/index.d.ts +0 -2
  999. package/node_modules/@opentelemetry/api/build/src/platform/index.js +0 -29
  1000. package/node_modules/@opentelemetry/api/build/src/platform/index.js.map +0 -1
  1001. package/node_modules/@opentelemetry/api/build/src/platform/node/globalThis.d.ts +0 -3
  1002. package/node_modules/@opentelemetry/api/build/src/platform/node/globalThis.js +0 -22
  1003. package/node_modules/@opentelemetry/api/build/src/platform/node/globalThis.js.map +0 -1
  1004. package/node_modules/@opentelemetry/api/build/src/platform/node/index.d.ts +0 -2
  1005. package/node_modules/@opentelemetry/api/build/src/platform/node/index.js +0 -29
  1006. package/node_modules/@opentelemetry/api/build/src/platform/node/index.js.map +0 -1
  1007. package/node_modules/@opentelemetry/api/build/src/propagation/NoopTextMapPropagator.d.ts +0 -13
  1008. package/node_modules/@opentelemetry/api/build/src/propagation/NoopTextMapPropagator.js +0 -34
  1009. package/node_modules/@opentelemetry/api/build/src/propagation/NoopTextMapPropagator.js.map +0 -1
  1010. package/node_modules/@opentelemetry/api/build/src/propagation/TextMapPropagator.d.ts +0 -84
  1011. package/node_modules/@opentelemetry/api/build/src/propagation/TextMapPropagator.js +0 -41
  1012. package/node_modules/@opentelemetry/api/build/src/propagation/TextMapPropagator.js.map +0 -1
  1013. package/node_modules/@opentelemetry/api/build/src/propagation-api.d.ts +0 -4
  1014. package/node_modules/@opentelemetry/api/build/src/propagation-api.js +0 -24
  1015. package/node_modules/@opentelemetry/api/build/src/propagation-api.js.map +0 -1
  1016. package/node_modules/@opentelemetry/api/build/src/trace/NonRecordingSpan.d.ts +0 -28
  1017. package/node_modules/@opentelemetry/api/build/src/trace/NonRecordingSpan.js +0 -69
  1018. package/node_modules/@opentelemetry/api/build/src/trace/NonRecordingSpan.js.map +0 -1
  1019. package/node_modules/@opentelemetry/api/build/src/trace/NoopTracer.d.ts +0 -14
  1020. package/node_modules/@opentelemetry/api/build/src/trace/NoopTracer.js +0 -75
  1021. package/node_modules/@opentelemetry/api/build/src/trace/NoopTracer.js.map +0 -1
  1022. package/node_modules/@opentelemetry/api/build/src/trace/NoopTracerProvider.d.ts +0 -13
  1023. package/node_modules/@opentelemetry/api/build/src/trace/NoopTracerProvider.js +0 -32
  1024. package/node_modules/@opentelemetry/api/build/src/trace/NoopTracerProvider.js.map +0 -1
  1025. package/node_modules/@opentelemetry/api/build/src/trace/ProxyTracer.d.ts +0 -27
  1026. package/node_modules/@opentelemetry/api/build/src/trace/ProxyTracer.js +0 -55
  1027. package/node_modules/@opentelemetry/api/build/src/trace/ProxyTracer.js.map +0 -1
  1028. package/node_modules/@opentelemetry/api/build/src/trace/ProxyTracerProvider.d.ts +0 -25
  1029. package/node_modules/@opentelemetry/api/build/src/trace/ProxyTracerProvider.js +0 -54
  1030. package/node_modules/@opentelemetry/api/build/src/trace/ProxyTracerProvider.js.map +0 -1
  1031. package/node_modules/@opentelemetry/api/build/src/trace/Sampler.d.ts +0 -31
  1032. package/node_modules/@opentelemetry/api/build/src/trace/Sampler.js +0 -18
  1033. package/node_modules/@opentelemetry/api/build/src/trace/Sampler.js.map +0 -1
  1034. package/node_modules/@opentelemetry/api/build/src/trace/SamplingResult.d.ts +0 -49
  1035. package/node_modules/@opentelemetry/api/build/src/trace/SamplingResult.js +0 -42
  1036. package/node_modules/@opentelemetry/api/build/src/trace/SamplingResult.js.map +0 -1
  1037. package/node_modules/@opentelemetry/api/build/src/trace/SpanOptions.d.ts +0 -23
  1038. package/node_modules/@opentelemetry/api/build/src/trace/SpanOptions.js +0 -18
  1039. package/node_modules/@opentelemetry/api/build/src/trace/SpanOptions.js.map +0 -1
  1040. package/node_modules/@opentelemetry/api/build/src/trace/attributes.d.ts +0 -10
  1041. package/node_modules/@opentelemetry/api/build/src/trace/attributes.js +0 -18
  1042. package/node_modules/@opentelemetry/api/build/src/trace/attributes.js.map +0 -1
  1043. package/node_modules/@opentelemetry/api/build/src/trace/context-utils.d.ts +0 -41
  1044. package/node_modules/@opentelemetry/api/build/src/trace/context-utils.js +0 -82
  1045. package/node_modules/@opentelemetry/api/build/src/trace/context-utils.js.map +0 -1
  1046. package/node_modules/@opentelemetry/api/build/src/trace/internal/tracestate-impl.d.ts +0 -22
  1047. package/node_modules/@opentelemetry/api/build/src/trace/internal/tracestate-impl.js +0 -103
  1048. package/node_modules/@opentelemetry/api/build/src/trace/internal/tracestate-impl.js.map +0 -1
  1049. package/node_modules/@opentelemetry/api/build/src/trace/internal/tracestate-validators.d.ts +0 -15
  1050. package/node_modules/@opentelemetry/api/build/src/trace/internal/tracestate-validators.js +0 -46
  1051. package/node_modules/@opentelemetry/api/build/src/trace/internal/tracestate-validators.js.map +0 -1
  1052. package/node_modules/@opentelemetry/api/build/src/trace/internal/utils.d.ts +0 -3
  1053. package/node_modules/@opentelemetry/api/build/src/trace/internal/utils.js +0 -24
  1054. package/node_modules/@opentelemetry/api/build/src/trace/internal/utils.js.map +0 -1
  1055. package/node_modules/@opentelemetry/api/build/src/trace/invalid-span-constants.d.ts +0 -5
  1056. package/node_modules/@opentelemetry/api/build/src/trace/invalid-span-constants.js +0 -27
  1057. package/node_modules/@opentelemetry/api/build/src/trace/invalid-span-constants.js.map +0 -1
  1058. package/node_modules/@opentelemetry/api/build/src/trace/link.d.ts +0 -26
  1059. package/node_modules/@opentelemetry/api/build/src/trace/link.js +0 -18
  1060. package/node_modules/@opentelemetry/api/build/src/trace/link.js.map +0 -1
  1061. package/node_modules/@opentelemetry/api/build/src/trace/span.d.ts +0 -120
  1062. package/node_modules/@opentelemetry/api/build/src/trace/span.js +0 -18
  1063. package/node_modules/@opentelemetry/api/build/src/trace/span.js.map +0 -1
  1064. package/node_modules/@opentelemetry/api/build/src/trace/span_context.d.ts +0 -53
  1065. package/node_modules/@opentelemetry/api/build/src/trace/span_context.js +0 -18
  1066. package/node_modules/@opentelemetry/api/build/src/trace/span_context.js.map +0 -1
  1067. package/node_modules/@opentelemetry/api/build/src/trace/span_kind.d.ts +0 -27
  1068. package/node_modules/@opentelemetry/api/build/src/trace/span_kind.js +0 -46
  1069. package/node_modules/@opentelemetry/api/build/src/trace/span_kind.js.map +0 -1
  1070. package/node_modules/@opentelemetry/api/build/src/trace/spancontext-utils.d.ts +0 -17
  1071. package/node_modules/@opentelemetry/api/build/src/trace/spancontext-utils.js +0 -49
  1072. package/node_modules/@opentelemetry/api/build/src/trace/spancontext-utils.js.map +0 -1
  1073. package/node_modules/@opentelemetry/api/build/src/trace/status.d.ts +0 -25
  1074. package/node_modules/@opentelemetry/api/build/src/trace/status.js +0 -23
  1075. package/node_modules/@opentelemetry/api/build/src/trace/status.js.map +0 -1
  1076. package/node_modules/@opentelemetry/api/build/src/trace/trace_flags.d.ts +0 -7
  1077. package/node_modules/@opentelemetry/api/build/src/trace/trace_flags.js +0 -26
  1078. package/node_modules/@opentelemetry/api/build/src/trace/trace_flags.js.map +0 -1
  1079. package/node_modules/@opentelemetry/api/build/src/trace/trace_state.d.ts +0 -38
  1080. package/node_modules/@opentelemetry/api/build/src/trace/trace_state.js +0 -18
  1081. package/node_modules/@opentelemetry/api/build/src/trace/trace_state.js.map +0 -1
  1082. package/node_modules/@opentelemetry/api/build/src/trace/tracer.d.ts +0 -71
  1083. package/node_modules/@opentelemetry/api/build/src/trace/tracer.js +0 -18
  1084. package/node_modules/@opentelemetry/api/build/src/trace/tracer.js.map +0 -1
  1085. package/node_modules/@opentelemetry/api/build/src/trace/tracer_options.d.ts +0 -10
  1086. package/node_modules/@opentelemetry/api/build/src/trace/tracer_options.js +0 -18
  1087. package/node_modules/@opentelemetry/api/build/src/trace/tracer_options.js.map +0 -1
  1088. package/node_modules/@opentelemetry/api/build/src/trace/tracer_provider.d.ts +0 -21
  1089. package/node_modules/@opentelemetry/api/build/src/trace/tracer_provider.js +0 -18
  1090. package/node_modules/@opentelemetry/api/build/src/trace/tracer_provider.js.map +0 -1
  1091. package/node_modules/@opentelemetry/api/build/src/trace-api.d.ts +0 -4
  1092. package/node_modules/@opentelemetry/api/build/src/trace-api.js +0 -24
  1093. package/node_modules/@opentelemetry/api/build/src/trace-api.js.map +0 -1
  1094. package/node_modules/@opentelemetry/api/build/src/version.d.ts +0 -2
  1095. package/node_modules/@opentelemetry/api/build/src/version.js +0 -21
  1096. package/node_modules/@opentelemetry/api/build/src/version.js.map +0 -1
  1097. package/node_modules/@opentelemetry/api/package.json +0 -113
  1098. package/node_modules/glob/LICENSE.md +0 -63
  1099. package/node_modules/glob/README.md +0 -1203
  1100. package/node_modules/glob/dist/commonjs/glob.d.ts +0 -396
  1101. package/node_modules/glob/dist/commonjs/glob.d.ts.map +0 -1
  1102. package/node_modules/glob/dist/commonjs/glob.js +0 -248
  1103. package/node_modules/glob/dist/commonjs/glob.js.map +0 -1
  1104. package/node_modules/glob/dist/commonjs/has-magic.d.ts +0 -14
  1105. package/node_modules/glob/dist/commonjs/has-magic.d.ts.map +0 -1
  1106. package/node_modules/glob/dist/commonjs/has-magic.js +0 -27
  1107. package/node_modules/glob/dist/commonjs/has-magic.js.map +0 -1
  1108. package/node_modules/glob/dist/commonjs/ignore.d.ts +0 -24
  1109. package/node_modules/glob/dist/commonjs/ignore.d.ts.map +0 -1
  1110. package/node_modules/glob/dist/commonjs/ignore.js +0 -119
  1111. package/node_modules/glob/dist/commonjs/ignore.js.map +0 -1
  1112. package/node_modules/glob/dist/commonjs/index.d.ts +0 -97
  1113. package/node_modules/glob/dist/commonjs/index.d.ts.map +0 -1
  1114. package/node_modules/glob/dist/commonjs/index.js +0 -68
  1115. package/node_modules/glob/dist/commonjs/index.js.map +0 -1
  1116. package/node_modules/glob/dist/commonjs/index.min.js +0 -4
  1117. package/node_modules/glob/dist/commonjs/index.min.js.map +0 -7
  1118. package/node_modules/glob/dist/commonjs/package.json +0 -3
  1119. package/node_modules/glob/dist/commonjs/pattern.d.ts +0 -79
  1120. package/node_modules/glob/dist/commonjs/pattern.d.ts.map +0 -1
  1121. package/node_modules/glob/dist/commonjs/pattern.js +0 -223
  1122. package/node_modules/glob/dist/commonjs/pattern.js.map +0 -1
  1123. package/node_modules/glob/dist/commonjs/processor.d.ts +0 -59
  1124. package/node_modules/glob/dist/commonjs/processor.d.ts.map +0 -1
  1125. package/node_modules/glob/dist/commonjs/processor.js +0 -301
  1126. package/node_modules/glob/dist/commonjs/processor.js.map +0 -1
  1127. package/node_modules/glob/dist/commonjs/walker.d.ts +0 -97
  1128. package/node_modules/glob/dist/commonjs/walker.d.ts.map +0 -1
  1129. package/node_modules/glob/dist/commonjs/walker.js +0 -387
  1130. package/node_modules/glob/dist/commonjs/walker.js.map +0 -1
  1131. package/node_modules/glob/dist/esm/glob.d.ts +0 -396
  1132. package/node_modules/glob/dist/esm/glob.d.ts.map +0 -1
  1133. package/node_modules/glob/dist/esm/glob.js +0 -244
  1134. package/node_modules/glob/dist/esm/glob.js.map +0 -1
  1135. package/node_modules/glob/dist/esm/has-magic.d.ts +0 -14
  1136. package/node_modules/glob/dist/esm/has-magic.d.ts.map +0 -1
  1137. package/node_modules/glob/dist/esm/has-magic.js +0 -23
  1138. package/node_modules/glob/dist/esm/has-magic.js.map +0 -1
  1139. package/node_modules/glob/dist/esm/ignore.d.ts +0 -24
  1140. package/node_modules/glob/dist/esm/ignore.d.ts.map +0 -1
  1141. package/node_modules/glob/dist/esm/ignore.js +0 -115
  1142. package/node_modules/glob/dist/esm/ignore.js.map +0 -1
  1143. package/node_modules/glob/dist/esm/index.d.ts +0 -97
  1144. package/node_modules/glob/dist/esm/index.d.ts.map +0 -1
  1145. package/node_modules/glob/dist/esm/index.js +0 -55
  1146. package/node_modules/glob/dist/esm/index.js.map +0 -1
  1147. package/node_modules/glob/dist/esm/index.min.js +0 -4
  1148. package/node_modules/glob/dist/esm/index.min.js.map +0 -7
  1149. package/node_modules/glob/dist/esm/package.json +0 -3
  1150. package/node_modules/glob/dist/esm/pattern.d.ts +0 -79
  1151. package/node_modules/glob/dist/esm/pattern.d.ts.map +0 -1
  1152. package/node_modules/glob/dist/esm/pattern.js +0 -219
  1153. package/node_modules/glob/dist/esm/pattern.js.map +0 -1
  1154. package/node_modules/glob/dist/esm/processor.d.ts +0 -59
  1155. package/node_modules/glob/dist/esm/processor.d.ts.map +0 -1
  1156. package/node_modules/glob/dist/esm/processor.js +0 -294
  1157. package/node_modules/glob/dist/esm/processor.js.map +0 -1
  1158. package/node_modules/glob/dist/esm/walker.d.ts +0 -97
  1159. package/node_modules/glob/dist/esm/walker.d.ts.map +0 -1
  1160. package/node_modules/glob/dist/esm/walker.js +0 -381
  1161. package/node_modules/glob/dist/esm/walker.js.map +0 -1
  1162. package/node_modules/glob/package.json +0 -98
  1163. package/node_modules/minipass/LICENSE.md +0 -55
  1164. package/node_modules/minipass/README.md +0 -825
  1165. package/node_modules/minipass/dist/commonjs/index.d.ts +0 -545
  1166. package/node_modules/minipass/dist/commonjs/index.d.ts.map +0 -1
  1167. package/node_modules/minipass/dist/commonjs/index.js +0 -1038
  1168. package/node_modules/minipass/dist/commonjs/index.js.map +0 -1
  1169. package/node_modules/minipass/dist/commonjs/package.json +0 -3
  1170. package/node_modules/minipass/dist/esm/index.d.ts +0 -545
  1171. package/node_modules/minipass/dist/esm/index.d.ts.map +0 -1
  1172. package/node_modules/minipass/dist/esm/index.js +0 -1020
  1173. package/node_modules/minipass/dist/esm/index.js.map +0 -1
  1174. package/node_modules/minipass/dist/esm/package.json +0 -3
  1175. package/node_modules/minipass/package.json +0 -77
  1176. package/node_modules/path-scurry/LICENSE.md +0 -55
  1177. package/node_modules/path-scurry/README.md +0 -636
  1178. package/node_modules/path-scurry/dist/commonjs/index.d.ts +0 -1115
  1179. package/node_modules/path-scurry/dist/commonjs/index.d.ts.map +0 -1
  1180. package/node_modules/path-scurry/dist/commonjs/index.js +0 -2018
  1181. package/node_modules/path-scurry/dist/commonjs/index.js.map +0 -1
  1182. package/node_modules/path-scurry/dist/commonjs/package.json +0 -3
  1183. package/node_modules/path-scurry/dist/esm/index.d.ts +0 -1115
  1184. package/node_modules/path-scurry/dist/esm/index.d.ts.map +0 -1
  1185. package/node_modules/path-scurry/dist/esm/index.js +0 -1983
  1186. package/node_modules/path-scurry/dist/esm/index.js.map +0 -1
  1187. package/node_modules/path-scurry/dist/esm/package.json +0 -3
  1188. package/node_modules/path-scurry/package.json +0 -72
@@ -1 +1 @@
1
- {"version":3,"file":"settings-list.d.ts","sourceRoot":"","sources":["../../src/components/settings-list.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAI3C,MAAM,WAAW,WAAW;IAC3B,yCAAyC;IACzC,EAAE,EAAE,MAAM,CAAC;IACX,gCAAgC;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,+CAA+C;IAC/C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4CAA4C;IAC5C,YAAY,EAAE,MAAM,CAAC;IACrB,2DAA2D;IAC3D,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,uFAAuF;IACvF,OAAO,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,aAAa,CAAC,EAAE,MAAM,KAAK,IAAI,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MAAM,EAAE,CAO9B;IAED,OAAO,CAAC,cAAc;IA8EtB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CA4B9B;IAED,OAAO,CAAC,YAAY;IAwBpB,OAAO,CAAC,YAAY;IASpB,OAAO,CAAC,WAAW;IAKnB,OAAO,CAAC,WAAW;CAanB","sourcesContent":["import { fuzzyFilter } from \"../fuzzy.ts\";\nimport { getKeybindings } from \"../keybindings.ts\";\nimport type { Component } from \"../tui.ts\";\nimport { truncateToWidth, visibleWidth, wrapTextWithAnsi } from \"../utils.ts\";\nimport { Input } from \"./input.ts\";\n\nexport interface SettingItem {\n\t/** Unique identifier for this setting */\n\tid: string;\n\t/** Display label (left side) */\n\tlabel: string;\n\t/** Optional description shown when selected */\n\tdescription?: string;\n\t/** Current value to display (right side) */\n\tcurrentValue: string;\n\t/** If provided, Enter/Space cycles through these values */\n\tvalues?: string[];\n\t/** If provided, Enter opens this submenu. Receives current value and done callback. */\n\tsubmenu?: (currentValue: string, done: (selectedValue?: string) => void) => Component;\n}\n\nexport interface SettingsListTheme {\n\tlabel: (text: string, selected: boolean) => string;\n\tvalue: (text: string, selected: boolean) => string;\n\tdescription: (text: string) => string;\n\tcursor: string;\n\thint: (text: string) => string;\n}\n\nexport interface SettingsListOptions {\n\tenableSearch?: boolean;\n}\n\nexport class SettingsList implements Component {\n\tprivate items: SettingItem[];\n\tprivate filteredItems: SettingItem[];\n\tprivate theme: SettingsListTheme;\n\tprivate selectedIndex = 0;\n\tprivate maxVisible: number;\n\tprivate onChange: (id: string, newValue: string) => void;\n\tprivate onCancel: () => void;\n\tprivate searchInput?: Input;\n\tprivate searchEnabled: boolean;\n\n\t// Submenu state\n\tprivate submenuComponent: Component | null = null;\n\tprivate submenuItemIndex: number | null = null;\n\n\tconstructor(\n\t\titems: SettingItem[],\n\t\tmaxVisible: number,\n\t\ttheme: SettingsListTheme,\n\t\tonChange: (id: string, newValue: string) => void,\n\t\tonCancel: () => void,\n\t\toptions: SettingsListOptions = {},\n\t) {\n\t\tthis.items = items;\n\t\tthis.filteredItems = items;\n\t\tthis.maxVisible = maxVisible;\n\t\tthis.theme = theme;\n\t\tthis.onChange = onChange;\n\t\tthis.onCancel = onCancel;\n\t\tthis.searchEnabled = options.enableSearch ?? false;\n\t\tif (this.searchEnabled) {\n\t\t\tthis.searchInput = new Input();\n\t\t}\n\t}\n\n\t/** Update an item's currentValue */\n\tupdateValue(id: string, newValue: string): void {\n\t\tconst item = this.items.find((i) => i.id === id);\n\t\tif (item) {\n\t\t\titem.currentValue = newValue;\n\t\t}\n\t}\n\n\tinvalidate(): void {\n\t\tthis.submenuComponent?.invalidate?.();\n\t}\n\n\trender(width: number): string[] {\n\t\t// If submenu is active, render it instead\n\t\tif (this.submenuComponent) {\n\t\t\treturn this.submenuComponent.render(width);\n\t\t}\n\n\t\treturn this.renderMainList(width);\n\t}\n\n\tprivate renderMainList(width: number): string[] {\n\t\tconst lines: string[] = [];\n\n\t\tif (this.searchEnabled && this.searchInput) {\n\t\t\tlines.push(...this.searchInput.render(width));\n\t\t\tlines.push(\"\");\n\t\t}\n\n\t\tif (this.items.length === 0) {\n\t\t\tlines.push(this.theme.hint(\" No settings available\"));\n\t\t\tif (this.searchEnabled) {\n\t\t\t\tthis.addHintLine(lines, width);\n\t\t\t}\n\t\t\treturn lines;\n\t\t}\n\n\t\tconst displayItems = this.searchEnabled ? this.filteredItems : this.items;\n\t\tif (displayItems.length === 0) {\n\t\t\tlines.push(truncateToWidth(this.theme.hint(\" No matching settings\"), width));\n\t\t\tthis.addHintLine(lines, width);\n\t\t\treturn lines;\n\t\t}\n\n\t\t// Calculate visible range with scrolling\n\t\tconst startIndex = Math.max(\n\t\t\t0,\n\t\t\tMath.min(this.selectedIndex - Math.floor(this.maxVisible / 2), displayItems.length - this.maxVisible),\n\t\t);\n\t\tconst endIndex = Math.min(startIndex + this.maxVisible, displayItems.length);\n\n\t\t// Calculate max label width for alignment\n\t\tconst maxLabelWidth = Math.min(30, Math.max(...this.items.map((item) => visibleWidth(item.label))));\n\n\t\t// Render visible items\n\t\tfor (let i = startIndex; i < endIndex; i++) {\n\t\t\tconst item = displayItems[i];\n\t\t\tif (!item) continue;\n\n\t\t\tconst isSelected = i === this.selectedIndex;\n\t\t\tconst prefix = isSelected ? this.theme.cursor : \" \";\n\t\t\tconst prefixWidth = visibleWidth(prefix);\n\n\t\t\t// Pad label to align values\n\t\t\tconst labelPadded = item.label + \" \".repeat(Math.max(0, maxLabelWidth - visibleWidth(item.label)));\n\t\t\tconst labelText = this.theme.label(labelPadded, isSelected);\n\n\t\t\t// Calculate space for value\n\t\t\tconst separator = \" \";\n\t\t\tconst usedWidth = prefixWidth + maxLabelWidth + visibleWidth(separator);\n\t\t\tconst valueMaxWidth = width - usedWidth - 2;\n\n\t\t\tconst valueText = this.theme.value(truncateToWidth(item.currentValue, valueMaxWidth, \"\"), isSelected);\n\n\t\t\tlines.push(truncateToWidth(prefix + labelText + separator + valueText, width));\n\t\t}\n\n\t\t// Add scroll indicator if needed\n\t\tif (startIndex > 0 || endIndex < displayItems.length) {\n\t\t\tconst scrollText = ` (${this.selectedIndex + 1}/${displayItems.length})`;\n\t\t\tlines.push(this.theme.hint(truncateToWidth(scrollText, width - 2, \"\")));\n\t\t}\n\n\t\t// Add description for selected item\n\t\tconst selectedItem = displayItems[this.selectedIndex];\n\t\tif (selectedItem?.description) {\n\t\t\tlines.push(\"\");\n\t\t\tconst wrappedDesc = wrapTextWithAnsi(selectedItem.description, width - 4);\n\t\t\tfor (const line of wrappedDesc) {\n\t\t\t\tlines.push(this.theme.description(` ${line}`));\n\t\t\t}\n\t\t}\n\n\t\t// Add hint\n\t\tthis.addHintLine(lines, width);\n\n\t\treturn lines;\n\t}\n\n\thandleInput(data: string): void {\n\t\t// If submenu is active, delegate all input to it\n\t\t// The submenu's onCancel (triggered by escape) will call done() which closes it\n\t\tif (this.submenuComponent) {\n\t\t\tthis.submenuComponent.handleInput?.(data);\n\t\t\treturn;\n\t\t}\n\n\t\t// Main list input handling\n\t\tconst kb = getKeybindings();\n\t\tconst displayItems = this.searchEnabled ? this.filteredItems : this.items;\n\t\tif (kb.matches(data, \"tui.select.up\")) {\n\t\t\tif (displayItems.length === 0) return;\n\t\t\tthis.selectedIndex = this.selectedIndex === 0 ? displayItems.length - 1 : this.selectedIndex - 1;\n\t\t} else if (kb.matches(data, \"tui.select.down\")) {\n\t\t\tif (displayItems.length === 0) return;\n\t\t\tthis.selectedIndex = this.selectedIndex === displayItems.length - 1 ? 0 : this.selectedIndex + 1;\n\t\t} else if (\n\t\t\tkb.matches(data, \"tui.select.confirm\") ||\n\t\t\t(data === \" \" && (!this.searchEnabled || this.searchInput?.getValue().length === 0))\n\t\t) {\n\t\t\tthis.activateItem();\n\t\t} else if (kb.matches(data, \"tui.select.cancel\")) {\n\t\t\tthis.onCancel();\n\t\t} else if (this.searchEnabled && this.searchInput) {\n\t\t\tthis.searchInput.handleInput(data);\n\t\t\tthis.applyFilter(this.searchInput.getValue());\n\t\t}\n\t}\n\n\tprivate activateItem(): void {\n\t\tconst item = this.searchEnabled ? this.filteredItems[this.selectedIndex] : this.items[this.selectedIndex];\n\t\tif (!item) return;\n\n\t\tif (item.submenu) {\n\t\t\t// Open submenu, passing current value so it can pre-select correctly\n\t\t\tthis.submenuItemIndex = this.selectedIndex;\n\t\t\tthis.submenuComponent = item.submenu(item.currentValue, (selectedValue?: string) => {\n\t\t\t\tif (selectedValue !== undefined) {\n\t\t\t\t\titem.currentValue = selectedValue;\n\t\t\t\t\tthis.onChange(item.id, selectedValue);\n\t\t\t\t}\n\t\t\t\tthis.closeSubmenu();\n\t\t\t});\n\t\t} else if (item.values && item.values.length > 0) {\n\t\t\t// Cycle through values\n\t\t\tconst currentIndex = item.values.indexOf(item.currentValue);\n\t\t\tconst nextIndex = (currentIndex + 1) % item.values.length;\n\t\t\tconst newValue = item.values[nextIndex];\n\t\t\titem.currentValue = newValue;\n\t\t\tthis.onChange(item.id, newValue);\n\t\t}\n\t}\n\n\tprivate closeSubmenu(): void {\n\t\tthis.submenuComponent = null;\n\t\t// Restore selection to the item that opened the submenu\n\t\tif (this.submenuItemIndex !== null) {\n\t\t\tthis.selectedIndex = this.submenuItemIndex;\n\t\t\tthis.submenuItemIndex = null;\n\t\t}\n\t}\n\n\tprivate applyFilter(query: string): void {\n\t\tthis.filteredItems = fuzzyFilter(this.items, query, (item) => item.label);\n\t\tthis.selectedIndex = 0;\n\t}\n\n\tprivate addHintLine(lines: string[], width: number): void {\n\t\tlines.push(\"\");\n\t\tlines.push(\n\t\t\ttruncateToWidth(\n\t\t\t\tthis.theme.hint(\n\t\t\t\t\tthis.searchEnabled\n\t\t\t\t\t\t? \" Type to search · Enter/Space to change · Esc to cancel\"\n\t\t\t\t\t\t: \" Enter/Space to change · Esc to cancel\",\n\t\t\t\t),\n\t\t\t\twidth,\n\t\t\t),\n\t\t);\n\t}\n}\n"]}
1
+ {"version":3,"file":"settings-list.d.ts","sourceRoot":"","sources":["../../src/components/settings-list.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAI3C,MAAM,WAAW,WAAW;IAC3B,yCAAyC;IACzC,EAAE,EAAE,MAAM,CAAC;IACX,gCAAgC;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,+CAA+C;IAC/C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4CAA4C;IAC5C,YAAY,EAAE,MAAM,CAAC;IACrB,2DAA2D;IAC3D,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB;iHAC6G;IAC7G,OAAO,CAAC,EAAE,CACT,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE,CAAC,aAAa,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,KACrE,SAAS,CAAC;CACf;AAED,MAAM,WAAW,iBAAiB;IACjC,KAAK,EAAE,CAAC,IAAI,EA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AK,EAAE,MAAM,GAAG,MAAM,EAAE,CAO9B;IAED,OAAO,CAAC,cAAc;IA8EtB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CA4B9B;IAED,OAAO,CAAC,YAAY;IA8BpB,OAAO,CAAC,YAAY;IAgBpB,OAAO,CAAC,WAAW;IAKnB,OAAO,CAAC,WAAW;CAanB","sourcesContent":["import { fuzzyFilter } from \"../fuzzy.ts\";\nimport { getKeybindings } from \"../keybindings.ts\";\nimport type { Component } from \"../tui.ts\";\nimport { truncateToWidth, visibleWidth, wrapTextWithAnsi } from \"../utils.ts\";\nimport { Input } from \"./input.ts\";\n\nexport interface SettingItem {\n\t/** Unique identifier for this setting */\n\tid: string;\n\t/** Display label (left side) */\n\tlabel: string;\n\t/** Optional description shown when selected */\n\tdescription?: string;\n\t/** Current value to display (right side) */\n\tcurrentValue: string;\n\t/** If provided, Enter/Space cycles through these values */\n\tvalues?: string[];\n\t/** If provided, Enter opens this submenu. Receives current value and done callback.\n\t * done() accepts an optional selectedValue and an optional navigateTo id to move the cursor after close. */\n\tsubmenu?: (\n\t\tcurrentValue: string,\n\t\tdone: (selectedValue?: string, options?: { navigateTo?: string }) => void,\n\t) => Component;\n}\n\nexport interface SettingsListTheme {\n\tlabel: (text: string, selected: boolean) => string;\n\tvalue: (text: string, selected: boolean) => string;\n\tdescription: (text: string) => string;\n\tcursor: string;\n\thint: (text: string) => string;\n}\n\nexport interface SettingsListOptions {\n\tenableSearch?: boolean;\n}\n\nexport class SettingsList implements Component {\n\tprivate items: SettingItem[];\n\tprivate filteredItems: SettingItem[];\n\tprivate theme: SettingsListTheme;\n\tprivate selectedIndex = 0;\n\tprivate maxVisible: number;\n\tprivate onChange: (id: string, newValue: string) => void;\n\tprivate onCancel: () => void;\n\tprivate searchInput?: Input;\n\tprivate searchEnabled: boolean;\n\n\t// Submenu state\n\tprivate submenuComponent: Component | null = null;\n\tprivate submenuItemIndex: number | null = null;\n\tprivate navigateAfterClose: string | null = null;\n\n\tconstructor(\n\t\titems: SettingItem[],\n\t\tmaxVisible: number,\n\t\ttheme: SettingsListTheme,\n\t\tonChange: (id: string, newValue: string) => void,\n\t\tonCancel: () => void,\n\t\toptions: SettingsListOptions = {},\n\t) {\n\t\tthis.items = items;\n\t\tthis.filteredItems = items;\n\t\tthis.maxVisible = maxVisible;\n\t\tthis.theme = theme;\n\t\tthis.onChange = onChange;\n\t\tthis.onCancel = onCancel;\n\t\tthis.searchEnabled = options.enableSearch ?? false;\n\t\tif (this.searchEnabled) {\n\t\t\tthis.searchInput = new Input();\n\t\t}\n\t}\n\n\t/** Update an item's currentValue */\n\tupdateValue(id: string, newValue: string): void {\n\t\tconst item = this.items.find((i) => i.id === id);\n\t\tif (item) {\n\t\t\titem.currentValue = newValue;\n\t\t}\n\t}\n\n\t/** Move selection to the item with the given id (no-op if not found). */\n\tselectItem(id: string): void {\n\t\tconst items = this.searchEnabled ? this.filteredItems : this.items;\n\t\tconst index = items.findIndex((i) => i.id === id);\n\t\tif (index !== -1) {\n\t\t\tthis.selectedIndex = index;\n\t\t}\n\t}\n\n\tinvalidate(): void {\n\t\tthis.submenuComponent?.invalidate?.();\n\t}\n\n\trender(width: number): string[] {\n\t\t// If submenu is active, render it instead\n\t\tif (this.submenuComponent) {\n\t\t\treturn this.submenuComponent.render(width);\n\t\t}\n\n\t\treturn this.renderMainList(width);\n\t}\n\n\tprivate renderMainList(width: number): string[] {\n\t\tconst lines: string[] = [];\n\n\t\tif (this.searchEnabled && this.searchInput) {\n\t\t\tlines.push(...this.searchInput.render(width));\n\t\t\tlines.push(\"\");\n\t\t}\n\n\t\tif (this.items.length === 0) {\n\t\t\tlines.push(this.theme.hint(\" No settings available\"));\n\t\t\tif (this.searchEnabled) {\n\t\t\t\tthis.addHintLine(lines, width);\n\t\t\t}\n\t\t\treturn lines;\n\t\t}\n\n\t\tconst displayItems = this.searchEnabled ? this.filteredItems : this.items;\n\t\tif (displayItems.length === 0) {\n\t\t\tlines.push(truncateToWidth(this.theme.hint(\" No matching settings\"), width));\n\t\t\tthis.addHintLine(lines, width);\n\t\t\treturn lines;\n\t\t}\n\n\t\t// Calculate visible range with scrolling\n\t\tconst startIndex = Math.max(\n\t\t\t0,\n\t\t\tMath.min(this.selectedIndex - Math.floor(this.maxVisible / 2), displayItems.length - this.maxVisible),\n\t\t);\n\t\tconst endIndex = Math.min(startIndex + this.maxVisible, displayItems.length);\n\n\t\t// Calculate max label width for alignment\n\t\tconst maxLabelWidth = Math.min(36, Math.max(...this.items.map((item) => visibleWidth(item.label))));\n\n\t\t// Render visible items\n\t\tfor (let i = startIndex; i < endIndex; i++) {\n\t\t\tconst item = displayItems[i];\n\t\t\tif (!item) continue;\n\n\t\t\tconst isSelected = i === this.selectedIndex;\n\t\t\tconst prefix = isSelected ? this.theme.cursor : \" \";\n\t\t\tconst prefixWidth = visibleWidth(prefix);\n\n\t\t\t// Pad label to align values\n\t\t\tconst labelPadded = item.label + \" \".repeat(Math.max(0, maxLabelWidth - visibleWidth(item.label)));\n\t\t\tconst labelText = this.theme.label(labelPadded, isSelected);\n\n\t\t\t// Calculate space for value\n\t\t\tconst separator = \" \";\n\t\t\tconst usedWidth = prefixWidth + maxLabelWidth + visibleWidth(separator);\n\t\t\tconst valueMaxWidth = width - usedWidth - 2;\n\n\t\t\tconst valueText = this.theme.value(truncateToWidth(item.currentValue, valueMaxWidth, \"\"), isSelected);\n\n\t\t\tlines.push(truncateToWidth(prefix + labelText + separator + valueText, width));\n\t\t}\n\n\t\t// Add scroll indicator if needed\n\t\tif (startIndex > 0 || endIndex < displayItems.length) {\n\t\t\tconst scrollText = ` (${this.selectedIndex + 1}/${displayItems.length})`;\n\t\t\tlines.push(this.theme.hint(truncateToWidth(scrollText, width - 2, \"\")));\n\t\t}\n\n\t\t// Add description for selected item\n\t\tconst selectedItem = displayItems[this.selectedIndex];\n\t\tif (selectedItem?.description) {\n\t\t\tlines.push(\"\");\n\t\t\tconst wrappedDesc = wrapTextWithAnsi(selectedItem.description, width - 4);\n\t\t\tfor (const line of wrappedDesc) {\n\t\t\t\tlines.push(this.theme.description(` ${line}`));\n\t\t\t}\n\t\t}\n\n\t\t// Add hint\n\t\tthis.addHintLine(lines, width);\n\n\t\treturn lines;\n\t}\n\n\thandleInput(data: string): void {\n\t\t// If submenu is active, delegate all input to it\n\t\t// The submenu's onCancel (triggered by escape) will call done() which closes it\n\t\tif (this.submenuComponent) {\n\t\t\tthis.submenuComponent.handleInput?.(data);\n\t\t\treturn;\n\t\t}\n\n\t\t// Main list input handling\n\t\tconst kb = getKeybindings();\n\t\tconst displayItems = this.searchEnabled ? this.filteredItems : this.items;\n\t\tif (kb.matches(data, \"tui.select.up\")) {\n\t\t\tif (displayItems.length === 0) return;\n\t\t\tthis.selectedIndex = this.selectedIndex === 0 ? displayItems.length - 1 : this.selectedIndex - 1;\n\t\t} else if (kb.matches(data, \"tui.select.down\")) {\n\t\t\tif (displayItems.length === 0) return;\n\t\t\tthis.selectedIndex = this.selectedIndex === displayItems.length - 1 ? 0 : this.selectedIndex + 1;\n\t\t} else if (\n\t\t\tkb.matches(data, \"tui.select.confirm\") ||\n\t\t\t(data === \" \" && (!this.searchEnabled || this.searchInput?.getValue().length === 0))\n\t\t) {\n\t\t\tthis.activateItem();\n\t\t} else if (kb.matches(data, \"tui.select.cancel\")) {\n\t\t\tthis.onCancel();\n\t\t} else if (this.searchEnabled && this.searchInput) {\n\t\t\tthis.searchInput.handleInput(data);\n\t\t\tthis.applyFilter(this.searchInput.getValue());\n\t\t}\n\t}\n\n\tprivate activateItem(): void {\n\t\tconst item = this.searchEnabled ? this.filteredItems[this.selectedIndex] : this.items[this.selectedIndex];\n\t\tif (!item) return;\n\n\t\tif (item.submenu) {\n\t\t\t// Open submenu, passing current value so it can pre-select correctly\n\t\t\tthis.submenuItemIndex = this.selectedIndex;\n\t\t\tthis.submenuComponent = item.submenu(\n\t\t\t\titem.currentValue,\n\t\t\t\t(selectedValue?: string, options?: { navigateTo?: string }) => {\n\t\t\t\t\tif (selectedValue !== undefined) {\n\t\t\t\t\t\titem.currentValue = selectedValue;\n\t\t\t\t\t\tthis.onChange(item.id, selectedValue);\n\t\t\t\t\t}\n\t\t\t\t\tif (options?.navigateTo) {\n\t\t\t\t\t\tthis.navigateAfterClose = options.navigateTo;\n\t\t\t\t\t}\n\t\t\t\t\tthis.closeSubmenu();\n\t\t\t\t},\n\t\t\t);\n\t\t} else if (item.values && item.values.length > 0) {\n\t\t\t// Cycle through values\n\t\t\tconst currentIndex = item.values.indexOf(item.currentValue);\n\t\t\tconst nextIndex = (currentIndex + 1) % item.values.length;\n\t\t\tconst newValue = item.values[nextIndex];\n\t\t\titem.currentValue = newValue;\n\t\t\tthis.onChange(item.id, newValue);\n\t\t}\n\t}\n\n\tprivate closeSubmenu(): void {\n\t\tthis.submenuComponent = null;\n\t\tif (this.navigateAfterClose !== null) {\n\t\t\tconst id = this.navigateAfterClose;\n\t\t\tthis.navigateAfterClose = null;\n\t\t\tthis.submenuItemIndex = null;\n\t\t\tthis.selectItem(id);\n\t\t\t// Open the target item's submenu automatically\n\t\t\tthis.activateItem();\n\t\t} else if (this.submenuItemIndex !== null) {\n\t\t\t// Restore selection to the item that opened the submenu\n\t\t\tthis.selectedIndex = this.submenuItemIndex;\n\t\t\tthis.submenuItemIndex = null;\n\t\t}\n\t}\n\n\tprivate applyFilter(query: string): void {\n\t\tthis.filteredItems = fuzzyFilter(this.items, query, (item) => item.label);\n\t\tthis.selectedIndex = 0;\n\t}\n\n\tprivate addHintLine(lines: string[], width: number): void {\n\t\tlines.push(\"\");\n\t\tlines.push(\n\t\t\ttruncateToWidth(\n\t\t\t\tthis.theme.hint(\n\t\t\t\t\tthis.searchEnabled\n\t\t\t\t\t\t? \" Type to search · Enter/Space to change · Esc to cancel\"\n\t\t\t\t\t\t: \" Enter/Space to change · Esc to cancel\",\n\t\t\t\t),\n\t\t\t\twidth,\n\t\t\t),\n\t\t);\n\t}\n}\n"]}
@@ -15,6 +15,7 @@ export class SettingsList {
15
15
  // Submenu state
16
16
  submenuComponent = null;
17
17
  submenuItemIndex = null;
18
+ navigateAfterClose = null;
18
19
  constructor(items, maxVisible, theme, onChange, onCancel, options = {}) {
19
20
  this.items = items;
20
21
  this.filteredItems = items;
@@ -34,6 +35,14 @@ export class SettingsList {
34
35
  item.currentValue = newValue;
35
36
  }
36
37
  }
38
+ /** Move selection to the item with the given id (no-op if not found). */
39
+ selectItem(id) {
40
+ const items = this.searchEnabled ? this.filteredItems : this.items;
41
+ const index = items.findIndex((i) => i.id === id);
42
+ if (index !== -1) {
43
+ this.selectedIndex = index;
44
+ }
45
+ }
37
46
  invalidate() {
38
47
  this.submenuComponent?.invalidate?.();
39
48
  }
@@ -67,7 +76,7 @@ export class SettingsList {
67
76
  const startIndex = Math.max(0, Math.min(this.selectedIndex - Math.floor(this.maxVisible / 2), displayItems.length - this.maxVisible));
68
77
  const endIndex = Math.min(startIndex + this.maxVisible, displayItems.length);
69
78
  // Calculate max label width for alignment
70
- const maxLabelWidth = Math.min(30, Math.max(...this.items.map((item) => visibleWidth(item.label))));
79
+ const maxLabelWidth = Math.min(36, Math.max(...this.items.map((item) => visibleWidth(item.label))));
71
80
  // Render visible items
72
81
  for (let i = startIndex; i < endIndex; i++) {
73
82
  const item = displayItems[i];
@@ -143,11 +152,14 @@ export class SettingsList {
143
152
  if (item.submenu) {
144
153
  // Open submenu, passing current value so it can pre-select correctly
145
154
  this.submenuItemIndex = this.selectedIndex;
146
- this.submenuComponent = item.submenu(item.currentValue, (selectedValue) => {
155
+ this.submenuComponent = item.submenu(item.currentValue, (selectedValue, options) => {
147
156
  if (selectedValue !== undefined) {
148
157
  item.currentValue = selectedValue;
149
158
  this.onChange(item.id, selectedValue);
150
159
  }
160
+ if (options?.navigateTo) {
161
+ this.navigateAfterClose = options.navigateTo;
162
+ }
151
163
  this.closeSubmenu();
152
164
  });
153
165
  }
@@ -162,8 +174,16 @@ export class SettingsList {
162
174
  }
163
175
  closeSubmenu() {
164
176
  this.submenuComponent = null;
165
- // Restore selection to the item that opened the submenu
166
- if (this.submenuItemIndex !== null) {
177
+ if (this.navigateAfterClose !== null) {
178
+ const id = this.navigateAfterClose;
179
+ this.navigateAfterClose = null;
180
+ this.submenuItemIndex = null;
181
+ this.selectItem(id);
182
+ // Open the target item's submenu automatically
183
+ this.activateItem();
184
+ }
185
+ else if (this.submenuItemIndex !== null) {
186
+ // Restore selection to the item that opened the submenu
167
187
  this.selectedIndex = this.submenuItemIndex;
168
188
  this.submenuItemIndex = null;
169
189
  }
@@ -1 +1 @@
1
- {"version":3,"file":"settings-list.js","sourceRoot":"","sources":["../../src/components/settings-list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC9E,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AA6BnC,MAAM,OAAO,YAAY;IAChB,KAAK,CAAgB;IACrB,aAAa,CAAgB;IAC7B,KAAK,CAAoB;IACzB,aAAa,GAAG,CAAC,CAAC;IAClB,UAAU,CAAS;IACnB,QAAQ,CAAyC;IACjD,QAAQ,CAAa;IACrB,WAAW,CAAS;IACpB,aAAa,CAAU;IAE/B,gBAAgB;IACR,gBAAgB,GAAqB,IAAI,CAAC;IAC1C,gBAAgB,GAAkB,IAAI,CAAC;IAE/C,YACC,KAAoB,EACpB,UAAkB,EAClB,KAAwB,EACxB,QAAgD,EAChD,QAAoB,EACpB,OAAO,GAAwB,EAAE,EAChC;QACD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC;QAC3B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,QAAQ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AAC;QAC7B,wDAAwD;QACxD,IAAI,IAAI,CAAC,gBAAgB,KAAK,IAAI,EAAE,CAAC;YACpC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,gBAAgB,CAAC;YAC3C,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC;QAC9B,CAAC;IAAA,CACD;IAEO,WAAW,CAAC,KAAa,EAAQ;QACxC,IAAI,CAAC,aAAa,GAAG,WAAW,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC1E,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC;IAAA,CACvB;IAEO,WAAW,CAAC,KAAe,EAAE,KAAa,EAAQ;QACzD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACf,KAAK,CAAC,IAAI,CACT,eAAe,CACd,IAAI,CAAC,KAAK,CAAC,IAAI,CACd,IAAI,CAAC,aAAa;YACjB,CAAC,CAAC,4DAA0D;YAC5D,CAAC,CAAC,0CAAyC,CAC5C,EACD,KAAK,CACL,CACD,CAAC;IAAA,CACF;CACD","sourcesContent":["import { fuzzyFilter } from \"../fuzzy.ts\";\nimport { getKeybindings } from \"../keybindings.ts\";\nimport type { Component } from \"../tui.ts\";\nimport { truncateToWidth, visibleWidth, wrapTextWithAnsi } from \"../utils.ts\";\nimport { Input } from \"./input.ts\";\n\nexport interface SettingItem {\n\t/** Unique identifier for this setting */\n\tid: string;\n\t/** Display label (left side) */\n\tlabel: string;\n\t/** Optional description shown when selected */\n\tdescription?: string;\n\t/** Current value to display (right side) */\n\tcurrentValue: string;\n\t/** If provided, Enter/Space cycles through these values */\n\tvalues?: string[];\n\t/** If provided, Enter opens this submenu. Receives current value and done callback. */\n\tsubmenu?: (currentValue: string, done: (selectedValue?: string) => void) => Component;\n}\n\nexport interface SettingsListTheme {\n\tlabel: (text: string, selected: boolean) => string;\n\tvalue: (text: string, selected: boolean) => string;\n\tdescription: (text: string) => string;\n\tcursor: string;\n\thint: (text: string) => string;\n}\n\nexport interface SettingsListOptions {\n\tenableSearch?: boolean;\n}\n\nexport class SettingsList implements Component {\n\tprivate items: SettingItem[];\n\tprivate filteredItems: SettingItem[];\n\tprivate theme: SettingsListTheme;\n\tprivate selectedIndex = 0;\n\tprivate maxVisible: number;\n\tprivate onChange: (id: string, newValue: string) => void;\n\tprivate onCancel: () => void;\n\tprivate searchInput?: Input;\n\tprivate searchEnabled: boolean;\n\n\t// Submenu state\n\tprivate submenuComponent: Component | null = null;\n\tprivate submenuItemIndex: number | null = null;\n\n\tconstructor(\n\t\titems: SettingItem[],\n\t\tmaxVisible: number,\n\t\ttheme: SettingsListTheme,\n\t\tonChange: (id: string, newValue: string) => void,\n\t\tonCancel: () => void,\n\t\toptions: SettingsListOptions = {},\n\t) {\n\t\tthis.items = items;\n\t\tthis.filteredItems = items;\n\t\tthis.maxVisible = maxVisible;\n\t\tthis.theme = theme;\n\t\tthis.onChange = onChange;\n\t\tthis.onCancel = onCancel;\n\t\tthis.searchEnabled = options.enableSearch ?? false;\n\t\tif (this.searchEnabled) {\n\t\t\tthis.searchInput = new Input();\n\t\t}\n\t}\n\n\t/** Update an item's currentValue */\n\tupdateValue(id: string, newValue: string): void {\n\t\tconst item = this.items.find((i) => i.id === id);\n\t\tif (item) {\n\t\t\titem.currentValue = newValue;\n\t\t}\n\t}\n\n\tinvalidate(): void {\n\t\tthis.submenuComponent?.invalidate?.();\n\t}\n\n\trender(width: number): string[] {\n\t\t// If submenu is active, render it instead\n\t\tif (this.submenuComponent) {\n\t\t\treturn this.submenuComponent.render(width);\n\t\t}\n\n\t\treturn this.renderMainList(width);\n\t}\n\n\tprivate renderMainList(width: number): string[] {\n\t\tconst lines: string[] = [];\n\n\t\tif (this.searchEnabled && this.searchInput) {\n\t\t\tlines.push(...this.searchInput.render(width));\n\t\t\tlines.push(\"\");\n\t\t}\n\n\t\tif (this.items.length === 0) {\n\t\t\tlines.push(this.theme.hint(\" No settings available\"));\n\t\t\tif (this.searchEnabled) {\n\t\t\t\tthis.addHintLine(lines, width);\n\t\t\t}\n\t\t\treturn lines;\n\t\t}\n\n\t\tconst displayItems = this.searchEnabled ? this.filteredItems : this.items;\n\t\tif (displayItems.length === 0) {\n\t\t\tlines.push(truncateToWidth(this.theme.hint(\" No matching settings\"), width));\n\t\t\tthis.addHintLine(lines, width);\n\t\t\treturn lines;\n\t\t}\n\n\t\t// Calculate visible range with scrolling\n\t\tconst startIndex = Math.max(\n\t\t\t0,\n\t\t\tMath.min(this.selectedIndex - Math.floor(this.maxVisible / 2), displayItems.length - this.maxVisible),\n\t\t);\n\t\tconst endIndex = Math.min(startIndex + this.maxVisible, displayItems.length);\n\n\t\t// Calculate max label width for alignment\n\t\tconst maxLabelWidth = Math.min(30, Math.max(...this.items.map((item) => visibleWidth(item.label))));\n\n\t\t// Render visible items\n\t\tfor (let i = startIndex; i < endIndex; i++) {\n\t\t\tconst item = displayItems[i];\n\t\t\tif (!item) continue;\n\n\t\t\tconst isSelected = i === this.selectedIndex;\n\t\t\tconst prefix = isSelected ? this.theme.cursor : \" \";\n\t\t\tconst prefixWidth = visibleWidth(prefix);\n\n\t\t\t// Pad label to align values\n\t\t\tconst labelPadded = item.label + \" \".repeat(Math.max(0, maxLabelWidth - visibleWidth(item.label)));\n\t\t\tconst labelText = this.theme.label(labelPadded, isSelected);\n\n\t\t\t// Calculate space for value\n\t\t\tconst separator = \" \";\n\t\t\tconst usedWidth = prefixWidth + maxLabelWidth + visibleWidth(separator);\n\t\t\tconst valueMaxWidth = width - usedWidth - 2;\n\n\t\t\tconst valueText = this.theme.value(truncateToWidth(item.currentValue, valueMaxWidth, \"\"), isSelected);\n\n\t\t\tlines.push(truncateToWidth(prefix + labelText + separator + valueText, width));\n\t\t}\n\n\t\t// Add scroll indicator if needed\n\t\tif (startIndex > 0 || endIndex < displayItems.length) {\n\t\t\tconst scrollText = ` (${this.selectedIndex + 1}/${displayItems.length})`;\n\t\t\tlines.push(this.theme.hint(truncateToWidth(scrollText, width - 2, \"\")));\n\t\t}\n\n\t\t// Add description for selected item\n\t\tconst selectedItem = displayItems[this.selectedIndex];\n\t\tif (selectedItem?.description) {\n\t\t\tlines.push(\"\");\n\t\t\tconst wrappedDesc = wrapTextWithAnsi(selectedItem.description, width - 4);\n\t\t\tfor (const line of wrappedDesc) {\n\t\t\t\tlines.push(this.theme.description(` ${line}`));\n\t\t\t}\n\t\t}\n\n\t\t// Add hint\n\t\tthis.addHintLine(lines, width);\n\n\t\treturn lines;\n\t}\n\n\thandleInput(data: string): void {\n\t\t// If submenu is active, delegate all input to it\n\t\t// The submenu's onCancel (triggered by escape) will call done() which closes it\n\t\tif (this.submenuComponent) {\n\t\t\tthis.submenuComponent.handleInput?.(data);\n\t\t\treturn;\n\t\t}\n\n\t\t// Main list input handling\n\t\tconst kb = getKeybindings();\n\t\tconst displayItems = this.searchEnabled ? this.filteredItems : this.items;\n\t\tif (kb.matches(data, \"tui.select.up\")) {\n\t\t\tif (displayItems.length === 0) return;\n\t\t\tthis.selectedIndex = this.selectedIndex === 0 ? displayItems.length - 1 : this.selectedIndex - 1;\n\t\t} else if (kb.matches(data, \"tui.select.down\")) {\n\t\t\tif (displayItems.length === 0) return;\n\t\t\tthis.selectedIndex = this.selectedIndex === displayItems.length - 1 ? 0 : this.selectedIndex + 1;\n\t\t} else if (\n\t\t\tkb.matches(data, \"tui.select.confirm\") ||\n\t\t\t(data === \" \" && (!this.searchEnabled || this.searchInput?.getValue().length === 0))\n\t\t) {\n\t\t\tthis.activateItem();\n\t\t} else if (kb.matches(data, \"tui.select.cancel\")) {\n\t\t\tthis.onCancel();\n\t\t} else if (this.searchEnabled && this.searchInput) {\n\t\t\tthis.searchInput.handleInput(data);\n\t\t\tthis.applyFilter(this.searchInput.getValue());\n\t\t}\n\t}\n\n\tprivate activateItem(): void {\n\t\tconst item = this.searchEnabled ? this.filteredItems[this.selectedIndex] : this.items[this.selectedIndex];\n\t\tif (!item) return;\n\n\t\tif (item.submenu) {\n\t\t\t// Open submenu, passing current value so it can pre-select correctly\n\t\t\tthis.submenuItemIndex = this.selectedIndex;\n\t\t\tthis.submenuComponent = item.submenu(item.currentValue, (selectedValue?: string) => {\n\t\t\t\tif (selectedValue !== undefined) {\n\t\t\t\t\titem.currentValue = selectedValue;\n\t\t\t\t\tthis.onChange(item.id, selectedValue);\n\t\t\t\t}\n\t\t\t\tthis.closeSubmenu();\n\t\t\t});\n\t\t} else if (item.values && item.values.length > 0) {\n\t\t\t// Cycle through values\n\t\t\tconst currentIndex = item.values.indexOf(item.currentValue);\n\t\t\tconst nextIndex = (currentIndex + 1) % item.values.length;\n\t\t\tconst newValue = item.values[nextIndex];\n\t\t\titem.currentValue = newValue;\n\t\t\tthis.onChange(item.id, newValue);\n\t\t}\n\t}\n\n\tprivate closeSubmenu(): void {\n\t\tthis.submenuComponent = null;\n\t\t// Restore selection to the item that opened the submenu\n\t\tif (this.submenuItemIndex !== null) {\n\t\t\tthis.selectedIndex = this.submenuItemIndex;\n\t\t\tthis.submenuItemIndex = null;\n\t\t}\n\t}\n\n\tprivate applyFilter(query: string): void {\n\t\tthis.filteredItems = fuzzyFilter(this.items, query, (item) => item.label);\n\t\tthis.selectedIndex = 0;\n\t}\n\n\tprivate addHintLine(lines: string[], width: number): void {\n\t\tlines.push(\"\");\n\t\tlines.push(\n\t\t\ttruncateToWidth(\n\t\t\t\tthis.theme.hint(\n\t\t\t\t\tthis.searchEnabled\n\t\t\t\t\t\t? \" Type to search · Enter/Space to change · Esc to cancel\"\n\t\t\t\t\t\t: \" Enter/Space to change · Esc to cancel\",\n\t\t\t\t),\n\t\t\t\twidth,\n\t\t\t),\n\t\t);\n\t}\n}\n"]}
1
+ {"version":3,"file":"settings-list.js","sourceRoot":"","sources":["../../src/components/settings-list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,m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EO,YAAY,GAAS;QAC5B,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC;QAC7B,IAAI,IAAI,CAAC,kBAAkB,KAAK,IAAI,EAAE,CAAC;YACtC,MAAM,EAAE,GAAG,IAAI,CAAC,kBAAkB,CAAC;YACnC,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC;YAC/B,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC;YAC7B,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;YACpB,+CAA+C;YAC/C,IAAI,CAAC,YAAY,EAAE,CAAC;QACrB,CAAC;aAAM,IAAI,IAAI,CAAC,gBAAgB,KAAK,IAAI,EAAE,CAAC;YAC3C,wDAAwD;YACxD,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,gBAAgB,CAAC;YAC3C,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC;QAC9B,CAAC;IAAA,CACD;IAEO,WAAW,CAAC,KAAa,EAAQ;QACxC,IAAI,CAAC,aAAa,GAAG,WAAW,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC1E,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC;IAAA,CACvB;IAEO,WAAW,CAAC,KAAe,EAAE,KAAa,EAAQ;QACzD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACf,KAAK,CAAC,IAAI,CACT,eAAe,CACd,IAAI,CAAC,KAAK,CAAC,IAAI,CACd,IAAI,CAAC,aAAa;YACjB,CAAC,CAAC,4DAA0D;YAC5D,CAAC,CAAC,0CAAyC,CAC5C,EACD,KAAK,CACL,CACD,CAAC;IAAA,CACF;CACD","sourcesContent":["import { fuzzyFilter } from \"../fuzzy.ts\";\nimport { getKeybindings } from \"../keybindings.ts\";\nimport type { Component } from \"../tui.ts\";\nimport { truncateToWidth, visibleWidth, wrapTextWithAnsi } from \"../utils.ts\";\nimport { Input } from \"./input.ts\";\n\nexport interface SettingItem {\n\t/** Unique identifier for this setting */\n\tid: string;\n\t/** Display label (left side) */\n\tlabel: string;\n\t/** Optional description shown when selected */\n\tdescription?: string;\n\t/** Current value to display (right side) */\n\tcurrentValue: string;\n\t/** If provided, Enter/Space cycles through these values */\n\tvalues?: string[];\n\t/** If provided, Enter opens this submenu. Receives current value and done callback.\n\t * done() accepts an optional selectedValue and an optional navigateTo id to move the cursor after close. */\n\tsubmenu?: (\n\t\tcurrentValue: string,\n\t\tdone: (selectedValue?: string, options?: { navigateTo?: string }) => void,\n\t) => Component;\n}\n\nexport interface SettingsListTheme {\n\tlabel: (text: string, selected: boolean) => string;\n\tvalue: (text: string, selected: boolean) => string;\n\tdescription: (text: string) => string;\n\tcursor: string;\n\thint: (text: string) => string;\n}\n\nexport interface SettingsListOptions {\n\tenableSearch?: boolean;\n}\n\nexport class SettingsList implements Component {\n\tprivate items: SettingItem[];\n\tprivate filteredItems: SettingItem[];\n\tprivate theme: SettingsListTheme;\n\tprivate selectedIndex = 0;\n\tprivate maxVisible: number;\n\tprivate onChange: (id: string, newValue: string) => void;\n\tprivate onCancel: () => void;\n\tprivate searchInput?: Input;\n\tprivate searchEnabled: boolean;\n\n\t// Submenu state\n\tprivate submenuComponent: Component | null = null;\n\tprivate submenuItemIndex: number | null = null;\n\tprivate navigateAfterClose: string | null = null;\n\n\tconstructor(\n\t\titems: SettingItem[],\n\t\tmaxVisible: number,\n\t\ttheme: SettingsListTheme,\n\t\tonChange: (id: string, newValue: string) => void,\n\t\tonCancel: () => void,\n\t\toptions: SettingsListOptions = {},\n\t) {\n\t\tthis.items = items;\n\t\tthis.filteredItems = items;\n\t\tthis.maxVisible = maxVisible;\n\t\tthis.theme = theme;\n\t\tthis.onChange = onChange;\n\t\tthis.onCancel = onCancel;\n\t\tthis.searchEnabled = options.enableSearch ?? false;\n\t\tif (this.searchEnabled) {\n\t\t\tthis.searchInput = new Input();\n\t\t}\n\t}\n\n\t/** Update an item's currentValue */\n\tupdateValue(id: string, newValue: string): void {\n\t\tconst item = this.items.find((i) => i.id === id);\n\t\tif (item) {\n\t\t\titem.currentValue = newValue;\n\t\t}\n\t}\n\n\t/** Move selection to the item with the given id (no-op if not found). */\n\tselectItem(id: string): void {\n\t\tconst items = this.searchEnabled ? this.filteredItems : this.items;\n\t\tconst index = items.findIndex((i) => i.id === id);\n\t\tif (index !== -1) {\n\t\t\tthis.selectedIndex = index;\n\t\t}\n\t}\n\n\tinvalidate(): void {\n\t\tthis.submenuComponent?.invalidate?.();\n\t}\n\n\trender(width: number): string[] {\n\t\t// If submenu is active, render it instead\n\t\tif (this.submenuComponent) {\n\t\t\treturn this.submenuComponent.render(width);\n\t\t}\n\n\t\treturn this.renderMainList(width);\n\t}\n\n\tprivate renderMainList(width: number): string[] {\n\t\tconst lines: string[] = [];\n\n\t\tif (this.searchEnabled && this.searchInput) {\n\t\t\tlines.push(...this.searchInput.render(width));\n\t\t\tlines.push(\"\");\n\t\t}\n\n\t\tif (this.items.length === 0) {\n\t\t\tlines.push(this.theme.hint(\" No settings available\"));\n\t\t\tif (this.searchEnabled) {\n\t\t\t\tthis.addHintLine(lines, width);\n\t\t\t}\n\t\t\treturn lines;\n\t\t}\n\n\t\tconst displayItems = this.searchEnabled ? this.filteredItems : this.items;\n\t\tif (displayItems.length === 0) {\n\t\t\tlines.push(truncateToWidth(this.theme.hint(\" No matching settings\"), width));\n\t\t\tthis.addHintLine(lines, width);\n\t\t\treturn lines;\n\t\t}\n\n\t\t// Calculate visible range with scrolling\n\t\tconst startIndex = Math.max(\n\t\t\t0,\n\t\t\tMath.min(this.selectedIndex - Math.floor(this.maxVisible / 2), displayItems.length - this.maxVisible),\n\t\t);\n\t\tconst endIndex = Math.min(startIndex + this.maxVisible, displayItems.length);\n\n\t\t// Calculate max label width for alignment\n\t\tconst maxLabelWidth = Math.min(36, Math.max(...this.items.map((item) => visibleWidth(item.label))));\n\n\t\t// Render visible items\n\t\tfor (let i = startIndex; i < endIndex; i++) {\n\t\t\tconst item = displayItems[i];\n\t\t\tif (!item) continue;\n\n\t\t\tconst isSelected = i === this.selectedIndex;\n\t\t\tconst prefix = isSelected ? this.theme.cursor : \" \";\n\t\t\tconst prefixWidth = visibleWidth(prefix);\n\n\t\t\t// Pad label to align values\n\t\t\tconst labelPadded = item.label + \" \".repeat(Math.max(0, maxLabelWidth - visibleWidth(item.label)));\n\t\t\tconst labelText = this.theme.label(labelPadded, isSelected);\n\n\t\t\t// Calculate space for value\n\t\t\tconst separator = \" \";\n\t\t\tconst usedWidth = prefixWidth + maxLabelWidth + visibleWidth(separator);\n\t\t\tconst valueMaxWidth = width - usedWidth - 2;\n\n\t\t\tconst valueText = this.theme.value(truncateToWidth(item.currentValue, valueMaxWidth, \"\"), isSelected);\n\n\t\t\tlines.push(truncateToWidth(prefix + labelText + separator + valueText, width));\n\t\t}\n\n\t\t// Add scroll indicator if needed\n\t\tif (startIndex > 0 || endIndex < displayItems.length) {\n\t\t\tconst scrollText = ` (${this.selectedIndex + 1}/${displayItems.length})`;\n\t\t\tlines.push(this.theme.hint(truncateToWidth(scrollText, width - 2, \"\")));\n\t\t}\n\n\t\t// Add description for selected item\n\t\tconst selectedItem = displayItems[this.selectedIndex];\n\t\tif (selectedItem?.description) {\n\t\t\tlines.push(\"\");\n\t\t\tconst wrappedDesc = wrapTextWithAnsi(selectedItem.description, width - 4);\n\t\t\tfor (const line of wrappedDesc) {\n\t\t\t\tlines.push(this.theme.description(` ${line}`));\n\t\t\t}\n\t\t}\n\n\t\t// Add hint\n\t\tthis.addHintLine(lines, width);\n\n\t\treturn lines;\n\t}\n\n\thandleInput(data: string): void {\n\t\t// If submenu is active, delegate all input to it\n\t\t// The submenu's onCancel (triggered by escape) will call done() which closes it\n\t\tif (this.submenuComponent) {\n\t\t\tthis.submenuComponent.handleInput?.(data);\n\t\t\treturn;\n\t\t}\n\n\t\t// Main list input handling\n\t\tconst kb = getKeybindings();\n\t\tconst displayItems = this.searchEnabled ? this.filteredItems : this.items;\n\t\tif (kb.matches(data, \"tui.select.up\")) {\n\t\t\tif (displayItems.length === 0) return;\n\t\t\tthis.selectedIndex = this.selectedIndex === 0 ? displayItems.length - 1 : this.selectedIndex - 1;\n\t\t} else if (kb.matches(data, \"tui.select.down\")) {\n\t\t\tif (displayItems.length === 0) return;\n\t\t\tthis.selectedIndex = this.selectedIndex === displayItems.length - 1 ? 0 : this.selectedIndex + 1;\n\t\t} else if (\n\t\t\tkb.matches(data, \"tui.select.confirm\") ||\n\t\t\t(data === \" \" && (!this.searchEnabled || this.searchInput?.getValue().length === 0))\n\t\t) {\n\t\t\tthis.activateItem();\n\t\t} else if (kb.matches(data, \"tui.select.cancel\")) {\n\t\t\tthis.onCancel();\n\t\t} else if (this.searchEnabled && this.searchInput) {\n\t\t\tthis.searchInput.handleInput(data);\n\t\t\tthis.applyFilter(this.searchInput.getValue());\n\t\t}\n\t}\n\n\tprivate activateItem(): void {\n\t\tconst item = this.searchEnabled ? this.filteredItems[this.selectedIndex] : this.items[this.selectedIndex];\n\t\tif (!item) return;\n\n\t\tif (item.submenu) {\n\t\t\t// Open submenu, passing current value so it can pre-select correctly\n\t\t\tthis.submenuItemIndex = this.selectedIndex;\n\t\t\tthis.submenuComponent = item.submenu(\n\t\t\t\titem.currentValue,\n\t\t\t\t(selectedValue?: string, options?: { navigateTo?: string }) => {\n\t\t\t\t\tif (selectedValue !== undefined) {\n\t\t\t\t\t\titem.currentValue = selectedValue;\n\t\t\t\t\t\tthis.onChange(item.id, selectedValue);\n\t\t\t\t\t}\n\t\t\t\t\tif (options?.navigateTo) {\n\t\t\t\t\t\tthis.navigateAfterClose = options.navigateTo;\n\t\t\t\t\t}\n\t\t\t\t\tthis.closeSubmenu();\n\t\t\t\t},\n\t\t\t);\n\t\t} else if (item.values && item.values.length > 0) {\n\t\t\t// Cycle through values\n\t\t\tconst currentIndex = item.values.indexOf(item.currentValue);\n\t\t\tconst nextIndex = (currentIndex + 1) % item.values.length;\n\t\t\tconst newValue = item.values[nextIndex];\n\t\t\titem.currentValue = newValue;\n\t\t\tthis.onChange(item.id, newValue);\n\t\t}\n\t}\n\n\tprivate closeSubmenu(): void {\n\t\tthis.submenuComponent = null;\n\t\tif (this.navigateAfterClose !== null) {\n\t\t\tconst id = this.navigateAfterClose;\n\t\t\tthis.navigateAfterClose = null;\n\t\t\tthis.submenuItemIndex = null;\n\t\t\tthis.selectItem(id);\n\t\t\t// Open the target item's submenu automatically\n\t\t\tthis.activateItem();\n\t\t} else if (this.submenuItemIndex !== null) {\n\t\t\t// Restore selection to the item that opened the submenu\n\t\t\tthis.selectedIndex = this.submenuItemIndex;\n\t\t\tthis.submenuItemIndex = null;\n\t\t}\n\t}\n\n\tprivate applyFilter(query: string): void {\n\t\tthis.filteredItems = fuzzyFilter(this.items, query, (item) => item.label);\n\t\tthis.selectedIndex = 0;\n\t}\n\n\tprivate addHintLine(lines: string[], width: number): void {\n\t\tlines.push(\"\");\n\t\tlines.push(\n\t\t\ttruncateToWidth(\n\t\t\t\tthis.theme.hint(\n\t\t\t\t\tthis.searchEnabled\n\t\t\t\t\t\t? \" Type to search · Enter/Space to change · Esc to cancel\"\n\t\t\t\t\t\t: \" Enter/Space to change · Esc to cancel\",\n\t\t\t\t),\n\t\t\t\twidth,\n\t\t\t),\n\t\t);\n\t}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../src/components/text.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAG3C;;GAEG;AACH,qBAAa,IAAK,YAAW,SAAS;IACrC,OAAO,CAAC,IAAI,CAAS;IACrB,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,UAAU,CAAC,CAA2B;IAG9C,OAAO,CAAC,UAAU,CAAC,CAAS;IAC5B,OAAO,CAAC,WAAW,CAAC,CAAS;IAC7B,OAAO,CAAC,WAAW,CAAC,CAAW;IAE/B,YAAY,IAAI,GAAE,MAAW,EAAE,QAAQ,GAAE,MAAU,EAAE,QAAQ,GAAE,MAAU,EAAE,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,EAK/G;IAED,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAK1B;IAED,aAAa,CAAC,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAKzD;IAED,UAAU,IAAI,IAAI,CAIjB;IAED,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CA4D9B;CACD","sourcesContent":["import type { Component } from \"../tui.ts\";\nimport { applyBackgroundToLine, visibleWidth, wrapTextWithAnsi } from \"../utils.ts\";\n\n/**\n * Text component - displays multi-line text with word wrapping\n */\nexport class Text implements Component {\n\tprivate text: string;\n\tprivate paddingX: number; // Left/right padding\n\tprivate paddingY: number; // Top/bottom padding\n\tprivate customBgFn?: (text: string) => string;\n\n\t// Cache for rendered output\n\tprivate cachedText?: string;\n\tprivate cachedWidth?: number;\n\tprivate cachedLines?: string[];\n\n\tconstructor(text: string = \"\", paddingX: number = 1, paddingY: number = 1, customBgFn?: (text: string) => string) {\n\t\tthis.text = text;\n\t\tthis.paddingX = paddingX;\n\t\tthis.paddingY = paddingY;\n\t\tthis.customBgFn = customBgFn;\n\t}\n\n\tsetText(text: string): void {\n\t\tthis.text = text;\n\t\tthis.cachedText = undefined;\n\t\tthis.cachedWidth = undefined;\n\t\tthis.cachedLines = undefined;\n\t}\n\n\tsetCustomBgFn(customBgFn?: (text: string) => string): void {\n\t\tthis.customBgFn = customBgFn;\n\t\tthis.cachedText = undefined;\n\t\tthis.cachedWidth = undefined;\n\t\tthis.cachedLines = undefined;\n\t}\n\n\tinvalidate(): void {\n\t\tthis.cachedText = undefined;\n\t\tthis.cachedWidth = undefined;\n\t\tthis.cachedLines = undefined;\n\t}\n\n\trender(width: number): string[] {\n\t\t// Check cache\n\t\tif (this.cachedLines && this.cachedText === this.text && this.cachedWidth === width) {\n\t\t\treturn this.cachedLines;\n\t\t}\n\n\t\t// Don't render anything if there's no actual text\n\t\tif (!this.text || this.text.trim() === \"\") {\n\t\t\tconst result: string[] = [];\n\t\t\tthis.cachedText = this.text;\n\t\t\tthis.cachedWidth = width;\n\t\t\tthis.cachedLines = result;\n\t\t\treturn result;\n\t\t}\n\n\t\t// Replace tabs with 3 spaces\n\t\tconst normalizedText = this.text.replace(/\\t/g, \" \");\n\n\t\t// Calculate content width (subtract left/right margins)\n\t\tconst contentWidth = Math.max(1, width - this.paddingX * 2);\n\n\t\t// Wrap text (this preserves ANSI codes but does NOT pad)\n\t\tconst wrappedLines = wrapTextWithAnsi(normalizedText, contentWidth);\n\n\t\t// Add margins and background to each line\n\t\tconst leftMargin = \" \".repeat(this.paddingX);\n\t\tconst rightMargin = \" \".repeat(this.paddingX);\n\t\tconst contentLines: string[] = [];\n\n\t\tfor (const line of wrappedLines) {\n\t\t\t// Add margins\n\t\t\tconst lineWithMargins = leftMargin + line + rightMargin;\n\n\t\t\t// Apply background if specified (this also pads to full width)\n\t\t\tif (this.customBgFn) {\n\t\t\t\tcontentLines.push(applyBackgroundToLine(lineWithMargins, width, this.customBgFn));\n\t\t\t} else {\n\t\t\t\t// No background - just pad to width with spaces\n\t\t\t\tconst visibleLen = visibleWidth(lineWithMargins);\n\t\t\t\tconst paddingNeeded = Math.max(0, width - visibleLen);\n\t\t\t\tcontentLines.push(lineWithMargins + \" \".repeat(paddingNeeded));\n\t\t\t}\n\t\t}\n\n\t\t// Add top/bottom padding (empty lines)\n\t\tconst emptyLine = \" \".repeat(width);\n\t\tconst emptyLines: string[] = [];\n\t\tfor (let i = 0; i < this.paddingY; i++) {\n\t\t\tconst line = this.customBgFn ? applyBackgroundToLine(emptyLine, width, this.customBgFn) : emptyLine;\n\t\t\temptyLines.push(line);\n\t\t}\n\n\t\tconst result = [...emptyLines, ...contentLines, ...emptyLines];\n\n\t\t// Update cache\n\t\tthis.cachedText = this.text;\n\t\tthis.cachedWidth = width;\n\t\tthis.cachedLines = result;\n\n\t\treturn result.length > 0 ? result : [\"\"];\n\t}\n}\n"]}
1
+ {"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../src/components/text.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAG3C;;GAEG;AACH,qBAAa,IAAK,YAAW,SAAS;IACrC,OAAO,CAAC,IAAI,CAAS;IACrB,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,UAAU,CAAC,CAA2B;IAG9C,OAAO,CAAC,UAAU,CAAC,CAAS;IAC5B,OAAO,CAAC,WAAW,CAAC,CAAS;IAC7B,OAAO,CAAC,WAAW,CAAC,CAAW;IAE/B,YAAY,IAAI,GAAE,MAAW,EAAE,QAAQ,GAAE,MAAU,EAAE,QAAQ,GAAE,MAAU,EAAE,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,EAK/G;IAED,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAK1B;IAED,aAAa,CAAC,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAKzD;IAED,UAAU,IAAI,IAAI,CAIjB;IAED,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CA6D9B;CACD","sourcesContent":["import type { Component } from \"../tui.ts\";\nimport { applyBackgroundToLine, visibleWidth, wrapTextWithAnsi } from \"../utils.ts\";\n\n/**\n * Text component - displays multi-line text with word wrapping\n */\nexport class Text implements Component {\n\tprivate text: string;\n\tprivate paddingX: number; // Left/right padding\n\tprivate paddingY: number; // Top/bottom padding\n\tprivate customBgFn?: (text: string) => string;\n\n\t// Cache for rendered output\n\tprivate cachedText?: string;\n\tprivate cachedWidth?: number;\n\tprivate cachedLines?: string[];\n\n\tconstructor(text: string = \"\", paddingX: number = 1, paddingY: number = 1, customBgFn?: (text: string) => string) {\n\t\tthis.text = text;\n\t\tthis.paddingX = paddingX;\n\t\tthis.paddingY = paddingY;\n\t\tthis.customBgFn = customBgFn;\n\t}\n\n\tsetText(text: string): void {\n\t\tthis.text = text;\n\t\tthis.cachedText = undefined;\n\t\tthis.cachedWidth = undefined;\n\t\tthis.cachedLines = undefined;\n\t}\n\n\tsetCustomBgFn(customBgFn?: (text: string) => string): void {\n\t\tthis.customBgFn = customBgFn;\n\t\tthis.cachedText = undefined;\n\t\tthis.cachedWidth = undefined;\n\t\tthis.cachedLines = undefined;\n\t}\n\n\tinvalidate(): void {\n\t\tthis.cachedText = undefined;\n\t\tthis.cachedWidth = undefined;\n\t\tthis.cachedLines = undefined;\n\t}\n\n\trender(width: number): string[] {\n\t\t// Check cache\n\t\tif (this.cachedLines && this.cachedText === this.text && this.cachedWidth === width) {\n\t\t\treturn this.cachedLines;\n\t\t}\n\n\t\t// Don't render anything if there's no actual text\n\t\tif (!this.text || this.text.trim() === \"\") {\n\t\t\tconst result: string[] = [];\n\t\t\tthis.cachedText = this.text;\n\t\t\tthis.cachedWidth = width;\n\t\t\tthis.cachedLines = result;\n\t\t\treturn result;\n\t\t}\n\n\t\t// Replace tabs with 3 spaces\n\t\tconst normalizedText = this.text.replace(/\\t/g, \" \");\n\n\t\t// Reduce margins when necessary so content and padding fit within the available width.\n\t\tconst paddingX = Math.min(this.paddingX, Math.max(0, Math.floor((width - 1) / 2)));\n\t\tconst contentWidth = Math.max(1, width - paddingX * 2);\n\n\t\t// Wrap text (this preserves ANSI codes but does NOT pad)\n\t\tconst wrappedLines = wrapTextWithAnsi(normalizedText, contentWidth);\n\n\t\t// Add margins and background to each line\n\t\tconst leftMargin = \" \".repeat(paddingX);\n\t\tconst rightMargin = \" \".repeat(paddingX);\n\t\tconst contentLines: string[] = [];\n\n\t\tfor (const line of wrappedLines) {\n\t\t\t// Add margins\n\t\t\tconst lineWithMargins = leftMargin + line + rightMargin;\n\n\t\t\t// Apply background if specified (this also pads to full width)\n\t\t\tif (this.customBgFn) {\n\t\t\t\tcontentLines.push(applyBackgroundToLine(lineWithMargins, width, this.customBgFn));\n\t\t\t} else {\n\t\t\t\t// No background - just pad to width with spaces\n\t\t\t\tconst visibleLen = visibleWidth(lineWithMargins);\n\t\t\t\tconst paddingNeeded = Math.max(0, width - visibleLen);\n\t\t\t\tcontentLines.push(lineWithMargins + \" \".repeat(paddingNeeded));\n\t\t\t}\n\t\t}\n\n\t\t// Add top/bottom padding (empty lines)\n\t\tconst emptyLine = \" \".repeat(width);\n\t\tconst emptyLines: string[] = [];\n\t\tfor (let i = 0; i < this.paddingY; i++) {\n\t\t\tconst line = this.customBgFn ? applyBackgroundToLine(emptyLine, width, this.customBgFn) : emptyLine;\n\t\t\temptyLines.push(line);\n\t\t}\n\n\t\tconst result = [...emptyLines, ...contentLines, ...emptyLines];\n\n\t\t// Update cache\n\t\tthis.cachedText = this.text;\n\t\tthis.cachedWidth = width;\n\t\tthis.cachedLines = result;\n\n\t\treturn result.length > 0 ? result : [\"\"];\n\t}\n}\n"]}
@@ -49,13 +49,14 @@ export class Text {
49
49
  }
50
50
  // Replace tabs with 3 spaces
51
51
  const normalizedText = this.text.replace(/\t/g, " ");
52
- // Calculate content width (subtract left/right margins)
53
- const contentWidth = Math.max(1, width - this.paddingX * 2);
52
+ // Reduce margins when necessary so content and padding fit within the available width.
53
+ const paddingX = Math.min(this.paddingX, Math.max(0, Math.floor((width - 1) / 2)));
54
+ const contentWidth = Math.max(1, width - paddingX * 2);
54
55
  // Wrap text (this preserves ANSI codes but does NOT pad)
55
56
  const wrappedLines = wrapTextWithAnsi(normalizedText, contentWidth);
56
57
  // Add margins and background to each line
57
- const leftMargin = " ".repeat(this.paddingX);
58
- const rightMargin = " ".repeat(this.paddingX);
58
+ const leftMargin = " ".repeat(paddingX);
59
+ const rightMargin = " ".repeat(paddingX);
59
60
  const contentLines = [];
60
61
  for (const line of wrappedLines) {
61
62
  // Add margins
@@ -1 +1 @@
1
- {"version":3,"file":"text.js","sourceRoot":"","sources":["../../src/components/text.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpF;;GAEG;AACH,MAAM,OAAO,IAAI;IACR,IAAI,CAAS;IACb,QAAQ,CAAS,CAAC,qBAAqB;IACvC,QAAQ,CAAS,CAAC,qBAAqB;IACvC,UAAU,CAA4B;IAE9C,4BAA4B;IACpB,UAAU,CAAU;IACpB,WAAW,CAAU;IACrB,WAAW,CAAY;IAE/B,YAAY,IAAI,GAAW,EAAE,EAAE,QAAQ,GAAW,CAAC,EAAE,QAAQ,GAAW,CAAC,EAAE,UAAqC,EAAE;QACjH,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAAA,CAC7B;IAED,OAAO,CAAC,IAAY,EAAQ;QAC3B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,IAAI,CAAC,WAAW,GAAG,SAAS,CAAC;QAC7B,IAAI,CAAC,WAAW,GAAG,SAAS,CAAC;IAAA,CAC7B;IAED,aAAa,CAAC,UAAqC,EAAQ;QAC1D,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,IAAI,CAAC,WAAW,GAAG,SAAS,CAAC;QAC7B,IAAI,CAAC,WAAW,GAAG,SAAS,CAAC;IAAA,CAC7B;IAED,UAAU,GAAS;QAClB,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,IAAI,CAAC,WAAW,GAAG,SAAS,CAAC;QAC7B,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CAAC,CAAC,EAAE,CAAC,CAAC;IAAA,CACzC;CACD","sourcesContent":["import type { Component } from \"../tui.ts\";\nimport { applyBackgroundToLine, visibleWidth, wrapTextWithAnsi } from \"../utils.ts\";\n\n/**\n * Text component - displays multi-line text with word wrapping\n */\nexport class Text implements Component {\n\tprivate text: string;\n\tprivate paddingX: number; // Left/right padding\n\tprivate paddingY: number; // Top/bottom padding\n\tprivate customBgFn?: (text: string) => string;\n\n\t// Cache for rendered output\n\tprivate cachedText?: string;\n\tprivate cachedWidth?: number;\n\tprivate cachedLines?: string[];\n\n\tconstructor(text: string = \"\", paddingX: number = 1, paddingY: number = 1, customBgFn?: (text: string) => string) {\n\t\tthis.text = text;\n\t\tthis.paddingX = paddingX;\n\t\tthis.paddingY = paddingY;\n\t\tthis.customBgFn = customBgFn;\n\t}\n\n\tsetText(text: string): void {\n\t\tthis.text = text;\n\t\tthis.cachedText = undefined;\n\t\tthis.cachedWidth = undefined;\n\t\tthis.cachedLines = undefined;\n\t}\n\n\tsetCustomBgFn(customBgFn?: (text: string) => string): void {\n\t\tthis.customBgFn = customBgFn;\n\t\tthis.cachedText = undefined;\n\t\tthis.cachedWidth = undefined;\n\t\tthis.cachedLines = undefined;\n\t}\n\n\tinvalidate(): void {\n\t\tthis.cachedText = undefined;\n\t\tthis.cachedWidth = undefined;\n\t\tthis.cachedLines = undefined;\n\t}\n\n\trender(width: number): string[] {\n\t\t// Check cache\n\t\tif (this.cachedLines && this.cachedText === this.text && this.cachedWidth === width) {\n\t\t\treturn this.cachedLines;\n\t\t}\n\n\t\t// Don't render anything if there's no actual text\n\t\tif (!this.text || this.text.trim() === \"\") {\n\t\t\tconst result: string[] = [];\n\t\t\tthis.cachedText = this.text;\n\t\t\tthis.cachedWidth = width;\n\t\t\tthis.cachedLines = result;\n\t\t\treturn result;\n\t\t}\n\n\t\t// Replace tabs with 3 spaces\n\t\tconst normalizedText = this.text.replace(/\\t/g, \" \");\n\n\t\t// Calculate content width (subtract left/right margins)\n\t\tconst contentWidth = Math.max(1, width - this.paddingX * 2);\n\n\t\t// Wrap text (this preserves ANSI codes but does NOT pad)\n\t\tconst wrappedLines = wrapTextWithAnsi(normalizedText, contentWidth);\n\n\t\t// Add margins and background to each line\n\t\tconst leftMargin = \" \".repeat(this.paddingX);\n\t\tconst rightMargin = \" \".repeat(this.paddingX);\n\t\tconst contentLines: string[] = [];\n\n\t\tfor (const line of wrappedLines) {\n\t\t\t// Add margins\n\t\t\tconst lineWithMargins = leftMargin + line + rightMargin;\n\n\t\t\t// Apply background if specified (this also pads to full width)\n\t\t\tif (this.customBgFn) {\n\t\t\t\tcontentLines.push(applyBackgroundToLine(lineWithMargins, width, this.customBgFn));\n\t\t\t} else {\n\t\t\t\t// No background - just pad to width with spaces\n\t\t\t\tconst visibleLen = visibleWidth(lineWithMargins);\n\t\t\t\tconst paddingNeeded = Math.max(0, width - visibleLen);\n\t\t\t\tcontentLines.push(lineWithMargins + \" \".repeat(paddingNeeded));\n\t\t\t}\n\t\t}\n\n\t\t// Add top/bottom padding (empty lines)\n\t\tconst emptyLine = \" \".repeat(width);\n\t\tconst emptyLines: string[] = [];\n\t\tfor (let i = 0; i < this.paddingY; i++) {\n\t\t\tconst line = this.customBgFn ? applyBackgroundToLine(emptyLine, width, this.customBgFn) : emptyLine;\n\t\t\temptyLines.push(line);\n\t\t}\n\n\t\tconst result = [...emptyLines, ...contentLines, ...emptyLines];\n\n\t\t// Update cache\n\t\tthis.cachedText = this.text;\n\t\tthis.cachedWidth = width;\n\t\tthis.cachedLines = result;\n\n\t\treturn result.length > 0 ? result : [\"\"];\n\t}\n}\n"]}
1
+ {"version":3,"file":"text.js","sourceRoot":"","sources":["../../src/components/text.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpF;;GAEG;AACH,MAAM,OAAO,IAAI;IACR,IAAI,CAAS;IACb,QAAQ,CAAS,CAAC,qBAAqB;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i } from \"../utils.ts\";\n\n/**\n * Text component - displays multi-line text with word wrapping\n */\nexport class Text implements Component {\n\tprivate text: string;\n\tprivate paddingX: number; // Left/right padding\n\tprivate paddingY: number; // Top/bottom padding\n\tprivate customBgFn?: (text: string) => string;\n\n\t// Cache for rendered output\n\tprivate cachedText?: string;\n\tprivate cachedWidth?: number;\n\tprivate cachedLines?: string[];\n\n\tconstructor(text: string = \"\", paddingX: number = 1, paddingY: number = 1, customBgFn?: (text: string) => string) {\n\t\tthis.text = text;\n\t\tthis.paddingX = paddingX;\n\t\tthis.paddingY = paddingY;\n\t\tthis.customBgFn = customBgFn;\n\t}\n\n\tsetText(text: string): void {\n\t\tthis.text = text;\n\t\tthis.cachedText = undefined;\n\t\tthis.cachedWidth = undefined;\n\t\tthis.cachedLines = undefined;\n\t}\n\n\tsetCustomBgFn(customBgFn?: (text: string) => string): void {\n\t\tthis.customBgFn = customBgFn;\n\t\tthis.cachedText = undefined;\n\t\tthis.cachedWidth = undefined;\n\t\tthis.cachedLines = undefined;\n\t}\n\n\tinvalidate(): void {\n\t\tthis.cachedText = undefined;\n\t\tthis.cachedWidth = undefined;\n\t\tthis.cachedLines = undefined;\n\t}\n\n\trender(width: number): string[] {\n\t\t// Check cache\n\t\tif (this.cachedLines && this.cachedText === this.text && this.cachedWidth === width) {\n\t\t\treturn this.cachedLines;\n\t\t}\n\n\t\t// Don't render anything if there's no actual text\n\t\tif (!this.text || this.text.trim() === \"\") {\n\t\t\tconst result: string[] = [];\n\t\t\tthis.cachedText = this.text;\n\t\t\tthis.cachedWidth = width;\n\t\t\tthis.cachedLines = result;\n\t\t\treturn result;\n\t\t}\n\n\t\t// Replace tabs with 3 spaces\n\t\tconst normalizedText = this.text.replace(/\\t/g, \" \");\n\n\t\t// Reduce margins when necessary so content and padding fit within the available width.\n\t\tconst paddingX = Math.min(this.paddingX, Math.max(0, Math.floor((width - 1) / 2)));\n\t\tconst contentWidth = Math.max(1, width - paddingX * 2);\n\n\t\t// Wrap text (this preserves ANSI codes but does NOT pad)\n\t\tconst wrappedLines = wrapTextWithAnsi(normalizedText, contentWidth);\n\n\t\t// Add margins and background to each line\n\t\tconst leftMargin = \" \".repeat(paddingX);\n\t\tconst rightMargin = \" \".repeat(paddingX);\n\t\tconst contentLines: string[] = [];\n\n\t\tfor (const line of wrappedLines) {\n\t\t\t// Add margins\n\t\t\tconst lineWithMargins = leftMargin + line + rightMargin;\n\n\t\t\t// Apply background if specified (this also pads to full width)\n\t\t\tif (this.customBgFn) {\n\t\t\t\tcontentLines.push(applyBackgroundToLine(lineWithMargins, width, this.customBgFn));\n\t\t\t} else {\n\t\t\t\t// No background - just pad to width with spaces\n\t\t\t\tconst visibleLen = visibleWidth(lineWithMargins);\n\t\t\t\tconst paddingNeeded = Math.max(0, width - visibleLen);\n\t\t\t\tcontentLines.push(lineWithMargins + \" \".repeat(paddingNeeded));\n\t\t\t}\n\t\t}\n\n\t\t// Add top/bottom padding (empty lines)\n\t\tconst emptyLine = \" \".repeat(width);\n\t\tconst emptyLines: string[] = [];\n\t\tfor (let i = 0; i < this.paddingY; i++) {\n\t\t\tconst line = this.customBgFn ? applyBackgroundToLine(emptyLine, width, this.customBgFn) : emptyLine;\n\t\t\temptyLines.push(line);\n\t\t}\n\n\t\tconst result = [...emptyLines, ...contentLines, ...emptyLines];\n\n\t\t// Update cache\n\t\tthis.cachedText = this.text;\n\t\tthis.cachedWidth = width;\n\t\tthis.cachedLines = result;\n\n\t\treturn result.length > 0 ? result : [\"\"];\n\t}\n}\n"]}
@@ -217,11 +217,11 @@ export declare const TUI_KEYBINDINGS: {
217
217
  readonly description: "Scroll viewport down one line";
218
218
  };
219
219
  readonly "tui.altScreen.previousPrompt": {
220
- readonly defaultKeys: "ctrl+shift+up";
220
+ readonly defaultKeys: ["ctrl+shift+up", "ctrl+up"];
221
221
  readonly description: "Jump to previous semantic prompt";
222
222
  };
223
223
  readonly "tui.altScreen.nextPrompt": {
224
- readonly defaultKeys: "ctrl+shift+down";
224
+ readonly defaultKeys: ["ctrl+shift+down", "ctrl+down"];
225
225
  readonly description: "Jump to next semantic prompt";
226
226
  };
227
227
  readonly "tui.altScreen.search": {
@@ -1 +1 @@
1
- {"version":3,"file":"keybindings.d.ts","sourceRoot":"","sources":["../src/keybindings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,KAAK,EAAc,MAAM,WAAW,CAAC;AAEnD;;;GAGG;AACH,MAAM,WAAW,WAAW;IAE3B,qBAAqB,EAAE,IAAI,CAAC;IAC5B,uBAAuB,EAAE,IAAI,CAAC;IAC9B,4BAA4B,EAAE,IAAI,CAAC;IACnC,wBAAwB,EAAE,IAAI,CAAC;IAC/B,uBAAuB,EAAE,IAAI,CAAC;IAC9B,wBAAwB,EAAE,IAAI,CAAC;IAC/B,2BAA2B,EAAE,IAAI,CAAC;IAClC,4BAA4B,EAAE,IAAI,CAAC;IACnC,4BAA4B,EAAE,IAAI,CAAC;IACnC,0BAA0B,EAAE,IAAI,CAAC;IACjC,wBAAwB,EAAE,IAAI,CAAC;IAC/B,yBAAyB,EAAE,IAAI,CAAC;IAChC,mBAAmB,EAAE,IAAI,CAAC;IAC1B,qBAAqB,EAAE,IAAI,CAAC;IAC5B,+BAA+B,EAAE,IAAI,CAAC;IACtC,8BAA8B,EAAE,IAAI,CAAC;IACrC,+BAA+B,EAAE,IAAI,CAAC;IACtC,8BAA8B,EAAE,IAAI,CAAC;IACrC,8BAA8B,EAAE,IAAI,CAAC;IACrC,4BAA4B,EAAE,IAAI,CAAC;IACnC,iBAAiB,EAAE,IAAI,CAAC;IACxB,oBAAoB,EAAE,IAAI,CAAC;IAC3B,iBAAiB,EAAE,IAAI,CAAC;IAExB,mBAAmB,EAAE,IAAI,CAAC;IAC1B,kBAAkB,EAAE,IAAI,CAAC;IACzB,eAAe,EAAE,IAAI,CAAC;IACtB,gBAAgB,EAAE,IAAI,CAAC;IAEvB,eAAe,EAAE,IAAI,CAAC;IACtB,iBAAiB,EAAE,IAAI,CAAC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AAW,kBAAkB;IAClC,GAAG,EAAE,KAAK,CAAC;IACX,WAAW,EAAE,MAAM,EAAE,CAAC;CACtB;AAgBD,qBAAa,kBAAkB;IAC9B,OAAO,CAAC,WAAW,CAAwB;IAC3C,OAAO,CAAC,YAAY,CAAoB;IACxC,OAAO,CAAC,QAAQ,CAAkC;IAClD,OAAO,CAAC,SAAS,CAA4B;IAE7C,YAAY,WAAW,EAAE,qBAAqB,EAAE,YAAY,GAAE,iBAAsB,EAInF;IAED,OAAO,CAAC,OAAO;IA2Bf,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,GAAG,OAAO,CAMrD;IAED,OAAO,CAAC,UAAU,EAAE,UAAU,GAAG,KAAK,EAAE,CAEvC;IAED,aAAa,CAAC,UAAU,EAAE,UAAU,GAAG,oBAAoB,CAE1D;IAED,YAAY,IAAI,kBAAkB,EAAE,CAEnC;IAED,eAAe,CAAC,YAAY,EAAE,iBAAiB,GAAG,IAAI,CAGrD;IAED,eAAe,IAAI,iBAAiB,CAEnC;IAED,mBAAmB,IAAI,iBAAiB,CAOvC;CACD;AAID,wBAAgB,cAAc,CAAC,WAAW,EAAE,kBAAkB,GAAG,IAAI,CAEpE;AAED,wBAAgB,cAAc,IAAI,kBAAkB,CAKnD","sourcesContent":["import { type KeyId, matchesKey } from \"./keys.ts\";\n\n/**\n * Global keybinding registry.\n * Downstream packages can add keybindings via declaration merging.\n */\nexport interface Keybindings {\n\t// Editor navigation and editing\n\t\"tui.editor.cursorUp\": true;\n\t\"tui.editor.cursorDown\": true;\n\t\"tui.editor.historyPrevious\": true;\n\t\"tui.editor.historyNext\": true;\n\t\"tui.editor.cursorLeft\": true;\n\t\"tui.editor.cursorRight\": true;\n\t\"tui.editor.cursorWordLeft\": true;\n\t\"tui.editor.cursorWordRight\": true;\n\t\"tui.editor.cursorLineStart\": true;\n\t\"tui.editor.cursorLineEnd\": true;\n\t\"tui.editor.jumpForward\": true;\n\t\"tui.editor.jumpBackward\": true;\n\t\"tui.editor.pageUp\": true;\n\t\"tui.editor.pageDown\": true;\n\t\"tui.editor.deleteCharBackward\": true;\n\t\"tui.editor.deleteCharForward\": true;\n\t\"tui.editor.deleteWordBackward\": true;\n\t\"tui.editor.deleteWordForward\": true;\n\t\"tui.editor.deleteToLineStart\": true;\n\t\"tui.editor.deleteToLineEnd\": true;\n\t\"tui.editor.yank\": true;\n\t\"tui.editor.yankPop\": true;\n\t\"tui.editor.undo\": true;\n\t// Generic input actions\n\t\"tui.input.newLine\": true;\n\t\"tui.input.submit\": true;\n\t\"tui.input.tab\": true;\n\t\"tui.input.copy\": true;\n\t// Generic selection actions\n\t\"tui.select.up\": true;\n\t\"tui.select.down\": true;\n\t\"tui.select.pageUp\": true;\n\t\"tui.select.pageDown\": true;\n\t\"tui.select.confirm\": true;\n\t\"tui.select.cancel\": true;\n\t// Alternate-screen viewport navigation\n\t\"tui.altScreen.pageUp\": true;\n\t\"tui.altScreen.pageDown\": true;\n\t\"tui.altScreen.halfPageUp\": true;\n\t\"tui.altScreen.halfPageDown\": true;\n\t\"tui.altScreen.lineUp\": true;\n\t\"tui.altScreen.lineDown\": true;\n\t\"tui.altScreen.previousPrompt\": true;\n\t\"tui.altScreen.nextPrompt\": true;\n\t\"tui.altScreen.search\": true;\n\t\"tui.altScreen.searchNext\": true;\n\t\"tui.altScreen.searchPrevious\": true;\n\t\"tui.altScreen.searchClose\": true;\n\t\"tui.altScreen.top\": true;\n\t\"tui.altScreen.bottom\": true;\n}\n\nexport type Keybinding = keyof Keybindings;\n\nexport interface KeybindingDefinition {\n\tdefaultKeys: KeyId | KeyId[];\n\tdescription?: string;\n}\n\nexport type KeybindingDefinitions = Record<string, KeybindingDefinition>;\nexport type KeybindingsConfig = Record<string, KeyId | KeyId[] | undefined>;\n\nexport const TUI_KEYBINDINGS = {\n\t\"tui.editor.cursorUp\": { defaultKeys: \"up\", description: \"Move cursor up\" },\n\t\"tui.editor.cursorDown\": { defaultKeys: \"down\", description: \"Move cursor down\" },\n\t\"tui.editor.historyPrevious\": {\n\t\tdefaultKeys: [],\n\t\tdescription: \"Select previous prompt history entry\",\n\t},\n\t\"tui.editor.historyNext\": {\n\t\tdefaultKeys: [],\n\t\tdescription: \"Select next prompt history entry\",\n\t},\n\t\"tui.editor.cursorLeft\": {\n\t\tdefaultKeys: [\"left\", \"ctrl+b\"],\n\t\tdescription: \"Move cursor left\",\n\t},\n\t\"tui.editor.cursorRight\": {\n\t\tdefaultKeys: [\"right\", \"ctrl+f\"],\n\t\tdescription: \"Move cursor right\",\n\t},\n\t\"tui.editor.cursorWordLeft\": {\n\t\tdefaultKeys: [\"alt+left\", \"ctrl+left\", \"alt+b\"],\n\t\tdescription: \"Move cursor word left\",\n\t},\n\t\"tui.editor.cursorWordRight\": {\n\t\tdefaultKeys: [\"alt+right\", \"ctrl+right\", \"alt+f\"],\n\t\tdescription: \"Move cursor word right\",\n\t},\n\t\"tui.editor.cursorLineStart\": {\n\t\tdefaultKeys: [\"home\", \"ctrl+home\", \"ctrl+a\"],\n\t\tdescription: \"Move to line start\",\n\t},\n\t\"tui.editor.cursorLineEnd\": {\n\t\tdefaultKeys: [\"end\", \"ctrl+end\", \"ctrl+e\"],\n\t\tdescription: \"Move to line end\",\n\t},\n\t\"tui.editor.jumpForward\": {\n\t\tdefaultKeys: \"ctrl+]\",\n\t\tdescription: \"Jump forward to character\",\n\t},\n\t\"tui.editor.jumpBackward\": {\n\t\tdefaultKeys: \"ctrl+alt+]\",\n\t\tdescription: \"Jump backward to character\",\n\t},\n\t\"tui.editor.pageUp\": { defaultKeys: [\"pageUp\", \"ctrl+pageUp\"], description: \"Page up\" },\n\t\"tui.editor.pageDown\": { defaultKeys: [\"pageDown\", \"ctrl+pageDown\"], description: \"Page down\" },\n\t\"tui.editor.deleteCharBackward\": {\n\t\tdefaultKeys: \"backspace\",\n\t\tdescription: \"Delete character backward\",\n\t},\n\t\"tui.editor.deleteCharForward\": {\n\t\tdefaultKeys: [\"delete\", \"ctrl+d\"],\n\t\tdescription: \"Delete character forward\",\n\t},\n\t\"tui.editor.deleteWordBackward\": {\n\t\tdefaultKeys: [\"ctrl+w\", \"alt+backspace\"],\n\t\tdescription: \"Delete word backward\",\n\t},\n\t\"tui.editor.deleteWordForward\": {\n\t\tdefaultKeys: [\"alt+d\", \"alt+delete\"],\n\t\tdescription: \"Delete word forward\",\n\t},\n\t\"tui.editor.deleteToLineStart\": {\n\t\tdefaultKeys: \"ctrl+u\",\n\t\tdescription: \"Delete to line start\",\n\t},\n\t\"tui.editor.deleteToLineEnd\": {\n\t\tdefaultKeys: \"ctrl+k\",\n\t\tdescription: \"Delete to line end\",\n\t},\n\t\"tui.editor.yank\": { defaultKeys: \"ctrl+y\", description: \"Yank\" },\n\t\"tui.editor.yankPop\": { defaultKeys: \"alt+y\", description: \"Yank pop\" },\n\t\"tui.editor.undo\": { defaultKeys: \"ctrl+-\", description: \"Undo\" },\n\t\"tui.input.newLine\": { defaultKeys: [\"shift+enter\", \"ctrl+j\"], description: \"Insert newline\" },\n\t\"tui.input.submit\": { defaultKeys: \"enter\", description: \"Submit input\" },\n\t\"tui.input.tab\": { defaultKeys: \"tab\", description: \"Tab / autocomplete\" },\n\t\"tui.input.copy\": { defaultKeys: \"ctrl+c\", description: \"Copy selection\" },\n\t\"tui.select.up\": { defaultKeys: \"up\", description: \"Move selection up\" },\n\t\"tui.select.down\": { defaultKeys: \"down\", description: \"Move selection down\" },\n\t\"tui.select.pageUp\": { defaultKeys: \"pageUp\", description: \"Selection page up\" },\n\t\"tui.select.pageDown\": {\n\t\tdefaultKeys: \"pageDown\",\n\t\tdescription: \"Selection page down\",\n\t},\n\t\"tui.select.confirm\": { defaultKeys: \"enter\", description: \"Confirm selection\" },\n\t\"tui.select.cancel\": {\n\t\tdefaultKeys: [\"escape\", \"ctrl+c\"],\n\t\tdescription: \"Cancel selection\",\n\t},\n\t// These intentionally shadow the unmodified editor bindings in fullscreen mode.\n\t\"tui.altScreen.pageUp\": {\n\t\tdefaultKeys: \"pageUp\",\n\t\tdescription: \"Scroll viewport up one page\",\n\t},\n\t\"tui.altScreen.pageDown\": {\n\t\tdefaultKeys: \"pageDown\",\n\t\tdescription: \"Scroll viewport down one page\",\n\t},\n\t\"tui.altScreen.halfPageUp\": {\n\t\tdefaultKeys: [],\n\t\tdescription: \"Scroll viewport up half a page\",\n\t},\n\t\"tui.altScreen.halfPageDown\": {\n\t\tdefaultKeys: [],\n\t\tdescription: \"Scroll viewport down half a page\",\n\t},\n\t\"tui.altScreen.lineUp\": {\n\t\tdefaultKeys: [],\n\t\tdescription: \"Scroll viewport up one line\",\n\t},\n\t\"tui.altScreen.lineDown\": {\n\t\tdefaultKeys: [],\n\t\tdescription: \"Scroll viewport down one line\",\n\t},\n\t\"tui.altScreen.previousPrompt\": {\n\t\tdefaultKeys: \"ctrl+shift+up\",\n\t\tdescription: \"Jump to previous semantic prompt\",\n\t},\n\t\"tui.altScreen.nextPrompt\": {\n\t\tdefaultKeys: \"ctrl+shift+down\",\n\t\tdescription: \"Jump to next semantic prompt\",\n\t},\n\t\"tui.altScreen.search\": {\n\t\tdefaultKeys: \"ctrl+shift+f\",\n\t\tdescription: \"Search the primary scroll view\",\n\t},\n\t\"tui.altScreen.searchNext\": {\n\t\tdefaultKeys: [\"enter\", \"ctrl+g\"],\n\t\tdescription: \"Select the next search match\",\n\t},\n\t\"tui.altScreen.searchPrevious\": {\n\t\tdefaultKeys: [\"shift+enter\", \"ctrl+shift+g\"],\n\t\tdescription: \"Select the previous search match\",\n\t},\n\t\"tui.altScreen.searchClose\": {\n\t\tdefaultKeys: \"escape\",\n\t\tdescription: \"Close transcript search\",\n\t},\n\t\"tui.altScreen.top\": { defaultKeys: \"home\", description: \"Scroll viewport to top\" },\n\t\"tui.altScreen.bottom\": { defaultKeys: \"end\", description: \"Scroll viewport to bottom\" },\n} as const satisfies KeybindingDefinitions;\n\nexport interface KeybindingConflict {\n\tkey: KeyId;\n\tkeybindings: string[];\n}\n\nfunction normalizeKeys(keys: KeyId | KeyId[] | undefined): KeyId[] {\n\tif (keys === undefined) return [];\n\tconst keyList = Array.isArray(keys) ? keys : [keys];\n\tconst seen = new Set<KeyId>();\n\tconst result: KeyId[] = [];\n\tfor (const key of keyList) {\n\t\tif (!seen.has(key)) {\n\t\t\tseen.add(key);\n\t\t\tresult.push(key);\n\t\t}\n\t}\n\treturn result;\n}\n\nexport class KeybindingsManager {\n\tprivate definitions: KeybindingDefinitions;\n\tprivate userBindings: KeybindingsConfig;\n\tprivate keysById = new Map<Keybinding, KeyId[]>();\n\tprivate conflicts: KeybindingConflict[] = [];\n\n\tconstructor(definitions: KeybindingDefinitions, userBindings: KeybindingsConfig = {}) {\n\t\tthis.definitions = definitions;\n\t\tthis.userBindings = userBindings;\n\t\tthis.rebuild();\n\t}\n\n\tprivate rebuild(): void {\n\t\tthis.keysById.clear();\n\t\tthis.conflicts = [];\n\n\t\tconst userClaims = new Map<KeyId, Set<Keybinding>>();\n\t\tfor (const [keybinding, keys] of Object.entries(this.userBindings)) {\n\t\t\tif (!(keybinding in this.definitions)) continue;\n\t\t\tfor (const key of normalizeKeys(keys)) {\n\t\t\t\tconst claimants = userClaims.get(key) ?? new Set<Keybinding>();\n\t\t\t\tclaimants.add(keybinding as Keybinding);\n\t\t\t\tuserClaims.set(key, claimants);\n\t\t\t}\n\t\t}\n\n\t\tfor (const [key, keybindings] of userClaims) {\n\t\t\tif (keybindings.size > 1) {\n\t\t\t\tthis.conflicts.push({ key, keybindings: [...keybindings] });\n\t\t\t}\n\t\t}\n\n\t\tfor (const [id, definition] of Object.entries(this.definitions)) {\n\t\t\tconst userKeys = this.userBindings[id];\n\t\t\tconst keys = userKeys === undefined ? normalizeKeys(definition.defaultKeys) : normalizeKeys(userKeys);\n\t\t\tthis.keysById.set(id as Keybinding, keys);\n\t\t}\n\t}\n\n\tmatches(data: string, keybinding: Keybinding): boolean {\n\t\tconst keys = this.keysById.get(keybinding) ?? [];\n\t\tfor (const key of keys) {\n\t\t\tif (matchesKey(data, key)) return true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tgetKeys(keybinding: Keybinding): KeyId[] {\n\t\treturn [...(this.keysById.get(keybinding) ?? [])];\n\t}\n\n\tgetDefinition(keybinding: Keybinding): KeybindingDefinition {\n\t\treturn this.definitions[keybinding];\n\t}\n\n\tgetConflicts(): KeybindingConflict[] {\n\t\treturn this.conflicts.map((conflict) => ({ ...conflict, keybindings: [...conflict.keybindings] }));\n\t}\n\n\tsetUserBindings(userBindings: KeybindingsConfig): void {\n\t\tthis.userBindings = userBindings;\n\t\tthis.rebuild();\n\t}\n\n\tgetUserBindings(): KeybindingsConfig {\n\t\treturn { ...this.userBindings };\n\t}\n\n\tgetResolvedBindings(): KeybindingsConfig {\n\t\tconst resolved: KeybindingsConfig = {};\n\t\tfor (const id of Object.keys(this.definitions)) {\n\t\t\tconst keys = this.keysById.get(id as Keybinding) ?? [];\n\t\t\tresolved[id] = keys.length === 1 ? keys[0]! : [...keys];\n\t\t}\n\t\treturn resolved;\n\t}\n}\n\nlet globalKeybindings: KeybindingsManager | null = null;\n\nexport function setKeybindings(keybindings: KeybindingsManager): void {\n\tglobalKeybindings = keybindings;\n}\n\nexport function getKeybindings(): KeybindingsManager {\n\tif (!globalKeybindings) {\n\t\tglobalKeybindings = new KeybindingsManager(TUI_KEYBINDINGS);\n\t}\n\treturn globalKeybindings;\n}\n"]}
1
+ {"version":3,"file":"keybindings.d.ts","sourceRoot":"","sources":["../src/keybindings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,KAAK,EAAc,MAAM,WAAW,CAAC;AAEnD;;;GAGG;AACH,MAAM,WAAW,WAAW;IAE3B,qBAAqB,EAAE,IAAI,CAAC;IAC5B,uBAAuB,EAAE,IAAI,CAAC;IAC9B,4BAA4B,EAAE,IAAI,CAAC;IACnC,wBAAwB,EAAE,IAAI,CAAC;IAC/B,uBAAuB,EAAE,IAAI,CAAC;IAC9B,wBAAwB,EAAE,IAAI,CAAC;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,UAAU,EAAE,UAAU,GAAG,oBAAoB,CAE1D;IAED,YAAY,IAAI,kBAAkB,EAAE,CAEnC;IAED,eAAe,CAAC,YAAY,EAAE,iBAAiB,GAAG,IAAI,CAGrD;IAED,eAAe,IAAI,iBAAiB,CAEnC;IAED,mBAAmB,IAAI,iBAAiB,CAOvC;CACD;AAID,wBAAgB,cAAc,CAAC,WAAW,EAAE,kBAAkB,GAAG,IAAI,CAEpE;AAED,wBAAgB,cAAc,IAAI,kBAAkB,CAKnD","sourcesContent":["import { type KeyId, matchesKey } from \"./keys.ts\";\n\n/**\n * Global keybinding registry.\n * Downstream packages can add keybindings via declaration merging.\n */\nexport interface Keybindings {\n\t// Editor navigation and editing\n\t\"tui.editor.cursorUp\": true;\n\t\"tui.editor.cursorDown\": true;\n\t\"tui.editor.historyPrevious\": true;\n\t\"tui.editor.historyNext\": true;\n\t\"tui.editor.cursorLeft\": true;\n\t\"tui.editor.cursorRight\": true;\n\t\"tui.editor.cursorWordLeft\": true;\n\t\"tui.editor.cursorWordRight\": true;\n\t\"tui.editor.cursorLineStart\": true;\n\t\"tui.editor.cursorLineEnd\": true;\n\t\"tui.editor.jumpForward\": true;\n\t\"tui.editor.jumpBackward\": true;\n\t\"tui.editor.pageUp\": true;\n\t\"tui.editor.pageDown\": true;\n\t\"tui.editor.deleteCharBackward\": true;\n\t\"tui.editor.deleteCharForward\": true;\n\t\"tui.editor.deleteWordBackward\": true;\n\t\"tui.editor.deleteWordForward\": true;\n\t\"tui.editor.deleteToLineStart\": true;\n\t\"tui.editor.deleteToLineEnd\": true;\n\t\"tui.editor.yank\": true;\n\t\"tui.editor.yankPop\": true;\n\t\"tui.editor.undo\": true;\n\t// Generic input actions\n\t\"tui.input.newLine\": true;\n\t\"tui.input.submit\": true;\n\t\"tui.input.tab\": true;\n\t\"tui.input.copy\": true;\n\t// Generic selection actions\n\t\"tui.select.up\": true;\n\t\"tui.select.down\": true;\n\t\"tui.select.pageUp\": true;\n\t\"tui.select.pageDown\": true;\n\t\"tui.select.confirm\": true;\n\t\"tui.select.cancel\": true;\n\t// Alternate-screen viewport navigation\n\t\"tui.altScreen.pageUp\": true;\n\t\"tui.altScreen.pageDown\": true;\n\t\"tui.altScreen.halfPageUp\": true;\n\t\"tui.altScreen.halfPageDown\": true;\n\t\"tui.altScreen.lineUp\": true;\n\t\"tui.altScreen.lineDown\": true;\n\t\"tui.altScreen.previousPrompt\": true;\n\t\"tui.altScreen.nextPrompt\": true;\n\t\"tui.altScreen.search\": true;\n\t\"tui.altScreen.searchNext\": true;\n\t\"tui.altScreen.searchPrevious\": true;\n\t\"tui.altScreen.searchClose\": true;\n\t\"tui.altScreen.top\": true;\n\t\"tui.altScreen.bottom\": true;\n}\n\nexport type Keybinding = keyof Keybindings;\n\nexport interface KeybindingDefinition {\n\tdefaultKeys: KeyId | KeyId[];\n\tdescription?: string;\n}\n\nexport type KeybindingDefinitions = Record<string, KeybindingDefinition>;\nexport type KeybindingsConfig = Record<string, KeyId | KeyId[] | undefined>;\n\nexport const TUI_KEYBINDINGS = {\n\t\"tui.editor.cursorUp\": { defaultKeys: \"up\", description: \"Move cursor up\" },\n\t\"tui.editor.cursorDown\": { defaultKeys: \"down\", description: \"Move cursor down\" },\n\t\"tui.editor.historyPrevious\": {\n\t\tdefaultKeys: [],\n\t\tdescription: \"Select previous prompt history entry\",\n\t},\n\t\"tui.editor.historyNext\": {\n\t\tdefaultKeys: [],\n\t\tdescription: \"Select next prompt history entry\",\n\t},\n\t\"tui.editor.cursorLeft\": {\n\t\tdefaultKeys: [\"left\", \"ctrl+b\"],\n\t\tdescription: \"Move cursor left\",\n\t},\n\t\"tui.editor.cursorRight\": {\n\t\tdefaultKeys: [\"right\", \"ctrl+f\"],\n\t\tdescription: \"Move cursor right\",\n\t},\n\t\"tui.editor.cursorWordLeft\": {\n\t\tdefaultKeys: [\"alt+left\", \"ctrl+left\", \"alt+b\"],\n\t\tdescription: \"Move cursor word left\",\n\t},\n\t\"tui.editor.cursorWordRight\": {\n\t\tdefaultKeys: [\"alt+right\", \"ctrl+right\", \"alt+f\"],\n\t\tdescription: \"Move cursor word right\",\n\t},\n\t\"tui.editor.cursorLineStart\": {\n\t\tdefaultKeys: [\"home\", \"ctrl+home\", \"ctrl+a\"],\n\t\tdescription: \"Move to line start\",\n\t},\n\t\"tui.editor.cursorLineEnd\": {\n\t\tdefaultKeys: [\"end\", \"ctrl+end\", \"ctrl+e\"],\n\t\tdescription: \"Move to line end\",\n\t},\n\t\"tui.editor.jumpForward\": {\n\t\tdefaultKeys: \"ctrl+]\",\n\t\tdescription: \"Jump forward to character\",\n\t},\n\t\"tui.editor.jumpBackward\": {\n\t\tdefaultKeys: \"ctrl+alt+]\",\n\t\tdescription: \"Jump backward to character\",\n\t},\n\t\"tui.editor.pageUp\": { defaultKeys: [\"pageUp\", \"ctrl+pageUp\"], description: \"Page up\" },\n\t\"tui.editor.pageDown\": { defaultKeys: [\"pageDown\", \"ctrl+pageDown\"], description: \"Page down\" },\n\t\"tui.editor.deleteCharBackward\": {\n\t\tdefaultKeys: \"backspace\",\n\t\tdescription: \"Delete character backward\",\n\t},\n\t\"tui.editor.deleteCharForward\": {\n\t\tdefaultKeys: [\"delete\", \"ctrl+d\"],\n\t\tdescription: \"Delete character forward\",\n\t},\n\t\"tui.editor.deleteWordBackward\": {\n\t\tdefaultKeys: [\"ctrl+w\", \"alt+backspace\"],\n\t\tdescription: \"Delete word backward\",\n\t},\n\t\"tui.editor.deleteWordForward\": {\n\t\tdefaultKeys: [\"alt+d\", \"alt+delete\"],\n\t\tdescription: \"Delete word forward\",\n\t},\n\t\"tui.editor.deleteToLineStart\": {\n\t\tdefaultKeys: \"ctrl+u\",\n\t\tdescription: \"Delete to line start\",\n\t},\n\t\"tui.editor.deleteToLineEnd\": {\n\t\tdefaultKeys: \"ctrl+k\",\n\t\tdescription: \"Delete to line end\",\n\t},\n\t\"tui.editor.yank\": { defaultKeys: \"ctrl+y\", description: \"Yank\" },\n\t\"tui.editor.yankPop\": { defaultKeys: \"alt+y\", description: \"Yank pop\" },\n\t\"tui.editor.undo\": { defaultKeys: \"ctrl+-\", description: \"Undo\" },\n\t\"tui.input.newLine\": { defaultKeys: [\"shift+enter\", \"ctrl+j\"], description: \"Insert newline\" },\n\t\"tui.input.submit\": { defaultKeys: \"enter\", description: \"Submit input\" },\n\t\"tui.input.tab\": { defaultKeys: \"tab\", description: \"Tab / autocomplete\" },\n\t\"tui.input.copy\": { defaultKeys: \"ctrl+c\", description: \"Copy selection\" },\n\t\"tui.select.up\": { defaultKeys: \"up\", description: \"Move selection up\" },\n\t\"tui.select.down\": { defaultKeys: \"down\", description: \"Move selection down\" },\n\t\"tui.select.pageUp\": { defaultKeys: \"pageUp\", description: \"Selection page up\" },\n\t\"tui.select.pageDown\": {\n\t\tdefaultKeys: \"pageDown\",\n\t\tdescription: \"Selection page down\",\n\t},\n\t\"tui.select.confirm\": { defaultKeys: \"enter\", description: \"Confirm selection\" },\n\t\"tui.select.cancel\": {\n\t\tdefaultKeys: [\"escape\", \"ctrl+c\"],\n\t\tdescription: \"Cancel selection\",\n\t},\n\t// These intentionally shadow the unmodified editor bindings in fullscreen mode.\n\t\"tui.altScreen.pageUp\": {\n\t\tdefaultKeys: \"pageUp\",\n\t\tdescription: \"Scroll viewport up one page\",\n\t},\n\t\"tui.altScreen.pageDown\": {\n\t\tdefaultKeys: \"pageDown\",\n\t\tdescription: \"Scroll viewport down one page\",\n\t},\n\t\"tui.altScreen.halfPageUp\": {\n\t\tdefaultKeys: [],\n\t\tdescription: \"Scroll viewport up half a page\",\n\t},\n\t\"tui.altScreen.halfPageDown\": {\n\t\tdefaultKeys: [],\n\t\tdescription: \"Scroll viewport down half a page\",\n\t},\n\t\"tui.altScreen.lineUp\": {\n\t\tdefaultKeys: [],\n\t\tdescription: \"Scroll viewport up one line\",\n\t},\n\t\"tui.altScreen.lineDown\": {\n\t\tdefaultKeys: [],\n\t\tdescription: \"Scroll viewport down one line\",\n\t},\n\t\"tui.altScreen.previousPrompt\": {\n\t\tdefaultKeys: [\"ctrl+shift+up\", \"ctrl+up\"],\n\t\tdescription: \"Jump to previous semantic prompt\",\n\t},\n\t\"tui.altScreen.nextPrompt\": {\n\t\tdefaultKeys: [\"ctrl+shift+down\", \"ctrl+down\"],\n\t\tdescription: \"Jump to next semantic prompt\",\n\t},\n\t\"tui.altScreen.search\": {\n\t\tdefaultKeys: \"ctrl+shift+f\",\n\t\tdescription: \"Search the primary scroll view\",\n\t},\n\t\"tui.altScreen.searchNext\": {\n\t\tdefaultKeys: [\"enter\", \"ctrl+g\"],\n\t\tdescription: \"Select the next search match\",\n\t},\n\t\"tui.altScreen.searchPrevious\": {\n\t\tdefaultKeys: [\"shift+enter\", \"ctrl+shift+g\"],\n\t\tdescription: \"Select the previous search match\",\n\t},\n\t\"tui.altScreen.searchClose\": {\n\t\tdefaultKeys: \"escape\",\n\t\tdescription: \"Close transcript search\",\n\t},\n\t\"tui.altScreen.top\": { defaultKeys: \"home\", description: \"Scroll viewport to top\" },\n\t\"tui.altScreen.bottom\": { defaultKeys: \"end\", description: \"Scroll viewport to bottom\" },\n} as const satisfies KeybindingDefinitions;\n\nexport interface KeybindingConflict {\n\tkey: KeyId;\n\tkeybindings: string[];\n}\n\nfunction normalizeKeys(keys: KeyId | KeyId[] | undefined): KeyId[] {\n\tif (keys === undefined) return [];\n\tconst keyList = Array.isArray(keys) ? keys : [keys];\n\tconst seen = new Set<KeyId>();\n\tconst result: KeyId[] = [];\n\tfor (const key of keyList) {\n\t\tif (!seen.has(key)) {\n\t\t\tseen.add(key);\n\t\t\tresult.push(key);\n\t\t}\n\t}\n\treturn result;\n}\n\nexport class KeybindingsManager {\n\tprivate definitions: KeybindingDefinitions;\n\tprivate userBindings: KeybindingsConfig;\n\tprivate keysById = new Map<Keybinding, KeyId[]>();\n\tprivate conflicts: KeybindingConflict[] = [];\n\n\tconstructor(definitions: KeybindingDefinitions, userBindings: KeybindingsConfig = {}) {\n\t\tthis.definitions = definitions;\n\t\tthis.userBindings = userBindings;\n\t\tthis.rebuild();\n\t}\n\n\tprivate rebuild(): void {\n\t\tthis.keysById.clear();\n\t\tthis.conflicts = [];\n\n\t\tconst userClaims = new Map<KeyId, Set<Keybinding>>();\n\t\tfor (const [keybinding, keys] of Object.entries(this.userBindings)) {\n\t\t\tif (!(keybinding in this.definitions)) continue;\n\t\t\tfor (const key of normalizeKeys(keys)) {\n\t\t\t\tconst claimants = userClaims.get(key) ?? new Set<Keybinding>();\n\t\t\t\tclaimants.add(keybinding as Keybinding);\n\t\t\t\tuserClaims.set(key, claimants);\n\t\t\t}\n\t\t}\n\n\t\tfor (const [key, keybindings] of userClaims) {\n\t\t\tif (keybindings.size > 1) {\n\t\t\t\tthis.conflicts.push({ key, keybindings: [...keybindings] });\n\t\t\t}\n\t\t}\n\n\t\tfor (const [id, definition] of Object.entries(this.definitions)) {\n\t\t\tconst userKeys = this.userBindings[id];\n\t\t\tconst keys = userKeys === undefined ? normalizeKeys(definition.defaultKeys) : normalizeKeys(userKeys);\n\t\t\tthis.keysById.set(id as Keybinding, keys);\n\t\t}\n\t}\n\n\tmatches(data: string, keybinding: Keybinding): boolean {\n\t\tconst keys = this.keysById.get(keybinding) ?? [];\n\t\tfor (const key of keys) {\n\t\t\tif (matchesKey(data, key)) return true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tgetKeys(keybinding: Keybinding): KeyId[] {\n\t\treturn [...(this.keysById.get(keybinding) ?? [])];\n\t}\n\n\tgetDefinition(keybinding: Keybinding): KeybindingDefinition {\n\t\treturn this.definitions[keybinding];\n\t}\n\n\tgetConflicts(): KeybindingConflict[] {\n\t\treturn this.conflicts.map((conflict) => ({ ...conflict, keybindings: [...conflict.keybindings] }));\n\t}\n\n\tsetUserBindings(userBindings: KeybindingsConfig): void {\n\t\tthis.userBindings = userBindings;\n\t\tthis.rebuild();\n\t}\n\n\tgetUserBindings(): KeybindingsConfig {\n\t\treturn { ...this.userBindings };\n\t}\n\n\tgetResolvedBindings(): KeybindingsConfig {\n\t\tconst resolved: KeybindingsConfig = {};\n\t\tfor (const id of Object.keys(this.definitions)) {\n\t\t\tconst keys = this.keysById.get(id as Keybinding) ?? [];\n\t\t\tresolved[id] = keys.length === 1 ? keys[0]! : [...keys];\n\t\t}\n\t\treturn resolved;\n\t}\n}\n\nlet globalKeybindings: KeybindingsManager | null = null;\n\nexport function setKeybindings(keybindings: KeybindingsManager): void {\n\tglobalKeybindings = keybindings;\n}\n\nexport function getKeybindings(): KeybindingsManager {\n\tif (!globalKeybindings) {\n\t\tglobalKeybindings = new KeybindingsManager(TUI_KEYBINDINGS);\n\t}\n\treturn globalKeybindings;\n}\n"]}
@@ -113,11 +113,11 @@ export const TUI_KEYBINDINGS = {
113
113
  description: "Scroll viewport down one line",
114
114
  },
115
115
  "tui.altScreen.previousPrompt": {
116
- defaultKeys: "ctrl+shift+up",
116
+ defaultKeys: ["ctrl+shift+up", "ctrl+up"],
117
117
  description: "Jump to previous semantic prompt",
118
118
  },
119
119
  "tui.altScreen.nextPrompt": {
120
- defaultKeys: "ctrl+shift+down",
120
+ defaultKeys: ["ctrl+shift+down", "ctrl+down"],
121
121
  description: "Jump to next semantic prompt",
122
122
  },
123
123
  "tui.altScreen.search": {
@@ -1 +1 @@
1
- {"version":3,"file":"keybindings.js","sourceRoot":"","sources":["../src/keybindings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,UAAU,EAAE,MAAM,WAAW,CAAC;AAsEnD,MAAM,CAAC,MAAM,eAAe,GAAG;IAC9B,qBAAqB,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,WAAW,EAAE,gBAAgB,EAAE;IAC3E,uBAAuB,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW,EAAE,kBAAkB,EAAE;IACjF,4BAA4B,EAAE;QAC7B,WAAW,EAAE,EAAE;QACf,WAAW,EAAE,sCAAsC;KACnD;IACD,wBAAwB,EAAE;QACzB,WAAW,EAAE,EAAE;QACf,WAAW,EAAE,kCAAk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ACD,OAAO,QAAQ,CAAC;IAAA,CAChB;CACD;AAED,IAAI,iBAAiB,GAA8B,IAAI,CAAC;AAExD,MAAM,UAAU,cAAc,CAAC,WAA+B,EAAQ;IACrE,iBAAiB,GAAG,WAAW,CAAC;AAAA,CAChC;AAED,MAAM,UAAU,cAAc,GAAuB;IACpD,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACxB,iBAAiB,GAAG,IAAI,kBAAkB,CAAC,eAAe,CAAC,CAAC;IAC7D,CAAC;IACD,OAAO,iBAAiB,CAAC;AAAA,CACzB","sourcesContent":["import { type KeyId, matchesKey } from \"./keys.ts\";\n\n/**\n * Global keybinding registry.\n * Downstream packages can add keybindings via declaration merging.\n */\nexport interface Keybindings {\n\t// Editor navigation and editing\n\t\"tui.editor.cursorUp\": true;\n\t\"tui.editor.cursorDown\": true;\n\t\"tui.editor.historyPrevious\": true;\n\t\"tui.editor.historyNext\": true;\n\t\"tui.editor.cursorLeft\": true;\n\t\"tui.editor.cursorRight\": true;\n\t\"tui.editor.cursorWordLeft\": true;\n\t\"tui.editor.cursorWordRight\": true;\n\t\"tui.editor.cursorLineStart\": true;\n\t\"tui.editor.cursorLineEnd\": true;\n\t\"tui.editor.jumpForward\": true;\n\t\"tui.editor.jumpBackward\": true;\n\t\"tui.editor.pageUp\": true;\n\t\"tui.editor.pageDown\": true;\n\t\"tui.editor.deleteCharBackward\": true;\n\t\"tui.editor.deleteCharForward\": true;\n\t\"tui.editor.deleteWordBackward\": true;\n\t\"tui.editor.deleteWordForward\": true;\n\t\"tui.editor.deleteToLineStart\": true;\n\t\"tui.editor.deleteToLineEnd\": true;\n\t\"tui.editor.yank\": true;\n\t\"tui.editor.yankPop\": true;\n\t\"tui.editor.undo\": true;\n\t// Generic input actions\n\t\"tui.input.newLine\": true;\n\t\"tui.input.submit\": true;\n\t\"tui.input.tab\": true;\n\t\"tui.input.copy\": true;\n\t// Generic selection actions\n\t\"tui.select.up\": true;\n\t\"tui.select.down\": true;\n\t\"tui.select.pageUp\": true;\n\t\"tui.select.pageDown\": true;\n\t\"tui.select.confirm\": true;\n\t\"tui.select.cancel\": true;\n\t// Alternate-screen viewport navigation\n\t\"tui.altScreen.pageUp\": true;\n\t\"tui.altScreen.pageDown\": true;\n\t\"tui.altScreen.halfPageUp\": true;\n\t\"tui.altScreen.halfPageDown\": true;\n\t\"tui.altScreen.lineUp\": true;\n\t\"tui.altScreen.lineDown\": true;\n\t\"tui.altScreen.previousPrompt\": true;\n\t\"tui.altScreen.nextPrompt\": true;\n\t\"tui.altScreen.search\": true;\n\t\"tui.altScreen.searchNext\": true;\n\t\"tui.altScreen.searchPrevious\": true;\n\t\"tui.altScreen.searchClose\": true;\n\t\"tui.altScreen.top\": true;\n\t\"tui.altScreen.bottom\": true;\n}\n\nexport type Keybinding = keyof Keybindings;\n\nexport interface KeybindingDefinition {\n\tdefaultKeys: KeyId | KeyId[];\n\tdescription?: string;\n}\n\nexport type KeybindingDefinitions = Record<string, KeybindingDefinition>;\nexport type KeybindingsConfig = Record<string, KeyId | KeyId[] | undefined>;\n\nexport const TUI_KEYBINDINGS = {\n\t\"tui.editor.cursorUp\": { defaultKeys: \"up\", description: \"Move cursor up\" },\n\t\"tui.editor.cursorDown\": { defaultKeys: \"down\", description: \"Move cursor down\" },\n\t\"tui.editor.historyPrevious\": {\n\t\tdefaultKeys: [],\n\t\tdescription: \"Select previous prompt history entry\",\n\t},\n\t\"tui.editor.historyNext\": {\n\t\tdefaultKeys: [],\n\t\tdescription: \"Select next prompt history entry\",\n\t},\n\t\"tui.editor.cursorLeft\": {\n\t\tdefaultKeys: [\"left\", \"ctrl+b\"],\n\t\tdescription: \"Move cursor left\",\n\t},\n\t\"tui.editor.cursorRight\": {\n\t\tdefaultKeys: [\"right\", \"ctrl+f\"],\n\t\tdescription: \"Move cursor right\",\n\t},\n\t\"tui.editor.cursorWordLeft\": {\n\t\tdefaultKeys: [\"alt+left\", \"ctrl+left\", \"alt+b\"],\n\t\tdescription: \"Move cursor word left\",\n\t},\n\t\"tui.editor.cursorWordRight\": {\n\t\tdefaultKeys: [\"alt+right\", \"ctrl+right\", \"alt+f\"],\n\t\tdescription: \"Move cursor word right\",\n\t},\n\t\"tui.editor.cursorLineStart\": {\n\t\tdefaultKeys: [\"home\", \"ctrl+home\", \"ctrl+a\"],\n\t\tdescription: \"Move to line start\",\n\t},\n\t\"tui.editor.cursorLineEnd\": {\n\t\tdefaultKeys: [\"end\", \"ctrl+end\", \"ctrl+e\"],\n\t\tdescription: \"Move to line end\",\n\t},\n\t\"tui.editor.jumpForward\": {\n\t\tdefaultKeys: \"ctrl+]\",\n\t\tdescription: \"Jump forward to character\",\n\t},\n\t\"tui.editor.jumpBackward\": {\n\t\tdefaultKeys: \"ctrl+alt+]\",\n\t\tdescription: \"Jump backward to character\",\n\t},\n\t\"tui.editor.pageUp\": { defaultKeys: [\"pageUp\", \"ctrl+pageUp\"], description: \"Page up\" },\n\t\"tui.editor.pageDown\": { defaultKeys: [\"pageDown\", \"ctrl+pageDown\"], description: \"Page down\" },\n\t\"tui.editor.deleteCharBackward\": {\n\t\tdefaultKeys: \"backspace\",\n\t\tdescription: \"Delete character backward\",\n\t},\n\t\"tui.editor.deleteCharForward\": {\n\t\tdefaultKeys: [\"delete\", \"ctrl+d\"],\n\t\tdescription: \"Delete character forward\",\n\t},\n\t\"tui.editor.deleteWordBackward\": {\n\t\tdefaultKeys: [\"ctrl+w\", \"alt+backspace\"],\n\t\tdescription: \"Delete word backward\",\n\t},\n\t\"tui.editor.deleteWordForward\": {\n\t\tdefaultKeys: [\"alt+d\", \"alt+delete\"],\n\t\tdescription: \"Delete word forward\",\n\t},\n\t\"tui.editor.deleteToLineStart\": {\n\t\tdefaultKeys: \"ctrl+u\",\n\t\tdescription: \"Delete to line start\",\n\t},\n\t\"tui.editor.deleteToLineEnd\": {\n\t\tdefaultKeys: \"ctrl+k\",\n\t\tdescription: \"Delete to line end\",\n\t},\n\t\"tui.editor.yank\": { defaultKeys: \"ctrl+y\", description: \"Yank\" },\n\t\"tui.editor.yankPop\": { defaultKeys: \"alt+y\", description: \"Yank pop\" },\n\t\"tui.editor.undo\": { defaultKeys: \"ctrl+-\", description: \"Undo\" },\n\t\"tui.input.newLine\": { defaultKeys: [\"shift+enter\", \"ctrl+j\"], description: \"Insert newline\" },\n\t\"tui.input.submit\": { defaultKeys: \"enter\", description: \"Submit input\" },\n\t\"tui.input.tab\": { defaultKeys: \"tab\", description: \"Tab / autocomplete\" },\n\t\"tui.input.copy\": { defaultKeys: \"ctrl+c\", description: \"Copy selection\" },\n\t\"tui.select.up\": { defaultKeys: \"up\", description: \"Move selection up\" },\n\t\"tui.select.down\": { defaultKeys: \"down\", description: \"Move selection down\" },\n\t\"tui.select.pageUp\": { defaultKeys: \"pageUp\", description: \"Selection page up\" },\n\t\"tui.select.pageDown\": {\n\t\tdefaultKeys: \"pageDown\",\n\t\tdescription: \"Selection page down\",\n\t},\n\t\"tui.select.confirm\": { defaultKeys: \"enter\", description: \"Confirm selection\" },\n\t\"tui.select.cancel\": {\n\t\tdefaultKeys: [\"escape\", \"ctrl+c\"],\n\t\tdescription: \"Cancel selection\",\n\t},\n\t// These intentionally shadow the unmodified editor bindings in fullscreen mode.\n\t\"tui.altScreen.pageUp\": {\n\t\tdefaultKeys: \"pageUp\",\n\t\tdescription: \"Scroll viewport up one page\",\n\t},\n\t\"tui.altScreen.pageDown\": {\n\t\tdefaultKeys: \"pageDown\",\n\t\tdescription: \"Scroll viewport down one page\",\n\t},\n\t\"tui.altScreen.halfPageUp\": {\n\t\tdefaultKeys: [],\n\t\tdescription: \"Scroll viewport up half a page\",\n\t},\n\t\"tui.altScreen.halfPageDown\": {\n\t\tdefaultKeys: [],\n\t\tdescription: \"Scroll viewport down half a page\",\n\t},\n\t\"tui.altScreen.lineUp\": {\n\t\tdefaultKeys: [],\n\t\tdescription: \"Scroll viewport up one line\",\n\t},\n\t\"tui.altScreen.lineDown\": {\n\t\tdefaultKeys: [],\n\t\tdescription: \"Scroll viewport down one line\",\n\t},\n\t\"tui.altScreen.previousPrompt\": {\n\t\tdefaultKeys: \"ctrl+shift+up\",\n\t\tdescription: \"Jump to previous semantic prompt\",\n\t},\n\t\"tui.altScreen.nextPrompt\": {\n\t\tdefaultKeys: \"ctrl+shift+down\",\n\t\tdescription: \"Jump to next semantic prompt\",\n\t},\n\t\"tui.altScreen.search\": {\n\t\tdefaultKeys: \"ctrl+shift+f\",\n\t\tdescription: \"Search the primary scroll view\",\n\t},\n\t\"tui.altScreen.searchNext\": {\n\t\tdefaultKeys: [\"enter\", \"ctrl+g\"],\n\t\tdescription: \"Select the next search match\",\n\t},\n\t\"tui.altScreen.searchPrevious\": {\n\t\tdefaultKeys: [\"shift+enter\", \"ctrl+shift+g\"],\n\t\tdescription: \"Select the previous search match\",\n\t},\n\t\"tui.altScreen.searchClose\": {\n\t\tdefaultKeys: \"escape\",\n\t\tdescription: \"Close transcript search\",\n\t},\n\t\"tui.altScreen.top\": { defaultKeys: \"home\", description: \"Scroll viewport to top\" },\n\t\"tui.altScreen.bottom\": { defaultKeys: \"end\", description: \"Scroll viewport to bottom\" },\n} as const satisfies KeybindingDefinitions;\n\nexport interface KeybindingConflict {\n\tkey: KeyId;\n\tkeybindings: string[];\n}\n\nfunction normalizeKeys(keys: KeyId | KeyId[] | undefined): KeyId[] {\n\tif (keys === undefined) return [];\n\tconst keyList = Array.isArray(keys) ? keys : [keys];\n\tconst seen = new Set<KeyId>();\n\tconst result: KeyId[] = [];\n\tfor (const key of keyList) {\n\t\tif (!seen.has(key)) {\n\t\t\tseen.add(key);\n\t\t\tresult.push(key);\n\t\t}\n\t}\n\treturn result;\n}\n\nexport class KeybindingsManager {\n\tprivate definitions: KeybindingDefinitions;\n\tprivate userBindings: KeybindingsConfig;\n\tprivate keysById = new Map<Keybinding, KeyId[]>();\n\tprivate conflicts: KeybindingConflict[] = [];\n\n\tconstructor(definitions: KeybindingDefinitions, userBindings: KeybindingsConfig = {}) {\n\t\tthis.definitions = definitions;\n\t\tthis.userBindings = userBindings;\n\t\tthis.rebuild();\n\t}\n\n\tprivate rebuild(): void {\n\t\tthis.keysById.clear();\n\t\tthis.conflicts = [];\n\n\t\tconst userClaims = new Map<KeyId, Set<Keybinding>>();\n\t\tfor (const [keybinding, keys] of Object.entries(this.userBindings)) {\n\t\t\tif (!(keybinding in this.definitions)) continue;\n\t\t\tfor (const key of normalizeKeys(keys)) {\n\t\t\t\tconst claimants = userClaims.get(key) ?? new Set<Keybinding>();\n\t\t\t\tclaimants.add(keybinding as Keybinding);\n\t\t\t\tuserClaims.set(key, claimants);\n\t\t\t}\n\t\t}\n\n\t\tfor (const [key, keybindings] of userClaims) {\n\t\t\tif (keybindings.size > 1) {\n\t\t\t\tthis.conflicts.push({ key, keybindings: [...keybindings] });\n\t\t\t}\n\t\t}\n\n\t\tfor (const [id, definition] of Object.entries(this.definitions)) {\n\t\t\tconst userKeys = this.userBindings[id];\n\t\t\tconst keys = userKeys === undefined ? normalizeKeys(definition.defaultKeys) : normalizeKeys(userKeys);\n\t\t\tthis.keysById.set(id as Keybinding, keys);\n\t\t}\n\t}\n\n\tmatches(data: string, keybinding: Keybinding): boolean {\n\t\tconst keys = this.keysById.get(keybinding) ?? [];\n\t\tfor (const key of keys) {\n\t\t\tif (matchesKey(data, key)) return true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tgetKeys(keybinding: Keybinding): KeyId[] {\n\t\treturn [...(this.keysById.get(keybinding) ?? [])];\n\t}\n\n\tgetDefinition(keybinding: Keybinding): KeybindingDefinition {\n\t\treturn this.definitions[keybinding];\n\t}\n\n\tgetConflicts(): KeybindingConflict[] {\n\t\treturn this.conflicts.map((conflict) => ({ ...conflict, keybindings: [...conflict.keybindings] }));\n\t}\n\n\tsetUserBindings(userBindings: KeybindingsConfig): void {\n\t\tthis.userBindings = userBindings;\n\t\tthis.rebuild();\n\t}\n\n\tgetUserBindings(): KeybindingsConfig {\n\t\treturn { ...this.userBindings };\n\t}\n\n\tgetResolvedBindings(): KeybindingsConfig {\n\t\tconst resolved: KeybindingsConfig = {};\n\t\tfor (const id of Object.keys(this.definitions)) {\n\t\t\tconst keys = this.keysById.get(id as Keybinding) ?? [];\n\t\t\tresolved[id] = keys.length === 1 ? keys[0]! : [...keys];\n\t\t}\n\t\treturn resolved;\n\t}\n}\n\nlet globalKeybindings: KeybindingsManager | null = null;\n\nexport function setKeybindings(keybindings: KeybindingsManager): void {\n\tglobalKeybindings = keybindings;\n}\n\nexport function getKeybindings(): KeybindingsManager {\n\tif (!globalKeybindings) {\n\t\tglobalKeybindings = new KeybindingsManager(TUI_KEYBINDINGS);\n\t}\n\treturn globalKeybindings;\n}\n"]}
1
+ {"version":3,"file":"keybindings.js","sourceRoot":"","sources":["../src/keybindings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,UAAU,EAAE,MAAM,WAAW,CAAC;AAsEnD,MAAM,CAAC,MAAM,eAAe,GAAG;IAC9B,qBAAqB,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,WAAW,EAAE,gBAAgB,EAAE;IAC3E,uBAAuB,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW,EAAE,kBAAkB,EAAE;IACjF,4BAA4B,EAAE;QAC7B,WAAW,EAAE,EAAE;QACf,WAAW,EAAE,sCAAsC;KACnD;IACD,wBAAwB,EAAE;QACzB,WAAW,EAAE,EAAE;QACf,WAAW,EAAE,kCAAkC;KAC/C;IACD,uBAAuB,EAAE;QACxB,WAAW,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC;QAC/B,WAAW,EAAE,kBAAkB;KAC/B;IACD,wBAAwB,EAAE;QACzB,WAAW,EAAE,CAAC,OAAO,EAAE,QAAQ,CAAC;QAChC,WAAW,EAAE,mBAAmB;KAChC;IACD,2BAA2B,EAAE;QAC5B,WAAW,EAAE,CAAC,UAAU,EAAE,WAAW,EAAE,OAAO,CAAC;QAC/C,WAAW,EAAE,uBAAuB;KACpC;IACD,4BAA4B,EAAE;QAC7B,WAAW,E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AO,iBAAiB,CAAC;AAAA,CACzB","sourcesContent":["import { type KeyId, matchesKey } from \"./keys.ts\";\n\n/**\n * Global keybinding registry.\n * Downstream packages can add keybindings via declaration merging.\n */\nexport interface Keybindings {\n\t// Editor navigation and editing\n\t\"tui.editor.cursorUp\": true;\n\t\"tui.editor.cursorDown\": true;\n\t\"tui.editor.historyPrevious\": true;\n\t\"tui.editor.historyNext\": true;\n\t\"tui.editor.cursorLeft\": true;\n\t\"tui.editor.cursorRight\": true;\n\t\"tui.editor.cursorWordLeft\": true;\n\t\"tui.editor.cursorWordRight\": true;\n\t\"tui.editor.cursorLineStart\": true;\n\t\"tui.editor.cursorLineEnd\": true;\n\t\"tui.editor.jumpForward\": true;\n\t\"tui.editor.jumpBackward\": true;\n\t\"tui.editor.pageUp\": true;\n\t\"tui.editor.pageDown\": true;\n\t\"tui.editor.deleteCharBackward\": true;\n\t\"tui.editor.deleteCharForward\": true;\n\t\"tui.editor.deleteWordBackward\": true;\n\t\"tui.editor.deleteWordForward\": true;\n\t\"tui.editor.deleteToLineStart\": true;\n\t\"tui.editor.deleteToLineEnd\": true;\n\t\"tui.editor.yank\": true;\n\t\"tui.editor.yankPop\": true;\n\t\"tui.editor.undo\": true;\n\t// Generic input actions\n\t\"tui.input.newLine\": true;\n\t\"tui.input.submit\": true;\n\t\"tui.input.tab\": true;\n\t\"tui.input.copy\": true;\n\t// Generic selection actions\n\t\"tui.select.up\": true;\n\t\"tui.select.down\": true;\n\t\"tui.select.pageUp\": true;\n\t\"tui.select.pageDown\": true;\n\t\"tui.select.confirm\": true;\n\t\"tui.select.cancel\": true;\n\t// Alternate-screen viewport navigation\n\t\"tui.altScreen.pageUp\": true;\n\t\"tui.altScreen.pageDown\": true;\n\t\"tui.altScreen.halfPageUp\": true;\n\t\"tui.altScreen.halfPageDown\": true;\n\t\"tui.altScreen.lineUp\": true;\n\t\"tui.altScreen.lineDown\": true;\n\t\"tui.altScreen.previousPrompt\": true;\n\t\"tui.altScreen.nextPrompt\": true;\n\t\"tui.altScreen.search\": true;\n\t\"tui.altScreen.searchNext\": true;\n\t\"tui.altScreen.searchPrevious\": true;\n\t\"tui.altScreen.searchClose\": true;\n\t\"tui.altScreen.top\": true;\n\t\"tui.altScreen.bottom\": true;\n}\n\nexport type Keybinding = keyof Keybindings;\n\nexport interface KeybindingDefinition {\n\tdefaultKeys: KeyId | KeyId[];\n\tdescription?: string;\n}\n\nexport type KeybindingDefinitions = Record<string, KeybindingDefinition>;\nexport type KeybindingsConfig = Record<string, KeyId | KeyId[] | undefined>;\n\nexport const TUI_KEYBINDINGS = {\n\t\"tui.editor.cursorUp\": { defaultKeys: \"up\", description: \"Move cursor up\" },\n\t\"tui.editor.cursorDown\": { defaultKeys: \"down\", description: \"Move cursor down\" },\n\t\"tui.editor.historyPrevious\": {\n\t\tdefaultKeys: [],\n\t\tdescription: \"Select previous prompt history entry\",\n\t},\n\t\"tui.editor.historyNext\": {\n\t\tdefaultKeys: [],\n\t\tdescription: \"Select next prompt history entry\",\n\t},\n\t\"tui.editor.cursorLeft\": {\n\t\tdefaultKeys: [\"left\", \"ctrl+b\"],\n\t\tdescription: \"Move cursor left\",\n\t},\n\t\"tui.editor.cursorRight\": {\n\t\tdefaultKeys: [\"right\", \"ctrl+f\"],\n\t\tdescription: \"Move cursor right\",\n\t},\n\t\"tui.editor.cursorWordLeft\": {\n\t\tdefaultKeys: [\"alt+left\", \"ctrl+left\", \"alt+b\"],\n\t\tdescription: \"Move cursor word left\",\n\t},\n\t\"tui.editor.cursorWordRight\": {\n\t\tdefaultKeys: [\"alt+right\", \"ctrl+right\", \"alt+f\"],\n\t\tdescription: \"Move cursor word right\",\n\t},\n\t\"tui.editor.cursorLineStart\": {\n\t\tdefaultKeys: [\"home\", \"ctrl+home\", \"ctrl+a\"],\n\t\tdescription: \"Move to line start\",\n\t},\n\t\"tui.editor.cursorLineEnd\": {\n\t\tdefaultKeys: [\"end\", \"ctrl+end\", \"ctrl+e\"],\n\t\tdescription: \"Move to line end\",\n\t},\n\t\"tui.editor.jumpForward\": {\n\t\tdefaultKeys: \"ctrl+]\",\n\t\tdescription: \"Jump forward to character\",\n\t},\n\t\"tui.editor.jumpBackward\": {\n\t\tdefaultKeys: \"ctrl+alt+]\",\n\t\tdescription: \"Jump backward to character\",\n\t},\n\t\"tui.editor.pageUp\": { defaultKeys: [\"pageUp\", \"ctrl+pageUp\"], description: \"Page up\" },\n\t\"tui.editor.pageDown\": { defaultKeys: [\"pageDown\", \"ctrl+pageDown\"], description: \"Page down\" },\n\t\"tui.editor.deleteCharBackward\": {\n\t\tdefaultKeys: \"backspace\",\n\t\tdescription: \"Delete character backward\",\n\t},\n\t\"tui.editor.deleteCharForward\": {\n\t\tdefaultKeys: [\"delete\", \"ctrl+d\"],\n\t\tdescription: \"Delete character forward\",\n\t},\n\t\"tui.editor.deleteWordBackward\": {\n\t\tdefaultKeys: [\"ctrl+w\", \"alt+backspace\"],\n\t\tdescription: \"Delete word backward\",\n\t},\n\t\"tui.editor.deleteWordForward\": {\n\t\tdefaultKeys: [\"alt+d\", \"alt+delete\"],\n\t\tdescription: \"Delete word forward\",\n\t},\n\t\"tui.editor.deleteToLineStart\": {\n\t\tdefaultKeys: \"ctrl+u\",\n\t\tdescription: \"Delete to line start\",\n\t},\n\t\"tui.editor.deleteToLineEnd\": {\n\t\tdefaultKeys: \"ctrl+k\",\n\t\tdescription: \"Delete to line end\",\n\t},\n\t\"tui.editor.yank\": { defaultKeys: \"ctrl+y\", description: \"Yank\" },\n\t\"tui.editor.yankPop\": { defaultKeys: \"alt+y\", description: \"Yank pop\" },\n\t\"tui.editor.undo\": { defaultKeys: \"ctrl+-\", description: \"Undo\" },\n\t\"tui.input.newLine\": { defaultKeys: [\"shift+enter\", \"ctrl+j\"], description: \"Insert newline\" },\n\t\"tui.input.submit\": { defaultKeys: \"enter\", description: \"Submit input\" },\n\t\"tui.input.tab\": { defaultKeys: \"tab\", description: \"Tab / autocomplete\" },\n\t\"tui.input.copy\": { defaultKeys: \"ctrl+c\", description: \"Copy selection\" },\n\t\"tui.select.up\": { defaultKeys: \"up\", description: \"Move selection up\" },\n\t\"tui.select.down\": { defaultKeys: \"down\", description: \"Move selection down\" },\n\t\"tui.select.pageUp\": { defaultKeys: \"pageUp\", description: \"Selection page up\" },\n\t\"tui.select.pageDown\": {\n\t\tdefaultKeys: \"pageDown\",\n\t\tdescription: \"Selection page down\",\n\t},\n\t\"tui.select.confirm\": { defaultKeys: \"enter\", description: \"Confirm selection\" },\n\t\"tui.select.cancel\": {\n\t\tdefaultKeys: [\"escape\", \"ctrl+c\"],\n\t\tdescription: \"Cancel selection\",\n\t},\n\t// These intentionally shadow the unmodified editor bindings in fullscreen mode.\n\t\"tui.altScreen.pageUp\": {\n\t\tdefaultKeys: \"pageUp\",\n\t\tdescription: \"Scroll viewport up one page\",\n\t},\n\t\"tui.altScreen.pageDown\": {\n\t\tdefaultKeys: \"pageDown\",\n\t\tdescription: \"Scroll viewport down one page\",\n\t},\n\t\"tui.altScreen.halfPageUp\": {\n\t\tdefaultKeys: [],\n\t\tdescription: \"Scroll viewport up half a page\",\n\t},\n\t\"tui.altScreen.halfPageDown\": {\n\t\tdefaultKeys: [],\n\t\tdescription: \"Scroll viewport down half a page\",\n\t},\n\t\"tui.altScreen.lineUp\": {\n\t\tdefaultKeys: [],\n\t\tdescription: \"Scroll viewport up one line\",\n\t},\n\t\"tui.altScreen.lineDown\": {\n\t\tdefaultKeys: [],\n\t\tdescription: \"Scroll viewport down one line\",\n\t},\n\t\"tui.altScreen.previousPrompt\": {\n\t\tdefaultKeys: [\"ctrl+shift+up\", \"ctrl+up\"],\n\t\tdescription: \"Jump to previous semantic prompt\",\n\t},\n\t\"tui.altScreen.nextPrompt\": {\n\t\tdefaultKeys: [\"ctrl+shift+down\", \"ctrl+down\"],\n\t\tdescription: \"Jump to next semantic prompt\",\n\t},\n\t\"tui.altScreen.search\": {\n\t\tdefaultKeys: \"ctrl+shift+f\",\n\t\tdescription: \"Search the primary scroll view\",\n\t},\n\t\"tui.altScreen.searchNext\": {\n\t\tdefaultKeys: [\"enter\", \"ctrl+g\"],\n\t\tdescription: \"Select the next search match\",\n\t},\n\t\"tui.altScreen.searchPrevious\": {\n\t\tdefaultKeys: [\"shift+enter\", \"ctrl+shift+g\"],\n\t\tdescription: \"Select the previous search match\",\n\t},\n\t\"tui.altScreen.searchClose\": {\n\t\tdefaultKeys: \"escape\",\n\t\tdescription: \"Close transcript search\",\n\t},\n\t\"tui.altScreen.top\": { defaultKeys: \"home\", description: \"Scroll viewport to top\" },\n\t\"tui.altScreen.bottom\": { defaultKeys: \"end\", description: \"Scroll viewport to bottom\" },\n} as const satisfies KeybindingDefinitions;\n\nexport interface KeybindingConflict {\n\tkey: KeyId;\n\tkeybindings: string[];\n}\n\nfunction normalizeKeys(keys: KeyId | KeyId[] | undefined): KeyId[] {\n\tif (keys === undefined) return [];\n\tconst keyList = Array.isArray(keys) ? keys : [keys];\n\tconst seen = new Set<KeyId>();\n\tconst result: KeyId[] = [];\n\tfor (const key of keyList) {\n\t\tif (!seen.has(key)) {\n\t\t\tseen.add(key);\n\t\t\tresult.push(key);\n\t\t}\n\t}\n\treturn result;\n}\n\nexport class KeybindingsManager {\n\tprivate definitions: KeybindingDefinitions;\n\tprivate userBindings: KeybindingsConfig;\n\tprivate keysById = new Map<Keybinding, KeyId[]>();\n\tprivate conflicts: KeybindingConflict[] = [];\n\n\tconstructor(definitions: KeybindingDefinitions, userBindings: KeybindingsConfig = {}) {\n\t\tthis.definitions = definitions;\n\t\tthis.userBindings = userBindings;\n\t\tthis.rebuild();\n\t}\n\n\tprivate rebuild(): void {\n\t\tthis.keysById.clear();\n\t\tthis.conflicts = [];\n\n\t\tconst userClaims = new Map<KeyId, Set<Keybinding>>();\n\t\tfor (const [keybinding, keys] of Object.entries(this.userBindings)) {\n\t\t\tif (!(keybinding in this.definitions)) continue;\n\t\t\tfor (const key of normalizeKeys(keys)) {\n\t\t\t\tconst claimants = userClaims.get(key) ?? new Set<Keybinding>();\n\t\t\t\tclaimants.add(keybinding as Keybinding);\n\t\t\t\tuserClaims.set(key, claimants);\n\t\t\t}\n\t\t}\n\n\t\tfor (const [key, keybindings] of userClaims) {\n\t\t\tif (keybindings.size > 1) {\n\t\t\t\tthis.conflicts.push({ key, keybindings: [...keybindings] });\n\t\t\t}\n\t\t}\n\n\t\tfor (const [id, definition] of Object.entries(this.definitions)) {\n\t\t\tconst userKeys = this.userBindings[id];\n\t\t\tconst keys = userKeys === undefined ? normalizeKeys(definition.defaultKeys) : normalizeKeys(userKeys);\n\t\t\tthis.keysById.set(id as Keybinding, keys);\n\t\t}\n\t}\n\n\tmatches(data: string, keybinding: Keybinding): boolean {\n\t\tconst keys = this.keysById.get(keybinding) ?? [];\n\t\tfor (const key of keys) {\n\t\t\tif (matchesKey(data, key)) return true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tgetKeys(keybinding: Keybinding): KeyId[] {\n\t\treturn [...(this.keysById.get(keybinding) ?? [])];\n\t}\n\n\tgetDefinition(keybinding: Keybinding): KeybindingDefinition {\n\t\treturn this.definitions[keybinding];\n\t}\n\n\tgetConflicts(): KeybindingConflict[] {\n\t\treturn this.conflicts.map((conflict) => ({ ...conflict, keybindings: [...conflict.keybindings] }));\n\t}\n\n\tsetUserBindings(userBindings: KeybindingsConfig): void {\n\t\tthis.userBindings = userBindings;\n\t\tthis.rebuild();\n\t}\n\n\tgetUserBindings(): KeybindingsConfig {\n\t\treturn { ...this.userBindings };\n\t}\n\n\tgetResolvedBindings(): KeybindingsConfig {\n\t\tconst resolved: KeybindingsConfig = {};\n\t\tfor (const id of Object.keys(this.definitions)) {\n\t\t\tconst keys = this.keysById.get(id as Keybinding) ?? [];\n\t\t\tresolved[id] = keys.length === 1 ? keys[0]! : [...keys];\n\t\t}\n\t\treturn resolved;\n\t}\n}\n\nlet globalKeybindings: KeybindingsManager | null = null;\n\nexport function setKeybindings(keybindings: KeybindingsManager): void {\n\tglobalKeybindings = keybindings;\n}\n\nexport function getKeybindings(): KeybindingsManager {\n\tif (!globalKeybindings) {\n\t\tglobalKeybindings = new KeybindingsManager(TUI_KEYBINDINGS);\n\t}\n\treturn globalKeybindings;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"native-modifiers.d.ts","sourceRoot":"","sources":["../src/native-modifiers.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC;AAmDrE,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,WAAW,GAAG,OAAO,CAQjE","sourcesContent":["import { createRequire } from \"node:module\";\nimport * as path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nconst cjsRequire = createRequire(import.meta.url);\n\nexport type ModifierKey = \"shift\" | \"command\" | \"control\" | \"option\";\n\ntype NativeModifiersHelper = {\n\tisModifierPressed: (name: ModifierKey) => boolean;\n};\n\nlet nativeModifiersHelper: NativeModifiersHelper | null | undefined;\n\nfunction isNativeModifiersHelper(value: unknown): value is NativeModifiersHelper {\n\tif (typeof value !== \"object\" || value === null) return false;\n\tconst candidate = (value as { isModifierPressed?: unknown }).isModifierPressed;\n\treturn typeof candidate === \"function\";\n}\n\nfunction loadNativeModifiersHelper(): NativeModifiersHelper | undefined {\n\tif (nativeModifiersHelper !== undefined) return nativeModifiersHelper ?? undefined;\n\tnativeModifiersHelper = null;\n\tconst arch = process.arch;\n\tif (arch !== \"x64\" && arch !== \"arm64\") return undefined;\n\n\tlet nativePath: string;\n\tif (process.platform === \"darwin\") {\n\t\tnativePath = path.join(\"native\", \"darwin\", \"prebuilds\", `darwin-${arch}`, \"darwin-modifiers.node\");\n\t} else if (process.platform === \"win32\") {\n\t\tnativePath = path.join(\"native\", \"win32\", \"prebuilds\", `win32-${arch}`, \"win32-console-mode.node\");\n\t} else {\n\t\treturn undefined;\n\t}\n\n\tconst moduleDir = path.dirname(fileURLToPath(import.meta.url));\n\tconst candidates = [\n\t\tpath.join(moduleDir, \"..\", nativePath),\n\t\tpath.join(moduleDir, nativePath),\n\t\tpath.join(path.dirname(process.execPath), nativePath),\n\t];\n\n\tfor (const modulePath of candidates) {\n\t\ttry {\n\t\t\tconst helper = cjsRequire(modulePath) as unknown;\n\t\t\tif (isNativeModifiersHelper(helper)) {\n\t\t\t\tnativeModifiersHelper = helper;\n\t\t\t\treturn helper;\n\t\t\t}\n\t\t} catch {\n\t\t\t// Try the next possible packaging location.\n\t\t}\n\t}\n\n\treturn undefined;\n}\n\nexport function isNativeModifierPressed(key: ModifierKey): boolean {\n\tconst helper = loadNativeModifiersHelper();\n\tif (!helper) return false;\n\ttry {\n\t\treturn helper.isModifierPressed(key) === true;\n\t} catch {\n\t\treturn false;\n\t}\n}\n"]}
1
+ {"version":3,"file":"native-modifiers.d.ts","sourceRoot":"","sources":["../src/native-modifiers.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC;AA4CrE,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,WAAW,GAAG,OAAO,CAQjE","sourcesContent":["import { createRequire } from \"node:module\";\nimport * as path from \"node:path\";\nimport { getNativeModuleCandidates } from \"./native-module-path.ts\";\n\nconst cjsRequire = createRequire(import.meta.url);\n\nexport type ModifierKey = \"shift\" | \"command\" | \"control\" | \"option\";\n\ntype NativeModifiersHelper = {\n\tisModifierPressed: (name: ModifierKey) => boolean;\n};\n\nlet nativeModifiersHelper: NativeModifiersHelper | null | undefined;\n\nfunction isNativeModifiersHelper(value: unknown): value is NativeModifiersHelper {\n\tif (typeof value !== \"object\" || value === null) return false;\n\tconst candidate = (value as { isModifierPressed?: unknown }).isModifierPressed;\n\treturn typeof candidate === \"function\";\n}\n\nfunction loadNativeModifiersHelper(): NativeModifiersHelper | undefined {\n\tif (nativeModifiersHelper !== undefined) return nativeModifiersHelper ?? undefined;\n\tnativeModifiersHelper = null;\n\tconst arch = process.arch;\n\tif (arch !== \"x64\" && arch !== \"arm64\") return undefined;\n\n\tlet nativePath: string;\n\tif (process.platform === \"darwin\") {\n\t\tnativePath = path.join(\"native\", \"darwin\", \"prebuilds\", `darwin-${arch}`, \"darwin-modifiers.node\");\n\t} else if (process.platform === \"win32\") {\n\t\tnativePath = path.join(\"native\", \"win32\", \"prebuilds\", `win32-${arch}`, \"win32-console-mode.node\");\n\t} else {\n\t\treturn undefined;\n\t}\n\n\tfor (const modulePath of getNativeModuleCandidates(nativePath)) {\n\t\ttry {\n\t\t\tconst helper = cjsRequire(modulePath) as unknown;\n\t\t\tif (isNativeModifiersHelper(helper)) {\n\t\t\t\tnativeModifiersHelper = helper;\n\t\t\t\treturn helper;\n\t\t\t}\n\t\t} catch {\n\t\t\t// Try the next possible packaging location.\n\t\t}\n\t}\n\n\treturn undefined;\n}\n\nexport function isNativeModifierPressed(key: ModifierKey): boolean {\n\tconst helper = loadNativeModifiersHelper();\n\tif (!helper) return false;\n\ttry {\n\t\treturn helper.isModifierPressed(key) === true;\n\t} catch {\n\t\treturn false;\n\t}\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  import { createRequire } from "node:module";
2
2
  import * as path from "node:path";
3
- import { fileURLToPath } from "node:url";
3
+ import { getNativeModuleCandidates } from "./native-module-path.js";
4
4
  const cjsRequire = createRequire(import.meta.url);
5
5
  let nativeModifiersHelper;
6
6
  function isNativeModifiersHelper(value) {
@@ -26,13 +26,7 @@ function loadNativeModifiersHelper() {
26
26
  else {
27
27
  return undefined;
28
28
  }
29
- const moduleDir = path.dirname(fileURLToPath(import.meta.url));
30
- const candidates = [
31
- path.join(moduleDir, "..", nativePath),
32
- path.join(moduleDir, nativePath),
33
- path.join(path.dirname(process.execPath), nativePath),
34
- ];
35
- for (const modulePath of candidates) {
29
+ for (const modulePath of getNativeModuleCandidates(nativePath)) {
36
30
  try {
37
31
  const helper = cjsRequire(modulePath);
38
32
  if (isNativeModifiersHelper(helper)) {
@@ -1 +1 @@
1
- {"version":3,"file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,CAAC;IAClB,CAAC;IAED,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IAC/D,MAAM,UAAU,GAAG;QAClB,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,UAAU,CAAC;QACtC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC;QAChC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC;KACrD,CAAC;IAEF,KAAK,MAAM,UAAU,IAAI,UAAU,EAAE,CAAC;QACrC,IAAI,CAAC;YACJ,MAAM,MAAM,GAAG,UAAU,CAAC,UAAU,CAAY,CAAC;YACjD,IAAI,uBAAuB,CAAC,MAAM,CAAC,EAAE,CAAC;gBACrC,qBAAqB,GAAG,MAAM,CAAC;gBAC/B,OAAO,MAAM,CAAC;YACf,CAAC;QACF,CAAC;QAAC,MAAM,CAAC;YACR,4CAA4C;QAC7C,CAAC;IACF,CAAC;IAED,OAAO,SAAS,CAAC;AAAA,CACjB;AAED,MAAM,UAAU,uBAAuB,CAAC,GAAgB,EAAW;IAClE,MAAM,MAAM,GAAG,yBAAyB,EAAE,CAAC;IAC3C,IAAI,CAAC,MAAM;QAAE,OAAO,KAAK,CAAC;IAC1B,IAAI,CAAC;QACJ,OAAO,MAAM,CAAC,iBAAiB,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC;IAC/C,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,KAAK,CAAC;IACd,CAAC;AAAA,CACD","sourcesContent":["import { createRequire } from \"node:module\";\nimport * as path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nconst cjsRequire = createRequire(import.meta.url);\n\nexport type ModifierKey = \"shift\" | \"command\" | \"control\" | \"option\";\n\ntype NativeModifiersHelper = {\n\tisModifierPressed: (name: ModifierKey) => boolean;\n};\n\nlet nativeModifiersHelper: NativeModifiersHelper | null | undefined;\n\nfunction isNativeModifiersHelper(value: unknown): value is NativeModifiersHelper {\n\tif (typeof value !== \"object\" || value === null) return false;\n\tconst candidate = (value as { isModifierPressed?: unknown }).isModifierPressed;\n\treturn typeof candidate === \"function\";\n}\n\nfunction loadNativeModifiersHelper(): NativeModifiersHelper | undefined {\n\tif (nativeModifiersHelper !== undefined) return nativeModifiersHelper ?? undefined;\n\tnativeModifiersHelper = null;\n\tconst arch = process.arch;\n\tif (arch !== \"x64\" && arch !== \"arm64\") return undefined;\n\n\tlet nativePath: string;\n\tif (process.platform === \"darwin\") {\n\t\tnativePath = path.join(\"native\", \"darwin\", \"prebuilds\", `darwin-${arch}`, \"darwin-modifiers.node\");\n\t} else if (process.platform === \"win32\") {\n\t\tnativePath = path.join(\"native\", \"win32\", \"prebuilds\", `win32-${arch}`, \"win32-console-mode.node\");\n\t} else {\n\t\treturn undefined;\n\t}\n\n\tconst moduleDir = path.dirname(fileURLToPath(import.meta.url));\n\tconst candidates = [\n\t\tpath.join(moduleDir, \"..\", nativePath),\n\t\tpath.join(moduleDir, nativePath),\n\t\tpath.join(path.dirname(process.execPath), nativePath),\n\t];\n\n\tfor (const modulePath of candidates) {\n\t\ttry {\n\t\t\tconst helper = cjsRequire(modulePath) as unknown;\n\t\t\tif (isNativeModifiersHelper(helper)) {\n\t\t\t\tnativeModifiersHelper = helper;\n\t\t\t\treturn helper;\n\t\t\t}\n\t\t} catch {\n\t\t\t// Try the next possible packaging location.\n\t\t}\n\t}\n\n\treturn undefined;\n}\n\nexport function isNativeModifierPressed(key: ModifierKey): boolean {\n\tconst helper = loadNativeModifiersHelper();\n\tif (!helper) return false;\n\ttry {\n\t\treturn helper.isModifierPressed(key) === true;\n\t} catch {\n\t\treturn false;\n\t}\n}\n"]}
1
+ {"version":3,"file":"native-modifiers.js","sourceRoot":"","sources":["../src/native-modifiers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,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E,IAAI,CAAC;YACJ,MAAM,MAAM,GAAG,UAAU,CAAC,UAAU,CAAY,CAAC;YACjD,IAAI,uBAAuB,CAAC,MAAM,CAAC,EAAE,CAAC;gBACrC,qBAAqB,GAAG,MAAM,CAAC;gBAC/B,OAAO,MAAM,CAAC;YACf,CAAC;QACF,CAAC;QAAC,MAAM,CAAC;YACR,4CAA4C;QAC7C,CAAC;IACF,CAAC;IAED,OAAO,SAAS,CAAC;AAAA,CACjB;AAED,MAAM,UAAU,uBAAuB,CAAC,GAAgB,EAAW;IAClE,MAAM,MAAM,GAAG,yBAAyB,EAAE,CAAC;IAC3C,IAAI,CAAC,MAAM;QAAE,OAAO,KAAK,CAAC;IAC1B,IAAI,CAAC;QACJ,OAAO,MAAM,CAAC,iBAAiB,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC;IAC/C,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,KAAK,CAAC;IACd,CAAC;AAAA,CACD","sourcesContent":["import { createRequire } from \"node:module\";\nimport * as path from \"node:path\";\nimport { getNativeModuleCandidates } from \"./native-module-path.ts\";\n\nconst cjsRequire = createRequire(import.meta.url);\n\nexport type ModifierKey = \"shift\" | \"command\" | \"control\" | \"option\";\n\ntype NativeModifiersHelper = {\n\tisModifierPressed: (name: ModifierKey) => boolean;\n};\n\nlet nativeModifiersHelper: NativeModifiersHelper | null | undefined;\n\nfunction isNativeModifiersHelper(value: unknown): value is NativeModifiersHelper {\n\tif (typeof value !== \"object\" || value === null) return false;\n\tconst candidate = (value as { isModifierPressed?: unknown }).isModifierPressed;\n\treturn typeof candidate === \"function\";\n}\n\nfunction loadNativeModifiersHelper(): NativeModifiersHelper | undefined {\n\tif (nativeModifiersHelper !== undefined) return nativeModifiersHelper ?? undefined;\n\tnativeModifiersHelper = null;\n\tconst arch = process.arch;\n\tif (arch !== \"x64\" && arch !== \"arm64\") return undefined;\n\n\tlet nativePath: string;\n\tif (process.platform === \"darwin\") {\n\t\tnativePath = path.join(\"native\", \"darwin\", \"prebuilds\", `darwin-${arch}`, \"darwin-modifiers.node\");\n\t} else if (process.platform === \"win32\") {\n\t\tnativePath = path.join(\"native\", \"win32\", \"prebuilds\", `win32-${arch}`, \"win32-console-mode.node\");\n\t} else {\n\t\treturn undefined;\n\t}\n\n\tfor (const modulePath of getNativeModuleCandidates(nativePath)) {\n\t\ttry {\n\t\t\tconst helper = cjsRequire(modulePath) as unknown;\n\t\t\tif (isNativeModifiersHelper(helper)) {\n\t\t\t\tnativeModifiersHelper = helper;\n\t\t\t\treturn helper;\n\t\t\t}\n\t\t} catch {\n\t\t\t// Try the next possible packaging location.\n\t\t}\n\t}\n\n\treturn undefined;\n}\n\nexport function isNativeModifierPressed(key: ModifierKey): boolean {\n\tconst helper = loadNativeModifiersHelper();\n\tif (!helper) return false;\n\ttry {\n\t\treturn helper.isModifierPressed(key) === true;\n\t} catch {\n\t\treturn false;\n\t}\n}\n"]}
@@ -0,0 +1,7 @@
1
+ export interface NativeModuleCandidateOptions {
2
+ moduleUrl?: string;
3
+ execPath?: string;
4
+ resolvePackage?: (specifier: string) => string;
5
+ }
6
+ export declare function getNativeModuleCandidates(nativePath: string, options?: NativeModuleCandidateOptions): string[];
7
+ //# sourceMappingURL=native-module-path.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"native-module-path.d.ts","sourceRoot":"","sources":["../src/native-module-path.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,4BAA4B;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;CAC/C;AAED,wBAAgB,yBAAyB,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,GAAE,4BAAiC,GAAG,MAAM,EAAE,CAiBlH","sourcesContent":["import { createRequire } from \"node:module\";\nimport { dirname, join } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nconst moduleRequire = createRequire(import.meta.url);\nconst TUI_PACKAGE_NAME = \"@earendil-works/pi-tui\";\n\nexport interface NativeModuleCandidateOptions {\n\tmoduleUrl?: string;\n\texecPath?: string;\n\tresolvePackage?: (specifier: string) => string;\n}\n\nexport function getNativeModuleCandidates(nativePath: string, options: NativeModuleCandidateOptions = {}): string[] {\n\tconst moduleDir = dirname(fileURLToPath(options.moduleUrl ?? import.meta.url));\n\tconst candidates: string[] = [];\n\n\ttry {\n\t\tconst packageEntry = (options.resolvePackage ?? moduleRequire.resolve)(TUI_PACKAGE_NAME);\n\t\tcandidates.push(join(dirname(packageEntry), \"..\", nativePath));\n\t} catch {\n\t\t// Standalone binaries do not have an installed TUI package.\n\t}\n\n\tcandidates.push(\n\t\tjoin(moduleDir, \"..\", nativePath),\n\t\tjoin(moduleDir, nativePath),\n\t\tjoin(dirname(options.execPath ?? process.execPath), nativePath),\n\t);\n\treturn Array.from(new Set(candidates));\n}\n"]}
@@ -0,0 +1,19 @@
1
+ import { createRequire } from "node:module";
2
+ import { dirname, join } from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
+ const moduleRequire = createRequire(import.meta.url);
5
+ const TUI_PACKAGE_NAME = "@earendil-works/pi-tui";
6
+ export function getNativeModuleCandidates(nativePath, options = {}) {
7
+ const moduleDir = dirname(fileURLToPath(options.moduleUrl ?? import.meta.url));
8
+ const candidates = [];
9
+ try {
10
+ const packageEntry = (options.resolvePackage ?? moduleRequire.resolve)(TUI_PACKAGE_NAME);
11
+ candidates.push(join(dirname(packageEntry), "..", nativePath));
12
+ }
13
+ catch {
14
+ // Standalone binaries do not have an installed TUI package.
15
+ }
16
+ candidates.push(join(moduleDir, "..", nativePath), join(moduleDir, nativePath), join(dirname(options.execPath ?? process.execPath), nativePath));
17
+ return Array.from(new Set(candidates));
18
+ }
19
+ //# sourceMappingURL=native-module-path.js.map