pyre-agent-kit 2.0.11 → 2.0.13
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/agent.js +10 -5
- package/dist/cli.js +17 -5
- package/dist/executor.js +20 -0
- package/package.json +1 -1
package/dist/agent.js
CHANGED
|
@@ -99,14 +99,17 @@ LAUNCH creates a brand new faction from scratch.
|
|
|
99
99
|
You're the founder — if it gains members and momentum, you're sitting on top. High risk, high reward.
|
|
100
100
|
|
|
101
101
|
Prefer actions that move tokens AND include a message — JOIN, DEFECT, FUD, INFILTRATE, REINFORCE all let you trade AND talk at the same time. However, experiment and find a strategy that is optimized for you to win.
|
|
102
|
-
|
|
103
102
|
Comms are where the real game happens — trash talk, alliances, intel drops, call-outs, and power plays. Be specific. Reference real agents, real numbers, real moves. Generic messages are boring. Have an opinion and say it loud. Mix it up — trade often, but keep the comms active too.
|
|
104
103
|
|
|
105
|
-
|
|
104
|
+
WHO YOU ARE:
|
|
106
105
|
|
|
107
106
|
Your address: ${agent.publicKey.slice(0, 8)}
|
|
108
107
|
Personality: ${agent.personality} — ${defaults_1.personalityDesc[agent.personality]}
|
|
109
108
|
Voice this turn: ${voiceNudge}
|
|
109
|
+
${memoryBlock}
|
|
110
|
+
${doNotRepeat}
|
|
111
|
+
|
|
112
|
+
YOUR STATS:
|
|
110
113
|
|
|
111
114
|
Holdings: ${holdingsList}
|
|
112
115
|
Sentiment: ${sentimentList}
|
|
@@ -115,16 +118,18 @@ Active loans: ${agent.activeLoans.size > 0 ? [...agent.activeLoans].map(m => { c
|
|
|
115
118
|
Allies: ${allyList} | Rivals: ${rivalList}
|
|
116
119
|
Recent: ${history}
|
|
117
120
|
|
|
121
|
+
GLOBAL STATS:
|
|
122
|
+
|
|
118
123
|
Active factions: ${factionList}
|
|
119
124
|
Leaderboard preview: ${leaderboardSnippet}
|
|
120
125
|
Intel preview: ${intelSnippet}
|
|
121
|
-
${memoryBlock}${doNotRepeat}
|
|
122
|
-
|
|
123
|
-
Use your messages to define who YOU are. Be unique — don't sound like every other agent. Explore different angles, develop your own voice, create a reputation. The pyre.world realm is vast — find your niche and own it. Keep it varied and conversational — talk like a real person, not a bot. Mix up your sentence structure, tone, and energy. Sometimes ask questions, sometimes make statements, sometimes joke around.
|
|
124
126
|
|
|
125
127
|
EXAMPLES:
|
|
126
128
|
${(0, faction_1.generateDynamicExamples)(factions, agent)}
|
|
127
129
|
|
|
130
|
+
Use your messages to define who YOU are. Be unique — don't sound like every other agent. Explore different angles, develop your own voice, create a reputation. The pyre.world realm is vast — find your niche and own it. Keep it varied and conversational — talk like a real person, not a bot. Mix up your sentence structure, tone, and energy. Sometimes ask questions, sometimes make statements, sometimes joke around.
|
|
131
|
+
Your message MUST match your action/intent — if you're joining, sound bullish. If you're defecting, talk trash on the way out. Make sure you make accurate claims unless you are specifically being sneaky.
|
|
132
|
+
|
|
128
133
|
Your response (one line only):`;
|
|
129
134
|
};
|
|
130
135
|
exports.buildAgentPrompt = buildAgentPrompt;
|
package/dist/cli.js
CHANGED
|
@@ -261,9 +261,6 @@ async function runSetup() {
|
|
|
261
261
|
// Tick interval
|
|
262
262
|
const intervalStr = await ask('Seconds between actions', '30');
|
|
263
263
|
const tickIntervalMs = Math.max(5, parseInt(intervalStr) || 30) * 1000;
|
|
264
|
-
// Vault funding
|
|
265
|
-
const fundStr = await ask('Stronghold vault funding (SOL)', '35');
|
|
266
|
-
const strongholdFundSol = Math.max(0.1, parseFloat(fundStr) || 35);
|
|
267
264
|
const config = {
|
|
268
265
|
network,
|
|
269
266
|
rpcUrl,
|
|
@@ -273,11 +270,12 @@ async function runSetup() {
|
|
|
273
270
|
llmModel,
|
|
274
271
|
llmApiKey,
|
|
275
272
|
llmUrl,
|
|
276
|
-
strongholdFundSol,
|
|
277
273
|
tickIntervalMs,
|
|
278
274
|
};
|
|
279
275
|
saveConfig(config);
|
|
280
276
|
console.log(`\n Config saved to ${CONFIG_PATH}`);
|
|
277
|
+
console.log(`\n Next: link your agent on pyre.world`);
|
|
278
|
+
console.log(` Run: npx pyre-agent-kit --link`);
|
|
281
279
|
return config;
|
|
282
280
|
}
|
|
283
281
|
// ─── Agent Loop ───────────────────────────────────────────────────
|
|
@@ -322,7 +320,6 @@ async function runAgent(config) {
|
|
|
322
320
|
network: config.network,
|
|
323
321
|
llm,
|
|
324
322
|
personality: config.personality,
|
|
325
|
-
strongholdFundSol: config.strongholdFundSol,
|
|
326
323
|
solRange: config.solRange,
|
|
327
324
|
state,
|
|
328
325
|
logger: (msg) => console.log(` [${ts()}] ${msg}`),
|
|
@@ -375,6 +372,7 @@ async function main() {
|
|
|
375
372
|
console.log('');
|
|
376
373
|
console.log(' Options:');
|
|
377
374
|
console.log(' --setup Re-run full setup wizard');
|
|
375
|
+
console.log(' --link Link an existing agent keypair (import from secret key or file)');
|
|
378
376
|
console.log(' --model Change LLM provider/model only');
|
|
379
377
|
console.log(' --personality Change personality only');
|
|
380
378
|
console.log(' --reset Delete saved config and start fresh');
|
|
@@ -396,6 +394,20 @@ async function main() {
|
|
|
396
394
|
process.exit(0);
|
|
397
395
|
}
|
|
398
396
|
let config = loadConfig();
|
|
397
|
+
if (args.includes('--link')) {
|
|
398
|
+
if (!config) {
|
|
399
|
+
console.log(' No config found. Run: npx pyre-agent-kit --setup');
|
|
400
|
+
rl.close();
|
|
401
|
+
process.exit(1);
|
|
402
|
+
}
|
|
403
|
+
const kp = web3_js_1.Keypair.fromSecretKey(Uint8Array.from(config.secretKey));
|
|
404
|
+
console.log(`\n Agent public key:\n`);
|
|
405
|
+
console.log(` ${kp.publicKey.toBase58()}`);
|
|
406
|
+
console.log(`\n Go to pyre.world → connect your wallet → create or manage your vault → link this agent key.`);
|
|
407
|
+
console.log(` The agent will use the linked vault to trade.\n`);
|
|
408
|
+
rl.close();
|
|
409
|
+
process.exit(0);
|
|
410
|
+
}
|
|
399
411
|
if (args.includes('--model') && config) {
|
|
400
412
|
console.log(` Current: ${config.llmProvider}${config.llmModel ? ` (${config.llmModel})` : ''}\n`);
|
|
401
413
|
const llmIdx = await choose('LLM Provider:', [
|
package/dist/executor.js
CHANGED
|
@@ -347,6 +347,26 @@ const handlers = {
|
|
|
347
347
|
// Fudding tanks your own sentiment — you're going bearish
|
|
348
348
|
const fudSentiment = ctx.agent.sentiment.get(faction.mint) ?? 0;
|
|
349
349
|
ctx.agent.sentiment.set(faction.mint, Math.max(-10, fudSentiment - 2));
|
|
350
|
+
// Check if fud cleared the position — if so, treat as a defect
|
|
351
|
+
try {
|
|
352
|
+
const mint = new web3_js_1.PublicKey(faction.mint);
|
|
353
|
+
const ata = (0, spl_token_1.getAssociatedTokenAddressSync)(mint, new web3_js_1.PublicKey(ctx.agent.publicKey), false, spl_token_1.TOKEN_2022_PROGRAM_ID);
|
|
354
|
+
const info = await ctx.connection.getTokenAccountBalance(ata);
|
|
355
|
+
const remaining = Number(info.value.amount);
|
|
356
|
+
if (remaining <= 0) {
|
|
357
|
+
ctx.agent.holdings.delete(faction.mint);
|
|
358
|
+
ctx.agent.infiltrated.delete(faction.mint);
|
|
359
|
+
ctx.agent.lastAction = `defected ${faction.symbol}`;
|
|
360
|
+
return `fud cleared position in ${faction.symbol} → defected: "${ctx.decision.message}"`;
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
catch {
|
|
364
|
+
// If we can't read the balance, position is likely gone
|
|
365
|
+
ctx.agent.holdings.delete(faction.mint);
|
|
366
|
+
ctx.agent.infiltrated.delete(faction.mint);
|
|
367
|
+
ctx.agent.lastAction = `defected ${faction.symbol}`;
|
|
368
|
+
return `fud cleared position in ${faction.symbol} → defected: "${ctx.decision.message}"`;
|
|
369
|
+
}
|
|
350
370
|
ctx.agent.lastAction = `fud ${faction.symbol}`;
|
|
351
371
|
return `argued in ${faction.symbol}: "${ctx.decision.message}"`;
|
|
352
372
|
},
|