@fbincon/claude-code-statusline 0.0.0-stage → 3.0.0-beta.1

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 (645) hide show
  1. package/LICENSE +21 -0
  2. package/LICENSE-Unicode.txt +39 -0
  3. package/LICENSE-Wcwidth.txt +27 -0
  4. package/README.md +90 -2
  5. package/bin/claude-statusline.js +2 -0
  6. package/candidate.json +1238 -0
  7. package/node_modules/@fbincon/statusline-cli/dist/src/config/arguments.d.ts +35 -0
  8. package/node_modules/@fbincon/statusline-cli/dist/src/config/arguments.js +228 -0
  9. package/node_modules/@fbincon/statusline-cli/dist/src/config/arguments.js.map +1 -0
  10. package/node_modules/@fbincon/statusline-cli/dist/src/config/backend-preferences.d.ts +6 -0
  11. package/node_modules/@fbincon/statusline-cli/dist/src/config/backend-preferences.js +72 -0
  12. package/node_modules/@fbincon/statusline-cli/dist/src/config/backend-preferences.js.map +1 -0
  13. package/node_modules/@fbincon/statusline-cli/dist/src/config/commands.d.ts +10 -0
  14. package/node_modules/@fbincon/statusline-cli/dist/src/config/commands.js +140 -0
  15. package/node_modules/@fbincon/statusline-cli/dist/src/config/commands.js.map +1 -0
  16. package/node_modules/@fbincon/statusline-cli/dist/src/config/host.d.ts +10 -0
  17. package/node_modules/@fbincon/statusline-cli/dist/src/config/host.js +101 -0
  18. package/node_modules/@fbincon/statusline-cli/dist/src/config/host.js.map +1 -0
  19. package/node_modules/@fbincon/statusline-cli/dist/src/config/operations.d.ts +10 -0
  20. package/node_modules/@fbincon/statusline-cli/dist/src/config/operations.js +96 -0
  21. package/node_modules/@fbincon/statusline-cli/dist/src/config/operations.js.map +1 -0
  22. package/node_modules/@fbincon/statusline-cli/dist/src/config/preferences.d.ts +11 -0
  23. package/node_modules/@fbincon/statusline-cli/dist/src/config/preferences.js +80 -0
  24. package/node_modules/@fbincon/statusline-cli/dist/src/config/preferences.js.map +1 -0
  25. package/node_modules/@fbincon/statusline-cli/dist/src/config/service.d.ts +45 -0
  26. package/node_modules/@fbincon/statusline-cli/dist/src/config/service.js +99 -0
  27. package/node_modules/@fbincon/statusline-cli/dist/src/config/service.js.map +1 -0
  28. package/node_modules/@fbincon/statusline-cli/dist/src/config/storage.d.ts +30 -0
  29. package/node_modules/@fbincon/statusline-cli/dist/src/config/storage.js +134 -0
  30. package/node_modules/@fbincon/statusline-cli/dist/src/config/storage.js.map +1 -0
  31. package/node_modules/@fbincon/statusline-cli/dist/src/config/transfer.d.ts +3 -0
  32. package/node_modules/@fbincon/statusline-cli/dist/src/config/transfer.js +89 -0
  33. package/node_modules/@fbincon/statusline-cli/dist/src/config/transfer.js.map +1 -0
  34. package/node_modules/@fbincon/statusline-cli/dist/src/context.d.ts +11 -0
  35. package/node_modules/@fbincon/statusline-cli/dist/src/context.js +2 -0
  36. package/node_modules/@fbincon/statusline-cli/dist/src/context.js.map +1 -0
  37. package/node_modules/@fbincon/statusline-cli/dist/src/entry.d.ts +1 -0
  38. package/node_modules/@fbincon/statusline-cli/dist/src/entry.js +3 -0
  39. package/node_modules/@fbincon/statusline-cli/dist/src/entry.js.map +1 -0
  40. package/node_modules/@fbincon/statusline-cli/dist/src/errors.d.ts +4 -0
  41. package/node_modules/@fbincon/statusline-cli/dist/src/errors.js +8 -0
  42. package/node_modules/@fbincon/statusline-cli/dist/src/errors.js.map +1 -0
  43. package/node_modules/@fbincon/statusline-cli/dist/src/help.d.ts +3 -0
  44. package/node_modules/@fbincon/statusline-cli/dist/src/help.js +67 -0
  45. package/node_modules/@fbincon/statusline-cli/dist/src/help.js.map +1 -0
  46. package/node_modules/@fbincon/statusline-cli/dist/src/integration/arguments.d.ts +10 -0
  47. package/node_modules/@fbincon/statusline-cli/dist/src/integration/arguments.js +40 -0
  48. package/node_modules/@fbincon/statusline-cli/dist/src/integration/arguments.js.map +1 -0
  49. package/node_modules/@fbincon/statusline-cli/dist/src/integration/configure.d.ts +3 -0
  50. package/node_modules/@fbincon/statusline-cli/dist/src/integration/configure.js +63 -0
  51. package/node_modules/@fbincon/statusline-cli/dist/src/integration/configure.js.map +1 -0
  52. package/node_modules/@fbincon/statusline-cli/dist/src/integration/doctor.d.ts +4 -0
  53. package/node_modules/@fbincon/statusline-cli/dist/src/integration/doctor.js +153 -0
  54. package/node_modules/@fbincon/statusline-cli/dist/src/integration/doctor.js.map +1 -0
  55. package/node_modules/@fbincon/statusline-cli/dist/src/integration/editor.d.ts +14 -0
  56. package/node_modules/@fbincon/statusline-cli/dist/src/integration/editor.js +3 -0
  57. package/node_modules/@fbincon/statusline-cli/dist/src/integration/editor.js.map +1 -0
  58. package/node_modules/@fbincon/statusline-cli/dist/src/integration/install.d.ts +6 -0
  59. package/node_modules/@fbincon/statusline-cli/dist/src/integration/install.js +142 -0
  60. package/node_modules/@fbincon/statusline-cli/dist/src/integration/install.js.map +1 -0
  61. package/node_modules/@fbincon/statusline-cli/dist/src/integration/launcher.d.ts +15 -0
  62. package/node_modules/@fbincon/statusline-cli/dist/src/integration/launcher.js +91 -0
  63. package/node_modules/@fbincon/statusline-cli/dist/src/integration/launcher.js.map +1 -0
  64. package/node_modules/@fbincon/statusline-cli/dist/src/integration/mod-ownership.d.ts +20 -0
  65. package/node_modules/@fbincon/statusline-cli/dist/src/integration/mod-ownership.js +109 -0
  66. package/node_modules/@fbincon/statusline-cli/dist/src/integration/mod-ownership.js.map +1 -0
  67. package/node_modules/@fbincon/statusline-cli/dist/src/integration/model.d.ts +60 -0
  68. package/node_modules/@fbincon/statusline-cli/dist/src/integration/model.js +12 -0
  69. package/node_modules/@fbincon/statusline-cli/dist/src/integration/model.js.map +1 -0
  70. package/node_modules/@fbincon/statusline-cli/dist/src/integration/mods.d.ts +10 -0
  71. package/node_modules/@fbincon/statusline-cli/dist/src/integration/mods.js +234 -0
  72. package/node_modules/@fbincon/statusline-cli/dist/src/integration/mods.js.map +1 -0
  73. package/node_modules/@fbincon/statusline-cli/dist/src/integration/ownership.d.ts +8 -0
  74. package/node_modules/@fbincon/statusline-cli/dist/src/integration/ownership.js +41 -0
  75. package/node_modules/@fbincon/statusline-cli/dist/src/integration/ownership.js.map +1 -0
  76. package/node_modules/@fbincon/statusline-cli/dist/src/integration/paths.d.ts +1 -0
  77. package/node_modules/@fbincon/statusline-cli/dist/src/integration/paths.js +14 -0
  78. package/node_modules/@fbincon/statusline-cli/dist/src/integration/paths.js.map +1 -0
  79. package/node_modules/@fbincon/statusline-cli/dist/src/integration/plan.d.ts +13 -0
  80. package/node_modules/@fbincon/statusline-cli/dist/src/integration/plan.js +92 -0
  81. package/node_modules/@fbincon/statusline-cli/dist/src/integration/plan.js.map +1 -0
  82. package/node_modules/@fbincon/statusline-cli/dist/src/integration/resources.d.ts +19 -0
  83. package/node_modules/@fbincon/statusline-cli/dist/src/integration/resources.js +91 -0
  84. package/node_modules/@fbincon/statusline-cli/dist/src/integration/resources.js.map +1 -0
  85. package/node_modules/@fbincon/statusline-cli/dist/src/integration/slash-hook.d.ts +6 -0
  86. package/node_modules/@fbincon/statusline-cli/dist/src/integration/slash-hook.js +94 -0
  87. package/node_modules/@fbincon/statusline-cli/dist/src/integration/slash-hook.js.map +1 -0
  88. package/node_modules/@fbincon/statusline-cli/dist/src/integration/transaction.d.ts +8 -0
  89. package/node_modules/@fbincon/statusline-cli/dist/src/integration/transaction.js +3 -0
  90. package/node_modules/@fbincon/statusline-cli/dist/src/integration/transaction.js.map +1 -0
  91. package/node_modules/@fbincon/statusline-cli/dist/src/main.d.ts +22 -0
  92. package/node_modules/@fbincon/statusline-cli/dist/src/main.js +197 -0
  93. package/node_modules/@fbincon/statusline-cli/dist/src/main.js.map +1 -0
  94. package/node_modules/@fbincon/statusline-cli/dist/src/recovery/files.d.ts +7 -0
  95. package/node_modules/@fbincon/statusline-cli/dist/src/recovery/files.js +134 -0
  96. package/node_modules/@fbincon/statusline-cli/dist/src/recovery/files.js.map +1 -0
  97. package/node_modules/@fbincon/statusline-cli/dist/src/recovery/journal.d.ts +58 -0
  98. package/node_modules/@fbincon/statusline-cli/dist/src/recovery/journal.js +144 -0
  99. package/node_modules/@fbincon/statusline-cli/dist/src/recovery/journal.js.map +1 -0
  100. package/node_modules/@fbincon/statusline-cli/dist/src/recovery/official.d.ts +5 -0
  101. package/node_modules/@fbincon/statusline-cli/dist/src/recovery/official.js +125 -0
  102. package/node_modules/@fbincon/statusline-cli/dist/src/recovery/official.js.map +1 -0
  103. package/node_modules/@fbincon/statusline-cli/dist/src/recovery/service.d.ts +11 -0
  104. package/node_modules/@fbincon/statusline-cli/dist/src/recovery/service.js +55 -0
  105. package/node_modules/@fbincon/statusline-cli/dist/src/recovery/service.js.map +1 -0
  106. package/node_modules/@fbincon/statusline-cli/dist/src/rendering/environment.d.ts +15 -0
  107. package/node_modules/@fbincon/statusline-cli/dist/src/rendering/environment.js +95 -0
  108. package/node_modules/@fbincon/statusline-cli/dist/src/rendering/environment.js.map +1 -0
  109. package/node_modules/@fbincon/statusline-cli/dist/src/rendering/main.d.ts +6 -0
  110. package/node_modules/@fbincon/statusline-cli/dist/src/rendering/main.js +48 -0
  111. package/node_modules/@fbincon/statusline-cli/dist/src/rendering/main.js.map +1 -0
  112. package/node_modules/@fbincon/statusline-cli/dist/src/rendering/preview.d.ts +2 -0
  113. package/node_modules/@fbincon/statusline-cli/dist/src/rendering/preview.js +13 -0
  114. package/node_modules/@fbincon/statusline-cli/dist/src/rendering/preview.js.map +1 -0
  115. package/node_modules/@fbincon/statusline-cli/dist/src/runtime/context.d.ts +11 -0
  116. package/node_modules/@fbincon/statusline-cli/dist/src/runtime/context.js +11 -0
  117. package/node_modules/@fbincon/statusline-cli/dist/src/runtime/context.js.map +1 -0
  118. package/node_modules/@fbincon/statusline-cli/dist/src/runtime/git.d.ts +19 -0
  119. package/node_modules/@fbincon/statusline-cli/dist/src/runtime/git.js +162 -0
  120. package/node_modules/@fbincon/statusline-cli/dist/src/runtime/git.js.map +1 -0
  121. package/node_modules/@fbincon/statusline-cli/dist/src/runtime/hook.d.ts +3 -0
  122. package/node_modules/@fbincon/statusline-cli/dist/src/runtime/hook.js +19 -0
  123. package/node_modules/@fbincon/statusline-cli/dist/src/runtime/hook.js.map +1 -0
  124. package/node_modules/@fbincon/statusline-cli/dist/src/runtime/io.d.ts +37 -0
  125. package/node_modules/@fbincon/statusline-cli/dist/src/runtime/io.js +75 -0
  126. package/node_modules/@fbincon/statusline-cli/dist/src/runtime/io.js.map +1 -0
  127. package/node_modules/@fbincon/statusline-cli/dist/src/runtime/json-data.d.ts +9 -0
  128. package/node_modules/@fbincon/statusline-cli/dist/src/runtime/json-data.js +241 -0
  129. package/node_modules/@fbincon/statusline-cli/dist/src/runtime/json-data.js.map +1 -0
  130. package/node_modules/@fbincon/statusline-cli/dist/src/runtime/live/collect.d.ts +2 -0
  131. package/node_modules/@fbincon/statusline-cli/dist/src/runtime/live/collect.js +14 -0
  132. package/node_modules/@fbincon/statusline-cli/dist/src/runtime/live/collect.js.map +1 -0
  133. package/node_modules/@fbincon/statusline-cli/dist/src/runtime/live/durations.d.ts +15 -0
  134. package/node_modules/@fbincon/statusline-cli/dist/src/runtime/live/durations.js +69 -0
  135. package/node_modules/@fbincon/statusline-cli/dist/src/runtime/live/durations.js.map +1 -0
  136. package/node_modules/@fbincon/statusline-cli/dist/src/runtime/live/protocol.d.ts +16 -0
  137. package/node_modules/@fbincon/statusline-cli/dist/src/runtime/live/protocol.js +90 -0
  138. package/node_modules/@fbincon/statusline-cli/dist/src/runtime/live/protocol.js.map +1 -0
  139. package/node_modules/@fbincon/statusline-cli/dist/src/runtime/live/store.d.ts +25 -0
  140. package/node_modules/@fbincon/statusline-cli/dist/src/runtime/live/store.js +80 -0
  141. package/node_modules/@fbincon/statusline-cli/dist/src/runtime/live/store.js.map +1 -0
  142. package/node_modules/@fbincon/statusline-cli/dist/src/runtime/registry.d.ts +4 -0
  143. package/node_modules/@fbincon/statusline-cli/dist/src/runtime/registry.js +40 -0
  144. package/node_modules/@fbincon/statusline-cli/dist/src/runtime/registry.js.map +1 -0
  145. package/node_modules/@fbincon/statusline-cli/dist/src/runtime/tasks/collect.d.ts +5 -0
  146. package/node_modules/@fbincon/statusline-cli/dist/src/runtime/tasks/collect.js +59 -0
  147. package/node_modules/@fbincon/statusline-cli/dist/src/runtime/tasks/collect.js.map +1 -0
  148. package/node_modules/@fbincon/statusline-cli/dist/src/runtime/tasks/service.d.ts +17 -0
  149. package/node_modules/@fbincon/statusline-cli/dist/src/runtime/tasks/service.js +69 -0
  150. package/node_modules/@fbincon/statusline-cli/dist/src/runtime/tasks/service.js.map +1 -0
  151. package/node_modules/@fbincon/statusline-cli/dist/src/runtime/tasks/store.d.ts +17 -0
  152. package/node_modules/@fbincon/statusline-cli/dist/src/runtime/tasks/store.js +70 -0
  153. package/node_modules/@fbincon/statusline-cli/dist/src/runtime/tasks/store.js.map +1 -0
  154. package/node_modules/@fbincon/statusline-cli/dist/src/runtime/tasks/submissions.d.ts +13 -0
  155. package/node_modules/@fbincon/statusline-cli/dist/src/runtime/tasks/submissions.js +75 -0
  156. package/node_modules/@fbincon/statusline-cli/dist/src/runtime/tasks/submissions.js.map +1 -0
  157. package/node_modules/@fbincon/statusline-cli/dist/src/runtime/usage.d.ts +33 -0
  158. package/node_modules/@fbincon/statusline-cli/dist/src/runtime/usage.js +227 -0
  159. package/node_modules/@fbincon/statusline-cli/dist/src/runtime/usage.js.map +1 -0
  160. package/node_modules/@fbincon/statusline-cli/dist/src/ui/protocol.d.ts +20 -0
  161. package/node_modules/@fbincon/statusline-cli/dist/src/ui/protocol.js +144 -0
  162. package/node_modules/@fbincon/statusline-cli/dist/src/ui/protocol.js.map +1 -0
  163. package/node_modules/@fbincon/statusline-cli/package.json +17 -0
  164. package/node_modules/@fbincon/statusline-cli/resources/statusline-config/SKILL.md +80 -0
  165. package/node_modules/@fbincon/statusline-cli/resources/statusline-configure/SKILL.md +19 -0
  166. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/.claude-plugin/plugin.json +37 -0
  167. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/hooks/hooks.json +6 -0
  168. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/hooks/register.ts +820 -0
  169. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/backend.ts +503 -0
  170. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/client/forms.ts +3 -0
  171. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/client/keys.ts +198 -0
  172. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/client/messages.ts +101 -0
  173. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/client/settings.ts +218 -0
  174. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/appearance.ts +29 -0
  175. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/draft.ts +254 -0
  176. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/forms.ts +167 -0
  177. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/guidance.ts +20 -0
  178. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/import-review.ts +55 -0
  179. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/instances.ts +30 -0
  180. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/navigation.ts +98 -0
  181. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/numeric.ts +42 -0
  182. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/search.ts +114 -0
  183. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/generated-contracts.ts +276 -0
  184. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/generated-unicode.ts +92 -0
  185. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/i18n/generated-locales.ts +6842 -0
  186. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/i18n/index.ts +40 -0
  187. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/i18n/messages.ts +33 -0
  188. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/i18n/presentation.ts +62 -0
  189. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/launch.ts +25 -0
  190. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/preferences.ts +61 -0
  191. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/preview-preferences.ts +8 -0
  192. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/session.ts +124 -0
  193. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/unicode.ts +121 -0
  194. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/resource-manifest.json +47 -0
  195. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/ui/client/draw.ts +159 -0
  196. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/ui/client/help.ts +84 -0
  197. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/ui/client/surface.ts +89 -0
  198. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/ui/components/catalog.ts +23 -0
  199. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/ui/components/preview.ts +45 -0
  200. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/ui/components/section.ts +49 -0
  201. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/ui/components/shortcuts.ts +83 -0
  202. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/ui/layout.ts +49 -0
  203. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/ui/styled-text.ts +56 -0
  204. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/ui/text.ts +23 -0
  205. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/ui/theme.ts +27 -0
  206. package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/.claude-plugin/plugin.json +49 -0
  207. package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/hooks/hooks.json +1 -0
  208. package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/hooks/observe.ts +279 -0
  209. package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/lib/checklists.ts +45 -0
  210. package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/lib/costs.ts +23 -0
  211. package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/lib/generated-contracts.ts +18 -0
  212. package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/lib/identity.ts +14 -0
  213. package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/lib/launch.ts +25 -0
  214. package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/lib/queue.ts +68 -0
  215. package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/lib/streams.ts +28 -0
  216. package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/lib/timing.ts +11 -0
  217. package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/resource-manifest.json +19 -0
  218. package/node_modules/@fbincon/statusline-core/dist/src/config/backend-preferences.d.ts +14 -0
  219. package/node_modules/@fbincon/statusline-core/dist/src/config/backend-preferences.js +72 -0
  220. package/node_modules/@fbincon/statusline-core/dist/src/config/backend-preferences.js.map +1 -0
  221. package/node_modules/@fbincon/statusline-core/dist/src/config/catalog-data.d.ts +86 -0
  222. package/node_modules/@fbincon/statusline-core/dist/src/config/catalog-data.js +3462 -0
  223. package/node_modules/@fbincon/statusline-core/dist/src/config/catalog-data.js.map +1 -0
  224. package/node_modules/@fbincon/statusline-core/dist/src/config/catalog.d.ts +10 -0
  225. package/node_modules/@fbincon/statusline-core/dist/src/config/catalog.js +17 -0
  226. package/node_modules/@fbincon/statusline-core/dist/src/config/catalog.js.map +1 -0
  227. package/node_modules/@fbincon/statusline-core/dist/src/config/defaults.d.ts +5 -0
  228. package/node_modules/@fbincon/statusline-core/dist/src/config/defaults.js +19 -0
  229. package/node_modules/@fbincon/statusline-core/dist/src/config/defaults.js.map +1 -0
  230. package/node_modules/@fbincon/statusline-core/dist/src/config/display.d.ts +13 -0
  231. package/node_modules/@fbincon/statusline-core/dist/src/config/display.js +232 -0
  232. package/node_modules/@fbincon/statusline-core/dist/src/config/display.js.map +1 -0
  233. package/node_modules/@fbincon/statusline-core/dist/src/config/draft.d.ts +4 -0
  234. package/node_modules/@fbincon/statusline-core/dist/src/config/draft.js +48 -0
  235. package/node_modules/@fbincon/statusline-core/dist/src/config/draft.js.map +1 -0
  236. package/node_modules/@fbincon/statusline-core/dist/src/config/editor-fields.d.ts +8 -0
  237. package/node_modules/@fbincon/statusline-core/dist/src/config/editor-fields.js +104 -0
  238. package/node_modules/@fbincon/statusline-core/dist/src/config/editor-fields.js.map +1 -0
  239. package/node_modules/@fbincon/statusline-core/dist/src/config/formatting.d.ts +11 -0
  240. package/node_modules/@fbincon/statusline-core/dist/src/config/formatting.js +99 -0
  241. package/node_modules/@fbincon/statusline-core/dist/src/config/formatting.js.map +1 -0
  242. package/node_modules/@fbincon/statusline-core/dist/src/config/generated-constants.d.ts +36 -0
  243. package/node_modules/@fbincon/statusline-core/dist/src/config/generated-constants.js +5 -0
  244. package/node_modules/@fbincon/statusline-core/dist/src/config/generated-constants.js.map +1 -0
  245. package/node_modules/@fbincon/statusline-core/dist/src/config/import-review.d.ts +4 -0
  246. package/node_modules/@fbincon/statusline-core/dist/src/config/import-review.js +80 -0
  247. package/node_modules/@fbincon/statusline-core/dist/src/config/import-review.js.map +1 -0
  248. package/node_modules/@fbincon/statusline-core/dist/src/config/instances.d.ts +29 -0
  249. package/node_modules/@fbincon/statusline-core/dist/src/config/instances.js +159 -0
  250. package/node_modules/@fbincon/statusline-core/dist/src/config/instances.js.map +1 -0
  251. package/node_modules/@fbincon/statusline-core/dist/src/config/presets.d.ts +10 -0
  252. package/node_modules/@fbincon/statusline-core/dist/src/config/presets.js +34 -0
  253. package/node_modules/@fbincon/statusline-core/dist/src/config/presets.js.map +1 -0
  254. package/node_modules/@fbincon/statusline-core/dist/src/config/transfer.d.ts +6 -0
  255. package/node_modules/@fbincon/statusline-core/dist/src/config/transfer.js +23 -0
  256. package/node_modules/@fbincon/statusline-core/dist/src/config/transfer.js.map +1 -0
  257. package/node_modules/@fbincon/statusline-core/dist/src/config/validation.d.ts +15 -0
  258. package/node_modules/@fbincon/statusline-core/dist/src/config/validation.js +55 -0
  259. package/node_modules/@fbincon/statusline-core/dist/src/config/validation.js.map +1 -0
  260. package/node_modules/@fbincon/statusline-core/dist/src/contracts/generated-catalog.d.ts +33 -0
  261. package/node_modules/@fbincon/statusline-core/dist/src/contracts/generated-catalog.js +5 -0
  262. package/node_modules/@fbincon/statusline-core/dist/src/contracts/generated-catalog.js.map +1 -0
  263. package/node_modules/@fbincon/statusline-core/dist/src/contracts/runtime.d.ts +18 -0
  264. package/node_modules/@fbincon/statusline-core/dist/src/contracts/runtime.js +3 -0
  265. package/node_modules/@fbincon/statusline-core/dist/src/contracts/runtime.js.map +1 -0
  266. package/node_modules/@fbincon/statusline-core/dist/src/contracts/ui.d.ts +663 -0
  267. package/node_modules/@fbincon/statusline-core/dist/src/contracts/ui.js +23 -0
  268. package/node_modules/@fbincon/statusline-core/dist/src/contracts/ui.js.map +1 -0
  269. package/node_modules/@fbincon/statusline-core/dist/src/editor/appearance.d.ts +5 -0
  270. package/node_modules/@fbincon/statusline-core/dist/src/editor/appearance.js +27 -0
  271. package/node_modules/@fbincon/statusline-core/dist/src/editor/appearance.js.map +1 -0
  272. package/node_modules/@fbincon/statusline-core/dist/src/editor/backend.d.ts +18 -0
  273. package/node_modules/@fbincon/statusline-core/dist/src/editor/backend.js +401 -0
  274. package/node_modules/@fbincon/statusline-core/dist/src/editor/backend.js.map +1 -0
  275. package/node_modules/@fbincon/statusline-core/dist/src/editor/draft.d.ts +73 -0
  276. package/node_modules/@fbincon/statusline-core/dist/src/editor/draft.js +251 -0
  277. package/node_modules/@fbincon/statusline-core/dist/src/editor/draft.js.map +1 -0
  278. package/node_modules/@fbincon/statusline-core/dist/src/editor/forms.d.ts +26 -0
  279. package/node_modules/@fbincon/statusline-core/dist/src/editor/forms.js +146 -0
  280. package/node_modules/@fbincon/statusline-core/dist/src/editor/forms.js.map +1 -0
  281. package/node_modules/@fbincon/statusline-core/dist/src/editor/guidance.d.ts +3 -0
  282. package/node_modules/@fbincon/statusline-core/dist/src/editor/guidance.js +17 -0
  283. package/node_modules/@fbincon/statusline-core/dist/src/editor/guidance.js.map +1 -0
  284. package/node_modules/@fbincon/statusline-core/dist/src/editor/import-review.d.ts +19 -0
  285. package/node_modules/@fbincon/statusline-core/dist/src/editor/import-review.js +53 -0
  286. package/node_modules/@fbincon/statusline-core/dist/src/editor/import-review.js.map +1 -0
  287. package/node_modules/@fbincon/statusline-core/dist/src/editor/instances.d.ts +4 -0
  288. package/node_modules/@fbincon/statusline-core/dist/src/editor/instances.js +36 -0
  289. package/node_modules/@fbincon/statusline-core/dist/src/editor/instances.js.map +1 -0
  290. package/node_modules/@fbincon/statusline-core/dist/src/editor/navigation.d.ts +37 -0
  291. package/node_modules/@fbincon/statusline-core/dist/src/editor/navigation.js +73 -0
  292. package/node_modules/@fbincon/statusline-core/dist/src/editor/navigation.js.map +1 -0
  293. package/node_modules/@fbincon/statusline-core/dist/src/editor/numeric.d.ts +11 -0
  294. package/node_modules/@fbincon/statusline-core/dist/src/editor/numeric.js +27 -0
  295. package/node_modules/@fbincon/statusline-core/dist/src/editor/numeric.js.map +1 -0
  296. package/node_modules/@fbincon/statusline-core/dist/src/editor/search.d.ts +22 -0
  297. package/node_modules/@fbincon/statusline-core/dist/src/editor/search.js +122 -0
  298. package/node_modules/@fbincon/statusline-core/dist/src/editor/search.js.map +1 -0
  299. package/node_modules/@fbincon/statusline-core/dist/src/editor/text.d.ts +2 -0
  300. package/node_modules/@fbincon/statusline-core/dist/src/editor/text.js +30 -0
  301. package/node_modules/@fbincon/statusline-core/dist/src/editor/text.js.map +1 -0
  302. package/node_modules/@fbincon/statusline-core/dist/src/i18n/generated-locales.d.ts +6841 -0
  303. package/node_modules/@fbincon/statusline-core/dist/src/i18n/generated-locales.js +6841 -0
  304. package/node_modules/@fbincon/statusline-core/dist/src/i18n/generated-locales.js.map +1 -0
  305. package/node_modules/@fbincon/statusline-core/dist/src/i18n/messages.d.ts +16 -0
  306. package/node_modules/@fbincon/statusline-core/dist/src/i18n/messages.js +38 -0
  307. package/node_modules/@fbincon/statusline-core/dist/src/i18n/messages.js.map +1 -0
  308. package/node_modules/@fbincon/statusline-core/dist/src/i18n/registry.d.ts +3 -0
  309. package/node_modules/@fbincon/statusline-core/dist/src/i18n/registry.js +4 -0
  310. package/node_modules/@fbincon/statusline-core/dist/src/i18n/registry.js.map +1 -0
  311. package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/en.d.ts +222 -0
  312. package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/en.js +224 -0
  313. package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/en.js.map +1 -0
  314. package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/ja.d.ts +222 -0
  315. package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/ja.js +224 -0
  316. package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/ja.js.map +1 -0
  317. package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/ko.d.ts +222 -0
  318. package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/ko.js +224 -0
  319. package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/ko.js.map +1 -0
  320. package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/zh-CN.d.ts +222 -0
  321. package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/zh-CN.js +224 -0
  322. package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/zh-CN.js.map +1 -0
  323. package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/zh-Hant.d.ts +222 -0
  324. package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/zh-Hant.js +224 -0
  325. package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/zh-Hant.js.map +1 -0
  326. package/node_modules/@fbincon/statusline-core/dist/src/integration/binding.d.ts +9 -0
  327. package/node_modules/@fbincon/statusline-core/dist/src/integration/binding.js +27 -0
  328. package/node_modules/@fbincon/statusline-core/dist/src/integration/binding.js.map +1 -0
  329. package/node_modules/@fbincon/statusline-core/dist/src/json-equality.d.ts +2 -0
  330. package/node_modules/@fbincon/statusline-core/dist/src/json-equality.js +31 -0
  331. package/node_modules/@fbincon/statusline-core/dist/src/json-equality.js.map +1 -0
  332. package/node_modules/@fbincon/statusline-core/dist/src/json-read.d.ts +9 -0
  333. package/node_modules/@fbincon/statusline-core/dist/src/json-read.js +137 -0
  334. package/node_modules/@fbincon/statusline-core/dist/src/json-read.js.map +1 -0
  335. package/node_modules/@fbincon/statusline-core/dist/src/json-text.d.ts +9 -0
  336. package/node_modules/@fbincon/statusline-core/dist/src/json-text.js +56 -0
  337. package/node_modules/@fbincon/statusline-core/dist/src/json-text.js.map +1 -0
  338. package/node_modules/@fbincon/statusline-core/dist/src/json.d.ts +18 -0
  339. package/node_modules/@fbincon/statusline-core/dist/src/json.js +165 -0
  340. package/node_modules/@fbincon/statusline-core/dist/src/json.js.map +1 -0
  341. package/node_modules/@fbincon/statusline-core/dist/src/numbers.d.ts +4 -0
  342. package/node_modules/@fbincon/statusline-core/dist/src/numbers.js +47 -0
  343. package/node_modules/@fbincon/statusline-core/dist/src/numbers.js.map +1 -0
  344. package/node_modules/@fbincon/statusline-core/dist/src/ordered-record.d.ts +21 -0
  345. package/node_modules/@fbincon/statusline-core/dist/src/ordered-record.js +105 -0
  346. package/node_modules/@fbincon/statusline-core/dist/src/ordered-record.js.map +1 -0
  347. package/node_modules/@fbincon/statusline-core/dist/src/release.d.ts +7 -0
  348. package/node_modules/@fbincon/statusline-core/dist/src/release.js +14 -0
  349. package/node_modules/@fbincon/statusline-core/dist/src/release.js.map +1 -0
  350. package/node_modules/@fbincon/statusline-core/dist/src/rendering/appearance.d.ts +10 -0
  351. package/node_modules/@fbincon/statusline-core/dist/src/rendering/appearance.js +73 -0
  352. package/node_modules/@fbincon/statusline-core/dist/src/rendering/appearance.js.map +1 -0
  353. package/node_modules/@fbincon/statusline-core/dist/src/rendering/coercion.d.ts +2 -0
  354. package/node_modules/@fbincon/statusline-core/dist/src/rendering/coercion.js +50 -0
  355. package/node_modules/@fbincon/statusline-core/dist/src/rendering/coercion.js.map +1 -0
  356. package/node_modules/@fbincon/statusline-core/dist/src/rendering/colors.d.ts +3 -0
  357. package/node_modules/@fbincon/statusline-core/dist/src/rendering/colors.js +36 -0
  358. package/node_modules/@fbincon/statusline-core/dist/src/rendering/colors.js.map +1 -0
  359. package/node_modules/@fbincon/statusline-core/dist/src/rendering/components.d.ts +10 -0
  360. package/node_modules/@fbincon/statusline-core/dist/src/rendering/components.js +49 -0
  361. package/node_modules/@fbincon/statusline-core/dist/src/rendering/components.js.map +1 -0
  362. package/node_modules/@fbincon/statusline-core/dist/src/rendering/context.d.ts +36 -0
  363. package/node_modules/@fbincon/statusline-core/dist/src/rendering/context.js +2 -0
  364. package/node_modules/@fbincon/statusline-core/dist/src/rendering/context.js.map +1 -0
  365. package/node_modules/@fbincon/statusline-core/dist/src/rendering/formatters.d.ts +10 -0
  366. package/node_modules/@fbincon/statusline-core/dist/src/rendering/formatters.js +58 -0
  367. package/node_modules/@fbincon/statusline-core/dist/src/rendering/formatters.js.map +1 -0
  368. package/node_modules/@fbincon/statusline-core/dist/src/rendering/git.d.ts +7 -0
  369. package/node_modules/@fbincon/statusline-core/dist/src/rendering/git.js +34 -0
  370. package/node_modules/@fbincon/statusline-core/dist/src/rendering/git.js.map +1 -0
  371. package/node_modules/@fbincon/statusline-core/dist/src/rendering/items.d.ts +49 -0
  372. package/node_modules/@fbincon/statusline-core/dist/src/rendering/items.js +399 -0
  373. package/node_modules/@fbincon/statusline-core/dist/src/rendering/items.js.map +1 -0
  374. package/node_modules/@fbincon/statusline-core/dist/src/rendering/language.d.ts +13 -0
  375. package/node_modules/@fbincon/statusline-core/dist/src/rendering/language.js +36 -0
  376. package/node_modules/@fbincon/statusline-core/dist/src/rendering/language.js.map +1 -0
  377. package/node_modules/@fbincon/statusline-core/dist/src/rendering/layout.d.ts +19 -0
  378. package/node_modules/@fbincon/statusline-core/dist/src/rendering/layout.js +176 -0
  379. package/node_modules/@fbincon/statusline-core/dist/src/rendering/layout.js.map +1 -0
  380. package/node_modules/@fbincon/statusline-core/dist/src/rendering/live.d.ts +4 -0
  381. package/node_modules/@fbincon/statusline-core/dist/src/rendering/live.js +29 -0
  382. package/node_modules/@fbincon/statusline-core/dist/src/rendering/live.js.map +1 -0
  383. package/node_modules/@fbincon/statusline-core/dist/src/rendering/metrics.d.ts +13 -0
  384. package/node_modules/@fbincon/statusline-core/dist/src/rendering/metrics.js +93 -0
  385. package/node_modules/@fbincon/statusline-core/dist/src/rendering/metrics.js.map +1 -0
  386. package/node_modules/@fbincon/statusline-core/dist/src/rendering/numeric-format.d.ts +3 -0
  387. package/node_modules/@fbincon/statusline-core/dist/src/rendering/numeric-format.js +46 -0
  388. package/node_modules/@fbincon/statusline-core/dist/src/rendering/numeric-format.js.map +1 -0
  389. package/node_modules/@fbincon/statusline-core/dist/src/rendering/palette.d.ts +23 -0
  390. package/node_modules/@fbincon/statusline-core/dist/src/rendering/palette.js +9 -0
  391. package/node_modules/@fbincon/statusline-core/dist/src/rendering/palette.js.map +1 -0
  392. package/node_modules/@fbincon/statusline-core/dist/src/rendering/powerline.d.ts +10 -0
  393. package/node_modules/@fbincon/statusline-core/dist/src/rendering/powerline.js +76 -0
  394. package/node_modules/@fbincon/statusline-core/dist/src/rendering/powerline.js.map +1 -0
  395. package/node_modules/@fbincon/statusline-core/dist/src/rendering/preferences.d.ts +14 -0
  396. package/node_modules/@fbincon/statusline-core/dist/src/rendering/preferences.js +98 -0
  397. package/node_modules/@fbincon/statusline-core/dist/src/rendering/preferences.js.map +1 -0
  398. package/node_modules/@fbincon/statusline-core/dist/src/rendering/preview.d.ts +67 -0
  399. package/node_modules/@fbincon/statusline-core/dist/src/rendering/preview.js +36 -0
  400. package/node_modules/@fbincon/statusline-core/dist/src/rendering/preview.js.map +1 -0
  401. package/node_modules/@fbincon/statusline-core/dist/src/rendering/spans.d.ts +8 -0
  402. package/node_modules/@fbincon/statusline-core/dist/src/rendering/spans.js +14 -0
  403. package/node_modules/@fbincon/statusline-core/dist/src/rendering/spans.js.map +1 -0
  404. package/node_modules/@fbincon/statusline-core/dist/src/rendering/styles.d.ts +24 -0
  405. package/node_modules/@fbincon/statusline-core/dist/src/rendering/styles.js +116 -0
  406. package/node_modules/@fbincon/statusline-core/dist/src/rendering/styles.js.map +1 -0
  407. package/node_modules/@fbincon/statusline-core/dist/src/rendering/subagents.d.ts +13 -0
  408. package/node_modules/@fbincon/statusline-core/dist/src/rendering/subagents.js +305 -0
  409. package/node_modules/@fbincon/statusline-core/dist/src/rendering/subagents.js.map +1 -0
  410. package/node_modules/@fbincon/statusline-core/dist/src/rendering/timer.d.ts +8 -0
  411. package/node_modules/@fbincon/statusline-core/dist/src/rendering/timer.js +33 -0
  412. package/node_modules/@fbincon/statusline-core/dist/src/rendering/timer.js.map +1 -0
  413. package/node_modules/@fbincon/statusline-core/dist/src/rendering/visibility.d.ts +4 -0
  414. package/node_modules/@fbincon/statusline-core/dist/src/rendering/visibility.js +52 -0
  415. package/node_modules/@fbincon/statusline-core/dist/src/rendering/visibility.js.map +1 -0
  416. package/node_modules/@fbincon/statusline-core/dist/src/runtime/git.d.ts +9 -0
  417. package/node_modules/@fbincon/statusline-core/dist/src/runtime/git.js +115 -0
  418. package/node_modules/@fbincon/statusline-core/dist/src/runtime/git.js.map +1 -0
  419. package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/bindings.d.ts +4 -0
  420. package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/bindings.js +104 -0
  421. package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/bindings.js.map +1 -0
  422. package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/model.d.ts +27 -0
  423. package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/model.js +196 -0
  424. package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/model.js.map +1 -0
  425. package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/ownership.d.ts +6 -0
  426. package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/ownership.js +45 -0
  427. package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/ownership.js.map +1 -0
  428. package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/reducer.d.ts +5 -0
  429. package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/reducer.js +228 -0
  430. package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/reducer.js.map +1 -0
  431. package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/requests.d.ts +24 -0
  432. package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/requests.js +145 -0
  433. package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/requests.js.map +1 -0
  434. package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/snapshot.d.ts +6 -0
  435. package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/snapshot.js +70 -0
  436. package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/snapshot.js.map +1 -0
  437. package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/state.d.ts +36 -0
  438. package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/state.js +110 -0
  439. package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/state.js.map +1 -0
  440. package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/agents.d.ts +8 -0
  441. package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/agents.js +75 -0
  442. package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/agents.js.map +1 -0
  443. package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/hooks.d.ts +10 -0
  444. package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/hooks.js +121 -0
  445. package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/hooks.js.map +1 -0
  446. package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/model.d.ts +43 -0
  447. package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/model.js +198 -0
  448. package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/model.js.map +1 -0
  449. package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/native.d.ts +6 -0
  450. package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/native.js +192 -0
  451. package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/native.js.map +1 -0
  452. package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/transitions.d.ts +16 -0
  453. package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/transitions.js +245 -0
  454. package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/transitions.js.map +1 -0
  455. package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/view.d.ts +4 -0
  456. package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/view.js +28 -0
  457. package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/view.js.map +1 -0
  458. package/node_modules/@fbincon/statusline-core/dist/src/runtime/transcript.d.ts +26 -0
  459. package/node_modules/@fbincon/statusline-core/dist/src/runtime/transcript.js +183 -0
  460. package/node_modules/@fbincon/statusline-core/dist/src/runtime/transcript.js.map +1 -0
  461. package/node_modules/@fbincon/statusline-core/dist/src/runtime/usage.d.ts +64 -0
  462. package/node_modules/@fbincon/statusline-core/dist/src/runtime/usage.js +263 -0
  463. package/node_modules/@fbincon/statusline-core/dist/src/runtime/usage.js.map +1 -0
  464. package/node_modules/@fbincon/statusline-core/dist/src/runtime/values.d.ts +18 -0
  465. package/node_modules/@fbincon/statusline-core/dist/src/runtime/values.js +103 -0
  466. package/node_modules/@fbincon/statusline-core/dist/src/runtime/values.js.map +1 -0
  467. package/node_modules/@fbincon/statusline-core/dist/src/terminal/key.d.ts +7 -0
  468. package/node_modules/@fbincon/statusline-core/dist/src/terminal/key.js +2 -0
  469. package/node_modules/@fbincon/statusline-core/dist/src/terminal/key.js.map +1 -0
  470. package/node_modules/@fbincon/statusline-core/dist/src/terminal/spans.d.ts +6 -0
  471. package/node_modules/@fbincon/statusline-core/dist/src/terminal/spans.js +50 -0
  472. package/node_modules/@fbincon/statusline-core/dist/src/terminal/spans.js.map +1 -0
  473. package/node_modules/@fbincon/statusline-core/dist/src/timing/sample.d.ts +8 -0
  474. package/node_modules/@fbincon/statusline-core/dist/src/timing/sample.js +13 -0
  475. package/node_modules/@fbincon/statusline-core/dist/src/timing/sample.js.map +1 -0
  476. package/node_modules/@fbincon/statusline-core/dist/src/timing/timer.d.ts +22 -0
  477. package/node_modules/@fbincon/statusline-core/dist/src/timing/timer.js +75 -0
  478. package/node_modules/@fbincon/statusline-core/dist/src/timing/timer.js.map +1 -0
  479. package/node_modules/@fbincon/statusline-core/dist/src/unicode/generated-unicode.d.ts +12 -0
  480. package/node_modules/@fbincon/statusline-core/dist/src/unicode/generated-unicode.js +93 -0
  481. package/node_modules/@fbincon/statusline-core/dist/src/unicode/generated-unicode.js.map +1 -0
  482. package/node_modules/@fbincon/statusline-core/dist/src/unicode/index.d.ts +5 -0
  483. package/node_modules/@fbincon/statusline-core/dist/src/unicode/index.js +178 -0
  484. package/node_modules/@fbincon/statusline-core/dist/src/unicode/index.js.map +1 -0
  485. package/node_modules/@fbincon/statusline-core/package.json +8 -0
  486. package/node_modules/@fbincon/statusline-core/resources/i18n/languages.json +7 -0
  487. package/node_modules/@fbincon/statusline-core/resources/i18n/locales/en.json +1367 -0
  488. package/node_modules/@fbincon/statusline-core/resources/i18n/locales/ja.json +1367 -0
  489. package/node_modules/@fbincon/statusline-core/resources/i18n/locales/ko.json +1367 -0
  490. package/node_modules/@fbincon/statusline-core/resources/i18n/locales/zh-CN.json +1367 -0
  491. package/node_modules/@fbincon/statusline-core/resources/i18n/locales/zh-Hant.json +1367 -0
  492. package/node_modules/@fbincon/statusline-platform/dist/src/architecture.d.ts +15 -0
  493. package/node_modules/@fbincon/statusline-platform/dist/src/architecture.js +22 -0
  494. package/node_modules/@fbincon/statusline-platform/dist/src/architecture.js.map +1 -0
  495. package/node_modules/@fbincon/statusline-platform/dist/src/clocks.d.ts +4 -0
  496. package/node_modules/@fbincon/statusline-platform/dist/src/clocks.js +102 -0
  497. package/node_modules/@fbincon/statusline-platform/dist/src/clocks.js.map +1 -0
  498. package/node_modules/@fbincon/statusline-platform/dist/src/command.d.ts +16 -0
  499. package/node_modules/@fbincon/statusline-platform/dist/src/command.js +18 -0
  500. package/node_modules/@fbincon/statusline-platform/dist/src/command.js.map +1 -0
  501. package/node_modules/@fbincon/statusline-platform/dist/src/commands.d.ts +12 -0
  502. package/node_modules/@fbincon/statusline-platform/dist/src/commands.js +160 -0
  503. package/node_modules/@fbincon/statusline-platform/dist/src/commands.js.map +1 -0
  504. package/node_modules/@fbincon/statusline-platform/dist/src/errors.d.ts +1 -0
  505. package/node_modules/@fbincon/statusline-platform/dist/src/errors.js +19 -0
  506. package/node_modules/@fbincon/statusline-platform/dist/src/errors.js.map +1 -0
  507. package/node_modules/@fbincon/statusline-platform/dist/src/files.d.ts +8 -0
  508. package/node_modules/@fbincon/statusline-platform/dist/src/files.js +164 -0
  509. package/node_modules/@fbincon/statusline-platform/dist/src/files.js.map +1 -0
  510. package/node_modules/@fbincon/statusline-platform/dist/src/hash.d.ts +2 -0
  511. package/node_modules/@fbincon/statusline-platform/dist/src/hash.js +5 -0
  512. package/node_modules/@fbincon/statusline-platform/dist/src/hash.js.map +1 -0
  513. package/node_modules/@fbincon/statusline-platform/dist/src/input.d.ts +2 -0
  514. package/node_modules/@fbincon/statusline-platform/dist/src/input.js +14 -0
  515. package/node_modules/@fbincon/statusline-platform/dist/src/input.js.map +1 -0
  516. package/node_modules/@fbincon/statusline-platform/dist/src/launch.d.ts +12 -0
  517. package/node_modules/@fbincon/statusline-platform/dist/src/launch.js +21 -0
  518. package/node_modules/@fbincon/statusline-platform/dist/src/launch.js.map +1 -0
  519. package/node_modules/@fbincon/statusline-platform/dist/src/line-cursor.d.ts +2 -0
  520. package/node_modules/@fbincon/statusline-platform/dist/src/line-cursor.js +31 -0
  521. package/node_modules/@fbincon/statusline-platform/dist/src/line-cursor.js.map +1 -0
  522. package/node_modules/@fbincon/statusline-platform/dist/src/native.d.ts +15 -0
  523. package/node_modules/@fbincon/statusline-platform/dist/src/native.js +36 -0
  524. package/node_modules/@fbincon/statusline-platform/dist/src/native.js.map +1 -0
  525. package/node_modules/@fbincon/statusline-platform/dist/src/plugin-host.d.ts +17 -0
  526. package/node_modules/@fbincon/statusline-platform/dist/src/plugin-host.js +44 -0
  527. package/node_modules/@fbincon/statusline-platform/dist/src/plugin-host.js.map +1 -0
  528. package/node_modules/@fbincon/statusline-platform/dist/src/presentation.d.ts +4 -0
  529. package/node_modules/@fbincon/statusline-platform/dist/src/presentation.js +48 -0
  530. package/node_modules/@fbincon/statusline-platform/dist/src/presentation.js.map +1 -0
  531. package/node_modules/@fbincon/statusline-platform/dist/src/processes.d.ts +2 -0
  532. package/node_modules/@fbincon/statusline-platform/dist/src/processes.js +67 -0
  533. package/node_modules/@fbincon/statusline-platform/dist/src/processes.js.map +1 -0
  534. package/node_modules/@fbincon/statusline-platform/dist/src/terminal/bridge.d.ts +42 -0
  535. package/node_modules/@fbincon/statusline-platform/dist/src/terminal/bridge.js +180 -0
  536. package/node_modules/@fbincon/statusline-platform/dist/src/terminal/bridge.js.map +1 -0
  537. package/node_modules/@fbincon/statusline-platform/dist/src/terminal/input.d.ts +11 -0
  538. package/node_modules/@fbincon/statusline-platform/dist/src/terminal/input.js +81 -0
  539. package/node_modules/@fbincon/statusline-platform/dist/src/terminal/input.js.map +1 -0
  540. package/node_modules/@fbincon/statusline-platform/dist/src/terminal/launchers.d.ts +32 -0
  541. package/node_modules/@fbincon/statusline-platform/dist/src/terminal/launchers.js +157 -0
  542. package/node_modules/@fbincon/statusline-platform/dist/src/terminal/launchers.js.map +1 -0
  543. package/node_modules/@fbincon/statusline-platform/dist/src/terminal/session.d.ts +18 -0
  544. package/node_modules/@fbincon/statusline-platform/dist/src/terminal/session.js +150 -0
  545. package/node_modules/@fbincon/statusline-platform/dist/src/terminal/session.js.map +1 -0
  546. package/node_modules/@fbincon/statusline-platform/dist/src/terminal/windows-modes.d.ts +6 -0
  547. package/node_modules/@fbincon/statusline-platform/dist/src/terminal/windows-modes.js +39 -0
  548. package/node_modules/@fbincon/statusline-platform/dist/src/terminal/windows-modes.js.map +1 -0
  549. package/node_modules/@fbincon/statusline-platform/dist/src/utf8.d.ts +5 -0
  550. package/node_modules/@fbincon/statusline-platform/dist/src/utf8.js +82 -0
  551. package/node_modules/@fbincon/statusline-platform/dist/src/utf8.js.map +1 -0
  552. package/node_modules/@fbincon/statusline-platform/package.json +8 -0
  553. package/node_modules/@fbincon/statusline-tui/dist/src/drawing.d.ts +16 -0
  554. package/node_modules/@fbincon/statusline-tui/dist/src/drawing.js +213 -0
  555. package/node_modules/@fbincon/statusline-tui/dist/src/drawing.js.map +1 -0
  556. package/node_modules/@fbincon/statusline-tui/dist/src/layout.d.ts +30 -0
  557. package/node_modules/@fbincon/statusline-tui/dist/src/layout.js +34 -0
  558. package/node_modules/@fbincon/statusline-tui/dist/src/layout.js.map +1 -0
  559. package/node_modules/@fbincon/statusline-tui/dist/src/session.d.ts +28 -0
  560. package/node_modules/@fbincon/statusline-tui/dist/src/session.js +126 -0
  561. package/node_modules/@fbincon/statusline-tui/dist/src/session.js.map +1 -0
  562. package/node_modules/@fbincon/statusline-tui/dist/src/state.d.ts +52 -0
  563. package/node_modules/@fbincon/statusline-tui/dist/src/state.js +352 -0
  564. package/node_modules/@fbincon/statusline-tui/dist/src/state.js.map +1 -0
  565. package/node_modules/@fbincon/statusline-tui/package.json +16 -0
  566. package/node_modules/@koromix/koffi-darwin-arm64/README.md +6 -0
  567. package/node_modules/@koromix/koffi-darwin-arm64/darwin_arm64/koffi.node +0 -0
  568. package/node_modules/@koromix/koffi-darwin-arm64/index.js +1 -0
  569. package/node_modules/@koromix/koffi-darwin-arm64/package.json +24 -0
  570. package/node_modules/@koromix/koffi-darwin-x64/README.md +6 -0
  571. package/node_modules/@koromix/koffi-darwin-x64/darwin_x64/koffi.node +0 -0
  572. package/node_modules/@koromix/koffi-darwin-x64/index.js +1 -0
  573. package/node_modules/@koromix/koffi-darwin-x64/package.json +24 -0
  574. package/node_modules/@koromix/koffi-linux-x64/README.md +6 -0
  575. package/node_modules/@koromix/koffi-linux-x64/index.js +198 -0
  576. package/node_modules/@koromix/koffi-linux-x64/linux_x64/koffi.node +0 -0
  577. package/node_modules/@koromix/koffi-linux-x64/musl_x64/koffi.node +0 -0
  578. package/node_modules/@koromix/koffi-linux-x64/package.json +24 -0
  579. package/node_modules/@koromix/koffi-win32-x64/README.md +6 -0
  580. package/node_modules/@koromix/koffi-win32-x64/index.js +1 -0
  581. package/node_modules/@koromix/koffi-win32-x64/package.json +24 -0
  582. package/node_modules/@koromix/koffi-win32-x64/win32_x64/koffi.lib +0 -0
  583. package/node_modules/@koromix/koffi-win32-x64/win32_x64/koffi.node +0 -0
  584. package/node_modules/koffi/LICENSE.txt +22 -0
  585. package/node_modules/koffi/README.md +46 -0
  586. package/node_modules/koffi/index.cjs +1 -0
  587. package/node_modules/koffi/index.d.ts +390 -0
  588. package/node_modules/koffi/index.js +2 -0
  589. package/node_modules/koffi/indirect.cjs +1 -0
  590. package/node_modules/koffi/indirect.js +2 -0
  591. package/node_modules/koffi/package.json +73 -0
  592. package/node_modules/koffi/src/koffi/index.cjs +327 -0
  593. package/node_modules/koffi/src/koffi/index.js +312 -0
  594. package/node_modules/koffi/src/koffi/indirect.cjs +326 -0
  595. package/node_modules/koffi/src/koffi/indirect.js +311 -0
  596. package/node_modules/koffi/src/koffi/src/static.cjs +170 -0
  597. package/node_modules/koffi/src/koffi/src/static.js +173 -0
  598. package/node_modules/lossless-json/LICENSE.md +9 -0
  599. package/node_modules/lossless-json/README.md +549 -0
  600. package/node_modules/lossless-json/lib/esm/LosslessNumber.js +92 -0
  601. package/node_modules/lossless-json/lib/esm/LosslessNumber.js.map +1 -0
  602. package/node_modules/lossless-json/lib/esm/config.js +9 -0
  603. package/node_modules/lossless-json/lib/esm/config.js.map +1 -0
  604. package/node_modules/lossless-json/lib/esm/index.js +9 -0
  605. package/node_modules/lossless-json/lib/esm/index.js.map +1 -0
  606. package/node_modules/lossless-json/lib/esm/numberParsers.js +9 -0
  607. package/node_modules/lossless-json/lib/esm/numberParsers.js.map +1 -0
  608. package/node_modules/lossless-json/lib/esm/package.json +3 -0
  609. package/node_modules/lossless-json/lib/esm/parse.js +346 -0
  610. package/node_modules/lossless-json/lib/esm/parse.js.map +1 -0
  611. package/node_modules/lossless-json/lib/esm/revive.js +57 -0
  612. package/node_modules/lossless-json/lib/esm/revive.js.map +1 -0
  613. package/node_modules/lossless-json/lib/esm/reviveDate.js +10 -0
  614. package/node_modules/lossless-json/lib/esm/reviveDate.js.map +1 -0
  615. package/node_modules/lossless-json/lib/esm/stringify.js +166 -0
  616. package/node_modules/lossless-json/lib/esm/stringify.js.map +1 -0
  617. package/node_modules/lossless-json/lib/esm/types.js +2 -0
  618. package/node_modules/lossless-json/lib/esm/types.js.map +1 -0
  619. package/node_modules/lossless-json/lib/esm/utils.js +236 -0
  620. package/node_modules/lossless-json/lib/esm/utils.js.map +1 -0
  621. package/node_modules/lossless-json/lib/types/LosslessNumber.d.ts +40 -0
  622. package/node_modules/lossless-json/lib/types/LosslessNumber.d.ts.map +1 -0
  623. package/node_modules/lossless-json/lib/types/config.d.ts +13 -0
  624. package/node_modules/lossless-json/lib/types/config.d.ts.map +1 -0
  625. package/node_modules/lossless-json/lib/types/index.d.ts +9 -0
  626. package/node_modules/lossless-json/lib/types/index.d.ts.map +1 -0
  627. package/node_modules/lossless-json/lib/types/numberParsers.d.ts +4 -0
  628. package/node_modules/lossless-json/lib/types/numberParsers.d.ts.map +1 -0
  629. package/node_modules/lossless-json/lib/types/parse.d.ts +33 -0
  630. package/node_modules/lossless-json/lib/types/parse.d.ts.map +1 -0
  631. package/node_modules/lossless-json/lib/types/revive.d.ts +13 -0
  632. package/node_modules/lossless-json/lib/types/revive.d.ts.map +1 -0
  633. package/node_modules/lossless-json/lib/types/reviveDate.d.ts +5 -0
  634. package/node_modules/lossless-json/lib/types/reviveDate.d.ts.map +1 -0
  635. package/node_modules/lossless-json/lib/types/stringify.d.ts +37 -0
  636. package/node_modules/lossless-json/lib/types/stringify.d.ts.map +1 -0
  637. package/node_modules/lossless-json/lib/types/types.d.ts +61 -0
  638. package/node_modules/lossless-json/lib/types/types.d.ts.map +1 -0
  639. package/node_modules/lossless-json/lib/types/utils.d.ts +79 -0
  640. package/node_modules/lossless-json/lib/types/utils.d.ts.map +1 -0
  641. package/node_modules/lossless-json/lib/umd/lossless-json.js +1 -0
  642. package/node_modules/lossless-json/lib/umd/lossless-json.js.map +1 -0
  643. package/node_modules/lossless-json/lib/umd/package.json +3 -0
  644. package/node_modules/lossless-json/package.json +89 -0
  645. package/package.json +57 -4
@@ -0,0 +1,254 @@
1
+ // Generated by tools/generation/resources.ts; do not edit.
2
+ import { t, type Language } from '../i18n/index.ts';
3
+ import { nodes, newInstance, reconcileRows } from './instances.ts';
4
+ import { isDraft } from '../backend.ts';
5
+ import type {
6
+ CatalogItem,
7
+ DescribeResult,
8
+ Draft,
9
+ ReadResult,
10
+ Scope,
11
+ } from '../generated-contracts.ts';
12
+ import { NUMERIC_FIELDS, numericValue, numericDiagnostic } from './numeric.ts';
13
+ import { bestMatch, fields, normalize } from './search.ts';
14
+ import type { Match } from './search.ts';
15
+ import type { ReviewState } from './import-review.ts';
16
+ import type { LocalizedText } from '../i18n/index.ts';
17
+ import type { NumericField } from './numeric.ts';
18
+ export type { NumericField } from './numeric.ts';
19
+
20
+ export type Page = 'main' | 'subagents' | 'settings' | 'layout';
21
+
22
+ /** Copy wire data without sharing editable arrays with the opening snapshot. */
23
+ export function copyDraft(draft: Draft): Draft {
24
+ return JSON.parse(JSON.stringify(draft)) as Draft;
25
+ }
26
+
27
+ export function sameDraft(left: Draft, right: Draft): boolean {
28
+ return JSON.stringify(left) === JSON.stringify(right);
29
+ }
30
+
31
+ /** Pure tool draft. Persistence and host configuration calls live in the hook. */
32
+ export class Editor {
33
+ draft: Draft;
34
+ baseline: ReadResult;
35
+ page: Page = 'main';
36
+ advanced = false;
37
+ adding = false;
38
+ pickerSaved: {search:string;category:string;selected:string} | null = null;
39
+ detail: { scope: Scope; id: string } | null = null;
40
+ guidanceScroll: number | null = null;
41
+ review: ReviewState | null = null;
42
+ preset = 'minimal';
43
+ path = 'statusline.json';
44
+ pendingTransfer: 'import' | 'export' | 'preset' | null = null;
45
+ setting = 'colors';
46
+ activeNumeric: NumericField | null = null;
47
+ selected: Record<Scope, string>;
48
+ order: Record<Scope, string[]>;
49
+ search: Record<Scope, string> = { main: '', subagent: '' };
50
+ category: Record<Scope, string> = { main: 'all', subagent: 'all' };
51
+ buffers: Record<NumericField, string>;
52
+ fieldErrors: Partial<Record<NumericField, string>> = {};
53
+ fieldErrorMessages: Partial<Record<NumericField, LocalizedText>> = {};
54
+
55
+ constructor(
56
+ public readonly description: DescribeResult,
57
+ current: ReadResult,
58
+ ) {
59
+ description.catalog.forEach(item => fields(item));
60
+ this.baseline = { ...current, draft: copyDraft(current.draft) };
61
+ this.draft = copyDraft(current.draft);
62
+ this.order = { main: [], subagent: [] };
63
+ this.selected = { main: '', subagent: '' };
64
+ for (const scope of ['main', 'subagent'] as const) {
65
+ this.order[scope] = nodes(this.draft,scope).map(i=>i.id);
66
+ this.selected[scope] = this.order[scope][0] || '';
67
+ }
68
+ this.buffers = {
69
+ padding: String(this.draft.host.padding),
70
+ refresh_interval: String(this.draft.host.refresh_interval),
71
+ };
72
+ }
73
+
74
+ replaceDraft(draft: Draft): void {
75
+ this.draft = copyDraft(draft);
76
+ for (const scope of ['main', 'subagent'] as const) {
77
+ this.order[scope] = nodes(this.draft,scope).map(i=>i.id);
78
+ if (!this.order[scope].includes(this.selected[scope])) this.selected[scope] = this.order[scope][0] || '';
79
+ }
80
+ this.buffers = { padding: String(draft.host.padding), refresh_interval: String(draft.host.refresh_interval) };
81
+ this.fieldErrors = {};
82
+ this.fieldErrorMessages = {};
83
+ this.activeNumeric = null;
84
+ this.detail = null;
85
+ this.guidanceScroll = null;
86
+ this.review = null;
87
+ }
88
+
89
+ get modified(): boolean {
90
+ return (
91
+ !sameDraft(this.draft, this.baseline.draft) ||
92
+ this.buffers.padding !== String(this.draft.host.padding) ||
93
+ this.buffers.refresh_interval !== String(this.draft.host.refresh_interval)
94
+ );
95
+ }
96
+
97
+ catalog(scope: Scope): CatalogItem[] {
98
+ return this.description.catalog.filter((item) => item.scope === scope);
99
+ }
100
+
101
+ items(scope: Scope): string[] {
102
+ return nodes(this.draft,scope).filter(i=>i.enabled).map(i=>i.id);
103
+ }
104
+
105
+ instance(scope: Scope, id: string) { return nodes(this.draft,scope).find(i=>i.id===id); }
106
+ definition(scope: Scope, id: string): CatalogItem | undefined {
107
+ return this.catalog(scope).find(i=>i.id===(this.instance(scope,id)?.type_id ?? id));
108
+ }
109
+
110
+ instanceLabel(scope:Scope,id:string,language:Language='en'):string {
111
+ const node=this.instance(scope,id),type=node?.type_id??id;
112
+ const peers=nodes(this.draft,scope).filter(i=>i.type_id===type);
113
+ return (node?.options.label || (type==='text'?node?.text:null) || t(`items.${scope}.${type}.label`,language))+
114
+ (node&&peers.length>1?` (${peers.indexOf(node)+1})`:'');
115
+ }
116
+
117
+ visible(scope: Scope): CatalogItem[] { return this.matches(scope).map(result => result.item); }
118
+
119
+ matches(scope: Scope): {item: CatalogItem & {type_id?:string;custom_label?:string|null;ordinal?:number}; match: Match}[] {
120
+ const catalog = new Map(this.catalog(scope).map(item=>[item.id as string,item]));
121
+ const order = this.adding ? [...catalog.keys()] : this.order[scope];
122
+ return order.flatMap(id=> {
123
+ const node = this.adding ? undefined : this.instance(scope,id);
124
+ const definition = catalog.get(node?.type_id ?? id);
125
+ if (!definition || (this.category[scope] !== 'all' && definition.group !== this.category[scope])) return [];
126
+ const peers = node ? nodes(this.draft,scope).filter(i=>i.type_id===node.type_id) : [];
127
+ const item = {...definition,id,type_id:definition.id,custom_label:node?.options.label || (node?.type_id==='text'?node.text:null),ordinal:peers.length>1?peers.indexOf(node!)+1:undefined};
128
+ const match = normalize(this.search[scope]).characters.length
129
+ ? bestMatch(fields(definition,item.custom_label),this.search[scope])
130
+ : {rank:5,positions:[],text:id,field:'id'};
131
+ return match ? [{item,match}] : [];
132
+ }).sort((a,b)=>a.match.rank-b.match.rank);
133
+ }
134
+
135
+ openPicker(scope: Scope): void {
136
+ this.pickerSaved={search:this.search[scope],category:this.category[scope],selected:this.selected[scope]};
137
+ this.adding=true; this.search[scope]='';this.category[scope]='all';this.selected[scope]=this.catalog(scope)[0]?.id ?? '';
138
+ }
139
+ closePicker(scope: Scope): void {
140
+ if(this.pickerSaved){this.search[scope]=this.pickerSaved.search;this.category[scope]=this.pickerSaved.category;this.selected[scope]=this.pickerSaved.selected;}
141
+ this.adding=false;this.pickerSaved=null;
142
+ }
143
+ instanceAction(scope: Scope, action:'add'|'copy'|'remove', typeId?:string): boolean {
144
+ const draft=copyDraft(this.draft), list=nodes(draft,scope);
145
+ const selected=this.adding ? this.pickerSaved?.selected : this.selected[scope];
146
+ const index=list.findIndex(i=>i.id===selected);
147
+ let next=selected ?? '';
148
+ if(action==='remove'){
149
+ if(index<0)return false;
150
+ list.splice(index,1);next=list[Math.min(index,list.length-1)]?.id??'';
151
+ }else{
152
+ if(action==='copy'&&index<0)return false;
153
+ const node=newInstance(typeId??list[index]!.type_id,list,action==='copy'?list[index]:undefined);
154
+ list.splice(index<0?list.length:index+1,0,node);next=node.id;
155
+ }
156
+ if(scope==='main')reconcileRows(draft);
157
+ if(!isDraft(draft))return false;
158
+ if(this.adding){this.closePicker(scope);this.search[scope]='';this.category[scope]='all';}
159
+ this.draft=draft;this.order[scope]=list.map(i=>i.id);this.selected[scope]=next;
160
+ return true;
161
+ }
162
+
163
+ categories(scope: Scope): string[] {
164
+ return ['all', ...new Set(this.catalog(scope).map(item => item.group))];
165
+ }
166
+
167
+ filtered(scope: Scope): boolean {
168
+ return this.category[scope] !== 'all' || normalize(this.search[scope]).characters.length > 0;
169
+ }
170
+
171
+ chooseCategory(scope: Scope, category: string): void {
172
+ if (!this.categories(scope).includes(category)) return;
173
+ this.category[scope] = category;
174
+ this.filter(scope, this.search[scope]);
175
+ }
176
+
177
+ filter(scope: Scope, value: string): void {
178
+ this.search[scope] = value;
179
+ const matches = this.matches(scope), selected = matches.find(result => result.item.id === this.selected[scope]);
180
+ if (!selected || selected.match.rank > matches[0]!.match.rank) {
181
+ this.selected[scope] = matches[0]?.item.id || '';
182
+ }
183
+ }
184
+
185
+ toggle(scope: Scope, id: string): boolean {
186
+ if(this.adding)return this.instanceAction(scope,'add',id);
187
+ const draft=copyDraft(this.draft),node=nodes(draft,scope).find(i=>i.id===id);
188
+ if(!node)return false;
189
+ node.enabled=!node.enabled;
190
+ if(!isDraft(draft))return false;
191
+ this.draft=draft;return true;
192
+ }
193
+
194
+ move(scope: Scope, delta: -1 | 1): boolean {
195
+ if (this.adding || this.filtered(scope)) return false;
196
+ const visible = this.visible(scope).map((item) => item.id as string);
197
+ const id = this.selected[scope];
198
+ const index = visible.indexOf(id);
199
+ const target = visible[index + delta];
200
+ if (index < 0 || !target) return false;
201
+ const draft = copyDraft(this.draft);
202
+ const ordered = nodes(draft, scope);
203
+ const sourceIndex = ordered.findIndex(node => node.id === id);
204
+ const [moving] = ordered.splice(sourceIndex, 1);
205
+ ordered.splice(ordered.findIndex(node => node.id === target) + (delta > 0 ? 1 : 0), 0, moving!);
206
+ if (scope === 'main') reconcileRows(draft);
207
+ if (!isDraft(draft)) return false;
208
+ this.draft = draft;
209
+ this.order[scope] = ordered.map(node => node.id);
210
+ return true;
211
+ }
212
+
213
+ setBuffer(field: NumericField, value: string): void {
214
+ this.activeNumeric = field;
215
+ this.buffers[field] = value;
216
+ delete this.fieldErrors[field];
217
+ delete this.fieldErrorMessages[field];
218
+ }
219
+
220
+ cancelNumeric(field?: NumericField): void {
221
+ for (const key of field ? [field] : NUMERIC_FIELDS) {
222
+ this.buffers[key] = String(this.draft.host[key]);
223
+ delete this.fieldErrors[key];
224
+ delete this.fieldErrorMessages[key];
225
+ }
226
+ if (!field || this.activeNumeric === field) this.activeNumeric = null;
227
+ }
228
+
229
+ acceptNumeric(field?: NumericField): boolean {
230
+ const values: Partial<Record<NumericField, number | 'event'>> = {};
231
+ const fields = field ? [field] : NUMERIC_FIELDS;
232
+ for (const key of fields) {
233
+ delete this.fieldErrors[key];
234
+ delete this.fieldErrorMessages[key];
235
+ const parsed = numericValue(this.description, key, this.buffers[key]);
236
+ if (parsed.error !== undefined) { this.fieldErrors[key] = parsed.error; this.fieldErrorMessages[key] = numericDiagnostic(this.description, key); }
237
+ else values[key] = parsed.value;
238
+ }
239
+ if (fields.some((key) => this.fieldErrors[key])) return false;
240
+ if (values.padding !== undefined)
241
+ this.draft.host.padding = values.padding as number;
242
+ if (values.refresh_interval !== undefined)
243
+ this.draft.host.refresh_interval = values.refresh_interval;
244
+ this.cancelNumeric(field);
245
+ return true;
246
+ }
247
+
248
+ committed(current: ReadResult): void {
249
+ this.baseline = { ...current, draft: copyDraft(current.draft) };
250
+ this.draft = copyDraft(current.draft);
251
+ this.cancelNumeric();
252
+ }
253
+
254
+ }
@@ -0,0 +1,167 @@
1
+ // Generated by tools/generation/resources.ts; do not edit.
2
+ import { nodes } from './instances.ts';
3
+ import { text as localizedText, type Language, type LocalizedText } from '../i18n/index.ts';
4
+ /** Canonical descriptors drive tool forms in both editors. */
5
+ import { ITEM_DEFAULTS } from '../generated-contracts.ts';
6
+ import { itemFields, normalizeColor } from './appearance.ts';
7
+ import { isDraft } from '../backend.ts';
8
+ import { copyDraft } from './draft.ts';
9
+ import type { Draft, EditorField } from '../generated-contracts.ts';
10
+ import type { Editor } from './draft.ts';
11
+ export interface FormView {
12
+ editor: Editor | null;
13
+ language?: Language;
14
+ message: string;
15
+ localized?: {
16
+ message?: LocalizedText;
17
+ };
18
+ }
19
+ export interface SettingRow {
20
+ key: string;
21
+ label: string;
22
+ group: string;
23
+ value: string;
24
+ editable: boolean;
25
+ }
26
+ function setMessage(view: FormView, slot: 'message', value: LocalizedText): void { view.message = value.fallback; (view.localized ??= {}).message = value; }
27
+ export function fieldMessage(row: SettingRow, view: FormView) {
28
+ const key = row.key;
29
+ if (key.startsWith('field:'))
30
+ return localizedText('fields.global.' + key.slice(6) + '.label');
31
+ if (key.startsWith('item:'))
32
+ return localizedText('fields.item.' + key.slice(5) + '.label');
33
+ if (key.startsWith('fit:')) {
34
+ const [, id, field] = key.split(':');
35
+ return localizedText('native.fitting_label', { item: view.editor!.instanceLabel('main', id!, view.language), field: localizedText('fields.item.' + field + '.label') });
36
+ }
37
+ if (key.startsWith('break:'))
38
+ return localizedText('layout.break_before', { item: view.editor!.instanceLabel('main', key.slice(6), view.language) });
39
+ return localizedText('native.settings.' + key);
40
+ }
41
+ export interface FormRow extends SettingRow {
42
+ spec: EditorField;
43
+ valueRaw: unknown;
44
+ }
45
+ function read(data: unknown, path: string): unknown {
46
+ return path.split('.').reduce((v, key) => (v as Record<string, unknown>)[key], data);
47
+ }
48
+ function write(data: unknown, path: string, value: unknown): void {
49
+ const parts = path.split('.');
50
+ const key = parts.pop()!;
51
+ const target = parts.reduce((v, part) => (v as Record<string, unknown>)[part], data);
52
+ (target as Record<string, unknown>)[key] = value;
53
+ }
54
+ function format(raw: unknown): string {
55
+ return raw === null ? 'inherit' : typeof raw === 'boolean' ? raw ? 'on' : 'off' : String(raw);
56
+ }
57
+ function row(spec: EditorField, key: string, valueRaw: unknown): FormRow {
58
+ return { ...spec, spec, key, valueRaw, value: format(valueRaw), editable: true };
59
+ }
60
+ export function formRows(view: FormView): FormRow[] {
61
+ const e = view.editor!;
62
+ const d = e.draft.display;
63
+ if (e.detail) {
64
+ const node = e.instance(e.detail.scope, e.detail.id)!;
65
+ const options = node.options;
66
+ return itemFields(e.description.editor_fields.item!, e.detail.scope, node.type_id).map((spec) => row(spec, 'item:' + spec.key, spec.key === 'text' ? node.text : spec.key in e.description.formatting_options ? options.formatting[spec.key] ?? 'inherit' :
67
+ options[spec.key as keyof typeof options] ?? ITEM_DEFAULTS[spec.key as keyof typeof ITEM_DEFAULTS]))
68
+ .sort((a, b) => ['Item format', 'Conditional visibility', 'Item colors', 'Item fitting'].indexOf(a.group) - ['Item format', 'Conditional visibility', 'Item colors', 'Item fitting'].indexOf(b.group));
69
+ }
70
+ if (e.page === 'layout') {
71
+ const result = [row({ key: 'layout.mode', label: 'Layout mode', group: 'Layout', kind: 'choice', choices: ['auto', 'explicit'], minimum: 0, maximum: 0, nullable: false }, 'layout.mode', d.layout.mode)];
72
+ const starts = new Set(d.layout.rows.slice(1).map((r) => r[0]));
73
+ for (const id of d.instances.map(i => i.id)) {
74
+ const label = e.definition('main', id)!.label;
75
+ if (id !== d.instances[0]?.id)
76
+ result.push(row({ key: 'break:' + id, label: 'New row before ' + label, group: 'Row boundaries', kind: 'boolean', choices: [], minimum: 0, maximum: 0, nullable: false }, 'break:' + id, starts.has(id)));
77
+ }
78
+ for (const id of d.instances.filter(i => i.type_id !== 'spacer').map(i => i.id)) {
79
+ const label = e.definition('main', id)!.label;
80
+ for (const name of ['priority', 'max_width']) {
81
+ const spec = e.description.editor_fields.item!.find((s) => s.key === name)!;
82
+ result.push(row({ ...spec, label: label + ' ' + spec.label, group: 'Item fitting' }, 'fit:' + id + ':' + name, e.instance('main', id)?.options[name as 'priority' | 'max_width'] ?? (name === 'priority' ? 50 : null)));
83
+ }
84
+ }
85
+ return result;
86
+ }
87
+ return e.description.editor_fields.global!.map((spec) => row(spec, 'field:' + spec.key, read(d, spec.key)));
88
+ }
89
+ function options(draft: Draft, scope: 'main' | 'subagent', id: string) {
90
+ return nodes(draft, scope).find(i => i.id === id)!.options;
91
+ }
92
+ export function setFormValue(view: FormView, current: FormRow, raw: string | boolean): boolean {
93
+ const e = view.editor!;
94
+ const spec = current.spec;
95
+ let value: unknown = raw;
96
+ if (spec.kind === 'integer') {
97
+ value = spec.nullable && (raw === 'inherit' || raw === 'none') ? null :
98
+ typeof raw === 'string' && /^\d+$/.test(raw) ? Number(raw) : NaN;
99
+ if (value !== null && (!Number.isInteger(value) || Number(value) < spec.minimum || Number(value) > spec.maximum)) {
100
+ setMessage(view, "message", localizedText("native.lib.client.forms.enter", { label: fieldMessage(current, view), minimum: spec.minimum, maximum: spec.maximum, value3: (spec.nullable ? localizedText("native.lib.client.forms.or_none") : localizedText("native.lib.client.forms.detail")) }));
101
+ return false;
102
+ }
103
+ }
104
+ else if (spec.kind === 'text')
105
+ value = spec.nullable && raw === 'inherit' ? null : raw;
106
+ else if (spec.kind === 'choice' && !spec.choices.includes(String(raw)))
107
+ return false;
108
+ if (spec.key === "foreground" || spec.key === "background")
109
+ value = normalizeColor(value);
110
+ const draft = copyDraft(e.draft);
111
+ if (current.key === 'layout.mode') {
112
+ draft.display.layout = { mode: value as 'auto' | 'explicit', rows: value === 'explicit' && draft.display.instances.length ? [draft.display.instances.map(i => i.id)] : [] };
113
+ }
114
+ else if (current.key.startsWith('break:')) {
115
+ const starts = new Set(draft.display.layout.rows.slice(1).map((r) => r[0]));
116
+ const id = current.key.slice(6) as string;
117
+ if (value)
118
+ starts.add(id);
119
+ else
120
+ starts.delete(id);
121
+ const rows: typeof draft.display.layout.rows = [];
122
+ for (const item of draft.display.instances.map(i => i.id)) {
123
+ if (!rows.length || starts.has(item))
124
+ rows.push([]);
125
+ rows[rows.length - 1]!.push(item);
126
+ }
127
+ draft.display.layout = { mode: 'explicit', rows };
128
+ }
129
+ else if (current.key.startsWith('fit:')) {
130
+ const [, id, key] = current.key.split(':');
131
+ (options(draft, 'main', id!) as unknown as Record<string, unknown>)[key!] = value;
132
+ }
133
+ else if (e.detail) {
134
+ const option = options(draft, e.detail.scope, e.detail.id);
135
+ if (spec.key === "text") {
136
+ nodes(draft, e.detail.scope).find(i => i.id === e.detail!.id)!.text = String(value);
137
+ }
138
+ else if (spec.key in e.description.formatting_options) {
139
+ if (value === 'inherit')
140
+ delete option.formatting[spec.key];
141
+ else
142
+ option.formatting[spec.key] = String(value);
143
+ }
144
+ else
145
+ (option as unknown as Record<string, unknown>)[spec.key] = value;
146
+ }
147
+ else
148
+ write(draft.display, spec.key, value);
149
+ if (!isDraft(draft)) {
150
+ setMessage(view, "message", localizedText("native.lib.client.forms.invalid_value_check_thresholds_text_and_width_constraints"));
151
+ return false;
152
+ }
153
+ e.draft = draft;
154
+ return true;
155
+ }
156
+ export function adjustForm(view: FormView, current: FormRow, delta: -1 | 1): void {
157
+ const spec = current.spec;
158
+ if (spec.kind === 'boolean')
159
+ setFormValue(view, current, !current.valueRaw);
160
+ else if (spec.kind === 'choice') {
161
+ const index = spec.choices.indexOf(String(current.valueRaw));
162
+ setFormValue(view, current, spec.choices[(index + delta + spec.choices.length) % spec.choices.length]!);
163
+ }
164
+ else if (spec.kind === 'integer') {
165
+ setFormValue(view, current, String(Math.max(spec.minimum, Math.min(spec.maximum, Number(current.valueRaw ?? spec.minimum) + delta))));
166
+ }
167
+ }
@@ -0,0 +1,20 @@
1
+ // Generated by tools/generation/resources.ts; do not edit.
2
+ import type { CatalogItem } from '../generated-contracts.ts';
3
+ import type { Language } from '../i18n/index.ts';
4
+ import { t } from '../i18n/index.ts';
5
+ import { wrapText } from '../../ui/text.ts';
6
+
7
+ export function guidanceLines(item: CatalogItem, language: Language, width: number): string[] {
8
+ const guide = item.guidance;
9
+ const tr = (key: string, params: Record<string, unknown> = {}) => t('guidance.' + key, language, params);
10
+ return wrapText([
11
+ t(`items.${item.scope}.${item.id}.label`, language) + ` (${item.scope}:${item.id})`,
12
+ tr('static'), '', tr('scope', {value:tr('scopes.' + guide.measurement_scope)}),
13
+ tr('sources', {value: guide.source_kinds.map(source => tr('sources.' + source)).join(', ')}),
14
+ tr('fields', {value: item.sources.join(', ')}),
15
+ item.minimum_version ? tr('version', {value:item.minimum_version}) : tr('version_unknown'),
16
+ '', tr('requirements'), ...guide.requirements.map(requirement => tr('requirements.' + requirement)),
17
+ '', tr('reasons'), ...item.unavailable_reasons.map(reason => tr('reasons.' + reason)),
18
+ '', tr('setup'), ...guide.setup,
19
+ ], width);
20
+ }
@@ -0,0 +1,55 @@
1
+ // Generated by tools/generation/resources.ts; do not edit.
2
+ import type { ImportReviewResult, Scope } from '../generated-contracts.ts';
3
+ import type { Language } from '../i18n/index.ts';
4
+ import { renderMessage, t } from '../i18n/index.ts';
5
+ import { wrapText } from '../../ui/text.ts';
6
+
7
+ export const REVIEW_SECTIONS = ['main','subagent','formatting','layout','language','host'] as const;
8
+ export interface ReviewState {
9
+ result: ImportReviewResult;
10
+ selected: string;
11
+ expanded: string[];
12
+ scroll: number;
13
+ previewScope: Scope;
14
+ }
15
+ export interface ReviewRow { text: string; section: string; heading: boolean }
16
+ export function sections(review: ReviewState): string[] {
17
+ return REVIEW_SECTIONS.filter(section => review.result.changes.some(change => change.section === section));
18
+ }
19
+ export function createReview(result: ImportReviewResult): ReviewState {
20
+ const review: ReviewState = {result, selected:'', expanded:[], scroll:0, previewScope:'main'};
21
+ review.selected = sections(review)[0] ?? '';
22
+ return review;
23
+ }
24
+ export function reviewRows(review: ReviewState, language: Language, width: number): ReviewRow[] {
25
+ const rows: ReviewRow[] = [];
26
+ for (const section of sections(review)) {
27
+ const changes = review.result.changes.filter(change => change.section === section);
28
+ rows.push({section, heading:true, text:`${review.selected === section ? '› ' : ' '}${review.expanded.includes(section) ? '[-]' : '[+]'} ${t('review.sections.' + section, language)} (${changes.length})`});
29
+ if (review.expanded.includes(section)) for (const change of changes) {
30
+ const paragraphs = [renderMessage(change.label, language),
31
+ t('review.before', language, {value:JSON.stringify(change.before)}),
32
+ t('review.after', language, {value:JSON.stringify(change.after)})];
33
+ rows.push(...wrapText(paragraphs, width).map(text => ({text, section, heading:false})));
34
+ }
35
+ }
36
+ return rows.length ? rows : [{text:t('review.empty', language),section:'',heading:false}];
37
+ }
38
+ export function navigateReview(review: ReviewState, key: string, language: Language, width: number, capacity: number): void {
39
+ const groups = sections(review);
40
+ let follow = false;
41
+ if (key === 'up' || key === 'down') {
42
+ review.selected = groups[Math.max(0, Math.min(groups.length - 1, groups.indexOf(review.selected) + (key === 'up' ? -1 : 1)))] ?? '';
43
+ follow = true;
44
+ } else if (key === 'return' && review.selected) {
45
+ review.expanded = review.expanded.includes(review.selected) ? review.expanded.filter(group => group !== review.selected) : [...review.expanded, review.selected];
46
+ follow = true;
47
+ } else if (key === 'tab') review.previewScope = review.previewScope === 'main' ? 'subagent' : 'main';
48
+ else if (key === 'pageup') review.scroll -= capacity;
49
+ else if (key === 'pagedown') review.scroll += capacity;
50
+ else if (key === 'home') review.scroll = 0;
51
+ else if (key === 'end') review.scroll = Number.MAX_SAFE_INTEGER;
52
+ const rows = reviewRows(review, language, width);
53
+ if (follow) review.scroll = Math.max(0, rows.findIndex(row => row.heading && row.section === review.selected));
54
+ review.scroll = Math.max(0, Math.min(Math.max(0, rows.length - capacity), review.scroll));
55
+ }
@@ -0,0 +1,30 @@
1
+ // Generated by tools/generation/resources.ts; do not edit.
2
+ /** Pure instance identity/order helpers; Python remains the persisted validator. */
3
+ import { ITEM_DEFAULTS } from '../generated-contracts.ts';
4
+ import type { Draft, InstanceDraft, Scope } from '../generated-contracts.ts';
5
+
6
+ let serial = 0;
7
+ export function nodes(draft: Draft, scope: Scope): InstanceDraft[] {
8
+ return scope === 'main' ? draft.display.instances : draft.display.subagents.instances;
9
+ }
10
+ export function newInstance(type_id: string, existing: InstanceDraft[], copy?: InstanceDraft): InstanceDraft {
11
+ let id: string;
12
+ do { id = `i-${Date.now().toString(36)}-${(++serial).toString(36)}-${Math.random().toString(36).slice(2,14)}`; }
13
+ while (existing.some(i=>i.id===id));
14
+ return copy ? {...JSON.parse(JSON.stringify(copy)),id} : {
15
+ id,type_id,enabled:true,text:type_id==='text'?'':null,
16
+ options:{...ITEM_DEFAULTS,visibility:'always',formatting:{}},
17
+ };
18
+ }
19
+ export function reconcileRows(draft: Draft): void {
20
+ const layout = draft.display.layout;
21
+ if (layout.mode !== 'explicit') return;
22
+ const ids=draft.display.instances.map(i=>i.id);
23
+ if(!layout.rows.length){layout.rows=ids.length?[ids]:[];return;}
24
+ const membership=new Map(layout.rows.flatMap((row,n)=>row.map(id=>[id,n] as const)));
25
+ const sizes=layout.rows.map(()=>0);
26
+ let current=ids.map(id=>membership.get(id)).find(n=>n!==undefined)??0;
27
+ for(const id of ids){current=membership.get(id)??current;sizes[current]=sizes[current]!+1;}
28
+ let offset=0;
29
+ layout.rows=sizes.filter(n=>n>0).map(size=>{const row=ids.slice(offset,offset+size);offset+=size;return row;});
30
+ }
@@ -0,0 +1,98 @@
1
+ // Generated by tools/generation/resources.ts; do not edit.
2
+ export const SETTING_KEYS = [
3
+ 'colors',
4
+ 'palette',
5
+ 'preview-background',
6
+ 'directory-style',
7
+ 'separator-style',
8
+ 'padding',
9
+ 'refresh_interval',
10
+ 'vim-indicator',
11
+ 'scope-labels',
12
+ 'settings-subagent-statusline',
13
+ ] as const;
14
+
15
+ export function settingsKeys(advanced: boolean): string[] {
16
+ return [...SETTING_KEYS, ...(advanced ? ['host-theme', 'host-verbose'] : [])];
17
+ }
18
+
19
+ export function itemKey(scope: string, id: string): string {
20
+ return `item-${scope}:${id}`;
21
+ }
22
+
23
+ export function pageWindow(
24
+ keys: readonly string[],
25
+ selected: string,
26
+ capacity: number,
27
+ ) {
28
+ const size = Math.max(1, capacity);
29
+ const index = Math.max(0, keys.indexOf(selected));
30
+ const start = Math.floor(index / size) * size;
31
+ return {
32
+ start,
33
+ end: Math.min(keys.length, start + size),
34
+ size,
35
+ page: Math.floor(start / size) + 1,
36
+ pages: Math.max(1, Math.ceil(keys.length / size)),
37
+ };
38
+ }
39
+
40
+ export function pageSelection(
41
+ keys: readonly string[],
42
+ selected: string,
43
+ capacity: number,
44
+ delta: -1 | 1,
45
+ ): string {
46
+ const window = pageWindow(keys, selected, capacity);
47
+ const page = Math.max(0, Math.min(window.pages - 1, window.page - 1 + delta));
48
+ const offset = Math.max(0, keys.indexOf(selected)) - window.start;
49
+ return keys[Math.min(keys.length - 1, page * window.size + offset)] || '';
50
+ }
51
+
52
+ interface GroupedRow {
53
+ key: string;
54
+ group: string;
55
+ }
56
+
57
+ export interface FormPage {
58
+ start: number;
59
+ end: number;
60
+ lines: { group: string; index: number | null }[];
61
+ }
62
+
63
+ /** Pack actual field/header rows; a heading always stays with its first field. */
64
+ export function formPages(rows: readonly GroupedRow[], height: number): FormPage[] {
65
+ const limit = Math.max(1, height);
66
+ const pages: FormPage[] = [];
67
+ let index = 0;
68
+ while (index < rows.length) {
69
+ const page: FormPage = { start: index, end: index, lines: [] };
70
+ let group: string | null = null;
71
+ while (index < rows.length) {
72
+ const row = rows[index]!;
73
+ const heading = limit > 1 && row.group !== group;
74
+ if (page.lines.length + 1 + Number(heading) > limit) break;
75
+ if (heading) page.lines.push({ group: row.group, index: null });
76
+ page.lines.push({ group: row.group, index });
77
+ group = row.group;
78
+ page.end = ++index;
79
+ }
80
+ pages.push(page);
81
+ }
82
+ return pages.length ? pages : [{ start: 0, end: 0, lines: [] }];
83
+ }
84
+
85
+ export function formWindow(rows: readonly GroupedRow[], selected: string, height: number) {
86
+ const pages = formPages(rows, height);
87
+ const index = Math.max(0, rows.findIndex((row) => row.key === selected));
88
+ const page = Math.max(0, pages.findIndex((p) => index >= p.start && index < p.end));
89
+ return { ...pages[page]!, page: page + 1, pages: pages.length };
90
+ }
91
+
92
+ export function formSelection(rows: readonly GroupedRow[], selected: string, height: number, delta: -1 | 1): string {
93
+ const pages = formPages(rows, height);
94
+ const window = formWindow(rows, selected, height);
95
+ const target = pages[Math.max(0, Math.min(pages.length - 1, window.page - 1 + delta))]!;
96
+ const offset = Math.max(0, rows.findIndex((row) => row.key === selected)) - window.start;
97
+ return rows[Math.min(target.end - 1, target.start + offset)]?.key ?? '';
98
+ }
@@ -0,0 +1,42 @@
1
+ // Generated by tools/generation/resources.ts; do not edit.
2
+ import type { DescribeResult } from '../generated-contracts.ts';
3
+ import { text as message } from '../i18n/index.ts';
4
+
5
+ export function numericDiagnostic(description: DescribeResult, field: NumericField) {
6
+ const range = field === 'padding' ? description.options.padding : description.options['refresh-interval'];
7
+ return message(field === 'refresh_interval' ? 'native.numeric.event' : 'native.numeric.number',
8
+ {minimum: range.minimum, maximum: range.maximum});
9
+ }
10
+
11
+ export type NumericField = 'padding' | 'refresh_interval';
12
+ export const NUMERIC_FIELDS: readonly NumericField[] = [
13
+ 'padding',
14
+ 'refresh_interval',
15
+ ];
16
+
17
+ export function numericValue(
18
+ description: DescribeResult,
19
+ field: NumericField,
20
+ input: string,
21
+ ):
22
+ | { value: number | 'event'; error?: never }
23
+ | { error: string; value?: never } {
24
+ const text = input.trim();
25
+ const range =
26
+ field === 'padding'
27
+ ? description.options.padding
28
+ : description.options['refresh-interval'];
29
+ if (field === 'refresh_interval' && text === 'event')
30
+ return { value: 'event' };
31
+ if (
32
+ /^\d+$/.test(text) &&
33
+ Number.isSafeInteger(Number(text)) &&
34
+ Number(text) >= range.minimum &&
35
+ Number(text) <= range.maximum
36
+ ) {
37
+ return { value: Number(text) };
38
+ }
39
+ return {
40
+ error: numericDiagnostic(description, field).fallback,
41
+ };
42
+ }