@fbincon/claude-code-statusline 3.6.0 → 3.7.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 (178) hide show
  1. package/README.md +77 -75
  2. package/candidate.json +331 -279
  3. package/node_modules/@fbincon/statusline-cli/dist/src/config/arguments.js +23 -5
  4. package/node_modules/@fbincon/statusline-cli/dist/src/config/arguments.js.map +1 -1
  5. package/node_modules/@fbincon/statusline-cli/dist/src/config/commands.js +43 -1
  6. package/node_modules/@fbincon/statusline-cli/dist/src/config/commands.js.map +1 -1
  7. package/node_modules/@fbincon/statusline-cli/dist/src/help.js +2 -1
  8. package/node_modules/@fbincon/statusline-cli/dist/src/help.js.map +1 -1
  9. package/node_modules/@fbincon/statusline-cli/dist/src/integration/doctor.js +2 -1
  10. package/node_modules/@fbincon/statusline-cli/dist/src/integration/doctor.js.map +1 -1
  11. package/node_modules/@fbincon/statusline-cli/dist/src/integration/install.js +2 -1
  12. package/node_modules/@fbincon/statusline-cli/dist/src/integration/install.js.map +1 -1
  13. package/node_modules/@fbincon/statusline-cli/dist/src/integration/model.js +1 -1
  14. package/node_modules/@fbincon/statusline-cli/dist/src/integration/mods.js +2 -1
  15. package/node_modules/@fbincon/statusline-cli/dist/src/integration/mods.js.map +1 -1
  16. package/node_modules/@fbincon/statusline-cli/dist/src/runtime/live/protocol.js +11 -3
  17. package/node_modules/@fbincon/statusline-cli/dist/src/runtime/live/protocol.js.map +1 -1
  18. package/node_modules/@fbincon/statusline-cli/dist/src/sources/automatic-state.d.ts +35 -0
  19. package/node_modules/@fbincon/statusline-cli/dist/src/sources/automatic-state.js +75 -0
  20. package/node_modules/@fbincon/statusline-cli/dist/src/sources/automatic-state.js.map +1 -0
  21. package/node_modules/@fbincon/statusline-cli/dist/src/sources/automatic.d.ts +12 -0
  22. package/node_modules/@fbincon/statusline-cli/dist/src/sources/automatic.js +99 -0
  23. package/node_modules/@fbincon/statusline-cli/dist/src/sources/automatic.js.map +1 -0
  24. package/node_modules/@fbincon/statusline-cli/dist/src/sources/command.js +5 -3
  25. package/node_modules/@fbincon/statusline-cli/dist/src/sources/command.js.map +1 -1
  26. package/node_modules/@fbincon/statusline-cli/dist/src/sources/lifecycle.d.ts +6 -0
  27. package/node_modules/@fbincon/statusline-cli/dist/src/sources/lifecycle.js +12 -0
  28. package/node_modules/@fbincon/statusline-cli/dist/src/sources/lifecycle.js.map +1 -0
  29. package/node_modules/@fbincon/statusline-cli/dist/src/sources/service.d.ts +9 -4
  30. package/node_modules/@fbincon/statusline-cli/dist/src/sources/service.js +84 -18
  31. package/node_modules/@fbincon/statusline-cli/dist/src/sources/service.js.map +1 -1
  32. package/node_modules/@fbincon/statusline-cli/dist/src/ui/protocol.d.ts +1 -1
  33. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/.claude-plugin/plugin.json +1 -1
  34. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/backend.ts +9 -5
  35. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/client/keys.ts +4 -0
  36. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/client/settings.ts +1 -0
  37. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/appearance.ts +3 -1
  38. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/cost-rate.ts +9 -0
  39. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/draft.ts +6 -1
  40. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/forms.ts +3 -1
  41. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/group-manager.ts +102 -0
  42. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/groups.ts +89 -0
  43. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/indicators.ts +20 -0
  44. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/source-manager.ts +20 -17
  45. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/source-validation.ts +5 -4
  46. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/generated-contracts.ts +23 -11
  47. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/i18n/generated-locales.ts +288 -6
  48. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/i18n/presentation.ts +3 -1
  49. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/resource-manifest.json +21 -17
  50. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/ui/client/draw.ts +5 -1
  51. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/ui/client/help.ts +1 -0
  52. package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/.claude-plugin/plugin.json +7 -1
  53. package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/hooks/observe.ts +27 -2
  54. package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/lib/generated-contracts.ts +1 -1
  55. package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/resource-manifest.json +6 -6
  56. package/node_modules/@fbincon/statusline-core/dist/src/config/catalog-data.d.ts +123 -0
  57. package/node_modules/@fbincon/statusline-core/dist/src/config/catalog-data.js +168 -0
  58. package/node_modules/@fbincon/statusline-core/dist/src/config/catalog-data.js.map +1 -1
  59. package/node_modules/@fbincon/statusline-core/dist/src/config/defaults.js +2 -2
  60. package/node_modules/@fbincon/statusline-core/dist/src/config/defaults.js.map +1 -1
  61. package/node_modules/@fbincon/statusline-core/dist/src/config/display.d.ts +2 -2
  62. package/node_modules/@fbincon/statusline-core/dist/src/config/display.js +22 -12
  63. package/node_modules/@fbincon/statusline-core/dist/src/config/display.js.map +1 -1
  64. package/node_modules/@fbincon/statusline-core/dist/src/config/editor-fields.js +6 -0
  65. package/node_modules/@fbincon/statusline-core/dist/src/config/editor-fields.js.map +1 -1
  66. package/node_modules/@fbincon/statusline-core/dist/src/config/formatting.js +8 -1
  67. package/node_modules/@fbincon/statusline-core/dist/src/config/formatting.js.map +1 -1
  68. package/node_modules/@fbincon/statusline-core/dist/src/config/import-review.js +2 -0
  69. package/node_modules/@fbincon/statusline-core/dist/src/config/import-review.js.map +1 -1
  70. package/node_modules/@fbincon/statusline-core/dist/src/config/instances.js +8 -6
  71. package/node_modules/@fbincon/statusline-core/dist/src/config/instances.js.map +1 -1
  72. package/node_modules/@fbincon/statusline-core/dist/src/config/presets.js +1 -1
  73. package/node_modules/@fbincon/statusline-core/dist/src/config/presets.js.map +1 -1
  74. package/node_modules/@fbincon/statusline-core/dist/src/contracts/generated-catalog.d.ts +1 -1
  75. package/node_modules/@fbincon/statusline-core/dist/src/contracts/generated-catalog.js +1 -1
  76. package/node_modules/@fbincon/statusline-core/dist/src/contracts/generated-catalog.js.map +1 -1
  77. package/node_modules/@fbincon/statusline-core/dist/src/contracts/runtime.d.ts +1 -1
  78. package/node_modules/@fbincon/statusline-core/dist/src/contracts/runtime.js +1 -1
  79. package/node_modules/@fbincon/statusline-core/dist/src/contracts/ui.d.ts +42 -9
  80. package/node_modules/@fbincon/statusline-core/dist/src/contracts/ui.js +5 -5
  81. package/node_modules/@fbincon/statusline-core/dist/src/contracts/ui.js.map +1 -1
  82. package/node_modules/@fbincon/statusline-core/dist/src/editor/appearance.js +3 -1
  83. package/node_modules/@fbincon/statusline-core/dist/src/editor/appearance.js.map +1 -1
  84. package/node_modules/@fbincon/statusline-core/dist/src/editor/backend.js +10 -5
  85. package/node_modules/@fbincon/statusline-core/dist/src/editor/backend.js.map +1 -1
  86. package/node_modules/@fbincon/statusline-core/dist/src/editor/cost-rate.d.ts +7 -0
  87. package/node_modules/@fbincon/statusline-core/dist/src/editor/cost-rate.js +8 -0
  88. package/node_modules/@fbincon/statusline-core/dist/src/editor/cost-rate.js.map +1 -0
  89. package/node_modules/@fbincon/statusline-core/dist/src/editor/draft.d.ts +2 -0
  90. package/node_modules/@fbincon/statusline-core/dist/src/editor/draft.js +5 -1
  91. package/node_modules/@fbincon/statusline-core/dist/src/editor/draft.js.map +1 -1
  92. package/node_modules/@fbincon/statusline-core/dist/src/editor/forms.js +3 -1
  93. package/node_modules/@fbincon/statusline-core/dist/src/editor/forms.js.map +1 -1
  94. package/node_modules/@fbincon/statusline-core/dist/src/editor/group-manager.d.ts +23 -0
  95. package/node_modules/@fbincon/statusline-core/dist/src/editor/group-manager.js +131 -0
  96. package/node_modules/@fbincon/statusline-core/dist/src/editor/group-manager.js.map +1 -0
  97. package/node_modules/@fbincon/statusline-core/dist/src/editor/groups.d.ts +18 -0
  98. package/node_modules/@fbincon/statusline-core/dist/src/editor/groups.js +103 -0
  99. package/node_modules/@fbincon/statusline-core/dist/src/editor/groups.js.map +1 -0
  100. package/node_modules/@fbincon/statusline-core/dist/src/editor/indicators.d.ts +11 -0
  101. package/node_modules/@fbincon/statusline-core/dist/src/editor/indicators.js +18 -0
  102. package/node_modules/@fbincon/statusline-core/dist/src/editor/indicators.js.map +1 -0
  103. package/node_modules/@fbincon/statusline-core/dist/src/editor/source-manager.d.ts +3 -2
  104. package/node_modules/@fbincon/statusline-core/dist/src/editor/source-manager.js +20 -11
  105. package/node_modules/@fbincon/statusline-core/dist/src/editor/source-manager.js.map +1 -1
  106. package/node_modules/@fbincon/statusline-core/dist/src/editor/source-validation.js +6 -4
  107. package/node_modules/@fbincon/statusline-core/dist/src/editor/source-validation.js.map +1 -1
  108. package/node_modules/@fbincon/statusline-core/dist/src/extensions/model.js +20 -4
  109. package/node_modules/@fbincon/statusline-core/dist/src/extensions/model.js.map +1 -1
  110. package/node_modules/@fbincon/statusline-core/dist/src/i18n/generated-locales.d.ts +282 -0
  111. package/node_modules/@fbincon/statusline-core/dist/src/i18n/generated-locales.js +288 -6
  112. package/node_modules/@fbincon/statusline-core/dist/src/i18n/generated-locales.js.map +1 -1
  113. package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/en.d.ts +4 -0
  114. package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/en.js +5 -1
  115. package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/en.js.map +1 -1
  116. package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/ja.d.ts +4 -0
  117. package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/ja.js +5 -1
  118. package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/ja.js.map +1 -1
  119. package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/ko.d.ts +4 -0
  120. package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/ko.js +5 -1
  121. package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/ko.js.map +1 -1
  122. package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/zh-CN.d.ts +4 -0
  123. package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/zh-CN.js +5 -1
  124. package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/zh-CN.js.map +1 -1
  125. package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/zh-HK.d.ts +4 -0
  126. package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/zh-HK.js +5 -1
  127. package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/zh-HK.js.map +1 -1
  128. package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/zh-TW.d.ts +4 -0
  129. package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/zh-TW.js +5 -1
  130. package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/zh-TW.js.map +1 -1
  131. package/node_modules/@fbincon/statusline-core/dist/src/release.d.ts +1 -1
  132. package/node_modules/@fbincon/statusline-core/dist/src/release.js +1 -1
  133. package/node_modules/@fbincon/statusline-core/dist/src/rendering/diagnose.d.ts +2 -2
  134. package/node_modules/@fbincon/statusline-core/dist/src/rendering/diagnose.js +6 -3
  135. package/node_modules/@fbincon/statusline-core/dist/src/rendering/diagnose.js.map +1 -1
  136. package/node_modules/@fbincon/statusline-core/dist/src/rendering/explain.js +4 -0
  137. package/node_modules/@fbincon/statusline-core/dist/src/rendering/explain.js.map +1 -1
  138. package/node_modules/@fbincon/statusline-core/dist/src/rendering/groups.d.ts +7 -0
  139. package/node_modules/@fbincon/statusline-core/dist/src/rendering/groups.js +124 -0
  140. package/node_modules/@fbincon/statusline-core/dist/src/rendering/groups.js.map +1 -0
  141. package/node_modules/@fbincon/statusline-core/dist/src/rendering/indicators.d.ts +4 -0
  142. package/node_modules/@fbincon/statusline-core/dist/src/rendering/indicators.js +48 -0
  143. package/node_modules/@fbincon/statusline-core/dist/src/rendering/indicators.js.map +1 -0
  144. package/node_modules/@fbincon/statusline-core/dist/src/rendering/items.js +12 -1
  145. package/node_modules/@fbincon/statusline-core/dist/src/rendering/items.js.map +1 -1
  146. package/node_modules/@fbincon/statusline-core/dist/src/rendering/metrics.d.ts +3 -0
  147. package/node_modules/@fbincon/statusline-core/dist/src/rendering/metrics.js +14 -0
  148. package/node_modules/@fbincon/statusline-core/dist/src/rendering/metrics.js.map +1 -1
  149. package/node_modules/@fbincon/statusline-core/dist/src/rendering/preferences.js +1 -1
  150. package/node_modules/@fbincon/statusline-core/dist/src/rendering/preferences.js.map +1 -1
  151. package/node_modules/@fbincon/statusline-core/dist/src/rendering/subagents.js +11 -1
  152. package/node_modules/@fbincon/statusline-core/dist/src/rendering/subagents.js.map +1 -1
  153. package/node_modules/@fbincon/statusline-core/dist/src/rendering/trace.d.ts +1 -1
  154. package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/model.d.ts +2 -1
  155. package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/model.js +2 -1
  156. package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/model.js.map +1 -1
  157. package/node_modules/@fbincon/statusline-core/resources/i18n/locales/en.json +48 -1
  158. package/node_modules/@fbincon/statusline-core/resources/i18n/locales/ja.json +48 -1
  159. package/node_modules/@fbincon/statusline-core/resources/i18n/locales/ko.json +48 -1
  160. package/node_modules/@fbincon/statusline-core/resources/i18n/locales/zh-CN.json +48 -1
  161. package/node_modules/@fbincon/statusline-core/resources/i18n/locales/zh-HK.json +48 -1
  162. package/node_modules/@fbincon/statusline-core/resources/i18n/locales/zh-TW.json +48 -1
  163. package/node_modules/@fbincon/statusline-platform/dist/src/files.d.ts +3 -0
  164. package/node_modules/@fbincon/statusline-platform/dist/src/files.js +7 -2
  165. package/node_modules/@fbincon/statusline-platform/dist/src/files.js.map +1 -1
  166. package/node_modules/@fbincon/statusline-platform/dist/src/source-files.js +18 -3
  167. package/node_modules/@fbincon/statusline-platform/dist/src/source-files.js.map +1 -1
  168. package/node_modules/@fbincon/statusline-tui/dist/src/drawing/pages.js +5 -0
  169. package/node_modules/@fbincon/statusline-tui/dist/src/drawing/pages.js.map +1 -1
  170. package/node_modules/@fbincon/statusline-tui/dist/src/drawing/presentation.js +6 -0
  171. package/node_modules/@fbincon/statusline-tui/dist/src/drawing/presentation.js.map +1 -1
  172. package/node_modules/@fbincon/statusline-tui/dist/src/drawing/shortcuts.js +2 -0
  173. package/node_modules/@fbincon/statusline-tui/dist/src/drawing/shortcuts.js.map +1 -1
  174. package/node_modules/@fbincon/statusline-tui/dist/src/drawing.js +1 -1
  175. package/node_modules/@fbincon/statusline-tui/dist/src/drawing.js.map +1 -1
  176. package/node_modules/@fbincon/statusline-tui/dist/src/state.js +12 -1
  177. package/node_modules/@fbincon/statusline-tui/dist/src/state.js.map +1 -1
  178. package/package.json +1 -1
@@ -5,12 +5,13 @@ import { t, text, type Language, type LocalizedText } from '../i18n/index.ts';
5
5
  import { inputKey, inputView, textInput, type TextInput, type TextKey } from './text-input.ts';
6
6
  import { wrapText } from '../../ui/text.ts';
7
7
  import { BackendError } from '../backend.ts';
8
- type Action = 'edit' | 'review' | 'disable' | 'remove' | 'bind' | 'unbind' | 'refresh' | 'status' | 'cancel' | 'diagnose';
8
+ type Action = 'edit' | 'review' | 'disable' | 'remove' | 'bind' | 'unbind' | 'refresh' | 'status' | 'cancel' | 'diagnose' | 'auto-review' | 'auto-off';
9
9
  export interface SourceManager {
10
10
  library: SourcesResult | null;
11
11
  context: SourceContext | null;
12
12
  owner: string;
13
- page: 'list' | 'actions' | 'kind' | 'form' | 'review' | 'remove' | 'bind' | 'unbind' | 'diagnose';
13
+ page: 'list' | 'actions' | 'kind' | 'form' | 'review' | 'remove' | 'bind' | 'unbind' | 'diagnose' | 'auto-review';
14
+ automaticInterval: number;
14
15
  cursor: number;
15
16
  scroll: number;
16
17
  selected: string | null;
@@ -24,7 +25,7 @@ export interface SourceManager {
24
25
  details: string[];
25
26
  jobs: SourceJob[];
26
27
  message: LocalizedText | null;
27
- effect: 'load' | 'save' | 'review' | 'enable' | 'disable' | 'remove' | 'bind' | 'refresh' | 'status' | 'cancel' | 'diagnose' | 'close' | null;
28
+ effect: 'load' | 'save' | 'review' | 'enable' | 'disable' | 'remove' | 'bind' | 'refresh' | 'status' | 'cancel' | 'diagnose' | 'close' | 'auto-review' | 'auto-on' | 'auto-off' | null;
28
29
  target: {
29
30
  scope: Scope;
30
31
  id: string;
@@ -35,10 +36,10 @@ export interface SourceBackend {
35
36
  }
36
37
  const external = ['external-value', 'github-pr', 'github-ci'];
37
38
  export function openSources(editor: Editor): void {
38
- editor.sources = { library: null, context: null, owner: 'editor-' + Date.now().toString(36) + '-' + Math.random().toString(36).slice(2), page: 'list', cursor: 0, scroll: 0, selected: null, kind: 'json', editing: false, fields: [], review: null, details: [], jobs: [], message: null, effect: 'load', target: null };
39
+ editor.sources = { library: null, context: null, owner: 'editor-' + Date.now().toString(36) + '-' + Math.random().toString(36).slice(2), page: 'list', automaticInterval: 300, cursor: 0, scroll: 0, selected: null, kind: 'json', editing: false, fields: [], review: null, details: [], jobs: [], message: null, effect: 'load', target: null };
39
40
  }
40
41
  function source(editor: Editor): SourceDefinition | undefined { return editor.sources!.library?.sources.find(s => s.id === editor.sources!.selected); }
41
- function actions(editor: Editor): Action[] { return ['edit', 'review', ...(source(editor)?.enabled ? ['disable' as const] : []), 'bind', 'refresh', 'status', 'cancel', 'diagnose', 'remove', 'unbind']; }
42
+ function actions(editor: Editor): Action[] { return ['edit', 'review', ...(source(editor)?.enabled ? ['disable' as const] : []), 'bind', 'refresh', 'status', 'cancel', 'diagnose', 'remove', 'unbind', ...(source(editor)?.kind === 'github' ? ['auto-review' as const, 'auto-off' as const] : [])]; }
42
43
  function targets(editor: Editor) {
43
44
  const s = source(editor);
44
45
  return (['main', 'subagent'] as const).flatMap(scope => (scope === 'main' ? editor.draft.display.instances : editor.draft.display.subagents.instances)
@@ -99,10 +100,11 @@ export function sourcesKey(editor: Editor, event: TextKey): 'sources' | null {
99
100
  }
100
101
  if (!plain)
101
102
  return null;
102
- if (['review', 'diagnose'].includes(m.page) && ['up', 'down', 'pageup', 'pagedown', 'home'].includes(key)) {
103
+ if (['review', 'diagnose', 'auto-review'].includes(m.page) && ['up', 'down', 'pageup', 'pagedown', 'home'].includes(key)) {
103
104
  m.scroll = key === 'home' ? 0 : Math.max(0, m.scroll + (key === 'up' ? -1 : key === 'pageup' ? -8 : key === 'pagedown' ? 8 : 1));
104
105
  return null;
105
106
  }
107
+ if (m.page === 'auto-review' && ['left', 'right'].includes(key)) { m.automaticInterval = Math.max(60, Math.min(86400, m.automaticInterval + (key === 'left' ? -60 : 60))); return null; }
106
108
  if (key === 'up' || key === 'down')
107
109
  m.cursor = Math.max(0, Math.min(count(editor) - 1, m.cursor + (key === 'up' ? -1 : 1)));
108
110
  if (key === 'r' && m.page === 'list')
@@ -131,8 +133,8 @@ export function sourcesKey(editor: Editor, event: TextKey): 'sources' | null {
131
133
  else
132
134
  m.effect = action;
133
135
  }
134
- else if (m.page === 'review')
135
- m.effect = 'enable';
136
+ else if (m.page === 'review') m.effect = 'enable';
137
+ else if (m.page === 'auto-review') m.effect = 'auto-on';
136
138
  else if (m.page === 'remove')
137
139
  m.effect = 'remove';
138
140
  else if (m.page === 'unbind') {
@@ -158,7 +160,7 @@ export async function closeSources(editor: Editor, backend: SourceBackend): Prom
158
160
  if (!m)
159
161
  return;
160
162
  let failed: unknown;
161
- for (const job of m.jobs.filter(job => job.state === 'running')) {
163
+ for (const job of m.jobs.filter(job => job.state === 'running' && job.owner === m.owner && job.trigger === 'manual')) {
162
164
  try { await backend.request('source_cancel', { id: job.id }); }
163
165
  catch (error) { failed = error; }
164
166
  }
@@ -183,9 +185,10 @@ export async function performSourceAction(editor: Editor, backend: SourceBackend
183
185
  m.context = await backend.request('source_context', { project: target?.project_root ?? (target?.target.kind === 'project' ? target.target.path : null), session: null, agent: null });
184
186
  return;
185
187
  }
186
- if (effect === 'review') {
188
+ if (effect === 'review' || effect === 'auto-review') {
187
189
  m.review = await backend.request('source_review', { id: m.selected });
188
- m.page = 'review';
190
+ m.page = effect;
191
+ m.automaticInterval = m.library?.automatic.find(p => p.source_id === m.selected)?.interval_seconds ?? Math.max(60, Math.min(86400, m.review.source.ttl_seconds));
189
192
  m.scroll = 0;
190
193
  return;
191
194
  }
@@ -195,7 +198,7 @@ export async function performSourceAction(editor: Editor, backend: SourceBackend
195
198
  const observed = await backend.request('source_diagnose', { id: m.selected, context });
196
199
  const jobs = await Promise.all(observed.jobs.map(job => backend.request(effect === 'cancel' && job.state === 'running' ? 'source_cancel' : 'source_status', { id: job.id })));
197
200
  m.jobs = m.jobs.map(job => jobs.find(updated => updated.id === job.id) ?? job);
198
- m.details = jobs.map(job => `${job.id}: ${job.state} (${job.reason})`);
201
+ m.details = [JSON.stringify(observed.automatic, null, 2), ...jobs.map(job => `${job.id}: ${job.state} (${job.reason})`)];
199
202
  m.page = 'diagnose';
200
203
  m.scroll = 0;
201
204
  return;
@@ -230,8 +233,8 @@ export async function performSourceAction(editor: Editor, backend: SourceBackend
230
233
  parsed.pr = parsed.pr === '' ? null : Number(parsed.pr);
231
234
  Object.assign(payload, { action: m.editing ? 'edit' : 'add', id, source: { name: name || id, kind: m.kind, scope: { project: project || null, session: session || null, agent: agent || null }, ttl_seconds: Number(ttl_seconds), settings: parsed } });
232
235
  }
233
- if (effect === 'enable')
234
- payload.review_revision = m.review?.review_revision;
236
+ if (effect === 'enable' || effect === 'auto-on') payload.review_revision = m.review?.review_revision;
237
+ if (effect === 'auto-on') payload.interval_seconds = m.automaticInterval;
235
238
  const result = await backend.request('sources_apply', payload);
236
239
  m.library = result;
237
240
  if (effect === 'bind' && m.target && result.binding) {
@@ -241,7 +244,7 @@ export async function performSourceAction(editor: Editor, backend: SourceBackend
241
244
  m.message = text('sources.bound');
242
245
  }
243
246
  else
244
- m.message = text('sources.saved');
247
+ m.message = text(effect === 'auto-on' ? 'sources.automatic_saved' : 'sources.saved');
245
248
  m.page = 'list';
246
249
  m.cursor = 0;
247
250
  m.scroll = 0;
@@ -264,7 +267,7 @@ export function sourcesView(editor: Editor, language: Language, width: number, h
264
267
  if (m.message)
265
268
  add(t(m.message.key, language, m.message.params));
266
269
  if (m.page === 'list') {
267
- m.library?.sources.forEach((s, i) => add(`${s.name} · ${s.kind} · ${tr(s.enabled ? 'enabled' : 'disabled')}`, m.cursor === i));
270
+ m.library?.sources.forEach((s, i) => add(`${s.name} · ${s.kind} · ${tr(s.enabled ? 'enabled' : 'disabled')}${s.kind === 'github' ? ' · ' + tr(m.library!.automatic.some(p => p.source_id === s.id && p.enabled) ? 'automatic_on' : 'automatic_off') : ''}`, m.cursor === i));
268
271
  add('+ ' + tr('add'), m.cursor === (m.library?.sources.length ?? 0));
269
272
  }
270
273
  else if (m.page === 'actions')
@@ -288,7 +291,7 @@ export function sourcesView(editor: Editor, language: Language, width: number, h
288
291
  else if (m.page === 'remove')
289
292
  add(tr('remove_confirm') + ' ' + source(editor)?.name, true);
290
293
  else {
291
- const lines = m.page === 'review' ? [tr('enable_review'), ...JSON.stringify(m.review?.source, null, 2).split('\n')] : m.details;
294
+ const lines = ['review', 'auto-review'].includes(m.page) ? [tr(m.page === 'auto-review' ? 'automatic_review' : 'enable_review'), ...(m.page === 'auto-review' ? [tr('interval') + ': ' + m.automaticInterval + ' s (←/→)'] : []), ...JSON.stringify(m.review?.source, null, 2).split('\n')] : m.details;
292
295
  const wrapped = lines.flatMap(line => wrapText([line], width));
293
296
  const capacity = Math.max(1, height - rows.length);
294
297
  const start = Math.min(m.scroll, Math.max(0, wrapped.length - capacity));
@@ -19,7 +19,7 @@ function definition(v: unknown): boolean {
19
19
  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;
20
20
  }
21
21
  function job(v: unknown): boolean {
22
- 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
+ return fields(v, ['version', 'id', 'source_id', 'source_revision', 'owner', 'context', 'started_at', 'deadline_at', 'state', 'reason', 'trigger', 'identity']) && v.version === 2 && ['manual', 'automatic'].includes(String(v.trigger)) && typeof v.identity === 'string' && /^[a-f0-9]{64}$/.test(v.identity) && ['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);
23
23
  }
24
24
  function view(v: unknown): boolean {
25
25
  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));
@@ -34,11 +34,12 @@ export function isSourceResult(operation: string, value: unknown): boolean {
34
34
  if (['source_refresh', 'source_status', 'source_cancel'].includes(operation))
35
35
  return job(value);
36
36
  if (operation === 'source_diagnose')
37
- return fields(value, ['source', 'view', 'jobs']) && definition(value.source) && view(value.view) && Array.isArray(value.jobs) && value.jobs.every(job);
38
- if (!['sources_read', 'sources_apply'].includes(operation) || !fields(value, ['version', 'sources', 'bindings', 'revision', ...(operation === 'sources_apply' ? ['backup_dir', ...(Object.hasOwn(value, 'binding') ? ['binding'] : [])] : [])]))
37
+ return fields(value, ['source', 'view', 'jobs', 'automatic']) && object(value.automatic) && ['off', 'waiting', 'running', 'backoff', 'paused'].includes(String(value.automatic.state)) && text(value.automatic.reason) && ['next_at', 'last_attempt', 'last_success'].every(k => value.automatic && nullable((value.automatic as Record<string, unknown>)[k])) && typeof value.automatic.interval_seconds === 'number' && value.automatic.interval_seconds >= 60 && value.automatic.interval_seconds <= 86400 && definition(value.source) && view(value.view) && Array.isArray(value.jobs) && value.jobs.every(job);
38
+ if (!['sources_read', 'sources_apply'].includes(operation) || !fields(value, ['version', 'sources', 'bindings', 'automatic', 'revision', ...(operation === 'sources_apply' ? ['backup_dir', ...(Object.hasOwn(value, 'binding') ? ['binding'] : [])] : [])]))
39
39
  return false;
40
- 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
+ if (value.version !== 2 || !text(value.revision) || !Array.isArray(value.sources) || value.sources.length > 128 || !value.sources.every(definition) || !Array.isArray(value.bindings) || value.bindings.length > 4096)
41
41
  return false;
42
+ if (!Array.isArray(value.automatic) || value.automatic.length > value.sources.length || !value.automatic.every(p => fields(p, ['source_id', 'enabled', 'review_revision', 'interval_seconds', 'auth_revision']) && id(p.source_id) && typeof p.enabled === 'boolean' && id(p.review_revision) && typeof p.interval_seconds === 'number' && Number.isInteger(p.interval_seconds) && p.interval_seconds >= 60 && p.interval_seconds <= 86400 && typeof p.auth_revision === 'string' && /^[a-f0-9]{64}$/.test(p.auth_revision))) return false;
42
43
  if (!value.bindings.every(b => fields(b, ['id', 'source_id']) && id(b.id) && id(b.source_id)))
43
44
  return false;
44
45
  return operation === 'sources_read' || nullable(value.backup_dir) && (value.binding === undefined || fields(value.binding, ['binding', 'hint']) && id(value.binding.binding) && text(value.binding.hint));
@@ -1,8 +1,8 @@
1
1
  // Generated by tools/generation/resources.ts; do not edit.
2
- export const PROTOCOL_VERSION = 17 as const;
2
+ export const PROTOCOL_VERSION = 21 as const;
3
3
  export const ITEM_DEFAULTS = {"label": null, "icon": null, "priority": 50, "max_width": null, "formatting": {}, "foreground": null, "background": null, "visibility": "always", "visibility_threshold": 70};
4
4
  export const VISIBILITY_ITEMS = {"main": {"git": "git-dirty", "git-changes": "git-dirty", "active-agents": "nonzero", "task-progress": "nonzero", "context-used": "used-at-least", "context-remaining": "used-at-least", "five-hour-limit": "used-at-least", "weekly-limit": "used-at-least", "spend-limit": "used-at-least"}, "subagent": {"context-used": "used-at-least", "context-remaining": "used-at-least"}} as const;
5
- export const GUIDANCE_KEYS = {"source_kinds": ["configuration", "official_input", "local_git", "local_system", "transcript", "local_state", "lifecycle", "native_timing", "live_metrics", "telemetry"], "scopes": ["main", "main_context", "session", "all_sessions", "task", "subagent", "subagent_context", "repository", "local", "latest_request"], "requirements": ["observed_field", "subagent_rows", "agent_context", "configured_effort", "agent_effort_optional", "git_repository", "git_upstream", "git_base", "pull_request", "worktree_session", "usage_records", "task_observation", "native_timing", "complete_waits", "live_metrics", "owned_agents", "checklist_events", "tool_events", "complete_stream", "request_coverage", "existing_telemetry", "gateway", "gateway_284", "valid_window", "warm_cache", "fast_mode", "thinking", "agent_mode", "vim_mode", "context_observation"]} as const;
5
+ export const GUIDANCE_KEYS = {"source_kinds": ["configuration", "official_input", "local_git", "local_system", "transcript", "local_state", "lifecycle", "native_timing", "live_metrics", "telemetry"], "scopes": ["main", "main_context", "session", "all_sessions", "task", "subagent", "subagent_context", "repository", "local", "latest_request"], "requirements": ["observed_field", "subagent_rows", "agent_context", "configured_effort", "agent_effort_optional", "git_repository", "git_upstream", "git_base", "pull_request", "worktree_session", "usage_records", "task_observation", "native_timing", "complete_waits", "live_metrics", "owned_agents", "checklist_events", "tool_events", "complete_stream", "request_coverage", "existing_telemetry", "gateway", "gateway_284", "valid_window", "warm_cache", "fast_mode", "thinking", "agent_mode", "vim_mode", "context_observation", "cost_rate"]} as const;
6
6
  export const POWERLINE_FIELDS = [
7
7
  {
8
8
  "key": "powerline.padding",
@@ -486,7 +486,7 @@ export const EDITOR_FIELDS = {
486
486
  export const PRESETS = [{"id": "developer", "purpose_key": "quick.purpose.developer", "requirements_key": "quick.requirements.developer", "example": false, "label": "Developer", "rows": [["model-with-effort", "current-dir", "git"], ["context-remaining", "tokens", "task-timer", "session-cost"]], "layout_mode": "explicit"}, {"id": "minimal", "purpose_key": "quick.purpose.minimal", "requirements_key": "quick.requirements.minimal", "example": false, "label": "Minimal", "rows": [["model-with-effort", "current-dir", "context-remaining", "task-timer"]], "layout_mode": "auto"}, {"id": "monitoring", "purpose_key": "quick.purpose.monitoring", "requirements_key": "quick.requirements.monitoring", "example": false, "label": "Monitoring", "rows": [["context-used", "five-hour-limit", "weekly-limit", "spend-limit"], ["five-hour-reset", "weekly-reset", "cache-state", "cache-expires"], ["session-cost", "session-duration", "api-duration", "api-requests", "cache-misses"]], "layout_mode": "explicit"}, {"id": "multi-agent", "purpose_key": "quick.purpose.multi-agent", "requirements_key": "quick.requirements.multi-agent", "example": false, "label": "Multi Agent", "rows": [["model-with-effort", "current-dir", "git"], ["context-remaining", "tokens", "task-timer"]], "layout_mode": "explicit"}, {"id": "left-right", "purpose_key": "quick.purpose.left-right", "requirements_key": "quick.requirements.left-right", "example": true, "label": "Left Right", "rows": [["model-with-effort", "git", "spacer", "context-remaining"]], "layout_mode": "explicit"}, {"id": "repeated-metrics", "purpose_key": "quick.purpose.repeated-metrics", "requirements_key": "quick.requirements.repeated-metrics", "example": true, "label": "Repeated Metrics", "rows": [["input-tokens", "input-tokens"]], "layout_mode": "explicit"}, {"id": "daily-development", "purpose_key": "quick.purpose.daily-development", "requirements_key": "quick.requirements.daily-development", "example": false, "label": "Daily Development", "rows": [["model-with-effort", "current-dir", "git", "context-remaining", "task-timer"], ["session-cost"]], "layout_mode": "explicit"}, {"id": "agent-focus", "purpose_key": "quick.purpose.agent-focus", "requirements_key": "quick.requirements.agent-focus", "example": false, "label": "Agent Focus", "rows": [["task-timer", "context-remaining", "git"], ["run-state", "task-progress", "active-agents"]], "layout_mode": "explicit"}, {"id": "quota-watch", "purpose_key": "quick.purpose.quota-watch", "requirements_key": "quick.requirements.quota-watch", "example": false, "label": "Quota Watch", "rows": [["context-used", "five-hour-limit", "weekly-limit"], ["five-hour-reset", "weekly-reset"], ["session-cost", "spend-limit", "cache-state", "cache-expires"]], "layout_mode": "explicit"}] as const;
487
487
  export const FORMAT_CHOICES = {"model_name": ["original", "short"], "number_format": ["legacy", "compact", "full", "grouped"], "labels": ["legacy", "short", "off"], "icons": ["legacy", "unicode", "ascii", "off"], "allowance": ["remaining", "used"], "reset_format": ["countdown", "time", "datetime"], "reset_timezone": ["local", "UTC"]} as const;
488
488
  export const FORMAT_DEFAULTS = {"model_name": "original", "number_format": "legacy", "labels": "legacy", "icons": "legacy", "allowance": "remaining", "reset_format": "countdown", "reset_timezone": "local", "thresholds": {"enabled": false, "warning": 70, "critical": 90}} as const;
489
- export type MainItemId = "model-with-effort" | "model" | "effort" | "fast-mode" | "thinking" | "current-dir" | "project-name" | "hostname" | "git" | "git-branch" | "git-changes" | "git-ahead-behind" | "branch-diff" | "pr" | "repo" | "worktree" | "context-remaining" | "context-used" | "context-window-size" | "context-tokens" | "five-hour-limit" | "five-hour-reset" | "weekly-limit" | "weekly-reset" | "spend-limit" | "spend-amount" | "spend-period" | "tokens" | "input-tokens" | "output-tokens" | "prompt-cache" | "cache-state" | "cache-expires" | "cache-misses" | "cache-miss-reason" | "api-requests" | "task-timer" | "task-active-timer" | "version" | "session" | "session-name" | "session-id" | "session-id-short" | "output-style" | "cost" | "session-cost" | "session-duration" | "api-duration" | "lines-changed" | "agent" | "vim-mode" | "run-state" | "permission-mode" | "active-agents" | "task-progress" | "last-tool" | "ttft" | "output-rate" | "prompt-input-tokens" | "prompt-output-tokens" | "prompt-cost" | "text" | "spacer" | "external-value" | "github-pr" | "github-ci";
489
+ export type MainItemId = "model-with-effort" | "model" | "effort" | "fast-mode" | "thinking" | "current-dir" | "project-name" | "hostname" | "git" | "git-branch" | "git-changes" | "git-ahead-behind" | "branch-diff" | "pr" | "repo" | "worktree" | "context-remaining" | "context-used" | "context-window-size" | "context-tokens" | "five-hour-limit" | "five-hour-reset" | "weekly-limit" | "weekly-reset" | "spend-limit" | "spend-amount" | "spend-period" | "tokens" | "input-tokens" | "output-tokens" | "prompt-cache" | "cache-state" | "cache-expires" | "cache-misses" | "cache-miss-reason" | "api-requests" | "task-timer" | "task-active-timer" | "version" | "session" | "session-name" | "session-id" | "session-id-short" | "output-style" | "cost" | "session-cost" | "session-cost-rate" | "session-duration" | "api-duration" | "lines-changed" | "agent" | "vim-mode" | "run-state" | "permission-mode" | "active-agents" | "task-progress" | "last-tool" | "ttft" | "output-rate" | "prompt-input-tokens" | "prompt-output-tokens" | "prompt-cost" | "text" | "spacer" | "external-value" | "github-pr" | "github-ci";
490
490
  export type SubagentItemId = "status-elapsed" | "status" | "name" | "model-with-effort" | "model" | "effort" | "context-remaining" | "context-used" | "context-tokens" | "context-window-size" | "elapsed" | "task" | "tokens" | "current-dir" | "text" | "spacer" | "external-value";
491
491
  export type Palette = "default" | "ansi";
492
492
  export type Theme = "classic" | "dark" | "light" | "terminal";
@@ -498,7 +498,7 @@ export type ScopeLabels = "off" | "when-subagents" | "always";
498
498
  export type StatuslineLanguage = "en" | "zh-CN" | "zh-TW" | "zh-HK" | "ja" | "ko";
499
499
  export type Scope = "main" | "subagent";
500
500
  export type UnavailableReason = "not_observed" | "unsupported_host" | "unknown_host_version" | "source_unavailable" | "condition_not_met" | "runtime_disabled" | "native_timing_disabled" | "wait_coverage_missing" | "stale" | "incomplete" | "ambiguous_owner" | "observed_only" | "missing_stream" | "synthetic_response" | "abnormal_clock" | "inconsistent_request" | "request_join_unavailable";
501
- export const MAIN_ITEM_IDS = ["model-with-effort", "model", "effort", "fast-mode", "thinking", "current-dir", "project-name", "hostname", "git", "git-branch", "git-changes", "git-ahead-behind", "branch-diff", "pr", "repo", "worktree", "context-remaining", "context-used", "context-window-size", "context-tokens", "five-hour-limit", "five-hour-reset", "weekly-limit", "weekly-reset", "spend-limit", "spend-amount", "spend-period", "tokens", "input-tokens", "output-tokens", "prompt-cache", "cache-state", "cache-expires", "cache-misses", "cache-miss-reason", "api-requests", "task-timer", "task-active-timer", "version", "session", "session-name", "session-id", "session-id-short", "output-style", "cost", "session-cost", "session-duration", "api-duration", "lines-changed", "agent", "vim-mode", "run-state", "permission-mode", "active-agents", "task-progress", "last-tool", "ttft", "output-rate", "prompt-input-tokens", "prompt-output-tokens", "prompt-cost", "text", "spacer", "external-value", "github-pr", "github-ci"] as const;
501
+ export const MAIN_ITEM_IDS = ["model-with-effort", "model", "effort", "fast-mode", "thinking", "current-dir", "project-name", "hostname", "git", "git-branch", "git-changes", "git-ahead-behind", "branch-diff", "pr", "repo", "worktree", "context-remaining", "context-used", "context-window-size", "context-tokens", "five-hour-limit", "five-hour-reset", "weekly-limit", "weekly-reset", "spend-limit", "spend-amount", "spend-period", "tokens", "input-tokens", "output-tokens", "prompt-cache", "cache-state", "cache-expires", "cache-misses", "cache-miss-reason", "api-requests", "task-timer", "task-active-timer", "version", "session", "session-name", "session-id", "session-id-short", "output-style", "cost", "session-cost", "session-cost-rate", "session-duration", "api-duration", "lines-changed", "agent", "vim-mode", "run-state", "permission-mode", "active-agents", "task-progress", "last-tool", "ttft", "output-rate", "prompt-input-tokens", "prompt-output-tokens", "prompt-cost", "text", "spacer", "external-value", "github-pr", "github-ci"] as const;
502
502
  export const SUBAGENT_ITEM_IDS = ["status-elapsed", "status", "name", "model-with-effort", "model", "effort", "context-remaining", "context-used", "context-tokens", "context-window-size", "elapsed", "task", "tokens", "current-dir", "text", "spacer", "external-value"] as const;
503
503
  export const PALETTE_VALUES = ["default", "ansi"] as const;
504
504
  export const THEME_VALUES = ["classic", "dark", "light", "terminal"] as const;
@@ -535,6 +535,7 @@ export interface CatalogItem {
535
535
  capabilities?: ItemCapability;
536
536
  }
537
537
  export interface ItemCapability {
538
+ indicator?: boolean;
538
539
  formats: string[];
539
540
  visibility: string[];
540
541
  link: boolean;
@@ -600,6 +601,10 @@ export interface FormattingDraft {
600
601
  thresholds: ThresholdDraft;
601
602
  }
602
603
  export interface ItemOptionsDraft {
604
+ presentation?: "numeric" | "bar";
605
+ bar_width?: number;
606
+ cost_rate_basis?: 'session' | 'api';
607
+ bar_style?: "auto" | "unicode" | "ascii";
603
608
  link?: 'off' | 'auto' | 'on';
604
609
  label: string | null;
605
610
  icon: string | null;
@@ -619,11 +624,15 @@ export interface InstanceDraft {
619
624
  options: ItemOptionsDraft;
620
625
  text: string | null;
621
626
  }
627
+ export interface GroupDraft {
628
+ id: string; member_ids: string[]; primary_id: string; link_visibility: boolean; shared_powerline: boolean;
629
+ }
622
630
  export interface LayoutDraft {
623
631
  mode: "auto" | "explicit";
624
632
  rows: string[][];
625
633
  }
626
634
  export interface SubagentDraft {
635
+ groups: GroupDraft[];
627
636
  enabled: boolean;
628
637
  instances: InstanceDraft[];
629
638
  visibility: "all" | "running";
@@ -642,7 +651,8 @@ export interface PowerlineDraft {
642
651
  color_mode: "semantic" | "continuous" | "restart";
643
652
  }
644
653
  export interface DisplayDraft {
645
- schema_version: 10;
654
+ groups: GroupDraft[];
655
+ schema_version: 13;
646
656
  statusline_language: StatuslineLanguage;
647
657
  instances: InstanceDraft[];
648
658
  use_colors: boolean;
@@ -706,7 +716,9 @@ export interface SourceDefinition {
706
716
  ttl_seconds: number; settings: SourceSettings; enabled: boolean; revision: string;
707
717
  }
708
718
  export interface SourceBinding { id: string; source_id: string }
709
- export interface SourceRegistry { version: 1; sources: SourceDefinition[]; bindings: SourceBinding[] }
719
+ export interface AutomaticPolicy { source_id: string; enabled: boolean; review_revision: string; interval_seconds: number; auth_revision: string }
720
+ export interface AutomaticStatus { state: 'off' | 'waiting' | 'running' | 'backoff' | 'paused'; reason: string; next_at: string | null; last_attempt: string | null; last_success: string | null; interval_seconds: number }
721
+ export interface SourceRegistry { version: 2; sources: SourceDefinition[]; bindings: SourceBinding[]; automatic: AutomaticPolicy[] }
710
722
  export interface SourcesResult extends SourceRegistry { revision: string }
711
723
  export type SourceState = 'valid' | 'missing' | 'partial' | 'error' | 'unsupported';
712
724
  export interface SourceObservation {
@@ -723,7 +735,7 @@ export interface SourceView {
723
735
  fields?: Record<string, string | number | boolean | null>;
724
736
  }
725
737
  export interface SourceJob {
726
- version: 1; id: string; source_id: string; source_revision: string; owner: string;
738
+ version: 2; id: string; source_id: string; source_revision: string; owner: string; trigger: 'manual' | 'automatic'; identity: string;
727
739
  context: SourceContext; started_at: string; deadline_at: string;
728
740
  state: 'running' | 'completed' | 'failed' | 'cancelled'; reason: string;
729
741
  }
@@ -734,9 +746,9 @@ export interface PreviewResult {
734
746
  main: Span[][];
735
747
  subagents: Span[][];
736
748
  }
737
- export const SAMPLE_REASONS = ['sample_visible','sample_empty','sample_condition_hidden','sample_truncated','sample_priority_omitted','sample_width_omitted','sample_row_hidden','sample_spacer'] as const;
749
+ export const SAMPLE_REASONS = ['sample_group_hidden','sample_visible','sample_empty','sample_condition_hidden','sample_truncated','sample_priority_omitted','sample_width_omitted','sample_row_hidden','sample_spacer'] as const;
738
750
  export type SampleReason = typeof SAMPLE_REASONS[number];
739
- export const EXPLAIN_REASONS = ['source_bound','source_unbound','configured_on','configured_off','scope_disabled','installation_owned','installation_absent','installation_foreign','installation_unknown','unknown_host_version','host_supported','unsupported_host','host_requirement_unknown','collector_unknown','native_timing_on','native_timing_off','live_metrics_on','live_metrics_off','actual_not_observed'] as const;
751
+ export const EXPLAIN_REASONS = ['cost_rate_session','cost_rate_api','indicator_bar','source_bound','source_unbound','configured_on','configured_off','scope_disabled','installation_owned','installation_absent','installation_foreign','installation_unknown','unknown_host_version','host_supported','unsupported_host','host_requirement_unknown','collector_unknown','native_timing_on','native_timing_off','live_metrics_on','live_metrics_off','actual_not_observed'] as const;
740
752
  export interface ExplainReason { code: string; origin: 'configuration' | 'local_configuration' | 'host_capability' | 'unknown'; }
741
753
  export interface InstanceSample { row_id: string; outcome: SampleReason; truncated: boolean; }
742
754
  export interface ExplainInstance {
@@ -752,7 +764,7 @@ export interface ExplainResult {
752
764
  preview: PreviewResult;
753
765
  instances: ExplainInstance[];
754
766
  }
755
- export const LAYOUT_REASONS = ['visible','empty','condition_hidden','priority_omitted','width_omitted','row_hidden','spacer'] as const;
767
+ export const LAYOUT_REASONS = ['group_hidden','visible','empty','condition_hidden','priority_omitted','width_omitted','row_hidden','spacer'] as const;
756
768
  export type LayoutReason = typeof LAYOUT_REASONS[number];
757
769
  export interface InstanceLayout { row_id: string; outcome: LayoutReason; truncated: boolean; }
758
770
  export const EVIDENCE_STATUSES = ['observed','not_observed','invalid_field','source_unavailable','association_unavailable','session_mismatch','prompt_mismatch','stale','partial','collector_off','input_only','newer_than_input','unsupported_host','no_misses','unidentified'] as const;
@@ -924,7 +936,7 @@ export interface ResultMap {
924
936
  source_refresh: SourceJob;
925
937
  source_status: SourceJob;
926
938
  source_cancel: SourceJob;
927
- source_diagnose: { source: SourceDefinition; view: SourceView; jobs: SourceJob[] };
939
+ source_diagnose: { source: SourceDefinition; view: SourceView; jobs: SourceJob[]; automatic: AutomaticStatus };
928
940
  describe: DescribeResult;
929
941
  read: ReadResult;
930
942
  preview: PreviewResult;