@pellux/goodvibes-tui 0.27.0 → 0.29.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 (143) hide show
  1. package/CHANGELOG.md +124 -0
  2. package/README.md +1 -1
  3. package/package.json +1 -1
  4. package/src/core/context-usage.ts +53 -0
  5. package/src/core/conversation.ts +4 -6
  6. package/src/core/session-recovery.ts +2 -0
  7. package/src/core/turn-event-wiring.ts +1 -0
  8. package/src/input/commands/cost-runtime.ts +49 -0
  9. package/src/input/commands/eval.ts +4 -3
  10. package/src/input/commands/operator-runtime.ts +5 -1
  11. package/src/input/commands.ts +2 -0
  12. package/src/input/handler-feed-routes.ts +60 -26
  13. package/src/input/handler-feed.ts +17 -8
  14. package/src/input/handler-picker-routes.ts +18 -13
  15. package/src/input/handler-shortcuts.ts +51 -0
  16. package/src/input/handler-ui-state.ts +4 -0
  17. package/src/input/handler.ts +43 -6
  18. package/src/input/keybindings.ts +53 -8
  19. package/src/input/model-picker.ts +5 -0
  20. package/src/input/panel-integration-actions.ts +117 -1
  21. package/src/main.ts +5 -2
  22. package/src/panels/agent-inspector-panel.ts +139 -45
  23. package/src/panels/agent-inspector-shared.ts +147 -3
  24. package/src/panels/approval-panel.ts +204 -102
  25. package/src/panels/automation-control-panel.ts +370 -103
  26. package/src/panels/base-panel.ts +26 -2
  27. package/src/panels/builtin/agent.ts +28 -37
  28. package/src/panels/builtin/development.ts +40 -32
  29. package/src/panels/builtin/knowledge.ts +15 -6
  30. package/src/panels/builtin/operations.ts +178 -117
  31. package/src/panels/builtin/session.ts +35 -9
  32. package/src/panels/builtin/shared.ts +98 -6
  33. package/src/panels/cockpit-panel.ts +253 -75
  34. package/src/panels/cockpit-read-model.ts +2 -1
  35. package/src/panels/communication-panel.ts +159 -56
  36. package/src/panels/confirm-state.ts +8 -1
  37. package/src/panels/control-plane-panel.ts +354 -95
  38. package/src/panels/cost-tracker-panel.ts +243 -57
  39. package/src/panels/debug-panel.ts +347 -159
  40. package/src/panels/diff-panel.ts +257 -82
  41. package/src/panels/docs-panel.ts +166 -64
  42. package/src/panels/eval-panel.ts +336 -109
  43. package/src/panels/expandable-list-panel.ts +189 -0
  44. package/src/panels/file-explorer-panel.ts +238 -159
  45. package/src/panels/file-preview-panel.ts +141 -59
  46. package/src/panels/git-panel.ts +360 -191
  47. package/src/panels/hooks-panel.ts +181 -19
  48. package/src/panels/incident-review-panel.ts +252 -43
  49. package/src/panels/index.ts +0 -4
  50. package/src/panels/intelligence-panel.ts +310 -103
  51. package/src/panels/knowledge-graph-panel.ts +480 -58
  52. package/src/panels/local-auth-panel.ts +251 -33
  53. package/src/panels/marketplace-panel.ts +219 -33
  54. package/src/panels/memory-panel.ts +83 -81
  55. package/src/panels/ops-control-panel.ts +211 -32
  56. package/src/panels/ops-strategy-panel.ts +131 -45
  57. package/src/panels/orchestration-panel.ts +259 -67
  58. package/src/panels/panel-list-panel.ts +184 -136
  59. package/src/panels/panel-manager.ts +120 -13
  60. package/src/panels/plan-dashboard-panel.ts +507 -74
  61. package/src/panels/plugins-panel.ts +227 -34
  62. package/src/panels/policy-panel.ts +264 -55
  63. package/src/panels/polish-core.ts +162 -0
  64. package/src/panels/polish-tables.ts +258 -0
  65. package/src/panels/polish.ts +67 -149
  66. package/src/panels/project-planning-answer-actions.ts +134 -0
  67. package/src/panels/project-planning-panel.ts +84 -113
  68. package/src/panels/provider-health-panel.ts +438 -480
  69. package/src/panels/provider-health-routes.ts +203 -0
  70. package/src/panels/provider-health-tracker.ts +194 -6
  71. package/src/panels/provider-health-views.ts +560 -0
  72. package/src/panels/qr-panel.ts +136 -38
  73. package/src/panels/remote-panel.ts +123 -38
  74. package/src/panels/routes-panel.ts +87 -24
  75. package/src/panels/sandbox-panel.ts +232 -65
  76. package/src/panels/scrollable-list-panel.ts +143 -145
  77. package/src/panels/security-panel.ts +204 -52
  78. package/src/panels/services-panel.ts +174 -76
  79. package/src/panels/session-browser-panel.ts +101 -6
  80. package/src/panels/session-maintenance.ts +4 -122
  81. package/src/panels/settings-sync-panel.ts +346 -68
  82. package/src/panels/skills-panel.ts +157 -89
  83. package/src/panels/subscription-panel.ts +105 -34
  84. package/src/panels/symbol-outline-panel.ts +287 -154
  85. package/src/panels/system-messages-panel.ts +172 -38
  86. package/src/panels/tasks-panel.ts +348 -134
  87. package/src/panels/thinking-panel.ts +66 -32
  88. package/src/panels/token-budget-panel.ts +233 -46
  89. package/src/panels/tool-inspector-panel.ts +170 -54
  90. package/src/panels/types.ts +65 -4
  91. package/src/panels/work-plan-panel.ts +393 -39
  92. package/src/panels/worktree-panel.ts +239 -61
  93. package/src/panels/wrfc-panel-format.ts +133 -0
  94. package/src/panels/wrfc-panel.ts +146 -150
  95. package/src/renderer/compaction-preview.ts +2 -1
  96. package/src/renderer/compositor.ts +46 -43
  97. package/src/renderer/conversation-overlays.ts +25 -11
  98. package/src/renderer/footer-tips.ts +41 -0
  99. package/src/renderer/fullscreen-primitives.ts +22 -16
  100. package/src/renderer/help-overlay.ts +91 -14
  101. package/src/renderer/hint-grammar.ts +52 -0
  102. package/src/renderer/layout.ts +7 -7
  103. package/src/renderer/modal-factory.ts +23 -15
  104. package/src/renderer/model-picker-overlay.ts +30 -11
  105. package/src/renderer/model-workspace.ts +2 -3
  106. package/src/renderer/overlay-box.ts +16 -10
  107. package/src/renderer/panel-composite.ts +7 -20
  108. package/src/renderer/panel-workspace-bar.ts +14 -8
  109. package/src/renderer/process-indicator.ts +3 -1
  110. package/src/renderer/progress.ts +8 -6
  111. package/src/renderer/search-overlay.ts +27 -6
  112. package/src/renderer/session-picker-modal.ts +6 -4
  113. package/src/renderer/settings-modal.ts +70 -10
  114. package/src/renderer/shell-surface.ts +41 -15
  115. package/src/renderer/status-glyphs.ts +11 -9
  116. package/src/renderer/tab-strip.ts +148 -34
  117. package/src/renderer/theme.ts +60 -3
  118. package/src/renderer/ui-factory.ts +45 -36
  119. package/src/renderer/ui-primitives.ts +23 -2
  120. package/src/runtime/bootstrap-shell.ts +35 -18
  121. package/src/runtime/diagnostics/panels/index.ts +0 -3
  122. package/src/runtime/ui/model-picker/health-enrichment.ts +3 -0
  123. package/src/runtime/ui/model-picker/types.ts +4 -0
  124. package/src/shell/ui-openers.ts +14 -22
  125. package/src/utils/format-duration.ts +55 -0
  126. package/src/utils/format-number.ts +71 -0
  127. package/src/utils/splash-lines.ts +44 -3
  128. package/src/version.ts +1 -1
  129. package/src/work-plans/work-plan-store.ts +13 -0
  130. package/src/panels/agent-logs-panel.ts +0 -666
  131. package/src/panels/agent-logs-shared.ts +0 -129
  132. package/src/panels/context-visualizer-panel.ts +0 -214
  133. package/src/panels/forensics-panel.ts +0 -364
  134. package/src/panels/panel-picker.ts +0 -106
  135. package/src/panels/provider-account-snapshot.ts +0 -259
  136. package/src/panels/provider-accounts-panel.ts +0 -218
  137. package/src/panels/provider-stats-panel.ts +0 -366
  138. package/src/panels/schedule-panel.ts +0 -342
  139. package/src/panels/watchers-panel.ts +0 -193
  140. package/src/renderer/panel-picker-overlay.ts +0 -202
  141. package/src/renderer/panel-tab-bar.ts +0 -69
  142. package/src/runtime/diagnostics/panels/panel-resources.ts +0 -118
  143. package/src/runtime/diagnostics/panels/policy.ts +0 -177
@@ -1,177 +0,0 @@
1
- /**
2
- * Policy diagnostics panel data provider.
3
- *
4
- * Wraps a `PolicyRegistry` and optionally a `DivergencePanel` to expose
5
- * combined policy state (current bundle, candidate, simulation status,
6
- * divergence trends) for the diagnostics view.
7
- *
8
- * This panel is push-passive: it does not drive timers. Callers must
9
- * call `recordTrendEntry()` periodically if a divergence panel is attached.
10
- */
11
-
12
- import type { PolicyBundleVersion, PolicyDiffResult } from '@/runtime/index.ts';
13
- import { PolicyRegistry } from '@/runtime/index.ts';
14
- import type { DivergenceDashboardSnapshot } from '@/runtime/index.ts';
15
- import type { DivergencePanel } from '@/runtime/index.ts';
16
- import type { PanelConfig } from '@/runtime/index.ts';
17
- import { DEFAULT_PANEL_CONFIG } from '@/runtime/index.ts';
18
- import type { PermissionAuditEntry } from '@/runtime/index.ts';
19
- import type { PolicyLintFinding } from '@/runtime/index.ts';
20
- import type { PolicySimulationSummary } from '@/runtime/index.ts';
21
- import type { PolicyPreflightReview } from '@/runtime/index.ts';
22
- import { logger } from '@pellux/goodvibes-sdk/platform/utils';
23
-
24
- /**
25
- * A point-in-time snapshot of policy state for diagnostics rendering.
26
- */
27
- export interface PolicyPanelSnapshot {
28
- /** The currently enforced bundle, or null if no policy is active. */
29
- current: PolicyBundleVersion | null;
30
- /** The pending candidate bundle, or null if none loaded. */
31
- candidate: PolicyBundleVersion | null;
32
- /** History of previous active bundles (most recent first). */
33
- history: PolicyBundleVersion[];
34
- /** Diff between current and candidate, or null if unavailable. */
35
- diff: PolicyDiffResult | null;
36
- /** Divergence dashboard snapshot, or null if no panel attached. */
37
- divergence: DivergenceDashboardSnapshot | null;
38
- /** Recent permission requests and decisions for operator audit review. */
39
- recentPermissionAudit: readonly PermissionAuditEntry[];
40
- /** Policy lint findings for current and candidate bundles. */
41
- lintFindings: readonly PolicyLintFinding[];
42
- /** Concrete scenario results from the most recent policy simulation run. */
43
- lastSimulationSummary: PolicySimulationSummary | null;
44
- /** Most recent proactive policy preflight review. */
45
- lastPreflightReview: PolicyPreflightReview | null;
46
- /** ISO 8601 timestamp of when this snapshot was captured. */
47
- capturedAt: string;
48
- }
49
-
50
- /**
51
- * PolicyPanel — diagnostics data provider for the policy registry.
52
- *
53
- * Usage:
54
- * ```ts
55
- * const registry = new PolicyRegistry();
56
- * const panel = new PolicyPanel(registry, divergencePanel);
57
- *
58
- * panel.subscribe(() => {
59
- * const snap = panel.getSnapshot();
60
- * render(snap);
61
- * });
62
- *
63
- * // Notify when the registry state changes:
64
- * panel.notify();
65
- *
66
- * // On cleanup:
67
- * panel.dispose();
68
- * ```
69
- */
70
- export class PolicyPanel {
71
- private readonly _registry: PolicyRegistry;
72
- private readonly _divergencePanel: DivergencePanel | null;
73
- private readonly _config: PanelConfig;
74
- private readonly _recentPermissionAudit: readonly PermissionAuditEntry[];
75
- private readonly _lintFindings: readonly PolicyLintFinding[];
76
- private readonly _lastSimulationSummary: PolicySimulationSummary | null;
77
- private readonly _lastPreflightReview: PolicyPreflightReview | null;
78
- private readonly _subscribers = new Set<() => void>();
79
-
80
- constructor(
81
- registry: PolicyRegistry,
82
- divergencePanel: DivergencePanel | null = null,
83
- recentPermissionAudit: readonly PermissionAuditEntry[] = [],
84
- lintFindings: readonly PolicyLintFinding[] = [],
85
- lastSimulationSummary: PolicySimulationSummary | null = null,
86
- lastPreflightReview: PolicyPreflightReview | null = null,
87
- config: PanelConfig = DEFAULT_PANEL_CONFIG,
88
- ) {
89
- this._registry = registry;
90
- this._divergencePanel = divergencePanel;
91
- this._recentPermissionAudit = recentPermissionAudit;
92
- this._lintFindings = lintFindings;
93
- this._lastSimulationSummary = lastSimulationSummary;
94
- this._lastPreflightReview = lastPreflightReview;
95
- this._config = config;
96
- }
97
-
98
- /**
99
- * recordTrendEntry — Forwards to the attached DivergencePanel if present.
100
- *
101
- * Call periodically (e.g. every 30 seconds) while simulation is active.
102
- */
103
- public recordTrendEntry(): void {
104
- this._divergencePanel?.recordTrendEntry();
105
- this._notify();
106
- }
107
-
108
- /**
109
- * notify — Trigger a subscriber notification.
110
- *
111
- * Call after registry state changes (load, promote, rollback) so the
112
- * diagnostics view can re-render.
113
- */
114
- public notify(): void {
115
- this._notify();
116
- }
117
-
118
- /**
119
- * getSnapshot — Returns the current combined policy + divergence snapshot.
120
- */
121
- public getSnapshot(): PolicyPanelSnapshot {
122
- const current = this._registry.getCurrent();
123
- const candidate = this._registry.getCandidate();
124
- const rawHistory = this._registry.getHistory();
125
- // Most recent first, capped for display
126
- const history = rawHistory
127
- .slice()
128
- .reverse()
129
- .slice(0, this._config.bufferLimit);
130
-
131
- const diff = this._registry.diff();
132
-
133
- let divergence: DivergenceDashboardSnapshot | null = null;
134
- if (this._divergencePanel) {
135
- divergence = this._divergencePanel.getSnapshot();
136
- }
137
-
138
- return {
139
- current,
140
- candidate,
141
- history,
142
- diff,
143
- divergence,
144
- recentPermissionAudit: this._recentPermissionAudit.slice(0, this._config.bufferLimit),
145
- lintFindings: this._lintFindings.slice(0, this._config.bufferLimit),
146
- lastSimulationSummary: this._lastSimulationSummary,
147
- lastPreflightReview: this._lastPreflightReview,
148
- capturedAt: new Date().toISOString(),
149
- };
150
- }
151
-
152
- /**
153
- * Register a callback invoked whenever the panel state changes.
154
- * @returns An unsubscribe function.
155
- */
156
- public subscribe(callback: () => void): () => void {
157
- this._subscribers.add(callback);
158
- return () => this._subscribers.delete(callback);
159
- }
160
-
161
- /**
162
- * Release all subscriptions.
163
- */
164
- public dispose(): void {
165
- this._subscribers.clear();
166
- }
167
-
168
- private _notify(): void {
169
- for (const cb of this._subscribers) {
170
- try {
171
- cb();
172
- } catch (err) {
173
- logger.warn(`[PolicyPanel] subscriber error: ${err}`);
174
- }
175
- }
176
- }
177
- }