amalgm 0.1.72 → 0.1.73
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/package.json +1 -2
- package/runtime/scripts/amalgm-mcp/agents/rest.js +29 -22
- package/runtime/scripts/amalgm-mcp/agents/store.js +90 -24
- package/runtime/scripts/amalgm-mcp/agents/talk.js +66 -37
- package/runtime/scripts/amalgm-mcp/agents/tools.js +0 -4
- package/runtime/scripts/amalgm-mcp/automations/runner.js +4 -5
- package/runtime/scripts/amalgm-mcp/automations/tool-actions.js +54 -57
- package/runtime/scripts/amalgm-mcp/automations/tools.js +4 -4
- package/runtime/scripts/amalgm-mcp/email/inbound.js +21 -0
- package/runtime/scripts/amalgm-mcp/events/internal-workflows.js +3 -3
- package/runtime/scripts/amalgm-mcp/index.js +3 -1
- package/runtime/scripts/amalgm-mcp/lib/prefs.js +15 -0
- package/runtime/scripts/amalgm-mcp/mcp-connections/rest.js +5 -3
- package/runtime/scripts/amalgm-mcp/runtime-worker.js +47 -0
- package/runtime/scripts/amalgm-mcp/server/combined-service.js +27 -0
- package/runtime/scripts/amalgm-mcp/server/control-plane-service.js +24 -0
- package/runtime/scripts/amalgm-mcp/server/core-tools.js +52 -7
- package/runtime/scripts/amalgm-mcp/server/http-context.js +44 -0
- package/runtime/scripts/amalgm-mcp/server/http-service.js +34 -0
- package/runtime/scripts/amalgm-mcp/server/http.js +31 -465
- package/runtime/scripts/amalgm-mcp/server/local-service-router.js +57 -0
- package/runtime/scripts/amalgm-mcp/server/mcp-adapter.js +22 -0
- package/runtime/scripts/amalgm-mcp/server/mcp-http-service.js +24 -0
- package/runtime/scripts/amalgm-mcp/server/mcp-request-context.js +32 -0
- package/runtime/scripts/amalgm-mcp/server/mcp.js +14 -73
- package/runtime/scripts/amalgm-mcp/server/routes/agents.js +29 -0
- package/runtime/scripts/amalgm-mcp/server/routes/apps.js +59 -0
- package/runtime/scripts/amalgm-mcp/server/routes/automations.js +45 -0
- package/runtime/scripts/amalgm-mcp/server/routes/browser.js +49 -0
- package/runtime/scripts/amalgm-mcp/server/routes/credentials.js +30 -0
- package/runtime/scripts/amalgm-mcp/server/routes/events.js +18 -0
- package/runtime/scripts/amalgm-mcp/server/routes/files.js +33 -0
- package/runtime/scripts/amalgm-mcp/server/routes/health.js +24 -0
- package/runtime/scripts/amalgm-mcp/server/routes/inbound.js +18 -0
- package/runtime/scripts/amalgm-mcp/server/routes/local.js +21 -0
- package/runtime/scripts/amalgm-mcp/server/routes/preferences.js +18 -0
- package/runtime/scripts/amalgm-mcp/server/routes/state.js +23 -0
- package/runtime/scripts/amalgm-mcp/server/routes/toolbox.js +59 -0
- package/runtime/scripts/amalgm-mcp/server/routes/workspace.js +57 -0
- package/runtime/scripts/amalgm-mcp/server/service-lifecycle.js +54 -0
- package/runtime/scripts/amalgm-mcp/services/control-plane.js +19 -0
- package/runtime/scripts/amalgm-mcp/services/mcp-adapter.js +12 -0
- package/runtime/scripts/amalgm-mcp/services/runtime-worker.js +18 -0
- package/runtime/scripts/amalgm-mcp/slack/inbound.js +21 -0
- package/runtime/scripts/amalgm-mcp/state/snapshot.js +3 -3
- package/runtime/scripts/amalgm-mcp/tests/agents-source-of-truth.test.js +82 -0
- package/runtime/scripts/amalgm-mcp/tests/automations-store-runner.test.js +5 -5
- package/runtime/scripts/amalgm-mcp/tests/core-tools.test.js +37 -0
- package/runtime/scripts/amalgm-mcp/tests/mcp-surface.test.js +158 -0
- package/runtime/scripts/amalgm-mcp/tests/server-routing.test.js +81 -0
- package/runtime/scripts/amalgm-mcp/tests/server-services.test.js +156 -0
- package/runtime/scripts/amalgm-mcp/tests/system-catalog.test.js +81 -0
- package/runtime/scripts/amalgm-mcp/tests/toolbox-service.test.js +250 -0
- package/runtime/scripts/amalgm-mcp/toolbox/mcp-surface.js +106 -0
- package/runtime/scripts/amalgm-mcp/toolbox/names.js +41 -0
- package/runtime/scripts/amalgm-mcp/toolbox/rest.js +107 -53
- package/runtime/scripts/amalgm-mcp/toolbox/runner.js +9 -75
- package/runtime/scripts/amalgm-mcp/toolbox/selection.js +22 -0
- package/runtime/scripts/amalgm-mcp/toolbox/service.js +227 -0
- package/runtime/scripts/amalgm-mcp/toolbox/store.js +9 -78
- package/runtime/scripts/amalgm-mcp/toolbox/system-catalog.js +112 -0
- package/runtime/scripts/amalgm-mcp/toolbox/tools.js +11 -74
- package/runtime/scripts/amalgm-mcp/workflows/compiler.js +1 -1
- package/runtime/scripts/amalgm-mcp/workflows/runner.js +4 -5
|
@@ -2,71 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
const { textResult } = require('../lib/tool-result');
|
|
4
4
|
const {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
getTool,
|
|
8
|
-
getToolAction,
|
|
9
|
-
readToolbox,
|
|
10
|
-
updateTool,
|
|
11
|
-
updateToolAction,
|
|
12
|
-
upsertTool,
|
|
13
|
-
upsertToolAction,
|
|
14
|
-
} = require('./store');
|
|
15
|
-
const { toolboxMcpToolName } = require('./runner');
|
|
16
|
-
|
|
17
|
-
function compactAction(action) {
|
|
18
|
-
return {
|
|
19
|
-
id: action.id,
|
|
20
|
-
name: action.name,
|
|
21
|
-
ref: `${action.toolId}.${action.name}`,
|
|
22
|
-
status: action.status,
|
|
23
|
-
description: action.description,
|
|
24
|
-
mcpToolName: toolboxMcpToolName(action),
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
function compactTool(tool, actions) {
|
|
29
|
-
return {
|
|
30
|
-
id: tool.id,
|
|
31
|
-
name: tool.name,
|
|
32
|
-
type: tool.type,
|
|
33
|
-
owner: tool.owner,
|
|
34
|
-
origin: tool.origin,
|
|
35
|
-
status: tool.status,
|
|
36
|
-
discovery: tool.discovery,
|
|
37
|
-
actions: actions.map(compactAction),
|
|
38
|
-
actionCount: actions.length,
|
|
39
|
-
source: tool.source,
|
|
40
|
-
guide: tool.guide,
|
|
41
|
-
display: tool.display,
|
|
42
|
-
policy: tool.policy,
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
function listPayload(args = {}) {
|
|
47
|
-
const toolbox = readToolbox();
|
|
48
|
-
const actionsByTool = new Map();
|
|
49
|
-
for (const action of Object.values(toolbox.toolActions || {})) {
|
|
50
|
-
const existing = actionsByTool.get(action.toolId) || [];
|
|
51
|
-
existing.push(action);
|
|
52
|
-
actionsByTool.set(action.toolId, existing);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
const tools = Object.values(toolbox.tools || {})
|
|
56
|
-
.filter((tool) => !args.type || tool.type === args.type)
|
|
57
|
-
.filter((tool) => !args.owner || tool.owner === args.owner)
|
|
58
|
-
.filter((tool) => !args.origin || tool.origin === args.origin)
|
|
59
|
-
.map((tool) => compactTool(tool, actionsByTool.get(tool.id) || []));
|
|
60
|
-
|
|
61
|
-
const payload = {
|
|
62
|
-
version: toolbox.version,
|
|
63
|
-
tools,
|
|
64
|
-
...(args.include_actions
|
|
65
|
-
? { toolActions: toolbox.toolActions }
|
|
66
|
-
: {}),
|
|
67
|
-
};
|
|
68
|
-
return payload;
|
|
69
|
-
}
|
|
5
|
+
defaultToolboxService: toolboxService,
|
|
6
|
+
} = require('./service');
|
|
70
7
|
|
|
71
8
|
module.exports = [
|
|
72
9
|
{
|
|
@@ -82,7 +19,7 @@ module.exports = [
|
|
|
82
19
|
},
|
|
83
20
|
},
|
|
84
21
|
async handler(args) {
|
|
85
|
-
return textResult(JSON.stringify(
|
|
22
|
+
return textResult(JSON.stringify(toolboxService.listTools(args || {}), null, 2));
|
|
86
23
|
},
|
|
87
24
|
},
|
|
88
25
|
{
|
|
@@ -97,7 +34,7 @@ module.exports = [
|
|
|
97
34
|
required: ['id'],
|
|
98
35
|
},
|
|
99
36
|
async handler(args) {
|
|
100
|
-
const payload = getTool(args?.id, { includeActions: args?.include_actions !== false });
|
|
37
|
+
const payload = toolboxService.getTool(args?.id, { includeActions: args?.include_actions !== false });
|
|
101
38
|
return textResult(JSON.stringify(payload, null, 2));
|
|
102
39
|
},
|
|
103
40
|
},
|
|
@@ -140,7 +77,7 @@ module.exports = [
|
|
|
140
77
|
required: ['id', 'name', 'type'],
|
|
141
78
|
},
|
|
142
79
|
async handler(args) {
|
|
143
|
-
const saved =
|
|
80
|
+
const saved = toolboxService.registerTool(args || {});
|
|
144
81
|
return textResult(JSON.stringify({ ok: true, ...saved }, null, 2));
|
|
145
82
|
},
|
|
146
83
|
},
|
|
@@ -180,7 +117,7 @@ module.exports = [
|
|
|
180
117
|
required: ['id'],
|
|
181
118
|
},
|
|
182
119
|
async handler(args) {
|
|
183
|
-
const saved = updateTool(args || {});
|
|
120
|
+
const saved = toolboxService.updateTool(args || {});
|
|
184
121
|
return textResult(JSON.stringify({ ok: true, ...saved }, null, 2));
|
|
185
122
|
},
|
|
186
123
|
},
|
|
@@ -195,7 +132,7 @@ module.exports = [
|
|
|
195
132
|
required: ['id'],
|
|
196
133
|
},
|
|
197
134
|
async handler(args) {
|
|
198
|
-
const payload =
|
|
135
|
+
const payload = toolboxService.getAction(args?.id);
|
|
199
136
|
return textResult(JSON.stringify(payload, null, 2));
|
|
200
137
|
},
|
|
201
138
|
},
|
|
@@ -221,7 +158,7 @@ module.exports = [
|
|
|
221
158
|
required: ['toolId', 'name'],
|
|
222
159
|
},
|
|
223
160
|
async handler(args) {
|
|
224
|
-
const action =
|
|
161
|
+
const action = toolboxService.registerAction(args || {});
|
|
225
162
|
return textResult(JSON.stringify({ ok: true, action }, null, 2));
|
|
226
163
|
},
|
|
227
164
|
},
|
|
@@ -247,7 +184,7 @@ module.exports = [
|
|
|
247
184
|
required: ['id'],
|
|
248
185
|
},
|
|
249
186
|
async handler(args) {
|
|
250
|
-
const action =
|
|
187
|
+
const action = toolboxService.updateAction(args || {});
|
|
251
188
|
return textResult(JSON.stringify({ ok: true, action }, null, 2));
|
|
252
189
|
},
|
|
253
190
|
},
|
|
@@ -262,7 +199,7 @@ module.exports = [
|
|
|
262
199
|
required: ['id'],
|
|
263
200
|
},
|
|
264
201
|
async handler(args) {
|
|
265
|
-
return textResult(JSON.stringify(deleteTool(args?.id), null, 2));
|
|
202
|
+
return textResult(JSON.stringify(toolboxService.deleteTool(args?.id), null, 2));
|
|
266
203
|
},
|
|
267
204
|
},
|
|
268
205
|
{
|
|
@@ -276,7 +213,7 @@ module.exports = [
|
|
|
276
213
|
required: ['id'],
|
|
277
214
|
},
|
|
278
215
|
async handler(args) {
|
|
279
|
-
return textResult(JSON.stringify(
|
|
216
|
+
return textResult(JSON.stringify(toolboxService.deleteAction(args?.id), null, 2));
|
|
280
217
|
},
|
|
281
218
|
},
|
|
282
219
|
];
|
|
@@ -136,7 +136,7 @@ function makeBuilders() {
|
|
|
136
136
|
const args = isObject(promptOrArgs)
|
|
137
137
|
? { agent, ...promptOrArgs }
|
|
138
138
|
: { agent, prompt: String(promptOrArgs || '') };
|
|
139
|
-
return builders.tool(name, 'amalgm.talk_to_agent', args, options);
|
|
139
|
+
return builders.tool(name, 'amalgm.agents.talk_to_agent', args, options);
|
|
140
140
|
};
|
|
141
141
|
|
|
142
142
|
builders.workflow = (definition) => definition;
|
|
@@ -10,7 +10,7 @@ const { recordEventRun } = require('../events/store');
|
|
|
10
10
|
const { compileWorkflowText } = require('./compiler');
|
|
11
11
|
const { loadWorkflows } = require('./store');
|
|
12
12
|
const { callToolboxMcpTool, toolboxMcpToolName } = require('../toolbox/runner');
|
|
13
|
-
const {
|
|
13
|
+
const { resolveFirstPartyToolAction, resolveToolboxAction, suggestWorkflowToolActions } = require('../automations/tool-actions');
|
|
14
14
|
|
|
15
15
|
const DEFAULT_CELL_TIMEOUT_MS = 120_000;
|
|
16
16
|
const DEFAULT_CODE_TIMEOUT_MS = 15_000;
|
|
@@ -290,10 +290,9 @@ async function runToolCell(cell, args, allowlist) {
|
|
|
290
290
|
return runHttpTool(args);
|
|
291
291
|
}
|
|
292
292
|
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
const result = await coreTool.handler(args, {
|
|
293
|
+
const firstPartyAction = resolveFirstPartyToolAction(cell.toolId, cell.actionName);
|
|
294
|
+
if (firstPartyAction) {
|
|
295
|
+
const result = await firstPartyAction.tool.handler(args, {
|
|
297
296
|
workflow: true,
|
|
298
297
|
sessionMetadata: {
|
|
299
298
|
origin: 'event-workflow',
|