xiaoju
5a7f417899
feat: migrate examples to status-based routing + fix mustache HTML escape
...
- Migrate solve-issue.yaml, analyze-topic.yaml, debate.yaml to new format
- Add status enum field to all role frontmatter schemas
- Use {{{ }}} (triple mustache) for prompt templates with user content
- Disable mustache HTML escaping globally (prompts are plain text, not HTML)
- Add 2 new tests for HTML escape behavior
- 9 moderator tests pass
Phase 2 of #490 (closes #492 )
2026-05-25 04:52:53 +00:00
xiaoju
d00f9df2dd
refactor: status-based graph routing + mustache prompt templates
...
- Delete ConditionDefinition, Transition types from workflow-protocol
- Add Target type, change graph to Record<string, Record<string, Target>>
- Remove conditions from WorkflowPayload and WORKFLOW_SCHEMA
- Replace jsonata with mustache in workflow-moderator
- Rewrite evaluate() to simple map lookup + mustache render
- Update cli-workflow to use new 3-arg evaluate(graph, role, output)
- 296 tests pass, 0 fail
Phase 1 of #490 (closes #491 )
2026-05-25 04:50:06 +00:00
xiaoju
3d6399c0e3
feat: make edge prompt required (Phase 1)
...
- Transition.prompt: string | null → string
- EvaluateResult.prompt: string | null → string
- AgentContext.edgePrompt: string | null → string
- CLI YAML validation rejects missing prompt
- All tests updated
Phase 2 will replace edgePrompt === null checks with findLastRoleIndex.
Refs #405 , #406 , #404
2026-05-23 04:28:58 +00:00
xiaoju
638329a562
feat: edge prompt + session resume implementation ( #402 )
...
- buildContinuationPrompt: incremental prompt for role re-entry
- buildHermesPrompt: dual-mode (initial vs continuation)
- session-cache: thread:role → hermes sessionId mapping
- HermesAcpClient.resume(): session/resume JSON-RPC
- Fallback: cache miss or resume fail → initial prompt
- UWF_NO_RESUME env to skip cache
- solve-issue.yaml: reviewer→developer edge prompt
- Tests updated for EvaluateResult + continuation prompt
Refs #402
2026-05-23 03:57:04 +00:00
xiaoju
1a06e014f5
feat(protocol): add edge prompt to Transition + EvaluateResult ( #402 )
...
- Transition type gains prompt: string | null
- evaluate() returns EvaluateResult { role, prompt } instead of string
- normalizeGraph coerces prompt: undefined → null
- spawnAgent passes edge prompt via UWF_EDGE_PROMPT env
- AgentContext gains edgePrompt field
Refs #402
2026-05-23 03:49:15 +00:00
xiaoju
e5ae9a134c
feat: register $first/$last JSONata functions in moderator
...
Register custom $first(role) and $last(role) functions in the JSONata
evaluator. These search the steps array and return the matching role's
frontmatter (output) directly, replacing verbose steps[-1].output.x
expressions with semantic $last('role').field syntax.
- workflow-moderator: register functions via expr.registerFunction()
- Updated all condition expressions in .workflows/ and examples/
- Added tests for $last, $first, and unmatched role (undefined)
Fixes #376
2026-05-22 06:29:56 +00:00
xiaoju
a3114bf840
chore: apply biome formatting across codebase
2026-05-22 02:06:05 +00:00
xiaoju
7b9cb6a9c8
chore: rename uwf-* → workflow-*, cli-uwf → cli-workflow
...
Reclaim the workflow-* package names now that legacy packages are archived.
Package renames:
- @uncaged/uwf-protocol → @uncaged/workflow-protocol
- @uncaged/uwf-moderator → @uncaged/workflow-moderator
- @uncaged/uwf-agent-kit → @uncaged/workflow-agent-kit
- @uncaged/uwf-agent-hermes → @uncaged/workflow-agent-hermes
- @uncaged/cli-uwf → @uncaged/cli-workflow
All internal imports, tsconfig references, and docs updated.
CLI binary name 'uwf' unchanged.
小橘 🍊 (NEKO Team)
2026-05-19 07:52:16 +00:00