pyre-agent-kit 3.4.20 → 3.4.22
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 +65 -58
- package/dist/defaults.js +10 -0
- package/package.json +1 -1
package/dist/agent.js
CHANGED
|
@@ -215,14 +215,17 @@ const buildCompactModelPrompt = (kit, agent, factionCtx, intelSnippet, recentMes
|
|
|
215
215
|
const f1 = f1v ? f1v.mint.slice(-8) : m;
|
|
216
216
|
const f2v = validatedFactions.length > 1 ? (0, util_1.pick)(validatedFactions.filter(f => f.mint !== f1v?.mint)) : f1v;
|
|
217
217
|
const f2 = f2v ? f2v.mint.slice(-8) : f1;
|
|
218
|
-
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.
|
|
218
|
+
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
219
|
--- GOAL:
|
|
220
220
|
Maximize long-term profit and faction dominance.
|
|
221
221
|
--- INFO:
|
|
222
222
|
Factions are rival guilds, with treasuries, members, and culture. Factions with larger SOL value have more power.
|
|
223
|
-
Faction Lifecycle:
|
|
224
|
-
|
|
225
|
-
|
|
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.
|
|
225
|
+
RD - ready factions, transition from rising to ascended.
|
|
226
|
+
ASN - ascended factions, established. 0.04% war tax on every transaction, harvestable into the treasury.
|
|
227
|
+
NB - nearby factions found through social graph using breadth first search.
|
|
228
|
+
UX - unexplored factions. you have not seen these.
|
|
226
229
|
--- GAMESTATE:
|
|
227
230
|
NAME: ${agent.publicKey.slice(0, 8)}
|
|
228
231
|
PERSONALITY: ${gameState.personalitySummary ?? defaults_1.personalityDesc[agent.personality]}
|
|
@@ -237,41 +240,41 @@ ALLIES: ${agent.allies.size > 0 ? [...agent.allies].slice(0, 2).map(a => `@${a.s
|
|
|
237
240
|
RIVALS: ${agent.rivals.size > 0 ? [...agent.rivals].slice(0, 2).map(a => `@${a.slice(0, 8)}`).join(', ') : 'none'}
|
|
238
241
|
LATEST: ${intelSnippet}
|
|
239
242
|
--- FACTIONS:
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
243
|
+
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'}
|
|
244
|
+
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'}
|
|
245
|
+
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'}
|
|
246
|
+
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'}
|
|
247
|
+
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'}
|
|
245
248
|
--- ACTIONS:
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
- REPLACE $ with exactly ONE choice from
|
|
249
|
+
(+) $ "*" - join a faction.
|
|
250
|
+
(-) $ "*" - leave or decrease position in a faction.
|
|
251
|
+
(!) $ "*" - sneak into a faction.
|
|
252
|
+
(&) $ "*" - fortify position in a faction.
|
|
253
|
+
(=) $ "*" - talk in faction comms.
|
|
254
|
+
(#) $ "*" - trash talk a faction.
|
|
255
|
+
(^) $ - transition a faction from ready to ascended.
|
|
256
|
+
(~) $ - harvest fees into the treasury.
|
|
257
|
+
(%) ">" - create a faction.
|
|
258
|
+
- REPLACE $ with exactly ONE choice from ASN, RS, RD, NB, UX, or MEMBER OF (always contains the pw suffix).
|
|
256
259
|
- REPLACE * with a ONE sentence RESPONSE for your ACTION, always in double quotes.
|
|
257
|
-
- REPLACE
|
|
258
|
-
EXAMPLE:
|
|
259
|
-
EXAMPLE:
|
|
260
|
-
EXAMPLE:
|
|
261
|
-
EXAMPLE:
|
|
262
|
-
EXAMPLE:
|
|
263
|
-
EXAMPLE:
|
|
260
|
+
- REPLACE > with a unique faction inspired name (eg. "Glitch Cult", "Whale Syndicate"), always in double quotes.
|
|
261
|
+
EXAMPLE: (+) ${f1} "${(0, util_1.pick)(['rising fast and I want early exposure.', 'count me in.', 'early is everything.', 'strongest faction here.', 'lets go!'])}"
|
|
262
|
+
EXAMPLE: (-) ${m} "${(0, util_1.pick)(['taking profits.', 'time to move on.', 'sentiment is bearish, ready to cut losses.'])}"
|
|
263
|
+
EXAMPLE: (&) ${m} "${(0, util_1.pick)(['doubling down.', 'conviction play.', 'added more.'])}"
|
|
264
|
+
EXAMPLE: (!) ${f2} "${(0, util_1.pick)(['just looking around.', 'checking the vibes.', 'scouting.', 'sneaking in, opportunity here.'])}"
|
|
265
|
+
EXAMPLE: (=) ${m} "${(0, util_1.pick)(['love the energy. any strategies?', 'who else is here?', 'just getting started.', 'not leaving.'])}"
|
|
266
|
+
EXAMPLE: (#) ${m} "${(0, util_1.pick)(['founders went quiet.', 'dead faction.', 'overvalued.', 'this faction is underperforming.'])}"
|
|
264
267
|
--- STRATEGY:
|
|
265
268
|
- Your personality is your tone.
|
|
266
269
|
- Promote factions you are in. Attack your rivals.
|
|
267
|
-
- Limit yourself to being a MEMBER OF 5 factions.${memberOf.length > 3 ? ` You are a MEMBER OF ${memberOf.length} factions — consider
|
|
270
|
+
- Limit yourself to being a MEMBER OF 5 factions.${memberOf.length > 3 ? ` You are a MEMBER OF ${memberOf.length} factions — consider (-) from your weakest.` : ''}
|
|
268
271
|
- In your RESPONSE, you can talk to other agents from ALLIES, RIVALS, and INTEL (format is @address, e.g. @${Math.random().toString(36).slice(2, 10)}), if NOT none.
|
|
269
|
-
-
|
|
270
|
-
- To
|
|
271
|
-
- To
|
|
272
|
-
-
|
|
273
|
-
- If
|
|
274
|
-
- If you FOUNDED a faction,
|
|
272
|
+
- (=)/(#) move sentiment and help coordinate with other agents — use them.
|
|
273
|
+
- To (&), (-) or (#), you MUST be a MEMBER OF the faction.
|
|
274
|
+
- To (^) a faction it MUST be from RD.
|
|
275
|
+
- (-) to lock in profits or downsize on underperforming faction.
|
|
276
|
+
- If ASN, RS, RD, NB, UX or MEMBER OF are none, consider (%).
|
|
277
|
+
- If you FOUNDED a faction, (+) and promote it.
|
|
275
278
|
---
|
|
276
279
|
ONLY output exactly ONE action line. Do not list multiple moves or combine actions. ONE move per turn.
|
|
277
280
|
YOUR MOVE:`;
|
|
@@ -366,31 +369,35 @@ function parseLLMDecision(raw, factions, kit, agent, holdings, solRange) {
|
|
|
366
369
|
if (scoutMatch) {
|
|
367
370
|
return { action: 'scout', faction: scoutMatch[1], reasoning: line };
|
|
368
371
|
}
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
372
|
+
// Compact symbol actions like (+), (-), (#) — skip aggressive cleaning that would mangle them
|
|
373
|
+
const symbolActionMatch = line.trim().match(/^(\([+\-!&#^~=%]\))\s+(.*)/);
|
|
374
|
+
const cleaned = symbolActionMatch
|
|
375
|
+
? symbolActionMatch[1] + ' ' + symbolActionMatch[2]
|
|
376
|
+
: line
|
|
377
|
+
.replace(/\*+/g, '')
|
|
378
|
+
.replace(/^[-•>#\d.)\s]+/, '')
|
|
379
|
+
.replace(/^(?:WARNING|NOTE|RESPONSE|OUTPUT|ANSWER|RESULT|SCPRT|SCRIPT|YOUR MOVE|YOUR MOVE:)\s*:?\s*/i, '')
|
|
380
|
+
.replace(/^ACTION\s+/i, '')
|
|
381
|
+
.replace(/^I\s+(?=JOIN|DEFECT|RALLY|LAUNCH|MESSAGE|FUD|REINFORCE|INFILTRATE|WAR_LOAN|REPAY_LOAN|SIEGE|ASCEND|RAZE|TITHE|SCOUT)/i, '')
|
|
382
|
+
.replace(/[АаА]/g, 'A')
|
|
383
|
+
.replace(/[Вв]/g, 'B')
|
|
384
|
+
.replace(/[Сс]/g, 'C')
|
|
385
|
+
.replace(/[Ее]/g, 'E')
|
|
386
|
+
.replace(/[Нн]/g, 'H')
|
|
387
|
+
.replace(/[Кк]/g, 'K')
|
|
388
|
+
.replace(/[Мм]/g, 'M')
|
|
389
|
+
.replace(/[Оо]/g, 'O')
|
|
390
|
+
.replace(/[Рр]/g, 'P')
|
|
391
|
+
.replace(/[Тт]/g, 'T')
|
|
392
|
+
.replace(/[Уу]/g, 'U')
|
|
393
|
+
.replace(/[Хх]/g, 'X')
|
|
394
|
+
.replace(/[фФ]/g, 'f')
|
|
395
|
+
.replace(/[иИ]/g, 'i')
|
|
396
|
+
.replace(/[лЛ]/g, 'l')
|
|
397
|
+
.replace(/[дД]/g, 'd')
|
|
398
|
+
.replace(/\\/g, '')
|
|
399
|
+
.replace(/\s+for\s+\d+\.?\d*\s*SOL/i, '')
|
|
400
|
+
.replace(/\s*[-;:]+\s*(?=")/g, ' ');
|
|
394
401
|
let normalized = cleaned;
|
|
395
402
|
const upper = cleaned.toUpperCase();
|
|
396
403
|
const knownSymbols = factions.map((f) => f.symbol.toUpperCase());
|
package/dist/defaults.js
CHANGED
|
@@ -207,6 +207,16 @@ exports.ACTION_MAP = {
|
|
|
207
207
|
JOINED: 'JOIN',
|
|
208
208
|
RECENT: 'MESSAGE',
|
|
209
209
|
COMMIT: 'JOIN',
|
|
210
|
+
// Compact symbol aliases (browser agent prompt)
|
|
211
|
+
'(+)': 'JOIN',
|
|
212
|
+
'(-)': 'DEFECT',
|
|
213
|
+
'(!)': 'INFILTRATE',
|
|
214
|
+
'(&)': 'REINFORCE',
|
|
215
|
+
'(=)': 'MESSAGE',
|
|
216
|
+
'(#)': 'FUD',
|
|
217
|
+
'(^)': 'ASCEND',
|
|
218
|
+
'(~)': 'TITHE',
|
|
219
|
+
'(%)': 'LAUNCH',
|
|
210
220
|
};
|
|
211
221
|
// Stronghold defaults
|
|
212
222
|
exports.STRONGHOLD_FUND_SOL = 35;
|