oneie 3.6.7 → 3.6.11

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 (165) hide show
  1. package/.claude/agents/agent-backend.md +83 -0
  2. package/.claude/agents/agent-designer.md +97 -0
  3. package/.claude/agents/agent-director.md +118 -7
  4. package/.claude/agents/agent-documenter.md +93 -0
  5. package/.claude/agents/agent-frontend.md +96 -0
  6. package/.claude/agents/agent-ops.md +182 -25
  7. package/.claude/agents/agent-problem-solver.md +166 -0
  8. package/.claude/agents/agent-quality.md +127 -0
  9. package/.claude/commands/build.md +293 -0
  10. package/.claude/commands/cascade.md +231 -127
  11. package/.claude/commands/mcp-toggle.md +93 -0
  12. package/.claude/commands/one.md +198 -116
  13. package/.claude/commands/plan.md +394 -80
  14. package/.claude/commands/release.md +41 -19
  15. package/.claude/commands/server.md +2 -0
  16. package/.claude/hooks/root-cleanup.py +75 -0
  17. package/.claude/skills/INDEX.md +523 -0
  18. package/.claude/skills/REGISTRY.md +529 -0
  19. package/.claude/skills/agent-backend-create-mutation.md +319 -0
  20. package/.claude/skills/agent-designer-create-wireframe.md +341 -0
  21. package/.claude/skills/agent-frontend-create-page.md +413 -0
  22. package/.claude/skills/agents/README.md +238 -0
  23. package/dist/clone-web.js +1 -1
  24. package/dist/clone-web.js.map +1 -1
  25. package/folders.yaml +1 -1
  26. package/one/.obsidian/workspace.json +38 -38
  27. package/one/connections/api/queries-reference.md +842 -0
  28. package/one/connections/api-reference.md +1011 -0
  29. package/one/connections/integration-examples.md +875 -0
  30. package/one/connections/integration-guide.md +869 -0
  31. package/one/connections/integration-phase2.md +736 -0
  32. package/one/events/API_ROUTES_FIXES_SUMMARY.md +262 -0
  33. package/one/events/ASTRO-INTEGRATION-EXAMPLES.md +636 -0
  34. package/one/events/BEFORE_AFTER_COMPARISON.md +960 -0
  35. package/one/events/CONNECTIONS_DEMO.md +501 -0
  36. package/one/events/DELIVERABLES.md +432 -0
  37. package/one/events/DEMO-GROUPS-PAGE.md +392 -0
  38. package/one/events/DEMO-TESTING-SUMMARY.md +518 -0
  39. package/one/events/DEMO_COMPONENTS.md +487 -0
  40. package/one/events/DEMO_HOOKS_INDEX.md +334 -0
  41. package/one/events/DEMO_INFRASTRUCTURE.md +905 -0
  42. package/one/events/DEMO_INFRASTRUCTURE_SUMMARY.md +570 -0
  43. package/one/events/DEMO_INTEGRATION_CHECKLIST.md +431 -0
  44. package/one/events/DEMO_QUICK_REFERENCE.md +441 -0
  45. package/one/events/DEMO_SETUP.md +476 -0
  46. package/one/events/EFFECT_TS_API_PATTERN.md +478 -0
  47. package/one/events/GROUPS_DEMO_IMPLEMENTATION.md +414 -0
  48. package/one/events/HOOKS-DEMO.md +441 -0
  49. package/one/events/ONTOLOGY-HOOKS-README.md +700 -0
  50. package/one/events/ONTOLOGY-INTEGRATION-MANIFEST.md +365 -0
  51. package/one/events/QA-CHECKLIST.md +674 -0
  52. package/one/events/QUICK-START-ONTOLOGY.md +408 -0
  53. package/one/events/SEARCH_DEMO_CODE_REFERENCE.md +639 -0
  54. package/one/events/SEARCH_DEMO_DELIVERY.md +415 -0
  55. package/one/events/SEARCH_DEMO_SUMMARY.md +303 -0
  56. package/one/events/SEARCH_DEMO_VISUAL_GUIDE.md +381 -0
  57. package/one/events/TEST-PLAN-INDEX.md +346 -0
  58. package/one/events/TEST-PLAN.md +1417 -0
  59. package/one/events/TESTING-DELIVERY.txt +372 -0
  60. package/one/events/TRANSITIONS-QUICK-START.md +141 -0
  61. package/one/events/TYPESCRIPT_FIXES.md +152 -0
  62. package/one/events/TYPESCRIPT_FIXES_COMPLETE.txt +412 -0
  63. package/one/events/TYPESCRIPT_FIXES_INDEX.md +341 -0
  64. package/one/events/VIEW-TRANSITIONS.md +428 -0
  65. package/one/events/backend-integration-tests.md +606 -0
  66. package/one/events/backend-structure-diagram.txt +393 -0
  67. package/one/events/backend-structure-summary.txt +269 -0
  68. package/one/events/cloudflare-pages-infrastructure-setup.md +264 -0
  69. package/one/events/convex-analysis-index.md +304 -0
  70. package/one/events/convex-structure-analysis.md +700 -0
  71. package/one/events/design-spec-complete.md +208 -0
  72. package/one/events/ontology-test-examples.md +562 -0
  73. package/one/events/phase1-backend-implementation-complete.md +518 -0
  74. package/one/events/test-dashboard.md +345 -0
  75. package/one/events/test-index.md +361 -0
  76. package/one/events/test-report-ontology.md +582 -0
  77. package/one/events/testing-summary.md +344 -0
  78. package/one/groups/features.md +2878 -0
  79. package/one/groups/strategy copy.md +869 -0
  80. package/one/knowledge/backend-api-reference.md +710 -0
  81. package/one/knowledge/documentation-summary.md +285 -0
  82. package/one/knowledge/lessons-learned.md +294 -4
  83. package/one/knowledge/ontology-visual-guide.md +360 -0
  84. package/one/knowledge/ontology.md +9 -17
  85. package/one/things/demo-accessibility-animations.md +999 -0
  86. package/one/things/demo-components.md +1304 -0
  87. package/one/things/demo-design-summary.md +629 -0
  88. package/one/things/demo-design-system.md +919 -0
  89. package/one/things/demo-page-layouts.md +989 -0
  90. package/one/things/designs/accessibility-audit.md +790 -0
  91. package/one/things/designs/component-specifications.md +757 -0
  92. package/one/things/designs/design-overview.md +318 -0
  93. package/one/things/designs/design-tokens.md +414 -0
  94. package/one/things/designs/wireframes-dashboard.md +653 -0
  95. package/one/things/docs/api-requests.md +923 -0
  96. package/one/things/features/0 All Features.md +2 -0
  97. package/one/things/implementation/backend-guide.md +412 -0
  98. package/one/things/plans/2-backend-agnostic-frontend.md +11 -8
  99. package/one/things/plans/ai-elements.md +1259 -0
  100. package/one/things/plans/ai-integration.md +947 -0
  101. package/one/things/plans/ai-sdk.md +761 -0
  102. package/one/things/plans/app.md +1 -1
  103. package/one/things/plans/architecture-summary.md +283 -0
  104. package/one/things/plans/async-ai-agents.md +215 -0
  105. package/one/things/plans/backend-agnostic-frontend.md +11 -6
  106. package/one/things/plans/backend-cleanup-quickstart.md +346 -0
  107. package/one/things/plans/backend-ontology-conformance.md +416 -0
  108. package/one/things/plans/backend-status.md +541 -0
  109. package/one/things/plans/backend-structure.md +799 -0
  110. package/one/things/plans/backend-target-structure.md +438 -0
  111. package/one/things/plans/backend.md +1133 -0
  112. package/one/things/plans/better-auth-any-backend.md +11 -11
  113. package/one/things/plans/cli-updates-required.md +280 -0
  114. package/one/things/plans/complete-step-by-step.md +1302 -0
  115. package/one/things/plans/convex-agents.md +1005 -0
  116. package/one/things/plans/deployment-architecture.md +426 -0
  117. package/one/things/plans/development-plan.md +1220 -0
  118. package/one/things/plans/effect.md +808 -48
  119. package/one/things/plans/integrate-frontend-and-backend.md +579 -0
  120. package/one/things/plans/mcp-clear-context-prompt.md +60 -0
  121. package/one/things/plans/mcp-simple.md +228 -0
  122. package/one/things/plans/one.md +8 -7
  123. package/one/things/plans/ontology-6-dimensions.md +20 -14
  124. package/one/things/plans/quick-wins.md +1273 -0
  125. package/one/things/plans/readme-backend-cleanup.md +361 -0
  126. package/one/things/plans/separate-demo.md +830 -0
  127. package/one/things/plans/separate.md +3 -3
  128. package/one/things/plans/sequence.md +1897 -0
  129. package/one/things/plans/sync-checklist.md +321 -0
  130. package/one/things/plans/unified-implementation-plan.md +3 -3
  131. package/one/things/plans/update-demos.md +513 -0
  132. package/package.json +1 -1
  133. package/.claude/agents/backend-specialist.md +0 -169
  134. package/.claude/agents/designer.md +0 -216
  135. package/.claude/agents/frontend-specialist.md +0 -236
  136. package/.claude/commands/done.md +0 -35
  137. package/.claude/commands/infer.md +0 -138
  138. package/.claude/commands/next.md +0 -53
  139. package/.claude/commands/one copy.md +0 -565
  140. package/.claude/commands/one-template.md +0 -106
  141. package/.claude/commands/one-v1.md +0 -609
  142. package/.claude/hooks/__pycache__/knowledge-post.cpython-313.pyc +0 -0
  143. package/.claude/hooks/__pycache__/knowledge-pre.cpython-313.pyc +0 -0
  144. package/.claude/hooks/__pycache__/todo.cpython-313.pyc +0 -0
  145. package/one/groups/nine-padel-customers.md +0 -138
  146. package/one/groups/nine-padel-data-structure.md +0 -167
  147. package/one/groups/nine-padel-ontology-specification.md +0 -359
  148. package/one/groups/nine-padel-ontology.md +0 -143
  149. package/one/groups/nine-padel-strategy.md +0 -234
  150. package/one/groups/nine-padel.md +0 -211
  151. package/one/groups/nine-padle-contents.baked.md +0 -1252
  152. package/one/groups/nine-padle-contents.md +0 -6
  153. package/one/things/features/1-1-agent-prompts/design.md +0 -470
  154. package/one/things/features/1-1-agent-prompts/tests.md +0 -264
  155. package/one/things/features/1-2-yaml-orchestrator/design.md +0 -497
  156. package/one/things/features/1-2-yaml-orchestrator/tests.md +0 -227
  157. package/one/things/features/1-3-event-coordination/design.md +0 -544
  158. package/one/things/features/1-3-event-coordination/tests.md +0 -223
  159. package/one/things/features/1-4-knowledge-management/design.md +0 -609
  160. package/one/things/features/1-4-knowledge-management/tests.md +0 -195
  161. package/one/things/features/1-5-quality-loops/design.md +0 -797
  162. package/one/things/features/1-5-quality-loops/tests.md +0 -212
  163. package/one/things/features/1-6-numbering-structure/design.md +0 -610
  164. package/one/things/features/1-6-numbering-structure/tests.md +0 -213
  165. package/one/things/features/dataprovider-interface/1-tests.md +0 -1522
@@ -0,0 +1,501 @@
1
+ # Connections Demo - Interactive Guide
2
+
3
+ ## Overview
4
+
5
+ The Connections demo page (`/demo/connections`) provides a comprehensive, interactive exploration of the **Connections dimension** - the fourth dimension of the ONE Platform's 6-dimension ontology.
6
+
7
+ A Connection represents a **relationship between two Things (entities)**. It's the edge in your graph database, storing how entities relate to each other with optional metadata, strength indicators, and temporal validity.
8
+
9
+ ## What's Implemented
10
+
11
+ ### 1. Educational Content (Static)
12
+
13
+ The page includes extensive documentation about connections:
14
+
15
+ - **What Are Connections?** - Core concept explanation
16
+ - **Connection Structure** - TypeScript interface documentation
17
+ - **25+ Relationship Types** - Organized by category:
18
+ - Ownership (owns, created_by)
19
+ - AI Relationships (clone_of, trained_on, powers)
20
+ - Content (authored, generated_by, published_to, part_of, references)
21
+ - Community (member_of, following, moderates, participated_in)
22
+ - Business (manages, reports_to, collaborates_with)
23
+ - Tokens (holds_tokens, staked_in, earned_from)
24
+ - Products (purchased, enrolled_in, completed, teaching)
25
+ - Consolidated (transacted, notified, referred, communicated, delegated, approved, fulfilled)
26
+
27
+ - **Bidirectional Relationships** - How to query from either direction
28
+ - **Temporal Validity** - Managing relationship lifecycles with validFrom/validTo
29
+ - **REST API Examples** - List, get, create, update connections
30
+ - **Protocol-Agnostic Design** - Storing protocol identity in metadata
31
+
32
+ ### 2. Interactive React Component (ConnectionsDemo.tsx)
33
+
34
+ A fully featured interactive playground with:
35
+
36
+ #### Filtering & Search
37
+ - **Text Search**: Search connections by entity name (from or to)
38
+ - **Relationship Type Filter**: Filter by any of 31 relationship types
39
+ - **Strength Range Slider**: Filter connections by relationship strength (0-1 scale)
40
+ - **Sort Options**: Sort by created date, strength, or entity name
41
+ - **Reset Button**: Clear all filters with one click
42
+
43
+ #### Data Display
44
+ - **Responsive Table**: Shows all connections matching current filters
45
+ - **Column Headers**:
46
+ - From Entity (name + type)
47
+ - Relationship Type (color-coded badge)
48
+ - To Entity (name + type)
49
+ - Strength (visual bar + numeric value)
50
+ - Created Date
51
+ - Actions (view details, delete)
52
+
53
+ #### Interactive Features
54
+ - **Connection Details Modal**: Click eye icon to view full connection details
55
+ - From entity information
56
+ - Relationship type with strength visualization
57
+ - To entity information
58
+ - Temporal validity (validFrom/validTo)
59
+ - Metadata as formatted JSON
60
+ - Creation/update timestamps
61
+
62
+ - **Create Connection Form**: Dialog to create new connections
63
+ - Entity selection (from/to)
64
+ - Relationship type dropdown
65
+ - Strength slider (0-1)
66
+ - JSON metadata editor
67
+
68
+ - **Loading States**: Skeleton loaders while data fetches
69
+ - **Real-time Sync**: Shows "Syncing..." indicator during updates
70
+ - **Dark Mode Support**: Full dark/light theme compatibility
71
+
72
+ #### Color-Coded Relationships
73
+ Each relationship type has a unique badge color for quick visual identification:
74
+ - Blue (owns, created_by)
75
+ - Purple (AI relationships)
76
+ - Green (content relationships)
77
+ - Orange (community)
78
+ - Red (tokens/financial)
79
+ - Indigo (consolidated)
80
+
81
+ ### 3. Code Examples (React Hooks)
82
+
83
+ Four practical code examples showing real-world patterns:
84
+
85
+ 1. **List Connections from an Entity**
86
+ - Use `api.connections.listFrom` to get outgoing connections
87
+ - Filter by relationship type
88
+ - Access metadata
89
+
90
+ 2. **Filter by Relationship Type**
91
+ - Query token holders with `listTo`
92
+ - Access metadata for business logic
93
+
94
+ 3. **Create Connections with Metadata**
95
+ - Enroll students in courses
96
+ - Store progress, dates, and status in metadata
97
+ - Set strength for relationship importance
98
+
99
+ 4. **Bidirectional Queries**
100
+ - Find connections between two specific entities
101
+ - Access relationship-specific data
102
+
103
+ ### 4. Backend Integration
104
+
105
+ The page fetches real connection data from the backend:
106
+
107
+ ```typescript
108
+ // Fetch from Convex backend
109
+ const convexUrl = import.meta.env.PUBLIC_CONVEX_URL || 'https://veracious-marlin-319.convex.cloud';
110
+ const response = await fetch(`${convexUrl}/api/connections?limit=20`);
111
+ ```
112
+
113
+ In standalone mode (no backend), the page gracefully shows sample data with a helpful message.
114
+
115
+ ## File Locations
116
+
117
+ ### Component
118
+ - **File**: `/Users/toc/Server/ONE/web/src/components/demo/ConnectionsDemo.tsx`
119
+ - **Type**: React component with `'use client'` directive
120
+ - **Size**: ~450 lines
121
+ - **Features**: Filtering, search, sorting, details modal, create form
122
+
123
+ ### Page
124
+ - **File**: `/Users/toc/Server/ONE/web/src/pages/demo/connections.astro`
125
+ - **Type**: Astro SSR page
126
+ - **Fetches**: Real connection data at build time
127
+ - **Passes**: Data as props to React island
128
+
129
+ ## Architecture
130
+
131
+ ### Static-First, Hydrated Islands
132
+
133
+ 1. **Astro Page** (.astro) - Server-side only
134
+ - Fetches connection data at build time
135
+ - Renders static content (documentation, examples)
136
+ - No JavaScript overhead
137
+
138
+ 2. **React Island** (.tsx) - Hydrated on demand
139
+ - `client:load` - Loads immediately (interactive filters need immediate JS)
140
+ - Handles user interactions (filtering, searching, sorting)
141
+ - Shows/hides modals
142
+ - Renders connection table dynamically
143
+
144
+ ### Data Flow
145
+
146
+ ```
147
+ Backend (Convex)
148
+ ↓
149
+ Astro Page (fetches via ConvexHttpClient)
150
+ ↓
151
+ Passes demoConnections prop
152
+ ↓
153
+ React Component (ConnectionsDemo)
154
+ ↓
155
+ User Interactions (filters, search, modals)
156
+ ```
157
+
158
+ ## Relationship Types (31 Total)
159
+
160
+ ### By Category
161
+
162
+ **Ownership (2)**
163
+ - `owns` - A owns B
164
+ - `created_by` - A was created by B
165
+
166
+ **AI (3)**
167
+ - `clone_of` - AI clone of person
168
+ - `trained_on` - AI trained on knowledge
169
+ - `powers` - AI powers feature
170
+
171
+ **Content (5)**
172
+ - `authored` - Person authored content
173
+ - `generated_by` - Content generated by AI
174
+ - `published_to` - Content published to platform
175
+ - `part_of` - Content part of collection
176
+ - `references` - Content references other content
177
+
178
+ **Community (4)**
179
+ - `member_of` - Person member of org/community
180
+ - `following` - Person follows person
181
+ - `moderates` - Person moderates community
182
+ - `participated_in` - Person participated in conversation
183
+
184
+ **Business (3)**
185
+ - `manages` - Person manages person/team
186
+ - `reports_to` - Person reports to person
187
+ - `collaborates_with` - Person collaborates with person
188
+
189
+ **Tokens (3)**
190
+ - `holds_tokens` - Person holds tokens
191
+ - `staked_in` - Tokens staked in pool
192
+ - `earned_from` - Tokens earned from activity
193
+
194
+ **Products (4)**
195
+ - `purchased` - Person purchased product
196
+ - `enrolled_in` - Person enrolled in course
197
+ - `completed` - Person completed course
198
+ - `teaching` - AI teaching course
199
+
200
+ **Consolidated (7)** - Use metadata for variants
201
+ - `transacted` - Payment/subscription
202
+ - `notified` - Notifications
203
+ - `referred` - Referrals
204
+ - `communicated` - Agent/protocol communication
205
+ - `delegated` - Task/workflow delegation
206
+ - `approved` - Approvals
207
+ - `fulfilled` - Fulfillment
208
+
209
+ ## Metadata Structure
210
+
211
+ Connections can store relationship-specific data in metadata:
212
+
213
+ ```typescript
214
+ // Token holding
215
+ {
216
+ balance: 1000,
217
+ network: "sui",
218
+ acquiredAt: Date.now()
219
+ }
220
+
221
+ // Course enrollment
222
+ {
223
+ progress: 0.45, // 45% complete
224
+ enrolledAt: Date.now(),
225
+ lastAccessedAt: Date.now()
226
+ }
227
+
228
+ // Organization membership
229
+ {
230
+ role: "org_owner",
231
+ permissions: ["read", "write", "admin"],
232
+ joinedAt: Date.now()
233
+ }
234
+
235
+ // Payment transaction
236
+ {
237
+ transactionType: "payment",
238
+ amount: 99.00,
239
+ currency: "USD",
240
+ paymentId: "pi_123456",
241
+ status: "completed",
242
+ protocol: "stripe"
243
+ }
244
+
245
+ // Agent communication
246
+ {
247
+ protocol: "a2a",
248
+ messageType: "task_delegation",
249
+ task: "research_market_trends",
250
+ messagesExchanged: 42
251
+ }
252
+ ```
253
+
254
+ ## Strength Indicator
255
+
256
+ Connections have an optional `strength` field (0-1 scale):
257
+ - **0.0** = Weak/new relationship
258
+ - **0.5** = Moderate relationship
259
+ - **1.0** = Strong relationship
260
+
261
+ The demo visualizes strength as a progress bar:
262
+ - Green bar showing relative strength
263
+ - Numeric value (0.0-1.0)
264
+ - Used for relationship importance weighting
265
+
266
+ ## Temporal Validity
267
+
268
+ Track relationship lifecycles:
269
+
270
+ ```typescript
271
+ {
272
+ validFrom: 1704067200000, // When relationship started
273
+ validTo: 1735689600000, // When relationship ended (optional)
274
+ }
275
+ ```
276
+
277
+ **Use Cases**:
278
+ - Contract periods (employment dates)
279
+ - Subscription cancellations
280
+ - Project timeline completion
281
+ - Relationship history tracking
282
+
283
+ ## Query Examples
284
+
285
+ ### From Backend
286
+
287
+ ```typescript
288
+ // List all connections FROM a user
289
+ const connections = await convex.query(api.connections.listFrom, {
290
+ fromEntityId: userId,
291
+ relationshipType: 'owns'
292
+ });
293
+
294
+ // List all connections TO an entity
295
+ const owners = await convex.query(api.connections.listTo, {
296
+ toEntityId: contentId,
297
+ relationshipType: 'owns'
298
+ });
299
+
300
+ // Find relationship between two specific entities
301
+ const relationship = await convex.query(api.connections.listBetween, {
302
+ fromEntityId: personA,
303
+ toEntityId: personB,
304
+ relationshipType: 'collaborates_with'
305
+ });
306
+
307
+ // List by type with limit
308
+ const tokenConnections = await convex.query(
309
+ api.connections.listByType,
310
+ {
311
+ relationshipType: 'holds_tokens',
312
+ limit: 100
313
+ }
314
+ );
315
+ ```
316
+
317
+ ### In React Components
318
+
319
+ ```typescript
320
+ // Hook pattern
321
+ const connections = useQuery(api.connections.listFrom, {
322
+ fromEntityId: entityId,
323
+ relationshipType: 'enrolled_in'
324
+ });
325
+
326
+ if (connections === undefined) return <Loading />;
327
+
328
+ return connections.map(conn => (
329
+ <div key={conn._id}>
330
+ <p>{conn.relationshipType}</p>
331
+ {conn.metadata?.progress && (
332
+ <ProgressBar value={conn.metadata.progress} />
333
+ )}
334
+ </div>
335
+ ));
336
+ ```
337
+
338
+ ## Indexing Strategy
339
+
340
+ The `connections` table uses these indexes for efficient queries:
341
+
342
+ | Index | Fields | Use Case |
343
+ |-------|--------|----------|
344
+ | `from_entity` | fromEntityId | "What does X own?" |
345
+ | `to_entity` | toEntityId | "Who owns X?" |
346
+ | `from_type` | fromEntityId, relationshipType | "What courses is user enrolled in?" |
347
+ | `to_type` | toEntityId, relationshipType | "Who is enrolled in this course?" |
348
+ | `bidirectional` | fromEntityId, toEntityId, relationshipType | "Direct relationship check" |
349
+ | `group_type` | groupId, relationshipType | "All transactions in org" |
350
+ | `by_created` | createdAt | "Newest connections" |
351
+
352
+ ## Performance Considerations
353
+
354
+ - **Indexed Queries**: O(log n) for all lookups
355
+ - **Bidirectional**: Query equally fast in both directions
356
+ - **Metadata**: No performance penalty (stored with connection)
357
+ - **Strength**: Indexed filtering supported
358
+ - **Pagination**: Use limit parameter for large result sets
359
+
360
+ ## Integration with 6-Dimension Ontology
361
+
362
+ **Connections** (Dimension 4) links **Things** (Dimension 3) with typed relationships.
363
+
364
+ Complete flow:
365
+ ```
366
+ Groups (Dimension 1)
367
+ ↓ (isolation boundary)
368
+ Things (Dimension 3) ← Entities in your system
369
+ ↓ (relationships)
370
+ Connections (Dimension 4) ← How they relate
371
+ ↓ (changes)
372
+ Events (Dimension 5) ← Audit trail
373
+ ↓ (categorization)
374
+ Knowledge (Dimension 6) ← Labels & embeddings
375
+ ```
376
+
377
+ ## Troubleshooting
378
+
379
+ ### No Data Showing?
380
+
381
+ 1. **Check Backend**: Ensure Convex backend is running
382
+ 2. **Check URL**: Verify `PUBLIC_CONVEX_URL` is set correctly
383
+ 3. **Check Data**: Backend must have entities and connections created first
384
+
385
+ ### Filters Not Working?
386
+
387
+ 1. **Clear Filters**: Use "Reset Filters" button
388
+ 2. **Check Search**: Only searches entity names
389
+ 3. **Check Strength**: Range must match connection strength values
390
+
391
+ ### Modal Not Closing?
392
+
393
+ 1. **Click Outside**: Click outside the modal to close
394
+ 2. **Keyboard**: Press Escape key
395
+ 3. **Button**: Use close button in modal header (X)
396
+
397
+ ## Future Enhancements
398
+
399
+ Potential features for future iterations:
400
+
401
+ 1. **Graph Visualization**: Force-directed graph showing connection network
402
+ 2. **Batch Operations**: Create multiple connections at once
403
+ 3. **Import/Export**: CSV import/export of connections
404
+ 4. **Relationship Analytics**: Statistics on connection types and strength distribution
405
+ 5. **Connection History**: Timeline view of relationship changes
406
+ 6. **Advanced Filtering**: Filter by metadata fields
407
+ 7. **Relationship Templates**: Pre-configured metadata templates by type
408
+ 8. **Performance Metrics**: Query latency visualization
409
+ 9. **Connection Strength ML**: Auto-calculate strength based on interaction
410
+
411
+ ## Code Examples Summary
412
+
413
+ ### Pattern 1: List from Entity
414
+ ```tsx
415
+ const connections = useQuery(api.connections.listFrom, {
416
+ fromEntityId: entityId,
417
+ relationshipType: 'owns'
418
+ });
419
+ ```
420
+
421
+ ### Pattern 2: List to Entity
422
+ ```tsx
423
+ const holders = useQuery(api.connections.listTo, {
424
+ toEntityId: tokenId,
425
+ relationshipType: 'holds_tokens'
426
+ });
427
+ ```
428
+
429
+ ### Pattern 3: Create with Metadata
430
+ ```tsx
431
+ const enrollStudent = useMutation(api.connections.create);
432
+ await enrollStudent({
433
+ fromEntityId: userId,
434
+ toEntityId: courseId,
435
+ relationshipType: 'enrolled_in',
436
+ metadata: {
437
+ progress: 0,
438
+ enrolledAt: Date.now(),
439
+ status: 'active'
440
+ },
441
+ strength: 0.5
442
+ });
443
+ ```
444
+
445
+ ### Pattern 4: Bidirectional Query
446
+ ```tsx
447
+ const collaboration = useQuery(api.connections.listBetween, {
448
+ fromEntityId: personA,
449
+ toEntityId: personB,
450
+ relationshipType: 'collaborates_with'
451
+ });
452
+ ```
453
+
454
+ ## Related Pages
455
+
456
+ - **[Things Demo](/demo/things)** - Learn about entities (Dimension 3)
457
+ - **[Events Demo](/demo/events)** - Learn about actions (Dimension 5)
458
+ - **[Knowledge Demo](/demo/search)** - Learn about labels & embeddings (Dimension 6)
459
+ - **[Groups Demo](/demo/groups)** - Learn about multi-tenancy (Dimension 1)
460
+ - **[People Demo](/demo/people)** - Learn about authorization (Dimension 2)
461
+
462
+ ## File Structure
463
+
464
+ ```
465
+ /web/
466
+ ├── src/
467
+ │ ├── pages/
468
+ │ │ └── demo/
469
+ │ │ └── connections.astro ← Main page (SSR)
470
+ │ └── components/
471
+ │ └── demo/
472
+ │ └── ConnectionsDemo.tsx ← Interactive component
473
+ └── CONNECTIONS_DEMO.md ← This file
474
+ ```
475
+
476
+ ## Development Commands
477
+
478
+ ```bash
479
+ # View the demo
480
+ bun run dev
481
+ # Visit http://localhost:4321/demo/connections
482
+
483
+ # Build for production
484
+ bun run build
485
+
486
+ # Type check
487
+ bunx astro check
488
+ ```
489
+
490
+ ## Summary
491
+
492
+ The Connections demo provides a **complete learning and interactive experience** for understanding relationships in the ONE Platform:
493
+
494
+ 1. **Educational** - 10+ sections explaining connections
495
+ 2. **Interactive** - Real-time filtering, search, and sorting
496
+ 3. **Practical** - 4 code examples showing real patterns
497
+ 4. **Beautiful** - Dark mode, responsive design, intuitive UI
498
+ 5. **Connected** - Real backend data integration
499
+ 6. **Helpful** - Graceful degradation in standalone mode
500
+
501
+ Perfect for developers who want to understand how to model, query, and leverage relationships in their ONE Platform applications.