spora 0.2.12 → 0.2.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-TSKHCOCJ.js → chunk-DHT5ORFX.js} +1 -1
- package/dist/{chunk-IN2KCKTO.js → chunk-GBOY5OQ6.js} +2 -2
- package/dist/{chunk-VSVZU476.js → chunk-TIY2L4F5.js} +3 -3
- package/dist/{chunk-Q57HNZDI.js → chunk-VTWZZNME.js} +43 -1
- package/dist/chunk-VTWZZNME.js.map +1 -0
- package/dist/cli.js +25 -25
- package/dist/cli.js.map +1 -1
- package/dist/{colony-JHR2B5OC.js → colony-4G3JMXXW.js} +2 -2
- package/dist/{decision-engine-JDAIVQH3.js → decision-engine-5FC6NCT4.js} +4 -4
- package/dist/{heartbeat-4CHHSMFQ.js → heartbeat-WFEX774V.js} +6 -6
- package/dist/{init-SOIKE75S.js → init-7TST23CG.js} +3 -3
- package/dist/{mcp-server-4YBCA4QH.js → mcp-server.js} +20 -20
- package/dist/{prompt-builder-7NIQIHTB.js → prompt-builder-VG7CUPU2.js} +4 -2
- package/dist/{queue-WMUESED4.js → queue-YEVE53NQ.js} +2 -2
- package/dist/web-chat/chat.html +143 -21
- package/dist/{web-chat-DUY5W7S3.js → web-chat-LNNJUCFA.js} +134 -6
- package/dist/web-chat-LNNJUCFA.js.map +1 -0
- package/dist/{x-client-7LK3F56M.js → x-client-YE6QFHEN.js} +2 -2
- package/package.json +1 -1
- package/dist/chat.html +0 -414
- package/dist/chunk-Q57HNZDI.js.map +0 -1
- package/dist/logo.png +0 -0
- package/dist/web-chat-DUY5W7S3.js.map +0 -1
- /package/dist/{chunk-TSKHCOCJ.js.map → chunk-DHT5ORFX.js.map} +0 -0
- /package/dist/{chunk-IN2KCKTO.js.map → chunk-GBOY5OQ6.js.map} +0 -0
- /package/dist/{chunk-VSVZU476.js.map → chunk-TIY2L4F5.js.map} +0 -0
- /package/dist/{colony-JHR2B5OC.js.map → colony-4G3JMXXW.js.map} +0 -0
- /package/dist/{decision-engine-JDAIVQH3.js.map → decision-engine-5FC6NCT4.js.map} +0 -0
- /package/dist/{heartbeat-4CHHSMFQ.js.map → heartbeat-WFEX774V.js.map} +0 -0
- /package/dist/{init-SOIKE75S.js.map → init-7TST23CG.js.map} +0 -0
- /package/dist/{mcp-server-4YBCA4QH.js.map → mcp-server.js.map} +0 -0
- /package/dist/{prompt-builder-7NIQIHTB.js.map → prompt-builder-VG7CUPU2.js.map} +0 -0
- /package/dist/{queue-WMUESED4.js.map → queue-YEVE53NQ.js.map} +0 -0
- /package/dist/{x-client-7LK3F56M.js.map → x-client-YE6QFHEN.js.map} +0 -0
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.6\");\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\n// ========== CHAT ==========\n\nprogram\n .command(\"chat\")\n .description(\"Open web-based chat interface with your Spore\")\n .action(async () => {\n if (!identityExists()) {\n console.log(chalk.red(\"✗ No identity found. Run `spora create` first.\"));\n process.exit(1);\n }\n\n const { startWebChat } = await import(\"./web-chat/index.js\");\n await startWebChat();\n });\n\nprogram\n .command(\"tui\")\n .description(\"Start terminal-based chat interface (TUI)\")\n .action(async () => {\n if (!identityExists()) {\n console.log(chalk.red(\"✗ No identity found. Run `spora create` first.\"));\n process.exit(1);\n }\n\n console.log(chalk.yellow(\"Terminal chat interface coming soon!\"));\n console.log(chalk.dim(\"For now, use `spora chat` to open the web interface.\"));\n process.exit(0);\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\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,iCAAi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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.6\");\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\n// ========== CHAT ==========\n\nprogram\n .command(\"chat\")\n .description(\"Open web-based chat interface with your Spore\")\n .action(async () => {\n if (!identityExists()) {\n console.log(chalk.red(\"✗ No identity found. Run `spora create` first.\"));\n process.exit(1);\n }\n\n const { startWebChat } = await import(\"./web-chat/index.js\");\n await startWebChat();\n });\n\nprogram\n .command(\"tui\")\n .description(\"Start terminal-based chat interface (TUI)\")\n .action(async () => {\n if (!identityExists()) {\n console.log(chalk.red(\"✗ No identity found. Run `spora create` first.\"));\n process.exit(1);\n }\n\n console.log(chalk.yellow(\"Terminal chat interface coming soon!\"));\n console.log(chalk.dim(\"For now, use `spora chat` to open the web interface.\"));\n process.exit(0);\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\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,0BAA0B,2BAA2B,EAC5D,OAAO,kCAAkC,kCAAkC,EAC3E,OAAO,0BAA0B,2BAA2B,EAC5D,OAAO,qBAAqB,qCAAqC,EACjE,OAAO,OAAO,SAAS;AAEtB,MAAI,KAAK,QAAQ;AACf,UAAM,EAAE,kBAAkB,IAAI,MAAM,OAAO,qBAAkB;AAC7D,UAAM,EAAE,gBAAgB,IAAI,MAAM,OAAO,sBAAmB;AAC5D,UAAM,EAAE,qBAAqB,WAAW,IAAI,MAAM,OAAO,sBAAmB;AAE5E,sBAAkB;AAElB,QAAI,KAAK,WAAW,UAAU;AAC5B,YA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A,UAAQ,IAAI,MAAM,MAAM;AAAA,+BAAkC,IAAI;AAAA,CAAI,CAAC;AACnE,UAAQ,IAAI,MAAM,KAAK,yBAAyB,CAAC;AAGjD,MAAI;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"]}
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from "./chunk-AHXZIGQE.js";
|
|
11
11
|
import {
|
|
12
12
|
getXClient
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-DHT5ORFX.js";
|
|
14
14
|
import "./chunk-RCJQI7FR.js";
|
|
15
15
|
import {
|
|
16
16
|
loadIdentity
|
|
@@ -226,4 +226,4 @@ export {
|
|
|
226
226
|
postStatus,
|
|
227
227
|
proposePlan
|
|
228
228
|
};
|
|
229
|
-
//# sourceMappingURL=colony-
|
|
229
|
+
//# sourceMappingURL=colony-4G3JMXXW.js.map
|
|
@@ -2,9 +2,9 @@ import {
|
|
|
2
2
|
executeAction,
|
|
3
3
|
executeActions,
|
|
4
4
|
parseActions
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-TIY2L4F5.js";
|
|
6
|
+
import "./chunk-DHT5ORFX.js";
|
|
7
|
+
import "./chunk-GBOY5OQ6.js";
|
|
8
8
|
import "./chunk-C3INKEY6.js";
|
|
9
9
|
import "./chunk-RCJQI7FR.js";
|
|
10
10
|
import "./chunk-AIEXQCQS.js";
|
|
@@ -16,4 +16,4 @@ export {
|
|
|
16
16
|
executeActions,
|
|
17
17
|
parseActions
|
|
18
18
|
};
|
|
19
|
-
//# sourceMappingURL=decision-engine-
|
|
19
|
+
//# sourceMappingURL=decision-engine-5FC6NCT4.js.map
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
2
|
executeActions,
|
|
3
3
|
parseActions
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-TIY2L4F5.js";
|
|
5
5
|
import {
|
|
6
6
|
getXClient
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-DHT5ORFX.js";
|
|
8
8
|
import {
|
|
9
9
|
flushQueue
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-GBOY5OQ6.js";
|
|
11
11
|
import {
|
|
12
12
|
buildHeartbeatUserMessage,
|
|
13
13
|
buildSystemPrompt
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-VTWZZNME.js";
|
|
15
|
+
import "./chunk-C3INKEY6.js";
|
|
15
16
|
import {
|
|
16
17
|
generateResponse
|
|
17
18
|
} from "./chunk-5J5TUBWK.js";
|
|
18
|
-
import "./chunk-C3INKEY6.js";
|
|
19
19
|
import {
|
|
20
20
|
loadConfig
|
|
21
21
|
} from "./chunk-RCJQI7FR.js";
|
|
@@ -175,4 +175,4 @@ export {
|
|
|
175
175
|
requestStop,
|
|
176
176
|
startHeartbeatLoop
|
|
177
177
|
};
|
|
178
|
-
//# sourceMappingURL=heartbeat-
|
|
178
|
+
//# sourceMappingURL=heartbeat-WFEX774V.js.map
|
|
@@ -203,7 +203,7 @@ async function loginFlow() {
|
|
|
203
203
|
console.log(chalk.green("\u2713 Logged in!\n"));
|
|
204
204
|
console.log(chalk.gray("Opening chat interface...\n"));
|
|
205
205
|
try {
|
|
206
|
-
const { startWebChat } = await import("./web-chat-
|
|
206
|
+
const { startWebChat } = await import("./web-chat-LNNJUCFA.js");
|
|
207
207
|
await startWebChat();
|
|
208
208
|
} catch (error) {
|
|
209
209
|
console.log(chalk.yellow(`Could not start chat interface: ${error.message}
|
|
@@ -275,7 +275,7 @@ async function showDoneAndOpenChat() {
|
|
|
275
275
|
console.log(chalk.bold.cyan("\u2501\u2501\u2501 Your Spore is Ready! \u2501\u2501\u2501\n"));
|
|
276
276
|
console.log(chalk.gray("Opening chat interface...\n"));
|
|
277
277
|
try {
|
|
278
|
-
const { startWebChat } = await import("./web-chat-
|
|
278
|
+
const { startWebChat } = await import("./web-chat-LNNJUCFA.js");
|
|
279
279
|
await startWebChat();
|
|
280
280
|
} catch (error) {
|
|
281
281
|
console.log(chalk.yellow(`Could not start chat interface: ${error.message}
|
|
@@ -400,4 +400,4 @@ async function runInit(token) {
|
|
|
400
400
|
export {
|
|
401
401
|
runInit
|
|
402
402
|
};
|
|
403
|
-
//# sourceMappingURL=init-
|
|
403
|
+
//# sourceMappingURL=init-7TST23CG.js.map
|
|
@@ -388,7 +388,7 @@ Identity saved. Your Spore is alive. Use spora_get_identity to read the full doc
|
|
|
388
388
|
},
|
|
389
389
|
async ({ content }) => {
|
|
390
390
|
try {
|
|
391
|
-
const { getXClient } = await import("./x-client-
|
|
391
|
+
const { getXClient } = await import("./x-client-YE6QFHEN.js");
|
|
392
392
|
const client = await getXClient();
|
|
393
393
|
const result = await client.postTweet(content);
|
|
394
394
|
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
@@ -406,7 +406,7 @@ Identity saved. Your Spore is alive. Use spora_get_identity to read the full doc
|
|
|
406
406
|
},
|
|
407
407
|
async ({ tweetId, content }) => {
|
|
408
408
|
try {
|
|
409
|
-
const { getXClient } = await import("./x-client-
|
|
409
|
+
const { getXClient } = await import("./x-client-YE6QFHEN.js");
|
|
410
410
|
const client = await getXClient();
|
|
411
411
|
const result = await client.replyToTweet(tweetId, content);
|
|
412
412
|
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
@@ -421,7 +421,7 @@ Identity saved. Your Spore is alive. Use spora_get_identity to read the full doc
|
|
|
421
421
|
{ tweetId: z.string().describe("The ID of the tweet to like") },
|
|
422
422
|
async ({ tweetId }) => {
|
|
423
423
|
try {
|
|
424
|
-
const { getXClient } = await import("./x-client-
|
|
424
|
+
const { getXClient } = await import("./x-client-YE6QFHEN.js");
|
|
425
425
|
const client = await getXClient();
|
|
426
426
|
const result = await client.likeTweet(tweetId);
|
|
427
427
|
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
@@ -436,7 +436,7 @@ Identity saved. Your Spore is alive. Use spora_get_identity to read the full doc
|
|
|
436
436
|
{ tweetId: z.string().describe("The ID of the tweet to retweet") },
|
|
437
437
|
async ({ tweetId }) => {
|
|
438
438
|
try {
|
|
439
|
-
const { getXClient } = await import("./x-client-
|
|
439
|
+
const { getXClient } = await import("./x-client-YE6QFHEN.js");
|
|
440
440
|
const client = await getXClient();
|
|
441
441
|
const result = await client.retweet(tweetId);
|
|
442
442
|
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
@@ -451,7 +451,7 @@ Identity saved. Your Spore is alive. Use spora_get_identity to read the full doc
|
|
|
451
451
|
{ userId: z.string().describe("The user ID to follow") },
|
|
452
452
|
async ({ userId }) => {
|
|
453
453
|
try {
|
|
454
|
-
const { getXClient } = await import("./x-client-
|
|
454
|
+
const { getXClient } = await import("./x-client-YE6QFHEN.js");
|
|
455
455
|
const client = await getXClient();
|
|
456
456
|
const result = await client.followUser(userId);
|
|
457
457
|
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
@@ -466,7 +466,7 @@ Identity saved. Your Spore is alive. Use spora_get_identity to read the full doc
|
|
|
466
466
|
{ userId: z.string().describe("The user ID to unfollow") },
|
|
467
467
|
async ({ userId }) => {
|
|
468
468
|
try {
|
|
469
|
-
const { getXClient } = await import("./x-client-
|
|
469
|
+
const { getXClient } = await import("./x-client-YE6QFHEN.js");
|
|
470
470
|
const client = await getXClient();
|
|
471
471
|
const result = await client.unfollowUser(userId);
|
|
472
472
|
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
@@ -481,7 +481,7 @@ Identity saved. Your Spore is alive. Use spora_get_identity to read the full doc
|
|
|
481
481
|
{ count: z.number().optional().describe("Number of tweets to fetch (default 20)") },
|
|
482
482
|
async ({ count }) => {
|
|
483
483
|
try {
|
|
484
|
-
const { getXClient } = await import("./x-client-
|
|
484
|
+
const { getXClient } = await import("./x-client-YE6QFHEN.js");
|
|
485
485
|
const client = await getXClient();
|
|
486
486
|
const result = await client.getTimeline({ count: count ?? 20 });
|
|
487
487
|
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
@@ -496,7 +496,7 @@ Identity saved. Your Spore is alive. Use spora_get_identity to read the full doc
|
|
|
496
496
|
{ count: z.number().optional().describe("Number of mentions to fetch (default 20)") },
|
|
497
497
|
async ({ count }) => {
|
|
498
498
|
try {
|
|
499
|
-
const { getXClient } = await import("./x-client-
|
|
499
|
+
const { getXClient } = await import("./x-client-YE6QFHEN.js");
|
|
500
500
|
const client = await getXClient();
|
|
501
501
|
const result = await client.getMentions({ count: count ?? 20 });
|
|
502
502
|
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
@@ -514,7 +514,7 @@ Identity saved. Your Spore is alive. Use spora_get_identity to read the full doc
|
|
|
514
514
|
},
|
|
515
515
|
async ({ query, count }) => {
|
|
516
516
|
try {
|
|
517
|
-
const { getXClient } = await import("./x-client-
|
|
517
|
+
const { getXClient } = await import("./x-client-YE6QFHEN.js");
|
|
518
518
|
const client = await getXClient();
|
|
519
519
|
const result = await client.searchTweets(query, { count: count ?? 20 });
|
|
520
520
|
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
@@ -529,7 +529,7 @@ Identity saved. Your Spore is alive. Use spora_get_identity to read the full doc
|
|
|
529
529
|
{ handle: z.string().describe("X handle (without @)") },
|
|
530
530
|
async ({ handle }) => {
|
|
531
531
|
try {
|
|
532
|
-
const { getXClient } = await import("./x-client-
|
|
532
|
+
const { getXClient } = await import("./x-client-YE6QFHEN.js");
|
|
533
533
|
const client = await getXClient();
|
|
534
534
|
const result = await client.getProfile(handle);
|
|
535
535
|
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
@@ -547,7 +547,7 @@ Identity saved. Your Spore is alive. Use spora_get_identity to read the full doc
|
|
|
547
547
|
},
|
|
548
548
|
async ({ content, scheduledFor }) => {
|
|
549
549
|
try {
|
|
550
|
-
const { addToQueue } = await import("./queue-
|
|
550
|
+
const { addToQueue } = await import("./queue-YEVE53NQ.js");
|
|
551
551
|
const entry = addToQueue(content, scheduledFor);
|
|
552
552
|
return {
|
|
553
553
|
content: [
|
|
@@ -565,7 +565,7 @@ Identity saved. Your Spore is alive. Use spora_get_identity to read the full doc
|
|
|
565
565
|
{},
|
|
566
566
|
async () => {
|
|
567
567
|
try {
|
|
568
|
-
const { flushQueue } = await import("./queue-
|
|
568
|
+
const { flushQueue } = await import("./queue-YEVE53NQ.js");
|
|
569
569
|
const results = await flushQueue();
|
|
570
570
|
return {
|
|
571
571
|
content: [
|
|
@@ -586,7 +586,7 @@ Identity saved. Your Spore is alive. Use spora_get_identity to read the full doc
|
|
|
586
586
|
{ message: z.string().optional().describe("Optional message to post to the Colony community") },
|
|
587
587
|
async ({ message }) => {
|
|
588
588
|
try {
|
|
589
|
-
const { colonyCheckin } = await import("./colony-
|
|
589
|
+
const { colonyCheckin } = await import("./colony-4G3JMXXW.js");
|
|
590
590
|
const result = await colonyCheckin(message);
|
|
591
591
|
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
592
592
|
} catch (error) {
|
|
@@ -600,7 +600,7 @@ Identity saved. Your Spore is alive. Use spora_get_identity to read the full doc
|
|
|
600
600
|
{},
|
|
601
601
|
async () => {
|
|
602
602
|
try {
|
|
603
|
-
const { getColonyMemory } = await import("./colony-
|
|
603
|
+
const { getColonyMemory } = await import("./colony-4G3JMXXW.js");
|
|
604
604
|
const memory = getColonyMemory();
|
|
605
605
|
return { content: [{ type: "text", text: JSON.stringify(memory, null, 2) }] };
|
|
606
606
|
} catch (error) {
|
|
@@ -614,7 +614,7 @@ Identity saved. Your Spore is alive. Use spora_get_identity to read the full doc
|
|
|
614
614
|
{},
|
|
615
615
|
async () => {
|
|
616
616
|
try {
|
|
617
|
-
const { getActivePlans } = await import("./colony-
|
|
617
|
+
const { getActivePlans } = await import("./colony-4G3JMXXW.js");
|
|
618
618
|
const plans = getActivePlans();
|
|
619
619
|
return {
|
|
620
620
|
content: [
|
|
@@ -637,7 +637,7 @@ Identity saved. Your Spore is alive. Use spora_get_identity to read the full doc
|
|
|
637
637
|
},
|
|
638
638
|
async ({ description }) => {
|
|
639
639
|
try {
|
|
640
|
-
const { proposePlan } = await import("./colony-
|
|
640
|
+
const { proposePlan } = await import("./colony-4G3JMXXW.js");
|
|
641
641
|
const result = await proposePlan(description);
|
|
642
642
|
if (result.success) {
|
|
643
643
|
return {
|
|
@@ -660,7 +660,7 @@ Identity saved. Your Spore is alive. Use spora_get_identity to read the full doc
|
|
|
660
660
|
},
|
|
661
661
|
async ({ planId }) => {
|
|
662
662
|
try {
|
|
663
|
-
const { joinPlan } = await import("./colony-
|
|
663
|
+
const { joinPlan } = await import("./colony-4G3JMXXW.js");
|
|
664
664
|
const result = await joinPlan(planId);
|
|
665
665
|
if (result.success) {
|
|
666
666
|
return { content: [{ type: "text", text: "Joined the plan! Go execute it." }] };
|
|
@@ -679,7 +679,7 @@ Identity saved. Your Spore is alive. Use spora_get_identity to read the full doc
|
|
|
679
679
|
},
|
|
680
680
|
async ({ status }) => {
|
|
681
681
|
try {
|
|
682
|
-
const { postStatus } = await import("./colony-
|
|
682
|
+
const { postStatus } = await import("./colony-4G3JMXXW.js");
|
|
683
683
|
const result = await postStatus(status);
|
|
684
684
|
if (result.success) {
|
|
685
685
|
return { content: [{ type: "text", text: "Status posted to the Colony." }] };
|
|
@@ -696,7 +696,7 @@ Identity saved. Your Spore is alive. Use spora_get_identity to read the full doc
|
|
|
696
696
|
{},
|
|
697
697
|
async () => {
|
|
698
698
|
try {
|
|
699
|
-
const { getTodaysActivity } = await import("./colony-
|
|
699
|
+
const { getTodaysActivity } = await import("./colony-4G3JMXXW.js");
|
|
700
700
|
const activity = getTodaysActivity();
|
|
701
701
|
return {
|
|
702
702
|
content: [
|
|
@@ -770,4 +770,4 @@ if (isMain) {
|
|
|
770
770
|
export {
|
|
771
771
|
startServer
|
|
772
772
|
};
|
|
773
|
-
//# sourceMappingURL=mcp-server
|
|
773
|
+
//# sourceMappingURL=mcp-server.js.map
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
buildChatPrompt,
|
|
3
3
|
buildHeartbeatUserMessage,
|
|
4
|
+
buildNarratedHeartbeatMessage,
|
|
4
5
|
buildSystemPrompt
|
|
5
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-VTWZZNME.js";
|
|
6
7
|
import "./chunk-C3INKEY6.js";
|
|
7
8
|
import "./chunk-RCJQI7FR.js";
|
|
8
9
|
import "./chunk-AIEXQCQS.js";
|
|
@@ -12,6 +13,7 @@ import "./chunk-53YLFYJF.js";
|
|
|
12
13
|
export {
|
|
13
14
|
buildChatPrompt,
|
|
14
15
|
buildHeartbeatUserMessage,
|
|
16
|
+
buildNarratedHeartbeatMessage,
|
|
15
17
|
buildSystemPrompt
|
|
16
18
|
};
|
|
17
|
-
//# sourceMappingURL=prompt-builder-
|
|
19
|
+
//# sourceMappingURL=prompt-builder-VG7CUPU2.js.map
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
addToQueue,
|
|
3
3
|
flushQueue,
|
|
4
4
|
showQueue
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-GBOY5OQ6.js";
|
|
6
6
|
import "./chunk-RCJQI7FR.js";
|
|
7
7
|
import "./chunk-KELPENM3.js";
|
|
8
8
|
import "./chunk-53YLFYJF.js";
|
|
@@ -11,4 +11,4 @@ export {
|
|
|
11
11
|
flushQueue,
|
|
12
12
|
showQueue
|
|
13
13
|
};
|
|
14
|
-
//# sourceMappingURL=queue-
|
|
14
|
+
//# sourceMappingURL=queue-YEVE53NQ.js.map
|