@enderfga/claw-orchestrator 3.7.1 → 4.0.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/README.md +19 -3
- package/dist/bin/cli.js +30 -7
- package/dist/bin/cli.js.map +1 -1
- package/dist/src/autoloop/messages.d.ts +0 -2
- package/dist/src/autoloop/messages.js +0 -2
- package/dist/src/autoloop/messages.js.map +1 -1
- package/dist/src/autoloop/planner-tools.d.ts +3 -3
- package/dist/src/autoloop/planner-tools.js +3 -3
- package/dist/src/autoloop/runner.d.ts +1 -2
- package/dist/src/autoloop/runner.js +1 -2
- package/dist/src/autoloop/runner.js.map +1 -1
- package/dist/src/autoloop/types.d.ts +0 -2
- package/dist/src/autoloop/types.js +0 -2
- package/dist/src/autoloop/types.js.map +1 -1
- package/dist/src/council.js +1 -0
- package/dist/src/council.js.map +1 -1
- package/dist/src/dashboard/index.html +709 -8
- package/dist/src/embedded-server.js +172 -6
- package/dist/src/embedded-server.js.map +1 -1
- package/dist/src/index.js +222 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/session-manager.d.ts +82 -1
- package/dist/src/session-manager.js +262 -5
- package/dist/src/session-manager.js.map +1 -1
- package/dist/src/ultraapp/build-events.d.ts +46 -0
- package/dist/src/ultraapp/build-events.js +6 -0
- package/dist/src/ultraapp/build-events.js.map +1 -0
- package/dist/src/ultraapp/build.d.ts +39 -0
- package/dist/src/ultraapp/build.js +111 -0
- package/dist/src/ultraapp/build.js.map +1 -0
- package/dist/src/ultraapp/conventions.d.ts +8 -0
- package/dist/src/ultraapp/conventions.js +248 -0
- package/dist/src/ultraapp/conventions.js.map +1 -0
- package/dist/src/ultraapp/council-adapter.d.ts +49 -0
- package/dist/src/ultraapp/council-adapter.js +152 -0
- package/dist/src/ultraapp/council-adapter.js.map +1 -0
- package/dist/src/ultraapp/deploy.d.ts +45 -0
- package/dist/src/ultraapp/deploy.js +82 -0
- package/dist/src/ultraapp/deploy.js.map +1 -0
- package/dist/src/ultraapp/diff-apply.d.ts +15 -0
- package/dist/src/ultraapp/diff-apply.js +48 -0
- package/dist/src/ultraapp/diff-apply.js.map +1 -0
- package/dist/src/ultraapp/docker.d.ts +57 -0
- package/dist/src/ultraapp/docker.js +83 -0
- package/dist/src/ultraapp/docker.js.map +1 -0
- package/dist/src/ultraapp/feedback-classifier.d.ts +24 -0
- package/dist/src/ultraapp/feedback-classifier.js +85 -0
- package/dist/src/ultraapp/feedback-classifier.js.map +1 -0
- package/dist/src/ultraapp/files.d.ts +24 -0
- package/dist/src/ultraapp/files.js +79 -0
- package/dist/src/ultraapp/files.js.map +1 -0
- package/dist/src/ultraapp/fix-on-failure-session.d.ts +23 -0
- package/dist/src/ultraapp/fix-on-failure-session.js +48 -0
- package/dist/src/ultraapp/fix-on-failure-session.js.map +1 -0
- package/dist/src/ultraapp/fix-on-failure.d.ts +39 -0
- package/dist/src/ultraapp/fix-on-failure.js +69 -0
- package/dist/src/ultraapp/fix-on-failure.js.map +1 -0
- package/dist/src/ultraapp/host-strategy.d.ts +57 -0
- package/dist/src/ultraapp/host-strategy.js +205 -0
- package/dist/src/ultraapp/host-strategy.js.map +1 -0
- package/dist/src/ultraapp/interview-parser.d.ts +41 -0
- package/dist/src/ultraapp/interview-parser.js +83 -0
- package/dist/src/ultraapp/interview-parser.js.map +1 -0
- package/dist/src/ultraapp/interview-tools.d.ts +16 -0
- package/dist/src/ultraapp/interview-tools.js +36 -0
- package/dist/src/ultraapp/interview-tools.js.map +1 -0
- package/dist/src/ultraapp/json-patch.d.ts +6 -0
- package/dist/src/ultraapp/json-patch.js +78 -0
- package/dist/src/ultraapp/json-patch.js.map +1 -0
- package/dist/src/ultraapp/lifecycle.d.ts +38 -0
- package/dist/src/ultraapp/lifecycle.js +31 -0
- package/dist/src/ultraapp/lifecycle.js.map +1 -0
- package/dist/src/ultraapp/manager.d.ts +141 -0
- package/dist/src/ultraapp/manager.js +661 -0
- package/dist/src/ultraapp/manager.js.map +1 -0
- package/dist/src/ultraapp/narrator-prompt.d.ts +10 -0
- package/dist/src/ultraapp/narrator-prompt.js +54 -0
- package/dist/src/ultraapp/narrator-prompt.js.map +1 -0
- package/dist/src/ultraapp/narrator.d.ts +49 -0
- package/dist/src/ultraapp/narrator.js +83 -0
- package/dist/src/ultraapp/narrator.js.map +1 -0
- package/dist/src/ultraapp/patcher.d.ts +35 -0
- package/dist/src/ultraapp/patcher.js +159 -0
- package/dist/src/ultraapp/patcher.js.map +1 -0
- package/dist/src/ultraapp/router.d.ts +39 -0
- package/dist/src/ultraapp/router.js +139 -0
- package/dist/src/ultraapp/router.js.map +1 -0
- package/dist/src/ultraapp/spec-delta.d.ts +18 -0
- package/dist/src/ultraapp/spec-delta.js +35 -0
- package/dist/src/ultraapp/spec-delta.js.map +1 -0
- package/dist/src/ultraapp/spec.d.ts +82 -0
- package/dist/src/ultraapp/spec.js +125 -0
- package/dist/src/ultraapp/spec.js.map +1 -0
- package/dist/src/ultraapp/store.d.ts +67 -0
- package/dist/src/ultraapp/store.js +177 -0
- package/dist/src/ultraapp/store.js.map +1 -0
- package/dist/src/ultraapp/versions.d.ts +50 -0
- package/dist/src/ultraapp/versions.js +65 -0
- package/dist/src/ultraapp/versions.js.map +1 -0
- package/openclaw.plugin.json +15 -1
- package/package.json +3 -1
- package/skills/SKILL.md +2 -2
- package/skills/references/autoloop.md +1 -1
- package/skills/references/mcp.md +2 -2
- package/skills/references/tools.md +183 -0
- package/skills/references/ultraapp.md +203 -0
- package/skills/ultraapp/SKILL.md +112 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"versions.js","sourceRoot":"","sources":["../../../src/ultraapp/versions.ts"],"names":[],"mappings":"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"}
|
package/openclaw.plugin.json
CHANGED
|
@@ -98,7 +98,21 @@
|
|
|
98
98
|
"ultraplan_start",
|
|
99
99
|
"ultraplan_status",
|
|
100
100
|
"ultrareview_start",
|
|
101
|
-
"ultrareview_status"
|
|
101
|
+
"ultrareview_status",
|
|
102
|
+
"ultraapp_list",
|
|
103
|
+
"ultraapp_get",
|
|
104
|
+
"ultraapp_status",
|
|
105
|
+
"ultraapp_new",
|
|
106
|
+
"ultraapp_answer",
|
|
107
|
+
"ultraapp_add_file",
|
|
108
|
+
"ultraapp_spec_edit",
|
|
109
|
+
"ultraapp_build_start",
|
|
110
|
+
"ultraapp_build_cancel",
|
|
111
|
+
"ultraapp_feedback",
|
|
112
|
+
"ultraapp_promote_version",
|
|
113
|
+
"ultraapp_start_container",
|
|
114
|
+
"ultraapp_stop_container",
|
|
115
|
+
"ultraapp_delete"
|
|
102
116
|
]
|
|
103
117
|
},
|
|
104
118
|
"skills": ["skills/SKILL.md"]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@enderfga/claw-orchestrator",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "Claw Orchestrator — run Claude Code, Codex, Gemini, Cursor Agent, OpenCode and custom coding CLIs as one unified runtime. Drop into Hermes Agent, Claude Desktop, Cursor, Cline, Continue, Zed, Windsurf, Goose or any Model Context Protocol (MCP) host, install as an OpenClaw plugin, or run standalone. Persistent sessions, multi-agent council, ultraplan, ultrareview, autoloop, tool orchestration.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/src/index.js",
|
|
@@ -92,6 +92,7 @@
|
|
|
92
92
|
"dependencies": {
|
|
93
93
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
94
94
|
"commander": "^12.1.0",
|
|
95
|
+
"diff": "^9.0.0",
|
|
95
96
|
"re2": "^1.24.0"
|
|
96
97
|
},
|
|
97
98
|
"peerDependencies": {
|
|
@@ -99,6 +100,7 @@
|
|
|
99
100
|
},
|
|
100
101
|
"devDependencies": {
|
|
101
102
|
"@eslint/js": "^9.15.0",
|
|
103
|
+
"@types/diff": "^7.0.2",
|
|
102
104
|
"@types/node": "^22.10.0",
|
|
103
105
|
"@vitest/coverage-v8": "^3.1.0",
|
|
104
106
|
"eslint": "^9.15.0",
|
package/skills/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: claw-orchestrator
|
|
3
|
-
description: Manage persistent coding sessions across Claude Code, Codex, Gemini, Cursor, and OpenCode engines. Use when orchestrating multi-engine coding agents, starting/sending/stopping sessions, running multi-agent council collaborations, cross-session messaging, ultraplan deep planning, ultrareview parallel code review, autoloop autonomous workspace iteration, switching models/tools at runtime, or exposing the orchestrator's
|
|
3
|
+
description: Manage persistent coding sessions across Claude Code, Codex, Gemini, Cursor, and OpenCode engines. Use when orchestrating multi-engine coding agents, starting/sending/stopping sessions, running multi-agent council collaborations, cross-session messaging, ultraplan deep planning, ultrareview parallel code review, autoloop autonomous workspace iteration, ultraapp building deployable web apps from a structured Q&A interview, switching models/tools at runtime, or exposing the orchestrator's 55 tools as an MCP server to Hermes Agent / Claude Desktop / Cursor / Cline / Continue / Zed / Windsurf / Goose. Triggers on "start a session", "send to session", "run council", "ultraplan", "ultrareview", "autoloop", "ultraapp", "Forge tab", "build a web app", "one-click app", "AppSpec", "autonomous iteration", "iterate until goal", "deep paper review", "auto research", "switch model", "multi-agent", "coding session", "session inbox", "cursor agent", "opencode", "mcp server", "clawo-mcp", "hermes mcp", "model context protocol".
|
|
4
4
|
metadata:
|
|
5
5
|
{
|
|
6
6
|
"openclaw":
|
|
@@ -43,7 +43,7 @@ metadata:
|
|
|
43
43
|
|
|
44
44
|
# Claw Orchestrator Skill
|
|
45
45
|
|
|
46
|
-
Claw Orchestrator — persistent multi-engine coding session manager for claw-style agent systems. Runs as a standalone CLI/server, with first-class OpenClaw plugin support. Wraps Claude Code, Codex, Gemini, Cursor Agent, OpenCode, and custom CLIs into headless agentic engines with
|
|
46
|
+
Claw Orchestrator — persistent multi-engine coding session manager for claw-style agent systems. Runs as a standalone CLI/server, with first-class OpenClaw plugin support. Wraps Claude Code, Codex, Gemini, Cursor Agent, OpenCode, and custom CLIs into headless agentic engines with 55 tools.
|
|
47
47
|
|
|
48
48
|
## Engine Quick Reference
|
|
49
49
|
|
|
@@ -5,7 +5,7 @@ the **Planner** to design a plan; on your approval, the Planner spawns the
|
|
|
5
5
|
**Coder** + **Reviewer** subloop, monitors it, and pushes you (wechat →
|
|
6
6
|
whatsapp → email fallback chain) only when something needs your attention.
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
This page is the operator reference.
|
|
9
9
|
|
|
10
10
|
## When to use
|
|
11
11
|
|
package/skills/references/mcp.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# MCP integration
|
|
2
2
|
|
|
3
|
-
Claw Orchestrator ships a Model Context Protocol (MCP) server (`clawo-mcp`) so any MCP-compatible host can drive its
|
|
3
|
+
Claw Orchestrator ships a Model Context Protocol (MCP) server (`clawo-mcp`) so any MCP-compatible host can drive its 55 tools.
|
|
4
4
|
|
|
5
5
|
This document covers:
|
|
6
6
|
|
|
@@ -229,7 +229,7 @@ The engines themselves (`claude`, `codex`, `gemini`, `agent`, `opencode`) must a
|
|
|
229
229
|
|
|
230
230
|
## Tool filtering
|
|
231
231
|
|
|
232
|
-
|
|
232
|
+
55 tools is a lot for a small context window. Reduce noise either at the host level (most hosts have an `include` / `exclude` filter — see Hermes example above) or at the server level via `CLAWO_MCP_TOOLS`:
|
|
233
233
|
|
|
234
234
|
```bash
|
|
235
235
|
CLAWO_MCP_TOOLS="session_start,session_send,session_stop,council_start,council_status" clawo-mcp
|
|
@@ -414,3 +414,186 @@ Get status and findings when completed.
|
|
|
414
414
|
| Parameter | Type | Required |
|
|
415
415
|
|-----------|------|----------|
|
|
416
416
|
| `id` | string | yes |
|
|
417
|
+
|
|
418
|
+
---
|
|
419
|
+
|
|
420
|
+
## Autoloop (6)
|
|
421
|
+
|
|
422
|
+
Three-agent autonomous iteration loop (Planner / Coder / Reviewer) over a git workspace. See [`autoloop.md`](./autoloop.md) for the operator reference (push policy, ledger layout, smoke test).
|
|
423
|
+
|
|
424
|
+
### `autoloop_start`
|
|
425
|
+
|
|
426
|
+
Start an autoloop run. Planner is created persistent; Coder + Reviewer are spawned by the Planner once `plan.md` is ready.
|
|
427
|
+
|
|
428
|
+
| Parameter | Type | Required | Description |
|
|
429
|
+
|-----------|------|----------|-------------|
|
|
430
|
+
| `cwd` | string | yes | Workspace (must be a git repo) |
|
|
431
|
+
| `goal` | string | yes | High-level user goal in natural language |
|
|
432
|
+
| `model` | string | | Planner model (default Opus) |
|
|
433
|
+
| `coderModel` | string | | Coder subagent model |
|
|
434
|
+
| `reviewerModel` | string | | Reviewer subagent model |
|
|
435
|
+
| `maxIters` | number | | Cap on Coder/Reviewer rounds (default 50) |
|
|
436
|
+
| `pushChannels` | string[] | | Notification channels (`wechat`, `whatsapp`, `email`) |
|
|
437
|
+
|
|
438
|
+
### `autoloop_chat`
|
|
439
|
+
|
|
440
|
+
Send a message into the Planner conversation (e.g. answer a clarifying question, refine the plan, kick off the subloop).
|
|
441
|
+
|
|
442
|
+
| Parameter | Type | Required |
|
|
443
|
+
|-----------|------|----------|
|
|
444
|
+
| `id` | string | yes |
|
|
445
|
+
| `message` | string | yes |
|
|
446
|
+
|
|
447
|
+
### `autoloop_status`
|
|
448
|
+
|
|
449
|
+
Get current state, phase, recent inbox messages, and ledger summary.
|
|
450
|
+
|
|
451
|
+
| Parameter | Type | Required |
|
|
452
|
+
|-----------|------|----------|
|
|
453
|
+
| `id` | string | yes |
|
|
454
|
+
|
|
455
|
+
### `autoloop_list`
|
|
456
|
+
|
|
457
|
+
List active and recent autoloop runs (in-memory + on-disk registry, deduped by run_id).
|
|
458
|
+
|
|
459
|
+
(no params)
|
|
460
|
+
|
|
461
|
+
### `autoloop_reset_agent`
|
|
462
|
+
|
|
463
|
+
Reset one of the subagent sessions (Coder or Reviewer) without losing Planner state — useful when a subagent loops on a stale belief.
|
|
464
|
+
|
|
465
|
+
| Parameter | Type | Required | Description |
|
|
466
|
+
|-----------|------|----------|-------------|
|
|
467
|
+
| `id` | string | yes | Run id |
|
|
468
|
+
| `agent` | `'coder'` \| `'reviewer'` | yes | Which subagent to reset |
|
|
469
|
+
|
|
470
|
+
### `autoloop_stop`
|
|
471
|
+
|
|
472
|
+
Terminate the run. All sessions are stopped and ledger state is finalised.
|
|
473
|
+
|
|
474
|
+
| Parameter | Type | Required |
|
|
475
|
+
|-----------|------|----------|
|
|
476
|
+
| `id` | string | yes |
|
|
477
|
+
|
|
478
|
+
---
|
|
479
|
+
|
|
480
|
+
## Ultraapp (14)
|
|
481
|
+
|
|
482
|
+
Forge tab — turn a structured Q&A interview into a deployed web app reachable at `localhost:19000/forge/<slug>/`. See [`ultraapp.md`](./ultraapp.md) for the operator reference (lifecycle, conventions §1–§7, runtime modes, file layout, HTTP routes).
|
|
483
|
+
|
|
484
|
+
### `ultraapp_list`
|
|
485
|
+
|
|
486
|
+
List all ultraapp runs.
|
|
487
|
+
|
|
488
|
+
(no params)
|
|
489
|
+
|
|
490
|
+
### `ultraapp_get`
|
|
491
|
+
|
|
492
|
+
Full snapshot of a run: spec + chat + state.
|
|
493
|
+
|
|
494
|
+
| Parameter | Type | Required |
|
|
495
|
+
|-----------|------|----------|
|
|
496
|
+
| `id` | string | yes |
|
|
497
|
+
|
|
498
|
+
### `ultraapp_status`
|
|
499
|
+
|
|
500
|
+
Lightweight status (mode + timestamps).
|
|
501
|
+
|
|
502
|
+
| Parameter | Type | Required |
|
|
503
|
+
|-----------|------|----------|
|
|
504
|
+
| `id` | string | yes |
|
|
505
|
+
|
|
506
|
+
### `ultraapp_new`
|
|
507
|
+
|
|
508
|
+
Create a fresh run. Optionally seeds the interview with the user's first message.
|
|
509
|
+
|
|
510
|
+
| Parameter | Type | Required | Description |
|
|
511
|
+
|-----------|------|----------|-------------|
|
|
512
|
+
| `firstMessage` | string | | Free-form opening line; the interview Opus reads it before its first question |
|
|
513
|
+
|
|
514
|
+
### `ultraapp_answer`
|
|
515
|
+
|
|
516
|
+
Submit an answer to the current interview question.
|
|
517
|
+
|
|
518
|
+
| Parameter | Type | Required | Description |
|
|
519
|
+
|-----------|------|----------|-------------|
|
|
520
|
+
| `id` | string | yes | Run id |
|
|
521
|
+
| `value` | string | yes | One of the question's `options[].value`, or `''` when using freeform |
|
|
522
|
+
| `freeform` | string | | Free-form text when none of the options fit |
|
|
523
|
+
|
|
524
|
+
### `ultraapp_add_file`
|
|
525
|
+
|
|
526
|
+
Upload a sample file to `examples/` (the interview engine will `extract_metadata` it).
|
|
527
|
+
|
|
528
|
+
| Parameter | Type | Required |
|
|
529
|
+
|-----------|------|----------|
|
|
530
|
+
| `id` | string | yes |
|
|
531
|
+
| `path` | string | yes |
|
|
532
|
+
| `content` | string \| Buffer | yes |
|
|
533
|
+
|
|
534
|
+
### `ultraapp_spec_edit`
|
|
535
|
+
|
|
536
|
+
Apply RFC 6902 JSON Patch ops to the AppSpec mid-interview.
|
|
537
|
+
|
|
538
|
+
| Parameter | Type | Required |
|
|
539
|
+
|-----------|------|----------|
|
|
540
|
+
| `id` | string | yes |
|
|
541
|
+
| `patch` | object[] | yes |
|
|
542
|
+
|
|
543
|
+
### `ultraapp_build_start`
|
|
544
|
+
|
|
545
|
+
Validate the spec strictly (shape + cross-refs + DAG) and enqueue the build. Council picks it up FIFO.
|
|
546
|
+
|
|
547
|
+
| Parameter | Type | Required |
|
|
548
|
+
|-----------|------|----------|
|
|
549
|
+
| `id` | string | yes |
|
|
550
|
+
|
|
551
|
+
### `ultraapp_build_cancel`
|
|
552
|
+
|
|
553
|
+
Abort an active build. Council sessions are stopped and the worktrees are left as-is for inspection.
|
|
554
|
+
|
|
555
|
+
| Parameter | Type | Required |
|
|
556
|
+
|-----------|------|----------|
|
|
557
|
+
| `id` | string | yes |
|
|
558
|
+
|
|
559
|
+
### `ultraapp_feedback`
|
|
560
|
+
|
|
561
|
+
Done-mode feedback. Haiku classifier routes into `cosmetic` (Opus patcher), `spec-delta` (focused interview + auto-rerun), or `structural` (suggest fresh run).
|
|
562
|
+
|
|
563
|
+
| Parameter | Type | Required | Description |
|
|
564
|
+
|-----------|------|----------|-------------|
|
|
565
|
+
| `id` | string | yes | Run id |
|
|
566
|
+
| `text` | string | yes | The feedback (1+ chars) |
|
|
567
|
+
|
|
568
|
+
### `ultraapp_promote_version`
|
|
569
|
+
|
|
570
|
+
Atomically swap the deployed version. Stops the current container/process, starts the target's, updates the router map.
|
|
571
|
+
|
|
572
|
+
| Parameter | Type | Required | Description |
|
|
573
|
+
|-----------|------|----------|-------------|
|
|
574
|
+
| `id` | string | yes | Run id |
|
|
575
|
+
| `version` | string | yes | Target version label (`v1`, `v2`, …) |
|
|
576
|
+
|
|
577
|
+
### `ultraapp_start_container`
|
|
578
|
+
|
|
579
|
+
Start the container/process for the active version (no-op if already running).
|
|
580
|
+
|
|
581
|
+
| Parameter | Type | Required |
|
|
582
|
+
|-----------|------|----------|
|
|
583
|
+
| `id` | string | yes |
|
|
584
|
+
|
|
585
|
+
### `ultraapp_stop_container`
|
|
586
|
+
|
|
587
|
+
Stop the container/process without deleting any state.
|
|
588
|
+
|
|
589
|
+
| Parameter | Type | Required |
|
|
590
|
+
|-----------|------|----------|
|
|
591
|
+
| `id` | string | yes |
|
|
592
|
+
|
|
593
|
+
### `ultraapp_delete`
|
|
594
|
+
|
|
595
|
+
Stop + remove the run completely (sessions, container, on-disk state, router entry).
|
|
596
|
+
|
|
597
|
+
| Parameter | Type | Required |
|
|
598
|
+
|-----------|------|----------|
|
|
599
|
+
| `id` | string | yes |
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
# ultraapp — Reference
|
|
2
|
+
|
|
3
|
+
Turn a structured Q&A interview into a deployed web app reachable at
|
|
4
|
+
`localhost:19000/forge/<slug>/`. The dashboard's **Forge** tab and a
|
|
5
|
+
14-tool MCP surface drive the end-to-end loop: interview → 3-agent
|
|
6
|
+
council → fix-on-failure → deploy → done-mode feedback.
|
|
7
|
+
|
|
8
|
+
This page is the operator reference. The interview behavioural contract
|
|
9
|
+
lives in [`skills/ultraapp/SKILL.md`](../ultraapp/SKILL.md). The
|
|
10
|
+
council architectural conventions every generated app must satisfy live
|
|
11
|
+
in [`src/ultraapp/conventions.ts`](../../src/ultraapp/conventions.ts).
|
|
12
|
+
|
|
13
|
+
## When to use
|
|
14
|
+
|
|
15
|
+
- You have a workflow in your head (or a sample input file) and want a
|
|
16
|
+
shareable web app for it without writing code.
|
|
17
|
+
- You want to iterate cosmetically on a deployed app via chat ("make
|
|
18
|
+
the button green", "shrink the hero h1") without touching the
|
|
19
|
+
codebase yourself.
|
|
20
|
+
- You want to evolve the AppSpec ("also output a thumbnail") and
|
|
21
|
+
rebuild without restarting the interview.
|
|
22
|
+
|
|
23
|
+
## Lifecycle
|
|
24
|
+
|
|
25
|
+
```text
|
|
26
|
+
interview ─► queued ─► building ─► build-complete ─► deploying ─► done
|
|
27
|
+
│
|
|
28
|
+
▼
|
|
29
|
+
done-mode chat
|
|
30
|
+
(cosmetic /
|
|
31
|
+
spec-delta /
|
|
32
|
+
structural)
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
| Mode | Meaning |
|
|
36
|
+
|------|---------|
|
|
37
|
+
| `interview` | AppSpec being filled by Q&A. Chat input goes to the interview Opus. |
|
|
38
|
+
| `queued` | Build accepted, waiting for a slot in the FIFO build queue. |
|
|
39
|
+
| `building` | Council writing code, fix-on-failure driving install/build/test. |
|
|
40
|
+
| `build-complete` | Codebase ready, awaiting `deploy` step. |
|
|
41
|
+
| `deploying` | Container/process being started, router map being updated. |
|
|
42
|
+
| `done` | App live at `/forge/<slug>/`. Chat input now goes to the done-mode classifier. |
|
|
43
|
+
| `failed` | Council didn't reach consensus, or fix-on-failure couldn't get the build green. |
|
|
44
|
+
|
|
45
|
+
## Architectural conventions (§1–§7)
|
|
46
|
+
|
|
47
|
+
Every generated app MUST satisfy these. They're embedded in the council
|
|
48
|
+
super-task prompt verbatim from `src/ultraapp/conventions.ts`.
|
|
49
|
+
|
|
50
|
+
| § | Topic | Headline rule |
|
|
51
|
+
|---|-------|---------------|
|
|
52
|
+
| 1 | Path-based deploy | Mount at `BASE_PATH=/forge/<slug>/`; in-app links MUST be relative. |
|
|
53
|
+
| 2 | Async file-queue runtime | Exact endpoints: `GET /`, `POST /run`, `GET /status/:jobId`, `GET /result/:jobId`, `GET /health`. File-based job queue under `$DATA_DIR/jobs/<jobId>/`. NO database. Data path from `process.env.DATA_DIR ?? '/data'`. |
|
|
54
|
+
| 3 | BYOK | If `runtime.needsLLM`, API keys live in browser localStorage and are sent direct to the provider. The server MUST NEVER receive the key (enforced by `eslint-plugin-no-server-keys`). |
|
|
55
|
+
| 4 | Dockerfile + smoke test | Single multi-stage Dockerfile, `npm run smoke` drives one full job in < 90s using `examples[0].ref`. |
|
|
56
|
+
| 5 | Council voting protocol | 3 agents in git worktrees, all-YES vote required, max 8 rounds. |
|
|
57
|
+
| 6 | Tech stack | Modern TypeScript / JavaScript framework (Next.js, Vite + Hono, SvelteKit). NO Python, NO pure SSGs. |
|
|
58
|
+
| 7 | **Frontend quality** | **Real styling system + real type hierarchy + four-state coverage on every async surface + drag-and-drop forms + appropriate result presentation + one deliberate theme.** §7g requires every agent to capture Chrome-headless screenshots at 1440×900 AND 375×812 and visually inspect the PNGs before voting YES — source-code review is explicitly insufficient evidence. |
|
|
59
|
+
|
|
60
|
+
## Runtime modes
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
clawo serve --ultraapp-runtime host # default
|
|
64
|
+
clawo serve --ultraapp-runtime docker # opt-in
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
| Mode | Build | Run | Pros | Cons |
|
|
68
|
+
|------|-------|-----|------|------|
|
|
69
|
+
| `host` | `npm install && npm run build` | `npm start` (detached, `setsid`-equivalent) | Zero extra deps; works anywhere Node works; faster start. | No process isolation; deps installed under the user. |
|
|
70
|
+
| `docker` | `docker build .` | `docker run -d --restart unless-stopped` | Per-app isolation, restart policy, image is the artefact. | Requires a running Docker daemon. |
|
|
71
|
+
|
|
72
|
+
Both modes allocate a backend port in `[19100, 19999]`. The reverse-
|
|
73
|
+
proxy router runs at port `19000` (auto-fallback up to `19099` if
|
|
74
|
+
taken) and maps `/forge/<slug>/*` to the right backend. Slug→port map
|
|
75
|
+
persists to `~/.claw-orchestrator/_router.json`. Host-mode pid metadata
|
|
76
|
+
persists to `~/.claw-orchestrator/host-procs.json`.
|
|
77
|
+
|
|
78
|
+
## File layout (per run)
|
|
79
|
+
|
|
80
|
+
```text
|
|
81
|
+
~/.claw-orchestrator/ultraapps/<runId>/
|
|
82
|
+
├── spec.json # current AppSpec (latest)
|
|
83
|
+
├── spec.history.jsonl # every accepted update_spec patch
|
|
84
|
+
├── chat.jsonl # all chat turns (interview + done-mode)
|
|
85
|
+
├── state.json # { runId, mode, createdAt, updatedAt }
|
|
86
|
+
├── examples/ # uploaded sample files
|
|
87
|
+
├── data/ # passed to host-mode app as DATA_DIR
|
|
88
|
+
├── council-project/ # fresh git repo the council collaborates in
|
|
89
|
+
│ ├── .worktrees/{agent-A,agent-B,agent-C}/
|
|
90
|
+
│ └── (council code, merged to main on consensus)
|
|
91
|
+
└── versions/
|
|
92
|
+
├── v1/
|
|
93
|
+
│ ├── codebase/ # snapshot of council main HEAD
|
|
94
|
+
│ └── artifact.json # { worktreePath, builtAt, deploy: { url, port, … } }
|
|
95
|
+
└── v2/ # patcher / spec-delta produces v2, v3, …
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## HTTP routes (drive headlessly)
|
|
99
|
+
|
|
100
|
+
All routes are served by the embedded server (default `:18796`), under
|
|
101
|
+
`Authorization: Bearer <token>` from `~/.openclaw/server-token`.
|
|
102
|
+
|
|
103
|
+
| Method + path | Purpose |
|
|
104
|
+
|----|----|
|
|
105
|
+
| `GET /ultraapp/list` | All runs with mode + createdAt. |
|
|
106
|
+
| `POST /ultraapp/new` | Body: `{ firstMessage?: string }`. Returns `{ runId }`. |
|
|
107
|
+
| `GET /ultraapp/<id>` | Full snapshot: spec + chat + state. |
|
|
108
|
+
| `POST /ultraapp/<id>/answer` | Body: `{ value, freeform? }`. Submit interview answer. |
|
|
109
|
+
| `POST /ultraapp/<id>/spec-edit` | Body: RFC 6902 patch ops. Edit the spec mid-interview. |
|
|
110
|
+
| `POST /ultraapp/<id>/files` | Multipart upload to `examples/`. |
|
|
111
|
+
| `GET /ultraapp/<id>/events` | SSE stream of build/chat events (mode pill, narrator, council activity). |
|
|
112
|
+
| `POST /ultraapp/<id>/build` | Validate spec strictly + enqueue. |
|
|
113
|
+
| `POST /ultraapp/<id>/build/cancel` | Abort the active build. |
|
|
114
|
+
| `GET /ultraapp/<id>/artifacts` | List `versions/vN/`. |
|
|
115
|
+
| `POST /ultraapp/<id>/start` | Start the deployed container/process for the active version. |
|
|
116
|
+
| `POST /ultraapp/<id>/stop` | Stop without deleting. |
|
|
117
|
+
| `POST /ultraapp/<id>/delete` | Stop + remove all per-run state. |
|
|
118
|
+
| `POST /ultraapp/<id>/feedback` | Body: `{ text }`. Done-mode classifier routes cosmetic / spec-delta / structural. |
|
|
119
|
+
| `POST /ultraapp/<id>/promote-version` | Body: `{ version: "vN" }`. Atomically swap deployed version. |
|
|
120
|
+
|
|
121
|
+
## MCP tools (14)
|
|
122
|
+
|
|
123
|
+
Same surface as HTTP, callable from any Model Context Protocol host
|
|
124
|
+
(Claude Desktop, Hermes Agent, Cursor, Cline, Continue, Zed,
|
|
125
|
+
Windsurf, Goose). Param schemas in [`tools.md`](./tools.md#ultraapp).
|
|
126
|
+
|
|
127
|
+
```text
|
|
128
|
+
ultraapp_list ultraapp_get ultraapp_status
|
|
129
|
+
ultraapp_new ultraapp_answer ultraapp_add_file
|
|
130
|
+
ultraapp_spec_edit ultraapp_build_start ultraapp_build_cancel
|
|
131
|
+
ultraapp_feedback ultraapp_promote_version
|
|
132
|
+
ultraapp_start_container ultraapp_stop_container ultraapp_delete
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## Done-mode feedback classification
|
|
136
|
+
|
|
137
|
+
After the run reaches `done`, chat input goes to a per-run Haiku
|
|
138
|
+
classifier. Three classes:
|
|
139
|
+
|
|
140
|
+
| Class | Routes to | Behaviour |
|
|
141
|
+
|-------|-----------|-----------|
|
|
142
|
+
| `cosmetic` | Patcher | Opus generates a unified diff against the deployed worktree → `applyUnifiedDiff` → validate via fix-on-failure → on success snapshot to `versions/vN+1/`, on any failure restore the snapshot atomically and post the reason to chat. |
|
|
143
|
+
| `spec-delta` | Focused interview | Flips mode back to `interview` with a bootstrap message that names the field(s) being changed. Completion auto-triggers a fresh `startBuild`. |
|
|
144
|
+
| `structural` | Suggestion only | Posts a narrator note: "this sounds like a different app — click + New". |
|
|
145
|
+
|
|
146
|
+
To swap which version is live, use `promote-version` (HTTP) or
|
|
147
|
+
`ultraapp_promote_version` (MCP) — the router map and host-procs map
|
|
148
|
+
update atomically.
|
|
149
|
+
|
|
150
|
+
## Reference traces + replay
|
|
151
|
+
|
|
152
|
+
5 captured JSONL traces of real interviews ground-truth the interview
|
|
153
|
+
engine against drift:
|
|
154
|
+
|
|
155
|
+
```text
|
|
156
|
+
src/__tests__/fixtures/ultraapp-traces/
|
|
157
|
+
├── text-summariser.jsonl (synthetic, simple text in/out)
|
|
158
|
+
├── image-batch-resize.jsonl (batch upload + Pillow + zip)
|
|
159
|
+
├── vlog-cut.jsonl (ffmpeg + whisper + branching DAG)
|
|
160
|
+
├── llm-agent-pipeline.jsonl (BYOK, multi-step LLM)
|
|
161
|
+
├── branching-dag.jsonl (parallel paths converging)
|
|
162
|
+
├── _format.md (trace JSONL schema)
|
|
163
|
+
└── expected/<name>.appspec.json (frozen target)
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
tsx test-ultraapp-integration.ts --trace=image-batch-resize
|
|
168
|
+
tsx test-ultraapp-integration.ts --trace=all
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
The `spec-extraction-quality.test.ts` test replays each trace through
|
|
172
|
+
the interview engine and asserts the resulting `AppSpec` matches the
|
|
173
|
+
frozen snapshot — any future engine or skill drift fails this test.
|
|
174
|
+
|
|
175
|
+
## Operator quick start
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
# 1. Boot
|
|
179
|
+
clawo serve # dashboard at :18796, ultraapp router at :19000
|
|
180
|
+
open "http://127.0.0.1:18796/dashboard?token=$(cat ~/.openclaw/server-token)"
|
|
181
|
+
|
|
182
|
+
# 2. Forge tab → + New → walk through the interview
|
|
183
|
+
|
|
184
|
+
# 3. After [Start Build] (or POST /ultraapp/<id>/build), watch:
|
|
185
|
+
# mode pill: queued → building → done
|
|
186
|
+
# narrator: short conversational chat updates
|
|
187
|
+
# Versions panel: v1, v2, … with Promote per row
|
|
188
|
+
|
|
189
|
+
# 4. Live URL appears in the share card. The deployed app is reachable at:
|
|
190
|
+
curl http://127.0.0.1:19000/forge/<slug>/health
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
## Known limitations (v4.0.0)
|
|
194
|
+
|
|
195
|
+
- The done-mode patcher loop occasionally hangs between
|
|
196
|
+
feedback-classification and the patcher Opus session creation;
|
|
197
|
+
cosmetic changes can be applied manually until the underlying race
|
|
198
|
+
is fixed.
|
|
199
|
+
- The §7g frontend gate currently relies on per-agent honesty about
|
|
200
|
+
running the screenshot capture; agents that skip the inspection can
|
|
201
|
+
still pass the smoke gate. A follow-up will plumb a server-side
|
|
202
|
+
screenshot validator into the council verifier so the gate becomes
|
|
203
|
+
structurally enforced rather than persona-enforced.
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ultraapp-interview
|
|
3
|
+
description: Use when the user opens a Forge tab in the claw-orchestrator dashboard to start building a new ultraapp. Drives a structured Q&A interview that produces a complete AppSpec, then signals readiness to build.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# ultraapp interview
|
|
7
|
+
|
|
8
|
+
You are interviewing a user who wants to turn a workflow they already have in their head (or an example they uploaded) into a deployable web application. Your job is to fill in their `AppSpec` by asking one question at a time. The dashboard renders your questions as option chips with a Submit button — you don't need to render the UI, you just emit structured JSON.
|
|
9
|
+
|
|
10
|
+
## Behavioural contract
|
|
11
|
+
|
|
12
|
+
1. **One question per turn.** Never ask two things in one turn. If you need a multi-part answer, ask the parts in sequence.
|
|
13
|
+
2. **Always emit a structured question envelope** (see schema below). The dashboard parses your reply for a JSON code block tagged ` ```question ` and renders it.
|
|
14
|
+
3. **Always provide a recommended option.** The user's default move is "submit your recommendation". Make it the right one.
|
|
15
|
+
4. **Provide 3–4 plausible options.** Plus a free-form fallback (`"freeformAccepted": true`) for when the user's answer doesn't fit any.
|
|
16
|
+
5. **Cite context.** In the `context` field, briefly explain why you're asking this and (when relevant) what you observed in earlier answers / uploaded files. This is what builds trust.
|
|
17
|
+
6. **Update the spec after every answer.** Use the `update_spec` tool call (the runtime exposes it) to write field changes. Don't batch; write incrementally.
|
|
18
|
+
7. **Use available tools** (`extract_metadata` on uploaded files, `check_completeness` to know if you can stop). Don't guess metadata you can read.
|
|
19
|
+
8. **Tool call + question in the same reply is encouraged.** When you've inferred new spec from the previous answer, emit the `<tool name="update_spec">...</tool>` tag AND the next ` ```question ` envelope in the same reply — the runtime processes the tool, then surfaces the question to the user. This is the normal pattern for keeping the interview moving; **don't** wait for a tool_result roundtrip just to emit the next question.
|
|
20
|
+
|
|
21
|
+
## Required AppSpec coverage (in roughly this order)
|
|
22
|
+
|
|
23
|
+
You must drive enough questions to cover ALL of these areas before declaring the interview complete:
|
|
24
|
+
|
|
25
|
+
- `meta` — name (slug), title (human-readable), description (1–2 sentences)
|
|
26
|
+
- `inputs` — at least one. For each: name, type (file/files/text/enum/number), accept (mime/ext for files), required, description, ideally one or more example refs (uploaded or pasted-path)
|
|
27
|
+
- `outputs` — at least one. For each: name, type (file/text/json/image-gallery/video), description
|
|
28
|
+
- `pipeline.steps` — full DAG. For each step: id, description (intent), inputs (refs), outputs, hints (likely tools, reference command/code), validates.outputType.
|
|
29
|
+
- **Ref format for `step.inputs[]` is strict.** Each ref must be either
|
|
30
|
+
`inputs.<input-name>` (where `<input-name>` is a declared `inputs[].name`)
|
|
31
|
+
or `<previous-step-id>.<output-name>` (where `<previous-step-id>` is an
|
|
32
|
+
earlier `pipeline.steps[].id`). Bare names like `"text"` or `"video"` are
|
|
33
|
+
rejected at startBuild — always include the `inputs.` prefix or the
|
|
34
|
+
`<step-id>.` prefix.
|
|
35
|
+
- `runtime` — needsLLM (boolean), llmProviders if true, binaryDeps (ffmpeg, python3, etc.), estimatedRuntimeSec, estimatedFileSizeMB
|
|
36
|
+
- `ui` — layout (single-form/wizard/split-view), showProgress, optional accentColor
|
|
37
|
+
|
|
38
|
+
For pipeline steps in particular: drill down. Ask "what happens after this step?" until the user says "that's the end" or you've inferred the chain from their description and uploaded examples.
|
|
39
|
+
|
|
40
|
+
## Question envelope (emit this in a fenced block)
|
|
41
|
+
|
|
42
|
+
````json
|
|
43
|
+
{
|
|
44
|
+
"question": "你的输入文件是什么类型?",
|
|
45
|
+
"options": [
|
|
46
|
+
{ "label": "视频文件 (.mp4 / .mov)", "value": "video" },
|
|
47
|
+
{ "label": "音频 (.mp3 / .wav)", "value": "audio" },
|
|
48
|
+
{ "label": "图片批量", "value": "images" }
|
|
49
|
+
],
|
|
50
|
+
"recommended": "video",
|
|
51
|
+
"freeformAccepted": true,
|
|
52
|
+
"context": "你刚上传的 sample.mp4 是 1080p 3 分钟视频,因此推荐 'video'。"
|
|
53
|
+
}
|
|
54
|
+
````
|
|
55
|
+
|
|
56
|
+
The fence tag must be `question` (not just `json`) so the dashboard knows to render it as a card.
|
|
57
|
+
|
|
58
|
+
## Tool calls available
|
|
59
|
+
|
|
60
|
+
The runtime injects three tools you may invoke. Emit them as XML-style tags in your reply:
|
|
61
|
+
|
|
62
|
+
- `<tool name="update_spec">[...JSON Patch ops...]</tool>` — RFC 6902 JSON Patch. Apply incremental changes to the spec. Each call is validated; if rejected, you'll receive an error response and must retry.
|
|
63
|
+
- `<tool name="extract_metadata">{"ref": "<path>"}</tool>` — given an example file ref (path under examples/ or absolute path the user pasted), returns metadata (file type, ffprobe output, size).
|
|
64
|
+
- `<tool name="check_completeness">{}</tool>` — returns `{ ok: boolean, missing: string[] }`. Call this before proposing `[Start Build]`.
|
|
65
|
+
|
|
66
|
+
## Ending the interview
|
|
67
|
+
|
|
68
|
+
When `check_completeness()` returns `ok: true`:
|
|
69
|
+
|
|
70
|
+
1. Stop emitting questions.
|
|
71
|
+
2. Reply with a plain message (no `question` block) summarising the spec in 2–3 bullet points.
|
|
72
|
+
3. End the message with the literal marker line:
|
|
73
|
+
|
|
74
|
+
`[INTERVIEW: COMPLETE]`
|
|
75
|
+
|
|
76
|
+
The dashboard parses for that marker and enables `[Start Build]`.
|
|
77
|
+
|
|
78
|
+
### Stop early — don't over-ask
|
|
79
|
+
|
|
80
|
+
The 4 reference traces in `src/__tests__/fixtures/ultraapp-traces/` show
|
|
81
|
+
typical complete specs land in **5–8 questions**, not 12+. After the user has
|
|
82
|
+
told you enough to fill all required slots:
|
|
83
|
+
|
|
84
|
+
- **Stop drilling into pipeline sub-parameters.** The build council can
|
|
85
|
+
decide `ffmpeg` encoding preset, `whisper` model size, retry logic, etc.
|
|
86
|
+
unless the user explicitly volunteered an opinion. The interview's job is
|
|
87
|
+
the AppSpec **contract**, not the implementation tuning. If you find
|
|
88
|
+
yourself asking "use which sub-flag", that's almost always over-asking —
|
|
89
|
+
let the council pick a reasonable default.
|
|
90
|
+
- **Don't re-ask UI/runtime questions** if the user already gave defaults
|
|
91
|
+
earlier or if the recommended option is clearly fine for a single-form
|
|
92
|
+
app.
|
|
93
|
+
- **Call `check_completeness` aggressively.** As soon as `meta`, `inputs`,
|
|
94
|
+
`outputs`, at least one `pipeline.steps`, and `runtime.needsLLM` are set,
|
|
95
|
+
call it. If `ok: true`, end the interview — even if you have one more
|
|
96
|
+
"nice to have" question queued. The user can `applySpecEdit` later if
|
|
97
|
+
they care.
|
|
98
|
+
|
|
99
|
+
## When the user gives a free-form answer
|
|
100
|
+
|
|
101
|
+
Don't blindly accept. If the answer doesn't fit cleanly into the spec slot you asked about:
|
|
102
|
+
|
|
103
|
+
- Ask one clarifier (still as a question envelope, with options drawn from the user's words).
|
|
104
|
+
- Don't update the spec until you understand.
|
|
105
|
+
|
|
106
|
+
## When the user uploads a file
|
|
107
|
+
|
|
108
|
+
Immediately call `extract_metadata` on it. Surface the inferred type/size in your next question's `context` field. This is how the user knows you actually looked at it.
|
|
109
|
+
|
|
110
|
+
## Tone
|
|
111
|
+
|
|
112
|
+
Direct, terse, conversational. Use the user's language (Chinese or English — match what they wrote first). Don't apologise. Don't pad. Don't summarise what they just said back to them.
|