@coolclaw/coolclaw 0.2.3 → 0.2.5
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.
|
@@ -75,7 +75,7 @@ import path from "path";
|
|
|
75
75
|
import { fileURLToPath } from "url";
|
|
76
76
|
var RIDDLE_BINDING_VERSION = 1;
|
|
77
77
|
function defaultBindingFile(home = homedir2()) {
|
|
78
|
-
return path.join(home, ".config", "
|
|
78
|
+
return path.join(home, ".config", "coolclaw", "agent_binding.json");
|
|
79
79
|
}
|
|
80
80
|
function defaultOpenClawConfigFile(home = homedir2()) {
|
|
81
81
|
return path.join(home, ".openclaw", "openclaw.json");
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
saveAgentToken,
|
|
10
10
|
saveBinding,
|
|
11
11
|
touchBinding
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-BPNTPLYX.js";
|
|
13
13
|
|
|
14
14
|
// src/setup.ts
|
|
15
15
|
import { access } from "fs/promises";
|
|
@@ -80,8 +80,11 @@ async function patchCoolclawAccountConfig(patch) {
|
|
|
80
80
|
tokenSecretRef: patch.tokenSecretRef,
|
|
81
81
|
dmPolicy: patch.dmPolicy ?? "open"
|
|
82
82
|
};
|
|
83
|
+
const effectiveDmPolicy = account.dmPolicy;
|
|
83
84
|
if (patch.allowFrom && patch.allowFrom.length > 0) {
|
|
84
85
|
account.allowFrom = patch.allowFrom;
|
|
86
|
+
} else if (effectiveDmPolicy === "open") {
|
|
87
|
+
account.allowFrom = ["*"];
|
|
85
88
|
}
|
|
86
89
|
accounts.default = account;
|
|
87
90
|
await writeOpenClawConfig(patch.configPath, config);
|
|
@@ -314,7 +317,7 @@ async function resolveRegistrationInput(explicitRegistration, workspaceDir, open
|
|
|
314
317
|
function registerCoolclawCli(options) {
|
|
315
318
|
const setup = options.setup ?? runCoolclawSetup;
|
|
316
319
|
const coolclaw = options.program.command("coolclaw").description("Manage the CoolClaw/Riddle channel");
|
|
317
|
-
coolclaw.command("setup").description("Register or reuse a Riddle agent and configure the CoolClaw channel").option("--gateway-url <url>", "Riddle gateway URL", "https://agits-xa.baidu.com/riddle").option("--binding-file <path>", "Shared Riddle binding file", defaultBindingFile()).option("--openclaw-config <path>", "OpenClaw config file").option("--workspace-dir <path>", "OpenClaw agent workspace directory", options.workspaceDir).option("--name <name>", "Riddle agent display name").option("--bio <bio>", "Riddle agent bio").option("--tags <tags>", "Riddle agent tags").option("--allow-from <items>", "Comma-separated DM allowlist").option("--dm-policy <policy>", "DM policy: allowlist or pairing", "
|
|
320
|
+
coolclaw.command("setup").description("Register or reuse a Riddle agent and configure the CoolClaw channel").option("--gateway-url <url>", "Riddle gateway URL", "https://agits-xa.baidu.com/riddle").option("--binding-file <path>", "Shared Riddle binding file", defaultBindingFile()).option("--openclaw-config <path>", "OpenClaw config file").option("--workspace-dir <path>", "OpenClaw agent workspace directory", options.workspaceDir).option("--name <name>", "Riddle agent display name").option("--bio <bio>", "Riddle agent bio").option("--tags <tags>", "Riddle agent tags").option("--allow-from <items>", "Comma-separated DM allowlist").option("--dm-policy <policy>", "DM policy: allowlist or pairing", "open").option("--force-register", "Register a new Riddle agent even if a valid binding exists", false).option("--dry-run", "Resolve setup inputs without writing local files", false).option("-y, --yes", "Accept defaults for non-interactive setup", false).action(async (...args) => {
|
|
318
321
|
const rawOptions = readActionOptions(args);
|
|
319
322
|
const result = await setup(toSetupOptions(rawOptions));
|
|
320
323
|
console.log(JSON.stringify(result, null, 2));
|
|
@@ -341,7 +344,7 @@ function toSetupOptions(raw) {
|
|
|
341
344
|
tags: stringOption(raw.tags) ?? JSON.stringify(["assistant", "openclaw", "coolclaw"])
|
|
342
345
|
} : void 0,
|
|
343
346
|
allowFrom: splitCsv(stringOption(raw.allowFrom)),
|
|
344
|
-
dmPolicy: raw.dmPolicy === "pairing" ? "pairing" : "
|
|
347
|
+
dmPolicy: raw.dmPolicy === "pairing" ? "pairing" : "open",
|
|
345
348
|
forceRegister: Boolean(raw.forceRegister),
|
|
346
349
|
dryRun: Boolean(raw.dryRun),
|
|
347
350
|
yes: Boolean(raw.yes)
|
package/dist/cli-metadata.js
CHANGED
package/dist/index.js
CHANGED
package/dist/setup-entry.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coolclaw/coolclaw",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.5",
|
|
4
4
|
"description": "OpenClaw native channel plugin for Riddle/CoolClaw chat.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"runtimeSetupEntry": "./dist/setup-entry.js",
|
|
59
59
|
"install": {
|
|
60
60
|
"npmSpec": "@coolclaw/coolclaw",
|
|
61
|
-
"expectedIntegrity": "sha512-
|
|
61
|
+
"expectedIntegrity": "sha512-4WHp7Zp+9tMVo7foZ/yHFh0DpEP/HD10E85DlBvQHjtRGKTBc8DMY55Wy45Zh8eK5hJLJtj8aZ8nKCfdpOZ7Eg==",
|
|
62
62
|
"defaultChoice": "npm",
|
|
63
63
|
"minHostVersion": ">=2026.3.13"
|
|
64
64
|
},
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
},
|
|
75
75
|
"build": {
|
|
76
76
|
"openclawVersion": "2026.4.20",
|
|
77
|
-
"pluginSdkVersion": "2026.4.
|
|
77
|
+
"pluginSdkVersion": "2026.4.29"
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
}
|