@synergenius/flow-weaver-pack-weaver 0.9.14 → 0.9.16
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/ai-chat-provider.d.ts +34 -0
- package/dist/ai-chat-provider.d.ts.map +1 -0
- package/dist/ai-chat-provider.js +256 -0
- package/dist/ai-chat-provider.js.map +1 -0
- package/dist/docs/docs/weaver-bot-usage.md +34 -0
- package/dist/docs/docs/weaver-genesis.md +32 -0
- package/dist/docs/docs/weaver-task-queue.md +34 -0
- package/dist/docs/weaver-bot-usage.md +34 -0
- package/dist/docs/weaver-config.md +9 -15
- package/dist/docs/weaver-genesis.md +32 -0
- package/dist/docs/weaver-task-queue.md +34 -0
- package/dist/ui/evolution-panel.js +129 -56
- package/dist/ui/insights-widget.js +69 -37
- package/flowweaver.manifest.json +281 -4
- package/package.json +1 -1
- package/src/ai-chat-provider.ts +300 -0
- package/src/docs/weaver-bot-usage.md +34 -0
- package/src/docs/weaver-genesis.md +32 -0
- package/src/docs/weaver-task-queue.md +34 -0
- package/src/ui/evolution-panel.tsx +155 -70
- package/src/ui/insights-widget.tsx +86 -33
- package/dist/bot/agent-loop.d.ts +0 -20
- package/dist/bot/agent-loop.d.ts.map +0 -1
- package/dist/bot/agent-loop.js +0 -331
- package/dist/bot/agent-loop.js.map +0 -1
- package/dist/cli.d.ts +0 -3
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js +0 -749
- package/dist/cli.js.map +0 -1
- package/dist/templates/weaver-template.d.ts +0 -11
- package/dist/templates/weaver-template.d.ts.map +0 -1
- package/dist/templates/weaver-template.js +0 -53
- package/dist/templates/weaver-template.js.map +0 -1
- package/dist/workflows/weaver-bot-session.d.ts +0 -65
- package/dist/workflows/weaver-bot-session.d.ts.map +0 -1
- package/dist/workflows/weaver-bot-session.js +0 -68
- package/dist/workflows/weaver-bot-session.js.map +0 -1
- package/dist/workflows/weaver.d.ts +0 -24
- package/dist/workflows/weaver.d.ts.map +0 -1
- package/dist/workflows/weaver.js +0 -28
- package/dist/workflows/weaver.js.map +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Weaver Insights
|
|
3
|
-
*
|
|
2
|
+
* Weaver Insights Widget — shows project health, insights, and cost summary.
|
|
3
|
+
* Fetches data from the connected device via platform relay endpoints.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import React, { useEffect, useState } from 'react';
|
|
6
|
+
import React, { useEffect, useState, useCallback } from 'react';
|
|
7
7
|
|
|
8
8
|
interface InsightsData {
|
|
9
9
|
health: { overall: number; workflows: Array<{ file: string; score: number; trend: string }> };
|
|
@@ -13,59 +13,112 @@ interface InsightsData {
|
|
|
13
13
|
trust: { phase: number; score: number };
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
interface Device {
|
|
17
|
+
id: string;
|
|
18
|
+
name: string;
|
|
19
|
+
capabilities: string[];
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function WeaverInsightsWidget() {
|
|
17
23
|
const [data, setData] = useState<InsightsData | null>(null);
|
|
18
24
|
const [error, setError] = useState<string | null>(null);
|
|
25
|
+
const [loading, setLoading] = useState(true);
|
|
26
|
+
const [deviceName, setDeviceName] = useState('');
|
|
27
|
+
|
|
28
|
+
const fetchData = useCallback(async () => {
|
|
29
|
+
try {
|
|
30
|
+
// Find first connected device with insights capability
|
|
31
|
+
const devRes = await fetch('/api/devices', { credentials: 'include' });
|
|
32
|
+
if (!devRes.ok) { setError('Not connected'); setLoading(false); return; }
|
|
33
|
+
const devices: Device[] = await devRes.json();
|
|
34
|
+
const device = devices.find(d => d.capabilities?.includes('insights'));
|
|
35
|
+
if (!device) { setError('No device with insights capability'); setLoading(false); return; }
|
|
36
|
+
setDeviceName(device.name);
|
|
37
|
+
|
|
38
|
+
// Fetch health + insights from device
|
|
39
|
+
const [healthRes, insightsRes] = await Promise.allSettled([
|
|
40
|
+
fetch(`/api/devices/${device.id}/health`, { credentials: 'include' }),
|
|
41
|
+
fetch(`/api/devices/${device.id}/insights`, { credentials: 'include' }),
|
|
42
|
+
]);
|
|
43
|
+
|
|
44
|
+
const health = healthRes.status === 'fulfilled' && healthRes.value.ok
|
|
45
|
+
? await healthRes.value.json() : null;
|
|
46
|
+
const insights = insightsRes.status === 'fulfilled' && insightsRes.value.ok
|
|
47
|
+
? await insightsRes.value.json() : [];
|
|
48
|
+
|
|
49
|
+
setData({
|
|
50
|
+
health: health?.health ?? { overall: 0, workflows: [] },
|
|
51
|
+
bots: health?.bots ?? [],
|
|
52
|
+
insights: Array.isArray(insights) ? insights : [],
|
|
53
|
+
cost: health?.cost ?? { last7Days: 0, trend: 'stable' },
|
|
54
|
+
trust: health?.trust ?? { phase: 1, score: 0 },
|
|
55
|
+
});
|
|
56
|
+
setError(null);
|
|
57
|
+
} catch (e) {
|
|
58
|
+
setError(e instanceof Error ? e.message : 'Failed to load');
|
|
59
|
+
} finally {
|
|
60
|
+
setLoading(false);
|
|
61
|
+
}
|
|
62
|
+
}, []);
|
|
19
63
|
|
|
20
64
|
useEffect(() => {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
};
|
|
65
|
+
fetchData();
|
|
66
|
+
const interval = setInterval(fetchData, 30_000);
|
|
67
|
+
return () => clearInterval(interval);
|
|
68
|
+
}, [fetchData]);
|
|
69
|
+
|
|
70
|
+
if (loading) return <div style={{ padding: 16, opacity: 0.5 }}>Loading insights...</div>;
|
|
71
|
+
if (error) return (
|
|
72
|
+
<div style={{ padding: 16 }}>
|
|
73
|
+
<div style={{ color: '#ef4444', marginBottom: 8 }}>{error}</div>
|
|
74
|
+
<button onClick={fetchData} style={{ fontSize: 12, color: '#6b7280', background: 'none', border: '1px solid #333', borderRadius: 4, padding: '4px 8px', cursor: 'pointer' }}>Retry</button>
|
|
75
|
+
</div>
|
|
76
|
+
);
|
|
77
|
+
if (!data) return null;
|
|
78
|
+
|
|
79
|
+
const severityColor: Record<string, string> = { critical: '#ef4444', warning: '#f59e0b', info: '#6b7280' };
|
|
36
80
|
|
|
37
81
|
return (
|
|
38
|
-
<div style={{ padding: 16, fontFamily: 'system-ui, sans-serif', fontSize: 13 }}>
|
|
39
|
-
<div style={{
|
|
82
|
+
<div style={{ padding: 16, fontFamily: 'system-ui, sans-serif', fontSize: 13, color: 'var(--color-text-high, #e5e5e5)' }}>
|
|
83
|
+
<div style={{ fontSize: 10, textTransform: 'uppercase', letterSpacing: '0.05em', opacity: 0.5, marginBottom: 12 }}>
|
|
84
|
+
{deviceName}
|
|
85
|
+
</div>
|
|
86
|
+
|
|
87
|
+
<div style={{ display: 'flex', alignItems: 'baseline', gap: 12, marginBottom: 16 }}>
|
|
40
88
|
<span style={{ fontSize: 28, fontWeight: 700 }}>{data.health.overall}</span>
|
|
41
89
|
<span style={{ opacity: 0.6 }}>/100 health</span>
|
|
42
90
|
<span style={{ marginLeft: 'auto', opacity: 0.5 }}>
|
|
43
|
-
|
|
91
|
+
P{data.trust.phase} · ${data.cost.last7Days.toFixed(2)}/7d
|
|
44
92
|
</span>
|
|
45
93
|
</div>
|
|
46
94
|
|
|
47
95
|
{data.insights.length > 0 && (
|
|
48
|
-
<div style={{ marginBottom:
|
|
49
|
-
<div style={{ fontWeight: 600, marginBottom: 6 }}>Insights</div>
|
|
50
|
-
{data.insights.slice(0,
|
|
51
|
-
<div key={i} style={{ padding: '
|
|
52
|
-
<span style={{ color: severityColor[insight.severity] ?? '#6b7280', fontWeight: 600, marginRight: 8 }}>
|
|
53
|
-
{insight.severity
|
|
96
|
+
<div style={{ marginBottom: 16 }}>
|
|
97
|
+
<div style={{ fontWeight: 600, marginBottom: 6, fontSize: 11, textTransform: 'uppercase', letterSpacing: '0.04em', opacity: 0.6 }}>Insights</div>
|
|
98
|
+
{data.insights.slice(0, 5).map((insight, i) => (
|
|
99
|
+
<div key={i} style={{ padding: '6px 0', borderBottom: '1px solid rgba(128,128,128,0.15)' }}>
|
|
100
|
+
<span style={{ color: severityColor[insight.severity] ?? '#6b7280', fontWeight: 600, marginRight: 8, fontSize: 10, textTransform: 'uppercase' }}>
|
|
101
|
+
{insight.severity}
|
|
54
102
|
</span>
|
|
55
103
|
<span>{insight.title}</span>
|
|
56
|
-
<span style={{ opacity: 0.5, marginLeft: 8 }}>{Math.round(insight.confidence * 100)}%</span>
|
|
57
104
|
</div>
|
|
58
105
|
))}
|
|
59
106
|
</div>
|
|
60
107
|
)}
|
|
61
108
|
|
|
109
|
+
{data.insights.length === 0 && data.health.overall === 0 && (
|
|
110
|
+
<div style={{ opacity: 0.5, textAlign: 'center', padding: 20 }}>
|
|
111
|
+
No data yet. Connect a device and run some workflows.
|
|
112
|
+
</div>
|
|
113
|
+
)}
|
|
114
|
+
|
|
62
115
|
{data.bots.length > 0 && (
|
|
63
116
|
<div>
|
|
64
|
-
<div style={{ fontWeight: 600, marginBottom: 6 }}>Bots</div>
|
|
117
|
+
<div style={{ fontWeight: 600, marginBottom: 6, fontSize: 11, textTransform: 'uppercase', letterSpacing: '0.04em', opacity: 0.6 }}>Bots</div>
|
|
65
118
|
{data.bots.map((bot, i) => (
|
|
66
|
-
<div key={i} style={{ padding: '
|
|
67
|
-
{bot.name}
|
|
68
|
-
|
|
119
|
+
<div key={i} style={{ padding: '4px 0', display: 'flex', justifyContent: 'space-between' }}>
|
|
120
|
+
<span>{bot.name}</span>
|
|
121
|
+
<span style={{ opacity: 0.6 }}>{Math.round(bot.successRate * 100)}% ({bot.totalTasksRun})</span>
|
|
69
122
|
</div>
|
|
70
123
|
))}
|
|
71
124
|
</div>
|
package/dist/bot/agent-loop.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tool-use agent loop — Claude drives the entire task via tool calls.
|
|
3
|
-
*
|
|
4
|
-
* Instead of plan → execute → retry, the AI calls tools directly:
|
|
5
|
-
* validate → sees errors → read_file → sees code → patch_file → validate → done
|
|
6
|
-
*
|
|
7
|
-
* Supports two providers:
|
|
8
|
-
* - Anthropic API: direct streaming with tool_use blocks
|
|
9
|
-
* - Claude CLI: fallback via callCliAsync (no tool loop, uses --json-schema)
|
|
10
|
-
*/
|
|
11
|
-
import type { ProviderInfo, StepLogEntry } from './types.js';
|
|
12
|
-
export interface AgentLoopResult {
|
|
13
|
-
success: boolean;
|
|
14
|
-
summary: string;
|
|
15
|
-
filesModified: string[];
|
|
16
|
-
stepLog: StepLogEntry[];
|
|
17
|
-
toolCallCount: number;
|
|
18
|
-
}
|
|
19
|
-
export declare function runAgentLoop(pInfo: Pick<ProviderInfo, 'type' | 'apiKey' | 'model' | 'maxTokens'>, systemPrompt: string, taskPrompt: string, projectDir: string, maxIterations?: number): Promise<AgentLoopResult>;
|
|
20
|
-
//# sourceMappingURL=agent-loop.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"agent-loop.d.ts","sourceRoot":"","sources":["../../src/bot/agent-loop.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAqH7D,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;CACvB;AAaD,wBAAsB,YAAY,CAChC,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,WAAW,CAAC,EACpE,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,aAAa,SAAK,GACjB,OAAO,CAAC,eAAe,CAAC,CA8E1B"}
|
package/dist/bot/agent-loop.js
DELETED
|
@@ -1,331 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tool-use agent loop — Claude drives the entire task via tool calls.
|
|
3
|
-
*
|
|
4
|
-
* Instead of plan → execute → retry, the AI calls tools directly:
|
|
5
|
-
* validate → sees errors → read_file → sees code → patch_file → validate → done
|
|
6
|
-
*
|
|
7
|
-
* Supports two providers:
|
|
8
|
-
* - Anthropic API: direct streaming with tool_use blocks
|
|
9
|
-
* - Claude CLI: fallback via callCliAsync (no tool loop, uses --json-schema)
|
|
10
|
-
*/
|
|
11
|
-
import { executeStep } from './step-executor.js';
|
|
12
|
-
// ---------------------------------------------------------------------------
|
|
13
|
-
// Tool definitions
|
|
14
|
-
// ---------------------------------------------------------------------------
|
|
15
|
-
const TOOLS = [
|
|
16
|
-
{
|
|
17
|
-
name: 'validate',
|
|
18
|
-
description: 'Run flow-weaver validate on a workflow file. Returns JSON with errors and warnings. Use this FIRST to discover issues, and AFTER patching to confirm fixes.',
|
|
19
|
-
input_schema: { type: 'object', properties: { file: { type: 'string', description: 'Path to the workflow file to validate' } }, required: ['file'] },
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
name: 'read_file',
|
|
23
|
-
description: 'Read a file and return its full contents. Use this to understand file structure before patching.',
|
|
24
|
-
input_schema: { type: 'object', properties: { file: { type: 'string', description: 'Path to the file to read' } }, required: ['file'] },
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
name: 'patch_file',
|
|
28
|
-
description: 'Apply surgical find-and-replace patches to a file. Each patch must have exact "find" and "replace" strings. Preferred over write_file for modifications.',
|
|
29
|
-
input_schema: {
|
|
30
|
-
type: 'object',
|
|
31
|
-
properties: {
|
|
32
|
-
file: { type: 'string', description: 'Path to the file to patch' },
|
|
33
|
-
patches: {
|
|
34
|
-
type: 'array',
|
|
35
|
-
items: {
|
|
36
|
-
type: 'object',
|
|
37
|
-
properties: {
|
|
38
|
-
find: { type: 'string', description: 'Exact string to find' },
|
|
39
|
-
replace: { type: 'string', description: 'String to replace with' },
|
|
40
|
-
},
|
|
41
|
-
required: ['find', 'replace'],
|
|
42
|
-
},
|
|
43
|
-
description: 'Array of find/replace patches',
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
required: ['file', 'patches'],
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
name: 'run_shell',
|
|
51
|
-
description: 'Execute a shell command and return output. Use for: npx flow-weaver validate, git status, etc. Blocked: rm -rf, git push, sudo.',
|
|
52
|
-
input_schema: { type: 'object', properties: { command: { type: 'string', description: 'Shell command to execute' } }, required: ['command'] },
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
name: 'list_files',
|
|
56
|
-
description: 'List files in a directory, optionally filtered by regex pattern.',
|
|
57
|
-
input_schema: {
|
|
58
|
-
type: 'object',
|
|
59
|
-
properties: {
|
|
60
|
-
directory: { type: 'string', description: 'Directory to list' },
|
|
61
|
-
pattern: { type: 'string', description: 'Optional regex filter pattern' },
|
|
62
|
-
},
|
|
63
|
-
required: ['directory'],
|
|
64
|
-
},
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
name: 'write_file',
|
|
68
|
-
description: 'Write content to a file (creates or overwrites). Use patch_file instead for modifications to existing files.',
|
|
69
|
-
input_schema: {
|
|
70
|
-
type: 'object',
|
|
71
|
-
properties: {
|
|
72
|
-
file: { type: 'string', description: 'Path to the file to write' },
|
|
73
|
-
content: { type: 'string', description: 'Complete file content' },
|
|
74
|
-
},
|
|
75
|
-
required: ['file', 'content'],
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
];
|
|
79
|
-
// ---------------------------------------------------------------------------
|
|
80
|
-
// Tool execution — delegates to step-executor with all safety guards
|
|
81
|
-
// ---------------------------------------------------------------------------
|
|
82
|
-
async function executeTool(name, args, projectDir) {
|
|
83
|
-
// Map tool names to step-executor operations
|
|
84
|
-
const operationMap = {
|
|
85
|
-
validate: 'run-shell',
|
|
86
|
-
read_file: 'read-file',
|
|
87
|
-
patch_file: 'patch-file',
|
|
88
|
-
run_shell: 'run-shell',
|
|
89
|
-
list_files: 'list-files',
|
|
90
|
-
write_file: 'write-file',
|
|
91
|
-
};
|
|
92
|
-
const operation = operationMap[name];
|
|
93
|
-
if (!operation) {
|
|
94
|
-
return { result: `Unknown tool: ${name}`, isError: true };
|
|
95
|
-
}
|
|
96
|
-
// Transform validate tool to run-shell with flow-weaver validate command
|
|
97
|
-
let stepArgs = { ...args };
|
|
98
|
-
if (name === 'validate') {
|
|
99
|
-
stepArgs = { command: `npx flow-weaver validate ${args.file} --json` };
|
|
100
|
-
}
|
|
101
|
-
try {
|
|
102
|
-
const result = await executeStep({ operation, args: stepArgs }, projectDir);
|
|
103
|
-
if (result.blocked) {
|
|
104
|
-
return { result: result.blockReason ?? 'Blocked by safety guard', isError: true };
|
|
105
|
-
}
|
|
106
|
-
return { result: result.output ?? 'Done', isError: false };
|
|
107
|
-
}
|
|
108
|
-
catch (err) {
|
|
109
|
-
const msg = err instanceof Error ? err.message : String(err);
|
|
110
|
-
return { result: msg, isError: true };
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
export async function runAgentLoop(pInfo, systemPrompt, taskPrompt, projectDir, maxIterations = 15) {
|
|
114
|
-
if (pInfo.type !== 'anthropic' || !pInfo.apiKey) {
|
|
115
|
-
throw new Error('Agent loop requires Anthropic API provider with API key');
|
|
116
|
-
}
|
|
117
|
-
const messages = [{ role: 'user', content: taskPrompt }];
|
|
118
|
-
const filesModified = [];
|
|
119
|
-
const stepLog = [];
|
|
120
|
-
let toolCallCount = 0;
|
|
121
|
-
for (let iteration = 0; iteration < maxIterations; iteration++) {
|
|
122
|
-
// Call Anthropic API with streaming
|
|
123
|
-
const { text, toolCalls, finishReason } = await streamAnthropicWithTools(pInfo.apiKey, pInfo.model ?? 'claude-sonnet-4-20250514', systemPrompt, messages, pInfo.maxTokens ?? 8192);
|
|
124
|
-
// Add assistant response to history
|
|
125
|
-
if (toolCalls.length > 0) {
|
|
126
|
-
messages.push({ role: 'assistant', content: text || '', toolCalls });
|
|
127
|
-
}
|
|
128
|
-
else if (text) {
|
|
129
|
-
messages.push({ role: 'assistant', content: text });
|
|
130
|
-
}
|
|
131
|
-
// If no tool calls, we're done
|
|
132
|
-
if (finishReason !== 'tool_calls' || toolCalls.length === 0) {
|
|
133
|
-
return {
|
|
134
|
-
success: true,
|
|
135
|
-
summary: text || 'Task completed',
|
|
136
|
-
filesModified: [...new Set(filesModified)],
|
|
137
|
-
stepLog,
|
|
138
|
-
toolCallCount,
|
|
139
|
-
};
|
|
140
|
-
}
|
|
141
|
-
// Execute tool calls and add results to history
|
|
142
|
-
for (const tc of toolCalls) {
|
|
143
|
-
toolCallCount++;
|
|
144
|
-
process.stderr.write(`\x1b[33m ⚡ ${tc.name}(${formatToolArgs(tc.arguments)})\x1b[0m\n`);
|
|
145
|
-
const { result, isError } = await executeTool(tc.name, tc.arguments, projectDir);
|
|
146
|
-
// Track files modified by patch_file and write_file
|
|
147
|
-
if ((tc.name === 'patch_file' || tc.name === 'write_file') && !isError && tc.arguments.file) {
|
|
148
|
-
filesModified.push(tc.arguments.file);
|
|
149
|
-
}
|
|
150
|
-
// Log step
|
|
151
|
-
stepLog.push({
|
|
152
|
-
step: `${tc.name}`,
|
|
153
|
-
status: isError ? 'error' : 'ok',
|
|
154
|
-
detail: isError ? result.slice(0, 200) : `${tc.name}(${formatToolArgs(tc.arguments)})`,
|
|
155
|
-
});
|
|
156
|
-
// Print result preview
|
|
157
|
-
const preview = result.slice(0, 150).replace(/\n/g, ' ');
|
|
158
|
-
const icon = isError ? '\x1b[31m ✗' : '\x1b[32m →';
|
|
159
|
-
process.stderr.write(`${icon} ${preview}\x1b[0m\n`);
|
|
160
|
-
// Add tool result to conversation
|
|
161
|
-
messages.push({
|
|
162
|
-
role: 'tool',
|
|
163
|
-
content: result.slice(0, 10000), // Cap tool result to prevent context overflow
|
|
164
|
-
toolCallId: tc.id,
|
|
165
|
-
});
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
return {
|
|
169
|
-
success: false,
|
|
170
|
-
summary: `Reached max iterations (${maxIterations})`,
|
|
171
|
-
filesModified: [...new Set(filesModified)],
|
|
172
|
-
stepLog,
|
|
173
|
-
toolCallCount,
|
|
174
|
-
};
|
|
175
|
-
}
|
|
176
|
-
function formatToolArgs(args) {
|
|
177
|
-
if (args.file)
|
|
178
|
-
return String(args.file).split('/').pop() ?? '';
|
|
179
|
-
if (args.command)
|
|
180
|
-
return String(args.command).slice(0, 60);
|
|
181
|
-
if (args.directory)
|
|
182
|
-
return String(args.directory);
|
|
183
|
-
return '';
|
|
184
|
-
}
|
|
185
|
-
// ---------------------------------------------------------------------------
|
|
186
|
-
// Anthropic streaming with tool support
|
|
187
|
-
// ---------------------------------------------------------------------------
|
|
188
|
-
async function streamAnthropicWithTools(apiKey, model, systemPrompt, messages, maxTokens) {
|
|
189
|
-
// Build Anthropic API request body
|
|
190
|
-
const apiMessages = messages.map((m) => {
|
|
191
|
-
if (m.role === 'tool') {
|
|
192
|
-
return {
|
|
193
|
-
role: 'user',
|
|
194
|
-
content: [{ type: 'tool_result', tool_use_id: m.toolCallId, content: m.content }],
|
|
195
|
-
};
|
|
196
|
-
}
|
|
197
|
-
if (m.role === 'assistant' && m.toolCalls?.length) {
|
|
198
|
-
const blocks = [];
|
|
199
|
-
if (m.content)
|
|
200
|
-
blocks.push({ type: 'text', text: m.content });
|
|
201
|
-
for (const tc of m.toolCalls) {
|
|
202
|
-
blocks.push({ type: 'tool_use', id: tc.id, name: tc.name, input: tc.arguments });
|
|
203
|
-
}
|
|
204
|
-
return { role: 'assistant', content: blocks };
|
|
205
|
-
}
|
|
206
|
-
return { role: m.role, content: m.content };
|
|
207
|
-
});
|
|
208
|
-
const body = JSON.stringify({
|
|
209
|
-
model,
|
|
210
|
-
max_tokens: maxTokens,
|
|
211
|
-
system: systemPrompt,
|
|
212
|
-
stream: true,
|
|
213
|
-
messages: apiMessages,
|
|
214
|
-
tools: TOOLS,
|
|
215
|
-
});
|
|
216
|
-
const response = await fetch('https://api.anthropic.com/v1/messages', {
|
|
217
|
-
method: 'POST',
|
|
218
|
-
headers: {
|
|
219
|
-
'x-api-key': apiKey,
|
|
220
|
-
'anthropic-version': '2025-04-15',
|
|
221
|
-
'content-type': 'application/json',
|
|
222
|
-
},
|
|
223
|
-
body,
|
|
224
|
-
signal: AbortSignal.timeout(300_000),
|
|
225
|
-
});
|
|
226
|
-
if (!response.ok) {
|
|
227
|
-
const err = await response.text();
|
|
228
|
-
throw new Error(`Anthropic API error ${response.status}: ${err.slice(0, 200)}`);
|
|
229
|
-
}
|
|
230
|
-
if (!response.body)
|
|
231
|
-
throw new Error('No response body');
|
|
232
|
-
// Parse SSE stream
|
|
233
|
-
const reader = response.body.getReader();
|
|
234
|
-
const decoder = new TextDecoder();
|
|
235
|
-
let buffer = '';
|
|
236
|
-
let textContent = '';
|
|
237
|
-
let finishReason = 'stop';
|
|
238
|
-
const toolCalls = [];
|
|
239
|
-
const activeToolUses = new Map();
|
|
240
|
-
let inThinking = false;
|
|
241
|
-
try {
|
|
242
|
-
while (true) {
|
|
243
|
-
const { done, value } = await reader.read();
|
|
244
|
-
if (done)
|
|
245
|
-
break;
|
|
246
|
-
buffer += decoder.decode(value, { stream: true });
|
|
247
|
-
const lines = buffer.split('\n');
|
|
248
|
-
buffer = lines.pop() || '';
|
|
249
|
-
for (const line of lines) {
|
|
250
|
-
if (!line.startsWith('data: '))
|
|
251
|
-
continue;
|
|
252
|
-
const jsonStr = line.slice(6).trim();
|
|
253
|
-
if (jsonStr === '[DONE]')
|
|
254
|
-
continue;
|
|
255
|
-
let event;
|
|
256
|
-
try {
|
|
257
|
-
event = JSON.parse(jsonStr);
|
|
258
|
-
}
|
|
259
|
-
catch {
|
|
260
|
-
continue;
|
|
261
|
-
}
|
|
262
|
-
const eventType = event.type;
|
|
263
|
-
if (eventType === 'content_block_start') {
|
|
264
|
-
const block = event.content_block;
|
|
265
|
-
const index = event.index;
|
|
266
|
-
if (block.type === 'tool_use' && block.id && block.name) {
|
|
267
|
-
activeToolUses.set(index, { id: block.id, name: block.name, jsonChunks: [] });
|
|
268
|
-
}
|
|
269
|
-
if (block.type === 'thinking') {
|
|
270
|
-
inThinking = true;
|
|
271
|
-
process.stderr.write('\x1b[90m thinking...');
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
if (eventType === 'content_block_delta') {
|
|
275
|
-
const delta = event.delta;
|
|
276
|
-
const index = event.index;
|
|
277
|
-
if (delta.type === 'text_delta' && delta.text) {
|
|
278
|
-
textContent += delta.text;
|
|
279
|
-
process.stderr.write(`\x1b[36m${delta.text}\x1b[0m`);
|
|
280
|
-
}
|
|
281
|
-
if (delta.type === 'thinking_delta' && delta.thinking) {
|
|
282
|
-
// Thinking — just show indicator, don't spam
|
|
283
|
-
}
|
|
284
|
-
if (delta.type === 'input_json_delta' && delta.partial_json !== undefined) {
|
|
285
|
-
const active = activeToolUses.get(index);
|
|
286
|
-
if (active)
|
|
287
|
-
active.jsonChunks.push(delta.partial_json);
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
if (eventType === 'content_block_stop') {
|
|
291
|
-
const index = event.index;
|
|
292
|
-
if (inThinking) {
|
|
293
|
-
process.stderr.write('\x1b[0m\n');
|
|
294
|
-
inThinking = false;
|
|
295
|
-
}
|
|
296
|
-
const active = activeToolUses.get(index);
|
|
297
|
-
if (active) {
|
|
298
|
-
activeToolUses.delete(index);
|
|
299
|
-
let args = {};
|
|
300
|
-
try {
|
|
301
|
-
args = JSON.parse(active.jsonChunks.join(''));
|
|
302
|
-
}
|
|
303
|
-
catch { /* malformed */ }
|
|
304
|
-
toolCalls.push({ id: active.id, name: active.name, arguments: args });
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
if (eventType === 'message_delta') {
|
|
308
|
-
const delta = event.delta;
|
|
309
|
-
if (delta.stop_reason === 'tool_use')
|
|
310
|
-
finishReason = 'tool_calls';
|
|
311
|
-
else if (delta.stop_reason === 'end_turn')
|
|
312
|
-
finishReason = 'stop';
|
|
313
|
-
else if (delta.stop_reason)
|
|
314
|
-
finishReason = delta.stop_reason;
|
|
315
|
-
}
|
|
316
|
-
if (eventType === 'error') {
|
|
317
|
-
const errObj = event.error;
|
|
318
|
-
throw new Error(`Anthropic stream error: ${errObj?.message ?? 'unknown'}`);
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
finally {
|
|
324
|
-
reader.releaseLock();
|
|
325
|
-
}
|
|
326
|
-
// Newline after streamed text
|
|
327
|
-
if (textContent)
|
|
328
|
-
process.stderr.write('\n');
|
|
329
|
-
return { text: textContent, toolCalls, finishReason };
|
|
330
|
-
}
|
|
331
|
-
//# sourceMappingURL=agent-loop.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"agent-loop.js","sourceRoot":"","sources":["../../src/bot/agent-loop.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGjD,8EAA8E;AAC9E,mBAAmB;AACnB,8EAA8E;AAE9E,MAAM,KAAK,GAAG;IACZ;QACE,IAAI,EAAE,UAAU;QAChB,WAAW,EAAE,6JAA6J;QAC1K,YAAY,EAAE,EAAE,IAAI,EAAE,QAAiB,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,uCAAuC,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,MAAM,CAAC,EAAE;KAC9J;IACD;QACE,IAAI,EAAE,WAAW;QACjB,WAAW,EAAE,kGAAkG;QAC/G,YAAY,EAAE,EAAE,IAAI,EAAE,QAAiB,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EA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