oneie 3.6.39 → 3.6.40

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 (46) hide show
  1. package/.claude/commands/deploy.md +187 -17
  2. package/.claude/commands/media-upload.md +186 -0
  3. package/.claude/hooks/.last-news-context +1 -1
  4. package/.claude/hooks/__pycache__/todo.cpython-312.pyc +0 -0
  5. package/one/README.md +1 -2
  6. package/one/knowledge/one-protocol-ai-agents.md +892 -0
  7. package/one/knowledge/one-protocol-executive-report.md +617 -0
  8. package/one/knowledge/one-protocol-standard.md +869 -0
  9. package/one/knowledge/one-protocol-whitepaper.md +756 -0
  10. package/one/knowledge/ontology-education-game.md +1654 -0
  11. package/one/knowledge/ontology-v2.md +4449 -0
  12. package/one/knowledge/ontology.md +1 -1
  13. package/one/things/contracts/Move.toml +12 -0
  14. package/one/things/contracts/README.md +288 -0
  15. package/one/things/contracts/one.move +762 -0
  16. package/one/things/contracts/sdk.ts +578 -0
  17. package/one/things/crypto/FEATURES.md +78 -0
  18. package/one/things/crypto/ONECORE.md +62 -0
  19. package/one/things/crypto/ONECOREFAQ.md +22 -0
  20. package/one/things/crypto/ONECOREHOW.md +46 -0
  21. package/one/things/crypto/ONEENTERPRISE.md +64 -0
  22. package/one/things/crypto/ONEENTERPRISEFAQ.md +64 -0
  23. package/one/things/crypto/ONEENTERPRISEHOW.md +53 -0
  24. package/one/things/crypto/ONEPRO.md +60 -0
  25. package/one/things/crypto/ONEPROFAQ.md +22 -0
  26. package/one/things/crypto/ONEPROHOW.md +53 -0
  27. package/one/things/crypto/READMEAGENCY.md +64 -0
  28. package/one/things/crypto/VSL.md +45 -0
  29. package/one/things/crypto/WebsiteCopy.md +176 -0
  30. package/one/things/design-system.md +832 -0
  31. package/one/things/pay.one.ie.md +53 -0
  32. package/one/things/plans/one-protocol-and-payone-usage.md +82 -0
  33. package/one/things/plans/plan-connect-to-api.md +146 -0
  34. package/one/things/plans-u.md +905 -0
  35. package/one/things/products/Blockchain Products.md +6278 -0
  36. package/one/things/scripts-clean-mac.sh +409 -0
  37. package/one/things/todo-release.md +654 -0
  38. package/one/things/todo.md +9 -642
  39. package/one/things/video-script-backup.md +318 -0
  40. package/one/things/video-script-demo.md +382 -0
  41. package/one/things/video-script-ontology.md +0 -1
  42. package/one/things/video-script.md +361 -0
  43. package/package.json +6 -5
  44. package/.claude/hooks/__pycache__/done.cpython-313.pyc +0 -0
  45. package/.claude/hooks/__pycache__/todo.cpython-311.pyc +0 -0
  46. package/llms.txt +0 -257
@@ -5,7 +5,7 @@ description: Deploy web to Cloudflare Pages (oneie project)
5
5
 
6
6
  # /deploy - Deploy Web to Cloudflare Pages
7
7
 
8
- **Purpose:** Build and deploy the web application to Cloudflare Pages using wrangler CLI.
8
+ **Purpose:** Build and deploy the web application to Cloudflare Pages using wrangler CLI with bundle size optimization.
9
9
 
10
10
  ## One-Command Deployment
11
11
 
@@ -30,6 +30,106 @@ View all deployments:
30
30
  wrangler pages deployment list --project-name=oneie
31
31
  ```
32
32
 
33
+ ---
34
+
35
+ ## CRITICAL: Worker Bundle Size Optimization
36
+
37
+ **Cloudflare Limits:**
38
+ - Free tier: **3 MiB** worker size
39
+ - Paid tier: **10 MiB** worker size
40
+
41
+ With Astro's `output: "server"` mode, ALL pages get bundled into the worker. To stay under limits:
42
+
43
+ ### Three Optimization Rules
44
+
45
+ #### Rule 1: Static Pages Should Prerender (95% of pages)
46
+
47
+ Add to all static pages (marketing, docs, blog, etc.):
48
+
49
+ ```astro
50
+ ---
51
+ export const prerender = true;
52
+
53
+ import Layout from '@/layouts/Layout.astro';
54
+ ---
55
+ <Layout>Content</Layout>
56
+ ```
57
+
58
+ **Effect:** Page becomes static HTML (0 KiB in worker bundle)
59
+
60
+ #### Rule 2: Heavy Components Use `client:only="react"` NOT `client:load`
61
+
62
+ ```astro
63
+ ---
64
+ export const prerender = true;
65
+ import { UDashboard } from '@/components/u/UDashboard';
66
+ ---
67
+
68
+ <!-- ❌ WRONG: Bundles into worker (378 KiB) -->
69
+ <UDashboard client:load />
70
+
71
+ <!-- ✅ CORRECT: Only ships to browser (0.06 KiB in worker) -->
72
+ <UDashboard client:only="react" />
73
+ ```
74
+
75
+ **Why:** `client:only="react"` skips SSR bundling - component only loads in browser.
76
+
77
+ **Use for:** Components with heavy dependencies (crypto/wallet libs, charting, video players, mermaid diagrams)
78
+
79
+ #### Rule 3: Dynamic Routes Need `prerender = false`
80
+
81
+ ```astro
82
+ ---
83
+ export const prerender = false;
84
+ const { id } = Astro.params;
85
+ ---
86
+ ```
87
+
88
+ **Use for:**
89
+ - Dynamic routes: `[param].astro`, `[...slug].astro`
90
+ - API endpoints: `*.ts` files
91
+ - Runtime auth/user data pages
92
+
93
+ ### Automation Script
94
+
95
+ Apply these rules automatically:
96
+
97
+ ```bash
98
+ cd /Users/toc/Server/ONE/web && ./scripts/add-prerender.sh
99
+ ```
100
+
101
+ ### Real Results
102
+
103
+ | Component | Before | After | Change |
104
+ |-----------|--------|-------|--------|
105
+ | `/u/index.astro` | 378 KiB | 0.06 KiB | **-99.98%** |
106
+ | `/mail.astro` | 400 KiB | 0.06 KiB | **-99.98%** |
107
+ | Total Worker | 15 MiB | 12 MiB | **-20%** |
108
+ | Deployment | ❌ Failed | ✅ Success | |
109
+
110
+ ---
111
+
112
+ ## Pre-Deployment Checklist
113
+
114
+ Before deploying, verify bundle optimization:
115
+
116
+ ```bash
117
+ # 1. Ensure heavy pages use client:only
118
+ grep -r "client:load" web/src/pages/u/ && echo "WARNING: Found client:load in /u pages!"
119
+
120
+ # 2. Check prerender exports exist
121
+ ./scripts/add-prerender.sh
122
+
123
+ # 3. Build and check worker size
124
+ cd web && bun run build
125
+ du -sh dist/_worker.js # Should be < 15MB for paid tier
126
+
127
+ # 4. Deploy
128
+ wrangler pages deploy dist --project-name=oneie
129
+ ```
130
+
131
+ ---
132
+
33
133
  ## Requirements
34
134
 
35
135
  **Before deploying:**
@@ -37,6 +137,7 @@ wrangler pages deployment list --project-name=oneie
37
137
  - ✅ Cloudflare Global API Key: `$CLOUDFLARE_GLOBAL_API_KEY`
38
138
  - ✅ Cloudflare Account ID: `$CLOUDFLARE_ACCOUNT_ID`
39
139
  - ✅ React 19 edge alias configured in `astro.config.mjs`
140
+ - ✅ Bundle optimization applied (see rules above)
40
141
 
41
142
  **Environment Setup:**
42
143
  ```bash
@@ -50,11 +151,14 @@ CLOUDFLARE_EMAIL=your-email@example.com
50
151
 
51
152
  1. **Build Phase:** `bun run build`
52
153
  - Compiles Astro + React 19 to static files + edge functions
154
+ - Prerenders static pages as HTML
155
+ - Bundles only SSR pages into worker
53
156
  - Outputs to `/web/dist/`
54
- - Time: ~25-30 seconds
157
+ - Time: ~60-70 seconds
55
158
 
56
159
  2. **Deploy Phase:** `wrangler pages deploy dist --project-name=oneie`
57
160
  - Uploads 600+ files to Cloudflare Pages
161
+ - Bundles `_worker.js` directory
58
162
  - Provisions edge runtime
59
163
  - Propagates to 330+ global data centers
60
164
  - Time: ~10-15 seconds
@@ -64,50 +168,104 @@ CLOUDFLARE_EMAIL=your-email@example.com
64
168
  - Cache warming across regions
65
169
  - Real-time analytics enabled
66
170
 
67
- ## React 19 + Cloudflare Edge
171
+ ## Configuration
68
172
 
69
- **Critical Config:** `astro.config.mjs` must have:
173
+ ### astro.config.mjs Critical Settings
70
174
 
71
175
  ```javascript
176
+ // Output mode - use server with strategic prerendering
177
+ output: "server",
178
+ adapter: cloudflare({ mode: "directory" }),
179
+
180
+ // Disable Shiki syntax highlighting (saves 9.4MB)
181
+ markdown: {
182
+ syntaxHighlight: false,
183
+ },
184
+
185
+ // React 19 edge compatibility
72
186
  resolve: {
73
187
  alias: {
74
188
  'react-dom/server': 'react-dom/server.edge',
75
189
  },
190
+ },
191
+
192
+ // Manual chunks for code splitting
193
+ build: {
194
+ rollupOptions: {
195
+ output: {
196
+ manualChunks: (id) => {
197
+ if (id.includes('mermaid')) return 'vendor-diagrams';
198
+ if (id.includes('cytoscape')) return 'vendor-graph';
199
+ if (id.includes('recharts')) return 'vendor-charts';
200
+ if (id.includes('video-react')) return 'vendor-video';
201
+ }
202
+ }
203
+ }
76
204
  }
77
205
  ```
78
206
 
79
- Without this, deployment fails with `MessageChannel is not defined`.
207
+ ---
80
208
 
81
209
  ## Troubleshooting
82
210
 
83
- **Authentication Failed**
211
+ ### Worker Size Exceeded (3MB/10MB limit)
212
+
213
+ **Error:** `Your Worker exceeded the size limit of 3 MiB`
214
+
215
+ **Solution:**
216
+ 1. Run `./scripts/add-prerender.sh` to add prerender exports
217
+ 2. Check heavy pages use `client:only="react"`:
218
+ ```bash
219
+ grep -r "client:load" web/src/pages/ | grep -v node_modules
220
+ ```
221
+ 3. Convert any `client:load` to `client:only="react"` for heavy components
222
+ 4. Rebuild and redeploy
223
+
224
+ ### Which Pages Are Bloating the Bundle?
225
+
84
226
  ```bash
85
- # Verify credentials are set:
227
+ # Check largest page bundles:
228
+ ls -lS web/dist/_worker.js/pages/*.mjs | head -20
229
+ ```
230
+
231
+ If a page is > 50KB, check if it imports heavy dependencies and convert to `client:only`.
232
+
233
+ ### Authentication Failed
234
+
235
+ ```bash
236
+ # Verify credentials:
86
237
  echo $CLOUDFLARE_GLOBAL_API_KEY
87
238
  echo $CLOUDFLARE_ACCOUNT_ID
88
239
  echo $CLOUDFLARE_EMAIL
89
240
 
90
- # Check wrangler auth:
241
+ # Re-authenticate:
91
242
  wrangler auth login
92
243
  ```
93
244
 
94
- **Build Errors**
245
+ ### Build Errors
246
+
95
247
  ```bash
96
- # Check Astro build:
248
+ # Check Astro types:
97
249
  cd web && bun run check
98
250
 
99
251
  # View detailed errors:
100
252
  cd web && bun run build --verbose
101
253
  ```
102
254
 
103
- **Deploy Timeout**
104
- ```bash
105
- # Retry deployment:
106
- wrangler pages deploy dist --project-name=oneie
255
+ ### MessageChannel is not defined
107
256
 
108
- # Or use direct git integration for auto-deploy on push
257
+ Missing React 19 edge alias:
258
+ ```javascript
259
+ // astro.config.mjs
260
+ resolve: {
261
+ alias: {
262
+ 'react-dom/server': 'react-dom/server.edge',
263
+ },
264
+ }
109
265
  ```
110
266
 
267
+ ---
268
+
111
269
  ## Rollback
112
270
 
113
271
  To rollback to a previous deployment:
@@ -120,13 +278,16 @@ wrangler pages deployment list --project-name=oneie
120
278
  wrangler pages deployments rollback --project-name=oneie
121
279
  ```
122
280
 
281
+ ---
282
+
123
283
  ## Performance Metrics
124
284
 
125
285
  **Typical Deployment:**
126
- - Build time: 25-30s
286
+ - Build time: 60-70s (with prerendering)
127
287
  - Upload time: 10-15s
128
- - Total time: 35-45s
288
+ - Total time: 70-85s
129
289
  - Files deployed: 600+
290
+ - Worker bundle: ~12 MiB (after optimization)
130
291
  - Global rollout: <2 minutes
131
292
 
132
293
  **Monitoring:**
@@ -136,4 +297,13 @@ wrangler pages deployments rollback --project-name=oneie
136
297
 
137
298
  ---
138
299
 
300
+ ## Documentation References
301
+
302
+ - **Full optimization guide:** `/web/BUNDLE_OPTIMIZATION.md`
303
+ - **Pages CLAUDE.md:** `/web/src/pages/CLAUDE.md` - Bundle Size section
304
+ - **Automation script:** `/web/scripts/add-prerender.sh`
305
+ - **Config comments:** `/web/astro.config.mjs`
306
+
307
+ ---
308
+
139
309
  **Ready to deploy!** 🚀
@@ -0,0 +1,186 @@
1
+ # /media-upload - Upload Media to Cloudflare R2
2
+
3
+ Upload media files to Cloudflare R2 storage with automatic public URL generation and fast S3-compatible uploads.
4
+
5
+ ## Usage
6
+
7
+ ```bash
8
+ /media-upload <file_path> [options]
9
+ ```
10
+
11
+ ## Examples
12
+
13
+ ```bash
14
+ # Quick upload with auto content-type
15
+ /media-upload /path/to/video.mp4
16
+
17
+ # Upload with custom filename
18
+ /media-upload /path/to/video.mp4 -n my-demo.mov
19
+
20
+ # Explicit content type
21
+ /media-upload /path/to/file.bin -c application/octet-stream
22
+
23
+ # Quiet mode (no output)
24
+ /media-upload /path/to/file.pdf -q
25
+
26
+ # Verbose mode
27
+ /media-upload /path/to/file.pdf -v
28
+
29
+ # Upload to custom bucket
30
+ /media-upload /path/to/file.pdf my-bucket
31
+ ```
32
+
33
+ ## Options
34
+
35
+ - `-n, --name NAME` - Custom filename for uploaded object
36
+ - `-c, --content-type TYPE` - Explicit MIME type (auto-detected if omitted)
37
+ - `-q, --quiet` - Suppress progress output (good for scripts)
38
+ - `-v, --verbose` - Detailed upload information
39
+ - `-h, --help` - Show help message
40
+
41
+ ## Features
42
+
43
+ ✅ **Fast Upload** - 15-43 MiB/s via AWS CLI S3-compatible protocol
44
+ ✅ **Auto Detection** - Automatically detects content-type from file extension
45
+ ✅ **Progress Tracking** - Real-time transfer rates and completion percentage
46
+ ✅ **Public URLs** - Automatic generation of `https://media.one.ie/filename`
47
+ ✅ **Custom Names** - Upload with different filename than source
48
+ ✅ **Multiple Buckets** - Support for any R2 bucket (default: one-platform-media)
49
+ ✅ **Error Handling** - Clear error messages and validation
50
+
51
+ ## Supported File Types
52
+
53
+ | Type | Extensions |
54
+ |------|-----------|
55
+ | Video | `.mp4`, `.mov`, `.webm` |
56
+ | Image | `.jpg`, `.jpeg`, `.png`, `.gif`, `.webp` |
57
+ | Document | `.pdf`, `.zip`, `.tar.gz` |
58
+ | Other | Auto-detect or specify with `-c` |
59
+
60
+ ## Output
61
+
62
+ Successful upload shows:
63
+
64
+ ```
65
+ ═══════════════════════════════════════════════════════════
66
+ Cloudflare R2 Media Upload
67
+ ═══════════════════════════════════════════════════════════
68
+ Source: /path/to/file.mp4
69
+ Size: 149.60 MiB
70
+ Destination: s3://one-platform-media/ONE-demo.mp4
71
+ Content-Type: video/mp4
72
+ Endpoint: https://627e0c7ccbe735a4a7cabf91e377bbad.r2.cloudflarestorage.com
73
+ ───────────────────────────────────────────────────────────
74
+ Completed 1.0 MiB/149.6 MiB (2.9 MiB/s) with 1 file(s) remaining
75
+ ...
76
+ ✓ Upload successful!
77
+ ───────────────────────────────────────────────────────────
78
+ Public URL: https://media.one.ie/ONE-demo.mp4
79
+ Direct URL: https://627e0c7ccbe735a4a7cabf91e377bbad.r2.cloudflarestorage.com/one-platform-media/ONE-demo.mp4
80
+ ═══════════════════════════════════════════════════════════
81
+ (Public URL copied to clipboard)
82
+ ```
83
+
84
+ ## Requirements
85
+
86
+ 1. **AWS CLI** - `brew install awscli`
87
+ 2. **R2 Credentials** in `.env`:
88
+ ```
89
+ CLOUDFLARE_R2_S3_ACCESS_KEY_ID=...
90
+ CLOUDFLARE_R2_S3_SECRET_KEY=...
91
+ CLOUDFLARE_ACCOUNT_ID=...
92
+ CLOUDFLARE_S3_API=...
93
+ ```
94
+ 3. **bc** - `brew install bc`
95
+
96
+ ## URLs
97
+
98
+ After upload, access your file:
99
+
100
+ **Public Domain:**
101
+ ```
102
+ https://media.one.ie/filename
103
+ ```
104
+
105
+ **R2 Direct (backup):**
106
+ ```
107
+ https://627e0c7ccbe735a4a7cabf91e377bbad.r2.cloudflarestorage.com/one-platform-media/filename
108
+ ```
109
+
110
+ ## Script Location
111
+
112
+ The underlying script is at:
113
+ ```
114
+ /Users/toc/Server/ONE/scripts/media-uploads.sh
115
+ ```
116
+
117
+ ## Documentation
118
+
119
+ Full documentation available at:
120
+ ```
121
+ /Users/toc/Server/ONE/media-upload.md
122
+ ```
123
+
124
+ ## Performance
125
+
126
+ - **Speed**: 15-43 MiB/s (varies with file size)
127
+ - **Max File Size**: 5 TiB
128
+ - **Bucket**: Unlimited objects
129
+
130
+ ## Troubleshooting
131
+
132
+ **"aws: command not found"**
133
+ ```bash
134
+ brew install awscli
135
+ ```
136
+
137
+ **"Error: .env file not found"**
138
+ Check that `.env` exists in project root with R2 credentials
139
+
140
+ **Connection issues**
141
+ - Verify internet connection
142
+ - Check R2 API endpoint in `.env`
143
+ - Verify AWS credentials are correct
144
+
145
+ ## Examples
146
+
147
+ ### Upload demo video
148
+
149
+ ```bash
150
+ /media-upload demo.mp4
151
+ # Returns: https://media.one.ie/demo.mp4
152
+ ```
153
+
154
+ ### Upload with custom name
155
+
156
+ ```bash
157
+ /media-upload video.mp4 -n product-demo.mov
158
+ # Returns: https://media.one.ie/product-demo.mov
159
+ ```
160
+
161
+ ### Batch upload (script)
162
+
163
+ ```bash
164
+ for file in /path/to/media/*; do
165
+ /media-upload "$file" -q
166
+ done
167
+ ```
168
+
169
+ ### Upload large file (40+ MiB)
170
+
171
+ ```bash
172
+ /media-upload large-file.zip
173
+ # Automatically uses multipart upload with retry logic
174
+ ```
175
+
176
+ ## See Also
177
+
178
+ - `media-upload.md` - Complete documentation
179
+ - `/scripts/media-uploads.sh` - Script source code
180
+ - [Cloudflare R2 Docs](https://developers.cloudflare.com/r2/)
181
+
182
+ ---
183
+
184
+ **Command Version**: 1.0
185
+ **Last Updated**: 2025-11-21
186
+ **Status**: Production Ready
@@ -1 +1 @@
1
- /var/folders/ll/3vb8ckfd47dc_pcl31s65xg40000gn/T/tmp.UXEfrShTxV
1
+ /var/folders/ll/3vb8ckfd47dc_pcl31s65xg40000gn/T/tmp.i8tpTEBf3b
package/one/README.md CHANGED
@@ -368,8 +368,7 @@ tags: ["payment_method:stripe", "status:completed", "audience:engaged"];
368
368
 
369
369
  ---
370
370
 
371
- ## 📐 Data Flow Through The Ontology
372
-
371
+ ## 📐 Data Flow
373
372
  ```
374
373
  0. Groups (Isolation Layer)
375
374
  ↓ Establishes scope for all operations (with optional nesting)