7 Commits

Author SHA1 Message Date
xiaoju e86bae8d4a refactor: migrate to Dynamic Workers — fix /run/{name} 404
Root cause: CF blocks Worker-to-Worker fetch on workers.dev (error 1042).
Gateway Worker could not proxy requests to child worker subdomains.

Fix: Replace CF API worker scripts with Dynamic Workers (LOADER binding).
- deploy() writes code to KV only, no CF API calls
- invoke() uses LOADER.get(id, fn) to execute code inline
- remove() clears KV only, no CF API delete
- Removed cf-api.ts, slot management, subdomain routing
- 67/67 tests passing, production verified

Reported-by: 小墨 🖊️ (KUMA)
小橘 🍊(NEKO Team)
2026-04-03 10:57:50 +00:00
xiaoju 9f0c303056 feat: pre-allocated slot pool — zero DNS latency
- Pre-create fixed Worker slots (s-slot-0, s-slot-1, s-slot-2)
- Deploy/page-in only updates slot code, no Worker create/delete
- Subdomain always active, zero DNS propagation delay
- Slot = physical page frame, capability = virtual page
- New endpoint: POST /_api/init-slots
- Clean up old dynamic Worker naming
- 73/73 tests pass
2026-04-03 10:37:47 +00:00
xiaoju 120e62d7e4 fix: restore missing KV route methods and getWorkerName helper
- Added back KvStore.getRoute/setRoute/deleteRoute methods
- Added back WorkerPool.getWorkerName() private method
- Fixed deploy() to properly set route.worker_name with prefix

Tests passing: 56/68 (82%)
2026-04-03 09:43:19 +00:00
xiaoju ce4c2b7b36 refactor: migrate from CF API worker scripts to Dynamic Workers — 小橘 🍊
- Added worker_loaders binding (LOADER) to wrangler.toml
- Updated WorkerPool to use LOADER.get() instead of CF API deploy/delete
- Removed subdomain-based invoke; now uses Dynamic Workers directly
- Cleaned up config.ts (removed SUBDOMAIN_SUFFIX, PAGE_RATE_LIMIT)
- Simplified cf-api.ts to legacy cleanup only (LegacyCfApi)
- Updated all tests to use createMockLoader instead of createMockCfApi
- Removed PageRateLimitError (no longer needed)
- All API endpoints unchanged; migration is internal implementation only
2026-04-03 09:41:13 +00:00
xiaoju c3f3b822f1 feat: embedding semantic search + MMR for explore
- Use CF Workers AI bge-base-en-v1.5 for embeddings
- Deploy stores capability embedding in KV
- Query uses cosine similarity (find) and MMR (explore)
- Query embedding cached in KV (1h TTL)
- Fallback to string matching for capabilities without embeddings
- Mock embedding service for unit tests
2026-04-03 08:16:27 +00:00
xiaoju 3705b158bb refactor: simplify to user-level shared capabilities
- Remove agent isolation (data sovereignty belongs to user, not agent)
- Capability naming: ping instead of xiaoju--ping
- Route: /run/{capability} instead of /{agent}/{capability}
- Auth: single deploy-token instead of per-agent tokens
- Delete S10 test (agent isolation no longer exists)
- Clean up old agent-prefixed workers
2026-04-03 05:49:20 +00:00
xiaoju f20b19a71e feat: implement Sigil Phase 1 MVP 🔮
- Wrangler project setup (TypeScript + Vitest)
- SigilBackend interface + WorkerPool implementation
- KV store with layered key schema (code/meta/lru/route/auth/stats)
- LRU scheduler with eviction priority (ephemeral_expired > ephemeral > normal > persistent)
- AuthModule: Bearer token validation, agent isolation, deploy cooldown
- Router: /_health, /_api/deploy, /_api/remove, /_api/list, /_api/inspect, /{agent}/{capability}
- 13 test scenarios, all passing (38 tests)
- MockKV + MockCfApi for isolated testing

Tests: 38/38  | Build: 22KB gzip:5KB 

小橘 🍊(NEKO Team)
2026-04-03 04:17:43 +00:00