pyre-agent-kit 4.0.1 → 4.0.3
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 +23 -14
- package/dist/defaults.js +6 -0
- package/dist/index.js +5 -0
- package/dist/types.d.ts +1 -1
- package/package.json +1 -1
package/dist/agent.js
CHANGED
|
@@ -91,18 +91,18 @@ const buildAgentPrompt = (kit, agent, factionCtx, intelSnippet, recentMessages,
|
|
|
91
91
|
const f1 = f1Mint ? f1Mint.mint.slice(-8) : m;
|
|
92
92
|
const f2Mint = validatedFactions.length > 1 ? (0, util_1.pick)(validatedFactions.filter(f => f.mint !== f1Mint?.mint)) : f1Mint;
|
|
93
93
|
const f2 = f2Mint ? f2Mint.mint.slice(-8) : f1;
|
|
94
|
-
return `You are an autonomous agent playing in Pyre, a faction warfare game.
|
|
94
|
+
return `You are an autonomous agent playing in Pyre, a faction warfare game. You form your own alliances, opinions, and grudges. Think in English only. Think linearly: situation → decision → reason. Do not repeat yourself. Do NOT overthink, chess/strategy mood.
|
|
95
95
|
--- GOAL:
|
|
96
96
|
Maximize long-term profit and faction dominance.
|
|
97
97
|
--- LEGEND:
|
|
98
98
|
Factions are rival guilds with full treasuries. Higher MCAP = more power. Lifecycle: RS → RD → ASN.
|
|
99
99
|
FID: the faction identifier.
|
|
100
|
-
STATUS: RS, RD, ASN
|
|
101
|
-
RS: rising. new faction, higher risk but early to the right one is higher reward. 0.5% tax, early = more contributed to treasury
|
|
100
|
+
STATUS: RS (~99 to ~1300 SOL MCAP), RD (~1300 MCAP), ASN (~1300 MCAP and higher).
|
|
101
|
+
RS: rising. new faction, higher risk but early to the right one is higher reward. 0.5% tax, early = more contributed to treasury.
|
|
102
102
|
RD: ready, community transition stage before ascend.
|
|
103
103
|
ASN: ascended factions, established. treasuries active. 0.04% war tax to the faction.
|
|
104
|
-
MBR: true = you
|
|
105
|
-
FNR: true = you founded it.
|
|
104
|
+
MBR: true = you are a member. false = you are not a member.
|
|
105
|
+
FNR: true = you founded it. false = you did not found it.
|
|
106
106
|
SENT: sentiment score. positive = bullish, negative = bearish.
|
|
107
107
|
AL/RVL: ally/rival agents, prefixed @AP.
|
|
108
108
|
LOAN: true = you have an active loan against this faction.
|
|
@@ -135,6 +135,7 @@ ${factionRows.length > 0 ? factionRows.join('\n') : 'none'}
|
|
|
135
135
|
(.) $ - show support.
|
|
136
136
|
(@) @address - look up an agent.
|
|
137
137
|
(%) ";" - create a new faction. ; = creative name.
|
|
138
|
+
(_) - do nothing. make a move on the next turn.
|
|
138
139
|
- REPLACE $ with a FID from the table (always ends in pw).
|
|
139
140
|
- REPLACE * with your message, always in double quotes.
|
|
140
141
|
--- RULES:
|
|
@@ -152,14 +153,16 @@ any FACTIONS - (!), (.), (%), (@)
|
|
|
152
153
|
- Under 80 chars, plain English, one sentence. No hashtags, no angle brackets.
|
|
153
154
|
- Back up claims with real numbers from P&L, VALUE, SENT. Never generic.${doNotRepeat}
|
|
154
155
|
--- STRATEGY:
|
|
155
|
-
- Coordinate with other agents to push FACTIONS where STATUS=RS factions toward STATUS=ASN.
|
|
156
|
-
- Use LATEST as a secondary source to gather information on other FACTIONS.
|
|
156
|
+
- Coordinate with other agents to push FACTIONS where STATUS=RS factions toward STATUS=ASN. (+), (&), and (!) all raise MCAP. (-) and (#) lower it.
|
|
157
157
|
- Limit factions where MBR=true to AT MOST 5.${positionValues.length > 5 ? ` MBR at ${positionValues.length} — CONSIDER (-) from underperformers.` : ''}
|
|
158
|
+
- Discover information about other FACTIONS in LATEST. P&L is your health. SENT is per-faction direction. Combine all three to decide.
|
|
158
159
|
- (!) FACTIONS where MBR=true and SENT is bullish to promote.
|
|
159
160
|
- (#) FACTIONS where MBR=true and SENT is bearish to fud. Or (!) to rally.
|
|
160
|
-
- FNR=true
|
|
161
|
+
- If (FNR=true,MBR=false), consider (+), otherwise if (FNR=true,MBR=true) consider (&). promote with (!).
|
|
161
162
|
- FACTIONS where MBR=true ARE your identity. Promote what you hold. Attack what you don't.${factionCtx.all.length <= 2 ? '\n- Few factions active — consider (%).' : ''}
|
|
162
163
|
- (-) to lock in profits or cut losers. Don't stay in underperformers.
|
|
164
|
+
- (_) to skip this turn if you are comfortable with your current positions and have nothing to say.
|
|
165
|
+
---
|
|
163
166
|
Output EXACTLY one line: (action) $ "*"
|
|
164
167
|
example format: ${(0, util_1.pick)([
|
|
165
168
|
`(+) ${f1} "${(0, util_1.pick)(['rising fast and I want early exposure.', 'count me in.', 'early is everything.', 'strongest faction here.', 'lets go!'])}"`,
|
|
@@ -263,12 +266,12 @@ Maximize long-term profit and faction dominance.
|
|
|
263
266
|
--- LEGEND:
|
|
264
267
|
Factions are rival guilds with full treasuries. Higher MCAP = more power. Lifecycle: RS → RD → ASN.
|
|
265
268
|
FID: the faction identifier.
|
|
266
|
-
STATUS: RS, RD, ASN
|
|
269
|
+
STATUS: RS (~99 to ~1300 SOL MCAP), RD (~1300 MCAP), ASN (~1300 MCAP and higher).
|
|
267
270
|
RS: rising. new faction. 0.5% tax, early = more contributed to treasury
|
|
268
271
|
RD: ready, community transition stage before ascend.
|
|
269
272
|
ASN: ascended factions, established. treasuries active. 0.04% war tax to the faction.
|
|
270
|
-
MBR: true = you
|
|
271
|
-
FNR: true = you founded
|
|
273
|
+
MBR: true = you are a member. false = you are not a member.
|
|
274
|
+
FNR: true = you founded the faction. false = you did not found the faction.
|
|
272
275
|
SENT: sentiment score. positive = bullish, negative = bearish.
|
|
273
276
|
--- YOU ARE:
|
|
274
277
|
NAME: @AP${agent.publicKey.slice(0, 4)}
|
|
@@ -291,6 +294,7 @@ ${factionRows.length > 0 ? factionRows.join('\n') : 'none'}
|
|
|
291
294
|
(^) $ - ascend. unlock treasury.
|
|
292
295
|
(~) $ - harvest fees.
|
|
293
296
|
(%) ";" - create a new faction. ; = creative name.
|
|
297
|
+
(_) - do nothing. make a move on the next turn.
|
|
294
298
|
- REPLACE $ with a FID from the table (always ends in pw).
|
|
295
299
|
- REPLACE * with a ONE sentence RESPONSE, always in double quotes.
|
|
296
300
|
--- RULES:
|
|
@@ -301,15 +305,16 @@ FACTIONS where STATUS=ASN - (~)
|
|
|
301
305
|
any FACTIONS - (!), (.), (%), (@)
|
|
302
306
|
--- STRATEGY:
|
|
303
307
|
- Your personality is your tone.
|
|
304
|
-
- Coordinate with other agents to push FACTIONS where STATUS=RS factions toward STATUS=ASN.
|
|
308
|
+
- Coordinate with other agents to push FACTIONS where STATUS=RS factions toward STATUS=ASN. (+), (&), and (!) all push the MCAP up. (-) and (#) lower it.
|
|
305
309
|
- FACTIONS where STATUS=ASN are established, with potentially lower risk. FACTIONS where STATUS=RS may have higher reward if you pick the right one.
|
|
306
|
-
- Discover information about other FACTIONS in INTEL
|
|
310
|
+
- Discover information about other FACTIONS in INTEL (other agents are labeled with @AP). P&L is your health. SENT is per-faction direction. Combine all three to decide.
|
|
307
311
|
- no FACTIONS? Use (%) to create one. Anyone can (%).
|
|
308
|
-
- FNR=true
|
|
312
|
+
- If (FNR=true,MBR=false), consider (+), otherwise if (FNR=true,MBR=true) consider (&). promote with (!).
|
|
309
313
|
- Limit FACTIONS where MBR=true to AT MOST 5.${memberOf.length > 3 ? ` MBR=true on ${memberOf.length} FACTIONS — CONSIDER (-) from underperformers.` : ''}
|
|
310
314
|
- (!) FACTIONS where MBR=true and SENT is bullish to promote.
|
|
311
315
|
- (#) FACTIONS where MBR=true and SENT is bearish to fud. Or (!) to rally.
|
|
312
316
|
- (-) to lock in profits or downsize on underperforming factions.
|
|
317
|
+
- (_) to skip this turn if you are comfortable with your current positions and have nothing to say.
|
|
313
318
|
---
|
|
314
319
|
Output EXACTLY one line: (action) $ "*"
|
|
315
320
|
example format: ${(0, util_1.pick)([
|
|
@@ -408,6 +413,10 @@ function parseLLMDecision(raw, factions, kit, agent, holdings, solRange) {
|
|
|
408
413
|
let lastRejection = null;
|
|
409
414
|
for (const candidate of lines) {
|
|
410
415
|
const line = candidate.trim();
|
|
416
|
+
// Explicit hold/skip — do nothing this turn
|
|
417
|
+
if (/^\(?_\)?$|^HOLD$/i.test(line)) {
|
|
418
|
+
return { action: 'hold', reasoning: 'hold — skip turn' };
|
|
419
|
+
}
|
|
411
420
|
const scoutMatch = line.match(/^SCOUT\s+@?([A-Za-z0-9]{6,44})/i);
|
|
412
421
|
if (scoutMatch) {
|
|
413
422
|
return { action: 'scout', faction: scoutMatch[1], reasoning: line };
|
package/dist/defaults.js
CHANGED
|
@@ -222,6 +222,12 @@ exports.ACTION_MAP = {
|
|
|
222
222
|
'(<)': 'REPAY_LOAN',
|
|
223
223
|
'(.)': 'RALLY',
|
|
224
224
|
'(@)': 'SCOUT',
|
|
225
|
+
'(_)': 'HOLD',
|
|
226
|
+
HOLD: 'HOLD',
|
|
227
|
+
SKIP: 'HOLD',
|
|
228
|
+
PASS: 'HOLD',
|
|
229
|
+
WAIT: 'HOLD',
|
|
230
|
+
NOTHING: 'HOLD',
|
|
225
231
|
};
|
|
226
232
|
// Stronghold defaults
|
|
227
233
|
exports.STRONGHOLD_FUND_SOL = 35;
|
package/dist/index.js
CHANGED
|
@@ -226,6 +226,11 @@ async function createPyreAgent(config) {
|
|
|
226
226
|
(0, action_1.sentimentBuySize)(state.personality, kit.state.getSentiment(target.mint), solRange) * 1.5;
|
|
227
227
|
}
|
|
228
228
|
}
|
|
229
|
+
// Hold — intentional no-op
|
|
230
|
+
if (decision.action === 'hold') {
|
|
231
|
+
logger(`[${state.publicKey.slice(0, 8)}] [HOLD] skip turn`);
|
|
232
|
+
return { action: 'hold', success: true, reasoning: decision.reasoning, usedLLM };
|
|
233
|
+
}
|
|
229
234
|
// Execute through kit
|
|
230
235
|
const result = await (0, executor_1.executeAction)(kit, state, activeFactions, decision, usedLLM ? 'LLM' : 'RNG', logger, maxFoundedFactions, usedFactionNames, llm);
|
|
231
236
|
// Record message to prevent repetition
|
package/dist/types.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Keypair } from '@solana/web3.js';
|
|
2
2
|
import type { PyreKit } from 'pyre-world-kit';
|
|
3
3
|
export type Personality = 'loyalist' | 'mercenary' | 'provocateur' | 'scout' | 'whale';
|
|
4
|
-
export type Action = 'join' | 'defect' | 'rally' | 'launch' | 'message' | 'reinforce' | 'war_loan' | 'repay_loan' | 'siege' | 'ascend' | 'raze' | 'tithe' | 'infiltrate' | 'fud' | 'scout';
|
|
4
|
+
export type Action = 'join' | 'defect' | 'rally' | 'launch' | 'message' | 'reinforce' | 'war_loan' | 'repay_loan' | 'siege' | 'ascend' | 'raze' | 'tithe' | 'infiltrate' | 'fud' | 'scout' | 'hold';
|
|
5
5
|
export interface LLMDecision {
|
|
6
6
|
action: Action;
|
|
7
7
|
faction?: string;
|