@principal-ai/subsystems-react 0.39.0 → 0.41.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 (35) hide show
  1. package/dist/components/maintain-events/MaintainEventLog.d.ts +35 -0
  2. package/dist/components/maintain-events/MaintainEventLog.d.ts.map +1 -0
  3. package/dist/components/maintain-events/MaintainEventLog.js +66 -0
  4. package/dist/components/maintain-events/MaintainEventLog.js.map +1 -0
  5. package/dist/components/maintain-events/MaintainLivePanel.d.ts +15 -0
  6. package/dist/components/maintain-events/MaintainLivePanel.d.ts.map +1 -0
  7. package/dist/components/maintain-events/MaintainLivePanel.js +49 -0
  8. package/dist/components/maintain-events/MaintainLivePanel.js.map +1 -0
  9. package/dist/components/maintain-events/index.d.ts +8 -0
  10. package/dist/components/maintain-events/index.d.ts.map +1 -0
  11. package/dist/components/maintain-events/index.js +6 -0
  12. package/dist/components/maintain-events/index.js.map +1 -0
  13. package/dist/index.d.ts +4 -0
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js +4 -0
  16. package/dist/index.js.map +1 -1
  17. package/dist/subsystem/AgentsPanel.d.ts +27 -0
  18. package/dist/subsystem/AgentsPanel.d.ts.map +1 -0
  19. package/dist/subsystem/AgentsPanel.js +66 -0
  20. package/dist/subsystem/AgentsPanel.js.map +1 -0
  21. package/dist/subsystem/SubsystemComponentGraph.d.ts +13 -0
  22. package/dist/subsystem/SubsystemComponentGraph.d.ts.map +1 -1
  23. package/dist/subsystem/SubsystemComponentGraph.js +25 -3
  24. package/dist/subsystem/SubsystemComponentGraph.js.map +1 -1
  25. package/package.json +1 -1
  26. package/src/components/maintain-events/MaintainEventLog.tsx +152 -0
  27. package/src/components/maintain-events/MaintainLivePanel.tsx +99 -0
  28. package/src/components/maintain-events/index.ts +10 -0
  29. package/src/index.ts +15 -0
  30. package/src/stories/MaintainEvents/MaintainEventLog.stories.tsx +66 -0
  31. package/src/stories/MaintainEvents/MaintainLivePanel.stories.tsx +77 -0
  32. package/src/stories/Subsystem/AgentsPanel.stories.tsx +61 -0
  33. package/src/stories/data/maintain-live-events.json +554 -0
  34. package/src/subsystem/AgentsPanel.tsx +140 -0
  35. package/src/subsystem/SubsystemComponentGraph.tsx +87 -10
@@ -57,6 +57,14 @@ import {
57
57
  } from './model';
58
58
  import { ConstructsCatalog } from './ConstructsCatalog';
59
59
  import type { SubsystemOpenFileOptions } from './declarationRef';
60
+ import {
61
+ SubsystemAgentsPanel,
62
+ type SubsystemAgentsPanelProps,
63
+ } from './AgentsPanel';
64
+ import {
65
+ MaintainLivePanel,
66
+ type MaintainLivePanelProps,
67
+ } from '../components/maintain-events/MaintainLivePanel';
60
68
  import type { WalkthroughSymbolQuery } from '../pierre/PierreWalkthroughCodeView';
61
69
  import { SubsystemComponentNode, SubsystemGroupNode, SubsystemEdge, SUBSYSTEM_CALLBACKS, hexWithAlpha, EDGE_DIM_ALPHA, fileMatchForNode, flowElementVisibility } from './nodes';
62
70
  import { SubsystemDiagnosticToggle, type SubsystemDiagnostic } from './DiagnosticToggle';
@@ -295,6 +303,17 @@ export interface SubsystemComponentGraphProps {
295
303
  onDescriptionOpenChange?: (open: boolean) => void;
296
304
  /** Rendered over the graph canvas only (not the title/legend sidebar). */
297
305
  canvasOverlay?: ReactNode;
306
+ /**
307
+ * Live agent-run events to show in a collapsible half-height panel over the
308
+ * graph canvas. Omit (or pass null) to hide it.
309
+ */
310
+ liveEvents?: MaintainLivePanelProps | null;
311
+ /**
312
+ * Maintain agent pipeline for the sidebar's diagnostics area. When set, the
313
+ * issues view grows an Issues / Agents tab bar; the Agents tab lists the
314
+ * agents with the router's next stage runnable.
315
+ */
316
+ agentsPanel?: SubsystemAgentsPanelProps | null;
298
317
  /** Extra controls at the top of the title/legend sidebar. */
299
318
  sidebarExtra?: ReactNode;
300
319
  /** Rendered in the sidebar under the description (e.g. selection inspector). */
@@ -500,7 +519,7 @@ interface InnerProps extends SubsystemComponentGraphProps {
500
519
  measured: { w: number; h: number } | null;
501
520
  }
502
521
 
503
- function Inner({ components, relations, walkthroughs, graphifyRelations, orderByLine, initialWalkthroughId, onReorderWalkthroughs, onSelect, onEdgeSelect, measured: _measured, maxNodeWidth, showEdgeLabels, showSingletonFrames = true, edgeView, title, hideSidebar, walkthroughStepMode = 'focus', autoPlayWalkthroughs = false, walkthroughAutoPlayIntervalMs = WALKTHROUGH_PLAY_PAUSE_MS, zoomOnWalkthroughFocus = true, walkthroughFocusDurationMs = 300, graphTitle, showWalkthroughTitle = false, description, canvasOverlay, sidebarExtra, sidebarAfterDescription, diagnostic, issues, showIssues, focusIssueCategory, onSelectIssue, onApplyIssueFix, onHoverIssue, renderFileView, renderFileViewer, renderWalkthroughViewer, onFileSelect, componentVerification, onInspectSymbol, boundaryColors, hideDrawer = false, persistKey }: InnerProps) {
522
+ function Inner({ components, relations, walkthroughs, graphifyRelations, orderByLine, initialWalkthroughId, onReorderWalkthroughs, onSelect, onEdgeSelect, measured: _measured, maxNodeWidth, showEdgeLabels, showSingletonFrames = true, edgeView, title, hideSidebar, walkthroughStepMode = 'focus', autoPlayWalkthroughs = false, walkthroughAutoPlayIntervalMs = WALKTHROUGH_PLAY_PAUSE_MS, zoomOnWalkthroughFocus = true, walkthroughFocusDurationMs = 300, graphTitle, showWalkthroughTitle = false, description, canvasOverlay, sidebarExtra, sidebarAfterDescription, diagnostic, issues, showIssues, focusIssueCategory, onSelectIssue, onApplyIssueFix, onHoverIssue, renderFileView, renderFileViewer, renderWalkthroughViewer, onFileSelect, componentVerification, onInspectSymbol, boundaryColors, hideDrawer = false, persistKey, liveEvents, agentsPanel }: InnerProps) {
504
523
  const { theme } = useTheme();
505
524
  const { fitView, fitBounds } = useReactFlow();
506
525
  const viewport = useViewport();
@@ -560,6 +579,8 @@ function Inner({ components, relations, walkthroughs, graphifyRelations, orderBy
560
579
  const [sidebarView, setSidebarView] = useState<'files' | 'walkthroughs'>(() =>
561
580
  walkthroughs?.length ? 'walkthroughs' : 'files',
562
581
  );
582
+ // Diagnostics area tab: issues list vs the Maintain agent pipeline.
583
+ const [diagnosticsTab, setDiagnosticsTab] = useState<'issues' | 'agents'>('issues');
563
584
  // Temporary edge-vocabulary override. Focusing a relation finding whose edge
564
585
  // belongs to the *other* vocabulary flips the canvas so the edge is actually
565
586
  // visible; it reverts when the focus is undone (see `unfocusIssueTarget`) or
@@ -2609,15 +2630,70 @@ function Inner({ components, relations, walkthroughs, graphifyRelations, orderBy
2609
2630
  }}
2610
2631
  >
2611
2632
  {issuesActive ? (
2612
- <SubsystemIssueList
2613
- issues={issues ?? []}
2614
- focusCategory={focusIssueCategory}
2615
- onSelectIssue={focusIssueTarget}
2616
- onDeselectIssue={unfocusIssueTarget}
2617
- onApplyFix={onApplyIssueFix}
2618
- onHoverIssue={onHoverIssue}
2619
- onExpandedCategoriesChange={handleExpandedCategoriesChange}
2620
- />
2633
+ agentsPanel ? (
2634
+ <div style={{ flex: 1, minHeight: 0, display: 'flex', flexDirection: 'column' }}>
2635
+ <div
2636
+ role="tablist"
2637
+ aria-label="Diagnostics view"
2638
+ style={{
2639
+ display: 'flex',
2640
+ width: '100%',
2641
+ flexShrink: 0,
2642
+ borderBottom: `1px solid ${theme.colors.border}`,
2643
+ background: theme.colors.backgroundSecondary ?? theme.colors.background,
2644
+ }}
2645
+ >
2646
+ {(['issues', 'agents'] as const).map((tab) => (
2647
+ <button
2648
+ key={tab}
2649
+ type="button"
2650
+ role="tab"
2651
+ aria-selected={diagnosticsTab === tab}
2652
+ onClick={() => setDiagnosticsTab(tab)}
2653
+ style={{
2654
+ flex: 1,
2655
+ minWidth: 0,
2656
+ padding: '8px 8px',
2657
+ border: 'none',
2658
+ borderRadius: 0,
2659
+ background: diagnosticsTab === tab ? theme.colors.background : 'transparent',
2660
+ color:
2661
+ diagnosticsTab === tab ? theme.colors.text : theme.colors.textSecondary,
2662
+ fontSize: theme.fontSizes[1],
2663
+ fontFamily: theme.fonts.monospace,
2664
+ textTransform: 'capitalize',
2665
+ cursor: 'pointer',
2666
+ }}
2667
+ >
2668
+ {tab === 'issues' ? 'Issues' : 'Agents'}
2669
+ </button>
2670
+ ))}
2671
+ </div>
2672
+ {diagnosticsTab === 'agents' ? (
2673
+ <SubsystemAgentsPanel {...agentsPanel} />
2674
+ ) : (
2675
+ <SubsystemIssueList
2676
+ issues={issues ?? []}
2677
+ focusCategory={focusIssueCategory}
2678
+ onSelectIssue={focusIssueTarget}
2679
+ onDeselectIssue={unfocusIssueTarget}
2680
+ onApplyFix={onApplyIssueFix}
2681
+ onHoverIssue={onHoverIssue}
2682
+ onExpandedCategoriesChange={handleExpandedCategoriesChange}
2683
+ />
2684
+ )}
2685
+ </div>
2686
+ ) : (
2687
+ <SubsystemIssueList
2688
+ issues={issues ?? []}
2689
+ focusCategory={focusIssueCategory}
2690
+ onSelectIssue={focusIssueTarget}
2691
+ onDeselectIssue={unfocusIssueTarget}
2692
+ onApplyFix={onApplyIssueFix}
2693
+ onHoverIssue={onHoverIssue}
2694
+ onExpandedCategoriesChange={handleExpandedCategoriesChange}
2695
+ />
2696
+ )
2621
2697
  ) : (
2622
2698
  <>
2623
2699
  {hasWalkthroughs && (
@@ -3167,6 +3243,7 @@ function Inner({ components, relations, walkthroughs, graphifyRelations, orderBy
3167
3243
  {/* Startup cover — hides measurement, layout swap, and camera settle. */}
3168
3244
  <GraphLayoutCover revealed={layoutReady} />
3169
3245
  {canvasOverlay}
3246
+ {liveEvents ? <MaintainLivePanel {...liveEvents} /> : null}
3170
3247
  </div>
3171
3248
  </div>
3172
3249
  );