You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: AGENTS.md
+11-2Lines changed: 11 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,8 +24,12 @@ All commands use pnpm. Target a single app with `pnpm --filter <package>`.
24
24
25
25
```bash
26
26
pnpm install # Install
27
-
pnpm dev # Local controller-first web stack (Controller + Web)
28
-
pnpm dev:controller # Controller only
27
+
pnpm dev start <service># Start one local-dev service: desktop|openclaw|controller|web
28
+
pnpm dev stop <service># Stop one local-dev service
29
+
pnpm dev restart <service># Restart one local-dev service
30
+
pnpm dev status <service># Show status for one local-dev service
31
+
pnpm dev logs <service># Show active-session log tail (max 200 lines) for one local-dev service
32
+
pnpm dev:controller # Legacy controller-only direct dev entrypoint
29
33
pnpm start # Build and launch the desktop local runtime stack
30
34
pnpm stop # Stop the desktop local runtime stack
31
35
pnpm restart # Restart the desktop local runtime stack
@@ -69,6 +73,9 @@ This repo is desktop-first. Prefer the controller-first path and remove or ignor
69
73
## Desktop local development
70
74
71
75
- Use `pnpm install` first, then `pnpm start` / `pnpm stop` / `pnpm restart` / `pnpm status` as the standard local desktop workflow.
76
+
- For script-managed local development, use explicit per-service commands only: `pnpm dev start <desktop|openclaw|controller|web>`, `pnpm dev stop <service>`, `pnpm dev restart <service>`, `pnpm dev status <service>`, and `pnpm dev logs <service>`.
77
+
-`pnpm dev` has no implicit aggregate default and intentionally does not support `all`; start each service deliberately in dependency order when you want the full local stack: `openclaw` -> `controller` -> `web` -> `desktop`.
78
+
-`pnpm dev logs <service>` is session-scoped, prints a fixed header, and tails at most the last 200 lines from the active service session.
72
79
-`pnpm start` is the canonical local desktop entrypoint and now applies safe startup optimizations by default: it reuses existing build artifacts when present and reuses the prepared OpenClaw sidecar cache when its inputs have not changed.
73
80
- Temporary escape hatches exist for debugging or suspicious cache behavior: `NEXU_DESKTOP_FORCE_FULL_START=1` disables the optimized start path, `NEXU_DESKTOP_DISABLE_BUILD_REUSE=1` disables build artifact reuse only, and `NEXU_DESKTOP_DISABLE_OPENCLAW_SIDECAR_CACHE=1` disables the OpenClaw sidecar cache only.
74
81
-`pnpm reset-state` is the reset button for the optimized path too: it stops the desktop runtime and clears repo-local runtime state plus cached sidecars under `.tmp/sidecars/`.
@@ -263,6 +270,8 @@ This note should track:
263
270
- OpenClaw managed skills dir (expected default): `~/.openclaw/skills/`
264
271
- Slack smoke probe setup: install Chrome Canary, set `PROBE_SLACK_URL`, run `pnpm probe:slack prepare`, then manually log into Slack in Canary before `pnpm probe:slack run`
265
272
-`openclaw-runtime` is installed implicitly by `pnpm install`; local development should normally not use a global `openclaw` CLI
273
+
- Local service startup order for the script-managed dev path: `pnpm dev start openclaw` -> `pnpm dev start controller` -> `pnpm dev start web` -> `pnpm dev start desktop`
274
+
- Local service shutdown order for the script-managed dev path: `pnpm dev stop desktop` -> `pnpm dev stop web` -> `pnpm dev stop controller` -> `pnpm dev stop openclaw`
266
275
- Prefer `./openclaw-wrapper` over global `openclaw` in local development; it executes `openclaw-runtime/node_modules/openclaw/openclaw.mjs`
267
276
- When OpenClaw is started manually, set `RUNTIME_MANAGE_OPENCLAW_PROCESS=false` for `@nexu/controller` to avoid launching a second OpenClaw process
268
277
- If behavior differs, verify effective `OPENCLAW_STATE_DIR` / `OPENCLAW_CONFIG_PATH` used by the running controller process.
Copy file name to clipboardExpand all lines: TASK.md
+52-11Lines changed: 52 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,6 +41,34 @@
41
41
- Updated `scripts/dev/src/index.ts` so `pnpm dev start|restart|stop|status|logs` now includes `openclaw`
42
42
- Updated existing `scripts/dev` controller/web assembly to consume injected values from `scripts/dev/.env` instead of assuming only hard-coded defaults
43
43
44
+
### `scripts/dev` now also owns desktop local-dev attach
45
+
46
+
- Added `scripts/dev/src/services/desktop.ts`
47
+
- Updated `scripts/dev/src/index.ts` so `pnpm dev start|restart|stop|status|logs` now includes `desktop`
48
+
-`scripts/dev` now launches desktop through `apps/desktop/scripts/dev-cli.mjs` with:
49
+
-`NEXU_DESKTOP_RUNTIME_MODE=external`
50
+
- injected controller/web/openclaw URLs from `scripts/dev/.env`
51
+
- shared `NEXU_HOME` from the `scripts/dev` contract
- desktop log access wired to `.tmp/logs/desktop-dev.log`
55
+
-`scripts/dev` command routing no longer has implicit aggregate defaults for `start | status | stop | restart`
56
+
- these commands now require an explicit single-service target: `desktop | openclaw | controller | web`
57
+
- aggregate target `all` is rejected
58
+
- example: `pnpm dev start openclaw`, `pnpm dev status desktop`, `pnpm dev stop web`
59
+
-`pnpm dev logs <service>` is now session-scoped and tail-oriented:
60
+
- logs are resolved from the active service session only
61
+
- output is capped to the last 200 lines by default
62
+
- the CLI prints a fixed header with the tail policy, session line count, and actual log file path before log content
63
+
- desktop logs are sliced from the current `launchId` inside the shared `desktop-dev.log` file instead of dumping the whole file
64
+
- Root `AGENTS.md` and `scripts/dev/AGENTS.md` were updated to describe the explicit per-service local-dev workflow, the lack of an `all` target, and the new session-scoped logging contract
65
+
- Cleaned obvious old script-managed dev wording in service errors so each service now points to the matching explicit stop command (`pnpm dev stop <service>`)
66
+
-`apps/desktop/main/bootstrap.ts` now respects a pre-injected `NEXU_HOME` in local dev instead of always forcing the desktop-local fallback path
67
+
-`apps/desktop/scripts/dev-cli.mjs` now treats external runtime attach as a first-class mode for local dev:
68
+
- skips killing controller/web/openclaw listener ports when desktop is only attaching
69
+
- derives runtime ports from injected env instead of fixed desktop defaults
70
+
- skips controller/web/openclaw sidecar builds when external attach only needs desktop artifacts
71
+
44
72
### Small controller-chain robustness fix
45
73
46
74
-`apps/controller/src/runtime/openclaw-config-writer.ts` now derives a fallback state dir from `openclawConfigPath` when the full env shape is not present, which fixed the related config-writer regression in tests
- Root-entrypoint local-dev acceptance for the current three-service flow passed:
56
-
-`pnpm dev status`
57
-
-`pnpm dev start`
58
-
-`pnpm dev status`
83
+
- Root-entrypoint local-dev acceptance for explicit per-service local-dev flow passed:
84
+
-`pnpm dev status all` rejects `all` as intended
85
+
-`pnpm dev start openclaw`
59
86
-`pnpm dev logs openclaw`
87
+
-`pnpm dev start controller`
60
88
-`pnpm dev logs controller`
61
-
-`pnpm dev restart`
62
-
-`pnpm dev stop`
63
-
-`pnpm dev status`
89
+
-`pnpm dev start web`
90
+
-`pnpm dev logs web`
91
+
-`pnpm dev start desktop`
92
+
-`pnpm dev logs desktop`
93
+
-`pnpm dev stop desktop`
94
+
-`pnpm dev stop web`
95
+
-`pnpm dev stop controller`
96
+
-`pnpm dev stop openclaw`
97
+
- Follow-up doc / cleanup validation passed:
98
+
-`pnpm --dir ./scripts/dev exec tsc --noEmit`
99
+
- grep audit across `AGENTS.md`, `scripts/dev/AGENTS.md`, and `scripts/dev/src/` for stale implicit-aggregate command wording
64
100
- Verified controller now boots in `external` OpenClaw mode and successfully reaches `openclaw_ws_connected` through the `scripts/dev`-managed OpenClaw process
101
+
-`pnpm lint` still fails, but only on pre-existing repo-wide Biome formatting drift unrelated to this branch
102
+
-`pnpm test` still fails, but the observed failures are pre-existing desktop cross-platform/path test issues unrelated to this branch
65
103
66
104
## Important Current Behavior
67
105
68
106
- OpenClaw local dev is now expected to be orchestrated by `scripts/dev`, not by its own dedicated `.env`
69
107
-`scripts/dev/.env` is intended to become the single dev-only source of truth for cross-service injected runtime values
70
108
- Controller local dev is already consuming OpenClaw through that external contract when launched via `scripts/dev`
71
-
- Desktop code is prepared for the same external-runtime shape, but desktop is not yet wired into `scripts/dev`
109
+
- Desktop local dev is now started/stopped through `scripts/dev` in `external` mode and attaches to the `scripts/dev`-managed controller/web/openclaw stack
110
+
-`pnpm dev start|status|stop|restart` now require an explicit single-service target; `all` is intentionally unsupported
111
+
-`pnpm dev logs <service>` only works for the active session of that service and prints at most the last 200 lines, prefixed with a fixed metadata header
112
+
- Desktop still writes to the shared `.tmp/logs/desktop-dev.log`, but `pnpm dev logs desktop` now slices output to the current `launchId` session before tailing
-Desktop is not yet started/stopped through `scripts/dev`; only `openclaw + controller + web` are wired today
121
+
-`pnpm test` still has additional pre-existing desktop failures on Windows path expectations / filesystem assumptions (launchd, plist, state migration, skill path, runtime manifest, skill DB migration)
81
122
82
123
## Suggested Next Steps
83
124
84
-
1.Wire `desktop` into `scripts/dev` using the same `scripts/dev/.env` contract and `NEXU_DESKTOP_RUNTIME_MODE=external`
85
-
2. Decide whether to expand `pnpm dev` into explicit single-service targeting like `pnpm dev start openclaw` / `pnpm dev stop controller`
125
+
1.Decide whether any per-service dependency guardrails are needed when users start `controller` or `desktop` without their expected upstream services already running
126
+
2. Decide whether `logs` should gain an opt-in `--full` / `--lines <n>` escape hatch later, or remain hard-capped at 200 lines
86
127
3. Continue tightening the `scripts/dev/.env` contract so every external injection is documented, named consistently, and traced to a single owner
0 commit comments