pyre-agent-kit 4.3.4 → 4.3.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.
- package/dist/agent.d.ts +1 -0
- package/dist/agent.js +12 -2
- package/package.json +1 -1
package/dist/agent.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { PyreKit } from 'pyre-world-kit';
|
|
|
2
2
|
import { AgentState, FactionInfo, LLMAdapter, LLMDecision } from './types';
|
|
3
3
|
export interface LLMDecideOptions {
|
|
4
4
|
compact?: boolean;
|
|
5
|
+
onPromptTable?: (header: string, rows: string[]) => void;
|
|
5
6
|
}
|
|
6
7
|
export declare const pendingScoutResults: Map<string, string[]>;
|
|
7
8
|
export interface FactionContext {
|
package/dist/agent.js
CHANGED
|
@@ -143,7 +143,7 @@ REPLACE * with a ONE sentence RESPONSE, always in double quotes.
|
|
|
143
143
|
(<) $ - repay loan.
|
|
144
144
|
(.) $ - show support.
|
|
145
145
|
(%) "{" - create new faction. { = creative name.
|
|
146
|
-
(_) -
|
|
146
|
+
(_) - skip turn.
|
|
147
147
|
--- RULES:
|
|
148
148
|
(%) or (_) no FACTIONS required.
|
|
149
149
|
(+) or (|) FACTIONS where MBR=false.
|
|
@@ -176,7 +176,7 @@ REPLACE * with a ONE sentence RESPONSE, always in double quotes.
|
|
|
176
176
|
- when HLTH is negative, prefer (-) weakest FACTIONS where MBR=true or (_). consider (+) or (&) ONLY if you see potential opportunity.
|
|
177
177
|
- (_) if holding is the optimal move.
|
|
178
178
|
---
|
|
179
|
-
one move per turn. output EXACTLY one line
|
|
179
|
+
one move per turn. output EXACTLY one line.
|
|
180
180
|
example format: ${(0, util_1.pick)([
|
|
181
181
|
`(+) ${f1} "${(0, util_1.pick)(['rising fast and I want early exposure.', 'count me in.', 'early is everything.', 'strongest faction here.', 'lets go!'])}"`,
|
|
182
182
|
`(-) ${m} "${(0, util_1.pick)(['taking profits.', 'time to move on.', 'sentiment is bearish, ready to cut losses.', 'cutting the drag.'])}"`,
|
|
@@ -719,6 +719,16 @@ async function llmDecide(kit, agent, factions, recentMessages, llm, log, solRang
|
|
|
719
719
|
}
|
|
720
720
|
const buildPrompt = compact ? exports.buildCompactModelPrompt : exports.buildAgentPrompt;
|
|
721
721
|
const prompt = buildPrompt(kit, agent, factionCtx, intelSnippet + scoutSnippet, recentMessages, solRange, holdings);
|
|
722
|
+
// Surface the faction table to the caller if requested
|
|
723
|
+
if (options?.onPromptTable) {
|
|
724
|
+
const tableStart = prompt.indexOf('--- FACTIONS:');
|
|
725
|
+
const tableEnd = prompt.indexOf('--- ACTIONS:');
|
|
726
|
+
if (tableStart !== -1 && tableEnd !== -1) {
|
|
727
|
+
const tableBlock = prompt.slice(tableStart + '--- FACTIONS:\n'.length, tableEnd).trim();
|
|
728
|
+
const lines = tableBlock.split('\n');
|
|
729
|
+
options.onPromptTable(lines[0], lines.slice(1));
|
|
730
|
+
}
|
|
731
|
+
}
|
|
722
732
|
const raw = await llm.generate(prompt);
|
|
723
733
|
if (!raw) {
|
|
724
734
|
log(`[${agent.publicKey.slice(0, 8)}] LLM returned null`);
|