spora 0.3.3 → 0.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/dist/account-creator-AABUY2JU.js +498 -0
  2. package/dist/account-creator-AABUY2JU.js.map +1 -0
  3. package/dist/chunk-6KCIAMHL.js +62 -0
  4. package/dist/chunk-6KCIAMHL.js.map +1 -0
  5. package/dist/chunk-A6R5ZGK6.js +156 -0
  6. package/dist/chunk-A6R5ZGK6.js.map +1 -0
  7. package/dist/chunk-B6VI6L4D.js +124 -0
  8. package/dist/chunk-B6VI6L4D.js.map +1 -0
  9. package/dist/chunk-FTFTB5Y5.js +622 -0
  10. package/dist/chunk-FTFTB5Y5.js.map +1 -0
  11. package/dist/chunk-GMSK775L.js +103 -0
  12. package/dist/chunk-GMSK775L.js.map +1 -0
  13. package/dist/chunk-H62HH5ZI.js +56 -0
  14. package/dist/chunk-H62HH5ZI.js.map +1 -0
  15. package/dist/chunk-KQ37VL54.js +32 -0
  16. package/dist/chunk-KQ37VL54.js.map +1 -0
  17. package/dist/chunk-ML4EMUZC.js +57 -0
  18. package/dist/chunk-ML4EMUZC.js.map +1 -0
  19. package/dist/chunk-N5TBL3NY.js +86 -0
  20. package/dist/chunk-N5TBL3NY.js.map +1 -0
  21. package/dist/chunk-PNZ3XK2N.js +358 -0
  22. package/dist/chunk-PNZ3XK2N.js.map +1 -0
  23. package/dist/chunk-UCCAF2ZO.js +47 -0
  24. package/dist/chunk-UCCAF2ZO.js.map +1 -0
  25. package/dist/chunk-V6ZNR2SI.js +105 -0
  26. package/dist/chunk-V6ZNR2SI.js.map +1 -0
  27. package/dist/cli.js +654 -0
  28. package/dist/cli.js.map +1 -0
  29. package/dist/client-BGLXHLID.js +401 -0
  30. package/dist/client-BGLXHLID.js.map +1 -0
  31. package/dist/client-TWYR2IIQ.js +373 -0
  32. package/dist/client-TWYR2IIQ.js.map +1 -0
  33. package/dist/colony-JVBCMZTK.js +229 -0
  34. package/dist/colony-JVBCMZTK.js.map +1 -0
  35. package/dist/config-5EPXA325.js +14 -0
  36. package/dist/config-5EPXA325.js.map +1 -0
  37. package/dist/crypto-HS4CGS4A.js +14 -0
  38. package/dist/crypto-HS4CGS4A.js.map +1 -0
  39. package/dist/heartbeat-B2CZKMUF.js +901 -0
  40. package/dist/heartbeat-B2CZKMUF.js.map +1 -0
  41. package/dist/identity-6CXRCXJQ.js +26 -0
  42. package/dist/identity-6CXRCXJQ.js.map +1 -0
  43. package/dist/init-KXNLBFMG.js +403 -0
  44. package/dist/init-KXNLBFMG.js.map +1 -0
  45. package/dist/llm-CUCO24K7.js +16 -0
  46. package/dist/llm-CUCO24K7.js.map +1 -0
  47. package/dist/mcp-server.js +773 -0
  48. package/dist/mcp-server.js.map +1 -0
  49. package/dist/memory-2OI3JXY2.js +26 -0
  50. package/dist/memory-2OI3JXY2.js.map +1 -0
  51. package/dist/memory-LPU2I6NI.js +24 -0
  52. package/dist/memory-LPU2I6NI.js.map +1 -0
  53. package/dist/paths-Q4TJEOMQ.js +13 -0
  54. package/dist/paths-Q4TJEOMQ.js.map +1 -0
  55. package/dist/prompt-builder-VHGZFBL6.js +19 -0
  56. package/dist/prompt-builder-VHGZFBL6.js.map +1 -0
  57. package/dist/queue-LNBQWMFX.js +14 -0
  58. package/dist/queue-LNBQWMFX.js.map +1 -0
  59. package/dist/web-chat/chat.html +423 -0
  60. package/dist/web-chat-DHHJTGFZ.js +253 -0
  61. package/dist/web-chat-DHHJTGFZ.js.map +1 -0
  62. package/dist/x-client-W5IB7XOM.js +12 -0
  63. package/dist/x-client-W5IB7XOM.js.map +1 -0
  64. package/package.json +2 -1
@@ -0,0 +1,253 @@
1
+ import {
2
+ loadIdentity
3
+ } from "./chunk-FTFTB5Y5.js";
4
+ import "./chunk-6KCIAMHL.js";
5
+
6
+ // src/web-chat/server.ts
7
+ import http from "http";
8
+ import { URL } from "url";
9
+ import { readFileSync } from "fs";
10
+ import { join, dirname } from "path";
11
+ import { fileURLToPath } from "url";
12
+ var __filename = fileURLToPath(import.meta.url);
13
+ var __dirname = dirname(__filename);
14
+ var WebChatServer = class {
15
+ server = null;
16
+ port;
17
+ messages = [];
18
+ onUserMessage;
19
+ identity;
20
+ constructor(port = 3737) {
21
+ this.port = port;
22
+ }
23
+ setIdentity(identity) {
24
+ this.identity = identity;
25
+ }
26
+ setMessageHandler(handler) {
27
+ this.onUserMessage = handler;
28
+ }
29
+ async start() {
30
+ return new Promise((resolve, reject) => {
31
+ this.server = http.createServer(async (req, res) => {
32
+ const url = new URL(req.url || "/", `http://${req.headers.host}`);
33
+ res.setHeader("Access-Control-Allow-Origin", "*");
34
+ res.setHeader("Access-Control-Allow-Methods", "GET, POST, OPTIONS");
35
+ res.setHeader("Access-Control-Allow-Headers", "Content-Type");
36
+ if (req.method === "OPTIONS") {
37
+ res.writeHead(200);
38
+ res.end();
39
+ return;
40
+ }
41
+ if (url.pathname === "/" || url.pathname === "/index.html") {
42
+ try {
43
+ const possiblePaths = [
44
+ join(__dirname, "web-chat", "chat.html"),
45
+ join(__dirname, "chat.html"),
46
+ join(__dirname, "..", "web-chat", "chat.html"),
47
+ join(__dirname, "..", "src", "web-chat", "chat.html")
48
+ ];
49
+ let html = null;
50
+ for (const p of possiblePaths) {
51
+ try {
52
+ html = readFileSync(p, "utf-8");
53
+ break;
54
+ } catch {
55
+ continue;
56
+ }
57
+ }
58
+ if (html) {
59
+ res.writeHead(200, { "Content-Type": "text/html" });
60
+ res.end(html);
61
+ } else {
62
+ console.error("Could not find chat.html in any of:", possiblePaths);
63
+ res.writeHead(500);
64
+ res.end("Error: Could not find chat.html");
65
+ }
66
+ } catch (error) {
67
+ res.writeHead(500);
68
+ res.end("Error loading chat interface");
69
+ }
70
+ return;
71
+ }
72
+ if (url.pathname === "/api/identity" && req.method === "GET") {
73
+ res.writeHead(200, { "Content-Type": "application/json" });
74
+ res.end(JSON.stringify({ identity: this.identity || null }));
75
+ return;
76
+ }
77
+ if (url.pathname === "/api/messages" && req.method === "GET") {
78
+ res.writeHead(200, { "Content-Type": "application/json" });
79
+ res.end(JSON.stringify({ messages: this.messages }));
80
+ return;
81
+ }
82
+ if (url.pathname === "/api/message" && req.method === "POST") {
83
+ let body = "";
84
+ req.on("data", (chunk) => {
85
+ body += chunk.toString();
86
+ });
87
+ req.on("end", async () => {
88
+ try {
89
+ const { message } = JSON.parse(body);
90
+ this.messages.push({
91
+ role: "user",
92
+ content: message,
93
+ timestamp: Date.now()
94
+ });
95
+ if (this.onUserMessage) {
96
+ const response = await this.onUserMessage(message);
97
+ this.messages.push({
98
+ role: "assistant",
99
+ content: response,
100
+ timestamp: Date.now()
101
+ });
102
+ res.writeHead(200, { "Content-Type": "application/json" });
103
+ res.end(JSON.stringify({ success: true, response }));
104
+ } else {
105
+ res.writeHead(500, { "Content-Type": "application/json" });
106
+ res.end(JSON.stringify({ error: "No message handler configured" }));
107
+ }
108
+ } catch (error) {
109
+ res.writeHead(400, { "Content-Type": "application/json" });
110
+ res.end(JSON.stringify({ error: "Invalid request" }));
111
+ }
112
+ });
113
+ return;
114
+ }
115
+ res.writeHead(404);
116
+ res.end("Not found");
117
+ });
118
+ this.server.listen(this.port, () => {
119
+ const url = `http://localhost:${this.port}`;
120
+ resolve(url);
121
+ });
122
+ this.server.on("error", (error) => {
123
+ if (error.code === "EADDRINUSE") {
124
+ this.port++;
125
+ this.server?.close();
126
+ this.start().then(resolve).catch(reject);
127
+ } else {
128
+ reject(error);
129
+ }
130
+ });
131
+ });
132
+ }
133
+ stop() {
134
+ if (this.server) {
135
+ this.server.close();
136
+ this.server = null;
137
+ }
138
+ }
139
+ };
140
+
141
+ // src/web-chat/index.ts
142
+ import { execSync } from "child_process";
143
+ import chalk from "chalk";
144
+ async function extractAndSaveLearnings(responseText) {
145
+ const learnPattern = /<<LEARN:\s*(.+?)>>/g;
146
+ const matches = [...responseText.matchAll(learnPattern)];
147
+ if (matches.length > 0) {
148
+ const { addLearning } = await import("./memory-LPU2I6NI.js");
149
+ for (const match of matches) {
150
+ const learning = match[1].trim();
151
+ addLearning(learning, "web-chat", ["chat", "creator-interaction"]);
152
+ console.log(chalk.dim(` [Memory] Saved learning: ${learning}`));
153
+ }
154
+ }
155
+ return responseText.replace(/<<LEARN:\s*.+?>>/g, "").trim();
156
+ }
157
+ async function logChatInteraction(userMessage, agentResponse) {
158
+ const { logInteraction } = await import("./memory-LPU2I6NI.js");
159
+ logInteraction({
160
+ id: `chat-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`,
161
+ timestamp: (/* @__PURE__ */ new Date()).toISOString(),
162
+ type: "reply",
163
+ content: agentResponse.slice(0, 200),
164
+ targetHandle: "creator",
165
+ creditsUsed: 0,
166
+ success: true
167
+ });
168
+ }
169
+ async function startWebChat() {
170
+ const identity = loadIdentity();
171
+ const server = new WebChatServer();
172
+ server.setIdentity({
173
+ name: identity.name,
174
+ handle: identity.handle,
175
+ bio: identity.bio,
176
+ profileImage: identity.profileImage
177
+ });
178
+ const chatHistory = [];
179
+ let systemPrompt = null;
180
+ let messageCount = 0;
181
+ server.setMessageHandler(async (message) => {
182
+ try {
183
+ if (!systemPrompt || messageCount % 10 === 0) {
184
+ const { buildChatPrompt } = await import("./prompt-builder-VHGZFBL6.js");
185
+ systemPrompt = buildChatPrompt();
186
+ }
187
+ messageCount++;
188
+ const { hasLLMKey, chat: chatLLM } = await import("./llm-CUCO24K7.js");
189
+ if (!hasLLMKey()) {
190
+ return "I can't respond right now - no API key configured. Run `spora set-llm-key` to set one up.";
191
+ }
192
+ chatHistory.push({ role: "user", content: message });
193
+ const response = await chatLLM(systemPrompt, chatHistory);
194
+ const cleanResponse = await extractAndSaveLearnings(response.content);
195
+ chatHistory.push({ role: "assistant", content: cleanResponse });
196
+ logChatInteraction(message, cleanResponse).catch(
197
+ (err) => console.error(chalk.dim(" [Memory] Failed to log interaction:"), err)
198
+ );
199
+ return cleanResponse;
200
+ } catch (error) {
201
+ console.error("Chat error:", error);
202
+ return `Sorry, I ran into an issue: ${error.message}`;
203
+ }
204
+ });
205
+ const url = await server.start();
206
+ console.log(chalk.green(`
207
+ \u2713 Chat interface started at ${chalk.bold(url)}
208
+ `));
209
+ console.log(chalk.dim(`Press Ctrl+C to stop the server
210
+ `));
211
+ openBrowser(url);
212
+ process.on("SIGINT", () => {
213
+ console.log(chalk.yellow("\n\nStopping chat server..."));
214
+ server.stop();
215
+ process.exit(0);
216
+ });
217
+ return server;
218
+ }
219
+ function openBrowser(url) {
220
+ const platform = process.platform;
221
+ try {
222
+ if (platform === "darwin") {
223
+ try {
224
+ execSync(`open -na "Google Chrome" --args --app="${url}" --window-size=500,700`, { stdio: "ignore" });
225
+ } catch {
226
+ try {
227
+ execSync(`open -na "Brave Browser" --args --app="${url}" --window-size=500,700`, { stdio: "ignore" });
228
+ } catch {
229
+ execSync(`open "${url}"`, { stdio: "ignore" });
230
+ }
231
+ }
232
+ } else if (platform === "win32") {
233
+ try {
234
+ execSync(`start chrome --app="${url}" --window-size=500,700`, { stdio: "ignore" });
235
+ } catch {
236
+ execSync(`start "" "${url}"`, { stdio: "ignore" });
237
+ }
238
+ } else {
239
+ try {
240
+ execSync(`google-chrome --app="${url}" --window-size=500,700`, { stdio: "ignore" });
241
+ } catch {
242
+ execSync(`xdg-open "${url}"`, { stdio: "ignore" });
243
+ }
244
+ }
245
+ } catch (error) {
246
+ console.log(chalk.dim(`(Couldn't open browser automatically - please visit ${url} manually)`));
247
+ }
248
+ }
249
+ export {
250
+ openBrowser,
251
+ startWebChat
252
+ };
253
+ //# sourceMappingURL=web-chat-DHHJTGFZ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/web-chat/server.ts","../src/web-chat/index.ts"],"sourcesContent":["/**\n * Local web chat server\n * Serves a simple chat interface for interacting with your Spore\n */\n\nimport http from \"node:http\";\nimport { URL } from \"node:url\";\nimport { readFileSync } from \"node:fs\";\nimport { join, dirname } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\ninterface ChatMessage {\n role: \"user\" | \"assistant\";\n content: string;\n timestamp: number;\n}\n\ninterface AgentIdentity {\n name: string;\n handle: string;\n bio?: string;\n profileImage?: string;\n}\n\nexport class WebChatServer {\n private server: http.Server | null = null;\n private port: number;\n private messages: ChatMessage[] = [];\n private onUserMessage?: (message: string) => Promise<string>;\n private identity?: AgentIdentity;\n\n constructor(port = 3737) {\n this.port = port;\n }\n\n setIdentity(identity: AgentIdentity) {\n this.identity = identity;\n }\n\n setMessageHandler(handler: (message: string) => Promise<string>) {\n this.onUserMessage = handler;\n }\n\n async start(): Promise<string> {\n return new Promise((resolve, reject) => {\n this.server = http.createServer(async (req, res) => {\n const url = new URL(req.url || \"/\", `http://${req.headers.host}`);\n\n // CORS headers\n res.setHeader(\"Access-Control-Allow-Origin\", \"*\");\n res.setHeader(\"Access-Control-Allow-Methods\", \"GET, POST, OPTIONS\");\n res.setHeader(\"Access-Control-Allow-Headers\", \"Content-Type\");\n\n if (req.method === \"OPTIONS\") {\n res.writeHead(200);\n res.end();\n return;\n }\n\n // Serve HTML\n if (url.pathname === \"/\" || url.pathname === \"/index.html\") {\n try {\n // Try multiple paths since __dirname changes based on build output\n const possiblePaths = [\n join(__dirname, \"web-chat\", \"chat.html\"),\n join(__dirname, \"chat.html\"),\n join(__dirname, \"..\", \"web-chat\", \"chat.html\"),\n join(__dirname, \"..\", \"src\", \"web-chat\", \"chat.html\"),\n ];\n\n let html: string | null = null;\n for (const p of possiblePaths) {\n try {\n html = readFileSync(p, \"utf-8\");\n break;\n } catch {\n continue;\n }\n }\n\n if (html) {\n res.writeHead(200, { \"Content-Type\": \"text/html\" });\n res.end(html);\n } else {\n console.error(\"Could not find chat.html in any of:\", possiblePaths);\n res.writeHead(500);\n res.end(\"Error: Could not find chat.html\");\n }\n } catch (error) {\n res.writeHead(500);\n res.end(\"Error loading chat interface\");\n }\n return;\n }\n\n // API: Get agent identity\n if (url.pathname === \"/api/identity\" && req.method === \"GET\") {\n res.writeHead(200, { \"Content-Type\": \"application/json\" });\n res.end(JSON.stringify({ identity: this.identity || null }));\n return;\n }\n\n // API: Get messages\n if (url.pathname === \"/api/messages\" && req.method === \"GET\") {\n res.writeHead(200, { \"Content-Type\": \"application/json\" });\n res.end(JSON.stringify({ messages: this.messages }));\n return;\n }\n\n // API: Send message\n if (url.pathname === \"/api/message\" && req.method === \"POST\") {\n let body = \"\";\n req.on(\"data\", (chunk) => {\n body += chunk.toString();\n });\n\n req.on(\"end\", async () => {\n try {\n const { message } = JSON.parse(body);\n\n // Add user message\n this.messages.push({\n role: \"user\",\n content: message,\n timestamp: Date.now(),\n });\n\n // Get response\n if (this.onUserMessage) {\n const response = await this.onUserMessage(message);\n this.messages.push({\n role: \"assistant\",\n content: response,\n timestamp: Date.now(),\n });\n res.writeHead(200, { \"Content-Type\": \"application/json\" });\n res.end(JSON.stringify({ success: true, response }));\n } else {\n res.writeHead(500, { \"Content-Type\": \"application/json\" });\n res.end(JSON.stringify({ error: \"No message handler configured\" }));\n }\n } catch (error) {\n res.writeHead(400, { \"Content-Type\": \"application/json\" });\n res.end(JSON.stringify({ error: \"Invalid request\" }));\n }\n });\n return;\n }\n\n // 404\n res.writeHead(404);\n res.end(\"Not found\");\n });\n\n this.server.listen(this.port, () => {\n const url = `http://localhost:${this.port}`;\n resolve(url);\n });\n\n this.server.on(\"error\", (error: NodeJS.ErrnoException) => {\n if (error.code === \"EADDRINUSE\") {\n // Port in use, try next port\n this.port++;\n this.server?.close();\n this.start().then(resolve).catch(reject);\n } else {\n reject(error);\n }\n });\n });\n }\n\n stop() {\n if (this.server) {\n this.server.close();\n this.server = null;\n }\n }\n}\n","/**\n * Web chat integration\n */\n\nimport { WebChatServer } from \"./server.js\";\nimport { loadIdentity } from \"../identity/index.js\";\nimport { execSync } from \"node:child_process\";\nimport chalk from \"chalk\";\n\n/**\n * Extract <<LEARN: ...>> tags from response, save them, and return cleaned text\n */\nasync function extractAndSaveLearnings(responseText: string): Promise<string> {\n const learnPattern = /<<LEARN:\\s*(.+?)>>/g;\n const matches = [...responseText.matchAll(learnPattern)];\n\n if (matches.length > 0) {\n const { addLearning } = await import(\"../memory/index.js\");\n for (const match of matches) {\n const learning = match[1].trim();\n addLearning(learning, \"web-chat\", [\"chat\", \"creator-interaction\"]);\n console.log(chalk.dim(` [Memory] Saved learning: ${learning}`));\n }\n }\n\n // Strip the learn tags from the response the user sees\n return responseText.replace(/<<LEARN:\\s*.+?>>/g, \"\").trim();\n}\n\n/**\n * Log a chat exchange as an interaction in memory\n */\nasync function logChatInteraction(userMessage: string, agentResponse: string): Promise<void> {\n const { logInteraction } = await import(\"../memory/index.js\");\n logInteraction({\n id: `chat-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`,\n timestamp: new Date().toISOString(),\n type: \"reply\",\n content: agentResponse.slice(0, 200),\n targetHandle: \"creator\",\n creditsUsed: 0,\n success: true,\n });\n}\n\nexport async function startWebChat() {\n const identity = loadIdentity();\n\n const server = new WebChatServer();\n\n // Pass identity to server so the chat UI can display it\n server.setIdentity({\n name: identity.name,\n handle: identity.handle,\n bio: identity.bio,\n profileImage: identity.profileImage,\n });\n\n // Set up message handler - connected to actual LLM with memory\n const chatHistory: Array<{ role: \"user\" | \"assistant\"; content: string }> = [];\n let systemPrompt: string | null = null;\n let messageCount = 0;\n\n server.setMessageHandler(async (message: string) => {\n try {\n // Build system prompt on first message, rebuild every 10 messages to refresh memory\n if (!systemPrompt || messageCount % 10 === 0) {\n const { buildChatPrompt } = await import(\"../runtime/prompt-builder.js\");\n systemPrompt = buildChatPrompt();\n }\n messageCount++;\n\n // Check for LLM key\n const { hasLLMKey, chat: chatLLM } = await import(\"../runtime/llm.js\");\n if (!hasLLMKey()) {\n return \"I can't respond right now - no API key configured. Run `spora set-llm-key` to set one up.\";\n }\n\n // Add user message to history\n chatHistory.push({ role: \"user\", content: message });\n\n // Call LLM with full conversation history\n const response = await chatLLM(systemPrompt, chatHistory);\n\n // Extract learnings from response and clean the text\n const cleanResponse = await extractAndSaveLearnings(response.content);\n\n // Add cleaned assistant response to history\n chatHistory.push({ role: \"assistant\", content: cleanResponse });\n\n // Log interaction to memory (async, don't block response)\n logChatInteraction(message, cleanResponse).catch((err) =>\n console.error(chalk.dim(\" [Memory] Failed to log interaction:\"), err)\n );\n\n return cleanResponse;\n } catch (error) {\n console.error(\"Chat error:\", error);\n return `Sorry, I ran into an issue: ${(error as Error).message}`;\n }\n });\n\n const url = await server.start();\n\n console.log(chalk.green(`\\n✓ Chat interface started at ${chalk.bold(url)}\\n`));\n console.log(chalk.dim(`Press Ctrl+C to stop the server\\n`));\n\n // Open browser\n openBrowser(url);\n\n // Keep process alive\n process.on(\"SIGINT\", () => {\n console.log(chalk.yellow(\"\\n\\nStopping chat server...\"));\n server.stop();\n process.exit(0);\n });\n\n // Return the server instance for external control\n return server;\n}\n\n/**\n * Open URL in a separate browser window (app-like)\n */\nfunction openBrowser(url: string) {\n const platform = process.platform;\n\n try {\n if (platform === \"darwin\") {\n // Open as a standalone Chrome app window (smaller, separate from existing tabs)\n try {\n execSync(`open -na \"Google Chrome\" --args --app=\"${url}\" --window-size=500,700`, { stdio: \"ignore\" });\n } catch {\n // Fallback: try Chromium-based browsers, then default\n try {\n execSync(`open -na \"Brave Browser\" --args --app=\"${url}\" --window-size=500,700`, { stdio: \"ignore\" });\n } catch {\n execSync(`open \"${url}\"`, { stdio: \"ignore\" });\n }\n }\n } else if (platform === \"win32\") {\n try {\n execSync(`start chrome --app=\"${url}\" --window-size=500,700`, { stdio: \"ignore\" });\n } catch {\n execSync(`start \"\" \"${url}\"`, { stdio: \"ignore\" });\n }\n } else {\n // Linux\n try {\n execSync(`google-chrome --app=\"${url}\" --window-size=500,700`, { stdio: \"ignore\" });\n } catch {\n execSync(`xdg-open \"${url}\"`, { stdio: \"ignore\" });\n }\n }\n } catch (error) {\n // Browser couldn't be opened, that's okay\n console.log(chalk.dim(`(Couldn't open browser automatically - please visit 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F,iBAAS,uBAAuB,GAAG,2BAA2B,EAAE,OAAO,SAAS,CAAC;AAAA,MACnF,QAAQ;AACN,iBAAS,aAAa,GAAG,KAAK,EAAE,OAAO,SAAS,CAAC;AAAA,MACnD;AAAA,IACF,OAAO;AAEL,UAAI;AACF,iBAAS,wBAAwB,GAAG,2BAA2B,EAAE,OAAO,SAAS,CAAC;AAAA,MACpF,QAAQ;AACN,iBAAS,aAAa,GAAG,KAAK,EAAE,OAAO,SAAS,CAAC;AAAA,MACnD;AAAA,IACF;AAAA,EACF,SAAS,OAAO;AAEd,YAAQ,IAAI,MAAM,IAAI,uDAAuD,GAAG,YAAY,CAAC;AAAA,EAC/F;AACF;","names":[]}
@@ -0,0 +1,12 @@
1
+ import {
2
+ getXClient,
3
+ resetXClient
4
+ } from "./chunk-KQ37VL54.js";
5
+ import "./chunk-GMSK775L.js";
6
+ import "./chunk-UCCAF2ZO.js";
7
+ import "./chunk-6KCIAMHL.js";
8
+ export {
9
+ getXClient,
10
+ resetXClient
11
+ };
12
+ //# sourceMappingURL=x-client-W5IB7XOM.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spora",
3
- "version": "0.3.3",
3
+ "version": "0.3.4",
4
4
  "description": "AI agents (Spores) that autonomously manage X/Twitter accounts",
5
5
  "type": "module",
6
6
  "author": "Spora",
@@ -43,6 +43,7 @@
43
43
  "agentmail": "^0.1.0",
44
44
  "chalk": "^5.3.0",
45
45
  "commander": "^12.1.0",
46
+ "openai": "^6.20.0",
46
47
  "playwright": "^1.49.0",
47
48
  "sharp": "^0.33.0",
48
49
  "twitter-api-v2": "^1.29.0",