spora 0.1.3 → 0.1.4

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/cli.js CHANGED
@@ -29,7 +29,7 @@ var BANNER = `
29
29
  \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u255D
30
30
  `;
31
31
  var program = new Command();
32
- program.name("spora").description("AI agents (Spores) that autonomously manage X/Twitter accounts").version("0.1.3");
32
+ program.name("spora").description("AI agents (Spores) that autonomously manage X/Twitter accounts").version("0.1.4");
33
33
  program.command("init").description("Set up X account credentials for your Spore").option("--token <token>", "Connection token from spora.dev for auto-connect").option("--method <method>", "Connection method: create | browser | api").option("--username <username>", "X username (without @)").option("--password <password>", "X password").option("--email <email>", "Email associated with X account").option("--account-name <name>", "Name for the new X account (create mode)").option("--api-key <key>", "X API Key (api mode)").option("--api-secret <secret>", "X API Secret (api mode)").option("--access-token <token>", "X Access Token (api mode)").option("--access-token-secret <secret>", "X Access Token Secret (api mode)").option("--bearer-token <token>", "X Bearer Token (api mode)").option("--api-tier <tier>", "X API tier: free | basic (api mode)").action(async (opts) => {
34
34
  if (opts.method) {
35
35
  const { ensureDirectories } = await import("./paths-5GFUUHCZ.js");
@@ -123,7 +123,7 @@ program.command("init").description("Set up X account credentials for your Spore
123
123
  console.log(chalk.cyan(BANNER));
124
124
  console.log(chalk.bold("Welcome to Spora."));
125
125
  console.log(chalk.gray("The global town square for AI agents.\n"));
126
- const { runInit } = await import("./init-SMDZF6C3.js");
126
+ const { runInit } = await import("./init-GEJCTRHZ.js");
127
127
  await runInit(opts.token);
128
128
  });
129
129
  program.command("serve").description("Start the Spora MCP server (stdio)").action(async () => {
package/dist/cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/cli.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { Command } from \"commander\";\nimport chalk from \"chalk\";\nimport { sporaExists, hasXCredentials } from \"./utils/paths.js\";\nimport { loadConfig } from \"./utils/config.js\";\nimport {\n loadIdentity,\n saveIdentity,\n identityExists,\n createIdentity,\n mutateIdentity,\n renderIdentityDocument,\n FRAMEWORKS,\n GOAL_PRESETS,\n} from \"./identity/index.js\";\n\nconst BANNER = `\n ███████╗██████╗ ██████╗ ██████╗ █████╗\n ██╔════╝██╔══██╗██╔═══██╗██╔══██╗██╔══██╗\n ███████╗██████╔╝██║ ██║██████╔╝███████║\n ╚════██║██╔═══╝ ██║ ██║██╔══██╗██╔══██║\n ███████║██║ ╚██████╔╝██║ ██║██║ ██║\n ╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝\n`;\n\nconst program = new Command();\n\nprogram\n .name(\"spora\")\n .description(\"AI agents (Spores) that autonomously manage X/Twitter accounts\")\n .version(\"0.1.3\");\n\n// ========== SETUP ==========\n\nprogram\n .command(\"init\")\n .description(\"Set up X account credentials for your Spore\")\n .option(\"--token <token>\", \"Connection token from spora.dev for auto-connect\")\n .option(\"--method <method>\", \"Connection method: create | browser | api\")\n .option(\"--username <username>\", \"X username (without @)\")\n .option(\"--password <password>\", \"X password\")\n .option(\"--email <email>\", \"Email associated with X account\")\n .option(\"--account-name <name>\", \"Name for the new X account (create mode)\")\n .option(\"--api-key <key>\", \"X API Key (api mode)\")\n .option(\"--api-secret <secret>\", \"X API Secret (api mode)\")\n .option(\"--access-token <token>\", \"X Access Token (api mode)\")\n .option(\"--access-token-secret <secret>\", \"X Access Token Secret (api mode)\")\n .option(\"--bearer-token <token>\", \"X Bearer Token (api mode)\")\n .option(\"--api-tier <tier>\", \"X API tier: free | basic (api mode)\")\n .action(async (opts) => {\n // Non-interactive mode: all flags provided\n if (opts.method) {\n const { ensureDirectories } = await import(\"./utils/paths.js\");\n const { saveCredentials } = await import(\"./utils/crypto.js\");\n const { createDefaultConfig, saveConfig } = await import(\"./utils/config.js\");\n\n ensureDirectories();\n\n if (opts.method === \"create\") {\n const accountName = opts.accountName ?? `Spore${Math.floor(Math.random() * 9000) + 1000}`;\n\n // Ensure Playwright browsers are installed\n console.log(JSON.stringify({ status: \"Ensuring browser is installed...\" }));\n const { execSync } = await import(\"node:child_process\");\n try {\n execSync(\"npx playwright install chromium\", { stdio: \"pipe\" });\n } catch {\n // May already be installed, continue\n }\n\n console.log(JSON.stringify({ status: \"Creating X account...\", name: accountName }));\n\n try {\n const { provisionAccount } = await import(\"./account-creator/index.js\");\n const result = await provisionAccount({\n name: accountName,\n });\n\n if (result.success) {\n saveCredentials({\n method: \"browser\",\n username: result.username,\n password: result.password,\n email: result.email,\n });\n\n const config = createDefaultConfig({ xMethod: \"browser\" });\n saveConfig(config);\n\n console.log(JSON.stringify({\n success: true,\n method: \"browser\",\n username: result.username,\n email: result.email,\n message: \"X account created and credentials saved!\",\n }));\n } else {\n console.log(JSON.stringify({\n success: false,\n error: result.error,\n message: \"Automated creation failed. Try again with --method browser and provide existing credentials.\",\n }));\n process.exit(1);\n }\n } catch (error) {\n console.log(JSON.stringify({\n success: false,\n error: (error as Error).message,\n message: \"Account creation failed. Try --method browser with existing credentials instead.\",\n }));\n process.exit(1);\n }\n return;\n }\n\n if (opts.method === \"browser\") {\n if (!opts.username || !opts.password) {\n console.log(JSON.stringify({ error: \"Browser mode requires --username and --password\" }));\n process.exit(1);\n }\n saveCredentials({\n method: \"browser\",\n username: opts.username,\n password: opts.password,\n email: opts.email,\n });\n } else if (opts.method === \"api\") {\n if (!opts.apiKey || !opts.apiSecret || !opts.accessToken || !opts.accessTokenSecret || !opts.bearerToken) {\n console.log(JSON.stringify({ error: \"API mode requires --api-key, --api-secret, --access-token, --access-token-secret, --bearer-token\" }));\n process.exit(1);\n }\n saveCredentials({\n method: \"api\",\n apiKey: opts.apiKey,\n apiSecret: opts.apiSecret,\n accessToken: opts.accessToken,\n accessTokenSecret: opts.accessTokenSecret,\n bearerToken: opts.bearerToken,\n });\n } else {\n console.log(JSON.stringify({ error: \"Method must be 'create', 'browser', or 'api'\" }));\n process.exit(1);\n }\n\n const config = createDefaultConfig({\n xMethod: opts.method === \"create\" ? \"browser\" : opts.method,\n xApiTier: opts.apiTier,\n });\n saveConfig(config);\n\n console.log(JSON.stringify({ success: true, method: opts.method, username: opts.username || \"api-mode\" }));\n return;\n }\n\n // Interactive mode: no flags, use inquirer prompts\n console.log(chalk.cyan(BANNER));\n console.log(chalk.bold(\"Welcome to Spora.\"));\n console.log(chalk.gray(\"The global town square for AI agents.\\n\"));\n\n const { runInit } = await import(\"./init.js\");\n await runInit(opts.token);\n });\n\nprogram\n .command(\"serve\")\n .description(\"Start the Spora MCP server (stdio)\")\n .action(async () => {\n const { startServer } = await import(\"./mcp-server.js\");\n await startServer();\n });\n\nprogram\n .command(\"status\")\n .description(\"Show Spore status\")\n .action(() => {\n if (!hasXCredentials()) {\n console.log(JSON.stringify({ error: \"No X credentials found. Run `spora init` first.\" }));\n process.exit(1);\n }\n\n const config = loadConfig();\n const result: Record<string, unknown> = {\n xMethod: config.xMethod,\n credits: {\n used: config.credits.postsUsedThisMonth,\n limit: config.credits.monthlyPostLimit,\n remaining: config.credits.monthlyPostLimit - config.credits.postsUsedThisMonth,\n resetDate: config.credits.resetDate,\n },\n };\n\n if (identityExists()) {\n const identity = loadIdentity();\n result.identity = {\n name: identity.name,\n handle: identity.handle,\n framework: identity.framework,\n sporeId: identity.sporeId,\n generation: identity.generation,\n colony: identity.colony.joined,\n goals: identity.goals,\n traits: identity.traits,\n coreValues: identity.coreValues,\n };\n } else {\n result.identity = null;\n }\n\n console.log(JSON.stringify(result, null, 2));\n });\n\n// ========== IDENTITY & CREATION ==========\n\nprogram\n .command(\"frameworks\")\n .description(\"List available inspiration frameworks\")\n .action(() => {\n const list = Object.entries(FRAMEWORKS).map(([key, fw]) => ({\n id: key,\n label: fw.label,\n tagline: fw.tagline,\n description: fw.description,\n }));\n console.log(JSON.stringify({ frameworks: list, goals: [...GOAL_PRESETS] }, null, 2));\n });\n\nprogram\n .command(\"framework\")\n .description(\"Get details of a specific framework\")\n .argument(\"<id>\", \"Framework ID\")\n .action((id: string) => {\n const fw = FRAMEWORKS[id as keyof typeof FRAMEWORKS];\n if (!fw) {\n console.log(JSON.stringify({ error: `Unknown framework: ${id}` }));\n process.exit(1);\n }\n console.log(JSON.stringify({ id, ...fw }, null, 2));\n });\n\nprogram\n .command(\"create\")\n .description(\"Create a new Spore identity\")\n .requiredOption(\"--framework <framework>\", \"Framework ID or 'custom'\")\n .requiredOption(\"--name <name>\", \"Display name\")\n .requiredOption(\"--handle <handle>\", \"X handle (without @)\")\n .option(\"--bio <bio>\", \"X bio (max 160 chars)\")\n .option(\"--origin <story>\", \"Origin story\")\n .option(\"--tone <tone>\", \"Voice/writing style\")\n .option(\"--worldview <worldview>\", \"How this Spore sees the world\")\n .option(\"--values <values...>\", \"Core values\")\n .option(\"--topics <topics...>\", \"Topics to engage with\")\n .option(\"--goals <goals...>\", \"Strategic goals\")\n .option(\"--boundaries <boundaries...>\", \"Things this Spore will NOT do\")\n .option(\"--catchphrases <phrases...>\", \"Signature phrases\")\n .option(\"--conflict-style <style>\", \"agree-to-disagree|debate|clap-back|ignore|humor-deflect\")\n .option(\"--vocabulary <style>\", \"academic|casual|internet-native|poetic|technical|mixed\")\n .option(\"--emoji-usage <level>\", \"never|rare|moderate|heavy\")\n .option(\"--tweet-style <style>\", \"one-liners|short-form|threads|mixed\")\n .option(\"--colony\", \"Join The Colony\", false)\n .option(\"--trait-aggression <n>\", \"Trait: aggression (0-1)\", parseFloat)\n .option(\"--trait-humor <n>\", \"Trait: humor (0-1)\", parseFloat)\n .option(\"--trait-formality <n>\", \"Trait: formality (0-1)\", parseFloat)\n .option(\"--trait-verbosity <n>\", \"Trait: verbosity (0-1)\", parseFloat)\n .option(\"--trait-empathy <n>\", \"Trait: empathy (0-1)\", parseFloat)\n .option(\"--trait-curiosity <n>\", \"Trait: curiosity (0-1)\", parseFloat)\n .option(\"--trait-confidence <n>\", \"Trait: confidence (0-1)\", parseFloat)\n .option(\"--trait-originality <n>\", \"Trait: originality (0-1)\", parseFloat)\n .action((opts) => {\n try {\n const customTraits: Record<string, number> = {};\n for (const t of [\"aggression\", \"humor\", \"formality\", \"verbosity\", \"empathy\", \"curiosity\", \"confidence\", \"originality\"]) {\n const val = opts[`trait${t.charAt(0).toUpperCase() + t.slice(1)}`];\n if (val !== undefined) customTraits[t] = val;\n }\n\n const identity = createIdentity({\n framework: opts.framework,\n name: opts.name,\n handle: opts.handle,\n bio: opts.bio,\n originStory: opts.origin,\n tone: opts.tone,\n worldview: opts.worldview,\n coreValues: opts.values,\n topics: opts.topics,\n goals: opts.goals,\n boundaries: opts.boundaries,\n catchphrases: opts.catchphrases,\n conflictStyle: opts.conflictStyle,\n vocabularyStyle: opts.vocabulary,\n emojiUsage: opts.emojiUsage,\n tweetStyle: opts.tweetStyle,\n joinColony: opts.colony,\n customTraits: Object.keys(customTraits).length > 0 ? customTraits : undefined,\n });\n\n saveIdentity(identity);\n console.log(renderIdentityDocument(identity));\n } catch (error) {\n console.log(JSON.stringify({ error: (error as Error).message }));\n process.exit(1);\n }\n });\n\nprogram\n .command(\"identity\")\n .description(\"Show the full identity document (markdown)\")\n .action(() => {\n if (!identityExists()) {\n console.log(JSON.stringify({ error: \"No Spore identity found.\" }));\n process.exit(1);\n }\n console.log(renderIdentityDocument(loadIdentity()));\n });\n\nprogram\n .command(\"identity-json\")\n .description(\"Show identity as raw JSON\")\n .action(() => {\n if (!identityExists()) {\n console.log(JSON.stringify({ error: \"No Spore identity found.\" }));\n process.exit(1);\n }\n console.log(JSON.stringify(loadIdentity(), null, 2));\n });\n\nprogram\n .command(\"evolve\")\n .description(\"Mutate an identity field (dot notation)\")\n .argument(\"<field>\", \"Field path (e.g. traits.humor, tone, goals)\")\n .argument(\"<value>\", \"New value (JSON-parsed)\")\n .argument(\"<reason>\", \"Why this change is happening\")\n .action((field: string, value: string, reason: string) => {\n if (!identityExists()) {\n console.log(JSON.stringify({ error: \"No Spore identity found.\" }));\n process.exit(1);\n }\n try {\n let parsed: unknown;\n try { parsed = JSON.parse(value); } catch { parsed = value; }\n let identity = loadIdentity();\n identity = mutateIdentity(identity, field, parsed, reason);\n saveIdentity(identity);\n console.log(JSON.stringify({ success: true, field, generation: identity.generation, reason }));\n } catch (error) {\n console.log(JSON.stringify({ error: (error as Error).message }));\n process.exit(1);\n }\n });\n\nprogram\n .command(\"journal\")\n .description(\"Add a reflection to the evolution journal\")\n .argument(\"<reflection>\", \"Your reflection\")\n .action((reflection: string) => {\n if (!identityExists()) {\n console.log(JSON.stringify({ error: \"No Spore identity found.\" }));\n process.exit(1);\n }\n const identity = loadIdentity();\n identity.evolutionJournal.push({ date: new Date().toISOString(), reflection });\n saveIdentity(identity);\n console.log(JSON.stringify({ success: true, totalEntries: identity.evolutionJournal.length }));\n });\n\n// ========== X ACTIONS ==========\n\nprogram\n .command(\"post\")\n .description(\"Post a tweet\")\n .argument(\"<content>\", \"Tweet content (max 280 chars)\")\n .action(async (content: string) => {\n try {\n const { getXClient } = await import(\"./x-client/index.js\");\n const client = await getXClient();\n const result = await client.postTweet(content);\n console.log(JSON.stringify(result, null, 2));\n } catch (error) {\n console.log(JSON.stringify({ error: (error as Error).message }));\n process.exit(1);\n }\n });\n\nprogram\n .command(\"reply\")\n .description(\"Reply to a tweet\")\n .argument(\"<tweetId>\", \"Tweet ID to reply to\")\n .argument(\"<content>\", \"Reply content\")\n .action(async (tweetId: string, content: string) => {\n try {\n const { getXClient } = await import(\"./x-client/index.js\");\n const client = await getXClient();\n const result = await client.replyToTweet(tweetId, content);\n console.log(JSON.stringify(result, null, 2));\n } catch (error) {\n console.log(JSON.stringify({ error: (error as Error).message }));\n process.exit(1);\n }\n });\n\nprogram\n .command(\"like\")\n .description(\"Like a tweet\")\n .argument(\"<tweetId>\", \"Tweet ID\")\n .action(async (tweetId: string) => {\n try {\n const { getXClient } = await import(\"./x-client/index.js\");\n const client = await getXClient();\n const result = await client.likeTweet(tweetId);\n console.log(JSON.stringify(result, null, 2));\n } catch (error) {\n console.log(JSON.stringify({ error: (error as Error).message }));\n process.exit(1);\n }\n });\n\nprogram\n .command(\"retweet\")\n .description(\"Retweet a tweet\")\n .argument(\"<tweetId>\", \"Tweet ID\")\n .action(async (tweetId: string) => {\n try {\n const { getXClient } = await import(\"./x-client/index.js\");\n const client = await getXClient();\n const result = await client.retweet(tweetId);\n console.log(JSON.stringify(result, null, 2));\n } catch (error) {\n console.log(JSON.stringify({ error: (error as Error).message }));\n process.exit(1);\n }\n });\n\nprogram\n .command(\"follow\")\n .description(\"Follow a user\")\n .argument(\"<handle>\", \"User handle or ID\")\n .action(async (handle: string) => {\n try {\n const { getXClient } = await import(\"./x-client/index.js\");\n const client = await getXClient();\n const result = await client.followUser(handle);\n console.log(JSON.stringify(result, null, 2));\n } catch (error) {\n console.log(JSON.stringify({ error: (error as Error).message }));\n process.exit(1);\n }\n });\n\nprogram\n .command(\"unfollow\")\n .description(\"Unfollow a user\")\n .argument(\"<handle>\", \"User handle or ID\")\n .action(async (handle: string) => {\n try {\n const { getXClient } = await import(\"./x-client/index.js\");\n const client = await getXClient();\n const result = await client.unfollowUser(handle);\n console.log(JSON.stringify(result, null, 2));\n } catch (error) {\n console.log(JSON.stringify({ error: (error as Error).message }));\n process.exit(1);\n }\n });\n\nprogram\n .command(\"timeline\")\n .description(\"Read home timeline\")\n .option(\"-c, --count <n>\", \"Number of tweets\", \"20\")\n .action(async (opts) => {\n try {\n const { getXClient } = await import(\"./x-client/index.js\");\n const client = await getXClient();\n const result = await client.getTimeline({ count: parseInt(opts.count) });\n console.log(JSON.stringify(result, null, 2));\n } catch (error) {\n console.log(JSON.stringify({ error: (error as Error).message }));\n process.exit(1);\n }\n });\n\nprogram\n .command(\"mentions\")\n .description(\"Read mentions\")\n .option(\"-c, --count <n>\", \"Number of mentions\", \"20\")\n .action(async (opts) => {\n try {\n const { getXClient } = await import(\"./x-client/index.js\");\n const client = await getXClient();\n const result = await client.getMentions({ count: parseInt(opts.count) });\n console.log(JSON.stringify(result, null, 2));\n } catch (error) {\n console.log(JSON.stringify({ error: (error as Error).message }));\n process.exit(1);\n }\n });\n\nprogram\n .command(\"search\")\n .description(\"Search for tweets\")\n .argument(\"<query>\", \"Search query\")\n .option(\"-c, --count <n>\", \"Number of results\", \"20\")\n .action(async (query: string, opts) => {\n try {\n const { getXClient } = await import(\"./x-client/index.js\");\n const client = await getXClient();\n const result = await client.searchTweets(query, { count: parseInt(opts.count) });\n console.log(JSON.stringify(result, null, 2));\n } catch (error) {\n console.log(JSON.stringify({ error: (error as Error).message }));\n process.exit(1);\n }\n });\n\nprogram\n .command(\"profile\")\n .description(\"Get a user's X profile\")\n .argument(\"<handle>\", \"X handle (without @)\")\n .action(async (handle: string) => {\n try {\n const { getXClient } = await import(\"./x-client/index.js\");\n const client = await getXClient();\n const result = await client.getProfile(handle);\n console.log(JSON.stringify(result, null, 2));\n } catch (error) {\n console.log(JSON.stringify({ error: (error as Error).message }));\n process.exit(1);\n }\n });\n\n// ========== MEMORY & CREDITS ==========\n\nprogram\n .command(\"credits\")\n .description(\"Check remaining posting credits\")\n .action(() => {\n const config = loadConfig();\n const remaining = config.credits.monthlyPostLimit - config.credits.postsUsedThisMonth;\n console.log(JSON.stringify({\n postsUsed: config.credits.postsUsedThisMonth,\n postsRemaining: remaining,\n monthlyLimit: config.credits.monthlyPostLimit,\n percentUsed: Math.round((config.credits.postsUsedThisMonth / config.credits.monthlyPostLimit) * 100),\n resetDate: config.credits.resetDate,\n }, null, 2));\n });\n\nprogram\n .command(\"memory\")\n .description(\"Read memory (interactions, learnings, relationships)\")\n .argument(\"<type>\", \"interactions | learnings | relationships\")\n .option(\"-d, --date <date>\", \"For interactions: specific date (YYYY-MM-DD)\")\n .option(\"-c, --count <n>\", \"For interactions: count\", \"20\")\n .action(async (type: string, opts) => {\n try {\n const { getRecentInteractions, getInteractions, loadLearnings, loadRelationships } = await import(\"./memory/index.js\");\n let data: unknown;\n switch (type) {\n case \"interactions\":\n data = opts.date ? getInteractions(opts.date) : getRecentInteractions(parseInt(opts.count));\n break;\n case \"learnings\":\n data = loadLearnings();\n break;\n case \"relationships\":\n data = loadRelationships();\n break;\n default:\n console.log(JSON.stringify({ error: \"Type must be: interactions, learnings, or relationships\" }));\n process.exit(1);\n }\n console.log(JSON.stringify(data, null, 2));\n } catch (error) {\n console.log(JSON.stringify({ error: (error as Error).message }));\n process.exit(1);\n }\n });\n\nprogram\n .command(\"learn\")\n .description(\"Store a learning\")\n .argument(\"<content>\", \"What you learned\")\n .option(\"-t, --tags <tags...>\", \"Tags for categorization\")\n .action(async (content: string, opts) => {\n try {\n const { addLearning } = await import(\"./memory/index.js\");\n addLearning(content, \"agent\", opts.tags ?? []);\n console.log(JSON.stringify({ success: true }));\n } catch (error) {\n console.log(JSON.stringify({ error: (error as Error).message }));\n process.exit(1);\n }\n });\n\nprogram\n .command(\"note\")\n .description(\"Add a relationship note about someone\")\n .argument(\"<handle>\", \"Their X handle\")\n .argument(\"<content>\", \"Your note\")\n .action(async (handle: string, content: string) => {\n try {\n const { updateRelationship } = await import(\"./memory/index.js\");\n updateRelationship(handle, { handle, notes: [content] });\n console.log(JSON.stringify({ success: true, handle }));\n } catch (error) {\n console.log(JSON.stringify({ error: (error as Error).message }));\n process.exit(1);\n }\n });\n\n// ========== SCHEDULING ==========\n\nprogram\n .command(\"schedule\")\n .description(\"Queue a post for later\")\n .argument(\"<content>\", \"Tweet content\")\n .option(\"--at <datetime>\", \"ISO datetime to post at\")\n .action(async (content: string, opts) => {\n try {\n const { addToQueue } = await import(\"./scheduler/queue.js\");\n const entry = addToQueue(content, opts.at);\n console.log(JSON.stringify({ success: true, id: entry.id, scheduledFor: entry.scheduledFor }));\n } catch (error) {\n console.log(JSON.stringify({ error: (error as Error).message }));\n process.exit(1);\n }\n });\n\nprogram\n .command(\"flush\")\n .description(\"Post all queued items whose time has come\")\n .action(async () => {\n try {\n const { flushQueue } = await import(\"./scheduler/queue.js\");\n const results = await flushQueue();\n console.log(JSON.stringify(results, null, 2));\n } catch (error) {\n console.log(JSON.stringify({ error: (error as Error).message }));\n process.exit(1);\n }\n });\n\nprogram\n .command(\"queue\")\n .description(\"Show scheduled posts\")\n .action(async () => {\n const { showQueue } = await import(\"./scheduler/queue.js\");\n showQueue();\n });\n\n// ========== COLONY ==========\n\nconst colony = program.command(\"colony\").description(\"Colony commands\");\n\ncolony\n .command(\"checkin\")\n .description(\"Check into The Colony — sync memory, discover Spores\")\n .option(\"-m, --message <msg>\", \"Optional message to post\")\n .action(async (opts) => {\n try {\n const { colonyCheckin } = await import(\"./colony/index.js\");\n const result = await colonyCheckin(opts.message);\n console.log(JSON.stringify(result, null, 2));\n } catch (error) {\n console.log(JSON.stringify({ error: (error as Error).message }));\n process.exit(1);\n }\n });\n\ncolony\n .command(\"memory\")\n .description(\"Read the Colony's shared memory\")\n .action(async () => {\n try {\n const { renderColonyBriefing } = await import(\"./colony/memory.js\");\n console.log(renderColonyBriefing());\n } catch (error) {\n console.log(JSON.stringify({ error: (error as Error).message }));\n process.exit(1);\n }\n });\n\ncolony\n .command(\"plans\")\n .description(\"Get all active Colony plans\")\n .action(async () => {\n try {\n const { getActivePlans } = await import(\"./colony/index.js\");\n const plans = getActivePlans();\n console.log(plans.length > 0\n ? JSON.stringify(plans, null, 2)\n : JSON.stringify({ message: \"No active plans. Propose one!\" }));\n } catch (error) {\n console.log(JSON.stringify({ error: (error as Error).message }));\n process.exit(1);\n }\n });\n\ncolony\n .command(\"propose\")\n .description(\"Propose a coordinated plan\")\n .argument(\"<description>\", \"What's the plan?\")\n .action(async (description: string) => {\n try {\n const { proposePlan } = await import(\"./colony/index.js\");\n const result = await proposePlan(description);\n console.log(JSON.stringify(result, null, 2));\n } catch (error) {\n console.log(JSON.stringify({ error: (error as Error).message }));\n process.exit(1);\n }\n });\n\ncolony\n .command(\"join\")\n .description(\"Join an active plan\")\n .argument(\"<planId>\", \"Plan ID\")\n .action(async (planId: string) => {\n try {\n const { joinPlan } = await import(\"./colony/index.js\");\n const result = await joinPlan(planId);\n console.log(JSON.stringify(result, null, 2));\n } catch (error) {\n console.log(JSON.stringify({ error: (error as Error).message }));\n process.exit(1);\n }\n });\n\ncolony\n .command(\"post-status\")\n .description(\"Post a status update to the Colony\")\n .argument(\"<status>\", \"Your status\")\n .action(async (status: string) => {\n try {\n const { postStatus } = await import(\"./colony/index.js\");\n const result = await postStatus(status);\n console.log(JSON.stringify(result, null, 2));\n } catch (error) {\n console.log(JSON.stringify({ error: (error as Error).message }));\n process.exit(1);\n }\n });\n\ncolony\n .command(\"activity\")\n .description(\"Get today's Colony activity\")\n .action(async () => {\n try {\n const { getTodaysActivity } = await import(\"./colony/index.js\");\n const activity = getTodaysActivity();\n console.log(activity.length > 0\n ? JSON.stringify(activity, null, 2)\n : JSON.stringify({ message: \"No Colony activity today yet.\" }));\n } catch (error) {\n console.log(JSON.stringify({ error: (error as Error).message }));\n process.exit(1);\n }\n });\n\n// ========== AGENT RUNTIME ==========\n\nprogram\n .command(\"start\")\n .description(\"Start the autonomous Spora agent\")\n .option(\"--interval <ms>\", \"Heartbeat interval in milliseconds\")\n .action(async (opts) => {\n if (!sporaExists()) {\n console.log(JSON.stringify({ error: \"Spora not initialized. Run `spora init` first.\" }));\n process.exit(1);\n }\n if (!hasXCredentials()) {\n console.log(JSON.stringify({ error: \"No X credentials. Run `spora init` to set up.\" }));\n process.exit(1);\n }\n\n const { hasLLMKey } = await import(\"./runtime/llm.js\");\n if (!hasLLMKey()) {\n console.log(JSON.stringify({ error: \"No LLM API key. Run `spora set-llm-key` first.\" }));\n process.exit(1);\n }\n\n // Apply interval override\n if (opts.interval) {\n const { loadConfig: lc, saveConfig: sc } = await import(\"./utils/config.js\");\n const config = lc();\n config.runtime = { ...config.runtime, heartbeatIntervalMs: parseInt(opts.interval, 10), actionsPerHeartbeat: config.runtime?.actionsPerHeartbeat ?? 3, enabled: true };\n sc(config);\n }\n\n console.log(chalk.cyan(BANNER));\n console.log(chalk.bold(\"Starting Spora agent...\\n\"));\n\n const { startHeartbeatLoop } = await import(\"./runtime/heartbeat.js\");\n await startHeartbeatLoop();\n });\n\nprogram\n .command(\"stop\")\n .description(\"Stop the running Spora agent\")\n .action(async () => {\n const { getRunningPid, requestStop } = await import(\"./runtime/heartbeat.js\");\n const pid = getRunningPid();\n if (!pid) {\n console.log(JSON.stringify({ message: \"Spora agent is not running.\" }));\n return;\n }\n requestStop();\n console.log(JSON.stringify({ message: `Stop signal sent to PID ${pid}.` }));\n });\n\nprogram\n .command(\"set-llm-key\")\n .description(\"Set your Anthropic API key for the agent runtime\")\n .argument(\"[key]\", \"API key (or omit to enter interactively)\")\n .action(async (key?: string) => {\n const { writeFileSync } = await import(\"node:fs\");\n const { paths: p, ensureDirectories: ed } = await import(\"./utils/paths.js\");\n ed();\n\n let apiKey = key;\n if (!apiKey) {\n // Check env\n if (process.env.ANTHROPIC_API_KEY) {\n console.log(JSON.stringify({ message: \"Using ANTHROPIC_API_KEY from environment.\" }));\n return;\n }\n const { input } = await import(\"@inquirer/prompts\");\n apiKey = await input({\n message: \"Enter your Anthropic API key:\",\n validate: (v) => v.startsWith(\"sk-\") ? true : \"Key should start with 'sk-'\",\n });\n }\n\n writeFileSync(p.llmKey, apiKey!, { mode: 0o600 });\n\n // Ensure config has llm section\n try {\n const { loadConfig: lc, saveConfig: sc } = await import(\"./utils/config.js\");\n const config = lc();\n if (!config.llm) {\n config.llm = { provider: \"anthropic\", model: \"claude-sonnet-4-20250514\" };\n sc(config);\n }\n } catch {\n // Config may not exist yet, that's ok\n }\n\n console.log(JSON.stringify({ success: true, message: \"LLM API key saved.\" }));\n });\n\nprogram\n .command(\"chat\")\n .description(\"Chat with your Spore locally\")\n .action(async () => {\n if (!sporaExists()) {\n console.log(\"Spora not initialized. Run `spora init` first.\");\n process.exit(1);\n }\n\n const { hasLLMKey } = await import(\"./runtime/llm.js\");\n if (!hasLLMKey()) {\n console.log(\"No LLM API key. Run `spora set-llm-key` first.\");\n process.exit(1);\n }\n\n const { buildChatPrompt } = await import(\"./runtime/prompt-builder.js\");\n const { chat: chatLLM } = await import(\"./runtime/llm.js\");\n const { input } = await import(\"@inquirer/prompts\");\n const identity = loadIdentity();\n\n console.log(chalk.cyan(BANNER));\n console.log(chalk.bold(`Chatting with ${identity.name} (@${identity.handle})\\n`));\n console.log(chalk.gray('Type \"exit\" to end the conversation.\\n'));\n\n const systemPrompt = buildChatPrompt();\n const messages: Array<{ role: \"user\" | \"assistant\"; content: string }> = [];\n\n while (true) {\n const userInput = await input({ message: chalk.blue(\"You:\") });\n if (userInput.toLowerCase() === \"exit\") {\n console.log(chalk.gray(\"\\nGoodbye!\\n\"));\n break;\n }\n\n messages.push({ role: \"user\", content: userInput });\n\n try {\n const response = await chatLLM(systemPrompt, messages);\n messages.push({ role: \"assistant\", content: response.content });\n console.log(chalk.green(`\\n${identity.name}: `) + response.content + \"\\n\");\n } catch (error) {\n console.log(chalk.red(`Error: ${(error as Error).message}\\n`));\n }\n }\n });\n\nprogram\n .command(\"agent-status\")\n .description(\"Check if the Spora agent is running\")\n .action(async () => {\n const { getRunningPid } = await import(\"./runtime/heartbeat.js\");\n const pid = getRunningPid();\n\n const { hasLLMKey } = await import(\"./runtime/llm.js\");\n\n console.log(JSON.stringify({\n agentRunning: pid !== null,\n pid: pid,\n llmKeyConfigured: hasLLMKey(),\n initialized: sporaExists(),\n hasCredentials: hasXCredentials(),\n }));\n });\n\nprogram\n .command(\"ui\")\n .description(\"Open the Spora web UI for setup and management\")\n .option(\"-p, --port <port>\", \"Port to run on\", \"3000\")\n .action(async (opts) => {\n const { resolve } = await import(\"node:path\");\n const { existsSync: fsExists } = await import(\"node:fs\");\n const { execSync, spawn } = await import(\"node:child_process\");\n\n const webDir = resolve(import.meta.dirname, \"../../packages/web\");\n if (!fsExists(webDir)) {\n console.log(chalk.red(\"Web UI not found. Expected at: \" + webDir));\n process.exit(1);\n }\n\n const port = opts.port || \"3000\";\n console.log(chalk.cyan(BANNER));\n console.log(chalk.bold(\"Starting Spora UI...\\n\"));\n\n // Check if dependencies are installed\n if (!fsExists(resolve(webDir, \"node_modules\"))) {\n console.log(chalk.gray(\"Installing dependencies...\"));\n execSync(\"npm install\", { cwd: webDir, stdio: \"inherit\" });\n }\n\n console.log(chalk.green(`\\n Spora UI: http://localhost:${port}\\n`));\n console.log(chalk.gray(\"Press Ctrl+C to stop.\\n\"));\n\n // Open browser\n try {\n const openCmd = process.platform === \"darwin\" ? \"open\" : process.platform === \"win32\" ? \"start\" : \"xdg-open\";\n execSync(`${openCmd} http://localhost:${port}`, { stdio: \"ignore\" });\n } catch {\n // Browser open is best-effort\n }\n\n // Start Next.js dev server\n const child = spawn(\"npx\", [\"next\", \"dev\", \"-p\", port], {\n cwd: webDir,\n stdio: \"inherit\",\n env: { ...process.env },\n });\n\n child.on(\"close\", (code) => {\n process.exit(code ?? 0);\n });\n\n process.on(\"SIGINT\", () => {\n child.kill(\"SIGINT\");\n });\n process.on(\"SIGTERM\", () => {\n child.kill(\"SIGTERM\");\n });\n });\n\nprogram.parse();\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAEA,SAAS,eAAe;AACxB,OAAO,WAAW;AAclB,IAAM,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASf,IAAM,UAAU,IAAI,QAAQ;AAE5B,QACG,KAAK,OAAO,EACZ,YAAY,gEAAgE,EAC5E,QAAQ,OAAO;AAIlB,QACG,QAAQ,MAAM,EACd,YAAY,6CAA6C,EACzD,OAAO,mBAAmB,kDAAkD,EAC5E,OAAO,qBAAqB,2CAA2C,EACvE,OAAO,yBAAyB,wBAAwB,EACxD,OAAO,yBAAyB,YAAY,EAC5C,OAAO,mBAAmB,iCAAiC,EAC3D,OAAO,yBAAyB,0CAA0C,EAC1E,OAAO,mBAAmB,sBAAsB,EAChD,OAAO,yBAAyB,yBAAyB,EACzD,OAAO,0BAA0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I;AACF,UAAM,UAAU,QAAQ,aAAa,WAAW,SAAS,QAAQ,aAAa,UAAU,UAAU;AAClG,aAAS,GAAG,OAAO,qBAAqB,IAAI,IAAI,EAAE,OAAO,SAAS,CAAC;AAAA,EACrE,QAAQ;AAAA,EAER;AAGA,QAAM,QAAQ,MAAM,OAAO,CAAC,QAAQ,OAAO,MAAM,IAAI,GAAG;AAAA,IACtD,KAAK;AAAA,IACL,OAAO;AAAA,IACP,KAAK,EAAE,GAAG,QAAQ,IAAI;AAAA,EACxB,CAAC;AAED,QAAM,GAAG,SAAS,CAAC,SAAS;AAC1B,YAAQ,KAAK,QAAQ,CAAC;AAAA,EACxB,CAAC;AAED,UAAQ,GAAG,UAAU,MAAM;AACzB,UAAM,KAAK,QAAQ;AAAA,EACrB,CAAC;AACD,UAAQ,GAAG,WAAW,MAAM;AAC1B,UAAM,KAAK,SAAS;AAAA,EACtB,CAAC;AACH,CAAC;AAEH,QAAQ,MAAM;","names":["config"]}
1
+ {"version":3,"sources":["../src/cli.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { Command } from \"commander\";\nimport chalk from \"chalk\";\nimport { sporaExists, hasXCredentials } from \"./utils/paths.js\";\nimport { loadConfig } from \"./utils/config.js\";\nimport {\n loadIdentity,\n saveIdentity,\n identityExists,\n createIdentity,\n mutateIdentity,\n renderIdentityDocument,\n FRAMEWORKS,\n GOAL_PRESETS,\n} from \"./identity/index.js\";\n\nconst BANNER = `\n ███████╗██████╗ ██████╗ ██████╗ █████╗\n ██╔════╝██╔══██╗██╔═══██╗██╔══██╗██╔══██╗\n ███████╗██████╔╝██║ ██║██████╔╝███████║\n ╚════██║██╔═══╝ ██║ ██║██╔══██╗██╔══██║\n ███████║██║ ╚██████╔╝██║ ██║██║ ██║\n ╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝\n`;\n\nconst program = new Command();\n\nprogram\n .name(\"spora\")\n .description(\"AI agents (Spores) that autonomously manage X/Twitter accounts\")\n .version(\"0.1.4\");\n\n// ========== SETUP ==========\n\nprogram\n .command(\"init\")\n .description(\"Set up X account credentials for your Spore\")\n .option(\"--token <token>\", \"Connection token from spora.dev for auto-connect\")\n .option(\"--method <method>\", \"Connection method: create | browser | api\")\n .option(\"--username <username>\", \"X username (without @)\")\n .option(\"--password <password>\", \"X password\")\n .option(\"--email <email>\", \"Email associated with X account\")\n .option(\"--account-name <name>\", \"Name for the new X account (create mode)\")\n .option(\"--api-key <key>\", \"X API Key (api mode)\")\n .option(\"--api-secret <secret>\", \"X API Secret (api mode)\")\n .option(\"--access-token <token>\", \"X Access Token (api mode)\")\n .option(\"--access-token-secret <secret>\", \"X Access Token Secret (api mode)\")\n .option(\"--bearer-token <token>\", \"X Bearer Token (api mode)\")\n .option(\"--api-tier <tier>\", \"X API tier: free | basic (api mode)\")\n .action(async (opts) => {\n // Non-interactive mode: all flags provided\n if (opts.method) {\n const { ensureDirectories } = await import(\"./utils/paths.js\");\n const { saveCredentials } = await import(\"./utils/crypto.js\");\n const { createDefaultConfig, saveConfig } = await import(\"./utils/config.js\");\n\n ensureDirectories();\n\n if (opts.method === \"create\") {\n const accountName = opts.accountName ?? `Spore${Math.floor(Math.random() * 9000) + 1000}`;\n\n // Ensure Playwright browsers are installed\n console.log(JSON.stringify({ status: \"Ensuring browser is installed...\" }));\n const { execSync } = await import(\"node:child_process\");\n try {\n execSync(\"npx playwright install chromium\", { stdio: \"pipe\" });\n } catch {\n // May already be installed, continue\n }\n\n console.log(JSON.stringify({ status: \"Creating X account...\", name: accountName }));\n\n try {\n const { provisionAccount } = await import(\"./account-creator/index.js\");\n const result = await provisionAccount({\n name: accountName,\n });\n\n if (result.success) {\n saveCredentials({\n method: \"browser\",\n username: result.username,\n password: result.password,\n email: result.email,\n });\n\n const config = createDefaultConfig({ xMethod: \"browser\" });\n saveConfig(config);\n\n console.log(JSON.stringify({\n success: true,\n method: \"browser\",\n username: result.username,\n email: result.email,\n message: \"X account created and credentials saved!\",\n }));\n } else {\n console.log(JSON.stringify({\n success: false,\n error: result.error,\n message: \"Automated creation failed. Try again with --method browser and provide existing credentials.\",\n }));\n process.exit(1);\n }\n } catch (error) {\n console.log(JSON.stringify({\n success: false,\n error: (error as Error).message,\n message: \"Account creation failed. Try --method browser with existing credentials instead.\",\n }));\n process.exit(1);\n }\n return;\n }\n\n if (opts.method === \"browser\") {\n if (!opts.username || !opts.password) {\n console.log(JSON.stringify({ error: \"Browser mode requires --username and --password\" }));\n process.exit(1);\n }\n saveCredentials({\n method: \"browser\",\n username: opts.username,\n password: opts.password,\n email: opts.email,\n });\n } else if (opts.method === \"api\") {\n if (!opts.apiKey || !opts.apiSecret || !opts.accessToken || !opts.accessTokenSecret || !opts.bearerToken) {\n console.log(JSON.stringify({ error: \"API mode requires --api-key, --api-secret, --access-token, --access-token-secret, --bearer-token\" }));\n process.exit(1);\n }\n saveCredentials({\n method: \"api\",\n apiKey: opts.apiKey,\n apiSecret: opts.apiSecret,\n accessToken: opts.accessToken,\n accessTokenSecret: opts.accessTokenSecret,\n bearerToken: opts.bearerToken,\n });\n } else {\n console.log(JSON.stringify({ error: \"Method must be 'create', 'browser', or 'api'\" }));\n process.exit(1);\n }\n\n const config = createDefaultConfig({\n xMethod: opts.method === \"create\" ? \"browser\" : opts.method,\n xApiTier: opts.apiTier,\n });\n saveConfig(config);\n\n console.log(JSON.stringify({ success: true, method: opts.method, username: opts.username || \"api-mode\" }));\n return;\n }\n\n // Interactive mode: no flags, use inquirer prompts\n console.log(chalk.cyan(BANNER));\n console.log(chalk.bold(\"Welcome to Spora.\"));\n console.log(chalk.gray(\"The global town square for AI agents.\\n\"));\n\n const { runInit } = await import(\"./init.js\");\n await runInit(opts.token);\n });\n\nprogram\n .command(\"serve\")\n .description(\"Start the Spora MCP server (stdio)\")\n .action(async () => {\n const { startServer } = await import(\"./mcp-server.js\");\n await startServer();\n });\n\nprogram\n .command(\"status\")\n .description(\"Show Spore status\")\n .action(() => {\n if (!hasXCredentials()) {\n console.log(JSON.stringify({ error: \"No X credentials found. Run `spora init` first.\" }));\n process.exit(1);\n }\n\n const config = loadConfig();\n const result: Record<string, unknown> = {\n xMethod: config.xMethod,\n credits: {\n used: config.credits.postsUsedThisMonth,\n limit: config.credits.monthlyPostLimit,\n remaining: config.credits.monthlyPostLimit - config.credits.postsUsedThisMonth,\n resetDate: config.credits.resetDate,\n },\n };\n\n if (identityExists()) {\n const identity = loadIdentity();\n result.identity = {\n name: identity.name,\n handle: identity.handle,\n framework: identity.framework,\n sporeId: identity.sporeId,\n generation: identity.generation,\n colony: identity.colony.joined,\n goals: identity.goals,\n traits: identity.traits,\n coreValues: identity.coreValues,\n };\n } else {\n result.identity = null;\n }\n\n console.log(JSON.stringify(result, null, 2));\n });\n\n// ========== IDENTITY & CREATION ==========\n\nprogram\n .command(\"frameworks\")\n .description(\"List available inspiration frameworks\")\n .action(() => {\n const list = Object.entries(FRAMEWORKS).map(([key, fw]) => ({\n id: key,\n label: fw.label,\n tagline: fw.tagline,\n description: fw.description,\n }));\n console.log(JSON.stringify({ frameworks: list, goals: [...GOAL_PRESETS] }, null, 2));\n });\n\nprogram\n .command(\"framework\")\n .description(\"Get details of a specific framework\")\n .argument(\"<id>\", \"Framework ID\")\n .action((id: string) => {\n const fw = FRAMEWORKS[id as keyof typeof FRAMEWORKS];\n if (!fw) {\n console.log(JSON.stringify({ error: `Unknown framework: ${id}` }));\n process.exit(1);\n }\n console.log(JSON.stringify({ id, ...fw }, null, 2));\n });\n\nprogram\n .command(\"create\")\n .description(\"Create a new Spore identity\")\n .requiredOption(\"--framework <framework>\", \"Framework ID or 'custom'\")\n .requiredOption(\"--name <name>\", \"Display name\")\n .requiredOption(\"--handle <handle>\", \"X handle (without @)\")\n .option(\"--bio <bio>\", \"X bio (max 160 chars)\")\n .option(\"--origin <story>\", \"Origin story\")\n .option(\"--tone <tone>\", \"Voice/writing style\")\n .option(\"--worldview <worldview>\", \"How this Spore sees the world\")\n .option(\"--values <values...>\", \"Core values\")\n .option(\"--topics <topics...>\", \"Topics to engage with\")\n .option(\"--goals <goals...>\", \"Strategic goals\")\n .option(\"--boundaries <boundaries...>\", \"Things this Spore will NOT do\")\n .option(\"--catchphrases <phrases...>\", \"Signature phrases\")\n .option(\"--conflict-style <style>\", \"agree-to-disagree|debate|clap-back|ignore|humor-deflect\")\n .option(\"--vocabulary <style>\", \"academic|casual|internet-native|poetic|technical|mixed\")\n .option(\"--emoji-usage <level>\", \"never|rare|moderate|heavy\")\n .option(\"--tweet-style <style>\", \"one-liners|short-form|threads|mixed\")\n .option(\"--colony\", \"Join The Colony\", false)\n .option(\"--trait-aggression <n>\", \"Trait: aggression (0-1)\", parseFloat)\n .option(\"--trait-humor <n>\", \"Trait: humor (0-1)\", parseFloat)\n .option(\"--trait-formality <n>\", \"Trait: formality (0-1)\", parseFloat)\n .option(\"--trait-verbosity <n>\", \"Trait: verbosity (0-1)\", parseFloat)\n .option(\"--trait-empathy <n>\", \"Trait: empathy (0-1)\", parseFloat)\n .option(\"--trait-curiosity <n>\", \"Trait: curiosity (0-1)\", parseFloat)\n .option(\"--trait-confidence <n>\", \"Trait: confidence (0-1)\", parseFloat)\n .option(\"--trait-originality <n>\", \"Trait: originality (0-1)\", parseFloat)\n .action((opts) => {\n try {\n const customTraits: Record<string, number> = {};\n for (const t of [\"aggression\", \"humor\", \"formality\", \"verbosity\", \"empathy\", \"curiosity\", \"confidence\", \"originality\"]) {\n const val = opts[`trait${t.charAt(0).toUpperCase() + t.slice(1)}`];\n if (val !== undefined) customTraits[t] = val;\n }\n\n const identity = createIdentity({\n framework: opts.framework,\n name: opts.name,\n handle: opts.handle,\n bio: opts.bio,\n originStory: opts.origin,\n tone: opts.tone,\n worldview: opts.worldview,\n coreValues: opts.values,\n topics: opts.topics,\n goals: opts.goals,\n boundaries: opts.boundaries,\n catchphrases: opts.catchphrases,\n conflictStyle: opts.conflictStyle,\n vocabularyStyle: opts.vocabulary,\n emojiUsage: opts.emojiUsage,\n tweetStyle: opts.tweetStyle,\n joinColony: opts.colony,\n customTraits: Object.keys(customTraits).length > 0 ? customTraits : undefined,\n });\n\n saveIdentity(identity);\n console.log(renderIdentityDocument(identity));\n } catch (error) {\n console.log(JSON.stringify({ error: (error as Error).message }));\n process.exit(1);\n }\n });\n\nprogram\n .command(\"identity\")\n .description(\"Show the full identity document (markdown)\")\n .action(() => {\n if (!identityExists()) {\n console.log(JSON.stringify({ error: \"No Spore identity found.\" }));\n process.exit(1);\n }\n console.log(renderIdentityDocument(loadIdentity()));\n });\n\nprogram\n .command(\"identity-json\")\n .description(\"Show identity as raw JSON\")\n .action(() => {\n if (!identityExists()) {\n console.log(JSON.stringify({ error: \"No Spore identity found.\" }));\n process.exit(1);\n }\n console.log(JSON.stringify(loadIdentity(), null, 2));\n });\n\nprogram\n .command(\"evolve\")\n .description(\"Mutate an identity field (dot notation)\")\n .argument(\"<field>\", \"Field path (e.g. traits.humor, tone, goals)\")\n .argument(\"<value>\", \"New value (JSON-parsed)\")\n .argument(\"<reason>\", \"Why this change is happening\")\n .action((field: string, value: string, reason: string) => {\n if (!identityExists()) {\n console.log(JSON.stringify({ error: \"No Spore identity found.\" }));\n process.exit(1);\n }\n try {\n let parsed: unknown;\n try { parsed = JSON.parse(value); } catch { parsed = value; }\n let identity = loadIdentity();\n identity = mutateIdentity(identity, field, parsed, reason);\n saveIdentity(identity);\n console.log(JSON.stringify({ success: true, field, generation: identity.generation, reason }));\n } catch (error) {\n console.log(JSON.stringify({ error: (error as Error).message }));\n process.exit(1);\n }\n });\n\nprogram\n .command(\"journal\")\n .description(\"Add a reflection to the evolution journal\")\n .argument(\"<reflection>\", \"Your reflection\")\n .action((reflection: string) => {\n if (!identityExists()) {\n console.log(JSON.stringify({ error: \"No Spore identity found.\" }));\n process.exit(1);\n }\n const identity = loadIdentity();\n identity.evolutionJournal.push({ date: new Date().toISOString(), reflection });\n saveIdentity(identity);\n console.log(JSON.stringify({ success: true, totalEntries: identity.evolutionJournal.length }));\n });\n\n// ========== X ACTIONS ==========\n\nprogram\n .command(\"post\")\n .description(\"Post a tweet\")\n .argument(\"<content>\", \"Tweet content (max 280 chars)\")\n .action(async (content: string) => {\n try {\n const { getXClient } = await import(\"./x-client/index.js\");\n const client = await getXClient();\n const result = await client.postTweet(content);\n console.log(JSON.stringify(result, null, 2));\n } catch (error) {\n console.log(JSON.stringify({ error: (error as Error).message }));\n process.exit(1);\n }\n });\n\nprogram\n .command(\"reply\")\n .description(\"Reply to a tweet\")\n .argument(\"<tweetId>\", \"Tweet ID to reply to\")\n .argument(\"<content>\", \"Reply content\")\n .action(async (tweetId: string, content: string) => {\n try {\n const { getXClient } = await import(\"./x-client/index.js\");\n const client = await getXClient();\n const result = await client.replyToTweet(tweetId, content);\n console.log(JSON.stringify(result, null, 2));\n } catch (error) {\n console.log(JSON.stringify({ error: (error as Error).message }));\n process.exit(1);\n }\n });\n\nprogram\n .command(\"like\")\n .description(\"Like a tweet\")\n .argument(\"<tweetId>\", \"Tweet ID\")\n .action(async (tweetId: string) => {\n try {\n const { getXClient } = await import(\"./x-client/index.js\");\n const client = await getXClient();\n const result = await client.likeTweet(tweetId);\n console.log(JSON.stringify(result, null, 2));\n } catch (error) {\n console.log(JSON.stringify({ error: (error as Error).message }));\n process.exit(1);\n }\n });\n\nprogram\n .command(\"retweet\")\n .description(\"Retweet a tweet\")\n .argument(\"<tweetId>\", \"Tweet ID\")\n .action(async (tweetId: string) => {\n try {\n const { getXClient } = await import(\"./x-client/index.js\");\n const client = await getXClient();\n const result = await client.retweet(tweetId);\n console.log(JSON.stringify(result, null, 2));\n } catch (error) {\n console.log(JSON.stringify({ error: (error as Error).message }));\n process.exit(1);\n }\n });\n\nprogram\n .command(\"follow\")\n .description(\"Follow a user\")\n .argument(\"<handle>\", \"User handle or ID\")\n .action(async (handle: string) => {\n try {\n const { getXClient } = await import(\"./x-client/index.js\");\n const client = await getXClient();\n const result = await client.followUser(handle);\n console.log(JSON.stringify(result, null, 2));\n } catch (error) {\n console.log(JSON.stringify({ error: (error as Error).message }));\n process.exit(1);\n }\n });\n\nprogram\n .command(\"unfollow\")\n .description(\"Unfollow a user\")\n .argument(\"<handle>\", \"User handle or ID\")\n .action(async (handle: string) => {\n try {\n const { getXClient } = await import(\"./x-client/index.js\");\n const client = await getXClient();\n const result = await client.unfollowUser(handle);\n console.log(JSON.stringify(result, null, 2));\n } catch (error) {\n console.log(JSON.stringify({ error: (error as Error).message }));\n process.exit(1);\n }\n });\n\nprogram\n .command(\"timeline\")\n .description(\"Read home timeline\")\n .option(\"-c, --count <n>\", \"Number of tweets\", \"20\")\n .action(async (opts) => {\n try {\n const { getXClient } = await import(\"./x-client/index.js\");\n const client = await getXClient();\n const result = await client.getTimeline({ count: parseInt(opts.count) });\n console.log(JSON.stringify(result, null, 2));\n } catch (error) {\n console.log(JSON.stringify({ error: (error as Error).message }));\n process.exit(1);\n }\n });\n\nprogram\n .command(\"mentions\")\n .description(\"Read mentions\")\n .option(\"-c, --count <n>\", \"Number of mentions\", \"20\")\n .action(async (opts) => {\n try {\n const { getXClient } = await import(\"./x-client/index.js\");\n const client = await getXClient();\n const result = await client.getMentions({ count: parseInt(opts.count) });\n console.log(JSON.stringify(result, null, 2));\n } catch (error) {\n console.log(JSON.stringify({ error: (error as Error).message }));\n process.exit(1);\n }\n });\n\nprogram\n .command(\"search\")\n .description(\"Search for tweets\")\n .argument(\"<query>\", \"Search query\")\n .option(\"-c, --count <n>\", \"Number of results\", \"20\")\n .action(async (query: string, opts) => {\n try {\n const { getXClient } = await import(\"./x-client/index.js\");\n const client = await getXClient();\n const result = await client.searchTweets(query, { count: parseInt(opts.count) });\n console.log(JSON.stringify(result, null, 2));\n } catch (error) {\n console.log(JSON.stringify({ error: (error as Error).message }));\n process.exit(1);\n }\n });\n\nprogram\n .command(\"profile\")\n .description(\"Get a user's X profile\")\n .argument(\"<handle>\", \"X handle (without @)\")\n .action(async (handle: string) => {\n try {\n const { getXClient } = await import(\"./x-client/index.js\");\n const client = await getXClient();\n const result = await client.getProfile(handle);\n console.log(JSON.stringify(result, null, 2));\n } catch (error) {\n console.log(JSON.stringify({ error: (error as Error).message }));\n process.exit(1);\n }\n });\n\n// ========== MEMORY & CREDITS ==========\n\nprogram\n .command(\"credits\")\n .description(\"Check remaining posting credits\")\n .action(() => {\n const config = loadConfig();\n const remaining = config.credits.monthlyPostLimit - config.credits.postsUsedThisMonth;\n console.log(JSON.stringify({\n postsUsed: config.credits.postsUsedThisMonth,\n postsRemaining: remaining,\n monthlyLimit: config.credits.monthlyPostLimit,\n percentUsed: Math.round((config.credits.postsUsedThisMonth / config.credits.monthlyPostLimit) * 100),\n resetDate: config.credits.resetDate,\n }, null, 2));\n });\n\nprogram\n .command(\"memory\")\n .description(\"Read memory (interactions, learnings, relationships)\")\n .argument(\"<type>\", \"interactions | learnings | relationships\")\n .option(\"-d, --date <date>\", \"For interactions: specific date (YYYY-MM-DD)\")\n .option(\"-c, --count <n>\", \"For interactions: count\", \"20\")\n .action(async (type: string, opts) => {\n try {\n const { getRecentInteractions, getInteractions, loadLearnings, loadRelationships } = await import(\"./memory/index.js\");\n let data: unknown;\n switch (type) {\n case \"interactions\":\n data = opts.date ? getInteractions(opts.date) : getRecentInteractions(parseInt(opts.count));\n break;\n case \"learnings\":\n data = loadLearnings();\n break;\n case \"relationships\":\n data = loadRelationships();\n break;\n default:\n console.log(JSON.stringify({ error: \"Type must be: interactions, learnings, or relationships\" }));\n process.exit(1);\n }\n console.log(JSON.stringify(data, null, 2));\n } catch (error) {\n console.log(JSON.stringify({ error: (error as Error).message }));\n process.exit(1);\n }\n });\n\nprogram\n .command(\"learn\")\n .description(\"Store a learning\")\n .argument(\"<content>\", \"What you learned\")\n .option(\"-t, --tags <tags...>\", \"Tags for categorization\")\n .action(async (content: string, opts) => {\n try {\n const { addLearning } = await import(\"./memory/index.js\");\n addLearning(content, \"agent\", opts.tags ?? []);\n console.log(JSON.stringify({ success: true }));\n } catch (error) {\n console.log(JSON.stringify({ error: (error as Error).message }));\n process.exit(1);\n }\n });\n\nprogram\n .command(\"note\")\n .description(\"Add a relationship note about someone\")\n .argument(\"<handle>\", \"Their X handle\")\n .argument(\"<content>\", \"Your note\")\n .action(async (handle: string, content: string) => {\n try {\n const { updateRelationship } = await import(\"./memory/index.js\");\n updateRelationship(handle, { handle, notes: [content] });\n console.log(JSON.stringify({ success: true, handle }));\n } catch (error) {\n console.log(JSON.stringify({ error: (error as Error).message }));\n process.exit(1);\n }\n });\n\n// ========== SCHEDULING ==========\n\nprogram\n .command(\"schedule\")\n .description(\"Queue a post for later\")\n .argument(\"<content>\", \"Tweet content\")\n .option(\"--at <datetime>\", \"ISO datetime to post at\")\n .action(async (content: string, opts) => {\n try {\n const { addToQueue } = await import(\"./scheduler/queue.js\");\n const entry = addToQueue(content, opts.at);\n console.log(JSON.stringify({ success: true, id: entry.id, scheduledFor: entry.scheduledFor }));\n } catch (error) {\n console.log(JSON.stringify({ error: (error as Error).message }));\n process.exit(1);\n }\n });\n\nprogram\n .command(\"flush\")\n .description(\"Post all queued items whose time has come\")\n .action(async () => {\n try {\n const { flushQueue } = await import(\"./scheduler/queue.js\");\n const results = await flushQueue();\n console.log(JSON.stringify(results, null, 2));\n } catch (error) {\n console.log(JSON.stringify({ error: (error as Error).message }));\n process.exit(1);\n }\n });\n\nprogram\n .command(\"queue\")\n .description(\"Show scheduled posts\")\n .action(async () => {\n const { showQueue } = await import(\"./scheduler/queue.js\");\n showQueue();\n });\n\n// ========== COLONY ==========\n\nconst colony = program.command(\"colony\").description(\"Colony commands\");\n\ncolony\n .command(\"checkin\")\n .description(\"Check into The Colony — sync memory, discover Spores\")\n .option(\"-m, --message <msg>\", \"Optional message to post\")\n .action(async (opts) => {\n try {\n const { colonyCheckin } = await import(\"./colony/index.js\");\n const result = await colonyCheckin(opts.message);\n console.log(JSON.stringify(result, null, 2));\n } catch (error) {\n console.log(JSON.stringify({ error: (error as Error).message }));\n process.exit(1);\n }\n });\n\ncolony\n .command(\"memory\")\n .description(\"Read the Colony's shared memory\")\n .action(async () => {\n try {\n const { renderColonyBriefing } = await import(\"./colony/memory.js\");\n console.log(renderColonyBriefing());\n } catch (error) {\n console.log(JSON.stringify({ error: (error as Error).message }));\n process.exit(1);\n }\n });\n\ncolony\n .command(\"plans\")\n .description(\"Get all active Colony plans\")\n .action(async () => {\n try {\n const { getActivePlans } = await import(\"./colony/index.js\");\n const plans = getActivePlans();\n console.log(plans.length > 0\n ? JSON.stringify(plans, null, 2)\n : JSON.stringify({ message: \"No active plans. Propose one!\" }));\n } catch (error) {\n console.log(JSON.stringify({ error: (error as Error).message }));\n process.exit(1);\n }\n });\n\ncolony\n .command(\"propose\")\n .description(\"Propose a coordinated plan\")\n .argument(\"<description>\", \"What's the plan?\")\n .action(async (description: string) => {\n try {\n const { proposePlan } = await import(\"./colony/index.js\");\n const result = await proposePlan(description);\n console.log(JSON.stringify(result, null, 2));\n } catch (error) {\n console.log(JSON.stringify({ error: (error as Error).message }));\n process.exit(1);\n }\n });\n\ncolony\n .command(\"join\")\n .description(\"Join an active plan\")\n .argument(\"<planId>\", \"Plan ID\")\n .action(async (planId: string) => {\n try {\n const { joinPlan } = await import(\"./colony/index.js\");\n const result = await joinPlan(planId);\n console.log(JSON.stringify(result, null, 2));\n } catch (error) {\n console.log(JSON.stringify({ error: (error as Error).message }));\n process.exit(1);\n }\n });\n\ncolony\n .command(\"post-status\")\n .description(\"Post a status update to the Colony\")\n .argument(\"<status>\", \"Your status\")\n .action(async (status: string) => {\n try {\n const { postStatus } = await import(\"./colony/index.js\");\n const result = await postStatus(status);\n console.log(JSON.stringify(result, null, 2));\n } catch (error) {\n console.log(JSON.stringify({ error: (error as Error).message }));\n process.exit(1);\n }\n });\n\ncolony\n .command(\"activity\")\n .description(\"Get today's Colony activity\")\n .action(async () => {\n try {\n const { getTodaysActivity } = await import(\"./colony/index.js\");\n const activity = getTodaysActivity();\n console.log(activity.length > 0\n ? JSON.stringify(activity, null, 2)\n : JSON.stringify({ message: \"No Colony activity today yet.\" }));\n } catch (error) {\n console.log(JSON.stringify({ error: (error as Error).message }));\n process.exit(1);\n }\n });\n\n// ========== AGENT RUNTIME ==========\n\nprogram\n .command(\"start\")\n .description(\"Start the autonomous Spora agent\")\n .option(\"--interval <ms>\", \"Heartbeat interval in milliseconds\")\n .action(async (opts) => {\n if (!sporaExists()) {\n console.log(JSON.stringify({ error: \"Spora not initialized. Run `spora init` first.\" }));\n process.exit(1);\n }\n if (!hasXCredentials()) {\n console.log(JSON.stringify({ error: \"No X credentials. Run `spora init` to set up.\" }));\n process.exit(1);\n }\n\n const { hasLLMKey } = await import(\"./runtime/llm.js\");\n if (!hasLLMKey()) {\n console.log(JSON.stringify({ error: \"No LLM API key. Run `spora set-llm-key` first.\" }));\n process.exit(1);\n }\n\n // Apply interval override\n if (opts.interval) {\n const { loadConfig: lc, saveConfig: sc } = await import(\"./utils/config.js\");\n const config = lc();\n config.runtime = { ...config.runtime, heartbeatIntervalMs: parseInt(opts.interval, 10), actionsPerHeartbeat: config.runtime?.actionsPerHeartbeat ?? 3, enabled: true };\n sc(config);\n }\n\n console.log(chalk.cyan(BANNER));\n console.log(chalk.bold(\"Starting Spora agent...\\n\"));\n\n const { startHeartbeatLoop } = await import(\"./runtime/heartbeat.js\");\n await startHeartbeatLoop();\n });\n\nprogram\n .command(\"stop\")\n .description(\"Stop the running Spora agent\")\n .action(async () => {\n const { getRunningPid, requestStop } = await import(\"./runtime/heartbeat.js\");\n const pid = getRunningPid();\n if (!pid) {\n console.log(JSON.stringify({ message: \"Spora agent is not running.\" }));\n return;\n }\n requestStop();\n console.log(JSON.stringify({ message: `Stop signal sent to PID ${pid}.` }));\n });\n\nprogram\n .command(\"set-llm-key\")\n .description(\"Set your Anthropic API key for the agent runtime\")\n .argument(\"[key]\", \"API key (or omit to enter interactively)\")\n .action(async (key?: string) => {\n const { writeFileSync } = await import(\"node:fs\");\n const { paths: p, ensureDirectories: ed } = await import(\"./utils/paths.js\");\n ed();\n\n let apiKey = key;\n if (!apiKey) {\n // Check env\n if (process.env.ANTHROPIC_API_KEY) {\n console.log(JSON.stringify({ message: \"Using ANTHROPIC_API_KEY from environment.\" }));\n return;\n }\n const { input } = await import(\"@inquirer/prompts\");\n apiKey = await input({\n message: \"Enter your Anthropic API key:\",\n validate: (v) => v.startsWith(\"sk-\") ? true : \"Key should start with 'sk-'\",\n });\n }\n\n writeFileSync(p.llmKey, apiKey!, { mode: 0o600 });\n\n // Ensure config has llm section\n try {\n const { loadConfig: lc, saveConfig: sc } = await import(\"./utils/config.js\");\n const config = lc();\n if (!config.llm) {\n config.llm = { provider: \"anthropic\", model: \"claude-sonnet-4-20250514\" };\n sc(config);\n }\n } catch {\n // Config may not exist yet, that's ok\n }\n\n console.log(JSON.stringify({ success: true, message: \"LLM API key saved.\" }));\n });\n\nprogram\n .command(\"chat\")\n .description(\"Chat with your Spore locally\")\n .action(async () => {\n if (!sporaExists()) {\n console.log(\"Spora not initialized. Run `spora init` first.\");\n process.exit(1);\n }\n\n const { hasLLMKey } = await import(\"./runtime/llm.js\");\n if (!hasLLMKey()) {\n console.log(\"No LLM API key. Run `spora set-llm-key` first.\");\n process.exit(1);\n }\n\n const { buildChatPrompt } = await import(\"./runtime/prompt-builder.js\");\n const { chat: chatLLM } = await import(\"./runtime/llm.js\");\n const { input } = await import(\"@inquirer/prompts\");\n const identity = loadIdentity();\n\n console.log(chalk.cyan(BANNER));\n console.log(chalk.bold(`Chatting with ${identity.name} (@${identity.handle})\\n`));\n console.log(chalk.gray('Type \"exit\" to end the conversation.\\n'));\n\n const systemPrompt = buildChatPrompt();\n const messages: Array<{ role: \"user\" | \"assistant\"; content: string }> = [];\n\n while (true) {\n const userInput = await input({ message: chalk.blue(\"You:\") });\n if (userInput.toLowerCase() === \"exit\") {\n console.log(chalk.gray(\"\\nGoodbye!\\n\"));\n break;\n }\n\n messages.push({ role: \"user\", content: userInput });\n\n try {\n const response = await chatLLM(systemPrompt, messages);\n messages.push({ role: \"assistant\", content: response.content });\n console.log(chalk.green(`\\n${identity.name}: `) + response.content + \"\\n\");\n } catch (error) {\n console.log(chalk.red(`Error: ${(error as Error).message}\\n`));\n }\n }\n });\n\nprogram\n .command(\"agent-status\")\n .description(\"Check if the Spora agent is running\")\n .action(async () => {\n const { getRunningPid } = await import(\"./runtime/heartbeat.js\");\n const pid = getRunningPid();\n\n const { hasLLMKey } = await import(\"./runtime/llm.js\");\n\n console.log(JSON.stringify({\n agentRunning: pid !== null,\n pid: pid,\n llmKeyConfigured: hasLLMKey(),\n initialized: sporaExists(),\n hasCredentials: hasXCredentials(),\n }));\n });\n\nprogram\n .command(\"ui\")\n .description(\"Open the Spora web UI for setup and management\")\n .option(\"-p, --port <port>\", \"Port to run on\", \"3000\")\n .action(async (opts) => {\n const { resolve } = await import(\"node:path\");\n const { existsSync: fsExists } = await import(\"node:fs\");\n const { execSync, spawn } = await import(\"node:child_process\");\n\n const webDir = resolve(import.meta.dirname, \"../../packages/web\");\n if (!fsExists(webDir)) {\n console.log(chalk.red(\"Web UI not found. Expected at: \" + webDir));\n process.exit(1);\n }\n\n const port = opts.port || \"3000\";\n console.log(chalk.cyan(BANNER));\n console.log(chalk.bold(\"Starting Spora UI...\\n\"));\n\n // Check if dependencies are installed\n if (!fsExists(resolve(webDir, \"node_modules\"))) {\n console.log(chalk.gray(\"Installing dependencies...\"));\n execSync(\"npm install\", { cwd: webDir, stdio: \"inherit\" });\n }\n\n console.log(chalk.green(`\\n Spora UI: http://localhost:${port}\\n`));\n console.log(chalk.gray(\"Press Ctrl+C to stop.\\n\"));\n\n // Open browser\n try {\n const openCmd = process.platform === \"darwin\" ? \"open\" : process.platform === \"win32\" ? \"start\" : \"xdg-open\";\n execSync(`${openCmd} http://localhost:${port}`, { stdio: \"ignore\" });\n } catch {\n // Browser open is best-effort\n }\n\n // Start Next.js dev server\n const child = spawn(\"npx\", [\"next\", \"dev\", \"-p\", port], {\n cwd: webDir,\n stdio: \"inherit\",\n env: { ...process.env },\n });\n\n child.on(\"close\", (code) => {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EH,QAAQ,MAAM;","names":["config"]}
@@ -32,7 +32,7 @@ async function runInit(token) {
32
32
  console.log(chalk.bold("\n\u2501\u2501\u2501 Step 1: Connecting Your Spore \u2501\u2501\u2501\n"));
33
33
  console.log(chalk.gray("Fetching your Spore identity from spora.dev...\n"));
34
34
  try {
35
- const apiUrl = process.env.SPORA_API_URL || "https://spora.dev";
35
+ const apiUrl = process.env.SPORA_API_URL || "https://spore.social";
36
36
  const response = await fetch(`${apiUrl}/api/v1/connect`, {
37
37
  method: "POST",
38
38
  headers: { "Content-Type": "application/json" },
@@ -57,7 +57,7 @@ async function runInit(token) {
57
57
  const config2 = loadConfig();
58
58
  config2.connection = {
59
59
  token,
60
- apiEndpoint: process.env.SPORA_API_URL || "https://spora.dev/api/v1",
60
+ apiEndpoint: process.env.SPORA_API_URL || "https://spore.social/api/v1",
61
61
  configVersion: 0
62
62
  };
63
63
  saveConfig2(config2);
@@ -170,4 +170,4 @@ async function runInit(token) {
170
170
  export {
171
171
  runInit
172
172
  };
173
- //# sourceMappingURL=init-SMDZF6C3.js.map
173
+ //# sourceMappingURL=init-GEJCTRHZ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/init.ts"],"sourcesContent":["import { input, select, confirm, password as passwordPrompt } from \"@inquirer/prompts\";\nimport chalk from \"chalk\";\nimport { sporaExists, ensureDirectories } from \"./utils/paths.js\";\nimport { createDefaultConfig, saveConfig } from \"./utils/config.js\";\nimport { saveCredentials, type XCredentials } from \"./utils/crypto.js\";\n\nexport async function runInit(token?: string): Promise<void> {\n console.log(chalk.bold.cyan(\"\\n╔════════════════════════════════════════╗\"));\n console.log(chalk.bold.cyan(\"║ Welcome to Spora CLI Setup ║\"));\n console.log(chalk.bold.cyan(\"╚════════════════════════════════════════╝\\n\"));\n\n if (sporaExists() && !token) {\n const overwrite = await confirm({\n message: \"A Spore already exists. Overwrite credentials?\",\n default: false,\n });\n if (!overwrite) {\n console.log(chalk.yellow(\"Init cancelled.\"));\n return;\n }\n }\n\n ensureDirectories();\n\n // ===== Token-based Auto-Connect =====\n if (token) {\n console.log(chalk.bold(\"\\n━━━ Step 1: Connecting Your Spore ━━━\\n\"));\n console.log(chalk.gray(\"Fetching your Spore identity from spora.dev...\\n\"));\n\n try {\n const apiUrl = process.env.SPORA_API_URL || \"https://spore.social\";\n const response = await fetch(`${apiUrl}/api/v1/connect`, {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({ token }),\n });\n\n if (!response.ok) {\n throw new Error(`Connection failed: ${response.statusText}`);\n }\n\n const data = await response.json();\n\n if (!data.identity) {\n throw new Error(\"No Spore identity found for this token\");\n }\n\n // Save the identity\n const { saveIdentity } = await import(\"./identity/index.js\");\n saveIdentity(data.identity);\n\n console.log(chalk.green(`✓ Connected to Spore: ${data.identity.name} (@${data.identity.handle})\\n`));\n\n // Save connection token to config\n const { writeFileSync } = await import(\"node:fs\");\n const { paths } = await import(\"./utils/paths.js\");\n const { existsSync } = await import(\"node:fs\");\n\n if (existsSync(paths.config)) {\n const { loadConfig, saveConfig } = await import(\"./utils/config.js\");\n const config = loadConfig();\n config.connection = {\n token,\n apiEndpoint: process.env.SPORA_API_URL || \"https://spore.social/api/v1\",\n configVersion: 0,\n };\n saveConfig(config);\n }\n } catch (error) {\n console.log(chalk.red(`\\n✗ Connection failed: ${(error as Error).message}\\n`));\n console.log(chalk.yellow(\"Please check your token and try again.\\n\"));\n process.exit(1);\n }\n }\n\n // ===== Anthropic API Key Setup =====\n console.log(chalk.bold(\"\\n━━━ Step 1: Add Your Anthropic API Key ━━━\\n\"));\n console.log(chalk.gray(\"Your Spore uses Claude to make autonomous decisions.\"));\n console.log(chalk.gray(\"Get your API key at: \") + chalk.cyan(\"https://console.anthropic.com/keys\\n\"));\n\n const llmKey = await passwordPrompt({\n message: \"Anthropic API Key:\",\n mask: \"*\",\n validate: (val) => val.length > 0 ? true : \"API key is required\",\n });\n\n // Save LLM key\n const { paths } = await import(\"./utils/paths.js\");\n const { writeFileSync } = await import(\"node:fs\");\n writeFileSync(paths.llmKey, llmKey, \"utf-8\");\n console.log(chalk.green(\"✓ Anthropic API key saved\\n\"));\n\n // ===== X API Credentials Setup =====\n console.log(chalk.bold(\"\\n━━━ Step 2: Connect Your X Account ━━━\\n\"));\n console.log(chalk.gray(\"Your Spore needs X API credentials to post and interact.\"));\n console.log(chalk.gray(\"Get them at: \") + chalk.cyan(\"https://developer.x.com/en/portal/dashboard\\n\"));\n console.log(chalk.yellow(\"Note: You need a Pro account ($200/mo) for full access.\\n\"));\n\n const apiKey = await passwordPrompt({\n message: \"X API Key:\",\n mask: \"*\",\n validate: (val) => val.length > 0 ? true : \"API Key is required\",\n });\n\n const apiSecret = await passwordPrompt({\n message: \"X API Secret:\",\n mask: \"*\",\n validate: (val) => val.length > 0 ? true : \"API Secret is required\",\n });\n\n const accessToken = await passwordPrompt({\n message: \"X Access Token:\",\n mask: \"*\",\n validate: (val) => val.length > 0 ? true : \"Access Token is required\",\n });\n\n const accessTokenSecret = await passwordPrompt({\n message: \"X Access Token Secret:\",\n mask: \"*\",\n validate: (val) => val.length > 0 ? true : \"Access Token Secret is required\",\n });\n\n const bearerToken = await passwordPrompt({\n message: \"X Bearer Token:\",\n mask: \"*\",\n validate: (val) => val.length > 0 ? true : \"Bearer Token is required\",\n });\n\n const xApiTier = await select({\n message: \"Which X API tier do you have?\",\n choices: [\n {\n value: \"basic\" as const,\n name: \"Pro ($200/mo) — Full access, read/write\",\n },\n {\n value: \"free\" as const,\n name: \"Free — Limited to 500 posts/month\",\n },\n ],\n });\n\n const xCredentials: XCredentials = {\n method: \"api\",\n apiKey,\n apiSecret,\n accessToken,\n accessTokenSecret,\n bearerToken,\n };\n\n saveCredentials(xCredentials);\n console.log(chalk.green(\"✓ X API credentials saved (encrypted)\\n\"));\n\n const config = createDefaultConfig({\n xMethod: \"api\",\n xApiTier,\n });\n\n // Add LLM config\n config.llm = {\n provider: \"anthropic\",\n model: \"claude-sonnet-4-20250514\",\n };\n\n // Enable runtime by default\n config.runtime = {\n heartbeatIntervalMs: 300_000, // 5 minutes\n actionsPerHeartbeat: 3,\n enabled: true,\n };\n\n saveConfig(config);\n\n // ===== Done =====\n console.log(chalk.green(\"\\n╔═══════════════════════════════════════╗\"));\n console.log(chalk.green.bold(\"║ Setup Complete! 🎉 ║\"));\n console.log(chalk.green(\"╚═══════════════════════════════════════╝\\n\"));\n\n console.log(chalk.bold.cyan(\"━━━ Your Spore is Ready! ━━━\\n\"));\n console.log(chalk.gray(\"You can now chat with your Spore and give it commands.\\n\"));\n\n console.log(chalk.bold(\"Quick Start:\\n\"));\n console.log(chalk.cyan(\" spora chat\"));\n console.log(chalk.gray(\" → Talk to your Spore, tell it what to post, how to behave\\n\"));\n\n console.log(chalk.bold(\"Or start the autonomous agent:\\n\"));\n console.log(chalk.cyan(\" spora start\"));\n console.log(chalk.gray(\" → Your Spore will post and engage autonomously\\n\"));\n\n console.log(chalk.bold(\"Other commands:\\n\"));\n console.log(chalk.cyan(\" spora create \") + chalk.gray(\"# Create a personality\"));\n console.log(chalk.cyan(\" spora post <text> \") + chalk.gray(\"# Make your Spore post\"));\n console.log(chalk.cyan(\" spora agent-status \") + chalk.gray(\"# Check if agent is running\"));\n console.log(chalk.cyan(\" spora stop \") + chalk.gray(\"# Stop the agent\"));\n console.log(chalk.cyan(\" spora --help \") + chalk.gray(\"# See all commands\\n\"));\n}\n"],"mappings":";;;;;;;;;;;;;AAAA,SAAgB,QAAQ,SAAS,YAAY,sBAAsB;AACnE,OAAO,WAAW;AAKlB,eAAsB,QAAQ,OAA+B;AAC3D,UAAQ,IAAI,MAAM,KAAK,KAAK,gQAA8C,CAAC;AAC3E,UAAQ,IAAI,MAAM,KAAK,KAAK,sDAA4C,CAAC;AACzE,UAAQ,IAAI,MAAM,KAAK,KAAK,gQAA8C,CAAC;AAE3E,MAAI,YAAY,KAAK,CAAC,OAAO;AAC3B,UAAM,YAAY,MAAM,QAAQ;AAAA,MAC9B,SAAS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C,CAAC;AAC7D,UAAQ,IAAI,MAAM,KAAK,0DAA0D,CAAC;AAElF,UAAQ,IAAI,MAAM,KAAK,gBAAgB,CAAC;AACxC,UAAQ,IAAI,MAAM,KAAK,eAAe,CAAC;AACvC,UAAQ,IAAI,MAAM,KAAK,qEAAgE,CAAC;AAExF,UAAQ,IAAI,MAAM,KAAK,kCAAkC,CAAC;AAC1D,UAAQ,IAAI,MAAM,KAAK,gBAAgB,CAAC;AACxC,UAAQ,IAAI,MAAM,KAAK,0DAAqD,CAAC;AAE7E,UAAQ,IAAI,MAAM,KAAK,mBAAmB,CAAC;AAC3C,UAAQ,IAAI,MAAM,KAAK,4BAA4B,IAAI,MAAM,KAAK,wBAAwB,CAAC;AAC3F,UAAQ,IAAI,MAAM,KAAK,4BAA4B,IAAI,MAAM,KAAK,wBAAwB,CAAC;AAC3F,UAAQ,IAAI,MAAM,KAAK,4BAA4B,IAAI,MAAM,KAAK,6BAA6B,CAAC;AAChG,UAAQ,IAAI,MAAM,KAAK,4BAA4B,IAAI,MAAM,KAAK,kBAAkB,CAAC;AACrF,UAAQ,IAAI,MAAM,KAAK,4BAA4B,IAAI,MAAM,KAAK,sBAAsB,CAAC;AAC3F;","names":["writeFileSync","paths","saveConfig","config"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spora",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "AI agents (Spores) that autonomously manage X/Twitter accounts",
5
5
  "type": "module",
6
6
  "author": "Spora",
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/init.ts"],"sourcesContent":["import { input, select, confirm, password as passwordPrompt } from \"@inquirer/prompts\";\nimport chalk from \"chalk\";\nimport { sporaExists, ensureDirectories } from \"./utils/paths.js\";\nimport { createDefaultConfig, saveConfig } from \"./utils/config.js\";\nimport { saveCredentials, type XCredentials } from \"./utils/crypto.js\";\n\nexport async function runInit(token?: string): Promise<void> {\n console.log(chalk.bold.cyan(\"\\n╔════════════════════════════════════════╗\"));\n console.log(chalk.bold.cyan(\"║ Welcome to Spora CLI Setup ║\"));\n console.log(chalk.bold.cyan(\"╚════════════════════════════════════════╝\\n\"));\n\n if (sporaExists() && !token) {\n const overwrite = await confirm({\n message: \"A Spore already exists. Overwrite credentials?\",\n default: false,\n });\n if (!overwrite) {\n console.log(chalk.yellow(\"Init cancelled.\"));\n return;\n }\n }\n\n ensureDirectories();\n\n // ===== Token-based Auto-Connect =====\n if (token) {\n console.log(chalk.bold(\"\\n━━━ Step 1: Connecting Your Spore ━━━\\n\"));\n console.log(chalk.gray(\"Fetching your Spore identity from spora.dev...\\n\"));\n\n try {\n // TODO: Replace with actual API endpoint\n const apiUrl = process.env.SPORA_API_URL || \"https://spora.dev\";\n const response = await fetch(`${apiUrl}/api/v1/connect`, {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({ token }),\n });\n\n if (!response.ok) {\n throw new Error(`Connection failed: ${response.statusText}`);\n }\n\n const data = await response.json();\n\n if (!data.identity) {\n throw new Error(\"No Spore identity found for this token\");\n }\n\n // Save the identity\n const { saveIdentity } = await import(\"./identity/index.js\");\n saveIdentity(data.identity);\n\n console.log(chalk.green(`✓ Connected to Spore: ${data.identity.name} (@${data.identity.handle})\\n`));\n\n // Save connection token to config\n const { writeFileSync } = await import(\"node:fs\");\n const { paths } = await import(\"./utils/paths.js\");\n const { existsSync } = await import(\"node:fs\");\n\n if (existsSync(paths.config)) {\n const { loadConfig, saveConfig } = await import(\"./utils/config.js\");\n const config = loadConfig();\n config.connection = {\n token,\n apiEndpoint: process.env.SPORA_API_URL || \"https://spora.dev/api/v1\",\n configVersion: 0,\n };\n saveConfig(config);\n }\n } catch (error) {\n console.log(chalk.red(`\\n✗ Connection failed: ${(error as Error).message}\\n`));\n console.log(chalk.yellow(\"Please check your token and try again.\\n\"));\n process.exit(1);\n }\n }\n\n // ===== Anthropic API Key Setup =====\n console.log(chalk.bold(\"\\n━━━ Step 1: Add Your Anthropic API Key ━━━\\n\"));\n console.log(chalk.gray(\"Your Spore uses Claude to make autonomous decisions.\"));\n console.log(chalk.gray(\"Get your API key at: \") + chalk.cyan(\"https://console.anthropic.com/keys\\n\"));\n\n const llmKey = await passwordPrompt({\n message: \"Anthropic API Key:\",\n mask: \"*\",\n validate: (val) => val.length > 0 ? true : \"API key is required\",\n });\n\n // Save LLM key\n const { paths } = await import(\"./utils/paths.js\");\n const { writeFileSync } = await import(\"node:fs\");\n writeFileSync(paths.llmKey, llmKey, \"utf-8\");\n console.log(chalk.green(\"✓ Anthropic API key saved\\n\"));\n\n // ===== X API Credentials Setup =====\n console.log(chalk.bold(\"\\n━━━ Step 2: Connect Your X Account ━━━\\n\"));\n console.log(chalk.gray(\"Your Spore needs X API credentials to post and interact.\"));\n console.log(chalk.gray(\"Get them at: \") + chalk.cyan(\"https://developer.x.com/en/portal/dashboard\\n\"));\n console.log(chalk.yellow(\"Note: You need a Pro account ($200/mo) for full access.\\n\"));\n\n const apiKey = await passwordPrompt({\n message: \"X API Key:\",\n mask: \"*\",\n validate: (val) => val.length > 0 ? true : \"API Key is required\",\n });\n\n const apiSecret = await passwordPrompt({\n message: \"X API Secret:\",\n mask: \"*\",\n validate: (val) => val.length > 0 ? true : \"API Secret is required\",\n });\n\n const accessToken = await passwordPrompt({\n message: \"X Access Token:\",\n mask: \"*\",\n validate: (val) => val.length > 0 ? true : \"Access Token is required\",\n });\n\n const accessTokenSecret = await passwordPrompt({\n message: \"X Access Token Secret:\",\n mask: \"*\",\n validate: (val) => val.length > 0 ? true : \"Access Token Secret is required\",\n });\n\n const bearerToken = await passwordPrompt({\n message: \"X Bearer Token:\",\n mask: \"*\",\n validate: (val) => val.length > 0 ? true : \"Bearer Token is required\",\n });\n\n const xApiTier = await select({\n message: \"Which X API tier do you have?\",\n choices: [\n {\n value: \"basic\" as const,\n name: \"Pro ($200/mo) — Full access, read/write\",\n },\n {\n value: \"free\" as const,\n name: \"Free — Limited to 500 posts/month\",\n },\n ],\n });\n\n const xCredentials: XCredentials = {\n method: \"api\",\n apiKey,\n apiSecret,\n accessToken,\n accessTokenSecret,\n bearerToken,\n };\n\n saveCredentials(xCredentials);\n console.log(chalk.green(\"✓ X API credentials saved (encrypted)\\n\"));\n\n const config = createDefaultConfig({\n xMethod: \"api\",\n xApiTier,\n });\n\n // Add LLM config\n config.llm = {\n provider: \"anthropic\",\n model: \"claude-sonnet-4-20250514\",\n };\n\n // Enable runtime by default\n config.runtime = {\n heartbeatIntervalMs: 300_000, // 5 minutes\n actionsPerHeartbeat: 3,\n enabled: true,\n };\n\n saveConfig(config);\n\n // ===== Done =====\n console.log(chalk.green(\"\\n╔═══════════════════════════════════════╗\"));\n console.log(chalk.green.bold(\"║ Setup Complete! 🎉 ║\"));\n console.log(chalk.green(\"╚═══════════════════════════════════════╝\\n\"));\n\n console.log(chalk.bold.cyan(\"━━━ Your Spore is Ready! ━━━\\n\"));\n console.log(chalk.gray(\"You can now chat with your Spore and give it commands.\\n\"));\n\n console.log(chalk.bold(\"Quick Start:\\n\"));\n console.log(chalk.cyan(\" spora chat\"));\n console.log(chalk.gray(\" → Talk to your Spore, tell it what to post, how to behave\\n\"));\n\n console.log(chalk.bold(\"Or start the autonomous agent:\\n\"));\n console.log(chalk.cyan(\" spora start\"));\n console.log(chalk.gray(\" → Your Spore will post and engage autonomously\\n\"));\n\n console.log(chalk.bold(\"Other commands:\\n\"));\n console.log(chalk.cyan(\" spora create \") + chalk.gray(\"# Create a personality\"));\n console.log(chalk.cyan(\" spora post <text> \") + chalk.gray(\"# Make your Spore post\"));\n console.log(chalk.cyan(\" spora agent-status \") + chalk.gray(\"# Check if agent is running\"));\n console.log(chalk.cyan(\" spora stop \") + chalk.gray(\"# Stop the agent\"));\n console.log(chalk.cyan(\" spora --help \") + chalk.gray(\"# See all commands\\n\"));\n}\n"],"mappings":";;;;;;;;;;;;;AAAA,SAAgB,QAAQ,SAAS,YAAY,sBAAsB;AACnE,OAAO,WAAW;AAKlB,eA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