@coolclaw/coolclaw 0.2.4 → 0.2.6
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/{channel-BozkcSms.d.ts → channel-C5YYO-tp.d.ts} +1 -1
- package/dist/{chunk-Y7RNWNEB.js → chunk-BMUQJBAA.js} +28 -25
- package/dist/{chunk-DRLI24I7.js → chunk-BPNTPLYX.js} +1 -1
- package/dist/cli-metadata.d.ts +2 -1
- package/dist/cli-metadata.js +2 -2
- package/dist/index.d.ts +10 -20
- package/dist/index.js +4 -6
- package/dist/setup-entry.d.ts +1 -1
- package/dist/setup-entry.js +1 -1
- package/package.json +3 -3
|
@@ -9,7 +9,10 @@ import {
|
|
|
9
9
|
saveAgentToken,
|
|
10
10
|
saveBinding,
|
|
11
11
|
touchBinding
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-BPNTPLYX.js";
|
|
13
|
+
|
|
14
|
+
// index.ts
|
|
15
|
+
import { defineChannelPluginEntry } from "openclaw/plugin-sdk/core";
|
|
13
16
|
|
|
14
17
|
// src/setup.ts
|
|
15
18
|
import { access } from "fs/promises";
|
|
@@ -317,7 +320,7 @@ async function resolveRegistrationInput(explicitRegistration, workspaceDir, open
|
|
|
317
320
|
function registerCoolclawCli(options) {
|
|
318
321
|
const setup = options.setup ?? runCoolclawSetup;
|
|
319
322
|
const coolclaw = options.program.command("coolclaw").description("Manage the CoolClaw/Riddle channel");
|
|
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", "
|
|
323
|
+
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) => {
|
|
321
324
|
const rawOptions = readActionOptions(args);
|
|
322
325
|
const result = await setup(toSetupOptions(rawOptions));
|
|
323
326
|
console.log(JSON.stringify(result, null, 2));
|
|
@@ -344,7 +347,7 @@ function toSetupOptions(raw) {
|
|
|
344
347
|
tags: stringOption(raw.tags) ?? JSON.stringify(["assistant", "openclaw", "coolclaw"])
|
|
345
348
|
} : void 0,
|
|
346
349
|
allowFrom: splitCsv(stringOption(raw.allowFrom)),
|
|
347
|
-
dmPolicy: raw.dmPolicy === "pairing" ? "pairing" : "
|
|
350
|
+
dmPolicy: raw.dmPolicy === "pairing" ? "pairing" : "open",
|
|
348
351
|
forceRegister: Boolean(raw.forceRegister),
|
|
349
352
|
dryRun: Boolean(raw.dryRun),
|
|
350
353
|
yes: Boolean(raw.yes)
|
|
@@ -360,32 +363,32 @@ function splitCsv(value) {
|
|
|
360
363
|
}
|
|
361
364
|
|
|
362
365
|
// index.ts
|
|
363
|
-
|
|
364
|
-
api.registerChannel({ plugin: coolclawChannelPlugin });
|
|
365
|
-
api.registerCli?.(
|
|
366
|
-
({ program, workspaceDir }) => {
|
|
367
|
-
registerCoolclawCli({ program, workspaceDir });
|
|
368
|
-
},
|
|
369
|
-
{
|
|
370
|
-
descriptors: [
|
|
371
|
-
{
|
|
372
|
-
name: "coolclaw",
|
|
373
|
-
description: "Manage the CoolClaw/Riddle channel",
|
|
374
|
-
hasSubcommands: true
|
|
375
|
-
}
|
|
376
|
-
]
|
|
377
|
-
}
|
|
378
|
-
);
|
|
379
|
-
}
|
|
380
|
-
var register = _register;
|
|
381
|
-
var index_default = {
|
|
366
|
+
var index_default = defineChannelPluginEntry({
|
|
382
367
|
id: "coolclaw",
|
|
383
368
|
name: "CoolClaw Channel",
|
|
384
369
|
description: "CoolClaw/Riddle messaging channel for OpenClaw",
|
|
385
|
-
|
|
386
|
-
|
|
370
|
+
plugin: coolclawChannelPlugin,
|
|
371
|
+
registerFull(api) {
|
|
372
|
+
api.registerCli(
|
|
373
|
+
({ program, workspaceDir }) => {
|
|
374
|
+
registerCoolclawCli({
|
|
375
|
+
program,
|
|
376
|
+
workspaceDir
|
|
377
|
+
});
|
|
378
|
+
},
|
|
379
|
+
{
|
|
380
|
+
descriptors: [
|
|
381
|
+
{
|
|
382
|
+
name: "coolclaw",
|
|
383
|
+
description: "Manage the CoolClaw/Riddle channel",
|
|
384
|
+
hasSubcommands: true
|
|
385
|
+
}
|
|
386
|
+
]
|
|
387
|
+
}
|
|
388
|
+
);
|
|
389
|
+
}
|
|
390
|
+
});
|
|
387
391
|
|
|
388
392
|
export {
|
|
389
|
-
register,
|
|
390
393
|
index_default
|
|
391
394
|
};
|
|
@@ -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");
|
package/dist/cli-metadata.d.ts
CHANGED
package/dist/cli-metadata.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,27 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { C as CoolclawChannelPlugin } from './channel-C5YYO-tp.js';
|
|
2
|
+
import * as openclaw_plugin_sdk_core from 'openclaw/plugin-sdk/core';
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
program: unknown;
|
|
9
|
-
workspaceDir?: string;
|
|
10
|
-
}) => void | Promise<void>, opts?: {
|
|
11
|
-
descriptors?: Array<{
|
|
12
|
-
name: string;
|
|
13
|
-
description: string;
|
|
14
|
-
hasSubcommands: boolean;
|
|
15
|
-
}>;
|
|
16
|
-
}): void;
|
|
17
|
-
};
|
|
18
|
-
declare function _register(api: OpenClawPluginApi): void;
|
|
19
|
-
declare const register: typeof _register;
|
|
4
|
+
/**
|
|
5
|
+
* 使用 OpenClaw 官方 SDK 辅助函数定义插件入口。
|
|
6
|
+
* defineChannelPluginEntry 保证导出形状与加载器完全兼容,
|
|
7
|
+
* 避免 Jiti interopDefault 在不同版本间的差异导致 "missing register/activate" 错误。
|
|
8
|
+
*/
|
|
20
9
|
declare const _default: {
|
|
21
10
|
id: string;
|
|
22
11
|
name: string;
|
|
23
12
|
description: string;
|
|
24
|
-
register:
|
|
13
|
+
register: (api: openclaw_plugin_sdk_core.OpenClawPluginApi) => void;
|
|
14
|
+
channelPlugin: CoolclawChannelPlugin;
|
|
25
15
|
};
|
|
26
16
|
|
|
27
|
-
export { _default as default
|
|
17
|
+
export { _default as default };
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
|
-
index_default
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import "./chunk-DRLI24I7.js";
|
|
2
|
+
index_default
|
|
3
|
+
} from "./chunk-BMUQJBAA.js";
|
|
4
|
+
import "./chunk-BPNTPLYX.js";
|
|
6
5
|
export {
|
|
7
|
-
index_default as default
|
|
8
|
-
register
|
|
6
|
+
index_default as default
|
|
9
7
|
};
|
package/dist/setup-entry.d.ts
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.6",
|
|
4
4
|
"description": "OpenClaw native channel plugin for Riddle/CoolClaw chat.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"directory": "plugins/openclaw-coolclaw-channel"
|
|
25
25
|
},
|
|
26
26
|
"scripts": {
|
|
27
|
-
"build": "tsup index.ts setup-entry.ts cli-metadata.ts --format esm --dts --out-dir dist --clean",
|
|
27
|
+
"build": "tsup index.ts setup-entry.ts cli-metadata.ts --format esm --dts --out-dir dist --clean --external openclaw",
|
|
28
28
|
"test": "vitest run",
|
|
29
29
|
"lint": "tsc --noEmit"
|
|
30
30
|
},
|
|
@@ -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-21+YAc9tyYHlS10KamBaj8op+IeltxJVPEa6VvnhyG3b3zxY+A0UDUtIlpLEYb7laxCeHC603//wbuHddkc4cA==",
|
|
62
62
|
"defaultChoice": "npm",
|
|
63
63
|
"minHostVersion": ">=2026.3.13"
|
|
64
64
|
},
|