@fbincon/claude-code-statusline 3.4.0 → 3.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (228) hide show
  1. package/README.md +78 -75
  2. package/candidate.json +392 -297
  3. package/node_modules/@fbincon/statusline-cli/dist/src/config/operations.js +5 -0
  4. package/node_modules/@fbincon/statusline-cli/dist/src/config/operations.js.map +1 -1
  5. package/node_modules/@fbincon/statusline-cli/dist/src/config/profiles.js +2 -1
  6. package/node_modules/@fbincon/statusline-cli/dist/src/config/profiles.js.map +1 -1
  7. package/node_modules/@fbincon/statusline-cli/dist/src/config/service.d.ts +2 -0
  8. package/node_modules/@fbincon/statusline-cli/dist/src/config/service.js +14 -0
  9. package/node_modules/@fbincon/statusline-cli/dist/src/config/service.js.map +1 -1
  10. package/node_modules/@fbincon/statusline-cli/dist/src/config/transfer.js +5 -3
  11. package/node_modules/@fbincon/statusline-cli/dist/src/config/transfer.js.map +1 -1
  12. package/node_modules/@fbincon/statusline-cli/dist/src/diagnostics/service.js +24 -0
  13. package/node_modules/@fbincon/statusline-cli/dist/src/diagnostics/service.js.map +1 -1
  14. package/node_modules/@fbincon/statusline-cli/dist/src/help.js +8 -2
  15. package/node_modules/@fbincon/statusline-cli/dist/src/help.js.map +1 -1
  16. package/node_modules/@fbincon/statusline-cli/dist/src/integration/arguments.js +1 -1
  17. package/node_modules/@fbincon/statusline-cli/dist/src/integration/arguments.js.map +1 -1
  18. package/node_modules/@fbincon/statusline-cli/dist/src/integration/install.js +2 -0
  19. package/node_modules/@fbincon/statusline-cli/dist/src/integration/install.js.map +1 -1
  20. package/node_modules/@fbincon/statusline-cli/dist/src/integration/model.d.ts +2 -0
  21. package/node_modules/@fbincon/statusline-cli/dist/src/integration/setup-service.d.ts +23 -0
  22. package/node_modules/@fbincon/statusline-cli/dist/src/integration/setup-service.js +168 -0
  23. package/node_modules/@fbincon/statusline-cli/dist/src/integration/setup-service.js.map +1 -0
  24. package/node_modules/@fbincon/statusline-cli/dist/src/integration/setup.d.ts +3 -0
  25. package/node_modules/@fbincon/statusline-cli/dist/src/integration/setup.js +64 -0
  26. package/node_modules/@fbincon/statusline-cli/dist/src/integration/setup.js.map +1 -0
  27. package/node_modules/@fbincon/statusline-cli/dist/src/main.js +24 -4
  28. package/node_modules/@fbincon/statusline-cli/dist/src/main.js.map +1 -1
  29. package/node_modules/@fbincon/statusline-cli/dist/src/recovery/journal.js +1 -1
  30. package/node_modules/@fbincon/statusline-cli/dist/src/recovery/journal.js.map +1 -1
  31. package/node_modules/@fbincon/statusline-cli/dist/src/rendering/environment.js +46 -1
  32. package/node_modules/@fbincon/statusline-cli/dist/src/rendering/environment.js.map +1 -1
  33. package/node_modules/@fbincon/statusline-cli/dist/src/sources/command.d.ts +3 -0
  34. package/node_modules/@fbincon/statusline-cli/dist/src/sources/command.js +117 -0
  35. package/node_modules/@fbincon/statusline-cli/dist/src/sources/command.js.map +1 -0
  36. package/node_modules/@fbincon/statusline-cli/dist/src/sources/context.d.ts +4 -0
  37. package/node_modules/@fbincon/statusline-cli/dist/src/sources/context.js +35 -0
  38. package/node_modules/@fbincon/statusline-cli/dist/src/sources/context.js.map +1 -0
  39. package/node_modules/@fbincon/statusline-cli/dist/src/sources/providers.d.ts +8 -0
  40. package/node_modules/@fbincon/statusline-cli/dist/src/sources/providers.js +118 -0
  41. package/node_modules/@fbincon/statusline-cli/dist/src/sources/providers.js.map +1 -0
  42. package/node_modules/@fbincon/statusline-cli/dist/src/sources/service.d.ts +35 -0
  43. package/node_modules/@fbincon/statusline-cli/dist/src/sources/service.js +359 -0
  44. package/node_modules/@fbincon/statusline-cli/dist/src/sources/service.js.map +1 -0
  45. package/node_modules/@fbincon/statusline-cli/dist/src/ui/protocol.d.ts +2 -2
  46. package/node_modules/@fbincon/statusline-cli/dist/src/ui/protocol.js +31 -1
  47. package/node_modules/@fbincon/statusline-cli/dist/src/ui/protocol.js.map +1 -1
  48. package/node_modules/@fbincon/statusline-cli/resources/statusline-config/SKILL.md +5 -0
  49. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/.claude-plugin/plugin.json +1 -1
  50. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/hooks/register.ts +15 -5
  51. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/backend.ts +14 -7
  52. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/client/keys.ts +6 -2
  53. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/client/settings.ts +1 -0
  54. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/appearance.ts +24 -6
  55. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/draft.ts +2 -0
  56. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/forms.ts +1 -1
  57. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/profile-manager.ts +21 -2
  58. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/quick-setup.ts +14 -11
  59. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/setup.ts +60 -0
  60. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/source-manager.ts +301 -0
  61. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/source-validation.ts +45 -0
  62. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/generated-contracts.ts +577 -10
  63. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/i18n/generated-locales.ts +1164 -6
  64. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/session.ts +2 -1
  65. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/resource-manifest.json +21 -18
  66. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/ui/client/draw.ts +6 -2
  67. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/ui/client/help.ts +1 -0
  68. package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/.claude-plugin/plugin.json +1 -1
  69. package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/resource-manifest.json +3 -3
  70. package/node_modules/@fbincon/statusline-core/dist/src/config/catalog-data.d.ts +91 -0
  71. package/node_modules/@fbincon/statusline-core/dist/src/config/catalog-data.js +250 -0
  72. package/node_modules/@fbincon/statusline-core/dist/src/config/catalog-data.js.map +1 -1
  73. package/node_modules/@fbincon/statusline-core/dist/src/config/defaults.d.ts +1 -0
  74. package/node_modules/@fbincon/statusline-core/dist/src/config/defaults.js +5 -2
  75. package/node_modules/@fbincon/statusline-core/dist/src/config/defaults.js.map +1 -1
  76. package/node_modules/@fbincon/statusline-core/dist/src/config/display.d.ts +1 -1
  77. package/node_modules/@fbincon/statusline-core/dist/src/config/display.js +21 -12
  78. package/node_modules/@fbincon/statusline-core/dist/src/config/display.js.map +1 -1
  79. package/node_modules/@fbincon/statusline-core/dist/src/config/editor-fields.js +7 -10
  80. package/node_modules/@fbincon/statusline-core/dist/src/config/editor-fields.js.map +1 -1
  81. package/node_modules/@fbincon/statusline-core/dist/src/config/formatting.d.ts +3 -0
  82. package/node_modules/@fbincon/statusline-core/dist/src/config/formatting.js +15 -1
  83. package/node_modules/@fbincon/statusline-core/dist/src/config/formatting.js.map +1 -1
  84. package/node_modules/@fbincon/statusline-core/dist/src/config/import-review.js +4 -2
  85. package/node_modules/@fbincon/statusline-core/dist/src/config/import-review.js.map +1 -1
  86. package/node_modules/@fbincon/statusline-core/dist/src/config/instances.js +7 -2
  87. package/node_modules/@fbincon/statusline-core/dist/src/config/instances.js.map +1 -1
  88. package/node_modules/@fbincon/statusline-core/dist/src/config/presets.d.ts +4 -0
  89. package/node_modules/@fbincon/statusline-core/dist/src/config/presets.js +37 -3
  90. package/node_modules/@fbincon/statusline-core/dist/src/config/presets.js.map +1 -1
  91. package/node_modules/@fbincon/statusline-core/dist/src/config/profiles.js +2 -1
  92. package/node_modules/@fbincon/statusline-core/dist/src/config/profiles.js.map +1 -1
  93. package/node_modules/@fbincon/statusline-core/dist/src/config/transfer.js +5 -3
  94. package/node_modules/@fbincon/statusline-core/dist/src/config/transfer.js.map +1 -1
  95. package/node_modules/@fbincon/statusline-core/dist/src/contracts/generated-catalog.d.ts +26 -2
  96. package/node_modules/@fbincon/statusline-core/dist/src/contracts/generated-catalog.js +3 -3
  97. package/node_modules/@fbincon/statusline-core/dist/src/contracts/generated-catalog.js.map +1 -1
  98. package/node_modules/@fbincon/statusline-core/dist/src/contracts/ui.d.ts +263 -6
  99. package/node_modules/@fbincon/statusline-core/dist/src/contracts/ui.js +486 -3
  100. package/node_modules/@fbincon/statusline-core/dist/src/contracts/ui.js.map +1 -1
  101. package/node_modules/@fbincon/statusline-core/dist/src/editor/appearance.d.ts +4 -2
  102. package/node_modules/@fbincon/statusline-core/dist/src/editor/appearance.js +29 -6
  103. package/node_modules/@fbincon/statusline-core/dist/src/editor/appearance.js.map +1 -1
  104. package/node_modules/@fbincon/statusline-core/dist/src/editor/backend.js +16 -7
  105. package/node_modules/@fbincon/statusline-core/dist/src/editor/backend.js.map +1 -1
  106. package/node_modules/@fbincon/statusline-core/dist/src/editor/draft.d.ts +2 -0
  107. package/node_modules/@fbincon/statusline-core/dist/src/editor/draft.js +1 -0
  108. package/node_modules/@fbincon/statusline-core/dist/src/editor/draft.js.map +1 -1
  109. package/node_modules/@fbincon/statusline-core/dist/src/editor/forms.js +1 -1
  110. package/node_modules/@fbincon/statusline-core/dist/src/editor/forms.js.map +1 -1
  111. package/node_modules/@fbincon/statusline-core/dist/src/editor/profile-manager.d.ts +3 -0
  112. package/node_modules/@fbincon/statusline-core/dist/src/editor/profile-manager.js +26 -1
  113. package/node_modules/@fbincon/statusline-core/dist/src/editor/profile-manager.js.map +1 -1
  114. package/node_modules/@fbincon/statusline-core/dist/src/editor/quick-setup.d.ts +4 -4
  115. package/node_modules/@fbincon/statusline-core/dist/src/editor/quick-setup.js +16 -9
  116. package/node_modules/@fbincon/statusline-core/dist/src/editor/quick-setup.js.map +1 -1
  117. package/node_modules/@fbincon/statusline-core/dist/src/editor/setup.d.ts +30 -0
  118. package/node_modules/@fbincon/statusline-core/dist/src/editor/setup.js +96 -0
  119. package/node_modules/@fbincon/statusline-core/dist/src/editor/setup.js.map +1 -0
  120. package/node_modules/@fbincon/statusline-core/dist/src/editor/source-manager.d.ts +39 -0
  121. package/node_modules/@fbincon/statusline-core/dist/src/editor/source-manager.js +270 -0
  122. package/node_modules/@fbincon/statusline-core/dist/src/editor/source-manager.js.map +1 -0
  123. package/node_modules/@fbincon/statusline-core/dist/src/editor/source-validation.d.ts +2 -0
  124. package/node_modules/@fbincon/statusline-core/dist/src/editor/source-validation.js +45 -0
  125. package/node_modules/@fbincon/statusline-core/dist/src/editor/source-validation.js.map +1 -0
  126. package/node_modules/@fbincon/statusline-core/dist/src/extensions/model.d.ts +27 -0
  127. package/node_modules/@fbincon/statusline-core/dist/src/extensions/model.js +222 -0
  128. package/node_modules/@fbincon/statusline-core/dist/src/extensions/model.js.map +1 -0
  129. package/node_modules/@fbincon/statusline-core/dist/src/extensions/portable.d.ts +3 -0
  130. package/node_modules/@fbincon/statusline-core/dist/src/extensions/portable.js +6 -0
  131. package/node_modules/@fbincon/statusline-core/dist/src/extensions/portable.js.map +1 -0
  132. package/node_modules/@fbincon/statusline-core/dist/src/i18n/generated-locales.d.ts +1158 -0
  133. package/node_modules/@fbincon/statusline-core/dist/src/i18n/generated-locales.js +1164 -6
  134. package/node_modules/@fbincon/statusline-core/dist/src/i18n/generated-locales.js.map +1 -1
  135. package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/en.d.ts +26 -0
  136. package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/en.js +27 -1
  137. package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/en.js.map +1 -1
  138. package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/ja.d.ts +26 -0
  139. package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/ja.js +27 -1
  140. package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/ja.js.map +1 -1
  141. package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/ko.d.ts +26 -0
  142. package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/ko.js +27 -1
  143. package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/ko.js.map +1 -1
  144. package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/zh-CN.d.ts +26 -0
  145. package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/zh-CN.js +27 -1
  146. package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/zh-CN.js.map +1 -1
  147. package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/zh-HK.d.ts +26 -0
  148. package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/zh-HK.js +27 -1
  149. package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/zh-HK.js.map +1 -1
  150. package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/zh-TW.d.ts +26 -0
  151. package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/zh-TW.js +27 -1
  152. package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/zh-TW.js.map +1 -1
  153. package/node_modules/@fbincon/statusline-core/dist/src/release.d.ts +1 -1
  154. package/node_modules/@fbincon/statusline-core/dist/src/release.js +1 -1
  155. package/node_modules/@fbincon/statusline-core/dist/src/rendering/appearance.d.ts +3 -1
  156. package/node_modules/@fbincon/statusline-core/dist/src/rendering/appearance.js +25 -3
  157. package/node_modules/@fbincon/statusline-core/dist/src/rendering/appearance.js.map +1 -1
  158. package/node_modules/@fbincon/statusline-core/dist/src/rendering/components.d.ts +3 -1
  159. package/node_modules/@fbincon/statusline-core/dist/src/rendering/components.js +18 -5
  160. package/node_modules/@fbincon/statusline-core/dist/src/rendering/components.js.map +1 -1
  161. package/node_modules/@fbincon/statusline-core/dist/src/rendering/context.d.ts +3 -0
  162. package/node_modules/@fbincon/statusline-core/dist/src/rendering/diagnose.js +1 -1
  163. package/node_modules/@fbincon/statusline-core/dist/src/rendering/diagnose.js.map +1 -1
  164. package/node_modules/@fbincon/statusline-core/dist/src/rendering/explain.js +2 -0
  165. package/node_modules/@fbincon/statusline-core/dist/src/rendering/explain.js.map +1 -1
  166. package/node_modules/@fbincon/statusline-core/dist/src/rendering/extensions.d.ts +7 -0
  167. package/node_modules/@fbincon/statusline-core/dist/src/rendering/extensions.js +35 -0
  168. package/node_modules/@fbincon/statusline-core/dist/src/rendering/extensions.js.map +1 -0
  169. package/node_modules/@fbincon/statusline-core/dist/src/rendering/items.js +12 -6
  170. package/node_modules/@fbincon/statusline-core/dist/src/rendering/items.js.map +1 -1
  171. package/node_modules/@fbincon/statusline-core/dist/src/rendering/layout.d.ts +3 -0
  172. package/node_modules/@fbincon/statusline-core/dist/src/rendering/layout.js +30 -9
  173. package/node_modules/@fbincon/statusline-core/dist/src/rendering/layout.js.map +1 -1
  174. package/node_modules/@fbincon/statusline-core/dist/src/rendering/powerline.d.ts +15 -5
  175. package/node_modules/@fbincon/statusline-core/dist/src/rendering/powerline.js +78 -48
  176. package/node_modules/@fbincon/statusline-core/dist/src/rendering/powerline.js.map +1 -1
  177. package/node_modules/@fbincon/statusline-core/dist/src/rendering/preferences.js +6 -0
  178. package/node_modules/@fbincon/statusline-core/dist/src/rendering/preferences.js.map +1 -1
  179. package/node_modules/@fbincon/statusline-core/dist/src/rendering/preview.js +3 -1
  180. package/node_modules/@fbincon/statusline-core/dist/src/rendering/preview.js.map +1 -1
  181. package/node_modules/@fbincon/statusline-core/dist/src/rendering/spans.d.ts +1 -0
  182. package/node_modules/@fbincon/statusline-core/dist/src/rendering/spans.js +2 -2
  183. package/node_modules/@fbincon/statusline-core/dist/src/rendering/spans.js.map +1 -1
  184. package/node_modules/@fbincon/statusline-core/dist/src/rendering/subagents.js +15 -4
  185. package/node_modules/@fbincon/statusline-core/dist/src/rendering/subagents.js.map +1 -1
  186. package/node_modules/@fbincon/statusline-core/dist/src/terminal/links.d.ts +6 -0
  187. package/node_modules/@fbincon/statusline-core/dist/src/terminal/links.js +37 -0
  188. package/node_modules/@fbincon/statusline-core/dist/src/terminal/links.js.map +1 -0
  189. package/node_modules/@fbincon/statusline-core/resources/i18n/locales/en.json +194 -1
  190. package/node_modules/@fbincon/statusline-core/resources/i18n/locales/ja.json +194 -1
  191. package/node_modules/@fbincon/statusline-core/resources/i18n/locales/ko.json +194 -1
  192. package/node_modules/@fbincon/statusline-core/resources/i18n/locales/zh-CN.json +194 -1
  193. package/node_modules/@fbincon/statusline-core/resources/i18n/locales/zh-HK.json +194 -1
  194. package/node_modules/@fbincon/statusline-core/resources/i18n/locales/zh-TW.json +194 -1
  195. package/node_modules/@fbincon/statusline-platform/dist/src/posix-source-exec.d.ts +1 -0
  196. package/node_modules/@fbincon/statusline-platform/dist/src/posix-source-exec.js +26 -0
  197. package/node_modules/@fbincon/statusline-platform/dist/src/posix-source-exec.js.map +1 -0
  198. package/node_modules/@fbincon/statusline-platform/dist/src/source-files.d.ts +2 -0
  199. package/node_modules/@fbincon/statusline-platform/dist/src/source-files.js +37 -0
  200. package/node_modules/@fbincon/statusline-platform/dist/src/source-files.js.map +1 -0
  201. package/node_modules/@fbincon/statusline-platform/dist/src/source-process.d.ts +19 -0
  202. package/node_modules/@fbincon/statusline-platform/dist/src/source-process.js +122 -0
  203. package/node_modules/@fbincon/statusline-platform/dist/src/source-process.js.map +1 -0
  204. package/node_modules/@fbincon/statusline-platform/dist/src/windows-source-environment.d.ts +4 -0
  205. package/node_modules/@fbincon/statusline-platform/dist/src/windows-source-environment.js +61 -0
  206. package/node_modules/@fbincon/statusline-platform/dist/src/windows-source-environment.js.map +1 -0
  207. package/node_modules/@fbincon/statusline-platform/dist/src/windows-source-job.d.ts +3 -0
  208. package/node_modules/@fbincon/statusline-platform/dist/src/windows-source-job.js +61 -0
  209. package/node_modules/@fbincon/statusline-platform/dist/src/windows-source-job.js.map +1 -0
  210. package/node_modules/@fbincon/statusline-tui/dist/src/drawing/canvas.js +3 -2
  211. package/node_modules/@fbincon/statusline-tui/dist/src/drawing/canvas.js.map +1 -1
  212. package/node_modules/@fbincon/statusline-tui/dist/src/drawing/pages.js +6 -1
  213. package/node_modules/@fbincon/statusline-tui/dist/src/drawing/pages.js.map +1 -1
  214. package/node_modules/@fbincon/statusline-tui/dist/src/drawing/presentation.js +2 -0
  215. package/node_modules/@fbincon/statusline-tui/dist/src/drawing/presentation.js.map +1 -1
  216. package/node_modules/@fbincon/statusline-tui/dist/src/drawing/shortcuts.js +2 -0
  217. package/node_modules/@fbincon/statusline-tui/dist/src/drawing/shortcuts.js.map +1 -1
  218. package/node_modules/@fbincon/statusline-tui/dist/src/drawing.js +1 -1
  219. package/node_modules/@fbincon/statusline-tui/dist/src/drawing.js.map +1 -1
  220. package/node_modules/@fbincon/statusline-tui/dist/src/session.js +6 -0
  221. package/node_modules/@fbincon/statusline-tui/dist/src/session.js.map +1 -1
  222. package/node_modules/@fbincon/statusline-tui/dist/src/setup.d.ts +12 -0
  223. package/node_modules/@fbincon/statusline-tui/dist/src/setup.js +75 -0
  224. package/node_modules/@fbincon/statusline-tui/dist/src/setup.js.map +1 -0
  225. package/node_modules/@fbincon/statusline-tui/dist/src/state.d.ts +1 -1
  226. package/node_modules/@fbincon/statusline-tui/dist/src/state.js +12 -1
  227. package/node_modules/@fbincon/statusline-tui/dist/src/state.js.map +1 -1
  228. package/package.json +1 -1
@@ -0,0 +1,45 @@
1
+ /** Strict response validation shared by the native and external source managers. */
2
+ const object = (v) => v !== null && typeof v === 'object' && !Array.isArray(v);
3
+ const text = (v) => typeof v === 'string' && v.length <= 16384 && !/[\p{Cc}\p{Cs}]/u.test(v);
4
+ const nullable = (v) => v === null || text(v);
5
+ const scalar = (v) => v === null || text(v) || typeof v === 'boolean' || typeof v === 'number' && Number.isFinite(v);
6
+ const fields = (v, keys) => object(v) && Object.keys(v).length === keys.length && keys.every(key => Object.hasOwn(v, key));
7
+ const id = (v) => text(v) && /^[A-Za-z0-9][A-Za-z0-9_-]{0,95}$/u.test(v);
8
+ const scope = (v) => fields(v, ['project', 'session', 'agent']) && Object.values(v).every(nullable) && (v.agent === null || v.session !== null);
9
+ export const isSourceContext = (v) => fields(v, ['project', 'session', 'agent', 'branch', 'head']) && Object.values(v).every(nullable);
10
+ function definition(v) {
11
+ if (!fields(v, ['id', 'name', 'kind', 'scope', 'ttl_seconds', 'settings', 'enabled', 'revision']) || !id(v.id) || !text(v.name) || !['json', 'github', 'command'].includes(String(v.kind)) || !scope(v.scope) || !id(v.revision) || typeof v.enabled !== 'boolean' || typeof v.ttl_seconds !== 'number' || !Number.isInteger(v.ttl_seconds) || v.ttl_seconds < 1 || v.ttl_seconds > 86400 || !object(v.settings))
12
+ return false;
13
+ const s = v.settings;
14
+ if (v.kind === 'json')
15
+ return fields(s, ['path', 'pointer', 'observed_at_pointer', 'unit']) && Object.values(s).every(text);
16
+ if (v.kind === 'github')
17
+ return fields(s, ['host', 'repository', 'branch', 'account', 'pr']) && ['host', 'repository', 'branch', 'account'].every(key => text(s[key])) && (s.pr === null || typeof s.pr === 'number' && Number.isSafeInteger(s.pr) && s.pr > 0);
18
+ return fields(s, ['executable', 'args', 'cwd', 'input', 'output', 'timeout_ms']) && text(s.executable) && text(s.cwd) && Array.isArray(s.args) && s.args.length <= 128 && s.args.every(arg => typeof arg === 'string' && arg.length <= 8192 && !arg.includes('\0')) && object(s.input) && Object.entries(s.input).every(([key, value]) => /^[A-Za-z][A-Za-z0-9_]{0,63}$/u.test(key) && ['project', 'session', 'agent', 'branch', 'head'].includes(String(value))) && ['json', 'text'].includes(String(s.output)) && typeof s.timeout_ms === 'number' && Number.isInteger(s.timeout_ms) && s.timeout_ms >= 100 && s.timeout_ms <= 30000;
19
+ }
20
+ function job(v) {
21
+ return fields(v, ['version', 'id', 'source_id', 'source_revision', 'owner', 'context', 'started_at', 'deadline_at', 'state', 'reason']) && v.version === 1 && ['id', 'source_id', 'source_revision', 'owner'].every(key => id(v[key])) && isSourceContext(v.context) && text(v.started_at) && Number.isFinite(Date.parse(v.started_at)) && text(v.deadline_at) && Number.isFinite(Date.parse(v.deadline_at)) && ['running', 'completed', 'failed', 'cancelled'].includes(String(v.state)) && text(v.reason);
22
+ }
23
+ function view(v) {
24
+ return object(v) && nullable(v.source_id) && text(v.name) && ['valid', 'missing', 'partial', 'error', 'unsupported', 'disabled', 'unbound', 'mismatch'].includes(String(v.state)) && text(v.reason) && nullable(v.observed_at) && ['current', 'stale', 'unknown'].includes(String(v.freshness)) && scalar(v.value) && nullable(v.unit) && (v.fields === undefined || object(v.fields) && Object.values(v.fields).every(scalar));
25
+ }
26
+ export function isSourceResult(operation, value) {
27
+ if (!object(value))
28
+ return false;
29
+ if (operation === 'source_context')
30
+ return isSourceContext(value);
31
+ if (operation === 'source_review')
32
+ return fields(value, ['source', 'review_revision']) && definition(value.source) && object(value.source) && value.review_revision === value.source.revision;
33
+ if (['source_refresh', 'source_status', 'source_cancel'].includes(operation))
34
+ return job(value);
35
+ if (operation === 'source_diagnose')
36
+ return fields(value, ['source', 'view', 'jobs']) && definition(value.source) && view(value.view) && Array.isArray(value.jobs) && value.jobs.every(job);
37
+ if (!['sources_read', 'sources_apply'].includes(operation) || !fields(value, ['version', 'sources', 'bindings', 'revision', ...(operation === 'sources_apply' ? ['backup_dir', ...(Object.hasOwn(value, 'binding') ? ['binding'] : [])] : [])]))
38
+ return false;
39
+ if (value.version !== 1 || !text(value.revision) || !Array.isArray(value.sources) || value.sources.length > 128 || !value.sources.every(definition) || !Array.isArray(value.bindings) || value.bindings.length > 4096)
40
+ return false;
41
+ if (!value.bindings.every(b => fields(b, ['id', 'source_id']) && id(b.id) && id(b.source_id)))
42
+ return false;
43
+ return operation === 'sources_read' || nullable(value.backup_dir) && (value.binding === undefined || fields(value.binding, ['binding', 'hint']) && id(value.binding.binding) && text(value.binding.hint));
44
+ }
45
+ //# sourceMappingURL=source-validation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source-validation.js","sourceRoot":"","sources":["../../../src/editor/source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AAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,MAAM,GAAG,IAAI;QACjN,OAAO,KAAK,CAAC;IACjB,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;QACzF,OAAO,KAAK,CAAC;IACjB,OAAO,SAAS,KAAK,cAAc,IAAI,QAAQ,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,KAAK,SAAS,IAAI,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;AAC9M,CAAC"}
@@ -0,0 +1,27 @@
1
+ import type { SourceContext, SourceDefinition, SourceObservation, SourceReference, SourceRegistry, SourceScope, SourceSettings, SourceView } from '../contracts/ui.js';
2
+ export declare const SOURCE_FILENAME = "claude-statusline-sources.json";
3
+ export declare const MAX_SOURCE_BYTES = 1048576;
4
+ export declare const SOURCE_TYPES: string[];
5
+ export declare const INPUT_FIELDS: readonly ["project", "session", "agent", "branch", "head"];
6
+ export declare const emptyRegistry: () => SourceRegistry;
7
+ export declare function sourceError(reason: string): never;
8
+ export declare function sourceText(value: unknown, maximum?: number, empty?: boolean): string;
9
+ export declare function sourceId(value: unknown): string;
10
+ export declare function sourceScope(value: unknown): SourceScope;
11
+ export declare function sourceContext(value: unknown): SourceContext;
12
+ export declare function matchesScope(scope: SourceScope, context: SourceScope): boolean;
13
+ export declare function sameContext(a: SourceContext, b: SourceContext): boolean;
14
+ /** Cache only declared scope and supplied input identities; a project source is
15
+ * reusable across sessions unless it explicitly consumes session/agent input. */
16
+ export declare function observationContext(source: SourceDefinition, actual: SourceContext): SourceContext;
17
+ export declare function reference(value: unknown): SourceReference;
18
+ export declare function pointerParts(value: unknown): string[];
19
+ export declare function selectPointer(value: unknown, pointer: string): unknown;
20
+ export declare function settings(kind: SourceDefinition['kind'], value: unknown): SourceSettings;
21
+ export declare function definition(value: unknown): SourceDefinition;
22
+ export declare function registry(value: unknown): SourceRegistry;
23
+ export declare function stamp(value: unknown): string | null;
24
+ export declare function scalar(value: unknown): string | number | boolean;
25
+ export declare function emptyObservation(source: SourceDefinition, context: SourceContext, reason: string, state?: SourceObservation['state']): SourceObservation;
26
+ export declare function parseObservation(raw: unknown, source: SourceDefinition, context: SourceContext, contracted?: boolean): SourceObservation;
27
+ export declare function sourceView(source: SourceDefinition | undefined, context: SourceContext, current: SourceObservation | null, good: SourceObservation | null, now: number): SourceView;
@@ -0,0 +1,222 @@
1
+ import { ConfigError, object, exact, integer, isSchema } from '../config/validation.js';
2
+ import { numeric } from '../runtime/values.js';
3
+ export const SOURCE_FILENAME = 'claude-statusline-sources.json';
4
+ export const MAX_SOURCE_BYTES = 1048576;
5
+ export const SOURCE_TYPES = ['external-value', 'github-pr', 'github-ci'];
6
+ export const INPUT_FIELDS = ['project', 'session', 'agent', 'branch', 'head'];
7
+ export const emptyRegistry = () => ({ version: 1, sources: [], bindings: [] });
8
+ export function sourceError(reason) { throw new ConfigError('sources.error.' + reason, {}, reason); }
9
+ export function sourceText(value, maximum = 4096, empty = false) {
10
+ if (typeof value !== 'string' || (!empty && !value.trim()) || value.length > maximum || /[\p{Cc}\p{Cs}]/u.test(value))
11
+ sourceError('invalid');
12
+ return value;
13
+ }
14
+ export function sourceId(value) {
15
+ const id = sourceText(value, 96);
16
+ if (!/^[A-Za-z0-9][A-Za-z0-9_-]*$/u.test(id))
17
+ sourceError('invalid');
18
+ return id;
19
+ }
20
+ export function sourceScope(value) {
21
+ exact(value, ['project', 'session', 'agent'], 'source scope');
22
+ const result = Object.fromEntries(['project', 'session', 'agent'].map(key => [key, value[key] === null ? null : sourceText(value[key])]));
23
+ if (result.agent && !result.session)
24
+ sourceError('scope');
25
+ return result;
26
+ }
27
+ export function sourceContext(value) {
28
+ exact(value, ['project', 'session', 'agent', 'branch', 'head'], 'source context');
29
+ return { ...sourceScope({ project: value.project, session: value.session, agent: value.agent }),
30
+ branch: value.branch === null ? null : sourceText(value.branch), head: value.head === null ? null : sourceText(value.head) };
31
+ }
32
+ export function matchesScope(scope, context) {
33
+ return ['project', 'session', 'agent'].every(key => scope[key] === null || scope[key] === context[key]);
34
+ }
35
+ export function sameContext(a, b) {
36
+ return ['project', 'session', 'agent', 'branch', 'head'].every(key => a[key] === b[key]);
37
+ }
38
+ /** Cache only declared scope and supplied input identities; a project source is
39
+ * reusable across sessions unless it explicitly consumes session/agent input. */
40
+ export function observationContext(source, actual) {
41
+ const inputs = Object.values(source.settings.input ?? {});
42
+ const git = source.kind === 'github';
43
+ return {
44
+ project: source.scope.project !== null || git || inputs.some(key => ['project', 'branch', 'head'].includes(key)) ? actual.project : null,
45
+ session: source.scope.session !== null || inputs.includes('session') || inputs.includes('agent') ? actual.session : null,
46
+ agent: source.scope.agent !== null || inputs.includes('agent') ? actual.agent : null,
47
+ branch: git || inputs.includes('branch') ? actual.branch : null,
48
+ head: git || inputs.includes('head') ? actual.head : null,
49
+ };
50
+ }
51
+ export function reference(value) {
52
+ exact(value, ['binding', 'hint'], 'source reference');
53
+ return { binding: value.binding === null ? null : sourceId(value.binding), hint: sourceText(value.hint, 128, true) };
54
+ }
55
+ export function pointerParts(value) {
56
+ const text = sourceText(value, 512, true);
57
+ if (!text)
58
+ return [];
59
+ if (!text.startsWith('/') || /~(?![01])/u.test(text))
60
+ sourceError('pointer');
61
+ const parts = text.slice(1).split('/').map(part => part.replaceAll('~1', '/').replaceAll('~0', '~'));
62
+ if (parts.length > 32 || parts.some(part => ['__proto__', 'prototype', 'constructor'].includes(part)))
63
+ sourceError('pointer');
64
+ return parts;
65
+ }
66
+ export function selectPointer(value, pointer) {
67
+ for (const key of pointerParts(pointer)) {
68
+ if ((!object(value) && !Array.isArray(value)) || !Object.hasOwn(value, key))
69
+ return undefined;
70
+ value = value[key];
71
+ }
72
+ return value;
73
+ }
74
+ function keys(value, allowed) {
75
+ if (Object.keys(value).some(key => !allowed.includes(key)))
76
+ sourceError('invalid');
77
+ }
78
+ export function settings(kind, value) {
79
+ if (!object(value))
80
+ sourceError('invalid');
81
+ if (kind === 'json') {
82
+ keys(value, ['path', 'pointer', 'observed_at_pointer', 'unit']);
83
+ const pointer = sourceText(value.pointer ?? '/value', 512, true);
84
+ pointerParts(pointer);
85
+ const observed = sourceText(value.observed_at_pointer ?? '/observed_at', 512, true);
86
+ pointerParts(observed);
87
+ return { path: sourceText(value.path), pointer, observed_at_pointer: observed, unit: sourceText(value.unit ?? '', 32, true) };
88
+ }
89
+ if (kind === 'github') {
90
+ keys(value, ['host', 'repository', 'branch', 'account', 'pr']);
91
+ const host = sourceText(value.host ?? 'github.com', 253).toLowerCase(), repository = sourceText(value.repository, 256);
92
+ if (!/^[a-z0-9](?:[a-z0-9.-]*[a-z0-9])?$/u.test(host) || !/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/u.test(repository))
93
+ sourceError('invalid');
94
+ const branch = sourceText(value.branch, 256), account = sourceText(value.account, 128);
95
+ if (branch.startsWith('-') || !/^[A-Za-z0-9_-]+$/u.test(account))
96
+ sourceError('invalid');
97
+ return { host, repository, branch, account, pr: value.pr == null ? null : integer(value.pr, 1, Number.MAX_SAFE_INTEGER, 'PR') };
98
+ }
99
+ if (kind !== 'command')
100
+ sourceError('invalid');
101
+ keys(value, ['executable', 'args', 'cwd', 'input', 'output', 'timeout_ms']);
102
+ if (!Array.isArray(value.args) || value.args.length > 128 || value.args.some(arg => typeof arg !== 'string' || arg.length > 8192 || arg.includes('\0')))
103
+ sourceError('invalid');
104
+ const input = value.input ?? {};
105
+ if (!object(input) || Object.keys(input).length > 16 || Object.entries(input).some(([key, field]) => !/^[A-Za-z][A-Za-z0-9_]{0,63}$/u.test(key) || !INPUT_FIELDS.includes(field)))
106
+ sourceError('input');
107
+ const output = value.output ?? 'json';
108
+ if (output !== 'json' && output !== 'text')
109
+ sourceError('invalid');
110
+ return { executable: sourceText(value.executable), args: [...value.args], cwd: sourceText(value.cwd), input: { ...input }, output,
111
+ timeout_ms: integer(value.timeout_ms ?? 5000, 100, 30000, 'timeout_ms') };
112
+ }
113
+ export function definition(value) {
114
+ exact(value, ['id', 'name', 'kind', 'scope', 'ttl_seconds', 'settings', 'enabled', 'revision'], 'source');
115
+ if (!['json', 'github', 'command'].includes(value.kind) || typeof value.enabled !== 'boolean')
116
+ sourceError('invalid');
117
+ const kind = value.kind, scope = sourceScope(value.scope);
118
+ if (kind === 'github' && !scope.project)
119
+ sourceError('scope');
120
+ return { id: sourceId(value.id), name: sourceText(value.name, 128), kind, scope, ttl_seconds: integer(value.ttl_seconds, 1, 86400, 'ttl_seconds'),
121
+ settings: settings(kind, value.settings), enabled: value.enabled, revision: sourceId(value.revision) };
122
+ }
123
+ export function registry(value) {
124
+ exact(value, ['version', 'sources', 'bindings'], 'source registry');
125
+ if (!isSchema(value.version, 1) || !Array.isArray(value.sources) || !Array.isArray(value.bindings) || value.sources.length > 128 || value.bindings.length > 4096)
126
+ sourceError('invalid');
127
+ const sources = value.sources.map(definition), ids = new Set(sources.map(source => source.id));
128
+ if (ids.size !== sources.length)
129
+ sourceError('invalid');
130
+ const bindings = value.bindings.map(raw => { exact(raw, ['id', 'source_id'], 'source binding'); return { id: sourceId(raw.id), source_id: sourceId(raw.source_id) }; });
131
+ if (new Set(bindings.map(binding => binding.id)).size !== bindings.length || bindings.some(binding => !ids.has(binding.source_id)))
132
+ sourceError('invalid');
133
+ return { version: 1, sources, bindings };
134
+ }
135
+ export function stamp(value) {
136
+ if (value == null)
137
+ return null;
138
+ if (typeof value !== 'string' || !/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,3})?(?:Z|[+-]\d{2}:\d{2})$/u.test(value) || !Number.isFinite(Date.parse(value)))
139
+ sourceError('time');
140
+ const [year, month, day, hour, minute, second] = value.match(/\d+/gu).slice(0, 6).map(Number);
141
+ if (month < 1 || month > 12 || day < 1 || day > new Date(Date.UTC(year, month, 0)).getUTCDate() || hour > 23 || minute > 59 || second > 59)
142
+ sourceError('time');
143
+ return new Date(value).toISOString();
144
+ }
145
+ export function scalar(value) {
146
+ if (typeof value === 'boolean')
147
+ return value;
148
+ if (typeof value === 'string')
149
+ return value.replace(/\x1b(?:\[[0-?]*[ -/]*[@-~]|\][^\x07\x1b]*(?:\x07|\x1b\\))/gu, '').replace(/[\p{Cc}\p{Cs}\p{Zl}\p{Zp}]/gu, ' ').slice(0, 4096);
150
+ const n = numeric(value);
151
+ if (n !== null && Number.isFinite(n))
152
+ return n;
153
+ return sourceError('type');
154
+ }
155
+ export function emptyObservation(source, context, reason, state = 'error') {
156
+ return { version: 1, source_id: source.id, source_revision: source.revision, context, observed_at: null, state, reason, value: null, unit: null };
157
+ }
158
+ export function parseObservation(raw, source, context, contracted = false) {
159
+ const result = emptyObservation(source, context, 'missing', 'missing');
160
+ if (contracted) {
161
+ if (!object(raw) || !isSchema(raw.version, 1))
162
+ sourceError('version');
163
+ exact(raw, ['version', 'source_id', 'scope', 'observed_at', 'state', 'value', 'unit'], 'source output');
164
+ if (raw.source_id !== source.id || !matchesScope(sourceScope(raw.scope), context) || !['project', 'session', 'agent'].every(key => sourceScope(raw.scope)[key] === source.scope[key]))
165
+ sourceError('scope');
166
+ if (!['valid', 'missing', 'partial', 'error', 'unsupported'].includes(raw.state))
167
+ sourceError('invalid');
168
+ result.state = raw.state;
169
+ result.reason = result.state;
170
+ result.value = raw.value === null ? null : scalar(raw.value);
171
+ if (result.state === 'valid' && result.value === null)
172
+ sourceError('type');
173
+ result.observed_at = stamp(raw.observed_at);
174
+ result.unit = raw.unit === null ? null : sourceText(raw.unit, 32, true);
175
+ }
176
+ else {
177
+ if (object(raw) && Object.hasOwn(raw, 'version') && !isSchema(raw.version, 1))
178
+ sourceError('version');
179
+ if (object(raw) && Object.hasOwn(raw, 'source_id') && raw.source_id !== source.id)
180
+ sourceError('scope');
181
+ if (object(raw) && Object.hasOwn(raw, 'scope') && (!matchesScope(sourceScope(raw.scope), context) || !['project', 'session', 'agent'].every(key => sourceScope(raw.scope)[key] === source.scope[key])))
182
+ sourceError('scope');
183
+ const value = selectPointer(raw, source.settings.pointer ?? '/value');
184
+ result.observed_at = stamp(selectPointer(raw, source.settings.observed_at_pointer ?? '/observed_at'));
185
+ result.unit = source.settings.unit || null;
186
+ if (value !== undefined && value !== null) {
187
+ result.value = scalar(value);
188
+ result.state = 'valid';
189
+ result.reason = 'valid';
190
+ }
191
+ if (object(raw) && Object.hasOwn(raw, 'state')) {
192
+ if (!['valid', 'missing', 'partial', 'error', 'unsupported'].includes(raw.state))
193
+ sourceError('invalid');
194
+ result.state = raw.state;
195
+ result.reason = result.state;
196
+ if (result.state === 'valid' && result.value === null)
197
+ sourceError('type');
198
+ }
199
+ }
200
+ return result;
201
+ }
202
+ export function sourceView(source, context, current, good, now) {
203
+ const result = { source_id: source?.id ?? null, name: source?.name ?? '', state: 'unbound', reason: 'unbound', observed_at: null, freshness: 'unknown', value: null, unit: null };
204
+ if (!source)
205
+ return result;
206
+ if (!source.enabled)
207
+ return { ...result, state: 'disabled', reason: 'disabled' };
208
+ if (!matchesScope(source.scope, context))
209
+ return { ...result, state: 'mismatch', reason: 'scope' };
210
+ const valid = (entry) => entry && entry.source_id === source.id && entry.source_revision === source.revision && sameContext(entry.context, context);
211
+ if (current && !valid(current))
212
+ return { ...result, state: 'mismatch', reason: 'identity' };
213
+ if (!current)
214
+ return { ...result, state: 'missing', reason: 'not_refreshed' };
215
+ if (['scope', 'identity', 'account'].includes(current.reason))
216
+ return { ...result, state: 'mismatch', reason: current.reason };
217
+ const latest = current.value !== null && ['valid', 'partial'].includes(current.state) ? current : valid(good) ? good : { ...current, value: null, unit: null, fields: undefined };
218
+ const time = latest.observed_at === null ? null : Date.parse(latest.observed_at), age = time === null ? null : now - time;
219
+ return { ...result, state: current.state, reason: current.reason, value: latest.value, unit: latest.unit, observed_at: latest.observed_at,
220
+ freshness: age === null || age < 0 ? 'unknown' : age > source.ttl_seconds * 1000 ? 'stale' : 'current', ...(latest.fields ? { fields: latest.fields } : {}) };
221
+ }
222
+ //# sourceMappingURL=model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model.js","sourceRoot":"","sources":["../../../src/extensions/model.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACxF,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,MAAM,CAAC,MAAM,eAAe,GAAG,gCAAgC,CAAC;AAChE,MAAM,CAAC,MAAM,gBAAgB,GAAG,OAAO,CAAC;AACxC,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,gBAAgB,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC;AACzE,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,CAAU,CAAC;AACvF,MAAM,CAAC,MAAM,aAAa,GAAG,GAAmB,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAAC;AAC/F,M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I,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,GAAG,MAAM,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;AACtK,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { DisplayDraft } from '../contracts/ui.js';
2
+ /** A portable file cannot carry a machine's opaque authorization binding. */
3
+ export declare function unboundDisplay(display: DisplayDraft): DisplayDraft;
@@ -0,0 +1,6 @@
1
+ /** A portable file cannot carry a machine's opaque authorization binding. */
2
+ export function unboundDisplay(display) {
3
+ const clear = (nodes) => nodes.map(node => node.source ? { ...node, source: { binding: null, hint: node.source.hint } } : node);
4
+ return { ...display, instances: clear(display.instances), subagents: { ...display.subagents, instances: clear(display.subagents.instances) } };
5
+ }
6
+ //# sourceMappingURL=portable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"portable.js","sourceRoot":"","sources":["../../../src/extensions/portable.ts"],"names":[],"mappings":"AACA,6EAA6E;AAC7E,MAAM,UAAU,cAAc,CAAC,OAAqB;IAChD,MAAM,KAAK,GAAG,CAAC,KAAgC,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IAC3J,OAAO,EAAE,GAAG,OAAO,EAAE,SAAS,EAAE,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,SAAS,EAAE,EAAE,GAAG,OAAO,CAAC,SAAS,EAAE,SAAS,EAAE,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,EAAE,CAAC;AACnJ,CAAC"}