@wrongstack/webui 1.0.17 → 1.0.24

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 (138) hide show
  1. package/dist/assets/{AgentRosterView-CV9MW-4M.js → AgentRosterView-Dq8Xa0WK.js} +4 -4
  2. package/dist/assets/{AnalyticsDashboard-30brLbuz.js → AnalyticsDashboard-DgqJODVI.js} +1 -1
  3. package/dist/assets/{AudienceMemoryPanel-bKVydKg8.js → AudienceMemoryPanel-BVGdDVTT.js} +1 -1
  4. package/dist/assets/{ChangesView-Cv6svx-V.js → ChangesView-BVyLENBb.js} +1 -1
  5. package/dist/assets/ChimeraReviewsView-CTuxzgTC.js +1 -0
  6. package/dist/assets/ChronicleDashboard-BRP7D6RZ.js +1 -0
  7. package/dist/assets/{CodeEditor-JlvMbECd.js → CodeEditor-k3z3M0NG.js} +1 -1
  8. package/dist/assets/{CodeMap-4swT3FIw.js → CodeMap-CvHNQZEF.js} +1 -1
  9. package/dist/assets/{CronJobsPanel-LSpFBceD.js → CronJobsPanel-GTK038V9.js} +1 -1
  10. package/dist/assets/{DeadCodeScanPanel-ZRNNV02b.js → DeadCodeScanPanel-DX4OEuyp.js} +1 -1
  11. package/dist/assets/{DebugDashboard-DlH0QNPX.js → DebugDashboard-CKp3sa_k.js} +1 -1
  12. package/dist/assets/{DesignGalleryView-yZgVVEg9.js → DesignGalleryView-DVUTYaP6.js} +1 -1
  13. package/dist/assets/{GoalView-D1gxZre2.js → GoalView-D8G8e8YG.js} +1 -1
  14. package/dist/assets/KanbanView-BMXGDqGo.js +3 -0
  15. package/dist/assets/{MailboxDetailView-C4lEW3f8.js → MailboxDetailView-CylnzTVc.js} +1 -1
  16. package/dist/assets/{MemoryDrawer-arujfDSW.js → MemoryDrawer-DJ0Y98Z8.js} +1 -1
  17. package/dist/assets/{MemoryManager-BmQYIRhD.js → MemoryManager-DfcsYPUB.js} +1 -1
  18. package/dist/assets/{ProcessMonitor-ByW-VKsX.js → ProcessMonitor-BnQ3vJtn.js} +1 -1
  19. package/dist/assets/{PromptJournalView-0cHPeYXa.js → PromptJournalView-D7k8Yh5a.js} +1 -1
  20. package/dist/assets/{ProviderTestView-CQlwC6HG.js → ProviderTestView-DSd6kkWT.js} +1 -1
  21. package/dist/assets/{QueuePanel-DJeK7xCh.js → QueuePanel-79KiyZWD.js} +1 -1
  22. package/dist/assets/{RefreshDebugView-BfOjHodq.js → RefreshDebugView-s6MyGpPq.js} +1 -1
  23. package/dist/assets/{RepositoryHistoryView-BYPPu5uv.js → RepositoryHistoryView-CWi_Zo3F.js} +1 -1
  24. package/dist/assets/RequirementIntakeView-D_Ea20fx.js +1 -0
  25. package/dist/assets/{SageTabs-Bt2kzPNB.js → SageTabs-D6eTg3ix.js} +2 -2
  26. package/dist/assets/SddFlowGraph-B-ptkFX6.js +1 -0
  27. package/dist/assets/SddHub-CSVfLGpr.js +2 -0
  28. package/dist/assets/{SessionInspectView-BasxJ_5x.js → SessionInspectView-NSpj5WEN.js} +1 -1
  29. package/dist/assets/{SessionList-C9MRSj_-.js → SessionList-BYRCs1AK.js} +1 -1
  30. package/dist/assets/{SessionsDashboard-BK95Zp6f.js → SessionsDashboard-mF4PzdKY.js} +1 -1
  31. package/dist/assets/{SetupScreen-rPKsBa9Z.js → SetupScreen-BUZeJSZi.js} +1 -1
  32. package/dist/assets/SkillDetailView-B9BFyB1i.js +3 -0
  33. package/dist/assets/{TechStackView-xVR5dsSn.js → TechStackView-CXJilX0M.js} +2 -2
  34. package/dist/assets/{TerminalPanel-CBEZTuvV.js → TerminalPanel-CAXevSAa.js} +1 -1
  35. package/dist/assets/{activity-CInOo57V.js → activity-B3wutYIE.js} +4 -4
  36. package/dist/assets/activity-Be03cc7g.js +10 -0
  37. package/dist/assets/activity-CiYZ3y4e.js +10 -0
  38. package/dist/assets/activity-CmIA2MhR.js +10 -0
  39. package/dist/assets/activity-Cp5GhldB.js +10 -0
  40. package/dist/assets/activity-DFCf7l5d.js +10 -0
  41. package/dist/assets/activity-EbNUY7Ci.js +10 -0
  42. package/dist/assets/{chat-store-BDVZSmod.js → chat-store-C7InoWAO.js} +1 -1
  43. package/dist/assets/common-Bjl7V12m.js +1 -0
  44. package/dist/assets/common-BtyQBZBN.js +1 -0
  45. package/dist/assets/common-D0QL7rwb.js +1 -0
  46. package/dist/assets/common-DJRPtYAt.js +1 -0
  47. package/dist/assets/common-DPPTV3yw.js +1 -0
  48. package/dist/assets/common-DvjdaRhB.js +1 -0
  49. package/dist/assets/common-opV6EoLd.js +1 -0
  50. package/dist/assets/config-store-BbL0WxLE.js +21 -0
  51. package/dist/assets/{i18n-CvJB4U4z.js → i18n-Dv97urcO.js} +3 -3
  52. package/dist/assets/index-CON0Nbm4.css +1 -0
  53. package/dist/assets/index-DX6tHUzs.js +177 -0
  54. package/dist/assets/roster-ws-Cv_PHlEV.js +1 -0
  55. package/dist/assets/settings-BCvuzOJ6.js +1 -0
  56. package/dist/assets/settings-DMPKd-4K.js +1 -0
  57. package/dist/assets/settings-DxQ2452f.js +1 -0
  58. package/dist/assets/settings-Dz3StaVx.js +1 -0
  59. package/dist/assets/settings-EBW1mlXc.js +1 -0
  60. package/dist/assets/settings-Er2LHp9d.js +1 -0
  61. package/dist/assets/settings-EzznCDaX.js +1 -0
  62. package/dist/assets/stores-DXn5tdr7.js +7 -0
  63. package/dist/assets/ui-store-DxDwFHNK.js +1 -0
  64. package/dist/assets/{view-navigation-DTs4cSQ6.js → view-navigation-CpIPxhZp.js} +1 -1
  65. package/dist/components/ChatInput/skill-mention-picker.d.ts +10 -0
  66. package/dist/components/CustomRosterPanel.d.ts +0 -1
  67. package/dist/components/KanbanColumnView.d.ts +13 -0
  68. package/dist/components/OfficeMapCanvas.d.ts +0 -7
  69. package/dist/components/SettingsPanel/BrainSection.d.ts +1 -1
  70. package/dist/components/SettingsPanel/JevSection.d.ts +4 -0
  71. package/dist/components/SettingsPanel/OAuthLoginSection.d.ts +2 -0
  72. package/dist/components/SettingsPanel/ProviderSection.d.ts +5 -5
  73. package/dist/components/SettingsPanel/brain-section-options.d.ts +1 -1
  74. package/dist/components/SettingsPanel/contracts.d.ts +1 -0
  75. package/dist/components/SettingsPanel/official-servers.d.ts +1 -0
  76. package/dist/components/SettingsPanel/use-brain-section.d.ts +28 -0
  77. package/dist/components/SkillDetailView.d.ts +1 -1
  78. package/dist/components/chronicle-event-detail.d.ts +51 -0
  79. package/dist/components/context-dashboard-sections.d.ts +79 -0
  80. package/dist/components/use-office-map-canvas.d.ts +42 -0
  81. package/dist/components/use-skill-detail.d.ts +177 -0
  82. package/dist/components/vector-memory-panel/model.d.ts +9 -0
  83. package/dist/hooks/useProviderModels.d.ts +2 -0
  84. package/dist/hooks/useWebSocket.d.ts +3 -3
  85. package/dist/hooks/ws-handlers/brain-handlers.d.ts +18 -0
  86. package/dist/hooks/ws-handlers/goal-handlers.d.ts +7 -0
  87. package/dist/hooks/ws-handlers/misc-handlers.d.ts +2 -21
  88. package/dist/index.html +9 -9
  89. package/dist/index.js +15586 -12891
  90. package/dist/lib/auth-operation.d.ts +5 -0
  91. package/dist/lib/kanban-cleaner.d.ts +1 -1
  92. package/dist/lib/sdd-theme.d.ts +2 -2
  93. package/dist/lib/ws-client-actions.d.ts +2 -0
  94. package/dist/lib/ws-client-domain-methods.d.ts +2 -2
  95. package/dist/lib/ws-client-echo.d.ts +1 -1
  96. package/dist/lib/ws-client-session-methods.d.ts +1 -1
  97. package/dist/lib/ws-client.d.ts +0 -3
  98. package/dist/stores/council-log-store.d.ts +4 -0
  99. package/dist/stores/ui-store-types.d.ts +1 -1
  100. package/dist/types/client-message.d.ts +13 -0
  101. package/dist/types/jev.d.ts +62 -0
  102. package/dist/types/runtime.d.ts +5 -3
  103. package/dist/types/server-message-system.d.ts +4 -0
  104. package/dist/types/system.d.ts +2 -0
  105. package/package.json +10 -10
  106. package/dist/assets/ChimeraReviewsView-DLTrEJDS.js +0 -1
  107. package/dist/assets/ChronicleDashboard-DhgWbaXj.js +0 -1
  108. package/dist/assets/KanbanView-Bh0T3p3J.js +0 -3
  109. package/dist/assets/RequirementIntakeView-CEwUB7VD.js +0 -1
  110. package/dist/assets/SddFlowGraph-CZSwcAtS.js +0 -1
  111. package/dist/assets/SddHub-Cc79Ob7A.js +0 -2
  112. package/dist/assets/SkillDetailView-LkJyIBPb.js +0 -3
  113. package/dist/assets/activity-CDHIWIPJ.js +0 -10
  114. package/dist/assets/activity-D6XfckyA.js +0 -10
  115. package/dist/assets/activity-DapbBEf6.js +0 -10
  116. package/dist/assets/activity-E8vCWdG2.js +0 -10
  117. package/dist/assets/activity-e8OIpNGJ.js +0 -10
  118. package/dist/assets/activity-oTJsNfZu.js +0 -10
  119. package/dist/assets/common-BXosnbIt.js +0 -1
  120. package/dist/assets/common-CzfPgMjC.js +0 -1
  121. package/dist/assets/common-DDDPz7Dv.js +0 -1
  122. package/dist/assets/common-DYx9oSoC.js +0 -1
  123. package/dist/assets/common-DZ-05t4z.js +0 -1
  124. package/dist/assets/common-MjX8fcng.js +0 -1
  125. package/dist/assets/common-ipsuLC3n.js +0 -1
  126. package/dist/assets/config-store-mWuYCild.js +0 -22
  127. package/dist/assets/index-DLjaZSCH.js +0 -177
  128. package/dist/assets/index-DiX5j910.css +0 -1
  129. package/dist/assets/roster-ws-BRANim2Y.js +0 -1
  130. package/dist/assets/settings-B5Jy-ObI.js +0 -1
  131. package/dist/assets/settings-BXTJJ4n-.js +0 -1
  132. package/dist/assets/settings-BcXAVecM.js +0 -1
  133. package/dist/assets/settings-ByPfZHGm.js +0 -1
  134. package/dist/assets/settings-CCe4iHcn.js +0 -1
  135. package/dist/assets/settings-D2GLiaDO.js +0 -1
  136. package/dist/assets/settings-gB9nKL3f.js +0 -1
  137. package/dist/assets/stores-D5loyGLL.js +0 -7
  138. package/dist/assets/ui-store-DC3mkswy.js +0 -1
@@ -0,0 +1,5 @@
1
+ import type { WSClientMessage } from '@/types';
2
+ import type { WrongStackWebSocketClient } from './ws-client';
3
+ /** A matching server acknowledgment, never an unrelated operation result. */
4
+ export declare function requestAuthOperation(client: WrongStackWebSocketClient, message: WSClientMessage, signal: AbortSignal, onTimeout: () => void): Promise<boolean>;
5
+ //# sourceMappingURL=auth-operation.d.ts.map
@@ -18,7 +18,7 @@ export type KanbanAuditSeverity = 'error' | 'warning';
18
18
  * two implementations' code sets instead of trusting that both type unions
19
19
  * were edited together.
20
20
  */
21
- export declare const ALL_AUDIT_CODES: readonly ['abandoned-running-task', 'board-oversized', 'missing-assignee', 'missing-description', 'missing-due-date', 'missing-labels', 'missing-subtasks', 'missing-success-criteria', 'skipped-lifecycle-state', 'stale-review', 'stale-running-task'];
21
+ export declare const ALL_AUDIT_CODES: readonly ['abandoned-running-task', 'board-oversized', 'missing-assignee', 'missing-description', 'missing-due-date', 'missing-labels', 'missing-subtasks', 'missing-success-criteria', 'parked-card', 'skipped-lifecycle-state', 'stale-review', 'stale-running-task'];
22
22
  export type KanbanAuditIssueCode = (typeof ALL_AUDIT_CODES)[number];
23
23
  export interface KanbanAuditIssue {
24
24
  id: string;
@@ -8,8 +8,8 @@
8
8
  import { type LucideIcon } from 'lucide-react';
9
9
  type SddStatus = 'pending' | 'queued' | 'in_progress' | 'blocked' | 'review' | 'failed' | 'completed' | 'cancelled';
10
10
  interface SddStatusStyle {
11
- /** Short label, e.g. "Running". */
12
- label: string;
11
+ /** i18n key resolving to the short label, e.g. "Running". */
12
+ labelKey: string;
13
13
  /** Lucide icon for the status. */
14
14
  icon: LucideIcon;
15
15
  /** True for the running state (drives spin + glow). */
@@ -64,6 +64,7 @@ export interface WsClientActionMethods {
64
64
  allowedTools?: string[];
65
65
  url?: string;
66
66
  headers?: Record<string, string>;
67
+ bearerTokenEnv?: string;
67
68
  lazy?: boolean;
68
69
  }): void;
69
70
  removeMcpServer(name: string): void;
@@ -78,6 +79,7 @@ export interface WsClientActionMethods {
78
79
  allowedTools?: string[];
79
80
  url?: string;
80
81
  headers?: Record<string, string>;
82
+ bearerTokenEnv?: string;
81
83
  lazy?: boolean;
82
84
  }): void;
83
85
  wakeMcpServer(name: string): void;
@@ -73,7 +73,7 @@ declare const domainMethods: {
73
73
  updateKey(this: WsClientDomainHost, providerId: string, label: string, apiKey: string): void;
74
74
  deleteKey(this: WsClientDomainHost, providerId: string, label: string): void;
75
75
  setActiveKey(this: WsClientDomainHost, providerId: string, label: string): void;
76
- addProvider(this: WsClientDomainHost, id: string, family: string, baseUrl?: string | undefined, apiKey?: string, models?: string[] | undefined, customModels?: Record<string, ProviderCustomModelWire> | undefined): void;
76
+ addProvider(this: WsClientDomainHost, id: string, family: string, baseUrl?: string | undefined, apiKey?: string, models?: string[] | undefined, customModels?: Record<string, ProviderCustomModelWire> | undefined, providerType?: string | undefined): void;
77
77
  removeProvider(this: WsClientDomainHost, providerId: string): void;
78
78
  listOAuthProviders(this: WsClientDomainHost): void;
79
79
  startOAuth(this: WsClientDomainHost, kind: string, providerId?: string): void;
@@ -137,7 +137,7 @@ declare const domainMethods: {
137
137
  getPrefs(this: WsClientDomainHost, sessionId?: string): void;
138
138
  };
139
139
  export declare function installWsClientDomainMethods(ctor: {
140
- prototype: any;
140
+ prototype: object;
141
141
  }): void;
142
142
  export type WsClientDomainMethods = typeof domainMethods;
143
143
  export {};
@@ -29,7 +29,7 @@ export declare class WsClientEchoSuppression {
29
29
  * matches the audit's instruction that suppression must be correlated
30
30
  * end-to-end, never type-keyed.
31
31
  */
32
- consumeSuppressedChatEcho(responseType: string, msg?: WSServerMessage): boolean;
32
+ consumeSuppressedChatEcho(_responseType: string, msg?: WSServerMessage): boolean;
33
33
  /**
34
34
  * Lazy periodic sweep for `suppressedChatEchoes`. TTL trimming otherwise
35
35
  * runs only on consume — a requestId that was minted but never consumed
@@ -41,7 +41,7 @@ export interface WsClientSessionMethods {
41
41
  sendAbort(sessionId?: string | undefined): void;
42
42
  subscribeSessions(sessionIds: string[]): void;
43
43
  clearSessionSubscription(): void;
44
- sendConfirm(id: string, decision: 'yes' | 'no' | 'always' | 'deny'): void;
44
+ sendConfirm(id: string, decision: 'yes' | 'no' | 'always' | 'always-exact' | 'always-command' | 'always-tool' | 'deny'): void;
45
45
  switchModel(provider: string, model: string, timeoutMs?: number): Promise<WSModelSwitchResult['payload']>;
46
46
  shutdownCodebaseIndexServer(timeoutMs?: number): Promise<Extract<WSServerMessage, {
47
47
  type: 'codebase.index.server.shutdown_result';
@@ -114,9 +114,6 @@ declare class WrongStackWebSocketClientBase {
114
114
  * B-04 (docs/audit/webui-full-review-2026-09-03.md).
115
115
  */
116
116
  private echoSuppression;
117
- private get suppressedChatEchoes();
118
- private get echoSweepTimer();
119
- private set echoSweepTimer(value);
120
117
  private protocolCapabilities;
121
118
  private protocolVersion;
122
119
  supportsCapability(capability: string): boolean;
@@ -6,6 +6,8 @@ export interface CouncilPanelEntry {
6
6
  startedAt: number;
7
7
  resolvedAt?: number | undefined;
8
8
  seats: CouncilSeatVote[];
9
+ /** Final ballots supersede the live stream, including later failed rounds. */
10
+ hasFinalVotes?: boolean | undefined;
9
11
  /** Folded in from the matching `brain.decision_*` event, when it arrives. */
10
12
  question?: string | undefined;
11
13
  status?: string | undefined;
@@ -33,6 +35,8 @@ export declare const MAX_COUNCIL_PANELS = 50;
33
35
  interface CouncilLogState {
34
36
  /** Newest first. */
35
37
  panels: CouncilPanelEntry[];
38
+ /** Bounded, session-local questions received before the first ballot. */
39
+ questions: Map<string, string>;
36
40
  recordVote: (payload: Record<string, unknown>) => void;
37
41
  recordResolution: (payload: Record<string, unknown>) => void;
38
42
  noteQuestion: (requestId: string, question: string) => void;
@@ -28,7 +28,7 @@ export type View = (typeof VIEWS)[number];
28
28
  export declare function coerceView(value: unknown): View;
29
29
  export declare const DOCK_SECTIONS: readonly ['goal', 'goal-state', 'fleet', 'work', 'worktrees', 'collab'];
30
30
  export declare function coerceDockSection(value: unknown): DockSection | null;
31
- export declare const SETTINGS_TABS: readonly ['general', 'fonts', 'provider', 'connection', 'agent', 'execution', 'fallbacks', 'routing', 'fleet', 'integrations', 'chimera', 'context', 'logs', 'security', 'display'];
31
+ export declare const SETTINGS_TABS: readonly ['general', 'fonts', 'provider', 'jev', 'connection', 'agent', 'execution', 'fallbacks', 'routing', 'fleet', 'integrations', 'chimera', 'context', 'logs', 'security', 'display'];
32
32
  export declare function coerceSettingsTab(value: unknown): string;
33
33
  /** Single source of truth for the secondary panel width bounds. */
34
34
  export declare const SIDEBAR_MIN_WIDTH = 240;
@@ -584,6 +584,7 @@ export type WSClientMessageCore = WSUserMessage | {
584
584
  type: 'provider.add';
585
585
  payload: {
586
586
  id: string;
587
+ type?: string | undefined;
587
588
  family: string;
588
589
  baseUrl?: string | undefined;
589
590
  apiKey?: string | undefined;
@@ -1175,7 +1176,19 @@ export type WSClientMessageCore = WSUserMessage | {
1175
1176
  type: 'brain.ask';
1176
1177
  payload: {
1177
1178
  question: string;
1179
+ requestId?: string;
1178
1180
  } & SessionScopedPayload;
1181
+ } | {
1182
+ type: 'jev.get' | 'jev.test' | 'jev.check';
1183
+ payload?: {
1184
+ requestId: string;
1185
+ };
1186
+ } | {
1187
+ type: 'jev.set';
1188
+ payload: {
1189
+ requestId: string;
1190
+ patch: Record<string, unknown>;
1191
+ };
1179
1192
  } | {
1180
1193
  type: 'brain.config.get';
1181
1194
  } | {
@@ -0,0 +1,62 @@
1
+ export interface JevSettings {
2
+ status: string;
3
+ reason?: string;
4
+ route: string;
5
+ endpoint: string;
6
+ model: string;
7
+ requestTimeoutMs: number;
8
+ keySource: string;
9
+ features: Record<string, boolean>;
10
+ contextStrategy?: 'hybrid' | 'intelligent' | 'selective';
11
+ recallTurnContext?: boolean;
12
+ readiness?: Record<string, {
13
+ state: 'disabled' | 'account-required' | 'blocked' | 'conditional';
14
+ reason: string;
15
+ }>;
16
+ }
17
+ export interface JevState {
18
+ requestId?: string;
19
+ settings?: JevSettings;
20
+ message?: string;
21
+ error?: string;
22
+ checks?: {
23
+ running: boolean;
24
+ report?: {
25
+ at: number;
26
+ route: string;
27
+ model: string;
28
+ passed: number;
29
+ total: number;
30
+ cases: Array<{
31
+ feature: string;
32
+ name: string;
33
+ expected: string;
34
+ actual: string;
35
+ ok: boolean;
36
+ ms: number;
37
+ note?: string;
38
+ }>;
39
+ };
40
+ };
41
+ activity?: {
42
+ scope: 'process';
43
+ path?: string;
44
+ writeError?: string;
45
+ entries: Array<{
46
+ id: string;
47
+ at: number;
48
+ feature: string;
49
+ purpose?: 'runtime' | 'self-test';
50
+ project: string;
51
+ route: string;
52
+ model: string;
53
+ durationMs: number;
54
+ outcome: 'answered' | 'incomplete' | 'fallback';
55
+ reason?: string;
56
+ inputTokens?: number;
57
+ outputTokens?: number;
58
+ answers?: Record<string, string | number>;
59
+ }>;
60
+ };
61
+ }
62
+ //# sourceMappingURL=jev.d.ts.map
@@ -56,7 +56,7 @@ export interface WSToolConfirmResolved {
56
56
  payload: SessionScopedPayload & {
57
57
  id: string;
58
58
  toolName: string;
59
- decision: 'yes' | 'no' | 'always' | 'deny' | 'abort';
59
+ decision: 'yes' | 'no' | 'always' | 'always-exact' | 'always-command' | 'always-tool' | 'deny' | 'abort';
60
60
  source: 'brain_timeout' | 'abort';
61
61
  rationale?: string | undefined;
62
62
  };
@@ -65,7 +65,7 @@ export interface WSToolConfirmResult {
65
65
  type: 'tool.confirm_result';
66
66
  payload: SessionScopedPayload & {
67
67
  id: string;
68
- decision: 'yes' | 'no' | 'always' | 'deny';
68
+ decision: 'yes' | 'no' | 'always' | 'always-exact' | 'always-command' | 'always-tool' | 'deny';
69
69
  };
70
70
  }
71
71
  export interface WSTrustPersisted {
@@ -73,6 +73,8 @@ export interface WSTrustPersisted {
73
73
  payload: SessionScopedPayload & {
74
74
  tool: string;
75
75
  pattern: string;
76
+ displayPattern?: string;
77
+ scope?: 'exact' | 'command' | 'tool';
76
78
  decision: 'always' | 'deny';
77
79
  };
78
80
  }
@@ -352,7 +354,7 @@ export interface WSTopicAdviceResult {
352
354
  confidence: number;
353
355
  reason: string;
354
356
  nextTopic?: string | undefined;
355
- source: 'explicit' | 'model' | 'cache' | 'local';
357
+ source: 'explicit' | 'model' | 'system-one' | 'cache' | 'local';
356
358
  };
357
359
  }
358
360
  export interface WSContextMaxContext {
@@ -218,6 +218,9 @@ export type WSSystemMiscServerMessage = {
218
218
  judgeIsVoter?: boolean | undefined;
219
219
  ledgerPath?: string | undefined;
220
220
  };
221
+ } | {
222
+ type: 'jev.state';
223
+ payload: import('./jev.js').JevState;
221
224
  } | {
222
225
  type: 'brain.config';
223
226
  payload: {
@@ -228,6 +231,7 @@ export type WSSystemMiscServerMessage = {
228
231
  } | {
229
232
  type: 'brain.answer';
230
233
  payload: SessionScopedPayload & {
234
+ requestId?: string;
231
235
  question: string;
232
236
  decision: {
233
237
  type: string;
@@ -306,6 +306,8 @@ export interface WSKeyOperationResult {
306
306
  payload: {
307
307
  success: boolean;
308
308
  message: string;
309
+ /** Correlates an acknowledged operation with its submitting form. */
310
+ requestId?: string | undefined;
309
311
  /**
310
312
  * The tab whose request this answers.
311
313
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wrongstack/webui",
3
- "version": "1.0.17",
3
+ "version": "1.0.24",
4
4
  "license": "MIT",
5
5
  "description": "Browser-based WebUI for WrongStack — React + Vite frontend. The WebSocket backend lives in the separate @wrongstack/webui-server package (extracted in PR #018b to remove the CLI -> @wrongstack/webui/server cross-package edge).",
6
6
  "keywords": [
@@ -87,12 +87,12 @@
87
87
  "@radix-ui/react-tabs": "^1.1.21",
88
88
  "@tanstack/react-virtual": "^3.14.12",
89
89
  "@uiw/react-textarea-code-editor": "^3.1.1",
90
- "@wrongstack/core": "1.0.17",
91
- "@wrongstack/kanban": "1.0.17",
92
- "@wrongstack/plugins": "1.0.17",
93
- "@wrongstack/providers": "1.0.17",
94
- "@wrongstack/tools": "1.0.17",
95
- "@wrongstack/webui-protocol": "1.0.17",
90
+ "@wrongstack/core": "1.0.24",
91
+ "@wrongstack/kanban": "1.0.24",
92
+ "@wrongstack/plugins": "1.0.24",
93
+ "@wrongstack/providers": "1.0.24",
94
+ "@wrongstack/tools": "1.0.24",
95
+ "@wrongstack/webui-protocol": "1.0.24",
96
96
  "@xterm/addon-fit": "^0.11.0",
97
97
  "@xterm/xterm": "^6.0.0",
98
98
  "@xyflow/react": "^12.11.6",
@@ -114,7 +114,7 @@
114
114
  "zustand": "^5.0.15"
115
115
  },
116
116
  "optionalDependencies": {
117
- "node-pty": "1.1.0"
117
+ "node-pty": "1.2.0-beta.15"
118
118
  },
119
119
  "devDependencies": {
120
120
  "@playwright/test": "^1.63.0",
@@ -128,8 +128,8 @@
128
128
  "@types/ws": "^8.18.1",
129
129
  "@vitejs/plugin-react": "^6.1.1",
130
130
  "@vitest/coverage-v8": "^5.0.0",
131
- "@wrongstack/sdd": "1.0.17",
132
- "@wrongstack/webui-server": "1.0.17",
131
+ "@wrongstack/sdd": "1.0.24",
132
+ "@wrongstack/webui-server": "1.0.24",
133
133
  "jsdom": "^30.0.1",
134
134
  "tailwindcss": "^4.3.3",
135
135
  "typescript": "^7.0.2",
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{K as t,kt as n}from"./config-store-mWuYCild.js";import{i as r,t as i}from"./react-core-wiHys0m2.js";import{Da as a,Dn as o,En as s,Fn as c,Ii as l,Ln as u,Mr as d,Na as f,Pa as p,Ta as m,Vn as h,bn as g,ga as _,ja as v,qn as y,xo as b}from"./vendor-V3ydTHqN.js";import"./i18n-CvJB4U4z.js";import{t as x}from"./utils-CKsqCaP8.js";import{i as S}from"./index-DLjaZSCH.js";import{t as C}from"./empty-state-pfuS5znr.js";var w=e(r(),1),T=i();function E(e){try{return new Date(e).toLocaleString()}catch{return e}}function D(e){try{let t=new Date(e),n=Date.now()-t.getTime();return n<6e4?`Just now`:n<36e5?`${Math.round(n/6e4)}m ago`:n<864e5?`${Math.round(n/36e5)}h ago`:n<6048e5?`${Math.round(n/864e5)}d ago`:t.toLocaleDateString()}catch{return e}}var O={open:{label:`Open`,cls:`border-primary/30 bg-primary/10 text-primary`,icon:a},actioned:{label:`Actioned`,cls:`border-warning/30 bg-warning/10 text-warning`,icon:c},completed:{label:`Completed`,cls:`border-success/30 bg-success/10 text-success`,icon:m},skipped:{label:`Skipped`,cls:`border-border bg-muted text-muted-foreground`,icon:_}},k={critical:{bg:`bg-destructive/10 border-destructive/30`,text:`text-destructive`,dot:`bg-destructive`},high:{bg:`bg-warning/15 border-warning/40`,text:`text-warning`,dot:`bg-warning`},medium:{bg:`bg-warning/10 border-warning/30`,text:`text-warning`,dot:`bg-warning`},low:{bg:`bg-muted border-border`,text:`text-muted-foreground`,dot:`bg-muted-foreground`}};function A(){let{t:e}=b(),{reports:r,selectedReportId:i,detail:a,loading:A,detailLoading:j,error:M,filterSessionId:N,filterLifecycle:P,searchQuery:F,fetchReports:I,selectReport:L,setFilterSessionId:R,setFilterLifecycle:z,setSearchQuery:B,transitionReport:V,addReportNote:H,transitionFinding:U}=S(),[W,G]=(0,w.useState)(``),[K,q]=(0,w.useState)(!1);(0,w.useEffect)(()=>{I()},[I]);let J=(0,w.useMemo)(()=>{let e=new Set;for(let t of r)t.sessionId&&e.add(t.sessionId);return Array.from(e)},[r]),Y=(0,w.useMemo)(()=>{let e=F.trim().toLowerCase();return r.filter(t=>{if(N&&t.sessionId!==N||P&&t.lifecycleStatus!==P)return!1;if(e){let n=t.reportId.toLowerCase().includes(e),r=t.sessionId.toLowerCase().includes(e),i=(t.reviewerModel??``).toLowerCase().includes(e);if(!n&&!r&&!i)return!1}return!0})},[r,N,P,F]);return(0,T.jsxs)(`div`,{className:`flex h-full w-full flex-col overflow-hidden bg-background text-foreground`,children:[(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 border-b border-border bg-card/40 px-4 py-3 sm:px-6`,children:[(0,T.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,T.jsx)(`span`,{className:`text-xl`,"aria-hidden":!0,children:`🦂`}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`h1`,{className:`text-base font-semibold leading-none`,children:`Chimera Review Hub & Journal`}),(0,T.jsx)(`p`,{className:`text-xs text-muted-foreground mt-0.5`,children:`Track agent code reviews, findings, session lineage, and audit event timeline`})]})]}),(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,T.jsxs)(`select`,{value:N,onChange:e=>R(e.target.value),className:`rounded-lg border border-border bg-background px-2.5 py-1.5 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-primary`,"aria-label":`Filter by session`,children:[(0,T.jsxs)(`option`,{value:``,children:[`All Sessions (`,J.length,`)`]}),J.map(e=>(0,T.jsxs)(`option`,{value:e,children:[`Session: `,e.length>16?`${e.slice(0,16)}…`:e]},e))]}),(0,T.jsxs)(`select`,{value:P,onChange:e=>z(e.target.value),className:`rounded-lg border border-border bg-background px-2.5 py-1.5 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-primary`,"aria-label":`Filter by status`,children:[(0,T.jsx)(`option`,{value:``,children:`All Statuses`}),(0,T.jsx)(`option`,{value:`open`,children:`Open`}),(0,T.jsx)(`option`,{value:`actioned`,children:`Actioned`}),(0,T.jsx)(`option`,{value:`completed`,children:`Completed`}),(0,T.jsx)(`option`,{value:`skipped`,children:`Skipped`})]}),(0,T.jsxs)(`div`,{className:`relative`,children:[(0,T.jsx)(o,{className:`absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground`}),(0,T.jsx)(`input`,{type:`text`,placeholder:`Search reports...`,value:F,onChange:e=>B(e.target.value),className:`rounded-lg border border-border bg-background pl-8 pr-3 py-1.5 text-xs placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-primary w-40 sm:w-52`})]}),(0,T.jsxs)(`button`,{type:`button`,onClick:()=>I(),disabled:A,className:`inline-flex items-center gap-1 rounded-lg border border-border bg-background px-2.5 py-1.5 text-xs font-medium hover:bg-muted transition-colors disabled:opacity-50`,title:`Refresh reports`,children:[(0,T.jsx)(h,{className:x(`h-3.5 w-3.5`,A&&`animate-spin`)}),(0,T.jsx)(`span`,{className:`hidden sm:inline`,children:`Refresh`})]})]})]}),(0,T.jsxs)(`div`,{className:`flex flex-1 min-h-0 min-w-0`,children:[(0,T.jsxs)(`div`,{className:`flex w-72 sm:w-80 flex-col border-r border-border bg-card/20 shrink-0 overflow-y-auto`,children:[(0,T.jsxs)(`div`,{className:`border-b border-border px-3 py-2 text-xs font-semibold text-muted-foreground uppercase tracking-wider flex items-center justify-between`,children:[(0,T.jsxs)(`span`,{children:[`Reports (`,Y.length,`)`]}),A&&(0,T.jsx)(d,{className:`h-3 w-3 animate-spin`})]}),Y.length===0?(0,T.jsx)(`div`,{className:`p-6 text-center text-xs text-muted-foreground`,children:A?`Loading review reports…`:`No review reports match your filter.`}):(0,T.jsx)(`div`,{className:`divide-y divide-border/60`,children:Y.map(e=>{let t=e.reportId===i,n=O[e.lifecycleStatus]??O.open,r=n.icon,a=e.totalFindings;return(0,T.jsxs)(`button`,{type:`button`,onClick:()=>L(e.reportId),className:x(`flex w-full flex-col gap-1.5 px-3.5 py-3 text-left transition-colors hover:bg-muted/60`,t&&`bg-primary/10 border-l-2 border-primary`),children:[(0,T.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,T.jsxs)(`span`,{className:`text-xs font-semibold truncate font-mono text-foreground`,children:[e.reportId.slice(0,12),`…`]}),(0,T.jsxs)(`span`,{className:x(`inline-flex items-center gap-1 rounded-full border px-1.5 py-0.5 text-[10px] font-medium leading-none`,n.cls),children:[(0,T.jsx)(r,{className:`h-2.5 w-2.5`}),n.label]})]}),(0,T.jsxs)(`div`,{className:`flex items-center justify-between text-[11px] text-muted-foreground`,children:[(0,T.jsxs)(`span`,{className:`truncate`,children:[`Sess: `,e.sessionId.slice(0,10),`…`]}),(0,T.jsx)(`span`,{children:D(e.reviewedAt)})]}),(0,T.jsxs)(`div`,{className:`flex items-center justify-between text-[11px]`,children:[(0,T.jsx)(`span`,{className:`text-muted-foreground`,children:a===0?(0,T.jsx)(`span`,{className:`text-success font-medium`,children:`All clear ✓`}):`${a} finding(s)`}),e.counts&&a>0&&(0,T.jsxs)(`div`,{className:`flex items-center gap-1 font-mono text-[10px]`,children:[e.counts.critical>0&&(0,T.jsxs)(`span`,{className:`text-destructive font-semibold`,children:[e.counts.critical,` critical`]}),e.counts.high>0&&(0,T.jsxs)(`span`,{className:`text-warning`,children:[e.counts.high,` high`]}),e.counts.medium>0&&(0,T.jsxs)(`span`,{className:`text-warning`,children:[e.counts.medium,` med`]}),e.counts.low>0&&(0,T.jsxs)(`span`,{className:`text-muted-foreground`,children:[e.counts.low,` low`]})]})]})]},e.reportId)})})]}),i&&a?.report?(0,T.jsxs)(`div`,{className:`flex flex-1 min-h-0 min-w-0 flex-col lg:flex-row overflow-hidden`,children:[(0,T.jsxs)(`div`,{className:`flex flex-1 min-h-0 min-w-0 flex-col overflow-y-auto p-4 sm:p-6 space-y-6`,children:[(0,T.jsxs)(`div`,{className:`rounded-xl border border-border bg-card p-5 space-y-4 shadow-sm`,children:[(0,T.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,T.jsxs)(`h2`,{className:`text-lg font-bold`,children:[`Review Report`,` `,(0,T.jsxs)(`span`,{className:`font-mono text-sm text-muted-foreground`,children:[`(`,a.report.id,`)`]})]})}),(0,T.jsxs)(`p`,{className:`text-xs text-muted-foreground mt-1`,children:[`Session`,` `,(0,T.jsx)(`span`,{className:`font-mono font-medium text-foreground`,children:a.report.sessionId}),` `,`• Reviewed at `,E(a.report.reviewedAt)]})]}),(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,T.jsxs)(`button`,{type:`button`,onClick:()=>V(a.report.id,`actioned`,`Manual action status`),disabled:a.report.lifecycle===`actioned`,className:`inline-flex items-center gap-1 rounded-lg border border-warning/30 bg-warning/10 px-2.5 py-1 text-xs font-medium text-warning hover:bg-warning/20 disabled:opacity-40 transition-colors`,children:[(0,T.jsx)(c,{className:`h-3.5 w-3.5`}),`Mark Actioned`]}),(0,T.jsxs)(`button`,{type:`button`,onClick:()=>V(a.report.id,`completed`,`Manual completion`),disabled:a.report.lifecycle===`completed`,className:`inline-flex items-center gap-1 rounded-lg border border-success/30 bg-success/10 px-2.5 py-1 text-xs font-medium text-success hover:bg-success/20 disabled:opacity-40 transition-colors`,children:[(0,T.jsx)(p,{className:`h-3.5 w-3.5`}),`Mark Completed`]}),(0,T.jsxs)(`button`,{type:`button`,onClick:()=>V(a.report.id,`skipped`,`Manual skip`),disabled:a.report.lifecycle===`skipped`,className:`inline-flex items-center gap-1 rounded-lg border border-border bg-muted px-2.5 py-1 text-xs font-medium text-muted-foreground hover:bg-muted/80 disabled:opacity-40 transition-colors`,children:[(0,T.jsx)(_,{className:`h-3.5 w-3.5`}),`Skip`]})]})]}),(0,T.jsxs)(`div`,{className:`grid grid-cols-2 sm:grid-cols-4 gap-3 pt-2 border-t border-border/60 text-xs`,children:[(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`span`,{className:`text-muted-foreground block text-[11px]`,children:`Reviewer Model`}),(0,T.jsx)(`span`,{className:`font-mono font-medium text-foreground`,children:a.report.reviewerModel||`default`})]}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`span`,{className:`text-muted-foreground block text-[11px]`,children:`Reviewed Files`}),(0,T.jsxs)(`span`,{className:`font-medium text-foreground`,children:[a.report.files.length,` file(s)`]})]}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`span`,{className:`text-muted-foreground block text-[11px]`,children:`Total Findings`}),(0,T.jsx)(`span`,{className:`font-semibold text-foreground`,children:a.report.totalFindings})]}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`span`,{className:`text-muted-foreground block text-[11px]`,children:`Cascade Depth`}),(0,T.jsx)(`span`,{className:`font-medium text-foreground`,children:a.report.cascadeDepth??0})]})]}),a.report.evidenceStatus&&(0,T.jsxs)(`div`,{className:`rounded-lg bg-muted/40 p-3 border border-border/80 text-xs space-y-2`,children:[(0,T.jsxs)(`div`,{className:`flex items-center gap-2 font-medium`,children:[(0,T.jsx)(`span`,{children:`Machine Evidence Verification:`}),(0,T.jsx)(`span`,{className:x(`px-1.5 py-0.5 rounded text-[10px] font-semibold uppercase border`,a.report.evidenceStatus===`verified`?`bg-success/10 text-success border-success/30`:a.report.evidenceStatus===`failed`?`bg-destructive/10 text-destructive border-destructive/30`:`bg-warning/10 text-warning border-warning/30`),children:a.report.evidenceStatus})]}),a.report.evidenceChecks&&a.report.evidenceChecks.length>0&&(0,T.jsx)(`div`,{className:`space-y-1 font-mono text-[11px] text-muted-foreground`,children:a.report.evidenceChecks.map((e,t)=>(0,T.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,T.jsx)(`span`,{children:e.ok?`✓`:`✗`}),(0,T.jsxs)(`span`,{className:`font-semibold text-foreground`,children:[e.name,`:`]}),(0,T.jsx)(`span`,{className:`truncate`,children:e.command})]},t))})]}),(0,T.jsx)(`div`,{className:`pt-2`,children:(0,T.jsxs)(`button`,{type:`button`,onClick:()=>{if(!a?.report)return;let e=a.report,r=`Take a look at the tasks mentioned in Chimera report (${e.id}) for session ${e.sessionId} — review the ${e.totalFindings} finding(s) it flagged and address them.`,i=n(e.sessionId);i.addMessage({role:`user`,content:r}),i.patch({isLoading:!0}),t().sendMessage(r,void 0,!1,e.sessionId===`__unbound__`?void 0:e.sessionId),V(e.id,`actioned`,`Prompt dispatched to leader`)},className:`inline-flex items-center gap-2 rounded-lg bg-primary px-4 py-2 text-xs font-semibold text-primary-foreground hover:bg-primary/90 transition-colors shadow-sm`,children:[(0,T.jsx)(s,{className:`h-3.5 w-3.5`}),`Dispatch Follow-up Task to Session Leader`]})})]}),(0,T.jsxs)(`div`,{className:`space-y-4`,children:[(0,T.jsx)(`div`,{className:`flex items-center justify-between`,children:(0,T.jsxs)(`h3`,{className:`text-sm font-bold uppercase tracking-wider text-muted-foreground`,children:[`Findings (`,a.findings.length,`)`]})}),a.findings.length===0?(0,T.jsxs)(`div`,{className:`rounded-xl border border-border/80 bg-card/40 p-8 text-center text-xs text-muted-foreground`,children:[(0,T.jsx)(m,{className:`mx-auto h-8 w-8 text-success/60 mb-2`}),`No actionable findings were discovered in this review run.`]}):(0,T.jsx)(`div`,{className:`space-y-3`,children:a.findings.map(({finding:e})=>{let t=k[e.severity]??k.low;return(0,T.jsxs)(`div`,{className:`rounded-xl border border-border bg-card p-4 space-y-3 shadow-sm transition-all hover:border-border/80`,children:[(0,T.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-2`,children:[(0,T.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,T.jsxs)(`span`,{className:x(`inline-flex items-center gap-1 rounded-md px-2 py-0.5 text-xs font-semibold uppercase border`,t.bg,t.text),children:[(0,T.jsx)(`span`,{className:x(`h-1.5 w-1.5 rounded-full`,t.dot)}),e.severity]}),e.category&&(0,T.jsx)(`span`,{className:`rounded-md bg-muted px-2 py-0.5 text-[11px] font-medium text-muted-foreground`,children:e.category}),e.location?.file&&(0,T.jsxs)(`span`,{className:`inline-flex items-center gap-1 font-mono text-xs text-foreground bg-muted/60 px-2 py-0.5 rounded`,children:[(0,T.jsx)(l,{className:`h-3 w-3 text-muted-foreground`}),e.location.file,e.location.line?`:${e.location.line}`:``]})]}),(0,T.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs`,children:[(0,T.jsx)(`span`,{className:`font-semibold text-muted-foreground mr-1`,children:`Status:`}),(0,T.jsx)(`span`,{className:x(`px-2 py-0.5 rounded-full text-[11px] font-medium capitalize border`,e.status===`resolved`?`bg-success/10 text-success border-success/30`:e.status===`ignored`?`bg-muted text-muted-foreground border-border`:`bg-primary/10 text-primary border-primary/30`),children:e.status}),e.status!==`resolved`&&(0,T.jsx)(`button`,{type:`button`,onClick:()=>U(e.id,`resolved`,`fixed`,`Resolved by operator in WebUI`),className:`ml-2 rounded px-2 py-0.5 text-[11px] font-medium bg-success/10 text-success hover:bg-success/20 border border-success/30`,children:`Resolve (Fixed)`}),e.status!==`ignored`&&e.status!==`resolved`&&(0,T.jsx)(`button`,{type:`button`,onClick:()=>U(e.id,`ignored`,void 0,`Ignored by operator`),className:`rounded px-2 py-0.5 text-[11px] font-medium bg-muted text-muted-foreground hover:bg-muted/80 border border-border`,children:`Ignore`}),(e.status===`resolved`||e.status===`ignored`)&&(0,T.jsx)(`button`,{type:`button`,onClick:()=>U(e.id,`active`,void 0,`Reopened in WebUI`),className:`rounded px-2 py-0.5 text-[11px] font-medium bg-primary/10 text-primary hover:bg-primary/20 border border-primary/30`,children:`Reopen`})]})]}),(0,T.jsx)(`h4`,{className:`text-sm font-semibold text-foreground`,children:e.title}),(0,T.jsx)(`p`,{className:`text-xs text-muted-foreground whitespace-pre-wrap`,children:e.description}),e.suggestedFix&&(0,T.jsxs)(`div`,{className:`rounded-lg bg-muted/40 border border-border/80 p-3 space-y-1 text-xs`,children:[(0,T.jsx)(`span`,{className:`font-semibold text-primary block`,children:`Suggested Fix:`}),(0,T.jsx)(`pre`,{className:`font-mono text-[11px] text-foreground overflow-x-auto whitespace-pre-wrap`,children:e.suggestedFix})]}),e.verification&&(0,T.jsxs)(`div`,{className:`text-[11px] text-muted-foreground flex items-center gap-2`,children:[(0,T.jsx)(`span`,{children:`Disk check:`}),(0,T.jsxs)(`span`,{className:x(`font-semibold`,e.verification.status===`verified`?`text-success`:e.verification.status===`failed`?`text-destructive`:`text-warning`),children:[e.verification.status,` (`,e.verification.reason,`)`]}),e.verification.evidence&&(0,T.jsxs)(`span`,{className:`font-mono text-muted-foreground truncate max-w-xs`,children:[`"`,e.verification.evidence,`"`]})]})]},e.id)})})]}),a.report.rawText&&(0,T.jsxs)(`div`,{className:`rounded-xl border border-border bg-card overflow-hidden`,children:[(0,T.jsxs)(`button`,{type:`button`,onClick:()=>q(e=>!e),className:`flex w-full items-center justify-between px-4 py-3 text-xs font-semibold text-muted-foreground hover:bg-muted/50 transition-colors`,children:[(0,T.jsx)(`span`,{children:`Raw Report Markdown`}),K?(0,T.jsx)(f,{className:`h-4 w-4`}):(0,T.jsx)(v,{className:`h-4 w-4`})]}),K&&(0,T.jsx)(`div`,{className:`border-t border-border p-4 bg-muted/20`,children:(0,T.jsx)(`pre`,{className:`text-xs font-mono whitespace-pre-wrap break-words text-muted-foreground`,children:a.report.rawText})})]})]}),(0,T.jsxs)(`div`,{className:`w-full lg:w-80 border-t lg:border-t-0 lg:border-l border-border bg-card/30 flex flex-col shrink-0 overflow-y-auto p-4 space-y-4`,children:[(0,T.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border pb-3`,children:[(0,T.jsx)(u,{className:`h-4 w-4 text-primary`}),(0,T.jsx)(`h3`,{className:`text-sm font-bold`,children:`Activity Journal`})]}),(0,T.jsx)(`div`,{className:`space-y-3 flex-1 overflow-y-auto`,children:a.events.length===0?(0,T.jsx)(`p`,{className:`text-xs text-muted-foreground italic`,children:`No journal events recorded yet.`}):(0,T.jsx)(`div`,{className:`relative pl-4 space-y-4 before:absolute before:left-1.5 before:top-2 before:bottom-2 before:w-0.5 before:bg-border`,children:a.events.map(e=>(0,T.jsxs)(`div`,{className:`relative space-y-1 text-xs`,children:[(0,T.jsx)(`div`,{className:`absolute -left-4 top-1 h-2 w-2 rounded-full bg-primary ring-4 ring-card`}),(0,T.jsxs)(`div`,{className:`flex items-center justify-between gap-1 text-[11px] text-muted-foreground`,children:[(0,T.jsx)(`span`,{className:`font-semibold text-foreground capitalize`,children:e.eventType.replace(`_`,` `)}),(0,T.jsx)(`span`,{children:D(e.timestamp)})]}),(0,T.jsxs)(`div`,{className:`text-[11px] text-muted-foreground`,children:[`Actor: `,(0,T.jsx)(`span`,{className:`font-medium text-foreground`,children:e.actorId}),` (`,e.actorKind,`)`]}),e.fromLifecycle&&e.toLifecycle&&(0,T.jsxs)(`div`,{className:`text-[11px] text-muted-foreground`,children:[`Status:`,` `,(0,T.jsxs)(`span`,{className:`text-foreground`,children:[e.fromLifecycle,` ➔ `,e.toLifecycle]})]}),e.reason&&(0,T.jsxs)(`p`,{className:`rounded bg-muted/60 p-1.5 text-[11px] text-foreground/90 italic`,children:[`"`,e.reason,`"`]})]},e.id))})}),(0,T.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),i&&W.trim()&&(H(i,W.trim()),G(``))},className:`pt-3 border-t border-border space-y-2`,children:[(0,T.jsx)(`label`,{className:`text-xs font-semibold text-muted-foreground block`,children:`Add Journal Note / Inote:`}),(0,T.jsx)(`textarea`,{rows:3,value:W,onChange:e=>G(e.target.value),placeholder:`Record an observation, fix PR link, or triage note...`,className:`w-full rounded-lg border border-border bg-background p-2 text-xs placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-primary`}),(0,T.jsxs)(`button`,{type:`submit`,disabled:!W.trim(),className:`inline-flex w-full items-center justify-center gap-1.5 rounded-lg bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground hover:bg-primary/90 transition-colors disabled:opacity-50`,children:[(0,T.jsx)(y,{className:`h-3.5 w-3.5`}),`Append to Journal`]})]})]})]}):(0,T.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-8`,children:(0,T.jsx)(C,{icon:(0,T.jsx)(g,{className:`h-12 w-12 text-muted-foreground/40`}),title:`Select a Chimera Review Report`,description:`Choose a review report from the left pane to view structured findings, disk verification proofs, and the activity journal.`})})]})]})}export{A as ChimeraReviewsView};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{K as t}from"./config-store-mWuYCild.js";import{i as n,t as r}from"./react-core-wiHys0m2.js";import{Dn as i,Ha as a,Ii as o,In as s,Ka as c,Mt as ee,Rr as te,Vn as ne,Yi as l,Yt as u,ci as d,da as re,ho as f,ja as p,ln as m,pi as ie,xo as h,yn as g}from"./vendor-V3ydTHqN.js";import"./i18n-CvJB4U4z.js";import{t as _}from"./utils-CKsqCaP8.js";import{E as ae,T as oe}from"./index-DLjaZSCH.js";var v=e(n(),1),y=r();function b({status:e}){let{t}=h();return(0,y.jsxs)(`section`,{className:`flex flex-wrap gap-x-5 gap-y-1 border-b border-border/60 bg-primary/[0.025] px-4 py-1.5 font-mono text-[9px] text-muted-foreground`,title:e.chronicleDirectory,children:[(0,y.jsx)(`span`,{className:`font-sans font-semibold uppercase tracking-wider text-primary`,children:t(`activity:chroniclePipelineStrip.chronicleOwnership`)}),(0,y.jsxs)(`span`,{children:[`collect `,(0,y.jsx)(`b`,{className:`text-foreground`,children:e.pipeline.collection})]}),(0,y.jsxs)(`span`,{children:[`process `,(0,y.jsx)(`b`,{className:`text-foreground`,children:e.pipeline.processing})]}),(0,y.jsxs)(`span`,{children:[`serve `,(0,y.jsx)(`b`,{className:`text-foreground`,children:e.pipeline.serving})]}),(0,y.jsxs)(`span`,{children:[`PID `,(0,y.jsx)(`b`,{className:`text-foreground`,children:e.pid}),` · `,e.clients,` clients`]}),(0,y.jsxs)(`span`,{children:[`watcher`,` `,(0,y.jsx)(`b`,{className:_(e.watcher.active?`text-success`:`text-warning`),children:e.watcher.active?`active`:`inactive`}),` `,`· `,e.watcher.watchedFiles,` files`]}),(0,y.jsxs)(`span`,{children:[`store `,(0,y.jsx)(`b`,{className:`text-foreground`,children:x(e.pipeline.storage)})]}),e.mode===`inline`&&(0,y.jsx)(`span`,{className:`font-sans font-semibold text-warning`,children:t(`activity:chroniclePipelineStrip.inlineFallback`)})]})}function x(e){return e.replaceAll(`\\`,`/`).split(`/`).filter(Boolean).slice(-3).join(`/`)}var S=[`eventType`,`providerId`,`modelId`,`outcome`,`resourceKind`],C=864e5;function w(){return{limit:300,order:`desc`,from:new Date(Date.now()-C).toISOString()}}var se=[{id:`all`,labelKey:`activity:chronicle.signalAllSignals`,icon:(0,y.jsx)(f,{})},{id:`llm`,labelKey:`activity:chronicle.signalLlm`,icon:(0,y.jsx)(a,{})},{id:`agents`,labelKey:`activity:chronicle.signalAgents`,icon:(0,y.jsx)(c,{})},{id:`tools`,labelKey:`activity:chronicle.signalTools`,icon:(0,y.jsx)(m,{})},{id:`files`,labelKey:`activity:chronicle.signalFiles`,icon:(0,y.jsx)(o,{})},{id:`failures`,labelKey:`activity:chronicle.signalFailures`,icon:(0,y.jsx)(u,{})}];function T(){let{t:e}=h(),n=t(),[r,l]=(0,v.useState)([]),[u,d]=(0,v.useState)(null),[f,p]=(0,v.useState)({}),[g,x]=(0,v.useState)(w()),[C,T]=(0,v.useState)({text:``,path:``,providerId:``,modelId:``,sessionId:``}),[E,k]=(0,v.useState)(`all`),[N,F]=(0,v.useState)({total:0,scannedEvents:0,sourceFiles:0,invalidLines:0}),[I,pe]=(0,v.useState)(D),[L,R]=(0,v.useState)(!0),[z,B]=(0,v.useState)(null),[me,V]=(0,v.useState)(null),[H,he]=(0,v.useState)([]),[U,ge]=(0,v.useState)([]),[W,_e]=(0,v.useState)(null),G=(0,v.useRef)(g);G.current=g;let K=(0,v.useCallback)(e=>{if(!n.supportsCapability(`chronicle.query`)){R(!1),B(`Restart the backend once to activate Chronicle protocol support.`);return}if(R(!0),B(null),x(e),p({}),n.send({type:`chronicle.query`,payload:{query:e}}),n.supportsCapability(`chronicle.facets`))n.send({type:`chronicle.facets`,payload:{fields:[...S],query:e,limit:12}});else for(let t of S)n.send({type:`chronicle.facet`,payload:{field:t,query:e,limit:12}})},[n]),q=(0,v.useCallback)(()=>{n.supportsCapability(`chronicle.metrics`)&&(n.send({type:`chronicle.metrics`,payload:{view:`providers`}}),n.send({type:`chronicle.metrics`,payload:{view:`tasks`,limit:200}}))},[n]),J=(0,v.useCallback)(()=>{n.supportsCapability(`chronicle.status`)&&n.send({type:`chronicle.status`})},[n]);(0,v.useEffect)(()=>{let e=n.on(`chronicle.query_result`,e=>{e.type===`chronicle.query_result`&&(l(e.payload.events),F(e.payload),pe(e.payload.summary??D),R(!1))}),t=n.on(`chronicle.facet_result`,e=>{e.type===`chronicle.facet_result`&&p(t=>({...t,[e.payload.field]:e.payload.values}))}),r=n.on(`chronicle.facets_result`,e=>{e.type===`chronicle.facets_result`&&p(e.payload.values)}),i=n.on(`chronicle.error`,e=>{e.type===`chronicle.error`&&(B(e.payload.message),R(!1))}),a=n.on(`chronicle.graph_result`,e=>{e.type===`chronicle.graph_result`&&V(e.payload)}),o=n.on(`chronicle.metrics_result`,e=>{e.type===`chronicle.metrics_result`&&(e.payload.view===`providers`?he(e.payload.data):e.payload.view===`tasks`&&ge(e.payload.data))}),s=n.on(`chronicle.status_result`,e=>{e.type===`chronicle.status_result`&&_e(e.payload)});return K(G.current),q(),J(),()=>{e(),t(),r(),i(),a(),o(),s()}},[n,K,q,J]);let Y=(0,v.useMemo)(()=>r.filter(e=>O(e,E)),[r,E]),X=ae(Y,25,E),Z=(0,v.useMemo)(()=>{let e=r.find(e=>e.eventType===`metrics.rollup`&&e.attributes?.signal===`runtime.health`)?.attributes?.stats;if(!e)return;let t=t=>e[t]?.last;return{eventLoop:{utilization:t(`eventLoop.utilization`),delayP95Ms:t(`eventLoop.delayP95Ms`)},memory:{heapUsedBytes:t(`memory.heapUsedBytes`)},chronicle:{pendingEvents:t(`chronicle.pendingEvents`),rejectedEvents:t(`chronicle.rejectedEvents`)}}},[r]),Q=(0,v.useMemo)(()=>{let e={};for(let t of U)e[t.status]=(e[t.status]??0)+1;let t=(e.completed??0)+(e.merged??0)+(e.failed??0)+(e.conflict??0),n=(e.completed??0)+(e.merged??0),r=[...U].sort((e,t)=>(t.endedAt??t.startedAt??``).localeCompare(e.endedAt??e.startedAt??``)).slice(0,8);return{counts:e,total:U.length,terminal:t,successRate:t>0?n/t*100:100,recent:r}},[U]),$=()=>K({...w(),...C.text?{text:C.text}:{},...C.path?{path:C.path}:{},...C.providerId?{providerId:C.providerId}:{},...C.modelId?{modelId:C.modelId}:{},...C.sessionId?{sessionId:C.sessionId}:{}}),ve=()=>{T({text:``,path:``,providerId:``,modelId:``,sessionId:``}),k(`all`),K(w())},ye=e=>{d(e),V(null),n.supportsCapability(`chronicle.graph`)&&n.send({type:`chronicle.graph`,payload:{seed:{eventId:e.eventId},hops:2,maxNodes:250}})};return(0,y.jsxs)(`div`,{className:`flex h-full min-h-0 bg-background`,"data-testid":`chronicle-dashboard`,children:[(0,y.jsxs)(`main`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,y.jsx)(`header`,{className:`border-b border-border/70 bg-gradient-to-r from-primary/[0.045] via-background to-background px-5 py-4`,children:(0,y.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,y.jsxs)(`div`,{children:[(0,y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,y.jsx)(a,{className:`h-5 w-5 text-primary`}),(0,y.jsx)(`h1`,{className:`text-lg font-semibold tracking-tight`,children:e(`activity:chronicle.codingIntelligence`)}),(0,y.jsx)(`span`,{className:`rounded-full border border-primary/20 bg-primary/10 px-2 py-0.5 text-[9px] font-semibold tracking-wider text-primary`,children:e(`activity:chronicle.chronicle`)})]}),(0,y.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:e(`activity:chronicle.llmAgentToolAndFileEvidence`)})]}),(0,y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,y.jsx)(`span`,{className:_(`h-2 w-2 rounded-full`,z?`bg-destructive`:L?`animate-pulse bg-warning`:`bg-success`)}),(0,y.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:L?`Reading journal`:z?`Unavailable`:`Live evidence`}),(0,y.jsx)(`button`,{type:`button`,onClick:()=>{K(g),q(),J()},className:`ml-2 rounded-md border border-border bg-card p-2 hover:bg-muted`,title:e(`activity:chronicle.refreshEvidence`),children:(0,y.jsx)(ne,{className:_(`h-4 w-4`,L&&`animate-spin`)})})]})]})}),(0,y.jsxs)(`section`,{className:`grid grid-cols-2 border-b border-border/70 xl:grid-cols-6`,children:[(0,y.jsx)(M,{icon:(0,y.jsx)(a,{}),label:e(`activity:chronicle.llmRequests`),value:I.logicalRequests,detail:`${I.modelAttempts} attempts · ${I.providers} providers · ${I.models} models`}),(0,y.jsx)(M,{icon:(0,y.jsx)(c,{}),label:e(`activity:chronicle.agentWork`),value:I.agentEvents,detail:`${I.uniqueAgents} correlated agents · ${I.decisions} decisions`}),(0,y.jsx)(M,{icon:(0,y.jsx)(m,{}),label:e(`activity:chronicle.toolCalls`),value:I.toolCalls,detail:`${I.failedTools} failed · ${I.processes} processes`}),(0,y.jsx)(M,{icon:(0,y.jsx)(o,{}),label:e(`activity:chronicle.fileEvidence`),value:I.fileEvents,detail:`${I.uniqueFiles} unique paths`}),(0,y.jsx)(M,{icon:(0,y.jsx)(s,{}),label:e(`activity:chronicle.retries`),value:I.scheduledRetries,detail:`${I.failures} failures · ${I.fallbacks} fallbacks`,tone:I.failures?`danger`:`normal`}),(0,y.jsx)(M,{icon:(0,y.jsx)(re,{}),label:e(`activity:chronicle.providerP95`),value:A(I.providerP95DurationMs),detail:`${A(I.providerAvgDurationMs)} average · all matches`})]}),(0,y.jsxs)(`section`,{className:`flex flex-wrap gap-x-6 gap-y-1 border-b border-border/60 bg-primary/[0.018] px-4 py-1.5 font-mono text-[9px] text-muted-foreground`,children:[(0,y.jsx)(`span`,{className:`font-sans font-semibold uppercase tracking-wider text-primary`,children:e(`activity:chronicle.tokenEconomics`)}),(0,y.jsxs)(`span`,{children:[e(`activity:chronicle.freshInput`),` `,(0,y.jsx)(`b`,{className:`text-foreground`,children:I.inputTokens.toLocaleString()})]}),(0,y.jsxs)(`span`,{children:[`output `,(0,y.jsx)(`b`,{className:`text-foreground`,children:I.outputTokens.toLocaleString()})]}),(0,y.jsxs)(`span`,{children:[e(`activity:chronicle.cacheRead`),` `,(0,y.jsx)(`b`,{className:`text-foreground`,children:I.cacheReadTokens.toLocaleString()})]}),(0,y.jsxs)(`span`,{children:[`cache write`,` `,(0,y.jsx)(`b`,{className:`text-foreground`,children:I.cacheWriteTokens.toLocaleString()})]}),(0,y.jsxs)(`span`,{children:[e(`activity:chronicle.cacheHit`),` `,(0,y.jsxs)(`b`,{className:`text-foreground`,children:[le(I).toFixed(1),`%`]})]}),(0,y.jsxs)(`span`,{children:[e(`activity:chronicle.estimatedCost`),` `,(0,y.jsxs)(`b`,{className:`text-foreground`,children:[`$`,I.estimatedCostUsd.toFixed(4)]})]})]}),H.length>0&&(0,y.jsxs)(`section`,{className:`flex items-center gap-3 overflow-x-auto border-b border-border/60 bg-muted/[0.14] px-4 py-1.5`,children:[(0,y.jsx)(`span`,{className:`shrink-0 text-[9px] font-semibold uppercase tracking-wider text-muted-foreground`,children:e(`activity:chronicle.modelReliability`)}),H.slice(0,6).map(e=>{let t=e.completed+e.failed,n=t>0?e.completed/t*100:100;return(0,y.jsxs)(`span`,{className:`flex shrink-0 items-center gap-2 rounded-full border border-border bg-card px-2.5 py-0.5 font-mono text-[9px]`,title:`${e.day} · ${e.attempts} attempts · avg ${A(e.avgDurationMs)} · ${e.inputTokens.toLocaleString()} in / ${e.outputTokens.toLocaleString()} out`,children:[(0,y.jsx)(`span`,{className:_(`h-1.5 w-1.5 rounded-full`,n>=99?`bg-success`:n>=90?`bg-warning`:`bg-destructive`)}),(0,y.jsxs)(`span`,{className:`max-w-[180px] truncate`,children:[e.providerId,`/`,e.modelId]}),(0,y.jsxs)(`b`,{className:`text-foreground`,children:[n.toFixed(0),`%`]}),(0,y.jsx)(`span`,{className:`text-muted-foreground`,children:e.day.slice(5)})]},`${e.day}-${e.providerId}-${e.modelId}`)})]}),Q.total>0&&(0,y.jsxs)(`section`,{className:`flex items-center gap-3 overflow-x-auto border-b border-border/60 bg-muted/[0.10] px-4 py-1.5`,children:[(0,y.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1 text-[9px] font-semibold uppercase tracking-wider text-muted-foreground`,children:[(0,y.jsx)(te,{className:`h-3 w-3`}),e(`activity:chronicle.taskOutcomes`)]}),(0,y.jsxs)(`span`,{className:`flex shrink-0 items-center gap-2 rounded-full border border-border bg-card px-2.5 py-0.5 font-mono text-[9px]`,title:`${Q.total} tasks tracked · ${Q.terminal} finished`,children:[(0,y.jsx)(`span`,{className:_(`h-1.5 w-1.5 rounded-full`,Q.successRate>=90?`bg-success`:Q.successRate>=60?`bg-warning`:`bg-destructive`)}),(0,y.jsxs)(`b`,{className:`text-foreground`,children:[Q.successRate.toFixed(0),`%`]}),(0,y.jsxs)(`span`,{className:`text-muted-foreground`,children:[`success · `,Q.total,` tasks`]})]}),[`completed`,`merged`,`failed`,`conflict`,`started`].filter(e=>Q.counts[e]).map(e=>(0,y.jsxs)(`span`,{className:`shrink-0 font-mono text-[9px] text-muted-foreground`,children:[e,` `,(0,y.jsx)(`b`,{className:_(e===`failed`||e===`conflict`?`text-destructive`:`text-foreground`),children:Q.counts[e]})]},e)),(0,y.jsx)(`span`,{className:`mx-1 h-3 w-px shrink-0 bg-border`}),Q.recent.map(e=>(0,y.jsxs)(`button`,{type:`button`,onClick:()=>K({limit:300,order:`desc`,taskId:e.taskId}),className:`flex shrink-0 items-center gap-1.5 rounded-full border border-border bg-card px-2 py-0.5 font-mono text-[9px] hover:border-primary/50`,title:`${e.taskId}${e.boardId?` · board ${e.boardId}`:``}${e.sessionId?` · ${e.sessionId}`:``} · ${e.filesTouched} files${e.retries?` · ${e.retries} retries`:``}${e.verificationFailures?` · ${e.verificationFailures} verify-fails`:``}`,children:[(0,y.jsx)(`span`,{className:_(`h-1.5 w-1.5 rounded-full`,e.status===`completed`||e.status===`merged`?`bg-success`:e.status===`failed`||e.status===`conflict`?`bg-destructive`:`bg-primary`)}),(0,y.jsx)(`span`,{className:`max-w-[84px] truncate`,children:e.taskId}),e.durationMs!==null&&(0,y.jsx)(`span`,{className:`text-muted-foreground`,children:A(e.durationMs)}),e.filesTouched>0&&(0,y.jsxs)(`span`,{className:`flex items-center gap-0.5 text-muted-foreground`,children:[(0,y.jsx)(o,{className:`h-2.5 w-2.5`}),e.filesTouched]})]},e.taskId))]}),(0,y.jsx)(`section`,{className:`border-b border-border/70 px-4 py-3`,children:(0,y.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 xl:grid-cols-[1.35fr_1fr_1fr_1fr_1fr_auto]`,children:[(0,y.jsx)(j,{icon:(0,y.jsx)(i,{}),placeholder:e(`activity:chronicle.searchEventEvidence`),value:C.text,onChange:e=>T(t=>({...t,text:e})),onEnter:$}),(0,y.jsx)(j,{placeholder:e(`activity:chronicle.fileOrDirectory`),value:C.path,onChange:e=>T(t=>({...t,path:e})),onEnter:$}),(0,y.jsx)(j,{placeholder:e(`activity:chronicle.provider`),value:C.providerId,onChange:e=>T(t=>({...t,providerId:e})),onEnter:$}),(0,y.jsx)(j,{placeholder:e(`activity:chronicle.model`),value:C.modelId,onChange:e=>T(t=>({...t,modelId:e})),onEnter:$}),(0,y.jsx)(j,{placeholder:e(`activity:chronicle.session`),value:C.sessionId,onChange:e=>T(t=>({...t,sessionId:e})),onEnter:$}),(0,y.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,y.jsxs)(`button`,{type:`button`,onClick:$,className:`rounded-md bg-primary px-3 text-xs font-medium text-primary-foreground`,children:[(0,y.jsx)(ie,{className:`mr-1 inline h-3 w-3`}),e(`activity:chronicle.apply`)]}),(0,y.jsx)(`button`,{type:`button`,onClick:ve,className:`rounded-md border border-border px-2.5 text-xs hover:bg-muted`,children:e(`activity:chronicle.clear`)})]})]})}),(0,y.jsxs)(`section`,{className:`flex items-center gap-1 overflow-x-auto border-b border-border/70 px-4 py-2`,children:[se.map(t=>(0,y.jsxs)(`button`,{type:`button`,onClick:()=>k(t.id),className:_(`flex shrink-0 items-center gap-1.5 rounded-md px-2.5 py-1.5 text-[11px] transition-colors [&>svg]:h-3.5 [&>svg]:w-3.5`,E===t.id?`bg-primary/10 font-medium text-primary`:`text-muted-foreground hover:bg-muted hover:text-foreground`),children:[t.icon,e(t.labelKey),(0,y.jsx)(`span`,{className:`ml-1 rounded bg-background/70 px-1 font-mono text-[9px]`,children:ce(I,t.id,N.total)})]},t.id)),(0,y.jsxs)(`div`,{className:`ml-auto hidden items-center gap-3 pl-4 text-[9px] text-muted-foreground lg:flex`,children:[(0,y.jsxs)(`span`,{children:[N.total.toLocaleString(),` matched`]}),(0,y.jsxs)(`span`,{children:[N.sourceFiles,` journal files`]}),N.invalidLines>0&&(0,y.jsxs)(`span`,{className:`text-warning`,children:[N.invalidLines,` invalid lines`]})]})]}),W&&(0,y.jsx)(b,{status:W}),Z&&(0,y.jsx)(ue,{health:Z}),(0,y.jsx)(`section`,{className:`flex gap-4 overflow-x-auto border-b border-border/60 bg-muted/[0.18] px-4 py-2`,children:[`providerId`,`modelId`,`outcome`].map(e=>(0,y.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[(0,y.jsx)(`span`,{className:`mr-1 text-[9px] font-semibold uppercase tracking-wider text-muted-foreground`,children:e.replace(`Id`,``)}),(f[e]??[]).slice(0,4).map(t=>(0,y.jsxs)(`button`,{type:`button`,onClick:()=>K({...g,[e]:t.value}),className:`rounded-full border border-border bg-card px-2 py-0.5 text-[9px] hover:border-primary/50`,children:[t.value,` `,(0,y.jsx)(`b`,{children:t.count})]},t.value))]},e))}),(0,y.jsxs)(`div`,{className:`grid grid-cols-[92px_minmax(190px,1.25fr)_110px_minmax(180px,1fr)_minmax(140px,.8fr)_24px] gap-3 border-b border-border/60 bg-muted/20 px-4 py-1.5 text-[9px] font-semibold uppercase tracking-wider text-muted-foreground`,children:[(0,y.jsx)(`span`,{children:e(`activity:chronicle.time`)}),(0,y.jsx)(`span`,{children:e(`activity:chronicle.signal`)}),(0,y.jsx)(`span`,{children:e(`activity:chronicle.outcome`)}),(0,y.jsx)(`span`,{children:e(`activity:chronicle.modelAgent`)}),(0,y.jsx)(`span`,{children:e(`activity:chronicle.resource`)}),(0,y.jsx)(`span`,{})]}),(0,y.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:z?(0,y.jsx)(P,{text:z}):!L&&Y.length===0?(0,y.jsx)(P,{text:`No coding evidence matches these filters.`}):(0,y.jsx)(`div`,{className:`divide-y divide-border/40`,children:X.pageItems.map(e=>(0,y.jsx)(de,{event:e,active:u?.eventId===e.eventId,onClick:()=>ye(e)},e.eventId))})}),(0,y.jsx)(oe,{page:X.page,pageSize:X.pageSize,totalItems:X.totalItems,onPageChange:X.setPage,itemLabel:`events`})]}),u&&(0,y.jsxs)(`aside`,{className:`w-[440px] max-w-[48vw] shrink-0 overflow-auto border-l border-border bg-card/60 shadow-[-12px_0_32px_hsl(var(--background)/.35)]`,children:[(0,y.jsxs)(`div`,{className:`sticky top-0 z-10 flex items-center justify-between border-b border-border bg-card/95 px-4 py-3 backdrop-blur`,children:[(0,y.jsxs)(`div`,{children:[(0,y.jsx)(`div`,{className:`text-xs font-semibold`,children:e(`activity:chronicle.evidenceLineage`)}),(0,y.jsxs)(`div`,{className:`mt-0.5 font-mono text-[9px] text-muted-foreground`,children:[`#`,u.sequence,` · `,u.eventId]})]}),(0,y.jsx)(`button`,{type:`button`,onClick:()=>d(null),className:`rounded p-1 hover:bg-muted`,children:(0,y.jsx)(ee,{className:`h-4 w-4`})})]}),(0,y.jsx)(fe,{event:u,graph:me})]})]})}var E={llm:0,agent:0,tool:0,file:0,memory:0,task:0,decision:0,runtime:0},D={logicalRequests:0,modelAttempts:0,completedAttempts:0,failedAttempts:0,scheduledRetries:0,fallbacks:0,providers:0,models:0,inputTokens:0,outputTokens:0,cacheReadTokens:0,cacheWriteTokens:0,estimatedCostUsd:0,providerAvgDurationMs:0,providerP95DurationMs:0,toolCalls:0,completedTools:0,failedTools:0,toolAvgDurationMs:0,processes:0,failedProcesses:0,fileEvents:0,uniqueFiles:0,agentEvents:0,uniqueAgents:0,decisions:0,escalations:0,failures:0,cancellations:0,families:{...E},failuresByFamily:{...E}};function ce(e,t,n){return t===`all`?n:t===`llm`?e.families.llm:t===`agents`?e.families.agent:t===`tools`?e.families.tool:t===`files`?e.families.file:e.failures}function le(e){let t=e.inputTokens+e.cacheReadTokens;return t?e.cacheReadTokens/t*100:0}function O(e,t){return t===`all`?!0:t===`llm`?/^(provider|token|context|compaction)\./.test(e.eventType):t===`agents`?/^(agent|subagent|delegate|fleet|sdd)\./.test(e.eventType):t===`tools`?/^(tool|process|mcp|network)\./.test(e.eventType):t===`files`?e.resource?.kind===`file`||/^(file|worktree|storage)\./.test(e.eventType):e.outcome===`failure`||/(?:failed|error|retry|fallback|blocked|conflict)/i.test(e.eventType)}function k(e){if(!e)return`—`;let t=e/1e6;return t<1?`${(e/1e3).toFixed(0)}µs`:t<1e3?`${t.toFixed(1)}ms`:`${(t/1e3).toFixed(1)}s`}function A(e){return e?e<1?`${(e*1e3).toFixed(0)}µs`:e<1e3?`${e.toFixed(1)}ms`:`${(e/1e3).toFixed(1)}s`:`—`}function j({placeholder:e,value:t,onChange:n,onEnter:r,icon:i}){return(0,y.jsxs)(`label`,{className:`flex items-center gap-2 rounded-md border border-border bg-card px-2.5 py-2 focus-within:border-primary/60`,children:[i&&(0,y.jsx)(`span`,{className:`text-muted-foreground [&>svg]:h-3.5 [&>svg]:w-3.5`,children:i}),(0,y.jsx)(`input`,{className:`w-full bg-transparent text-xs outline-none placeholder:text-muted-foreground/70`,placeholder:e,value:t,onChange:e=>n(e.target.value),onKeyDown:e=>{e.key===`Enter`&&r()}})]})}function M({icon:e,label:t,value:n,detail:r,tone:i=`normal`}){return(0,y.jsxs)(`div`,{className:`min-w-0 border-r border-border/60 px-4 py-3`,children:[(0,y.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[10px] font-medium uppercase tracking-wide text-muted-foreground`,children:[(0,y.jsx)(`span`,{className:`text-primary [&>svg]:h-3.5 [&>svg]:w-3.5`,children:e}),t]}),(0,y.jsx)(`div`,{className:_(`mt-1 text-xl font-semibold tabular-nums`,i===`danger`&&`text-destructive`),children:typeof n==`number`?n.toLocaleString():n}),(0,y.jsx)(`div`,{className:`mt-0.5 truncate text-[9px] text-muted-foreground`,children:r})]})}function ue({health:e}){let{t}=h();return(0,y.jsxs)(`section`,{className:`flex flex-wrap gap-x-5 gap-y-1 border-b border-border/60 bg-success/[0.025] px-4 py-1.5 font-mono text-[9px] text-muted-foreground`,children:[(0,y.jsx)(`span`,{className:`font-sans font-semibold uppercase tracking-wider text-success`,children:t(`activity:chronicle.collectorHealthy`)}),(0,y.jsxs)(`span`,{children:[`ELU`,` `,(0,y.jsxs)(`b`,{className:`text-foreground`,children:[((e.eventLoop?.utilization??0)*100).toFixed(1),`%`]})]}),(0,y.jsxs)(`span`,{children:[`p95 `,(0,y.jsxs)(`b`,{className:`text-foreground`,children:[(e.eventLoop?.delayP95Ms??0).toFixed(1),`ms`]})]}),(0,y.jsxs)(`span`,{children:[`heap`,` `,(0,y.jsxs)(`b`,{className:`text-foreground`,children:[((e.memory?.heapUsedBytes??0)/1048576).toFixed(0),`MB`]})]}),(0,y.jsxs)(`span`,{children:[`queue `,(0,y.jsx)(`b`,{className:`text-foreground`,children:e.chronicle?.pendingEvents??0})]}),(0,y.jsxs)(`span`,{children:[`dropped`,` `,(0,y.jsx)(`b`,{className:_((e.chronicle?.rejectedEvents??0)>0&&`text-destructive`),children:e.chronicle?.rejectedEvents??0})]})]})}function de({event:e,active:t,onClick:n}){let r=e.occurredAt??e.observedAt,i=e.runtime?.modelId??e.scope.agentId??e.runtime?.providerId??`—`,a=e.resource?.path??e.resource?.id??e.correlation.toolCallId??`—`;return(0,y.jsxs)(`button`,{type:`button`,onClick:n,className:_(`grid w-full grid-cols-[92px_minmax(190px,1.25fr)_110px_minmax(180px,1fr)_minmax(140px,.8fr)_24px] items-center gap-3 px-4 py-2.5 text-left hover:bg-muted/45`,t&&`bg-primary/[0.07]`),children:[(0,y.jsx)(`span`,{className:`font-mono text-[9px] text-muted-foreground`,children:new Date(r).toLocaleTimeString()}),(0,y.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,y.jsx)(`span`,{className:_(`h-1.5 w-1.5 shrink-0 rounded-full`,e.outcome===`failure`?`bg-destructive`:e.outcome===`success`?`bg-success`:`bg-primary`)}),(0,y.jsx)(`span`,{className:`truncate font-mono text-[11px] font-medium`,children:e.eventType})]}),(0,y.jsx)(`span`,{className:_(`w-fit rounded px-1.5 py-0.5 text-[9px]`,F(e.outcome)),children:e.outcome??`unknown`}),(0,y.jsx)(`span`,{className:`truncate font-mono text-[9px] text-muted-foreground`,children:i}),(0,y.jsx)(`span`,{className:`truncate font-mono text-[9px] text-muted-foreground`,children:a}),(0,y.jsx)(p,{className:`h-3.5 w-3.5 text-muted-foreground`})]})}function fe({event:e,graph:t}){let{t:n}=h(),r=(0,v.useMemo)(()=>[[`Scope`,e.scope],[`Correlation`,e.correlation],[`Runtime`,e.runtime],[`Resource`,e.resource],[`Attributes`,e.attributes],[`Tags`,e.tags]],[e]);return(0,y.jsxs)(`div`,{className:`p-4`,children:[(0,y.jsxs)(`div`,{className:`mb-4 rounded-lg border border-border bg-background/60 p-3`,children:[(0,y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,y.jsx)(`span`,{className:_(`h-2 w-2 rounded-full`,e.outcome===`failure`?`bg-destructive`:e.outcome===`success`?`bg-success`:`bg-primary`)}),(0,y.jsx)(`span`,{className:`font-mono text-xs font-semibold`,children:e.eventType})]}),(0,y.jsxs)(`div`,{className:`mt-2 flex gap-4 text-[9px] text-muted-foreground`,children:[(0,y.jsx)(`span`,{children:new Date(e.occurredAt??e.observedAt).toLocaleString()}),(0,y.jsx)(`span`,{children:k(Number(e.durationNs??0))})]})]}),(0,y.jsxs)(`div`,{className:`mb-4 grid grid-cols-2 gap-2`,children:[(0,y.jsx)(N,{icon:(0,y.jsx)(g,{}),label:n(`activity:chronicle.evidenceHash`),value:e.hash.slice(0,16)}),(0,y.jsx)(N,{icon:(0,y.jsx)(l,{}),label:n(`activity:chronicle.sequence`),value:String(e.sequence)})]}),t&&(0,y.jsxs)(`section`,{className:`mb-4`,children:[(0,y.jsxs)(`h3`,{className:`mb-1.5 flex items-center gap-1 text-[9px] font-semibold uppercase tracking-wider text-muted-foreground`,children:[(0,y.jsx)(d,{className:`h-3 w-3`}),`Lineage · `,t.nodes.length,` nodes · `,t.edges.length,` edges`]}),(0,y.jsx)(`div`,{className:`space-y-1 rounded-md border border-border bg-background/70 p-2`,children:t.edges.slice(0,40).map((e,n)=>(0,y.jsxs)(`div`,{className:`flex items-center gap-2 font-mono text-[9px]`,children:[(0,y.jsx)(`span`,{className:_(`rounded px-1`,e.confidence===`explicit`?`bg-success/10 text-success`:e.confidence===`inferred`?`bg-warning/10 text-warning`:`bg-primary/10 text-primary`),children:e.confidence}),(0,y.jsx)(`span`,{className:`text-muted-foreground`,children:e.kind}),(0,y.jsxs)(`span`,{className:`truncate`,children:[t.nodes.find(t=>t.eventId===e.from)?.eventType,` →`,` `,t.nodes.find(t=>t.eventId===e.to)?.eventType]})]},`${e.from}-${e.to}-${e.kind}-${n}`))}),t.truncated&&(0,y.jsx)(`p`,{className:`mt-1 text-[9px] text-warning`,children:n(`activity:chronicle.lineageTruncatedAtSafetyLimit`)})]}),r.map(([e,t])=>t&&(0,y.jsxs)(`section`,{className:`mb-4`,children:[(0,y.jsx)(`h3`,{className:`mb-1.5 text-[9px] font-semibold uppercase tracking-wider text-muted-foreground`,children:e}),(0,y.jsx)(`pre`,{className:`overflow-auto rounded-md border border-border bg-background/70 p-3 font-mono text-[9px] leading-relaxed`,children:JSON.stringify(t,null,2)})]},e))]})}function N({icon:e,label:t,value:n}){return(0,y.jsxs)(`div`,{className:`rounded-md border border-border p-2`,children:[(0,y.jsxs)(`div`,{className:`flex items-center gap-1 text-[8px] uppercase text-muted-foreground`,children:[(0,y.jsx)(`span`,{className:`[&>svg]:h-3 [&>svg]:w-3`,children:e}),t]}),(0,y.jsx)(`div`,{className:`mt-1 truncate font-mono text-[9px]`,children:n})]})}function P({text:e}){return(0,y.jsx)(`div`,{className:`flex h-48 items-center justify-center text-sm text-muted-foreground`,children:e})}function F(e){return e===`failure`?`bg-destructive/10 text-destructive`:e===`success`?`bg-success/10 text-success`:e===`started`?`bg-primary/10 text-primary`:`bg-muted text-muted-foreground`}export{T as ChronicleDashboard};