Skip to content

Commit 7408c6b

Browse files
grypezclaude
andcommitted
refactor(evm-wallet-experiment): replace 'interactive' with 'demo' throughout demo stack
Renames: run-interactive-compose.mjs→run-demo-compose.mjs, .env.interactive→.env.demo, Dockerfile target interactive→demo. Identifier sweep: INTERACTIVE_PACKAGE_ROOT→DEMO_PACKAGE_ROOT, INTERACTIVE_PAIR_TO_PROFILE→DEMO_PAIR_TO_PROFILE, interactiveDockerComposeArgs→demoDockerComposeArgs, runInteractiveCompose→runDemoCompose, etc. Env vars: OCAP_INTERACTIVE_PAIR→OCAP_DEMO_PAIR, DEBUG_OCAP_INTERACTIVE_COMPOSE→DEBUG_OCAP_DEMO_COMPOSE. Docs updated throughout. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 3d23828 commit 7408c6b

16 files changed

Lines changed: 105 additions & 110 deletions

packages/evm-wallet-experiment/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,7 @@ yarn workspace @ocap/evm-wallet-experiment build
712712
yarn workspace @ocap/evm-wallet-experiment lint:fix
713713
```
714714

715-
For Docker Compose setup (interactive simulation and E2E tests), see [docs/docker.md](./docs/docker.md). Docker Model Runner with `ai/qwen3.5:4B-UD-Q4_K_XL` is required for the interactive simulation's OpenClaw AI agent.
715+
For Docker Compose setup (local demo and E2E tests), see [docs/docker.md](./docs/docker.md). Docker Model Runner with `ai/qwen3.5:4B-UD-Q4_K_XL` is required for the local demo's OpenClaw AI agent.
716716

717717
## Testing
718718

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Used by `yarn docker:demo:up` (--env-file). Switches
2+
# `kernel-away-bundler-7702` to the `demo` Dockerfile target (OpenClaw).
3+
KERNEL_AWAY_7702_TARGET=demo

packages/evm-wallet-experiment/docker/.env.interactive

Lines changed: 0 additions & 3 deletions
This file was deleted.

packages/evm-wallet-experiment/docker/Dockerfile.kernel-base

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ COPY --from=builder /build /app
6262
RUN mkdir -p /logs /run/ocap
6363

6464
# ---------------------------------------------------------------------------
65-
# Target: interactive — kernel + OpenClaw + wallet plugin (used interactively)
65+
# Target: demo — kernel + OpenClaw + wallet plugin (used in local demo)
6666
# ---------------------------------------------------------------------------
67-
FROM kernel AS interactive
67+
FROM kernel AS demo
6868

6969
# OpenClaw loads local plugins as TypeScript via jiti (no extra TS runner in the image).
7070
# `package.json` docker:demo:setup starts the gateway via

packages/evm-wallet-experiment/docker/MAINTAINERS.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Copy the top-level **Digest** (index), then set in `docker-compose.yml`:
3030

3131
Keep the comment above that line in sync with the command you used.
3232

33-
### OpenClaw (interactive image only)
33+
### OpenClaw (demo image only)
3434

3535
`Dockerfile.kernel-base` installs a **fixed** global CLI version (`openclaw@…`). The gateway loads **`openclaw-plugin/index.ts`** via **jiti**; nothing in the image invokes `tsx`. Bump OpenClaw deliberately when you want new gateway behavior; avoid `@latest` here.
3636

@@ -62,16 +62,16 @@ Host-side scripts (e.g. `yarn docker:setup:wallets`) use the workspace **`tsx`**
6262

6363
- **`yarn docker:up`** and **`yarn test:e2e:docker`** expect the full stack, including [**Compose `models`**](https://docs.docker.com/ai/compose/models-and-compose/) on each **`kernel-away-*`** service. That requires **Docker Compose v2.38+** and [**Docker Model Runner**](https://docs.docker.com/ai/model-runner/) enabled.
6464
- Top-level **`models.llm`** pins **`ai/qwen3.5:4B-UD-Q4_K_XL`** with **`context_size: 32768`** and **`runtime_flags: ['--ctx-size','32768']`** so llama.cpp does not stay at DMR’s 4096 default (OpenClaw + tools need more). Pull if needed: **`docker model pull ai/qwen3.5:4B-UD-Q4_K_XL`**. If requests still hit 4096, run **`docker model configure --context-size 32768 ai/qwen3.5:4B-UD-Q4_K_XL`** on the host and recreate containers.
65-
- Vitest Docker E2E does **not** call the LLM today, but away containers still receive **`LLM_URL`** / **`LLM_MODEL`** for consistency with interactive OpenClaw and future tests.
65+
- Vitest Docker E2E does **not** call the LLM today, but away containers still receive **`LLM_URL`** / **`LLM_MODEL`** for consistency with the demo OpenClaw stack and future tests.
6666

67-
## Interactive stack (`docker/.env.interactive` + one pair profile)
67+
## Demo stack (`docker/.env.demo` + one pair profile)
6868

69-
- **`yarn docker:compose:demo`** runs **`node docker/run-interactive-compose.mjs`**, which passes **`--env-file docker/.env.interactive`** ( **`KERNEL_AWAY_7702_TARGET=interactive`** for the 7702 away image) and **one** **`--profile`** (**`7702`**, **`4337`**, or **`relay`**). Default delegation mode is **`bundler-7702`** → profile **`7702`** (same mode strings as Docker E2E **`DELEGATION_MODE`**).
70-
- **Choose the pair**: set **`OCAP_INTERACTIVE_PAIR`** to **`bundler-7702`**, **`bundler-hybrid`**, or **`peer-relay`**, or pass **`--pair <value>`** before compose subcommands (after **`yarn … --`** if needed), e.g. **`yarn docker:demo:up -- --pair bundler-hybrid`**.
69+
- **`yarn docker:compose:demo`** runs **`node docker/run-demo-compose.mjs`**, which passes **`--env-file docker/.env.demo`** ( **`KERNEL_AWAY_7702_TARGET=demo`** for the 7702 away image) and **one** **`--profile`** (**`7702`**, **`4337`**, or **`relay`**). Default delegation mode is **`bundler-7702`** → profile **`7702`** (same mode strings as Docker E2E **`DELEGATION_MODE`**).
70+
- **Choose the pair**: set **`OCAP_DEMO_PAIR`** to **`bundler-7702`**, **`bundler-hybrid`**, or **`peer-relay`**, or pass **`--pair <value>`** before compose subcommands (after **`yarn … --`** if needed), e.g. **`yarn docker:demo:up -- --pair bundler-hybrid`**.
7171
- **`yarn docker:demo:setup`** runs wallet setup; OpenClaw **`setup-openclaw.mjs`** + gateway run **only** when the pair is **`bundler-7702`** (the image with OpenClaw). Other pairs skip those steps with a short log line.
7272
- OpenClaw UI history for 7702 lives under **`$HOME/.openclaw`** on the **`ocap-run`** volume; use **`yarn docker:demo:reset-openclaw`** then **`yarn docker:demo:setup`**, or **`docker compose … down -v`** for a full volume wipe. LLM wiring is **only** in **`docker-compose.yml`** (**`models:`**).
7373

74-
**Raw `docker compose -f docker/docker-compose.yml up`** without **`--profile`** starts **evm** and **bundler** only (no kernels). Prefer **`yarn docker:up`** or the interactive scripts above.
74+
**Raw `docker compose -f docker/docker-compose.yml up`** without **`--profile`** starts **evm** and **bundler** only (no kernels). Prefer **`yarn docker:up`** or the demo scripts above.
7575

7676
## `yarn docker:delegate`
7777

packages/evm-wallet-experiment/docker/attach.mjs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
import { spawnSync } from 'node:child_process';
33

44
import {
5-
awayServiceForInteractivePair,
6-
homeServiceForInteractivePair,
7-
interactiveDockerComposeArgs,
8-
INTERACTIVE_PACKAGE_ROOT,
5+
awayServiceForDemoPair,
6+
homeServiceForDemoPair,
7+
demoDockerComposeArgs,
8+
DEMO_PACKAGE_ROOT,
99
} from './demo-compose-lib.mjs';
1010

1111
const [side, ...rest] = process.argv.slice(2);
@@ -15,17 +15,15 @@ if (side !== 'away' && side !== 'home') {
1515
process.exit(1);
1616
}
1717

18-
const { pair, dockerArgs } = interactiveDockerComposeArgs(rest);
18+
const { pair, dockerArgs } = demoDockerComposeArgs(rest);
1919
const service =
20-
side === 'away'
21-
? awayServiceForInteractivePair(pair)
22-
: homeServiceForInteractivePair(pair);
20+
side === 'away' ? awayServiceForDemoPair(pair) : homeServiceForDemoPair(pair);
2321

2422
const spawned = spawnSync(
2523
'docker',
2624
[...dockerArgs, 'exec', '-it', service, 'bash'],
2725
{
28-
cwd: INTERACTIVE_PACKAGE_ROOT,
26+
cwd: DEMO_PACKAGE_ROOT,
2927
stdio: 'inherit',
3028
env: process.env,
3129
},

packages/evm-wallet-experiment/docker/delegate.mjs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,23 @@
22
import { spawnSync } from 'node:child_process';
33

44
import {
5-
homeServiceForInteractivePair,
6-
interactiveDockerComposeArgs,
7-
INTERACTIVE_PACKAGE_ROOT,
5+
homeServiceForDemoPair,
6+
demoDockerComposeArgs,
7+
DEMO_PACKAGE_ROOT,
88
} from './demo-compose-lib.mjs';
99

1010
const SCRIPT_ON_HOST = 'docker/create-delegation.mjs';
1111
const SCRIPT_IN_CONTAINER =
1212
'/app/packages/evm-wallet-experiment/docker/create-delegation.mjs';
1313

1414
const argv = process.argv.slice(2);
15-
const { pair, dockerArgs } = interactiveDockerComposeArgs(argv);
16-
const home = homeServiceForInteractivePair(pair);
15+
const { pair, dockerArgs } = demoDockerComposeArgs(argv);
16+
const home = homeServiceForDemoPair(pair);
1717

1818
const cp = spawnSync(
1919
'docker',
2020
[...dockerArgs, 'cp', SCRIPT_ON_HOST, `${home}:${SCRIPT_IN_CONTAINER}`],
21-
{ cwd: INTERACTIVE_PACKAGE_ROOT, stdio: 'inherit', env: process.env },
21+
{ cwd: DEMO_PACKAGE_ROOT, stdio: 'inherit', env: process.env },
2222
);
2323
if (cp.status !== 0) {
2424
process.exit(cp.status ?? 1);
@@ -41,6 +41,6 @@ const exec = spawnSync(
4141
'development',
4242
SCRIPT_IN_CONTAINER,
4343
],
44-
{ cwd: INTERACTIVE_PACKAGE_ROOT, stdio: 'inherit', env: process.env },
44+
{ cwd: DEMO_PACKAGE_ROOT, stdio: 'inherit', env: process.env },
4545
);
4646
process.exit(exec.status ?? 1);

packages/evm-wallet-experiment/docker/demo-compose-lib.mjs

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,28 @@
11
/* eslint-disable n/no-sync, n/no-process-env, n/no-process-exit, jsdoc/require-jsdoc */
22
/**
3-
* Shared parsing + `docker compose` argv for interactive stack (one home/away pair).
3+
* Shared parsing + `docker compose` argv for demo stack (one home/away pair).
44
* Keep delegation-mode keys in sync with `test/e2e/docker/helpers/docker-e2e-kernel-services.ts`.
55
*/
66
import { spawnSync } from 'node:child_process';
77
import { dirname, join } from 'node:path';
88
import { fileURLToPath } from 'node:url';
99

1010
const dockerLibDir = dirname(fileURLToPath(import.meta.url));
11-
export const INTERACTIVE_PACKAGE_ROOT = join(dockerLibDir, '..');
11+
export const DEMO_PACKAGE_ROOT = join(dockerLibDir, '..');
1212

13-
const COMPOSE_FILE = join(
14-
INTERACTIVE_PACKAGE_ROOT,
15-
'docker/docker-compose.yml',
16-
);
17-
const ENV_FILE = join(INTERACTIVE_PACKAGE_ROOT, 'docker/.env.interactive');
13+
const COMPOSE_FILE = join(DEMO_PACKAGE_ROOT, 'docker/docker-compose.yml');
14+
const ENV_FILE = join(DEMO_PACKAGE_ROOT, 'docker/.env.demo');
1815

1916
/** @type {Record<string, string>} */
20-
export const INTERACTIVE_PAIR_TO_PROFILE = {
17+
export const DEMO_PAIR_TO_PROFILE = {
2118
'bundler-7702': '7702',
2219
'bundler-hybrid': '4337',
2320
'peer-relay': 'relay',
2421
};
2522

26-
export const DEFAULT_INTERACTIVE_PAIR = 'bundler-7702';
23+
export const DEFAULT_DEMO_PAIR = 'bundler-7702';
2724

28-
export function awayServiceForInteractivePair(pair) {
25+
export function awayServiceForDemoPair(pair) {
2926
if (pair === 'bundler-7702') {
3027
return 'kernel-away-bundler-7702';
3128
}
@@ -35,10 +32,10 @@ export function awayServiceForInteractivePair(pair) {
3532
if (pair === 'peer-relay') {
3633
return 'kernel-away-peer-relay';
3734
}
38-
throw new Error(`Unknown interactive pair: ${pair}`);
35+
throw new Error(`Unknown demo pair: ${pair}`);
3936
}
4037

41-
export function homeServiceForInteractivePair(pair) {
38+
export function homeServiceForDemoPair(pair) {
4239
if (pair === 'bundler-7702') {
4340
return 'kernel-home-bundler-7702';
4441
}
@@ -48,29 +45,29 @@ export function homeServiceForInteractivePair(pair) {
4845
if (pair === 'peer-relay') {
4946
return 'kernel-home-peer-relay';
5047
}
51-
throw new Error(`Unknown interactive pair: ${pair}`);
48+
throw new Error(`Unknown demo pair: ${pair}`);
5249
}
5350

54-
export function parseInteractiveComposeArgv(argv) {
55-
let pair = process.env.OCAP_INTERACTIVE_PAIR ?? DEFAULT_INTERACTIVE_PAIR;
51+
export function parseDemoComposeArgv(argv) {
52+
let pair = process.env.OCAP_DEMO_PAIR ?? DEFAULT_DEMO_PAIR;
5653
const rest = [...argv];
5754
const i = rest.indexOf('--pair');
5855
if (i !== -1 && rest[i + 1]) {
5956
pair = rest[i + 1];
6057
rest.splice(i, 2);
6158
}
62-
const profile = INTERACTIVE_PAIR_TO_PROFILE[pair];
59+
const profile = DEMO_PAIR_TO_PROFILE[pair];
6360
if (!profile) {
6461
console.error(
65-
`Unknown pair "${pair}". Use: ${Object.keys(INTERACTIVE_PAIR_TO_PROFILE).join(', ')} (env OCAP_INTERACTIVE_PAIR, or --pair before compose subcommands).`,
62+
`Unknown pair "${pair}". Use: ${Object.keys(DEMO_PAIR_TO_PROFILE).join(', ')} (env OCAP_DEMO_PAIR, or --pair before compose subcommands).`,
6663
);
6764
process.exit(1);
6865
}
6966
return { pair, profile, rest };
7067
}
7168

72-
export function interactiveDockerComposeArgs(argv) {
73-
const { pair, profile, rest } = parseInteractiveComposeArgv(argv);
69+
export function demoDockerComposeArgs(argv) {
70+
const { pair, profile, rest } = parseDemoComposeArgv(argv);
7471
return {
7572
pair,
7673
profile,
@@ -88,15 +85,15 @@ export function interactiveDockerComposeArgs(argv) {
8885
};
8986
}
9087

91-
export function runInteractiveCompose(argv) {
92-
const { pair, profile, dockerArgs } = interactiveDockerComposeArgs(argv);
93-
if (process.env.DEBUG_OCAP_INTERACTIVE_COMPOSE) {
88+
export function runDemoCompose(argv) {
89+
const { pair, profile, dockerArgs } = demoDockerComposeArgs(argv);
90+
if (process.env.DEBUG_OCAP_DEMO_COMPOSE) {
9491
console.error(
95-
`[ocap interactive compose] OCAP_INTERACTIVE_PAIR=${pair} profile=${profile}`,
92+
`[ocap demo compose] OCAP_DEMO_PAIR=${pair} profile=${profile}`,
9693
);
9794
}
9895
const spawned = spawnSync('docker', dockerArgs, {
99-
cwd: INTERACTIVE_PACKAGE_ROOT,
96+
cwd: DEMO_PACKAGE_ROOT,
10097
stdio: 'inherit',
10198
env: process.env,
10299
});

packages/evm-wallet-experiment/docker/demo-reset-openclaw.mjs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
import { spawnSync } from 'node:child_process';
33

44
import {
5-
awayServiceForInteractivePair,
6-
interactiveDockerComposeArgs,
7-
INTERACTIVE_PACKAGE_ROOT,
5+
awayServiceForDemoPair,
6+
demoDockerComposeArgs,
7+
DEMO_PACKAGE_ROOT,
88
} from './demo-compose-lib.mjs';
99

1010
const argv = process.argv.slice(2);
11-
const { pair, dockerArgs } = interactiveDockerComposeArgs(argv);
11+
const { pair, dockerArgs } = demoDockerComposeArgs(argv);
1212

1313
if (pair !== 'bundler-7702') {
1414
console.log(
@@ -17,13 +17,13 @@ if (pair !== 'bundler-7702') {
1717
process.exit(0);
1818
}
1919

20-
const away = awayServiceForInteractivePair(pair);
20+
const away = awayServiceForDemoPair(pair);
2121
const openclawDir = `/run/ocap/${away}/.openclaw`;
2222

2323
const spawned = spawnSync(
2424
'docker',
2525
[...dockerArgs, 'exec', away, 'rm', '-rf', openclawDir],
26-
{ cwd: INTERACTIVE_PACKAGE_ROOT, stdio: 'inherit', env: process.env },
26+
{ cwd: DEMO_PACKAGE_ROOT, stdio: 'inherit', env: process.env },
2727
);
2828
if (spawned.status !== 0) {
2929
process.exit(spawned.status ?? 1);

packages/evm-wallet-experiment/docker/demo-setup.mjs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,31 @@
22
import { spawnSync } from 'node:child_process';
33

44
import {
5-
awayServiceForInteractivePair,
6-
interactiveDockerComposeArgs,
7-
INTERACTIVE_PACKAGE_ROOT,
5+
awayServiceForDemoPair,
6+
demoDockerComposeArgs,
7+
DEMO_PACKAGE_ROOT,
88
} from './demo-compose-lib.mjs';
99

1010
const argv = process.argv.slice(2);
11-
const { pair, dockerArgs } = interactiveDockerComposeArgs(argv);
11+
const { pair, dockerArgs } = demoDockerComposeArgs(argv);
1212

1313
const wallets = spawnSync(
1414
'yarn',
1515
['tsx', 'test/e2e/docker/setup-wallets.ts', pair],
1616
{
17-
cwd: INTERACTIVE_PACKAGE_ROOT,
17+
cwd: DEMO_PACKAGE_ROOT,
1818
stdio: 'inherit',
1919
env: process.env,
2020
},
2121
);
2222
if (wallets.status !== 0) {
2323
process.exit(wallets.status ?? 1);
2424
}
25-
const away = awayServiceForInteractivePair(pair);
25+
const away = awayServiceForDemoPair(pair);
2626

2727
if (pair !== 'bundler-7702') {
2828
console.log(
29-
'OpenClaw setup skipped (interactive Dockerfile target + OpenClaw run only on kernel-away-bundler-7702).',
29+
'OpenClaw setup skipped (demo Dockerfile target + OpenClaw run only on kernel-away-bundler-7702).',
3030
);
3131
process.exit(0);
3232
}
@@ -40,7 +40,7 @@ const setupOpenclaw = spawnSync(
4040
'node',
4141
'/app/packages/evm-wallet-experiment/docker/setup-openclaw.mjs',
4242
],
43-
{ cwd: INTERACTIVE_PACKAGE_ROOT, stdio: 'inherit', env: process.env },
43+
{ cwd: DEMO_PACKAGE_ROOT, stdio: 'inherit', env: process.env },
4444
);
4545
if (setupOpenclaw.status !== 0) {
4646
process.exit(setupOpenclaw.status ?? 1);
@@ -57,12 +57,12 @@ const gateway = spawnSync(
5757
'/usr/local/lib/node_modules/openclaw/openclaw.mjs',
5858
'gateway',
5959
],
60-
{ cwd: INTERACTIVE_PACKAGE_ROOT, stdio: 'inherit', env: process.env },
60+
{ cwd: DEMO_PACKAGE_ROOT, stdio: 'inherit', env: process.env },
6161
);
6262
if (gateway.status !== 0) {
6363
process.exit(gateway.status ?? 1);
6464
}
6565

6666
console.log(
67-
`OpenClaw configured + gateway started (${away}). Shell: OCAP_INTERACTIVE_PAIR=${pair} yarn docker:demo:attach:away`,
67+
`OpenClaw configured + gateway started (${away}). Shell: OCAP_DEMO_PAIR=${pair} yarn docker:demo:attach:away`,
6868
);

0 commit comments

Comments
 (0)