tuplet 2.7.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/LICENSE +21 -0
- package/README.md +136 -0
- package/dist/agent.d.ts +46 -0
- package/dist/agent.d.ts.map +1 -0
- package/dist/agent.js +393 -0
- package/dist/agent.js.map +1 -0
- package/dist/built-in-agents/explore.d.ts +9 -0
- package/dist/built-in-agents/explore.d.ts.map +1 -0
- package/dist/built-in-agents/explore.js +40 -0
- package/dist/built-in-agents/explore.js.map +1 -0
- package/dist/built-in-agents/index.d.ts +15 -0
- package/dist/built-in-agents/index.d.ts.map +1 -0
- package/dist/built-in-agents/index.js +19 -0
- package/dist/built-in-agents/index.js.map +1 -0
- package/dist/built-in-agents/plan.d.ts +10 -0
- package/dist/built-in-agents/plan.d.ts.map +1 -0
- package/dist/built-in-agents/plan.js +62 -0
- package/dist/built-in-agents/plan.js.map +1 -0
- package/dist/built-in-agents/worker.d.ts +9 -0
- package/dist/built-in-agents/worker.d.ts.map +1 -0
- package/dist/built-in-agents/worker.js +53 -0
- package/dist/built-in-agents/worker.js.map +1 -0
- package/dist/constants.d.ts +7 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +18 -0
- package/dist/constants.js.map +1 -0
- package/dist/context-manager.d.ts +65 -0
- package/dist/context-manager.d.ts.map +1 -0
- package/dist/context-manager.js +272 -0
- package/dist/context-manager.js.map +1 -0
- package/dist/context-manager.test.d.ts +2 -0
- package/dist/context-manager.test.d.ts.map +1 -0
- package/dist/context-manager.test.js +394 -0
- package/dist/context-manager.test.js.map +1 -0
- package/dist/executor.d.ts +29 -0
- package/dist/executor.d.ts.map +1 -0
- package/dist/executor.js +399 -0
- package/dist/executor.js.map +1 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +40 -0
- package/dist/index.js.map +1 -0
- package/dist/prompt/index.d.ts +9 -0
- package/dist/prompt/index.d.ts.map +1 -0
- package/dist/prompt/index.js +10 -0
- package/dist/prompt/index.js.map +1 -0
- package/dist/prompt/main-agent-builder.d.ts +81 -0
- package/dist/prompt/main-agent-builder.d.ts.map +1 -0
- package/dist/prompt/main-agent-builder.js +287 -0
- package/dist/prompt/main-agent-builder.js.map +1 -0
- package/dist/prompt/sub-agent-builder.d.ts +133 -0
- package/dist/prompt/sub-agent-builder.d.ts.map +1 -0
- package/dist/prompt/sub-agent-builder.js +337 -0
- package/dist/prompt/sub-agent-builder.js.map +1 -0
- package/dist/prompt/templates.d.ts +87 -0
- package/dist/prompt/templates.d.ts.map +1 -0
- package/dist/prompt/templates.js +343 -0
- package/dist/prompt/templates.js.map +1 -0
- package/dist/prompt/types.d.ts +159 -0
- package/dist/prompt/types.d.ts.map +1 -0
- package/dist/prompt/types.js +5 -0
- package/dist/prompt/types.js.map +1 -0
- package/dist/prompt.d.ts +32 -0
- package/dist/prompt.d.ts.map +1 -0
- package/dist/prompt.js +86 -0
- package/dist/prompt.js.map +1 -0
- package/dist/providers/dataset/base.d.ts +74 -0
- package/dist/providers/dataset/base.d.ts.map +1 -0
- package/dist/providers/dataset/base.js +7 -0
- package/dist/providers/dataset/base.js.map +1 -0
- package/dist/providers/dataset/index.d.ts +8 -0
- package/dist/providers/dataset/index.d.ts.map +1 -0
- package/dist/providers/dataset/index.js +8 -0
- package/dist/providers/dataset/index.js.map +1 -0
- package/dist/providers/dataset/recorder.d.ts +46 -0
- package/dist/providers/dataset/recorder.d.ts.map +1 -0
- package/dist/providers/dataset/recorder.js +105 -0
- package/dist/providers/dataset/recorder.js.map +1 -0
- package/dist/providers/dataset/replayer.d.ts +46 -0
- package/dist/providers/dataset/replayer.d.ts.map +1 -0
- package/dist/providers/dataset/replayer.js +163 -0
- package/dist/providers/dataset/replayer.js.map +1 -0
- package/dist/providers/dataset/tester.d.ts +89 -0
- package/dist/providers/dataset/tester.d.ts.map +1 -0
- package/dist/providers/dataset/tester.js +143 -0
- package/dist/providers/dataset/tester.js.map +1 -0
- package/dist/providers/env/memory.d.ts +14 -0
- package/dist/providers/env/memory.d.ts.map +1 -0
- package/dist/providers/env/memory.js +19 -0
- package/dist/providers/env/memory.js.map +1 -0
- package/dist/providers/index.d.ts +12 -0
- package/dist/providers/index.d.ts.map +1 -0
- package/dist/providers/index.js +10 -0
- package/dist/providers/index.js.map +1 -0
- package/dist/providers/llm/base.d.ts +7 -0
- package/dist/providers/llm/base.d.ts.map +1 -0
- package/dist/providers/llm/base.js +7 -0
- package/dist/providers/llm/base.js.map +1 -0
- package/dist/providers/llm/claude.d.ts +32 -0
- package/dist/providers/llm/claude.d.ts.map +1 -0
- package/dist/providers/llm/claude.js +171 -0
- package/dist/providers/llm/claude.js.map +1 -0
- package/dist/providers/llm/openai.d.ts +26 -0
- package/dist/providers/llm/openai.d.ts.map +1 -0
- package/dist/providers/llm/openai.js +174 -0
- package/dist/providers/llm/openai.js.map +1 -0
- package/dist/providers/llm/openrouter.d.ts +43 -0
- package/dist/providers/llm/openrouter.d.ts.map +1 -0
- package/dist/providers/llm/openrouter.js +288 -0
- package/dist/providers/llm/openrouter.js.map +1 -0
- package/dist/providers/logger/base.d.ts +7 -0
- package/dist/providers/logger/base.d.ts.map +1 -0
- package/dist/providers/logger/base.js +7 -0
- package/dist/providers/logger/base.js.map +1 -0
- package/dist/providers/logger/console.d.ts +29 -0
- package/dist/providers/logger/console.d.ts.map +1 -0
- package/dist/providers/logger/console.js +70 -0
- package/dist/providers/logger/console.js.map +1 -0
- package/dist/providers/repository/base.d.ts +7 -0
- package/dist/providers/repository/base.d.ts.map +1 -0
- package/dist/providers/repository/base.js +7 -0
- package/dist/providers/repository/base.js.map +1 -0
- package/dist/providers/repository/memory.d.ts +21 -0
- package/dist/providers/repository/memory.d.ts.map +1 -0
- package/dist/providers/repository/memory.js +50 -0
- package/dist/providers/repository/memory.js.map +1 -0
- package/dist/providers/workspace/file.d.ts +26 -0
- package/dist/providers/workspace/file.d.ts.map +1 -0
- package/dist/providers/workspace/file.js +151 -0
- package/dist/providers/workspace/file.js.map +1 -0
- package/dist/providers/workspace/index.d.ts +7 -0
- package/dist/providers/workspace/index.d.ts.map +1 -0
- package/dist/providers/workspace/index.js +6 -0
- package/dist/providers/workspace/index.js.map +1 -0
- package/dist/providers/workspace/memory.d.ts +26 -0
- package/dist/providers/workspace/memory.d.ts.map +1 -0
- package/dist/providers/workspace/memory.js +136 -0
- package/dist/providers/workspace/memory.js.map +1 -0
- package/dist/providers/workspace/types.d.ts +27 -0
- package/dist/providers/workspace/types.d.ts.map +1 -0
- package/dist/providers/workspace/types.js +8 -0
- package/dist/providers/workspace/types.js.map +1 -0
- package/dist/providers/workspace/workspace-provider.test.d.ts +2 -0
- package/dist/providers/workspace/workspace-provider.test.d.ts.map +1 -0
- package/dist/providers/workspace/workspace-provider.test.js +250 -0
- package/dist/providers/workspace/workspace-provider.test.js.map +1 -0
- package/dist/shell/commands/browse.d.ts +6 -0
- package/dist/shell/commands/browse.d.ts.map +1 -0
- package/dist/shell/commands/browse.js +158 -0
- package/dist/shell/commands/browse.js.map +1 -0
- package/dist/shell/commands/cat.d.ts +6 -0
- package/dist/shell/commands/cat.d.ts.map +1 -0
- package/dist/shell/commands/cat.js +104 -0
- package/dist/shell/commands/cat.js.map +1 -0
- package/dist/shell/commands/curl.d.ts +6 -0
- package/dist/shell/commands/curl.d.ts.map +1 -0
- package/dist/shell/commands/curl.js +190 -0
- package/dist/shell/commands/curl.js.map +1 -0
- package/dist/shell/commands/date.d.ts +6 -0
- package/dist/shell/commands/date.d.ts.map +1 -0
- package/dist/shell/commands/date.js +151 -0
- package/dist/shell/commands/date.js.map +1 -0
- package/dist/shell/commands/echo.d.ts +6 -0
- package/dist/shell/commands/echo.d.ts.map +1 -0
- package/dist/shell/commands/echo.js +48 -0
- package/dist/shell/commands/echo.js.map +1 -0
- package/dist/shell/commands/env.d.ts +8 -0
- package/dist/shell/commands/env.d.ts.map +1 -0
- package/dist/shell/commands/env.js +41 -0
- package/dist/shell/commands/env.js.map +1 -0
- package/dist/shell/commands/file.d.ts +6 -0
- package/dist/shell/commands/file.d.ts.map +1 -0
- package/dist/shell/commands/file.js +213 -0
- package/dist/shell/commands/file.js.map +1 -0
- package/dist/shell/commands/find.d.ts +6 -0
- package/dist/shell/commands/find.d.ts.map +1 -0
- package/dist/shell/commands/find.js +100 -0
- package/dist/shell/commands/find.js.map +1 -0
- package/dist/shell/commands/grep.d.ts +6 -0
- package/dist/shell/commands/grep.d.ts.map +1 -0
- package/dist/shell/commands/grep.js +229 -0
- package/dist/shell/commands/grep.js.map +1 -0
- package/dist/shell/commands/head.d.ts +6 -0
- package/dist/shell/commands/head.d.ts.map +1 -0
- package/dist/shell/commands/head.js +88 -0
- package/dist/shell/commands/head.js.map +1 -0
- package/dist/shell/commands/index.d.ts +25 -0
- package/dist/shell/commands/index.d.ts.map +1 -0
- package/dist/shell/commands/index.js +43 -0
- package/dist/shell/commands/index.js.map +1 -0
- package/dist/shell/commands/jq.d.ts +8 -0
- package/dist/shell/commands/jq.d.ts.map +1 -0
- package/dist/shell/commands/jq.js +233 -0
- package/dist/shell/commands/jq.js.map +1 -0
- package/dist/shell/commands/ls.d.ts +6 -0
- package/dist/shell/commands/ls.d.ts.map +1 -0
- package/dist/shell/commands/ls.js +88 -0
- package/dist/shell/commands/ls.js.map +1 -0
- package/dist/shell/commands/mkdir.d.ts +6 -0
- package/dist/shell/commands/mkdir.d.ts.map +1 -0
- package/dist/shell/commands/mkdir.js +43 -0
- package/dist/shell/commands/mkdir.js.map +1 -0
- package/dist/shell/commands/rm.d.ts +6 -0
- package/dist/shell/commands/rm.d.ts.map +1 -0
- package/dist/shell/commands/rm.js +64 -0
- package/dist/shell/commands/rm.js.map +1 -0
- package/dist/shell/commands/sed.d.ts +6 -0
- package/dist/shell/commands/sed.d.ts.map +1 -0
- package/dist/shell/commands/sed.js +414 -0
- package/dist/shell/commands/sed.js.map +1 -0
- package/dist/shell/commands/sort.d.ts +6 -0
- package/dist/shell/commands/sort.d.ts.map +1 -0
- package/dist/shell/commands/sort.js +109 -0
- package/dist/shell/commands/sort.js.map +1 -0
- package/dist/shell/commands/tail.d.ts +6 -0
- package/dist/shell/commands/tail.d.ts.map +1 -0
- package/dist/shell/commands/tail.js +68 -0
- package/dist/shell/commands/tail.js.map +1 -0
- package/dist/shell/commands/wc.d.ts +6 -0
- package/dist/shell/commands/wc.d.ts.map +1 -0
- package/dist/shell/commands/wc.js +86 -0
- package/dist/shell/commands/wc.js.map +1 -0
- package/dist/shell/index.d.ts +10 -0
- package/dist/shell/index.d.ts.map +1 -0
- package/dist/shell/index.js +10 -0
- package/dist/shell/index.js.map +1 -0
- package/dist/shell/limits.d.ts +5 -0
- package/dist/shell/limits.d.ts.map +1 -0
- package/dist/shell/limits.js +5 -0
- package/dist/shell/limits.js.map +1 -0
- package/dist/shell/parser.d.ts +8 -0
- package/dist/shell/parser.d.ts.map +1 -0
- package/dist/shell/parser.js +307 -0
- package/dist/shell/parser.js.map +1 -0
- package/dist/shell/path-validation.d.ts +35 -0
- package/dist/shell/path-validation.d.ts.map +1 -0
- package/dist/shell/path-validation.js +81 -0
- package/dist/shell/path-validation.js.map +1 -0
- package/dist/shell/shell.d.ts +66 -0
- package/dist/shell/shell.d.ts.map +1 -0
- package/dist/shell/shell.js +301 -0
- package/dist/shell/shell.js.map +1 -0
- package/dist/shell/shell.test.d.ts +2 -0
- package/dist/shell/shell.test.d.ts.map +1 -0
- package/dist/shell/shell.test.js +1088 -0
- package/dist/shell/shell.test.js.map +1 -0
- package/dist/shell/types.d.ts +82 -0
- package/dist/shell/types.d.ts.map +1 -0
- package/dist/shell/types.js +5 -0
- package/dist/shell/types.js.map +1 -0
- package/dist/summarizer.d.ts +28 -0
- package/dist/summarizer.d.ts.map +1 -0
- package/dist/summarizer.js +136 -0
- package/dist/summarizer.js.map +1 -0
- package/dist/summarizer.test.d.ts +2 -0
- package/dist/summarizer.test.d.ts.map +1 -0
- package/dist/summarizer.test.js +192 -0
- package/dist/summarizer.test.js.map +1 -0
- package/dist/tools/ask-user.d.ts +11 -0
- package/dist/tools/ask-user.d.ts.map +1 -0
- package/dist/tools/ask-user.js +35 -0
- package/dist/tools/ask-user.js.map +1 -0
- package/dist/tools/index.d.ts +11 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +18 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/output.d.ts +15 -0
- package/dist/tools/output.d.ts.map +1 -0
- package/dist/tools/output.js +40 -0
- package/dist/tools/output.js.map +1 -0
- package/dist/tools/shell.d.ts +13 -0
- package/dist/tools/shell.d.ts.map +1 -0
- package/dist/tools/shell.js +166 -0
- package/dist/tools/shell.js.map +1 -0
- package/dist/tools/sub-agent.d.ts +25 -0
- package/dist/tools/sub-agent.d.ts.map +1 -0
- package/dist/tools/sub-agent.js +312 -0
- package/dist/tools/sub-agent.js.map +1 -0
- package/dist/tools/tasks.d.ts +170 -0
- package/dist/tools/tasks.d.ts.map +1 -0
- package/dist/tools/tasks.js +947 -0
- package/dist/tools/tasks.js.map +1 -0
- package/dist/trace/builder.d.ts +54 -0
- package/dist/trace/builder.d.ts.map +1 -0
- package/dist/trace/builder.js +229 -0
- package/dist/trace/builder.js.map +1 -0
- package/dist/trace/console.d.ts +45 -0
- package/dist/trace/console.d.ts.map +1 -0
- package/dist/trace/console.js +143 -0
- package/dist/trace/console.js.map +1 -0
- package/dist/trace/index.d.ts +11 -0
- package/dist/trace/index.d.ts.map +1 -0
- package/dist/trace/index.js +11 -0
- package/dist/trace/index.js.map +1 -0
- package/dist/trace/openrouter-pricing.d.ts +9 -0
- package/dist/trace/openrouter-pricing.d.ts.map +1 -0
- package/dist/trace/openrouter-pricing.js +321 -0
- package/dist/trace/openrouter-pricing.js.map +1 -0
- package/dist/trace/pricing.d.ts +13 -0
- package/dist/trace/pricing.d.ts.map +1 -0
- package/dist/trace/pricing.js +41 -0
- package/dist/trace/pricing.js.map +1 -0
- package/dist/trace/types.d.ts +142 -0
- package/dist/trace/types.d.ts.map +1 -0
- package/dist/trace/types.js +16 -0
- package/dist/trace/types.js.map +1 -0
- package/dist/trace.d.ts +5 -0
- package/dist/trace.d.ts.map +1 -0
- package/dist/trace.js +5 -0
- package/dist/trace.js.map +1 -0
- package/dist/types.d.ts +382 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +5 -0
- package/dist/types.js.map +1 -0
- package/dist/workspace.d.ts +287 -0
- package/dist/workspace.d.ts.map +1 -0
- package/dist/workspace.js +560 -0
- package/dist/workspace.js.map +1 -0
- package/package.json +47 -0
package/dist/executor.js
ADDED
|
@@ -0,0 +1,399 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Executor - Tool Execution Loop
|
|
3
|
+
*
|
|
4
|
+
* Core execution loop that runs tools and handles agent responses.
|
|
5
|
+
*/
|
|
6
|
+
const ASK_USER_TOOL_NAME = '__ask_user__';
|
|
7
|
+
/**
|
|
8
|
+
* Extract text from content blocks
|
|
9
|
+
*/
|
|
10
|
+
function extractText(content) {
|
|
11
|
+
return content
|
|
12
|
+
.filter((block) => block.type === 'text')
|
|
13
|
+
.map(block => block.text)
|
|
14
|
+
.join('\n');
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Extract thinking blocks
|
|
18
|
+
*/
|
|
19
|
+
function extractThinking(content) {
|
|
20
|
+
return content
|
|
21
|
+
.filter((block) => block.type === 'thinking')
|
|
22
|
+
.map(block => block.thinking);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Convert tools to schemas for LLM
|
|
26
|
+
*/
|
|
27
|
+
function toolsToSchemas(tools) {
|
|
28
|
+
return tools.map(tool => ({
|
|
29
|
+
name: tool.name,
|
|
30
|
+
description: tool.description,
|
|
31
|
+
input_schema: tool.parameters
|
|
32
|
+
}));
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Truncate and stringify data for logging
|
|
36
|
+
*/
|
|
37
|
+
function truncateForLog(data, maxLength = 500) {
|
|
38
|
+
const str = JSON.stringify(data);
|
|
39
|
+
if (str.length <= maxLength)
|
|
40
|
+
return str;
|
|
41
|
+
return str.slice(0, maxLength) + `... (${str.length} chars total)`;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Execute a single tool
|
|
45
|
+
*/
|
|
46
|
+
async function executeTool(tool, params, context, logger) {
|
|
47
|
+
const startTime = Date.now();
|
|
48
|
+
// Progress: tool starting (with context for specific tools)
|
|
49
|
+
let progressMessage = `Running ${tool.name}...`;
|
|
50
|
+
if (tool.name === 'TaskCreate') {
|
|
51
|
+
const subject = params.subject;
|
|
52
|
+
progressMessage = subject ? `Creating task: "${subject}"...` : 'Creating task...';
|
|
53
|
+
}
|
|
54
|
+
else if (tool.name === 'TaskUpdate') {
|
|
55
|
+
const status = params.status;
|
|
56
|
+
if (status === 'completed') {
|
|
57
|
+
progressMessage = 'Marking task complete...';
|
|
58
|
+
}
|
|
59
|
+
else if (status === 'in_progress') {
|
|
60
|
+
progressMessage = 'Starting task...';
|
|
61
|
+
}
|
|
62
|
+
else if (status === 'deleted') {
|
|
63
|
+
progressMessage = 'Deleting task...';
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
progressMessage = 'Updating task...';
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
else if (tool.name === 'TaskList') {
|
|
70
|
+
progressMessage = 'Checking tasks...';
|
|
71
|
+
}
|
|
72
|
+
else if (tool.name === 'TaskGet') {
|
|
73
|
+
progressMessage = 'Getting task details...';
|
|
74
|
+
}
|
|
75
|
+
else if (tool.name === '__sub_agent__') {
|
|
76
|
+
const agent = params.agent;
|
|
77
|
+
progressMessage = `Delegating to ${agent}...`;
|
|
78
|
+
}
|
|
79
|
+
else if (tool.name === '__shell__') {
|
|
80
|
+
const command = params.command;
|
|
81
|
+
if (command) {
|
|
82
|
+
// Show the full command, truncated if too long
|
|
83
|
+
const truncated = command.length > 80 ? command.slice(0, 80) + '...' : command;
|
|
84
|
+
progressMessage = `$ ${truncated}`;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
logger?.onProgress?.({
|
|
88
|
+
type: 'tool_start',
|
|
89
|
+
message: progressMessage,
|
|
90
|
+
details: { toolName: tool.name }
|
|
91
|
+
});
|
|
92
|
+
// Log tool execution details
|
|
93
|
+
logger?.debug(`[Tool: ${tool.name}] Executing with params: ${truncateForLog(params)}`);
|
|
94
|
+
logger?.debug(`[Tool: ${tool.name}] Context: conversationId=${context.conversationId}, userId=${context.userId}, remainingTokens=${context.remainingTokens}`);
|
|
95
|
+
logger?.onToolCall?.(tool.name, params);
|
|
96
|
+
try {
|
|
97
|
+
const result = await tool.execute(params, context);
|
|
98
|
+
const durationMs = Date.now() - startTime;
|
|
99
|
+
// Log result details
|
|
100
|
+
logger?.debug(`[Tool: ${tool.name}] Completed in ${durationMs}ms, success=${result.success}`);
|
|
101
|
+
if (result.success) {
|
|
102
|
+
if (result.data !== undefined) {
|
|
103
|
+
logger?.debug(`[Tool: ${tool.name}] Result data: ${truncateForLog(result.data)}`);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
logger?.warn(`[Tool: ${tool.name}] Error: ${result.error}`);
|
|
108
|
+
if (result.data !== undefined) {
|
|
109
|
+
logger?.warn(`[Tool: ${tool.name}] Details: ${truncateForLog(result.data, 1000)}`);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
// Progress: tool completed (with result context)
|
|
113
|
+
let completionMessage = `${tool.name} completed`;
|
|
114
|
+
if (!result.success) {
|
|
115
|
+
completionMessage = `${tool.name} failed: ${result.error}`;
|
|
116
|
+
}
|
|
117
|
+
else if (tool.name === '__shell__') {
|
|
118
|
+
const command = params.command;
|
|
119
|
+
if (command) {
|
|
120
|
+
const truncated = command.length > 80 ? command.slice(0, 80) + '...' : command;
|
|
121
|
+
completionMessage = `$ ${truncated}`;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
const isTaskTool = ['TaskCreate', 'TaskUpdate', 'TaskGet', 'TaskList'].includes(tool.name);
|
|
126
|
+
if (isTaskTool && result.data) {
|
|
127
|
+
const data = result.data;
|
|
128
|
+
if (data.message) {
|
|
129
|
+
completionMessage = data.message;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
logger?.onProgress?.({
|
|
134
|
+
type: 'tool_end',
|
|
135
|
+
message: completionMessage,
|
|
136
|
+
details: { toolName: tool.name, duration: durationMs, success: result.success }
|
|
137
|
+
});
|
|
138
|
+
logger?.onToolResult?.(tool.name, result, durationMs);
|
|
139
|
+
return { result, durationMs };
|
|
140
|
+
}
|
|
141
|
+
catch (error) {
|
|
142
|
+
const durationMs = Date.now() - startTime;
|
|
143
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
144
|
+
const errorStack = error instanceof Error ? error.stack : undefined;
|
|
145
|
+
logger?.error(`[Tool: ${tool.name}] Exception after ${durationMs}ms: ${errorMessage}`);
|
|
146
|
+
if (errorStack) {
|
|
147
|
+
logger?.error(`[Tool: ${tool.name}] Stack trace: ${errorStack}`);
|
|
148
|
+
}
|
|
149
|
+
const result = {
|
|
150
|
+
success: false,
|
|
151
|
+
error: errorMessage
|
|
152
|
+
};
|
|
153
|
+
// Progress: tool failed
|
|
154
|
+
logger?.onProgress?.({
|
|
155
|
+
type: 'tool_end',
|
|
156
|
+
message: `${tool.name} failed`,
|
|
157
|
+
details: { toolName: tool.name, duration: durationMs, success: false }
|
|
158
|
+
});
|
|
159
|
+
logger?.onToolResult?.(tool.name, result, durationMs);
|
|
160
|
+
return { result, durationMs };
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Check if execution should be interrupted
|
|
165
|
+
*/
|
|
166
|
+
async function checkInterruption(signal, shouldContinue) {
|
|
167
|
+
// Check AbortSignal
|
|
168
|
+
if (signal?.aborted) {
|
|
169
|
+
return 'aborted';
|
|
170
|
+
}
|
|
171
|
+
// Check shouldContinue callback
|
|
172
|
+
if (shouldContinue) {
|
|
173
|
+
const continueExecution = await shouldContinue();
|
|
174
|
+
if (!continueExecution) {
|
|
175
|
+
return 'stopped';
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
return null;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Build interrupted result
|
|
182
|
+
*/
|
|
183
|
+
function buildInterruptedResult(reason, iteration, messages, toolCallLogs, thinkingBlocks, taskManager) {
|
|
184
|
+
const tasks = taskManager.getAll();
|
|
185
|
+
return {
|
|
186
|
+
response: '',
|
|
187
|
+
history: messages,
|
|
188
|
+
toolCalls: toolCallLogs,
|
|
189
|
+
thinking: thinkingBlocks.length > 0 ? thinkingBlocks : undefined,
|
|
190
|
+
tasks: tasks.length > 0 ? tasks : undefined,
|
|
191
|
+
status: 'interrupted',
|
|
192
|
+
interrupted: {
|
|
193
|
+
reason,
|
|
194
|
+
iterationsCompleted: iteration
|
|
195
|
+
}
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Main execution loop
|
|
200
|
+
*/
|
|
201
|
+
export async function executeLoop(config, initialMessages, toolContext) {
|
|
202
|
+
const { systemPrompt, tools, llm, logger, maxIterations, contextManager, taskManager, llmOptions, signal, shouldContinue, traceBuilder } = config;
|
|
203
|
+
const messages = [...initialMessages];
|
|
204
|
+
const toolCallLogs = [];
|
|
205
|
+
const thinkingBlocks = [];
|
|
206
|
+
const toolSchemas = toolsToSchemas(tools);
|
|
207
|
+
const modelId = llm.getModelId?.() || 'unknown';
|
|
208
|
+
for (let iteration = 0; iteration < maxIterations; iteration++) {
|
|
209
|
+
// Check for interruption at start of each iteration
|
|
210
|
+
const interruptReason = await checkInterruption(signal, shouldContinue);
|
|
211
|
+
if (interruptReason) {
|
|
212
|
+
logger?.onProgress?.({
|
|
213
|
+
type: 'status',
|
|
214
|
+
message: `Interrupted: ${interruptReason}`
|
|
215
|
+
});
|
|
216
|
+
return buildInterruptedResult(interruptReason, iteration, messages, toolCallLogs, thinkingBlocks, taskManager);
|
|
217
|
+
}
|
|
218
|
+
logger?.onIteration?.(iteration, messages.length);
|
|
219
|
+
// Progress: thinking
|
|
220
|
+
logger?.onProgress?.({
|
|
221
|
+
type: 'thinking',
|
|
222
|
+
message: iteration === 0 ? 'Thinking...' : 'Processing...'
|
|
223
|
+
});
|
|
224
|
+
// Manage context (truncate/summarize if needed)
|
|
225
|
+
const managedMessages = await contextManager.manageContext(messages);
|
|
226
|
+
// Call LLM with timing
|
|
227
|
+
const llmStartTime = Date.now();
|
|
228
|
+
let response;
|
|
229
|
+
try {
|
|
230
|
+
response = await llm.chat(systemPrompt, managedMessages, toolSchemas, llmOptions);
|
|
231
|
+
}
|
|
232
|
+
catch (error) {
|
|
233
|
+
const llmDurationMs = Date.now() - llmStartTime;
|
|
234
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
235
|
+
logger?.error(`[LLM] Failed after ${llmDurationMs}ms: ${errorMessage}`);
|
|
236
|
+
const tasks = taskManager.getAll();
|
|
237
|
+
return {
|
|
238
|
+
response: '',
|
|
239
|
+
history: messages,
|
|
240
|
+
toolCalls: toolCallLogs,
|
|
241
|
+
thinking: thinkingBlocks.length > 0 ? thinkingBlocks : undefined,
|
|
242
|
+
tasks: tasks.length > 0 ? tasks : undefined,
|
|
243
|
+
status: 'error',
|
|
244
|
+
error: errorMessage
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
const llmDurationMs = Date.now() - llmStartTime;
|
|
248
|
+
// Record usage in trace
|
|
249
|
+
if (response.usage) {
|
|
250
|
+
traceBuilder?.recordLLMCall(modelId, response.usage.inputTokens, response.usage.outputTokens, llmDurationMs, {
|
|
251
|
+
cacheCreationTokens: response.cacheUsage?.cacheCreationInputTokens,
|
|
252
|
+
cacheReadTokens: response.cacheUsage?.cacheReadInputTokens,
|
|
253
|
+
systemPrompt,
|
|
254
|
+
messages: managedMessages,
|
|
255
|
+
response: response.content
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
// Collect thinking blocks
|
|
259
|
+
thinkingBlocks.push(...extractThinking(response.content));
|
|
260
|
+
// Add assistant message to history
|
|
261
|
+
messages.push({ role: 'assistant', content: response.content });
|
|
262
|
+
// Check if done (no tool use)
|
|
263
|
+
if (response.stopReason !== 'tool_use') {
|
|
264
|
+
const tasks = taskManager.getAll();
|
|
265
|
+
const incompleteTasks = tasks.filter(t => t.status !== 'completed');
|
|
266
|
+
// If there are incomplete tasks, force the agent to continue working
|
|
267
|
+
if (incompleteTasks.length > 0) {
|
|
268
|
+
logger?.onProgress?.({
|
|
269
|
+
type: 'status',
|
|
270
|
+
message: `${incompleteTasks.length} tasks remaining, continuing...`
|
|
271
|
+
});
|
|
272
|
+
// Add a reminder to continue working on tasks
|
|
273
|
+
const reminderContent = `You have ${incompleteTasks.length} incomplete task(s) in your task list:\n${incompleteTasks.map(t => `- ${t.status === 'in_progress' ? '[IN PROGRESS] ' : ''}${t.subject}`).join('\n')}\n\nYou MUST continue working on these tasks. Use the TaskUpdate tool with status "completed" after finishing each task. Do not respond to the user until all tasks are completed.`;
|
|
274
|
+
messages.push({
|
|
275
|
+
role: 'user',
|
|
276
|
+
content: reminderContent
|
|
277
|
+
});
|
|
278
|
+
// Continue the loop instead of returning
|
|
279
|
+
continue;
|
|
280
|
+
}
|
|
281
|
+
const result = {
|
|
282
|
+
response: extractText(response.content),
|
|
283
|
+
history: messages,
|
|
284
|
+
toolCalls: toolCallLogs,
|
|
285
|
+
thinking: thinkingBlocks.length > 0 ? thinkingBlocks : undefined,
|
|
286
|
+
tasks: tasks.length > 0 ? tasks : undefined,
|
|
287
|
+
status: 'complete'
|
|
288
|
+
};
|
|
289
|
+
logger?.onComplete?.(result);
|
|
290
|
+
return result;
|
|
291
|
+
}
|
|
292
|
+
// Execute tool calls
|
|
293
|
+
const toolUseBlocks = response.content.filter((block) => block.type === 'tool_use');
|
|
294
|
+
const toolResults = [];
|
|
295
|
+
for (const toolUse of toolUseBlocks) {
|
|
296
|
+
// Check for interruption between tool calls
|
|
297
|
+
const toolInterruptReason = await checkInterruption(signal, shouldContinue);
|
|
298
|
+
if (toolInterruptReason) {
|
|
299
|
+
logger?.onProgress?.({
|
|
300
|
+
type: 'status',
|
|
301
|
+
message: `Interrupted between tools: ${toolInterruptReason}`
|
|
302
|
+
});
|
|
303
|
+
return buildInterruptedResult(toolInterruptReason, iteration, messages, toolCallLogs, thinkingBlocks, taskManager);
|
|
304
|
+
}
|
|
305
|
+
// Handle ask_user tool specially
|
|
306
|
+
if (toolUse.name === ASK_USER_TOOL_NAME) {
|
|
307
|
+
const input = toolUse.input;
|
|
308
|
+
// Build pendingQuestion from questions array
|
|
309
|
+
const questions = input.questions && Array.isArray(input.questions) && input.questions.length > 0
|
|
310
|
+
? input.questions
|
|
311
|
+
: [{ question: 'The assistant needs more information. Please provide additional details.' }];
|
|
312
|
+
const pendingQuestion = { questions };
|
|
313
|
+
const tasks = taskManager.getAll();
|
|
314
|
+
return {
|
|
315
|
+
response: '',
|
|
316
|
+
history: messages,
|
|
317
|
+
toolCalls: toolCallLogs,
|
|
318
|
+
thinking: thinkingBlocks.length > 0 ? thinkingBlocks : undefined,
|
|
319
|
+
tasks: tasks.length > 0 ? tasks : undefined,
|
|
320
|
+
pendingQuestion,
|
|
321
|
+
status: 'needs_input'
|
|
322
|
+
};
|
|
323
|
+
}
|
|
324
|
+
// Find and execute the tool
|
|
325
|
+
const tool = tools.find(t => t.name === toolUse.name);
|
|
326
|
+
if (!tool) {
|
|
327
|
+
toolResults.push({
|
|
328
|
+
type: 'tool_result',
|
|
329
|
+
tool_use_id: toolUse.id,
|
|
330
|
+
content: JSON.stringify({ success: false, error: `Unknown tool: ${toolUse.name}` }),
|
|
331
|
+
is_error: true
|
|
332
|
+
});
|
|
333
|
+
continue;
|
|
334
|
+
}
|
|
335
|
+
const { result, durationMs } = await executeTool(tool, toolUse.input, toolContext, logger);
|
|
336
|
+
toolCallLogs.push({
|
|
337
|
+
name: toolUse.name,
|
|
338
|
+
input: toolUse.input,
|
|
339
|
+
output: result,
|
|
340
|
+
durationMs
|
|
341
|
+
});
|
|
342
|
+
// Record in trace
|
|
343
|
+
traceBuilder?.recordToolCall(toolUse.name, toolUse.input, result, durationMs);
|
|
344
|
+
// If a sub-agent needs user input, propagate needs_input immediately
|
|
345
|
+
// We add the __sub_agent__ tool result to history, then synthesize an __ask_user__
|
|
346
|
+
// tool call so the existing resume logic in agent.ts works correctly
|
|
347
|
+
if (toolUse.name === '__sub_agent__' && !result.success && result.error === 'Sub-agent needs user input' && result.data) {
|
|
348
|
+
const subAgentData = result.data;
|
|
349
|
+
if (subAgentData.questions && Array.isArray(subAgentData.questions) && subAgentData.questions.length > 0) {
|
|
350
|
+
// Add the __sub_agent__ tool result to close the pending tool_use
|
|
351
|
+
toolResults.push({
|
|
352
|
+
type: 'tool_result',
|
|
353
|
+
tool_use_id: toolUse.id,
|
|
354
|
+
content: JSON.stringify(result),
|
|
355
|
+
is_error: true
|
|
356
|
+
});
|
|
357
|
+
messages.push({ role: 'user', content: toolResults });
|
|
358
|
+
// Synthesize an __ask_user__ tool call so resume logic works
|
|
359
|
+
const syntheticAskUserId = `synthetic_ask_user_${Date.now()}`;
|
|
360
|
+
messages.push({
|
|
361
|
+
role: 'assistant',
|
|
362
|
+
content: [{
|
|
363
|
+
type: 'tool_use',
|
|
364
|
+
id: syntheticAskUserId,
|
|
365
|
+
name: ASK_USER_TOOL_NAME,
|
|
366
|
+
input: { questions: subAgentData.questions }
|
|
367
|
+
}]
|
|
368
|
+
});
|
|
369
|
+
const pendingQuestion = { questions: subAgentData.questions };
|
|
370
|
+
const tasks = taskManager.getAll();
|
|
371
|
+
return {
|
|
372
|
+
response: '',
|
|
373
|
+
history: messages,
|
|
374
|
+
toolCalls: toolCallLogs,
|
|
375
|
+
thinking: thinkingBlocks.length > 0 ? thinkingBlocks : undefined,
|
|
376
|
+
tasks: tasks.length > 0 ? tasks : undefined,
|
|
377
|
+
pendingQuestion,
|
|
378
|
+
status: 'needs_input'
|
|
379
|
+
};
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
toolResults.push({
|
|
383
|
+
type: 'tool_result',
|
|
384
|
+
tool_use_id: toolUse.id,
|
|
385
|
+
content: JSON.stringify(result),
|
|
386
|
+
is_error: !result.success
|
|
387
|
+
});
|
|
388
|
+
}
|
|
389
|
+
// Add tool results as user message
|
|
390
|
+
messages.push({ role: 'user', content: toolResults });
|
|
391
|
+
}
|
|
392
|
+
// Max iterations reached - return as interrupted instead of throwing
|
|
393
|
+
logger?.onProgress?.({
|
|
394
|
+
type: 'status',
|
|
395
|
+
message: `Max iterations (${maxIterations}) reached`
|
|
396
|
+
});
|
|
397
|
+
return buildInterruptedResult('max_iterations', maxIterations, messages, toolCallLogs, thinkingBlocks, taskManager);
|
|
398
|
+
}
|
|
399
|
+
//# sourceMappingURL=executor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../src/executor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAqBH,MAAM,kBAAkB,GAAG,cAAc,CAAA;AAsBzC;;GAEG;AACH,SAAS,WAAW,CAAC,OAAuB;IAC1C,OAAO,OAAO;SACX,MAAM,CAAC,CAAC,KAAK,EAA2C,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,MAAM,CAAC;SACjF,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC;SACxB,IAAI,CAAC,IAAI,CAAC,CAAA;AACf,CAAC;AAED;;GAEG;AACH,SAAS,eAAe,CAAC,OAAuB;IAC9C,OAAO,OAAO;SACX,MAAM,CAAC,CAAC,KAAK,EAAmD,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,UAAU,CAAC;SAC7F,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAA;AACjC,CAAC;AAED;;GAEG;AACH,SAAS,cAAc,CAAC,K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MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS;wBAC3C,eAAe;wBACf,MAAM,EAAE,aAAa;qBACtB,CAAA;gBACH,CAAC;YACH,CAAC;YAED,WAAW,CAAC,IAAI,CAAC;gBACf,IAAI,EAAE,aAAa;gBACnB,WAAW,EAAE,OAAO,CAAC,EAAE;gBACvB,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC;gBAC/B,QAAQ,EAAE,CAAC,MAAM,CAAC,OAAO;aAC1B,CAAC,CAAA;QACJ,CAAC;QAED,mCAAmC;QACnC,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC,CAAA;IACvD,CAAC;IAED,qEAAqE;IACrE,MAAM,EAAE,UAAU,EAAE,CAAC;QACnB,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,mBAAmB,aAAa,WAAW;KACrD,CAAC,CAAA;IAEF,OAAO,sBAAsB,CAC3B,gBAAgB,EAChB,aAAa,EACb,QAAQ,EACR,YAAY,EACZ,cAAc,EACd,WAAW,CACZ,CAAA;AACH,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tuplet Agent Framework
|
|
3
|
+
*
|
|
4
|
+
* Minimal TypeScript agent framework inspired by Claude Code architecture.
|
|
5
|
+
*/
|
|
6
|
+
export { Tuplet, Tuplet as Hive, PLAN_PATH } from './agent.js';
|
|
7
|
+
export type { Message, MessageRole, ContentBlock, TextBlock, ThinkingBlock, ToolUseBlock, ToolResultBlock, Tool, ToolSchema, ToolResult, ToolContext, ToolCallLog, JSONSchema, TupletConfig, TupletConfig as HiveConfig, SubAgentConfig, RunOptions, AgentResult, AgentStatus, PendingQuestion, QuestionOption, EnhancedQuestion, TaskItem, TaskStatus, TaskComment, TaskProgress, TaskUpdateNotification, TodoItem, TodoStatus, TodoProgress, TodoUpdate, LLMProvider, LLMResponse, LLMOptions, StopReason, LogProvider, RepositoryProvider, EnvironmentProvider, ProgressUpdate, CacheUsage, ContextStrategy, SystemPromptConfig, EnvironmentInfo } from './types.js';
|
|
8
|
+
export { ClaudeProvider, type ClaudeProviderConfig } from './providers/llm/claude.js';
|
|
9
|
+
export { OpenAIProvider, type OpenAIProviderConfig } from './providers/llm/openai.js';
|
|
10
|
+
export { OpenRouterProvider, type OpenRouterProviderConfig } from './providers/llm/openrouter.js';
|
|
11
|
+
export { ConsoleLogger, type ConsoleLoggerConfig, type LogLevel } from './providers/logger/console.js';
|
|
12
|
+
export { MemoryRepository } from './providers/repository/memory.js';
|
|
13
|
+
export { MemoryEnvironmentProvider } from './providers/env/memory.js';
|
|
14
|
+
export { estimateTokens, estimateMessageTokens, estimateTotalTokens, truncateOldMessages, sanitizeHistory, ContextManager } from './context-manager.js';
|
|
15
|
+
export { summarizeMessages, microCompact, parseSummary } from './summarizer.js';
|
|
16
|
+
export { buildSystemPrompt, buildEnvironmentSection, buildRemindersSection, getCurrentEnvironment, DEFAULT_SYSTEM_PROMPT, SubAgentBuilder, roleSection, subAgentsTable, questionHandlingSection, directToolsSection, workspaceStorageSection, rulesSection, taskExamplesSection, subAgentRoleSection, taskSection, workflowSection, guidelinesSection, outputSection, type SubAgentDef, type ToolDef, type WorkspacePathDef, type TaskExample, type WorkflowStep, type OutputFormat, type SubAgentPromptConfig } from './prompt.js';
|
|
17
|
+
export { TaskManager, formatTaskList, createTaskTools, createTaskCreateTool, createTaskUpdateTool, createTaskGetTool, createTaskListTool, type TaskToolOptions, TodoManager, formatTodoList, createTodoTool, type TodoToolOptions } from './tools/tasks.js';
|
|
18
|
+
export { TraceBuilder, ConsoleTraceProvider, generateTraceId, generateSpanId, calculateCost, DEFAULT_MODEL_PRICING, OPENROUTER_MODEL_PRICING, type TraceProvider, type TraceId, type SpanId, type Trace, type AgentSpan, type TraceEvent, type LLMCallEvent, type ToolCallEvent, type TraceContext, type ModelPricing, type ConsoleTraceConfig } from './trace.js';
|
|
19
|
+
export { Workspace, type WorkspaceEntry, type WorkspaceListItem, type WorkspaceConfig, type WorkspaceConfigExt, type PathConfig, type ValidatorFn, type ZodLike, type ValidationError, type WriteResult } from './workspace.js';
|
|
20
|
+
export { type WorkspaceProvider, type WorkspaceChange, type WorkspaceChangeListener, MemoryWorkspaceProvider, FileWorkspaceProvider } from './providers/workspace/index.js';
|
|
21
|
+
export { Shell, type ShellConfig, type ShellResult, type CommandHandler, type CommandHelp, type CommandFlag, type CommandExample } from './shell/index.js';
|
|
22
|
+
export { exploreAgent, planAgent, getBuiltInAgents } from './built-in-agents/index.js';
|
|
23
|
+
export { RunRecorder, RunReplayer, RunTester, type RunRecorderConfig, type RunRecord, type RunRecordConfig, type RunRecordResult, type SerializedTool, type SerializedSubAgentConfig, type RunTesterConfig, type TestResult, type TestSummary } from './providers/dataset/index.js';
|
|
24
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,MAAM,EAAE,MAAM,IAAI,IAAI,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAG9D,YAAY,EAEV,OAAO,EACP,WAAW,EACX,YAAY,EACZ,SAAS,EACT,aAAa,EACb,YAAY,EACZ,eAAe,EAGf,IAAI,EACJ,UAAU,EACV,UAAU,EACV,WAAW,EACX,WAAW,EACX,UAAU,EAGV,YAAY,EACZ,YAAY,IAAI,UAAU,EAC1B,cAAc,EACd,UAAU,EACV,WAAW,EACX,WAAW,EACX,eAAe,EACf,cAAc,EACd,gBAAgB,EAGhB,QAAQ,EACR,UAAU,EACV,WAAW,EACX,YAAY,EACZ,sBAAsB,EAGtB,QAAQ,EACR,UAAU,EACV,YAAY,EACZ,UAAU,EAGV,WAAW,EACX,WAAW,EACX,UAAU,EACV,UAAU,EACV,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/dist/index.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tuplet Agent Framework
|
|
3
|
+
*
|
|
4
|
+
* Minimal TypeScript agent framework inspired by Claude Code architecture.
|
|
5
|
+
*/
|
|
6
|
+
// Main agent class
|
|
7
|
+
export { Tuplet, Tuplet as Hive, PLAN_PATH } from './agent.js';
|
|
8
|
+
// Providers
|
|
9
|
+
export { ClaudeProvider } from './providers/llm/claude.js';
|
|
10
|
+
export { OpenAIProvider } from './providers/llm/openai.js';
|
|
11
|
+
export { OpenRouterProvider } from './providers/llm/openrouter.js';
|
|
12
|
+
export { ConsoleLogger } from './providers/logger/console.js';
|
|
13
|
+
export { MemoryRepository } from './providers/repository/memory.js';
|
|
14
|
+
// Environment Providers
|
|
15
|
+
export { MemoryEnvironmentProvider } from './providers/env/memory.js';
|
|
16
|
+
// Utilities
|
|
17
|
+
export { estimateTokens, estimateMessageTokens, estimateTotalTokens, truncateOldMessages, sanitizeHistory, ContextManager } from './context-manager.js';
|
|
18
|
+
export { summarizeMessages, microCompact, parseSummary } from './summarizer.js';
|
|
19
|
+
export { buildSystemPrompt, buildEnvironmentSection, buildRemindersSection, getCurrentEnvironment, DEFAULT_SYSTEM_PROMPT,
|
|
20
|
+
// Prompt builders
|
|
21
|
+
SubAgentBuilder,
|
|
22
|
+
// Template functions (for advanced customization)
|
|
23
|
+
roleSection, subAgentsTable, questionHandlingSection, directToolsSection, workspaceStorageSection, rulesSection, taskExamplesSection, subAgentRoleSection, taskSection, workflowSection, guidelinesSection, outputSection } from './prompt.js';
|
|
24
|
+
// Task Management utilities (new 4-tool approach)
|
|
25
|
+
export { TaskManager, formatTaskList, createTaskTools, createTaskCreateTool, createTaskUpdateTool, createTaskGetTool, createTaskListTool,
|
|
26
|
+
// Backward compatibility (deprecated)
|
|
27
|
+
TodoManager, formatTodoList, createTodoTool } from './tools/tasks.js';
|
|
28
|
+
// Tracing
|
|
29
|
+
export { TraceBuilder, ConsoleTraceProvider, generateTraceId, generateSpanId, calculateCost, DEFAULT_MODEL_PRICING, OPENROUTER_MODEL_PRICING } from './trace.js';
|
|
30
|
+
// Workspace
|
|
31
|
+
export { Workspace } from './workspace.js';
|
|
32
|
+
// Workspace Providers
|
|
33
|
+
export { MemoryWorkspaceProvider, FileWorkspaceProvider } from './providers/workspace/index.js';
|
|
34
|
+
// Shell
|
|
35
|
+
export { Shell } from './shell/index.js';
|
|
36
|
+
// Built-in Agents
|
|
37
|
+
export { exploreAgent, planAgent, getBuiltInAgents } from './built-in-agents/index.js';
|
|
38
|
+
// Dataset (Run Recording, Replay & Testing)
|
|
39
|
+
export { RunRecorder, RunReplayer, RunTester } from './providers/dataset/index.js';
|
|
40
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,mBAAmB;AACnB,OAAO,EAAE,MAAM,EAAE,MAAM,IAAI,IAAI,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAgE9D,YAAY;AACZ,OAAO,EACL,cAAc,EAEf,MAAM,2BAA2B,CAAA;AAElC,OAAO,EACL,cAAc,EAEf,MAAM,2BAA2B,CAAA;AAElC,OAAO,EACL,kBAAkB,EAEnB,MAAM,+BAA+B,CAAA;AAEtC,OAAO,EACL,aAAa,EAGd,MAAM,+BAA+B,CAAA;AAEtC,OAAO,EACL,gBAAgB,EACjB,MAAM,kCAAkC,CAAA;AAEzC,wBAAwB;AACxB,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAA;AAErE,YAAY;AACZ,OAAO,EACL,cAAc,EACd,qBAAqB,EACrB,mBAAmB,EACnB,mBAAmB,EACnB,eAAe,EACf,cAAc,EACf,MAAM,sBAAsB,CAAA;AAE7B,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACb,MAAM,iBAAiB,CAAA;AAExB,OAAO,EACL,iBAAiB,EACjB,uBAAuB,EACvB,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB;AACrB,kBAAkB;AAClB,eAAe;AACf,kDAAkD;AAClD,WAAW,EACX,cAAc,EACd,uBAAuB,EACvB,kBAAkB,EAClB,uBAAuB,EACvB,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,WAAW,EACX,eAAe,EACf,iBAAiB,EACjB,aAAa,EASd,MAAM,aAAa,CAAA;AAEpB,kDAAkD;AAClD,OAAO,EACL,WAAW,EACX,cAAc,EACd,eAAe,EACf,oBAAoB,EACpB,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB;AAElB,sCAAsC;AACtC,WAAW,EACX,cAAc,EACd,cAAc,EAEf,MAAM,kBAAkB,CAAA;AAEzB,UAAU;AACV,OAAO,EACL,YAAY,EACZ,oBAAoB,EACpB,eAAe,EACf,cAAc,EACd,aAAa,EACb,qBAAqB,EACrB,wBAAwB,EAYzB,MAAM,YAAY,CAAA;AAEnB,YAAY;AACZ,OAAO,EACL,SAAS,EAUV,MAAM,gBAAgB,CAAA;AAEvB,sBAAsB;AACtB,OAAO,EAIL,uBAAuB,EACvB,qBAAqB,EACtB,MAAM,gCAAgC,CAAA;AAEvC,QAAQ;AACR,OAAO,EACL,KAAK,EAON,MAAM,kBAAkB,CAAA;AAEzB,kBAAkB;AAClB,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAEtF,4CAA4C;AAC5C,OAAO,EACL,WAAW,EACX,WAAW,EACX,SAAS,EAUV,MAAM,8BAA8B,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Prompt Builder Module
|
|
3
|
+
*
|
|
4
|
+
* Fluent API builders for creating main agent and sub-agent system prompts.
|
|
5
|
+
*/
|
|
6
|
+
export type { SubAgentDef, ToolDef, WorkspacePathDef, TaskExample, WorkflowStep, OutputFormat, MainAgentPromptConfig, SubAgentPromptConfig } from './types.js';
|
|
7
|
+
export { SubAgentBuilder } from './sub-agent-builder.js';
|
|
8
|
+
export { roleSection, subAgentsTable, questionHandlingSection, directToolsSection, workspaceStorageSection, rulesSection, taskExamplesSection, subAgentRoleSection, taskSection, workflowSection, guidelinesSection, outputSection } from './templates.js';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/prompt/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,YAAY,EACV,WAAW,EACX,OAAO,EACP,gBAAgB,EAChB,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,YAAY,CAAA;AAGnB,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAGxD,OAAO,EACL,WAAW,EACX,cAAc,EACd,uBAAuB,EACvB,kBAAkB,EAClB,uBAAuB,EACvB,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,WAAW,EACX,eAAe,EACf,iBAAiB,EACjB,aAAa,EACd,MAAM,gBAAgB,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Prompt Builder Module
|
|
3
|
+
*
|
|
4
|
+
* Fluent API builders for creating main agent and sub-agent system prompts.
|
|
5
|
+
*/
|
|
6
|
+
// Builders
|
|
7
|
+
export { SubAgentBuilder } from './sub-agent-builder.js';
|
|
8
|
+
// Templates (for advanced customization)
|
|
9
|
+
export { roleSection, subAgentsTable, questionHandlingSection, directToolsSection, workspaceStorageSection, rulesSection, taskExamplesSection, subAgentRoleSection, taskSection, workflowSection, guidelinesSection, outputSection } from './templates.js';
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/prompt/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAcH,WAAW;AACX,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAExD,yCAAyC;AACzC,OAAO,EACL,WAAW,EACX,cAAc,EACd,uBAAuB,EACvB,kBAAkB,EAClB,uBAAuB,EACvB,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,WAAW,EACX,eAAe,EACf,iBAAiB,EACjB,aAAa,EACd,MAAM,gBAAgB,CAAA"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Main Agent Prompt Builder
|
|
3
|
+
*
|
|
4
|
+
* Fluent API for building main agent system prompts.
|
|
5
|
+
*/
|
|
6
|
+
import type { WorkspacePathDef, TaskExample, MainAgentPromptConfig } from './types.js';
|
|
7
|
+
import type { Tool, SubAgentConfig } from '../types.js';
|
|
8
|
+
export declare class MainAgentBuilder {
|
|
9
|
+
private config;
|
|
10
|
+
private _skipBuiltInAgents;
|
|
11
|
+
/**
|
|
12
|
+
* Skip auto-injecting built-in agents (used when Tuplet already merges them)
|
|
13
|
+
*/
|
|
14
|
+
skipBuiltInAgents(): this;
|
|
15
|
+
/**
|
|
16
|
+
* Set the agent's role identity
|
|
17
|
+
*/
|
|
18
|
+
role(role: string): this;
|
|
19
|
+
/**
|
|
20
|
+
* Set the agent's description
|
|
21
|
+
*/
|
|
22
|
+
description(description: string): this;
|
|
23
|
+
/**
|
|
24
|
+
* Set sub-agents from actual SubAgentConfig objects
|
|
25
|
+
* Extracts name, description, and input parameters automatically
|
|
26
|
+
*/
|
|
27
|
+
agents(configs: SubAgentConfig[]): this;
|
|
28
|
+
/**
|
|
29
|
+
* Configure question handling behavior
|
|
30
|
+
*/
|
|
31
|
+
questionHandling(options: {
|
|
32
|
+
description?: string;
|
|
33
|
+
exampleFlow?: string[];
|
|
34
|
+
}): this;
|
|
35
|
+
/**
|
|
36
|
+
* Set tools from actual Tool objects
|
|
37
|
+
* Extracts name and description automatically
|
|
38
|
+
*/
|
|
39
|
+
tools(toolObjects: Tool[]): this;
|
|
40
|
+
/**
|
|
41
|
+
* Add a workspace path definition
|
|
42
|
+
*/
|
|
43
|
+
addWorkspacePath(path: string, description: string): this;
|
|
44
|
+
/**
|
|
45
|
+
* Add multiple workspace paths at once
|
|
46
|
+
*/
|
|
47
|
+
addWorkspacePaths(paths: WorkspacePathDef[]): this;
|
|
48
|
+
/**
|
|
49
|
+
* Add a behavioral rule
|
|
50
|
+
*/
|
|
51
|
+
addRule(rule: string): this;
|
|
52
|
+
/**
|
|
53
|
+
* Add multiple rules at once
|
|
54
|
+
*/
|
|
55
|
+
addRules(rules: string[]): this;
|
|
56
|
+
/**
|
|
57
|
+
* Add a task example showing the flow
|
|
58
|
+
*/
|
|
59
|
+
addExample(example: TaskExample): this;
|
|
60
|
+
/**
|
|
61
|
+
* Add multiple examples at once
|
|
62
|
+
*/
|
|
63
|
+
addExamples(examples: TaskExample[]): this;
|
|
64
|
+
/**
|
|
65
|
+
* Add a custom section with title and content
|
|
66
|
+
*/
|
|
67
|
+
addSection(title: string, content: string): this;
|
|
68
|
+
/**
|
|
69
|
+
* Get the current configuration
|
|
70
|
+
*/
|
|
71
|
+
getConfig(): MainAgentPromptConfig;
|
|
72
|
+
/**
|
|
73
|
+
* Build the final system prompt string
|
|
74
|
+
*/
|
|
75
|
+
build(): string;
|
|
76
|
+
/**
|
|
77
|
+
* Reset the builder to initial state
|
|
78
|
+
*/
|
|
79
|
+
reset(): this;
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=main-agent-builder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main-agent-builder.d.ts","sourceRoot":"","sources":["../../src/prompt/main-agent-builder.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,gBAAgB,EAChB,WAAW,EACX,qBAAqB,EACtB,MAAM,YAAY,CAAA;AACnB,OAAO,KAAK,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AA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