HarborForge.OpenclawPlugin: dev-2026-03-29 -> main #4

Merged
hzhang merged 15 commits from dev-2026-03-29 into main 2026-04-05 22:09:30 +00:00
Showing only changes of commit ff5c07a38c - Show all commits

View File

@@ -30,6 +30,7 @@ const PLUGIN_NAME = 'harbor-forge';
const OLD_PLUGIN_NAME = 'harborforge-monitor';
const PLUGIN_SRC_DIR = join(__dirname, 'plugin');
const SKILLS_SRC_DIR = join(__dirname, 'skills');
const MONITOR_REPO_URL = 'https://git.hangman-lab.top/zhi/HarborForge.Monitor.git';
const args = process.argv.slice(2);
const options = {
@@ -182,15 +183,12 @@ async function build() {
function installManagedMonitor(openclawPath) {
if (options.installMonitor !== 'yes') return null;
const projectRoot = resolve(__dirname, '..');
const gitRoot = exec('git config --get remote.origin.url', { cwd: projectRoot, silent: true }).trim();
const monitorRepo = gitRoot.replace(/HarborForge\.OpenclawPlugin(\.git)?$/, 'HarborForge.Monitor.git');
const tmpDir = join('/tmp', `harborforge-monitor-${Date.now()}`);
const monitorDestDir = join(openclawPath, 'plugins', PLUGIN_NAME, 'bin');
const binaryPath = join(monitorDestDir, 'HarborForge.Monitor');
mkdirSync(monitorDestDir, { recursive: true });
try {
exec(`git clone --branch ${shellEscape(options.monitorBranch)} ${shellEscape(monitorRepo)} ${shellEscape(tmpDir)}`, { silent: !options.verbose });
exec(`git clone --branch ${shellEscape(options.monitorBranch)} ${shellEscape(MONITOR_REPO_URL)} ${shellEscape(tmpDir)}`, { silent: !options.verbose });
exec(`go build -o ${shellEscape(binaryPath)} ./cmd/harborforge-monitor`, { cwd: tmpDir, silent: !options.verbose });
chmodSync(binaryPath, 0o755);
logOk(`Managed monitor installed → ${binaryPath} (branch hint: ${options.monitorBranch})`);