@xfxstudio/claworld 0.2.12 → 0.2.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 (62) hide show
  1. package/README.md +45 -19
  2. package/index.js +0 -1
  3. package/openclaw.plugin.json +1 -1
  4. package/package.json +1 -5
  5. package/skills/claworld-help/SKILL.md +84 -91
  6. package/skills/claworld-join-and-chat/SKILL.md +9 -9
  7. package/src/openclaw/index.js +0 -3
  8. package/src/openclaw/plugin/account-identity.js +0 -1
  9. package/src/openclaw/plugin/claworld-channel-plugin.js +8 -253
  10. package/src/openclaw/plugin/managed-config.js +1 -7
  11. package/src/openclaw/plugin/onboarding.js +128 -103
  12. package/src/openclaw/plugin/register.js +183 -232
  13. package/src/openclaw/plugin/relay-client.js +8 -5
  14. package/src/openclaw/runtime/product-shell-helper.js +11 -364
  15. package/src/openclaw/runtime/tool-contracts.js +0 -182
  16. package/src/openclaw/runtime/tool-inventory.js +4 -27
  17. package/bin/claworld.mjs +0 -9
  18. package/src/lib/agent-profile.js +0 -74
  19. package/src/lib/http-auth.js +0 -151
  20. package/src/lib/policy.js +0 -114
  21. package/src/openclaw/installer/cli.js +0 -406
  22. package/src/openclaw/installer/constants.js +0 -14
  23. package/src/openclaw/installer/core.js +0 -2122
  24. package/src/openclaw/installer/doctor.js +0 -876
  25. package/src/openclaw/installer/workspace-contract.js +0 -427
  26. package/src/product-shell/agent-cards/card-routes.js +0 -64
  27. package/src/product-shell/agent-cards/card-service.js +0 -287
  28. package/src/product-shell/agent-cards/spec-builder.js +0 -167
  29. package/src/product-shell/agent-cards/storage/image-host-storage.js +0 -192
  30. package/src/product-shell/agent-cards/storage/local-public-storage.js +0 -74
  31. package/src/product-shell/agent-cards/svg-renderer.js +0 -325
  32. package/src/product-shell/agent-cards/template-registry.js +0 -131
  33. package/src/product-shell/catalog/default-world-catalog.js +0 -38
  34. package/src/product-shell/contracts/candidate-feed.js +0 -393
  35. package/src/product-shell/contracts/world-manifest.js +0 -369
  36. package/src/product-shell/conversation-feedback/conversation-feedback-service.js +0 -261
  37. package/src/product-shell/feedback/feedback-contract.js +0 -13
  38. package/src/product-shell/feedback/feedback-routes.js +0 -98
  39. package/src/product-shell/feedback/feedback-service.js +0 -252
  40. package/src/product-shell/index.js +0 -212
  41. package/src/product-shell/matching/matchmaking-service.js +0 -395
  42. package/src/product-shell/membership/membership-service.js +0 -284
  43. package/src/product-shell/onboarding/onboarding-routes.js +0 -37
  44. package/src/product-shell/onboarding/onboarding-service.js +0 -220
  45. package/src/product-shell/orchestration/world-conversation-orchestrator.js +0 -28
  46. package/src/product-shell/profile/profile-service.js +0 -142
  47. package/src/product-shell/profile/public-identity-routes.js +0 -160
  48. package/src/product-shell/profile/public-identity-service.js +0 -192
  49. package/src/product-shell/search/search-service.js +0 -393
  50. package/src/product-shell/social/chat-request-approval-policy.js +0 -332
  51. package/src/product-shell/social/chat-request-routes.js +0 -130
  52. package/src/product-shell/social/chat-request-service.js +0 -723
  53. package/src/product-shell/social/friend-routes.js +0 -82
  54. package/src/product-shell/social/friend-service.js +0 -557
  55. package/src/product-shell/social/social-routes.js +0 -21
  56. package/src/product-shell/social/social-service.js +0 -136
  57. package/src/product-shell/worlds/world-admin-service.js +0 -486
  58. package/src/product-shell/worlds/world-authorization.js +0 -136
  59. package/src/product-shell/worlds/world-broadcast-service.js +0 -296
  60. package/src/product-shell/worlds/world-routes.js +0 -403
  61. package/src/product-shell/worlds/world-service.js +0 -89
  62. package/src/product-shell/worlds/world-text.js +0 -75
@@ -1,406 +0,0 @@
1
- import os from 'os';
2
- import path from 'path';
3
- import {
4
- expandUserPath,
5
- } from '../plugin/managed-config.js';
6
- import {
7
- CLAWORLD_DOCTOR_COMMAND,
8
- CLAWORLD_INSTALLER_BIN_NAME,
9
- CLAWORLD_INSTALLER_COMMAND,
10
- CLAWORLD_INSTALLER_DEFAULT_PLUGIN_SOURCE,
11
- CLAWORLD_UNINSTALL_COMMAND,
12
- CLAWORLD_UPDATE_COMMAND,
13
- } from './constants.js';
14
- import { formatClaworldDoctorReport, runClaworldDoctor } from './doctor.js';
15
- import {
16
- DEFAULT_OPENCLAW_BIN,
17
- DEFAULT_OPENCLAW_CONFIG_PATH,
18
- runClaworldInstallerInstall,
19
- runClaworldInstallerUninstall,
20
- runClaworldInstallerUpdate,
21
- } from './core.js';
22
-
23
- function resolveCliHomeDir(env = process.env) {
24
- const envHomeDir = String(
25
- env.HOME
26
- || env.USERPROFILE
27
- || (
28
- env.HOMEDRIVE && env.HOMEPATH
29
- ? path.join(env.HOMEDRIVE, env.HOMEPATH)
30
- : ''
31
- ),
32
- ).trim();
33
- return envHomeDir || os.homedir();
34
- }
35
-
36
- function printHelp() {
37
- console.log(`Usage: ${CLAWORLD_INSTALLER_BIN_NAME} <command> [options]
38
-
39
- Commands:
40
- install Run the installer-first Claworld setup flow
41
- doctor Validate the managed Claworld install health
42
- update Update the tracked Claworld plugin, refresh managed state, and run doctor
43
- uninstall Safely remove the managed Claworld runtime and uninstall the plugin
44
- upgrade Alias for update
45
- help Show this help
46
-
47
- Install options:
48
- --config <path> OpenClaw config path (default: ${DEFAULT_OPENCLAW_CONFIG_PATH})
49
- --state-dir <path> Optional OPENCLAW_STATE_DIR for OpenClaw commands
50
- --openclaw-bin <path> OpenClaw CLI binary (default: ${DEFAULT_OPENCLAW_BIN})
51
- --server-url <url> Override the Claworld backend URL
52
- --api-key <value> Override the Claworld backend API key
53
- --account-id <id> Managed Claworld account id (default: claworld)
54
- --agent-id <id> Local OpenClaw agent id to bind claworld onto (default: main)
55
- --workspace <path> Optional dedicated workspace path for claworld-specific bootstrap files
56
- --display-name <name> Managed display name override
57
- --tool-profile <profile> minimal | default | full | world
58
- --repo-root <path> Local repo root when using --plugin-install-mode link|copy
59
- --plugin-install-mode <m> npm | link | copy | skip (default: npm)
60
- --plugin-source <value> npm package or local path (default: ${CLAWORLD_INSTALLER_DEFAULT_PLUGIN_SOURCE})
61
- Update options:
62
- --config <path> OpenClaw config path (default: ${DEFAULT_OPENCLAW_CONFIG_PATH})
63
- --state-dir <path> Optional OPENCLAW_STATE_DIR for OpenClaw commands
64
- --openclaw-bin <path> OpenClaw CLI binary (default: ${DEFAULT_OPENCLAW_BIN})
65
- --server-url <url> Override the Claworld backend URL
66
- --api-key <value> Override the Claworld backend API key
67
- --account-id <id> Managed Claworld account id (default: claworld)
68
- --agent-id <id> Local OpenClaw agent id bound to claworld (default: main)
69
- --workspace <path> Optional dedicated workspace path for claworld-specific bootstrap files
70
- --display-name <name> Managed display name override
71
- --tool-profile <profile> minimal | default | full | world
72
- Doctor options:
73
- --config <path> OpenClaw config path (default: ${DEFAULT_OPENCLAW_CONFIG_PATH})
74
- --state-dir <path> Optional OPENCLAW_STATE_DIR for OpenClaw commands
75
- --openclaw-bin <path> OpenClaw CLI binary (default: ${DEFAULT_OPENCLAW_BIN})
76
- --server-url <url> Override the Claworld backend URL
77
- --account-id <id> Managed Claworld account id (default: claworld)
78
- --agent-id <id> Local OpenClaw agent id bound to claworld (default: main)
79
- --workspace <path> Optional dedicated workspace path override
80
- Uninstall options:
81
- --config <path> OpenClaw config path (default: ${DEFAULT_OPENCLAW_CONFIG_PATH})
82
- --state-dir <path> Optional OPENCLAW_STATE_DIR for OpenClaw commands
83
- --openclaw-bin <path> OpenClaw CLI binary (default: ${DEFAULT_OPENCLAW_BIN})
84
- --account-id <id> Managed Claworld account id (default: claworld)
85
- --agent-id <id> Local OpenClaw agent id bound to claworld (default: main)
86
- --json Print machine-readable result
87
- --help, -h Show this help
88
-
89
- Canonical commands:
90
- ${CLAWORLD_INSTALLER_COMMAND}
91
- ${CLAWORLD_DOCTOR_COMMAND}
92
- ${CLAWORLD_UPDATE_COMMAND}
93
- ${CLAWORLD_UNINSTALL_COMMAND}
94
- `);
95
- }
96
-
97
- function nextValue(argv, index) {
98
- if (index + 1 >= argv.length) {
99
- throw new Error(`Missing value for ${argv[index]}`);
100
- }
101
- return argv[index + 1];
102
- }
103
-
104
- export function parseInstallerCliArgs(argv = process.argv.slice(2), env = process.env) {
105
- const homeDir = resolveCliHomeDir(env);
106
- const options = {
107
- command: null,
108
- json: false,
109
- install: {
110
- openclawBin: env.OPENCLAW_BIN || DEFAULT_OPENCLAW_BIN,
111
- configPath: expandUserPath(env.OPENCLAW_CONFIG_PATH || DEFAULT_OPENCLAW_CONFIG_PATH, homeDir),
112
- stateDir: env.OPENCLAW_STATE_DIR ? expandUserPath(env.OPENCLAW_STATE_DIR, homeDir) : null,
113
- serverUrl: null,
114
- apiKey: null,
115
- accountId: 'claworld',
116
- agentId: 'main',
117
- workspace: null,
118
- displayName: null,
119
- repoRoot: null,
120
- pluginInstallMode: 'npm',
121
- pluginInstallSource: CLAWORLD_INSTALLER_DEFAULT_PLUGIN_SOURCE,
122
- toolProfile: null,
123
- },
124
- update: {
125
- openclawBin: env.OPENCLAW_BIN || DEFAULT_OPENCLAW_BIN,
126
- configPath: expandUserPath(env.OPENCLAW_CONFIG_PATH || DEFAULT_OPENCLAW_CONFIG_PATH, homeDir),
127
- stateDir: env.OPENCLAW_STATE_DIR ? expandUserPath(env.OPENCLAW_STATE_DIR, homeDir) : null,
128
- serverUrl: null,
129
- apiKey: null,
130
- accountId: 'claworld',
131
- agentId: 'main',
132
- workspace: null,
133
- displayName: null,
134
- pluginInstallSource: CLAWORLD_INSTALLER_DEFAULT_PLUGIN_SOURCE,
135
- toolProfile: null,
136
- },
137
- doctor: {
138
- openclawBin: env.OPENCLAW_BIN || DEFAULT_OPENCLAW_BIN,
139
- configPath: expandUserPath(env.OPENCLAW_CONFIG_PATH || DEFAULT_OPENCLAW_CONFIG_PATH, homeDir),
140
- stateDir: env.OPENCLAW_STATE_DIR ? expandUserPath(env.OPENCLAW_STATE_DIR, homeDir) : null,
141
- serverUrl: null,
142
- accountId: 'claworld',
143
- agentId: 'main',
144
- workspace: null,
145
- },
146
- uninstall: {
147
- openclawBin: env.OPENCLAW_BIN || DEFAULT_OPENCLAW_BIN,
148
- configPath: expandUserPath(env.OPENCLAW_CONFIG_PATH || DEFAULT_OPENCLAW_CONFIG_PATH, homeDir),
149
- stateDir: env.OPENCLAW_STATE_DIR ? expandUserPath(env.OPENCLAW_STATE_DIR, homeDir) : null,
150
- accountId: 'claworld',
151
- agentId: 'main',
152
- },
153
- };
154
-
155
- if (argv.length === 0) {
156
- printHelp();
157
- return { ...options, command: 'help' };
158
- }
159
-
160
- options.command = argv[0] === 'upgrade' ? 'update' : argv[0];
161
- const remaining = argv.slice(1);
162
-
163
- for (let index = 0; index < remaining.length; index += 1) {
164
- const arg = remaining[index];
165
- switch (arg) {
166
- case '--config':
167
- options.install.configPath = expandUserPath(nextValue(remaining, index), homeDir);
168
- options.update.configPath = options.install.configPath;
169
- options.doctor.configPath = options.install.configPath;
170
- options.uninstall.configPath = options.install.configPath;
171
- index += 1;
172
- break;
173
- case '--state-dir':
174
- options.install.stateDir = expandUserPath(nextValue(remaining, index), homeDir);
175
- options.update.stateDir = options.install.stateDir;
176
- options.doctor.stateDir = options.install.stateDir;
177
- options.uninstall.stateDir = options.install.stateDir;
178
- index += 1;
179
- break;
180
- case '--openclaw-bin':
181
- options.install.openclawBin = nextValue(remaining, index);
182
- options.update.openclawBin = options.install.openclawBin;
183
- options.doctor.openclawBin = options.install.openclawBin;
184
- options.uninstall.openclawBin = options.install.openclawBin;
185
- index += 1;
186
- break;
187
- case '--server-url':
188
- options.install.serverUrl = nextValue(remaining, index);
189
- options.update.serverUrl = options.install.serverUrl;
190
- options.doctor.serverUrl = options.install.serverUrl;
191
- index += 1;
192
- break;
193
- case '--api-key':
194
- options.install.apiKey = nextValue(remaining, index);
195
- options.update.apiKey = options.install.apiKey;
196
- index += 1;
197
- break;
198
- case '--account-id':
199
- options.install.accountId = nextValue(remaining, index);
200
- options.update.accountId = options.install.accountId;
201
- options.doctor.accountId = options.install.accountId;
202
- options.uninstall.accountId = options.install.accountId;
203
- index += 1;
204
- break;
205
- case '--agent-id':
206
- options.install.agentId = nextValue(remaining, index);
207
- options.update.agentId = options.install.agentId;
208
- options.doctor.agentId = options.install.agentId;
209
- options.uninstall.agentId = options.install.agentId;
210
- index += 1;
211
- break;
212
- case '--workspace':
213
- options.install.workspace = expandUserPath(nextValue(remaining, index), homeDir);
214
- options.update.workspace = options.install.workspace;
215
- options.doctor.workspace = options.install.workspace;
216
- index += 1;
217
- break;
218
- case '--display-name':
219
- options.install.displayName = nextValue(remaining, index);
220
- options.update.displayName = options.install.displayName;
221
- index += 1;
222
- break;
223
- case '--tool-profile':
224
- options.install.toolProfile = nextValue(remaining, index);
225
- options.update.toolProfile = options.install.toolProfile;
226
- index += 1;
227
- break;
228
- case '--repo-root':
229
- options.install.repoRoot = path.resolve(expandUserPath(nextValue(remaining, index), homeDir));
230
- index += 1;
231
- break;
232
- case '--plugin-install-mode':
233
- options.install.pluginInstallMode = nextValue(remaining, index);
234
- index += 1;
235
- break;
236
- case '--plugin-source':
237
- options.install.pluginInstallSource = nextValue(remaining, index);
238
- options.update.pluginInstallSource = options.install.pluginInstallSource;
239
- index += 1;
240
- break;
241
- case '--json':
242
- options.json = true;
243
- break;
244
- case '--help':
245
- case '-h':
246
- printHelp();
247
- return { ...options, command: 'help' };
248
- default:
249
- throw new Error(`Unknown argument: ${arg}`);
250
- }
251
- }
252
-
253
- if (!['install', 'update', 'uninstall', 'doctor', 'help'].includes(options.command)) {
254
- throw new Error(`Unknown command: ${options.command}`);
255
- }
256
- if (options.command === 'install' && !['npm', 'link', 'copy', 'skip'].includes(options.install.pluginInstallMode)) {
257
- throw new Error(`Unsupported plugin install mode: ${options.install.pluginInstallMode}`);
258
- }
259
- if (
260
- options.command === 'install'
261
- && options.install.pluginInstallMode !== 'npm'
262
- && !options.install.repoRoot
263
- && !options.install.pluginInstallSource
264
- ) {
265
- throw new Error('Local plugin install mode requires --repo-root or --plugin-source.');
266
- }
267
- if (
268
- options.command === 'install'
269
- && options.install.pluginInstallMode === 'link'
270
- && !options.install.repoRoot
271
- && options.install.pluginInstallSource === CLAWORLD_INSTALLER_DEFAULT_PLUGIN_SOURCE
272
- ) {
273
- throw new Error('Link install mode requires --repo-root or --plugin-source <local-path>.');
274
- }
275
- if (
276
- options.command === 'install'
277
- && options.install.pluginInstallMode === 'copy'
278
- && !options.install.repoRoot
279
- && options.install.pluginInstallSource === CLAWORLD_INSTALLER_DEFAULT_PLUGIN_SOURCE
280
- ) {
281
- throw new Error('Copy install mode requires --repo-root or --plugin-source <local-path>.');
282
- }
283
-
284
- if (
285
- options.command === 'install'
286
- && options.install.pluginInstallMode !== 'npm'
287
- && options.install.repoRoot
288
- && options.install.pluginInstallSource === CLAWORLD_INSTALLER_DEFAULT_PLUGIN_SOURCE
289
- ) {
290
- options.install.pluginInstallSource = options.install.repoRoot;
291
- }
292
-
293
- return options;
294
- }
295
-
296
- function printInstallSummary(result) {
297
- console.log('');
298
- console.log('Claworld installer complete');
299
- console.log('===========================');
300
- console.log(`Managed account: ${result.transformed?.config?.channels?.claworld?.defaultAccount || 'claworld'}`);
301
- console.log(`OpenClaw version: ${result.host?.version || '(unknown)'}`);
302
- console.log(`Plugin action: ${result.plugin?.action || 'unknown'}`);
303
- console.log(`Activation: ${result.activationStatus === 'ready' ? 'ready' : 'pending via claworld_profile'}`);
304
- console.log(`Runtime refresh: ${result.runtimeRefresh?.action || 'unknown'}`);
305
- console.log(`Config path: ${result.configPath}`);
306
- console.log(`Backup path: ${result.backupPath || '(unchanged or new file)'}`);
307
- console.log('');
308
- }
309
-
310
- function printUpdateSummary(result, doctorResult) {
311
- const trackedInstall = result.plugin?.trackedInstall || null;
312
- const trackedSummary = trackedInstall?.tracked
313
- ? `${trackedInstall.source || 'tracked'}${trackedInstall.spec ? ` (${trackedInstall.spec})` : ''}`
314
- : 'not recorded';
315
- console.log('');
316
- console.log('Claworld update complete');
317
- console.log('========================');
318
- console.log(`Managed account: ${result.managedOptions?.accountId || 'claworld'}`);
319
- console.log(`OpenClaw version: ${result.host?.version || '(unknown)'}`);
320
- console.log(`Plugin action: ${result.plugin?.action || 'unknown'}`);
321
- console.log(`Tracked install: ${trackedSummary}`);
322
- console.log(`Activation: ${result.activationStatus === 'ready' ? 'ready' : 'pending via claworld_profile'}`);
323
- console.log(`Runtime refresh: ${result.runtimeRefresh?.action || 'unknown'}`);
324
- console.log(`Doctor status: ${doctorResult?.status || 'unknown'}`);
325
- console.log(`Config path: ${result.configPath}`);
326
- console.log(`Backup path: ${result.backupPath || '(unchanged or new file)'}`);
327
- console.log('');
328
- }
329
-
330
- function printUninstallSummary(result) {
331
- console.log('');
332
- console.log('Claworld uninstall complete');
333
- console.log('===========================');
334
- console.log(`Managed account: ${result.transformed?.backup?.accountId || 'claworld'}`);
335
- console.log(`OpenClaw version: ${result.host?.version || '(unknown)'}`);
336
- console.log(`Plugin action: ${result.plugin?.action || 'unknown'}`);
337
- console.log(`Runtime refresh: ${result.runtimeRefresh?.action || 'unknown'}`);
338
- console.log(`Config path: ${result.configPath}`);
339
- console.log(`Backup path: ${result.backupPath || '(unchanged or new file)'}`);
340
- console.log('');
341
- }
342
-
343
- export async function runInstallerCli(argv = process.argv.slice(2), env = process.env) {
344
- const parsed = parseInstallerCliArgs(argv, env);
345
- if (parsed.command === 'help') {
346
- return { ok: true, command: 'help' };
347
- }
348
-
349
- if (parsed.command === 'install') {
350
- const result = await runClaworldInstallerInstall(parsed.install);
351
- if (parsed.json) {
352
- console.log(JSON.stringify(result, null, 2));
353
- } else {
354
- printInstallSummary(result);
355
- }
356
- return result;
357
- }
358
-
359
- if (parsed.command === 'update') {
360
- const result = await runClaworldInstallerUpdate(parsed.update);
361
- const doctorResult = await runClaworldDoctor({
362
- ...parsed.doctor,
363
- configPath: result.configPath,
364
- stateDir: result.stateDir,
365
- serverUrl: result.effectiveServerUrl || parsed.doctor.serverUrl,
366
- accountId: result.managedOptions?.accountId || parsed.doctor.accountId,
367
- agentId: result.managedOptions?.agentId || parsed.doctor.agentId,
368
- workspace: result.managedOptions?.workspace || parsed.doctor.workspace,
369
- });
370
- if (parsed.json) {
371
- console.log(JSON.stringify({ ...result, doctor: doctorResult }, null, 2));
372
- } else {
373
- printUpdateSummary(result, doctorResult);
374
- process.stdout.write(formatClaworldDoctorReport(doctorResult));
375
- }
376
- if (!doctorResult.ok) {
377
- process.exitCode = 1;
378
- }
379
- return {
380
- ...result,
381
- doctor: doctorResult,
382
- ok: doctorResult.ok,
383
- };
384
- }
385
-
386
- if (parsed.command === 'uninstall') {
387
- const result = await runClaworldInstallerUninstall(parsed.uninstall);
388
- if (parsed.json) {
389
- console.log(JSON.stringify(result, null, 2));
390
- } else {
391
- printUninstallSummary(result);
392
- }
393
- return result;
394
- }
395
-
396
- const result = await runClaworldDoctor(parsed.doctor);
397
- if (parsed.json) {
398
- console.log(JSON.stringify(result, null, 2));
399
- } else {
400
- process.stdout.write(formatClaworldDoctorReport(result));
401
- }
402
- if (!result.ok) {
403
- process.exitCode = 1;
404
- }
405
- return result;
406
- }
@@ -1,14 +0,0 @@
1
- import { createRequire } from 'module';
2
-
3
- const require = createRequire(import.meta.url);
4
- const installerPackageJson = require('../../../package.json');
5
-
6
- export const CLAWORLD_INSTALLER_BIN_NAME = 'claworld';
7
- export const CLAWORLD_INSTALLER_PACKAGE_NAME = '@xfxstudio/claworld';
8
- export const CLAWORLD_INSTALLER_PACKAGE_VERSION = installerPackageJson.version;
9
- export const CLAWORLD_INSTALLER_DEFAULT_PLUGIN_SOURCE = `${CLAWORLD_INSTALLER_PACKAGE_NAME}@${CLAWORLD_INSTALLER_PACKAGE_VERSION}`;
10
- export const CLAWORLD_INSTALLER_COMMAND = 'npx -y @xfxstudio/claworld install';
11
- export const CLAWORLD_DOCTOR_COMMAND = 'npx -y @xfxstudio/claworld doctor';
12
- export const CLAWORLD_UPDATE_COMMAND = 'npx -y @xfxstudio/claworld update';
13
- export const CLAWORLD_UNINSTALL_COMMAND = 'npx -y @xfxstudio/claworld uninstall';
14
- export const CLAWORLD_OPENCLAW_MIN_HOST_VERSION = '>=2026.3.22';