fix: remove all hardcoded user paths — dynamic OC SDK resolution #333

Merged
jason.woltje merged 1 commits from fix/macp-dynamic-sdk-resolution into main 2026-03-30 19:55:22 +00:00
Owner

Zero hardcoded /home/ paths in any plugin source file.

Approach:

  • plugins/macp/src/index.ts: uses createRequire + dynamic import() to resolve the OC plugin SDK at runtime from wherever openclaw is globally installed
  • plugins/macp/src/acp-runtime-types.ts: local TypeScript interface definitions mirroring the OC ACP runtime contract — compiles without the SDK present
  • plugins/macp/src/macp-runtime.ts: DEFAULT_REPO_ROOT and PI_RUNNER_PATH use os.homedir() + path.join() instead of literal paths
  • plugins/mosaic-framework/src/index.ts: SDK type import replaced with local type

This plugin will now compile and run on any machine with openclaw installed globally via npm.

**Zero hardcoded `/home/` paths in any plugin source file.** Approach: - `plugins/macp/src/index.ts`: uses `createRequire` + dynamic `import()` to resolve the OC plugin SDK at runtime from wherever `openclaw` is globally installed - `plugins/macp/src/acp-runtime-types.ts`: local TypeScript interface definitions mirroring the OC ACP runtime contract — compiles without the SDK present - `plugins/macp/src/macp-runtime.ts`: `DEFAULT_REPO_ROOT` and `PI_RUNNER_PATH` use `os.homedir()` + `path.join()` instead of literal paths - `plugins/mosaic-framework/src/index.ts`: SDK type import replaced with local type This plugin will now compile and run on any machine with `openclaw` installed globally via npm.
jason.woltje added 1 commit 2026-03-30 19:55:21 +00:00
fix: remove all hardcoded user paths from plugins — dynamic SDK resolution
Some checks failed
ci/woodpecker/push/ci Pipeline failed
ci/woodpecker/pr/ci Pipeline failed
281e636e4d
- plugins/macp/src/index.ts: use createRequire + dynamic import() for OC SDK
- plugins/macp/src/acp-runtime-types.ts: local ACP runtime type definitions
- plugins/macp/src/macp-runtime.ts: DEFAULT_REPO_ROOT and PI_RUNNER_PATH use
  os.homedir() instead of hardcoded /home/user/
- plugins/mosaic-framework/src/index.ts: removed hardcoded SDK import
- No hardcoded /home/ paths remain in any plugin source file
- Plugin works on any machine with openclaw installed globally
jason.woltje merged commit da41724490 into main 2026-03-30 19:55:22 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mosaicstack/stack#333