qlogicagent 0.2.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent.js +1 -0
- package/dist/cli.js +9 -0
- package/dist/contracts.js +1 -0
- package/dist/index.js +5 -15
- package/dist/orchestration.js +118 -0
- package/package.json +56 -42
- package/dist/agent/agent.js +0 -113
- package/dist/agent/tool-loop.js +0 -575
- package/dist/agent/types.js +0 -14
- package/dist/cli/main.js +0 -23
- package/dist/cli/stdio-server.js +0 -463
- package/dist/config/config.js +0 -21
- package/dist/contracts/hooks.js +0 -7
- package/dist/contracts/index.js +0 -10
- package/dist/contracts/planner.js +0 -2
- package/dist/contracts/skill-candidate.js +0 -195
- package/dist/contracts/todo.js +0 -9
- package/dist/llm/builtin-providers.js +0 -531
- package/dist/llm/index.js +0 -14
- package/dist/llm/llm-client.js +0 -67
- package/dist/llm/model-catalog.js +0 -191
- package/dist/llm/provider-def.js +0 -12
- package/dist/llm/provider-registry.js +0 -147
- package/dist/llm/transport.js +0 -27
- package/dist/llm/transports/anthropic-messages.js +0 -293
- package/dist/llm/transports/openai-chat.js +0 -165
- package/dist/orchestration/agent-registry.js +0 -116
- package/dist/orchestration/approval-aware-tool-plan.js +0 -87
- package/dist/orchestration/context-compression.js +0 -583
- package/dist/orchestration/conversation-repair.js +0 -429
- package/dist/orchestration/curator-scheduler.js +0 -135
- package/dist/orchestration/embedded-failover-policy.js +0 -168
- package/dist/orchestration/error-classification.js +0 -77
- package/dist/orchestration/failover-classification.js +0 -381
- package/dist/orchestration/failover-error.js +0 -198
- package/dist/orchestration/fork-subagent.js +0 -98
- package/dist/orchestration/index.js +0 -267
- package/dist/orchestration/memory-flush-policy.js +0 -85
- package/dist/orchestration/memory-provider.js +0 -2
- package/dist/orchestration/parallel-tool-calls.js +0 -59
- package/dist/orchestration/prompt-cache-strategy.js +0 -228
- package/dist/orchestration/reactive-compact.js +0 -78
- package/dist/orchestration/retry-loop.js +0 -24
- package/dist/orchestration/skill-candidate.js +0 -141
- package/dist/orchestration/skill-consolidation.js +0 -220
- package/dist/orchestration/skill-improvement.js +0 -66
- package/dist/orchestration/skill-similarity.js +0 -131
- package/dist/orchestration/streaming-tool-executor.js +0 -96
- package/dist/orchestration/team-orchestration.js +0 -369
- package/dist/orchestration/team-tool-loop-wiring.js +0 -147
- package/dist/orchestration/tool-choice-policy.js +0 -164
- package/dist/orchestration/tool-loop-state.js +0 -133
- package/dist/orchestration/tool-schema.js +0 -297
- package/dist/orchestration/transcript-repair.js +0 -426
- package/dist/orchestration/turn-loop-guard.js +0 -92
- package/dist/orchestration/web-browser-policy.js +0 -39
- package/dist/runtime/context-compression.js +0 -274
- package/dist/runtime/hook-registry.js +0 -53
- package/dist/runtime/memory-hooks.js +0 -65
- package/dist/runtime/tool-eligibility.js +0 -111
- package/dist/skills/index.js +0 -82
- package/dist/skills/memory-extractor.js +0 -173
- package/dist/skills/memory-query-tool.js +0 -127
- package/dist/skills/memory-store.js +0 -228
- package/dist/skills/memory-tool.js +0 -192
- package/dist/skills/portable-tool.js +0 -14
- package/dist/skills/qmemory-adapter.js +0 -165
- package/dist/skills/skill-frontmatter.js +0 -344
- package/dist/skills/skill-guard.js +0 -229
- package/dist/skills/skill-loader.js +0 -303
- package/dist/skills/skill-source.js +0 -126
- package/dist/skills/skill-types.js +0 -6
- package/dist/skills/think-tool.js +0 -59
- package/dist/skills/todo-tool.js +0 -114
- package/dist/skills/tools/agent-tool.js +0 -142
- package/dist/skills/tools/apply-patch-tool.js +0 -184
- package/dist/skills/tools/ask-user-tool.js +0 -121
- package/dist/skills/tools/brief-tool.js +0 -95
- package/dist/skills/tools/browser-tool.js +0 -155
- package/dist/skills/tools/checkpoint-tool.js +0 -102
- package/dist/skills/tools/config-tool.js +0 -143
- package/dist/skills/tools/cron-tool.js +0 -175
- package/dist/skills/tools/edit-tool.js +0 -70
- package/dist/skills/tools/exec-tool.js +0 -133
- package/dist/skills/tools/image-generate-tool.js +0 -67
- package/dist/skills/tools/instructions-tool.js +0 -187
- package/dist/skills/tools/lsp-tool.js +0 -227
- package/dist/skills/tools/mcp-client-types.js +0 -53
- package/dist/skills/tools/mcp-tool.js +0 -503
- package/dist/skills/tools/memory-tool.js +0 -88
- package/dist/skills/tools/monitor-tool.js +0 -131
- package/dist/skills/tools/music-generate-tool.js +0 -62
- package/dist/skills/tools/notify-tool.js +0 -62
- package/dist/skills/tools/patch-tool.js +0 -505
- package/dist/skills/tools/pdf-tool.js +0 -88
- package/dist/skills/tools/plan-mode-tool.js +0 -122
- package/dist/skills/tools/read-tool.js +0 -84
- package/dist/skills/tools/repl-tool.js +0 -69
- package/dist/skills/tools/search-tool.js +0 -225
- package/dist/skills/tools/send-message-tool.js +0 -76
- package/dist/skills/tools/skill-list-tool.js +0 -54
- package/dist/skills/tools/skill-manage-tool.js +0 -153
- package/dist/skills/tools/skill-view-tool.js +0 -72
- package/dist/skills/tools/sleep-tool.js +0 -81
- package/dist/skills/tools/structured-output-tool.js +0 -176
- package/dist/skills/tools/task-tool.js +0 -161
- package/dist/skills/tools/team-tool.js +0 -105
- package/dist/skills/tools/tool-search-tool.js +0 -110
- package/dist/skills/tools/tts-tool.js +0 -45
- package/dist/skills/tools/video-edit-tool.js +0 -74
- package/dist/skills/tools/video-generate-tool.js +0 -66
- package/dist/skills/tools/video-merge-tool.js +0 -92
- package/dist/skills/tools/video-upscale-tool.js +0 -52
- package/dist/skills/tools/web-fetch-tool.js +0 -92
- package/dist/skills/tools/web-search-tool.js +0 -86
- package/dist/skills/tools/worktree-tool.js +0 -147
- package/dist/skills/tools/write-tool.js +0 -81
- /package/dist/{agent → types/agent}/agent.d.ts +0 -0
- /package/dist/{agent → types/agent}/tool-loop.d.ts +0 -0
- /package/dist/{agent → types/agent}/types.d.ts +0 -0
- /package/dist/{cli → types/cli}/main.d.ts +0 -0
- /package/dist/{cli → types/cli}/stdio-server.d.ts +0 -0
- /package/dist/{config → types/config}/config.d.ts +0 -0
- /package/dist/{contracts → types/contracts}/hooks.d.ts +0 -0
- /package/dist/{contracts → types/contracts}/index.d.ts +0 -0
- /package/dist/{contracts → types/contracts}/planner.d.ts +0 -0
- /package/dist/{contracts → types/contracts}/skill-candidate.d.ts +0 -0
- /package/dist/{contracts → types/contracts}/todo.d.ts +0 -0
- /package/dist/{index.d.ts → types/index.d.ts} +0 -0
- /package/dist/{llm → types/llm}/builtin-providers.d.ts +0 -0
- /package/dist/{llm → types/llm}/index.d.ts +0 -0
- /package/dist/{llm → types/llm}/llm-client.d.ts +0 -0
- /package/dist/{llm → types/llm}/model-catalog.d.ts +0 -0
- /package/dist/{llm → types/llm}/provider-def.d.ts +0 -0
- /package/dist/{llm → types/llm}/provider-registry.d.ts +0 -0
- /package/dist/{llm → types/llm}/transport.d.ts +0 -0
- /package/dist/{llm → types/llm}/transports/anthropic-messages.d.ts +0 -0
- /package/dist/{llm → types/llm}/transports/openai-chat.d.ts +0 -0
- /package/dist/{orchestration → types/orchestration}/agent-registry.d.ts +0 -0
- /package/dist/{orchestration → types/orchestration}/approval-aware-tool-plan.d.ts +0 -0
- /package/dist/{orchestration → types/orchestration}/context-compression.d.ts +0 -0
- /package/dist/{orchestration → types/orchestration}/conversation-repair.d.ts +0 -0
- /package/dist/{orchestration → types/orchestration}/curator-scheduler.d.ts +0 -0
- /package/dist/{orchestration → types/orchestration}/embedded-failover-policy.d.ts +0 -0
- /package/dist/{orchestration → types/orchestration}/error-classification.d.ts +0 -0
- /package/dist/{orchestration → types/orchestration}/failover-classification.d.ts +0 -0
- /package/dist/{orchestration → types/orchestration}/failover-error.d.ts +0 -0
- /package/dist/{orchestration → types/orchestration}/fork-subagent.d.ts +0 -0
- /package/dist/{orchestration → types/orchestration}/index.d.ts +0 -0
- /package/dist/{orchestration → types/orchestration}/memory-flush-policy.d.ts +0 -0
- /package/dist/{orchestration → types/orchestration}/memory-provider.d.ts +0 -0
- /package/dist/{orchestration → types/orchestration}/parallel-tool-calls.d.ts +0 -0
- /package/dist/{orchestration → types/orchestration}/prompt-cache-strategy.d.ts +0 -0
- /package/dist/{orchestration → types/orchestration}/reactive-compact.d.ts +0 -0
- /package/dist/{orchestration → types/orchestration}/retry-loop.d.ts +0 -0
- /package/dist/{orchestration → types/orchestration}/skill-candidate.d.ts +0 -0
- /package/dist/{orchestration → types/orchestration}/skill-consolidation.d.ts +0 -0
- /package/dist/{orchestration → types/orchestration}/skill-improvement.d.ts +0 -0
- /package/dist/{orchestration → types/orchestration}/skill-similarity.d.ts +0 -0
- /package/dist/{orchestration → types/orchestration}/streaming-tool-executor.d.ts +0 -0
- /package/dist/{orchestration → types/orchestration}/team-orchestration.d.ts +0 -0
- /package/dist/{orchestration → types/orchestration}/team-tool-loop-wiring.d.ts +0 -0
- /package/dist/{orchestration → types/orchestration}/tool-choice-policy.d.ts +0 -0
- /package/dist/{orchestration → types/orchestration}/tool-loop-state.d.ts +0 -0
- /package/dist/{orchestration → types/orchestration}/tool-schema.d.ts +0 -0
- /package/dist/{orchestration → types/orchestration}/transcript-repair.d.ts +0 -0
- /package/dist/{orchestration → types/orchestration}/turn-loop-guard.d.ts +0 -0
- /package/dist/{orchestration → types/orchestration}/web-browser-policy.d.ts +0 -0
- /package/dist/{runtime → types/runtime}/context-compression.d.ts +0 -0
- /package/dist/{runtime → types/runtime}/hook-registry.d.ts +0 -0
- /package/dist/{runtime → types/runtime}/memory-hooks.d.ts +0 -0
- /package/dist/{runtime → types/runtime}/tool-eligibility.d.ts +0 -0
- /package/dist/{skills → types/skills}/index.d.ts +0 -0
- /package/dist/{skills → types/skills}/memory-extractor.d.ts +0 -0
- /package/dist/{skills → types/skills}/memory-query-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/memory-store.d.ts +0 -0
- /package/dist/{skills → types/skills}/memory-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/portable-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/qmemory-adapter.d.ts +0 -0
- /package/dist/{skills → types/skills}/skill-frontmatter.d.ts +0 -0
- /package/dist/{skills → types/skills}/skill-guard.d.ts +0 -0
- /package/dist/{skills → types/skills}/skill-loader.d.ts +0 -0
- /package/dist/{skills → types/skills}/skill-source.d.ts +0 -0
- /package/dist/{skills → types/skills}/skill-types.d.ts +0 -0
- /package/dist/{skills → types/skills}/think-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/todo-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/agent-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/apply-patch-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/ask-user-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/brief-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/browser-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/checkpoint-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/config-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/cron-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/edit-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/exec-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/image-generate-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/instructions-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/lsp-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/mcp-client-types.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/mcp-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/memory-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/monitor-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/music-generate-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/notify-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/patch-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/pdf-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/plan-mode-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/read-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/repl-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/search-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/send-message-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/skill-list-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/skill-manage-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/skill-view-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/sleep-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/structured-output-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/task-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/team-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/tool-search-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/tts-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/video-edit-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/video-generate-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/video-merge-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/video-upscale-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/web-fetch-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/web-search-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/worktree-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/write-tool.d.ts +0 -0
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
// ============================================================
|
|
2
|
-
// Monitor Tool — event-driven wake-up / watch mechanism.
|
|
3
|
-
// Reference: CC proactive mode MonitorTool (feature-gated)
|
|
4
|
-
// Category: autonomous / proactive mode
|
|
5
|
-
// ============================================================
|
|
6
|
-
export const MONITOR_TOOL_NAME = "monitor";
|
|
7
|
-
export const MONITOR_TOOL_SCHEMA = {
|
|
8
|
-
type: "object",
|
|
9
|
-
properties: {
|
|
10
|
-
action: {
|
|
11
|
-
type: "string",
|
|
12
|
-
enum: ["start", "stop", "list"],
|
|
13
|
-
description: "Action to perform: start a new monitor, stop an existing one, or list active monitors.",
|
|
14
|
-
},
|
|
15
|
-
monitorId: {
|
|
16
|
-
type: "string",
|
|
17
|
-
description: "Identifier for the monitor instance. Required for start/stop.",
|
|
18
|
-
},
|
|
19
|
-
source: {
|
|
20
|
-
type: "string",
|
|
21
|
-
enum: ["process", "file", "task", "custom"],
|
|
22
|
-
description: "Type of event source to watch.",
|
|
23
|
-
},
|
|
24
|
-
target: {
|
|
25
|
-
type: "string",
|
|
26
|
-
description: "Selector for the monitored target. For process: PID or background job id. " +
|
|
27
|
-
"For file: glob pattern. For task: task ID. For custom: host-defined key.",
|
|
28
|
-
},
|
|
29
|
-
conditions: {
|
|
30
|
-
type: "array",
|
|
31
|
-
items: {
|
|
32
|
-
type: "object",
|
|
33
|
-
properties: {
|
|
34
|
-
type: {
|
|
35
|
-
type: "string",
|
|
36
|
-
enum: ["exit", "output_match", "file_changed", "task_status"],
|
|
37
|
-
},
|
|
38
|
-
value: { type: "string" },
|
|
39
|
-
},
|
|
40
|
-
required: ["type"],
|
|
41
|
-
},
|
|
42
|
-
description: "Conditions that trigger a wake-up notification.",
|
|
43
|
-
},
|
|
44
|
-
timeoutSeconds: {
|
|
45
|
-
type: "number",
|
|
46
|
-
description: "Auto-stop after this many seconds (default: 3600).",
|
|
47
|
-
minimum: 1,
|
|
48
|
-
maximum: 86400,
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
required: ["action"],
|
|
52
|
-
};
|
|
53
|
-
export function createMonitorTool(deps) {
|
|
54
|
-
return {
|
|
55
|
-
name: MONITOR_TOOL_NAME,
|
|
56
|
-
label: "Monitor",
|
|
57
|
-
shouldDefer: true,
|
|
58
|
-
description: [
|
|
59
|
-
"Set up event-driven monitoring to wake up when something happens.",
|
|
60
|
-
"",
|
|
61
|
-
"Use this to watch for:",
|
|
62
|
-
"• Background process completion or specific output patterns",
|
|
63
|
-
"• File system changes (new file, modification)",
|
|
64
|
-
"• Async task state transitions (pending → completed/failed)",
|
|
65
|
-
"• Custom host-defined events",
|
|
66
|
-
"",
|
|
67
|
-
"When a monitored condition triggers, you'll receive a notification in your next tick.",
|
|
68
|
-
"This is more efficient than polling with Sleep — you only wake up when there's work to do.",
|
|
69
|
-
"",
|
|
70
|
-
"Actions:",
|
|
71
|
-
"• start — register a new monitor (requires monitorId, source, target)",
|
|
72
|
-
"• stop — deregister an active monitor",
|
|
73
|
-
"• list — show all active monitors and their event counts",
|
|
74
|
-
].join("\n"),
|
|
75
|
-
parameters: MONITOR_TOOL_SCHEMA,
|
|
76
|
-
execute: async (_toolCallId, params) => {
|
|
77
|
-
const { action } = params;
|
|
78
|
-
if (action === "list") {
|
|
79
|
-
const monitors = await deps.listMonitors();
|
|
80
|
-
if (monitors.length === 0) {
|
|
81
|
-
return {
|
|
82
|
-
content: [{ type: "text", text: "No active monitors." }],
|
|
83
|
-
details: { action, monitors: [] },
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
const lines = monitors.map((m) => `• ${m.monitorId} [${m.source}] → ${m.target} (events: ${m.eventCount}, timeout: ${m.timeoutSeconds}s)`);
|
|
87
|
-
return {
|
|
88
|
-
content: [{ type: "text", text: `Active monitors:\n${lines.join("\n")}` }],
|
|
89
|
-
details: { action, monitors },
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
if (!params.monitorId) {
|
|
93
|
-
return {
|
|
94
|
-
content: [{ type: "text", text: "Error: monitorId is required for start/stop." }],
|
|
95
|
-
details: { action, success: false, error: "missing_monitor_id" },
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
if (action === "stop") {
|
|
99
|
-
const result = await deps.stopMonitor(params.monitorId);
|
|
100
|
-
const text = result.success
|
|
101
|
-
? `Monitor "${params.monitorId}" stopped.`
|
|
102
|
-
: `Failed to stop monitor "${params.monitorId}": ${result.error ?? "not found"}`;
|
|
103
|
-
return {
|
|
104
|
-
content: [{ type: "text", text }],
|
|
105
|
-
details: { ...result },
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
|
-
// action === "start"
|
|
109
|
-
if (!params.source || !params.target) {
|
|
110
|
-
return {
|
|
111
|
-
content: [{ type: "text", text: "Error: source and target are required to start a monitor." }],
|
|
112
|
-
details: { action, success: false, error: "missing_source_or_target" },
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
const result = await deps.startMonitor({
|
|
116
|
-
monitorId: params.monitorId,
|
|
117
|
-
source: params.source,
|
|
118
|
-
target: params.target,
|
|
119
|
-
conditions: params.conditions ?? [],
|
|
120
|
-
timeoutSeconds: params.timeoutSeconds ?? 3600,
|
|
121
|
-
});
|
|
122
|
-
const text = result.success
|
|
123
|
-
? `Monitor "${params.monitorId}" started: watching ${params.source} "${params.target}".`
|
|
124
|
-
: `Failed to start monitor: ${result.error ?? "unknown"}`;
|
|
125
|
-
return {
|
|
126
|
-
content: [{ type: "text", text }],
|
|
127
|
-
details: { ...result },
|
|
128
|
-
};
|
|
129
|
-
},
|
|
130
|
-
};
|
|
131
|
-
}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
// ============================================================
|
|
2
|
-
// Music Generate Tool — text-to-music via backend adapter.
|
|
3
|
-
// Category: media
|
|
4
|
-
// ============================================================
|
|
5
|
-
export const MUSIC_GENERATE_TOOL_NAME = "music_generate";
|
|
6
|
-
export const MUSIC_GENERATE_TOOL_SCHEMA = {
|
|
7
|
-
type: "object",
|
|
8
|
-
properties: {
|
|
9
|
-
prompt: {
|
|
10
|
-
type: "string",
|
|
11
|
-
description: "Music generation prompt. MUST be in English. " +
|
|
12
|
-
"Include genre, mood, tempo, instruments, and atmosphere details.",
|
|
13
|
-
},
|
|
14
|
-
purpose: {
|
|
15
|
-
type: "string",
|
|
16
|
-
description: "Intended use: 'background-music', 'ringtone', 'short-video-bgm', 'full-song', 'notification-sound', etc.",
|
|
17
|
-
},
|
|
18
|
-
style: {
|
|
19
|
-
type: "string",
|
|
20
|
-
description: "Musical style/genre: 'lo-fi', 'pop', 'rock', 'jazz', 'classical', 'electronic', 'ambient', etc.",
|
|
21
|
-
},
|
|
22
|
-
lyrics: {
|
|
23
|
-
type: "string",
|
|
24
|
-
description: "Optional lyrics for vocal music. Structure with [verse], [chorus], [bridge] tags if desired.",
|
|
25
|
-
},
|
|
26
|
-
duration: {
|
|
27
|
-
type: "number",
|
|
28
|
-
description: "Duration in seconds (5-300). Infer from purpose: ringtone 15-30s, BGM 30-60s, full song 120-180s.",
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
required: ["prompt"],
|
|
32
|
-
};
|
|
33
|
-
export function createMusicGenerateTool(deps) {
|
|
34
|
-
return {
|
|
35
|
-
name: MUSIC_GENERATE_TOOL_NAME,
|
|
36
|
-
label: "Music Generate",
|
|
37
|
-
description: "Generate music, songs, or melodies from text descriptions. " +
|
|
38
|
-
"Prompt MUST be in English. Supports lyrics for vocal songs. " +
|
|
39
|
-
"DO NOT use for spoken-word audio or TTS — use tts tool instead.",
|
|
40
|
-
parameters: MUSIC_GENERATE_TOOL_SCHEMA,
|
|
41
|
-
execute: async (_toolCallId, params) => {
|
|
42
|
-
const result = await deps.generateMusic({
|
|
43
|
-
prompt: params.prompt,
|
|
44
|
-
purpose: params.purpose,
|
|
45
|
-
style: params.style,
|
|
46
|
-
lyrics: params.lyrics,
|
|
47
|
-
duration: params.duration,
|
|
48
|
-
});
|
|
49
|
-
const count = result.mediaUrls.length;
|
|
50
|
-
const text = `Generated ${count} audio track${count > 1 ? "s" : ""}${result.model ? ` (model: ${result.model})` : ""}`;
|
|
51
|
-
return {
|
|
52
|
-
content: [{ type: "text", text }],
|
|
53
|
-
details: {
|
|
54
|
-
type: "music_generate",
|
|
55
|
-
model: result.model,
|
|
56
|
-
durationMs: result.durationMs,
|
|
57
|
-
mediaUrls: result.mediaUrls,
|
|
58
|
-
},
|
|
59
|
-
};
|
|
60
|
-
},
|
|
61
|
-
};
|
|
62
|
-
}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
// ============================================================
|
|
2
|
-
// Notify Tool — push notifications to user across platforms.
|
|
3
|
-
// Reference: hermes-agent-main/tools/send_message_tool.py
|
|
4
|
-
// Category: interaction
|
|
5
|
-
// ============================================================
|
|
6
|
-
export const NOTIFY_TOOL_NAME = "notify";
|
|
7
|
-
export const NOTIFY_TOOL_SCHEMA = {
|
|
8
|
-
type: "object",
|
|
9
|
-
properties: {
|
|
10
|
-
message: {
|
|
11
|
-
type: "string",
|
|
12
|
-
description: "Notification content to send to the user.",
|
|
13
|
-
},
|
|
14
|
-
title: {
|
|
15
|
-
type: "string",
|
|
16
|
-
description: "Optional notification title/subject line.",
|
|
17
|
-
},
|
|
18
|
-
priority: {
|
|
19
|
-
type: "string",
|
|
20
|
-
enum: ["low", "normal", "high"],
|
|
21
|
-
description: "Notification priority (default: normal). High may trigger sound/vibration.",
|
|
22
|
-
},
|
|
23
|
-
channel: {
|
|
24
|
-
type: "string",
|
|
25
|
-
description: "Target delivery channel (e.g. 'wechat', 'feishu', 'discord'). Default: user's primary.",
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
required: ["message"],
|
|
29
|
-
};
|
|
30
|
-
export function createNotifyTool(deps) {
|
|
31
|
-
return {
|
|
32
|
-
name: NOTIFY_TOOL_NAME,
|
|
33
|
-
label: "Notify",
|
|
34
|
-
description: "Send a notification to the user. Used for alerting about completed long-running tasks, " +
|
|
35
|
-
"important updates, or requesting attention. Supports multiple channels (WeChat, Feishu, Discord, etc).",
|
|
36
|
-
parameters: NOTIFY_TOOL_SCHEMA,
|
|
37
|
-
execute: async (_toolCallId, params) => {
|
|
38
|
-
if (!params.message || params.message.trim().length === 0) {
|
|
39
|
-
return {
|
|
40
|
-
content: [{ type: "text", text: "Error: message is required." }],
|
|
41
|
-
details: { type: "notify", error: "empty_message" },
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
const result = await deps.sendNotification({
|
|
45
|
-
message: params.message.trim(),
|
|
46
|
-
title: params.title,
|
|
47
|
-
priority: params.priority || "normal",
|
|
48
|
-
channel: params.channel,
|
|
49
|
-
});
|
|
50
|
-
if (!result.delivered) {
|
|
51
|
-
return {
|
|
52
|
-
content: [{ type: "text", text: `Notification failed: ${result.error || "delivery error"}` }],
|
|
53
|
-
details: { type: "notify", delivered: false, error: result.error },
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
return {
|
|
57
|
-
content: [{ type: "text", text: `Notification sent via ${result.channel}.` }],
|
|
58
|
-
details: { type: "notify", delivered: true, channel: result.channel },
|
|
59
|
-
};
|
|
60
|
-
},
|
|
61
|
-
};
|
|
62
|
-
}
|