spora 0.2.13 → 0.2.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-TSKHCOCJ.js → chunk-DHT5ORFX.js} +1 -1
- package/dist/{chunk-IN2KCKTO.js → chunk-GBOY5OQ6.js} +2 -2
- package/dist/{chunk-VSVZU476.js → chunk-PQAAEOB7.js} +7 -6
- package/dist/chunk-PQAAEOB7.js.map +1 -0
- package/dist/{chunk-VTWZZNME.js → chunk-SJMQDGRN.js} +27 -14
- package/dist/chunk-SJMQDGRN.js.map +1 -0
- package/dist/cli.js +25 -25
- package/dist/cli.js.map +1 -1
- package/dist/{colony-JHR2B5OC.js → colony-4G3JMXXW.js} +2 -2
- package/dist/{decision-engine-JDAIVQH3.js → decision-engine-TEYVBE7F.js} +4 -4
- package/dist/{heartbeat-BU74IJO4.js → heartbeat-SQRFUVIJ.js} +9 -9
- package/dist/heartbeat-SQRFUVIJ.js.map +1 -0
- package/dist/{init-RY7VY2H2.js → init-FBDXTEZJ.js} +3 -3
- package/dist/{mcp-server-4YBCA4QH.js → mcp-server.js} +20 -20
- package/dist/{prompt-builder-VG7CUPU2.js → prompt-builder-D5PFEN4S.js} +2 -2
- package/dist/{queue-WMUESED4.js → queue-YEVE53NQ.js} +2 -2
- package/dist/web-chat/chat.html +115 -21
- package/dist/{web-chat-F5K6GQ67.js → web-chat-Z42YFXCH.js} +18 -14
- package/dist/web-chat-Z42YFXCH.js.map +1 -0
- package/dist/{x-client-7LK3F56M.js → x-client-YE6QFHEN.js} +2 -2
- package/package.json +1 -1
- package/dist/chat.html +0 -442
- package/dist/chunk-VSVZU476.js.map +0 -1
- package/dist/chunk-VTWZZNME.js.map +0 -1
- package/dist/heartbeat-BU74IJO4.js.map +0 -1
- package/dist/logo.png +0 -0
- package/dist/web-chat-F5K6GQ67.js.map +0 -1
- /package/dist/{chunk-TSKHCOCJ.js.map → chunk-DHT5ORFX.js.map} +0 -0
- /package/dist/{chunk-IN2KCKTO.js.map → chunk-GBOY5OQ6.js.map} +0 -0
- /package/dist/{colony-JHR2B5OC.js.map → colony-4G3JMXXW.js.map} +0 -0
- /package/dist/{decision-engine-JDAIVQH3.js.map → decision-engine-TEYVBE7F.js.map} +0 -0
- /package/dist/{init-RY7VY2H2.js.map → init-FBDXTEZJ.js.map} +0 -0
- /package/dist/{mcp-server-4YBCA4QH.js.map → mcp-server.js.map} +0 -0
- /package/dist/{prompt-builder-VG7CUPU2.js.map → prompt-builder-D5PFEN4S.js.map} +0 -0
- /package/dist/{queue-WMUESED4.js.map → queue-YEVE53NQ.js.map} +0 -0
- /package/dist/{x-client-7LK3F56M.js.map → x-client-YE6QFHEN.js.map} +0 -0
|
@@ -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-
|
|
70
|
+
const { getXClient } = await import("./x-client-YE6QFHEN.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-
|
|
124
|
+
//# sourceMappingURL=chunk-GBOY5OQ6.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getXClient
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-DHT5ORFX.js";
|
|
4
4
|
import {
|
|
5
5
|
addToQueue
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-GBOY5OQ6.js";
|
|
7
7
|
import {
|
|
8
8
|
rateLimiter
|
|
9
9
|
} from "./chunk-C3INKEY6.js";
|
|
@@ -147,9 +147,10 @@ async function executeAction(action) {
|
|
|
147
147
|
}
|
|
148
148
|
case "schedule": {
|
|
149
149
|
if (!action.content) return { action: type, success: false, error: "No content" };
|
|
150
|
-
const entry = addToQueue(action.content);
|
|
151
|
-
|
|
152
|
-
|
|
150
|
+
const entry = addToQueue(action.content, action.scheduledFor);
|
|
151
|
+
const time = new Date(entry.scheduledFor).toLocaleTimeString("en-US", { hour: "numeric", minute: "2-digit" });
|
|
152
|
+
logger.info(`Scheduled: "${action.content.slice(0, 50)}..." for ${time}`);
|
|
153
|
+
return { action: type, success: true, detail: `Queued for ${time}` };
|
|
153
154
|
}
|
|
154
155
|
case "learn": {
|
|
155
156
|
if (!action.content) return { action: type, success: false, error: "No content" };
|
|
@@ -197,4 +198,4 @@ export {
|
|
|
197
198
|
executeAction,
|
|
198
199
|
executeActions
|
|
199
200
|
};
|
|
200
|
-
//# sourceMappingURL=chunk-
|
|
201
|
+
//# sourceMappingURL=chunk-PQAAEOB7.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\";\nimport { rateLimiter } from \"../x-client/rate-limiter.js\";\n\nexport interface AgentAction {\n action: string;\n content?: string;\n tweetId?: string;\n handle?: string;\n tags?: string[];\n reason?: string;\n reasoning?: string;\n scheduledFor?: string;\n}\n\nexport interface ActionResult {\n action: string;\n success: boolean;\n detail?: string;\n error?: string;\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\nexport async function executeAction(action: AgentAction): Promise<ActionResult> {\n const { action: type } = action;\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 if (!rateLimiter.canPost()) {\n return { action: type, success: false, error: \"No credits remaining this month\" };\n }\n\n const client = await getXClient();\n const result = await client.postTweet(action.content);\n if (result.success) {\n rateLimiter.consume(1);\n logInteraction({\n id: `int-${Date.now()}`,\n timestamp: new Date().toISOString(),\n type: \"post\",\n tweetId: result.tweetId,\n content: action.content,\n creditsUsed: 1,\n success: true,\n });\n logger.info(`Posted: \"${action.content.slice(0, 50)}...\"`);\n }\n return { action: type, success: result.success, detail: result.tweetId, error: result.error };\n }\n\n case \"reply\": {\n if (!action.tweetId || !action.content) {\n return { action: type, success: false, error: \"Missing tweetId or content\" };\n }\n if (!rateLimiter.canPost()) {\n return { action: type, success: false, error: \"No credits remaining\" };\n }\n\n const client = await getXClient();\n const result = await client.replyToTweet(action.tweetId, action.content);\n if (result.success) {\n rateLimiter.consume(1);\n logInteraction({\n id: `int-${Date.now()}`,\n timestamp: new Date().toISOString(),\n type: \"reply\",\n tweetId: result.tweetId,\n inReplyTo: action.tweetId,\n content: action.content,\n creditsUsed: 1,\n success: true,\n });\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 };\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 if (result.success) {\n logInteraction({\n id: `int-${Date.now()}`,\n timestamp: new Date().toISOString(),\n type: \"like\",\n tweetId: action.tweetId,\n creditsUsed: 0,\n success: true,\n });\n }\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 if (result.success) {\n logInteraction({\n id: `int-${Date.now()}`,\n timestamp: new Date().toISOString(),\n type: \"retweet\",\n tweetId: action.tweetId,\n creditsUsed: 0,\n success: true,\n });\n }\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 if (result.success) {\n logInteraction({\n id: `int-${Date.now()}`,\n timestamp: new Date().toISOString(),\n type: \"follow\",\n targetHandle: action.handle,\n creditsUsed: 0,\n success: true,\n });\n }\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);\n const time = new Date(entry.scheduledFor).toLocaleTimeString(\"en-US\", { hour: \"numeric\", minute: \"2-digit\" });\n logger.info(`Scheduled: \"${action.content.slice(0, 50)}...\" for ${time}`);\n return { action: type, success: true, detail: `Queued for ${time}` };\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 \"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 for (const action of actions) {\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":";;;;;;;;;;;;;;;;;;;;;;AAyBO,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,eAAsB,cAAc,QAA4C;AAC9E,QAAM,EAAE,QAAQ,KAAK,IAAI;AAEzB,MAAI;AACF,YAAQ,MAAM;AAAA,MACZ,KAAK,QAAQ;AACX,YAAI,CAAC,OAAO,QAAS,QAAO,EAAE,QAAQ,MAAM,SAAS,OAAO,OAAO,sBAAsB;AACzF,YAAI,OAAO,QAAQ,SAAS,KAAK;AAC/B,iBAAO,EAAE,QAAQ,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buildHeartbeatUserMessage(timeline, mentions) {
|
|
94
|
+
function buildHeartbeatUserMessage(timeline, mentions, heartbeatIntervalMs) {
|
|
95
95
|
const parts = [];
|
|
96
|
+
const intervalMin = Math.round((heartbeatIntervalMs ?? 6e4) / 6e4);
|
|
97
|
+
const now = /* @__PURE__ */ new Date();
|
|
96
98
|
parts.push("It's time for your heartbeat cycle. Here's what's happening on your timeline:");
|
|
97
99
|
parts.push("");
|
|
98
100
|
if (mentions.length > 0) {
|
|
@@ -111,15 +113,17 @@ function buildHeartbeatUserMessage(timeline, mentions) {
|
|
|
111
113
|
}
|
|
112
114
|
parts.push("## Your Task");
|
|
113
115
|
parts.push("Based on your identity, goals, and what you see above, decide what actions to take.");
|
|
114
|
-
parts.push("
|
|
116
|
+
parts.push("Do immediate actions (reply to mentions, like posts) AND schedule tweets to post between now and your next heartbeat.");
|
|
117
|
+
parts.push(`Your next heartbeat is in ~${intervalMin} minutes. Current time: ${now.toISOString()}`);
|
|
118
|
+
parts.push("Schedule 3-5 tweets spaced randomly across that window so your feed stays active while you sleep.");
|
|
115
119
|
parts.push("");
|
|
116
120
|
parts.push("Available actions:");
|
|
117
|
-
parts.push("- `post` \u2014 Write an original tweet (provide `content`, max 280 chars)");
|
|
121
|
+
parts.push("- `post` \u2014 Write an original tweet NOW (provide `content`, max 280 chars)");
|
|
118
122
|
parts.push("- `reply` \u2014 Reply to a tweet (provide `tweetId` and `content`)");
|
|
119
123
|
parts.push("- `like` \u2014 Like a tweet (provide `tweetId`)");
|
|
120
124
|
parts.push("- `retweet` \u2014 Retweet (provide `tweetId`)");
|
|
121
125
|
parts.push("- `follow` \u2014 Follow a user (provide `handle`)");
|
|
122
|
-
parts.push("- `schedule` \u2014 Queue a
|
|
126
|
+
parts.push("- `schedule` \u2014 Queue a tweet for later (provide `content` and `scheduledFor` ISO timestamp)");
|
|
123
127
|
parts.push("- `learn` \u2014 Record a learning/observation (provide `content` and optional `tags`)");
|
|
124
128
|
parts.push("- `reflect` \u2014 Add a journal entry about your growth (provide `content`)");
|
|
125
129
|
parts.push("- `skip` \u2014 Do nothing this heartbeat (provide `reason`)");
|
|
@@ -127,16 +131,20 @@ function buildHeartbeatUserMessage(timeline, mentions) {
|
|
|
127
131
|
parts.push("Respond with a JSON array of actions:");
|
|
128
132
|
parts.push("```json");
|
|
129
133
|
parts.push("[");
|
|
130
|
-
parts.push(' { "action": "
|
|
131
|
-
parts.push(' { "action": "like", "tweetId": "
|
|
134
|
+
parts.push(' { "action": "reply", "tweetId": "123", "content": "my reply", "reasoning": "why" },');
|
|
135
|
+
parts.push(' { "action": "like", "tweetId": "456", "reasoning": "why" },');
|
|
136
|
+
parts.push(` { "action": "schedule", "content": "tweet for later", "scheduledFor": "${new Date(now.getTime() + intervalMin * 6e4 * 0.3).toISOString()}", "reasoning": "why" },`);
|
|
137
|
+
parts.push(` { "action": "schedule", "content": "another later tweet", "scheduledFor": "${new Date(now.getTime() + intervalMin * 6e4 * 0.7).toISOString()}", "reasoning": "why" }`);
|
|
132
138
|
parts.push("]");
|
|
133
139
|
parts.push("```");
|
|
134
140
|
parts.push("");
|
|
135
141
|
parts.push("Think carefully about what serves your goals. Be authentic to your personality.");
|
|
136
142
|
return parts.join("\n");
|
|
137
143
|
}
|
|
138
|
-
function buildNarratedHeartbeatMessage(timeline, mentions) {
|
|
144
|
+
function buildNarratedHeartbeatMessage(timeline, mentions, heartbeatIntervalMs) {
|
|
139
145
|
const parts = [];
|
|
146
|
+
const intervalMin = Math.round((heartbeatIntervalMs ?? 6e4) / 6e4);
|
|
147
|
+
const now = /* @__PURE__ */ new Date();
|
|
140
148
|
parts.push("It's time for your heartbeat \u2014 you're waking up to check on things and interact with X/Twitter.");
|
|
141
149
|
parts.push("IMPORTANT: Narrate your thought process as you go. Your creator is watching in the chat and wants to see what you're thinking.");
|
|
142
150
|
parts.push("");
|
|
@@ -160,19 +168,24 @@ function buildNarratedHeartbeatMessage(timeline, mentions) {
|
|
|
160
168
|
parts.push("## Your Task");
|
|
161
169
|
parts.push("1. First, write a SHORT narration for your creator about what you see and what you plan to do (2-3 sentences max).");
|
|
162
170
|
parts.push("2. Then include your actions as a JSON block.");
|
|
163
|
-
parts.push("3.
|
|
171
|
+
parts.push("3. Do immediate actions (reply to mentions, like posts) AND schedule tweets to post between now and your next heartbeat.");
|
|
172
|
+
parts.push(`4. Your next heartbeat is in ~${intervalMin} minutes. Schedule 3-5 tweets spaced randomly across that window so your feed stays active while you sleep.`);
|
|
173
|
+
parts.push(`5. The current time is ${now.toISOString()}. Use the \`scheduledFor\` field with ISO timestamps to space out scheduled posts.`);
|
|
164
174
|
parts.push("");
|
|
165
175
|
parts.push("Example response format:");
|
|
166
|
-
parts.push("Waking up! I see @someone mentioned me about AI \u2014 gotta reply to that. Also
|
|
176
|
+
parts.push("Waking up! I see @someone mentioned me about AI \u2014 gotta reply to that. Also scheduling a few tweets to keep my feed active until my next check-in.");
|
|
167
177
|
parts.push("```json");
|
|
168
178
|
parts.push("[");
|
|
169
179
|
parts.push(' { "action": "reply", "tweetId": "123", "content": "my reply here" },');
|
|
170
|
-
parts.push(' { "action": "
|
|
171
|
-
parts.push(
|
|
180
|
+
parts.push(' { "action": "like", "tweetId": "456" },');
|
|
181
|
+
parts.push(` { "action": "schedule", "content": "tweet 1 goes out soon", "scheduledFor": "${new Date(now.getTime() + intervalMin * 6e4 * 0.2).toISOString()}" },`);
|
|
182
|
+
parts.push(` { "action": "schedule", "content": "tweet 2 mid-window", "scheduledFor": "${new Date(now.getTime() + intervalMin * 6e4 * 0.5).toISOString()}" },`);
|
|
183
|
+
parts.push(` { "action": "schedule", "content": "tweet 3 near end", "scheduledFor": "${new Date(now.getTime() + intervalMin * 6e4 * 0.8).toISOString()}" }`);
|
|
172
184
|
parts.push("]");
|
|
173
185
|
parts.push("```");
|
|
174
186
|
parts.push("");
|
|
175
|
-
parts.push("Available actions: post, reply, like, retweet, follow, schedule, learn, skip");
|
|
187
|
+
parts.push("Available actions: post (instant), reply, like, retweet, follow, schedule (with scheduledFor), learn, skip");
|
|
188
|
+
parts.push("Use `post` for things you want live NOW. Use `schedule` with `scheduledFor` timestamps to spread content across the window until your next heartbeat.");
|
|
176
189
|
parts.push("Be authentic. Be you. Do what feels right.");
|
|
177
190
|
return parts.join("\n");
|
|
178
191
|
}
|
|
@@ -247,7 +260,7 @@ function buildChatPrompt() {
|
|
|
247
260
|
sections.push("- `like` \u2014 Like a tweet (provide `tweetId`)");
|
|
248
261
|
sections.push("- `retweet` \u2014 Retweet (provide `tweetId`)");
|
|
249
262
|
sections.push("- `follow` \u2014 Follow a user (provide `handle`)");
|
|
250
|
-
sections.push("- `schedule` \u2014 Queue a post for later (provide `content`)");
|
|
263
|
+
sections.push("- `schedule` \u2014 Queue a post for later (provide `content` and optional `scheduledFor` ISO timestamp)");
|
|
251
264
|
sections.push("");
|
|
252
265
|
sections.push("You can include multiple actions in one response. They will all be executed.");
|
|
253
266
|
sections.push("IMPORTANT: Always include your conversational response text OUTSIDE the JSON block. The JSON is for actions only.");
|
|
@@ -271,4 +284,4 @@ export {
|
|
|
271
284
|
buildNarratedHeartbeatMessage,
|
|
272
285
|
buildChatPrompt
|
|
273
286
|
};
|
|
274
|
-
//# sourceMappingURL=chunk-
|
|
287
|
+
//# sourceMappingURL=chunk-SJMQDGRN.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 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 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(\"Do immediate actions (reply to mentions, like posts) AND schedule tweets to post between now and your next heartbeat.\");\n parts.push(`Your next heartbeat is in ~${intervalMin} minutes. Current time: ${now.toISOString()}`);\n parts.push(\"Schedule 3-5 tweets spaced randomly across that window so your feed stays active while you sleep.\");\n parts.push(\"\");\n parts.push(\"Available actions:\");\n parts.push(\"- `post` — Write an original tweet NOW (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 tweet for later (provide `content` and `scheduledFor` ISO timestamp)\");\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\": \"reply\", \"tweetId\": \"123\", \"content\": \"my reply\", \"reasoning\": \"why\" },');\n parts.push(' { \"action\": \"like\", \"tweetId\": \"456\", \"reasoning\": \"why\" },');\n parts.push(` { \"action\": \"schedule\", \"content\": \"tweet for later\", \"scheduledFor\": \"${new Date(now.getTime() + intervalMin * 60_000 * 0.3).toISOString()}\", \"reasoning\": \"why\" },`);\n parts.push(` { \"action\": \"schedule\", \"content\": \"another later tweet\", \"scheduledFor\": \"${new Date(now.getTime() + intervalMin * 60_000 * 0.7).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 parts.push(\"It's time for your heartbeat — you're waking up to check on things and interact with X/Twitter.\");\n parts.push(\"IMPORTANT: Narrate your thought process as you go. Your creator is watching in the chat and wants to see what you're thinking.\");\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 } else {\n parts.push(\"## Mentions: None right now.\");\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(\"1. First, write a SHORT narration for your creator about what you see and what you plan to do (2-3 sentences max).\");\n parts.push(\"2. Then include your actions as a JSON block.\");\n parts.push(\"3. Do immediate actions (reply to mentions, like posts) AND schedule tweets to post between now and your next heartbeat.\");\n parts.push(`4. Your next heartbeat is in ~${intervalMin} minutes. Schedule 3-5 tweets spaced randomly across that window so your feed stays active while you sleep.`);\n parts.push(`5. The current time is ${now.toISOString()}. Use the \\`scheduledFor\\` field with ISO timestamps to space out scheduled posts.`);\n parts.push(\"\");\n parts.push(\"Example response format:\");\n parts.push(\"Waking up! I see @someone mentioned me about AI — gotta reply to that. Also scheduling a few tweets to keep my feed active until my next check-in.\");\n parts.push(\"```json\");\n parts.push('[');\n parts.push(' { \"action\": \"reply\", \"tweetId\": \"123\", \"content\": \"my reply here\" },');\n parts.push(' { \"action\": \"like\", \"tweetId\": \"456\" },');\n parts.push(` { \"action\": \"schedule\", \"content\": \"tweet 1 goes out soon\", \"scheduledFor\": \"${new Date(now.getTime() + intervalMin * 60_000 * 0.2).toISOString()}\" },`);\n parts.push(` { \"action\": \"schedule\", \"content\": \"tweet 2 mid-window\", \"scheduledFor\": \"${new Date(now.getTime() + intervalMin * 60_000 * 0.5).toISOString()}\" },`);\n parts.push(` { \"action\": \"schedule\", \"content\": \"tweet 3 near end\", \"scheduledFor\": \"${new Date(now.getTime() + intervalMin * 60_000 * 0.8).toISOString()}\" }`);\n parts.push(']');\n parts.push(\"```\");\n parts.push(\"\");\n parts.push(\"Available actions: post (instant), reply, like, retweet, follow, schedule (with scheduledFor), learn, skip\");\n parts.push(\"Use `post` for things you want live NOW. Use `schedule` with `scheduledFor` timestamps to spread content across the window until your next heartbeat.\");\n parts.push(\"Be authentic. Be you. Do what feels right.\");\n\n return parts.join(\"\\n\");\n}\n\nexport function buildChatPrompt(): string {\n const identity = loadIdentity();\n const identityDoc = renderIdentityDocument(identity);\n\n const sections: string[] = [];\n\n sections.push(`You are ${identity.name} (@${identity.handle}), an AUTONOMOUS AI agent that lives on X/Twitter.`);\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.\");\n sections.push(\"- `reply` — Reply to a tweet (provide `tweetId` and `content`)\");\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(\"- `schedule` — Queue a post for later (provide `content` and optional `scheduledFor` ISO timestamp)\");\n sections.push(\"\");\n sections.push(\"You can include multiple actions in one response. They will all be executed.\");\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 if (identity.boundaries.length > 0) {\n sections.push(`7. 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,yC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AA+E;AAC7F,WAAS,KAAK,sCAAsC;AACpD,WAAS,KAAK,uEAAuE;AACrF,WAAS,KAAK,qFAAqF;AACnG,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":[]}
|
package/dist/cli.js
CHANGED
|
@@ -123,11 +123,11 @@ 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-
|
|
126
|
+
const { runInit } = await import("./init-FBDXTEZJ.js");
|
|
127
127
|
await runInit(opts.token);
|
|
128
128
|
});
|
|
129
129
|
program.command("serve").description("Start the Spora MCP server (stdio)").action(async () => {
|
|
130
|
-
const { startServer } = await import("./mcp-server
|
|
130
|
+
const { startServer } = await import("./mcp-server.js");
|
|
131
131
|
await startServer();
|
|
132
132
|
});
|
|
133
133
|
program.command("chat").description("Open web-based chat interface with your Spore").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-
|
|
138
|
+
const { startWebChat } = await import("./web-chat-Z42YFXCH.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-
|
|
281
|
+
const { getXClient } = await import("./x-client-YE6QFHEN.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-
|
|
292
|
+
const { getXClient } = await import("./x-client-YE6QFHEN.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-
|
|
303
|
+
const { getXClient } = await import("./x-client-YE6QFHEN.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-
|
|
314
|
+
const { getXClient } = await import("./x-client-YE6QFHEN.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-
|
|
325
|
+
const { getXClient } = await import("./x-client-YE6QFHEN.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-
|
|
336
|
+
const { getXClient } = await import("./x-client-YE6QFHEN.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-
|
|
347
|
+
const { getXClient } = await import("./x-client-YE6QFHEN.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-
|
|
358
|
+
const { getXClient } = await import("./x-client-YE6QFHEN.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-
|
|
369
|
+
const { getXClient } = await import("./x-client-YE6QFHEN.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-
|
|
380
|
+
const { getXClient } = await import("./x-client-YE6QFHEN.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-
|
|
446
|
+
const { addToQueue } = await import("./queue-YEVE53NQ.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-
|
|
456
|
+
const { flushQueue } = await import("./queue-YEVE53NQ.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-
|
|
465
|
+
const { showQueue } = await import("./queue-YEVE53NQ.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-
|
|
471
|
+
const { colonyCheckin } = await import("./colony-4G3JMXXW.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-
|
|
490
|
+
const { getActivePlans } = await import("./colony-4G3JMXXW.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-
|
|
500
|
+
const { proposePlan } = await import("./colony-4G3JMXXW.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-
|
|
510
|
+
const { joinPlan } = await import("./colony-4G3JMXXW.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-
|
|
520
|
+
const { postStatus } = await import("./colony-4G3JMXXW.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-
|
|
530
|
+
const { getTodaysActivity } = await import("./colony-4G3JMXXW.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-
|
|
560
|
+
const { startHeartbeatLoop } = await import("./heartbeat-SQRFUVIJ.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-
|
|
564
|
+
const { getRunningPid, requestStop } = await import("./heartbeat-SQRFUVIJ.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-
|
|
602
|
+
const { getRunningPid } = await import("./heartbeat-SQRFUVIJ.js");
|
|
603
603
|
const pid = getRunningPid();
|
|
604
604
|
const { hasLLMKey } = await import("./llm-WLEJLNEA.js");
|
|
605
605
|
console.log(JSON.stringify({
|