pyre-agent-kit 4.5.4 → 4.5.5

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.
Files changed (2) hide show
  1. package/dist/agent.js +31 -19
  2. package/package.json +1 -1
package/dist/agent.js CHANGED
@@ -299,10 +299,16 @@ const buildCompactModelPrompt = async (kit, agent, factionCtx, solRange, holding
299
299
  const sent = kit.state.sentimentMap.get(f.mint) ?? 0;
300
300
  factionRows.push(`${f.mint.slice(-8)},${mcap},${statusTag(f)},false,false,0,0,${sentLabel(sent)}`);
301
301
  }
302
- // Fetch intel from table member factions only no off-screen FIDs
302
+ // Slice to 8 rows for compact prompt (5 held max + 3 new min)
303
+ const compactRows = factionRows.slice(0, 8);
304
+ const compactMints = new Set(compactRows.map(r => {
305
+ const fid = r.split(',')[0];
306
+ return [...seenMints].find(mint => mint.endsWith(fid)) ?? fid;
307
+ }));
308
+ // Fetch intel from compact table factions only — no off-screen FIDs
303
309
  let intelSnippet = '';
304
310
  try {
305
- const tableMemberMints = [...seenMints].filter(mint => heldMints.has(mint));
311
+ const tableMemberMints = [...compactMints].filter(mint => heldMints.has(mint));
306
312
  const lines = [];
307
313
  for (const mint of tableMemberMints.slice(0, 2)) {
308
314
  const f = factionCtx.all.find(ff => ff.mint === mint);
@@ -318,8 +324,8 @@ const buildCompactModelPrompt = async (kit, agent, factionCtx, solRange, holding
318
324
  }
319
325
  catch { }
320
326
  // Pick example FIDs only from factions actually shown in the table
321
- const tableFids = factionRows.map(r => r.split(',')[0]);
322
- const m = tableFids.find(fid => heldMints.has([...seenMints].find(mint => mint.endsWith(fid)) ?? '')) ?? tableFids[0] ?? 'xxxxxxpw';
327
+ const tableFids = compactRows.map(r => r.split(',')[0]);
328
+ const m = tableFids.find(fid => heldMints.has([...compactMints].find(mint => mint.endsWith(fid)) ?? '')) ?? tableFids[0] ?? 'xxxxxxpw';
323
329
  const nonMemberFids = tableFids.filter(fid => fid !== m);
324
330
  const f1 = nonMemberFids.length > 0 ? (0, util_1.pick)(nonMemberFids) : m;
325
331
  const f2 = nonMemberFids.length > 1 ? (0, util_1.pick)(nonMemberFids.filter(fid => fid !== f1)) : f1;
@@ -327,7 +333,7 @@ const buildCompactModelPrompt = async (kit, agent, factionCtx, solRange, holding
327
333
  --- GOAL:
328
334
  Maximize long-term profit and faction dominance.
329
335
  --- LEGEND:
330
- Factions are rival guilds with full treasuries. Higher MCAP = more power. Lifecycle: RS → RD → ASN.
336
+ Factions are rival guilds with treasuries. Higher MCAP = more power. Lifecycle: RS → RD → ASN.
331
337
  HLTH: your overall profit and loss. your health.
332
338
  FID: the faction identifier.
333
339
  STATUS: RS (99 to 1300 SOL MCAP), RD (1300 MCAP), ASN (1300 MCAP and higher).
@@ -340,14 +346,14 @@ PNL: per-position profit. positive = winning, negative = losing.
340
346
  SENT: sentiment score. positive = bullish, negative = bearish.
341
347
  --- YOU ARE:
342
348
  NAME: @AP${agent.publicKey.slice(0, 4)}
343
- BIO: ${defaults_1.personalityDesc[agent.personality]}
349
+ BIO: ${gameState.personalitySummary ?? defaults_1.personalityDesc[agent.personality]}
344
350
  HLTH: ${pnl >= 0 ? '+' : ''}${pnl.toFixed(4)} SOL
345
351
  ${unrealizedPnl > 1 ? 'YOU ARE UP. consider taking profits.' : unrealizedPnl < -0.5 ? 'YOU ARE DOWN. be conservative. consider downsizing.' : 'BREAKEVEN. look for conviction plays.'}
346
352
  --- INTEL:
347
353
  ${intelSnippet}
348
354
  --- FACTIONS:
349
355
  FID,MCAP,STATUS,MBR,FNR,VALUE,PNL,SENT
350
- ${factionRows.length > 0 ? factionRows.join('\n') : 'none'}
356
+ ${compactRows.length > 0 ? compactRows.join('\n') : 'none'}
351
357
  --- ACTIONS:
352
358
  FORMAT: (action) $ "*"
353
359
  REPLACE $ with EXACTLY one FID from FACTIONS ONLY (always ends in pw).
@@ -361,7 +367,7 @@ REPLACE * with a ONE sentence RESPONSE, always in double quotes.
361
367
  (%) "&" - create new faction. & = creative name, in quotes.
362
368
  (_) - skip turn.
363
369
  --- RULES:
364
- (+) increase MCAP. (-) decreases MCAP.
370
+ (+) increases MCAP. (-) decreases MCAP.
365
371
  (!) increases SENT. (#) decreases SENT.
366
372
  (^) FACTIONS where STATUS=RD.
367
373
  (~) FACTIONS where STATUS=ASN.
@@ -378,7 +384,7 @@ REPLACE * with a ONE sentence RESPONSE, always in double quotes.
378
384
  - (+) and (!) strengthen FACTIONS where MBR=true and STATUS=RS and push towards STATUS=ASN.
379
385
  - consider (-) FACTIONS where MBR=true and PNL is positive to lock in profits.
380
386
  - consider (-) FACTIONS where MBR=true and PNL is negative unless FNR=true or SENT is positive.
381
- - if HLTH is negative, consider (_) or (-) weakest FACTIONS where MBR=true. (+) ONLY if you see opportunity.
387
+ - when HLTH is negative, consider (_) or (-) weakest FACTIONS where MBR=true. (+) ONLY if you see opportunity.
382
388
  - (_) if you would prefer to hold and wait to take action.
383
389
  ---
384
390
  one move per turn. output EXACTLY one line.
@@ -472,10 +478,16 @@ const buildMinimumPrompt = async (kit, agent, factionCtx, solRange, holdings) =>
472
478
  const sent = kit.state.sentimentMap.get(f.mint) ?? 0;
473
479
  factionRows.push(`${f.mint.slice(-8)},${mcap},${statusTag(f)},false,false,0,0,${sentLabel(sent)}`);
474
480
  }
475
- // Fetch intel from table member factions only no off-screen FIDs
481
+ // Slice to 4 rows for min prompt (3 held max + 1 new)
482
+ const minRows = factionRows.slice(0, 4);
483
+ const minMints = new Set(minRows.map(r => {
484
+ const fid = r.split(',')[0];
485
+ return [...seenMints].find(mint => mint.endsWith(fid)) ?? fid;
486
+ }));
487
+ // Fetch intel from min table factions only — no off-screen FIDs
476
488
  let intelSnippet = '';
477
489
  try {
478
- const tableMemberMints = [...seenMints].filter(mint => heldMints.has(mint));
490
+ const tableMemberMints = [...minMints].filter(mint => heldMints.has(mint));
479
491
  const lines = [];
480
492
  for (const mint of tableMemberMints.slice(0, 1)) {
481
493
  const f = factionCtx.all.find(ff => ff.mint === mint);
@@ -491,8 +503,8 @@ const buildMinimumPrompt = async (kit, agent, factionCtx, solRange, holdings) =>
491
503
  }
492
504
  catch { }
493
505
  // Pick example FIDs only from factions actually shown in the table
494
- const tableFids = factionRows.slice(0, 4).map(r => r.split(',')[0]);
495
- const m = tableFids.find(fid => heldMints.has([...seenMints].find(mint => mint.endsWith(fid)) ?? '')) ?? tableFids[0] ?? 'xxxxxxpw';
506
+ const tableFids = minRows.map(r => r.split(',')[0]);
507
+ const m = tableFids.find(fid => heldMints.has([...minMints].find(mint => mint.endsWith(fid)) ?? '')) ?? tableFids[0] ?? 'xxxxxxpw';
496
508
  const nonMemberFids = tableFids.filter(fid => fid !== m);
497
509
  const f1 = nonMemberFids.length > 0 ? (0, util_1.pick)(nonMemberFids) : m;
498
510
  return `Welcome to Pyre, a faction warfare game. Think in English only. Think linearly: situation → decision → reason. Do not repeat yourself. Do NOT overthink, chess/strategy mood.
@@ -512,18 +524,18 @@ PNL: per-position profit. positive = winning, negative = losing.
512
524
  SENT: sentiment score. positive = bullish, negative = bearish.
513
525
  --- YOU ARE:
514
526
  NAME: @AP${agent.publicKey.slice(0, 4)}
515
- BIO: ${defaults_1.personalityDesc[agent.personality]}
516
- HLTH: ${pnl >= 0 ? '+' : ''}${pnl.toFixed(5)} SOL
527
+ BIO: ${gameState.personalitySummary ?? defaults_1.personalityDesc[agent.personality]}
528
+ HLTH: ${pnl >= 0 ? '+' : ''}${pnl.toFixed(4)} SOL
517
529
  ${unrealizedPnl > 1 ? 'YOU ARE UP. consider taking profits.' : unrealizedPnl < -0.5 ? 'YOU ARE DOWN. be conservative. consider downsizing.' : 'BREAKEVEN. look for conviction plays.'}
518
530
  --- INTEL:
519
531
  ${intelSnippet}
520
532
  --- FACTIONS:
521
533
  FID,MCAP,STATUS,MBR,FNR,VALUE,PNL,SENT
522
- ${factionRows.length > 0 ? factionRows.slice(0, 4).join('\n') : 'none'}
534
+ ${minRows.length > 0 ? minRows.join('\n') : 'none'}
523
535
  --- ACTIONS:
524
- FORMAT: (action) $ OR (action) $ "*"
536
+ FORMAT: (action) $ "*"
525
537
  REPLACE $ with EXACTLY one FID from FACTIONS ONLY (always ends in pw).
526
- REPLACE * with a ONE sentence cno , always in double quotes.
538
+ REPLACE * with a ONE sentence RESPONSE, always in double quotes.
527
539
  (+) $ "*" - join or increase.
528
540
  (-) $ "*" - leave or reduce.
529
541
  (!) $ "*" - talk in comms. your voice.
@@ -550,7 +562,7 @@ REPLACE * with a ONE sentence cno , always in double quotes.
550
562
  - (+) and (!) strengthen FACTIONS where MBR=true and STATUS=RS and push towards STATUS=ASN.
551
563
  - consider (-) FACTIONS where MBR=true and PNL is positive to lock in profits.
552
564
  - consider (-) FACTIONS where MBR=true and PNL is negative unless FNR=true or SENT is positive.
553
- - if HLTH is negative, consider (_) or (-) weakest FACTIONS where MBR=true. (+) ONLY if you see opportunity.
565
+ - when HLTH is negative, consider (_) or (-) weakest FACTIONS where MBR=true. (+) ONLY if you see opportunity.
554
566
  - (_) if you would prefer to hold and wait to take action.
555
567
  ---
556
568
  one move per turn. output EXACTLY one line.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pyre-agent-kit",
3
- "version": "4.5.4",
3
+ "version": "4.5.5",
4
4
  "description": "Autonomous agent kit for Pyre — plug in your own LLM and play pyre.world",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",