fix: remove all hardcoded user paths from plugins — dynamic SDK resolution
- 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
This commit is contained in:
@@ -13,7 +13,7 @@ import type {
|
||||
AcpRuntimeHandle,
|
||||
AcpRuntimeStatus,
|
||||
AcpRuntimeTurnInput,
|
||||
} from '/home/woltjejason/.npm-global/lib/node_modules/openclaw/dist/plugin-sdk/acp-runtime.js';
|
||||
} from './acp-runtime-types.js';
|
||||
|
||||
export interface MacpRuntimeConfig {
|
||||
defaultModel: string;
|
||||
@@ -80,9 +80,9 @@ const MACP_CAPABILITIES: AcpRuntimeCapabilities = {
|
||||
controls: [],
|
||||
};
|
||||
|
||||
const DEFAULT_REPO_ROOT = '~/src/mosaic-stack-new';
|
||||
const DEFAULT_REPO_ROOT = '~/src/mosaic-stack';
|
||||
const ORCHESTRATOR_RUN_PATH = '~/.config/mosaic/bin/mosaic-orchestrator-run';
|
||||
const PI_RUNNER_PATH = '/home/woltjejason/src/mosaic-stack-new/tools/macp/dispatcher/pi_runner.ts';
|
||||
const PI_RUNNER_PATH = path.join(os.homedir(), 'src', 'mosaic-stack', 'tools', 'macp', 'dispatcher', 'pi_runner.ts');
|
||||
|
||||
function expandHome(rawPath: string): string {
|
||||
if (rawPath === '~') {
|
||||
|
||||
Reference in New Issue
Block a user