Skip to content

Commit ed8f50f

Browse files
authored
refactor: simplify plugin dependency handling
Simplify plugin installation and runtime loading around package-manager-owned dependencies, with Jiti reserved for local/TS fallback paths. Also scans npm plugin install roots so hoisted transitive dependencies are covered by dependency denylist and node_modules symlink checks.
1 parent 2e8e9cd commit ed8f50f

294 files changed

Lines changed: 2615 additions & 25507 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/codeql/codeql-plugin-boundary-critical-quality.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ paths:
2020
- src/plugins/bundled-dir.ts
2121
- src/plugins/bundled-plugin-metadata.ts
2222
- src/plugins/bundled-public-surface-runtime-root.ts
23-
- src/plugins/bundled-runtime-deps.ts
24-
- src/plugins/bundled-runtime-root.ts
23+
- src/plugins/plugin-sdk-dist-alias.ts
2524
- src/plugins/captured-registration.ts
2625
- src/plugins/config-activation-shared.ts
2726
- src/plugins/config-contracts.ts

.github/codeql/codeql-plugin-trust-boundary-critical-security.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ paths:
2525
- src/plugins/bundled-dir.ts
2626
- src/plugins/bundled-plugin-metadata.ts
2727
- src/plugins/bundled-plugin-scan.ts
28-
- src/plugins/bundled-runtime-deps*.ts
29-
- src/plugins/bundled-runtime-root.ts
28+
- src/plugins/plugin-sdk-dist-alias.ts
3029
- src/plugins/cli-registry-loader.ts
3130
- src/plugins/config-activation-shared.ts
3231
- src/plugins/config-contracts.ts

.github/workflows/ci.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -564,9 +564,6 @@ jobs:
564564
- name: Smoke test built bundled plugin singleton
565565
run: pnpm test:build:singleton
566566

567-
- name: Smoke test built bundled runtime deps
568-
run: pnpm test:build:bundled-runtime-deps
569-
570567
- name: Check CLI startup memory
571568
run: pnpm test:startup:memory
572569

.github/workflows/install-smoke.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -510,9 +510,3 @@ jobs:
510510
with:
511511
install-bun: "false"
512512
install-deps: "true"
513-
514-
- name: Run fast bundled plugin Docker E2E
515-
env:
516-
OPENCLAW_BUNDLED_CHANNEL_DEPS_E2E_IMAGE: openclaw-bundled-channel-fast:local
517-
OPENCLAW_BUNDLED_CHANNEL_DOCKER_RUN_TIMEOUT: 90s
518-
run: timeout 480s pnpm test:docker:bundled-channel-deps:fast

.github/workflows/openclaw-live-and-e2e-checks-reusable.yml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -646,21 +646,6 @@ jobs:
646646
- chunk_id: plugins-runtime-install-h
647647
label: plugins/runtime install H
648648
timeout_minutes: 120
649-
- chunk_id: bundled-channels-core
650-
label: bundled channels core
651-
timeout_minutes: 90
652-
- chunk_id: bundled-channels-update-a
653-
label: bundled channels update A
654-
timeout_minutes: 45
655-
- chunk_id: bundled-channels-update-discord
656-
label: bundled channels update Discord
657-
timeout_minutes: 30
658-
- chunk_id: bundled-channels-update-b
659-
label: bundled channels update B
660-
timeout_minutes: 45
661-
- chunk_id: bundled-channels-contracts
662-
label: bundled channels contracts
663-
timeout_minutes: 90
664649
env:
665650
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
666651
OPENAI_BASE_URL: ${{ secrets.OPENAI_BASE_URL }}

.github/workflows/openclaw-release-checks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ jobs:
440440
artifact_name: ${{ needs.prepare_release_package.outputs.artifact_name }}
441441
package_sha256: ${{ needs.prepare_release_package.outputs.package_sha256 }}
442442
suite_profile: custom
443-
docker_lanes: bundled-channel-deps-compat plugins-offline
443+
docker_lanes: plugins-offline plugin-update
444444
telegram_mode: mock-openai
445445
telegram_scenarios: telegram-help-command,telegram-commands-command,telegram-tools-compact-command,telegram-whoami-command,telegram-context-command,telegram-mention-gating
446446
secrets:

.github/workflows/package-acceptance.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,10 +386,10 @@ jobs:
386386
docker_lanes="npm-onboard-channel-agent gateway-network config-reload"
387387
;;
388388
package)
389-
docker_lanes="npm-onboard-channel-agent doctor-switch update-channel-switch upgrade-survivor published-upgrade-survivor bundled-channel-deps-compat plugins-offline plugin-update"
389+
docker_lanes="npm-onboard-channel-agent doctor-switch update-channel-switch upgrade-survivor published-upgrade-survivor plugins-offline plugin-update"
390390
;;
391391
product)
392-
docker_lanes="npm-onboard-channel-agent doctor-switch update-channel-switch upgrade-survivor published-upgrade-survivor bundled-channel-deps-compat plugins plugin-update mcp-channels cron-mcp-cleanup openai-web-search-minimal openwebui"
392+
docker_lanes="npm-onboard-channel-agent doctor-switch update-channel-switch upgrade-survivor published-upgrade-survivor plugins plugin-update mcp-channels cron-mcp-cleanup openai-web-search-minimal openwebui"
393393
include_openwebui=true
394394
;;
395395
full)

Dockerfile

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ COPY openclaw.mjs ./
6363
COPY ui/package.json ./ui/package.json
6464
COPY patches ./patches
6565
COPY scripts/postinstall-bundled-plugins.mjs scripts/preinstall-package-manager-warning.mjs scripts/npm-runner.mjs scripts/windows-cmd-helpers.mjs ./scripts/
66-
COPY scripts/lib/bundled-runtime-deps-install.mjs ./scripts/lib/bundled-runtime-deps-install.mjs
6766
COPY scripts/lib/package-dist-imports.mjs ./scripts/lib/package-dist-imports.mjs
6867

6968
COPY --from=ext-deps /out/ ./${OPENCLAW_BUNDLED_PLUGIN_DIR}/
@@ -268,12 +267,10 @@ RUN --mount=type=cache,id=openclaw-bookworm-apt-cache,target=/var/cache/apt,shar
268267
RUN ln -sf /app/openclaw.mjs /usr/local/bin/openclaw \
269268
&& chmod 755 /app/openclaw.mjs
270269

271-
# Pre-create the default state and runtime-deps dirs so first-run Docker named
272-
# volumes mounted here inherit node ownership instead of root-owned state.
270+
# Pre-create the default state dir so first-run Docker named volumes mounted
271+
# here inherit node ownership instead of root-owned state.
273272
RUN install -d -m 0700 -o node -g node /home/node/.openclaw && \
274-
install -d -m 0700 -o node -g node /var/lib/openclaw/plugin-runtime-deps && \
275-
stat -c '%U:%G %a' /home/node/.openclaw | grep -qx 'node:node 700' && \
276-
stat -c '%U:%G %a' /var/lib/openclaw/plugin-runtime-deps | grep -qx 'node:node 700'
273+
stat -c '%U:%G %a' /home/node/.openclaw | grep -qx 'node:node 700'
277274

278275
ENV NODE_ENV=production
279276

docker-compose.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,10 @@ services:
2323
CLAUDE_AI_SESSION_KEY: ${CLAUDE_AI_SESSION_KEY:-}
2424
CLAUDE_WEB_SESSION_KEY: ${CLAUDE_WEB_SESSION_KEY:-}
2525
CLAUDE_WEB_COOKIE: ${CLAUDE_WEB_COOKIE:-}
26-
OPENCLAW_PLUGIN_STAGE_DIR: /var/lib/openclaw/plugin-runtime-deps
2726
TZ: ${OPENCLAW_TZ:-UTC}
2827
volumes:
2928
- ${OPENCLAW_CONFIG_DIR:-${HOME:-/tmp}/.openclaw}:/home/node/.openclaw
3029
- ${OPENCLAW_WORKSPACE_DIR:-${HOME:-/tmp}/.openclaw/workspace}:/home/node/.openclaw/workspace
31-
- openclaw-plugin-runtime-deps:/var/lib/openclaw/plugin-runtime-deps
3230
## Uncomment the lines below to enable sandbox isolation
3331
## (agents.defaults.sandbox). Requires Docker CLI in the image
3432
## (build with --build-arg OPENCLAW_INSTALL_DOCKER_CLI=1) or use
@@ -87,18 +85,13 @@ services:
8785
CLAUDE_AI_SESSION_KEY: ${CLAUDE_AI_SESSION_KEY:-}
8886
CLAUDE_WEB_SESSION_KEY: ${CLAUDE_WEB_SESSION_KEY:-}
8987
CLAUDE_WEB_COOKIE: ${CLAUDE_WEB_COOKIE:-}
90-
OPENCLAW_PLUGIN_STAGE_DIR: /var/lib/openclaw/plugin-runtime-deps
9188
TZ: ${OPENCLAW_TZ:-UTC}
9289
volumes:
9390
- ${OPENCLAW_CONFIG_DIR:-${HOME:-/tmp}/.openclaw}:/home/node/.openclaw
9491
- ${OPENCLAW_WORKSPACE_DIR:-${HOME:-/tmp}/.openclaw/workspace}:/home/node/.openclaw/workspace
95-
- openclaw-plugin-runtime-deps:/var/lib/openclaw/plugin-runtime-deps
9692
stdin_open: true
9793
tty: true
9894
init: true
9995
entrypoint: ["node", "dist/index.js"]
10096
depends_on:
10197
- openclaw-gateway
102-
103-
volumes:
104-
openclaw-plugin-runtime-deps:

docs/channels/qqbot.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,16 @@ QQ Bot connects to OpenClaw via the official QQ Bot API (WebSocket gateway). The
1111
plugin supports C2C private chat, group @messages, and guild channel messages with
1212
rich media (images, voice, video, files).
1313

14-
Status: bundled plugin. Direct messages, group chats, guild channels, and
14+
Status: downloadable plugin. Direct messages, group chats, guild channels, and
1515
media are supported. Reactions and threads are not supported.
1616

17-
## Bundled plugin
17+
## Install
1818

19-
Current OpenClaw releases bundle QQ Bot, so normal packaged builds do not need
20-
a separate `openclaw plugins install` step.
19+
Install QQ Bot before setup:
20+
21+
```bash
22+
openclaw plugins install @openclaw/qqbot
23+
```
2124

2225
## Setup
2326

0 commit comments

Comments
 (0)