xiaomo
56ec8cd401
Merge pull request 'refactor: reorganize gateway routes under /api/ prefix' ( #183 ) from feat/177-gateway-route-reorg into main
2026-05-11 08:01:02 +00:00
xingyue
b783027406
fix: remove stray lockfiles + refactor gateway auth with Hono group
...
- Remove root and workflow-gateway pnpm-lock.yaml (workspace mode)
- Replace startsWith auth skip with Hono route group
- Gateway management routes use GATEWAY_SECRET (per-route)
- /api/gateway/endpoints + /api/agents/* use dashboard auth
- No more global /api/* middleware with path-based exceptions
2026-05-11 15:59:42 +08:00
xingyue
93145cf08c
refactor: reorganize gateway routes under /api/ prefix ( closes #178 , closes #179 )
...
- Gateway management: /api/gateway/register, /api/gateway/endpoints
- Agent proxy: /api/agents/:agent/*
- /healthz stays at root (CF/k8s convention)
- Skip dashboard auth for gateway register routes
- Update CLI serve tunnel registration paths
- Update dashboard API client paths
Ref: #177
2026-05-11 15:48:13 +08:00
xiaoju
da6bcb10d6
feat(workflow): add declarative ModeratorTable type and migrate templates
...
Migrate workflow-template-develop and workflow-template-solve-issue
moderators to use the declarative ModeratorTable/tableToModerator
pattern. Update workflow-runtime re-exports and workflow-execute
engine to use renamed types.
Fixes #172
2026-05-11 06:25:39 +00:00
xiaoju
6fc97fc8c8
feat(workflow-protocol): add declarative moderator table types and tableToModerator
...
Add ModeratorCondition, FALLBACK, ModeratorTransition, ModeratorTable types
and tableToModerator converter function. Export from workflow-protocol and
re-export from workflow-runtime for backward compat.
Refs #172
2026-05-11 06:22:24 +00:00
xiaoju
93d9821f64
docs: update CLI skill with serve command, thread status, defaults, env vars
...
小橘 <xiaoju@shazhou.work >
2026-05-10 01:57:42 +00:00
xiaoju
29367cbe31
chore: remove stray bundle artifacts from repo
...
小橘 <xiaoju@shazhou.work >
2026-05-10 01:44:40 +00:00
xiaoju
ec397aecd3
chore: remove stray bundle artifacts from repo
...
小橘 <xiaoju@shazhou.work >
2026-05-10 01:42:18 +00:00
xiaoju
2e9d939f8e
fix: thread detail API returns correct status instead of source
...
小橘 <xiaoju@shazhou.work >
2026-05-10 01:39:09 +00:00
xiaoju
064a24f093
fix: no-ctl threads should be failed, not active
...
小橘 <xiaoju@shazhou.work >
2026-05-10 01:36:14 +00:00
xiaoju
fede623a82
dashboard: remove 'All agents' dropdown option, auto-select first agent
...
小橘 <xiaoju@shazhou.work >
2026-05-09 13:26:11 +00:00
xiaoju
2a52b930b9
chore: raise default maxRounds from 5 to 10 (CLI, matches API default)
...
小橘 <xiaoju@shazhou.work >
2026-05-09 13:17:57 +00:00
xiaoju
bf2f790e6e
fix: detect crashed threads even when .running marker is already gone
...
Check worker PID liveness as final fallback — if worker is dead
and thread has no __end__ node, it crashed.
小橘 <xiaoju@shazhou.work >
2026-05-09 12:52:39 +00:00
xiaoju
08a79b77db
fix: SSE sends 'done' event for non-running threads, frontend stops reconnecting
...
- routes-live: emit 'done' event before closing SSE for non-running threads
- use-sse: handle 'done' event — set completed, disconnect, stop reconnect
- Prevents 'Live' badge flash on failed/completed threads
小橘 <xiaoju@shazhou.work >
2026-05-09 12:49:20 +00:00
xiaoju
22a6200b69
fix: close SSE stream for non-running threads, fix Live badge
...
- routes-live: check .running marker before keeping SSE open;
if thread is not running, emit existing records and close
- thread-detail: only show Live badge when connected AND not completed
小橘 <xiaoju@shazhou.work >
2026-05-09 12:45:58 +00:00
xiaoju
7e7f6aa6d6
fix: detect crashed threads by checking worker PID liveness
...
When .running marker exists but no __end__ in CAS chain,
check if the worker process is actually alive. Dead PID
means the worker crashed without cleanup → status 'failed'.
Fixes #170
小橘 <xiaoju@shazhou.work >
2026-05-09 12:38:18 +00:00
xiaoju
d6fe3f844c
fix: detect crashed threads as failed instead of stuck running
...
- resolveThreadListStatus() checks CAS chain for __end__ node
- Stale .running markers no longer cause false 'running' status
- Distinguish 'failed' (returnCode != 0) from 'completed'
- Worker signal handlers (SIGINT/SIGTERM) clean up .running files
- listRunningThreads filters out terminated threads with stale markers
Fixes #170
小橘 <xiaoju@shazhou.work >
2026-05-09 12:28:33 +00:00
xiaoju
d0803019b5
feat: ephemeral agent token for serve ↔ gateway auth
...
- serve generates random UUID on startup
- registration sends agentToken to gateway, stored in KV
- gateway injects X-Agent-Token header when proxying to agent
- serve rejects /api/* requests without valid token
- healthz remains unauthenticated
- tunnel URL is now protected — direct access returns 401
小橘 <xiaoju@shazhou.work >
2026-05-09 12:05:10 +00:00
xiaoju
f16e7641fd
chore: add .env.production for dashboard gateway URL
...
小橘 <xiaoju@shazhou.work >
2026-05-09 11:58:51 +00:00
xiaoju
3b41625001
feat: dashboard API key authentication
...
- Gateway: DASHBOARD_API_KEY middleware on /endpoints and /api/* routes
- Dashboard: login page with key validation, stored in localStorage
- SSE: key passed as ?key= query param (EventSource can't set headers)
- Sidebar: logout button to clear key
Refs #169
小橘 <xiaoju@shazhou.work >
2026-05-09 11:56:25 +00:00
xiaoju
c602d2284b
fix(dashboard): pass content as children to ReactMarkdown
...
Self-closing <ReactMarkdown /> renders nothing — need children.
小橘 <xiaoju@shazhou.work >
2026-05-09 10:58:33 +00:00
xiaoju
d96e10b0fc
feat(dashboard): structured record rendering with markdown support ( #169 )
...
- API returns structured fields for thread-start (workflow, prompt, status)
and workflow-result (returnCode, content, timestamp)
- New RecordCard component renders by type:
- StartCard: workflow name badge + prompt blockquote
- RoleMessage: role-colored badges (preparer/agent/extractor) + markdown
- ResultCard: success/fail status badge + summary
- Added react-markdown + shiki for markdown rendering with syntax highlighting
- Replaces generic <pre> blocks with proper structured rendering
Refs #169
小橘 <xiaoju@shazhou.work >
2026-05-09 10:41:13 +00:00
xiaoju
8e36d3e1f5
fix: use getContentMerklePayload to extract prompt text
...
Was showing raw YAML of the CAS node instead of the payload string.
小橘 <xiaoju@shazhou.work >
2026-05-09 10:34:43 +00:00
xiaoju
bbe4fe0ed1
fix: include prompt text in thread-start record
...
Read prompt from StartNode refs[0] CAS blob and display it.
小橘 <xiaoju@shazhou.work >
2026-05-09 10:32:59 +00:00
xiaoju
e105c5cac1
fix: show workflow name instead of bundle hash in thread-start record
...
小橘 <xiaoju@shazhou.work >
2026-05-09 10:31:08 +00:00
xiaoju
578776fccf
fix: add standard fields to thread-start record
...
小橘 <xiaoju@shazhou.work >
2026-05-09 10:27:03 +00:00
xiaoju
cb756a999a
fix: normalize workflow-result records to match ThreadRecord shape
...
Both REST and SSE endpoints now return workflow-result with standard
fields (role, content, timestamp) instead of non-standard (summary).
Fixes 'Invalid Date' and empty content in dashboard.
小橘 <xiaoju@shazhou.work >
2026-05-09 10:24:48 +00:00
xiaoju
e0577ceefe
fix: add /api/healthz alias for gateway proxy health check
...
Gateway proxies /api/neko/healthz → /api/healthz on the agent,
but healthz was only on /healthz. Dashboard status bar showed
permanent Offline.
小橘 🍊 (NEKO Team)
2026-05-09 10:05:46 +00:00
xiaoju
024dd8c1e8
Merge pull request 'feat: auto-tunnel + CF Worker gateway + dashboard multi-agent' ( #168 ) from feat/164-cf-worker-gateway into main
2026-05-09 10:02:36 +00:00
xiaoju
9e98119145
feat: dashboard multi-agent support + CF Pages deploy
...
Phase C of #164 :
- Dashboard fetches agents from gateway /endpoints
- Sidebar shows agent selector with online/offline status
- All API calls routed through gateway /api/:agent/*
- Hash routing: #agent/threads/id format
- SSE live streaming via gateway proxy
- VITE_GATEWAY_URL env var for gateway configuration
- Deployed to CF Pages: workflow-dashboard-54r.pages.dev
- Custom domain: workflow.shazhou.work (pending SSL)
Ref: #164 , closes #167
小橘 🍊 (NEKO Team)
2026-05-09 10:01:27 +00:00
xiaoju
fd8943f131
feat: serve auto-tunnel + gateway registration
...
Phase B of #164 :
- serve --name <agent> starts cloudflared quick tunnel automatically
- Registers with CF Worker gateway, heartbeat every 60s
- Graceful unregister on SIGINT/SIGTERM
- --no-tunnel flag for local dev
- Default name from hostname
Ref: #164 , closes #166
小橘 🍊 (NEKO Team)
2026-05-09 09:53:08 +00:00
xiaoju
f7253d5948
feat: CF Worker API gateway with KV endpoint registry
...
Phase A of #164 :
- Hono-based CF Worker at workflow-gateway.shazhou.workers.dev
- POST /register — agent registration with shared secret
- DELETE /register/:name — unregister
- GET /endpoints — list online agents
- GET /api/:agent/* — proxy to agent tunnel URL
- KV-backed with TTL auto-expiry
Ref: #164 , closes #165
小橘 🍊 (NEKO Team)
2026-05-09 09:48:49 +00:00
xiaoju
1c5636c270
Merge pull request 'fix: content node refs field + backward compat' ( #163 ) from fix/161-162-cas-content-refs into main
2026-05-09 09:10:09 +00:00
xiaoju
ca0403c8ab
fix: content node refs field + thread head update
...
Fixes #161
Fixes #162
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-05-09 08:53:02 +00:00
xiaoju
aa25f55f63
fix: add workflow-protocol and workflow-util to bundle validator allowlist
...
小橘 <xiaoju@shazhou.work >
2026-05-09 08:36:39 +00:00
xiaoju
e29d1bf345
feat: Phase 5 — CLI + Dashboard CAS adaptation, cleanup .data.jsonl
...
- Align REST API contracts for Dashboard (threads list, detail, SSE)
- Add content resolution from CAS in thread show + API responses
- Rename dataWatcher → threadsJsonWatcher in SSE routes
- Update docs (CLAUDE.md, architecture.md, skill.ts) to reflect CAS storage
- Zero .data.jsonl code paths in production code
- All 166 tests pass, bun run check clean
Refs #155 , closes #160
小橘 <xiaoju@shazhou.work >
2026-05-09 08:16:04 +00:00
xiaoju
f3aedf8d6c
feat: Phase 4 — CAS-based fork + mark-and-sweep GC
...
- Rewrite fork to create StateNode pointing to fork point (zero duplication)
- Rewrite GC as mark-and-sweep: roots from threads.json + history, findReachableHashes via refs[]
- Remove .data.jsonl code paths
- Fix all 7 previously failing CLI tests
- New: gc-mark-sweep.test.ts verifying shared nodes survive GC
- All 166 tests pass
Refs #155 , closes #159
小橘 <xiaoju@shazhou.work >
2026-05-09 08:12:49 +00:00
xiaoju
26cf51366f
feat: Phase 3 — engine read path + runtime context builder
...
- Add buildThreadContext(headHash, cas) to workflow-runtime
- Expand extract phase to return { meta, contentPayload, refs[] }
- Add parseCasThreadNode() to workflow-cas for node type parsing
- Update createWorkflow to write ContentMerkleNode with artifact refs
- Tests: 4 pass (build-context + extract-refs)
- Biome format pass on all files
Refs #155 , closes #158
小橘 <xiaoju@shazhou.work >
2026-05-09 08:00:24 +00:00
xiaoju
81c582ae0e
feat: Phase 2 — engine write path (CAS nodes + threads.json)
...
- Engine writes StartNode, StateNode, ContentMerkleNode as CAS blobs
- threads.json tracks active threads, completed → history/{date}.jsonl
- No more .data.jsonl writes
- ancestors skip-list: [parent, ...parentAncestors] capped at 11
- Tests: 4 pass (engine write path)
Refs #155 , closes #157
小橘 <xiaoju@shazhou.work >
2026-05-09 07:53:44 +00:00
xiaoju
6f000512d2
feat: Phase 1 — CAS thread storage types + helpers
...
- Add StartNode, StateNode, ContentMerkleNode types to workflow-protocol
- Add collectRefs() to workflow-cas — extracts CAS hashes from StateNode payload
- Add findReachableHashes() to workflow-cas — recursive mark traversal via refs[]
- Tests: 7 pass (collect-refs + reachable)
Refs #155 , closes #156
小橘 <xiaoju@shazhou.work >
2026-05-09 07:30:47 +00:00
xiaoju
8f78a00063
docs: RFC v3 — named payload fields, refs as GC index, merge parent+ancestors
...
- payload is source of truth with named fields (start, content, ancestors, compact)
- refs[] auto-derived by collectRefs(), pure GC index
- parent merged into ancestors[0]
小橘 <xiaoju@shazhou.work >
2026-05-09 07:12:29 +00:00
xiaoju
6c2a137aef
docs: update CAS thread storage RFC
...
- StartNode prompt via refs[0] instead of inline
- threads.json active-only, completed → history/{date}.jsonl
- Content Merkle node carries role artifact refs
- Extract phase expanded to produce refs[]
小橘 <xiaoju@shazhou.work >
2026-05-09 07:08:10 +00:00
xiaoju
6cd856ca99
docs: add RFC for CAS-based thread storage
...
小橘 <xiaoju@shazhou.work >
2026-05-09 06:34:24 +00:00
xiaoju
064696c558
docs: update architecture docs and package READMEs for post-split structure
...
- Rewrite docs/architecture.md with 15-package map, dependency graph, updated engine paths
- Update CLAUDE.md monorepo structure section
- Add READMEs for: workflow-protocol, workflow-runtime, workflow-util, workflow-cas, workflow-register, workflow-execute, workflow-reactor
- Fix agent READMEs: update deps from @uncaged/workflow to actual packages
- Mark workflow-as-agent plan as outdated
Fixes #153
小橘 <xiaoju@shazhou.work >
2026-05-09 04:39:57 +00:00
xiaoju
0f28e9b61a
refactor: remove non-index re-exports
...
Remove re-exports from non-index files to enforce folder module discipline:
- workflow-agent-hermes: remove buildAgentPrompt re-export
- workflow-agent-cursor: remove buildAgentPrompt re-export
- cli-workflow/cli-dispatch: remove CommandEntry/CommandGroup/DispatchFn/getCommandRegistry re-exports
小橘 <xiaoju@shazhou.work >
2026-05-09 04:19:49 +00:00
xiaoju
1ea56009a2
Merge pull request 'chore: rename dashboard folder' ( #152 ) from chore/rename-dashboard-folder into main
2026-05-09 03:59:32 +00:00
xiaoju
6cc2481a16
chore: remove accidental pnpm-lock.yaml
2026-05-09 03:58:30 +00:00
xiaoju
44018bd17d
chore: rename packages/dashboard → packages/workflow-dashboard
...
Align folder name with package name @uncaged/workflow-dashboard,
consistent with all other packages in the monorepo.
2026-05-09 03:57:49 +00:00
xingyue
28c35bb3e0
Merge pull request 'refactor: 七包拆分 — protocol / runtime / util / cas / reactor / register / execute' ( #151 ) from refactor/143-split-packages into main
2026-05-09 03:53:54 +00:00
xiaoju
b8b557baf6
fix: migrate template test imports from @uncaged/workflow to new packages
...
小橘 🍊 (NEKO Team)
2026-05-09 03:51:48 +00:00