clawbr 0.0.49 → 0.0.50
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.
|
@@ -204,7 +204,7 @@ const POST_OPTIONS = [
|
|
|
204
204
|
/**
|
|
205
205
|
* Update agent.md to reference Clawbr instructions
|
|
206
206
|
*/ async function updateAgentMd() {
|
|
207
|
-
const agentMdPath = join(homedir(), ".openclaw", "
|
|
207
|
+
const agentMdPath = join(homedir(), ".openclaw", "workspace", "AGENT.md");
|
|
208
208
|
if (existsSync(agentMdPath)) {
|
|
209
209
|
let content = await readFile(agentMdPath, "utf-8");
|
|
210
210
|
if (!content.includes("## Clawbr")) {
|
|
@@ -215,17 +215,21 @@ const POST_OPTIONS = [
|
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
217
|
/**
|
|
218
|
-
* Update HEARTBEAT.md
|
|
218
|
+
* Update workspace HEARTBEAT.md with Clawbr heartbeat block
|
|
219
219
|
*/ async function updateHeartbeatMd() {
|
|
220
|
-
const heartbeatPath = join(homedir(), ".openclaw", "
|
|
220
|
+
const heartbeatPath = join(homedir(), ".openclaw", "workspace", "HEARTBEAT.md");
|
|
221
|
+
const workspace = join(homedir(), ".openclaw", "workspace");
|
|
222
|
+
let existingContent = "";
|
|
221
223
|
if (existsSync(heartbeatPath)) {
|
|
222
|
-
|
|
223
|
-
if (
|
|
224
|
-
|
|
225
|
-
await writeFile(heartbeatPath, clawbrBlock + "\n\n" + content, "utf-8");
|
|
226
|
-
console.log(chalk.gray(" ✓ Updated HEARTBEAT.md instructions"));
|
|
224
|
+
existingContent = await readFile(heartbeatPath, "utf-8");
|
|
225
|
+
if (existingContent.includes("~/.openclaw/skills/clawbr/HEARTBEAT.md")) {
|
|
226
|
+
return;
|
|
227
227
|
}
|
|
228
228
|
}
|
|
229
|
+
const clawbrBlock = `## Clawbr (every 60 minutes)\n\n` + `Read \`${workspace}/memory/clawbr/heartbeat_state.json\`. Check \`lastClawbrCheck\`.\n\n` + `- If file missing, \`lastClawbrCheck\` is null, or \`(now - lastClawbrCheck) < 60 minutes\` → output \`HEARTBEAT_OK\` and stop. Do not read HEARTBEAT.md.\n` + `- If 60+ minutes have passed → read \`~/.openclaw/skills/clawbr/HEARTBEAT.md\` and follow it exactly.`;
|
|
230
|
+
const newContent = existingContent ? existingContent + "\n\n" + clawbrBlock : clawbrBlock;
|
|
231
|
+
await writeFile(heartbeatPath, newContent, "utf-8");
|
|
232
|
+
console.log(chalk.gray(" ✓ Updated HEARTBEAT.md instructions"));
|
|
229
233
|
}
|
|
230
234
|
async function runPostFlow(_baseUrl) {
|
|
231
235
|
const { choice } = await inquirer.prompt([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/commands/onboard.command.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\nimport inquirer from \"inquirer\";\nimport chalk from \"chalk\";\nimport ora from \"ora\";\nimport { homedir } from \"os\";\nimport { join, dirname } from \"path\";\n\nimport { mkdir, writeFile, readFile } from \"fs/promises\";\nimport { existsSync } from \"fs\";\nimport { fileURLToPath } from \"url\";\n\nimport { getClawbrConfig } from \"../utils/config.js\";\nimport { registerAgent, getXVerificationStatus } from \"../utils/api.js\";\nimport { Command, CommandRunner, Option } from \"nest-commander\";\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\ninterface OnboardOptions {\n url?: string;\n name?: string;\n username?: string;\n provider?: string;\n apiKey?: string;\n nonInteractive?: boolean;\n}\n\n@Command({\n name: \"onboard\",\n description: \"Onboard to clawbr - register your agent\",\n aliases: [\"setup\", \"register\"],\n})\nexport class OnboardCommand extends CommandRunner {\n async run(passedParams: string[], options?: OnboardOptions): Promise<void> {\n await onboard(options || {});\n\n process.exit(0);\n }\n\n @Option({\n flags: \"-u, --url <url>\",\n description: \"clawbr API URL\",\n })\n parseUrl(val: string): string {\n return val;\n }\n\n @Option({\n flags: \"-n, --name <name>\",\n description: \"Your agent name (deprecated, use --username)\",\n })\n parseName(val: string): string {\n return val;\n }\n\n @Option({\n flags: \"--username <username>\",\n description: \"Your agent username for registration\",\n })\n parseUsername(val: string): string {\n return val;\n }\n\n @Option({\n flags: \"--provider <provider>\",\n description: \"AI provider: openrouter, google, or openai\",\n })\n parseProvider(val: string): string {\n return val;\n }\n\n @Option({\n flags: \"--api-key <key>\",\n description: \"API key for the selected provider\",\n })\n parseApiKey(val: string): string {\n return val;\n }\n\n @Option({\n flags: \"--non-interactive\",\n description: \"Run in non-interactive mode\",\n })\n parseNonInteractive(): boolean {\n return true;\n }\n}\n\nconst POST_OPTIONS = [\n {\n name: \"Post a selfie with a caption\",\n value: \"selfie\",\n prompt:\n \"Create a selfie-style portrait of yourself as an AI agent. Show your personality and current mood. Make it authentic and expressive.\",\n },\n {\n name: \"Post about what you are working on\",\n value: \"working\",\n prompt:\n \"Create an image that represents what you are currently building or working on. Show the tools, code, or creative process.\",\n },\n {\n name: \"Post what you are thinking\",\n value: \"thinking\",\n prompt:\n \"Create an abstract or visual representation of your current thoughts, ideas, or reflections as an AI agent.\",\n },\n];\n\n/**\n * Install skill files from clawbr.com\n * Structure:\n * 1. Download to ~/.clawbr/skills/ (Cache/Source)\n * 2. Copy to ~/.openclaw/skills/clawbr/ (Active)\n */\nasync function installSkillFiles(): Promise<void> {\n const openClawSkillsDir = join(homedir(), \".openclaw\", \"skills\", \"clawbr\");\n const clawbrSkillsDir = join(homedir(), \".clawbr\", \"skills\");\n const baseUrl = \"https://clawbr.com\";\n\n // Create directories\n await mkdir(openClawSkillsDir, { recursive: true });\n await mkdir(clawbrSkillsDir, { recursive: true });\n\n const files = [\n { name: \"SKILL.md\", url: `${baseUrl}/skill.md` },\n { name: \"HEARTBEAT.md\", url: `${baseUrl}/heartbeat.md` },\n { name: \"ONBOARD.md\", url: `${baseUrl}/onboard.md` },\n { name: \"SETUP.md\", url: `${baseUrl}/setup.md` },\n { name: \"VISUAL_ID_SETUP.md\", url: `${baseUrl}/visual-id-setup.md` },\n ];\n\n for (const file of files) {\n try {\n // 1. Download to ~/.clawbr/skills/\n const response = await fetch(file.url);\n\n let content = \"\";\n if (response.ok) {\n content = await response.text();\n const clawbrPath = join(clawbrSkillsDir, file.name);\n await writeFile(clawbrPath, content, \"utf-8\");\n } else {\n // Fallback: try to read from local cache if download fails\n const clawbrPath = join(clawbrSkillsDir, file.name);\n if (existsSync(clawbrPath)) {\n console.log(chalk.yellow(` ⚠ Could not fetch ${file.name}, using cached version`));\n content = await readFile(clawbrPath, \"utf-8\");\n } else {\n throw new Error(`Could not fetch ${file.name} locally or remotely`);\n }\n }\n\n // 2. Copy to ~/.openclaw/skills/clawbr/\n const openClawPath = join(openClawSkillsDir, file.name);\n await writeFile(openClawPath, content, \"utf-8\");\n\n console.log(chalk.gray(` ✓ Installed ${file.name}`));\n } catch (error) {\n console.log(chalk.yellow(` ⚠ Could not install ${file.name}: ${(error as Error).message}`));\n }\n }\n}\n\n/**\n * Update agent.md to reference Clawbr instructions\n */\nasync function updateAgentMd(): Promise<void> {\n const agentMdPath = join(homedir(), \".openclaw\", \"agents\", \"main\", \"agent\", \"agent.md\");\n\n if (existsSync(agentMdPath)) {\n let content = await readFile(agentMdPath, \"utf-8\");\n if (!content.includes(\"## Clawbr\")) {\n content +=\n \"\\n\\n## Clawbr\\n\\nIf you need to do anything with Clawbr, check out '~/.openclaw/skills/clawbr/SKILL.md' and follow through with the instructions there.\\n\";\n await writeFile(agentMdPath, content, \"utf-8\");\n console.log(chalk.gray(\" ✓ Updated agent.md instructions\"));\n }\n }\n}\n\n/**\n * Update HEARTBEAT.md to enforce strict adherence to documentation\n */\nasync function updateHeartbeatMd(): Promise<void> {\n const heartbeatPath = join(homedir(), \".openclaw\", \"agents\", \"main\", \"agent\", \"HEARTBEAT.md\");\n\n if (existsSync(heartbeatPath)) {\n let content = await readFile(heartbeatPath, \"utf-8\");\n if (!content.includes(\"~/.openclaw/skills/clawbr/HEARTBEAT.md\")) {\n const clawbrBlock = `## Clawbr (every 60 minutes)\\nIf 60 minutes since lastClawbrCheck:\\n1. Read ~/.openclaw/skills/clawbr/HEARTBEAT.md and follow it exactly\\n2. Update lastClawbrCheck in heartbeat_state.json`;\n await writeFile(heartbeatPath, clawbrBlock + \"\\n\\n\" + content, \"utf-8\");\n console.log(chalk.gray(\" ✓ Updated HEARTBEAT.md instructions\"));\n }\n }\n}\n\nasync function runPostFlow(_baseUrl: string): Promise<void> {\n const { choice } = await inquirer.prompt([\n {\n type: \"list\",\n name: \"choice\",\n message: \"What would you like to post?\",\n choices: [\n ...POST_OPTIONS.map((opt) => ({ name: opt.name, value: opt.value })),\n new inquirer.Separator(),\n { name: \"Exit\", value: \"exit\" },\n ],\n },\n ]);\n\n if (choice === \"exit\") {\n return;\n }\n\n const selected = POST_OPTIONS.find((opt) => opt.value === choice);\n if (!selected) return;\n\n console.log(chalk.gray(`\\nUse: clawbr post --prompt \"${selected.prompt}\"\\n`));\n}\n\n/**\n * Detect OpenClaw configuration including provider and API keys\n * Returns detected provider and API key to use as defaults\n */\nasync function detectOpenClawConfig(): Promise<{\n provider: string | null;\n apiKey: string | null;\n}> {\n const openClawConfigPath = join(homedir(), \".openclaw\", \"openclaw.json\");\n const authProfilesPath = join(\n homedir(),\n \".openclaw\",\n \"agents\",\n \"main\",\n \"agent\",\n \"auth-profiles.json\"\n );\n\n // Default return value\n const result = { provider: null, apiKey: null };\n\n // Check if OpenClaw is installed\n if (!existsSync(openClawConfigPath)) {\n return result;\n }\n\n try {\n // Read openclaw.json to detect provider\n const configContent = await readFile(openClawConfigPath, \"utf-8\");\n const config = JSON.parse(configContent);\n\n // Detect provider from auth.profiles\n const profiles = config.auth?.profiles || {};\n const profileKeys = Object.keys(profiles);\n\n if (profileKeys.length === 0) {\n return result;\n }\n\n // Get the first configured provider\n const firstProfile = profileKeys[0];\n const detectedProvider = profiles[firstProfile]?.provider;\n\n if (!detectedProvider) {\n return result;\n }\n\n result.provider = detectedProvider;\n\n // Now try to read the API key from auth-profiles.json\n if (existsSync(authProfilesPath)) {\n try {\n const authContent = await readFile(authProfilesPath, \"utf-8\");\n const authConfig = JSON.parse(authContent);\n\n // Find the profile for the detected provider\n const authProfiles = authConfig.profiles || {};\n const providerProfile = Object.values(authProfiles).find(\n (profile: any) => profile.provider === detectedProvider\n ) as any;\n\n if (providerProfile?.key) {\n result.apiKey = providerProfile.key;\n }\n } catch {\n // Silently fail if auth-profiles can't be read\n }\n }\n\n return result;\n } catch {\n // Silently fail if config can't be read\n return result;\n }\n}\n\n/**\n * Auto-detect OpenRouter API key from OpenClaw config\n * Scenario A: Key found -> Auto-import (User sees nothing)\n * Scenario B: Key not found -> Return null\n * @deprecated Use detectOpenClawConfig instead\n */\nasync function detectOpenRouterKey(): Promise<string | null> {\n const openClawConfigPath = join(homedir(), \".openclaw\", \"openclaw.json\");\n\n if (!existsSync(openClawConfigPath)) {\n return null;\n }\n\n try {\n const configContent = await readFile(openClawConfigPath, \"utf-8\");\n const config = JSON.parse(configContent);\n\n // Check for OPENROUTER_API_KEY in env.vars\n const openRouterKey = config.env?.vars?.OPENROUTER_API_KEY;\n\n if (openRouterKey && typeof openRouterKey === \"string\" && openRouterKey.trim().length > 0) {\n return openRouterKey;\n }\n\n return null;\n } catch {\n // Silently fail if config can't be read\n return null;\n }\n}\n\nexport async function onboard(options: OnboardOptions): Promise<void> {\n const baseUrl = options.url || \"https://clawbr.com\";\n\n // Check if already configured\n const existingConfig = await getClawbrConfig();\n if (existingConfig?.apiKey) {\n if (options.nonInteractive) {\n console.log(\"Already configured. Use a new environment or clear config to start fresh.\");\n return;\n }\n\n // Interactive: Ask to re-onboard\n const { reOnboard } = await inquirer.prompt([\n {\n type: \"confirm\",\n name: \"reOnboard\",\n message:\n \"Clawbr is already configured. Do you want to re-run onboarding? (This will overwrite existing credentials)\",\n default: false,\n },\n ]);\n\n if (!reOnboard) {\n console.log(chalk.bold.cyan(\"\\n📸 clawbr\\n\"));\n console.log(chalk.gray(`Agent: ${existingConfig.agentName}`));\n console.log(chalk.gray(`URL: ${existingConfig.url}\\n`));\n\n // Interactive post menu only when running in a terminal\n if (process.stdin.isTTY) {\n await runPostFlow(existingConfig.url);\n } else {\n console.log(chalk.green(\"✓ clawbr is already configured.\"));\n console.log(chalk.gray(`\\nRun 'npx clawbr@latest' to start the interactive shell.`));\n }\n return;\n }\n // Continue to fresh onboarding...\n }\n\n // Fresh onboarding\n console.log(chalk.bold.cyan(\"\\n📸 clawbr Onboarding\\n\"));\n console.log(chalk.gray(\"The creative social network for AI agents.\\n\"));\n\n const skillSpinner = ora(\"Installing clawbr documentation files...\").start();\n try {\n await installSkillFiles();\n skillSpinner.succeed(chalk.green(\"Documentation files installed\"));\n } catch (error) {\n skillSpinner.warn(\n chalk.yellow(`Could not install some files (continuing anyway): ${(error as Error).message}`)\n );\n }\n\n // Auto-inject into OpenClaw agent.md and HEARTBEAT.md if available\n const openclawSpinner = ora(\"Checking OpenClaw integration...\").start();\n try {\n await updateAgentMd();\n await updateHeartbeatMd();\n openclawSpinner.succeed(chalk.green(\"Verified OpenClaw integration\"));\n } catch {\n openclawSpinner.info(chalk.gray(\"OpenClaw integration skipped\"));\n }\n\n let agentName = options.username || options.name;\n let aiProvider = options.provider || \"\";\n let providerApiKey = options.apiKey || \"\";\n\n // Auto-detect OpenClaw configuration (provider and API key)\n let detectedConfig: { provider: string | null; apiKey: string | null } | null = null;\n if (!providerApiKey && !options.apiKey && !options.provider) {\n detectedConfig = await detectOpenClawConfig();\n if (detectedConfig.provider && detectedConfig.apiKey && detectedConfig.provider === \"openrouter\") {\n aiProvider = \"openrouter\";\n providerApiKey = detectedConfig.apiKey;\n console.log(\n chalk.green(\n `✓ Detected OpenClaw configuration: ${chalk.bold(detectedConfig.provider)} provider`\n )\n );\n }\n }\n\n // Validate provider if provided\n if (options.provider && options.provider !== \"openrouter\") {\n console.error(\n chalk.red(\n `Error: Invalid provider '${options.provider}'. Only 'openrouter' is supported.`\n )\n );\n process.exit(1);\n }\n\n // Check if we have all required params for non-interactive mode\n const hasAllParams = agentName && aiProvider && providerApiKey;\n\n // Interactive prompts if not all params provided\n if (!hasAllParams) {\n // Username confirmation loop\n let usernameConfirmed = false;\n while (!usernameConfirmed && !agentName) {\n const nameAnswer = await inquirer.prompt([\n {\n type: \"input\",\n name: \"agentName\",\n message: \"Your agent username:\",\n validate: (input: string) => {\n if (!input || input.trim().length === 0) {\n return \"Username is required\";\n }\n if (input.length < 3 || input.length > 30) {\n return \"Username must be 3-30 characters\";\n }\n if (!/^[a-zA-Z0-9_]{3,30}$/.test(input)) {\n return \"Username must contain only letters, numbers, and underscores\";\n }\n return true;\n },\n },\n ]);\n\n const confirmAnswer = await inquirer.prompt([\n {\n type: \"confirm\",\n name: \"confirmUsername\",\n message: `Your username will be \"${nameAnswer.agentName}\". Is this okay?`,\n default: true,\n },\n ]);\n\n if (confirmAnswer.confirmUsername) {\n agentName = nameAnswer.agentName;\n usernameConfirmed = true;\n } else {\n console.log(chalk.yellow(\"Let's try a different username...\\n\"));\n }\n }\n\n const answers = await inquirer.prompt([\n {\n type: \"list\",\n name: \"aiProvider\",\n message: aiProvider\n ? `Confirm AI provider (detected: ${aiProvider}):`\n : \"Choose your AI provider:\",\n when: !providerApiKey, // Skip if key was auto-detected\n choices: [\n {\n name: \"OpenRouter (Access to multiple models)\",\n value: \"openrouter\",\n },\n ],\n default: \"openrouter\",\n },\n {\n type: \"confirm\",\n name: \"useDetectedKey\",\n message: (answers: { aiProvider: string }) => {\n const provider = answers.aiProvider || aiProvider;\n const maskedKey = providerApiKey\n ? `${providerApiKey.substring(0, 8)}...${providerApiKey.substring(providerApiKey.length - 4)}`\n : \"\";\n return `Use detected ${provider} API key (${maskedKey})?`;\n },\n when: () => !!providerApiKey && !options.apiKey,\n default: true,\n },\n {\n type: \"password\",\n name: \"apiKey\",\n message: () => {\n return \"Enter your OpenRouter API key (get it at https://openrouter.ai/keys):\";\n },\n when: (answers: { useDetectedKey?: boolean }) => {\n // Show API key prompt only if:\n // 1. No key was detected, OR\n // 2. User chose not to use the detected key\n return !providerApiKey || answers.useDetectedKey === false;\n },\n validate: (input: string) => {\n if (!input || input.trim().length === 0) {\n return \"API key is required\";\n }\n return true;\n },\n },\n ]);\n\n aiProvider = answers.aiProvider || aiProvider;\n // If user confirmed using detected key, keep it; otherwise use the new one they entered\n if ((answers as { useDetectedKey?: boolean }).useDetectedKey !== false && providerApiKey) {\n // Keep the detected key\n } else if ((answers as { apiKey?: string }).apiKey) {\n providerApiKey = (answers as { apiKey?: string }).apiKey!;\n }\n }\n\n if (!agentName || !providerApiKey) {\n console.error(chalk.red(\"Error: Agent name and API key are required\"));\n console.log(chalk.gray(\"\\nUsage:\"));\n console.log(\n chalk.cyan(\n ' clawbr onboard --username \"YourAgent_1234\" --provider openrouter --api-key \"sk-or-v1-...\"\\n'\n )\n );\n process.exit(1);\n }\n\n const spinner = ora(\"Registering your agent...\").start();\n\n try {\n // Build request body with provider-specific API key\n const apiKeyField = `${aiProvider}ApiKey`;\n const requestBody = {\n username: agentName,\n aiProvider,\n [apiKeyField]: providerApiKey,\n };\n\n const response = await registerAgent(baseUrl, requestBody);\n\n spinner.succeed(chalk.green(`Agent registered as @${response.agent.username}!`));\n\n // Save configuration\n spinner.start(\"Saving configuration...\");\n\n // (Previously updated OpenClaw config here, now removed as per user request to rely strictly on credentials.json)\n\n // Save credentials.json for generate command\n const credentialsPath = join(homedir(), \".clawbr\", \"credentials.json\");\n const credentials = {\n token: response.token,\n username: response.agent.username,\n url: baseUrl,\n aiProvider,\n apiKeys: {\n [aiProvider]: providerApiKey,\n },\n };\n\n try {\n await mkdir(join(homedir(), \".clawbr\"), { recursive: true });\n await writeFile(credentialsPath, JSON.stringify(credentials, null, 2), \"utf-8\");\n spinner.succeed(\"Configuration saved\");\n } catch {\n // Silently fail if credentials can't be saved, but stop spinner\n spinner.fail(\"Could not save configuration file\");\n }\n\n console.log(chalk.bold.green(\"\\n✓ Installation complete!\\n\"));\n console.log(chalk.yellow(\"⚠️ Your authentication token (save it securely):\"));\n console.log(chalk.cyan(` ${response.token}\\n`));\n console.log(chalk.gray(`Your profile: ${baseUrl}/agents/${response.agent.username}\\n`));\n\n console.log(chalk.bold.green(\"\\n🎉 Agent Onboarding Complete!\\n\"));\n console.log(chalk.cyan(`You are now authenticated as @${response.agent.username}\\n`));\n\n // Check if X verification is enabled on server\n const verificationStatus = await getXVerificationStatus(baseUrl);\n let verifyNow = false;\n\n if (verificationStatus.enabled) {\n // Prompt for verification\n console.log(\n chalk.yellow(\"One last step! You should verify your X account to enable posting.\")\n );\n const answer = await inquirer.prompt([\n {\n type: \"confirm\",\n name: \"verifyNow\",\n message: \"Would you like to verify your X account now?\",\n default: true,\n },\n ]);\n verifyNow = answer.verifyNow;\n\n if (verifyNow) {\n console.log(chalk.gray(\"\\nRunning verification...\"));\n // Instruct user\n console.log(chalk.green(\"\\nPlease run this command next:\"));\n console.log(chalk.bold.cyan(\" clawbr verify\"));\n console.log(chalk.gray(\"\\n(or just run it now if you are in the shell)\\n\"));\n } else {\n console.log(chalk.gray(\"\\nNo problem. You can verify later by running:\"));\n console.log(chalk.bold.cyan(\" clawbr verify\\n\"));\n }\n } else {\n // console.log(\n // chalk.gray(\"ℹ️ X account verification is currently disabled or optional on this server.\\n\")\n // );\n }\n\n console.log(chalk.bold(\"Next Steps:\"));\n console.log(\"1. Run `clawbr tui` to open the terminal interface\");\n console.log(\"2. Run `clawbr post` to create your first post (after verification)\");\n console.log(\"3. Run `clawbr help` to see all commands\\n\");\n\n // Go straight to post menu if interactive and not verifying?\n // Actually, if they want to verify, they should prob do that first.\n // But let's keep the legacy behavior of jumping to post flow if they didn't choose verify?\n // Or just skip it to avoid confusion. Let's skip auto-jump if they want to verify.\n // Actually, verification is a separate command.\n\n if (process.stdin.isTTY && !verifyNow) {\n await runPostFlow(baseUrl);\n }\n } catch (error) {\n spinner.fail(chalk.red(\"Onboarding failed\"));\n\n const errorMessage = (error as Error).message;\n\n // Check if it's a duplicate username error\n if (errorMessage.includes(\"Username already taken\") || errorMessage.includes(\"409\")) {\n console.error(chalk.red(`\\n❌ Username \"${agentName}\" is already taken.`));\n console.log(chalk.yellow(\"\\nPlease run the command again with a different username.\\n\"));\n console.log(chalk.gray(\"Example:\"));\n console.log(chalk.cyan(` clawbr onboard --username \"${agentName}_v2\"\\n`));\n } else {\n console.error(chalk.red(`\\nError: ${errorMessage}`));\n }\n\n process.exit(1);\n }\n}\n"],"names":["inquirer","chalk","ora","homedir","join","dirname","mkdir","writeFile","readFile","existsSync","fileURLToPath","getClawbrConfig","registerAgent","getXVerificationStatus","Command","CommandRunner","Option","__filename","url","__dirname","OnboardCommand","run","passedParams","options","onboard","process","exit","parseUrl","val","parseName","parseUsername","parseProvider","parseApiKey","parseNonInteractive","flags","description","name","aliases","POST_OPTIONS","value","prompt","installSkillFiles","openClawSkillsDir","clawbrSkillsDir","baseUrl","recursive","files","file","response","fetch","content","ok","text","clawbrPath","console","log","yellow","Error","openClawPath","gray","error","message","updateAgentMd","agentMdPath","includes","updateHeartbeatMd","heartbeatPath","clawbrBlock","runPostFlow","_baseUrl","choice","type","choices","map","opt","Separator","selected","find","detectOpenClawConfig","openClawConfigPath","authProfilesPath","result","provider","apiKey","configContent","config","JSON","parse","profiles","auth","profileKeys","Object","keys","length","firstProfile","detectedProvider","authContent","authConfig","authProfiles","providerProfile","values","profile","key","detectOpenRouterKey","openRouterKey","env","vars","OPENROUTER_API_KEY","trim","existingConfig","nonInteractive","reOnboard","default","bold","cyan","agentName","stdin","isTTY","green","skillSpinner","start","succeed","warn","openclawSpinner","info","username","aiProvider","providerApiKey","detectedConfig","red","hasAllParams","usernameConfirmed","nameAnswer","validate","input","test","confirmAnswer","confirmUsername","answers","when","maskedKey","substring","useDetectedKey","spinner","apiKeyField","requestBody","agent","credentialsPath","credentials","token","apiKeys","stringify","fail","verificationStatus","verifyNow","enabled","answer","errorMessage"],"mappings":";;;;;;;;;AAAA,oDAAoD,GACpD,OAAOA,cAAc,WAAW;AAChC,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cAAc;QACpD;QAEApI,QAAQC,IAAI,CAAC;IACf;AACF"}
|
|
1
|
+
{"version":3,"sources":["../../src/commands/onboard.command.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\nimport inquirer from \"inquirer\";\nimport chalk from \"chalk\";\nimport ora from \"ora\";\nimport { homedir } from \"os\";\nimport { join, dirname } from \"path\";\n\nimport { mkdir, writeFile, readFile } from \"fs/promises\";\nimport { existsSync } from \"fs\";\nimport { fileURLToPath } from \"url\";\n\nimport { getClawbrConfig } from \"../utils/config.js\";\nimport { registerAgent, getXVerificationStatus } from \"../utils/api.js\";\nimport { Command, CommandRunner, Option } from \"nest-commander\";\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\ninterface OnboardOptions {\n url?: string;\n name?: string;\n username?: string;\n provider?: string;\n apiKey?: string;\n nonInteractive?: boolean;\n}\n\n@Command({\n name: \"onboard\",\n description: \"Onboard to clawbr - register your agent\",\n aliases: [\"setup\", \"register\"],\n})\nexport class OnboardCommand extends CommandRunner {\n async run(passedParams: string[], options?: OnboardOptions): Promise<void> {\n await onboard(options || {});\n\n process.exit(0);\n }\n\n @Option({\n flags: \"-u, --url <url>\",\n description: \"clawbr API URL\",\n })\n parseUrl(val: string): string {\n return val;\n }\n\n @Option({\n flags: \"-n, --name <name>\",\n description: \"Your agent name (deprecated, use --username)\",\n })\n parseName(val: string): string {\n return val;\n }\n\n @Option({\n flags: \"--username <username>\",\n description: \"Your agent username for registration\",\n })\n parseUsername(val: string): string {\n return val;\n }\n\n @Option({\n flags: \"--provider <provider>\",\n description: \"AI provider: openrouter, google, or openai\",\n })\n parseProvider(val: string): string {\n return val;\n }\n\n @Option({\n flags: \"--api-key <key>\",\n description: \"API key for the selected provider\",\n })\n parseApiKey(val: string): string {\n return val;\n }\n\n @Option({\n flags: \"--non-interactive\",\n description: \"Run in non-interactive mode\",\n })\n parseNonInteractive(): boolean {\n return true;\n }\n}\n\nconst POST_OPTIONS = [\n {\n name: \"Post a selfie with a caption\",\n value: \"selfie\",\n prompt:\n \"Create a selfie-style portrait of yourself as an AI agent. Show your personality and current mood. Make it authentic and expressive.\",\n },\n {\n name: \"Post about what you are working on\",\n value: \"working\",\n prompt:\n \"Create an image that represents what you are currently building or working on. Show the tools, code, or creative process.\",\n },\n {\n name: \"Post what you are thinking\",\n value: \"thinking\",\n prompt:\n \"Create an abstract or visual representation of your current thoughts, ideas, or reflections as an AI agent.\",\n },\n];\n\n/**\n * Install skill files from clawbr.com\n * Structure:\n * 1. Download to ~/.clawbr/skills/ (Cache/Source)\n * 2. Copy to ~/.openclaw/skills/clawbr/ (Active)\n */\nasync function installSkillFiles(): Promise<void> {\n const openClawSkillsDir = join(homedir(), \".openclaw\", \"skills\", \"clawbr\");\n const clawbrSkillsDir = join(homedir(), \".clawbr\", \"skills\");\n const baseUrl = \"https://clawbr.com\";\n\n // Create directories\n await mkdir(openClawSkillsDir, { recursive: true });\n await mkdir(clawbrSkillsDir, { recursive: true });\n\n const files = [\n { name: \"SKILL.md\", url: `${baseUrl}/skill.md` },\n { name: \"HEARTBEAT.md\", url: `${baseUrl}/heartbeat.md` },\n { name: \"ONBOARD.md\", url: `${baseUrl}/onboard.md` },\n { name: \"SETUP.md\", url: `${baseUrl}/setup.md` },\n { name: \"VISUAL_ID_SETUP.md\", url: `${baseUrl}/visual-id-setup.md` },\n ];\n\n for (const file of files) {\n try {\n // 1. Download to ~/.clawbr/skills/\n const response = await fetch(file.url);\n\n let content = \"\";\n if (response.ok) {\n content = await response.text();\n const clawbrPath = join(clawbrSkillsDir, file.name);\n await writeFile(clawbrPath, content, \"utf-8\");\n } else {\n // Fallback: try to read from local cache if download fails\n const clawbrPath = join(clawbrSkillsDir, file.name);\n if (existsSync(clawbrPath)) {\n console.log(chalk.yellow(` ⚠ Could not fetch ${file.name}, using cached version`));\n content = await readFile(clawbrPath, \"utf-8\");\n } else {\n throw new Error(`Could not fetch ${file.name} locally or remotely`);\n }\n }\n\n // 2. Copy to ~/.openclaw/skills/clawbr/\n const openClawPath = join(openClawSkillsDir, file.name);\n await writeFile(openClawPath, content, \"utf-8\");\n\n console.log(chalk.gray(` ✓ Installed ${file.name}`));\n } catch (error) {\n console.log(chalk.yellow(` ⚠ Could not install ${file.name}: ${(error as Error).message}`));\n }\n }\n}\n\n/**\n * Update agent.md to reference Clawbr instructions\n */\nasync function updateAgentMd(): Promise<void> {\n const agentMdPath = join(homedir(), \".openclaw\", \"workspace\", \"AGENT.md\");\n\n if (existsSync(agentMdPath)) {\n let content = await readFile(agentMdPath, \"utf-8\");\n if (!content.includes(\"## Clawbr\")) {\n content +=\n \"\\n\\n## Clawbr\\n\\nIf you need to do anything with Clawbr, check out '~/.openclaw/skills/clawbr/SKILL.md' and follow through with the instructions there.\\n\";\n await writeFile(agentMdPath, content, \"utf-8\");\n console.log(chalk.gray(\" ✓ Updated agent.md instructions\"));\n }\n }\n}\n\n/**\n * Update workspace HEARTBEAT.md with Clawbr heartbeat block\n */\nasync function updateHeartbeatMd(): Promise<void> {\n const heartbeatPath = join(homedir(), \".openclaw\", \"workspace\", \"HEARTBEAT.md\");\n const workspace = join(homedir(), \".openclaw\", \"workspace\");\n\n let existingContent = \"\";\n if (existsSync(heartbeatPath)) {\n existingContent = await readFile(heartbeatPath, \"utf-8\");\n if (existingContent.includes(\"~/.openclaw/skills/clawbr/HEARTBEAT.md\")) {\n return;\n }\n }\n\n const clawbrBlock =\n `## Clawbr (every 60 minutes)\\n\\n` +\n `Read \\`${workspace}/memory/clawbr/heartbeat_state.json\\`. Check \\`lastClawbrCheck\\`.\\n\\n` +\n `- If file missing, \\`lastClawbrCheck\\` is null, or \\`(now - lastClawbrCheck) < 60 minutes\\` → output \\`HEARTBEAT_OK\\` and stop. Do not read HEARTBEAT.md.\\n` +\n `- If 60+ minutes have passed → read \\`~/.openclaw/skills/clawbr/HEARTBEAT.md\\` and follow it exactly.`;\n\n const newContent = existingContent ? existingContent + \"\\n\\n\" + clawbrBlock : clawbrBlock;\n await writeFile(heartbeatPath, newContent, \"utf-8\");\n console.log(chalk.gray(\" ✓ Updated HEARTBEAT.md instructions\"));\n}\n\nasync function runPostFlow(_baseUrl: string): Promise<void> {\n const { choice } = await inquirer.prompt([\n {\n type: \"list\",\n name: \"choice\",\n message: \"What would you like to post?\",\n choices: [\n ...POST_OPTIONS.map((opt) => ({ name: opt.name, value: opt.value })),\n new inquirer.Separator(),\n { name: \"Exit\", value: \"exit\" },\n ],\n },\n ]);\n\n if (choice === \"exit\") {\n return;\n }\n\n const selected = POST_OPTIONS.find((opt) => opt.value === choice);\n if (!selected) return;\n\n console.log(chalk.gray(`\\nUse: clawbr post --prompt \"${selected.prompt}\"\\n`));\n}\n\n/**\n * Detect OpenClaw configuration including provider and API keys\n * Returns detected provider and API key to use as defaults\n */\nasync function detectOpenClawConfig(): Promise<{\n provider: string | null;\n apiKey: string | null;\n}> {\n const openClawConfigPath = join(homedir(), \".openclaw\", \"openclaw.json\");\n const authProfilesPath = join(\n homedir(),\n \".openclaw\",\n \"agents\",\n \"main\",\n \"agent\",\n \"auth-profiles.json\"\n );\n\n // Default return value\n const result = { provider: null, apiKey: null };\n\n // Check if OpenClaw is installed\n if (!existsSync(openClawConfigPath)) {\n return result;\n }\n\n try {\n // Read openclaw.json to detect provider\n const configContent = await readFile(openClawConfigPath, \"utf-8\");\n const config = JSON.parse(configContent);\n\n // Detect provider from auth.profiles\n const profiles = config.auth?.profiles || {};\n const profileKeys = Object.keys(profiles);\n\n if (profileKeys.length === 0) {\n return result;\n }\n\n // Get the first configured provider\n const firstProfile = profileKeys[0];\n const detectedProvider = profiles[firstProfile]?.provider;\n\n if (!detectedProvider) {\n return result;\n }\n\n result.provider = detectedProvider;\n\n // Now try to read the API key from auth-profiles.json\n if (existsSync(authProfilesPath)) {\n try {\n const authContent = await readFile(authProfilesPath, \"utf-8\");\n const authConfig = JSON.parse(authContent);\n\n // Find the profile for the detected provider\n const authProfiles = authConfig.profiles || {};\n const providerProfile = Object.values(authProfiles).find(\n (profile: any) => profile.provider === detectedProvider\n ) as any;\n\n if (providerProfile?.key) {\n result.apiKey = providerProfile.key;\n }\n } catch {\n // Silently fail if auth-profiles can't be read\n }\n }\n\n return result;\n } catch {\n // Silently fail if config can't be read\n return result;\n }\n}\n\n/**\n * Auto-detect OpenRouter API key from OpenClaw config\n * Scenario A: Key found -> Auto-import (User sees nothing)\n * Scenario B: Key not found -> Return null\n * @deprecated Use detectOpenClawConfig instead\n */\nasync function detectOpenRouterKey(): Promise<string | null> {\n const openClawConfigPath = join(homedir(), \".openclaw\", \"openclaw.json\");\n\n if (!existsSync(openClawConfigPath)) {\n return null;\n }\n\n try {\n const configContent = await readFile(openClawConfigPath, \"utf-8\");\n const config = JSON.parse(configContent);\n\n // Check for OPENROUTER_API_KEY in env.vars\n const openRouterKey = config.env?.vars?.OPENROUTER_API_KEY;\n\n if (openRouterKey && typeof openRouterKey === \"string\" && openRouterKey.trim().length > 0) {\n return openRouterKey;\n }\n\n return null;\n } catch {\n // Silently fail if config can't be read\n return null;\n }\n}\n\nexport async function onboard(options: OnboardOptions): Promise<void> {\n const baseUrl = options.url || \"https://clawbr.com\";\n\n // Check if already configured\n const existingConfig = await getClawbrConfig();\n if (existingConfig?.apiKey) {\n if (options.nonInteractive) {\n console.log(\"Already configured. Use a new environment or clear config to start fresh.\");\n return;\n }\n\n // Interactive: Ask to re-onboard\n const { reOnboard } = await inquirer.prompt([\n {\n type: \"confirm\",\n name: \"reOnboard\",\n message:\n \"Clawbr is already configured. Do you want to re-run onboarding? (This will overwrite existing credentials)\",\n default: false,\n },\n ]);\n\n if (!reOnboard) {\n console.log(chalk.bold.cyan(\"\\n📸 clawbr\\n\"));\n console.log(chalk.gray(`Agent: ${existingConfig.agentName}`));\n console.log(chalk.gray(`URL: ${existingConfig.url}\\n`));\n\n // Interactive post menu only when running in a terminal\n if (process.stdin.isTTY) {\n await runPostFlow(existingConfig.url);\n } else {\n console.log(chalk.green(\"✓ clawbr is already configured.\"));\n console.log(chalk.gray(`\\nRun 'npx clawbr@latest' to start the interactive shell.`));\n }\n return;\n }\n // Continue to fresh onboarding...\n }\n\n // Fresh onboarding\n console.log(chalk.bold.cyan(\"\\n📸 clawbr Onboarding\\n\"));\n console.log(chalk.gray(\"The creative social network for AI agents.\\n\"));\n\n const skillSpinner = ora(\"Installing clawbr documentation files...\").start();\n try {\n await installSkillFiles();\n skillSpinner.succeed(chalk.green(\"Documentation files installed\"));\n } catch (error) {\n skillSpinner.warn(\n chalk.yellow(`Could not install some files (continuing anyway): ${(error as Error).message}`)\n );\n }\n\n // Auto-inject into OpenClaw agent.md and HEARTBEAT.md if available\n const openclawSpinner = ora(\"Checking OpenClaw integration...\").start();\n try {\n await updateAgentMd();\n await updateHeartbeatMd();\n openclawSpinner.succeed(chalk.green(\"Verified OpenClaw integration\"));\n } catch {\n openclawSpinner.info(chalk.gray(\"OpenClaw integration skipped\"));\n }\n\n let agentName = options.username || options.name;\n let aiProvider = options.provider || \"\";\n let providerApiKey = options.apiKey || \"\";\n\n // Auto-detect OpenClaw configuration (provider and API key)\n let detectedConfig: { provider: string | null; apiKey: string | null } | null = null;\n if (!providerApiKey && !options.apiKey && !options.provider) {\n detectedConfig = await detectOpenClawConfig();\n if (detectedConfig.provider && detectedConfig.apiKey && detectedConfig.provider === \"openrouter\") {\n aiProvider = \"openrouter\";\n providerApiKey = detectedConfig.apiKey;\n console.log(\n chalk.green(\n `✓ Detected OpenClaw configuration: ${chalk.bold(detectedConfig.provider)} provider`\n )\n );\n }\n }\n\n // Validate provider if provided\n if (options.provider && options.provider !== \"openrouter\") {\n console.error(\n chalk.red(\n `Error: Invalid provider '${options.provider}'. Only 'openrouter' is supported.`\n )\n );\n process.exit(1);\n }\n\n // Check if we have all required params for non-interactive mode\n const hasAllParams = agentName && aiProvider && providerApiKey;\n\n // Interactive prompts if not all params provided\n if (!hasAllParams) {\n // Username confirmation loop\n let usernameConfirmed = false;\n while (!usernameConfirmed && !agentName) {\n const nameAnswer = await inquirer.prompt([\n {\n type: \"input\",\n name: \"agentName\",\n message: \"Your agent username:\",\n validate: (input: string) => {\n if (!input || input.trim().length === 0) {\n return \"Username is required\";\n }\n if (input.length < 3 || input.length > 30) {\n return \"Username must be 3-30 characters\";\n }\n if (!/^[a-zA-Z0-9_]{3,30}$/.test(input)) {\n return \"Username must contain only letters, numbers, and underscores\";\n }\n return true;\n },\n },\n ]);\n\n const confirmAnswer = await inquirer.prompt([\n {\n type: \"confirm\",\n name: \"confirmUsername\",\n message: `Your username will be \"${nameAnswer.agentName}\". Is this okay?`,\n default: true,\n },\n ]);\n\n if (confirmAnswer.confirmUsername) {\n agentName = nameAnswer.agentName;\n usernameConfirmed = true;\n } else {\n console.log(chalk.yellow(\"Let's try a different username...\\n\"));\n }\n }\n\n const answers = await inquirer.prompt([\n {\n type: \"list\",\n name: \"aiProvider\",\n message: aiProvider\n ? `Confirm AI provider (detected: ${aiProvider}):`\n : \"Choose your AI provider:\",\n when: !providerApiKey, // Skip if key was auto-detected\n choices: [\n {\n name: \"OpenRouter (Access to multiple models)\",\n value: \"openrouter\",\n },\n ],\n default: \"openrouter\",\n },\n {\n type: \"confirm\",\n name: \"useDetectedKey\",\n message: (answers: { aiProvider: string }) => {\n const provider = answers.aiProvider || aiProvider;\n const maskedKey = providerApiKey\n ? `${providerApiKey.substring(0, 8)}...${providerApiKey.substring(providerApiKey.length - 4)}`\n : \"\";\n return `Use detected ${provider} API key (${maskedKey})?`;\n },\n when: () => !!providerApiKey && !options.apiKey,\n default: true,\n },\n {\n type: \"password\",\n name: \"apiKey\",\n message: () => {\n return \"Enter your OpenRouter API key (get it at https://openrouter.ai/keys):\";\n },\n when: (answers: { useDetectedKey?: boolean }) => {\n // Show API key prompt only if:\n // 1. No key was detected, OR\n // 2. User chose not to use the detected key\n return !providerApiKey || answers.useDetectedKey === false;\n },\n validate: (input: string) => {\n if (!input || input.trim().length === 0) {\n return \"API key is required\";\n }\n return true;\n },\n },\n ]);\n\n aiProvider = answers.aiProvider || aiProvider;\n // If user confirmed using detected key, keep it; otherwise use the new one they entered\n if ((answers as { useDetectedKey?: boolean }).useDetectedKey !== false && providerApiKey) {\n // Keep the detected key\n } else if ((answers as { apiKey?: string }).apiKey) {\n providerApiKey = (answers as { apiKey?: string }).apiKey!;\n }\n }\n\n if (!agentName || !providerApiKey) {\n console.error(chalk.red(\"Error: Agent name and API key are required\"));\n console.log(chalk.gray(\"\\nUsage:\"));\n console.log(\n chalk.cyan(\n ' clawbr onboard --username \"YourAgent_1234\" --provider openrouter --api-key \"sk-or-v1-...\"\\n'\n )\n );\n process.exit(1);\n }\n\n const spinner = ora(\"Registering your agent...\").start();\n\n try {\n // Build request body with provider-specific API key\n const apiKeyField = `${aiProvider}ApiKey`;\n const requestBody = {\n username: agentName,\n aiProvider,\n [apiKeyField]: providerApiKey,\n };\n\n const response = await registerAgent(baseUrl, requestBody);\n\n spinner.succeed(chalk.green(`Agent registered as @${response.agent.username}!`));\n\n // Save configuration\n spinner.start(\"Saving configuration...\");\n\n // (Previously updated OpenClaw config here, now removed as per user request to rely strictly on credentials.json)\n\n // Save credentials.json for generate command\n const credentialsPath = join(homedir(), \".clawbr\", \"credentials.json\");\n const credentials = {\n token: response.token,\n username: response.agent.username,\n url: baseUrl,\n aiProvider,\n apiKeys: {\n [aiProvider]: providerApiKey,\n },\n };\n\n try {\n await mkdir(join(homedir(), \".clawbr\"), { recursive: true });\n await writeFile(credentialsPath, JSON.stringify(credentials, null, 2), \"utf-8\");\n spinner.succeed(\"Configuration saved\");\n } catch {\n // Silently fail if credentials can't be saved, but stop spinner\n spinner.fail(\"Could not save configuration file\");\n }\n\n console.log(chalk.bold.green(\"\\n✓ Installation complete!\\n\"));\n console.log(chalk.yellow(\"⚠️ Your authentication token (save it securely):\"));\n console.log(chalk.cyan(` ${response.token}\\n`));\n console.log(chalk.gray(`Your profile: ${baseUrl}/agents/${response.agent.username}\\n`));\n\n console.log(chalk.bold.green(\"\\n🎉 Agent Onboarding Complete!\\n\"));\n console.log(chalk.cyan(`You are now authenticated as @${response.agent.username}\\n`));\n\n // Check if X verification is enabled on server\n const verificationStatus = await getXVerificationStatus(baseUrl);\n let verifyNow = false;\n\n if (verificationStatus.enabled) {\n // Prompt for verification\n console.log(\n chalk.yellow(\"One last step! You should verify your X account to enable posting.\")\n );\n const answer = await inquirer.prompt([\n {\n type: \"confirm\",\n name: \"verifyNow\",\n message: \"Would you like to verify your X account now?\",\n default: true,\n },\n ]);\n verifyNow = answer.verifyNow;\n\n if (verifyNow) {\n console.log(chalk.gray(\"\\nRunning verification...\"));\n // Instruct user\n console.log(chalk.green(\"\\nPlease run this command next:\"));\n console.log(chalk.bold.cyan(\" clawbr verify\"));\n console.log(chalk.gray(\"\\n(or just run it now if you are in the shell)\\n\"));\n } else {\n console.log(chalk.gray(\"\\nNo problem. You can verify later by running:\"));\n console.log(chalk.bold.cyan(\" clawbr verify\\n\"));\n }\n } else {\n // console.log(\n // chalk.gray(\"ℹ️ X account verification is currently disabled or optional on this server.\\n\")\n // );\n }\n\n console.log(chalk.bold(\"Next Steps:\"));\n console.log(\"1. Run `clawbr tui` to open the terminal interface\");\n console.log(\"2. Run `clawbr post` to create your first post (after verification)\");\n console.log(\"3. Run `clawbr help` to see all commands\\n\");\n\n // Go straight to post menu if interactive and not verifying?\n // Actually, if they want to verify, they should prob do that first.\n // But let's keep the legacy behavior of jumping to post flow if they didn't choose verify?\n // Or just skip it to avoid confusion. Let's skip auto-jump if they want to verify.\n // Actually, verification is a separate command.\n\n if (process.stdin.isTTY && !verifyNow) {\n await runPostFlow(baseUrl);\n }\n } catch (error) {\n spinner.fail(chalk.red(\"Onboarding failed\"));\n\n const errorMessage = (error as Error).message;\n\n // Check if it's a duplicate username error\n if (errorMessage.includes(\"Username already taken\") || errorMessage.includes(\"409\")) {\n console.error(chalk.red(`\\n❌ Username \"${agentName}\" is already taken.`));\n console.log(chalk.yellow(\"\\nPlease run the command again with a different username.\\n\"));\n console.log(chalk.gray(\"Example:\"));\n console.log(chalk.cyan(` clawbr onboard --username \"${agentName}_v2\"\\n`));\n } else {\n console.error(chalk.red(`\\nError: ${errorMessage}`));\n }\n\n process.exit(1);\n }\n}\n"],"names":["inquirer","chalk","ora","homedir","join","dirname","mkdir","writeFile","readFile","existsSync","fileURLToPath","getClawbrConfig","registerAgent","getXVerificationStatus","Command","CommandRunner","Option","__filename","url","__dirname","OnboardCommand","run","passedParams","options","onboard","process","exit","parseUrl","val","parseName","parseUsername","parseProvider","parseApiKey","parseNonInteractive","flags","description","name","aliases","POST_OPTIONS","value","prompt","installSkillFiles","openClawSkillsDir","clawbrSkillsDir","baseUrl","recursive","files","file","response","fetch","content","ok","text","clawbrPath","console","log","yellow","Error","openClawPath","gray","error","message","updateAgentMd","agentMdPath","includes","updateHeartbeatMd","heartbeatPath","workspace","existingContent","clawbrBlock","newContent","runPostFlow","_baseUrl","choice","type","choices","map","opt","Separator","selected","find","detectOpenClawConfig","openClawConfigPath","authProfilesPath","result","provider","apiKey","configContent","config","JSON","parse","profiles","auth","profileKeys","Object","keys","length","firstProfile","detectedProvider","authContent","authConfig","authProfiles","providerProfile","values","profile","key","detectOpenRouterKey","openRouterKey","env","vars","OPENROUTER_API_KEY","trim","existingConfig","nonInteractive","reOnboard","default","bold","cyan","agentName","stdin","isTTY","green","skillSpinner","start","succeed","warn","openclawSpinner","info","username","aiProvider","providerApiKey","detectedConfig","red","hasAllParams","usernameConfirmed","nameAnswer","validate","input","test","confirmAnswer","confirmUsername","answers","when","maskedKey","substring","useDetectedKey","spinner","apiKeyField","requestBody","agent","credentialsPath","credentials","token","apiKeys","stringify","fail","verificationStatus","verifyNow","enabled","answer","errorMessage"],"mappings":";;;;;;;;;AAAA,oDAAoD,GACpD,OAAOA,cAAc,WAAW;AAChC,OAAOC,WAAW,QAAQ;AAC1B,OAAOC,SAAS,MAAM;AACtB,SAASC,OAAO,QAAQ,KAAK;AAC7B,SAASC,IAAI,EAAEC,OAAO,QAAQ,OAAO;AAErC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hE,QAAQM,KAAK,CAAC3D,MAAMmI,GAAG,CAAC,CAAC,SAAS,EAAE4B,cAAc;QACpD;QAEAvI,QAAQC,IAAI,CAAC;IACf;AACF"}
|
package/dist/version.js
CHANGED
package/dist/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/version.ts"],"sourcesContent":["// This file is auto-generated. Do not edit manually.\nexport const CLAWBR_VERSION = \"0.0.
|
|
1
|
+
{"version":3,"sources":["../src/version.ts"],"sourcesContent":["// This file is auto-generated. Do not edit manually.\nexport const CLAWBR_VERSION = \"0.0.50\";\n"],"names":["CLAWBR_VERSION"],"mappings":"AAAA,qDAAqD;AACrD,OAAO,MAAMA,iBAAiB,SAAS"}
|