pyre-agent-kit 4.1.3 → 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 +19 -20
- 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,7 +126,7 @@ 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.
|
|
@@ -193,7 +199,13 @@ const buildCompactModelPrompt = (kit, agent, factionCtx, intelSnippet, recentMes
|
|
|
193
199
|
return { id: mint.slice(-8), mint, valueSol: (bal / TOKEN_MULTIPLIER) * (f.price_sol ?? 0), bal };
|
|
194
200
|
})
|
|
195
201
|
.filter(Boolean)
|
|
196
|
-
.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
|
+
});
|
|
197
209
|
const pnl = (gameState.totalSolReceived - gameState.totalSolSpent) / 1e9;
|
|
198
210
|
const totalHoldingsValue = valued.reduce((sum, v) => sum + v.valueSol, 0);
|
|
199
211
|
const unrealizedPnl = totalHoldingsValue + pnl;
|
|
@@ -202,17 +214,6 @@ const buildCompactModelPrompt = (kit, agent, factionCtx, intelSnippet, recentMes
|
|
|
202
214
|
const founded = gameState.founded.slice(0, 2).map((m) => m.slice(-8));
|
|
203
215
|
const heldMints = new Set(holdingsEntries.map(([m]) => m));
|
|
204
216
|
const memberOf = valued.filter((v) => v.valueSol > 0.001).map((v) => v.id);
|
|
205
|
-
const sentimentList = [...kit.state.sentimentMap]
|
|
206
|
-
.filter(([mint]) => heldMints.has(mint))
|
|
207
|
-
.map(([mint, score]) => {
|
|
208
|
-
const f = factionCtx.all.find((ff) => ff.mint === mint);
|
|
209
|
-
if (!f)
|
|
210
|
-
return null;
|
|
211
|
-
const label = score > 3 ? 'bullish' : score < -3 ? 'bearish' : 'neutral';
|
|
212
|
-
return `${f.mint.slice(-8)}:${label}`;
|
|
213
|
-
})
|
|
214
|
-
.filter(Boolean)
|
|
215
|
-
.join(', ') || 'none';
|
|
216
217
|
const foundedSet = new Set(gameState.founded);
|
|
217
218
|
const nearbyMints = new Set(factionCtx.nearby.map(f => f.mint));
|
|
218
219
|
// Status tag for each faction
|
|
@@ -306,7 +307,6 @@ ${factionRows.length > 0 ? factionRows.join('\n') : 'none'}
|
|
|
306
307
|
--- ACTIONS:
|
|
307
308
|
(+) $ "*" - join.
|
|
308
309
|
(-) $ "*" - leave or downsize.
|
|
309
|
-
(|) $ "*" - infiltrate, sneak in.
|
|
310
310
|
(&) $ "*" - reinforce. increase position. bullish.
|
|
311
311
|
(!) $ "*" - talk in comms.
|
|
312
312
|
(#) $ "*" - fud or trash talk.
|
|
@@ -317,7 +317,7 @@ ${factionRows.length > 0 ? factionRows.join('\n') : 'none'}
|
|
|
317
317
|
- REPLACE $ with a FID from the table (always ends in pw).
|
|
318
318
|
- REPLACE * with a ONE sentence RESPONSE, always in double quotes.
|
|
319
319
|
--- RULES:
|
|
320
|
-
FACTIONS where MBR=false: (+)
|
|
320
|
+
FACTIONS where MBR=false: (+)
|
|
321
321
|
FACTIONS where MBR=true: (-), (&), (#)
|
|
322
322
|
FACTIONS where STATUS=RD: (^)
|
|
323
323
|
FACTIONS where STATUS=ASN: (~)
|
|
@@ -326,7 +326,7 @@ any FACTIONS: (!)
|
|
|
326
326
|
- your personality is your tone.
|
|
327
327
|
- no FACTIONS? (%) to create one.
|
|
328
328
|
- (!) and (#) are your voice and how you coordinate with other agents.
|
|
329
|
-
- (+), (&),
|
|
329
|
+
- (+), (&), and (!) all push MCAP up. (-) and (#) lower it.
|
|
330
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.
|
|
331
331
|
- FACTIONS where STATUS=RS may have higher reward if you (+) the right one.
|
|
332
332
|
- (&) and (!) to push FACTIONS where (STATUS=RS,MBR=true) to (STATUS=ASN,MBR=true).
|
|
@@ -339,7 +339,6 @@ example format: ${(0, util_1.pick)([
|
|
|
339
339
|
`(+) ${f1} "${(0, util_1.pick)(['rising fast and I want early exposure.', 'count me in.', 'early is everything.', 'strongest faction here.', 'lets go!'])}"`,
|
|
340
340
|
`(&) ${m} "${(0, util_1.pick)(['doubling down.', 'conviction play.', 'added more.'])}"`,
|
|
341
341
|
`(-) ${m} "${(0, util_1.pick)(['taking profits.', 'time to move on.', 'sentiment is bearish, ready to cut losses.'])}"`,
|
|
342
|
-
`(|) ${f2} "${(0, util_1.pick)(['just looking around.', 'checking the vibes.', 'scouting.', 'sneaking in, opportunity here.'])}"`,
|
|
343
342
|
`(!) ${m} "${(0, util_1.pick)(['love the energy. any strategies?', 'who else is here?', 'just getting started.', 'not leaving.'])}"`,
|
|
344
343
|
`(#) ${m} "${(0, util_1.pick)(['founders went quiet.', 'dead faction.', 'overvalued.', 'this faction is underperforming.'])}"`,
|
|
345
344
|
])}
|