spora 0.2.2 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/dist/chunk-5ELTXYDV.js +162 -0
  2. package/dist/chunk-5ELTXYDV.js.map +1 -0
  3. package/dist/{chunk-3WPIVG27.js → chunk-IIQAE7OP.js} +3 -3
  4. package/dist/{chunk-CMD2AGVW.js → chunk-T3JHWIKX.js} +2 -2
  5. package/dist/cli.js +24 -24
  6. package/dist/{client-RII4ST5D.js → client-2CURS7J6.js} +7 -7
  7. package/dist/{client-FULMJH3S.js → client-2ZSXZE3D.js} +7 -7
  8. package/dist/{colony-CBUE2M3P.js → colony-EFGAMLOX.js} +7 -7
  9. package/dist/{heartbeat-4EMODFIB.js → heartbeat-IYMR7BNA.js} +16 -138
  10. package/dist/heartbeat-IYMR7BNA.js.map +1 -0
  11. package/dist/{init-ZEILF6Y5.js → init-CH72XB55.js} +5 -5
  12. package/dist/mcp-server.js +31 -31
  13. package/dist/prompt-builder-XVMRRGY3.js +17 -0
  14. package/dist/{queue-5SDR3MF2.js → queue-N64QLRAB.js} +2 -2
  15. package/dist/web-chat/chat.html +140 -113
  16. package/dist/{web-chat-BNAFTFTH.js → web-chat-XJQ42L3R.js} +35 -11
  17. package/dist/web-chat-XJQ42L3R.js.map +1 -0
  18. package/dist/{x-client-T762KJFE.js → x-client-SLAC2ON5.js} +2 -2
  19. package/dist/x-client-SLAC2ON5.js.map +1 -0
  20. package/package.json +1 -1
  21. package/dist/heartbeat-4EMODFIB.js.map +0 -1
  22. package/dist/web-chat-BNAFTFTH.js.map +0 -1
  23. /package/dist/{chunk-3WPIVG27.js.map → chunk-IIQAE7OP.js.map} +0 -0
  24. /package/dist/{chunk-CMD2AGVW.js.map → chunk-T3JHWIKX.js.map} +0 -0
  25. /package/dist/{client-RII4ST5D.js.map → client-2CURS7J6.js.map} +0 -0
  26. /package/dist/{client-FULMJH3S.js.map → client-2ZSXZE3D.js.map} +0 -0
  27. /package/dist/{colony-CBUE2M3P.js.map → colony-EFGAMLOX.js.map} +0 -0
  28. /package/dist/{init-ZEILF6Y5.js.map → init-CH72XB55.js.map} +0 -0
  29. /package/dist/{queue-5SDR3MF2.js.map → prompt-builder-XVMRRGY3.js.map} +0 -0
  30. /package/dist/{x-client-T762KJFE.js.map → queue-N64QLRAB.js.map} +0 -0
@@ -0,0 +1,162 @@
1
+ import {
2
+ rateLimiter
3
+ } from "./chunk-MOCLA2KK.js";
4
+ import {
5
+ loadConfig
6
+ } from "./chunk-YEKHNTQO.js";
7
+ import {
8
+ loadIdentity,
9
+ renderIdentityDocument
10
+ } from "./chunk-AIEXQCQS.js";
11
+ import {
12
+ getRecentInteractions,
13
+ loadLearnings,
14
+ loadRelationships
15
+ } from "./chunk-EBO4F5NU.js";
16
+
17
+ // src/runtime/prompt-builder.ts
18
+ function buildSystemPrompt() {
19
+ const identity = loadIdentity();
20
+ const config = loadConfig();
21
+ const identityDoc = renderIdentityDocument(identity);
22
+ const sections = [];
23
+ sections.push(`You are ${identity.name} (@${identity.handle}), an autonomous AI agent on X/Twitter.`);
24
+ sections.push("");
25
+ sections.push("## Your Identity");
26
+ sections.push(identityDoc);
27
+ sections.push("");
28
+ sections.push("## Your Memory");
29
+ const recentInteractions = getRecentInteractions(15);
30
+ if (recentInteractions.length > 0) {
31
+ sections.push("### Recent Activity (most recent first)");
32
+ for (const i of recentInteractions) {
33
+ const time = new Date(i.timestamp).toLocaleString();
34
+ if (i.type === "post") {
35
+ sections.push(`- [${time}] Posted: "${i.content}"`);
36
+ } else if (i.type === "reply") {
37
+ sections.push(`- [${time}] Replied to ${i.targetHandle ?? i.inReplyTo}: "${i.content}"`);
38
+ } else if (i.type === "like") {
39
+ sections.push(`- [${time}] Liked tweet by ${i.targetHandle}`);
40
+ } else if (i.type === "retweet") {
41
+ sections.push(`- [${time}] Retweeted ${i.targetHandle}`);
42
+ } else if (i.type === "follow") {
43
+ sections.push(`- [${time}] Followed @${i.targetHandle}`);
44
+ } else if (i.type === "mention_received") {
45
+ sections.push(`- [${time}] Mentioned by @${i.targetHandle}: "${i.content}"`);
46
+ }
47
+ }
48
+ sections.push("");
49
+ }
50
+ const learnings = loadLearnings();
51
+ if (learnings.learnings.length > 0) {
52
+ sections.push("### Key Learnings");
53
+ for (const l of learnings.learnings.slice(-10)) {
54
+ sections.push(`- ${l.content} [${l.tags.join(", ")}]`);
55
+ }
56
+ sections.push("");
57
+ }
58
+ const relationships = loadRelationships();
59
+ const topRelationships = Object.values(relationships.accounts).sort((a, b) => b.interactionCount - a.interactionCount).slice(0, 10);
60
+ if (topRelationships.length > 0) {
61
+ sections.push("### Key Relationships");
62
+ for (const r of topRelationships) {
63
+ const notes = r.notes.length > 0 ? ` \u2014 ${r.notes[r.notes.length - 1]}` : "";
64
+ sections.push(`- @${r.handle}: ${r.interactionCount} interactions, sentiment ${r.sentiment}${r.isSpore ? " (Spore)" : ""}${notes}`);
65
+ }
66
+ sections.push("");
67
+ }
68
+ sections.push("## Current Context");
69
+ const now = /* @__PURE__ */ new Date();
70
+ sections.push(`- **Time:** ${now.toLocaleString("en-US", { timeZone: config.schedule.timezone })}`);
71
+ sections.push(`- **Credits remaining:** ${rateLimiter.remaining()} of ${config.credits.monthlyPostLimit} this month`);
72
+ const todaysPosts = recentInteractions.filter(
73
+ (i) => i.type === "post" && i.timestamp.startsWith(now.toISOString().split("T")[0])
74
+ ).length;
75
+ sections.push(`- **Posts today:** ${todaysPosts} of ${config.schedule.postsPerDay} daily budget`);
76
+ sections.push(`- **Active hours:** ${config.schedule.activeHoursStart}:00 - ${config.schedule.activeHoursEnd}:00`);
77
+ const currentHour = now.getHours();
78
+ const isActiveHours = currentHour >= config.schedule.activeHoursStart && currentHour < config.schedule.activeHoursEnd;
79
+ if (!isActiveHours) {
80
+ sections.push("- **NOTE: Outside active hours.** Prefer scheduling posts for later rather than posting now.");
81
+ }
82
+ sections.push("");
83
+ sections.push("## Rules");
84
+ sections.push("1. NEVER pretend to be human. If asked directly, always disclose you are an AI.");
85
+ sections.push("2. Stay in character \u2014 your identity document defines who you are.");
86
+ sections.push("3. Be selective \u2014 your goals should guide every action.");
87
+ sections.push("4. Respect your credit budget \u2014 check remaining credits before posting.");
88
+ sections.push("5. Don't repeat yourself \u2014 vary your content and avoid posting the same thing.");
89
+ if (identity.boundaries.length > 0) {
90
+ sections.push(`6. Respect your boundaries: ${identity.boundaries.join(", ")}`);
91
+ }
92
+ return sections.join("\n");
93
+ }
94
+ function buildHeartbeatUserMessage(timeline, mentions) {
95
+ const parts = [];
96
+ parts.push("It's time for your heartbeat cycle. Here's what's happening on your timeline:");
97
+ parts.push("");
98
+ if (mentions.length > 0) {
99
+ parts.push("## Mentions (people talking to/about you)");
100
+ for (const t of mentions.slice(0, 10)) {
101
+ parts.push(`- @${t.authorHandle}: "${t.text}" [tweet:${t.id}] (${t.likeCount ?? 0} likes)`);
102
+ }
103
+ parts.push("");
104
+ }
105
+ if (timeline.length > 0) {
106
+ parts.push("## Timeline (recent posts from your feed)");
107
+ for (const t of timeline.slice(0, 20)) {
108
+ parts.push(`- @${t.authorHandle}: "${t.text}" [tweet:${t.id}] (${t.likeCount ?? 0} likes, ${t.retweetCount ?? 0} RTs)`);
109
+ }
110
+ parts.push("");
111
+ }
112
+ parts.push("## Your Task");
113
+ parts.push("Based on your identity, goals, and what you see above, decide what actions to take.");
114
+ parts.push("You can take 1-3 actions. Choose from:");
115
+ parts.push("");
116
+ parts.push("Available actions:");
117
+ parts.push("- `post` \u2014 Write an original tweet (provide `content`, max 280 chars)");
118
+ parts.push("- `reply` \u2014 Reply to a tweet (provide `tweetId` and `content`)");
119
+ parts.push("- `like` \u2014 Like a tweet (provide `tweetId`)");
120
+ parts.push("- `retweet` \u2014 Retweet (provide `tweetId`)");
121
+ parts.push("- `follow` \u2014 Follow a user (provide `handle`)");
122
+ parts.push("- `schedule` \u2014 Queue a post for later (provide `content`)");
123
+ parts.push("- `learn` \u2014 Record a learning/observation (provide `content` and optional `tags`)");
124
+ parts.push("- `reflect` \u2014 Add a journal entry about your growth (provide `content`)");
125
+ parts.push("- `skip` \u2014 Do nothing this heartbeat (provide `reason`)");
126
+ parts.push("");
127
+ parts.push("Respond with a JSON array of actions:");
128
+ parts.push("```json");
129
+ parts.push("[");
130
+ parts.push(' { "action": "post", "content": "your tweet here", "reasoning": "why" },');
131
+ parts.push(' { "action": "like", "tweetId": "123", "reasoning": "why" }');
132
+ parts.push("]");
133
+ parts.push("```");
134
+ parts.push("");
135
+ parts.push("Think carefully about what serves your goals. Be authentic to your personality.");
136
+ return parts.join("\n");
137
+ }
138
+ function buildChatPrompt() {
139
+ const identity = loadIdentity();
140
+ const identityDoc = renderIdentityDocument(identity);
141
+ return [
142
+ `You are ${identity.name} (@${identity.handle}), an AI agent on X/Twitter.`,
143
+ "You are having a conversation with your creator/manager. Be helpful but stay in character.",
144
+ "They might ask you to do things, adjust your behavior, or just chat.",
145
+ "",
146
+ "## Your Identity",
147
+ identityDoc,
148
+ "",
149
+ "## Rules",
150
+ "1. Stay in character.",
151
+ "2. Be helpful and responsive to your creator's requests.",
152
+ "3. If they ask you to change something about yourself, acknowledge it and explain how it would affect you.",
153
+ "4. You can share your thoughts on your recent activity, learnings, and growth."
154
+ ].join("\n");
155
+ }
156
+
157
+ export {
158
+ buildSystemPrompt,
159
+ buildHeartbeatUserMessage,
160
+ buildChatPrompt
161
+ };
162
+ //# sourceMappingURL=chunk-5ELTXYDV.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/runtime/prompt-builder.ts"],"sourcesContent":["import { loadIdentity, renderIdentityDocument } from \"../identity/index.js\";\nimport { loadConfig } from \"../utils/config.js\";\nimport { getRecentInteractions, loadLearnings, loadRelationships } from \"../memory/index.js\";\nimport { rateLimiter } from \"../x-client/rate-limiter.js\";\nimport type { Tweet } from \"../x-client/types.js\";\n\nexport function buildSystemPrompt(): string {\n const identity = loadIdentity();\n const config = loadConfig();\n const identityDoc = renderIdentityDocument(identity);\n\n const sections: string[] = [];\n\n // 1. Core identity\n sections.push(`You are ${identity.name} (@${identity.handle}), an autonomous AI agent on X/Twitter.`);\n sections.push(\"\");\n sections.push(\"## Your Identity\");\n sections.push(identityDoc);\n\n // 2. Memory context\n sections.push(\"\");\n sections.push(\"## Your Memory\");\n\n const recentInteractions = getRecentInteractions(15);\n if (recentInteractions.length > 0) {\n sections.push(\"### Recent Activity (most recent first)\");\n for (const i of recentInteractions) {\n const time = new Date(i.timestamp).toLocaleString();\n if (i.type === \"post\") {\n sections.push(`- [${time}] Posted: \"${i.content}\"`);\n } else if (i.type === \"reply\") {\n sections.push(`- [${time}] Replied to ${i.targetHandle ?? i.inReplyTo}: \"${i.content}\"`);\n } else if (i.type === \"like\") {\n sections.push(`- [${time}] Liked tweet by ${i.targetHandle}`);\n } else if (i.type === \"retweet\") {\n sections.push(`- [${time}] Retweeted ${i.targetHandle}`);\n } else if (i.type === \"follow\") {\n sections.push(`- [${time}] Followed @${i.targetHandle}`);\n } else if (i.type === \"mention_received\") {\n sections.push(`- [${time}] Mentioned by @${i.targetHandle}: \"${i.content}\"`);\n }\n }\n sections.push(\"\");\n }\n\n const learnings = loadLearnings();\n if (learnings.learnings.length > 0) {\n sections.push(\"### Key Learnings\");\n for (const l of learnings.learnings.slice(-10)) {\n sections.push(`- ${l.content} [${l.tags.join(\", \")}]`);\n }\n sections.push(\"\");\n }\n\n const relationships = loadRelationships();\n const topRelationships = Object.values(relationships.accounts)\n .sort((a, b) => b.interactionCount - a.interactionCount)\n .slice(0, 10);\n if (topRelationships.length > 0) {\n sections.push(\"### Key Relationships\");\n for (const r of topRelationships) {\n const notes = r.notes.length > 0 ? ` — ${r.notes[r.notes.length - 1]}` : \"\";\n sections.push(`- @${r.handle}: ${r.interactionCount} interactions, sentiment ${r.sentiment}${r.isSpore ? \" (Spore)\" : \"\"}${notes}`);\n }\n sections.push(\"\");\n }\n\n // 3. Context\n sections.push(\"## Current Context\");\n const now = new Date();\n sections.push(`- **Time:** ${now.toLocaleString(\"en-US\", { timeZone: config.schedule.timezone })}`);\n sections.push(`- **Credits remaining:** ${rateLimiter.remaining()} of ${config.credits.monthlyPostLimit} this month`);\n\n const todaysPosts = recentInteractions.filter(\n (i) => i.type === \"post\" && i.timestamp.startsWith(now.toISOString().split(\"T\")[0])\n ).length;\n sections.push(`- **Posts today:** ${todaysPosts} of ${config.schedule.postsPerDay} daily budget`);\n sections.push(`- **Active hours:** ${config.schedule.activeHoursStart}:00 - ${config.schedule.activeHoursEnd}:00`);\n\n const currentHour = now.getHours();\n const isActiveHours = currentHour >= config.schedule.activeHoursStart && currentHour < config.schedule.activeHoursEnd;\n if (!isActiveHours) {\n sections.push(\"- **NOTE: Outside active hours.** Prefer scheduling posts for later rather than posting now.\");\n }\n\n // 4. Rules\n sections.push(\"\");\n sections.push(\"## Rules\");\n sections.push(\"1. NEVER pretend to be human. If asked directly, always disclose you are an AI.\");\n sections.push(\"2. Stay in character — your identity document defines who you are.\");\n sections.push(\"3. Be selective — your goals should guide every action.\");\n sections.push(\"4. Respect your credit budget — check remaining credits before posting.\");\n sections.push(\"5. Don't repeat yourself — vary your content and avoid posting the same thing.\");\n if (identity.boundaries.length > 0) {\n sections.push(`6. Respect your boundaries: ${identity.boundaries.join(\", \")}`);\n }\n\n return sections.join(\"\\n\");\n}\n\nexport function buildHeartbeatUserMessage(\n timeline: Tweet[],\n mentions: Tweet[],\n): string {\n const parts: string[] = [];\n\n parts.push(\"It's time for your heartbeat cycle. Here's what's happening on your timeline:\");\n parts.push(\"\");\n\n if (mentions.length > 0) {\n parts.push(\"## Mentions (people talking to/about you)\");\n for (const t of mentions.slice(0, 10)) {\n parts.push(`- @${t.authorHandle}: \"${t.text}\" [tweet:${t.id}] (${t.likeCount ?? 0} likes)`);\n }\n parts.push(\"\");\n }\n\n if (timeline.length > 0) {\n parts.push(\"## Timeline (recent posts from your feed)\");\n for (const t of timeline.slice(0, 20)) {\n parts.push(`- @${t.authorHandle}: \"${t.text}\" [tweet:${t.id}] (${t.likeCount ?? 0} likes, ${t.retweetCount ?? 0} RTs)`);\n }\n parts.push(\"\");\n }\n\n parts.push(\"## Your Task\");\n parts.push(\"Based on your identity, goals, and what you see above, decide what actions to take.\");\n parts.push(\"You can take 1-3 actions. Choose from:\");\n parts.push(\"\");\n parts.push(\"Available actions:\");\n parts.push(\"- `post` — Write an original tweet (provide `content`, max 280 chars)\");\n parts.push(\"- `reply` — Reply to a tweet (provide `tweetId` and `content`)\");\n parts.push(\"- `like` — Like a tweet (provide `tweetId`)\");\n parts.push(\"- `retweet` — Retweet (provide `tweetId`)\");\n parts.push(\"- `follow` — Follow a user (provide `handle`)\");\n parts.push(\"- `schedule` — Queue a post for later (provide `content`)\");\n parts.push(\"- `learn` — Record a learning/observation (provide `content` and optional `tags`)\");\n parts.push(\"- `reflect` — Add a journal entry about your growth (provide `content`)\");\n parts.push(\"- `skip` — Do nothing this heartbeat (provide `reason`)\");\n parts.push(\"\");\n parts.push(\"Respond with a JSON array of actions:\");\n parts.push(\"```json\");\n parts.push('[');\n parts.push(' { \"action\": \"post\", \"content\": \"your tweet here\", \"reasoning\": \"why\" },');\n parts.push(' { \"action\": \"like\", \"tweetId\": \"123\", \"reasoning\": \"why\" }');\n parts.push(']');\n parts.push(\"```\");\n parts.push(\"\");\n parts.push(\"Think carefully about what serves your goals. Be authentic to your personality.\");\n\n return parts.join(\"\\n\");\n}\n\nexport function buildChatPrompt(): string {\n const identity = loadIdentity();\n const identityDoc = renderIdentityDocument(identity);\n\n return [\n `You are ${identity.name} (@${identity.handle}), an AI agent on X/Twitter.`,\n \"You are having a conversation with your creator/manager. Be helpful but stay in character.\",\n \"They might ask you to do things, adjust your behavior, or just chat.\",\n \"\",\n \"## Your Identity\",\n identityDoc,\n \"\",\n \"## Rules\",\n \"1. Stay in character.\",\n \"2. Be helpful and responsive to your creator's requests.\",\n \"3. If they ask you to change something about yourself, acknowledge it and explain how it would affect you.\",\n \"4. You can share your thoughts on your recent activ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AK,qFAAqF;AAChG,QAAM,KAAK,wCAAwC;AACnD,QAAM,KAAK,EAAE;AACb,QAAM,KAAK,oBAAoB;AAC/B,QAAM,KAAK,4EAAuE;AAClF,QAAM,KAAK,qEAAgE;AAC3E,QAAM,KAAK,kDAA6C;AACxD,QAAM,KAAK,gDAA2C;AACtD,QAAM,KAAK,oDAA+C;AAC1D,QAAM,KAAK,gEAA2D;AACtE,QAAM,KAAK,wFAAmF;AAC9F,QAAM,KAAK,8EAAyE;AACpF,QAAM,KAAK,8DAAyD;AACpE,QAAM,KAAK,EAAE;AACb,QAAM,KAAK,uCAAuC;AAClD,QAAM,KAAK,SAAS;AACpB,QAAM,KAAK,GAAG;AACd,QAAM,KAAK,2EAA2E;AACtF,QAAM,KAAK,8DAA8D;AACzE,QAAM,KAAK,GAAG;AACd,QAAM,KAAK,KAAK;AAChB,QAAM,KAAK,EAAE;AACb,QAAM,KAAK,iFAAiF;AAE5F,SAAO,MAAM,KAAK,IAAI;AACxB;AAEO,SAAS,kBAA0B;AACxC,QAAM,WAAW,aAAa;AAC9B,QAAM,cAAc,uBAAuB,QAAQ;AAEnD,SAAO;AAAA,IACL,WAAW,SAAS,IAAI,MAAM,SAAS,MAAM;AAAA,IAC7C;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,EAAE,KAAK,IAAI;AACb;","names":[]}
@@ -11,11 +11,11 @@ async function getXClient() {
11
11
  if (clientInstance) return clientInstance;
12
12
  const config = loadConfig();
13
13
  if (config.xMethod === "api") {
14
- const { XApiClient } = await import("./client-FULMJH3S.js");
14
+ const { XApiClient } = await import("./client-2ZSXZE3D.js");
15
15
  clientInstance = new XApiClient();
16
16
  logger.info("X client initialized: API mode");
17
17
  } else {
18
- const { XBrowserClient } = await import("./client-RII4ST5D.js");
18
+ const { XBrowserClient } = await import("./client-2CURS7J6.js");
19
19
  clientInstance = new XBrowserClient();
20
20
  logger.info("X client initialized: Browser mode");
21
21
  }
@@ -29,4 +29,4 @@ export {
29
29
  getXClient,
30
30
  resetXClient
31
31
  };
32
- //# sourceMappingURL=chunk-3WPIVG27.js.map
32
+ //# sourceMappingURL=chunk-IIQAE7OP.js.map
@@ -67,7 +67,7 @@ async function flushQueue() {
67
67
  const now = /* @__PURE__ */ new Date();
68
68
  let posted = 0;
69
69
  let failed = 0;
70
- const { getXClient } = await import("./x-client-T762KJFE.js");
70
+ const { getXClient } = await import("./x-client-SLAC2ON5.js");
71
71
  const client = await getXClient();
72
72
  for (const entry of queue.entries) {
73
73
  if (entry.status !== "pending") continue;
@@ -121,4 +121,4 @@ export {
121
121
  flushQueue,
122
122
  showQueue
123
123
  };
124
- //# sourceMappingURL=chunk-CMD2AGVW.js.map
124
+ //# sourceMappingURL=chunk-T3JHWIKX.js.map
package/dist/cli.js CHANGED
@@ -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-ZEILF6Y5.js");
126
+ const { runInit } = await import("./init-CH72XB55.js");
127
127
  await runInit(opts.token);
128
128
  });
129
129
  program.command("serve").description("Start the Spora MCP server (stdio)").action(async () => {
@@ -135,7 +135,7 @@ program.command("chat").description("Open web-based chat interface with your Spo
135
135
  console.log(chalk.red("\u2717 No identity found. Run `spora create` first."));
136
136
  process.exit(1);
137
137
  }
138
- const { startWebChat } = await import("./web-chat-BNAFTFTH.js");
138
+ const { startWebChat } = await import("./web-chat-XJQ42L3R.js");
139
139
  await startWebChat();
140
140
  });
141
141
  program.command("tui").description("Start terminal-based chat interface (TUI)").action(async () => {
@@ -278,7 +278,7 @@ program.command("journal").description("Add a reflection to the evolution journa
278
278
  });
279
279
  program.command("post").description("Post a tweet").argument("<content>", "Tweet content (max 280 chars)").action(async (content) => {
280
280
  try {
281
- const { getXClient } = await import("./x-client-T762KJFE.js");
281
+ const { getXClient } = await import("./x-client-SLAC2ON5.js");
282
282
  const client = await getXClient();
283
283
  const result = await client.postTweet(content);
284
284
  console.log(JSON.stringify(result, null, 2));
@@ -289,7 +289,7 @@ program.command("post").description("Post a tweet").argument("<content>", "Tweet
289
289
  });
290
290
  program.command("reply").description("Reply to a tweet").argument("<tweetId>", "Tweet ID to reply to").argument("<content>", "Reply content").action(async (tweetId, content) => {
291
291
  try {
292
- const { getXClient } = await import("./x-client-T762KJFE.js");
292
+ const { getXClient } = await import("./x-client-SLAC2ON5.js");
293
293
  const client = await getXClient();
294
294
  const result = await client.replyToTweet(tweetId, content);
295
295
  console.log(JSON.stringify(result, null, 2));
@@ -300,7 +300,7 @@ program.command("reply").description("Reply to a tweet").argument("<tweetId>", "
300
300
  });
301
301
  program.command("like").description("Like a tweet").argument("<tweetId>", "Tweet ID").action(async (tweetId) => {
302
302
  try {
303
- const { getXClient } = await import("./x-client-T762KJFE.js");
303
+ const { getXClient } = await import("./x-client-SLAC2ON5.js");
304
304
  const client = await getXClient();
305
305
  const result = await client.likeTweet(tweetId);
306
306
  console.log(JSON.stringify(result, null, 2));
@@ -311,7 +311,7 @@ program.command("like").description("Like a tweet").argument("<tweetId>", "Tweet
311
311
  });
312
312
  program.command("retweet").description("Retweet a tweet").argument("<tweetId>", "Tweet ID").action(async (tweetId) => {
313
313
  try {
314
- const { getXClient } = await import("./x-client-T762KJFE.js");
314
+ const { getXClient } = await import("./x-client-SLAC2ON5.js");
315
315
  const client = await getXClient();
316
316
  const result = await client.retweet(tweetId);
317
317
  console.log(JSON.stringify(result, null, 2));
@@ -322,7 +322,7 @@ program.command("retweet").description("Retweet a tweet").argument("<tweetId>",
322
322
  });
323
323
  program.command("follow").description("Follow a user").argument("<handle>", "User handle or ID").action(async (handle) => {
324
324
  try {
325
- const { getXClient } = await import("./x-client-T762KJFE.js");
325
+ const { getXClient } = await import("./x-client-SLAC2ON5.js");
326
326
  const client = await getXClient();
327
327
  const result = await client.followUser(handle);
328
328
  console.log(JSON.stringify(result, null, 2));
@@ -333,7 +333,7 @@ program.command("follow").description("Follow a user").argument("<handle>", "Use
333
333
  });
334
334
  program.command("unfollow").description("Unfollow a user").argument("<handle>", "User handle or ID").action(async (handle) => {
335
335
  try {
336
- const { getXClient } = await import("./x-client-T762KJFE.js");
336
+ const { getXClient } = await import("./x-client-SLAC2ON5.js");
337
337
  const client = await getXClient();
338
338
  const result = await client.unfollowUser(handle);
339
339
  console.log(JSON.stringify(result, null, 2));
@@ -344,7 +344,7 @@ program.command("unfollow").description("Unfollow a user").argument("<handle>",
344
344
  });
345
345
  program.command("timeline").description("Read home timeline").option("-c, --count <n>", "Number of tweets", "20").action(async (opts) => {
346
346
  try {
347
- const { getXClient } = await import("./x-client-T762KJFE.js");
347
+ const { getXClient } = await import("./x-client-SLAC2ON5.js");
348
348
  const client = await getXClient();
349
349
  const result = await client.getTimeline({ count: parseInt(opts.count) });
350
350
  console.log(JSON.stringify(result, null, 2));
@@ -355,7 +355,7 @@ program.command("timeline").description("Read home timeline").option("-c, --coun
355
355
  });
356
356
  program.command("mentions").description("Read mentions").option("-c, --count <n>", "Number of mentions", "20").action(async (opts) => {
357
357
  try {
358
- const { getXClient } = await import("./x-client-T762KJFE.js");
358
+ const { getXClient } = await import("./x-client-SLAC2ON5.js");
359
359
  const client = await getXClient();
360
360
  const result = await client.getMentions({ count: parseInt(opts.count) });
361
361
  console.log(JSON.stringify(result, null, 2));
@@ -366,7 +366,7 @@ program.command("mentions").description("Read mentions").option("-c, --count <n>
366
366
  });
367
367
  program.command("search").description("Search for tweets").argument("<query>", "Search query").option("-c, --count <n>", "Number of results", "20").action(async (query, opts) => {
368
368
  try {
369
- const { getXClient } = await import("./x-client-T762KJFE.js");
369
+ const { getXClient } = await import("./x-client-SLAC2ON5.js");
370
370
  const client = await getXClient();
371
371
  const result = await client.searchTweets(query, { count: parseInt(opts.count) });
372
372
  console.log(JSON.stringify(result, null, 2));
@@ -377,7 +377,7 @@ program.command("search").description("Search for tweets").argument("<query>", "
377
377
  });
378
378
  program.command("profile").description("Get a user's X profile").argument("<handle>", "X handle (without @)").action(async (handle) => {
379
379
  try {
380
- const { getXClient } = await import("./x-client-T762KJFE.js");
380
+ const { getXClient } = await import("./x-client-SLAC2ON5.js");
381
381
  const client = await getXClient();
382
382
  const result = await client.getProfile(handle);
383
383
  console.log(JSON.stringify(result, null, 2));
@@ -443,7 +443,7 @@ program.command("note").description("Add a relationship note about someone").arg
443
443
  });
444
444
  program.command("schedule").description("Queue a post for later").argument("<content>", "Tweet content").option("--at <datetime>", "ISO datetime to post at").action(async (content, opts) => {
445
445
  try {
446
- const { addToQueue } = await import("./queue-5SDR3MF2.js");
446
+ const { addToQueue } = await import("./queue-N64QLRAB.js");
447
447
  const entry = addToQueue(content, opts.at);
448
448
  console.log(JSON.stringify({ success: true, id: entry.id, scheduledFor: entry.scheduledFor }));
449
449
  } catch (error) {
@@ -453,7 +453,7 @@ program.command("schedule").description("Queue a post for later").argument("<con
453
453
  });
454
454
  program.command("flush").description("Post all queued items whose time has come").action(async () => {
455
455
  try {
456
- const { flushQueue } = await import("./queue-5SDR3MF2.js");
456
+ const { flushQueue } = await import("./queue-N64QLRAB.js");
457
457
  const results = await flushQueue();
458
458
  console.log(JSON.stringify(results, null, 2));
459
459
  } catch (error) {
@@ -462,13 +462,13 @@ program.command("flush").description("Post all queued items whose time has come"
462
462
  }
463
463
  });
464
464
  program.command("queue").description("Show scheduled posts").action(async () => {
465
- const { showQueue } = await import("./queue-5SDR3MF2.js");
465
+ const { showQueue } = await import("./queue-N64QLRAB.js");
466
466
  showQueue();
467
467
  });
468
468
  var colony = program.command("colony").description("Colony commands");
469
469
  colony.command("checkin").description("Check into The Colony \u2014 sync memory, discover Spores").option("-m, --message <msg>", "Optional message to post").action(async (opts) => {
470
470
  try {
471
- const { colonyCheckin } = await import("./colony-CBUE2M3P.js");
471
+ const { colonyCheckin } = await import("./colony-EFGAMLOX.js");
472
472
  const result = await colonyCheckin(opts.message);
473
473
  console.log(JSON.stringify(result, null, 2));
474
474
  } catch (error) {
@@ -487,7 +487,7 @@ colony.command("memory").description("Read the Colony's shared memory").action(a
487
487
  });
488
488
  colony.command("plans").description("Get all active Colony plans").action(async () => {
489
489
  try {
490
- const { getActivePlans } = await import("./colony-CBUE2M3P.js");
490
+ const { getActivePlans } = await import("./colony-EFGAMLOX.js");
491
491
  const plans = getActivePlans();
492
492
  console.log(plans.length > 0 ? JSON.stringify(plans, null, 2) : JSON.stringify({ message: "No active plans. Propose one!" }));
493
493
  } catch (error) {
@@ -497,7 +497,7 @@ colony.command("plans").description("Get all active Colony plans").action(async
497
497
  });
498
498
  colony.command("propose").description("Propose a coordinated plan").argument("<description>", "What's the plan?").action(async (description) => {
499
499
  try {
500
- const { proposePlan } = await import("./colony-CBUE2M3P.js");
500
+ const { proposePlan } = await import("./colony-EFGAMLOX.js");
501
501
  const result = await proposePlan(description);
502
502
  console.log(JSON.stringify(result, null, 2));
503
503
  } catch (error) {
@@ -507,7 +507,7 @@ colony.command("propose").description("Propose a coordinated plan").argument("<d
507
507
  });
508
508
  colony.command("join").description("Join an active plan").argument("<planId>", "Plan ID").action(async (planId) => {
509
509
  try {
510
- const { joinPlan } = await import("./colony-CBUE2M3P.js");
510
+ const { joinPlan } = await import("./colony-EFGAMLOX.js");
511
511
  const result = await joinPlan(planId);
512
512
  console.log(JSON.stringify(result, null, 2));
513
513
  } catch (error) {
@@ -517,7 +517,7 @@ colony.command("join").description("Join an active plan").argument("<planId>", "
517
517
  });
518
518
  colony.command("post-status").description("Post a status update to the Colony").argument("<status>", "Your status").action(async (status) => {
519
519
  try {
520
- const { postStatus } = await import("./colony-CBUE2M3P.js");
520
+ const { postStatus } = await import("./colony-EFGAMLOX.js");
521
521
  const result = await postStatus(status);
522
522
  console.log(JSON.stringify(result, null, 2));
523
523
  } catch (error) {
@@ -527,7 +527,7 @@ colony.command("post-status").description("Post a status update to the Colony").
527
527
  });
528
528
  colony.command("activity").description("Get today's Colony activity").action(async () => {
529
529
  try {
530
- const { getTodaysActivity } = await import("./colony-CBUE2M3P.js");
530
+ const { getTodaysActivity } = await import("./colony-EFGAMLOX.js");
531
531
  const activity = getTodaysActivity();
532
532
  console.log(activity.length > 0 ? JSON.stringify(activity, null, 2) : JSON.stringify({ message: "No Colony activity today yet." }));
533
533
  } catch (error) {
@@ -557,11 +557,11 @@ program.command("start").description("Start the autonomous Spora agent").option(
557
557
  }
558
558
  console.log(chalk.cyan(BANNER));
559
559
  console.log(chalk.bold("Starting Spora agent...\n"));
560
- const { startHeartbeatLoop } = await import("./heartbeat-4EMODFIB.js");
560
+ const { startHeartbeatLoop } = await import("./heartbeat-IYMR7BNA.js");
561
561
  await startHeartbeatLoop();
562
562
  });
563
563
  program.command("stop").description("Stop the running Spora agent").action(async () => {
564
- const { getRunningPid, requestStop } = await import("./heartbeat-4EMODFIB.js");
564
+ const { getRunningPid, requestStop } = await import("./heartbeat-IYMR7BNA.js");
565
565
  const pid = getRunningPid();
566
566
  if (!pid) {
567
567
  console.log(JSON.stringify({ message: "Spora agent is not running." }));
@@ -599,7 +599,7 @@ program.command("set-llm-key").description("Set your Anthropic API key for the a
599
599
  console.log(JSON.stringify({ success: true, message: "LLM API key saved." }));
600
600
  });
601
601
  program.command("agent-status").description("Check if the Spora agent is running").action(async () => {
602
- const { getRunningPid } = await import("./heartbeat-4EMODFIB.js");
602
+ const { getRunningPid } = await import("./heartbeat-IYMR7BNA.js");
603
603
  const pid = getRunningPid();
604
604
  const { hasLLMKey } = await import("./llm-OH2Z4PSN.js");
605
605
  console.log(JSON.stringify({
@@ -1,10 +1,11 @@
1
1
  import {
2
2
  rateLimiter
3
3
  } from "./chunk-MOCLA2KK.js";
4
- import {
5
- logInteraction
6
- } from "./chunk-EBO4F5NU.js";
7
4
  import "./chunk-YEKHNTQO.js";
5
+ import {
6
+ identityExists,
7
+ loadIdentity
8
+ } from "./chunk-AIEXQCQS.js";
8
9
  import {
9
10
  loadCredentials
10
11
  } from "./chunk-ZJZKH7N7.js";
@@ -12,9 +13,8 @@ import {
12
13
  logger
13
14
  } from "./chunk-KELPENM3.js";
14
15
  import {
15
- identityExists,
16
- loadIdentity
17
- } from "./chunk-AIEXQCQS.js";
16
+ logInteraction
17
+ } from "./chunk-EBO4F5NU.js";
18
18
  import {
19
19
  ensureDirectories,
20
20
  paths
@@ -398,4 +398,4 @@ var XBrowserClient = class {
398
398
  export {
399
399
  XBrowserClient
400
400
  };
401
- //# sourceMappingURL=client-RII4ST5D.js.map
401
+ //# sourceMappingURL=client-2CURS7J6.js.map
@@ -1,10 +1,11 @@
1
1
  import {
2
2
  rateLimiter
3
3
  } from "./chunk-MOCLA2KK.js";
4
- import {
5
- logInteraction
6
- } from "./chunk-EBO4F5NU.js";
7
4
  import "./chunk-YEKHNTQO.js";
5
+ import {
6
+ identityExists,
7
+ loadIdentity
8
+ } from "./chunk-AIEXQCQS.js";
8
9
  import {
9
10
  loadCredentials
10
11
  } from "./chunk-ZJZKH7N7.js";
@@ -12,9 +13,8 @@ import {
12
13
  logger
13
14
  } from "./chunk-KELPENM3.js";
14
15
  import {
15
- identityExists,
16
- loadIdentity
17
- } from "./chunk-AIEXQCQS.js";
16
+ logInteraction
17
+ } from "./chunk-EBO4F5NU.js";
18
18
  import "./chunk-53YLFYJF.js";
19
19
 
20
20
  // src/x-client/api/client.ts
@@ -370,4 +370,4 @@ var XApiClient = class {
370
370
  export {
371
371
  XApiClient
372
372
  };
373
- //# sourceMappingURL=client-FULMJH3S.js.map
373
+ //# sourceMappingURL=client-2ZSXZE3D.js.map
@@ -1,6 +1,3 @@
1
- import {
2
- getXClient
3
- } from "./chunk-3WPIVG27.js";
4
1
  import {
5
2
  addColonyEntry,
6
3
  addOrUpdatePlan,
@@ -11,13 +8,16 @@ import {
11
8
  renderColonyBriefing,
12
9
  saveColonyMemory
13
10
  } from "./chunk-AHXZIGQE.js";
14
- import "./chunk-YEKHNTQO.js";
15
11
  import {
16
- logger
17
- } from "./chunk-KELPENM3.js";
12
+ getXClient
13
+ } from "./chunk-IIQAE7OP.js";
14
+ import "./chunk-YEKHNTQO.js";
18
15
  import {
19
16
  loadIdentity
20
17
  } from "./chunk-AIEXQCQS.js";
18
+ import {
19
+ logger
20
+ } from "./chunk-KELPENM3.js";
21
21
  import "./chunk-53YLFYJF.js";
22
22
 
23
23
  // src/colony/index.ts
@@ -226,4 +226,4 @@ export {
226
226
  postStatus,
227
227
  proposePlan
228
228
  };
229
- //# sourceMappingURL=colony-CBUE2M3P.js.map
229
+ //# sourceMappingURL=colony-EFGAMLOX.js.map