oneie 2.0.9 → 2.0.10

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.
@@ -0,0 +1,599 @@
1
+ # ONE: The Platform Organization
2
+
3
+ **ONE is the platform organization owned by Anthony O'Connell.**
4
+
5
+ ---
6
+
7
+ ## Identity
8
+
9
+ - **Name:** ONE Platform
10
+ - **Slug:** `one`
11
+ - **Domain:** `one.ie`
12
+ - **Owner:** Anthony O'Connell (100%)
13
+ - **Status:** Active
14
+ - **Plan:** Enterprise (unlimited)
15
+
16
+ ---
17
+
18
+ ## The ONE Organization Entity
19
+
20
+ ```typescript
21
+ {
22
+ type: "organization",
23
+ name: "ONE Platform",
24
+ properties: {
25
+ // Identity
26
+ slug: "one",
27
+ domain: "one.ie",
28
+ logo: "https://one.ie/logo.svg",
29
+ description: "AI-powered multi-tenant platform for creators and businesses",
30
+
31
+ // Status & Plan
32
+ status: "active",
33
+ plan: "enterprise",
34
+
35
+ // Limits & Usage (unlimited for platform)
36
+ limits: {
37
+ users: 1000000, // 1M users
38
+ storage: 1000000, // 1 PB
39
+ apiCalls: -1, // Unlimited
40
+ inferences: -1, // Unlimited
41
+ },
42
+ usage: {
43
+ users: 0,
44
+ storage: 0,
45
+ apiCalls: 0,
46
+ inferences: 0,
47
+ },
48
+
49
+ // Billing (platform uses blockchain)
50
+ billing: {
51
+ cryptoEnabled: true,
52
+ treasuryAddress: {
53
+ sui: process.env.PLATFORM_TREASURY_SUI,
54
+ solana: process.env.PLATFORM_TREASURY_SOLANA,
55
+ base: process.env.PLATFORM_TREASURY_BASE,
56
+ },
57
+ // No Stripe - platform collects via smart contracts
58
+ customerId: null,
59
+ subscriptionId: null,
60
+ currentPeriodEnd: null,
61
+ },
62
+
63
+ // Settings
64
+ settings: {
65
+ allowSignups: true,
66
+ requireEmailVerification: true,
67
+ enableTwoFactor: true,
68
+ allowedDomains: ["one.ie"],
69
+
70
+ // Inference settings
71
+ inferenceEnabled: true,
72
+ inferenceModels: [
73
+ "gpt-4-turbo",
74
+ "gpt-4",
75
+ "claude-3.5-sonnet",
76
+ "claude-3-opus",
77
+ "llama-3-70b",
78
+ "mistral-large",
79
+ ],
80
+ },
81
+
82
+ // Revenue share (platform owner keeps 100%)
83
+ revenueShare: 0, // 0% revenue share - Anthony keeps all
84
+
85
+ // Platform metadata
86
+ features: [
87
+ "inference",
88
+ "ai_clones",
89
+ "content_creation",
90
+ "token_economy",
91
+ "nft_minting",
92
+ "blockchain_payments",
93
+ "revenue_sharing",
94
+ "multi_tenant",
95
+ ],
96
+
97
+ // Public info
98
+ website: "https://one.ie",
99
+ github: "https://github.com/oneplatform",
100
+ twitter: "https://twitter.com/oneplatform",
101
+ discord: "https://discord.gg/oneplatform",
102
+
103
+ createdAt: Date.now(),
104
+ trialEndsAt: null, // No trial - platform org
105
+ },
106
+ status: "active",
107
+ createdAt: Date.now(),
108
+ updatedAt: Date.now(),
109
+ }
110
+ ```
111
+
112
+ ---
113
+
114
+ ## Ownership Connections
115
+
116
+ ### Anthony Owns ONE
117
+ `anthony` → `one-org` via `owns`
118
+
119
+ ```typescript
120
+ {
121
+ fromThingId: anthonyId,
122
+ toThingId: oneOrgId,
123
+ relationshipType: "owns",
124
+ metadata: {
125
+ ownershipPercentage: 100,
126
+ since: "2024-01-01",
127
+ },
128
+ createdAt: Date.now(),
129
+ }
130
+ ```
131
+
132
+ ### Anthony is Member of ONE
133
+ `anthony` → `one-org` via `member_of`
134
+
135
+ ```typescript
136
+ {
137
+ fromThingId: anthonyId,
138
+ toThingId: oneOrgId,
139
+ relationshipType: "member_of",
140
+ metadata: {
141
+ role: "org_owner",
142
+ permissions: ["*"], // All permissions
143
+ joinedAt: Date.now(),
144
+ },
145
+ createdAt: Date.now(),
146
+ }
147
+ ```
148
+
149
+ ---
150
+
151
+ ## Platform Resources
152
+
153
+ ### ONE Owns Smart Contracts
154
+ `one-org` → `smart-contract` via `owns`
155
+
156
+ ```typescript
157
+ // Sui Inference Payment Contract
158
+ {
159
+ fromThingId: oneOrgId,
160
+ toThingId: suiInferenceContractId,
161
+ relationshipType: "owns",
162
+ metadata: {
163
+ network: "sui",
164
+ contractType: "inference_payment",
165
+ packageId: process.env.SUI_INFERENCE_PACKAGE_ID,
166
+ deployedBy: anthonyId,
167
+ },
168
+ createdAt: Date.now(),
169
+ }
170
+
171
+ // Solana Token Contract
172
+ {
173
+ fromThingId: oneOrgId,
174
+ toThingId: solanaTokenId,
175
+ relationshipType: "owns",
176
+ metadata: {
177
+ network: "solana",
178
+ contractType: "token",
179
+ mintAddress: process.env.SOLANA_TOKEN_MINT,
180
+ deployedBy: anthonyId,
181
+ },
182
+ createdAt: Date.now(),
183
+ }
184
+
185
+ // Base Bridge Contract
186
+ {
187
+ fromThingId: oneOrgId,
188
+ toThingId: baseBridgeId,
189
+ relationshipType: "owns",
190
+ metadata: {
191
+ network: "base",
192
+ contractType: "bridge",
193
+ contractAddress: process.env.BASE_BRIDGE_CONTRACT,
194
+ deployedBy: anthonyId,
195
+ },
196
+ createdAt: Date.now(),
197
+ }
198
+ ```
199
+
200
+ ### ONE Owns Platform Tokens
201
+ `one-org` → `token` via `owns`
202
+
203
+ ```typescript
204
+ {
205
+ fromThingId: oneOrgId,
206
+ toThingId: oneTokenId,
207
+ relationshipType: "owns",
208
+ metadata: {
209
+ tokenName: "ONE",
210
+ tokenSymbol: "ONE",
211
+ totalSupply: 1000000000, // 1B tokens
212
+ networks: ["sui", "solana", "base"],
213
+ },
214
+ createdAt: Date.now(),
215
+ }
216
+ ```
217
+
218
+ ---
219
+
220
+ ## Platform Treasury
221
+
222
+ ### Treasury Addresses
223
+
224
+ ```typescript
225
+ const treasuryAddresses = {
226
+ sui: process.env.PLATFORM_TREASURY_SUI,
227
+ solana: process.env.PLATFORM_TREASURY_SOLANA,
228
+ base: process.env.PLATFORM_TREASURY_BASE,
229
+ };
230
+ ```
231
+
232
+ ### Treasury Connections
233
+ `one-org` → `treasury-wallet` via `controls`
234
+
235
+ ```typescript
236
+ // Sui Treasury
237
+ {
238
+ fromThingId: oneOrgId,
239
+ toThingId: suiTreasuryId,
240
+ relationshipType: "controls",
241
+ metadata: {
242
+ network: "sui",
243
+ address: process.env.PLATFORM_TREASURY_SUI,
244
+ type: "platform_treasury",
245
+ purpose: "Collect all inference and subscription revenue",
246
+ },
247
+ createdAt: Date.now(),
248
+ }
249
+
250
+ // Solana Treasury
251
+ {
252
+ fromThingId: oneOrgId,
253
+ toThingId: solanaTreasuryId,
254
+ relationshipType: "controls",
255
+ metadata: {
256
+ network: "solana",
257
+ address: process.env.PLATFORM_TREASURY_SOLANA,
258
+ type: "platform_treasury",
259
+ purpose: "Collect token sales and NFT revenue",
260
+ },
261
+ createdAt: Date.now(),
262
+ }
263
+
264
+ // Base Treasury
265
+ {
266
+ fromThingId: oneOrgId,
267
+ toThingId: baseTreasuryId,
268
+ relationshipType: "controls",
269
+ metadata: {
270
+ network: "base",
271
+ address: process.env.PLATFORM_TREASURY_BASE,
272
+ type: "platform_treasury",
273
+ purpose: "Collect cross-chain bridge fees",
274
+ },
275
+ createdAt: Date.now(),
276
+ }
277
+ ```
278
+
279
+ ---
280
+
281
+ ## Organization Events
282
+
283
+ ### Platform Lifecycle
284
+
285
+ ```typescript
286
+ // ONE organization created
287
+ {
288
+ type: "organization_created",
289
+ actorId: anthonyId,
290
+ targetId: oneOrgId,
291
+ timestamp: Date.now(),
292
+ metadata: {
293
+ name: "ONE Platform",
294
+ slug: "one",
295
+ plan: "enterprise",
296
+ createdBy: anthonyId,
297
+ },
298
+ }
299
+
300
+ // ONE organization updated
301
+ {
302
+ type: "organization_updated",
303
+ actorId: anthonyId,
304
+ targetId: oneOrgId,
305
+ timestamp: Date.now(),
306
+ metadata: {
307
+ updatedFields: ["settings.inferenceModels"],
308
+ previousValues: { inferenceModels: ["gpt-4"] },
309
+ newValues: { inferenceModels: ["gpt-4", "claude-3.5-sonnet"] },
310
+ },
311
+ }
312
+ ```
313
+
314
+ ### Revenue Events
315
+
316
+ ```typescript
317
+ // Platform collects inference revenue
318
+ {
319
+ type: "inference_revenue_collected",
320
+ actorId: "system",
321
+ targetId: anthonyId,
322
+ timestamp: Date.now(),
323
+ metadata: {
324
+ organizationId: oneOrgId,
325
+ amount: 0.10,
326
+ cost: 0.045,
327
+ profit: 0.055,
328
+ network: "sui",
329
+ txDigest: "...",
330
+ },
331
+ }
332
+
333
+ // Customer org generates revenue for platform
334
+ {
335
+ type: "org_revenue_generated",
336
+ actorId: customerOrgId,
337
+ targetId: anthonyId,
338
+ timestamp: Date.now(),
339
+ metadata: {
340
+ totalRevenue: 1000.00,
341
+ platformShare: 1000.00, // Anthony gets 100% (no rev share)
342
+ revenueSharePercentage: 0,
343
+ },
344
+ }
345
+ ```
346
+
347
+ ---
348
+
349
+ ## Customer Organizations
350
+
351
+ ONE Platform hosts customer organizations:
352
+
353
+ ```typescript
354
+ // Customer creates org on ONE Platform
355
+ const customerOrgId = await db.insert("things", {
356
+ type: "organization",
357
+ name: "Acme Corp",
358
+ properties: {
359
+ slug: "acme",
360
+ domain: "acme.one.ie", // Subdomain of ONE
361
+ plan: "pro",
362
+ limits: {
363
+ users: 50,
364
+ storage: 100,
365
+ apiCalls: 100000,
366
+ inferences: 10000,
367
+ },
368
+ usage: { users: 0, storage: 0, apiCalls: 0, inferences: 0 },
369
+ billing: {
370
+ customerId: "cus_stripe123",
371
+ subscriptionId: "sub_stripe456",
372
+ cryptoEnabled: false,
373
+ },
374
+ settings: {
375
+ allowSignups: false,
376
+ requireEmailVerification: true,
377
+ enableTwoFactor: false,
378
+ inferenceEnabled: true,
379
+ inferenceModels: ["gpt-4", "claude-3.5-sonnet"],
380
+ },
381
+ revenueShare: 0.1, // 10% rev share if they refer users
382
+ },
383
+ status: "active",
384
+ createdAt: Date.now(),
385
+ updatedAt: Date.now(),
386
+ });
387
+
388
+ // Customer org is hosted by ONE
389
+ {
390
+ fromThingId: customerOrgId,
391
+ toThingId: oneOrgId,
392
+ relationshipType: "hosted_by",
393
+ metadata: {
394
+ plan: "pro",
395
+ monthlyFee: 99.00,
396
+ },
397
+ createdAt: Date.now(),
398
+ }
399
+ ```
400
+
401
+ ---
402
+
403
+ ## Multi-Tenant Isolation
404
+
405
+ Every customer org is isolated:
406
+
407
+ ```typescript
408
+ // Query user's organizations
409
+ export const getUserOrganizations = async (userId: Id<"things">) => {
410
+ const memberships = await db
411
+ .query("connections")
412
+ .withIndex("from_type", q =>
413
+ q.eq("fromThingId", userId)
414
+ .eq("relationshipType", "member_of")
415
+ )
416
+ .collect();
417
+
418
+ const orgs = await Promise.all(
419
+ memberships.map(m => db.get(m.toThingId))
420
+ );
421
+
422
+ return orgs;
423
+ };
424
+
425
+ // Check if user can access org
426
+ export const canAccessOrg = async (
427
+ userId: Id<"things">,
428
+ organizationId: Id<"things">
429
+ ) => {
430
+ const membership = await db
431
+ .query("connections")
432
+ .withIndex("from_type", q =>
433
+ q.eq("fromThingId", userId)
434
+ .eq("toThingId", organizationId)
435
+ .eq("relationshipType", "member_of")
436
+ )
437
+ .first();
438
+
439
+ return !!membership;
440
+ };
441
+ ```
442
+
443
+ ---
444
+
445
+ ## Queries
446
+
447
+ **Get ONE organization:**
448
+ ```typescript
449
+ export const getOneOrg = async () => {
450
+ const oneOrg = await db
451
+ .query("things")
452
+ .withIndex("type", q => q.eq("type", "organization"))
453
+ .filter(q => q.eq(q.field("properties.slug"), "one"))
454
+ .first();
455
+
456
+ return oneOrg;
457
+ };
458
+ ```
459
+
460
+ **Get ONE's smart contracts:**
461
+ ```typescript
462
+ const contracts = await db
463
+ .query("connections")
464
+ .withIndex("from_type", q =>
465
+ q.eq("fromThingId", oneOrgId)
466
+ .eq("relationshipType", "owns")
467
+ )
468
+ .filter(q =>
469
+ q.neq(q.field("metadata.contractType"), undefined)
470
+ )
471
+ .collect();
472
+ ```
473
+
474
+ **Get ONE's customer organizations:**
475
+ ```typescript
476
+ const customerOrgs = await db
477
+ .query("connections")
478
+ .withIndex("to_type", q =>
479
+ q.eq("toThingId", oneOrgId)
480
+ .eq("relationshipType", "hosted_by")
481
+ )
482
+ .collect();
483
+
484
+ const orgEntities = await Promise.all(
485
+ customerOrgs.map(c => db.get(c.fromThingId))
486
+ );
487
+ ```
488
+
489
+ **Get ONE's total revenue:**
490
+ ```typescript
491
+ const revenueEvents = await db
492
+ .query("events")
493
+ .withIndex("type_time", q =>
494
+ q.eq("type", "inference_revenue_collected")
495
+ )
496
+ .collect();
497
+
498
+ const totalRevenue = revenueEvents.reduce(
499
+ (sum, e) => sum + (e.metadata.profit || 0),
500
+ 0
501
+ );
502
+ ```
503
+
504
+ **Get ONE's treasury balances:**
505
+ ```typescript
506
+ const treasuryBalances = {
507
+ sui: await getSuiBalance(process.env.PLATFORM_TREASURY_SUI),
508
+ solana: await getSolanaBalance(process.env.PLATFORM_TREASURY_SOLANA),
509
+ base: await getBaseBalance(process.env.PLATFORM_TREASURY_BASE),
510
+ };
511
+ ```
512
+
513
+ ---
514
+
515
+ ## Platform Features
516
+
517
+ ### 8 Core Features
518
+
519
+ 1. **Inference API** - Pay-per-use AI inference
520
+ 2. **AI Clones** - Voice & video clones of creators
521
+ 3. **Content Creation** - AI-powered content generation
522
+ 4. **Token Economy** - Creator tokens & NFTs
523
+ 5. **Blockchain Payments** - Multi-chain (Sui, Solana, Base)
524
+ 6. **Revenue Sharing** - Optional rev share with orgs
525
+ 7. **Multi-Tenant** - Isolated organizations
526
+ 8. **Knowledge Integration** - RAG & vector search
527
+
528
+ ### Supported Inference Models
529
+
530
+ ```typescript
531
+ const inferenceModels = [
532
+ // OpenAI
533
+ "gpt-4-turbo",
534
+ "gpt-4",
535
+ "gpt-3.5-turbo",
536
+
537
+ // Anthropic
538
+ "claude-3.5-sonnet",
539
+ "claude-3-opus",
540
+ "claude-3-sonnet",
541
+
542
+ // Meta
543
+ "llama-3-70b",
544
+ "llama-3-8b",
545
+
546
+ // Mistral
547
+ "mistral-large",
548
+ "mixtral-8x7b",
549
+ ];
550
+ ```
551
+
552
+ ### Supported Blockchains
553
+
554
+ ```typescript
555
+ const supportedNetworks = [
556
+ {
557
+ name: "Sui",
558
+ chainId: "sui:mainnet",
559
+ nativeToken: "SUI",
560
+ features: ["inference_payment", "token", "nft", "subscription"],
561
+ },
562
+ {
563
+ name: "Solana",
564
+ chainId: "solana:mainnet",
565
+ nativeToken: "SOL",
566
+ features: ["token", "nft", "staking"],
567
+ },
568
+ {
569
+ name: "Base",
570
+ chainId: "base:mainnet",
571
+ nativeToken: "ETH",
572
+ features: ["token", "bridge", "payment"],
573
+ },
574
+ ];
575
+ ```
576
+
577
+ ---
578
+
579
+ ## Key Principles
580
+
581
+ - **Platform Organization** - ONE is the parent org for all customer orgs
582
+ - **100% Ownership** - Anthony owns 100% of ONE organization
583
+ - **Unlimited Resources** - No limits on users, storage, API calls, inferences
584
+ - **Blockchain-First** - All revenue collected via smart contracts
585
+ - **Multi-Chain** - Supports Sui, Solana, and Base
586
+ - **Multi-Tenant** - Hosts customer organizations with isolation
587
+ - **Revenue Flow** - All customer payments flow to platform treasury
588
+ - **Enterprise Plan** - ONE runs on unlimited enterprise plan
589
+
590
+ **ONE is not just an organization. ONE is THE platform.**
591
+
592
+ ---
593
+
594
+ ## See Also
595
+
596
+ - [Anthony O'Connell Profile](./anthony-o-connell.md)
597
+ - [Platform Owner Role](./owner.md)
598
+ - [Organization Structure](./organisation.md)
599
+ - [People Roles](./people.md)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oneie",
3
- "version": "2.0.9",
3
+ "version": "2.0.10",
4
4
  "type": "module",
5
5
  "description": "Build apps, websites, and AI agents in English. Download to your computer, run in the cloud, deploy to the edge. Open source and free forever.",
6
6
  "bin": {