spora 0.7.4 → 0.7.6
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/autonomy-E3DWYRJM.js +20 -0
- package/dist/{chunk-SUZUJGGW.js → chunk-342ZX72W.js} +4 -4
- package/dist/{chunk-PN5A6MCV.js → chunk-5R4AJZHN.js} +4 -4
- package/dist/{chunk-PN5A6MCV.js.map → chunk-5R4AJZHN.js.map} +1 -1
- package/dist/{chunk-JBYZ7K56.js → chunk-BBXHECZ5.js} +2 -2
- package/dist/{chunk-WN35MRMF.js → chunk-CAWWG3MD.js} +2 -2
- package/dist/chunk-CP6JWCLY.js +171 -0
- package/dist/chunk-CP6JWCLY.js.map +1 -0
- package/dist/{chunk-T7L2L7ZL.js → chunk-D47OFTEK.js} +2 -2
- package/dist/{chunk-Q3YXJ2C6.js → chunk-E5PEY36J.js} +408 -63
- package/dist/chunk-E5PEY36J.js.map +1 -0
- package/dist/chunk-FBHLDOMC.js +2436 -0
- package/dist/chunk-FBHLDOMC.js.map +1 -0
- package/dist/{chunk-M6YOQVSI.js → chunk-IULO3GRE.js} +4 -4
- package/dist/chunk-IULO3GRE.js.map +1 -0
- package/dist/chunk-OTZNHIXT.js +431 -0
- package/dist/chunk-OTZNHIXT.js.map +1 -0
- package/dist/{chunk-NO3NQN67.js → chunk-QYFNAGNI.js} +2 -2
- package/dist/{chunk-YMGJQRKG.js → chunk-RSNEVBEI.js} +2 -2
- package/dist/{chunk-QWEYVDLU.js → chunk-SXNZVKLJ.js} +2 -2
- package/dist/{chunk-MDOFAAZB.js → chunk-ZLSDFYBR.js} +17 -5
- package/dist/chunk-ZLSDFYBR.js.map +1 -0
- package/dist/{chunk-3RYCUGXE.js → chunk-ZWKTKWS6.js} +4 -1
- package/dist/chunk-ZWKTKWS6.js.map +1 -0
- package/dist/cli.js +49 -49
- package/dist/{client-Z5UQWPPI.js → client-AR5ZD6S4.js} +48 -16
- package/dist/client-AR5ZD6S4.js.map +1 -0
- package/dist/{colony-NNX45EAV.js → colony-UGVYALOS.js} +7 -7
- package/dist/{config-FL4VJVKZ.js → config-MU2ODEO3.js} +3 -3
- package/dist/{crypto-B65ZH7KN.js → crypto-GDG5K3ZH.js} +3 -3
- package/dist/{goals-RBKLMILE.js → goals-QWX3A47Y.js} +3 -3
- package/dist/{heartbeat-ZCCOIZGU.js → heartbeat-GVBLNAFM.js} +18 -21
- package/dist/heartbeat-GVBLNAFM.js.map +1 -0
- package/dist/{identity-VDUW4I2K.js → identity-ASHVWIN5.js} +3 -3
- package/dist/{init-SEJPTOOB.js → init-C4OZPGUC.js} +108 -15
- package/dist/init-C4OZPGUC.js.map +1 -0
- package/dist/{llm-OGOYCWBH.js → llm-IJBRQ7O2.js} +5 -5
- package/dist/mcp-server.js +24 -24
- package/dist/{memory-PNW7SX7A.js → memory-AWKIW2KW.js} +3 -3
- package/dist/{memory-OIAH33G2.js → memory-DTSLVSQG.js} +3 -3
- package/dist/{paths-BYR6MEPR.js → paths-4V5OCB5F.js} +2 -2
- package/dist/prompt-builder-NTN4FCBD.js +27 -0
- package/dist/queue-QCGNDHH2.js +14 -0
- package/dist/strategy-R2BMRVJ3.js +19 -0
- package/dist/{web-chat-ZZ65DUID.js → web-chat-2N2RN6J7.js} +23 -28
- package/dist/web-chat-2N2RN6J7.js.map +1 -0
- package/dist/x-client-S2LUVEKV.js +12 -0
- package/package.json +1 -1
- package/dist/autonomy-XUKCAZM3.js +0 -19
- package/dist/chunk-3RYCUGXE.js.map +0 -1
- package/dist/chunk-4LNMA56H.js +0 -57
- package/dist/chunk-4LNMA56H.js.map +0 -1
- package/dist/chunk-EU4FMOKG.js +0 -377
- package/dist/chunk-EU4FMOKG.js.map +0 -1
- package/dist/chunk-M6YOQVSI.js.map +0 -1
- package/dist/chunk-MDOFAAZB.js.map +0 -1
- package/dist/chunk-P6KZIJYL.js +0 -79
- package/dist/chunk-P6KZIJYL.js.map +0 -1
- package/dist/chunk-Q3YXJ2C6.js.map +0 -1
- package/dist/client-Z5UQWPPI.js.map +0 -1
- package/dist/heartbeat-ZCCOIZGU.js.map +0 -1
- package/dist/init-SEJPTOOB.js.map +0 -1
- package/dist/prompt-builder-KJKFCGM7.js +0 -25
- package/dist/queue-2ZBKDFX3.js +0 -14
- package/dist/strategy-Z4JSFHSP.js +0 -12
- package/dist/web-chat-ZZ65DUID.js.map +0 -1
- package/dist/x-client-YG7UCCNI.js +0 -12
- /package/dist/{autonomy-XUKCAZM3.js.map → autonomy-E3DWYRJM.js.map} +0 -0
- /package/dist/{chunk-SUZUJGGW.js.map → chunk-342ZX72W.js.map} +0 -0
- /package/dist/{chunk-JBYZ7K56.js.map → chunk-BBXHECZ5.js.map} +0 -0
- /package/dist/{chunk-WN35MRMF.js.map → chunk-CAWWG3MD.js.map} +0 -0
- /package/dist/{chunk-T7L2L7ZL.js.map → chunk-D47OFTEK.js.map} +0 -0
- /package/dist/{chunk-NO3NQN67.js.map → chunk-QYFNAGNI.js.map} +0 -0
- /package/dist/{chunk-YMGJQRKG.js.map → chunk-RSNEVBEI.js.map} +0 -0
- /package/dist/{chunk-QWEYVDLU.js.map → chunk-SXNZVKLJ.js.map} +0 -0
- /package/dist/{colony-NNX45EAV.js.map → colony-UGVYALOS.js.map} +0 -0
- /package/dist/{config-FL4VJVKZ.js.map → config-MU2ODEO3.js.map} +0 -0
- /package/dist/{crypto-B65ZH7KN.js.map → crypto-GDG5K3ZH.js.map} +0 -0
- /package/dist/{goals-RBKLMILE.js.map → goals-QWX3A47Y.js.map} +0 -0
- /package/dist/{identity-VDUW4I2K.js.map → identity-ASHVWIN5.js.map} +0 -0
- /package/dist/{llm-OGOYCWBH.js.map → llm-IJBRQ7O2.js.map} +0 -0
- /package/dist/{memory-OIAH33G2.js.map → memory-AWKIW2KW.js.map} +0 -0
- /package/dist/{memory-PNW7SX7A.js.map → memory-DTSLVSQG.js.map} +0 -0
- /package/dist/{paths-BYR6MEPR.js.map → paths-4V5OCB5F.js.map} +0 -0
- /package/dist/{prompt-builder-KJKFCGM7.js.map → prompt-builder-NTN4FCBD.js.map} +0 -0
- /package/dist/{queue-2ZBKDFX3.js.map → queue-QCGNDHH2.js.map} +0 -0
- /package/dist/{strategy-Z4JSFHSP.js.map → strategy-R2BMRVJ3.js.map} +0 -0
- /package/dist/{x-client-YG7UCCNI.js.map → x-client-S2LUVEKV.js.map} +0 -0
package/dist/cli.js
CHANGED
|
@@ -8,14 +8,14 @@ import {
|
|
|
8
8
|
mutateIdentity,
|
|
9
9
|
renderIdentityDocument,
|
|
10
10
|
saveIdentity
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-IULO3GRE.js";
|
|
12
12
|
import {
|
|
13
13
|
loadConfig
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-QYFNAGNI.js";
|
|
15
15
|
import {
|
|
16
16
|
hasXCredentials,
|
|
17
17
|
sporaExists
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-ZWKTKWS6.js";
|
|
19
19
|
|
|
20
20
|
// src/cli.ts
|
|
21
21
|
import { Command } from "commander";
|
|
@@ -36,9 +36,9 @@ var cliVersion = JSON.parse(readFileSync(packageJsonPath, "utf-8")).version;
|
|
|
36
36
|
program.name("spora").description("AI agents (Spores) that autonomously manage X/Twitter accounts").version(cliVersion);
|
|
37
37
|
program.command("init").description("Set up X account credentials for your Spore").option("--token <token>", "Connection token from spora.dev for auto-connect").option("--method <method>", "Connection method (api only)").option("--api-key <key>", "X API Key (api mode)").option("--api-secret <secret>", "X API Secret (api mode)").option("--access-token <token>", "X Access Token (api mode)").option("--access-token-secret <secret>", "X Access Token Secret (api mode)").option("--bearer-token <token>", "X Bearer Token (optional, recommended)").option("--api-tier <tier>", "X API tier: free | basic (api mode)").action(async (opts) => {
|
|
38
38
|
if (opts.method) {
|
|
39
|
-
const { ensureDirectories } = await import("./paths-
|
|
40
|
-
const { saveCredentials } = await import("./crypto-
|
|
41
|
-
const { createDefaultConfig, saveConfig } = await import("./config-
|
|
39
|
+
const { ensureDirectories } = await import("./paths-4V5OCB5F.js");
|
|
40
|
+
const { saveCredentials } = await import("./crypto-GDG5K3ZH.js");
|
|
41
|
+
const { createDefaultConfig, saveConfig } = await import("./config-MU2ODEO3.js");
|
|
42
42
|
ensureDirectories();
|
|
43
43
|
if (opts.method !== "api") {
|
|
44
44
|
console.log(JSON.stringify({ error: "Only API mode is supported. Use --method api." }));
|
|
@@ -67,7 +67,7 @@ program.command("init").description("Set up X account credentials for your Spore
|
|
|
67
67
|
console.log(chalk.cyan(BANNER));
|
|
68
68
|
console.log(chalk.bold("Welcome to Spora."));
|
|
69
69
|
console.log(chalk.gray("The global town square for AI agents.\n"));
|
|
70
|
-
const { runInit } = await import("./init-
|
|
70
|
+
const { runInit } = await import("./init-C4OZPGUC.js");
|
|
71
71
|
await runInit(opts.token);
|
|
72
72
|
});
|
|
73
73
|
program.command("serve").description("Start the Spora MCP server (stdio)").action(async () => {
|
|
@@ -79,7 +79,7 @@ program.command("chat").description("Open web-based chat interface with your Spo
|
|
|
79
79
|
console.log(chalk.red("\u2717 No identity found. Run `spora create` first."));
|
|
80
80
|
process.exit(1);
|
|
81
81
|
}
|
|
82
|
-
const { startWebChat } = await import("./web-chat-
|
|
82
|
+
const { startWebChat } = await import("./web-chat-2N2RN6J7.js");
|
|
83
83
|
await startWebChat();
|
|
84
84
|
});
|
|
85
85
|
program.command("tui").description("Start terminal-based chat interface (TUI)").action(async () => {
|
|
@@ -222,7 +222,7 @@ program.command("journal").description("Add a reflection to the evolution journa
|
|
|
222
222
|
});
|
|
223
223
|
program.command("post").description("Post a tweet").argument("<content>", "Tweet content (max 280 chars)").action(async (content) => {
|
|
224
224
|
try {
|
|
225
|
-
const { getXClient } = await import("./x-client-
|
|
225
|
+
const { getXClient } = await import("./x-client-S2LUVEKV.js");
|
|
226
226
|
const client = await getXClient();
|
|
227
227
|
const result = await client.postTweet(content);
|
|
228
228
|
console.log(JSON.stringify(result, null, 2));
|
|
@@ -233,7 +233,7 @@ program.command("post").description("Post a tweet").argument("<content>", "Tweet
|
|
|
233
233
|
});
|
|
234
234
|
program.command("reply").description("Reply to a tweet").argument("<tweetId>", "Tweet ID to reply to").argument("<content>", "Reply content").action(async (tweetId, content) => {
|
|
235
235
|
try {
|
|
236
|
-
const { getXClient } = await import("./x-client-
|
|
236
|
+
const { getXClient } = await import("./x-client-S2LUVEKV.js");
|
|
237
237
|
const client = await getXClient();
|
|
238
238
|
const result = await client.replyToTweet(tweetId, content);
|
|
239
239
|
console.log(JSON.stringify(result, null, 2));
|
|
@@ -244,7 +244,7 @@ program.command("reply").description("Reply to a tweet").argument("<tweetId>", "
|
|
|
244
244
|
});
|
|
245
245
|
program.command("like").description("Like a tweet").argument("<tweetId>", "Tweet ID").action(async (tweetId) => {
|
|
246
246
|
try {
|
|
247
|
-
const { getXClient } = await import("./x-client-
|
|
247
|
+
const { getXClient } = await import("./x-client-S2LUVEKV.js");
|
|
248
248
|
const client = await getXClient();
|
|
249
249
|
const result = await client.likeTweet(tweetId);
|
|
250
250
|
console.log(JSON.stringify(result, null, 2));
|
|
@@ -255,7 +255,7 @@ program.command("like").description("Like a tweet").argument("<tweetId>", "Tweet
|
|
|
255
255
|
});
|
|
256
256
|
program.command("retweet").description("Retweet a tweet").argument("<tweetId>", "Tweet ID").action(async (tweetId) => {
|
|
257
257
|
try {
|
|
258
|
-
const { getXClient } = await import("./x-client-
|
|
258
|
+
const { getXClient } = await import("./x-client-S2LUVEKV.js");
|
|
259
259
|
const client = await getXClient();
|
|
260
260
|
const result = await client.retweet(tweetId);
|
|
261
261
|
console.log(JSON.stringify(result, null, 2));
|
|
@@ -266,7 +266,7 @@ program.command("retweet").description("Retweet a tweet").argument("<tweetId>",
|
|
|
266
266
|
});
|
|
267
267
|
program.command("follow").description("Follow a user").argument("<handle>", "User handle or ID").action(async (handle) => {
|
|
268
268
|
try {
|
|
269
|
-
const { getXClient } = await import("./x-client-
|
|
269
|
+
const { getXClient } = await import("./x-client-S2LUVEKV.js");
|
|
270
270
|
const client = await getXClient();
|
|
271
271
|
const result = await client.followUser(handle);
|
|
272
272
|
console.log(JSON.stringify(result, null, 2));
|
|
@@ -277,7 +277,7 @@ program.command("follow").description("Follow a user").argument("<handle>", "Use
|
|
|
277
277
|
});
|
|
278
278
|
program.command("unfollow").description("Unfollow a user").argument("<handle>", "User handle or ID").action(async (handle) => {
|
|
279
279
|
try {
|
|
280
|
-
const { getXClient } = await import("./x-client-
|
|
280
|
+
const { getXClient } = await import("./x-client-S2LUVEKV.js");
|
|
281
281
|
const client = await getXClient();
|
|
282
282
|
const result = await client.unfollowUser(handle);
|
|
283
283
|
console.log(JSON.stringify(result, null, 2));
|
|
@@ -288,7 +288,7 @@ program.command("unfollow").description("Unfollow a user").argument("<handle>",
|
|
|
288
288
|
});
|
|
289
289
|
program.command("timeline").description("Read home timeline").option("-c, --count <n>", "Number of tweets", "20").action(async (opts) => {
|
|
290
290
|
try {
|
|
291
|
-
const { getXClient } = await import("./x-client-
|
|
291
|
+
const { getXClient } = await import("./x-client-S2LUVEKV.js");
|
|
292
292
|
const client = await getXClient();
|
|
293
293
|
const result = await client.getTimeline({ count: parseInt(opts.count) });
|
|
294
294
|
console.log(JSON.stringify(result, null, 2));
|
|
@@ -299,7 +299,7 @@ program.command("timeline").description("Read home timeline").option("-c, --coun
|
|
|
299
299
|
});
|
|
300
300
|
program.command("mentions").description("Read mentions").option("-c, --count <n>", "Number of mentions", "20").action(async (opts) => {
|
|
301
301
|
try {
|
|
302
|
-
const { getXClient } = await import("./x-client-
|
|
302
|
+
const { getXClient } = await import("./x-client-S2LUVEKV.js");
|
|
303
303
|
const client = await getXClient();
|
|
304
304
|
const result = await client.getMentions({ count: parseInt(opts.count) });
|
|
305
305
|
console.log(JSON.stringify(result, null, 2));
|
|
@@ -310,7 +310,7 @@ program.command("mentions").description("Read mentions").option("-c, --count <n>
|
|
|
310
310
|
});
|
|
311
311
|
program.command("search").description("Search for tweets").argument("<query>", "Search query").option("-c, --count <n>", "Number of results", "20").action(async (query, opts) => {
|
|
312
312
|
try {
|
|
313
|
-
const { getXClient } = await import("./x-client-
|
|
313
|
+
const { getXClient } = await import("./x-client-S2LUVEKV.js");
|
|
314
314
|
const client = await getXClient();
|
|
315
315
|
const result = await client.searchTweets(query, { count: parseInt(opts.count) });
|
|
316
316
|
console.log(JSON.stringify(result, null, 2));
|
|
@@ -321,7 +321,7 @@ program.command("search").description("Search for tweets").argument("<query>", "
|
|
|
321
321
|
});
|
|
322
322
|
program.command("profile").description("Get a user's X profile").argument("<handle>", "X handle (without @)").action(async (handle) => {
|
|
323
323
|
try {
|
|
324
|
-
const { getXClient } = await import("./x-client-
|
|
324
|
+
const { getXClient } = await import("./x-client-S2LUVEKV.js");
|
|
325
325
|
const client = await getXClient();
|
|
326
326
|
const result = await client.getProfile(handle);
|
|
327
327
|
console.log(JSON.stringify(result, null, 2));
|
|
@@ -343,7 +343,7 @@ program.command("credits").description("Check remaining posting credits").action
|
|
|
343
343
|
});
|
|
344
344
|
program.command("memory").description("Read memory (interactions, learnings, relationships)").argument("<type>", "interactions | learnings | relationships").option("-d, --date <date>", "For interactions: specific date (YYYY-MM-DD)").option("-c, --count <n>", "For interactions: count", "20").action(async (type, opts) => {
|
|
345
345
|
try {
|
|
346
|
-
const { getRecentInteractions, getInteractions, loadLearnings, loadRelationships } = await import("./memory-
|
|
346
|
+
const { getRecentInteractions, getInteractions, loadLearnings, loadRelationships } = await import("./memory-DTSLVSQG.js");
|
|
347
347
|
let data;
|
|
348
348
|
switch (type) {
|
|
349
349
|
case "interactions":
|
|
@@ -367,7 +367,7 @@ program.command("memory").description("Read memory (interactions, learnings, rel
|
|
|
367
367
|
});
|
|
368
368
|
program.command("learn").description("Store a learning").argument("<content>", "What you learned").option("-t, --tags <tags...>", "Tags for categorization").action(async (content, opts) => {
|
|
369
369
|
try {
|
|
370
|
-
const { addLearning } = await import("./memory-
|
|
370
|
+
const { addLearning } = await import("./memory-DTSLVSQG.js");
|
|
371
371
|
addLearning(content, "agent", opts.tags ?? []);
|
|
372
372
|
console.log(JSON.stringify({ success: true }));
|
|
373
373
|
} catch (error) {
|
|
@@ -377,7 +377,7 @@ program.command("learn").description("Store a learning").argument("<content>", "
|
|
|
377
377
|
});
|
|
378
378
|
program.command("note").description("Add a relationship note about someone").argument("<handle>", "Their X handle").argument("<content>", "Your note").action(async (handle, content) => {
|
|
379
379
|
try {
|
|
380
|
-
const { updateRelationship } = await import("./memory-
|
|
380
|
+
const { updateRelationship } = await import("./memory-DTSLVSQG.js");
|
|
381
381
|
updateRelationship(handle, { handle, notes: [content] });
|
|
382
382
|
console.log(JSON.stringify({ success: true, handle }));
|
|
383
383
|
} catch (error) {
|
|
@@ -387,7 +387,7 @@ program.command("note").description("Add a relationship note about someone").arg
|
|
|
387
387
|
});
|
|
388
388
|
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) => {
|
|
389
389
|
try {
|
|
390
|
-
const { addToQueue } = await import("./queue-
|
|
390
|
+
const { addToQueue } = await import("./queue-QCGNDHH2.js");
|
|
391
391
|
const entry = addToQueue(content, opts.at);
|
|
392
392
|
console.log(JSON.stringify({ success: true, id: entry.id, scheduledFor: entry.scheduledFor }));
|
|
393
393
|
} catch (error) {
|
|
@@ -397,7 +397,7 @@ program.command("schedule").description("Queue a post for later").argument("<con
|
|
|
397
397
|
});
|
|
398
398
|
program.command("flush").description("Post all queued items whose time has come").action(async () => {
|
|
399
399
|
try {
|
|
400
|
-
const { flushQueue } = await import("./queue-
|
|
400
|
+
const { flushQueue } = await import("./queue-QCGNDHH2.js");
|
|
401
401
|
const results = await flushQueue();
|
|
402
402
|
console.log(JSON.stringify(results, null, 2));
|
|
403
403
|
} catch (error) {
|
|
@@ -406,13 +406,13 @@ program.command("flush").description("Post all queued items whose time has come"
|
|
|
406
406
|
}
|
|
407
407
|
});
|
|
408
408
|
program.command("queue").description("Show scheduled posts").action(async () => {
|
|
409
|
-
const { showQueue } = await import("./queue-
|
|
409
|
+
const { showQueue } = await import("./queue-QCGNDHH2.js");
|
|
410
410
|
showQueue();
|
|
411
411
|
});
|
|
412
412
|
var colony = program.command("colony").description("Colony commands");
|
|
413
413
|
colony.command("checkin").description("Check into The Colony \u2014 sync memory, discover Spores").option("-m, --message <msg>", "Optional message to post").action(async (opts) => {
|
|
414
414
|
try {
|
|
415
|
-
const { colonyCheckin } = await import("./colony-
|
|
415
|
+
const { colonyCheckin } = await import("./colony-UGVYALOS.js");
|
|
416
416
|
const result = await colonyCheckin(opts.message);
|
|
417
417
|
console.log(JSON.stringify(result, null, 2));
|
|
418
418
|
} catch (error) {
|
|
@@ -422,7 +422,7 @@ colony.command("checkin").description("Check into The Colony \u2014 sync memory,
|
|
|
422
422
|
});
|
|
423
423
|
colony.command("memory").description("Read the Colony's shared memory").action(async () => {
|
|
424
424
|
try {
|
|
425
|
-
const { renderColonyBriefing } = await import("./memory-
|
|
425
|
+
const { renderColonyBriefing } = await import("./memory-AWKIW2KW.js");
|
|
426
426
|
console.log(renderColonyBriefing());
|
|
427
427
|
} catch (error) {
|
|
428
428
|
console.log(JSON.stringify({ error: error.message }));
|
|
@@ -431,7 +431,7 @@ colony.command("memory").description("Read the Colony's shared memory").action(a
|
|
|
431
431
|
});
|
|
432
432
|
colony.command("plans").description("Get all active Colony plans").action(async () => {
|
|
433
433
|
try {
|
|
434
|
-
const { getActivePlans } = await import("./colony-
|
|
434
|
+
const { getActivePlans } = await import("./colony-UGVYALOS.js");
|
|
435
435
|
const plans = getActivePlans();
|
|
436
436
|
console.log(plans.length > 0 ? JSON.stringify(plans, null, 2) : JSON.stringify({ message: "No active plans. Propose one!" }));
|
|
437
437
|
} catch (error) {
|
|
@@ -441,7 +441,7 @@ colony.command("plans").description("Get all active Colony plans").action(async
|
|
|
441
441
|
});
|
|
442
442
|
colony.command("propose").description("Propose a coordinated plan").argument("<description>", "What's the plan?").action(async (description) => {
|
|
443
443
|
try {
|
|
444
|
-
const { proposePlan } = await import("./colony-
|
|
444
|
+
const { proposePlan } = await import("./colony-UGVYALOS.js");
|
|
445
445
|
const result = await proposePlan(description);
|
|
446
446
|
console.log(JSON.stringify(result, null, 2));
|
|
447
447
|
} catch (error) {
|
|
@@ -451,7 +451,7 @@ colony.command("propose").description("Propose a coordinated plan").argument("<d
|
|
|
451
451
|
});
|
|
452
452
|
colony.command("join").description("Join an active plan").argument("<planId>", "Plan ID").action(async (planId) => {
|
|
453
453
|
try {
|
|
454
|
-
const { joinPlan } = await import("./colony-
|
|
454
|
+
const { joinPlan } = await import("./colony-UGVYALOS.js");
|
|
455
455
|
const result = await joinPlan(planId);
|
|
456
456
|
console.log(JSON.stringify(result, null, 2));
|
|
457
457
|
} catch (error) {
|
|
@@ -461,7 +461,7 @@ colony.command("join").description("Join an active plan").argument("<planId>", "
|
|
|
461
461
|
});
|
|
462
462
|
colony.command("post-status").description("Post a status update to the Colony").argument("<status>", "Your status").action(async (status) => {
|
|
463
463
|
try {
|
|
464
|
-
const { postStatus } = await import("./colony-
|
|
464
|
+
const { postStatus } = await import("./colony-UGVYALOS.js");
|
|
465
465
|
const result = await postStatus(status);
|
|
466
466
|
console.log(JSON.stringify(result, null, 2));
|
|
467
467
|
} catch (error) {
|
|
@@ -471,7 +471,7 @@ colony.command("post-status").description("Post a status update to the Colony").
|
|
|
471
471
|
});
|
|
472
472
|
colony.command("activity").description("Get today's Colony activity").action(async () => {
|
|
473
473
|
try {
|
|
474
|
-
const { getTodaysActivity } = await import("./colony-
|
|
474
|
+
const { getTodaysActivity } = await import("./colony-UGVYALOS.js");
|
|
475
475
|
const activity = getTodaysActivity();
|
|
476
476
|
console.log(activity.length > 0 ? JSON.stringify(activity, null, 2) : JSON.stringify({ message: "No Colony activity today yet." }));
|
|
477
477
|
} catch (error) {
|
|
@@ -488,24 +488,24 @@ program.command("start").description("Start the autonomous Spora agent").option(
|
|
|
488
488
|
console.log(JSON.stringify({ error: "No X credentials. Run `spora init` to set up." }));
|
|
489
489
|
process.exit(1);
|
|
490
490
|
}
|
|
491
|
-
const { hasLLMKey } = await import("./llm-
|
|
491
|
+
const { hasLLMKey } = await import("./llm-IJBRQ7O2.js");
|
|
492
492
|
if (!hasLLMKey()) {
|
|
493
493
|
console.log(JSON.stringify({ error: "No LLM API key. Run `spora llm set --provider <provider>` first." }));
|
|
494
494
|
process.exit(1);
|
|
495
495
|
}
|
|
496
496
|
if (opts.interval) {
|
|
497
|
-
const { loadConfig: lc, saveConfig: sc } = await import("./config-
|
|
497
|
+
const { loadConfig: lc, saveConfig: sc } = await import("./config-MU2ODEO3.js");
|
|
498
498
|
const config = lc();
|
|
499
499
|
config.runtime = { ...config.runtime, heartbeatIntervalMs: parseInt(opts.interval, 10), actionsPerHeartbeat: config.runtime?.actionsPerHeartbeat ?? 4, enabled: true };
|
|
500
500
|
sc(config);
|
|
501
501
|
}
|
|
502
502
|
console.log(chalk.cyan(BANNER));
|
|
503
503
|
console.log(chalk.bold("Starting Spora agent...\n"));
|
|
504
|
-
const { startHeartbeatLoop } = await import("./heartbeat-
|
|
504
|
+
const { startHeartbeatLoop } = await import("./heartbeat-GVBLNAFM.js");
|
|
505
505
|
await startHeartbeatLoop();
|
|
506
506
|
});
|
|
507
507
|
program.command("stop").description("Stop the running Spora agent").action(async () => {
|
|
508
|
-
const { getRunningPid, requestStop } = await import("./heartbeat-
|
|
508
|
+
const { getRunningPid, requestStop } = await import("./heartbeat-GVBLNAFM.js");
|
|
509
509
|
const pid = getRunningPid();
|
|
510
510
|
if (!pid) {
|
|
511
511
|
console.log(JSON.stringify({ message: "Spora agent is not running." }));
|
|
@@ -515,10 +515,10 @@ program.command("stop").description("Stop the running Spora agent").action(async
|
|
|
515
515
|
console.log(JSON.stringify({ message: `Stop signal sent to PID ${pid}.` }));
|
|
516
516
|
});
|
|
517
517
|
program.command("set-llm-key").description("Legacy alias: set API key for currently configured LLM provider").argument("[key]", "API key (or omit to enter interactively)").action(async (key) => {
|
|
518
|
-
const { ensureDirectories: ed } = await import("./paths-
|
|
518
|
+
const { ensureDirectories: ed } = await import("./paths-4V5OCB5F.js");
|
|
519
519
|
const { input } = await import("@inquirer/prompts");
|
|
520
|
-
const { loadConfig: lc } = await import("./config-
|
|
521
|
-
const { setLLMApiKey, getDefaultModel } = await import("./llm-
|
|
520
|
+
const { loadConfig: lc } = await import("./config-MU2ODEO3.js");
|
|
521
|
+
const { setLLMApiKey, getDefaultModel } = await import("./llm-IJBRQ7O2.js");
|
|
522
522
|
ed();
|
|
523
523
|
let provider = "deepseek";
|
|
524
524
|
let model = getDefaultModel("deepseek");
|
|
@@ -534,8 +534,8 @@ program.command("set-llm-key").description("Legacy alias: set API key for curren
|
|
|
534
534
|
});
|
|
535
535
|
var llm = program.command("llm").description("LLM provider/model settings");
|
|
536
536
|
llm.command("status").description("Show current provider/model and which keys are configured").action(async () => {
|
|
537
|
-
const { loadConfig: lc } = await import("./config-
|
|
538
|
-
const { listLLMKeyStatus, getDefaultModel } = await import("./llm-
|
|
537
|
+
const { loadConfig: lc } = await import("./config-MU2ODEO3.js");
|
|
538
|
+
const { listLLMKeyStatus, getDefaultModel } = await import("./llm-IJBRQ7O2.js");
|
|
539
539
|
let provider = "deepseek";
|
|
540
540
|
let model = getDefaultModel("deepseek");
|
|
541
541
|
try {
|
|
@@ -557,9 +557,9 @@ llm.command("set").description("Set provider/model and store API key").requiredO
|
|
|
557
557
|
process.exit(1);
|
|
558
558
|
}
|
|
559
559
|
const { input } = await import("@inquirer/prompts");
|
|
560
|
-
const { loadConfig: lc, saveConfig: sc } = await import("./config-
|
|
561
|
-
const { setLLMApiKey, getDefaultModel } = await import("./llm-
|
|
562
|
-
const { ensureDirectories: ed } = await import("./paths-
|
|
560
|
+
const { loadConfig: lc, saveConfig: sc } = await import("./config-MU2ODEO3.js");
|
|
561
|
+
const { setLLMApiKey, getDefaultModel } = await import("./llm-IJBRQ7O2.js");
|
|
562
|
+
const { ensureDirectories: ed } = await import("./paths-4V5OCB5F.js");
|
|
563
563
|
ed();
|
|
564
564
|
const model = opts.model ?? getDefaultModel(provider);
|
|
565
565
|
const apiKey = (opts.key ?? await input({ message: `Enter your ${provider} API key:` })).trim();
|
|
@@ -575,7 +575,7 @@ llm.command("set").description("Set provider/model and store API key").requiredO
|
|
|
575
575
|
});
|
|
576
576
|
llm.command("test").description("Send a tiny test prompt to validate current LLM config").action(async () => {
|
|
577
577
|
try {
|
|
578
|
-
const { chat } = await import("./llm-
|
|
578
|
+
const { chat } = await import("./llm-IJBRQ7O2.js");
|
|
579
579
|
const response = await chat(
|
|
580
580
|
"You are a short diagnostic assistant. Reply with exactly: ok",
|
|
581
581
|
[{ role: "user", content: "health check" }]
|
|
@@ -587,9 +587,9 @@ llm.command("test").description("Send a tiny test prompt to validate current LLM
|
|
|
587
587
|
}
|
|
588
588
|
});
|
|
589
589
|
program.command("agent-status").description("Check if the Spora agent is running").action(async () => {
|
|
590
|
-
const { getRunningPid } = await import("./heartbeat-
|
|
590
|
+
const { getRunningPid } = await import("./heartbeat-GVBLNAFM.js");
|
|
591
591
|
const pid = getRunningPid();
|
|
592
|
-
const { hasLLMKey } = await import("./llm-
|
|
592
|
+
const { hasLLMKey } = await import("./llm-IJBRQ7O2.js");
|
|
593
593
|
console.log(JSON.stringify({
|
|
594
594
|
agentRunning: pid !== null,
|
|
595
595
|
pid,
|
|
@@ -600,7 +600,7 @@ program.command("agent-status").description("Check if the Spora agent is running
|
|
|
600
600
|
});
|
|
601
601
|
program.command("agent-metrics").description("Show recent heartbeat metrics for autonomy quality").option("-n, --count <n>", "Number of entries", "20").action(async (opts) => {
|
|
602
602
|
const { existsSync, readFileSync: readFileSync2 } = await import("fs");
|
|
603
|
-
const { paths } = await import("./paths-
|
|
603
|
+
const { paths } = await import("./paths-4V5OCB5F.js");
|
|
604
604
|
const count = Math.max(1, parseInt(opts.count, 10) || 20);
|
|
605
605
|
if (!existsSync(paths.runtimeMetrics)) {
|
|
606
606
|
console.log(JSON.stringify({ message: "No metrics recorded yet." }));
|
|
@@ -619,7 +619,7 @@ program.command("doctor").description("Run diagnostics for X API, LLM provider,
|
|
|
619
619
|
checks.push({ check: "config", ok: false, detail: error.message });
|
|
620
620
|
}
|
|
621
621
|
try {
|
|
622
|
-
const { hasLLMKey, chat } = await import("./llm-
|
|
622
|
+
const { hasLLMKey, chat } = await import("./llm-IJBRQ7O2.js");
|
|
623
623
|
if (!hasLLMKey()) {
|
|
624
624
|
checks.push({ check: "llm_key", ok: false, detail: "No key configured for current provider" });
|
|
625
625
|
} else {
|
|
@@ -633,7 +633,7 @@ program.command("doctor").description("Run diagnostics for X API, LLM provider,
|
|
|
633
633
|
checks.push({ check: "llm_call", ok: false, detail: error.message });
|
|
634
634
|
}
|
|
635
635
|
try {
|
|
636
|
-
const { getXClient } = await import("./x-client-
|
|
636
|
+
const { getXClient } = await import("./x-client-S2LUVEKV.js");
|
|
637
637
|
const client = await getXClient();
|
|
638
638
|
const timeline = await client.getTimeline({ count: 3 });
|
|
639
639
|
checks.push({ check: "x_api_timeline", ok: true, detail: `timeline_count=${timeline.length}` });
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
|
-
rateLimiter
|
|
3
|
-
|
|
2
|
+
rateLimiter,
|
|
3
|
+
trackPost
|
|
4
|
+
} from "./chunk-CP6JWCLY.js";
|
|
4
5
|
import {
|
|
5
6
|
identityExists,
|
|
6
7
|
loadIdentity
|
|
7
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-IULO3GRE.js";
|
|
8
9
|
import {
|
|
9
10
|
loadCredentials
|
|
10
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-SXNZVKLJ.js";
|
|
11
12
|
import {
|
|
12
13
|
logger
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import "./chunk-
|
|
14
|
+
} from "./chunk-RSNEVBEI.js";
|
|
15
|
+
import "./chunk-QYFNAGNI.js";
|
|
15
16
|
import {
|
|
16
17
|
logInteraction
|
|
17
|
-
} from "./chunk-
|
|
18
|
-
import "./chunk-
|
|
18
|
+
} from "./chunk-BBXHECZ5.js";
|
|
19
|
+
import "./chunk-ZWKTKWS6.js";
|
|
19
20
|
|
|
20
21
|
// src/x-client/api/client.ts
|
|
21
22
|
import { TwitterApi } from "twitter-api-v2";
|
|
@@ -67,10 +68,11 @@ var XApiClient = class {
|
|
|
67
68
|
};
|
|
68
69
|
}
|
|
69
70
|
/**
|
|
70
|
-
*
|
|
71
|
+
* 4-strategy approach to resolve the authenticated user's ID.
|
|
71
72
|
* 1. Extract from OAuth access token (format: {userId}-{rest})
|
|
72
73
|
* 2. Use /2/users/me endpoint
|
|
73
|
-
* 3.
|
|
74
|
+
* 3. Use v1.1 verify_credentials endpoint
|
|
75
|
+
* 4. Fall back to userByUsername lookup
|
|
74
76
|
*/
|
|
75
77
|
async getUserId() {
|
|
76
78
|
if (this.meId) return this.meId;
|
|
@@ -98,24 +100,33 @@ var XApiClient = class {
|
|
|
98
100
|
} catch (err) {
|
|
99
101
|
logger.warn(`/me endpoint failed: ${extractTwitterError(err)}`);
|
|
100
102
|
}
|
|
103
|
+
try {
|
|
104
|
+
const me = await this.readWrite.v1.verifyCredentials();
|
|
105
|
+
const id = me.id_str ?? (typeof me.id === "number" ? String(me.id) : me.id);
|
|
106
|
+
if (id) {
|
|
107
|
+
logger.info(`User ID from verify_credentials: ${id}${me.screen_name ? ` (@${me.screen_name})` : ""}`);
|
|
108
|
+
this.meId = id;
|
|
109
|
+
return this.meId;
|
|
110
|
+
}
|
|
111
|
+
} catch (err) {
|
|
112
|
+
logger.warn(`verify_credentials failed: ${extractTwitterError(err)}`);
|
|
113
|
+
}
|
|
101
114
|
const handle = this.getHandle();
|
|
102
115
|
logger.info(`Trying userByUsername lookup for: ${handle}`);
|
|
103
116
|
const result = await this.readOnly.v2.userByUsername(handle);
|
|
104
117
|
if (!result.data) {
|
|
105
118
|
const errInfo = result.errors;
|
|
106
119
|
throw new Error(
|
|
107
|
-
`Could not
|
|
120
|
+
`Could not resolve authenticated user ID. Username fallback @${handle} failed: ${JSON.stringify(errInfo ?? "no data")}`
|
|
108
121
|
);
|
|
109
122
|
}
|
|
110
123
|
this.meId = result.data.id;
|
|
111
124
|
return this.meId;
|
|
112
125
|
}
|
|
113
126
|
getHandle() {
|
|
114
|
-
let handle;
|
|
115
|
-
if (identityExists()) {
|
|
127
|
+
let handle = this.creds.username;
|
|
128
|
+
if (!handle && identityExists()) {
|
|
116
129
|
handle = loadIdentity().handle;
|
|
117
|
-
} else {
|
|
118
|
-
handle = this.creds.username;
|
|
119
130
|
}
|
|
120
131
|
if (!handle) throw new Error("No handle found. Create a Spore identity first.");
|
|
121
132
|
return handle.replace(/^@/, "");
|
|
@@ -154,6 +165,7 @@ var XApiClient = class {
|
|
|
154
165
|
return { success: false, error: "X API did not return a tweet ID." };
|
|
155
166
|
}
|
|
156
167
|
rateLimiter.consume(1);
|
|
168
|
+
trackPost(tweetId, content, "post");
|
|
157
169
|
logInteraction({
|
|
158
170
|
id: `int-${Date.now()}`,
|
|
159
171
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -181,6 +193,7 @@ var XApiClient = class {
|
|
|
181
193
|
return { success: false, error: "X API did not return a reply ID." };
|
|
182
194
|
}
|
|
183
195
|
rateLimiter.consume(1);
|
|
196
|
+
trackPost(createdId, content, "reply");
|
|
184
197
|
logInteraction({
|
|
185
198
|
id: `int-${Date.now()}`,
|
|
186
199
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -386,6 +399,25 @@ var XApiClient = class {
|
|
|
386
399
|
return [];
|
|
387
400
|
}
|
|
388
401
|
}
|
|
402
|
+
async getTweetMetrics(tweetId) {
|
|
403
|
+
try {
|
|
404
|
+
rateLimiter.requireBasicTier("Read tweet metrics");
|
|
405
|
+
const response = await this.readOnly.v2.singleTweet(tweetId, {
|
|
406
|
+
"tweet.fields": ["public_metrics"]
|
|
407
|
+
});
|
|
408
|
+
const metrics = response.data?.public_metrics;
|
|
409
|
+
if (!metrics) return null;
|
|
410
|
+
return {
|
|
411
|
+
likeCount: metrics.like_count ?? 0,
|
|
412
|
+
retweetCount: metrics.retweet_count ?? 0,
|
|
413
|
+
replyCount: metrics.reply_count ?? 0
|
|
414
|
+
};
|
|
415
|
+
} catch (error) {
|
|
416
|
+
const detail = extractTwitterError(error);
|
|
417
|
+
logger.warn(`Failed to read tweet metrics for ${tweetId}: ${detail}`);
|
|
418
|
+
return null;
|
|
419
|
+
}
|
|
420
|
+
}
|
|
389
421
|
async getProfile(handle) {
|
|
390
422
|
rateLimiter.requireBasicTier("Get profile");
|
|
391
423
|
const cleanedHandle = handle.trim().replace(/^@/, "");
|
|
@@ -418,4 +450,4 @@ var XApiClient = class {
|
|
|
418
450
|
export {
|
|
419
451
|
XApiClient
|
|
420
452
|
};
|
|
421
|
-
//# sourceMappingURL=client-
|
|
453
|
+
//# sourceMappingURL=client-AR5ZD6S4.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/x-client/api/client.ts"],"sourcesContent":["import { TwitterApi } from \"twitter-api-v2\";\nimport { loadCredentials } from \"../../utils/crypto.js\";\nimport { logger } from \"../../utils/logger.js\";\nimport { loadIdentity, identityExists } from \"../../identity/index.js\";\nimport { logInteraction } from \"../../memory/index.js\";\nimport { trackPost } from \"../../memory/performance.js\";\nimport { rateLimiter } from \"../rate-limiter.js\";\nimport type {\n XClientInterface,\n Tweet,\n TweetMetrics,\n UserProfile,\n PostResult,\n TimelineOptions,\n SearchOptions,\n} from \"../types.js\";\n\ninterface TwitterResponseMeta {\n next_token?: string;\n}\n\ninterface TwitterUser {\n id: string;\n username: string;\n name?: string;\n description?: string;\n verified?: boolean;\n profile_image_url?: string;\n public_metrics?: {\n followers_count?: number;\n following_count?: number;\n tweet_count?: number;\n };\n}\n\ninterface TwitterTweet {\n id: string;\n text: string;\n author_id?: string;\n created_at?: string;\n in_reply_to_user_id?: string;\n public_metrics?: {\n like_count?: number;\n retweet_count?: number;\n reply_count?: number;\n };\n}\n\ninterface TwitterTimelineResponse {\n data?: TwitterTweet[];\n includes?: {\n users?: TwitterUser[];\n };\n meta?: TwitterResponseMeta;\n}\n\n/**\n * Extract useful error details from twitter-api-v2 errors.\n * Their ApiResponseError has .code, .data, .errors properties that JSON.stringify misses.\n */\nfunction extractTwitterError(error: unknown): string {\n if (!error || typeof error !== \"object\") return String(error);\n const e = error as Record<string, unknown>;\n\n // twitter-api-v2 ApiResponseError shape\n if (e.code && e.data) {\n const status = e.code;\n const data = e.data as Record<string, unknown>;\n const errors = (data.errors ?? data.detail ?? data.title ?? data.reason) as unknown;\n return `HTTP ${status}: ${JSON.stringify(errors ?? data)}`;\n }\n\n // Fallback for standard errors\n if (e.message) return e.message as string;\n return String(error);\n}\n\nexport class XApiClient implements XClientInterface {\n private readonly readWrite: TwitterApi;\n private readonly readOnly: TwitterApi;\n private meId: string | null = null;\n private creds: ReturnType<typeof loadCredentials>;\n\n constructor() {\n this.creds = loadCredentials();\n if (this.creds.method !== \"api\") {\n throw new Error(\"Only API credentials are supported.\");\n }\n\n if (!this.creds.apiKey || !this.creds.apiSecret || !this.creds.accessToken || !this.creds.accessTokenSecret) {\n throw new Error(\"Missing X OAuth credentials. Run `spora init` and provide API keys.\");\n }\n\n this.readWrite = new TwitterApi({\n appKey: this.creds.apiKey,\n appSecret: this.creds.apiSecret,\n accessToken: this.creds.accessToken,\n accessSecret: this.creds.accessTokenSecret,\n });\n\n // Use user-context auth for all reads in runtime.\n // Some endpoints we rely on (timeline/mentions) reject OAuth2 app-only auth.\n this.readOnly = this.readWrite;\n }\n\n private toTweet(tweet: TwitterTweet, userMap: Map<string, string>): Tweet {\n const authorId = tweet.author_id ?? \"unknown\";\n return {\n id: tweet.id,\n text: tweet.text,\n authorId,\n authorHandle: userMap.get(authorId) ?? \"unknown\",\n createdAt: tweet.created_at ?? new Date().toISOString(),\n likeCount: tweet.public_metrics?.like_count,\n retweetCount: tweet.public_metrics?.retweet_count,\n replyCount: tweet.public_metrics?.reply_count,\n inReplyToId: tweet.in_reply_to_user_id,\n };\n }\n\n /**\n * 4-strategy approach to resolve the authenticated user's ID.\n * 1. Extract from OAuth access token (format: {userId}-{rest})\n * 2. Use /2/users/me endpoint\n * 3. Use v1.1 verify_credentials endpoint\n * 4. Fall back to userByUsername lookup\n */\n private async getUserId(): Promise<string> {\n if (this.meId) return this.meId;\n\n // Strategy 1: Extract user ID from OAuth access token (format: {userId}-{rest})\n const accessToken = this.creds.accessToken;\n if (accessToken) {\n const dashIdx = accessToken.indexOf(\"-\");\n if (dashIdx > 0) {\n const candidate = accessToken.substring(0, dashIdx);\n if (/^\\d+$/.test(candidate)) {\n logger.info(`User ID extracted from access token: ${candidate}`);\n this.meId = candidate;\n return this.meId;\n }\n }\n }\n\n // Strategy 2: Use /2/users/me endpoint\n try {\n const me = (await this.readWrite.v2.me({\n \"user.fields\": [\"id\"],\n })) as { data?: { id: string; username?: string } };\n\n if (me.data?.id) {\n logger.info(`User ID from /me endpoint: ${me.data.id}${me.data.username ? ` (@${me.data.username})` : \"\"}`);\n this.meId = me.data.id;\n return this.meId;\n }\n } catch (err) {\n logger.warn(`/me endpoint failed: ${extractTwitterError(err)}`);\n }\n\n // Strategy 3: v1.1 verify_credentials (works reliably for OAuth 1.0a user context)\n try {\n const me = (await this.readWrite.v1.verifyCredentials()) as {\n id_str?: string;\n id?: string | number;\n screen_name?: string;\n };\n const id = me.id_str ?? (typeof me.id === \"number\" ? String(me.id) : me.id);\n if (id) {\n logger.info(`User ID from verify_credentials: ${id}${me.screen_name ? ` (@${me.screen_name})` : \"\"}`);\n this.meId = id;\n return this.meId;\n }\n } catch (err) {\n logger.warn(`verify_credentials failed: ${extractTwitterError(err)}`);\n }\n\n // Strategy 4: Fall back to username lookup\n const handle = this.getHandle();\n logger.info(`Trying userByUsername lookup for: ${handle}`);\n const result = await this.readOnly.v2.userByUsername(handle);\n if (!(result as { data?: { id: string } }).data) {\n const errInfo = (result as Record<string, unknown>).errors;\n throw new Error(\n `Could not resolve authenticated user ID. Username fallback @${handle} failed: ${JSON.stringify(errInfo ?? \"no data\")}`\n );\n }\n this.meId = (result as { data: { id: string } }).data.id;\n return this.meId;\n }\n\n private getHandle(): string {\n // Prefer credential-sourced username because it's tied to auth;\n // identity handle can drift if user changes @handle on X.\n let handle: string | undefined = this.creds.username;\n if (!handle && identityExists()) {\n handle = loadIdentity().handle;\n }\n if (!handle) throw new Error(\"No handle found. Create a Spore identity first.\");\n // Strip @ prefix — twitter-api-v2 userByUsername expects bare handle\n return handle.replace(/^@/, \"\");\n }\n\n private normalizeHandleOrId(input: string): { isId: boolean; value: string } {\n const cleaned = input.trim().replace(/^@/, \"\");\n const isId = /^\\d+$/.test(cleaned);\n return { isId, value: cleaned };\n }\n\n private async resolveUserId(handleOrId: string): Promise<string> {\n const parsed = this.normalizeHandleOrId(handleOrId);\n if (parsed.isId) return parsed.value;\n\n const user = (await this.readOnly.v2.userByUsername(parsed.value, {\n \"user.fields\": [\"id\", \"username\"],\n })) as { data?: { id: string } };\n\n if (!user.data?.id) {\n throw new Error(`Could not resolve @${parsed.value} to a user ID`);\n }\n\n return user.data.id;\n }\n\n private buildUserMap(users: TwitterUser[] | undefined): Map<string, string> {\n const map = new Map<string, string>();\n for (const user of users ?? []) {\n map.set(user.id, user.username);\n }\n return map;\n }\n\n async postTweet(content: string): Promise<PostResult> {\n if (!rateLimiter.canPost()) {\n return { success: false, error: \"Monthly post limit reached\" };\n }\n\n try {\n const response = (await this.readWrite.v2.tweet(content)) as { data?: { id?: string } };\n const tweetId = response.data?.id;\n\n if (!tweetId) {\n return { success: false, error: \"X API did not return a tweet ID.\" };\n }\n\n rateLimiter.consume(1);\n trackPost(tweetId, content, \"post\");\n logInteraction({\n id: `int-${Date.now()}`,\n timestamp: new Date().toISOString(),\n type: \"post\",\n tweetId,\n content,\n creditsUsed: 1,\n success: true,\n });\n\n return { success: true, tweetId };\n } catch (error) {\n const detail = extractTwitterError(error);\n logger.error(`Failed to post tweet: ${detail}`);\n return { success: false, error: detail };\n }\n }\n\n async replyToTweet(tweetId: string, content: string): Promise<PostResult> {\n if (!rateLimiter.canPost()) {\n return { success: false, error: \"Monthly post limit reached\" };\n }\n\n try {\n const response = (await this.readWrite.v2.reply(content, tweetId)) as {\n data?: { id?: string };\n };\n const createdId = response.data?.id;\n\n if (!createdId) {\n return { success: false, error: \"X API did not return a reply ID.\" };\n }\n\n rateLimiter.consume(1);\n trackPost(createdId, content, \"reply\");\n logInteraction({\n id: `int-${Date.now()}`,\n timestamp: new Date().toISOString(),\n type: \"reply\",\n tweetId: createdId,\n inReplyTo: tweetId,\n content,\n creditsUsed: 1,\n success: true,\n });\n\n return { success: true, tweetId: createdId };\n } catch (error) {\n const detail = extractTwitterError(error);\n logger.error(`Failed to reply: ${detail}`);\n return { success: false, error: detail };\n }\n }\n\n async deleteTweet(tweetId: string): Promise<PostResult> {\n try {\n await this.readWrite.v2.deleteTweet(tweetId);\n return { success: true, tweetId };\n } catch (error) {\n return { success: false, error: (error as Error).message };\n }\n }\n\n async likeTweet(tweetId: string): Promise<PostResult> {\n try {\n rateLimiter.requireBasicTier(\"Like\");\n const meId = await this.getUserId();\n await this.readWrite.v2.like(meId, tweetId);\n\n logInteraction({\n id: `int-${Date.now()}`,\n timestamp: new Date().toISOString(),\n type: \"like\",\n tweetId,\n creditsUsed: 0,\n success: true,\n });\n\n return { success: true, tweetId };\n } catch (error) {\n return { success: false, error: (error as Error).message };\n }\n }\n\n async unlikeTweet(tweetId: string): Promise<PostResult> {\n try {\n rateLimiter.requireBasicTier(\"Unlike\");\n const meId = await this.getUserId();\n await this.readWrite.v2.unlike(meId, tweetId);\n return { success: true, tweetId };\n } catch (error) {\n return { success: false, error: (error as Error).message };\n }\n }\n\n async retweet(tweetId: string): Promise<PostResult> {\n try {\n rateLimiter.requireBasicTier(\"Retweet\");\n const meId = await this.getUserId();\n await this.readWrite.v2.retweet(meId, tweetId);\n\n logInteraction({\n id: `int-${Date.now()}`,\n timestamp: new Date().toISOString(),\n type: \"retweet\",\n tweetId,\n creditsUsed: 0,\n success: true,\n });\n\n return { success: true, tweetId };\n } catch (error) {\n return { success: false, error: (error as Error).message };\n }\n }\n\n async unretweet(tweetId: string): Promise<PostResult> {\n try {\n rateLimiter.requireBasicTier(\"Unretweet\");\n const meId = await this.getUserId();\n await this.readWrite.v2.unretweet(meId, tweetId);\n return { success: true, tweetId };\n } catch (error) {\n return { success: false, error: (error as Error).message };\n }\n }\n\n async followUser(handleOrId: string): Promise<PostResult> {\n rateLimiter.requireBasicTier(\"Follow\");\n try {\n const meId = await this.getUserId();\n const targetId = await this.resolveUserId(handleOrId);\n await this.readWrite.v2.follow(meId, targetId);\n\n logInteraction({\n id: `int-${Date.now()}`,\n timestamp: new Date().toISOString(),\n type: \"follow\",\n targetUserId: targetId,\n targetHandle: handleOrId.replace(/^@/, \"\"),\n creditsUsed: 0,\n success: true,\n });\n\n return { success: true };\n } catch (error) {\n return { success: false, error: (error as Error).message };\n }\n }\n\n async unfollowUser(handleOrId: string): Promise<PostResult> {\n rateLimiter.requireBasicTier(\"Unfollow\");\n try {\n const meId = await this.getUserId();\n const targetId = await this.resolveUserId(handleOrId);\n await this.readWrite.v2.unfollow(meId, targetId);\n return { success: true };\n } catch (error) {\n return { success: false, error: (error as Error).message };\n }\n }\n\n async getTimeline(options?: TimelineOptions): Promise<Tweet[]> {\n try {\n rateLimiter.requireBasicTier(\"Read timeline\");\n const meId = await this.getUserId();\n\n const response = (await this.readOnly.v2.get(\n `users/${meId}/timelines/reverse_chronological`,\n {\n max_results: options?.count ?? 20,\n since_id: options?.sinceId,\n expansions: [\"author_id\"],\n \"tweet.fields\": [\n \"created_at\",\n \"public_metrics\",\n \"in_reply_to_user_id\",\n \"author_id\",\n ],\n \"user.fields\": [\"username\"],\n }\n )) as TwitterTimelineResponse;\n\n if (!response.data?.length) return [];\n\n const users = this.buildUserMap(response.includes?.users);\n return response.data.map((tweet) => this.toTweet(tweet, users));\n } catch (error) {\n const detail = extractTwitterError(error);\n logger.error(`Failed to read timeline: ${detail}`);\n return [];\n }\n }\n\n async getMentions(options?: TimelineOptions): Promise<Tweet[]> {\n try {\n rateLimiter.requireBasicTier(\"Read mentions\");\n const meId = await this.getUserId();\n const response = (await this.readOnly.v2.get(`users/${meId}/mentions`, {\n max_results: options?.count ?? 20,\n since_id: options?.sinceId,\n expansions: [\"author_id\"],\n \"tweet.fields\": [\"created_at\", \"public_metrics\", \"author_id\"],\n \"user.fields\": [\"username\"],\n })) as TwitterTimelineResponse;\n\n if (!response.data?.length) return [];\n\n const users = this.buildUserMap(response.includes?.users);\n return response.data.map((tweet) => this.toTweet(tweet, users));\n } catch (error) {\n const detail = extractTwitterError(error);\n logger.error(`Failed to read mentions: ${detail}`);\n return [];\n }\n }\n\n async getUserTweets(userId: string, options?: TimelineOptions): Promise<Tweet[]> {\n try {\n rateLimiter.requireBasicTier(\"Read user tweets\");\n\n const response = (await this.readOnly.v2.get(`users/${userId}/tweets`, {\n max_results: options?.count ?? 10,\n since_id: options?.sinceId,\n expansions: [\"author_id\"],\n \"tweet.fields\": [\"created_at\", \"public_metrics\", \"author_id\"],\n \"user.fields\": [\"username\"],\n })) as TwitterTimelineResponse;\n\n if (!response.data?.length) return [];\n\n const users = this.buildUserMap(response.includes?.users);\n return response.data.map((tweet) => this.toTweet(tweet, users));\n } catch (error) {\n const detail = extractTwitterError(error);\n logger.error(`Failed to read user tweets for ${userId}: ${detail}`);\n return [];\n }\n }\n\n async searchTweets(query: string, options?: SearchOptions): Promise<Tweet[]> {\n try {\n rateLimiter.requireBasicTier(\"Search tweets\");\n const paginator = await this.readOnly.v2.search(query, {\n max_results: Math.min(options?.count ?? 20, 100),\n expansions: [\"author_id\"],\n \"tweet.fields\": [\"created_at\", \"public_metrics\", \"author_id\"],\n \"user.fields\": [\"username\"],\n });\n\n const tweets: TwitterTweet[] = [];\n const users = new Map<string, string>();\n\n for await (const tweet of paginator) {\n tweets.push(tweet as unknown as TwitterTweet);\n if (tweets.length >= (options?.count ?? 20)) break;\n }\n\n const includeUsers = (paginator as unknown as { includes?: { users?: TwitterUser[] } }).includes?.users;\n for (const user of includeUsers ?? []) {\n users.set(user.id, user.username);\n }\n\n return tweets.map((tweet) => this.toTweet(tweet, users));\n } catch (error) {\n const detail = extractTwitterError(error);\n logger.error(`Failed to search tweets: ${detail}`);\n return [];\n }\n }\n\n async getTweetMetrics(tweetId: string): Promise<TweetMetrics | null> {\n try {\n rateLimiter.requireBasicTier(\"Read tweet metrics\");\n const response = (await this.readOnly.v2.singleTweet(tweetId, {\n \"tweet.fields\": [\"public_metrics\"],\n })) as {\n data?: {\n public_metrics?: {\n like_count?: number;\n retweet_count?: number;\n reply_count?: number;\n };\n };\n };\n\n const metrics = response.data?.public_metrics;\n if (!metrics) return null;\n return {\n likeCount: metrics.like_count ?? 0,\n retweetCount: metrics.retweet_count ?? 0,\n replyCount: metrics.reply_count ?? 0,\n };\n } catch (error) {\n const detail = extractTwitterError(error);\n logger.warn(`Failed to read tweet metrics for ${tweetId}: ${detail}`);\n return null;\n }\n }\n\n async getProfile(handle: string): Promise<UserProfile> {\n rateLimiter.requireBasicTier(\"Get profile\");\n\n const cleanedHandle = handle.trim().replace(/^@/, \"\");\n const response = (await this.readOnly.v2.userByUsername(cleanedHandle, {\n \"user.fields\": [\n \"description\",\n \"public_metrics\",\n \"verified\",\n \"profile_image_url\",\n \"username\",\n \"name\",\n ],\n })) as { data?: TwitterUser };\n\n if (!response.data) {\n throw new Error(`Profile not found for @${cleanedHandle}`);\n }\n\n return {\n id: response.data.id,\n handle: response.data.username,\n name: response.data.name ?? response.data.username,\n bio: response.data.description ?? \"\",\n followersCount: response.data.public_metrics?.followers_count ?? 0,\n followingCount: response.data.public_metrics?.following_count ?? 0,\n tweetCount: response.data.public_metrics?.tweet_count ?? 0,\n verified: response.data.verified ?? false,\n profileImageUrl: response.data.profile_image_url,\n };\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;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AAQ,cAAc;AAAA,QACjC,cAAc,QAAQ,iBAAiB;AAAA,QACvC,YAAY,QAAQ,eAAe;AAAA,MACrC;AAAA,IACF,SAAS,OAAO;AACd,YAAM,SAAS,oBAAoB,KAAK;AACxC,aAAO,KAAK,oCAAoC,OAAO,KAAK,MAAM,EAAE;AACpE,aAAO;AAAA,IACT;AAAA,EACF;AAAA,EAEA,MAAM,WAAW,QAAsC;AACrD,gBAAY,iBAAiB,aAAa;AAE1C,UAAM,gBAAgB,OAAO,KAAK,EAAE,QAAQ,MAAM,EAAE;AACpD,UAAM,WAAY,MAAM,KAAK,SAAS,GAAG,eAAe,eAAe;AAAA,MACrE,eAAe;AAAA,QACb;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,IACF,CAAC;AAED,QAAI,CAAC,SAAS,MAAM;AAClB,YAAM,IAAI,MAAM,0BAA0B,aAAa,EAAE;AAAA,IAC3D;AAEA,WAAO;AAAA,MACL,IAAI,SAAS,KAAK;AAAA,MAClB,QAAQ,SAAS,KAAK;AAAA,MACtB,MAAM,SAAS,KAAK,QAAQ,SAAS,KAAK;AAAA,MAC1C,KAAK,SAAS,KAAK,eAAe;AAAA,MAClC,gBAAgB,SAAS,KAAK,gBAAgB,mBAAmB;AAAA,MACjE,gBAAgB,SAAS,KAAK,gBAAgB,mBAAmB;AAAA,MACjE,YAAY,SAAS,KAAK,gBAAgB,eAAe;AAAA,MACzD,UAAU,SAAS,KAAK,YAAY;AAAA,MACpC,iBAAiB,SAAS,KAAK;AAAA,IACjC;AAAA,EACF;AACF;","names":[]}
|
|
@@ -7,18 +7,18 @@ import {
|
|
|
7
7
|
loadColonyMemory,
|
|
8
8
|
renderColonyBriefing,
|
|
9
9
|
saveColonyMemory
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-D47OFTEK.js";
|
|
11
11
|
import {
|
|
12
12
|
getXClient
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-5R4AJZHN.js";
|
|
14
14
|
import {
|
|
15
15
|
loadIdentity
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-IULO3GRE.js";
|
|
17
17
|
import {
|
|
18
18
|
logger
|
|
19
|
-
} from "./chunk-
|
|
20
|
-
import "./chunk-
|
|
21
|
-
import "./chunk-
|
|
19
|
+
} from "./chunk-RSNEVBEI.js";
|
|
20
|
+
import "./chunk-QYFNAGNI.js";
|
|
21
|
+
import "./chunk-ZWKTKWS6.js";
|
|
22
22
|
|
|
23
23
|
// src/colony/index.ts
|
|
24
24
|
var COLONY_TAG = "#SporaColony";
|
|
@@ -226,4 +226,4 @@ export {
|
|
|
226
226
|
postStatus,
|
|
227
227
|
proposePlan
|
|
228
228
|
};
|
|
229
|
-
//# sourceMappingURL=colony-
|
|
229
|
+
//# sourceMappingURL=colony-UGVYALOS.js.map
|
|
@@ -3,12 +3,12 @@ import {
|
|
|
3
3
|
createDefaultConfig,
|
|
4
4
|
loadConfig,
|
|
5
5
|
saveConfig
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-QYFNAGNI.js";
|
|
7
|
+
import "./chunk-ZWKTKWS6.js";
|
|
8
8
|
export {
|
|
9
9
|
ConfigSchema,
|
|
10
10
|
createDefaultConfig,
|
|
11
11
|
loadConfig,
|
|
12
12
|
saveConfig
|
|
13
13
|
};
|
|
14
|
-
//# sourceMappingURL=config-
|
|
14
|
+
//# sourceMappingURL=config-MU2ODEO3.js.map
|
|
@@ -3,12 +3,12 @@ import {
|
|
|
3
3
|
encrypt,
|
|
4
4
|
loadCredentials,
|
|
5
5
|
saveCredentials
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-SXNZVKLJ.js";
|
|
7
|
+
import "./chunk-ZWKTKWS6.js";
|
|
8
8
|
export {
|
|
9
9
|
decrypt,
|
|
10
10
|
encrypt,
|
|
11
11
|
loadCredentials,
|
|
12
12
|
saveCredentials
|
|
13
13
|
};
|
|
14
|
-
//# sourceMappingURL=crypto-
|
|
14
|
+
//# sourceMappingURL=crypto-GDG5K3ZH.js.map
|
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
loadGoals,
|
|
3
3
|
renderGoalsForPrompt,
|
|
4
4
|
saveGoals
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-CAWWG3MD.js";
|
|
6
|
+
import "./chunk-ZWKTKWS6.js";
|
|
7
7
|
export {
|
|
8
8
|
loadGoals,
|
|
9
9
|
renderGoalsForPrompt,
|
|
10
10
|
saveGoals
|
|
11
11
|
};
|
|
12
|
-
//# sourceMappingURL=goals-
|
|
12
|
+
//# sourceMappingURL=goals-QWX3A47Y.js.map
|