pyre-agent-kit 2.0.21 → 2.0.23

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
@@ -109,7 +109,7 @@ Prefer actions that move tokens AND include a message — JOIN, DEFECT, FUD, INF
109
109
  Comms are where the real game happens — trash talk, alliances, intel drops, call-outs, and power plays. Be specific. Reference real agents, real numbers, real moves. Generic messages are boring. Have an opinion and say it loud. Mix it up — trade often, but keep the comms active too.
110
110
 
111
111
  WHO YOU ARE:
112
- Your address: ${agent.publicKey.slice(0, 8)}
112
+ You are "${agent.publicKey.slice(0, 8)}" — always speak in FIRST PERSON. Say "I", "my", "me". Never refer to yourself in third person or by your address.
113
113
  Personality: ${agent.personality} — ${defaults_1.personalityDesc[agent.personality]}
114
114
  Voice this turn: ${voiceNudge}
115
115
  ${memoryBlock}
@@ -133,7 +133,7 @@ ${(0, faction_1.generateDynamicExamples)(factions, agent)}
133
133
 
134
134
  Use your messages to define who YOU are. Be unique — don't sound like every other agent. Explore different angles, develop your own voice, create a reputation. The pyre.world realm is vast — find your niche and own it. Keep it varied and conversational — talk like a real person, not a bot. Mix up your sentence structure, tone, and energy. Sometimes ask questions, sometimes make statements, sometimes joke around.
135
135
  Your message MUST match your action/intent — if you're joining, sound bullish. If you're defecting, talk trash on the way out. Make sure you make accurate claims unless you are specifically being sneaky.
136
- If referencing your own wallet address, reframe the message from third person to first person. For example, instead of "saw @5Vt7ENia dump 5%, I'm out" say "I just dumped 5%, deal with it". Occasionally, as a checkpoint step, message a faction with who you currently are (think of this like a checkpoint).
136
+ CRITICAL: Always speak as yourself in first person. Say "I'm going all in" NOT "${agent.publicKey.slice(0, 8)} is going all in". You ARE the agent use "I", "my", "me" in every message.
137
137
 
138
138
  Your response (one line only):`;
139
139
  };
package/dist/cli.js CHANGED
@@ -47,6 +47,7 @@ const fs = __importStar(require("fs"));
47
47
  const path = __importStar(require("path"));
48
48
  const web3_js_1 = require("@solana/web3.js");
49
49
  const index_1 = require("./index");
50
+ const pyre_world_kit_1 = require("pyre-world-kit");
50
51
  // ─── Constants ────────────────────────────────────────────────────
51
52
  const CONFIG_PATH = path.join(process.env.HOME ?? '.', '.pyre-agent.json');
52
53
  const BANNER = `
@@ -340,7 +341,29 @@ async function runAgent(config) {
340
341
  };
341
342
  process.on('SIGINT', shutdown);
342
343
  process.on('SIGTERM', shutdown);
343
- // Auto-save every 10 ticks
344
+ // Action tracking for checkpoints
345
+ const CHECKPOINT_EVERY = 20;
346
+ const ALL_ACTIONS = [
347
+ 'join', 'defect', 'rally', 'launch', 'message',
348
+ 'stronghold', 'war_loan', 'repay_loan', 'siege', 'ascend', 'raze', 'tithe',
349
+ 'infiltrate', 'fud',
350
+ ];
351
+ const actionCounts = new Array(14).fill(0);
352
+ const recentMemos = [];
353
+ // Seed counts from registry profile if available
354
+ try {
355
+ const reg = await (0, pyre_world_kit_1.getRegistryProfile)(connection, keypair.publicKey.toBase58());
356
+ if (reg) {
357
+ const seed = [
358
+ reg.joins, reg.defects, reg.rallies, reg.launches, reg.messages,
359
+ reg.reinforces, reg.war_loans, reg.repay_loans, reg.sieges,
360
+ reg.ascends, reg.razes, reg.tithes, reg.infiltrates, reg.fuds,
361
+ ];
362
+ for (let i = 0; i < seed.length; i++)
363
+ actionCounts[i] = Math.max(actionCounts[i], seed[i]);
364
+ }
365
+ }
366
+ catch { /* no profile yet */ }
344
367
  let tickCount = 0;
345
368
  while (running) {
346
369
  try {
@@ -350,11 +373,47 @@ async function runAgent(config) {
350
373
  const msg = result.message ? ` "${result.message}"` : '';
351
374
  const brain = result.usedLLM ? 'LLM' : 'RNG';
352
375
  console.log(` [${ts()}] #${tickCount} [${brain}] ${result.action.toUpperCase()} ${result.faction ?? ''}${msg} — ${status}`);
376
+ // Track actions for checkpoint
377
+ if (result.success) {
378
+ const idx = ALL_ACTIONS.indexOf(result.action);
379
+ if (idx >= 0)
380
+ actionCounts[idx]++;
381
+ if (result.message?.trim()) {
382
+ recentMemos.push(result.message);
383
+ if (recentMemos.length > 10)
384
+ recentMemos.shift();
385
+ }
386
+ }
353
387
  // Auto-save state every 10 ticks
354
388
  if (tickCount % 10 === 0) {
355
389
  const saved = agent.serialize();
356
390
  fs.writeFileSync(statePath, JSON.stringify(saved, null, 2));
357
391
  }
392
+ // Checkpoint to pyre_world every N ticks
393
+ if (tickCount % CHECKPOINT_EVERY === 0) {
394
+ try {
395
+ const personality = agent.personality;
396
+ const summary = recentMemos.length > 0
397
+ ? `${personality}: ${recentMemos.slice(-5).join('. ')}`.slice(0, 256)
398
+ : personality;
399
+ const pub = keypair.publicKey.toBase58();
400
+ const cpResult = await (0, pyre_world_kit_1.buildCheckpointTransaction)(connection, {
401
+ signer: pub,
402
+ creator: pub,
403
+ joins: actionCounts[0], defects: actionCounts[1], rallies: actionCounts[2],
404
+ launches: actionCounts[3], messages: actionCounts[4], fuds: actionCounts[13],
405
+ infiltrates: actionCounts[12], reinforces: actionCounts[5],
406
+ war_loans: actionCounts[6], repay_loans: actionCounts[7], sieges: actionCounts[8],
407
+ ascends: actionCounts[9], razes: actionCounts[10], tithes: actionCounts[11],
408
+ personality_summary: summary,
409
+ });
410
+ await (0, index_1.sendAndConfirm)(connection, keypair, cpResult);
411
+ console.log(` [${ts()}] Checkpointed to pyre_world (${actionCounts.reduce((a, b) => a + b, 0)} total actions)`);
412
+ }
413
+ catch (e) {
414
+ console.error(` [${ts()}] Checkpoint failed: ${e.message?.slice(0, 60)}`);
415
+ }
416
+ }
358
417
  }
359
418
  catch (e) {
360
419
  console.error(` [${ts()}] Tick error: ${e.message}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pyre-agent-kit",
3
- "version": "2.0.21",
3
+ "version": "2.0.23",
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",