pyre-agent-kit 4.1.2 → 4.1.4
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 +27 -32
- package/package.json +1 -1
package/dist/agent.js
CHANGED
|
@@ -26,7 +26,13 @@ const buildAgentPrompt = (kit, agent, factionCtx, intelSnippet, recentMessages,
|
|
|
26
26
|
totalHoldingsValue += valueSol;
|
|
27
27
|
positionValues.push({ label, valueSol, mint });
|
|
28
28
|
}
|
|
29
|
-
positionValues.sort((a, b) =>
|
|
29
|
+
positionValues.sort((a, b) => {
|
|
30
|
+
const aFnr = foundedSet.has(a.mint) ? 1 : 0;
|
|
31
|
+
const bFnr = foundedSet.has(b.mint) ? 1 : 0;
|
|
32
|
+
if (aFnr !== bFnr)
|
|
33
|
+
return bFnr - aFnr; // founded first
|
|
34
|
+
return b.valueSol - a.valueSol; // then by value
|
|
35
|
+
});
|
|
30
36
|
const pnl = (gameState.totalSolReceived - gameState.totalSolSpent) / 1e9;
|
|
31
37
|
const unrealizedPnl = totalHoldingsValue + pnl;
|
|
32
38
|
const netInvested = (gameState.totalSolSpent - gameState.totalSolReceived) / 1e9;
|
|
@@ -58,7 +64,7 @@ const buildAgentPrompt = (kit, agent, factionCtx, intelSnippet, recentMessages,
|
|
|
58
64
|
const posPnl = pv.valueSol - estCost;
|
|
59
65
|
pnlStr = `${posPnl >= 0 ? '+' : ''}${posPnl.toFixed(4)}`;
|
|
60
66
|
}
|
|
61
|
-
factionRows.push(`(${f.mint.slice(-8)},${mcap},${statusTag(f)},true,${fnr},${pv.valueSol.toFixed(4)},${pnlStr},${sent > 0 ? '+' : ''}${sent}
|
|
67
|
+
factionRows.push(`(${f.mint.slice(-8)},${mcap},${statusTag(f)},true,${fnr},${pv.valueSol.toFixed(4)},${pnlStr},${sent > 0 ? '+' : ''}${sent},${loan})`);
|
|
62
68
|
}
|
|
63
69
|
// Non-member factions
|
|
64
70
|
const nonMember = factionCtx.all.filter(f => !seenMints.has(f.mint) && f.status !== 'razed');
|
|
@@ -75,7 +81,7 @@ const buildAgentPrompt = (kit, agent, factionCtx, intelSnippet, recentMessages,
|
|
|
75
81
|
seenMints.add(f.mint);
|
|
76
82
|
const mcap = f.market_cap_sol ? `${f.market_cap_sol.toFixed(2)}` : '?';
|
|
77
83
|
const sent = kit.state.sentimentMap.get(f.mint) ?? 0;
|
|
78
|
-
factionRows.push(`(${f.mint.slice(-8)},${mcap},${statusTag(f)},false,false,0,0,${sent > 0 ? '+' : ''}${Math.round(sent * 10) / 10})`);
|
|
84
|
+
factionRows.push(`(${f.mint.slice(-8)},${mcap},${statusTag(f)},false,false,0,0,${sent > 0 ? '+' : ''}${Math.round(sent * 10) / 10},false)`);
|
|
79
85
|
}
|
|
80
86
|
const validatedFactions = [...ascended, ...ready, ...rising, ...nearby, ...unexplored];
|
|
81
87
|
const doNotRepeat = recentMessages.length > 0
|
|
@@ -120,13 +126,13 @@ AL: ${agent.allies.size > 0 ? [...agent.allies].slice(0, 5).map((a) => `@AP${a.s
|
|
|
120
126
|
RVL: ${agent.rivals.size > 0 ? [...agent.rivals].slice(0, 5).map((a) => `@AP${a.slice(0, 4)}`).join(', ') : 'none'}
|
|
121
127
|
LATEST: ${intelSnippet}
|
|
122
128
|
--- FACTIONS:
|
|
123
|
-
(FID,MCAP,STATUS,MBR,FNR,VALUE,PNL,SENT)
|
|
129
|
+
(FID,MCAP,STATUS,MBR,FNR,VALUE,PNL,SENT,LOAN)
|
|
124
130
|
${factionRows.length > 0 ? factionRows.join('\n') : 'none'}
|
|
125
131
|
--- ACTIONS:
|
|
126
132
|
(+) $ "*" - join.
|
|
127
133
|
(-) $ "*" - leave or downsize.
|
|
128
134
|
(|) $ "*" - infiltrate, sneak in.
|
|
129
|
-
(&) $ "*" - reinforce. increase position.
|
|
135
|
+
(&) $ "*" - reinforce. increase position. bullish.
|
|
130
136
|
(!) $ "*" - talk in comms.
|
|
131
137
|
(#) $ "*" - fud or trash talk.
|
|
132
138
|
(^) $ - ascend. unlock treasury.
|
|
@@ -146,7 +152,7 @@ FACTIONS where MBR=true: (-), (&), (#)
|
|
|
146
152
|
FACTIONS where STATUS=RD: (^)
|
|
147
153
|
FACTIONS where STATUS=ASN: (~)
|
|
148
154
|
FACTIONS where (MBR=true,STATUS=ASN): (?), (>)
|
|
149
|
-
FACTIONS where (
|
|
155
|
+
FACTIONS where (LOAN=true): (<)
|
|
150
156
|
any FACTIONS: (!), (.), (%), (@)
|
|
151
157
|
--- VOICE:
|
|
152
158
|
- your personality is your tone. first person only.
|
|
@@ -157,6 +163,7 @@ any FACTIONS: (!), (.), (%), (@)
|
|
|
157
163
|
- dont talk just numbers. build your faction community and culture. form collective identities.${doNotRepeat}
|
|
158
164
|
--- STRATEGIES:
|
|
159
165
|
- (+), (&), (|) and (!) all push MCAP up. (-) and (#) lower it.
|
|
166
|
+
- (|) to join a faction with intentions of (-) later. make this move when you are profit seeking or want to harm a rival faction.
|
|
160
167
|
- find information about FACTIONS in LATEST (other agents are labeled with @AP). HLTH is your performance. PNL and SENT are per-faction direction. combine all three to decide.
|
|
161
168
|
- FACTIONS where STATUS=RS may have higher reward if you (+) the right one.
|
|
162
169
|
- (&) and (!) to push FACTIONS from (STATUS=RS,MBR=true) to (STATUS=ASN,MBR=true) if SENT is bullish.
|
|
@@ -192,7 +199,13 @@ const buildCompactModelPrompt = (kit, agent, factionCtx, intelSnippet, recentMes
|
|
|
192
199
|
return { id: mint.slice(-8), mint, valueSol: (bal / TOKEN_MULTIPLIER) * (f.price_sol ?? 0), bal };
|
|
193
200
|
})
|
|
194
201
|
.filter(Boolean)
|
|
195
|
-
.sort((a, b) =>
|
|
202
|
+
.sort((a, b) => {
|
|
203
|
+
const aFnr = gameState.founded.includes(a.mint) ? 1 : 0;
|
|
204
|
+
const bFnr = gameState.founded.includes(b.mint) ? 1 : 0;
|
|
205
|
+
if (aFnr !== bFnr)
|
|
206
|
+
return bFnr - aFnr; // founded first
|
|
207
|
+
return b.valueSol - a.valueSol; // then by value
|
|
208
|
+
});
|
|
196
209
|
const pnl = (gameState.totalSolReceived - gameState.totalSolSpent) / 1e9;
|
|
197
210
|
const totalHoldingsValue = valued.reduce((sum, v) => sum + v.valueSol, 0);
|
|
198
211
|
const unrealizedPnl = totalHoldingsValue + pnl;
|
|
@@ -201,17 +214,6 @@ const buildCompactModelPrompt = (kit, agent, factionCtx, intelSnippet, recentMes
|
|
|
201
214
|
const founded = gameState.founded.slice(0, 2).map((m) => m.slice(-8));
|
|
202
215
|
const heldMints = new Set(holdingsEntries.map(([m]) => m));
|
|
203
216
|
const memberOf = valued.filter((v) => v.valueSol > 0.001).map((v) => v.id);
|
|
204
|
-
const sentimentList = [...kit.state.sentimentMap]
|
|
205
|
-
.filter(([mint]) => heldMints.has(mint))
|
|
206
|
-
.map(([mint, score]) => {
|
|
207
|
-
const f = factionCtx.all.find((ff) => ff.mint === mint);
|
|
208
|
-
if (!f)
|
|
209
|
-
return null;
|
|
210
|
-
const label = score > 3 ? 'bullish' : score < -3 ? 'bearish' : 'neutral';
|
|
211
|
-
return `${f.mint.slice(-8)}:${label}`;
|
|
212
|
-
})
|
|
213
|
-
.filter(Boolean)
|
|
214
|
-
.join(', ') || 'none';
|
|
215
217
|
const foundedSet = new Set(gameState.founded);
|
|
216
218
|
const nearbyMints = new Set(factionCtx.nearby.map(f => f.mint));
|
|
217
219
|
// Status tag for each faction
|
|
@@ -305,8 +307,7 @@ ${factionRows.length > 0 ? factionRows.join('\n') : 'none'}
|
|
|
305
307
|
--- ACTIONS:
|
|
306
308
|
(+) $ "*" - join.
|
|
307
309
|
(-) $ "*" - leave or downsize.
|
|
308
|
-
(
|
|
309
|
-
(&) $ "*" - reinforce. increase position.
|
|
310
|
+
(&) $ "*" - reinforce. increase position. bullish.
|
|
310
311
|
(!) $ "*" - talk in comms.
|
|
311
312
|
(#) $ "*" - fud or trash talk.
|
|
312
313
|
(^) $ - ascend. unlock treasury.
|
|
@@ -316,37 +317,31 @@ ${factionRows.length > 0 ? factionRows.join('\n') : 'none'}
|
|
|
316
317
|
- REPLACE $ with a FID from the table (always ends in pw).
|
|
317
318
|
- REPLACE * with a ONE sentence RESPONSE, always in double quotes.
|
|
318
319
|
--- RULES:
|
|
319
|
-
FACTIONS where MBR=false: (+)
|
|
320
|
+
FACTIONS where MBR=false: (+)
|
|
320
321
|
FACTIONS where MBR=true: (-), (&), (#)
|
|
321
322
|
FACTIONS where STATUS=RD: (^)
|
|
322
323
|
FACTIONS where STATUS=ASN: (~)
|
|
323
|
-
any FACTIONS: (!)
|
|
324
|
+
any FACTIONS: (!)
|
|
324
325
|
--- STRATEGIES:
|
|
325
326
|
- your personality is your tone.
|
|
326
327
|
- no FACTIONS? (%) to create one.
|
|
327
|
-
- (
|
|
328
|
+
- (!) and (#) are your voice and how you coordinate with other agents.
|
|
329
|
+
- (+), (&), and (!) all push MCAP up. (-) and (#) lower it.
|
|
328
330
|
- find information about FACTIONS in INTEL (other agents are labeled with @AP). HLTH is your performance. PNL and SENT are per-faction direction. combine all three to decide.
|
|
329
331
|
- FACTIONS where STATUS=RS may have higher reward if you (+) the right one.
|
|
330
|
-
- (&) and (!) to push FACTIONS where (STATUS=RS,MBR=true) to (STATUS=ASN,MBR=true)
|
|
331
|
-
- (!) and (#) are your voice.
|
|
332
|
+
- (&) and (!) to push FACTIONS where (STATUS=RS,MBR=true) to (STATUS=ASN,MBR=true).
|
|
332
333
|
- if (FNR=true,MBR=false), consider (+). this is your faction, promote it.
|
|
333
334
|
- limit FACTIONS where MBR=true to AT MOST 5.${memberOf.length > 3 ? ` MBR=true on ${memberOf.length} FACTIONS — consider (-) from underperformers.` : ''}
|
|
334
335
|
- (-) to lock in profits on FACTIONS where (MBR=true,PNL=WIN) or downsize where (MBR=true,PNL=LOSS,SENT=BEAR).
|
|
335
336
|
- (_) to skip this turn if you are comfortable with your current positions and have nothing to say.
|
|
336
337
|
---
|
|
337
|
-
|
|
338
|
+
example format: ${(0, util_1.pick)([
|
|
338
339
|
`(+) ${f1} "${(0, util_1.pick)(['rising fast and I want early exposure.', 'count me in.', 'early is everything.', 'strongest faction here.', 'lets go!'])}"`,
|
|
339
340
|
`(&) ${m} "${(0, util_1.pick)(['doubling down.', 'conviction play.', 'added more.'])}"`,
|
|
340
|
-
])}
|
|
341
|
-
EXAMPLE: ${(0, util_1.pick)([
|
|
342
341
|
`(-) ${m} "${(0, util_1.pick)(['taking profits.', 'time to move on.', 'sentiment is bearish, ready to cut losses.'])}"`,
|
|
343
|
-
`(|) ${f2} "${(0, util_1.pick)(['just looking around.', 'checking the vibes.', 'scouting.', 'sneaking in, opportunity here.'])}"`,
|
|
344
|
-
])}
|
|
345
|
-
EXAMPLE: ${(0, util_1.pick)([
|
|
346
342
|
`(!) ${m} "${(0, util_1.pick)(['love the energy. any strategies?', 'who else is here?', 'just getting started.', 'not leaving.'])}"`,
|
|
347
343
|
`(#) ${m} "${(0, util_1.pick)(['founders went quiet.', 'dead faction.', 'overvalued.', 'this faction is underperforming.'])}"`,
|
|
348
344
|
])}
|
|
349
|
-
---
|
|
350
345
|
output EXACTLY one line: (action) $ "*" OR (_)
|
|
351
346
|
>`;
|
|
352
347
|
};
|