@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,227 @@
1
+ import { dirname, join, resolve, extname } from 'node:path';
2
+ import { object, own, int, string, truth, dictionary } from '@fbincon/statusline-core/runtime/values';
3
+ import * as usage from '@fbincon/statusline-core/runtime/usage';
4
+ import { applyTurnMetadata, TurnAccumulator } from '@fbincon/statusline-core/runtime/transcript';
5
+ import { equalSettings } from '@fbincon/statusline-core/json-equality';
6
+ import { divideIntegers, fixed } from '@fbincon/statusline-core/numbers';
7
+ import { scalarCompare } from '@fbincon/statusline-core/json';
8
+ import { sha256 } from '@fbincon/statusline-platform/hash';
9
+ import { runtimeIO, visitTranscript } from './io.js';
10
+ import { TaskService } from './tasks/service.js';
11
+ import { readDataJson, dumpDataJson } from './json-data.js';
12
+ import { decodeUtf8 } from '@fbincon/statusline-platform/utf8';
13
+ import { orderedDataRecord, recordEntries } from '@fbincon/statusline-core/ordered-record';
14
+ export function humanizeTokens(value) {
15
+ if (value >= 1000000n)
16
+ return fixed(divideIntegers(value, 1000000n), 2).replace(/0+$/u, '').replace(/\.$/u, '') + 'M';
17
+ if (value >= 1000n)
18
+ return fixed(divideIntegers(value, 1000n), 1) + 'K';
19
+ return String(value > 0n ? value : 0n);
20
+ }
21
+ export class UsageCollector {
22
+ context;
23
+ io;
24
+ tasks;
25
+ constructor(context, io = runtimeIO()) {
26
+ this.context = context;
27
+ this.io = io;
28
+ this.tasks = new TaskService(context, io);
29
+ }
30
+ path() { return join(this.context.cacheRoot, 'statusline_state.json'); }
31
+ load() {
32
+ try {
33
+ const bytes = this.io.read(this.path());
34
+ const raw = bytes === null ? null : readDataJson(decodeUtf8(bytes));
35
+ if (object(raw) && object(raw.sessions)) {
36
+ const sessions = orderedDataRecord(raw.sessions);
37
+ Object.setPrototypeOf(sessions, null);
38
+ raw.sessions = sessions;
39
+ let dropped = false;
40
+ for (const [key, entry] of recordEntries(sessions))
41
+ if (!object(entry) || !object(entry.files) || !object(entry.ids)) {
42
+ delete sessions[key];
43
+ dropped = true;
44
+ }
45
+ else {
46
+ entry.ids = orderedDataRecord(entry.ids);
47
+ Object.setPrototypeOf(entry.ids, null);
48
+ }
49
+ return { state: raw, dropped };
50
+ }
51
+ }
52
+ catch { /* A corrupt cache is rebuilt from transcript evidence. */ }
53
+ return { state: { sessions: dictionary() }, dropped: false };
54
+ }
55
+ scan(entry, path, start, mode, prompts = false, cost = false, reset = false) {
56
+ const observed = entry.token_observed ? { ...entry.token_observed } : undefined;
57
+ const ids = mode === 'merge' ? dictionary() : null;
58
+ const turns = prompts ? new TurnAccumulator(reset ? null : entry.transcript_prompt_id ?? null) : null;
59
+ const costs = cost ? new usage.CostAccumulator(observed) : null;
60
+ const pending = !cost && mode !== 'none' && object(entry._pending_api_snapshot) && object(entry._pending_api_snapshot._snapshot_ts) ? { ...entry._pending_api_snapshot, _post_ids: dictionary() } : null;
61
+ const delta = { _pending_api_snapshot: pending };
62
+ const read = visitTranscript(this.io, path, start, row => {
63
+ if (mode !== 'none')
64
+ usage.addUsage(ids, row, observed);
65
+ turns?.push(row);
66
+ costs?.push(row);
67
+ if (pending)
68
+ usage.stageSubagentDelta(delta, [row]);
69
+ });
70
+ return read ? { ...read, ids, observed, turns: turns?.result, snapshot: costs?.finish(sha256) ?? null, post: pending?._post_ids } : null;
71
+ }
72
+ metadata(entry, result, session) {
73
+ const observations = applyTurnMetadata(entry, result);
74
+ if (observations.length) {
75
+ try {
76
+ this.tasks.transcript(session, observations);
77
+ }
78
+ catch { /* Accounting survives an unavailable lifecycle ledger. */ }
79
+ }
80
+ }
81
+ applyScan(entry, scan, session, cost, force = false) {
82
+ if (scan.observed && entry.token_observed)
83
+ Object.assign(entry.token_observed, scan.observed);
84
+ if (scan.ids)
85
+ usage.mergeIds(entry.ids, scan.ids);
86
+ if (scan.turns && session)
87
+ this.metadata(entry, scan.turns, session);
88
+ if (cost)
89
+ usage.stageParsedCostSnapshot(entry, scan.snapshot, force);
90
+ else if (scan.post && object(entry._pending_api_snapshot)) {
91
+ const pending = entry._pending_api_snapshot;
92
+ usage.mergeIds((pending._post_ids ??= dictionary()), scan.post);
93
+ }
94
+ }
95
+ updateFile(entry, path, session = null, trackPrompts = false, trackCost = false) {
96
+ let size, mtime;
97
+ try {
98
+ const stat = this.io.stat(path);
99
+ size = stat.size;
100
+ mtime = stat.mtimeNs;
101
+ }
102
+ catch {
103
+ return false;
104
+ }
105
+ const previous = own(entry.files, path), recorded = previous ? int(previous.size) : 0n;
106
+ const reset = !previous || size < recorded || size === recorded && mtime !== int(previous.mtime_ns);
107
+ if (!reset && size <= recorded)
108
+ return false;
109
+ const scan = this.scan(entry, path, reset ? 0n : recorded, 'merge', trackPrompts && Boolean(session), trackCost, reset);
110
+ if (!scan?.count)
111
+ return false;
112
+ if (!previous)
113
+ entry.files[path] = { size: scan.cursor, mtime_ns: mtime };
114
+ else {
115
+ previous.size = scan.cursor;
116
+ previous.mtime_ns = mtime;
117
+ }
118
+ this.applyScan(entry, scan, session, trackCost);
119
+ return true;
120
+ }
121
+ subagentFiles(root) {
122
+ const paths = [];
123
+ const walk = (directory) => {
124
+ let entries;
125
+ try {
126
+ entries = this.io.entries(directory);
127
+ }
128
+ catch {
129
+ return;
130
+ }
131
+ for (const entry of entries) {
132
+ if (entry.directory && !entry.link)
133
+ walk(entry.path);
134
+ else if (!entry.directory && entry.name.startsWith('agent-') && entry.name.endsWith('.jsonl'))
135
+ paths.push(entry.path);
136
+ }
137
+ };
138
+ walk(root);
139
+ return paths.sort(scalarCompare);
140
+ }
141
+ collect(data) {
142
+ if (!object(data) || !truth(data.session_id) || !truth(data.transcript_path))
143
+ return null;
144
+ const session = string(data.session_id), path = resolve(data.transcript_path);
145
+ // Lock acquisition failures are soft; failures inside a collector are observable
146
+ // to the renderer's existing boundary and are never mistaken for valid totals.
147
+ let entered = false;
148
+ try {
149
+ return this.io.lock(this.path() + '.lock', () => { entered = true; return this.locked(session, path); });
150
+ }
151
+ catch (error) {
152
+ if (entered)
153
+ throw error;
154
+ return null;
155
+ }
156
+ }
157
+ locked(session, path) {
158
+ const { state, dropped } = this.load();
159
+ const entry = state.sessions[session] ??= { files: dictionary(), ids: dictionary(), base: { ...usage.BASE } };
160
+ let changed = dropped, rescan = false;
161
+ if (!object(entry.token_observed)) {
162
+ entry.token_observed = usage.tokenObservations(entry, true);
163
+ changed = true;
164
+ }
165
+ if (this.updateFile(entry, path, session, true, true))
166
+ changed = true;
167
+ if (!equalSettings(entry.turn_scan_version, usage.TURN_SCAN_VERSION)) {
168
+ for (const key of ['last_pt', 'last_prompt_id', 'last_interrupt', 'last_local_command', 'last_assistant_ts'])
169
+ delete entry[key];
170
+ const scan = this.scan(entry, path, 0n, 'none', true);
171
+ if (scan?.count)
172
+ this.applyScan(entry, scan, session, false);
173
+ entry.turn_scan_version = usage.TURN_SCAN_VERSION;
174
+ changed = true;
175
+ }
176
+ if (!equalSettings(entry.usage_scan_version, usage.USAGE_SCAN_VERSION)) {
177
+ const scan = this.scan(entry, path, 0n, 'observe', false, true);
178
+ if (scan?.count)
179
+ this.applyScan(entry, scan, null, true, true);
180
+ entry.usage_scan_version = usage.USAGE_SCAN_VERSION;
181
+ rescan = true;
182
+ changed = true;
183
+ }
184
+ let root = join(path.slice(0, path.length - extname(path).length), 'subagents');
185
+ const directory = (target) => {
186
+ try {
187
+ this.io.entries(target);
188
+ return true;
189
+ }
190
+ catch {
191
+ return false;
192
+ }
193
+ };
194
+ if (!directory(root)) {
195
+ const alternative = join(dirname(path), session, 'subagents');
196
+ if (directory(alternative))
197
+ root = alternative;
198
+ }
199
+ for (const sub of this.subagentFiles(root)) {
200
+ if (this.updateFile(entry, sub))
201
+ changed = true;
202
+ if (rescan) {
203
+ const scan = this.scan(entry, sub, 0n, 'observe');
204
+ if (scan?.count)
205
+ this.applyScan(entry, scan, null, false);
206
+ }
207
+ }
208
+ if (usage.collapseIds(entry))
209
+ changed = true;
210
+ const visible = usage.visibleTotals(entry);
211
+ if (usage.acceptPending(entry, visible))
212
+ changed = true;
213
+ if (changed) {
214
+ delete state.sessions[session];
215
+ state.sessions[session] = entry;
216
+ while (Object.keys(state.sessions).length > usage.MAX_SESSIONS)
217
+ delete state.sessions[Object.keys(state.sessions)[0]];
218
+ try {
219
+ this.io.write(this.path(), Buffer.from(dumpDataJson(state)));
220
+ }
221
+ catch { /* Retain this result even if the cache cannot be saved. */ }
222
+ }
223
+ const displayed = usage.displayTotals(entry, visible);
224
+ return [humanizeTokens(displayed.hit), humanizeTokens(displayed.miss), humanizeTokens(displayed.out), entry.last_pt ?? null, { ...entry, _raw_token_counts: displayed }];
225
+ }
226
+ }
227
+ //# sourceMappingURL=usage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usage.js","sourceRoot":"","sources":["../../../src/runtime/usage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAa,MAAM,yCAAyC,CAAC;AACj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,aAAa,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QACtD,OAAO,CAAC,cAAc,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,cAAc,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,cAAc,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,OAAO,IAAI,IAAI,EAAE,EAAE,GAAG,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,CAAC,CAAC;IAC7K,CAAC;CACJ"}
@@ -0,0 +1,20 @@
1
+ import * as contracts from '@fbincon/statusline-core/contracts/ui';
2
+ import type { Draft } from '@fbincon/statusline-core/contracts/ui';
3
+ import { ConfigurationService, type EffectiveConfig } from '../config/service.js';
4
+ export declare const BACKEND_VERSION = "3.0.0-beta.1";
5
+ export declare const OPERATIONS: readonly ["describe", "read", "preview", "apply", "import", "export", "preset", "read_ui_preferences", "set_ui_language", "review_import"];
6
+ export type Preview = (draft: Draft, width: number) => unknown;
7
+ export declare function capabilities(version: readonly number[] | null): contracts.Capabilities;
8
+ export declare function configurationOptions(): contracts.ConfigurationOptions;
9
+ export declare class ConfigurationProtocol {
10
+ readonly service: ConfigurationService;
11
+ readonly preview?: Preview | undefined;
12
+ readonly nextId: () => string;
13
+ constructor(service: ConfigurationService, preview?: Preview | undefined, nextId?: () => string);
14
+ readResult(effective: EffectiveConfig): Record<string, unknown>;
15
+ dispatch(request: unknown): unknown;
16
+ handle(raw: string, diagnostics?: (error: unknown) => void): {
17
+ response: unknown;
18
+ status: number;
19
+ };
20
+ }
@@ -0,0 +1,144 @@
1
+ import { VERSION } from '@fbincon/statusline-core/release';
2
+ import { randomUUID } from 'node:crypto';
3
+ import * as contracts from '@fbincon/statusline-core/contracts/ui';
4
+ import { requestObject, validateDraft } from '@fbincon/statusline-core/config/draft';
5
+ import { isSchema } from '@fbincon/statusline-core/config/display';
6
+ import { ConfigError } from '@fbincon/statusline-core/config/validation';
7
+ import { ITEMS } from '@fbincon/statusline-core/config/catalog';
8
+ import { applyPreset } from '@fbincon/statusline-core/config/presets';
9
+ import { differences } from '@fbincon/statusline-core/config/import-review';
10
+ import { text } from '@fbincon/statusline-core/i18n/messages';
11
+ import { readJson, JsonSyntaxError } from '@fbincon/statusline-core/json-read';
12
+ import { safeInteger } from '@fbincon/statusline-core/json';
13
+ import { atLeast, draft } from '../config/service.js';
14
+ import { readPreferences, setLanguage } from '../config/preferences.js';
15
+ import { importFile, exportFile } from '../config/transfer.js';
16
+ import { localizedError } from '../errors.js';
17
+ import { errorDescription } from '@fbincon/statusline-platform/errors';
18
+ export const BACKEND_VERSION = VERSION;
19
+ export const OPERATIONS = ['describe', 'read', 'preview', 'apply', 'import', 'export', 'preset', 'read_ui_preferences', 'set_ui_language', 'review_import'];
20
+ export function capabilities(version) {
21
+ return {
22
+ host_version: version?.join('.') ?? null,
23
+ subagent_rows: version === null ? 'unknown' : atLeast(version, [2, 1, 205]) ? 'supported' : 'unsupported',
24
+ native_mod: version === null ? 'unknown' : atLeast(version, [2, 1, 287]) ? 'unverified' : 'unsupported',
25
+ native_mod_loaded: null, data_observation: 'not_observed',
26
+ };
27
+ }
28
+ export function configurationOptions() {
29
+ return {
30
+ colors: { choices: [true, false] }, palette: { choices: [...contracts.PALETTE_VALUES] }, theme: { choices: [...contracts.THEME_VALUES] },
31
+ 'powerline-glyph': { choices: [...contracts.POWERLINEGLYPH_VALUES] }, 'directory-style': { choices: [...contracts.DIRECTORYSTYLE_VALUES] },
32
+ 'separator-style': { choices: [...contracts.SEPARATORSTYLE_VALUES] }, 'scope-labels': { choices: [...contracts.SCOPELABELS_VALUES] },
33
+ 'statusline-language': { choices: [...contracts.STATUSLINELANGUAGE_VALUES] }, 'subagent-statusline': { choices: [true, false] },
34
+ padding: { minimum: 0, maximum: 32 }, 'refresh-interval': { minimum: 1, maximum: 3600, special: 'event' }, 'hide-vim-mode-indicator': { choices: [true, false] },
35
+ };
36
+ }
37
+ export class ConfigurationProtocol {
38
+ service;
39
+ preview;
40
+ nextId;
41
+ constructor(service, preview, nextId = () => randomUUID().replaceAll('-', '')) {
42
+ this.service = service;
43
+ this.preview = preview;
44
+ this.nextId = nextId;
45
+ }
46
+ readResult(effective) {
47
+ return { draft: draft(effective), revision: effective.revision, installed: effective.installed, installation: effective.installation, capabilities: capabilities(this.service.context.hostVersion()), backend_version: BACKEND_VERSION };
48
+ }
49
+ dispatch(request) {
50
+ requestObject(request, ['protocol_version', 'operation', 'payload'], 'request');
51
+ if (!isSchema(request.protocol_version, contracts.PROTOCOL_VERSION))
52
+ throw new ConfigError('errors.protocol.unsupported_protocol', { version: contracts.PROTOCOL_VERSION }, 'unsupported_protocol');
53
+ const operation = request.operation;
54
+ if (typeof operation !== 'string' || !OPERATIONS.includes(operation))
55
+ throw new ConfigError('errors.protocol.unsupported_configuration_operation', {}, 'unsupported_operation');
56
+ const payload = request.payload;
57
+ if (operation === 'read_ui_preferences' || operation === 'set_ui_language') {
58
+ requestObject(payload, operation === 'read_ui_preferences' ? [] : ['ui_language'], 'payload');
59
+ return operation === 'read_ui_preferences' ? readPreferences(this.service.context.configDir, this.service.io) : setLanguage(this.service.context.configDir, payload.ui_language, this.service.io);
60
+ }
61
+ if (['import', 'review_import', 'export', 'preset'].includes(operation)) {
62
+ requestObject(payload, operation === 'export' ? ['draft', 'path', 'overwrite'] : operation === 'preset' ? ['draft', 'preset'] : ['draft', 'path'], 'payload');
63
+ const current = validateDraft(payload.draft, true);
64
+ if (operation === 'preset') {
65
+ if (typeof payload.preset !== 'string')
66
+ throw new ConfigError('errors.protocol.preset_must_be_a_string', {}, 'invalid_request');
67
+ return { draft: { display: applyPreset(current.display, payload.preset, this.nextId), host: current.host } };
68
+ }
69
+ const path = payload.path;
70
+ if (typeof path !== 'string' || !path.trim() || path.includes('\0'))
71
+ throw new ConfigError('errors.protocol.path_must_be_nonempty_text_without_nul', {}, 'invalid_request');
72
+ if (operation === 'import')
73
+ return { draft: importFile(path, current) };
74
+ if (operation === 'review_import') {
75
+ const candidate = importFile(path, current);
76
+ return { draft: candidate, changes: differences(current, candidate) };
77
+ }
78
+ if (typeof payload.overwrite !== 'boolean')
79
+ throw new ConfigError('errors.protocol.overwrite_must_be_a_boolean', {}, 'invalid_request');
80
+ return { path: exportFile(path, current, this.service.context.configDir, payload.overwrite) };
81
+ }
82
+ if (operation === 'describe' || operation === 'read')
83
+ requestObject(payload, [], 'payload');
84
+ if (operation === 'describe')
85
+ return { presets: contracts.PRESETS, editor_fields: contracts.EDITOR_FIELDS, catalog: ITEMS, options: configurationOptions(), capabilities: capabilities(this.service.context.hostVersion()), backend_version: BACKEND_VERSION, operations: [...OPERATIONS], formatting_options: contracts.FORMAT_CHOICES };
86
+ if (operation === 'read')
87
+ return this.readResult(this.service.read());
88
+ if (operation === 'apply') {
89
+ requestObject(payload, ['draft', 'expected_revision'], 'payload');
90
+ const parsed = validateDraft(payload.draft, true), revision = payload.expected_revision;
91
+ if (typeof revision !== 'string' || !/^[0-9a-f]{64}$/u.test(revision))
92
+ throw new ConfigError('errors.protocol.expected_revision_must_be_the_revision_returned', {}, 'invalid_request');
93
+ const result = this.service.apply(parsed, revision);
94
+ return { ...this.readResult(result.effective), changed: result.changed, backup_dir: result.backup_dir };
95
+ }
96
+ requestObject(payload, ['draft', 'width'], 'payload');
97
+ const parsed = validateDraft(payload.draft);
98
+ let width;
99
+ try {
100
+ width = safeInteger(payload.width, 2, 10000);
101
+ }
102
+ catch {
103
+ throw new ConfigError('errors.protocol.width_must_be_an_integer_from_2', {}, 'invalid_request');
104
+ }
105
+ if (!this.preview)
106
+ throw new Error('Preview adapter has not been bound');
107
+ return this.preview(parsed, width);
108
+ }
109
+ handle(raw, diagnostics = error => console.error(error)) {
110
+ try {
111
+ const request = readJson(raw, {
112
+ duplicate(field) { throw new ConfigError('errors.protocol.duplicate_json_key', { field }, 'invalid_json'); },
113
+ constant(value) { throw new ConfigError('errors.protocol.non_finite_json_value', { value }, 'invalid_json'); },
114
+ });
115
+ return { response: { protocol_version: contracts.PROTOCOL_VERSION, result: this.dispatch(request) }, status: 0 };
116
+ }
117
+ catch (error) {
118
+ let code, message, localization = null;
119
+ if (error instanceof ConfigError) {
120
+ code = error.code;
121
+ const localized = localizedError(error);
122
+ message = localized.fallback;
123
+ if (message !== error.key)
124
+ localization = localized;
125
+ }
126
+ else if (error instanceof JsonSyntaxError) {
127
+ code = 'invalid_json';
128
+ message = error.message;
129
+ }
130
+ else if (error instanceof Error && 'code' in error && typeof error.code === 'string') {
131
+ code = 'io_error';
132
+ message = errorDescription(error);
133
+ }
134
+ else {
135
+ diagnostics(error);
136
+ code = 'internal_error';
137
+ localization = text('errors.protocol.unexpected_backend_failure_see_stderr_diagnostics');
138
+ message = localization.fallback;
139
+ }
140
+ return { response: { protocol_version: contracts.PROTOCOL_VERSION, error: { code, message, localization } }, status: 2 };
141
+ }
142
+ }
143
+ }
144
+ //# sourceMappingURL=protocol.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"protocol.js","sourceRoot":"","sources":["../../../src/ui/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,SAAS,MAAM,uCAAuC,CAAC;AAEnE,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AACrF,OAAO,EAAE,QAAQ,EAAE,MAAM,yCAAyC,CAAC;AACnE,OAAO,EAAE,WAAW,EAAU,MAAM,4CAA4C,CAAC;AACjF,OAAO,EAAE,KAAK,EAAE,MAAM,yCAAyC,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAC5E,OAAO,EAAE,IAAI,EAAE,MAAM,wCAAwC,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAC/E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C;gBACnF,IAAI,GAAG,UAAU,CAAC;gBAClB,OAAO,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAAC;YACtC,CAAC;iBACI,CAAC;gBACF,WAAW,CAAC,KAAK,CAAC,CAAC;gBACnB,IAAI,GAAG,gBAAgB,CAAC;gBACxB,YAAY,GAAG,IAAI,CAAC,mEAAmE,CAAC,CAAC;gBACzF,OAAO,GAAG,YAAY,CAAC,QAAQ,CAAC;YACpC,CAAC;YACD,OAAO,EAAE,QAAQ,EAAE,EAAE,gBAAgB,EAAE,SAAS,CAAC,gBAAgB,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;QAC7H,CAAC;IACL,CAAC;CACJ"}
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "@fbincon/statusline-cli",
3
+ "version": "0.0.0",
4
+ "private": true,
5
+ "type": "module",
6
+ "exports": {
7
+ "./*": {
8
+ "types": "./dist/src/*.d.ts",
9
+ "import": "./dist/src/*.js"
10
+ }
11
+ },
12
+ "dependencies": {
13
+ "@fbincon/statusline-core": "0.0.0",
14
+ "@fbincon/statusline-platform": "0.0.0",
15
+ "@fbincon/statusline-tui": "0.0.0"
16
+ }
17
+ }
@@ -0,0 +1,80 @@
1
+ ---
2
+ name: statusline-config
3
+ description: Configure the installed claude-statusline display and Claude Code host settings.
4
+ argument-hint: "[show|list-items|set-items|enable|disable|order|subagents|set|item|instance|layout|preset|import|export|language|reset]"
5
+ disable-model-invocation: true
6
+ allowed-tools:
7
+ - AskUserQuestion
8
+ __CLAUDE_STATUSLINE_ALLOWED_RULES__
9
+ ---
10
+
11
+ # Configure Claude Code Statusline
12
+
13
+ This is a user-global configuration workflow. Never edit settings or statusline
14
+ files directly. Use only `__CLAUDE_STATUSLINE_COMMAND__ config ...`.
15
+
16
+ The invocation arguments are: `$ARGUMENTS`.
17
+
18
+ If the invocation arguments are non-empty, this Claude Code version did not handle the
19
+ shortcut locally. Parse the arguments as one of the documented `config`
20
+ subcommands, run `__CLAUDE_STATUSLINE_COMMAND__ config $ARGUMENTS`, report its
21
+ exact result, and stop. Do not reinterpret invalid arguments or make unrelated
22
+ changes.
23
+
24
+ If the invocation arguments are empty:
25
+
26
+ 1. Run `__CLAUDE_STATUSLINE_COMMAND__ config language show --json` first. Use its
27
+ `ui_language` for every question, explanation and completion message.
28
+ Supported languages: __CLAUDE_STATUSLINE_LANGUAGES__. Do not infer the interface
29
+ language from the conversation or from `statusline_language`.
30
+ Run `__CLAUDE_STATUSLINE_COMMAND__ config show --json` and
31
+ `__CLAUDE_STATUSLINE_COMMAND__ config list-items --json`, then run
32
+ `__CLAUDE_STATUSLINE_COMMAND__ config subagents list-items --json`.
33
+ Also run `__CLAUDE_STATUSLINE_COMMAND__ config list-items` and
34
+ `__CLAUDE_STATUSLINE_COMMAND__ config subagents list-items` for the tool's
35
+ localized descriptions. Translate question/group labels into the interface
36
+ language, retaining the IDs, choices, defaults and exclusions from JSON.
37
+ Check both scopes' `instances` before starting the type-based questions.
38
+ If either scope contains duplicate `type_id` values, `text`, or `spacer`,
39
+ explain that this composition needs the instance editor or `config instance`
40
+ commands, show those entry points, and stop without changing configuration.
41
+ Do not collapse copies or discard nodes to make the legacy form fit.
42
+ Otherwise use only metric catalog rows (`instance_only: false`) below.
43
+ 2. Tell the user that the configuration applies to every Claude Code project.
44
+ 3. Use AskUserQuestion with multi-select questions for these groups:
45
+ __CLAUDE_STATUSLINE_ITEM_GROUPS__
46
+ 4. Preserve the relative order of currently enabled selected items. Append
47
+ newly enabled items in the catalog order returned by `list-items`.
48
+ 5. Ask for:
49
+ - statusline language: __CLAUDE_STATUSLINE_LANGUAGES__; preserve each native language name.
50
+ Start from `display.statusline_language` in the current configuration.
51
+ This changes main and subagent output independently of interface language.
52
+ Preview is available in the editors; this guided choice is saved with all
53
+ other display answers, not immediately.
54
+ - subagent row items from the listing; respect its excludes constraints. If the
55
+ user selects status-elapsed together with status or elapsed, keep the combined
56
+ item and drop the excluded standalone items.
57
+ - custom subagent rows: on or off
58
+ - scope labels: off, when-subagents, or always
59
+ - colors: on or off
60
+ - palette: default or ansi (retain the current value if colors are off)
61
+ - directory style: full, home, project-relative, or basename
62
+ - separator style: classic, compact, or powerline (uses the saved glyph; ASCII by default)
63
+ - padding: 0, 1, 2, or 4 (accept a custom integer from 0 through 32)
64
+ - refresh interval: 1, 2, 5, or event (accept a custom integer from 1 through 3600)
65
+ - Vim indicator: show or hide
66
+ 6. Do not write anything if the user cancels or any answer is unresolved.
67
+ 7. Apply every answer in one command with this exact argument structure:
68
+
69
+ `__CLAUDE_STATUSLINE_COMMAND__ config apply --items ITEM... --subagent-items ITEM... --subagent-statusline on|off --scope-labels off|when-subagents|always --statusline-language __CLAUDE_STATUSLINE_LANGUAGE_CHOICES__ --colors on|off --palette default|ansi --directory-style full|home|project-relative|basename --separator-style classic|compact|powerline --padding N --refresh-interval event|N --hide-vim-mode-indicator on|off`
70
+
71
+ Map "hide" to `--hide-vim-mode-indicator on` and "show" to
72
+ `--hide-vim-mode-indicator off`.
73
+
74
+ After it succeeds, run `__CLAUDE_STATUSLINE_COMMAND__ config show --json`
75
+ once to verify the saved result. Report the applied values and mention that
76
+ arbitrary reordering is available through
77
+ `/statusline-config order ITEM...` and
78
+ `/statusline-config subagents order ITEM...`.
79
+
80
+ The guided form preserves the saved theme, Powerline glyph, item colors and visibility rules. For appearance changes, the user can open either editor or invoke `/statusline-config set theme classic|dark|light|terminal`, `/statusline-config set powerline-glyph ascii|powerline`, or `/statusline-config item main|subagent ID OPTION VALUE`. Item appearance options are `foreground`, `background`, `visibility`, and `visibility-threshold`. Colors accept `inherit`, `default`, `ansi:0`–`ansi:255`, or a quoted six-digit hex value. Use only the visibility rule supported by the scoped item; usage thresholds are independent of warning colors.
@@ -0,0 +1,19 @@
1
+ ---
2
+ name: statusline-configure
3
+ description: Open the experimental local interactive status line configuration launcher.
4
+ argument-hint: ""
5
+ disable-model-invocation: true
6
+ disallowed-tools:
7
+ - Bash
8
+ - PowerShell
9
+ ---
10
+
11
+ # Experimental Interactive Status Line Configuration
12
+
13
+ This command is normally intercepted by a local `UserPromptExpansion` hook before
14
+ model invocation. The local hook did not run, for example because Claude Code hooks
15
+ are disabled with `disableAllHooks`.
16
+
17
+ Do not start curses or any terminal interface through Bash or another tool. Reply
18
+ only that the experimental hook did not run and suggest running
19
+ `claude-statusline configure` in a terminal or using `/statusline-config`.
@@ -0,0 +1,37 @@
1
+ {
2
+ "name": "statusline-native",
3
+ "version": "3.0.0-beta.1",
4
+ "description": "In-session Client TUI for statusline configuration",
5
+ "author": {
6
+ "name": "fbincon"
7
+ },
8
+ "license": "MIT",
9
+ "homepage": "https://github.com/fbincon/claude-code-statusline",
10
+ "userConfig": {
11
+ "backendExecutable": {
12
+ "type": "string",
13
+ "title": "Backend executable",
14
+ "description": "Matching backend executable; an executable environment override replaces the complete executable/args binding.",
15
+ "default": "claude-statusline"
16
+ },
17
+ "configDir": {
18
+ "type": "string",
19
+ "title": "Configuration directory",
20
+ "description": "Claude configuration directory used by the installer; CLAUDE_CONFIG_DIR takes precedence.",
21
+ "default": ""
22
+ },
23
+ "backendVersion": {
24
+ "type": "string",
25
+ "title": "Expected backend version",
26
+ "description": "Version bound by the installer; empty permits protocol-compatible source development.",
27
+ "default": ""
28
+ },
29
+ "backendArgs": {
30
+ "type": "string",
31
+ "multiple": true,
32
+ "title": "Backend arguments",
33
+ "description": "Argument prefix for the matching backend, including the absolute installed JavaScript entry for Node installations.",
34
+ "default": []
35
+ }
36
+ }
37
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "description": "Native statusline configuration editor",
3
+ "modules": [
4
+ "./register.ts"
5
+ ]
6
+ }