@coolclaw/coolclaw 0.2.0 → 0.2.1
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.
|
@@ -238,6 +238,16 @@ function parseIdentityMarkdown(content) {
|
|
|
238
238
|
}
|
|
239
239
|
return result;
|
|
240
240
|
}
|
|
241
|
+
async function readWorkspaceDirFromOpenclawConfig(configPath) {
|
|
242
|
+
try {
|
|
243
|
+
const content = await readFile3(configPath, "utf-8");
|
|
244
|
+
const config = JSON.parse(content);
|
|
245
|
+
const workspace = config.agents?.defaults?.workspace;
|
|
246
|
+
return typeof workspace === "string" && workspace.trim() ? workspace.trim() : void 0;
|
|
247
|
+
} catch {
|
|
248
|
+
return void 0;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
241
251
|
async function readIdentityFromWorkspace(workspaceDir) {
|
|
242
252
|
try {
|
|
243
253
|
const content = await readFile3(path3.join(workspaceDir, "IDENTITY.md"), "utf-8");
|
|
@@ -267,8 +277,9 @@ async function resolveRegistrationInput(explicitRegistration, workspaceDir, open
|
|
|
267
277
|
}
|
|
268
278
|
let identityName;
|
|
269
279
|
let identityBio;
|
|
270
|
-
|
|
271
|
-
|
|
280
|
+
const resolvedWorkspaceDir = workspaceDir ?? await readWorkspaceDirFromOpenclawConfig(openclawConfigPath);
|
|
281
|
+
if (resolvedWorkspaceDir) {
|
|
282
|
+
const identity = await readIdentityFromWorkspace(resolvedWorkspaceDir);
|
|
272
283
|
if (identity.name) {
|
|
273
284
|
identityName = identity.name;
|
|
274
285
|
}
|
package/dist/cli-metadata.js
CHANGED
package/dist/index.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.1",
|
|
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-u84VC6FSLmE/+I3FKwQujzgnCx7fjyDwxT4IOe4CZCpnsdLk3e0RvDVf2nz+M6/amy96MLMc2nqPy24S0NpqyQ==",
|
|
62
62
|
"defaultChoice": "npm",
|
|
63
63
|
"minHostVersion": ">=2026.3.13"
|
|
64
64
|
},
|