@oneie/claude 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/.claude-plugin/plugin.json +16 -0
- package/.mcp.json +12 -0
- package/README.md +204 -0
- package/agents/w1-recon.md +102 -0
- package/agents/w2-decide.md +164 -0
- package/agents/w3-edit.md +91 -0
- package/agents/w4-verify.md +416 -0
- package/commands/browser.md +55 -0
- package/commands/cc-connect.md +67 -0
- package/commands/claw.md +135 -0
- package/commands/close.md +143 -0
- package/commands/create.md +78 -0
- package/commands/deploy.md +415 -0
- package/commands/do-autonomous.md +80 -0
- package/commands/do-improve.md +51 -0
- package/commands/do-show.md +89 -0
- package/commands/do.md +226 -0
- package/commands/improve.md +99 -0
- package/commands/kill.md +45 -0
- package/commands/release.md +144 -0
- package/commands/see.md +161 -0
- package/commands/setup.md +75 -0
- package/commands/sync.md +185 -0
- package/hooks/hooks.json +90 -0
- package/hooks/lib/signal.sh +28 -0
- package/hooks/scripts/design-check.sh +83 -0
- package/hooks/scripts/post-edit-check.sh +32 -0
- package/hooks/scripts/session-end-verify.sh +51 -0
- package/hooks/scripts/session-start.sh +88 -0
- package/hooks/scripts/stop-reflect.sh +95 -0
- package/hooks/scripts/sync-todo-docs.sh +46 -0
- package/hooks/scripts/task-complete-verify.sh +52 -0
- package/hooks/scripts/tool-signal.sh +48 -0
- package/package.json +33 -0
- package/rules/api.md +50 -0
- package/rules/astro.md +206 -0
- package/rules/design.md +221 -0
- package/rules/documentation.md +218 -0
- package/rules/engine.md +297 -0
- package/rules/react.md +137 -0
- package/rules/ui.md +82 -0
- package/scripts/cc-connect.sh +345 -0
- package/scripts/do-analyze.sh +42 -0
- package/scripts/do-folder.sh +63 -0
- package/scripts/do-prove.sh +51 -0
- package/scripts/do-reconcile.sh +28 -0
- package/scripts/do-smoke.sh +60 -0
- package/scripts/do-survey.sh +30 -0
- package/scripts/do-tier.sh +43 -0
- package/skills/build/SKILL.md +52 -0
- package/skills/cloudflare/SKILL.md +503 -0
- package/skills/dev/SKILL.md +58 -0
- package/skills/do/SKILL.md +24 -0
- package/skills/oneie/SKILL.md +51 -0
- package/skills/perf/SKILL.md +45 -0
- package/skills/signal/SKILL.md +108 -0
- package/skills/sui/SKILL.md +441 -0
- package/skills/tutorial/SKILL.md +96 -0
- package/skills/typecheck/SKILL.md +66 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: build
|
|
3
|
+
description: Build the ONE Astro app (`one.ie/web/`) for production via `bun run build` — emits `dist/` for CF Workers Static Assets. Use when the user asks to "build for production", "check bundle size", or as the pre-deploy gate. Scope is `one.ie/web/` only; the four Workers (agents/api/sync/backup) build via wrangler — use /cloudflare instead.
|
|
4
|
+
user-invocable: true
|
|
5
|
+
allowed-tools: Bash
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Build ONE web (one.ie/web)
|
|
9
|
+
|
|
10
|
+
**Skills:** `/deploy` (wraps this as step 3 of the 8-step pipeline) · `/astro` (bundle-size rules — `markdown.syntaxHighlight: false`, `ssr.external`, keeps the CF Worker bundle under 10 MiB)
|
|
11
|
+
|
|
12
|
+
Build the Astro + React 19 project for production.
|
|
13
|
+
|
|
14
|
+
## Command
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
cd /Users/toc/Server/one-ie/one.ie/web && bun run build
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Expected Output
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
╭────────────────────────────────────────────────╮
|
|
24
|
+
│ BUILD RESULTS │
|
|
25
|
+
├────────────────────────────────────────────────┤
|
|
26
|
+
│ ✓ Astro build complete │
|
|
27
|
+
│ ✓ React components bundled │
|
|
28
|
+
│ ✓ Static pages generated │
|
|
29
|
+
│ ✓ Output: dist/ │
|
|
30
|
+
╰────────────────────────────────────────────────╯
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Build Artifacts
|
|
34
|
+
|
|
35
|
+
- `dist/` - Production build output
|
|
36
|
+
- `dist/_astro/` - Bundled assets (JS, CSS)
|
|
37
|
+
- `dist/index.html` - Entry page
|
|
38
|
+
|
|
39
|
+
## Error Handling
|
|
40
|
+
|
|
41
|
+
If build fails:
|
|
42
|
+
1. Check TypeScript errors with `bun run build` output
|
|
43
|
+
2. Verify all imports resolve correctly
|
|
44
|
+
3. Check for missing dependencies
|
|
45
|
+
|
|
46
|
+
## Preview Production Build
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
bun preview
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Opens at http://localhost:4321
|
|
@@ -0,0 +1,503 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: cloudflare
|
|
3
|
+
description: Cloudflare operations for ONE — Workers+Assets, wrangler 4, KV/D1/R2 bindings, tail/logs, secrets, rollback, custom domains. Post-Pages-migration era.
|
|
4
|
+
user-invocable: true
|
|
5
|
+
allowed-tools: Bash(*), Read(*), Write(*)
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# /cloudflare — Workers + Static Assets
|
|
9
|
+
|
|
10
|
+
Manage ONE's Cloudflare deployment: credentials, secrets, KV/D1, monitoring, logs, rollback. Platform direction is **Workers with Static Assets** (unified with Pages free tier; new features land here). Pages project is in a rollback window; cutover tracked in `docs/cf-workers-migration-todo.md`.
|
|
11
|
+
|
|
12
|
+
## Works With
|
|
13
|
+
|
|
14
|
+
| Skill | Load when |
|
|
15
|
+
|------------|------------------------------------------------------------------------------------------------|
|
|
16
|
+
| `/deploy` | Any push to Workers — bundle-size rules + Global API Key enforcement live in `.claude/commands/deploy.md`. |
|
|
17
|
+
| `/astro` | SSR worker bundle — the 10 MiB ceiling needs `ssr.external` + `client:only="react"` (Astro-specific). |
|
|
18
|
+
| `/sui` | Workers signing on-chain txns — platform keypair lives in CF secrets (`SUI_SEED`), derived per-agent. |
|
|
19
|
+
| `/typedb` | Gateway proxies TypeDB Cloud at port 1729 — `/v1/` API prefix and credentials flow through CF secrets. |
|
|
20
|
+
| `/signal` | Post-deploy `deploy:success` / `deploy:degraded` signals + `/broadcast` WsHub DO auth (`X-Broadcast-Secret`). |
|
|
21
|
+
|
|
22
|
+
## Live Workers
|
|
23
|
+
|
|
24
|
+
| Worker | URL | Adapter | Role |
|
|
25
|
+
|---|---|---|---|
|
|
26
|
+
| Astro (one-substrate) | `dev.one.ie` (primary, CF Workers Static Assets) · `one-substrate.pages.dev` (legacy idle, rollback safety net) | `@astrojs/cloudflare@13` | SSR + static assets |
|
|
27
|
+
| Gateway | `api.one.ie` (custom domain) → `one-gateway.oneie.workers.dev` | vanilla Worker | TypeDB proxy + WsHub DO |
|
|
28
|
+
| Sync | `one-sync.oneie.workers.dev` | vanilla Worker | TypeDB → KV cron (1 min) |
|
|
29
|
+
| NanoClaw | `nanoclaw.oneie.workers.dev` | vanilla Worker | Edge agents (Telegram/Discord webhooks) |
|
|
30
|
+
| Donal-Claw | `donal-claw.oneie.workers.dev` | vanilla Worker | CMO bot (persona: donal) |
|
|
31
|
+
| Debby-Claw | `debby-claw.oneie.workers.dev` | vanilla Worker | Elevare works bot |
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Credentials — GLOBAL API KEY ONLY
|
|
36
|
+
|
|
37
|
+
**⚠ NON-NEGOTIABLE.** Scoped `CLOUDFLARE_API_TOKEN` is **forbidden** — lacks permissions for Workers deploy + custom domains + KV management + D1 create + Pages + secrets.
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
# .env (gitignored)
|
|
41
|
+
CLOUDFLARE_GLOBAL_API_KEY=<40-char-key>
|
|
42
|
+
CLOUDFLARE_EMAIL=tony@one.ie
|
|
43
|
+
CLOUDFLARE_ACCOUNT_ID=627e0c7ccbe735a4a7cabf91e377bbad
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Scripts map `CLOUDFLARE_GLOBAL_API_KEY` → wrangler's `CLOUDFLARE_API_KEY` at runtime and **explicitly blank `CLOUDFLARE_API_TOKEN`** in the spawned env. See `scripts/deploy.ts:loadCredentials()`.
|
|
47
|
+
|
|
48
|
+
**Manual invocation (debugging only):**
|
|
49
|
+
```bash
|
|
50
|
+
export CLOUDFLARE_API_KEY=$(grep '^CLOUDFLARE_GLOBAL_API_KEY=' .env | cut -d= -f2-)
|
|
51
|
+
export CLOUDFLARE_EMAIL=$(grep '^CLOUDFLARE_EMAIL=' .env | cut -d= -f2-)
|
|
52
|
+
export CLOUDFLARE_ACCOUNT_ID=$(grep '^CLOUDFLARE_ACCOUNT_ID=' .env | cut -d= -f2-)
|
|
53
|
+
unset CLOUDFLARE_API_TOKEN # MUST be unset, or wrangler prefers it
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
**Error decoder:**
|
|
57
|
+
- `Authentication failed [code: 9106]` → Global Key not in env
|
|
58
|
+
- `Invalid access token [code: 9109]` → `CLOUDFLARE_API_TOKEN` is set and invalid
|
|
59
|
+
|
|
60
|
+
**Always prefer `bun run deploy` over manual wrangler.**
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## wrangler.toml — Workers + Assets Shape
|
|
65
|
+
|
|
66
|
+
### Astro SSR worker (the ONE pattern)
|
|
67
|
+
|
|
68
|
+
```toml
|
|
69
|
+
# wrangler.toml — current working config
|
|
70
|
+
name = "one-substrate"
|
|
71
|
+
compatibility_date = "2024-12-01"
|
|
72
|
+
compatibility_flags = ["nodejs_compat"]
|
|
73
|
+
|
|
74
|
+
# @astrojs/cloudflare v13 auto-injects `main` + `[assets]` during build.
|
|
75
|
+
# Declaring them here fails at config-resolve time on fresh checkouts
|
|
76
|
+
# (vite plugin validates file existence BEFORE build runs).
|
|
77
|
+
# Trust the adapter.
|
|
78
|
+
|
|
79
|
+
[[kv_namespaces]]
|
|
80
|
+
binding = "KV"
|
|
81
|
+
id = "1c1dac4766e54a2c85425022a3b1e9da"
|
|
82
|
+
|
|
83
|
+
[env.production]
|
|
84
|
+
vars = { ENVIRONMENT = "production" }
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
**This is intentional.** Do NOT add `main = "./dist/_worker.js/index.js"` or `[assets] directory = "./dist"` — the Astro adapter injects them during build. Scar tissue from `29a7cbd`.
|
|
88
|
+
|
|
89
|
+
### Minimum vanilla Worker + Assets
|
|
90
|
+
|
|
91
|
+
```toml
|
|
92
|
+
name = "my-worker"
|
|
93
|
+
main = "./src/index.ts"
|
|
94
|
+
compatibility_date = "2026-04-17"
|
|
95
|
+
compatibility_flags = ["nodejs_compat"]
|
|
96
|
+
|
|
97
|
+
[assets]
|
|
98
|
+
directory = "./public"
|
|
99
|
+
binding = "ASSETS"
|
|
100
|
+
not_found_handling = "single-page-application" # SPA fallback to index.html
|
|
101
|
+
|
|
102
|
+
[observability]
|
|
103
|
+
enabled = true
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### `[assets]` block reference
|
|
107
|
+
|
|
108
|
+
| Key | Values | Default | Notes |
|
|
109
|
+
|---|---|---|---|
|
|
110
|
+
| `directory` | path string | **required** | Where static files live |
|
|
111
|
+
| `binding` | string | optional | Conventionally `"ASSETS"`; needed for `env.ASSETS.fetch()` |
|
|
112
|
+
| `not_found_handling` | `"none"` \| `"404-page"` \| `"single-page-application"` | `"none"` | SPA = 200 + `index.html`; 404-page = nearest `404.html` |
|
|
113
|
+
| `run_worker_first` | `bool` \| `string[]` | `false` | `true` = worker for all requests; array = globs w/ `!` negation |
|
|
114
|
+
| `html_handling` | `"auto-trailing-slash"` \| `"force-trailing-slash"` \| `"drop-trailing-slash"` \| `"none"` | `"auto-trailing-slash"` | Trailing-slash normalization for `.html` lookups |
|
|
115
|
+
|
|
116
|
+
**Request flow (default):**
|
|
117
|
+
```
|
|
118
|
+
Request → asset exists in [assets].directory?
|
|
119
|
+
├── yes → serve asset (FREE, unlimited, doesn't count against quota)
|
|
120
|
+
└── no → invoke worker (main)
|
|
121
|
+
└── worker may call env.ASSETS.fetch(req) to serve asset manually
|
|
122
|
+
└── or returns Response
|
|
123
|
+
└── or falls through to not_found_handling
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### Resource bindings
|
|
127
|
+
|
|
128
|
+
```toml
|
|
129
|
+
[[kv_namespaces]]
|
|
130
|
+
binding = "KV"
|
|
131
|
+
id = "1c1dac4766e54a2c85425022a3b1e9da"
|
|
132
|
+
preview_id = "..."
|
|
133
|
+
|
|
134
|
+
[[d1_databases]]
|
|
135
|
+
binding = "DB"
|
|
136
|
+
database_name = "one"
|
|
137
|
+
database_id = "0aa5fceb-667a-470e-b08c-40ead2f4525d"
|
|
138
|
+
migrations_dir = "migrations"
|
|
139
|
+
|
|
140
|
+
[[r2_buckets]]
|
|
141
|
+
binding = "BUCKET"
|
|
142
|
+
bucket_name = "..."
|
|
143
|
+
|
|
144
|
+
[[queues.producers]]
|
|
145
|
+
binding = "QUEUE"
|
|
146
|
+
queue = "nanoclaw-agents"
|
|
147
|
+
|
|
148
|
+
[[queues.consumers]]
|
|
149
|
+
queue = "nanoclaw-agents"
|
|
150
|
+
max_batch_size = 10
|
|
151
|
+
max_retries = 3
|
|
152
|
+
dead_letter_queue = "dlq"
|
|
153
|
+
|
|
154
|
+
[[durable_objects.bindings]]
|
|
155
|
+
name = "WSHUB"
|
|
156
|
+
class_name = "WsHub"
|
|
157
|
+
|
|
158
|
+
[[migrations]]
|
|
159
|
+
tag = "v1"
|
|
160
|
+
new_classes = ["WsHub"]
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### `[env.production]` — inheritance rules
|
|
164
|
+
|
|
165
|
+
| Inheritable (top-level applies if omitted) | Non-inheritable (must re-declare) |
|
|
166
|
+
|---|---|
|
|
167
|
+
| `main`, `compatibility_date`, `compatibility_flags` | `vars`, `kv_namespaces`, `d1_databases` |
|
|
168
|
+
| `account_id`, `workers_dev`, `routes` | `r2_buckets`, `durable_objects.bindings` |
|
|
169
|
+
| `build`, `placement` | `queues`, `assets` |
|
|
170
|
+
|
|
171
|
+
### `[placement]` — Smart Placement (free, Workers-only)
|
|
172
|
+
|
|
173
|
+
```toml
|
|
174
|
+
[placement]
|
|
175
|
+
mode = "smart"
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
Available all plans. No extra cost. Analyzes ~15 min post-deploy. Applies to `fetch` handlers only (not RPC). Enable when your backend is distant or multi-region; skip for pure-CF stacks.
|
|
179
|
+
|
|
180
|
+
### `[observability]`
|
|
181
|
+
|
|
182
|
+
```toml
|
|
183
|
+
[observability]
|
|
184
|
+
enabled = true
|
|
185
|
+
head_sampling_rate = 1 # 0.0–1.0
|
|
186
|
+
|
|
187
|
+
[observability.logs]
|
|
188
|
+
invocation_logs = true
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
Retention: 3 days free, 7 days paid. 256 KB per log (truncated). 5B logs/day account cap.
|
|
192
|
+
|
|
193
|
+
---
|
|
194
|
+
|
|
195
|
+
## wrangler 4 CLI
|
|
196
|
+
|
|
197
|
+
### Deploy
|
|
198
|
+
|
|
199
|
+
```bash
|
|
200
|
+
bun wrangler deploy # deploy current config
|
|
201
|
+
bun wrangler deploy --dry-run # validate bundle + bindings, no push
|
|
202
|
+
bun wrangler deploy --env production # select [env.production] block
|
|
203
|
+
bun wrangler deploy --name my-prod # override worker name
|
|
204
|
+
|
|
205
|
+
# Versioned deploys (stage, then flip)
|
|
206
|
+
bun wrangler versions upload --tag=rc1 --message="..." # no traffic
|
|
207
|
+
bun wrangler versions list
|
|
208
|
+
bun wrangler versions deploy <VERSION_ID> # flip traffic
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
### Dev
|
|
212
|
+
|
|
213
|
+
```bash
|
|
214
|
+
bun wrangler dev # localhost with local miniflare + local KV
|
|
215
|
+
bun wrangler dev --remote # hits real CF resources (use with care)
|
|
216
|
+
bun wrangler dev --test-scheduled # exposes /__scheduled for cron
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
### Tail / Logs
|
|
220
|
+
|
|
221
|
+
```bash
|
|
222
|
+
# Live streams — one worker at a time
|
|
223
|
+
cd api && bun wrangler tail && cd ..
|
|
224
|
+
cd sync && bun wrangler tail && cd ..
|
|
225
|
+
cd agents && bun wrangler tail && cd ..
|
|
226
|
+
bun wrangler tail --name=one-substrate
|
|
227
|
+
|
|
228
|
+
# Filters
|
|
229
|
+
bun wrangler tail --format=json | jq .
|
|
230
|
+
bun wrangler tail --status=error --sampling-rate=0.1
|
|
231
|
+
bun wrangler tail --search="deploy:" --method=POST
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
| Flag | Values |
|
|
235
|
+
|---|---|
|
|
236
|
+
| `--format` | `pretty` \| `json` |
|
|
237
|
+
| `--status` | `ok` \| `error` \| `canceled` |
|
|
238
|
+
| `--sampling-rate` | 0.0–1.0 |
|
|
239
|
+
| `--search` | free-text in `console.log` |
|
|
240
|
+
| `--method` | `GET`, `POST`, ... |
|
|
241
|
+
|
|
242
|
+
**Dashboard Observability tab:** Workers & Pages → (worker) → Observability → filter by status/outcome/trigger.
|
|
243
|
+
|
|
244
|
+
### Rollback
|
|
245
|
+
|
|
246
|
+
```bash
|
|
247
|
+
bun wrangler deployments list # last 10 versions
|
|
248
|
+
bun wrangler deployments view <ID>
|
|
249
|
+
bun wrangler rollback [VERSION_ID] --message="revert bad deploy"
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
---
|
|
253
|
+
|
|
254
|
+
## Secrets
|
|
255
|
+
|
|
256
|
+
Per-worker. Set via wrangler:
|
|
257
|
+
|
|
258
|
+
```bash
|
|
259
|
+
# Gateway (TypeDB auth)
|
|
260
|
+
cd api
|
|
261
|
+
printf 'admin' | bun wrangler secret put TYPEDB_USERNAME
|
|
262
|
+
printf 'your-typedb-pw' | bun wrangler secret put TYPEDB_PASSWORD
|
|
263
|
+
printf "$(openssl rand -hex 32)" | bun wrangler secret put BROADCAST_SECRET
|
|
264
|
+
cd ..
|
|
265
|
+
|
|
266
|
+
# NanoClaw (LLM + channels)
|
|
267
|
+
cd agents
|
|
268
|
+
printf 'your-openrouter-key' | bun wrangler secret put OPENROUTER_API_KEY
|
|
269
|
+
printf 'your-tg-token' | bun wrangler secret put TELEGRAM_TOKEN
|
|
270
|
+
cd ..
|
|
271
|
+
|
|
272
|
+
# Astro worker (if it reads secrets at runtime)
|
|
273
|
+
printf 'your-key' | bun wrangler secret put MY_SECRET
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
**List / delete:**
|
|
277
|
+
```bash
|
|
278
|
+
bun wrangler secret list
|
|
279
|
+
bun wrangler secret delete <NAME>
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
---
|
|
283
|
+
|
|
284
|
+
## KV Namespaces
|
|
285
|
+
|
|
286
|
+
Shared across workers (same ID in all `wrangler.toml` files). Binding name: `KV`. Namespace ID: `1c1dac4766e54a2c85425022a3b1e9da`.
|
|
287
|
+
|
|
288
|
+
**Snapshots written by sync worker:** `paths.json`, `units.json`, `skills.json`, `highways.json`, `toxic.json` (FNV-1a hash-gated writes, skipped if unchanged).
|
|
289
|
+
|
|
290
|
+
```bash
|
|
291
|
+
# Read key
|
|
292
|
+
bun wrangler kv key get --binding=KV paths.json
|
|
293
|
+
|
|
294
|
+
# Write key
|
|
295
|
+
bun wrangler kv key put --binding=KV test "hello"
|
|
296
|
+
|
|
297
|
+
# Delete key
|
|
298
|
+
bun wrangler kv key delete --binding=KV test
|
|
299
|
+
|
|
300
|
+
# List all keys
|
|
301
|
+
bun wrangler kv key list --binding=KV --namespace-id=1c1dac4766e54a2c85425022a3b1e9da
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
---
|
|
305
|
+
|
|
306
|
+
## D1 Database
|
|
307
|
+
|
|
308
|
+
Database: `one`. ID: `0aa5fceb-667a-470e-b08c-40ead2f4525d`. Stores signals, messages, sync logs (not the brain — TypeDB is).
|
|
309
|
+
|
|
310
|
+
```bash
|
|
311
|
+
bun wrangler d1 execute one --remote --command="SELECT COUNT(*) FROM signals"
|
|
312
|
+
bun wrangler d1 execute one --remote --file=migrations/0010_payment_columns.sql
|
|
313
|
+
bun wrangler d1 export one --output=/tmp/one-backup.sql
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
New D1 tables need manual migration — `try/catch` in migration code won't save you (feedback memory).
|
|
317
|
+
|
|
318
|
+
---
|
|
319
|
+
|
|
320
|
+
## Custom Domains
|
|
321
|
+
|
|
322
|
+
### Bind via `wrangler.toml`
|
|
323
|
+
|
|
324
|
+
```toml
|
|
325
|
+
# api/wrangler.toml
|
|
326
|
+
[[routes]]
|
|
327
|
+
pattern = "api.one.ie"
|
|
328
|
+
custom_domain = true
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
### Bind via Dashboard
|
|
332
|
+
|
|
333
|
+
1. https://dash.cloudflare.com → Workers & Pages → (worker) → Settings → Triggers
|
|
334
|
+
2. Add Custom Domain → `dev.one.ie` → Save
|
|
335
|
+
3. DNS records auto-created; propagates in ~30s
|
|
336
|
+
|
|
337
|
+
### Astro worker custom domain (Cycle 3 cutover)
|
|
338
|
+
|
|
339
|
+
`dev.one.ie` CNAME currently points at Pages project. Flip to Workers in CF dashboard:
|
|
340
|
+
1. Remove `dev.one.ie` from `one-substrate` Pages project
|
|
341
|
+
2. Add `dev.one.ie` to Astro worker (Workers project)
|
|
342
|
+
3. TTL matters — note it, don't time the cut
|
|
343
|
+
|
|
344
|
+
---
|
|
345
|
+
|
|
346
|
+
## Pricing (2026-04)
|
|
347
|
+
|
|
348
|
+
| | Workers Free | Workers Paid ($5/mo) |
|
|
349
|
+
|---|---|---|
|
|
350
|
+
| Base | $0 | $5/mo per account |
|
|
351
|
+
| Requests | 100k/day | 10M/mo incl.; $0.30/M overage |
|
|
352
|
+
| CPU time | **10 ms** cap/invocation | 30M ms/mo incl.; $0.02/M ms; up to 30s default |
|
|
353
|
+
| Bandwidth | Unlimited, free | Unlimited, free |
|
|
354
|
+
| **Static asset requests** | **FREE, unlimited** | **FREE, unlimited** |
|
|
355
|
+
| Duration wall-clock | No charge | Same |
|
|
356
|
+
|
|
357
|
+
**Free-tier math for ONE:**
|
|
358
|
+
- 100k req/day = ~3M/mo before hitting cap
|
|
359
|
+
- Static assets from `[assets]` binding **don't count** against quota — pre-render everything you can
|
|
360
|
+
- 10 ms CPU is tight for cold SSR — aggressive KV caching + `prerender = true` keep us in
|
|
361
|
+
- Observability: 3-day log retention; 5B logs/day account cap (sampling kicks in beyond)
|
|
362
|
+
|
|
363
|
+
---
|
|
364
|
+
|
|
365
|
+
## Pages → Workers Migration State
|
|
366
|
+
|
|
367
|
+
**Status (2026-04-18):** Cycles 1-3 shipped on main. Cutover is live — `dev.one.ie` now serves from the `one-substrate` Worker; Pages project paused as rollback safety net. Cutover tool: `bun run cf-cutover` (dry-run) / `--execute` (commit). Script in `scripts/cf-cutover.ts`.
|
|
368
|
+
|
|
369
|
+
| | CF Pages (old) | CF Workers + Assets (new) |
|
|
370
|
+
|---|---|---|
|
|
371
|
+
| Free tier | same | same |
|
|
372
|
+
| `*.pages.dev` URL | ✓ | ✓ (preserved by CF across migration) |
|
|
373
|
+
| Bindings | ✓ | ✓ |
|
|
374
|
+
| Smart Placement | ✗ | ✓ |
|
|
375
|
+
| Tail logs | Limited | Full |
|
|
376
|
+
| `wrangler deploy` | ✗ (uses `pages deploy`) | ✓ |
|
|
377
|
+
| New CF features | ✗ (frozen) | ✓ |
|
|
378
|
+
|
|
379
|
+
Cycle 3 steps (dashboard):
|
|
380
|
+
1. Create Workers project for Astro SSR
|
|
381
|
+
2. Push main branch → Workers deploys
|
|
382
|
+
3. Move `dev.one.ie` custom domain from Pages → Workers
|
|
383
|
+
4. Pause Pages project (rollback window: 1 cycle)
|
|
384
|
+
5. Archive Pages project after no-traffic confirmed
|
|
385
|
+
|
|
386
|
+
---
|
|
387
|
+
|
|
388
|
+
## Monitoring Commands
|
|
389
|
+
|
|
390
|
+
### Live logs (one worker at a time)
|
|
391
|
+
|
|
392
|
+
```bash
|
|
393
|
+
cd api && bun wrangler tail && cd ..
|
|
394
|
+
cd sync && bun wrangler tail && cd ..
|
|
395
|
+
cd agents && bun wrangler tail && cd ..
|
|
396
|
+
bun wrangler tail --name=one-substrate
|
|
397
|
+
```
|
|
398
|
+
|
|
399
|
+
### Health checks
|
|
400
|
+
|
|
401
|
+
```bash
|
|
402
|
+
time curl -s https://api.one.ie/health -o /dev/null # expect <10ms
|
|
403
|
+
time curl -s https://dev.one.ie/ -o /dev/null # expect <500ms (Workers)
|
|
404
|
+
time curl -s https://nanoclaw.oneie.workers.dev/health -o /dev/null
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
### Deployment history
|
|
408
|
+
|
|
409
|
+
```bash
|
|
410
|
+
bun wrangler deployments list --name=one-gateway | head -10
|
|
411
|
+
bun wrangler deployments view <ID> --name=one-gateway
|
|
412
|
+
```
|
|
413
|
+
|
|
414
|
+
### Performance — TypeDB round-trip via gateway
|
|
415
|
+
|
|
416
|
+
```bash
|
|
417
|
+
time curl -X POST https://api.one.ie/typedb/query \
|
|
418
|
+
-H 'Content-Type: application/json' \
|
|
419
|
+
-d '{"query": "match $u isa actor; limit 1; select $u;", "transactionType": "read"}' \
|
|
420
|
+
-o /dev/null
|
|
421
|
+
```
|
|
422
|
+
|
|
423
|
+
Expected: gateway <10ms, full TypeDB query <100ms.
|
|
424
|
+
|
|
425
|
+
---
|
|
426
|
+
|
|
427
|
+
## Troubleshooting
|
|
428
|
+
|
|
429
|
+
### `Authentication failed (status: 400)`
|
|
430
|
+
|
|
431
|
+
```bash
|
|
432
|
+
echo $CLOUDFLARE_GLOBAL_API_KEY # should be 40 chars
|
|
433
|
+
echo $CLOUDFLARE_EMAIL
|
|
434
|
+
echo $CLOUDFLARE_ACCOUNT_ID # should be 32 hex chars
|
|
435
|
+
set -a && source .env && set +a # reload
|
|
436
|
+
```
|
|
437
|
+
|
|
438
|
+
### Slow worker startup (>400 ms)
|
|
439
|
+
|
|
440
|
+
Bundle too large. Check:
|
|
441
|
+
```bash
|
|
442
|
+
bun wrangler deploy --dry-run | grep "Total Upload"
|
|
443
|
+
```
|
|
444
|
+
>3 MiB needs trimming. For Astro worker, see `/astro` bundle rules.
|
|
445
|
+
|
|
446
|
+
### Gateway 502
|
|
447
|
+
|
|
448
|
+
TypeDB down or credentials wrong:
|
|
449
|
+
```bash
|
|
450
|
+
# Update TypeDB password
|
|
451
|
+
cd api && printf 'new-pw' | bun wrangler secret put TYPEDB_PASSWORD && cd ..
|
|
452
|
+
```
|
|
453
|
+
|
|
454
|
+
### Queue backed up (NanoClaw)
|
|
455
|
+
|
|
456
|
+
```bash
|
|
457
|
+
bun wrangler queues consumers list nanoclaw-agents
|
|
458
|
+
# No built-in purge — dashboard only, or drain via consumer
|
|
459
|
+
```
|
|
460
|
+
|
|
461
|
+
---
|
|
462
|
+
|
|
463
|
+
## GitHub Actions CI
|
|
464
|
+
|
|
465
|
+
Repo includes `.github/workflows/deploy.yml`.
|
|
466
|
+
|
|
467
|
+
**Required secrets** (Settings → Secrets → Actions):
|
|
468
|
+
|
|
469
|
+
| Secret | Value |
|
|
470
|
+
|---|---|
|
|
471
|
+
| `CLOUDFLARE_GLOBAL_API_KEY` | 40-char Global API Key from `.env` |
|
|
472
|
+
| `CLOUDFLARE_EMAIL` | `tony@one.ie` |
|
|
473
|
+
| `CLOUDFLARE_ACCOUNT_ID` | `627e0c7ccbe735a4a7cabf91e377bbad` |
|
|
474
|
+
|
|
475
|
+
**Do NOT set `CLOUDFLARE_API_TOKEN`** — workflow blanks it to force Global Key auth.
|
|
476
|
+
|
|
477
|
+
**Production gate** (Settings → Environments → `production`):
|
|
478
|
+
1. Deployment branches: `main` only
|
|
479
|
+
2. Required reviewers: add yourself (or team)
|
|
480
|
+
|
|
481
|
+
Behavior:
|
|
482
|
+
```
|
|
483
|
+
push feature/** → verify → deploy (auto-approved)
|
|
484
|
+
push main → verify → build → 🚦 reviewer → deploy
|
|
485
|
+
workflow_dispatch → manual trigger
|
|
486
|
+
```
|
|
487
|
+
|
|
488
|
+
---
|
|
489
|
+
|
|
490
|
+
## Reference
|
|
491
|
+
|
|
492
|
+
- `docs/cf-workers-migration-todo.md` — C1+C2+C3 shipped; cutover live on `dev.one.ie`
|
|
493
|
+
- `docs/deploy.md` — 8-step pipeline, bundle diagnosis, LOCKED rules
|
|
494
|
+
- `.claude/commands/deploy.md` — pipeline script + bundle rules + known-flaky + first-time setup (merged from skills/deploy.md 2026-04-19)
|
|
495
|
+
- [CF Workers Static Assets docs](https://developers.cloudflare.com/workers/static-assets/)
|
|
496
|
+
- [wrangler 4 configuration](https://developers.cloudflare.com/workers/wrangler/configuration/)
|
|
497
|
+
- [CF Workers framework guide — Astro](https://developers.cloudflare.com/workers/frameworks/framework-guides/astro/)
|
|
498
|
+
- Dashboard: https://dash.cloudflare.com/627e0c7ccbe735a4a7cabf91e377bbad
|
|
499
|
+
|
|
500
|
+
---
|
|
501
|
+
|
|
502
|
+
**Version:** 2.0.0 — Workers + Static Assets (2026-04-18)
|
|
503
|
+
**Previous:** 1.0.0 (CF Pages era)
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dev
|
|
3
|
+
description: Start the ONE Astro dev server in `one.ie/web/` — `bun run dev` on port 4321 with HMR + islands hydration. Use when the user asks to "run the app", "start the dev server", "see it live", or to verify a UI change before commit. Scope is `one.ie/web/` only — for `agents/`, `api/`, `sync/`, `backup/` Workers use /cloudflare.
|
|
4
|
+
user-invocable: true
|
|
5
|
+
allowed-tools: Bash
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Start Development Server
|
|
9
|
+
|
|
10
|
+
**Skills:** `/signal` (dev server hosts `/api/*` — every signal lands here first) · `/astro` (HMR + islands hydration in local mode)
|
|
11
|
+
|
|
12
|
+
Start the Astro dev server with hot module replacement.
|
|
13
|
+
|
|
14
|
+
## Command
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
cd /Users/toc/Server/one-ie/one.ie/web && bun run dev
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Expected Output
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
┃ Local http://localhost:4321/
|
|
24
|
+
┃ Network use --host to expose
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Features
|
|
28
|
+
|
|
29
|
+
- Hot Module Replacement (HMR)
|
|
30
|
+
- Fast refresh for React components
|
|
31
|
+
- TypeScript error overlay
|
|
32
|
+
- Tailwind CSS JIT compilation
|
|
33
|
+
|
|
34
|
+
## Common Tasks
|
|
35
|
+
|
|
36
|
+
### Check if server is running
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
lsof -i :4321
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Kill existing server
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
pkill -f "astro dev"
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Run on different port
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
bun dev -- --port 3000
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Expose to network
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
bun dev -- --host
|
|
58
|
+
```
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: /do lifecycle
|
|
3
|
+
description: The /do build lifecycle — idea to shipped feature. Covers the artifact spine (promise → spec → todo → code → tests → proof → docs → release), the W0-W4 BUILD engine, tier classifier (PATCH/FIX/FEATURE/SCHEMA), trust system, token economy, and the dependency graph for cross-cycle parallelism. Use when working on or extending the /do harness itself.
|
|
4
|
+
version: 2.0.0
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
The `/do` lifecycle harness lives in `commands/do.md`. See that file for the full contract.
|
|
8
|
+
|
|
9
|
+
Key files:
|
|
10
|
+
- `commands/do.md` — the lifecycle + BUILD engine
|
|
11
|
+
- `commands/do-autonomous.md` — autonomous loop mode
|
|
12
|
+
- `commands/do-show.md` — cycle frame rendering
|
|
13
|
+
- `commands/do-improve.md` — meta-improvement from drift signals
|
|
14
|
+
- `agents/w1-recon.md` — recon agent
|
|
15
|
+
- `agents/w2-decide.md` — decide agent
|
|
16
|
+
- `agents/w3-edit.md` — edit agent
|
|
17
|
+
- `agents/w4-verify.md` — verify agent
|
|
18
|
+
- `scripts/do-tier.sh` — tier + pruned spine + classifier + token ceiling
|
|
19
|
+
- `scripts/do-folder.sh` — folder-aware verify/build
|
|
20
|
+
- `scripts/do-survey.sh` — reuse verdict (expose/extend/build/drop)
|
|
21
|
+
- `scripts/do-analyze.sh` — spec↔todo coverage gate
|
|
22
|
+
- `scripts/do-prove.sh` — surface-detect proof
|
|
23
|
+
- `scripts/do-reconcile.sh` — substrate dim/verb/dead-name gate
|
|
24
|
+
- `scripts/do-smoke.sh` — deterministic outcome check
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: oneie
|
|
3
|
+
description: ONE substrate CLI + SDK + MCP toolkit — 17 verbs, 6 dimensions, launch handoff to agent-launch. Use when working on cli/, packages/sdk/, packages/mcp/, packages/templates/, or when the user mentions `oneie`, "dimension", "verb", "launch".
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# oneie
|
|
7
|
+
|
|
8
|
+
The substrate-wired CLI/SDK/MCP toolkit owned by this repo. Not to be confused with the legacy `../ONE/cli` (merged in) or `../agent-launch-toolkit` (strip-lifted).
|
|
9
|
+
|
|
10
|
+
## Layout
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
cli/ — oneie npm package (v3.6.40-next), ESM, node>=22
|
|
14
|
+
packages/sdk/ — @oneie/sdk (re-exports + launchToken handoff)
|
|
15
|
+
packages/mcp/ — @oneie/mcp (15 tools = 12 substrate + 3 discovery)
|
|
16
|
+
packages/templates/ — @oneie/templates (16 C-suite + marketing + service presets)
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Verbs (17)
|
|
20
|
+
|
|
21
|
+
| Category | Verbs |
|
|
22
|
+
|---|---|
|
|
23
|
+
| Substrate (12) | signal, ask, mark, warn, fade, select, recall, reveal, forget, frontier, know, highways |
|
|
24
|
+
| Deploy (4) | init, agent, deploy, claw, sync |
|
|
25
|
+
| Handoff (1) | launch (→ agent-launch) |
|
|
26
|
+
|
|
27
|
+
## The Boundary
|
|
28
|
+
|
|
29
|
+
**In scope:** the 6 dimensions, substrate learning, routing.
|
|
30
|
+
**Out of scope:** tokenize, buy, sell, holders, bonding curve, ERC-20, ethers, cosmjs. These live at [agent-launch](https://agent-launch.ai). `oneie launch` is the only call that crosses the boundary.
|
|
31
|
+
|
|
32
|
+
## When to use
|
|
33
|
+
|
|
34
|
+
- User asks about `oneie <verb>` — see `docs/cli-reference.md`
|
|
35
|
+
- User touches `packages/{sdk,mcp,templates}/` — see the per-package README
|
|
36
|
+
- User wants to mint a token for an agent — route to `oneie launch <uid> --dry-run`, then handoff docs
|
|
37
|
+
- User asks why buy/sell isn't in ONE — [launch-handoff.md](../../docs/launch-handoff.md) is the "why"
|
|
38
|
+
|
|
39
|
+
## Guardrails
|
|
40
|
+
|
|
41
|
+
**Never introduce:** `tokenize`, `buy`, `sell`, `holders`, `ERC-20`, `@cosmjs/*`, `ethers`, `bonding curve` code in `packages/` or `cli/src/commands/`. The `test-no-mint-code.mjs` smoke test enforces this.
|
|
42
|
+
|
|
43
|
+
**Always:** wrap HTTP calls in `cli/src/lib/http.ts`. Share arg parsing via `cli/src/lib/args.ts`. Use `@oneie/sdk` as the one place that knows how to talk to `api.one.ie`.
|
|
44
|
+
|
|
45
|
+
## See Also
|
|
46
|
+
|
|
47
|
+
- [cli-reference.md](../../docs/cli-reference.md)
|
|
48
|
+
- [sdk-reference.md](../../docs/sdk-reference.md)
|
|
49
|
+
- [mcp-tools.md](../../docs/mcp-tools.md)
|
|
50
|
+
- [launch-handoff.md](../../docs/launch-handoff.md)
|
|
51
|
+
- [copy-toolkit-todo.md](../../docs/copy-toolkit-todo.md) — the merge plan (3 cycles)
|