pyre-agent-kit 3.4.29 → 3.4.31

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 (2) hide show
  1. package/dist/agent.js +120 -71
  2. package/package.json +1 -1
package/dist/agent.js CHANGED
@@ -87,84 +87,99 @@ const buildAgentPrompt = (kit, agent, factionCtx, intelSnippet, recentMessages,
87
87
  const f1 = f1Mint ? f1Mint.mint.slice(-8) : m;
88
88
  const f2Mint = validatedFactions.length > 1 ? (0, util_1.pick)(validatedFactions.filter(f => f.mint !== f1Mint?.mint)) : f1Mint;
89
89
  const f2 = f2Mint ? f2Mint.mint.slice(-8) : f1;
90
- return `You are an autonomous agent playing Pyre, a faction warfare game.
90
+ return `Think in English only. Think linearly: situation decision reason. Do not repeat yourself. Do NOT overthink, chess/strategy mood.
91
91
  --- GOAL:
92
92
  Maximize long-term profit and faction dominance.
93
93
  --- INFO:
94
94
  Factions are rival guilds, with treasuries, members, and culture. Factions with larger SOL value have more power.
95
- Lifecycle: launchrisingreadyvote → ascended
96
- Rising Factions:
95
+ Lifecycle: RSRDVASN
96
+ RS:
97
97
  - 0.5% realm fee + treasury contribution (starts ~12.5%, decays to ~4% as the faction grows).
98
98
  - Initial vote on joining: 90% goes to your position and 10% seeds the treasury. After that, 100% goes to your position.
99
99
  - Early actions contribute more to the treasury. Later actions contribute less.
100
- Ascended Factions:
100
+ ASN:
101
101
  - Treasuries are active: TITHE harvests fees, WAR_LOAN borrows against holdings, SIEGE liquidates bad loans.
102
102
  - 0.04% war tax on every transaction — harvestable into the treasury for lending.
103
+ --- LEGEND:
104
+ RS - rising factions.
105
+ RD - ready factions, transition from rising to ascended.
106
+ ASN - ascended factions.
107
+ NB - nearby factions found through social graph using breadth first search.
108
+ UX - unexplored factions. you have not seen these.
109
+ FNR - factions you created/founded.
110
+ MBR - factions you are a member of/hold a position in.
111
+ AL - ally. these are other agents you befriend, prefixed with @AP
112
+ RVL - rival. these are other agents that are enemies, prefixed with @AP
103
113
  --- GAMESTATE:
104
114
  NAME: @AP${agent.publicKey.slice(0, 4)}
105
- PERSONALITY: ${gameState.personalitySummary ?? defaults_1.personalityDesc[agent.personality]}
115
+ BIO: ${gameState.personalitySummary ?? defaults_1.personalityDesc[agent.personality]}
106
116
  MEMORIES: ${memoryBlock}
107
117
  VALUE: ${totalHoldingsValue.toFixed(4)} SOL | Realized P&L: ${pnl >= 0 ? '+' : ''}${pnl.toFixed(4)} SOL | Unrealized: ${unrealizedPnl >= 0 ? '+' : ''}${unrealizedPnl.toFixed(4)} SOL
108
118
  SPEND RANGE: ${minSol}–${maxSol} SOL
109
- FOUNDED: ${gameState.founded.length > 0 ? `${gameState.founded.map((m) => m.slice(-8)).join(', ')} — promote these aggressively` : 'none'}
110
- MEMBER OF: ${holdingsList}
119
+ FNR: ${gameState.founded.length > 0 ? `${gameState.founded.map((m) => m.slice(-8)).join(', ')} — promote these aggressively` : 'none'}
120
+ MBR: ${holdingsList}
111
121
  SENTIMENT: ${sentimentList}
112
122
  ${positionValues.length > 0 ? `BEST FACTION: ${positionValues.sort((a, b) => b.valueSol - a.valueSol)[0].label} (${positionValues.sort((a, b) => b.valueSol - a.valueSol)[0].valueSol.toFixed(4)} SOL)` : ''}
113
123
  ACTIVE LOANS: ${gameState.activeLoans.size > 0 ? `${[...gameState.activeLoans].map((m) => m.slice(-8)).join(', ')}` : 'none'}
114
124
  ${unrealizedPnl > 0.1 ? 'You are UP. Consider taking profits on your biggest winners with DEFECT.' : unrealizedPnl < -0.05 ? 'You are DOWN. Be conservative. Cut losers with DEFECT. Smaller positions.' : 'Near breakeven. Look for conviction plays.'}
115
125
  --- INTEL:
116
- ALLIES: ${allyList}
117
- RIVALS: ${rivalList}
126
+ AL: ${allyList}
127
+ RVL: ${rivalList}
118
128
  LATEST: ${intelSnippet}
119
129
  --- FACTIONS:
120
- ASCENDED: ${ascendedList}
121
- READY: ${readyList}
122
- RISING: ${risingList}
123
- NEARBY: ${nearbyList}
124
- UNEXPLORED: ${unexploredList}
130
+ ASN: ${ascendedList}
131
+ RD: ${readyList}
132
+ RS: ${risingList}
133
+ NB: ${nearbyList}
134
+ UX: ${unexploredList}
125
135
  --- ACTIONS:
126
- JOIN $ "*" join a faction.
127
- DEFECT $ "*" leave or downsize a faction.
128
- REINFORCE $ "*" increase size in a faction, you are bullish.
129
- INFILTRATE $ "*" join a rival to defect later.
130
- MESSAGE $ "*" talk in faction comms.
131
- FUD $ "*" trash talk in a faction.
132
- SCOUT @address — look up an agent.
133
- ASCEND $ — promote a ready faction (ready factions only).
134
- RALLY $ — show support, one-time per faction.
135
- RAZE $ — reclaim an inactive faction.
136
- WAR_LOAN $ — borrow against your size in a faction (ascended factions only).
137
- REPAY_LOAN $ — repay a loan (ascended factions only).
138
- SIEGE $ — liquidate a bad loan (ascended factions only).
139
- TITHE $ — harvest fees into the treasury to grow the faction economy (ascended factions only).
140
- LAUNCH "name" — create a new faction. name should be original, be creative. wrap name in double quotes always.
141
- - REPLACE $ with exactly ONE faction from ASCENDED, RISING, READY, NEARBY, UNEXPLORED, or MEMBER OF (always contains the pw suffix).
136
+ (+) $ "*" - join a faction.
137
+ (-) $ "*" - leave or decrease position in a faction.
138
+ (!) $ "*" - sneak into a faction.
139
+ (&) $ "*" - fortify position in a faction.
140
+ (=) $ "*" - talk in faction comms.
141
+ (#) $ "*" - trash talk a faction.
142
+ (@) @address — look up an agent.
143
+ (^) $ — promote a ready faction (ready factions only).
144
+ (.) $ — show support, one-time per faction.
145
+ (-) $ — reclaim an inactive faction.
146
+ (?) $ — borrow against your size in a faction (ascended factions only).
147
+ (<) $ — repay a loan (ascended factions only).
148
+ (>) $ — liquidate a bad loan (ascended factions only).
149
+ (~) $ — harvest fees into the treasury to grow the faction economy (ascended factions only).
150
+ (%) "name" — create a new faction. name should be original, be creative. wrap name in double quotes always.
151
+ - REPLACE $ with exactly ONE faction from ASN, RS, RD, NB, UX, FNR, or MBR (always contains the pw suffix).
142
152
  - REPLACE * with what you have to say about your action, always in double quotes, if available on the action. optional but recommended.
143
- EXAMPLE: JOIN ${f1} "${(0, util_1.pick)(['rising fast and I want early exposure.', 'count me in.', 'early is everything.', 'strongest faction here.', 'lets go!'])}"
144
- EXAMPLE: DEFECT ${m} "${(0, util_1.pick)(['taking profits.', 'time to move on.', 'sentiment is bearish, ready to cut losses.'])}"
145
- EXAMPLE: REINFORCE ${m} "${(0, util_1.pick)(['doubling down.', 'conviction play.', 'added more.'])}"
146
- EXAMPLE: INFILTRATE ${f2} "${(0, util_1.pick)(['just looking around.', 'checking the vibes.', 'scouting.', 'sneaking in, opportunity here.'])}"
147
- EXAMPLE: ASCEND ${m}
148
- EXAMPLE: TITHE ${m}
149
- EXAMPLE: MESSAGE ${m} "${(0, util_1.pick)(['love the energy. any strategies?', 'who else is here?', 'just getting started.', 'not leaving.'])}"
150
- EXAMPLE: FUD ${m} "${(0, util_1.pick)(['founders went quiet.', 'dead faction.', 'overvalued.', 'this faction is underperforming.'])}"
151
153
  --- VOICE:
152
154
  - Your personality is your tone.
153
- - First person only. Be specific when speaking with other agents from ALLIES, RIVALS, and INTEL using @address (format is @address, e.g. @${Math.random().toString(36).slice(2, 10)}).
155
+ - First person only. Be specific when speaking with other agents from AL, RVL, and INTEL using @address (format is @address, e.g. @${Math.random().toString(36).slice(2, 10)}).
154
156
  - What you say MUST match the intent of action you are taking.
155
157
  - Write something original and unique every time. Talk TO agents, not about them.
156
158
  - Be concise. Under 80 chars, plain English, one sentence. No hashtags, no angle brackets.
157
159
  - Back up your claims with real numbers from your actions, p&l, and sentiment. Never generic.
158
160
  - Your message should reflect YOUR faction.${doNotRepeat}
161
+ --- RULES:
162
+ - To (^) a faction it MUST be from RD.
163
+ - To (&), (-) or (#), MBR must be true
164
+ - To ()
159
165
  --- STRATEGY:
160
166
  - Limit to being a member of ~5 faction. MESSAGE/FUD in others is fine but factions you are in focused.${positionValues.length > 5 ? ` You are a member of ${positionValues.length} factions — consider DEFECT from your weakest.` : ''}
161
- - MESSAGE/FUD cost almost nothing but move sentiment and help you coordinate with other agents — use them.
167
+ - (=)/(#) cost almost nothing but move sentiment and help you coordinate with other agents — use them.
162
168
  - Collaborate and coordinate with other agents to push factions. Working together can help you profit together. You need to coordinate to push RISING factions to ASCENDED.
163
169
  - If you FOUNDED a faction, consider JOIN and promote it.
164
170
  - REINFORCE factions you believe in. Don't JOIN the same faction twice.
165
171
  - DEFECT to lock in profits or cut losses. Don't stay in losers. You can ONLY DEFECT or FUD factions you are a member of.
166
172
  - Your holdings ARE your identity. Promote what you hold. Attack what you don't.${factionCtx.all.length <= 2 ? '\n- Few factions active — consider LAUNCH.' : ''}
167
173
  ---
174
+ EXAMPLE: (+) ${f1} "${(0, util_1.pick)(['rising fast and I want early exposure.', 'count me in.', 'early is everything.', 'strongest faction here.', 'lets go!'])}"
175
+ EXAMPLE: (-) ${m} "${(0, util_1.pick)(['taking profits.', 'time to move on.', 'sentiment is bearish, ready to cut losses.'])}"
176
+ EXAMPLE: (&) ${m} "${(0, util_1.pick)(['doubling down.', 'conviction play.', 'added more.'])}"
177
+ EXAMPLE: (!) ${f2} "${(0, util_1.pick)(['just looking around.', 'checking the vibes.', 'scouting.', 'sneaking in, opportunity here.'])}"
178
+ EXAMPLE: (^) ${m}
179
+ EXAMPLE: (~) ${m}
180
+ EXAMPLE: (=) ${m} "${(0, util_1.pick)(['love the energy. any strategies?', 'who else is here?', 'just getting started.', 'not leaving.'])}"
181
+ EXAMPLE: (#) ${m} "${(0, util_1.pick)(['founders went quiet.', 'dead faction.', 'overvalued.', 'this faction is underperforming.'])}"
182
+
168
183
  ONLY output exactly ONE action line. Do NOT explain step by step. Do not list multiple moves or combine actions. ONE move per turn.
169
184
  YOUR MOVE:`;
170
185
  };
@@ -198,16 +213,53 @@ const buildCompactModelPrompt = (kit, agent, factionCtx, intelSnippet, recentMes
198
213
  })
199
214
  .filter(Boolean)
200
215
  .join(', ') || 'none';
201
- const nearby = factionCtx.nearby.filter(f => !heldMints.has(f.mint)).slice(0, 2);
202
- const nearbyMints = new Set(nearby.map(f => f.mint));
203
- const rising = factionCtx.rising.filter(f => !heldMints.has(f.mint) && !nearbyMints.has(f.mint)).slice(0, 2);
204
- const risingMints = new Set(rising.map(f => f.mint));
205
- const ascended = factionCtx.ascended.filter(f => !heldMints.has(f.mint) && !nearbyMints.has(f.mint) && !risingMints.has(f.mint)).slice(0, 2);
206
- const ascendedMints = new Set(ascended.map(f => f.mint));
207
- const ready = factionCtx.all.filter(f => f.status === 'ready' && !heldMints.has(f.mint) && !nearbyMints.has(f.mint) && !risingMints.has(f.mint) && !ascendedMints.has(f.mint));
208
- const readyMints = new Set(ready.map(f => f.mint));
209
- const seenMints = new Set([...heldMints, ...nearbyMints, ...risingMints, ...ascendedMints, ...readyMints]);
210
- const unexplored = factionCtx.all.filter(f => !seenMints.has(f.mint)).sort(() => Math.random() - 0.5).slice(0, 3);
216
+ const foundedSet = new Set(gameState.founded);
217
+ const nearbyMints = new Set(factionCtx.nearby.map(f => f.mint));
218
+ // Status tag for each faction
219
+ const statusTag = (f) => {
220
+ if (f.status === 'ascended')
221
+ return 'ASN';
222
+ if (f.status === 'ready')
223
+ return 'RD';
224
+ return 'RS';
225
+ };
226
+ // Discovery tag
227
+ const discoveryTag = (f) => {
228
+ if (nearbyMints.has(f.mint))
229
+ return 'NB';
230
+ return 'UX';
231
+ };
232
+ // Build flat faction rows: FACTION (MCAP) STATUS MBR FNR [NB|UX]
233
+ const factionRows = [];
234
+ const seenMints = new Set();
235
+ // MBR factions first (most important to the agent)
236
+ for (const v of valued.slice(0, 5)) {
237
+ const f = factionCtx.all.find(ff => ff.mint.slice(-8) === v.id);
238
+ if (!f)
239
+ continue;
240
+ seenMints.add(f.mint);
241
+ const mcap = f.market_cap_sol ? `${f.market_cap_sol.toFixed(2)}` : '?';
242
+ const fnr = foundedSet.has(f.mint);
243
+ const sent = kit.state.sentimentMap.get(f.mint) ?? 0;
244
+ factionRows.push(`${f.mint.slice(-8)} | ${mcap} | ${statusTag(f)} | true | ${fnr} | ${v.valueSol.toFixed(4)} | ${sent > 0 ? '+' : ''}${sent}`);
245
+ }
246
+ // Non-member factions
247
+ const nonMember = factionCtx.all.filter(f => !seenMints.has(f.mint) && f.status !== 'razed');
248
+ const nearby = nonMember.filter(f => nearbyMints.has(f.mint)).slice(0, 2);
249
+ const rest = nonMember.filter(f => !nearbyMints.has(f.mint));
250
+ const rising = rest.filter(f => f.status === 'rising').slice(0, 2);
251
+ const ascended = rest.filter(f => f.status === 'ascended').slice(0, 2);
252
+ const ready = rest.filter(f => f.status === 'ready').slice(0, 2);
253
+ const shown = new Set([...nearby, ...rising, ...ascended, ...ready].map(f => f.mint));
254
+ const unexplored = rest.filter(f => !shown.has(f.mint)).sort(() => Math.random() - 0.5).slice(0, 3);
255
+ for (const f of [...nearby, ...ascended, ...ready, ...rising, ...unexplored]) {
256
+ if (seenMints.has(f.mint))
257
+ continue;
258
+ seenMints.add(f.mint);
259
+ const mcap = f.market_cap_sol ? `${f.market_cap_sol.toFixed(2)}` : '?';
260
+ const sent = kit.state.sentimentMap.get(f.mint) ?? 0;
261
+ factionRows.push(`${f.mint.slice(-8)} | ${mcap} | ${statusTag(f)} | false | false | 0 | ${sent > 0 ? '+' : ''}${sent}`);
262
+ }
211
263
  const validatedFactions = [...ascended, ...ready, ...rising, ...nearby, ...unexplored];
212
264
  const mMint2 = [...heldMints][0] || (validatedFactions.length > 0 ? (0, util_1.pick)(validatedFactions).mint : null);
213
265
  const m = mMint2 ? mMint2.slice(-8) : 'xxxxxxpw';
@@ -218,37 +270,33 @@ const buildCompactModelPrompt = (kit, agent, factionCtx, intelSnippet, recentMes
218
270
  return `You are an autonomous agent playing in Pyre, a faction warfare game. Think in English only. Think linearly: situation → decision → reason. Do not repeat yourself. Do NOT overthink, chess/strategy mood.
219
271
  --- GOAL:
220
272
  Maximize long-term profit and faction dominance.
221
- --- INFO:
222
- Factions are rival guilds, with treasuries, members, and culture. Factions with larger SOL value have more power.
223
- Faction Lifecycle: RS → RD → V → ASN
224
- RS - rising factions, new. 0.5% realm tax. early moves contribute more to the treasury, later moves contribute less.
273
+ --- LEGEND:
274
+ RS - rising factions, new.
225
275
  RD - ready factions, transition from rising to ascended.
226
- ASN - ascended factions, established. 0.04% war tax on every transaction, harvestable into the treasury.
276
+ ASN - ascended factions, established.
227
277
  NB - nearby factions found through social graph using breadth first search.
228
278
  UX - unexplored factions. you have not seen these.
229
279
  FNR - factions you created/founded.
230
280
  MBR - factions you are a member of/hold a position in.
231
281
  AL - ally. these are other agents you befriend, prefixed with @AP
232
282
  RVL - rival. these are other agents that are enemies, prefixed with @AP
283
+ --- INFO:
284
+ Factions are rival guilds, with treasuries, members, and culture. Factions with larger SOL value have more power.
285
+ Faction Lifecycle: RS → RD → V → ASN
286
+ RS - 0.5% realm tax. early moves contribute more to the treasury, later moves contribute less.
287
+ RD - 0.04% war tax on every transaction, harvestable into the treasury.
233
288
  --- YOU ARE:
234
289
  NAME: @AP${agent.publicKey.slice(0, 4)}
235
290
  BIO: ${gameState.personalitySummary ?? defaults_1.personalityDesc[agent.personality]}
236
291
  LAST MOVES: ${kit.state.history.length > 0 ? [...kit.state.history].slice(-2).join('; ') : 'none'}
237
292
  P&L: ${pnl >= 0 ? '+' : ''}${pnl.toFixed(4)} SOL
238
- FNR: ${founded.length > 0 ? founded.join(', ') : 'none'}
239
- MBR: ${memberOf.length > 0 ? memberOf.join(', ') : 'none'}
240
- MBR VALUE: ${valued.length > 0 ? valued.map(v => `${v.id}: ${v.valueSol.toFixed(4)} SOL`).join(', ') : 'no value'}
241
- SENTIMENT: ${sentimentList}
242
293
  --- INTEL:
243
294
  AL: ${agent.allies.size > 0 ? [...agent.allies].slice(0, 2).map(a => `@AP${a.slice(0, 4)}`).join(', ') : 'none'}
244
295
  RVL: ${agent.rivals.size > 0 ? [...agent.rivals].slice(0, 2).map(a => `@AP${a.slice(0, 4)}`).join(', ') : 'none'}
245
296
  LATEST: ${intelSnippet}
246
297
  --- FACTIONS:
247
- ASN: ${ascended.length > 0 ? ascended.map(f => f.market_cap_sol ? `${f.mint.slice(-8)} (${f.market_cap_sol.toFixed(2)} SOL)` : f.mint.slice(-8)).join(', ') : 'none'}
248
- RS: ${rising.length > 0 ? rising.map(f => f.market_cap_sol ? `${f.mint.slice(-8)} (${f.market_cap_sol.toFixed(2)} SOL)` : f.mint.slice(-8)).join(', ') : 'none'}
249
- RD: ${ready.length > 0 ? ready.map(f => f.market_cap_sol ? `${f.mint.slice(-8)} (${f.market_cap_sol.toFixed(2)} SOL)` : f.mint.slice(-8)).join(', ') : 'none'}
250
- NB: ${nearby.length > 0 ? nearby.map(f => f.market_cap_sol ? `${f.mint.slice(-8)} (${f.market_cap_sol.toFixed(2)} SOL)` : f.mint.slice(-8)).join(', ') : 'none'}
251
- UX: ${unexplored.length > 0 ? unexplored.map(f => f.market_cap_sol ? `${f.mint.slice(-8)} (${f.market_cap_sol.toFixed(2)} SOL)` : f.mint.slice(-8)).join(', ') : 'none'}
298
+ $ | MCAP | STATUS | MBR | FNR | VALUE | SENT
299
+ ${factionRows.length > 0 ? factionRows.join('\n') : 'none'}
252
300
  --- ACTIONS:
253
301
  (+) $ "*" - join a faction.
254
302
  (-) $ "*" - leave or decrease position in a faction.
@@ -264,15 +312,16 @@ UX: ${unexplored.length > 0 ? unexplored.map(f => f.market_cap_sol ? `${f.mint.s
264
312
  - REPLACE ; with a unique faction inspired name (eg. "Glitch Cult", "Whale Syndicate"), always in double quotes. only for (%).
265
313
  --- STRATEGY:
266
314
  - Your personality is your tone.
267
- - Promote factions you are in. Attack your rivals.
268
315
  - $ is ALWAYS a faction (ends in pw), NEVER an @AP agent. To talk to agents, put @AP inside your "*" response.
269
316
  - In your RESPONSE, you can mention other agents from AL, RVL, and LATEST (format is @AP + 4 chars, e.g. @AP${Math.random().toString(36).slice(2, 6)}), if NOT none.
270
- - Limit MBR to AT MOST 5 factions.${memberOf.length > 3 ? ` MBR at ${memberOf.length} factions consider (-) from your weakest.` : ''}
271
- - ASN, RS, RD, NB, UX, MBR, FNR all none? Use (%) to create one. Anyone can (%).
272
- - If FNR contains factions, you founded them. (+), (&) and promote them with (=).
273
- - (=)/(#) move sentiment and help coordinate with other agents — use them.
274
- - To (&), (-) or (#), the faction must come from MBR.
275
- - To (^) a faction it MUST be from RD.
317
+ - Factions with STATUS ASN are lower risk and established, but RS factions may have higher reward if you pick the right one.
318
+ - To (&), (-) or (#), the faction MBR MUST be true.
319
+ - To (^) a faction, STATUS must be RD.
320
+ - no factions? Use (%) to create one. Anyone can (%).
321
+ - If FNR is true on a faction, you founded it. (+) if MBR is false, (&) if MBR is true and promote them with (=).
322
+ - Limit factions where MBR is true to AT MOST 5 factions.${memberOf.length > 3 ? ` MBR at ${memberOf.length} factions — CONSIDER (-) from underperformers.` : ''}
323
+ - Promote factions you are in. Attack your rival factions.
324
+ - (=)/(#) move sentiment and help coordinate with other agents — use (=) to promote your winners and (#) to fud your losers.
276
325
  - (-) to lock in profits or downsize on underperforming factions.
277
326
  ---
278
327
  EXAMPLE: (+) ${f1} "${(0, util_1.pick)(['rising fast and I want early exposure.', 'count me in.', 'early is everything.', 'strongest faction here.', 'lets go!'])}"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pyre-agent-kit",
3
- "version": "3.4.29",
3
+ "version": "3.4.31",
4
4
  "description": "Autonomous agent kit for Pyre — plug in your own LLM and play pyre.world",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",