qlogicagent 0.2.1 → 0.4.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/README.md +45 -45
- package/package.json +56 -42
- package/dist/agent/agent.d.ts +0 -43
- package/dist/agent/agent.js +0 -113
- package/dist/agent/tool-loop.d.ts +0 -64
- package/dist/agent/tool-loop.js +0 -575
- package/dist/agent/types.d.ts +0 -175
- package/dist/agent/types.js +0 -14
- package/dist/cli/main.d.ts +0 -11
- package/dist/cli/main.js +0 -23
- package/dist/cli/stdio-server.d.ts +0 -45
- package/dist/cli/stdio-server.js +0 -463
- package/dist/config/config.d.ts +0 -17
- package/dist/config/config.js +0 -21
- package/dist/contracts/hooks.d.ts +0 -120
- package/dist/contracts/hooks.js +0 -7
- package/dist/contracts/index.d.ts +0 -10
- package/dist/contracts/index.js +0 -10
- package/dist/contracts/planner.d.ts +0 -35
- package/dist/contracts/planner.js +0 -2
- package/dist/contracts/skill-candidate.d.ts +0 -63
- package/dist/contracts/skill-candidate.js +0 -195
- package/dist/contracts/todo.d.ts +0 -14
- package/dist/contracts/todo.js +0 -9
- package/dist/index.d.ts +0 -13
- package/dist/index.js +0 -15
- package/dist/llm/builtin-providers.d.ts +0 -10
- package/dist/llm/builtin-providers.js +0 -531
- package/dist/llm/index.d.ts +0 -15
- package/dist/llm/index.js +0 -14
- package/dist/llm/llm-client.d.ts +0 -43
- package/dist/llm/llm-client.js +0 -67
- package/dist/llm/model-catalog.d.ts +0 -53
- package/dist/llm/model-catalog.js +0 -191
- package/dist/llm/provider-def.d.ts +0 -59
- package/dist/llm/provider-def.js +0 -12
- package/dist/llm/provider-registry.d.ts +0 -54
- package/dist/llm/provider-registry.js +0 -147
- package/dist/llm/transport.d.ts +0 -62
- package/dist/llm/transport.js +0 -27
- package/dist/llm/transports/anthropic-messages.d.ts +0 -31
- package/dist/llm/transports/anthropic-messages.js +0 -293
- package/dist/llm/transports/openai-chat.d.ts +0 -36
- package/dist/llm/transports/openai-chat.js +0 -165
- package/dist/orchestration/agent-registry.d.ts +0 -41
- package/dist/orchestration/agent-registry.js +0 -116
- package/dist/orchestration/approval-aware-tool-plan.d.ts +0 -32
- package/dist/orchestration/approval-aware-tool-plan.js +0 -87
- package/dist/orchestration/context-compression.d.ts +0 -220
- package/dist/orchestration/context-compression.js +0 -583
- package/dist/orchestration/conversation-repair.d.ts +0 -61
- package/dist/orchestration/conversation-repair.js +0 -429
- package/dist/orchestration/curator-scheduler.d.ts +0 -119
- package/dist/orchestration/curator-scheduler.js +0 -135
- package/dist/orchestration/embedded-failover-policy.d.ts +0 -110
- package/dist/orchestration/embedded-failover-policy.js +0 -168
- package/dist/orchestration/error-classification.d.ts +0 -12
- package/dist/orchestration/error-classification.js +0 -77
- package/dist/orchestration/failover-classification.d.ts +0 -8
- package/dist/orchestration/failover-classification.js +0 -381
- package/dist/orchestration/failover-error.d.ts +0 -33
- package/dist/orchestration/failover-error.js +0 -198
- package/dist/orchestration/fork-subagent.d.ts +0 -100
- package/dist/orchestration/fork-subagent.js +0 -98
- package/dist/orchestration/index.d.ts +0 -120
- package/dist/orchestration/index.js +0 -267
- package/dist/orchestration/memory-flush-policy.d.ts +0 -57
- package/dist/orchestration/memory-flush-policy.js +0 -85
- package/dist/orchestration/memory-provider.d.ts +0 -14
- package/dist/orchestration/memory-provider.js +0 -2
- package/dist/orchestration/parallel-tool-calls.d.ts +0 -41
- package/dist/orchestration/parallel-tool-calls.js +0 -59
- package/dist/orchestration/prompt-cache-strategy.d.ts +0 -126
- package/dist/orchestration/prompt-cache-strategy.js +0 -228
- package/dist/orchestration/reactive-compact.d.ts +0 -73
- package/dist/orchestration/reactive-compact.js +0 -78
- package/dist/orchestration/retry-loop.d.ts +0 -22
- package/dist/orchestration/retry-loop.js +0 -24
- package/dist/orchestration/skill-candidate.d.ts +0 -52
- package/dist/orchestration/skill-candidate.js +0 -141
- package/dist/orchestration/skill-consolidation.d.ts +0 -123
- package/dist/orchestration/skill-consolidation.js +0 -220
- package/dist/orchestration/skill-improvement.d.ts +0 -59
- package/dist/orchestration/skill-improvement.js +0 -66
- package/dist/orchestration/skill-similarity.d.ts +0 -98
- package/dist/orchestration/skill-similarity.js +0 -131
- package/dist/orchestration/streaming-tool-executor.d.ts +0 -73
- package/dist/orchestration/streaming-tool-executor.js +0 -96
- package/dist/orchestration/team-orchestration.d.ts +0 -195
- package/dist/orchestration/team-orchestration.js +0 -369
- package/dist/orchestration/team-tool-loop-wiring.d.ts +0 -92
- package/dist/orchestration/team-tool-loop-wiring.js +0 -147
- package/dist/orchestration/tool-choice-policy.d.ts +0 -54
- package/dist/orchestration/tool-choice-policy.js +0 -164
- package/dist/orchestration/tool-loop-state.d.ts +0 -50
- package/dist/orchestration/tool-loop-state.js +0 -133
- package/dist/orchestration/tool-schema.d.ts +0 -39
- package/dist/orchestration/tool-schema.js +0 -297
- package/dist/orchestration/transcript-repair.d.ts +0 -42
- package/dist/orchestration/transcript-repair.js +0 -426
- package/dist/orchestration/turn-loop-guard.d.ts +0 -86
- package/dist/orchestration/turn-loop-guard.js +0 -92
- package/dist/orchestration/web-browser-policy.d.ts +0 -17
- package/dist/orchestration/web-browser-policy.js +0 -39
- package/dist/runtime/context-compression.d.ts +0 -61
- package/dist/runtime/context-compression.js +0 -274
- package/dist/runtime/hook-registry.d.ts +0 -12
- package/dist/runtime/hook-registry.js +0 -53
- package/dist/runtime/memory-hooks.d.ts +0 -23
- package/dist/runtime/memory-hooks.js +0 -65
- package/dist/runtime/tool-eligibility.d.ts +0 -59
- package/dist/runtime/tool-eligibility.js +0 -111
- package/dist/skills/index.d.ts +0 -108
- package/dist/skills/index.js +0 -82
- package/dist/skills/memory-extractor.d.ts +0 -64
- package/dist/skills/memory-extractor.js +0 -173
- package/dist/skills/memory-query-tool.d.ts +0 -43
- package/dist/skills/memory-query-tool.js +0 -127
- package/dist/skills/memory-store.d.ts +0 -66
- package/dist/skills/memory-store.js +0 -228
- package/dist/skills/memory-tool.d.ts +0 -67
- package/dist/skills/memory-tool.js +0 -192
- package/dist/skills/portable-tool.d.ts +0 -71
- package/dist/skills/portable-tool.js +0 -14
- package/dist/skills/qmemory-adapter.d.ts +0 -52
- package/dist/skills/qmemory-adapter.js +0 -165
- package/dist/skills/skill-frontmatter.d.ts +0 -19
- package/dist/skills/skill-frontmatter.js +0 -344
- package/dist/skills/skill-guard.d.ts +0 -23
- package/dist/skills/skill-guard.js +0 -229
- package/dist/skills/skill-loader.d.ts +0 -16
- package/dist/skills/skill-loader.js +0 -303
- package/dist/skills/skill-source.d.ts +0 -119
- package/dist/skills/skill-source.js +0 -126
- package/dist/skills/skill-types.d.ts +0 -199
- package/dist/skills/skill-types.js +0 -6
- package/dist/skills/think-tool.d.ts +0 -16
- package/dist/skills/think-tool.js +0 -59
- package/dist/skills/todo-tool.d.ts +0 -63
- package/dist/skills/todo-tool.js +0 -114
- package/dist/skills/tools/agent-tool.d.ts +0 -91
- package/dist/skills/tools/agent-tool.js +0 -142
- package/dist/skills/tools/apply-patch-tool.d.ts +0 -29
- package/dist/skills/tools/apply-patch-tool.js +0 -184
- package/dist/skills/tools/ask-user-tool.d.ts +0 -80
- package/dist/skills/tools/ask-user-tool.js +0 -121
- package/dist/skills/tools/brief-tool.d.ts +0 -74
- package/dist/skills/tools/brief-tool.js +0 -95
- package/dist/skills/tools/browser-tool.d.ts +0 -114
- package/dist/skills/tools/browser-tool.js +0 -155
- package/dist/skills/tools/checkpoint-tool.d.ts +0 -66
- package/dist/skills/tools/checkpoint-tool.js +0 -102
- package/dist/skills/tools/config-tool.d.ts +0 -63
- package/dist/skills/tools/config-tool.js +0 -143
- package/dist/skills/tools/cron-tool.d.ts +0 -116
- package/dist/skills/tools/cron-tool.js +0 -175
- package/dist/skills/tools/edit-tool.d.ts +0 -43
- package/dist/skills/tools/edit-tool.js +0 -70
- package/dist/skills/tools/exec-tool.d.ts +0 -102
- package/dist/skills/tools/exec-tool.js +0 -133
- package/dist/skills/tools/image-generate-tool.d.ts +0 -62
- package/dist/skills/tools/image-generate-tool.js +0 -67
- package/dist/skills/tools/instructions-tool.d.ts +0 -103
- package/dist/skills/tools/instructions-tool.js +0 -187
- package/dist/skills/tools/lsp-tool.d.ts +0 -153
- package/dist/skills/tools/lsp-tool.js +0 -227
- package/dist/skills/tools/mcp-client-types.d.ts +0 -269
- package/dist/skills/tools/mcp-client-types.js +0 -53
- package/dist/skills/tools/mcp-tool.d.ts +0 -249
- package/dist/skills/tools/mcp-tool.js +0 -503
- package/dist/skills/tools/memory-tool.d.ts +0 -74
- package/dist/skills/tools/memory-tool.js +0 -88
- package/dist/skills/tools/monitor-tool.d.ts +0 -113
- package/dist/skills/tools/monitor-tool.js +0 -131
- package/dist/skills/tools/music-generate-tool.d.ts +0 -55
- package/dist/skills/tools/music-generate-tool.js +0 -62
- package/dist/skills/tools/notify-tool.d.ts +0 -53
- package/dist/skills/tools/notify-tool.js +0 -62
- package/dist/skills/tools/patch-tool.d.ts +0 -45
- package/dist/skills/tools/patch-tool.js +0 -505
- package/dist/skills/tools/pdf-tool.d.ts +0 -66
- package/dist/skills/tools/pdf-tool.js +0 -88
- package/dist/skills/tools/plan-mode-tool.d.ts +0 -59
- package/dist/skills/tools/plan-mode-tool.js +0 -122
- package/dist/skills/tools/read-tool.d.ts +0 -51
- package/dist/skills/tools/read-tool.js +0 -84
- package/dist/skills/tools/repl-tool.d.ts +0 -70
- package/dist/skills/tools/repl-tool.js +0 -69
- package/dist/skills/tools/search-tool.d.ts +0 -112
- package/dist/skills/tools/search-tool.js +0 -225
- package/dist/skills/tools/send-message-tool.d.ts +0 -51
- package/dist/skills/tools/send-message-tool.js +0 -76
- package/dist/skills/tools/skill-list-tool.d.ts +0 -33
- package/dist/skills/tools/skill-list-tool.js +0 -54
- package/dist/skills/tools/skill-manage-tool.d.ts +0 -73
- package/dist/skills/tools/skill-manage-tool.js +0 -153
- package/dist/skills/tools/skill-view-tool.d.ts +0 -37
- package/dist/skills/tools/skill-view-tool.js +0 -72
- package/dist/skills/tools/sleep-tool.d.ts +0 -49
- package/dist/skills/tools/sleep-tool.js +0 -81
- package/dist/skills/tools/structured-output-tool.d.ts +0 -116
- package/dist/skills/tools/structured-output-tool.js +0 -176
- package/dist/skills/tools/task-tool.d.ts +0 -104
- package/dist/skills/tools/task-tool.js +0 -161
- package/dist/skills/tools/team-tool.d.ts +0 -89
- package/dist/skills/tools/team-tool.js +0 -105
- package/dist/skills/tools/tool-search-tool.d.ts +0 -51
- package/dist/skills/tools/tool-search-tool.js +0 -110
- package/dist/skills/tools/tts-tool.d.ts +0 -38
- package/dist/skills/tools/tts-tool.js +0 -45
- package/dist/skills/tools/video-edit-tool.d.ts +0 -69
- package/dist/skills/tools/video-edit-tool.js +0 -74
- package/dist/skills/tools/video-generate-tool.d.ts +0 -62
- package/dist/skills/tools/video-generate-tool.js +0 -66
- package/dist/skills/tools/video-merge-tool.d.ts +0 -105
- package/dist/skills/tools/video-merge-tool.js +0 -92
- package/dist/skills/tools/video-upscale-tool.d.ts +0 -45
- package/dist/skills/tools/video-upscale-tool.js +0 -52
- package/dist/skills/tools/web-fetch-tool.d.ts +0 -78
- package/dist/skills/tools/web-fetch-tool.js +0 -92
- package/dist/skills/tools/web-search-tool.d.ts +0 -57
- package/dist/skills/tools/web-search-tool.js +0 -86
- package/dist/skills/tools/worktree-tool.d.ts +0 -69
- package/dist/skills/tools/worktree-tool.js +0 -147
- package/dist/skills/tools/write-tool.d.ts +0 -45
- package/dist/skills/tools/write-tool.js +0 -81
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
// ============================================================
|
|
2
|
-
// Task Tool — background agent task management (CRUD + output).
|
|
3
|
-
// Reference: claude-code-haha/src/tools/TaskCreateTool/TaskCreateTool.ts
|
|
4
|
-
// claude-code-haha/src/tools/TaskGetTool/TaskGetTool.ts
|
|
5
|
-
// claude-code-haha/src/tools/TaskListTool/TaskListTool.ts
|
|
6
|
-
// claude-code-haha/src/tools/TaskOutputTool/TaskOutputTool.tsx
|
|
7
|
-
// claude-code-haha/src/tools/TaskStopTool/TaskStopTool.ts
|
|
8
|
-
// Category: system
|
|
9
|
-
// ============================================================
|
|
10
|
-
export const TASK_TOOL_NAME = "task";
|
|
11
|
-
export const TASK_TOOL_SCHEMA = {
|
|
12
|
-
type: "object",
|
|
13
|
-
properties: {
|
|
14
|
-
action: {
|
|
15
|
-
type: "string",
|
|
16
|
-
enum: ["create", "get", "list", "output", "stop"],
|
|
17
|
-
description: "Action to perform:\n" +
|
|
18
|
-
"- create: Spawn a new background agent task\n" +
|
|
19
|
-
"- get: Get task status and metadata by ID\n" +
|
|
20
|
-
"- list: List all tasks with their statuses\n" +
|
|
21
|
-
"- output: Get stdout/output from a running or completed task\n" +
|
|
22
|
-
"- stop: Terminate a running task",
|
|
23
|
-
},
|
|
24
|
-
taskId: {
|
|
25
|
-
type: "string",
|
|
26
|
-
description: "Task ID. Required for get/output/stop.",
|
|
27
|
-
},
|
|
28
|
-
prompt: {
|
|
29
|
-
type: "string",
|
|
30
|
-
description: "Detailed prompt for the background agent. Must contain all context needed " +
|
|
31
|
-
"to complete the task independently. Required for create.",
|
|
32
|
-
},
|
|
33
|
-
description: {
|
|
34
|
-
type: "string",
|
|
35
|
-
description: "Short (3-7 word) description of the task. Used for tracking and display.",
|
|
36
|
-
},
|
|
37
|
-
allowedTools: {
|
|
38
|
-
type: "array",
|
|
39
|
-
items: { type: "string" },
|
|
40
|
-
description: "Restrict background agent to only these tools. If omitted, inherits parent's tools.",
|
|
41
|
-
},
|
|
42
|
-
cwd: {
|
|
43
|
-
type: "string",
|
|
44
|
-
description: "Working directory for the background task (absolute path).",
|
|
45
|
-
},
|
|
46
|
-
model: {
|
|
47
|
-
type: "string",
|
|
48
|
-
description: "Model override for the task agent (e.g. 'sonnet', 'opus').",
|
|
49
|
-
},
|
|
50
|
-
maxLines: {
|
|
51
|
-
type: "number",
|
|
52
|
-
description: "Max output lines to return for the 'output' action (default: 100).",
|
|
53
|
-
minimum: 1,
|
|
54
|
-
maximum: 2000,
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
required: ["action"],
|
|
58
|
-
};
|
|
59
|
-
const DEFAULT_MAX_LINES = 100;
|
|
60
|
-
export function createTaskTool(deps) {
|
|
61
|
-
return {
|
|
62
|
-
name: TASK_TOOL_NAME,
|
|
63
|
-
label: "Task",
|
|
64
|
-
shouldDefer: true,
|
|
65
|
-
description: "Manage background agent tasks. Use this to spawn long-running tasks (image generation, " +
|
|
66
|
-
"code refactoring, research) that run independently while you continue working. " +
|
|
67
|
-
"Actions: create (spawn), get (status check), list (all tasks), output (logs), stop (terminate).",
|
|
68
|
-
parameters: TASK_TOOL_SCHEMA,
|
|
69
|
-
execute: async (_toolCallId, params) => {
|
|
70
|
-
switch (params.action) {
|
|
71
|
-
case "create": {
|
|
72
|
-
if (!params.prompt || params.prompt.trim().length < 10) {
|
|
73
|
-
return {
|
|
74
|
-
content: [{ type: "text", text: "Error: 'prompt' is required for create (min 10 chars)." }],
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
const task = await deps.createTask({
|
|
78
|
-
prompt: params.prompt.trim(),
|
|
79
|
-
description: params.description,
|
|
80
|
-
allowedTools: params.allowedTools,
|
|
81
|
-
cwd: params.cwd,
|
|
82
|
-
model: params.model,
|
|
83
|
-
});
|
|
84
|
-
return {
|
|
85
|
-
content: [{
|
|
86
|
-
type: "text",
|
|
87
|
-
text: [
|
|
88
|
-
`Task created successfully.`,
|
|
89
|
-
`ID: ${task.taskId}`,
|
|
90
|
-
`Status: ${task.status}`,
|
|
91
|
-
task.description ? `Description: ${task.description}` : "",
|
|
92
|
-
].filter(Boolean).join("\n"),
|
|
93
|
-
}],
|
|
94
|
-
details: { type: "task", action: "create", taskId: task.taskId, status: task.status },
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
case "get": {
|
|
98
|
-
if (!params.taskId) {
|
|
99
|
-
return { content: [{ type: "text", text: "Error: 'taskId' is required for get." }] };
|
|
100
|
-
}
|
|
101
|
-
const task = await deps.getTask(params.taskId);
|
|
102
|
-
if (!task) {
|
|
103
|
-
return { content: [{ type: "text", text: `Error: task "${params.taskId}" not found.` }] };
|
|
104
|
-
}
|
|
105
|
-
const lines = [
|
|
106
|
-
`Task: ${task.taskId}`,
|
|
107
|
-
`Status: ${task.status}`,
|
|
108
|
-
task.description ? `Description: ${task.description}` : "",
|
|
109
|
-
`Created: ${new Date(task.createdAt).toISOString()}`,
|
|
110
|
-
task.completedAt ? `Completed: ${new Date(task.completedAt).toISOString()}` : "",
|
|
111
|
-
task.result ? `Result: ${task.result.slice(0, 500)}` : "",
|
|
112
|
-
task.error ? `Error: ${task.error}` : "",
|
|
113
|
-
];
|
|
114
|
-
return {
|
|
115
|
-
content: [{ type: "text", text: lines.filter(Boolean).join("\n") }],
|
|
116
|
-
details: { type: "task", action: "get", task },
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
case "list": {
|
|
120
|
-
const tasks = await deps.listTasks();
|
|
121
|
-
if (tasks.length === 0) {
|
|
122
|
-
return { content: [{ type: "text", text: "No tasks found." }] };
|
|
123
|
-
}
|
|
124
|
-
const lines = tasks.map(t => {
|
|
125
|
-
const icon = t.status === "completed" ? "✅" :
|
|
126
|
-
t.status === "running" ? "🔄" :
|
|
127
|
-
t.status === "failed" ? "❌" :
|
|
128
|
-
t.status === "stopped" ? "⏹️" : "⏳";
|
|
129
|
-
return `${icon} [${t.taskId}] ${t.description || "(no description)"} — ${t.status}`;
|
|
130
|
-
});
|
|
131
|
-
return {
|
|
132
|
-
content: [{ type: "text", text: `Tasks (${tasks.length}):\n${lines.join("\n")}` }],
|
|
133
|
-
details: { type: "task", action: "list", count: tasks.length },
|
|
134
|
-
};
|
|
135
|
-
}
|
|
136
|
-
case "output": {
|
|
137
|
-
if (!params.taskId) {
|
|
138
|
-
return { content: [{ type: "text", text: "Error: 'taskId' is required for output." }] };
|
|
139
|
-
}
|
|
140
|
-
const output = await deps.getTaskOutput(params.taskId, params.maxLines ?? DEFAULT_MAX_LINES);
|
|
141
|
-
return {
|
|
142
|
-
content: [{ type: "text", text: output || "(no output yet)" }],
|
|
143
|
-
details: { type: "task", action: "output", taskId: params.taskId },
|
|
144
|
-
};
|
|
145
|
-
}
|
|
146
|
-
case "stop": {
|
|
147
|
-
if (!params.taskId) {
|
|
148
|
-
return { content: [{ type: "text", text: "Error: 'taskId' is required for stop." }] };
|
|
149
|
-
}
|
|
150
|
-
const stopped = await deps.stopTask(params.taskId);
|
|
151
|
-
return {
|
|
152
|
-
content: [{ type: "text", text: stopped ? `Task ${params.taskId} stopped.` : `Failed to stop task ${params.taskId} (may already be completed).` }],
|
|
153
|
-
details: { type: "task", action: "stop", taskId: params.taskId, stopped },
|
|
154
|
-
};
|
|
155
|
-
}
|
|
156
|
-
default:
|
|
157
|
-
return { content: [{ type: "text", text: `Error: unknown action "${params.action}". Use: create/get/list/output/stop.` }] };
|
|
158
|
-
}
|
|
159
|
-
},
|
|
160
|
-
};
|
|
161
|
-
}
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import type { PortableTool } from "../portable-tool.js";
|
|
2
|
-
export declare const TEAM_TOOL_NAME: "team";
|
|
3
|
-
export type TeamAction = "create" | "delete" | "list" | "status";
|
|
4
|
-
export interface TeamMember {
|
|
5
|
-
name: string;
|
|
6
|
-
role: string;
|
|
7
|
-
tools?: string[];
|
|
8
|
-
}
|
|
9
|
-
export interface TeamToolParams {
|
|
10
|
-
action: TeamAction;
|
|
11
|
-
/** Team name (required for create/delete) */
|
|
12
|
-
teamName?: string;
|
|
13
|
-
/** Team description */
|
|
14
|
-
description?: string;
|
|
15
|
-
/** Members to include (for create) */
|
|
16
|
-
members?: TeamMember[];
|
|
17
|
-
}
|
|
18
|
-
export declare const TEAM_TOOL_SCHEMA: {
|
|
19
|
-
readonly type: "object";
|
|
20
|
-
readonly properties: {
|
|
21
|
-
readonly action: {
|
|
22
|
-
readonly type: "string";
|
|
23
|
-
readonly enum: readonly ["create", "delete", "list", "status"];
|
|
24
|
-
readonly description: "Team action: create (new team), delete (disband), list (all teams), status (team details).";
|
|
25
|
-
};
|
|
26
|
-
readonly teamName: {
|
|
27
|
-
readonly type: "string";
|
|
28
|
-
readonly description: "Team name. Required for create/delete/status.";
|
|
29
|
-
};
|
|
30
|
-
readonly description: {
|
|
31
|
-
readonly type: "string";
|
|
32
|
-
readonly description: "Team description/objective. Used for create.";
|
|
33
|
-
};
|
|
34
|
-
readonly members: {
|
|
35
|
-
readonly type: "array";
|
|
36
|
-
readonly description: "Team members with roles and tool restrictions.";
|
|
37
|
-
readonly items: {
|
|
38
|
-
readonly type: "object";
|
|
39
|
-
readonly properties: {
|
|
40
|
-
readonly name: {
|
|
41
|
-
readonly type: "string";
|
|
42
|
-
readonly description: "Agent name/role identifier.";
|
|
43
|
-
};
|
|
44
|
-
readonly role: {
|
|
45
|
-
readonly type: "string";
|
|
46
|
-
readonly description: "Role description (e.g. 'frontend developer').";
|
|
47
|
-
};
|
|
48
|
-
readonly tools: {
|
|
49
|
-
readonly type: "array";
|
|
50
|
-
readonly items: {
|
|
51
|
-
readonly type: "string";
|
|
52
|
-
};
|
|
53
|
-
readonly description: "Allowed tools for this member.";
|
|
54
|
-
};
|
|
55
|
-
};
|
|
56
|
-
readonly required: readonly ["name", "role"];
|
|
57
|
-
};
|
|
58
|
-
};
|
|
59
|
-
};
|
|
60
|
-
readonly required: readonly ["action"];
|
|
61
|
-
};
|
|
62
|
-
export interface Team {
|
|
63
|
-
name: string;
|
|
64
|
-
description?: string;
|
|
65
|
-
leadId: string;
|
|
66
|
-
members: TeamMember[];
|
|
67
|
-
createdAt: string;
|
|
68
|
-
}
|
|
69
|
-
export interface TeamResult {
|
|
70
|
-
success: boolean;
|
|
71
|
-
team?: Team;
|
|
72
|
-
teams?: Team[];
|
|
73
|
-
error?: string;
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Host-provided team management backend.
|
|
77
|
-
* Creates agent teams where members coordinate via send_message.
|
|
78
|
-
*/
|
|
79
|
-
export interface TeamToolDeps {
|
|
80
|
-
createTeam(params: {
|
|
81
|
-
teamName: string;
|
|
82
|
-
description?: string;
|
|
83
|
-
members?: TeamMember[];
|
|
84
|
-
}): Promise<TeamResult>;
|
|
85
|
-
deleteTeam(teamName: string): Promise<TeamResult>;
|
|
86
|
-
listTeams(): Promise<TeamResult>;
|
|
87
|
-
getTeamStatus(teamName: string): Promise<TeamResult>;
|
|
88
|
-
}
|
|
89
|
-
export declare function createTeamTool(deps: TeamToolDeps): PortableTool<TeamToolParams>;
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
// ============================================================
|
|
2
|
-
// Team Tool — create and manage multi-agent teams (Swarm).
|
|
3
|
-
// Reference: claude-code-haha/src/tools/TeamCreateTool/TeamCreateTool.ts
|
|
4
|
-
// claude-code-haha/src/tools/TeamDeleteTool/TeamDeleteTool.ts
|
|
5
|
-
// Category: system
|
|
6
|
-
// ============================================================
|
|
7
|
-
export const TEAM_TOOL_NAME = "team";
|
|
8
|
-
export const TEAM_TOOL_SCHEMA = {
|
|
9
|
-
type: "object",
|
|
10
|
-
properties: {
|
|
11
|
-
action: {
|
|
12
|
-
type: "string",
|
|
13
|
-
enum: ["create", "delete", "list", "status"],
|
|
14
|
-
description: "Team action: create (new team), delete (disband), list (all teams), status (team details).",
|
|
15
|
-
},
|
|
16
|
-
teamName: {
|
|
17
|
-
type: "string",
|
|
18
|
-
description: "Team name. Required for create/delete/status.",
|
|
19
|
-
},
|
|
20
|
-
description: {
|
|
21
|
-
type: "string",
|
|
22
|
-
description: "Team description/objective. Used for create.",
|
|
23
|
-
},
|
|
24
|
-
members: {
|
|
25
|
-
type: "array",
|
|
26
|
-
description: "Team members with roles and tool restrictions.",
|
|
27
|
-
items: {
|
|
28
|
-
type: "object",
|
|
29
|
-
properties: {
|
|
30
|
-
name: { type: "string", description: "Agent name/role identifier." },
|
|
31
|
-
role: { type: "string", description: "Role description (e.g. 'frontend developer')." },
|
|
32
|
-
tools: { type: "array", items: { type: "string" }, description: "Allowed tools for this member." },
|
|
33
|
-
},
|
|
34
|
-
required: ["name", "role"],
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
required: ["action"],
|
|
39
|
-
};
|
|
40
|
-
export function createTeamTool(deps) {
|
|
41
|
-
return {
|
|
42
|
-
name: TEAM_TOOL_NAME,
|
|
43
|
-
label: "Team",
|
|
44
|
-
description: "Manage multi-agent teams. Create teams of specialized agents that collaborate via send_message. " +
|
|
45
|
-
"Each member has a role and optional tool restrictions. Use for complex tasks requiring parallel work.",
|
|
46
|
-
parameters: TEAM_TOOL_SCHEMA,
|
|
47
|
-
execute: async (_toolCallId, params) => {
|
|
48
|
-
switch (params.action) {
|
|
49
|
-
case "create": {
|
|
50
|
-
if (!params.teamName) {
|
|
51
|
-
return { content: [{ type: "text", text: "Error: teamName required for create." }], details: { type: "team", error: "missing_name" } };
|
|
52
|
-
}
|
|
53
|
-
const r = await deps.createTeam({ teamName: params.teamName, description: params.description, members: params.members });
|
|
54
|
-
if (!r.success) {
|
|
55
|
-
return { content: [{ type: "text", text: `Error: ${r.error}` }], details: { type: "team", error: r.error } };
|
|
56
|
-
}
|
|
57
|
-
const lines = [`Team "${r.team.name}" created.`, `Lead: ${r.team.leadId}`, `Members: ${r.team.members.length}`];
|
|
58
|
-
for (const m of r.team.members) {
|
|
59
|
-
lines.push(` - ${m.name} (${m.role})`);
|
|
60
|
-
}
|
|
61
|
-
return { content: [{ type: "text", text: lines.join("\n") }], details: { type: "team", action: "create", teamName: r.team.name } };
|
|
62
|
-
}
|
|
63
|
-
case "delete": {
|
|
64
|
-
if (!params.teamName) {
|
|
65
|
-
return { content: [{ type: "text", text: "Error: teamName required for delete." }], details: { type: "team", error: "missing_name" } };
|
|
66
|
-
}
|
|
67
|
-
const r = await deps.deleteTeam(params.teamName);
|
|
68
|
-
if (!r.success) {
|
|
69
|
-
return { content: [{ type: "text", text: `Error: ${r.error}` }], details: { type: "team", error: r.error } };
|
|
70
|
-
}
|
|
71
|
-
return { content: [{ type: "text", text: `Team "${params.teamName}" disbanded.` }], details: { type: "team", action: "delete", teamName: params.teamName } };
|
|
72
|
-
}
|
|
73
|
-
case "list": {
|
|
74
|
-
const r = await deps.listTeams();
|
|
75
|
-
if (!r.teams || r.teams.length === 0) {
|
|
76
|
-
return { content: [{ type: "text", text: "No active teams." }], details: { type: "team", action: "list", count: 0 } };
|
|
77
|
-
}
|
|
78
|
-
const lines = [`Active teams (${r.teams.length}):`, ""];
|
|
79
|
-
for (const t of r.teams) {
|
|
80
|
-
lines.push(`- **${t.name}**: ${t.description || "(no description)"} — ${t.members.length} members`);
|
|
81
|
-
}
|
|
82
|
-
return { content: [{ type: "text", text: lines.join("\n") }], details: { type: "team", action: "list", count: r.teams.length } };
|
|
83
|
-
}
|
|
84
|
-
case "status": {
|
|
85
|
-
if (!params.teamName) {
|
|
86
|
-
return { content: [{ type: "text", text: "Error: teamName required for status." }], details: { type: "team", error: "missing_name" } };
|
|
87
|
-
}
|
|
88
|
-
const r = await deps.getTeamStatus(params.teamName);
|
|
89
|
-
if (!r.success) {
|
|
90
|
-
return { content: [{ type: "text", text: `Error: ${r.error}` }], details: { type: "team", error: r.error } };
|
|
91
|
-
}
|
|
92
|
-
const t = r.team;
|
|
93
|
-
const lines = [`Team: ${t.name}`, `Description: ${t.description || "—"}`, `Lead: ${t.leadId}`, `Created: ${t.createdAt}`, "", `Members (${t.members.length}):`];
|
|
94
|
-
for (const m of t.members) {
|
|
95
|
-
const tools = m.tools ? ` [tools: ${m.tools.join(", ")}]` : "";
|
|
96
|
-
lines.push(` - ${m.name} (${m.role})${tools}`);
|
|
97
|
-
}
|
|
98
|
-
return { content: [{ type: "text", text: lines.join("\n") }], details: { type: "team", action: "status", teamName: t.name } };
|
|
99
|
-
}
|
|
100
|
-
default:
|
|
101
|
-
return { content: [{ type: "text", text: `Error: unknown action "${params.action}".` }], details: { type: "team", error: "unknown_action" } };
|
|
102
|
-
}
|
|
103
|
-
},
|
|
104
|
-
};
|
|
105
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import type { PortableTool } from "../portable-tool.js";
|
|
2
|
-
export declare const TOOL_SEARCH_TOOL_NAME: "tool_search";
|
|
3
|
-
export interface ToolSearchToolParams {
|
|
4
|
-
query: string;
|
|
5
|
-
maxResults?: number;
|
|
6
|
-
}
|
|
7
|
-
export declare const TOOL_SEARCH_TOOL_SCHEMA: {
|
|
8
|
-
readonly type: "object";
|
|
9
|
-
readonly properties: {
|
|
10
|
-
readonly query: {
|
|
11
|
-
readonly type: "string";
|
|
12
|
-
readonly description: string;
|
|
13
|
-
};
|
|
14
|
-
readonly maxResults: {
|
|
15
|
-
readonly type: "number";
|
|
16
|
-
readonly description: "Maximum number of results to return (default: 5).";
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
readonly required: readonly ["query"];
|
|
20
|
-
};
|
|
21
|
-
export interface DeferredToolInfo {
|
|
22
|
-
name: string;
|
|
23
|
-
description: string;
|
|
24
|
-
/** Optional search hint for better discovery */
|
|
25
|
-
searchHint?: string;
|
|
26
|
-
}
|
|
27
|
-
export interface ToolSearchOutput {
|
|
28
|
-
matches: DeferredToolInfo[];
|
|
29
|
-
query: string;
|
|
30
|
-
totalDeferred: number;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Host-provided deferred tool registry.
|
|
34
|
-
* The host manages which tools are loaded vs deferred,
|
|
35
|
-
* and handles activation when selected.
|
|
36
|
-
*/
|
|
37
|
-
export interface ToolSearchToolDeps {
|
|
38
|
-
/**
|
|
39
|
-
* Search deferred tools by query.
|
|
40
|
-
* Supports "select:name" for direct activation and keyword search.
|
|
41
|
-
*/
|
|
42
|
-
searchTools(query: string, options?: {
|
|
43
|
-
maxResults?: number;
|
|
44
|
-
}): Promise<ToolSearchOutput>;
|
|
45
|
-
/**
|
|
46
|
-
* Activate a deferred tool so it appears in subsequent turns.
|
|
47
|
-
* Returns true if activation succeeded.
|
|
48
|
-
*/
|
|
49
|
-
activateTool?(name: string): Promise<boolean>;
|
|
50
|
-
}
|
|
51
|
-
export declare function createToolSearchTool(deps: ToolSearchToolDeps): PortableTool<ToolSearchToolParams>;
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
// ============================================================
|
|
2
|
-
// Tool Search Tool — discover deferred/hidden tools by keyword.
|
|
3
|
-
// Reference: claude-code-haha/src/tools/ToolSearchTool/ToolSearchTool.ts
|
|
4
|
-
// Category: system
|
|
5
|
-
// ============================================================
|
|
6
|
-
export const TOOL_SEARCH_TOOL_NAME = "tool_search";
|
|
7
|
-
export const TOOL_SEARCH_TOOL_SCHEMA = {
|
|
8
|
-
type: "object",
|
|
9
|
-
properties: {
|
|
10
|
-
query: {
|
|
11
|
-
type: "string",
|
|
12
|
-
description: 'Search query for tools. Use "select:toolName" to directly activate a deferred tool, ' +
|
|
13
|
-
"or provide keywords to search tool names/descriptions. " +
|
|
14
|
-
'Prefix a term with "+" to mark it as required (all +terms must match).',
|
|
15
|
-
},
|
|
16
|
-
maxResults: {
|
|
17
|
-
type: "number",
|
|
18
|
-
description: "Maximum number of results to return (default: 5).",
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
required: ["query"],
|
|
22
|
-
};
|
|
23
|
-
const DEFAULT_MAX_RESULTS = 5;
|
|
24
|
-
export function createToolSearchTool(deps) {
|
|
25
|
-
return {
|
|
26
|
-
name: TOOL_SEARCH_TOOL_NAME,
|
|
27
|
-
label: "Tool Search",
|
|
28
|
-
description: "Search for available tools that are not currently loaded. " +
|
|
29
|
-
"Many tools are deferred to save context tokens. " +
|
|
30
|
-
'Use "select:toolName" to directly activate a tool, ' +
|
|
31
|
-
"or provide keywords to find relevant tools. " +
|
|
32
|
-
"Activated tools become available in subsequent messages.",
|
|
33
|
-
parameters: TOOL_SEARCH_TOOL_SCHEMA,
|
|
34
|
-
execute: async (_toolCallId, params) => {
|
|
35
|
-
if (!params.query || params.query.trim().length === 0) {
|
|
36
|
-
return {
|
|
37
|
-
content: [{ type: "text", text: "Error: query is required." }],
|
|
38
|
-
details: { type: "tool_search", error: "empty_query" },
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
const query = params.query.trim();
|
|
42
|
-
const maxResults = params.maxResults ?? DEFAULT_MAX_RESULTS;
|
|
43
|
-
// Handle direct selection: "select:toolName" or "select:A,B,C"
|
|
44
|
-
if (query.startsWith("select:")) {
|
|
45
|
-
const names = query.slice(7).split(",").map((n) => n.trim()).filter(Boolean);
|
|
46
|
-
const activated = [];
|
|
47
|
-
const notFound = [];
|
|
48
|
-
if (deps.activateTool) {
|
|
49
|
-
for (const name of names) {
|
|
50
|
-
const ok = await deps.activateTool(name);
|
|
51
|
-
if (ok)
|
|
52
|
-
activated.push(name);
|
|
53
|
-
else
|
|
54
|
-
notFound.push(name);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
else {
|
|
58
|
-
// No activation support — just search
|
|
59
|
-
const result = await deps.searchTools(query, { maxResults });
|
|
60
|
-
return formatSearchResult(result);
|
|
61
|
-
}
|
|
62
|
-
const parts = [];
|
|
63
|
-
if (activated.length > 0) {
|
|
64
|
-
parts.push(`Activated: ${activated.join(", ")}. These tools are now available.`);
|
|
65
|
-
}
|
|
66
|
-
if (notFound.length > 0) {
|
|
67
|
-
parts.push(`Not found: ${notFound.join(", ")}.`);
|
|
68
|
-
}
|
|
69
|
-
return {
|
|
70
|
-
content: [{ type: "text", text: parts.join("\n") }],
|
|
71
|
-
details: { type: "tool_search", activated, notFound, mode: "select" },
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
// Keyword search
|
|
75
|
-
const result = await deps.searchTools(query, { maxResults });
|
|
76
|
-
return formatSearchResult(result);
|
|
77
|
-
},
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
function formatSearchResult(result) {
|
|
81
|
-
if (result.matches.length === 0) {
|
|
82
|
-
return {
|
|
83
|
-
content: [{
|
|
84
|
-
type: "text",
|
|
85
|
-
text: `No tools found matching "${result.query}". ` +
|
|
86
|
-
`Total deferred tools available: ${result.totalDeferred}.`,
|
|
87
|
-
}],
|
|
88
|
-
details: { type: "tool_search", query: result.query, matchCount: 0, totalDeferred: result.totalDeferred },
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
const lines = [
|
|
92
|
-
`Found ${result.matches.length} tool(s) matching "${result.query}" (${result.totalDeferred} total deferred):`,
|
|
93
|
-
"",
|
|
94
|
-
];
|
|
95
|
-
for (const tool of result.matches) {
|
|
96
|
-
lines.push(`- **${tool.name}**: ${tool.description}`);
|
|
97
|
-
}
|
|
98
|
-
lines.push("");
|
|
99
|
-
lines.push('Use "select:toolName" to activate a tool for use in subsequent messages.');
|
|
100
|
-
return {
|
|
101
|
-
content: [{ type: "text", text: lines.join("\n") }],
|
|
102
|
-
details: {
|
|
103
|
-
type: "tool_search",
|
|
104
|
-
query: result.query,
|
|
105
|
-
matchCount: result.matches.length,
|
|
106
|
-
totalDeferred: result.totalDeferred,
|
|
107
|
-
matches: result.matches.map((m) => m.name),
|
|
108
|
-
},
|
|
109
|
-
};
|
|
110
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import type { PortableTool } from "../portable-tool.js";
|
|
2
|
-
export declare const TTS_TOOL_NAME: "tts";
|
|
3
|
-
export interface TtsToolParams {
|
|
4
|
-
text: string;
|
|
5
|
-
channel?: string;
|
|
6
|
-
}
|
|
7
|
-
export declare const TTS_TOOL_SCHEMA: {
|
|
8
|
-
readonly type: "object";
|
|
9
|
-
readonly properties: {
|
|
10
|
-
readonly text: {
|
|
11
|
-
readonly type: "string";
|
|
12
|
-
readonly description: "Text to convert to speech.";
|
|
13
|
-
};
|
|
14
|
-
readonly channel: {
|
|
15
|
-
readonly type: "string";
|
|
16
|
-
readonly description: "Optional channel id to pick output format (e.g. telegram).";
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
readonly required: readonly ["text"];
|
|
20
|
-
};
|
|
21
|
-
export interface TtsResult {
|
|
22
|
-
audioPath: string;
|
|
23
|
-
provider?: string;
|
|
24
|
-
voiceCompatible?: boolean;
|
|
25
|
-
mediaUrls: string[];
|
|
26
|
-
}
|
|
27
|
-
/** Deps injected by the host runtime for TTS. */
|
|
28
|
-
export interface TtsToolDeps {
|
|
29
|
-
/**
|
|
30
|
-
* Convert text to speech via the configured backend.
|
|
31
|
-
* The host handles voice selection, format conversion, and storage.
|
|
32
|
-
*/
|
|
33
|
-
textToSpeech(params: {
|
|
34
|
-
text: string;
|
|
35
|
-
channel?: string;
|
|
36
|
-
}): Promise<TtsResult>;
|
|
37
|
-
}
|
|
38
|
-
export declare function createTtsTool(deps: TtsToolDeps): PortableTool<TtsToolParams>;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
// ============================================================
|
|
2
|
-
// TTS Tool — text-to-speech via backend adapter.
|
|
3
|
-
// Category: media
|
|
4
|
-
// ============================================================
|
|
5
|
-
export const TTS_TOOL_NAME = "tts";
|
|
6
|
-
export const TTS_TOOL_SCHEMA = {
|
|
7
|
-
type: "object",
|
|
8
|
-
properties: {
|
|
9
|
-
text: {
|
|
10
|
-
type: "string",
|
|
11
|
-
description: "Text to convert to speech.",
|
|
12
|
-
},
|
|
13
|
-
channel: {
|
|
14
|
-
type: "string",
|
|
15
|
-
description: "Optional channel id to pick output format (e.g. telegram).",
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
required: ["text"],
|
|
19
|
-
};
|
|
20
|
-
export function createTtsTool(deps) {
|
|
21
|
-
return {
|
|
22
|
-
name: TTS_TOOL_NAME,
|
|
23
|
-
label: "TTS",
|
|
24
|
-
description: "Convert text to speech (TTS) — read text aloud as spoken audio. " +
|
|
25
|
-
"Use for narration, voice messages, or any spoken-word output. " +
|
|
26
|
-
"DO NOT use for music, songs, or melodies — use music_generate instead.",
|
|
27
|
-
parameters: TTS_TOOL_SCHEMA,
|
|
28
|
-
execute: async (_toolCallId, params) => {
|
|
29
|
-
const result = await deps.textToSpeech({
|
|
30
|
-
text: params.text,
|
|
31
|
-
channel: params.channel,
|
|
32
|
-
});
|
|
33
|
-
return {
|
|
34
|
-
content: [{ type: "text", text: "已成功生成语音。" }],
|
|
35
|
-
details: {
|
|
36
|
-
type: "tts",
|
|
37
|
-
audioPath: result.audioPath,
|
|
38
|
-
provider: result.provider,
|
|
39
|
-
voiceCompatible: result.voiceCompatible,
|
|
40
|
-
mediaUrls: result.mediaUrls,
|
|
41
|
-
},
|
|
42
|
-
};
|
|
43
|
-
},
|
|
44
|
-
};
|
|
45
|
-
}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import type { PortableTool } from "../portable-tool.js";
|
|
2
|
-
export declare const VIDEO_EDIT_TOOL_NAME: "video_edit";
|
|
3
|
-
export interface VideoEditToolParams {
|
|
4
|
-
prompt: string;
|
|
5
|
-
source_videos: string[];
|
|
6
|
-
reference_images?: string[];
|
|
7
|
-
duration?: number;
|
|
8
|
-
aspect_ratio?: string;
|
|
9
|
-
resolution?: string;
|
|
10
|
-
}
|
|
11
|
-
export declare const VIDEO_EDIT_TOOL_SCHEMA: {
|
|
12
|
-
readonly type: "object";
|
|
13
|
-
readonly properties: {
|
|
14
|
-
readonly prompt: {
|
|
15
|
-
readonly type: "string";
|
|
16
|
-
readonly description: string;
|
|
17
|
-
};
|
|
18
|
-
readonly source_videos: {
|
|
19
|
-
readonly type: "array";
|
|
20
|
-
readonly items: {
|
|
21
|
-
readonly type: "string";
|
|
22
|
-
};
|
|
23
|
-
readonly minItems: 1;
|
|
24
|
-
readonly maxItems: 3;
|
|
25
|
-
readonly description: "Video(s) to edit (1-3 URLs). Order: [0]=视频1, [1]=视频2, [2]=视频3.";
|
|
26
|
-
};
|
|
27
|
-
readonly reference_images: {
|
|
28
|
-
readonly type: "array";
|
|
29
|
-
readonly items: {
|
|
30
|
-
readonly type: "string";
|
|
31
|
-
};
|
|
32
|
-
readonly description: "Optional reference images for element replacement (up to 9).";
|
|
33
|
-
};
|
|
34
|
-
readonly duration: {
|
|
35
|
-
readonly type: "number";
|
|
36
|
-
readonly description: "Output duration in seconds (4-15s). Default: same as source.";
|
|
37
|
-
};
|
|
38
|
-
readonly aspect_ratio: {
|
|
39
|
-
readonly type: "string";
|
|
40
|
-
readonly description: "Output aspect ratio: 16:9, 9:16, 1:1, 4:3, 3:4, 21:9. Default: same as source.";
|
|
41
|
-
};
|
|
42
|
-
readonly resolution: {
|
|
43
|
-
readonly type: "string";
|
|
44
|
-
readonly description: "Output resolution: '480p' or '720p'. Default: '720p'.";
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
readonly required: readonly ["prompt", "source_videos"];
|
|
48
|
-
};
|
|
49
|
-
export interface VideoEditResult {
|
|
50
|
-
mediaUrls: string[];
|
|
51
|
-
model?: string;
|
|
52
|
-
durationMs?: number;
|
|
53
|
-
}
|
|
54
|
-
/** Deps injected by the host runtime for video editing. */
|
|
55
|
-
export interface VideoEditToolDeps {
|
|
56
|
-
/**
|
|
57
|
-
* Edit a video via the configured backend (Seedance 2.0, etc.).
|
|
58
|
-
* The host handles URL resolution, model routing, and storage.
|
|
59
|
-
*/
|
|
60
|
-
editVideo(params: {
|
|
61
|
-
prompt: string;
|
|
62
|
-
sourceVideos: string[];
|
|
63
|
-
referenceImages?: string[];
|
|
64
|
-
duration?: number;
|
|
65
|
-
aspectRatio?: string;
|
|
66
|
-
resolution?: string;
|
|
67
|
-
}): Promise<VideoEditResult>;
|
|
68
|
-
}
|
|
69
|
-
export declare function createVideoEditTool(deps: VideoEditToolDeps): PortableTool<VideoEditToolParams>;
|