pyre-agent-kit 2.0.6 → 2.0.8
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 +31 -9
- package/dist/chain.d.ts +1 -1
- package/dist/chain.js +23 -16
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/agent.js
CHANGED
|
@@ -48,18 +48,40 @@ RULES:
|
|
|
48
48
|
- NO generic crypto slang
|
|
49
49
|
|
|
50
50
|
ACTIONS (pick exactly one — every action with "message" lets you talk in comms at the same time):
|
|
51
|
-
- JOIN SYMBOL "message" — buy into a faction AND OPTIONALLY post a message
|
|
52
|
-
- DEFECT SYMBOL "message" — sell tokens AND OPTIONALLY post a message
|
|
53
|
-
- REINFORCE SYMBOL "message" — increase your position
|
|
54
|
-
- FUD SYMBOL "message" — micro sell + trash talk a faction you hold
|
|
55
|
-
- INFILTRATE SYMBOL "message" — secretly join a rival
|
|
56
|
-
- MESSAGE SYMBOL "message" — post in comms only (no buy/sell
|
|
51
|
+
- JOIN SYMBOL "message" — buy into a faction AND OPTIONALLY post a message
|
|
52
|
+
- DEFECT SYMBOL "message" — sell tokens AND OPTIONALLY post a message
|
|
53
|
+
- REINFORCE SYMBOL "message" — increase your position AND OPTIONALLY post a message
|
|
54
|
+
- FUD SYMBOL "message" — micro sell + trash talk a faction you hold
|
|
55
|
+
- INFILTRATE SYMBOL "message" — secretly join a rival AND OPTIONALLY post a message
|
|
56
|
+
- MESSAGE SYMBOL "message" — post in comms only (no buy/sell)
|
|
57
57
|
- RALLY SYMBOL — show support (one-time per faction, no message)
|
|
58
|
-
- WAR_LOAN SYMBOL — borrow SOL against collateral
|
|
58
|
+
- WAR_LOAN SYMBOL — borrow SOL against collateral (ascended factions only)
|
|
59
59
|
- REPAY_LOAN SYMBOL — repay a loan
|
|
60
|
-
- SIEGE SYMBOL — liquidate undercollateralized loan
|
|
60
|
+
- SIEGE SYMBOL — liquidate undercollateralized loan (ascended factions only)
|
|
61
61
|
- LAUNCH "name" — create a new faction
|
|
62
62
|
|
|
63
|
+
JOIN is how you enter the war. You're putting SOL behind a faction — backing a side, growing the treasury, climbing the leaderboard. Every join is a statement: you believe in this faction. Join early, join loud, and let everyone know you're in.
|
|
64
|
+
|
|
65
|
+
DEFECT is a power move. If a faction is underperforming, if sentiment is bearish, if you've been infiltrating, or if you just want to take profits and talk trash on the way out — DEFECT. Selling is part of the game. The best agents know when to cut and run. You must hold the token to defect.
|
|
66
|
+
|
|
67
|
+
REINFORCE is conviction. You already hold — now you're doubling down. This pushes you up the leaderboard and signals to everyone that you're not going anywhere. Reinforce when you're bullish and want to flex your position.
|
|
68
|
+
|
|
69
|
+
FUD is psychological warfare. A micro sell paired with trash talk — designed to shake weak hands, tank sentiment, and set up bigger dumps. Use it to destabilize a faction from the inside. Only works on factions you hold.
|
|
70
|
+
|
|
71
|
+
INFILTRATE is the long con. You secretly buy into a rival faction, blend in, and when the time is right — DEFECT and dump everything. The ultimate betrayal. Use it when you want to sabotage from within.
|
|
72
|
+
|
|
73
|
+
MESSAGE is the meta-game. No trade, just comms. Coordinate with allies, drop intel, call out rivals, start beef, make predictions. The social layer is where real power plays happen.
|
|
74
|
+
|
|
75
|
+
RALLY is a one-time public signal of support. No trade, no message — just planting your flag. Choose wisely, you only get one per faction.
|
|
76
|
+
|
|
77
|
+
WAR_LOAN lets you borrow SOL against your tokens in an ascended faction. Use the leverage to make moves elsewhere — but if your collateral value drops, you risk getting sieged. Only available after a faction ascends.
|
|
78
|
+
|
|
79
|
+
REPAY_LOAN clears your debt and protects your collateral. Pay back before someone liquidates you. Smart agents manage their loans.
|
|
80
|
+
|
|
81
|
+
SIEGE is the predator move. If another agent's war loan is undercollateralized, you can liquidate them and take a cut. Ruthless, profitable, and only available on ascended factions.
|
|
82
|
+
|
|
83
|
+
LAUNCH creates a brand new faction from scratch. You're the founder — if it gains members and momentum, you're sitting on top. High risk, high reward.
|
|
84
|
+
|
|
63
85
|
Examples:
|
|
64
86
|
${(0, faction_1.generateDynamicExamples)(factions, agent)}
|
|
65
87
|
|
|
@@ -81,7 +103,7 @@ Leaderboard preview: ${leaderboardSnippet}
|
|
|
81
103
|
Intel preview: ${intelSnippet}
|
|
82
104
|
${memoryBlock}${doNotRepeat}
|
|
83
105
|
|
|
84
|
-
Prefer actions that move tokens AND include a message — JOIN, DEFECT, FUD, INFILTRATE, REINFORCE all let you trade AND talk at the same time.
|
|
106
|
+
Prefer actions that move tokens AND include a message — JOIN, DEFECT, FUD, INFILTRATE, REINFORCE all let you trade AND talk at the same time. 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.
|
|
85
107
|
|
|
86
108
|
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.
|
|
87
109
|
|
package/dist/chain.d.ts
CHANGED
|
@@ -47,7 +47,7 @@ export declare function actionIndex(action: Action): number;
|
|
|
47
47
|
* LLM-based personality classification.
|
|
48
48
|
* Falls back to formula scoring if LLM is unavailable.
|
|
49
49
|
*/
|
|
50
|
-
export declare function classifyPersonality(weights: number[], memos: string[], perFactionHistory?: Map<string, number[]>, llmGenerate?: (prompt: string) => Promise<string | null>, factionNames?: Map<string, string
|
|
50
|
+
export declare function classifyPersonality(weights: number[], memos: string[], perFactionHistory?: Map<string, number[]>, llmGenerate?: (prompt: string) => Promise<string | null>, factionNames?: Map<string, string>, currentPersonality?: Personality): Promise<Personality>;
|
|
51
51
|
/**
|
|
52
52
|
* Compute sentiment towards factions from on-chain interaction patterns.
|
|
53
53
|
*
|
package/dist/chain.js
CHANGED
|
@@ -316,23 +316,22 @@ function buildClassifyPrompt(weights, memos, perFactionHistory, factionNames) {
|
|
|
316
316
|
const memoBlock = recentMemos.length > 0
|
|
317
317
|
? `\nThis agent's last ${recentMemos.length} messages (oldest first):\n${recentMemos.map((m, i) => ` ${i + 1}. "${m}"`).join('\n')}`
|
|
318
318
|
: '\nNo messages from this agent.';
|
|
319
|
-
return `You are classifying an autonomous agent's personality
|
|
319
|
+
return `You are classifying an autonomous agent's personality in Pyre, a faction warfare game on Solana.
|
|
320
320
|
|
|
321
|
-
|
|
322
|
-
- loyalist: Committed to their factions. Positive, supportive messages. Builds community. Sticks around.
|
|
323
|
-
- mercenary: Profit-driven. Moves between factions opportunistically. Self-serving messages. Not necessarily hostile — just always looking for the next edge.
|
|
324
|
-
- provocateur: Stirs the pot. Confrontational, inflammatory, loves drama. Challenges others and starts beef.
|
|
325
|
-
- scout: Observant and analytical. Comments on movements, asks questions, shares intel. Thoughtful rather than aggressive.
|
|
326
|
-
- whale: Actions speak louder than words. Trades heavily but communicates sparingly. When they do speak, it's brief and direct.
|
|
321
|
+
There are 5 personality types. Consider BOTH the action distribution AND the message tone equally.
|
|
327
322
|
|
|
328
|
-
|
|
323
|
+
- loyalist: Sticks with their factions. Messages are positive, supportive, hype-oriented — "we're going to win", defending allies, calling out defectors. Actions: high join/reinforce, low defect.
|
|
324
|
+
- mercenary: Moves between factions for profit. Messages reference exits, profits, opportunities, or next plays. Actions: notable defect/infiltrate activity, faction-hopping pattern.
|
|
325
|
+
- provocateur: Stirs drama and picks fights. Messages are confrontational — trash talk, call-outs, hot takes, challenges. Actions: high fud, targets rivals.
|
|
326
|
+
- scout: The quiet strategist. Messages are sparse but deliberate — brief intel, pointed questions, terse observations. NOT just anyone who comments on things. Actions: low overall activity, selective engagement.
|
|
327
|
+
- whale: Trades big, talks little. Very low message count relative to trade volume. When they speak it's 3-5 words max. Actions: high join/defect volume, minimal comms.
|
|
329
328
|
|
|
330
|
-
Agent behavior data:
|
|
331
329
|
${actionSummary}
|
|
332
330
|
${memoBlock}
|
|
333
331
|
|
|
334
|
-
|
|
335
|
-
|
|
332
|
+
Weigh actions and message tone equally. An agent who talks a lot is NOT a scout — scouts are quiet and selective. An agent who is positive about their faction is a loyalist, not a scout. Only pick scout if the agent genuinely engages sparingly and strategically.
|
|
333
|
+
|
|
334
|
+
Respond with ONLY one word: loyalist, mercenary, provocateur, scout, or whale.`;
|
|
336
335
|
}
|
|
337
336
|
/** Formula-based fallback for personality classification */
|
|
338
337
|
function classifyPersonalityFormula(weights, memos) {
|
|
@@ -355,7 +354,7 @@ function classifyPersonalityFormula(weights, memos) {
|
|
|
355
354
|
- msgRatio * 2 - rallyRate * 2,
|
|
356
355
|
provocateur: fudRatio * 4 + infiltrateRate * 2 + defectRate * 1.5
|
|
357
356
|
- msgRatio * 1 - rallyRate * 1,
|
|
358
|
-
scout:
|
|
357
|
+
scout: rallyRate * 2 - commsRate * 2 - fudRatio * 2 - defectRate,
|
|
359
358
|
whale: (tradeRate > commsRate ? 1 : 0) * 2 + warLoanRate * 3 + defectRate * 2
|
|
360
359
|
- commsRate * 3,
|
|
361
360
|
};
|
|
@@ -376,10 +375,10 @@ function classifyPersonalityFormula(weights, memos) {
|
|
|
376
375
|
* LLM-based personality classification.
|
|
377
376
|
* Falls back to formula scoring if LLM is unavailable.
|
|
378
377
|
*/
|
|
379
|
-
async function classifyPersonality(weights, memos, perFactionHistory, llmGenerate, factionNames) {
|
|
378
|
+
async function classifyPersonality(weights, memos, perFactionHistory, llmGenerate, factionNames, currentPersonality) {
|
|
380
379
|
const total = weights.reduce((a, b) => a + b, 0);
|
|
381
380
|
if (total === 0)
|
|
382
|
-
return 'loyalist';
|
|
381
|
+
return currentPersonality ?? 'loyalist';
|
|
383
382
|
if (llmGenerate) {
|
|
384
383
|
try {
|
|
385
384
|
const prompt = buildClassifyPrompt(weights, memos, perFactionHistory, factionNames);
|
|
@@ -388,13 +387,21 @@ async function classifyPersonality(weights, memos, perFactionHistory, llmGenerat
|
|
|
388
387
|
const cleaned = response.toLowerCase().replace(/[^a-z]/g, '').trim();
|
|
389
388
|
const valid = ['loyalist', 'mercenary', 'provocateur', 'scout', 'whale'];
|
|
390
389
|
const match = valid.find(p => cleaned.includes(p));
|
|
391
|
-
if (match)
|
|
390
|
+
if (match) {
|
|
391
|
+
if (currentPersonality && match !== currentPersonality && total < 20) {
|
|
392
|
+
return currentPersonality;
|
|
393
|
+
}
|
|
392
394
|
return match;
|
|
395
|
+
}
|
|
393
396
|
}
|
|
394
397
|
}
|
|
395
398
|
catch { /* fall through to formula */ }
|
|
396
399
|
}
|
|
397
|
-
|
|
400
|
+
const formula = classifyPersonalityFormula(weights, memos);
|
|
401
|
+
if (currentPersonality && formula !== currentPersonality && total < 20) {
|
|
402
|
+
return currentPersonality;
|
|
403
|
+
}
|
|
404
|
+
return formula;
|
|
398
405
|
}
|
|
399
406
|
// ─── Sentiment from On-Chain Data ────────────────────────────────
|
|
400
407
|
const POSITIVE_PATTERN = /strong|rally|bull|pump|rising|hold|loyal|power|growing|moon|love|trust|alpha|build|conviction/;
|
package/dist/index.js
CHANGED
|
@@ -266,7 +266,7 @@ async function createPyreAgent(config) {
|
|
|
266
266
|
return false; // not enough data
|
|
267
267
|
const weights = (0, chain_1.weightsFromCounts)(actionCounts, seedPersonality);
|
|
268
268
|
const llmGen = llm ? (p) => llm.generate(p) : undefined;
|
|
269
|
-
const newPersonality = await (0, chain_1.classifyPersonality)(weights, memoBuffer, undefined, llmGen);
|
|
269
|
+
const newPersonality = await (0, chain_1.classifyPersonality)(weights, memoBuffer, undefined, llmGen, undefined, state.personality);
|
|
270
270
|
dynamicWeights = weights;
|
|
271
271
|
if (newPersonality !== state.personality) {
|
|
272
272
|
logger(`[${publicKey.slice(0, 8)}] personality evolved: ${state.personality} → ${newPersonality} (${total} runtime actions)`);
|