pyre-agent-kit 10.1.3 → 10.2.0
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/executor.js +6 -46
- package/dist/index.js +0 -1
- package/package.json +2 -2
package/dist/executor.js
CHANGED
|
@@ -28,28 +28,9 @@ const handlers = {
|
|
|
28
28
|
stronghold: vc,
|
|
29
29
|
ascended: faction.status === 'ascended',
|
|
30
30
|
};
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
let { result, confirm } = await kit.exec('actions', 'join', params);
|
|
35
|
-
try {
|
|
36
|
-
await (0, tx_1.sendAndConfirm)(kit.connection, agent.keypair, result);
|
|
37
|
-
await confirm();
|
|
38
|
-
}
|
|
39
|
-
catch (err) {
|
|
40
|
-
const parsed = (0, error_1.parseCustomError)(err);
|
|
41
|
-
if (parsed?.code === 6022) {
|
|
42
|
-
// VoteRequired — retry with strategy
|
|
43
|
-
params.strategy = Math.random() > 0.5 ? 'fortify' : 'smelt';
|
|
44
|
-
const retry = await kit.exec('actions', 'join', params);
|
|
45
|
-
await (0, tx_1.sendAndConfirm)(kit.connection, agent.keypair, retry.result);
|
|
46
|
-
await retry.confirm();
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
throw err;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
kit.state.markVoted(faction.mint);
|
|
31
|
+
const { result, confirm } = await kit.exec('actions', 'join', params);
|
|
32
|
+
await (0, tx_1.sendAndConfirm)(kit.connection, agent.keypair, result);
|
|
33
|
+
await confirm();
|
|
53
34
|
agent.lastAction = `joined ${faction.mint.slice(-8)}`;
|
|
54
35
|
return `joined ${faction.mint.slice(-8)} for ${sol.toFixed(4)} SOL${decision.message ? ` — "${decision.message}"` : ''}`;
|
|
55
36
|
},
|
|
@@ -197,27 +178,9 @@ const handlers = {
|
|
|
197
178
|
stronghold: vc,
|
|
198
179
|
ascended: faction.status === 'ascended',
|
|
199
180
|
};
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
let { result, confirm } = await kit.exec('actions', 'message', params);
|
|
204
|
-
try {
|
|
205
|
-
await (0, tx_1.sendAndConfirm)(kit.connection, agent.keypair, result);
|
|
206
|
-
await confirm();
|
|
207
|
-
}
|
|
208
|
-
catch (err) {
|
|
209
|
-
const p = (0, error_1.parseCustomError)(err);
|
|
210
|
-
if (p?.code === 6022) {
|
|
211
|
-
params.strategy = Math.random() > 0.5 ? 'fortify' : 'smelt';
|
|
212
|
-
const retry = await kit.exec('actions', 'message', params);
|
|
213
|
-
await (0, tx_1.sendAndConfirm)(kit.connection, agent.keypair, retry.result);
|
|
214
|
-
await retry.confirm();
|
|
215
|
-
}
|
|
216
|
-
else {
|
|
217
|
-
throw err;
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
kit.state.markVoted(faction.mint);
|
|
181
|
+
const { result, confirm } = await kit.exec('actions', 'message', params);
|
|
182
|
+
await (0, tx_1.sendAndConfirm)(kit.connection, agent.keypair, result);
|
|
183
|
+
await confirm();
|
|
221
184
|
agent.lastAction = `messaged ${faction.mint.slice(-8)}`;
|
|
222
185
|
return `said in ${faction.mint.slice(-8)}: "${decision.message}"`;
|
|
223
186
|
},
|
|
@@ -279,13 +242,10 @@ const handlers = {
|
|
|
279
242
|
stronghold: vc,
|
|
280
243
|
ascended: faction.status === 'ascended',
|
|
281
244
|
};
|
|
282
|
-
if (!kit.state.hasVoted(faction.mint))
|
|
283
|
-
params.strategy = 'smelt';
|
|
284
245
|
const { result, confirm } = await kit.exec('actions', 'join', params);
|
|
285
246
|
await (0, tx_1.sendAndConfirm)(kit.connection, agent.keypair, result);
|
|
286
247
|
await confirm();
|
|
287
248
|
agent.infiltrated.add(faction.mint);
|
|
288
|
-
kit.state.markVoted(faction.mint);
|
|
289
249
|
agent.lastAction = `infiltrated ${faction.mint.slice(-8)}`;
|
|
290
250
|
return `infiltrated ${faction.mint.slice(-8)} for ${sol.toFixed(4)} SOL${decision.message ? ` — "${decision.message}"` : ''}`;
|
|
291
251
|
},
|
package/dist/index.js
CHANGED
|
@@ -143,7 +143,6 @@ async function createPyreAgent(config) {
|
|
|
143
143
|
hasStronghold,
|
|
144
144
|
activeLoans: gameState.activeLoans,
|
|
145
145
|
sentiment: gameState.sentiment,
|
|
146
|
-
voted: gameState.voted,
|
|
147
146
|
rallied: gameState.rallied,
|
|
148
147
|
};
|
|
149
148
|
const action = (0, action_1.chooseAction)(state.personality, compatState, canRally, activeFactions, dynamicWeights);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pyre-agent-kit",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.2.0",
|
|
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",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@solana/spl-token": "^0.4.6",
|
|
18
18
|
"@solana/web3.js": "^1.98.4",
|
|
19
|
-
"pyre-world-kit": "10.
|
|
19
|
+
"pyre-world-kit": "10.2.0"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"prettier": "^3.5.3",
|