musonda 1.0.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 (196) hide show
  1. package/IMPLEMENTATION.md +432 -0
  2. package/README.md +119 -0
  3. package/dist/agent/harness.d.ts +25 -0
  4. package/dist/agent/harness.js +215 -0
  5. package/dist/agent/harness.js.map +1 -0
  6. package/dist/agent/openaiResponsesClient.d.ts +35 -0
  7. package/dist/agent/openaiResponsesClient.js +250 -0
  8. package/dist/agent/openaiResponsesClient.js.map +1 -0
  9. package/dist/agent/systemPrompt.d.ts +9 -0
  10. package/dist/agent/systemPrompt.js +100 -0
  11. package/dist/agent/systemPrompt.js.map +1 -0
  12. package/dist/agent/types.d.ts +53 -0
  13. package/dist/agent/types.js +2 -0
  14. package/dist/agent/types.js.map +1 -0
  15. package/dist/cli/commands/chat.d.ts +6 -0
  16. package/dist/cli/commands/chat.js +8 -0
  17. package/dist/cli/commands/chat.js.map +1 -0
  18. package/dist/cli/commands/doctor.d.ts +4 -0
  19. package/dist/cli/commands/doctor.js +336 -0
  20. package/dist/cli/commands/doctor.js.map +1 -0
  21. package/dist/cli/commands/gateway.d.ts +20 -0
  22. package/dist/cli/commands/gateway.js +135 -0
  23. package/dist/cli/commands/gateway.js.map +1 -0
  24. package/dist/cli/commands/help.d.ts +4 -0
  25. package/dist/cli/commands/help.js +159 -0
  26. package/dist/cli/commands/help.js.map +1 -0
  27. package/dist/cli/commands/plugins.d.ts +18 -0
  28. package/dist/cli/commands/plugins.js +250 -0
  29. package/dist/cli/commands/plugins.js.map +1 -0
  30. package/dist/cli/commands/service.d.ts +16 -0
  31. package/dist/cli/commands/service.js +136 -0
  32. package/dist/cli/commands/service.js.map +1 -0
  33. package/dist/cli/commands/setup.d.ts +4 -0
  34. package/dist/cli/commands/setup.js +8 -0
  35. package/dist/cli/commands/setup.js.map +1 -0
  36. package/dist/cli/commands/status.d.ts +4 -0
  37. package/dist/cli/commands/status.js +73 -0
  38. package/dist/cli/commands/status.js.map +1 -0
  39. package/dist/cli/commands/update.d.ts +22 -0
  40. package/dist/cli/commands/update.js +226 -0
  41. package/dist/cli/commands/update.js.map +1 -0
  42. package/dist/cli/daemon.d.ts +33 -0
  43. package/dist/cli/daemon.js +208 -0
  44. package/dist/cli/daemon.js.map +1 -0
  45. package/dist/cli/interactiveMenu.d.ts +5 -0
  46. package/dist/cli/interactiveMenu.js +225 -0
  47. package/dist/cli/interactiveMenu.js.map +1 -0
  48. package/dist/cli/musondaCli.d.ts +30 -0
  49. package/dist/cli/musondaCli.js +269 -0
  50. package/dist/cli/musondaCli.js.map +1 -0
  51. package/dist/cli/ui.d.ts +49 -0
  52. package/dist/cli/ui.js +90 -0
  53. package/dist/cli/ui.js.map +1 -0
  54. package/dist/cli.d.ts +9 -0
  55. package/dist/cli.js +315 -0
  56. package/dist/cli.js.map +1 -0
  57. package/dist/config/loader.d.ts +12 -0
  58. package/dist/config/loader.js +217 -0
  59. package/dist/config/loader.js.map +1 -0
  60. package/dist/config/paths.d.ts +11 -0
  61. package/dist/config/paths.js +18 -0
  62. package/dist/config/paths.js.map +1 -0
  63. package/dist/config/types.d.ts +246 -0
  64. package/dist/config/types.js +155 -0
  65. package/dist/config/types.js.map +1 -0
  66. package/dist/gateway/channels/cli.d.ts +37 -0
  67. package/dist/gateway/channels/cli.js +298 -0
  68. package/dist/gateway/channels/cli.js.map +1 -0
  69. package/dist/gateway/channels/discord.d.ts +18 -0
  70. package/dist/gateway/channels/discord.js +419 -0
  71. package/dist/gateway/channels/discord.js.map +1 -0
  72. package/dist/gateway/channels/slack.d.ts +26 -0
  73. package/dist/gateway/channels/slack.js +470 -0
  74. package/dist/gateway/channels/slack.js.map +1 -0
  75. package/dist/gateway/channels/webhook.d.ts +18 -0
  76. package/dist/gateway/channels/webhook.js +49 -0
  77. package/dist/gateway/channels/webhook.js.map +1 -0
  78. package/dist/gateway/http.d.ts +33 -0
  79. package/dist/gateway/http.js +605 -0
  80. package/dist/gateway/http.js.map +1 -0
  81. package/dist/gateway/server.d.ts +38 -0
  82. package/dist/gateway/server.js +233 -0
  83. package/dist/gateway/server.js.map +1 -0
  84. package/dist/gateway/types.d.ts +28 -0
  85. package/dist/gateway/types.js +2 -0
  86. package/dist/gateway/types.js.map +1 -0
  87. package/dist/index.d.ts +17 -0
  88. package/dist/index.js +32 -0
  89. package/dist/index.js.map +1 -0
  90. package/dist/memory/memoryManager.d.ts +22 -0
  91. package/dist/memory/memoryManager.js +200 -0
  92. package/dist/memory/memoryManager.js.map +1 -0
  93. package/dist/memory/storage.d.ts +24 -0
  94. package/dist/memory/storage.js +187 -0
  95. package/dist/memory/storage.js.map +1 -0
  96. package/dist/memory/types.d.ts +43 -0
  97. package/dist/memory/types.js +2 -0
  98. package/dist/memory/types.js.map +1 -0
  99. package/dist/plugins/manifest.d.ts +23 -0
  100. package/dist/plugins/manifest.js +185 -0
  101. package/dist/plugins/manifest.js.map +1 -0
  102. package/dist/plugins/mcp/mcpBridge.d.ts +31 -0
  103. package/dist/plugins/mcp/mcpBridge.js +115 -0
  104. package/dist/plugins/mcp/mcpBridge.js.map +1 -0
  105. package/dist/plugins/mcp/mcpClient.d.ts +43 -0
  106. package/dist/plugins/mcp/mcpClient.js +309 -0
  107. package/dist/plugins/mcp/mcpClient.js.map +1 -0
  108. package/dist/plugins/mcp/mcpConfig.d.ts +34 -0
  109. package/dist/plugins/mcp/mcpConfig.js +326 -0
  110. package/dist/plugins/mcp/mcpConfig.js.map +1 -0
  111. package/dist/plugins/mcp/types.d.ts +48 -0
  112. package/dist/plugins/mcp/types.js +2 -0
  113. package/dist/plugins/mcp/types.js.map +1 -0
  114. package/dist/plugins/pluginManager.d.ts +164 -0
  115. package/dist/plugins/pluginManager.js +1016 -0
  116. package/dist/plugins/pluginManager.js.map +1 -0
  117. package/dist/plugins/skills/frontmatterParser.d.ts +28 -0
  118. package/dist/plugins/skills/frontmatterParser.js +189 -0
  119. package/dist/plugins/skills/frontmatterParser.js.map +1 -0
  120. package/dist/plugins/skills/skillDiscovery.d.ts +15 -0
  121. package/dist/plugins/skills/skillDiscovery.js +148 -0
  122. package/dist/plugins/skills/skillDiscovery.js.map +1 -0
  123. package/dist/plugins/skills/skillTools.d.ts +8 -0
  124. package/dist/plugins/skills/skillTools.js +195 -0
  125. package/dist/plugins/skills/skillTools.js.map +1 -0
  126. package/dist/plugins/skills/types.d.ts +25 -0
  127. package/dist/plugins/skills/types.js +2 -0
  128. package/dist/plugins/skills/types.js.map +1 -0
  129. package/dist/plugins/types.d.ts +30 -0
  130. package/dist/plugins/types.js +2 -0
  131. package/dist/plugins/types.js.map +1 -0
  132. package/dist/scheduler/scheduler.d.ts +25 -0
  133. package/dist/scheduler/scheduler.js +239 -0
  134. package/dist/scheduler/scheduler.js.map +1 -0
  135. package/dist/scheduler/types.d.ts +39 -0
  136. package/dist/scheduler/types.js +2 -0
  137. package/dist/scheduler/types.js.map +1 -0
  138. package/dist/security/childProcessEnv.d.ts +5 -0
  139. package/dist/security/childProcessEnv.js +42 -0
  140. package/dist/security/childProcessEnv.js.map +1 -0
  141. package/dist/security/fileSandbox.d.ts +153 -0
  142. package/dist/security/fileSandbox.js +779 -0
  143. package/dist/security/fileSandbox.js.map +1 -0
  144. package/dist/service/index.d.ts +30 -0
  145. package/dist/service/index.js +41 -0
  146. package/dist/service/index.js.map +1 -0
  147. package/dist/service/systemd.d.ts +36 -0
  148. package/dist/service/systemd.js +409 -0
  149. package/dist/service/systemd.js.map +1 -0
  150. package/dist/service/types.d.ts +118 -0
  151. package/dist/service/types.js +6 -0
  152. package/dist/service/types.js.map +1 -0
  153. package/dist/tools/builtin/calcTools.d.ts +2 -0
  154. package/dist/tools/builtin/calcTools.js +51 -0
  155. package/dist/tools/builtin/calcTools.js.map +1 -0
  156. package/dist/tools/builtin/fileTools.d.ts +11 -0
  157. package/dist/tools/builtin/fileTools.js +352 -0
  158. package/dist/tools/builtin/fileTools.js.map +1 -0
  159. package/dist/tools/builtin/memoryTools.d.ts +4 -0
  160. package/dist/tools/builtin/memoryTools.js +123 -0
  161. package/dist/tools/builtin/memoryTools.js.map +1 -0
  162. package/dist/tools/builtin/noteTools.d.ts +4 -0
  163. package/dist/tools/builtin/noteTools.js +91 -0
  164. package/dist/tools/builtin/noteTools.js.map +1 -0
  165. package/dist/tools/builtin/pluginTools.d.ts +29 -0
  166. package/dist/tools/builtin/pluginTools.js +406 -0
  167. package/dist/tools/builtin/pluginTools.js.map +1 -0
  168. package/dist/tools/builtin/scheduleTools.d.ts +4 -0
  169. package/dist/tools/builtin/scheduleTools.js +156 -0
  170. package/dist/tools/builtin/scheduleTools.js.map +1 -0
  171. package/dist/tools/builtin/timeTools.d.ts +2 -0
  172. package/dist/tools/builtin/timeTools.js +41 -0
  173. package/dist/tools/builtin/timeTools.js.map +1 -0
  174. package/dist/tools/builtin/webTools.d.ts +12 -0
  175. package/dist/tools/builtin/webTools.js +325 -0
  176. package/dist/tools/builtin/webTools.js.map +1 -0
  177. package/dist/tools/registry.d.ts +15 -0
  178. package/dist/tools/registry.js +111 -0
  179. package/dist/tools/registry.js.map +1 -0
  180. package/dist/tools/types.d.ts +41 -0
  181. package/dist/tools/types.js +2 -0
  182. package/dist/tools/types.js.map +1 -0
  183. package/dist/utils/logger.d.ts +29 -0
  184. package/dist/utils/logger.js +124 -0
  185. package/dist/utils/logger.js.map +1 -0
  186. package/dist/wizard/onboarding.d.ts +3 -0
  187. package/dist/wizard/onboarding.js +408 -0
  188. package/dist/wizard/onboarding.js.map +1 -0
  189. package/package.json +69 -0
  190. package/plugins/example-calc/mcp.json +11 -0
  191. package/plugins/example-calc/plugin.json +12 -0
  192. package/plugins/example-calc/server.mjs +92 -0
  193. package/plugins/example-calc/skills/math-assistant/SKILL.md +15 -0
  194. package/plugins/plugin-builder/plugin.json +12 -0
  195. package/plugins/plugin-builder/skills/create-plugin/SKILL.md +149 -0
  196. package/plugins/plugin-builder/skills/manage-plugins/SKILL.md +157 -0
@@ -0,0 +1,123 @@
1
+ export const memoryStoreTool = {
2
+ name: 'memory_store',
3
+ description: 'Store an important fact, personal preference, goal, or piece of knowledge about the user or project into Musonda long-term persistent memory.',
4
+ parameters: {
5
+ type: 'object',
6
+ properties: {
7
+ content: {
8
+ type: 'string',
9
+ description: 'The fact, insight, or preference to remember for future conversations.',
10
+ },
11
+ category: {
12
+ type: 'string',
13
+ enum: ['fact', 'preference', 'project', 'goal', 'note', 'general'],
14
+ description: 'The category of the memory.',
15
+ },
16
+ tags: {
17
+ type: 'string',
18
+ description: 'Comma-separated list of keywords or tags for quick search, e.g. "python, coding, preference".',
19
+ },
20
+ },
21
+ required: ['content'],
22
+ },
23
+ execute: async (args, context) => {
24
+ const category = args.category || 'general';
25
+ const tags = args.tags ? args.tags.split(',').map((t) => t.trim()) : [];
26
+ const item = context.memory.addMemory(args.content, category, tags);
27
+ return {
28
+ success: true,
29
+ message: `Successfully remembered [${category}]: "${args.content}"`,
30
+ memoryId: item.id,
31
+ };
32
+ },
33
+ };
34
+ export const memoryRecallTool = {
35
+ name: 'memory_recall',
36
+ description: 'Search Musonda persistent long-term memory for facts, preferences, past topics, or user details matching a query.',
37
+ parameters: {
38
+ type: 'object',
39
+ properties: {
40
+ query: {
41
+ type: 'string',
42
+ description: 'Search query or keywords to look up in persistent memory.',
43
+ },
44
+ limit: {
45
+ type: 'number',
46
+ description: 'Maximum number of memories to return (default 5).',
47
+ },
48
+ },
49
+ required: ['query'],
50
+ },
51
+ execute: async (args, context) => {
52
+ const limit = args.limit || 5;
53
+ const items = context.memory.searchMemories(args.query, limit);
54
+ if (!items.length) {
55
+ return {
56
+ found: 0,
57
+ memories: [],
58
+ message: `No memories found matching "${args.query}".`,
59
+ };
60
+ }
61
+ return {
62
+ found: items.length,
63
+ memories: items.map((m) => ({
64
+ id: m.id,
65
+ category: m.category,
66
+ content: m.content,
67
+ tags: m.tags,
68
+ savedAt: m.createdAt,
69
+ })),
70
+ };
71
+ },
72
+ };
73
+ export const updateUserProfileTool = {
74
+ name: 'update_user_profile',
75
+ description: 'Update the structured profile details about the user, such as their name, profession/bio, interests, or communication preferences.',
76
+ parameters: {
77
+ type: 'object',
78
+ properties: {
79
+ name: {
80
+ type: 'string',
81
+ description: 'User preferred name.',
82
+ },
83
+ bio: {
84
+ type: 'string',
85
+ description: 'Short summary of the user, their role, and background.',
86
+ },
87
+ interests: {
88
+ type: 'string',
89
+ description: 'Comma-separated list of user interests, hobbies, or domains.',
90
+ },
91
+ communicationStyle: {
92
+ type: 'string',
93
+ enum: ['concise', 'detailed', 'friendly', 'technical'],
94
+ description: 'Preferred conversational tone and response style.',
95
+ },
96
+ notes: {
97
+ type: 'string',
98
+ description: 'Special instructions or persistent notes regarding how the user likes to work.',
99
+ },
100
+ },
101
+ },
102
+ execute: async (args, context) => {
103
+ const updates = {};
104
+ if (args.name)
105
+ updates.name = args.name;
106
+ if (args.bio)
107
+ updates.bio = args.bio;
108
+ if (args.communicationStyle)
109
+ updates.communicationStyle = args.communicationStyle;
110
+ if (args.notes)
111
+ updates.notes = args.notes;
112
+ if (args.interests) {
113
+ updates.interests = args.interests.split(',').map((s) => s.trim());
114
+ }
115
+ const updated = context.memory.updateProfile(updates);
116
+ return {
117
+ success: true,
118
+ message: 'User profile updated successfully.',
119
+ profile: updated,
120
+ };
121
+ },
122
+ };
123
+ //# sourceMappingURL=memoryTools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memoryTools.js","sourceRoot":"","sources":["../../../src/tools/builtin/memoryTools.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,eAAe,GAAmB;IAC7C,IAAI,EAAE,cAAc;IACpB,WAAW,EACT,+IAA+I;IACjJ,UAAU,EAAE;QACV,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,wEAAwE;aACtF;YACD,QAAQ,EAAE;gBACR,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,CAAC,MAAM,EAA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C;gBACtD,WAAW,EAAE,mDAAmD;aACjE;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,gFAAgF;aAC9F;SACF;KACF;IACD,OAAO,EAAE,KAAK,EACZ,IAMC,EACD,OAAO,EACP,EAAE;QACF,MAAM,OAAO,GAAwB,EAAE,CAAC;QACxC,IAAI,IAAI,CAAC,IAAI;YAAE,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACxC,IAAI,IAAI,CAAC,GAAG;YAAE,OAAO,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC;QACrC,IAAI,IAAI,CAAC,kBAAkB;YAAE,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,kBAAkB,CAAC;QAClF,IAAI,IAAI,CAAC,KAAK;YAAE,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QAC3C,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACnB,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;QACrE,CAAC;QAED,MAAM,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QACtD,OAAO;YACL,OAAO,EAAE,IAAI;YACb,OAAO,EAAE,oCAAoC;YAC7C,OAAO,EAAE,OAAO;SACjB,CAAC;IACJ,CAAC;CACF,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { ToolDefinition } from '../types.js';
2
+ export declare const noteSaveTool: ToolDefinition;
3
+ export declare const noteReadTool: ToolDefinition;
4
+ export declare const noteListTool: ToolDefinition;
@@ -0,0 +1,91 @@
1
+ import path from 'node:path';
2
+ import fs from 'node:fs';
3
+ function getNotesDir(dataDir) {
4
+ const dir = path.join(dataDir, 'notes');
5
+ if (!fs.existsSync(dir)) {
6
+ fs.mkdirSync(dir, { recursive: true });
7
+ }
8
+ return dir;
9
+ }
10
+ export const noteSaveTool = {
11
+ name: 'note_save',
12
+ description: 'Save or update a personal note, draft, or document for the user.',
13
+ parameters: {
14
+ type: 'object',
15
+ properties: {
16
+ title: {
17
+ type: 'string',
18
+ description: 'The title/name of the note (alphanumeric, hyphens, underscores).',
19
+ },
20
+ content: {
21
+ type: 'string',
22
+ description: 'The full text or markdown content of the note.',
23
+ },
24
+ },
25
+ required: ['title', 'content'],
26
+ },
27
+ execute: async (args, context) => {
28
+ const safeTitle = args.title.replace(/[^a-zA-Z0-9_-]/g, '_').toLowerCase();
29
+ const notesDir = getNotesDir(context.config.memory.storageDir);
30
+ const filePath = path.join(notesDir, `${safeTitle}.md`);
31
+ fs.writeFileSync(filePath, args.content, 'utf-8');
32
+ return {
33
+ success: true,
34
+ title: args.title,
35
+ savedPath: filePath,
36
+ bytes: Buffer.byteLength(args.content, 'utf-8'),
37
+ };
38
+ },
39
+ };
40
+ export const noteReadTool = {
41
+ name: 'note_read',
42
+ description: 'Read the content of an existing personal note by title.',
43
+ parameters: {
44
+ type: 'object',
45
+ properties: {
46
+ title: {
47
+ type: 'string',
48
+ description: 'The title or filename of the note to read.',
49
+ },
50
+ },
51
+ required: ['title'],
52
+ },
53
+ execute: async (args, context) => {
54
+ const safeTitle = args.title.replace(/[^a-zA-Z0-9_-]/g, '_').toLowerCase();
55
+ const notesDir = getNotesDir(context.config.memory.storageDir);
56
+ const filePath = path.join(notesDir, `${safeTitle}.md`);
57
+ if (!fs.existsSync(filePath)) {
58
+ return { error: `Note "${args.title}" does not exist.` };
59
+ }
60
+ const content = fs.readFileSync(filePath, 'utf-8');
61
+ return {
62
+ title: args.title,
63
+ content,
64
+ };
65
+ },
66
+ };
67
+ export const noteListTool = {
68
+ name: 'note_list',
69
+ description: 'List all existing saved notes for the user.',
70
+ parameters: {
71
+ type: 'object',
72
+ properties: {},
73
+ },
74
+ execute: async (_args, context) => {
75
+ const notesDir = getNotesDir(context.config.memory.storageDir);
76
+ const files = fs.readdirSync(notesDir).filter((f) => f.endsWith('.md'));
77
+ const notes = files.map((file) => {
78
+ const stats = fs.statSync(path.join(notesDir, file));
79
+ return {
80
+ title: file.replace(/\.md$/, ''),
81
+ sizeBytes: stats.size,
82
+ modifiedAt: stats.mtime.toISOString(),
83
+ };
84
+ });
85
+ return {
86
+ total: notes.length,
87
+ notes,
88
+ };
89
+ },
90
+ };
91
+ //# sourceMappingURL=noteTools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"noteTools.js","sourceRoot":"","sources":["../../../src/tools/builtin/noteTools.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,SAAS,CAAC;AAGzB,SAAS,WAAW,CAAC,OAAe;IAClC,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACxC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QACxB,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACzC,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,MAAM,CAAC,MAAM,YAAY,GAAmB;IAC1C,IAAI,EAAE,WAAW;IACjB,WAAW,EAAE,kEAAkE;IAC/E,UAAU,EAAE;QACV,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,kEAAkE;aAChF;YACD,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,gDAAgD;aAC9D;SACF;QACD,QAAQ,EAAE,CAAC,OAAO,EAAE,SAAS,CAAC;KAC/B;IACD,OAAO,EAAE,KAAK,EAAE,IAAwC,EAAE,OAAO,EAAE,EAAE;QACnE,MAAM,SAAS,GA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AC;CACF,CAAC"}
@@ -0,0 +1,29 @@
1
+ import { ToolDefinition } from '../types.js';
2
+ /**
3
+ * Tool for creating and instantly loading a new Agent Plugin into the live runtime.
4
+ */
5
+ export declare const pluginCreateTool: ToolDefinition;
6
+ /**
7
+ * Tool for reloading plugins from disk into the live gateway runtime.
8
+ */
9
+ export declare const pluginReloadTool: ToolDefinition;
10
+ /**
11
+ * Tool for listing all currently loaded plugins and their capabilities in the runtime.
12
+ */
13
+ export declare const pluginListTool: ToolDefinition;
14
+ /**
15
+ * Tool for installing an Agent Plugin from a local path, Git repo, or npm package into the live runtime.
16
+ */
17
+ export declare const pluginInstallTool: ToolDefinition;
18
+ /**
19
+ * Tool for safely removing and uninstalling an Agent Plugin from live runtime and disk.
20
+ */
21
+ export declare const pluginRemoveTool: ToolDefinition;
22
+ /**
23
+ * Tool for finding and searching Agent Plugins locally and across the ecosystem.
24
+ */
25
+ export declare const pluginFindTool: ToolDefinition;
26
+ /**
27
+ * Tool for inspecting detailed plugin manifest metadata, skills, and MCP configuration.
28
+ */
29
+ export declare const pluginInfoTool: ToolDefinition;
@@ -0,0 +1,406 @@
1
+ /**
2
+ * Tool for creating and instantly loading a new Agent Plugin into the live runtime.
3
+ */
4
+ export const pluginCreateTool = {
5
+ name: 'plugin_create',
6
+ description: 'Creates and installs a new Agent Plugin with a valid manifest (plugin.json), optional skills (SKILL.md), and optional MCP server configuration, then immediately activates it in the live Musonda Gateway runtime without requiring a server restart.',
7
+ parameters: {
8
+ type: 'object',
9
+ properties: {
10
+ name: {
11
+ type: 'string',
12
+ description: 'Plugin identifier name (lowercase alphanumeric with single hyphens, 1-64 chars, e.g. "github-tools", "weather-service").',
13
+ },
14
+ description: {
15
+ type: 'string',
16
+ description: 'Clear description of what capabilities and skills the plugin provides.',
17
+ },
18
+ version: {
19
+ type: 'string',
20
+ description: 'Semantic version of the plugin (default: "1.0.0").',
21
+ },
22
+ skills: {
23
+ type: 'array',
24
+ description: 'Optional list of Agent Skills to scaffold inside the plugin package.',
25
+ items: {
26
+ type: 'object',
27
+ },
28
+ },
29
+ mcp: {
30
+ type: 'object',
31
+ description: 'Optional Model Context Protocol (MCP) server definitions with stdio or http commands.',
32
+ },
33
+ targetDir: {
34
+ type: 'string',
35
+ description: 'Optional custom target directory (defaults to "./plugins/<name>").',
36
+ },
37
+ },
38
+ required: ['name', 'description'],
39
+ },
40
+ execute: async (args, context) => {
41
+ if (!context.pluginManager || !context.toolRegistry) {
42
+ return {
43
+ error: 'Plugin subsystem is not available in the current execution context.',
44
+ };
45
+ }
46
+ const { name, description, version, skills, mcp, targetDir } = args;
47
+ if (!name || typeof name !== 'string') {
48
+ return { error: 'Missing or invalid "name" parameter.' };
49
+ }
50
+ if (!description || typeof description !== 'string') {
51
+ return { error: 'Missing or invalid "description" parameter.' };
52
+ }
53
+ const result = await context.pluginManager.createAndLoadPlugin({
54
+ name,
55
+ description,
56
+ version: version || '1.0.0',
57
+ skills,
58
+ mcp,
59
+ targetDir,
60
+ }, context.toolRegistry);
61
+ if (!result.success) {
62
+ return {
63
+ success: false,
64
+ error: result.error || 'Unknown error occurred during plugin creation.',
65
+ };
66
+ }
67
+ return {
68
+ success: true,
69
+ message: `Plugin "${name}" created and loaded into Musonda runtime successfully!`,
70
+ plugin: {
71
+ name: result.plugin?.name,
72
+ rootDir: result.plugin?.rootDir,
73
+ dataDir: result.plugin?.dataDir,
74
+ version: result.plugin?.manifest.version,
75
+ },
76
+ skillsLoaded: result.skillsLoaded,
77
+ toolsRegistered: result.toolsRegistered,
78
+ };
79
+ },
80
+ };
81
+ /**
82
+ * Tool for reloading plugins from disk into the live gateway runtime.
83
+ */
84
+ export const pluginReloadTool = {
85
+ name: 'plugin_reload',
86
+ description: 'Reloads plugins from disk into the live Musonda Gateway runtime without restarting the server. Can reload a specific plugin by name or all configured plugins.',
87
+ parameters: {
88
+ type: 'object',
89
+ properties: {
90
+ pluginName: {
91
+ type: 'string',
92
+ description: 'Name of the specific plugin to reload. If omitted or set to "all", all plugins are re-scanned and reloaded.',
93
+ },
94
+ },
95
+ },
96
+ execute: async (args, context) => {
97
+ if (!context.pluginManager || !context.toolRegistry) {
98
+ return {
99
+ error: 'Plugin subsystem is not available in the current execution context.',
100
+ };
101
+ }
102
+ const pluginName = args.pluginName?.trim();
103
+ if (pluginName && pluginName.toLowerCase() !== 'all') {
104
+ const reloaded = await context.pluginManager.reloadPlugin(pluginName, context.toolRegistry);
105
+ if (!reloaded) {
106
+ return {
107
+ success: false,
108
+ error: `Could not reload plugin "${pluginName}". Ensure the directory and valid plugin.json exist.`,
109
+ };
110
+ }
111
+ const pluginSkills = context.pluginManager
112
+ .getAllSkills()
113
+ .filter((s) => s.pluginName === pluginName);
114
+ const activeMcpServers = context.pluginManager
115
+ .getMcpBridge()
116
+ .getActiveServers()
117
+ .filter((s) => s.server.pluginName === pluginName);
118
+ const tools = activeMcpServers.flatMap((s) => s.tools.map((t) => t.name));
119
+ return {
120
+ success: true,
121
+ message: `Plugin "${pluginName}" reloaded successfully!`,
122
+ plugin: {
123
+ name: reloaded.name,
124
+ rootDir: reloaded.rootDir,
125
+ version: reloaded.manifest.version,
126
+ },
127
+ skills: pluginSkills.map((s) => s.name),
128
+ tools,
129
+ };
130
+ }
131
+ const summary = await context.pluginManager.reloadAll(context.toolRegistry);
132
+ return {
133
+ success: true,
134
+ message: `All plugins reloaded into runtime.`,
135
+ pluginsLoaded: summary.loaded,
136
+ skillsLoaded: summary.skills,
137
+ mcpServersConnected: summary.mcpServers,
138
+ };
139
+ },
140
+ };
141
+ /**
142
+ * Tool for listing all currently loaded plugins and their capabilities in the runtime.
143
+ */
144
+ export const pluginListTool = {
145
+ name: 'plugin_list',
146
+ description: 'Lists all currently loaded Agent Plugins in the Musonda Gateway runtime, including their versions, directory paths, skills, and active MCP servers and tools.',
147
+ parameters: {
148
+ type: 'object',
149
+ properties: {},
150
+ },
151
+ execute: async (_args, context) => {
152
+ if (!context.pluginManager) {
153
+ return {
154
+ error: 'Plugin subsystem is not available in the current execution context.',
155
+ };
156
+ }
157
+ const plugins = context.pluginManager.getAllPlugins();
158
+ const skills = context.pluginManager.getAllSkills();
159
+ const mcpServers = context.pluginManager.getMcpBridge().getActiveServers();
160
+ return {
161
+ totalPlugins: plugins.length,
162
+ totalSkills: skills.length,
163
+ totalMcpServers: mcpServers.length,
164
+ plugins: plugins.map((p) => {
165
+ const pluginSkills = skills
166
+ .filter((s) => s.pluginName === p.name)
167
+ .map((s) => ({
168
+ name: s.name,
169
+ description: s.description,
170
+ }));
171
+ const servers = mcpServers
172
+ .filter((s) => s.server.pluginName === p.name)
173
+ .map((s) => ({
174
+ name: s.server.name,
175
+ type: s.server.config.type,
176
+ tools: s.tools.map((t) => t.name),
177
+ }));
178
+ return {
179
+ name: p.name,
180
+ version: p.manifest.version || '1.0.0',
181
+ description: p.manifest.description || '',
182
+ rootDir: p.rootDir,
183
+ dataDir: p.dataDir,
184
+ skills: pluginSkills,
185
+ mcpServers: servers,
186
+ };
187
+ }),
188
+ };
189
+ },
190
+ };
191
+ /**
192
+ * Tool for installing an Agent Plugin from a local path, Git repo, or npm package into the live runtime.
193
+ */
194
+ export const pluginInstallTool = {
195
+ name: 'plugin_install',
196
+ description: 'Installs and instantly activates an Agent Plugin from a local directory path, Git repository URL (e.g. GitHub URL or "owner/repo" shorthand), or package into the live Musonda Gateway runtime without restarting the server. Validates conformance with the Agent Plugins 1.0.0 standard (https://agent-plugins.org), installs dependencies if needed, and registers skills and MCP tools.',
197
+ parameters: {
198
+ type: 'object',
199
+ properties: {
200
+ source: {
201
+ type: 'string',
202
+ description: 'Source location: local directory path (e.g. "./my-plugin"), Git repository URL (e.g. "https://github.com/agentplugins/agent-plugins-example.git"), or GitHub shorthand (e.g. "agentplugins/agent-plugins-example").',
203
+ },
204
+ name: {
205
+ type: 'string',
206
+ description: 'Optional custom name for the installed plugin package.',
207
+ },
208
+ installDependencies: {
209
+ type: 'boolean',
210
+ description: 'Whether to automatically install production dependencies via npm if package.json is present (default: true).',
211
+ },
212
+ targetDir: {
213
+ type: 'string',
214
+ description: 'Optional custom installation directory path.',
215
+ },
216
+ },
217
+ required: ['source'],
218
+ },
219
+ execute: async (args, context) => {
220
+ if (!context.pluginManager || !context.toolRegistry) {
221
+ return {
222
+ error: 'Plugin subsystem is not available in the current execution context.',
223
+ };
224
+ }
225
+ const { source, name, installDependencies, targetDir } = args;
226
+ if (!source || typeof source !== 'string') {
227
+ return { error: 'Missing or invalid "source" parameter.' };
228
+ }
229
+ const result = await context.pluginManager.installPlugin({
230
+ source,
231
+ name,
232
+ installDependencies: installDependencies !== false,
233
+ targetDir,
234
+ }, context.toolRegistry);
235
+ if (!result.success) {
236
+ return {
237
+ success: false,
238
+ error: result.error || 'Unknown error occurred during plugin installation.',
239
+ };
240
+ }
241
+ return {
242
+ success: true,
243
+ message: `Plugin "${result.plugin?.name}" installed and activated in Musonda Gateway runtime successfully!`,
244
+ plugin: {
245
+ name: result.plugin?.name,
246
+ rootDir: result.plugin?.rootDir,
247
+ dataDir: result.plugin?.dataDir,
248
+ version: result.plugin?.manifest.version,
249
+ },
250
+ skillsLoaded: result.skillsLoaded,
251
+ toolsRegistered: result.toolsRegistered,
252
+ installedPath: result.installedPath,
253
+ };
254
+ },
255
+ };
256
+ /**
257
+ * Tool for safely removing and uninstalling an Agent Plugin from live runtime and disk.
258
+ */
259
+ export const pluginRemoveTool = {
260
+ name: 'plugin_remove',
261
+ description: 'Unloads and removes an Agent Plugin from the live Musonda Gateway runtime without restarting the server. Gracefully terminates its active MCP subprocesses, deregisters bridged MCP tools, removes its skills, and deletes its files from disk (with optional purge of persistent data).',
262
+ parameters: {
263
+ type: 'object',
264
+ properties: {
265
+ pluginName: {
266
+ type: 'string',
267
+ description: 'Name of the plugin to remove and unload.',
268
+ },
269
+ deleteFiles: {
270
+ type: 'boolean',
271
+ description: 'Whether to delete the plugin package files from disk (default: true). Set false to only unload from runtime.',
272
+ },
273
+ purgeData: {
274
+ type: 'boolean',
275
+ description: 'Whether to also delete the persistent data directory (PLUGIN_DATA) in data/plugin_data/<name> (default: false).',
276
+ },
277
+ },
278
+ required: ['pluginName'],
279
+ },
280
+ execute: async (args, context) => {
281
+ if (!context.pluginManager || !context.toolRegistry) {
282
+ return {
283
+ error: 'Plugin subsystem is not available in the current execution context.',
284
+ };
285
+ }
286
+ const { pluginName, deleteFiles, purgeData } = args;
287
+ if (!pluginName || typeof pluginName !== 'string') {
288
+ return { error: 'Missing or invalid "pluginName" parameter.' };
289
+ }
290
+ const result = await context.pluginManager.removePlugin({
291
+ pluginName,
292
+ deleteFiles: deleteFiles !== false,
293
+ purgeData: purgeData === true,
294
+ }, context.toolRegistry);
295
+ if (!result.success) {
296
+ return {
297
+ success: false,
298
+ error: result.error || `Could not remove plugin "${pluginName}".`,
299
+ };
300
+ }
301
+ return {
302
+ success: true,
303
+ message: `Plugin "${pluginName}" removed successfully from Musonda runtime!`,
304
+ pluginName: result.pluginName,
305
+ unloadedFromRuntime: result.unloaded,
306
+ deletedFilesFromDisk: result.deletedFiles,
307
+ purgedDataDirectory: result.purgedData,
308
+ skillsRemoved: result.skillsRemoved,
309
+ toolsUnregistered: result.toolsUnregistered,
310
+ };
311
+ },
312
+ };
313
+ /**
314
+ * Tool for finding and searching Agent Plugins locally and across the ecosystem.
315
+ */
316
+ export const pluginFindTool = {
317
+ name: 'plugin_find',
318
+ description: 'Searches and discovers Agent Plugins locally on disk and across the ecosystem (including official agent-plugins.org repositories, GitHub topic "agent-plugin", and npm). Use this to find plugins that provide specific skills, integrations, or MCP tools.',
319
+ parameters: {
320
+ type: 'object',
321
+ properties: {
322
+ query: {
323
+ type: 'string',
324
+ description: 'Keywords, topics, or capabilities to search for (e.g. "calculator", "github", "database", "weather", "search").',
325
+ },
326
+ source: {
327
+ type: 'string',
328
+ description: 'Search scope: "all" (default: local and remote), "local" (only on disk), or "remote" (ecosystem repositories).',
329
+ enum: ['all', 'local', 'remote'],
330
+ },
331
+ },
332
+ },
333
+ execute: async (args, context) => {
334
+ if (!context.pluginManager) {
335
+ return {
336
+ error: 'Plugin subsystem is not available in the current execution context.',
337
+ };
338
+ }
339
+ const { query, source } = args;
340
+ const result = await context.pluginManager.findPlugins({
341
+ query,
342
+ source: source || 'all',
343
+ });
344
+ return {
345
+ success: true,
346
+ query: result.query,
347
+ totalFound: result.totalFound,
348
+ localPlugins: result.local,
349
+ remotePlugins: result.remote,
350
+ help: 'To install any plugin, use "plugin_install" with its repository URL or local path. To learn how to create your own, inspect "plugin_create" or read the create-plugin skill.',
351
+ };
352
+ },
353
+ };
354
+ /**
355
+ * Tool for inspecting detailed plugin manifest metadata, skills, and MCP configuration.
356
+ */
357
+ export const pluginInfoTool = {
358
+ name: 'plugin_info',
359
+ description: 'Inspects detailed metadata, manifest configuration, discovered skills (with instructions summary), and MCP servers for a specific Agent Plugin (either active in runtime or located on disk).',
360
+ parameters: {
361
+ type: 'object',
362
+ properties: {
363
+ pluginName: {
364
+ type: 'string',
365
+ description: 'Name or directory path of the plugin to inspect.',
366
+ },
367
+ },
368
+ required: ['pluginName'],
369
+ },
370
+ execute: async (args, context) => {
371
+ if (!context.pluginManager) {
372
+ return {
373
+ error: 'Plugin subsystem is not available in the current execution context.',
374
+ };
375
+ }
376
+ const pluginName = args.pluginName?.trim();
377
+ if (!pluginName) {
378
+ return { error: 'Missing or invalid "pluginName" parameter.' };
379
+ }
380
+ const info = context.pluginManager.getPluginInfo(pluginName);
381
+ if (!info.found) {
382
+ return {
383
+ success: false,
384
+ error: info.error || `Plugin "${pluginName}" could not be found.`,
385
+ };
386
+ }
387
+ return {
388
+ success: true,
389
+ name: info.manifest?.name || pluginName,
390
+ isLoaded: info.isLoaded,
391
+ version: info.manifest?.version || '1.0.0',
392
+ description: info.manifest?.description || '',
393
+ author: info.manifest?.author,
394
+ license: info.manifest?.license,
395
+ homepage: info.manifest?.homepage,
396
+ repository: info.manifest?.repository,
397
+ keywords: info.manifest?.keywords || [],
398
+ rootDir: info.rootDir,
399
+ dataDir: info.dataDir,
400
+ skills: info.skills,
401
+ mcpServers: info.mcpServers,
402
+ activeTools: info.activeTools || [],
403
+ };
404
+ },
405
+ };
406
+ //# sourceMappingURL=pluginTools.js.map