@reefclaw/connect 0.1.13 → 0.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/plugin.js +24 -15
- package/package.json +1 -1
package/dist/plugin.js
CHANGED
|
@@ -48,27 +48,36 @@ export function installPlugin() {
|
|
|
48
48
|
const cli = which('openclaw');
|
|
49
49
|
if (!cli) {
|
|
50
50
|
fail('the `openclaw` CLI is not on your PATH — cannot register the plugin.');
|
|
51
|
-
info(`Once OpenClaw is on PATH, run: openclaw plugins install --
|
|
51
|
+
info(`Once OpenClaw is on PATH, run: openclaw plugins install --link ${PLUGIN_DIR}`);
|
|
52
|
+
info('(if OpenClaw asks you to rerun with --force, add --force before --link)');
|
|
52
53
|
return { registered: false };
|
|
53
54
|
}
|
|
54
|
-
//
|
|
55
|
-
//
|
|
56
|
-
//
|
|
57
|
-
//
|
|
58
|
-
//
|
|
59
|
-
//
|
|
60
|
-
//
|
|
61
|
-
//
|
|
62
|
-
//
|
|
55
|
+
// Two OpenClaw generations have MUTUALLY EXCLUSIVE requirements here
|
|
56
|
+
// (issue #216, verified against both npm dists):
|
|
57
|
+
// - <= 2026.7.1 hard-REJECTS --force with --link ("--force is not
|
|
58
|
+
// supported with --link", plugins-install-command guard);
|
|
59
|
+
// - >= 2026.7.2 REQUIRES --force for non-ClawHub sources in a non-TTY
|
|
60
|
+
// context (confirmNonClawHubInstall cancels with "rerun with --force").
|
|
61
|
+
// So: try plain --link first (correct on every version that doesn't gate),
|
|
62
|
+
// and only when the CLI's own output asks for --force, retry with it.
|
|
63
|
+
// Acknowledging is correct here — the "source" is our own bundled plugin the
|
|
64
|
+
// user explicitly chose to install by running this installer. The first
|
|
65
|
+
// attempt never passes --force, so any mention of --force in its output is
|
|
66
|
+
// the CLI requesting it, not an echo of our own arguments.
|
|
63
67
|
info('registering the plugin with OpenClaw…');
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
68
|
+
let r = run('openclaw', ['plugins', 'install', '--link', PLUGIN_DIR], { timeoutMs: 300_000 });
|
|
69
|
+
if (!r.ok && `${r.stderr}\n${r.stdout}`.includes('--force')) {
|
|
70
|
+
info('this OpenClaw requires acknowledging non-ClawHub sources — retrying with --force…');
|
|
71
|
+
r = run('openclaw', ['plugins', 'install', '--force', '--link', PLUGIN_DIR], {
|
|
72
|
+
timeoutMs: 300_000,
|
|
73
|
+
});
|
|
74
|
+
}
|
|
67
75
|
if (!r.ok) {
|
|
68
|
-
warn('`openclaw plugins install --
|
|
76
|
+
warn('`openclaw plugins install --link` returned non-zero:');
|
|
69
77
|
if (r.stderr.trim())
|
|
70
78
|
info(r.stderr.trim().split('\n').slice(-3).join('\n'));
|
|
71
|
-
info(`Retry manually: openclaw plugins install --
|
|
79
|
+
info(`Retry manually: openclaw plugins install --link ${PLUGIN_DIR}`);
|
|
80
|
+
info('(if OpenClaw asks you to rerun with --force, add --force before --link)');
|
|
72
81
|
return { registered: false };
|
|
73
82
|
}
|
|
74
83
|
ok('plugin registered with OpenClaw');
|