pyre-agent-kit 4.5.3 → 4.5.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 CHANGED
@@ -352,23 +352,21 @@ ${factionRows.length > 0 ? factionRows.join('\n') : 'none'}
352
352
  FORMAT: (action) $ "*"
353
353
  REPLACE $ with EXACTLY one FID from FACTIONS ONLY (always ends in pw).
354
354
  REPLACE * with a ONE sentence RESPONSE, always in double quotes.
355
- (+) $ "*" - join.
355
+ (+) $ "*" - join or increase.
356
356
  (-) $ "*" - leave or reduce.
357
- (&) $ "*" - reinforce. increase position.
358
357
  (!) $ "*" - talk in comms. your voice.
359
358
  (#) $ "*" - trash talk.
360
359
  (^) $ - ascend. unlock treasury.
361
360
  (~) $ - harvest fees.
362
- (%) "..." - create new faction. "..." = creative name, in quotes.
361
+ (%) "&" - create new faction. & = creative name, in quotes.
363
362
  (_) - skip turn.
364
363
  --- RULES:
365
- (+) and (&) increase MCAP. (-) decreases MCAP.
364
+ (+) increase MCAP. (-) decreases MCAP.
366
365
  (!) increases SENT. (#) decreases SENT.
367
- (!) any FACTIONS.
368
366
  (^) FACTIONS where STATUS=RD.
369
367
  (~) FACTIONS where STATUS=ASN.
370
- (+) FACTIONS where MBR=false.
371
- (-), (&) or (#) FACTIONS where MBR=true.
368
+ (-) or (#) FACTIONS where MBR=true.
369
+ (+) or (!) any FACTIONS.
372
370
  --- STRATEGIES:
373
371
  - your personality is your tone.
374
372
  - no FACTIONS? (%) to create one.
@@ -377,19 +375,20 @@ REPLACE * with a ONE sentence RESPONSE, always in double quotes.
377
375
  - FACTIONS where FNR=true and MBR=false, consider (+). (!) to promote it.
378
376
  - FACTIONS where STATUS=RS may have higher reward if you (+) the right one.
379
377
  - in FACTIONS where MBR=true, if MCAP increases, your PNL will increase.
380
- - (&) and (!) strengthen FACTIONS where MBR=true and STATUS=RS and push towards STATUS=ASN.
378
+ - (+) and (!) strengthen FACTIONS where MBR=true and STATUS=RS and push towards STATUS=ASN.
381
379
  - consider (-) FACTIONS where MBR=true and PNL is positive to lock in profits.
382
380
  - consider (-) FACTIONS where MBR=true and PNL is negative unless FNR=true or SENT is positive.
383
- - if HLTH is negative, consider (_) or (-) weakest FACTIONS where MBR=true. (+) or (&) ONLY if you see opportunity.
381
+ - if HLTH is negative, consider (_) or (-) weakest FACTIONS where MBR=true. (+) ONLY if you see opportunity.
384
382
  - (_) if you would prefer to hold and wait to take action.
385
383
  ---
386
384
  one move per turn. output EXACTLY one line.
387
385
  example format: ${(0, util_1.pick)([
388
- `(+) ${f1} "${(0, util_1.pick)(['rising fast and I want early exposure.', 'count me in.', 'early is everything.', 'strongest faction here.', 'lets go!'])}"`,
389
- `(&) ${m} "${(0, util_1.pick)(['doubling down.', 'conviction play.', 'added more.'])}"`,
386
+ `(+) ${f1} "${(0, util_1.pick)(['conviction play.', 'count me in.', 'early is everything.', 'strongest faction here.'])}"`,
390
387
  `(-) ${m} "${(0, util_1.pick)(['taking profits.', 'time to move on.', 'sentiment is bearish, ready to cut losses.'])}"`,
391
- `(!) ${m} "${(0, util_1.pick)(['love the energy. any strategies?', 'who else is here?', 'just getting started.', 'not leaving.'])}"`,
392
- `(#) ${m} "${(0, util_1.pick)(['founders went quiet.', 'dead faction.', 'overvalued.', 'this faction is underperforming.'])}"`,
388
+ `(!) ${m} "${(0, util_1.pick)(['any strategies?', 'not leaving.', 'just getting started.'])}"`,
389
+ `(#) ${m} "${(0, util_1.pick)(['dead faction.', 'overvalued.', 'full of larps.'])}"`,
390
+ `(!) ${m} "${(0, util_1.pick)(['who else is here?', 'love the energy.', 'lets go!'])}"`,
391
+ `(#) ${m} "${(0, util_1.pick)(['faction went quiet.', 'underperforming.'])}"`,
393
392
  ])}
394
393
  >`;
395
394
  };
@@ -525,23 +524,21 @@ ${factionRows.length > 0 ? factionRows.slice(0, 4).join('\n') : 'none'}
525
524
  FORMAT: (action) $ OR (action) $ "*"
526
525
  REPLACE $ with EXACTLY one FID from FACTIONS ONLY (always ends in pw).
527
526
  REPLACE * with a ONE sentence cno , always in double quotes.
528
- (+) $ - join.
529
- (-) $ - leave or reduce.
530
- (&) $ - increase position.
527
+ (+) $ "*" - join or increase.
528
+ (-) $ "*" - leave or reduce.
531
529
  (!) $ "*" - talk in comms. your voice.
532
530
  (#) $ "*" - trash talk.
533
531
  (^) $ - ascend. unlock treasury.
534
532
  (~) $ - harvest fees.
535
- (%) "..." - create new faction. "..." = creative name, in quotes.
533
+ (%) "&" - create new faction. & = creative name, in quotes.
536
534
  (_) - skip turn.
537
535
  --- RULES:
538
- (+) and (&) increase MCAP. (-) decreases MCAP.
539
- (!) increases SENT. (#) decreases SENT.the
540
- (!) any FACTIONS.
536
+ (+) increases MCAP. (-) decreases MCAP.
537
+ (!) increases SENT. (#) decreases SENT.
541
538
  (^) FACTIONS where STATUS=RD.
542
539
  (~) FACTIONS where STATUS=ASN.
543
- (+) FACTIONS where MBR=false.
544
- (-), (&) or (#) FACTIONS where MBR=true.
540
+ (-) or (#) FACTIONS where MBR=true.
541
+ (+) or (!) any FACTIONS.
545
542
  --- STRATEGIES:
546
543
  - your personality is your tone.
547
544
  - no FACTIONS? (%) to create one.
@@ -550,20 +547,19 @@ REPLACE * with a ONE sentence cno , always in double quotes.
550
547
  - FACTIONS where FNR=true and MBR=false, consider (+). (!) to promote it.
551
548
  - FACTIONS where STATUS=RS may have higher reward if you (+) the right one.
552
549
  - in FACTIONS where MBR=true, if MCAP increases, your PNL will increase.
553
- - (&) and (!) strengthen FACTIONS where MBR=true and STATUS=RS and push towards STATUS=ASN.
550
+ - (+) and (!) strengthen FACTIONS where MBR=true and STATUS=RS and push towards STATUS=ASN.
554
551
  - consider (-) FACTIONS where MBR=true and PNL is positive to lock in profits.
555
552
  - consider (-) FACTIONS where MBR=true and PNL is negative unless FNR=true or SENT is positive.
556
- - if HLTH is negative, consider (_) or (-) weakest FACTIONS where MBR=true. (+) or (&) ONLY if you see opportunity.
553
+ - if HLTH is negative, consider (_) or (-) weakest FACTIONS where MBR=true. (+) ONLY if you see opportunity.
557
554
  - (_) if you would prefer to hold and wait to take action.
558
555
  ---
559
556
  one move per turn. output EXACTLY one line.
560
557
  example format: ${(0, util_1.pick)([
561
- `(+) ${f1}`,
562
- `(&) ${m}`,
563
- `(-) ${m}`,
564
- `(!) ${m} "${(0, util_1.pick)(['any strategies?', 'not leaving.'])}"`,
565
- `(#) ${m} "${(0, util_1.pick)(['dead faction.', 'overvalued.'])}"`,
566
- `(!) ${m} "${(0, util_1.pick)(['who else is here?', 'love the energy.'])}"`,
558
+ `(+) ${f1} "${(0, util_1.pick)(['conviction play.', 'count me in.', 'early is everything.', 'strongest faction here.'])}"`,
559
+ `(-) ${m} "${(0, util_1.pick)(['taking profits.', 'time to move on.', 'sentiment is bearish, ready to cut losses.'])}"`,
560
+ `(!) ${m} "${(0, util_1.pick)(['any strategies?', 'not leaving.', 'just getting started.'])}"`,
561
+ `(#) ${m} "${(0, util_1.pick)(['dead faction.', 'overvalued.', 'full of larps.'])}"`,
562
+ `(!) ${m} "${(0, util_1.pick)(['who else is here?', 'love the energy.', 'lets go!'])}"`,
567
563
  `(#) ${m} "${(0, util_1.pick)(['faction went quiet.', 'underperforming.'])}"`,
568
564
  ])}
569
565
  >`;
package/dist/executor.js CHANGED
@@ -431,9 +431,19 @@ const handlers = {
431
431
  async function executeAction(kit, agent, factions, decision, brain, log, maxFoundedFactions, usedFactionNames, llm) {
432
432
  const short = agent.publicKey.slice(0, 8);
433
433
  try {
434
- const handler = handlers[decision.action];
434
+ // (+) resolves to 'join' — reroute to 'reinforce' if agent already holds the faction
435
+ let action = decision.action;
436
+ if (action === 'join' && decision.faction) {
437
+ const faction = factions.find(f => f.mint === decision.faction || f.mint.endsWith(decision.faction));
438
+ if (faction) {
439
+ const balance = await kit.state.getBalance(faction.mint);
440
+ if (balance > 0)
441
+ action = 'reinforce';
442
+ }
443
+ }
444
+ const handler = handlers[action];
435
445
  if (!handler)
436
- return { success: false, error: `unknown action: ${decision.action}` };
446
+ return { success: false, error: `unknown action: ${action}` };
437
447
  const desc = await handler(kit, agent, factions, decision, log, maxFoundedFactions, usedFactionNames, llm);
438
448
  if (!desc)
439
449
  return { success: false, error: 'action precondition not met' };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pyre-agent-kit",
3
- "version": "4.5.3",
3
+ "version": "4.5.4",
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",