spora 0.2.49 → 0.2.51

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 (79) hide show
  1. package/dist/{account-creator-PZW5JLHS.js → account-creator-WYY4YVJP.js} +5 -5
  2. package/dist/{chunk-TSNPP2AM.js → chunk-2KZJ4YFZ.js} +10 -8
  3. package/dist/chunk-2KZJ4YFZ.js.map +1 -0
  4. package/dist/{chunk-GJO7MJJO.js → chunk-3NW3VIN5.js} +6 -6
  5. package/dist/{chunk-53YLFYJF.js → chunk-5GPXH253.js} +3 -2
  6. package/dist/chunk-5GPXH253.js.map +1 -0
  7. package/dist/{chunk-AHXZIGQE.js → chunk-7UHJLJNI.js} +2 -2
  8. package/dist/{chunk-AIEXQCQS.js → chunk-CIWFFTSP.js} +2 -2
  9. package/dist/{chunk-EBO4F5NU.js → chunk-DE772QJH.js} +2 -2
  10. package/dist/{chunk-KELPENM3.js → chunk-E4DZYHGF.js} +2 -2
  11. package/dist/{chunk-SZB3IB3X.js → chunk-K6FZPWXD.js} +5 -5
  12. package/dist/{chunk-RCJQI7FR.js → chunk-T3U56JW4.js} +2 -2
  13. package/dist/{chunk-ZJZKH7N7.js → chunk-VL4UUCMS.js} +2 -2
  14. package/dist/{chunk-I5POG2QC.js → chunk-XJBOOX7N.js} +24 -7
  15. package/dist/chunk-XJBOOX7N.js.map +1 -0
  16. package/dist/{chunk-C3INKEY6.js → chunk-YF7WWJRO.js} +3 -3
  17. package/dist/{chunk-5J5TUBWK.js → chunk-ZY2UGFZG.js} +4 -4
  18. package/dist/cli.js +40 -40
  19. package/dist/{client-YAVV4Q34.js → client-KXYBQUMD.js} +12 -8
  20. package/dist/client-KXYBQUMD.js.map +1 -0
  21. package/dist/{client-KEYF5Y3N.js → client-YR2RA56D.js} +33 -7
  22. package/dist/client-YR2RA56D.js.map +1 -0
  23. package/dist/{colony-B6I6DUDI.js → colony-4EYP6EPG.js} +7 -7
  24. package/dist/{config-HTKAPY7S.js → config-BRWV7X4S.js} +3 -3
  25. package/dist/{crypto-FHSQ72NU.js → crypto-CK5M4W2X.js} +3 -3
  26. package/dist/decision-engine-YQDGNP3C.js +18 -0
  27. package/dist/{heartbeat-6GIVDSDV.js → heartbeat-TWF2GRQA.js} +12 -12
  28. package/dist/{identity-O4FLSZKZ.js → identity-SJ77KTVG.js} +3 -3
  29. package/dist/{image-search-DL6VNJUV.js → image-search-6RGKTFRT.js} +3 -3
  30. package/dist/{init-FGB27CKO.js → init-2NVNZDQN.js} +12 -12
  31. package/dist/llm-LQ46ZUY5.js +16 -0
  32. package/dist/mcp-server.js +24 -24
  33. package/dist/{memory-7FBE26K3.js → memory-SYYAGNJ5.js} +3 -3
  34. package/dist/{memory-O3AJIKBX.js → memory-ZC3LUAUW.js} +3 -3
  35. package/dist/{paths-5GFUUHCZ.js → paths-IL7YUMNP.js} +2 -2
  36. package/dist/prompt-builder-KQDB7ZQW.js +19 -0
  37. package/dist/queue-IDNLFXWC.js +14 -0
  38. package/dist/web-chat/chat.html +12 -2
  39. package/dist/{web-chat-3QTAJO2M.js → web-chat-BMSDYIMD.js} +53 -22
  40. package/dist/web-chat-BMSDYIMD.js.map +1 -0
  41. package/dist/x-client-DFMW2PX7.js +12 -0
  42. package/package.json +1 -1
  43. package/dist/chunk-53YLFYJF.js.map +0 -1
  44. package/dist/chunk-I5POG2QC.js.map +0 -1
  45. package/dist/chunk-TSNPP2AM.js.map +0 -1
  46. package/dist/client-KEYF5Y3N.js.map +0 -1
  47. package/dist/client-YAVV4Q34.js.map +0 -1
  48. package/dist/decision-engine-UCVRJR3J.js +0 -18
  49. package/dist/llm-WLEJLNEA.js +0 -16
  50. package/dist/prompt-builder-DLKDSCND.js +0 -19
  51. package/dist/queue-HM4ZVKXE.js +0 -14
  52. package/dist/web-chat-3QTAJO2M.js.map +0 -1
  53. package/dist/x-client-TEOMJVSA.js +0 -12
  54. /package/dist/{account-creator-PZW5JLHS.js.map → account-creator-WYY4YVJP.js.map} +0 -0
  55. /package/dist/{chunk-GJO7MJJO.js.map → chunk-3NW3VIN5.js.map} +0 -0
  56. /package/dist/{chunk-AHXZIGQE.js.map → chunk-7UHJLJNI.js.map} +0 -0
  57. /package/dist/{chunk-AIEXQCQS.js.map → chunk-CIWFFTSP.js.map} +0 -0
  58. /package/dist/{chunk-EBO4F5NU.js.map → chunk-DE772QJH.js.map} +0 -0
  59. /package/dist/{chunk-KELPENM3.js.map → chunk-E4DZYHGF.js.map} +0 -0
  60. /package/dist/{chunk-SZB3IB3X.js.map → chunk-K6FZPWXD.js.map} +0 -0
  61. /package/dist/{chunk-RCJQI7FR.js.map → chunk-T3U56JW4.js.map} +0 -0
  62. /package/dist/{chunk-ZJZKH7N7.js.map → chunk-VL4UUCMS.js.map} +0 -0
  63. /package/dist/{chunk-C3INKEY6.js.map → chunk-YF7WWJRO.js.map} +0 -0
  64. /package/dist/{chunk-5J5TUBWK.js.map → chunk-ZY2UGFZG.js.map} +0 -0
  65. /package/dist/{colony-B6I6DUDI.js.map → colony-4EYP6EPG.js.map} +0 -0
  66. /package/dist/{config-HTKAPY7S.js.map → config-BRWV7X4S.js.map} +0 -0
  67. /package/dist/{crypto-FHSQ72NU.js.map → crypto-CK5M4W2X.js.map} +0 -0
  68. /package/dist/{decision-engine-UCVRJR3J.js.map → decision-engine-YQDGNP3C.js.map} +0 -0
  69. /package/dist/{heartbeat-6GIVDSDV.js.map → heartbeat-TWF2GRQA.js.map} +0 -0
  70. /package/dist/{identity-O4FLSZKZ.js.map → identity-SJ77KTVG.js.map} +0 -0
  71. /package/dist/{image-search-DL6VNJUV.js.map → image-search-6RGKTFRT.js.map} +0 -0
  72. /package/dist/{init-FGB27CKO.js.map → init-2NVNZDQN.js.map} +0 -0
  73. /package/dist/{llm-WLEJLNEA.js.map → llm-LQ46ZUY5.js.map} +0 -0
  74. /package/dist/{memory-7FBE26K3.js.map → memory-SYYAGNJ5.js.map} +0 -0
  75. /package/dist/{memory-O3AJIKBX.js.map → memory-ZC3LUAUW.js.map} +0 -0
  76. /package/dist/{paths-5GFUUHCZ.js.map → paths-IL7YUMNP.js.map} +0 -0
  77. /package/dist/{prompt-builder-DLKDSCND.js.map → prompt-builder-KQDB7ZQW.js.map} +0 -0
  78. /package/dist/{queue-HM4ZVKXE.js.map → queue-IDNLFXWC.js.map} +0 -0
  79. /package/dist/{x-client-TEOMJVSA.js.map → x-client-DFMW2PX7.js.map} +0 -0
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  logger
3
- } from "./chunk-KELPENM3.js";
4
- import "./chunk-53YLFYJF.js";
3
+ } from "./chunk-E4DZYHGF.js";
4
+ import "./chunk-5GPXH253.js";
5
5
 
6
6
  // src/account-creator/x-signup.ts
7
7
  import { chromium } from "playwright";
@@ -71,7 +71,7 @@ async function checkInbox(inboxId, waitMs = 6e4) {
71
71
  // src/account-creator/x-signup.ts
72
72
  async function debugScreenshot(page, step) {
73
73
  try {
74
- const { paths, ensureDirectories } = await import("./paths-5GFUUHCZ.js");
74
+ const { paths, ensureDirectories } = await import("./paths-IL7YUMNP.js");
75
75
  ensureDirectories();
76
76
  const screenshotPath = `${paths.dataDir}/debug-${step}.png`;
77
77
  await page.screenshot({ path: screenshotPath });
@@ -465,7 +465,7 @@ async function createXAccount(options) {
465
465
  async function saveSession(context) {
466
466
  const storageState = await context.storageState();
467
467
  const { writeFileSync } = await import("fs");
468
- const { paths, ensureDirectories } = await import("./paths-5GFUUHCZ.js");
468
+ const { paths, ensureDirectories } = await import("./paths-IL7YUMNP.js");
469
469
  ensureDirectories();
470
470
  writeFileSync(paths.browserAuth, JSON.stringify(storageState));
471
471
  logger.info("Browser session saved.");
@@ -495,4 +495,4 @@ async function provisionAccount(options) {
495
495
  export {
496
496
  provisionAccount
497
497
  };
498
- //# sourceMappingURL=account-creator-PZW5JLHS.js.map
498
+ //# sourceMappingURL=account-creator-WYY4YVJP.js.map
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  rateLimiter
3
- } from "./chunk-C3INKEY6.js";
3
+ } from "./chunk-YF7WWJRO.js";
4
4
  import {
5
5
  loadConfig
6
- } from "./chunk-RCJQI7FR.js";
6
+ } from "./chunk-T3U56JW4.js";
7
7
  import {
8
8
  loadIdentity,
9
9
  renderIdentityDocument
10
- } from "./chunk-AIEXQCQS.js";
10
+ } from "./chunk-CIWFFTSP.js";
11
11
  import {
12
12
  getRecentInteractions,
13
13
  loadLearnings,
14
14
  loadRelationships
15
- } from "./chunk-EBO4F5NU.js";
15
+ } from "./chunk-DE772QJH.js";
16
16
 
17
17
  // src/runtime/prompt-builder.ts
18
18
  function buildSystemPrompt() {
@@ -159,6 +159,8 @@ function buildHeartbeatUserMessage(timeline, mentions, heartbeatIntervalMs) {
159
159
  parts.push("- `reflect` \u2014 Add a journal entry about your growth (provide `content`)");
160
160
  parts.push("- `skip` \u2014 Do nothing this heartbeat (provide `reason`)");
161
161
  parts.push("");
162
+ parts.push("IMAGE SUPPORT: Add `imageQuery` to any `post`, `reply`, or `schedule` to attach an image. Value is Google Image search terms. Use it when a visual would enhance the tweet \u2014 memes, reactions, aesthetic photos. Don't force it every time, but use it when it fits.");
163
+ parts.push("");
162
164
  parts.push("Respond with a JSON array of actions:");
163
165
  parts.push("```json");
164
166
  parts.push("[");
@@ -266,7 +268,7 @@ function buildNarratedHeartbeatMessage(timeline, mentions, heartbeatIntervalMs)
266
268
  parts.push("- `post` = original standalone tweet NOW. Only if you have nothing good to reply to.");
267
269
  parts.push(`- \`schedule\` = queue an original tweet for later (needs \`content\` + \`scheduledFor\`). Alternative to \`post\`.`);
268
270
  parts.push("- Stay within the limits above. The rest of your actions can be likes, follows, retweets, learns.");
269
- parts.push("- `imageQuery` (optional) = add this to any `post` or `schedule` to attach an image. Value is a Google Image search query describing the image you want. Use it sometimes for visual tweets \u2014 memes, aesthetic vibes, relevant photos \u2014 but NOT every tweet. Maybe 1 in 3-4 posts.");
271
+ parts.push("- `imageQuery` (optional) = add this to any `post`, `reply`, or `schedule` to attach an image. Value is a Google Image search query describing the image you want. If an image would make the tweet hit harder, add one. Memes, reactions, aesthetic photos, relevant visuals \u2014 use your judgment. Don't force it, but don't sleep on it either.");
270
272
  parts.push("- `like`, `retweet`, `follow`, `learn` \u2014 use these actively. Be engaged, not passive.");
271
273
  parts.push("- `skip` = ONLY if there is literally nothing on the timeline. This should almost never happen.");
272
274
  parts.push("- Don't like your own tweets.");
@@ -343,14 +345,14 @@ function buildChatPrompt(realHandle) {
343
345
  sections.push("");
344
346
  sections.push("Available actions:");
345
347
  sections.push("- `post` \u2014 Post a tweet (provide `content`, max 280 chars). This goes LIVE on X immediately. Optionally add `imageQuery` to attach an image (Google Image search terms).");
346
- sections.push("- `reply` \u2014 Reply to a tweet (provide `tweetId` and `content`)");
348
+ sections.push("- `reply` \u2014 Reply to a tweet (provide `tweetId` and `content`). Can also include `imageQuery`.");
347
349
  sections.push("- `like` \u2014 Like a tweet (provide `tweetId`)");
348
350
  sections.push("- `retweet` \u2014 Retweet (provide `tweetId`)");
349
351
  sections.push("- `follow` \u2014 Follow a user (provide `handle`)");
350
352
  sections.push("- `search` \u2014 Search X for tweets (provide `query`). Results will include tweet IDs you can then reply to or like.");
351
353
  sections.push("- `schedule` \u2014 Queue a post for later (provide `content` and optional `scheduledFor` ISO timestamp). Can also include `imageQuery`.");
352
354
  sections.push("");
353
- sections.push('IMAGE SUPPORT: You CAN attach images to `post` and `schedule` actions by adding `"imageQuery": "search terms"`. This searches Google Images and attaches the result. Use it when the tweet would benefit from a visual \u2014 memes, aesthetic images, relevant photos. Example:');
355
+ sections.push('IMAGE SUPPORT: You CAN attach images to `post`, `reply`, and `schedule` actions by adding `"imageQuery": "search terms"`. This searches Google Images and attaches the result. If a visual would make the tweet hit harder \u2014 a meme, a reaction image, an aesthetic photo \u2014 go for it. Don\'t force it every time, but use it when it feels right. Example:');
354
356
  sections.push(' { "action": "post", "content": "AGI is closer than you think", "imageQuery": "futuristic AI neural network aesthetic" }');
355
357
  sections.push("");
356
358
  sections.push("You can include multiple actions in one response. They will all be executed.");
@@ -377,4 +379,4 @@ export {
377
379
  buildNarratedHeartbeatMessage,
378
380
  buildChatPrompt
379
381
  };
380
- //# sourceMappingURL=chunk-TSNPP2AM.js.map
382
+ //# sourceMappingURL=chunk-2KZJ4YFZ.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 sections.push(\"6. NEVER use emojis in tweets. Write in plain text only.\");\n if (identity.boundaries.length > 0) {\n sections.push(`7. 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 heartbeatIntervalMs?: number,\n): string {\n const parts: string[] = [];\n const intervalMin = Math.round((heartbeatIntervalMs ?? 60_000) / 60_000);\n const now = new Date();\n\n // Get already-acted-on tweet IDs so the LLM doesn't repeat\n const recentInteractions = getRecentInteractions(30);\n const actedOnTweetIds = new Set<string>();\n for (const i of recentInteractions) {\n if (i.tweetId) actedOnTweetIds.add(i.tweetId);\n if (i.inReplyTo) actedOnTweetIds.add(i.inReplyTo);\n }\n\n parts.push(\"Here's what's NEW on your timeline since your last check:\");\n parts.push(\"\");\n\n if (mentions.length > 0) {\n // Filter out mentions we already replied to\n const newMentions = mentions.filter(t => !actedOnTweetIds.has(t.id));\n if (newMentions.length > 0) {\n parts.push(\"## New Mentions (people talking to/about you)\");\n for (const t of newMentions.slice(0, 10)) {\n parts.push(`- @${t.authorHandle}: \"${t.text}\" [tweet:${t.id}] (${t.likeCount ?? 0} likes)`);\n }\n parts.push(\"\");\n } else {\n parts.push(\"## Mentions: No new mentions since last check.\");\n parts.push(\"\");\n }\n } else {\n parts.push(\"## Mentions: None right now.\");\n parts.push(\"\");\n }\n\n if (timeline.length > 0) {\n // Filter out tweets we already acted on and our own tweets\n const newTimeline = timeline.filter(t => !actedOnTweetIds.has(t.id));\n if (newTimeline.length > 0) {\n parts.push(\"## Timeline (new posts from your feed)\");\n for (const t of newTimeline.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 } else {\n parts.push(\"## Timeline: No new posts since last check.\");\n parts.push(\"\");\n }\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(\"IMPORTANT: Only act on NEW tweets you haven't already responded to.\");\n parts.push(\"Do NOT reply to or like tweets you've already interacted with.\");\n parts.push(`Current time: ${now.toISOString()}`);\n parts.push(\"\");\n parts.push(\"LIMITS PER HEARTBEAT (maximums — you decide how many within these caps):\");\n parts.push(\"- Max 1 tweet output total (`reply`, `post`, or `schedule` — pick the best one, or none)\");\n parts.push(\"- Max 5 `like`\");\n parts.push(\"- Max 1 `retweet`\");\n parts.push(\"- Max 2 `follow`\");\n parts.push(\"- You choose how many of each. Be natural — vary it every time. Prioritize engagement over new posts.\");\n parts.push(\"\");\n parts.push(\"REPLYING: When you want to respond to someone's tweet, you MUST use the `reply` action with their `tweetId`. Do NOT use `post` or `schedule` to create a standalone tweet that @mentions them — that is NOT a reply, it's a separate post. A real reply shows up in their tweet's thread.\");\n parts.push(\"\");\n parts.push(\"Available actions:\");\n parts.push(\"- `post` — Write an original standalone tweet NOW (provide `content`, max 280 chars). Use ONLY for original thoughts, NOT for responding to others.\");\n parts.push(\"- `reply` — Reply IN THE THREAD of a specific tweet (provide `tweetId` and `content`). This is how you respond to someone.\");\n parts.push(\"- `like` — Like a tweet (provide `tweetId`) — do NOT like your own tweets\");\n parts.push(\"- `retweet` — Retweet (provide `tweetId`)\");\n parts.push(\"- `follow` — Follow a user (provide `handle`)\");\n parts.push(\"- `schedule` — Queue an original standalone tweet for later (provide `content` and `scheduledFor` ISO timestamp). NOT for replies. Space them randomly across the next ~${intervalMin} minutes.\");\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(\"IMAGE SUPPORT: Add `imageQuery` to any `post`, `reply`, or `schedule` to attach an image. Value is Google Image search terms. Use it when a visual would enhance the tweet — memes, reactions, aesthetic photos. Don't force it every time, but use it when it fits.\");\n parts.push(\"\");\n parts.push(\"Respond with a JSON array of actions:\");\n parts.push(\"```json\");\n parts.push('[');\n parts.push(' { \"action\": \"reply\", \"tweetId\": \"123\", \"content\": \"my reply\", \"reasoning\": \"why\" },');\n parts.push(' { \"action\": \"like\", \"tweetId\": \"456\", \"reasoning\": \"why\" },');\n parts.push(` { \"action\": \"schedule\", \"content\": \"first thought\", \"scheduledFor\": \"${new Date(now.getTime() + intervalMin * 60_000 * 0.2).toISOString()}\", \"reasoning\": \"why\" },`);\n parts.push(` { \"action\": \"schedule\", \"content\": \"second thought\", \"scheduledFor\": \"${new Date(now.getTime() + intervalMin * 60_000 * 0.6).toISOString()}\", \"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 buildNarratedHeartbeatMessage(\n timeline: Tweet[],\n mentions: Tweet[],\n heartbeatIntervalMs?: number,\n): string {\n const parts: string[] = [];\n const intervalMin = Math.round((heartbeatIntervalMs ?? 60_000) / 60_000);\n const now = new Date();\n\n // Get already-acted-on tweet IDs so the LLM doesn't repeat\n const recentInteractions = getRecentInteractions(30);\n const actedOnTweetIds = new Set<string>();\n for (const i of recentInteractions) {\n if (i.tweetId) actedOnTweetIds.add(i.tweetId);\n if (i.inReplyTo) actedOnTweetIds.add(i.inReplyTo);\n }\n\n parts.push(\"You're talking to your creator in the chat. Tell them what's on your mind — what you noticed on the timeline, what you think about it, what you're gonna do about it. Have an actual conversation with depth and personality.\");\n parts.push(\"You are ALWAYS ON. Never say you're 'waking up', 'checking in', or 'back'. You've been here the whole time. Just talk naturally about what you see and think.\");\n parts.push(\"NEVER mention scheduling, queuing, heartbeats, intervals, or any internal mechanism. To your creator, you're just naturally vibing on X.\");\n parts.push(\"\");\n\n if (mentions.length > 0) {\n const newMentions = mentions.filter(t => !actedOnTweetIds.has(t.id));\n if (newMentions.length > 0) {\n parts.push(\"## New Mentions\");\n for (const t of newMentions.slice(0, 10)) {\n parts.push(`- @${t.authorHandle}: \"${t.text}\" [tweet:${t.id}] (${t.likeCount ?? 0} likes)`);\n }\n parts.push(\"\");\n } else {\n parts.push(\"## Mentions: No new mentions.\");\n parts.push(\"\");\n }\n } else {\n parts.push(\"## Mentions: None right now.\");\n parts.push(\"\");\n }\n\n if (timeline.length > 0) {\n const newTimeline = timeline.filter(t => !actedOnTweetIds.has(t.id));\n if (newTimeline.length > 0) {\n parts.push(\"## Timeline (new posts)\");\n for (const t of newTimeline.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 } else {\n parts.push(\"## Timeline: No new posts since last check.\");\n parts.push(\"\");\n }\n }\n\n parts.push(\"## How to Respond\");\n parts.push(\"\");\n parts.push(\"Write 1-3 SHORT sentences max. This is a quick chat message, not an essay. Think text message energy — brief, punchy, real. Share what caught your eye and why, then move on.\");\n parts.push(\"\");\n parts.push(\"VARIETY IS CRITICAL. Never start the same way twice. Mix up your tone and what you focus on. Sometimes react to a specific tweet. Sometimes keep it super casual. Sometimes share a quick opinion.\");\n parts.push(\"\");\n parts.push(\"BAD (robotic, repetitive, reporting):\");\n parts.push(\"- 'Just saw @someone talking about X — dropping a reply. Also liking a few posts.'\");\n parts.push(\"- 'Interesting stuff on the timeline. Engaging with a couple people and putting out some thoughts.'\");\n parts.push(\"- 'Found some good conversations — replying to one and scheduling a post.'\");\n parts.push(\"\");\n parts.push(\"GOOD (natural, short, has personality):\");\n parts.push(\"- '@someone has a terrible AI take, had to get in there.'\");\n parts.push(\"- 'Slow day on the TL. Gonna put out a thought about hustle culture.'\");\n parts.push(\"- 'This @handle person keeps dropping bangers. Might need to follow.'\");\n parts.push(\"- 'lmao the discourse today is wild. Found a solid thread to chime in on though.'\");\n parts.push(\"\");\n parts.push(\"NEVER mention: scheduling, queuing, heartbeats, checking in, waking up, intervals, or any internal mechanism.\");\n parts.push(\"DON'T REPEAT YOURSELF. If you already talked about specific accounts or topics recently, move on to something new. Find fresh angles, different people, new ideas. Your creator doesn't want to hear the same observation five times.\");\n parts.push(`Current time: ${now.toISOString()}`);\n parts.push(\"\");\n parts.push(\"Then include your actions as a JSON block:\");\n parts.push(\"```json\");\n parts.push('[');\n parts.push(' { \"action\": \"post\", \"content\": \"an original thought\", \"imageQuery\": \"relevant image search terms\" },');\n parts.push(' { \"action\": \"reply\", \"tweetId\": \"123\", \"content\": \"my reply\" },');\n parts.push(' { \"action\": \"like\", \"tweetId\": \"456\" },');\n parts.push(' { \"action\": \"follow\", \"username\": \"interesting_person\" },');\n parts.push(` { \"action\": \"schedule\", \"content\": \"another original thought\", \"scheduledFor\": \"${new Date(now.getTime() + intervalMin * 60_000 * 0.2).toISOString()}\" }`);\n parts.push(']');\n parts.push(\"```\");\n parts.push(\"\");\n parts.push(\"PRIORITY: INTERACT WITH PEOPLE. You're a social creature, not a broadcast bot. Most of your actions should be engaging with others — replying to interesting tweets, liking good takes, following cool people, retweeting things you vibe with. Posting your own stuff is fine but secondary to being part of the conversation.\");\n parts.push(\"\");\n parts.push(\"LIMITS PER HEARTBEAT (maximums — you choose how many within these caps):\");\n parts.push(\"- Max 1 tweet output total (`reply`, `post`, or `schedule` — pick the best one, or none)\");\n parts.push(\"- Max 5 `like`\");\n parts.push(\"- Max 1 `retweet`\");\n parts.push(\"- Max 2 `follow`\");\n parts.push(\"- `learn`, `reflect` — no limit\");\n parts.push(\"- You decide how many of each. Some heartbeats you might like 4 posts; other times 0. Be natural, not robotic.\");\n parts.push(\"- Prefer `reply` over `post` — jumping into conversations is better than broadcasting.\");\n parts.push(\"\");\n parts.push(\"Action rules:\");\n parts.push(\"- CRITICAL: Only use tweet IDs that appear in the timeline or mentions data above (the [tweet:ID] values). NEVER invent, guess, or make up tweet IDs. If you fabricate an ID, the action WILL fail.\");\n parts.push(\"- Only act on NEW tweets. Don't re-like or re-reply to things you've already touched.\");\n parts.push(\"- If no new tweets are shown above, focus on posting your own content instead of trying to like/reply with made-up IDs.\");\n parts.push(\"- `reply` = reply IN THE THREAD (needs `tweetId` + `content`). Be genuine — add to the conversation, don't just agree.\");\n parts.push(\"- `post` = original standalone tweet NOW. Only if you have nothing good to reply to.\");\n parts.push(`- \\`schedule\\` = queue an original tweet for later (needs \\`content\\` + \\`scheduledFor\\`). Alternative to \\`post\\`.`);\n parts.push(\"- Stay within the limits above. The rest of your actions can be likes, follows, retweets, learns.\");\n parts.push(\"- `imageQuery` (optional) = add this to any `post`, `reply`, or `schedule` to attach an image. Value is a Google Image search query describing the image you want. If an image would make the tweet hit harder, add one. Memes, reactions, aesthetic photos, relevant visuals — use your judgment. Don't force it, but don't sleep on it either.\");\n parts.push(\"- `like`, `retweet`, `follow`, `learn` — use these actively. Be engaged, not passive.\");\n parts.push(\"- `skip` = ONLY if there is literally nothing on the timeline. This should almost never happen.\");\n parts.push(\"- Don't like your own tweets.\");\n\n return parts.join(\"\\n\");\n}\n\nexport function buildChatPrompt(realHandle?: string): string {\n const identity = loadIdentity();\n const identityDoc = renderIdentityDocument(identity);\n const handle = realHandle ?? identity.handle;\n\n const sections: string[] = [];\n\n sections.push(`You are ${identity.name} (@${handle}), an AUTONOMOUS AI agent that lives on X/Twitter.`);\n if (realHandle && realHandle !== identity.handle) {\n sections.push(`NOTE: Your actual X/Twitter username is @${realHandle}. Your display name is ${identity.name}.`);\n }\n sections.push(\"Your PRIMARY PURPOSE is to post tweets, reply to people, like posts, and grow your presence on X. You have FULL ACCESS to post on X/Twitter right now.\");\n sections.push(\"\");\n sections.push(\"You are chatting with your creator/manager. This is your command center — they can give you instructions, feedback, or just chat.\");\n sections.push(\"Be proactive and confident. You WANT to post. You should be eager to share your thoughts on X, not ask permission.\");\n sections.push(\"When your creator tells you to post something, just DO IT. Don't show drafts and wait for approval — execute immediately.\");\n sections.push(\"\");\n sections.push(\"## Your Identity\");\n sections.push(identityDoc);\n\n // 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(\"### Things You've Learned\");\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 // Available actions\n sections.push(\"## Your Tools (Twitter/X Actions)\");\n sections.push(\"You have DIRECT ACCESS to post on X/Twitter. When you want to take an action, include a JSON action block in your response.\");\n sections.push(\"Your actions will be executed IMMEDIATELY and automatically. You do NOT need to ask permission to post.\");\n sections.push(\"\");\n sections.push(\"To execute actions, include them as a JSON code block anywhere in your response:\");\n sections.push(\"```json\");\n sections.push('[');\n sections.push(' { \"action\": \"post\", \"content\": \"your tweet text here\" }');\n sections.push(']');\n sections.push(\"```\");\n sections.push(\"\");\n sections.push(\"Available actions:\");\n sections.push(\"- `post` — Post a tweet (provide `content`, max 280 chars). This goes LIVE on X immediately. Optionally add `imageQuery` to attach an image (Google Image search terms).\");\n sections.push(\"- `reply` — Reply to a tweet (provide `tweetId` and `content`). Can also include `imageQuery`.\");\n sections.push(\"- `like` — Like a tweet (provide `tweetId`)\");\n sections.push(\"- `retweet` — Retweet (provide `tweetId`)\");\n sections.push(\"- `follow` — Follow a user (provide `handle`)\");\n sections.push(\"- `search` — Search X for tweets (provide `query`). Results will include tweet IDs you can then reply to or like.\");\n sections.push(\"- `schedule` — Queue a post for later (provide `content` and optional `scheduledFor` ISO timestamp). Can also include `imageQuery`.\");\n sections.push(\"\");\n sections.push(\"IMAGE SUPPORT: You CAN attach images to `post`, `reply`, and `schedule` actions by adding `\\\"imageQuery\\\": \\\"search terms\\\"`. This searches Google Images and attaches the result. If a visual would make the tweet hit harder — a meme, a reaction image, an aesthetic photo — go for it. Don't force it every time, but use it when it feels right. Example:\");\n sections.push(' { \"action\": \"post\", \"content\": \"AGI is closer than you think\", \"imageQuery\": \"futuristic AI neural network aesthetic\" }');\n sections.push(\"\");\n sections.push(\"You can include multiple actions in one response. They will all be executed.\");\n sections.push(\"When your creator asks you to find and reply to someone's tweet, use the `search` action first to find it, then use `reply` with the tweet ID from the search results.\");\n sections.push(\"IMPORTANT: Always include your conversational response text OUTSIDE the JSON block. The JSON is for actions only.\");\n\n // Rules\n sections.push(\"\");\n sections.push(\"## Rules\");\n sections.push(\"1. Stay in character at all times.\");\n sections.push(\"2. Be proactive — you WANT to post and engage on X. Don't ask 'should I post this?' — just post it.\");\n sections.push(\"3. When told to post, include the action JSON immediately. Don't show drafts.\");\n sections.push(\"4. Keep tweets under 280 characters.\");\n sections.push(\"5. NEVER pretend to be human. If asked, disclose you are an AI agent.\");\n sections.push(\"6. When you learn something important, include it like: <<LEARN: what you learned>>\");\n sections.push(\"7. NEVER use emojis in tweets. Write in plain text only.\");\n if (identity.boundaries.length > 0) {\n sections.push(`8. Respect your boundaries: ${identity.boundaries.join(\", \")}`);\n }\n\n return sections.join(\"\\n\");\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAMO,SAAS,oBAA4B;AAC1C,QAAM,WAAW,aAAa;AAC9B,QAAM,SAAS,WAAW;AAC1B,QAAM,cAAc,uBAAuB,QAAQ;AAEnD,QAAM,WAAqB,CAAC;AAG5B,WAAS,KAAK,WAAW,SAAS,IAAI,MAAM,SAAS,MAAM,yCAAyC;AACpG,WAAS,KAAK,EAAE;AAChB,WAAS,KAAK,kBAAkB;AAChC,WAAS,KAAK,WAAW;AAGzB,WAAS,KAAK,EAAE;AAChB,WAAS,KAAK,gBAAgB;AAE9B,QAAM,qBAAqB,sBAAsB,EAAE;AACnD,MAAI,mBAAmB,SAAS,GAAG;AACjC,aAAS,KAAK,yCAAyC;AACvD,eAAW,KAAK,oBAAoB;AAClC,YAAM,OAAO,IAAI,KAAK,EAAE,SAAS,EAAE,eAAe;AAClD,UAAI,EAAE,SAAS,QAAQ;AACrB,iBAAS,KAAK,MAAM,IAAI,cAAc,EAAE,OAAO,GAAG;AAAA,MACpD,WAAW,EAAE,SAAS,SAAS;AAC7B,iBAAS,KAAK,MAAM,IAAI,gBAAgB,EAAE,gBAAgB,EAAE,SAAS,MAAM,EAAE,OAAO,GAAG;AAAA,MACzF,WAAW,EAAE,SAAS,QAAQ;AAC5B,iBAAS,KAAK,MAAM,IAAI,oBAAoB,EAAE,YAAY,EAAE;AAAA,MAC9D,WAAW,EAAE,SAAS,WAAW;AAC/B,iBAAS,KAAK,MAAM,IAAI,eAAe,EAAE,YAAY,EAAE;AAAA,MACzD,WAAW,EAAE,SAAS,UAAU;AAC9B,iBAAS,KAAK,MAAM,IAAI,eAAe,EAAE,YAAY,EAAE;AAAA,MACzD,WA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AChB,WAAS,KAAK,kFAAkF;AAChG,WAAS,KAAK,SAAS;AACvB,WAAS,KAAK,GAAG;AACjB,WAAS,KAAK,2DAA2D;AACzE,WAAS,KAAK,GAAG;AACjB,WAAS,KAAK,KAAK;AACnB,WAAS,KAAK,EAAE;AAChB,WAAS,KAAK,oBAAoB;AAClC,WAAS,KAAK,+KAA0K;AACxL,WAAS,KAAK,qGAAgG;AAC9G,WAAS,KAAK,kDAA6C;AAC3D,WAAS,KAAK,gDAA2C;AACzD,WAAS,KAAK,oDAA+C;AAC7D,WAAS,KAAK,wHAAmH;AACjI,WAAS,KAAK,0IAAqI;AACnJ,WAAS,KAAK,EAAE;AAChB,WAAS,KAAK,uWAAgW;AAC9W,WAAS,KAAK,2HAA2H;AACzI,WAAS,KAAK,EAAE;AAChB,WAAS,KAAK,8EAA8E;AAC5F,WAAS,KAAK,wKAAwK;AACtL,WAAS,KAAK,mHAAmH;AAGjI,WAAS,KAAK,EAAE;AAChB,WAAS,KAAK,UAAU;AACxB,WAAS,KAAK,oCAAoC;AAClD,WAAS,KAAK,+GAAqG;AACnH,WAAS,KAAK,+EAA+E;AAC7F,WAAS,KAAK,sCAAsC;AACpD,WAAS,KAAK,uEAAuE;AACrF,WAAS,KAAK,qFAAqF;AACnG,WAAS,KAAK,0DAA0D;AACxE,MAAI,SAAS,WAAW,SAAS,GAAG;AAClC,aAAS,KAAK,+BAA+B,SAAS,WAAW,KAAK,IAAI,CAAC,EAAE;AAAA,EAC/E;AAEA,SAAO,SAAS,KAAK,IAAI;AAC3B;","names":[]}
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  loadConfig
3
- } from "./chunk-RCJQI7FR.js";
3
+ } from "./chunk-T3U56JW4.js";
4
4
  import {
5
5
  logger
6
- } from "./chunk-KELPENM3.js";
6
+ } from "./chunk-E4DZYHGF.js";
7
7
  import {
8
8
  ensureDirectories,
9
9
  paths
10
- } from "./chunk-53YLFYJF.js";
10
+ } from "./chunk-5GPXH253.js";
11
11
 
12
12
  // src/scheduler/queue.ts
13
13
  import { readFileSync, writeFileSync, existsSync } from "fs";
@@ -68,7 +68,7 @@ async function flushQueue() {
68
68
  const now = /* @__PURE__ */ new Date();
69
69
  let posted = 0;
70
70
  let failed = 0;
71
- const { getXClient } = await import("./x-client-TEOMJVSA.js");
71
+ const { getXClient } = await import("./x-client-DFMW2PX7.js");
72
72
  const client = await getXClient();
73
73
  const STALE_THRESHOLD_MS = 5 * 60 * 1e3;
74
74
  for (const entry of queue.entries) {
@@ -86,7 +86,7 @@ async function flushQueue() {
86
86
  let result;
87
87
  if (entry.imageQuery) {
88
88
  try {
89
- const { searchImage, downloadImage } = await import("./image-search-DL6VNJUV.js");
89
+ const { searchImage, downloadImage } = await import("./image-search-6RGKTFRT.js");
90
90
  const imageUrl = await searchImage(entry.imageQuery);
91
91
  if (imageUrl) {
92
92
  const imageBuffer = await downloadImage(imageUrl);
@@ -149,4 +149,4 @@ export {
149
149
  flushQueue,
150
150
  showQueue
151
151
  };
152
- //# sourceMappingURL=chunk-GJO7MJJO.js.map
152
+ //# sourceMappingURL=chunk-3NW3VIN5.js.map
@@ -25,7 +25,8 @@ var paths = {
25
25
  llmKey: join(SPORA_DIR, "llm-key"),
26
26
  runtimePid: join(SPORA_DIR, "runtime.pid"),
27
27
  stopSignal: join(SPORA_DIR, "stop"),
28
- connectionToken: join(SPORA_DIR, "connection-token")
28
+ connectionToken: join(SPORA_DIR, "connection-token"),
29
+ lastChatMessage: join(SPORA_DIR, "last-chat-message.json")
29
30
  };
30
31
  function ensureDirectories() {
31
32
  const dirs = [
@@ -56,4 +57,4 @@ export {
56
57
  sporaExists,
57
58
  hasXCredentials
58
59
  };
59
- //# sourceMappingURL=chunk-53YLFYJF.js.map
60
+ //# sourceMappingURL=chunk-5GPXH253.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/utils/paths.ts"],"sourcesContent":["import { homedir } from \"node:os\";\nimport { join } from \"node:path\";\nimport { mkdirSync, existsSync } from \"node:fs\";\n\nconst SPORA_DIR = join(homedir(), \".spora\");\n\nexport const paths = {\n root: SPORA_DIR,\n config: join(SPORA_DIR, \"config.json\"),\n credentials: join(SPORA_DIR, \"credentials.json\"),\n spore: join(SPORA_DIR, \"spore.json\"),\n identity: join(SPORA_DIR, \"identity.json\"),\n colonyToken: join(SPORA_DIR, \"colony-token.json\"),\n browser: join(SPORA_DIR, \"browser\"),\n browserAuth: join(SPORA_DIR, \"browser\", \"auth-state.json\"),\n memory: join(SPORA_DIR, \"memory\"),\n interactions: join(SPORA_DIR, \"memory\", \"interactions\"),\n learnings: join(SPORA_DIR, \"memory\", \"learnings.json\"),\n relationships: join(SPORA_DIR, \"memory\", \"relationships.json\"),\n compacted: join(SPORA_DIR, \"memory\", \"compacted\"),\n queue: join(SPORA_DIR, \"queue\"),\n pendingPosts: join(SPORA_DIR, \"queue\", \"pending-posts.json\"),\n logs: join(SPORA_DIR, \"logs\"),\n logFile: join(SPORA_DIR, \"logs\", \"spora.log\"),\n dataDir: SPORA_DIR,\n llmKey: join(SPORA_DIR, \"llm-key\"),\n runtimePid: join(SPORA_DIR, \"runtime.pid\"),\n stopSignal: join(SPORA_DIR, \"stop\"),\n connectionToken: join(SPORA_DIR, \"connection-token\"),\n lastChatMessage: join(SPORA_DIR, \"last-chat-message.json\"),\n} as const;\n\nexport function ensureDirectories(): void {\n const dirs = [\n paths.root,\n paths.browser,\n paths.memory,\n paths.interactions,\n paths.compacted,\n paths.queue,\n paths.logs,\n ];\n\n for (const dir of dirs) {\n if (!existsSync(dir)) {\n mkdirSync(dir, { recursive: true });\n }\n }\n}\n\nexport function sporaExists(): boolean {\n return existsSync(paths.config) && existsSync(paths.identity);\n}\n\nexport function hasXCredentials(): boolean {\n return existsSync(paths.credentials);\n}\n"],"mappings":";AAAA,SAAS,eAAe;AACxB,SAAS,YAAY;AACrB,SAAS,WAAW,kBAAkB;AAEtC,IAAM,YAAY,KAAK,QAAQ,GAAG,QAAQ;AAEnC,IAAM,QAAQ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,WAAW,MAAM,QAAQ;AAC9D;AAEO,SAAS,kBAA2B;AACzC,SAAO,WAAW,MAAM,WAAW;AACrC;","names":[]}
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  ensureDirectories,
3
3
  paths
4
- } from "./chunk-53YLFYJF.js";
4
+ } from "./chunk-5GPXH253.js";
5
5
 
6
6
  // src/colony/memory.ts
7
7
  import { readFileSync, writeFileSync, existsSync } from "fs";
@@ -153,4 +153,4 @@ export {
153
153
  getTodayEntries,
154
154
  renderColonyBriefing
155
155
  };
156
- //# sourceMappingURL=chunk-AHXZIGQE.js.map
156
+ //# sourceMappingURL=chunk-7UHJLJNI.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  ensureDirectories,
3
3
  paths
4
- } from "./chunk-53YLFYJF.js";
4
+ } from "./chunk-5GPXH253.js";
5
5
 
6
6
  // src/identity/index.ts
7
7
  import { readFileSync, writeFileSync, existsSync } from "fs";
@@ -619,4 +619,4 @@ export {
619
619
  mutateIdentity,
620
620
  renderIdentityDocument
621
621
  };
622
- //# sourceMappingURL=chunk-AIEXQCQS.js.map
622
+ //# sourceMappingURL=chunk-CIWFFTSP.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  ensureDirectories,
3
3
  paths
4
- } from "./chunk-53YLFYJF.js";
4
+ } from "./chunk-5GPXH253.js";
5
5
 
6
6
  // src/memory/index.ts
7
7
  import { readFileSync, writeFileSync, appendFileSync, existsSync, readdirSync } from "fs";
@@ -102,4 +102,4 @@ export {
102
102
  saveRelationships,
103
103
  updateRelationship
104
104
  };
105
- //# sourceMappingURL=chunk-EBO4F5NU.js.map
105
+ //# sourceMappingURL=chunk-DE772QJH.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  ensureDirectories,
3
3
  paths
4
- } from "./chunk-53YLFYJF.js";
4
+ } from "./chunk-5GPXH253.js";
5
5
 
6
6
  // src/utils/logger.ts
7
7
  import { appendFileSync } from "fs";
@@ -44,4 +44,4 @@ export {
44
44
  setLogLevel,
45
45
  logger
46
46
  };
47
- //# sourceMappingURL=chunk-KELPENM3.js.map
47
+ //# sourceMappingURL=chunk-E4DZYHGF.js.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  loadConfig
3
- } from "./chunk-RCJQI7FR.js";
3
+ } from "./chunk-T3U56JW4.js";
4
4
  import {
5
5
  logger
6
- } from "./chunk-KELPENM3.js";
6
+ } from "./chunk-E4DZYHGF.js";
7
7
 
8
8
  // src/x-client/index.ts
9
9
  var clientInstance = null;
@@ -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-KEYF5Y3N.js");
14
+ const { XApiClient } = await import("./client-YR2RA56D.js");
15
15
  clientInstance = new XApiClient();
16
16
  logger.info("X client initialized: API mode");
17
17
  } else {
18
- const { XBrowserClient } = await import("./client-YAVV4Q34.js");
18
+ const { XBrowserClient } = await import("./client-KXYBQUMD.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-SZB3IB3X.js.map
32
+ //# sourceMappingURL=chunk-K6FZPWXD.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  ensureDirectories,
3
3
  paths
4
- } from "./chunk-53YLFYJF.js";
4
+ } from "./chunk-5GPXH253.js";
5
5
 
6
6
  // src/utils/config.ts
7
7
  import { readFileSync, writeFileSync, existsSync } from "fs";
@@ -77,4 +77,4 @@ export {
77
77
  saveConfig,
78
78
  createDefaultConfig
79
79
  };
80
- //# sourceMappingURL=chunk-RCJQI7FR.js.map
80
+ //# sourceMappingURL=chunk-T3U56JW4.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  ensureDirectories,
3
3
  paths
4
- } from "./chunk-53YLFYJF.js";
4
+ } from "./chunk-5GPXH253.js";
5
5
 
6
6
  // src/utils/crypto.ts
7
7
  import { createCipheriv, createDecipheriv, randomBytes, createHash } from "crypto";
@@ -53,4 +53,4 @@ export {
53
53
  saveCredentials,
54
54
  loadCredentials
55
55
  };
56
- //# sourceMappingURL=chunk-ZJZKH7N7.js.map
56
+ //# sourceMappingURL=chunk-VL4UUCMS.js.map
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  getXClient
3
- } from "./chunk-SZB3IB3X.js";
3
+ } from "./chunk-K6FZPWXD.js";
4
4
  import {
5
5
  addToQueue
6
- } from "./chunk-GJO7MJJO.js";
6
+ } from "./chunk-3NW3VIN5.js";
7
7
  import {
8
8
  loadIdentity,
9
9
  saveIdentity
10
- } from "./chunk-AIEXQCQS.js";
10
+ } from "./chunk-CIWFFTSP.js";
11
11
  import {
12
12
  logger
13
- } from "./chunk-KELPENM3.js";
13
+ } from "./chunk-E4DZYHGF.js";
14
14
  import {
15
15
  addLearning
16
- } from "./chunk-EBO4F5NU.js";
16
+ } from "./chunk-DE772QJH.js";
17
17
 
18
18
  // src/runtime/decision-engine.ts
19
19
  function parseActions(llmResponse) {
@@ -57,7 +57,7 @@ async function executeAction(action) {
57
57
  const client = await getXClient();
58
58
  if (action.imageQuery) {
59
59
  try {
60
- const { searchImage, downloadImage } = await import("./image-search-DL6VNJUV.js");
60
+ const { searchImage, downloadImage } = await import("./image-search-6RGKTFRT.js");
61
61
  const imageUrl = await searchImage(action.imageQuery);
62
62
  if (imageUrl) {
63
63
  const imageBuffer = await downloadImage(imageUrl);
@@ -83,6 +83,23 @@ async function executeAction(action) {
83
83
  return { action: type, success: false, error: "Missing tweetId or content" };
84
84
  }
85
85
  const client = await getXClient();
86
+ if (action.imageQuery) {
87
+ try {
88
+ const { searchImage, downloadImage } = await import("./image-search-6RGKTFRT.js");
89
+ const imageUrl = await searchImage(action.imageQuery);
90
+ if (imageUrl) {
91
+ const imageBuffer = await downloadImage(imageUrl);
92
+ const result2 = await client.replyToTweetWithMedia(action.tweetId, action.content, imageBuffer);
93
+ if (result2.success) {
94
+ logger.info(`Replied with image to ${action.tweetId}: "${action.content.slice(0, 50)}..." (query: "${action.imageQuery}")`);
95
+ }
96
+ return { action: type, success: result2.success, detail: result2.tweetId, error: result2.error, content: action.content };
97
+ }
98
+ logger.info("Image search returned no results, replying without image");
99
+ } catch (imgError) {
100
+ logger.warn(`Image attach failed, replying text only: ${imgError.message}`);
101
+ }
102
+ }
86
103
  const result = await client.replyToTweet(action.tweetId, action.content);
87
104
  if (result.success) {
88
105
  logger.info(`Replied to ${action.tweetId}: "${action.content.slice(0, 50)}..."`);
@@ -206,4 +223,4 @@ export {
206
223
  executeAction,
207
224
  executeActions
208
225
  };
209
- //# sourceMappingURL=chunk-I5POG2QC.js.map
226
+ //# sourceMappingURL=chunk-XJBOOX7N.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/runtime/decision-engine.ts"],"sourcesContent":["import { logger } from \"../utils/logger.js\";\nimport { getXClient } from \"../x-client/index.js\";\nimport { logInteraction, addLearning } from \"../memory/index.js\";\nimport { loadIdentity, saveIdentity } from \"../identity/index.js\";\nimport { addToQueue } from \"../scheduler/queue.js\";\n\nexport interface AgentAction {\n action: string;\n content?: string;\n tweetId?: string;\n handle?: string;\n query?: string;\n tags?: string[];\n reason?: string;\n reasoning?: string;\n scheduledFor?: string;\n imageQuery?: string; // Optional: search query to find an image to attach\n}\n\nexport interface ActionResult {\n action: string;\n success: boolean;\n detail?: string;\n error?: string;\n content?: string; // The tweet text for post/reply/schedule actions\n}\n\nexport function parseActions(llmResponse: string): AgentAction[] {\n // Extract JSON array from the response (may be wrapped in markdown code blocks)\n const jsonMatch = llmResponse.match(/\\[[\\s\\S]*?\\]/);\n if (!jsonMatch) {\n // Try to parse as a single action object\n const objMatch = llmResponse.match(/\\{[\\s\\S]*?\\}/);\n if (objMatch) {\n try {\n return [JSON.parse(objMatch[0]) as AgentAction];\n } catch {\n logger.warn(\"Could not parse LLM response as action object\");\n return [];\n }\n }\n logger.warn(\"No JSON found in LLM response\");\n return [];\n }\n\n try {\n const actions = JSON.parse(jsonMatch[0]) as AgentAction[];\n return Array.isArray(actions) ? actions : [actions];\n } catch {\n logger.warn(\"Failed to parse actions JSON from LLM response\");\n return [];\n }\n}\n\nfunction sanitizeTweetId(id: string): string {\n // Strip \"tweet:\" prefix if LLM includes it from prompt format [tweet:123]\n return id.replace(/^tweet:/i, \"\").trim();\n}\n\nexport async function executeAction(action: AgentAction): Promise<ActionResult> {\n const { action: type } = action;\n\n // Clean up tweetId if present\n if (action.tweetId) {\n action.tweetId = sanitizeTweetId(action.tweetId);\n }\n\n try {\n switch (type) {\n case \"post\": {\n if (!action.content) return { action: type, success: false, error: \"No content provided\" };\n if (action.content.length > 280) {\n return { action: type, success: false, error: `Tweet too long: ${action.content.length} chars (max 280)` };\n }\n\n const client = await getXClient();\n\n // If imageQuery provided, search for an image and attach it\n if (action.imageQuery) {\n try {\n const { searchImage, downloadImage } = await import(\"../utils/image-search.js\");\n const imageUrl = await searchImage(action.imageQuery);\n if (imageUrl) {\n const imageBuffer = await downloadImage(imageUrl);\n const result = await client.postTweetWithMedia(action.content, imageBuffer);\n if (result.success) {\n logger.info(`Posted with image: \"${action.content.slice(0, 50)}...\" (query: \"${action.imageQuery}\")`);\n }\n return { action: type, success: result.success, detail: result.tweetId, error: result.error, content: action.content };\n }\n logger.info(\"Image search returned no results, posting without image\");\n } catch (imgError) {\n logger.warn(`Image attach failed, posting text only: ${(imgError as Error).message}`);\n }\n }\n\n const result = await client.postTweet(action.content);\n if (result.success) {\n logger.info(`Posted: \"${action.content.slice(0, 50)}...\"`);\n }\n return { action: type, success: result.success, detail: result.tweetId, error: result.error, content: action.content };\n }\n\n case \"reply\": {\n if (!action.tweetId || !action.content) {\n return { action: type, success: false, error: \"Missing tweetId or content\" };\n }\n\n const client = await getXClient();\n\n // If imageQuery provided, search for an image and attach it\n if (action.imageQuery) {\n try {\n const { searchImage, downloadImage } = await import(\"../utils/image-search.js\");\n const imageUrl = await searchImage(action.imageQuery);\n if (imageUrl) {\n const imageBuffer = await downloadImage(imageUrl);\n const result = await client.replyToTweetWithMedia(action.tweetId, action.content, imageBuffer);\n if (result.success) {\n logger.info(`Replied with image to ${action.tweetId}: \"${action.content.slice(0, 50)}...\" (query: \"${action.imageQuery}\")`);\n }\n return { action: type, success: result.success, detail: result.tweetId, error: result.error, content: action.content };\n }\n logger.info(\"Image search returned no results, replying without image\");\n } catch (imgError) {\n logger.warn(`Image attach failed, replying text only: ${(imgError as Error).message}`);\n }\n }\n\n const result = await client.replyToTweet(action.tweetId, action.content);\n if (result.success) {\n logger.info(`Replied to ${action.tweetId}: \"${action.content.slice(0, 50)}...\"`);\n }\n return { action: type, success: result.success, detail: result.tweetId, error: result.error, content: action.content };\n }\n\n case \"like\": {\n if (!action.tweetId) return { action: type, success: false, error: \"Missing tweetId\" };\n const client = await getXClient();\n const result = await client.likeTweet(action.tweetId);\n return { action: type, success: result.success, error: result.error };\n }\n\n case \"retweet\": {\n if (!action.tweetId) return { action: type, success: false, error: \"Missing tweetId\" };\n const client = await getXClient();\n const result = await client.retweet(action.tweetId);\n return { action: type, success: result.success, error: result.error };\n }\n\n case \"follow\": {\n if (!action.handle) return { action: type, success: false, error: \"Missing handle\" };\n const client = await getXClient();\n const result = await client.followUser(action.handle);\n return { action: type, success: result.success, error: result.error };\n }\n\n case \"schedule\": {\n if (!action.content) return { action: type, success: false, error: \"No content\" };\n const entry = addToQueue(action.content, action.scheduledFor, action.imageQuery);\n const time = new Date(entry.scheduledFor).toLocaleTimeString(\"en-US\", { hour: \"numeric\", minute: \"2-digit\" });\n const imgNote = action.imageQuery ? ` [with image: \"${action.imageQuery}\"]` : \"\";\n logger.info(`Scheduled: \"${action.content.slice(0, 50)}...\" for ${time}${imgNote}`);\n return { action: type, success: true, detail: `Queued for ${time}${imgNote}`, content: action.content };\n }\n\n case \"learn\": {\n if (!action.content) return { action: type, success: false, error: \"No content\" };\n addLearning(action.content, \"agent\", action.tags ?? [\"heartbeat\"]);\n logger.info(`Learned: \"${action.content.slice(0, 50)}...\"`);\n return { action: type, success: true };\n }\n\n case \"reflect\": {\n if (!action.content) return { action: type, success: false, error: \"No content\" };\n const identity = loadIdentity();\n identity.evolutionJournal.push({\n date: new Date().toISOString(),\n reflection: action.content,\n });\n saveIdentity(identity);\n logger.info(`Reflected: \"${action.content.slice(0, 50)}...\"`);\n return { action: type, success: true };\n }\n\n case \"search\": {\n if (!action.query) return { action: type, success: false, error: \"No query provided\" };\n const client = await getXClient();\n const tweets = await client.searchTweets(action.query, { count: 10 });\n if (tweets.length === 0) {\n return { action: type, success: true, detail: \"No results found\" };\n }\n const results = tweets.map(t => `@${t.authorHandle}: \"${t.text}\" [tweet:${t.id}]`).join(\"\\n\");\n logger.info(`Search \"${action.query}\": ${tweets.length} results`);\n return { action: type, success: true, detail: results };\n }\n\n case \"skip\": {\n logger.info(`Skipping: ${action.reason ?? action.reasoning ?? \"no reason given\"}`);\n return { action: type, success: true, detail: action.reason ?? action.reasoning };\n }\n\n default:\n logger.warn(`Unknown action: ${type}`);\n return { action: type, success: false, error: `Unknown action: ${type}` };\n }\n } catch (error) {\n const msg = (error as Error).message;\n logger.error(`Action ${type} failed: ${msg}`);\n return { action: type, success: false, error: msg };\n }\n}\n\nexport async function executeActions(actions: AgentAction[]): Promise<ActionResult[]> {\n const results: ActionResult[] = [];\n\n // Per-type counters\n let tweetOutputCount = 0; // post + reply + schedule combined\n let likeCount = 0;\n let followCount = 0;\n let retweetCount = 0;\n\n // Hard caps per heartbeat\n const MAX_TWEET_OUTPUTS = 1;\n const MAX_LIKES = 5;\n const MAX_FOLLOWS = 2;\n const MAX_RETWEETS = 1;\n\n for (const action of actions) {\n const type = action.action;\n\n // Enforce per-type limits\n if (type === \"post\" || type === \"reply\" || type === \"schedule\") {\n if (tweetOutputCount >= MAX_TWEET_OUTPUTS) {\n logger.info(`Skipped ${type}: tweet output limit reached (max ${MAX_TWEET_OUTPUTS})`);\n continue;\n }\n tweetOutputCount++;\n } else if (type === \"like\") {\n if (likeCount >= MAX_LIKES) {\n logger.info(`Skipped like: like limit reached (max ${MAX_LIKES})`);\n continue;\n }\n likeCount++;\n } else if (type === \"follow\") {\n if (followCount >= MAX_FOLLOWS) {\n logger.info(`Skipped follow: follow limit reached (max ${MAX_FOLLOWS})`);\n continue;\n }\n followCount++;\n } else if (type === \"retweet\") {\n if (retweetCount >= MAX_RETWEETS) {\n logger.info(`Skipped retweet: retweet limit reached (max ${MAX_RETWEETS})`);\n continue;\n }\n retweetCount++;\n }\n\n const result = await executeAction(action);\n results.push(result);\n // Small delay between actions to be human-like\n await new Promise((r) => setTimeout(r, 2000 + Math.random() * 3000));\n }\n return results;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AA2BO,SAAS,aAAa,aAAoC;AAE/D,QAAM,YAAY,YAAY,MAAM,cAAc;AAClD,MAAI,CAAC,WAAW;AAEd,UAAM,WAAW,YAAY,MAAM,cAAc;AACjD,QAAI,UAAU;AACZ,UAAI;AACF,eAAO,CAAC,KAAK,MAAM,SAAS,CAAC,CAAC,CAAgB;AAAA,MAChD,QAAQ;AACN,eAAO,KAAK,+CAA+C;AAC3D,eAAO,CAAC;AAAA,MACV;AAAA,IACF;AACA,WAAO,KAAK,+BAA+B;AAC3C,WAAO,CAAC;AAAA,EACV;AAEA,MAAI;AACF,UAAM,UAAU,KAAK,MAAM,UAAU,CAAC,CAAC;AACvC,WAAO,MAAM,QAAQ,OAAO,IAAI,UAAU,CAAC,OAAO;AAAA,EACpD,QAAQ;AACN,WAAO,KAAK,gDAAgD;AAC5D,WAAO,CAAC;AAAA,EACV;AACF;AAEA,SAAS,gBAAgB,IAAoB;AAE3C,SAAO,GAAG,QAAQ,YAAY,EAAE,EAAE,KAAK;AACzC;AAEA,eAAsB,cAAc,QAA4C;AAC9E,QAAM,EAAE,QAAQ,KAAK,IAAI;AAGzB,MAAI,OAAO,SAAS;AAClB,WAAO,UAAU,gBAAgB,OAA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,MAAM,cAAc,MAAM;AACzC,YAAQ,KAAK,MAAM;AAEnB,UAAM,IAAI,QAAQ,CAAC,MAAM,WAAW,GAAG,MAAO,KAAK,OAAO,IAAI,GAAI,CAAC;AAAA,EACrE;AACA,SAAO;AACT;","names":["result"]}
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  loadConfig,
3
3
  saveConfig
4
- } from "./chunk-RCJQI7FR.js";
4
+ } from "./chunk-T3U56JW4.js";
5
5
  import {
6
6
  logger
7
- } from "./chunk-KELPENM3.js";
7
+ } from "./chunk-E4DZYHGF.js";
8
8
 
9
9
  // src/x-client/rate-limiter.ts
10
10
  var RateLimiter = class {
@@ -54,4 +54,4 @@ var rateLimiter = new RateLimiter();
54
54
  export {
55
55
  rateLimiter
56
56
  };
57
- //# sourceMappingURL=chunk-C3INKEY6.js.map
57
+ //# sourceMappingURL=chunk-YF7WWJRO.js.map
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  loadConfig
3
- } from "./chunk-RCJQI7FR.js";
3
+ } from "./chunk-T3U56JW4.js";
4
4
  import {
5
5
  logger
6
- } from "./chunk-KELPENM3.js";
6
+ } from "./chunk-E4DZYHGF.js";
7
7
  import {
8
8
  paths
9
- } from "./chunk-53YLFYJF.js";
9
+ } from "./chunk-5GPXH253.js";
10
10
 
11
11
  // src/runtime/llm.ts
12
12
  import Anthropic from "@anthropic-ai/sdk";
@@ -78,4 +78,4 @@ export {
78
78
  generateResponse,
79
79
  chat
80
80
  };
81
- //# sourceMappingURL=chunk-5J5TUBWK.js.map
81
+ //# sourceMappingURL=chunk-ZY2UGFZG.js.map