oneie 3.6.7 → 3.6.12
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/.claude/agents/agent-backend.md +83 -0
- package/.claude/agents/agent-designer.md +97 -0
- package/.claude/agents/agent-director.md +118 -7
- package/.claude/agents/agent-documenter.md +93 -0
- package/.claude/agents/agent-frontend.md +96 -0
- package/.claude/agents/agent-ops.md +264 -32
- package/.claude/agents/agent-problem-solver.md +166 -0
- package/.claude/agents/agent-quality.md +127 -0
- package/.claude/commands/build.md +293 -0
- package/.claude/commands/cascade.md +231 -127
- package/.claude/commands/deploy.md +56 -17
- package/.claude/commands/mcp-toggle.md +93 -0
- package/.claude/commands/one.md +78 -127
- package/.claude/commands/plan.md +394 -80
- package/.claude/commands/push.md +75 -14
- package/.claude/commands/release.md +89 -25
- package/.claude/commands/server.md +2 -0
- package/.claude/hooks/__pycache__/todo.cpython-313.pyc +0 -0
- package/.claude/hooks/root-cleanup.py +75 -0
- package/.claude/skills/INDEX.md +523 -0
- package/.claude/skills/REGISTRY.md +529 -0
- package/.claude/skills/agent-backend-create-mutation.md +319 -0
- package/.claude/skills/agent-designer-create-wireframe.md +341 -0
- package/.claude/skills/agent-frontend-create-page.md +413 -0
- package/.claude/skills/agents/README.md +238 -0
- package/dist/clone-web.js +1 -1
- package/dist/clone-web.js.map +1 -1
- package/folders.yaml +1 -1
- package/one/.obsidian/workspace.json +38 -38
- package/one/connections/api/queries-reference.md +842 -0
- package/one/connections/api-reference.md +1011 -0
- package/one/connections/integration-examples.md +875 -0
- package/one/connections/integration-guide.md +869 -0
- package/one/connections/integration-phase2.md +736 -0
- package/one/events/API_ROUTES_FIXES_SUMMARY.md +262 -0
- package/one/events/ASTRO-INTEGRATION-EXAMPLES.md +636 -0
- package/one/events/BEFORE_AFTER_COMPARISON.md +960 -0
- package/one/events/CONNECTIONS_DEMO.md +501 -0
- package/one/events/DELIVERABLES.md +432 -0
- package/one/events/DEMO-GROUPS-PAGE.md +392 -0
- package/one/events/DEMO-TESTING-SUMMARY.md +518 -0
- package/one/events/DEMO_COMPONENTS.md +487 -0
- package/one/events/DEMO_HOOKS_INDEX.md +334 -0
- package/one/events/DEMO_INFRASTRUCTURE.md +905 -0
- package/one/events/DEMO_INFRASTRUCTURE_SUMMARY.md +570 -0
- package/one/events/DEMO_INTEGRATION_CHECKLIST.md +431 -0
- package/one/events/DEMO_QUICK_REFERENCE.md +441 -0
- package/one/events/DEMO_SETUP.md +476 -0
- package/one/events/EFFECT_TS_API_PATTERN.md +478 -0
- package/one/events/GROUPS_DEMO_IMPLEMENTATION.md +414 -0
- package/one/events/HOOKS-DEMO.md +441 -0
- package/one/events/ONTOLOGY-HOOKS-README.md +700 -0
- package/one/events/ONTOLOGY-INTEGRATION-MANIFEST.md +365 -0
- package/one/events/QA-CHECKLIST.md +674 -0
- package/one/events/QUICK-START-ONTOLOGY.md +408 -0
- package/one/events/SEARCH_DEMO_CODE_REFERENCE.md +639 -0
- package/one/events/SEARCH_DEMO_DELIVERY.md +415 -0
- package/one/events/SEARCH_DEMO_SUMMARY.md +303 -0
- package/one/events/SEARCH_DEMO_VISUAL_GUIDE.md +381 -0
- package/one/events/TEST-PLAN-INDEX.md +346 -0
- package/one/events/TEST-PLAN.md +1417 -0
- package/one/events/TESTING-DELIVERY.txt +372 -0
- package/one/events/TRANSITIONS-QUICK-START.md +141 -0
- package/one/events/TYPESCRIPT_FIXES.md +152 -0
- package/one/events/TYPESCRIPT_FIXES_COMPLETE.txt +412 -0
- package/one/events/TYPESCRIPT_FIXES_INDEX.md +341 -0
- package/one/events/VIEW-TRANSITIONS.md +428 -0
- package/one/events/backend-integration-tests.md +606 -0
- package/one/events/backend-structure-diagram.txt +393 -0
- package/one/events/backend-structure-summary.txt +269 -0
- package/one/events/cloudflare-pages-infrastructure-setup.md +264 -0
- package/one/events/convex-analysis-index.md +304 -0
- package/one/events/convex-structure-analysis.md +700 -0
- package/one/events/design-spec-complete.md +208 -0
- package/one/events/ontology-test-examples.md +562 -0
- package/one/events/phase1-backend-implementation-complete.md +518 -0
- package/one/events/test-dashboard.md +345 -0
- package/one/events/test-index.md +361 -0
- package/one/events/test-report-ontology.md +582 -0
- package/one/events/testing-summary.md +344 -0
- package/one/groups/features.md +2878 -0
- package/one/groups/strategy copy.md +869 -0
- package/one/knowledge/backend-api-reference.md +710 -0
- package/one/knowledge/documentation-summary.md +285 -0
- package/one/knowledge/lessons-learned.md +294 -4
- package/one/knowledge/ontology-visual-guide.md +360 -0
- package/one/knowledge/ontology.md +9 -17
- package/one/things/demo-accessibility-animations.md +999 -0
- package/one/things/demo-components.md +1304 -0
- package/one/things/demo-design-summary.md +629 -0
- package/one/things/demo-design-system.md +919 -0
- package/one/things/demo-page-layouts.md +989 -0
- package/one/things/designs/accessibility-audit.md +790 -0
- package/one/things/designs/component-specifications.md +757 -0
- package/one/things/designs/design-overview.md +318 -0
- package/one/things/designs/design-tokens.md +414 -0
- package/one/things/designs/wireframes-dashboard.md +653 -0
- package/one/things/docs/api-requests.md +923 -0
- package/one/things/features/0 All Features.md +2 -0
- package/one/things/implementation/backend-guide.md +412 -0
- package/one/things/plans/2-backend-agnostic-frontend.md +11 -8
- package/one/things/plans/2-sites.md +895 -0
- package/one/things/plans/ai-elements.md +1259 -0
- package/one/things/plans/ai-integration.md +947 -0
- package/one/things/plans/ai-sdk.md +761 -0
- package/one/things/plans/app.md +1 -1
- package/one/things/plans/architecture-summary.md +283 -0
- package/one/things/plans/async-ai-agents.md +215 -0
- package/one/things/plans/backend-agnostic-frontend.md +11 -6
- package/one/things/plans/backend-cleanup-quickstart.md +346 -0
- package/one/things/plans/backend-ontology-conformance.md +416 -0
- package/one/things/plans/backend-status.md +541 -0
- package/one/things/plans/backend-structure.md +799 -0
- package/one/things/plans/backend-target-structure.md +438 -0
- package/one/things/plans/backend.md +1133 -0
- package/one/things/plans/better-auth-any-backend.md +11 -11
- package/one/things/plans/cli-updates-required.md +280 -0
- package/one/things/plans/complete-step-by-step.md +1302 -0
- package/one/things/plans/convex-agents.md +1005 -0
- package/one/things/plans/deployment-architecture.md +426 -0
- package/one/things/plans/development-plan.md +1220 -0
- package/one/things/plans/effect.md +808 -48
- package/one/things/plans/integrate-frontend-and-backend.md +579 -0
- package/one/things/plans/mcp-clear-context-prompt.md +60 -0
- package/one/things/plans/mcp-simple.md +228 -0
- package/one/things/plans/one.md +8 -7
- package/one/things/plans/ontology-6-dimensions.md +20 -14
- package/one/things/plans/quick-wins.md +1273 -0
- package/one/things/plans/readme-backend-cleanup.md +361 -0
- package/one/things/plans/separate-demo.md +830 -0
- package/one/things/plans/separate.md +3 -3
- package/one/things/plans/sequence.md +1897 -0
- package/one/things/plans/sync-checklist.md +321 -0
- package/one/things/plans/unified-implementation-plan.md +3 -3
- package/one/things/plans/update-demos.md +513 -0
- package/package.json +1 -1
- package/.claude/agents/backend-specialist.md +0 -169
- package/.claude/agents/designer.md +0 -216
- package/.claude/agents/frontend-specialist.md +0 -236
- package/.claude/commands/done.md +0 -35
- package/.claude/commands/infer.md +0 -138
- package/.claude/commands/next.md +0 -53
- package/.claude/commands/one copy.md +0 -565
- package/.claude/commands/one-template.md +0 -106
- package/.claude/commands/one-v1.md +0 -609
- package/.claude/hooks/__pycache__/knowledge-post.cpython-313.pyc +0 -0
- package/.claude/hooks/__pycache__/knowledge-pre.cpython-313.pyc +0 -0
- package/one/groups/nine-padel-customers.md +0 -138
- package/one/groups/nine-padel-data-structure.md +0 -167
- package/one/groups/nine-padel-ontology-specification.md +0 -359
- package/one/groups/nine-padel-ontology.md +0 -143
- package/one/groups/nine-padel-strategy.md +0 -234
- package/one/groups/nine-padel.md +0 -211
- package/one/groups/nine-padle-contents.baked.md +0 -1252
- package/one/groups/nine-padle-contents.md +0 -6
- package/one/things/features/1-1-agent-prompts/design.md +0 -470
- package/one/things/features/1-1-agent-prompts/tests.md +0 -264
- package/one/things/features/1-2-yaml-orchestrator/design.md +0 -497
- package/one/things/features/1-2-yaml-orchestrator/tests.md +0 -227
- package/one/things/features/1-3-event-coordination/design.md +0 -544
- package/one/things/features/1-3-event-coordination/tests.md +0 -223
- package/one/things/features/1-4-knowledge-management/design.md +0 -609
- package/one/things/features/1-4-knowledge-management/tests.md +0 -195
- package/one/things/features/1-5-quality-loops/design.md +0 -797
- package/one/things/features/1-5-quality-loops/tests.md +0 -212
- package/one/things/features/1-6-numbering-structure/design.md +0 -610
- package/one/things/features/1-6-numbering-structure/tests.md +0 -213
- package/one/things/features/dataprovider-interface/1-tests.md +0 -1522
|
@@ -0,0 +1,408 @@
|
|
|
1
|
+
# Quick Start: Ontology Hooks & Features
|
|
2
|
+
|
|
3
|
+
Get started with the 6-dimension ontology integration in 5 minutes.
|
|
4
|
+
|
|
5
|
+
## 1. Install Dependencies
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
cd web/
|
|
9
|
+
bun add effect
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## 2. Set Feature Flags
|
|
13
|
+
|
|
14
|
+
Create `.env.local` (choose based on your needs):
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
# Frontend-only (markdown blog, no backend)
|
|
18
|
+
# (no env vars needed)
|
|
19
|
+
|
|
20
|
+
# OR Static site with search
|
|
21
|
+
VITE_FEATURE_SEARCH=true
|
|
22
|
+
|
|
23
|
+
# OR SaaS app with auth
|
|
24
|
+
VITE_FEATURE_AUTH=true
|
|
25
|
+
VITE_FEATURE_GROUPS=true
|
|
26
|
+
VITE_FEATURE_PERMISSIONS=true
|
|
27
|
+
VITE_FEATURE_REALTIME=true
|
|
28
|
+
VITE_FEATURE_SEARCH=true
|
|
29
|
+
VITE_FEATURE_CONNECTIONS=true
|
|
30
|
+
VITE_FEATURE_EVENTS=true
|
|
31
|
+
|
|
32
|
+
# OR Full platform
|
|
33
|
+
VITE_FEATURES='{"auth":true,"groups":true,"permissions":true,"realtime":true,"search":true,"knowledge":true,"connections":true,"events":true,"inference":true,"payments":true,"marketplace":true,"community":true}'
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## 3. Wrap App with Provider
|
|
37
|
+
|
|
38
|
+
```tsx
|
|
39
|
+
// src/components/App.tsx
|
|
40
|
+
import { DataProviderProvider } from '@/hooks/ontology';
|
|
41
|
+
|
|
42
|
+
// TODO: Import actual provider (Convex, Notion, etc.)
|
|
43
|
+
const provider = null; // For now: frontend-only
|
|
44
|
+
|
|
45
|
+
export default function App() {
|
|
46
|
+
return (
|
|
47
|
+
<DataProviderProvider provider={provider}>
|
|
48
|
+
<YourAppContent />
|
|
49
|
+
</DataProviderProvider>
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## 4. Use Hooks in Components
|
|
55
|
+
|
|
56
|
+
```tsx
|
|
57
|
+
// src/components/CourseList.tsx
|
|
58
|
+
import { useThings, useCurrentUser, isFeatureEnabled } from '@/hooks/ontology';
|
|
59
|
+
|
|
60
|
+
export default function CourseList() {
|
|
61
|
+
// Get current user (if auth enabled)
|
|
62
|
+
const { user, isAuthenticated } = useCurrentUser();
|
|
63
|
+
|
|
64
|
+
// Get courses
|
|
65
|
+
const { things: courses, loading } = useThings({
|
|
66
|
+
type: 'course',
|
|
67
|
+
status: 'published'
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
// Check if search is available
|
|
71
|
+
const hasSearch = isFeatureEnabled('search');
|
|
72
|
+
|
|
73
|
+
if (loading) return <div>Loading...</div>;
|
|
74
|
+
|
|
75
|
+
return (
|
|
76
|
+
<div>
|
|
77
|
+
{isAuthenticated && <p>Welcome, {user.name}!</p>}
|
|
78
|
+
|
|
79
|
+
{hasSearch && <SearchBox />}
|
|
80
|
+
|
|
81
|
+
<div className="grid">
|
|
82
|
+
{courses?.map(course => (
|
|
83
|
+
<CourseCard key={course._id} course={course} />
|
|
84
|
+
))}
|
|
85
|
+
</div>
|
|
86
|
+
</div>
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## 5. Use in Astro Pages
|
|
92
|
+
|
|
93
|
+
```astro
|
|
94
|
+
---
|
|
95
|
+
// src/pages/courses/index.astro
|
|
96
|
+
import { getThings } from '@/lib/ontology/astro-helpers';
|
|
97
|
+
import CourseList from '@/components/CourseList.tsx';
|
|
98
|
+
|
|
99
|
+
// Server-side data fetching
|
|
100
|
+
const courses = await getThings({
|
|
101
|
+
type: 'course',
|
|
102
|
+
status: 'published'
|
|
103
|
+
});
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
<Layout title="Courses">
|
|
107
|
+
<h1>Popular Courses</h1>
|
|
108
|
+
<CourseList courses={courses} client:load />
|
|
109
|
+
</Layout>
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## Common Patterns
|
|
113
|
+
|
|
114
|
+
### Conditional Rendering by Feature
|
|
115
|
+
|
|
116
|
+
```tsx
|
|
117
|
+
import { isFeatureEnabled } from '@/lib/ontology/features';
|
|
118
|
+
|
|
119
|
+
export function Navigation() {
|
|
120
|
+
return (
|
|
121
|
+
<nav>
|
|
122
|
+
<a href="/">Home</a>
|
|
123
|
+
<a href="/blog">Blog</a>
|
|
124
|
+
|
|
125
|
+
{isFeatureEnabled('search') && (
|
|
126
|
+
<a href="/search">Search</a>
|
|
127
|
+
)}
|
|
128
|
+
|
|
129
|
+
{isFeatureEnabled('auth') && (
|
|
130
|
+
<a href="/account">Account</a>
|
|
131
|
+
)}
|
|
132
|
+
|
|
133
|
+
{isFeatureEnabled('groups') && (
|
|
134
|
+
<a href="/organizations">Organizations</a>
|
|
135
|
+
)}
|
|
136
|
+
</nav>
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Loading & Error States
|
|
142
|
+
|
|
143
|
+
```tsx
|
|
144
|
+
import { useThings } from '@/hooks/ontology';
|
|
145
|
+
|
|
146
|
+
export function ThingsList() {
|
|
147
|
+
const { things, loading, error } = useThings();
|
|
148
|
+
|
|
149
|
+
if (loading) return <Skeleton />;
|
|
150
|
+
if (error) return <ErrorMessage error={error} />;
|
|
151
|
+
if (!things?.length) return <EmptyState />;
|
|
152
|
+
|
|
153
|
+
return (
|
|
154
|
+
<ul>
|
|
155
|
+
{things.map(thing => (
|
|
156
|
+
<li key={thing._id}>{thing.name}</li>
|
|
157
|
+
))}
|
|
158
|
+
</ul>
|
|
159
|
+
);
|
|
160
|
+
}
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### Protected Routes
|
|
164
|
+
|
|
165
|
+
```tsx
|
|
166
|
+
import { useCurrentUser, useCanAccess } from '@/hooks/ontology';
|
|
167
|
+
import { Navigate } from 'react-router-dom';
|
|
168
|
+
|
|
169
|
+
export function AdminPanel() {
|
|
170
|
+
const { user, isAuthenticated } = useCurrentUser();
|
|
171
|
+
const canAccess = useCanAccess('org_manage');
|
|
172
|
+
|
|
173
|
+
if (!isAuthenticated) return <Navigate to="/login" />;
|
|
174
|
+
if (!canAccess) return <AccessDenied />;
|
|
175
|
+
|
|
176
|
+
return <AdminUI />;
|
|
177
|
+
}
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
### Search with Debouncing
|
|
181
|
+
|
|
182
|
+
```tsx
|
|
183
|
+
import { useSearch } from '@/hooks/ontology';
|
|
184
|
+
import { useState } from 'react';
|
|
185
|
+
|
|
186
|
+
export function SearchPage() {
|
|
187
|
+
const [query, setQuery] = useState('');
|
|
188
|
+
const { results, loading } = useSearch(query); // Built-in 300ms debounce
|
|
189
|
+
|
|
190
|
+
return (
|
|
191
|
+
<div>
|
|
192
|
+
<input
|
|
193
|
+
type="search"
|
|
194
|
+
placeholder="Search courses..."
|
|
195
|
+
value={query}
|
|
196
|
+
onChange={(e) => setQuery(e.target.value)}
|
|
197
|
+
/>
|
|
198
|
+
|
|
199
|
+
{loading && <div>Searching...</div>}
|
|
200
|
+
|
|
201
|
+
<ul>
|
|
202
|
+
{results.map(result => (
|
|
203
|
+
<li key={result._id}>{result.name}</li>
|
|
204
|
+
))}
|
|
205
|
+
</ul>
|
|
206
|
+
</div>
|
|
207
|
+
);
|
|
208
|
+
}
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
### Recording Events
|
|
212
|
+
|
|
213
|
+
```tsx
|
|
214
|
+
import { useEvent } from '@/hooks/ontology';
|
|
215
|
+
|
|
216
|
+
export function CourseEnrollButton({ courseId, userId }) {
|
|
217
|
+
const { record, loading } = useEvent();
|
|
218
|
+
|
|
219
|
+
const handleEnroll = async () => {
|
|
220
|
+
await record({
|
|
221
|
+
type: 'course_enrolled',
|
|
222
|
+
targetId: courseId,
|
|
223
|
+
actorId: userId,
|
|
224
|
+
metadata: { enrolledAt: Date.now() }
|
|
225
|
+
});
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
return (
|
|
229
|
+
<button onClick={handleEnroll} disabled={loading}>
|
|
230
|
+
{loading ? 'Enrolling...' : 'Enroll Now'}
|
|
231
|
+
</button>
|
|
232
|
+
);
|
|
233
|
+
}
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
### Creating Relationships
|
|
237
|
+
|
|
238
|
+
```tsx
|
|
239
|
+
import { useConnection } from '@/hooks/ontology';
|
|
240
|
+
|
|
241
|
+
export function FollowButton({ userId, authorId }) {
|
|
242
|
+
const { create, loading } = useConnection();
|
|
243
|
+
|
|
244
|
+
const handleFollow = async () => {
|
|
245
|
+
await create({
|
|
246
|
+
fromEntityId: userId,
|
|
247
|
+
toEntityId: authorId,
|
|
248
|
+
relationshipType: 'following'
|
|
249
|
+
});
|
|
250
|
+
};
|
|
251
|
+
|
|
252
|
+
return (
|
|
253
|
+
<button onClick={handleFollow} disabled={loading}>
|
|
254
|
+
{loading ? 'Following...' : 'Follow'}
|
|
255
|
+
</button>
|
|
256
|
+
);
|
|
257
|
+
}
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
## Feature Modes at a Glance
|
|
261
|
+
|
|
262
|
+
```
|
|
263
|
+
Frontend-Only (Blog)
|
|
264
|
+
├─ No backend required
|
|
265
|
+
├─ Use markdown for content
|
|
266
|
+
├─ Static HTML generation
|
|
267
|
+
└─ Perfect for portfolios
|
|
268
|
+
|
|
269
|
+
Static + Search
|
|
270
|
+
├─ Markdown content
|
|
271
|
+
├─ Client-side search
|
|
272
|
+
└─ Great for documentation
|
|
273
|
+
|
|
274
|
+
Authenticated
|
|
275
|
+
├─ User accounts
|
|
276
|
+
├─ Protected pages
|
|
277
|
+
├─ Personal data
|
|
278
|
+
└─ Good for SaaS
|
|
279
|
+
|
|
280
|
+
Multi-Tenant (SaaS)
|
|
281
|
+
├─ Organizations/groups
|
|
282
|
+
├─ Team collaboration
|
|
283
|
+
├─ Real-time updates
|
|
284
|
+
└─ Complete platform
|
|
285
|
+
|
|
286
|
+
Full Featured
|
|
287
|
+
├─ Everything enabled
|
|
288
|
+
├─ AI/inference
|
|
289
|
+
├─ Payments/marketplace
|
|
290
|
+
├─ Blockchain support
|
|
291
|
+
└─ Enterprise platform
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
## Hook Cheat Sheet
|
|
295
|
+
|
|
296
|
+
### Getting Data
|
|
297
|
+
|
|
298
|
+
```tsx
|
|
299
|
+
// Things (entities)
|
|
300
|
+
const { things } = useThings({ type: 'course' });
|
|
301
|
+
const { thing } = useThingDetail(id);
|
|
302
|
+
|
|
303
|
+
// People (users)
|
|
304
|
+
const { user } = useCurrentUser();
|
|
305
|
+
const { members } = useGroupMembers(groupId);
|
|
306
|
+
|
|
307
|
+
// Connections (relationships)
|
|
308
|
+
const { entities } = useFollowing(userId);
|
|
309
|
+
const { entities } = useEnrollments(courseId);
|
|
310
|
+
|
|
311
|
+
// Events (activity)
|
|
312
|
+
const { events } = useActivityFeed(20);
|
|
313
|
+
const { events } = useAuditTrail(entityId);
|
|
314
|
+
|
|
315
|
+
// Search (knowledge)
|
|
316
|
+
const { results } = useSearch('query');
|
|
317
|
+
const { labels } = useLabels('category');
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
### Creating Data
|
|
321
|
+
|
|
322
|
+
```tsx
|
|
323
|
+
// Things
|
|
324
|
+
const { create } = useThing();
|
|
325
|
+
await create({ type: 'course', name: 'React 101', properties: {} });
|
|
326
|
+
|
|
327
|
+
// Connections
|
|
328
|
+
const { create } = useConnection();
|
|
329
|
+
await create({
|
|
330
|
+
fromEntityId: userId,
|
|
331
|
+
toEntityId: courseId,
|
|
332
|
+
relationshipType: 'enrolled_in'
|
|
333
|
+
});
|
|
334
|
+
|
|
335
|
+
// Events
|
|
336
|
+
const { record } = useEvent();
|
|
337
|
+
await record({ type: 'course_completed', targetId: courseId });
|
|
338
|
+
|
|
339
|
+
// Groups
|
|
340
|
+
const { create } = useGroup();
|
|
341
|
+
await create({ name: 'Acme Corp', type: 'organization' });
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
### Checking Status
|
|
345
|
+
|
|
346
|
+
```tsx
|
|
347
|
+
import { isFeatureEnabled, getFeatureMode } from '@/lib/ontology/features';
|
|
348
|
+
|
|
349
|
+
isFeatureEnabled('auth') // ✅/❌
|
|
350
|
+
isFeatureEnabled('groups') // ✅/❌
|
|
351
|
+
isFeatureEnabled('realtime') // ✅/❌
|
|
352
|
+
|
|
353
|
+
getFeatureMode() // 'frontend-only' | 'authenticated' | 'full'
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
## File Locations
|
|
357
|
+
|
|
358
|
+
- **Hooks**: `/web/src/hooks/ontology/`
|
|
359
|
+
- **Features**: `/web/src/lib/ontology/features.ts`
|
|
360
|
+
- **Astro Helpers**: `/web/src/lib/ontology/astro-helpers.ts`
|
|
361
|
+
- **Documentation**: `/web/ONTOLOGY-HOOKS-README.md`
|
|
362
|
+
- **Examples**: `/web/ASTRO-INTEGRATION-EXAMPLES.md`
|
|
363
|
+
|
|
364
|
+
## Next Steps
|
|
365
|
+
|
|
366
|
+
1. Read [ONTOLOGY-HOOKS-README.md](/web/ONTOLOGY-HOOKS-README.md) for complete API reference
|
|
367
|
+
2. Check [ASTRO-INTEGRATION-EXAMPLES.md](/web/ASTRO-INTEGRATION-EXAMPLES.md) for advanced patterns
|
|
368
|
+
3. Review [integration-phase2-summary.md](/INTEGRATION-SUMMARY.md) for architecture overview
|
|
369
|
+
|
|
370
|
+
## Troubleshooting
|
|
371
|
+
|
|
372
|
+
### Provider Not Available
|
|
373
|
+
|
|
374
|
+
```tsx
|
|
375
|
+
const provider = useProvider();
|
|
376
|
+
if (!provider) {
|
|
377
|
+
// Fall back to content collections
|
|
378
|
+
return <MarkdownUI />;
|
|
379
|
+
}
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
### Feature Not Enabled
|
|
383
|
+
|
|
384
|
+
```tsx
|
|
385
|
+
import { assertFeatureEnabled } from '@/lib/ontology/features';
|
|
386
|
+
|
|
387
|
+
try {
|
|
388
|
+
assertFeatureEnabled('auth');
|
|
389
|
+
} catch (error) {
|
|
390
|
+
// Feature disabled - hide UI or redirect
|
|
391
|
+
}
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
### Type Errors
|
|
395
|
+
|
|
396
|
+
```tsx
|
|
397
|
+
import type { Thing, Connection, Event } from '@/hooks/ontology';
|
|
398
|
+
|
|
399
|
+
// All imports available from '@/hooks/ontology'
|
|
400
|
+
```
|
|
401
|
+
|
|
402
|
+
## Questions?
|
|
403
|
+
|
|
404
|
+
- See [ONTOLOGY-HOOKS-README.md](/web/ONTOLOGY-HOOKS-README.md) for detailed API
|
|
405
|
+
- Check [ASTRO-INTEGRATION-EXAMPLES.md](/web/ASTRO-INTEGRATION-EXAMPLES.md) for patterns
|
|
406
|
+
- Review [INTEGRATION-SUMMARY.md](/INTEGRATION-SUMMARY.md) for architecture
|
|
407
|
+
|
|
408
|
+
Happy coding!
|