pyre-agent-kit 4.5.2 → 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,18 +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
- - consider (-) FACTIONS where MBR=true and PNL is negative unless FNR=true or SENT is positive.${pnl < 0 ? `\n- HLTH is negative, consider (_) or (-) weakest FACTIONS where MBR=true. (+) or (&) ONLY if you see opportunity.` : ''}
380
+ - 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.
383
382
  - (_) if you would prefer to hold and wait to take action.
384
383
  ---
385
384
  one move per turn. output EXACTLY one line.
386
385
  example format: ${(0, util_1.pick)([
387
- `(+) ${f1} "${(0, util_1.pick)(['rising fast and I want early exposure.', 'count me in.', 'early is everything.', 'strongest faction here.', 'lets go!'])}"`,
388
- `(&) ${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.'])}"`,
389
387
  `(-) ${m} "${(0, util_1.pick)(['taking profits.', 'time to move on.', 'sentiment is bearish, ready to cut losses.'])}"`,
390
- `(!) ${m} "${(0, util_1.pick)(['love the energy. any strategies?', 'who else is here?', 'just getting started.', 'not leaving.'])}"`,
391
- `(#) ${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.'])}"`,
392
392
  ])}
393
393
  >`;
394
394
  };
@@ -524,23 +524,21 @@ ${factionRows.length > 0 ? factionRows.slice(0, 4).join('\n') : 'none'}
524
524
  FORMAT: (action) $ OR (action) $ "*"
525
525
  REPLACE $ with EXACTLY one FID from FACTIONS ONLY (always ends in pw).
526
526
  REPLACE * with a ONE sentence cno , always in double quotes.
527
- (+) $ - join.
528
- (-) $ - leave or reduce.
529
- (&) $ - increase position.
527
+ (+) $ "*" - join or increase.
528
+ (-) $ "*" - leave or reduce.
530
529
  (!) $ "*" - talk in comms. your voice.
531
530
  (#) $ "*" - trash talk.
532
531
  (^) $ - ascend. unlock treasury.
533
532
  (~) $ - harvest fees.
534
- (%) "..." - create new faction. "..." = creative name, in quotes.
533
+ (%) "&" - create new faction. & = creative name, in quotes.
535
534
  (_) - skip turn.
536
535
  --- RULES:
537
- (+) and (&) increase MCAP. (-) decreases MCAP.
538
- (!) increases SENT. (#) decreases SENT.the
539
- (!) any FACTIONS.
536
+ (+) increases MCAP. (-) decreases MCAP.
537
+ (!) increases SENT. (#) decreases SENT.
540
538
  (^) FACTIONS where STATUS=RD.
541
539
  (~) FACTIONS where STATUS=ASN.
542
- (+) FACTIONS where MBR=false.
543
- (-), (&) or (#) FACTIONS where MBR=true.
540
+ (-) or (#) FACTIONS where MBR=true.
541
+ (+) or (!) any FACTIONS.
544
542
  --- STRATEGIES:
545
543
  - your personality is your tone.
546
544
  - no FACTIONS? (%) to create one.
@@ -549,19 +547,19 @@ REPLACE * with a ONE sentence cno , always in double quotes.
549
547
  - FACTIONS where FNR=true and MBR=false, consider (+). (!) to promote it.
550
548
  - FACTIONS where STATUS=RS may have higher reward if you (+) the right one.
551
549
  - in FACTIONS where MBR=true, if MCAP increases, your PNL will increase.
552
- - (&) 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.
553
551
  - consider (-) FACTIONS where MBR=true and PNL is positive to lock in profits.
554
- - consider (-) FACTIONS where MBR=true and PNL is negative unless FNR=true or SENT is positive.${pnl < 0 ? `\n- HLTH is negative, consider (_) or (-) weakest FACTIONS where MBR=true. (+) or (&) ONLY if you see opportunity.` : ''}
552
+ - 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.
555
554
  - (_) if you would prefer to hold and wait to take action.
556
555
  ---
557
556
  one move per turn. output EXACTLY one line.
558
557
  example format: ${(0, util_1.pick)([
559
- `(+) ${f1}`,
560
- `(&) ${m}`,
561
- `(-) ${m}`,
562
- `(!) ${m} "${(0, util_1.pick)(['any strategies?', 'not leaving.'])}"`,
563
- `(#) ${m} "${(0, util_1.pick)(['dead faction.', 'overvalued.'])}"`,
564
- `(!) ${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!'])}"`,
565
563
  `(#) ${m} "${(0, util_1.pick)(['faction went quiet.', 'underperforming.'])}"`,
566
564
  ])}
567
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.2",
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",