@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.
- package/dist/components/maintain-events/MaintainEventLog.d.ts +35 -0
- package/dist/components/maintain-events/MaintainEventLog.d.ts.map +1 -0
- package/dist/components/maintain-events/MaintainEventLog.js +66 -0
- package/dist/components/maintain-events/MaintainEventLog.js.map +1 -0
- package/dist/components/maintain-events/MaintainLivePanel.d.ts +15 -0
- package/dist/components/maintain-events/MaintainLivePanel.d.ts.map +1 -0
- package/dist/components/maintain-events/MaintainLivePanel.js +49 -0
- package/dist/components/maintain-events/MaintainLivePanel.js.map +1 -0
- package/dist/components/maintain-events/index.d.ts +8 -0
- package/dist/components/maintain-events/index.d.ts.map +1 -0
- package/dist/components/maintain-events/index.js +6 -0
- package/dist/components/maintain-events/index.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/subsystem/AgentsPanel.d.ts +27 -0
- package/dist/subsystem/AgentsPanel.d.ts.map +1 -0
- package/dist/subsystem/AgentsPanel.js +66 -0
- package/dist/subsystem/AgentsPanel.js.map +1 -0
- package/dist/subsystem/SubsystemComponentGraph.d.ts +13 -0
- package/dist/subsystem/SubsystemComponentGraph.d.ts.map +1 -1
- package/dist/subsystem/SubsystemComponentGraph.js +25 -3
- package/dist/subsystem/SubsystemComponentGraph.js.map +1 -1
- package/package.json +1 -1
- package/src/components/maintain-events/MaintainEventLog.tsx +152 -0
- package/src/components/maintain-events/MaintainLivePanel.tsx +99 -0
- package/src/components/maintain-events/index.ts +10 -0
- package/src/index.ts +15 -0
- package/src/stories/MaintainEvents/MaintainEventLog.stories.tsx +66 -0
- package/src/stories/MaintainEvents/MaintainLivePanel.stories.tsx +77 -0
- package/src/stories/Subsystem/AgentsPanel.stories.tsx +61 -0
- package/src/stories/data/maintain-live-events.json +554 -0
- package/src/subsystem/AgentsPanel.tsx +140 -0
- 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
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
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
|
);
|