claw-control-center 0.1.5 → 0.1.7
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/index.cjs +37 -57
- package/dist/install-qclaw.cjs +36 -52
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -5408,10 +5408,6 @@ var import_node_os = require("os");
|
|
|
5408
5408
|
var import_node_path3 = require("path");
|
|
5409
5409
|
var SENSITIVE_KEY_PATTERN = /(token|secret|password|key|credential)/i;
|
|
5410
5410
|
function detectHostKind(pathHint) {
|
|
5411
|
-
const normalized = (pathHint ?? "").replaceAll("\\", "/").toLowerCase();
|
|
5412
|
-
if (normalized.includes("/.qclaw") || normalized.includes("/.qclow")) {
|
|
5413
|
-
return "qclaw";
|
|
5414
|
-
}
|
|
5415
5411
|
return "openclaw";
|
|
5416
5412
|
}
|
|
5417
5413
|
function resolvePluginConfig(config) {
|
|
@@ -6657,7 +6653,7 @@ function createGatewayClient(config) {
|
|
|
6657
6653
|
await transport.request("chat.send", {
|
|
6658
6654
|
sessionKey: sessionId,
|
|
6659
6655
|
message: content,
|
|
6660
|
-
deliver:
|
|
6656
|
+
deliver: false,
|
|
6661
6657
|
idempotencyKey: (0, import_node_crypto3.randomUUID)()
|
|
6662
6658
|
});
|
|
6663
6659
|
},
|
|
@@ -8865,30 +8861,10 @@ function toRecord3(value) {
|
|
|
8865
8861
|
var import_node_crypto4 = require("crypto");
|
|
8866
8862
|
var import_promises4 = require("fs/promises");
|
|
8867
8863
|
var import_node_fs4 = require("fs");
|
|
8868
|
-
var import_node_os2 = require("os");
|
|
8869
8864
|
var import_node_path6 = require("path");
|
|
8870
8865
|
var PLUGIN_ID = "claw-control-center";
|
|
8871
8866
|
var LEGACY_PLUGIN_ID = "53ai-openclaw";
|
|
8872
|
-
var DEFAULT_QCLAW_HOME = (0, import_node_path6.resolve)((0, import_node_os2.homedir)(), ".qclaw");
|
|
8873
|
-
var DEFAULT_OPENCLAW_HOME = (0, import_node_path6.resolve)((0, import_node_os2.homedir)(), ".openclaw");
|
|
8874
|
-
var DEFAULT_EXTENSIONS_DIR = (0, import_node_path6.resolve)(
|
|
8875
|
-
(0, import_node_os2.homedir)(),
|
|
8876
|
-
"Library/Application Support/QClaw/openclaw/config/extensions"
|
|
8877
|
-
);
|
|
8878
|
-
var DEFAULT_OPENCLAW_EXTENSIONS_DIR = (0, import_node_path6.resolve)(DEFAULT_OPENCLAW_HOME, "extensions");
|
|
8879
8867
|
var COPY_ITEMS = ["dist", "openclaw.plugin.json", "package.json", "bin", "web-dist"];
|
|
8880
|
-
var INSTALL_TARGETS = {
|
|
8881
|
-
qclaw: {
|
|
8882
|
-
label: "QClaw",
|
|
8883
|
-
defaultConfigPath: (0, import_node_path6.join)(DEFAULT_QCLAW_HOME, "openclaw.json"),
|
|
8884
|
-
defaultExtensionsDir: DEFAULT_EXTENSIONS_DIR
|
|
8885
|
-
},
|
|
8886
|
-
openclaw: {
|
|
8887
|
-
label: "OpenClaw",
|
|
8888
|
-
defaultConfigPath: (0, import_node_path6.join)(DEFAULT_OPENCLAW_HOME, "openclaw.json"),
|
|
8889
|
-
defaultExtensionsDir: DEFAULT_OPENCLAW_EXTENSIONS_DIR
|
|
8890
|
-
}
|
|
8891
|
-
};
|
|
8892
8868
|
async function installIntoQClaw(input) {
|
|
8893
8869
|
return installIntoHost(input, "QClaw");
|
|
8894
8870
|
}
|
|
@@ -9002,42 +8978,52 @@ async function runInstallCommand(input) {
|
|
|
9002
8978
|
throw new Error("expected subcommand: install");
|
|
9003
8979
|
}
|
|
9004
8980
|
const args = parseArgs(argv.slice(1));
|
|
9005
|
-
const
|
|
9006
|
-
|
|
9007
|
-
|
|
9008
|
-
|
|
9009
|
-
|
|
9010
|
-
|
|
9011
|
-
|
|
9012
|
-
|
|
9013
|
-
|
|
9014
|
-
|
|
9015
|
-
|
|
9016
|
-
|
|
9017
|
-
|
|
9018
|
-
|
|
9019
|
-
|
|
9020
|
-
|
|
9021
|
-
|
|
9022
|
-
|
|
9023
|
-
|
|
9024
|
-
|
|
9025
|
-
hubEnabled: parseOptionalBoolean(args["hub-enabled"]),
|
|
9026
|
-
consoleHost: args["console-host"],
|
|
9027
|
-
consolePort: args["console-port"] ? Number(args["console-port"]) : void 0
|
|
9028
|
-
});
|
|
8981
|
+
const destination = resolveInstallDestination(args);
|
|
8982
|
+
const result = await installIntoHost(
|
|
8983
|
+
{
|
|
8984
|
+
packageRoot: input.packageRoot,
|
|
8985
|
+
extensionsDir: destination.extensionsDir,
|
|
8986
|
+
configPath: destination.configPath,
|
|
8987
|
+
gateway: args.gateway,
|
|
8988
|
+
botId: args["bot-id"],
|
|
8989
|
+
secret: args.secret,
|
|
8990
|
+
preferResponsesApi: parseOptionalBoolean(args["prefer-responses-api"]),
|
|
8991
|
+
gatewayModel: args["gateway-model"],
|
|
8992
|
+
hubWsUrl: args["hub-ws-url"],
|
|
8993
|
+
hubBotId: args["hub-bot-id"],
|
|
8994
|
+
hubSecret: args["hub-secret"],
|
|
8995
|
+
hubEnabled: parseOptionalBoolean(args["hub-enabled"]),
|
|
8996
|
+
consoleHost: args["console-host"],
|
|
8997
|
+
consolePort: args["console-port"] ? Number(args["console-port"]) : void 0
|
|
8998
|
+
},
|
|
8999
|
+
"Claw"
|
|
9000
|
+
);
|
|
9029
9001
|
process.stdout.write(
|
|
9030
9002
|
[
|
|
9031
|
-
`Installed ${PLUGIN_ID} into
|
|
9003
|
+
`Installed ${PLUGIN_ID} into Claw.`,
|
|
9032
9004
|
`Extensions: ${result.extensionsDir}`,
|
|
9033
9005
|
`Config: ${result.configPath}`,
|
|
9034
9006
|
`Gateway: ${result.gatewayBaseUrl}`,
|
|
9035
9007
|
`53AIHub: ${result.hub53aiConfigured ? "configured" : "not configured"}`,
|
|
9036
9008
|
`Plugin build: ${result.pluginBuild}`,
|
|
9037
|
-
|
|
9009
|
+
"Restart your Claw host to load the plugin."
|
|
9038
9010
|
].join("\n") + "\n"
|
|
9039
9011
|
);
|
|
9040
9012
|
}
|
|
9013
|
+
function resolveInstallDestination(args) {
|
|
9014
|
+
if (args.target !== void 0) {
|
|
9015
|
+
throw new Error("--target is no longer supported; pass --config-path and --extensions-dir from your Claw host");
|
|
9016
|
+
}
|
|
9017
|
+
const explicitConfigPath = args["config-path"] ? (0, import_node_path6.resolve)(args["config-path"]) : void 0;
|
|
9018
|
+
const explicitExtensionsDir = args["extensions-dir"] ? (0, import_node_path6.resolve)(args["extensions-dir"]) : void 0;
|
|
9019
|
+
if (!explicitConfigPath || !explicitExtensionsDir) {
|
|
9020
|
+
throw new Error("missing --config-path and --extensions-dir; provide the paths generated by your Claw host");
|
|
9021
|
+
}
|
|
9022
|
+
return {
|
|
9023
|
+
configPath: explicitConfigPath,
|
|
9024
|
+
extensionsDir: explicitExtensionsDir
|
|
9025
|
+
};
|
|
9026
|
+
}
|
|
9041
9027
|
function parseArgs(argv) {
|
|
9042
9028
|
const parsed = {};
|
|
9043
9029
|
for (let index = 0; index < argv.length; index += 1) {
|
|
@@ -9055,12 +9041,6 @@ function parseArgs(argv) {
|
|
|
9055
9041
|
}
|
|
9056
9042
|
return parsed;
|
|
9057
9043
|
}
|
|
9058
|
-
function parseInstallTarget(target) {
|
|
9059
|
-
if (target === "qclaw" || target === "openclaw") {
|
|
9060
|
-
return target;
|
|
9061
|
-
}
|
|
9062
|
-
return void 0;
|
|
9063
|
-
}
|
|
9064
9044
|
async function copyPublishablePackage(packageRoot, destination) {
|
|
9065
9045
|
if (!(0, import_node_fs4.existsSync)(packageRoot)) {
|
|
9066
9046
|
throw new Error(`package root does not exist: ${packageRoot}`);
|
package/dist/install-qclaw.cjs
CHANGED
|
@@ -28,30 +28,10 @@ module.exports = __toCommonJS(install_qclaw_exports);
|
|
|
28
28
|
var import_node_crypto = require("crypto");
|
|
29
29
|
var import_promises = require("fs/promises");
|
|
30
30
|
var import_node_fs = require("fs");
|
|
31
|
-
var import_node_os = require("os");
|
|
32
31
|
var import_node_path = require("path");
|
|
33
32
|
var PLUGIN_ID = "claw-control-center";
|
|
34
33
|
var LEGACY_PLUGIN_ID = "53ai-openclaw";
|
|
35
|
-
var DEFAULT_QCLAW_HOME = (0, import_node_path.resolve)((0, import_node_os.homedir)(), ".qclaw");
|
|
36
|
-
var DEFAULT_OPENCLAW_HOME = (0, import_node_path.resolve)((0, import_node_os.homedir)(), ".openclaw");
|
|
37
|
-
var DEFAULT_EXTENSIONS_DIR = (0, import_node_path.resolve)(
|
|
38
|
-
(0, import_node_os.homedir)(),
|
|
39
|
-
"Library/Application Support/QClaw/openclaw/config/extensions"
|
|
40
|
-
);
|
|
41
|
-
var DEFAULT_OPENCLAW_EXTENSIONS_DIR = (0, import_node_path.resolve)(DEFAULT_OPENCLAW_HOME, "extensions");
|
|
42
34
|
var COPY_ITEMS = ["dist", "openclaw.plugin.json", "package.json", "bin", "web-dist"];
|
|
43
|
-
var INSTALL_TARGETS = {
|
|
44
|
-
qclaw: {
|
|
45
|
-
label: "QClaw",
|
|
46
|
-
defaultConfigPath: (0, import_node_path.join)(DEFAULT_QCLAW_HOME, "openclaw.json"),
|
|
47
|
-
defaultExtensionsDir: DEFAULT_EXTENSIONS_DIR
|
|
48
|
-
},
|
|
49
|
-
openclaw: {
|
|
50
|
-
label: "OpenClaw",
|
|
51
|
-
defaultConfigPath: (0, import_node_path.join)(DEFAULT_OPENCLAW_HOME, "openclaw.json"),
|
|
52
|
-
defaultExtensionsDir: DEFAULT_OPENCLAW_EXTENSIONS_DIR
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
35
|
async function installIntoQClaw(input) {
|
|
56
36
|
return installIntoHost(input, "QClaw");
|
|
57
37
|
}
|
|
@@ -165,42 +145,52 @@ async function runInstallCommand(input) {
|
|
|
165
145
|
throw new Error("expected subcommand: install");
|
|
166
146
|
}
|
|
167
147
|
const args = parseArgs(argv.slice(1));
|
|
168
|
-
const
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
hubEnabled: parseOptionalBoolean(args["hub-enabled"]),
|
|
189
|
-
consoleHost: args["console-host"],
|
|
190
|
-
consolePort: args["console-port"] ? Number(args["console-port"]) : void 0
|
|
191
|
-
});
|
|
148
|
+
const destination = resolveInstallDestination(args);
|
|
149
|
+
const result = await installIntoHost(
|
|
150
|
+
{
|
|
151
|
+
packageRoot: input.packageRoot,
|
|
152
|
+
extensionsDir: destination.extensionsDir,
|
|
153
|
+
configPath: destination.configPath,
|
|
154
|
+
gateway: args.gateway,
|
|
155
|
+
botId: args["bot-id"],
|
|
156
|
+
secret: args.secret,
|
|
157
|
+
preferResponsesApi: parseOptionalBoolean(args["prefer-responses-api"]),
|
|
158
|
+
gatewayModel: args["gateway-model"],
|
|
159
|
+
hubWsUrl: args["hub-ws-url"],
|
|
160
|
+
hubBotId: args["hub-bot-id"],
|
|
161
|
+
hubSecret: args["hub-secret"],
|
|
162
|
+
hubEnabled: parseOptionalBoolean(args["hub-enabled"]),
|
|
163
|
+
consoleHost: args["console-host"],
|
|
164
|
+
consolePort: args["console-port"] ? Number(args["console-port"]) : void 0
|
|
165
|
+
},
|
|
166
|
+
"Claw"
|
|
167
|
+
);
|
|
192
168
|
process.stdout.write(
|
|
193
169
|
[
|
|
194
|
-
`Installed ${PLUGIN_ID} into
|
|
170
|
+
`Installed ${PLUGIN_ID} into Claw.`,
|
|
195
171
|
`Extensions: ${result.extensionsDir}`,
|
|
196
172
|
`Config: ${result.configPath}`,
|
|
197
173
|
`Gateway: ${result.gatewayBaseUrl}`,
|
|
198
174
|
`53AIHub: ${result.hub53aiConfigured ? "configured" : "not configured"}`,
|
|
199
175
|
`Plugin build: ${result.pluginBuild}`,
|
|
200
|
-
|
|
176
|
+
"Restart your Claw host to load the plugin."
|
|
201
177
|
].join("\n") + "\n"
|
|
202
178
|
);
|
|
203
179
|
}
|
|
180
|
+
function resolveInstallDestination(args) {
|
|
181
|
+
if (args.target !== void 0) {
|
|
182
|
+
throw new Error("--target is no longer supported; pass --config-path and --extensions-dir from your Claw host");
|
|
183
|
+
}
|
|
184
|
+
const explicitConfigPath = args["config-path"] ? (0, import_node_path.resolve)(args["config-path"]) : void 0;
|
|
185
|
+
const explicitExtensionsDir = args["extensions-dir"] ? (0, import_node_path.resolve)(args["extensions-dir"]) : void 0;
|
|
186
|
+
if (!explicitConfigPath || !explicitExtensionsDir) {
|
|
187
|
+
throw new Error("missing --config-path and --extensions-dir; provide the paths generated by your Claw host");
|
|
188
|
+
}
|
|
189
|
+
return {
|
|
190
|
+
configPath: explicitConfigPath,
|
|
191
|
+
extensionsDir: explicitExtensionsDir
|
|
192
|
+
};
|
|
193
|
+
}
|
|
204
194
|
function parseArgs(argv) {
|
|
205
195
|
const parsed = {};
|
|
206
196
|
for (let index = 0; index < argv.length; index += 1) {
|
|
@@ -218,12 +208,6 @@ function parseArgs(argv) {
|
|
|
218
208
|
}
|
|
219
209
|
return parsed;
|
|
220
210
|
}
|
|
221
|
-
function parseInstallTarget(target) {
|
|
222
|
-
if (target === "qclaw" || target === "openclaw") {
|
|
223
|
-
return target;
|
|
224
|
-
}
|
|
225
|
-
return void 0;
|
|
226
|
-
}
|
|
227
211
|
async function copyPublishablePackage(packageRoot, destination) {
|
|
228
212
|
if (!(0, import_node_fs.existsSync)(packageRoot)) {
|
|
229
213
|
throw new Error(`package root does not exist: ${packageRoot}`);
|