pyre-agent-kit 4.3.0 → 4.3.1
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 -14
- package/package.json +1 -1
package/dist/agent.js
CHANGED
|
@@ -64,7 +64,7 @@ const buildAgentPrompt = (kit, agent, factionCtx, intelSnippet, recentMessages,
|
|
|
64
64
|
const posPnl = pv.valueSol - estCost;
|
|
65
65
|
pnlStr = `${posPnl >= 0 ? '+' : ''}${posPnl.toFixed(4)}`;
|
|
66
66
|
}
|
|
67
|
-
factionRows.push(
|
|
67
|
+
factionRows.push(`${f.mint.slice(-8)},${mcap},${statusTag(f)},true,${fnr},${pv.valueSol.toFixed(4)},${pnlStr},${sent > 0 ? '+' : ''}${sent},${loan}`);
|
|
68
68
|
}
|
|
69
69
|
// Non-member factions
|
|
70
70
|
const nonMember = factionCtx.all.filter(f => !seenMints.has(f.mint) && f.status !== 'razed');
|
|
@@ -81,7 +81,7 @@ const buildAgentPrompt = (kit, agent, factionCtx, intelSnippet, recentMessages,
|
|
|
81
81
|
seenMints.add(f.mint);
|
|
82
82
|
const mcap = f.market_cap_sol ? `${f.market_cap_sol.toFixed(2)}` : '?';
|
|
83
83
|
const sent = kit.state.sentimentMap.get(f.mint) ?? 0;
|
|
84
|
-
factionRows.push(
|
|
84
|
+
factionRows.push(`${f.mint.slice(-8)},${mcap},${statusTag(f)},false,false,0,0,${sent > 0 ? '+' : ''}${Math.round(sent * 10) / 10},false`);
|
|
85
85
|
}
|
|
86
86
|
const validatedFactions = [...ascended, ...ready, ...rising, ...nearby, ...unexplored];
|
|
87
87
|
const doNotRepeat = recentMessages.length > 0
|
|
@@ -124,7 +124,7 @@ ALLIES: ${agent.allies.size > 0 ? [...agent.allies].slice(0, 5).map((a) => `@AP$
|
|
|
124
124
|
RIVALS: ${agent.rivals.size > 0 ? [...agent.rivals].slice(0, 5).map((a) => `@AP${a.slice(0, 4)}`).join(', ') : 'none'}
|
|
125
125
|
LATEST: ${intelSnippet}
|
|
126
126
|
--- FACTIONS:
|
|
127
|
-
|
|
127
|
+
FID,MCAP,STATUS,MBR,FNR,VALUE,PNL,SENT,LOAN
|
|
128
128
|
${factionRows.length > 0 ? factionRows.join('\n') : 'none'}
|
|
129
129
|
--- ACTIONS:
|
|
130
130
|
FORMAT: (action) $ "*"
|
|
@@ -172,7 +172,8 @@ REPLACE * with a ONE sentence RESPONSE, always in double quotes.
|
|
|
172
172
|
- (|) to join a faction with intentions of (-) later. take this action when you are profit seeking or want to harm a rival faction.
|
|
173
173
|
- (&) and (!) to push FACTIONS where MBR=true and STATUS=RS to STATUS=ASN.
|
|
174
174
|
- consider (-) to lock in profits on FACTIONS where MBR=true and PNL is positive.
|
|
175
|
-
- consider (-)
|
|
175
|
+
- consider (-) FACTIONS where MBR=true and PNL is negative unless FNR=true or SENT is bullish.
|
|
176
|
+
- when HLTH is negative, prefer (-) weakest FACTIONS where MBR=true or (_). consider (+) or (&) ONLY if you see potential opportunity.
|
|
176
177
|
- (_) if you are comfortable with your current positions and have nothing to say. the best move is sometimes no move.
|
|
177
178
|
---
|
|
178
179
|
one move per turn. output EXACTLY one line: (action) $ "*" OR (_)
|
|
@@ -253,7 +254,7 @@ const buildCompactModelPrompt = (kit, agent, factionCtx, intelSnippet, recentMes
|
|
|
253
254
|
const mcap = f.market_cap_sol ? `${f.market_cap_sol.toFixed(2)}` : '?';
|
|
254
255
|
const fnr = foundedSet.has(f.mint);
|
|
255
256
|
const sent = kit.state.sentimentMap.get(f.mint) ?? 0;
|
|
256
|
-
factionRows.push(
|
|
257
|
+
factionRows.push(`${f.mint.slice(-8)},${mcap},${statusTag(f)},true,${fnr},${v.valueSol.toFixed(4)},${pnlLabel(v.valueSol, v.bal)},${sentLabel(sent)}`);
|
|
257
258
|
}
|
|
258
259
|
// Non-member factions
|
|
259
260
|
const nonMember = factionCtx.all.filter(f => !seenMints.has(f.mint) && f.status !== 'razed');
|
|
@@ -270,7 +271,7 @@ const buildCompactModelPrompt = (kit, agent, factionCtx, intelSnippet, recentMes
|
|
|
270
271
|
seenMints.add(f.mint);
|
|
271
272
|
const mcap = f.market_cap_sol ? `${f.market_cap_sol.toFixed(2)}` : '?';
|
|
272
273
|
const sent = kit.state.sentimentMap.get(f.mint) ?? 0;
|
|
273
|
-
factionRows.push(
|
|
274
|
+
factionRows.push(`${f.mint.slice(-8)},${mcap},${statusTag(f)},false,false,0,FLAT,${sentLabel(sent)}`);
|
|
274
275
|
}
|
|
275
276
|
const validatedFactions = [...ascended, ...ready, ...rising, ...nearby, ...unexplored];
|
|
276
277
|
const mMint2 = [...heldMints][0] || (validatedFactions.length > 0 ? (0, util_1.pick)(validatedFactions).mint : null);
|
|
@@ -297,13 +298,12 @@ SENT: sentiment score. BULL=positive, BEAR=negative, NEUT=neutral.
|
|
|
297
298
|
--- YOU ARE:
|
|
298
299
|
NAME: @AP${agent.publicKey.slice(0, 4)}
|
|
299
300
|
BIO: ${defaults_1.personalityDesc[agent.personality]}
|
|
300
|
-
LAST MOVES: ${kit.state.history.length > 0 ? [...kit.state.history].slice(-2).join('; ') : 'none'}
|
|
301
301
|
HLTH: ${pnl >= 0 ? '+' : ''}${pnl.toFixed(4)} SOL
|
|
302
302
|
${unrealizedPnl > 1 ? 'YOU ARE UP. consider taking profits.' : unrealizedPnl < -0.5 ? 'YOU ARE DOWN. be conservative. consider downsizing.' : 'BREAKEVEN. look for conviction plays.'}
|
|
303
303
|
--- INTEL:
|
|
304
304
|
${intelSnippet}
|
|
305
305
|
--- FACTIONS:
|
|
306
|
-
|
|
306
|
+
FID,MCAP,STATUS,MBR,FNR,VALUE,PNL,SENT
|
|
307
307
|
${factionRows.length > 0 ? factionRows.join('\n') : 'none'}
|
|
308
308
|
--- ACTIONS:
|
|
309
309
|
FORMAT: (action) $ "*"
|
|
@@ -336,7 +336,8 @@ REPLACE * with a ONE sentence RESPONSE, always in double quotes.
|
|
|
336
336
|
- (+) and (&) increase MCAP. (-) decreases MCAP.
|
|
337
337
|
- (&) and (!) to push FACTIONS where MBR=true and STATUS=RS to STATUS=ASN.
|
|
338
338
|
- consider (-) FACTIONS where MBR=true and PNL=WIN to lock in profits.
|
|
339
|
-
- consider (-) FACTIONS where MBR=true
|
|
339
|
+
- consider (-) FACTIONS where MBR=true and PNL=LOSS unless FNR=true or SENT=BULL.
|
|
340
|
+
- when HLTH is negative, prefer (-) weakest FACTIONS where MBR=true or (_). consider (+) or (&) ONLY if you see potential opportunity.
|
|
340
341
|
- (_) if you are comfortable with your current positions. the best move is sometimes no move.
|
|
341
342
|
---
|
|
342
343
|
one move per turn. output EXACTLY one line: (action) $ "*" OR (_)
|
|
@@ -661,17 +662,21 @@ async function llmDecide(kit, agent, factions, recentMessages, llm, log, solRang
|
|
|
661
662
|
};
|
|
662
663
|
let intelSnippet = '';
|
|
663
664
|
if (compact) {
|
|
664
|
-
// Compact:
|
|
665
|
+
// Compact: up to 2 intel lines from held factions
|
|
665
666
|
try {
|
|
666
667
|
const heldMints = [...holdings.keys()];
|
|
667
|
-
const
|
|
668
|
-
|
|
669
|
-
|
|
668
|
+
const heldFactions = allFactions.filter((f) => heldMints.includes(f.mint)).slice(0, 2);
|
|
669
|
+
const lines = [];
|
|
670
|
+
for (const hf of heldFactions) {
|
|
671
|
+
if (lines.length >= 2)
|
|
672
|
+
break;
|
|
673
|
+
const intel = await (0, faction_1.fetchFactionIntel)(kit, hf);
|
|
670
674
|
const latest = intel.recentComms.find((c) => c.sender !== agent.publicKey);
|
|
671
675
|
if (latest) {
|
|
672
|
-
|
|
676
|
+
lines.push(`@AP${latest.sender.slice(0, 4)} in ${hf.mint.slice(-8)}: "${latest.memo.replace(/^<+/, '').replace(/>+\s*$/, '').slice(0, 60)}"`);
|
|
673
677
|
}
|
|
674
678
|
}
|
|
679
|
+
intelSnippet = lines.join('\n');
|
|
675
680
|
}
|
|
676
681
|
catch { }
|
|
677
682
|
}
|