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.
Files changed (226) hide show
  1. package/README.md +45 -45
  2. package/package.json +56 -42
  3. package/dist/agent/agent.d.ts +0 -43
  4. package/dist/agent/agent.js +0 -113
  5. package/dist/agent/tool-loop.d.ts +0 -64
  6. package/dist/agent/tool-loop.js +0 -575
  7. package/dist/agent/types.d.ts +0 -175
  8. package/dist/agent/types.js +0 -14
  9. package/dist/cli/main.d.ts +0 -11
  10. package/dist/cli/main.js +0 -23
  11. package/dist/cli/stdio-server.d.ts +0 -45
  12. package/dist/cli/stdio-server.js +0 -463
  13. package/dist/config/config.d.ts +0 -17
  14. package/dist/config/config.js +0 -21
  15. package/dist/contracts/hooks.d.ts +0 -120
  16. package/dist/contracts/hooks.js +0 -7
  17. package/dist/contracts/index.d.ts +0 -10
  18. package/dist/contracts/index.js +0 -10
  19. package/dist/contracts/planner.d.ts +0 -35
  20. package/dist/contracts/planner.js +0 -2
  21. package/dist/contracts/skill-candidate.d.ts +0 -63
  22. package/dist/contracts/skill-candidate.js +0 -195
  23. package/dist/contracts/todo.d.ts +0 -14
  24. package/dist/contracts/todo.js +0 -9
  25. package/dist/index.d.ts +0 -13
  26. package/dist/index.js +0 -15
  27. package/dist/llm/builtin-providers.d.ts +0 -10
  28. package/dist/llm/builtin-providers.js +0 -531
  29. package/dist/llm/index.d.ts +0 -15
  30. package/dist/llm/index.js +0 -14
  31. package/dist/llm/llm-client.d.ts +0 -43
  32. package/dist/llm/llm-client.js +0 -67
  33. package/dist/llm/model-catalog.d.ts +0 -53
  34. package/dist/llm/model-catalog.js +0 -191
  35. package/dist/llm/provider-def.d.ts +0 -59
  36. package/dist/llm/provider-def.js +0 -12
  37. package/dist/llm/provider-registry.d.ts +0 -54
  38. package/dist/llm/provider-registry.js +0 -147
  39. package/dist/llm/transport.d.ts +0 -62
  40. package/dist/llm/transport.js +0 -27
  41. package/dist/llm/transports/anthropic-messages.d.ts +0 -31
  42. package/dist/llm/transports/anthropic-messages.js +0 -293
  43. package/dist/llm/transports/openai-chat.d.ts +0 -36
  44. package/dist/llm/transports/openai-chat.js +0 -165
  45. package/dist/orchestration/agent-registry.d.ts +0 -41
  46. package/dist/orchestration/agent-registry.js +0 -116
  47. package/dist/orchestration/approval-aware-tool-plan.d.ts +0 -32
  48. package/dist/orchestration/approval-aware-tool-plan.js +0 -87
  49. package/dist/orchestration/context-compression.d.ts +0 -220
  50. package/dist/orchestration/context-compression.js +0 -583
  51. package/dist/orchestration/conversation-repair.d.ts +0 -61
  52. package/dist/orchestration/conversation-repair.js +0 -429
  53. package/dist/orchestration/curator-scheduler.d.ts +0 -119
  54. package/dist/orchestration/curator-scheduler.js +0 -135
  55. package/dist/orchestration/embedded-failover-policy.d.ts +0 -110
  56. package/dist/orchestration/embedded-failover-policy.js +0 -168
  57. package/dist/orchestration/error-classification.d.ts +0 -12
  58. package/dist/orchestration/error-classification.js +0 -77
  59. package/dist/orchestration/failover-classification.d.ts +0 -8
  60. package/dist/orchestration/failover-classification.js +0 -381
  61. package/dist/orchestration/failover-error.d.ts +0 -33
  62. package/dist/orchestration/failover-error.js +0 -198
  63. package/dist/orchestration/fork-subagent.d.ts +0 -100
  64. package/dist/orchestration/fork-subagent.js +0 -98
  65. package/dist/orchestration/index.d.ts +0 -120
  66. package/dist/orchestration/index.js +0 -267
  67. package/dist/orchestration/memory-flush-policy.d.ts +0 -57
  68. package/dist/orchestration/memory-flush-policy.js +0 -85
  69. package/dist/orchestration/memory-provider.d.ts +0 -14
  70. package/dist/orchestration/memory-provider.js +0 -2
  71. package/dist/orchestration/parallel-tool-calls.d.ts +0 -41
  72. package/dist/orchestration/parallel-tool-calls.js +0 -59
  73. package/dist/orchestration/prompt-cache-strategy.d.ts +0 -126
  74. package/dist/orchestration/prompt-cache-strategy.js +0 -228
  75. package/dist/orchestration/reactive-compact.d.ts +0 -73
  76. package/dist/orchestration/reactive-compact.js +0 -78
  77. package/dist/orchestration/retry-loop.d.ts +0 -22
  78. package/dist/orchestration/retry-loop.js +0 -24
  79. package/dist/orchestration/skill-candidate.d.ts +0 -52
  80. package/dist/orchestration/skill-candidate.js +0 -141
  81. package/dist/orchestration/skill-consolidation.d.ts +0 -123
  82. package/dist/orchestration/skill-consolidation.js +0 -220
  83. package/dist/orchestration/skill-improvement.d.ts +0 -59
  84. package/dist/orchestration/skill-improvement.js +0 -66
  85. package/dist/orchestration/skill-similarity.d.ts +0 -98
  86. package/dist/orchestration/skill-similarity.js +0 -131
  87. package/dist/orchestration/streaming-tool-executor.d.ts +0 -73
  88. package/dist/orchestration/streaming-tool-executor.js +0 -96
  89. package/dist/orchestration/team-orchestration.d.ts +0 -195
  90. package/dist/orchestration/team-orchestration.js +0 -369
  91. package/dist/orchestration/team-tool-loop-wiring.d.ts +0 -92
  92. package/dist/orchestration/team-tool-loop-wiring.js +0 -147
  93. package/dist/orchestration/tool-choice-policy.d.ts +0 -54
  94. package/dist/orchestration/tool-choice-policy.js +0 -164
  95. package/dist/orchestration/tool-loop-state.d.ts +0 -50
  96. package/dist/orchestration/tool-loop-state.js +0 -133
  97. package/dist/orchestration/tool-schema.d.ts +0 -39
  98. package/dist/orchestration/tool-schema.js +0 -297
  99. package/dist/orchestration/transcript-repair.d.ts +0 -42
  100. package/dist/orchestration/transcript-repair.js +0 -426
  101. package/dist/orchestration/turn-loop-guard.d.ts +0 -86
  102. package/dist/orchestration/turn-loop-guard.js +0 -92
  103. package/dist/orchestration/web-browser-policy.d.ts +0 -17
  104. package/dist/orchestration/web-browser-policy.js +0 -39
  105. package/dist/runtime/context-compression.d.ts +0 -61
  106. package/dist/runtime/context-compression.js +0 -274
  107. package/dist/runtime/hook-registry.d.ts +0 -12
  108. package/dist/runtime/hook-registry.js +0 -53
  109. package/dist/runtime/memory-hooks.d.ts +0 -23
  110. package/dist/runtime/memory-hooks.js +0 -65
  111. package/dist/runtime/tool-eligibility.d.ts +0 -59
  112. package/dist/runtime/tool-eligibility.js +0 -111
  113. package/dist/skills/index.d.ts +0 -108
  114. package/dist/skills/index.js +0 -82
  115. package/dist/skills/memory-extractor.d.ts +0 -64
  116. package/dist/skills/memory-extractor.js +0 -173
  117. package/dist/skills/memory-query-tool.d.ts +0 -43
  118. package/dist/skills/memory-query-tool.js +0 -127
  119. package/dist/skills/memory-store.d.ts +0 -66
  120. package/dist/skills/memory-store.js +0 -228
  121. package/dist/skills/memory-tool.d.ts +0 -67
  122. package/dist/skills/memory-tool.js +0 -192
  123. package/dist/skills/portable-tool.d.ts +0 -71
  124. package/dist/skills/portable-tool.js +0 -14
  125. package/dist/skills/qmemory-adapter.d.ts +0 -52
  126. package/dist/skills/qmemory-adapter.js +0 -165
  127. package/dist/skills/skill-frontmatter.d.ts +0 -19
  128. package/dist/skills/skill-frontmatter.js +0 -344
  129. package/dist/skills/skill-guard.d.ts +0 -23
  130. package/dist/skills/skill-guard.js +0 -229
  131. package/dist/skills/skill-loader.d.ts +0 -16
  132. package/dist/skills/skill-loader.js +0 -303
  133. package/dist/skills/skill-source.d.ts +0 -119
  134. package/dist/skills/skill-source.js +0 -126
  135. package/dist/skills/skill-types.d.ts +0 -199
  136. package/dist/skills/skill-types.js +0 -6
  137. package/dist/skills/think-tool.d.ts +0 -16
  138. package/dist/skills/think-tool.js +0 -59
  139. package/dist/skills/todo-tool.d.ts +0 -63
  140. package/dist/skills/todo-tool.js +0 -114
  141. package/dist/skills/tools/agent-tool.d.ts +0 -91
  142. package/dist/skills/tools/agent-tool.js +0 -142
  143. package/dist/skills/tools/apply-patch-tool.d.ts +0 -29
  144. package/dist/skills/tools/apply-patch-tool.js +0 -184
  145. package/dist/skills/tools/ask-user-tool.d.ts +0 -80
  146. package/dist/skills/tools/ask-user-tool.js +0 -121
  147. package/dist/skills/tools/brief-tool.d.ts +0 -74
  148. package/dist/skills/tools/brief-tool.js +0 -95
  149. package/dist/skills/tools/browser-tool.d.ts +0 -114
  150. package/dist/skills/tools/browser-tool.js +0 -155
  151. package/dist/skills/tools/checkpoint-tool.d.ts +0 -66
  152. package/dist/skills/tools/checkpoint-tool.js +0 -102
  153. package/dist/skills/tools/config-tool.d.ts +0 -63
  154. package/dist/skills/tools/config-tool.js +0 -143
  155. package/dist/skills/tools/cron-tool.d.ts +0 -116
  156. package/dist/skills/tools/cron-tool.js +0 -175
  157. package/dist/skills/tools/edit-tool.d.ts +0 -43
  158. package/dist/skills/tools/edit-tool.js +0 -70
  159. package/dist/skills/tools/exec-tool.d.ts +0 -102
  160. package/dist/skills/tools/exec-tool.js +0 -133
  161. package/dist/skills/tools/image-generate-tool.d.ts +0 -62
  162. package/dist/skills/tools/image-generate-tool.js +0 -67
  163. package/dist/skills/tools/instructions-tool.d.ts +0 -103
  164. package/dist/skills/tools/instructions-tool.js +0 -187
  165. package/dist/skills/tools/lsp-tool.d.ts +0 -153
  166. package/dist/skills/tools/lsp-tool.js +0 -227
  167. package/dist/skills/tools/mcp-client-types.d.ts +0 -269
  168. package/dist/skills/tools/mcp-client-types.js +0 -53
  169. package/dist/skills/tools/mcp-tool.d.ts +0 -249
  170. package/dist/skills/tools/mcp-tool.js +0 -503
  171. package/dist/skills/tools/memory-tool.d.ts +0 -74
  172. package/dist/skills/tools/memory-tool.js +0 -88
  173. package/dist/skills/tools/monitor-tool.d.ts +0 -113
  174. package/dist/skills/tools/monitor-tool.js +0 -131
  175. package/dist/skills/tools/music-generate-tool.d.ts +0 -55
  176. package/dist/skills/tools/music-generate-tool.js +0 -62
  177. package/dist/skills/tools/notify-tool.d.ts +0 -53
  178. package/dist/skills/tools/notify-tool.js +0 -62
  179. package/dist/skills/tools/patch-tool.d.ts +0 -45
  180. package/dist/skills/tools/patch-tool.js +0 -505
  181. package/dist/skills/tools/pdf-tool.d.ts +0 -66
  182. package/dist/skills/tools/pdf-tool.js +0 -88
  183. package/dist/skills/tools/plan-mode-tool.d.ts +0 -59
  184. package/dist/skills/tools/plan-mode-tool.js +0 -122
  185. package/dist/skills/tools/read-tool.d.ts +0 -51
  186. package/dist/skills/tools/read-tool.js +0 -84
  187. package/dist/skills/tools/repl-tool.d.ts +0 -70
  188. package/dist/skills/tools/repl-tool.js +0 -69
  189. package/dist/skills/tools/search-tool.d.ts +0 -112
  190. package/dist/skills/tools/search-tool.js +0 -225
  191. package/dist/skills/tools/send-message-tool.d.ts +0 -51
  192. package/dist/skills/tools/send-message-tool.js +0 -76
  193. package/dist/skills/tools/skill-list-tool.d.ts +0 -33
  194. package/dist/skills/tools/skill-list-tool.js +0 -54
  195. package/dist/skills/tools/skill-manage-tool.d.ts +0 -73
  196. package/dist/skills/tools/skill-manage-tool.js +0 -153
  197. package/dist/skills/tools/skill-view-tool.d.ts +0 -37
  198. package/dist/skills/tools/skill-view-tool.js +0 -72
  199. package/dist/skills/tools/sleep-tool.d.ts +0 -49
  200. package/dist/skills/tools/sleep-tool.js +0 -81
  201. package/dist/skills/tools/structured-output-tool.d.ts +0 -116
  202. package/dist/skills/tools/structured-output-tool.js +0 -176
  203. package/dist/skills/tools/task-tool.d.ts +0 -104
  204. package/dist/skills/tools/task-tool.js +0 -161
  205. package/dist/skills/tools/team-tool.d.ts +0 -89
  206. package/dist/skills/tools/team-tool.js +0 -105
  207. package/dist/skills/tools/tool-search-tool.d.ts +0 -51
  208. package/dist/skills/tools/tool-search-tool.js +0 -110
  209. package/dist/skills/tools/tts-tool.d.ts +0 -38
  210. package/dist/skills/tools/tts-tool.js +0 -45
  211. package/dist/skills/tools/video-edit-tool.d.ts +0 -69
  212. package/dist/skills/tools/video-edit-tool.js +0 -74
  213. package/dist/skills/tools/video-generate-tool.d.ts +0 -62
  214. package/dist/skills/tools/video-generate-tool.js +0 -66
  215. package/dist/skills/tools/video-merge-tool.d.ts +0 -105
  216. package/dist/skills/tools/video-merge-tool.js +0 -92
  217. package/dist/skills/tools/video-upscale-tool.d.ts +0 -45
  218. package/dist/skills/tools/video-upscale-tool.js +0 -52
  219. package/dist/skills/tools/web-fetch-tool.d.ts +0 -78
  220. package/dist/skills/tools/web-fetch-tool.js +0 -92
  221. package/dist/skills/tools/web-search-tool.d.ts +0 -57
  222. package/dist/skills/tools/web-search-tool.js +0 -86
  223. package/dist/skills/tools/worktree-tool.d.ts +0 -69
  224. package/dist/skills/tools/worktree-tool.js +0 -147
  225. package/dist/skills/tools/write-tool.d.ts +0 -45
  226. package/dist/skills/tools/write-tool.js +0 -81
@@ -1,113 +0,0 @@
1
- import type { PortableTool } from "../portable-tool.js";
2
- export declare const MONITOR_TOOL_NAME: "monitor";
3
- /** The kind of event source the agent can monitor. */
4
- export type MonitorSource = "process" | "file" | "task" | "custom";
5
- export type MonitorAction = "start" | "stop" | "list";
6
- export interface MonitorToolParams {
7
- action: MonitorAction;
8
- /** Required for start/stop — identifies the monitor instance. */
9
- monitorId?: string;
10
- /** Required for start — what kind of event source to watch. */
11
- source?: MonitorSource;
12
- /** Required for start — selector for the target (pid, path, taskId, custom key). */
13
- target?: string;
14
- /** Optional for start — conditions that should trigger wake-up. */
15
- conditions?: MonitorCondition[];
16
- /** Optional for start — max time to monitor in seconds before auto-stop. */
17
- timeoutSeconds?: number;
18
- }
19
- export interface MonitorCondition {
20
- /** What to check: exit code, stdout pattern, file modification, task status. */
21
- type: "exit" | "output_match" | "file_changed" | "task_status";
22
- /** Pattern or value to match (regex for output_match, status name for task_status). */
23
- value?: string;
24
- }
25
- export declare const MONITOR_TOOL_SCHEMA: {
26
- readonly type: "object";
27
- readonly properties: {
28
- readonly action: {
29
- readonly type: "string";
30
- readonly enum: readonly ["start", "stop", "list"];
31
- readonly description: "Action to perform: start a new monitor, stop an existing one, or list active monitors.";
32
- };
33
- readonly monitorId: {
34
- readonly type: "string";
35
- readonly description: "Identifier for the monitor instance. Required for start/stop.";
36
- };
37
- readonly source: {
38
- readonly type: "string";
39
- readonly enum: readonly ["process", "file", "task", "custom"];
40
- readonly description: "Type of event source to watch.";
41
- };
42
- readonly target: {
43
- readonly type: "string";
44
- readonly description: string;
45
- };
46
- readonly conditions: {
47
- readonly type: "array";
48
- readonly items: {
49
- readonly type: "object";
50
- readonly properties: {
51
- readonly type: {
52
- readonly type: "string";
53
- readonly enum: readonly ["exit", "output_match", "file_changed", "task_status"];
54
- };
55
- readonly value: {
56
- readonly type: "string";
57
- };
58
- };
59
- readonly required: readonly ["type"];
60
- };
61
- readonly description: "Conditions that trigger a wake-up notification.";
62
- };
63
- readonly timeoutSeconds: {
64
- readonly type: "number";
65
- readonly description: "Auto-stop after this many seconds (default: 3600).";
66
- readonly minimum: 1;
67
- readonly maximum: 86400;
68
- };
69
- };
70
- readonly required: readonly ["action"];
71
- };
72
- /** Info about an active monitor. */
73
- export interface MonitorInfo {
74
- monitorId: string;
75
- source: MonitorSource;
76
- target: string;
77
- conditions: MonitorCondition[];
78
- startedAt: number;
79
- timeoutSeconds: number;
80
- /** Events received so far. */
81
- eventCount: number;
82
- }
83
- /** Result of monitor operations. */
84
- export interface MonitorResult {
85
- action: MonitorAction;
86
- success: boolean;
87
- monitorId?: string;
88
- monitors?: MonitorInfo[];
89
- error?: string;
90
- }
91
- /**
92
- * Runtime dependencies injected by the host.
93
- *
94
- * The host is responsible for:
95
- * 1. Actually watching the event source (polling, inotify, process hooks, etc.)
96
- * 2. Delivering notifications back to the agent loop (via tick or wake-up)
97
- * 3. Cleaning up monitors when they time out or are stopped.
98
- */
99
- export interface MonitorToolDeps {
100
- /** Start monitoring a target. Returns the created monitor info. */
101
- startMonitor(params: {
102
- monitorId: string;
103
- source: MonitorSource;
104
- target: string;
105
- conditions: MonitorCondition[];
106
- timeoutSeconds: number;
107
- }): Promise<MonitorResult>;
108
- /** Stop an active monitor. */
109
- stopMonitor(monitorId: string): Promise<MonitorResult>;
110
- /** List all active monitors for this session. */
111
- listMonitors(): Promise<MonitorInfo[]>;
112
- }
113
- export declare function createMonitorTool(deps: MonitorToolDeps): PortableTool<MonitorToolParams>;
@@ -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,55 +0,0 @@
1
- import type { PortableTool } from "../portable-tool.js";
2
- export declare const MUSIC_GENERATE_TOOL_NAME: "music_generate";
3
- export interface MusicGenerateToolParams {
4
- prompt: string;
5
- purpose?: string;
6
- style?: string;
7
- lyrics?: string;
8
- duration?: number;
9
- }
10
- export declare const MUSIC_GENERATE_TOOL_SCHEMA: {
11
- readonly type: "object";
12
- readonly properties: {
13
- readonly prompt: {
14
- readonly type: "string";
15
- readonly description: string;
16
- };
17
- readonly purpose: {
18
- readonly type: "string";
19
- readonly description: "Intended use: 'background-music', 'ringtone', 'short-video-bgm', 'full-song', 'notification-sound', etc.";
20
- };
21
- readonly style: {
22
- readonly type: "string";
23
- readonly description: "Musical style/genre: 'lo-fi', 'pop', 'rock', 'jazz', 'classical', 'electronic', 'ambient', etc.";
24
- };
25
- readonly lyrics: {
26
- readonly type: "string";
27
- readonly description: "Optional lyrics for vocal music. Structure with [verse], [chorus], [bridge] tags if desired.";
28
- };
29
- readonly duration: {
30
- readonly type: "number";
31
- readonly description: "Duration in seconds (5-300). Infer from purpose: ringtone 15-30s, BGM 30-60s, full song 120-180s.";
32
- };
33
- };
34
- readonly required: readonly ["prompt"];
35
- };
36
- export interface MusicGenerateResult {
37
- mediaUrls: string[];
38
- model?: string;
39
- durationMs?: number;
40
- }
41
- /** Deps injected by the host runtime for music generation. */
42
- export interface MusicGenerateToolDeps {
43
- /**
44
- * Generate music via the configured backend.
45
- * The host handles model selection, failover, and storage.
46
- */
47
- generateMusic(params: {
48
- prompt: string;
49
- purpose?: string;
50
- style?: string;
51
- lyrics?: string;
52
- duration?: number;
53
- }): Promise<MusicGenerateResult>;
54
- }
55
- export declare function createMusicGenerateTool(deps: MusicGenerateToolDeps): PortableTool<MusicGenerateToolParams>;
@@ -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,53 +0,0 @@
1
- import type { PortableTool } from "../portable-tool.js";
2
- export declare const NOTIFY_TOOL_NAME: "notify";
3
- export interface NotifyToolParams {
4
- /** Notification message */
5
- message: string;
6
- /** Optional title/subject */
7
- title?: string;
8
- /** Priority level */
9
- priority?: "low" | "normal" | "high";
10
- /** Target channel override (default: user's primary channel) */
11
- channel?: string;
12
- }
13
- export declare const NOTIFY_TOOL_SCHEMA: {
14
- readonly type: "object";
15
- readonly properties: {
16
- readonly message: {
17
- readonly type: "string";
18
- readonly description: "Notification content to send to the user.";
19
- };
20
- readonly title: {
21
- readonly type: "string";
22
- readonly description: "Optional notification title/subject line.";
23
- };
24
- readonly priority: {
25
- readonly type: "string";
26
- readonly enum: readonly ["low", "normal", "high"];
27
- readonly description: "Notification priority (default: normal). High may trigger sound/vibration.";
28
- };
29
- readonly channel: {
30
- readonly type: "string";
31
- readonly description: "Target delivery channel (e.g. 'wechat', 'feishu', 'discord'). Default: user's primary.";
32
- };
33
- };
34
- readonly required: readonly ["message"];
35
- };
36
- export interface NotifyResult {
37
- delivered: boolean;
38
- channel: string;
39
- error?: string;
40
- }
41
- /**
42
- * Host-provided notification delivery backend.
43
- */
44
- export interface NotifyToolDeps {
45
- /** Send notification to user. Host routes to correct platform. */
46
- sendNotification(params: {
47
- message: string;
48
- title?: string;
49
- priority?: string;
50
- channel?: string;
51
- }): Promise<NotifyResult>;
52
- }
53
- export declare function createNotifyTool(deps: NotifyToolDeps): PortableTool<NotifyToolParams>;
@@ -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
- }
@@ -1,45 +0,0 @@
1
- import type { PortableTool } from "../portable-tool.js";
2
- export declare const PATCH_TOOL_NAME: "patch";
3
- export interface PatchToolParams {
4
- /** V4A unified diff or simple find-replace */
5
- input: string;
6
- /** When true, replace all occurrences in each file (default: false) */
7
- replaceAll?: boolean;
8
- }
9
- export declare const PATCH_TOOL_SCHEMA: {
10
- readonly type: "object";
11
- readonly properties: {
12
- readonly input: {
13
- readonly type: "string";
14
- readonly description: string;
15
- };
16
- readonly replaceAll: {
17
- readonly type: "boolean";
18
- readonly description: "Replace all occurrences instead of first only (default: false).";
19
- };
20
- };
21
- readonly required: readonly ["input"];
22
- };
23
- export interface PatchResult {
24
- filesModified: string[];
25
- filesAdded: string[];
26
- filesDeleted: string[];
27
- strategies: Record<string, string>;
28
- errors: string[];
29
- }
30
- export interface PatchToolDeps {
31
- readFile(path: string): Promise<string>;
32
- writeFile(path: string, content: string): Promise<void>;
33
- deleteFile(path: string): Promise<void>;
34
- fileExists(path: string): Promise<boolean>;
35
- resolvePath(input: string): string;
36
- }
37
- export type MatchStrategy = "exact" | "line_trimmed" | "whitespace_normalized" | "indentation_flexible" | "escape_normalized" | "trimmed_boundary" | "unicode_normalized" | "block_anchor" | "context_aware";
38
- interface MatchResult {
39
- start: number;
40
- end: number;
41
- strategy: MatchStrategy;
42
- }
43
- declare function fuzzyFind(content: string, search: string, replaceAll: boolean): MatchResult[];
44
- export declare function createPatchTool(deps: PatchToolDeps): PortableTool<PatchToolParams>;
45
- export { fuzzyFind, type MatchResult };