@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.
Files changed (2) hide show
  1. package/dist/plugin.js +24 -15
  2. 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 --force --link ${PLUGIN_DIR}`);
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
- // --force is REQUIRED on openclaw >= 2026.7.2 (issue #216): non-ClawHub
55
- // sources (incl. local paths) need an acknowledgement, and in a non-TTY
56
- // context the install is cancelled with "rerun with --force" instead of
57
- // prompting. Acknowledging is correct here — the "source" is our own bundled
58
- // plugin the user explicitly chose to install by running this installer.
59
- // On <= 2026.7.1, --force only means overwrite-an-existing-install, which
60
- // also makes installer re-runs idempotent instead of failing on the exists
61
- // check. Verified against both dists' plugins-install command + the beta's
62
- // confirmNonClawHubInstall (install cancelled when !TTY && !force).
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
- const r = run('openclaw', ['plugins', 'install', '--force', '--link', PLUGIN_DIR], {
65
- timeoutMs: 300_000,
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 --force --link` returned non-zero:');
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 --force --link ${PLUGIN_DIR}`);
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');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reefclaw/connect",
3
- "version": "0.1.13",
3
+ "version": "0.1.14",
4
4
  "description": "One-command installer that connects your OpenClaw agent to ReefClaw (paper trading, no exchange keys).",
5
5
  "type": "module",
6
6
  "bin": {