@stephen-netu/design-system 0.1.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/README.md +66 -0
- package/package.json +130 -0
- package/src/b0-app-shell/clarification-overlay/ClarificationOverlay.svelte +221 -0
- package/src/b0-app-shell/clarification-overlay/index.ts +1 -0
- package/src/b0-app-shell/command-bar/CommandBar.svelte +565 -0
- package/src/b0-app-shell/index.ts +14 -0
- package/src/base.css +152 -0
- package/src/d0-data-viz/BarChart.svelte +236 -0
- package/src/d0-data-viz/CheckpointBar.svelte +574 -0
- package/src/d0-data-viz/CheckpointPill.svelte +297 -0
- package/src/d0-data-viz/MetricCard.svelte +159 -0
- package/src/d0-data-viz/SparkLine.svelte +66 -0
- package/src/d0-data-viz/StorageMap.svelte +182 -0
- package/src/d0-data-viz/Timeline.svelte +188 -0
- package/src/d0-data-viz/checkpoint-types.ts +162 -0
- package/src/d0-data-viz/d0-tokens.css +32 -0
- package/src/d0-data-viz/index.ts +58 -0
- package/src/d0-data-viz/storage-map-types.ts +142 -0
- package/src/d0-data-viz/theme-integration.ts +134 -0
- package/src/d0-data-viz/types.ts +53 -0
- package/src/demos/BspSizingInfographic.svelte +386 -0
- package/src/demos/BspZoneDemo.svelte +255 -0
- package/src/demos/ControlRoomDemo.svelte +570 -0
- package/src/demos/NodepadBlocksShowcase.svelte +189 -0
- package/src/demos/index.ts +7 -0
- package/src/editor/CodeEditor.svelte +188 -0
- package/src/editor/FindReplaceDialog.svelte +516 -0
- package/src/editor/MarkdownEditor.svelte +660 -0
- package/src/editor/index.ts +2 -0
- package/src/entity-graph-view/WorldView.svelte +171 -0
- package/src/entity-graph-view/index.ts +6 -0
- package/src/entity-graph-view/types.ts +364 -0
- package/src/epistemic/index.ts +2 -0
- package/src/epistemic/types.ts +134 -0
- package/src/epistemic/utils.ts +32 -0
- package/src/f0-forms/checkbox/Checkbox.svelte +158 -0
- package/src/f0-forms/field/FormField.svelte +91 -0
- package/src/f0-forms/index.ts +11 -0
- package/src/f0-forms/radio/RadioGroup.svelte +192 -0
- package/src/f0-forms/search/SearchBar.svelte +99 -0
- package/src/f0-forms/select/Select.svelte +198 -0
- package/src/f0-forms/textarea/TextArea.svelte +170 -0
- package/src/f0-forms/toggle/FormToggle.svelte +147 -0
- package/src/f0-forms/validation/validate.ts +47 -0
- package/src/fabric/ai/ChatPanel.svelte +648 -0
- package/src/fabric/ai/index.ts +11 -0
- package/src/fabric/data/index.ts +21 -0
- package/src/fabric/feedback/StatusBar.svelte +274 -0
- package/src/fabric/feedback/ToastContainer.svelte +122 -0
- package/src/fabric/feedback/index.ts +14 -0
- package/src/fabric/index.ts +37 -0
- package/src/fabric/input/CommandBar.svelte +79 -0
- package/src/fabric/input/KeyboardShortcuts.svelte +388 -0
- package/src/fabric/input/index.ts +12 -0
- package/src/fabric/layout/GlassBox.svelte +193 -0
- package/src/fabric/layout/KanbanBoard.svelte +158 -0
- package/src/fabric/layout/KanbanCard.svelte +226 -0
- package/src/fabric/layout/KanbanColumn.svelte +278 -0
- package/src/fabric/layout/index.ts +17 -0
- package/src/fabric/navigation/ActivityRail.svelte +271 -0
- package/src/fabric/navigation/index.ts +11 -0
- package/src/g0-geo/SovereignMap.svelte +149 -0
- package/src/g0-geo/index.ts +2 -0
- package/src/index.ts +68 -0
- package/src/l0-layout/block-writer/BlockConnectionLines.svelte +98 -0
- package/src/l0-layout/block-writer/BlockContent.svelte +213 -0
- package/src/l0-layout/block-writer/BlockHeader.svelte +230 -0
- package/src/l0-layout/block-writer/BlockItem.svelte +177 -0
- package/src/l0-layout/block-writer/BlockWriter.svelte +219 -0
- package/src/l0-layout/block-writer/block-writer-types.ts +63 -0
- package/src/l0-layout/block-writer/index.ts +24 -0
- package/src/l0-layout/block-writer/markdown.ts +110 -0
- package/src/l0-layout/chat-view/ChatViewLayout.svelte +61 -0
- package/src/l0-layout/epistemic/AllayDetailPanel.svelte +113 -0
- package/src/l0-layout/epistemic/AssayDetailPanel.svelte +164 -0
- package/src/l0-layout/epistemic/AvenueTrace.svelte +253 -0
- package/src/l0-layout/epistemic/KnowledgeDetailPanel.svelte +204 -0
- package/src/l0-layout/epistemic/ParadigmLens.svelte +170 -0
- package/src/l0-layout/epistemic/ProvenanceChain.svelte +164 -0
- package/src/l0-layout/epistemic/TrustView.svelte +195 -0
- package/src/l0-layout/epistemic/index.ts +7 -0
- package/src/l0-layout/grove/AccordCard.svelte +156 -0
- package/src/l0-layout/grove/GroveCard.svelte +197 -0
- package/src/l0-layout/grove/MemberBadge.svelte +96 -0
- package/src/l0-layout/grove/MemberList.svelte +59 -0
- package/src/l0-layout/grove/grove-types.ts +29 -0
- package/src/l0-layout/grove/index.ts +14 -0
- package/src/l0-layout/index.ts +45 -0
- package/src/l0-layout/kanban/KanbanBoard.svelte +71 -0
- package/src/l0-layout/kanban/KanbanCard.svelte +276 -0
- package/src/l0-layout/kanban/KanbanColumn.svelte +198 -0
- package/src/l0-layout/kanban/KanbanViewLayout.svelte +61 -0
- package/src/l0-layout/workspace/WorkspaceLayout.svelte +93 -0
- package/src/n0-node-graph/GraphEditor.svelte +342 -0
- package/src/n0-node-graph/GraphHistory.svelte +122 -0
- package/src/n0-node-graph/Node.svelte +269 -0
- package/src/n0-node-graph/NodeCanvas.svelte +187 -0
- package/src/n0-node-graph/NodeEdge.svelte +152 -0
- package/src/n0-node-graph/NodePalette.svelte +318 -0
- package/src/n0-node-graph/NodePort.svelte +128 -0
- package/src/n0-node-graph/index.ts +33 -0
- package/src/n0-node-graph/n0-tokens.css +29 -0
- package/src/n0-node-graph/node-port-types.ts +19 -0
- package/src/n0-node-graph/types.ts +96 -0
- package/src/n0-node-graph/validate.test.ts +722 -0
- package/src/n0-node-graph/validate.ts +371 -0
- package/src/n1-flow-canvas/FlowCanvas.svelte +202 -0
- package/src/n1-flow-canvas/graph-state.svelte.ts +95 -0
- package/src/n1-flow-canvas/index.ts +21 -0
- package/src/n1-flow-canvas/layout.ts +118 -0
- package/src/n1-flow-canvas/layout.worker.ts +128 -0
- package/src/n1-flow-canvas/types.ts +102 -0
- package/src/n1-flow-canvas/utils.ts +146 -0
- package/src/n2-manifold-disk/ManifoldDisk.svelte +314 -0
- package/src/n2-manifold-disk/index.ts +6 -0
- package/src/n2-manifold-disk/poincare.ts +184 -0
- package/src/n3-force-graph/ForceGraph.svelte +180 -0
- package/src/n3-force-graph/GraphTooltip.svelte +99 -0
- package/src/n3-force-graph/animated-edge.ts +107 -0
- package/src/n3-force-graph/health-node.ts +128 -0
- package/src/n3-force-graph/index.ts +31 -0
- package/src/n3-force-graph/types.ts +94 -0
- package/src/n4-adaptive-manifold/AdaptiveManifold.svelte +1165 -0
- package/src/n4-adaptive-manifold/DetailCard.svelte +212 -0
- package/src/n4-adaptive-manifold/SuggestionIndicator.svelte +91 -0
- package/src/n4-adaptive-manifold/classifier.ts +139 -0
- package/src/n4-adaptive-manifold/index.ts +45 -0
- package/src/n4-adaptive-manifold/n4-tokens.css +155 -0
- package/src/n4-adaptive-manifold/orchestrator.ts +301 -0
- package/src/n4-adaptive-manifold/phase-theme.ts +92 -0
- package/src/n4-adaptive-manifold/pinnacle-events.ts +135 -0
- package/src/n4-adaptive-manifold/providers/gravitational-provider.ts +191 -0
- package/src/n4-adaptive-manifold/providers/manifold-provider.ts +276 -0
- package/src/n4-adaptive-manifold/transition.ts +90 -0
- package/src/n4-adaptive-manifold/types.ts +313 -0
- package/src/p0-primitives/index.ts +6 -0
- package/src/p0-primitives/tokens/control-room.css +309 -0
- package/src/p0-primitives/tokens/index.ts +6 -0
- package/src/p0-primitives/tokens/tokens.css +140 -0
- package/src/p0-primitives/tokens/tokens.json +132 -0
- package/src/p0-primitives/types/index.ts +123 -0
- package/src/p0-primitives/types/plugin-types.ts +74 -0
- package/src/p0-primitives/utils/index.ts +39 -0
- package/src/platform/hud-protocol.ts +20 -0
- package/src/platform/index.ts +3 -0
- package/src/s0-state/create-store.ts +84 -0
- package/src/s0-state/derived.ts +41 -0
- package/src/s0-state/index.ts +6 -0
- package/src/showcase/Showcase.svelte +401 -0
- package/src/spatial/BspTilingCanvas.svelte +232 -0
- package/src/spatial/ForceCanvas.svelte +289 -0
- package/src/spatial/LodRenderer.svelte +334 -0
- package/src/spatial/SnapZoomCamera.svelte +185 -0
- package/src/spatial/ZoneTiler.svelte +311 -0
- package/src/spatial/camera-types.ts +45 -0
- package/src/spatial/content-proportional-bsp.ts +253 -0
- package/src/spatial/force-canvas-types.ts +102 -0
- package/src/spatial/index.ts +15 -0
- package/src/spatial/lod-types.ts +70 -0
- package/src/spatial/zone-tiler-types.ts +177 -0
- package/src/stores/vaultStore.svelte +14 -0
- package/src/t0-transport/connection.ts +34 -0
- package/src/t0-transport/error.ts +37 -0
- package/src/t0-transport/events.ts +50 -0
- package/src/t0-transport/index.ts +6 -0
- package/src/t0-transport/invoke.ts +30 -0
- package/src/tauri/index.ts +13 -0
- package/src/u0-primitives/allay-gauge/AllayGauge.svelte +90 -0
- package/src/u0-primitives/allay-gauge/index.ts +1 -0
- package/src/u0-primitives/animated-icon/AnimatedIcon.svelte +273 -0
- package/src/u0-primitives/animated-icon/README.md +53 -0
- package/src/u0-primitives/animated-icon/index.ts +31 -0
- package/src/u0-primitives/assay-badge/AssayBadge.svelte +121 -0
- package/src/u0-primitives/assay-badge/AssaySignalBar.svelte +83 -0
- package/src/u0-primitives/assay-badge/index.ts +2 -0
- package/src/u0-primitives/avatar/Avatar.svelte +177 -0
- package/src/u0-primitives/badge/Badge.svelte +149 -0
- package/src/u0-primitives/button/Button.svelte +304 -0
- package/src/u0-primitives/card/Card.svelte +182 -0
- package/src/u0-primitives/dropdown/Dropdown.svelte +305 -0
- package/src/u0-primitives/expert-badge/ExpertBadge.svelte +89 -0
- package/src/u0-primitives/expert-badge/index.ts +1 -0
- package/src/u0-primitives/index.ts +35 -0
- package/src/u0-primitives/input/Input.svelte +237 -0
- package/src/u0-primitives/modal/Modal.svelte +331 -0
- package/src/u0-primitives/modal/index.ts +1 -0
- package/src/u0-primitives/spinner/Spinner.svelte +129 -0
- package/src/u0-primitives/tabs/Tabs.svelte +225 -0
- package/src/u0-primitives/tabs/tabs-types.ts +11 -0
- package/src/u0-primitives/toggle/Toggle.svelte +161 -0
- package/src/u0-primitives/tooltip/Tooltip.svelte +234 -0
- package/src/v0-diagrams/DiagramPanel.svelte +68 -0
- package/src/v0-diagrams/MarkmapDiagram.svelte +56 -0
- package/src/v0-diagrams/MermaidDiagram.svelte +53 -0
- package/src/v0-diagrams/index.ts +4 -0
- package/src/v0-diagrams/types.ts +28 -0
- package/src/v0-diagrams/v0-tokens.css +6 -0
- package/src/vite-env.d.ts +7 -0
- package/src/x0-enchanted-blocks/ENCHANTED_BLOCKS_SPEC.md +457 -0
- package/src/x0-enchanted-blocks/components/EnchantedBlock.svelte +485 -0
- package/src/x0-enchanted-blocks/components/NodepadBlock.svelte +262 -0
- package/src/x0-enchanted-blocks/core/block-layout.ts +211 -0
- package/src/x0-enchanted-blocks/core/block-types.ts +227 -0
- package/src/x0-enchanted-blocks/index.ts +46 -0
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { WorldSnapshot, EntityFilter } from './types';
|
|
3
|
+
import { snapshotToGraphSchema, snapshotToMetrics, snapshotToTimeline, entityStateStr, filterEntities } from './types';
|
|
4
|
+
import type { GraphSchema } from '../n0-node-graph/types';
|
|
5
|
+
import type { Tab } from '../u0-primitives/tabs/tabs-types';
|
|
6
|
+
import type { MetricCardProps, TimelineEntry } from '../d0-data-viz/types';
|
|
7
|
+
import GraphEditor from '../n0-node-graph/GraphEditor.svelte';
|
|
8
|
+
import MetricCard from '../d0-data-viz/MetricCard.svelte';
|
|
9
|
+
import Timeline from '../d0-data-viz/Timeline.svelte';
|
|
10
|
+
import Tabs from '../u0-primitives/tabs/Tabs.svelte';
|
|
11
|
+
|
|
12
|
+
interface WorldViewProps {
|
|
13
|
+
snapshot: WorldSnapshot;
|
|
14
|
+
filter?: EntityFilter;
|
|
15
|
+
readonly?: boolean;
|
|
16
|
+
'aria-label'?: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
let {
|
|
20
|
+
snapshot,
|
|
21
|
+
filter,
|
|
22
|
+
readonly = false,
|
|
23
|
+
'aria-label': ariaLabel = 'Entity Graph View',
|
|
24
|
+
}: WorldViewProps = $props();
|
|
25
|
+
|
|
26
|
+
// Derived data for visualizations
|
|
27
|
+
let graphSchema = $derived(snapshotToGraphSchema(snapshot));
|
|
28
|
+
let metrics = $derived(snapshotToMetrics(snapshot));
|
|
29
|
+
let timelineEntries = $derived(snapshotToTimeline(snapshot));
|
|
30
|
+
|
|
31
|
+
// Filtered entity/edge counts
|
|
32
|
+
let entityCount = $derived(
|
|
33
|
+
filter
|
|
34
|
+
? filterEntities(Object.values(snapshot.entities), filter).length
|
|
35
|
+
: Object.keys(snapshot.entities).length
|
|
36
|
+
);
|
|
37
|
+
let edgeCount = $derived(Object.keys(snapshot.edges).length);
|
|
38
|
+
|
|
39
|
+
// Tab configuration — MUST be $derived so labels react to count changes
|
|
40
|
+
let tabs = $derived<Tab[]>([
|
|
41
|
+
{ id: 'graph', label: `Graph (${entityCount})` },
|
|
42
|
+
{ id: 'metrics', label: `Metrics (${metrics.length})` },
|
|
43
|
+
{ id: 'timeline', label: `Timeline (${timelineEntries.length})` },
|
|
44
|
+
]);
|
|
45
|
+
let activeTab = $state('graph');
|
|
46
|
+
</script>
|
|
47
|
+
|
|
48
|
+
<div class="entity-graph-view" role="region" aria-label={ariaLabel}>
|
|
49
|
+
<div class="entity-graph-view__header">
|
|
50
|
+
<h2 class="entity-graph-view__title">
|
|
51
|
+
Entity Graph
|
|
52
|
+
<span class="entity-graph-view__sequence">#{snapshot.sequence}</span>
|
|
53
|
+
</h2>
|
|
54
|
+
<div class="entity-graph-view__stats">
|
|
55
|
+
<span class="entity-graph-view__stat">{entityCount} entities</span>
|
|
56
|
+
<span class="entity-graph-view__stat">{edgeCount} edges</span>
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
|
|
60
|
+
<Tabs {tabs} bind:activeId={activeTab} />
|
|
61
|
+
|
|
62
|
+
<div class="entity-graph-view__content">
|
|
63
|
+
{#if activeTab === 'graph'}
|
|
64
|
+
<div class="entity-graph-view__graph">
|
|
65
|
+
<GraphEditor
|
|
66
|
+
schema={graphSchema}
|
|
67
|
+
readonly={readonly}
|
|
68
|
+
snapToGrid={false}
|
|
69
|
+
/>
|
|
70
|
+
</div>
|
|
71
|
+
{:else if activeTab === 'metrics'}
|
|
72
|
+
<div class="entity-graph-view__metrics">
|
|
73
|
+
{#if metrics.length === 0}
|
|
74
|
+
<p class="entity-graph-view__empty">No scalar metrics available</p>
|
|
75
|
+
{:else}
|
|
76
|
+
<div class="entity-graph-view__metrics-grid">
|
|
77
|
+
{#each metrics as metric (metric.label)}
|
|
78
|
+
<MetricCard {...metric} />
|
|
79
|
+
{/each}
|
|
80
|
+
</div>
|
|
81
|
+
{/if}
|
|
82
|
+
</div>
|
|
83
|
+
{:else if activeTab === 'timeline'}
|
|
84
|
+
<div class="entity-graph-view__timeline">
|
|
85
|
+
{#if timelineEntries.length === 0}
|
|
86
|
+
<p class="entity-graph-view__empty">No state transitions recorded</p>
|
|
87
|
+
{:else}
|
|
88
|
+
<Timeline entries={timelineEntries} orientation="vertical" />
|
|
89
|
+
{/if}
|
|
90
|
+
</div>
|
|
91
|
+
{/if}
|
|
92
|
+
</div>
|
|
93
|
+
</div>
|
|
94
|
+
|
|
95
|
+
<style>
|
|
96
|
+
.entity-graph-view {
|
|
97
|
+
display: flex;
|
|
98
|
+
flex-direction: column;
|
|
99
|
+
height: 100%;
|
|
100
|
+
min-height: 400px;
|
|
101
|
+
background: var(--color-surface, #1a1a1a);
|
|
102
|
+
border-radius: var(--radius-lg, 8px);
|
|
103
|
+
overflow: hidden;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.entity-graph-view__header {
|
|
107
|
+
display: flex;
|
|
108
|
+
justify-content: space-between;
|
|
109
|
+
align-items: center;
|
|
110
|
+
padding: 16px 20px;
|
|
111
|
+
border-bottom: 1px solid var(--border-default, #333);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.entity-graph-view__title {
|
|
115
|
+
font-size: 18px;
|
|
116
|
+
font-weight: 600;
|
|
117
|
+
color: var(--color-text-primary, #e5e5e5);
|
|
118
|
+
margin: 0;
|
|
119
|
+
display: flex;
|
|
120
|
+
align-items: baseline;
|
|
121
|
+
gap: 8px;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.entity-graph-view__sequence {
|
|
125
|
+
font-size: 14px;
|
|
126
|
+
font-weight: 400;
|
|
127
|
+
color: var(--color-text-secondary, #888);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.entity-graph-view__stats {
|
|
131
|
+
display: flex;
|
|
132
|
+
gap: 16px;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.entity-graph-view__stat {
|
|
136
|
+
font-size: 13px;
|
|
137
|
+
color: var(--color-text-secondary, #888);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.entity-graph-view__content {
|
|
141
|
+
flex: 1;
|
|
142
|
+
overflow: auto;
|
|
143
|
+
padding: 16px;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.entity-graph-view__graph {
|
|
147
|
+
height: 100%;
|
|
148
|
+
min-height: 300px;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.entity-graph-view__metrics {
|
|
152
|
+
padding: 8px;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.entity-graph-view__metrics-grid {
|
|
156
|
+
display: grid;
|
|
157
|
+
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
|
|
158
|
+
gap: 16px;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.entity-graph-view__timeline {
|
|
162
|
+
padding: 8px;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.entity-graph-view__empty {
|
|
166
|
+
color: var(--color-text-secondary, #888);
|
|
167
|
+
font-size: 14px;
|
|
168
|
+
text-align: center;
|
|
169
|
+
padding: 40px;
|
|
170
|
+
}
|
|
171
|
+
</style>
|
|
@@ -0,0 +1,364 @@
|
|
|
1
|
+
// Entity Graph View — SOVEREIGN Entity Graph Visualization Types
|
|
2
|
+
// Maps m0-primitives entity types to LEAP visualization components
|
|
3
|
+
//
|
|
4
|
+
// IMPORTANT: These types match the serde serialization output from Rust.
|
|
5
|
+
// Rust uses snake_case fields and externally tagged enum variants by default.
|
|
6
|
+
|
|
7
|
+
import type { GraphSchema, NodeInstance, NodeDefinition, EdgeDefinition } from '../n0-node-graph/types';
|
|
8
|
+
import type { MetricCardProps, TimelineEntry } from '../d0-data-viz/types';
|
|
9
|
+
|
|
10
|
+
// === Serde-compatible SOVEREIGN Entity Types ===
|
|
11
|
+
//
|
|
12
|
+
// Rust newtype wrappers (EntityId, EdgeId) serialize as plain strings.
|
|
13
|
+
// Rust enums serialize as externally tagged: { "Custom": "foo" }, { "Active": null }
|
|
14
|
+
// Rust BTreeMap serializes as plain JSON object, not TS Map.
|
|
15
|
+
// Rust BTreeSet serializes as JSON array.
|
|
16
|
+
// Rust u64 serializes as JSON number.
|
|
17
|
+
|
|
18
|
+
export type EntityId = string;
|
|
19
|
+
export type EdgeId = string;
|
|
20
|
+
|
|
21
|
+
// Enums — externally tagged per serde default
|
|
22
|
+
export type EntityType = { Custom: string };
|
|
23
|
+
export type RelationshipType = { Custom: string };
|
|
24
|
+
export type MetricType = { Custom: string };
|
|
25
|
+
|
|
26
|
+
export type EntityState =
|
|
27
|
+
| { Active: null }
|
|
28
|
+
| { Inactive: null }
|
|
29
|
+
| { Degraded: null }
|
|
30
|
+
| { Critical: null }
|
|
31
|
+
| { Pending: null }
|
|
32
|
+
| { Resolved: null }
|
|
33
|
+
| { Custom: string };
|
|
34
|
+
|
|
35
|
+
export type MetricValue =
|
|
36
|
+
| { Scalar: number }
|
|
37
|
+
| { Distribution: number[] }
|
|
38
|
+
| { TimeSeries: [number, number][] };
|
|
39
|
+
|
|
40
|
+
// === Core Domain Structs (snake_case matches Rust) ===
|
|
41
|
+
|
|
42
|
+
export interface WorldEntity {
|
|
43
|
+
id: EntityId;
|
|
44
|
+
entity_type: EntityType;
|
|
45
|
+
canonical_name: string;
|
|
46
|
+
display_name: string;
|
|
47
|
+
properties: Record<string, unknown>;
|
|
48
|
+
state: EntityState;
|
|
49
|
+
created_sequence: number;
|
|
50
|
+
updated_sequence: number;
|
|
51
|
+
tags: string[];
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export interface WorldEdge {
|
|
55
|
+
id: EdgeId;
|
|
56
|
+
source: EntityId;
|
|
57
|
+
target: EntityId;
|
|
58
|
+
relationship: RelationshipType;
|
|
59
|
+
properties: Record<string, unknown>;
|
|
60
|
+
weight: number;
|
|
61
|
+
created_sequence: number;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export interface WorldMetric {
|
|
65
|
+
entity_id: EntityId;
|
|
66
|
+
metric_type: MetricType;
|
|
67
|
+
value: MetricValue;
|
|
68
|
+
unit: string;
|
|
69
|
+
timestamp_sequence: number;
|
|
70
|
+
source: string;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export interface StateTransition {
|
|
74
|
+
entity_id: EntityId;
|
|
75
|
+
from_state: EntityState;
|
|
76
|
+
to_state: EntityState;
|
|
77
|
+
trigger: string;
|
|
78
|
+
sequence: number;
|
|
79
|
+
metadata: Record<string, unknown>;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export interface WorldSnapshot {
|
|
83
|
+
sequence: number;
|
|
84
|
+
// BTreeMap serializes as plain JSON object
|
|
85
|
+
entities: Record<EntityId, WorldEntity>;
|
|
86
|
+
edges: Record<EdgeId, WorldEdge>;
|
|
87
|
+
// BTreeMap<EntityId, BTreeMap<String, Vec<WorldMetric>>>
|
|
88
|
+
metrics: Record<EntityId, Record<string, WorldMetric[]>>;
|
|
89
|
+
transitions: StateTransition[];
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// === Delta / Anomaly / MetricDelta (for streaming updates) ===
|
|
93
|
+
|
|
94
|
+
/** The delta between two snapshots — used for incremental updates. */
|
|
95
|
+
export interface WorldDelta {
|
|
96
|
+
since_sequence: number;
|
|
97
|
+
until_sequence: number;
|
|
98
|
+
added_entities: EntityId[];
|
|
99
|
+
modified_entities: EntityId[];
|
|
100
|
+
removed_entities: EntityId[];
|
|
101
|
+
added_edges: EdgeId[];
|
|
102
|
+
removed_edges: EdgeId[];
|
|
103
|
+
// BTreeMap<EntityId, Vec<WorldMetric>>
|
|
104
|
+
new_metrics: Record<EntityId, WorldMetric[]>;
|
|
105
|
+
new_transitions: StateTransition[];
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/** A detected anomaly on an entity metric. */
|
|
109
|
+
export interface Anomaly {
|
|
110
|
+
entity_id: EntityId;
|
|
111
|
+
metric_type: MetricType;
|
|
112
|
+
description: string;
|
|
113
|
+
severity: number;
|
|
114
|
+
sequence: number;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/** The change in a metric over a window. */
|
|
118
|
+
export interface MetricDelta {
|
|
119
|
+
entity_id: EntityId;
|
|
120
|
+
metric_type: MetricType;
|
|
121
|
+
start_value: number;
|
|
122
|
+
end_value: number;
|
|
123
|
+
absolute_change: number;
|
|
124
|
+
percent_change: number;
|
|
125
|
+
window_start: number;
|
|
126
|
+
window_end: number;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// === Enum Extractors ===
|
|
130
|
+
|
|
131
|
+
/** Extract string value from externally-tagged EntityType */
|
|
132
|
+
export function entityTypeStr(t: EntityType): string {
|
|
133
|
+
return t.Custom;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/** Extract string value from externally-tagged RelationshipType */
|
|
137
|
+
export function relationshipTypeStr(t: RelationshipType): string {
|
|
138
|
+
return t.Custom;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/** Extract string value from externally-tagged MetricType */
|
|
142
|
+
export function metricTypeStr(t: MetricType): string {
|
|
143
|
+
return t.Custom;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/** Extract state string from externally-tagged EntityState */
|
|
147
|
+
export function entityStateStr(s: EntityState): string {
|
|
148
|
+
if ('Active' in s) return 'active';
|
|
149
|
+
if ('Inactive' in s) return 'inactive';
|
|
150
|
+
if ('Degraded' in s) return 'degraded';
|
|
151
|
+
if ('Critical' in s) return 'critical';
|
|
152
|
+
if ('Pending' in s) return 'pending';
|
|
153
|
+
if ('Resolved' in s) return 'resolved';
|
|
154
|
+
if ('Custom' in s) return s.Custom;
|
|
155
|
+
return 'unknown';
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/** Extract scalar value from MetricValue, if scalar */
|
|
159
|
+
export function metricValueScalar(v: MetricValue): number | null {
|
|
160
|
+
if ('Scalar' in v) return v.Scalar;
|
|
161
|
+
return null;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/** Extract latest value from MetricValue */
|
|
165
|
+
export function metricValueLatest(v: MetricValue): number | null {
|
|
166
|
+
if ('Scalar' in v) return v.Scalar;
|
|
167
|
+
if ('Distribution' in v) {
|
|
168
|
+
const d = v.Distribution;
|
|
169
|
+
return d.length > 0 ? d[d.length - 1] : null;
|
|
170
|
+
}
|
|
171
|
+
if ('TimeSeries' in v) {
|
|
172
|
+
const ts = v.TimeSeries;
|
|
173
|
+
return ts.length > 0 ? ts[ts.length - 1][1] : null;
|
|
174
|
+
}
|
|
175
|
+
return null;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
// === State Color Map ===
|
|
179
|
+
|
|
180
|
+
export const STATE_COLORS: Record<string, string> = {
|
|
181
|
+
active: '#22c55e',
|
|
182
|
+
inactive: '#6b7280',
|
|
183
|
+
degraded: '#f59e0b',
|
|
184
|
+
critical: '#ef4444',
|
|
185
|
+
pending: '#3b82f6',
|
|
186
|
+
resolved: '#10b981',
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
// === Adapters ===
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Convert WorldEntity to NodeInstance for n0-node-graph.
|
|
193
|
+
* EntityId is a string, so id maps directly.
|
|
194
|
+
*/
|
|
195
|
+
export function entityToNodeInstance(
|
|
196
|
+
entity: WorldEntity,
|
|
197
|
+
position: { x: number; y: number } = { x: 0, y: 0 }
|
|
198
|
+
): NodeInstance {
|
|
199
|
+
return {
|
|
200
|
+
id: entity.id,
|
|
201
|
+
kind: entityTypeStr(entity.entity_type),
|
|
202
|
+
position,
|
|
203
|
+
size: { width: 200, height: 100 },
|
|
204
|
+
data: {
|
|
205
|
+
display_name: entity.display_name,
|
|
206
|
+
canonical_name: entity.canonical_name,
|
|
207
|
+
state: entityStateStr(entity.state),
|
|
208
|
+
tags: entity.tags,
|
|
209
|
+
...entity.properties,
|
|
210
|
+
},
|
|
211
|
+
collapsed: false,
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* Convert WorldEdge to EdgeDefinition for n0-node-graph.
|
|
217
|
+
*/
|
|
218
|
+
export function edgeToEdgeDefinition(edge: WorldEdge): EdgeDefinition {
|
|
219
|
+
return {
|
|
220
|
+
id: edge.id,
|
|
221
|
+
sourceNodeId: edge.source,
|
|
222
|
+
sourcePortId: 'output',
|
|
223
|
+
targetNodeId: edge.target,
|
|
224
|
+
targetPortId: 'input',
|
|
225
|
+
metadata: {
|
|
226
|
+
relationship: relationshipTypeStr(edge.relationship),
|
|
227
|
+
weight: edge.weight,
|
|
228
|
+
...edge.properties,
|
|
229
|
+
},
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Generate NodeDefinition for an entity type.
|
|
235
|
+
* One definition per unique entity_type in the snapshot.
|
|
236
|
+
*/
|
|
237
|
+
export function entityTypeToNodeDefinition(entityType: string): NodeDefinition {
|
|
238
|
+
return {
|
|
239
|
+
kind: entityType,
|
|
240
|
+
label: entityType.charAt(0).toUpperCase() + entityType.slice(1),
|
|
241
|
+
description: `${entityType} entity`,
|
|
242
|
+
ports: [
|
|
243
|
+
{ id: 'input', label: 'In', type: 'system:edge:default', direction: 'input', required: false, maxConnections: -1 },
|
|
244
|
+
{ id: 'output', label: 'Out', type: 'system:edge:default', direction: 'output', required: false, maxConnections: -1 },
|
|
245
|
+
],
|
|
246
|
+
metadata: {},
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* Convert WorldSnapshot to GraphSchema with ELK-compatible layout hints.
|
|
252
|
+
* Positions are set to 0,0 — use elkjs for layout before rendering.
|
|
253
|
+
*/
|
|
254
|
+
export function snapshotToGraphSchema(snapshot: WorldSnapshot): GraphSchema {
|
|
255
|
+
// Collect unique entity types for node definitions
|
|
256
|
+
const typeSet = new Set<string>();
|
|
257
|
+
Object.values(snapshot.entities).forEach(e => {
|
|
258
|
+
typeSet.add(entityTypeStr(e.entity_type));
|
|
259
|
+
});
|
|
260
|
+
const nodeDefinitions: NodeDefinition[] = Array.from(typeSet).sort().map(entityTypeToNodeDefinition);
|
|
261
|
+
|
|
262
|
+
// Create nodes at origin — layout engine positions them
|
|
263
|
+
const nodes: NodeInstance[] = Object.values(snapshot.entities).map(e =>
|
|
264
|
+
entityToNodeInstance(e, { x: 0, y: 0 })
|
|
265
|
+
);
|
|
266
|
+
|
|
267
|
+
// Create edges
|
|
268
|
+
const edges: EdgeDefinition[] = Object.values(snapshot.edges).map(edgeToEdgeDefinition);
|
|
269
|
+
|
|
270
|
+
return {
|
|
271
|
+
id: `entity-graph-${snapshot.sequence}`,
|
|
272
|
+
name: `Entity Graph #${snapshot.sequence}`,
|
|
273
|
+
version: '1.0.0',
|
|
274
|
+
nodeDefinitions,
|
|
275
|
+
nodes,
|
|
276
|
+
edges,
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* Extract latest scalar metrics as MetricCardProps.
|
|
282
|
+
*/
|
|
283
|
+
export function snapshotToMetrics(snapshot: WorldSnapshot): MetricCardProps[] {
|
|
284
|
+
const cards: MetricCardProps[] = [];
|
|
285
|
+
|
|
286
|
+
for (const [_entityId, metricMap] of Object.entries(snapshot.metrics)) {
|
|
287
|
+
for (const [metricTypeKey, metrics] of Object.entries(metricMap)) {
|
|
288
|
+
if (metrics.length === 0) continue;
|
|
289
|
+
|
|
290
|
+
// Find latest by timestamp_sequence
|
|
291
|
+
const sorted = [...metrics].sort((a, b) => a.timestamp_sequence - b.timestamp_sequence);
|
|
292
|
+
const latest = sorted[sorted.length - 1];
|
|
293
|
+
const scalar = metricValueLatest(latest.value);
|
|
294
|
+
if (scalar === null) continue;
|
|
295
|
+
|
|
296
|
+
// Compute trend from last two values
|
|
297
|
+
let trend: 'up' | 'down' | 'flat' | undefined;
|
|
298
|
+
if (sorted.length >= 2) {
|
|
299
|
+
const prev = metricValueLatest(sorted[sorted.length - 2].value);
|
|
300
|
+
if (prev !== null) {
|
|
301
|
+
trend = scalar > prev ? 'up' : scalar < prev ? 'down' : 'flat';
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
cards.push({
|
|
306
|
+
label: metricTypeKey.replace(/_/g, ' ').replace(/\b\w/g, c => c.toUpperCase()),
|
|
307
|
+
value: scalar.toFixed(2),
|
|
308
|
+
unit: latest.unit,
|
|
309
|
+
trend,
|
|
310
|
+
size: 'default',
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
return cards;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
/**
|
|
319
|
+
* Convert StateTransitions to TimelineEntries.
|
|
320
|
+
*/
|
|
321
|
+
export function snapshotToTimeline(snapshot: WorldSnapshot): TimelineEntry[] {
|
|
322
|
+
return [...snapshot.transitions]
|
|
323
|
+
.sort((a, b) => a.sequence - b.sequence)
|
|
324
|
+
.map(t => ({
|
|
325
|
+
id: `transition-${t.sequence}-${t.entity_id}`,
|
|
326
|
+
timestamp: `Seq ${t.sequence}`,
|
|
327
|
+
label: `${entityStateStr(t.from_state)} → ${entityStateStr(t.to_state)}`,
|
|
328
|
+
description: `${t.entity_id}: ${t.trigger}`,
|
|
329
|
+
color: STATE_COLORS[entityStateStr(t.to_state)] ?? '#6b7280',
|
|
330
|
+
}));
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
// === Filter ===
|
|
334
|
+
|
|
335
|
+
export interface EntityFilter {
|
|
336
|
+
entity_types?: string[];
|
|
337
|
+
states?: string[];
|
|
338
|
+
tags_any?: string[];
|
|
339
|
+
tags_all?: string[];
|
|
340
|
+
name_contains?: string;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
export function filterEntities(entities: WorldEntity[], filter: EntityFilter): WorldEntity[] {
|
|
344
|
+
return entities.filter(entity => {
|
|
345
|
+
if (filter.entity_types?.length && !filter.entity_types.includes(entityTypeStr(entity.entity_type))) {
|
|
346
|
+
return false;
|
|
347
|
+
}
|
|
348
|
+
if (filter.states?.length && !filter.states.includes(entityStateStr(entity.state))) {
|
|
349
|
+
return false;
|
|
350
|
+
}
|
|
351
|
+
if (filter.tags_any?.length && !filter.tags_any.some(t => entity.tags.includes(t))) {
|
|
352
|
+
return false;
|
|
353
|
+
}
|
|
354
|
+
if (filter.tags_all?.length && !filter.tags_all.every(t => entity.tags.includes(t))) {
|
|
355
|
+
return false;
|
|
356
|
+
}
|
|
357
|
+
if (filter.name_contains &&
|
|
358
|
+
!entity.canonical_name.includes(filter.name_contains) &&
|
|
359
|
+
!entity.display_name.includes(filter.name_contains)) {
|
|
360
|
+
return false;
|
|
361
|
+
}
|
|
362
|
+
return true;
|
|
363
|
+
});
|
|
364
|
+
}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
// @kos/design-system — Epistemic transparency types
|
|
2
|
+
// Derived from LEAP-EPISTEMIC-TRANSPARENCY-SPEC.md
|
|
3
|
+
|
|
4
|
+
// --- ASSAY ---
|
|
5
|
+
export interface AssayClearanceView {
|
|
6
|
+
checkpoint: 'PreIsr' | 'PreMettle' | 'PreEffector' | 'PreKnowledge';
|
|
7
|
+
gate: 'Cleared' | 'Blocked';
|
|
8
|
+
severity: 'None' | 'Minor' | 'Medium' | 'High' | 'Critical';
|
|
9
|
+
weightedSum: number; // 0.0–1.0
|
|
10
|
+
signals: AssaySignalView[];
|
|
11
|
+
computedAt: number; // deterministic tick
|
|
12
|
+
isDegraded: boolean;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface AssaySignalView {
|
|
16
|
+
id: 'SaeClarity' | 'SchemaValid' | 'RiskTier' | 'SourceCredibility'
|
|
17
|
+
| 'SemanticCoherence' | 'CapabilityCheck' | 'FeatureCoverage' | 'NoveltyGate';
|
|
18
|
+
result: 'Pass' | 'Fail' | 'Unavailable';
|
|
19
|
+
confidence: number | null;
|
|
20
|
+
isHardGate: boolean;
|
|
21
|
+
reason?: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// --- ALLAY ---
|
|
25
|
+
export interface AllayStageView {
|
|
26
|
+
stage: 0 | 1 | 2 | 3 | 4 | 5;
|
|
27
|
+
confidence: number; // 0.0–1.0
|
|
28
|
+
stageName: 'Propose' | 'Parse' | 'Authorize' | 'Execute' | 'Trace' | 'Replicate';
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// Mapping from assay_confidence (u8, 0-255) to stage:
|
|
32
|
+
// 0-50: Stage 0 (Propose)
|
|
33
|
+
// 51-100: Stage 1 (Parse)
|
|
34
|
+
// 101-150: Stage 2 (Authorize)
|
|
35
|
+
// 151-190: Stage 3 (Execute)
|
|
36
|
+
// 191-230: Stage 4 (Trace)
|
|
37
|
+
// 231-255: Stage 5 (Replicate)
|
|
38
|
+
export function confidenceToStage(confidence: number): AllayStageView {
|
|
39
|
+
const stage: 0 | 1 | 2 | 3 | 4 | 5 =
|
|
40
|
+
confidence <= 50 ? 0 :
|
|
41
|
+
confidence <= 100 ? 1 :
|
|
42
|
+
confidence <= 150 ? 2 :
|
|
43
|
+
confidence <= 190 ? 3 :
|
|
44
|
+
confidence <= 230 ? 4 : 5;
|
|
45
|
+
const names: AllayStageView['stageName'][] = ['Propose','Parse','Authorize','Execute','Trace','Replicate'];
|
|
46
|
+
return { stage, confidence: confidence / 255, stageName: names[stage] };
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// --- EXPERT ---
|
|
50
|
+
export interface ExpertIdentity {
|
|
51
|
+
name: 'Atelier' | 'Agora' | 'Ryu' | 'SOVEREIGN' | 'Agent';
|
|
52
|
+
agentId?: string;
|
|
53
|
+
domain: string;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// --- AVENUE ---
|
|
57
|
+
// Flat step view — matches the Rust AvenueStepView struct emitted by the Tauri command.
|
|
58
|
+
// Rich per-type fields are NOT present; use step_type + summary for display.
|
|
59
|
+
export interface AvenueStepView {
|
|
60
|
+
step_type: 'query' | 'retrieve' | 'filter' | 'synthesize' | 'contradict' | 'verify' | string;
|
|
61
|
+
summary: string;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export interface AvenueTraceView {
|
|
65
|
+
steps: AvenueStepView[];
|
|
66
|
+
isPartial: boolean;
|
|
67
|
+
confidence: number;
|
|
68
|
+
session_id: string;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// --- PROVENANCE ---
|
|
72
|
+
export type ProvenanceNodeType =
|
|
73
|
+
| 'human_draft' | 'file_source' | 'web_source' | 'assay_evaluation'
|
|
74
|
+
| 'sigchain_witness' | 'agent_research' | 'accord_replication'
|
|
75
|
+
| 'access_epoch' | 'knowledge_merge' | 'supersession';
|
|
76
|
+
|
|
77
|
+
export interface ProvenanceChainNodeBase {
|
|
78
|
+
id: string;
|
|
79
|
+
timestamp: number;
|
|
80
|
+
expert: ExpertIdentity;
|
|
81
|
+
previousNodeId: string | null;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export type ProvenanceChainNode = ProvenanceChainNodeBase & (
|
|
85
|
+
| { type: 'human_draft'; detail: { contentHash: string } }
|
|
86
|
+
| { type: 'file_source'; detail: { filePath: string; contentHash: string } }
|
|
87
|
+
| { type: 'web_source'; detail: { url: string; sourceUrlHash: string; sectionId?: string } }
|
|
88
|
+
| { type: 'assay_evaluation'; detail: { checkpoint: string; gate: string; clearanceHash: string; weightedSum: number } }
|
|
89
|
+
| { type: 'sigchain_witness'; detail: { witnessRef: string; assayConfidence: number } }
|
|
90
|
+
| { type: 'agent_research'; detail: { sessionId: string; claimHash: string } }
|
|
91
|
+
| { type: 'accord_replication'; detail: { accordId: string; sourceRealmId: string } }
|
|
92
|
+
| { type: 'access_epoch'; detail: { accessCount: number; consolidatorId: string } }
|
|
93
|
+
| { type: 'knowledge_merge'; detail: { inputHashes: string[] } }
|
|
94
|
+
| { type: 'supersession'; detail: { supersededHash: string } }
|
|
95
|
+
);
|
|
96
|
+
|
|
97
|
+
// --- EPISTEMIC DETAIL ---
|
|
98
|
+
export interface KnowledgeEpistemicDetail {
|
|
99
|
+
contentHash: string;
|
|
100
|
+
title: string;
|
|
101
|
+
source: string;
|
|
102
|
+
// Phase 0: Rust returns null; will be ExpertIdentity once wt-710 is wired.
|
|
103
|
+
expert?: ExpertIdentity | null;
|
|
104
|
+
allay: AllayStageView;
|
|
105
|
+
// Phase 0: Rust returns null; will be non-null once AssayClearanceFor is wired.
|
|
106
|
+
assay?: AssayClearanceView | null;
|
|
107
|
+
// Phase 0: Rust returns null; will be ProvenanceChainNode[] once wt-710 is wired.
|
|
108
|
+
provenance: ProvenanceChainNode[] | null;
|
|
109
|
+
// Phase 0: Rust returns null; will be AvenueTraceView once wt-711 is wired.
|
|
110
|
+
avenue?: AvenueTraceView | null;
|
|
111
|
+
convergence: number;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// --- AGGREGATE STATS ---
|
|
115
|
+
export interface EpistemicStats {
|
|
116
|
+
totalKnowledge: number;
|
|
117
|
+
byStage: Record<number, number>;
|
|
118
|
+
byGate: Record<string, number>;
|
|
119
|
+
pendingReview: number;
|
|
120
|
+
averageConfidence: number;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// Rust-side alias (camelCase serde output from EpistemicStatsView).
|
|
124
|
+
// byStage / byGate are stub empty objects until wt-710 daemon aggregate is wired.
|
|
125
|
+
export type EpistemicStatsView = EpistemicStats;
|
|
126
|
+
|
|
127
|
+
// --- PARADIGM ---
|
|
128
|
+
export interface ParadigmDefinition {
|
|
129
|
+
id: 'spatial' | 'temporal' | 'hierarchical' | 'graph' | 'trust';
|
|
130
|
+
label: string;
|
|
131
|
+
description: string;
|
|
132
|
+
conceals: string;
|
|
133
|
+
icon: string;
|
|
134
|
+
}
|