@rowan-agent/agent 0.27.0 → 0.28.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/index.d.ts +0 -12
- package/dist/index.js +0 -17
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -16,25 +16,13 @@ type InternalModelLoopOptions = {
|
|
|
16
16
|
tools?: readonly string[];
|
|
17
17
|
maxToolRounds?: number;
|
|
18
18
|
};
|
|
19
|
-
/** Snapshot of phase-level context for restore */
|
|
20
|
-
type PhaseContextSnapshot = {
|
|
21
|
-
systemPrompt: string;
|
|
22
|
-
messages: AgentMessage[];
|
|
23
|
-
currentPhase: string;
|
|
24
|
-
availablePhases: string[];
|
|
25
|
-
turnNumber: number;
|
|
26
|
-
payload?: unknown;
|
|
27
|
-
};
|
|
28
19
|
/** Execution capabilities for a phase — operates on PhaseContext. */
|
|
29
20
|
type PhaseExecution = {
|
|
30
|
-
snapshot(): PhaseContextSnapshot;
|
|
31
|
-
restore(snapshot: PhaseContextSnapshot): void;
|
|
32
21
|
invokeModel(context: PhaseContext, options?: {
|
|
33
22
|
output?: "reply" | "internal";
|
|
34
23
|
}): Promise<ModelInvokeOutput>;
|
|
35
24
|
runInternalModelLoop(context: PhaseContext, options: InternalModelLoopOptions): Promise<ModelInvokeOutput>;
|
|
36
25
|
reportStatus(status: PhaseStatus): Promise<void>;
|
|
37
|
-
executeTool(context: AgentContext, toolCall: ToolCall): Promise<ToolResult>;
|
|
38
26
|
executeTools(context: AgentContext, toolCalls: readonly ToolCall[], contentBlocks?: readonly ContentBlock[], meta?: {
|
|
39
27
|
model?: ModelRef;
|
|
40
28
|
usage?: LlmTokenUsage;
|
package/dist/index.js
CHANGED
|
@@ -3779,22 +3779,6 @@ function createPhaseExecution(config, state, phase, messageManager, toolExecutio
|
|
|
3779
3779
|
const execution = {
|
|
3780
3780
|
interaction,
|
|
3781
3781
|
messages: messageManager,
|
|
3782
|
-
snapshot() {
|
|
3783
|
-
return {
|
|
3784
|
-
systemPrompt: config.context.systemPrompt,
|
|
3785
|
-
messages: [...config.context.messages],
|
|
3786
|
-
currentPhase: state.currentPhase ?? "",
|
|
3787
|
-
availablePhases: Array.from(registry.phases.keys()),
|
|
3788
|
-
turnNumber: state.metrics.iterations
|
|
3789
|
-
};
|
|
3790
|
-
},
|
|
3791
|
-
restore(snapshot) {
|
|
3792
|
-
config.context.systemPrompt = snapshot.systemPrompt;
|
|
3793
|
-
config.context.messages.length = 0;
|
|
3794
|
-
config.context.messages.push(...snapshot.messages);
|
|
3795
|
-
state.currentPhase = snapshot.currentPhase;
|
|
3796
|
-
state.metrics.iterations = snapshot.turnNumber;
|
|
3797
|
-
},
|
|
3798
3782
|
async invokeModel(phaseContext, options = {}) {
|
|
3799
3783
|
if (config.beforePrompt) {
|
|
3800
3784
|
phaseContext = await config.beforePrompt(phase.name, phaseContext);
|
|
@@ -3896,7 +3880,6 @@ function createPhaseExecution(config, state, phase, messageManager, toolExecutio
|
|
|
3896
3880
|
async reportStatus(status) {
|
|
3897
3881
|
await config.onPhaseStatus?.(phase.name, status);
|
|
3898
3882
|
},
|
|
3899
|
-
executeTool: executePhaseTool,
|
|
3900
3883
|
async executeTools(phaseContext, toolCalls, contentBlocks, meta) {
|
|
3901
3884
|
return runTurn(async () => {
|
|
3902
3885
|
const tools = phaseContext.tools.filter((tool) => tool.name !== PhaseRouteTool);
|