flock-core 0.5.0b71__py3-none-any.whl → 0.5.1__py3-none-any.whl
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.
Potentially problematic release.
This version of flock-core might be problematic. Click here for more details.
- flock/agent.py +39 -1
- flock/artifacts.py +17 -10
- flock/cli.py +1 -1
- flock/dashboard/__init__.py +2 -0
- flock/dashboard/collector.py +282 -6
- flock/dashboard/events.py +6 -0
- flock/dashboard/graph_builder.py +563 -0
- flock/dashboard/launcher.py +11 -6
- flock/dashboard/models/__init__.py +1 -0
- flock/dashboard/models/graph.py +156 -0
- flock/dashboard/service.py +175 -14
- flock/dashboard/static_v2/assets/index-DFRnI_mt.js +111 -0
- flock/dashboard/static_v2/assets/index-fPLNdmp1.css +1 -0
- flock/dashboard/static_v2/index.html +13 -0
- flock/dashboard/websocket.py +2 -2
- flock/engines/dspy_engine.py +294 -20
- flock/frontend/README.md +6 -6
- flock/frontend/src/App.tsx +23 -31
- flock/frontend/src/__tests__/integration/graph-snapshot.test.tsx +647 -0
- flock/frontend/src/components/details/DetailWindowContainer.tsx +13 -17
- flock/frontend/src/components/details/MessageDetailWindow.tsx +439 -0
- flock/frontend/src/components/details/MessageHistoryTab.tsx +128 -53
- flock/frontend/src/components/details/RunStatusTab.tsx +79 -38
- flock/frontend/src/components/graph/AgentNode.test.tsx +3 -1
- flock/frontend/src/components/graph/AgentNode.tsx +8 -6
- flock/frontend/src/components/graph/GraphCanvas.tsx +13 -8
- flock/frontend/src/components/graph/MessageNode.test.tsx +3 -1
- flock/frontend/src/components/graph/MessageNode.tsx +16 -3
- flock/frontend/src/components/layout/DashboardLayout.tsx +12 -9
- flock/frontend/src/components/modules/HistoricalArtifactsModule.tsx +4 -14
- flock/frontend/src/components/modules/ModuleRegistry.ts +5 -3
- flock/frontend/src/hooks/useModules.ts +12 -4
- flock/frontend/src/hooks/usePersistence.ts +5 -3
- flock/frontend/src/services/api.ts +3 -19
- flock/frontend/src/services/graphService.test.ts +330 -0
- flock/frontend/src/services/graphService.ts +75 -0
- flock/frontend/src/services/websocket.ts +104 -268
- flock/frontend/src/store/filterStore.test.ts +89 -1
- flock/frontend/src/store/filterStore.ts +38 -16
- flock/frontend/src/store/graphStore.test.ts +538 -173
- flock/frontend/src/store/graphStore.ts +374 -465
- flock/frontend/src/store/moduleStore.ts +51 -33
- flock/frontend/src/store/uiStore.ts +23 -11
- flock/frontend/src/types/graph.ts +77 -44
- flock/frontend/src/utils/mockData.ts +16 -3
- flock/frontend/vite.config.ts +2 -2
- flock/orchestrator.py +27 -7
- flock/patches/__init__.py +5 -0
- flock/patches/dspy_streaming_patch.py +82 -0
- flock/service.py +2 -2
- flock/store.py +169 -4
- flock/themes/darkmatrix.toml +2 -2
- flock/themes/deep.toml +2 -2
- flock/themes/neopolitan.toml +4 -4
- {flock_core-0.5.0b71.dist-info → flock_core-0.5.1.dist-info}/METADATA +20 -13
- {flock_core-0.5.0b71.dist-info → flock_core-0.5.1.dist-info}/RECORD +59 -53
- flock/frontend/src/__tests__/e2e/critical-scenarios.test.tsx +0 -586
- flock/frontend/src/__tests__/integration/filtering-e2e.test.tsx +0 -391
- flock/frontend/src/__tests__/integration/graph-rendering.test.tsx +0 -640
- flock/frontend/src/services/websocket.test.ts +0 -595
- flock/frontend/src/utils/transforms.test.ts +0 -860
- flock/frontend/src/utils/transforms.ts +0 -323
- {flock_core-0.5.0b71.dist-info → flock_core-0.5.1.dist-info}/WHEEL +0 -0
- {flock_core-0.5.0b71.dist-info → flock_core-0.5.1.dist-info}/entry_points.txt +0 -0
- {flock_core-0.5.0b71.dist-info → flock_core-0.5.1.dist-info}/licenses/LICENSE +0 -0
flock/frontend/src/App.tsx
CHANGED
|
@@ -5,11 +5,10 @@ import { measureRenderTime } from './utils/performance';
|
|
|
5
5
|
import { initializeWebSocket } from './services/websocket';
|
|
6
6
|
import { registerModules } from './components/modules/registerModules';
|
|
7
7
|
import { useKeyboardShortcuts } from './hooks/useKeyboardShortcuts';
|
|
8
|
-
import {
|
|
8
|
+
import { fetchArtifactSummary, fetchArtifacts } from './services/api';
|
|
9
9
|
import { useGraphStore } from './store/graphStore';
|
|
10
10
|
import { useUIStore } from './store/uiStore';
|
|
11
11
|
import { useFilterStore } from './store/filterStore';
|
|
12
|
-
import { mapArtifactToMessage } from './utils/artifacts';
|
|
13
12
|
import { indexedDBService } from './services/indexeddb';
|
|
14
13
|
|
|
15
14
|
// Register modules once at module load time
|
|
@@ -38,9 +37,10 @@ const App: React.FC = () => {
|
|
|
38
37
|
await indexedDBService.initialize();
|
|
39
38
|
|
|
40
39
|
const filterStore = useFilterStore.getState();
|
|
41
|
-
const graphStore = useGraphStore.getState();
|
|
42
|
-
const uiStore = useUIStore.getState();
|
|
43
40
|
|
|
41
|
+
// UI Optimization Migration (Phase 2/4 - Spec 002): Backend-driven architecture
|
|
42
|
+
// Fetch artifact summary to populate filter facets
|
|
43
|
+
// Note: Node positions are now loaded automatically in generateAgentViewGraph/generateBlackboardViewGraph
|
|
44
44
|
const summary = await fetchArtifactSummary();
|
|
45
45
|
filterStore.setSummary(summary);
|
|
46
46
|
filterStore.updateAvailableFacets({
|
|
@@ -50,17 +50,9 @@ const App: React.FC = () => {
|
|
|
50
50
|
visibilities: Object.keys(summary.by_visibility),
|
|
51
51
|
});
|
|
52
52
|
|
|
53
|
+
// Fetch correlation IDs for filter dropdown
|
|
53
54
|
const artifactResponse = await fetchArtifacts({ limit: 200, embedMeta: true });
|
|
54
|
-
|
|
55
|
-
if (messages.length > 0) {
|
|
56
|
-
graphStore.batchUpdate({ messages });
|
|
57
|
-
if (uiStore.mode === 'blackboard') {
|
|
58
|
-
graphStore.generateBlackboardViewGraph();
|
|
59
|
-
} else {
|
|
60
|
-
graphStore.generateAgentViewGraph();
|
|
61
|
-
}
|
|
62
|
-
graphStore.applyFilters();
|
|
63
|
-
|
|
55
|
+
if (artifactResponse.items.length > 0) {
|
|
64
56
|
const correlationMetadata = new Map<string, { correlation_id: string; first_seen: number; artifact_count: number; run_count: number }>();
|
|
65
57
|
artifactResponse.items.forEach((item) => {
|
|
66
58
|
if (!item.correlation_id) return;
|
|
@@ -82,44 +74,44 @@ const App: React.FC = () => {
|
|
|
82
74
|
filterStore.updateAvailableCorrelationIds(Array.from(correlationMetadata.values()));
|
|
83
75
|
}
|
|
84
76
|
}
|
|
77
|
+
|
|
78
|
+
// Generate initial graph view from backend snapshot
|
|
79
|
+
// (GraphCanvas useEffect will handle initial render based on mode)
|
|
80
|
+
// No need to manually trigger here - happens in GraphCanvas mount
|
|
85
81
|
} catch (error) {
|
|
86
82
|
console.error('[App] Failed to load historical artifacts:', error);
|
|
87
83
|
}
|
|
88
84
|
};
|
|
89
85
|
|
|
90
|
-
//
|
|
91
|
-
//
|
|
92
|
-
const
|
|
86
|
+
// UI Optimization Migration (Phase 2/4 - Spec 002): Simplified initial graph load
|
|
87
|
+
// Backend snapshot includes all agents + artifacts + edges in a single call
|
|
88
|
+
const loadInitialGraph = async () => {
|
|
93
89
|
try {
|
|
94
|
-
console.log('[App]
|
|
95
|
-
const agents = await fetchRegisteredAgents();
|
|
96
|
-
console.log(`[App] Loaded ${agents.length} registered agents`);
|
|
97
|
-
|
|
90
|
+
console.log('[App] Loading initial graph from backend snapshot...');
|
|
98
91
|
const graphStore = useGraphStore.getState();
|
|
99
92
|
const uiStore = useUIStore.getState();
|
|
100
93
|
|
|
101
|
-
//
|
|
102
|
-
agents.forEach(agent => graphStore.addAgent(agent));
|
|
103
|
-
|
|
104
|
-
// Generate initial graph layout based on current view mode
|
|
94
|
+
// Fetch complete graph snapshot from backend (includes agents + artifacts + edges)
|
|
105
95
|
if (uiStore.mode === 'agent') {
|
|
106
|
-
graphStore.generateAgentViewGraph();
|
|
96
|
+
await graphStore.generateAgentViewGraph();
|
|
107
97
|
} else {
|
|
108
|
-
graphStore.generateBlackboardViewGraph();
|
|
98
|
+
await graphStore.generateBlackboardViewGraph();
|
|
109
99
|
}
|
|
100
|
+
|
|
101
|
+
console.log('[App] Initial graph loaded from backend');
|
|
110
102
|
} catch (error) {
|
|
111
|
-
console.error('[App] Failed to load
|
|
112
|
-
// Graceful degradation:
|
|
103
|
+
console.error('[App] Failed to load initial graph:', error);
|
|
104
|
+
// Graceful degradation: graph will populate as WebSocket events arrive
|
|
113
105
|
}
|
|
114
106
|
};
|
|
115
107
|
|
|
116
|
-
const wsUrl = import.meta.env.VITE_WS_URL || 'ws://localhost:
|
|
108
|
+
const wsUrl = import.meta.env.VITE_WS_URL || 'ws://localhost:8344/ws';
|
|
117
109
|
const wsClient = initializeWebSocket(wsUrl);
|
|
118
110
|
let cancelled = false;
|
|
119
111
|
|
|
120
112
|
const bootstrap = async () => {
|
|
121
113
|
await loadHistoricalData();
|
|
122
|
-
await
|
|
114
|
+
await loadInitialGraph();
|
|
123
115
|
|
|
124
116
|
if (!cancelled) {
|
|
125
117
|
wsClient.connect();
|