n8n-nodes-vercel-ai-sdk-universal-temp 0.3.2 → 0.3.4
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/nodes/UniversalAI/UniversalAI.node.d.ts +1 -0
- package/dist/nodes/UniversalAI/UniversalAI.node.js +47 -35
- package/dist/nodes/UniversalAI/UniversalAI.node.js.map +1 -1
- package/dist/nodes/UniversalAI/helpers/cacheMetrics.d.ts +1 -1
- package/dist/nodes/UniversalAI/helpers/cacheMetrics.js.map +1 -1
- package/dist/nodes/UniversalAI/helpers/inputBuilder.js +16 -0
- package/dist/nodes/UniversalAI/helpers/inputBuilder.js.map +1 -1
- package/dist/nodes/UniversalAI/helpers/responseFormatter.js +6 -6
- package/dist/nodes/UniversalAI/helpers/responseFormatter.js.map +1 -1
- package/dist/nodes/UniversalAI/helpers/utils.d.ts +1 -1
- package/dist/nodes/UniversalAI/helpers/utils.js +6 -2
- package/dist/nodes/UniversalAI/helpers/utils.js.map +1 -1
- package/dist/nodes/UniversalAI/providers/google.d.ts +2 -2
- package/dist/nodes/UniversalAI/providers/google.js +9 -5
- package/dist/nodes/UniversalAI/providers/google.js.map +1 -1
- package/dist/nodes/UniversalAI/providers/index.js +2 -0
- package/dist/nodes/UniversalAI/providers/index.js.map +1 -1
- package/dist/nodes/UniversalAI/providers/letta.d.ts +16 -0
- package/dist/nodes/UniversalAI/providers/letta.js +77 -0
- package/dist/nodes/UniversalAI/providers/letta.js.map +1 -0
- package/dist/nodes/UniversalAI/providers/strategy.d.ts +3 -1
- package/dist/nodes/UniversalAI/providers/types.d.ts +2 -2
- package/dist/nodes/UniversalAgent/UniversalAgent.node.d.ts +1 -12
- package/dist/nodes/UniversalAgent/UniversalAgent.node.js +58 -398
- package/dist/nodes/UniversalAgent/UniversalAgent.node.js.map +1 -1
- package/dist/nodes/UniversalAgent/UniversalAgentDescription.d.ts +2 -0
- package/dist/nodes/UniversalAgent/UniversalAgentDescription.js +1381 -0
- package/dist/nodes/UniversalAgent/UniversalAgentDescription.js.map +1 -0
- package/dist/nodes/UniversalAgent/handlers/agent.handler.d.ts +2 -0
- package/dist/nodes/UniversalAgent/handlers/agent.handler.js +253 -0
- package/dist/nodes/UniversalAgent/handlers/agent.handler.js.map +1 -0
- package/dist/nodes/UniversalAgent/handlers/archives.handler.d.ts +2 -0
- package/dist/nodes/UniversalAgent/handlers/archives.handler.js +70 -0
- package/dist/nodes/UniversalAgent/handlers/archives.handler.js.map +1 -0
- package/dist/nodes/UniversalAgent/handlers/batches.handler.d.ts +2 -0
- package/dist/nodes/UniversalAgent/handlers/batches.handler.js +59 -0
- package/dist/nodes/UniversalAgent/handlers/batches.handler.js.map +1 -0
- package/dist/nodes/UniversalAgent/handlers/blocks.handler.d.ts +2 -0
- package/dist/nodes/UniversalAgent/handlers/blocks.handler.js +103 -0
- package/dist/nodes/UniversalAgent/handlers/blocks.handler.js.map +1 -0
- package/dist/nodes/UniversalAgent/handlers/chat.handler.d.ts +2 -0
- package/dist/nodes/UniversalAgent/handlers/chat.handler.js +61 -0
- package/dist/nodes/UniversalAgent/handlers/chat.handler.js.map +1 -0
- package/dist/nodes/UniversalAgent/handlers/folders.handler.d.ts +2 -0
- package/dist/nodes/UniversalAgent/handlers/folders.handler.js +94 -0
- package/dist/nodes/UniversalAgent/handlers/folders.handler.js.map +1 -0
- package/dist/nodes/UniversalAgent/handlers/groups.handler.d.ts +2 -0
- package/dist/nodes/UniversalAgent/handlers/groups.handler.js +70 -0
- package/dist/nodes/UniversalAgent/handlers/groups.handler.js.map +1 -0
- package/dist/nodes/UniversalAgent/handlers/identity.handler.d.ts +2 -0
- package/dist/nodes/UniversalAgent/handlers/identity.handler.js +86 -0
- package/dist/nodes/UniversalAgent/handlers/identity.handler.js.map +1 -0
- package/dist/nodes/UniversalAgent/handlers/mcp.handler.d.ts +2 -0
- package/dist/nodes/UniversalAgent/handlers/mcp.handler.js +114 -0
- package/dist/nodes/UniversalAgent/handlers/mcp.handler.js.map +1 -0
- package/dist/nodes/UniversalAgent/handlers/models.handler.d.ts +2 -0
- package/dist/nodes/UniversalAgent/handlers/models.handler.js +55 -0
- package/dist/nodes/UniversalAgent/handlers/models.handler.js.map +1 -0
- package/dist/nodes/UniversalAgent/handlers/runs.handler.d.ts +2 -0
- package/dist/nodes/UniversalAgent/handlers/runs.handler.js +59 -0
- package/dist/nodes/UniversalAgent/handlers/runs.handler.js.map +1 -0
- package/dist/nodes/UniversalAgent/handlers/steps.handler.d.ts +2 -0
- package/dist/nodes/UniversalAgent/handlers/steps.handler.js +37 -0
- package/dist/nodes/UniversalAgent/handlers/steps.handler.js.map +1 -0
- package/dist/nodes/UniversalAgent/handlers/tags.handler.d.ts +2 -0
- package/dist/nodes/UniversalAgent/handlers/tags.handler.js +36 -0
- package/dist/nodes/UniversalAgent/handlers/tags.handler.js.map +1 -0
- package/dist/nodes/UniversalAgent/handlers/templates.handler.d.ts +2 -0
- package/dist/nodes/UniversalAgent/handlers/templates.handler.js +59 -0
- package/dist/nodes/UniversalAgent/handlers/templates.handler.js.map +1 -0
- package/dist/nodes/UniversalAgent/handlers/tools.handler.d.ts +2 -0
- package/dist/nodes/UniversalAgent/handlers/tools.handler.js +176 -0
- package/dist/nodes/UniversalAgent/handlers/tools.handler.js.map +1 -0
- package/dist/nodes/UniversalAgent/handlers/utils.d.ts +21 -0
- package/dist/nodes/UniversalAgent/handlers/utils.js +165 -0
- package/dist/nodes/UniversalAgent/handlers/utils.js.map +1 -0
- package/dist/nodes/UniversalEmbedding/UniversalEmbedding.node.d.ts +2 -1
- package/dist/nodes/UniversalEmbedding/UniversalEmbedding.node.js +7 -10
- package/dist/nodes/UniversalEmbedding/UniversalEmbedding.node.js.map +1 -1
- package/dist/nodes/UniversalImageGen/UniversalImageGen.node.d.ts +2 -1
- package/dist/nodes/UniversalImageGen/UniversalImageGen.node.js +41 -24
- package/dist/nodes/UniversalImageGen/UniversalImageGen.node.js.map +1 -1
- package/dist/nodes/UniversalSpeechGen/UniversalSpeechGen.node.d.ts +2 -1
- package/dist/nodes/UniversalSpeechGen/UniversalSpeechGen.node.js +6 -6
- package/dist/nodes/UniversalSpeechGen/UniversalSpeechGen.node.js.map +1 -1
- package/dist/nodes/UniversalTranscription/UniversalTranscription.node.d.ts +2 -1
- package/dist/nodes/UniversalTranscription/UniversalTranscription.node.js +6 -6
- package/dist/nodes/UniversalTranscription/UniversalTranscription.node.js.map +1 -1
- package/dist/nodes/shared/DescriptionBuilder.d.ts +1 -0
- package/dist/nodes/shared/DescriptionBuilder.js +18 -0
- package/dist/nodes/shared/DescriptionBuilder.js.map +1 -1
- package/dist/nodes/shared/cache/registry.d.ts +15 -0
- package/dist/nodes/shared/cache/registry.js +51 -0
- package/dist/nodes/shared/cache/registry.js.map +1 -0
- package/dist/nodes/shared/descriptions.js +365 -2177
- package/dist/nodes/shared/descriptions.js.map +1 -1
- package/dist/nodes/shared/helpers.d.ts +2 -2
- package/dist/nodes/shared/helpers.js +3 -3
- package/dist/nodes/shared/helpers.js.map +1 -1
- package/dist/nodes/shared/letta/client.d.ts +34 -9
- package/dist/nodes/shared/letta/client.js +289 -45
- package/dist/nodes/shared/letta/client.js.map +1 -1
- package/dist/nodes/shared/letta/index.d.ts +2 -2
- package/dist/nodes/shared/letta/index.js +1 -1
- package/dist/nodes/shared/letta/index.js.map +1 -1
- package/dist/nodes/shared/providers/factory.d.ts +3 -2
- package/dist/nodes/shared/providers/factory.js +97 -19
- package/dist/nodes/shared/providers/factory.js.map +1 -1
- package/dist/nodes/shared/providers/registry.d.ts +4 -0
- package/dist/nodes/shared/providers/registry.js +4 -0
- package/dist/nodes/shared/providers/registry.js.map +1 -1
- package/dist/nodes/shared/types.d.ts +7 -1
- package/package.json +19 -19
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.handleChatOperation = handleChatOperation;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const letta_1 = require("../../shared/letta");
|
|
6
|
+
const utils_1 = require("./utils");
|
|
7
|
+
const utils_2 = require("./utils");
|
|
8
|
+
async function handleChatOperation(exec, index) {
|
|
9
|
+
const client = await (0, letta_1.getLettaProvider)(exec, index);
|
|
10
|
+
const params = (0, utils_2.extractParams)(exec, index, [
|
|
11
|
+
{ name: 'message', type: 'string', required: true },
|
|
12
|
+
{ name: 'agentId', type: 'string', required: true },
|
|
13
|
+
{ name: 'identityId', type: 'string', required: false },
|
|
14
|
+
]);
|
|
15
|
+
const message = params.message;
|
|
16
|
+
const agentId = params.agentId;
|
|
17
|
+
const identityId = params.identityId;
|
|
18
|
+
const chatOptions = buildChatOptions(exec, index);
|
|
19
|
+
if (chatOptions.background) {
|
|
20
|
+
throw new n8n_workflow_1.NodeOperationError(exec.getNode(), 'Background mode is not supported for chat operations. Please disable background processing.');
|
|
21
|
+
}
|
|
22
|
+
const response = await client.sendMessage(agentId, message, identityId, chatOptions);
|
|
23
|
+
return processChatResponse(response, index);
|
|
24
|
+
}
|
|
25
|
+
function buildChatOptions(exec, index) {
|
|
26
|
+
return {};
|
|
27
|
+
}
|
|
28
|
+
function processChatResponse(response, index) {
|
|
29
|
+
if (Array.isArray(response)) {
|
|
30
|
+
return [{ json: { responses: response }, pairedItem: { item: index } }];
|
|
31
|
+
}
|
|
32
|
+
if (!response) {
|
|
33
|
+
throw new Error('No response received from Letta API');
|
|
34
|
+
}
|
|
35
|
+
let text = '';
|
|
36
|
+
const finishReason = response.stopReason || response.stop_reason;
|
|
37
|
+
const usage = response.usage;
|
|
38
|
+
if (response.messages) {
|
|
39
|
+
text = (0, utils_1.extractTextFromLettaMessages)(response.messages);
|
|
40
|
+
}
|
|
41
|
+
else if (response.content) {
|
|
42
|
+
const content = response.content;
|
|
43
|
+
text = typeof content === 'string' ? content : JSON.stringify(content);
|
|
44
|
+
}
|
|
45
|
+
else if (response.text) {
|
|
46
|
+
text = response.text;
|
|
47
|
+
}
|
|
48
|
+
else if (response.message) {
|
|
49
|
+
text = (0, utils_1.extractTextFromLettaMessage)(response.message);
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
text = (0, utils_1.extractTextFromLettaMessages)(response);
|
|
53
|
+
}
|
|
54
|
+
return [
|
|
55
|
+
{
|
|
56
|
+
json: { text, finishReason, usage, rawResponse: response },
|
|
57
|
+
pairedItem: { item: index },
|
|
58
|
+
},
|
|
59
|
+
];
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=chat.handler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat.handler.js","sourceRoot":"","sources":["../../../../nodes/UniversalAgent/handlers/chat.handler.ts"],"names":[],"mappings":";;AAQA,kDA4BC;AApCD,+CAAsG;AACtG,8CAAsD;AACtD,mCAGiB;AACjB,mCAAwC;AAEjC,KAAK,UAAU,mBAAmB,CACrC,IAAuB,EACvB,KAAa;IAEb,MAAM,MAAM,GAAG,MAAM,IAAA,wBAAgB,EAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACnD,MAAM,MAAM,GAAG,IAAA,qBAAa,EAAC,IAAI,EAAE,KAAK,EAAE;QACtC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;QACnD,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;QACnD,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE;KAC1D,CAAC,CAAC;IAEH,MAAM,OAAO,GAAG,MAAM,CAAC,OAAiB,CAAC;IACzC,MAAM,OAAO,GAAG,MAAM,CAAC,OAAiB,CAAC;IACzC,MAAM,UAAU,GAAG,MAAM,CAAC,UAAgC,CAAC;IAE3D,MAAM,WAAW,GAAG,gBAAgB,CAAC,IAAI,EAAE,KAAK,CAAC,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AAC,SAAS,CAAC,OAAO,CAAC,CAAC;IAC3E,CAAC;SAAM,IAAK,QAAwB,CAAC,IAAI,EAAE,CAAC;QAExC,IAAI,GAAI,QAAwB,CAAC,IAAc,CAAC;IACpD,CAAC;SAAM,IAAK,QAAwB,CAAC,OAAO,EAAE,CAAC;QAE3C,IAAI,GAAG,IAAA,mCAA2B,EAAE,QAAwB,CAAC,OAAsB,CAAC,CAAC;IACzF,CAAC;SAAM,CAAC;QAEJ,IAAI,GAAG,IAAA,oCAA4B,EAAC,QAAuB,CAAC,CAAC;IACjE,CAAC;IAED,OAAO;QACH;YACI,IAAI,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE;YAC1D,UAAU,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE;SAC9B;KACJ,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.handleFoldersOperation = handleFoldersOperation;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const letta_1 = require("../../shared/letta");
|
|
6
|
+
async function handleFoldersOperation(exec, index) {
|
|
7
|
+
const client = await (0, letta_1.getLettaProvider)(exec, index);
|
|
8
|
+
const operation = exec.getNodeParameter('operation', index);
|
|
9
|
+
switch (operation) {
|
|
10
|
+
case 'list': {
|
|
11
|
+
const folders = await client.listFolders();
|
|
12
|
+
return [
|
|
13
|
+
{
|
|
14
|
+
json: {
|
|
15
|
+
folders: folders.map((folder) => ({
|
|
16
|
+
id: folder.id,
|
|
17
|
+
name: folder.name,
|
|
18
|
+
embeddingConfig: folder.embedding_config,
|
|
19
|
+
})),
|
|
20
|
+
total: folders.length,
|
|
21
|
+
},
|
|
22
|
+
pairedItem: { item: index },
|
|
23
|
+
},
|
|
24
|
+
];
|
|
25
|
+
}
|
|
26
|
+
case 'create': {
|
|
27
|
+
const name = exec.getNodeParameter('name', index);
|
|
28
|
+
const embeddingConfig = exec.getNodeParameter('embeddingConfig', index, {});
|
|
29
|
+
const folder = await client.createFolder({
|
|
30
|
+
name,
|
|
31
|
+
embedding_config: embeddingConfig,
|
|
32
|
+
});
|
|
33
|
+
return [
|
|
34
|
+
{
|
|
35
|
+
json: {
|
|
36
|
+
folderId: folder.id,
|
|
37
|
+
name: folder.name,
|
|
38
|
+
embeddingConfig: folder.embedding_config,
|
|
39
|
+
},
|
|
40
|
+
pairedItem: { item: index },
|
|
41
|
+
},
|
|
42
|
+
];
|
|
43
|
+
}
|
|
44
|
+
case 'get': {
|
|
45
|
+
const folderId = exec.getNodeParameter('folderId', index);
|
|
46
|
+
const folder = await client.getFolder(folderId);
|
|
47
|
+
return [
|
|
48
|
+
{
|
|
49
|
+
json: {
|
|
50
|
+
folderId: folder.id,
|
|
51
|
+
name: folder.name,
|
|
52
|
+
embeddingConfig: folder.embedding_config,
|
|
53
|
+
},
|
|
54
|
+
pairedItem: { item: index },
|
|
55
|
+
},
|
|
56
|
+
];
|
|
57
|
+
}
|
|
58
|
+
case 'update': {
|
|
59
|
+
const folderId = exec.getNodeParameter('folderId', index);
|
|
60
|
+
const name = exec.getNodeParameter('name', index);
|
|
61
|
+
const embeddingConfig = exec.getNodeParameter('embeddingConfig', index, {});
|
|
62
|
+
const folder = await client.updateFolder(folderId, {
|
|
63
|
+
name,
|
|
64
|
+
embedding_config: embeddingConfig,
|
|
65
|
+
});
|
|
66
|
+
return [
|
|
67
|
+
{
|
|
68
|
+
json: {
|
|
69
|
+
folderId: folder.id,
|
|
70
|
+
name: folder.name,
|
|
71
|
+
embeddingConfig: folder.embedding_config,
|
|
72
|
+
},
|
|
73
|
+
pairedItem: { item: index },
|
|
74
|
+
},
|
|
75
|
+
];
|
|
76
|
+
}
|
|
77
|
+
case 'delete': {
|
|
78
|
+
const folderId = exec.getNodeParameter('folderId', index);
|
|
79
|
+
await client.deleteFolder(folderId);
|
|
80
|
+
return [
|
|
81
|
+
{
|
|
82
|
+
json: {
|
|
83
|
+
deleted: true,
|
|
84
|
+
folderId,
|
|
85
|
+
},
|
|
86
|
+
pairedItem: { item: index },
|
|
87
|
+
},
|
|
88
|
+
];
|
|
89
|
+
}
|
|
90
|
+
default:
|
|
91
|
+
throw new n8n_workflow_1.NodeOperationError(exec.getNode(), `Unsupported folders operation: ${operation}`);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=folders.handler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"folders.handler.js","sourceRoot":"","sources":["../../../../nodes/UniversalAgent/handlers/folders.handler.ts"],"names":[],"mappings":";;AAGA,wDAuGC;AA1GD,+CAAsG;AACtG,8CAAsD;AAE/C,KAAK,UAAU,sBAAsB,CACxC,IAAuB,EACvB,KAAa;IAEb,MAAM,MAAM,GAAG,MAAM,IAAA,wBAAgB,EAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACnD,MAAM,SAAS,GAAG,IAAI,CAAC,gBAAgB,CAAC,WAAW,EAAE,KAAK,CAK5C,CAAC;IAEf,QAAQ,SAAS,EAAE,CAAC;QAChB,KAAK,MAAM,CAAC,CAAC,CAAC;YACV,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,WAAW,EAAE,CAAC;YAE3C,OAAO;gBACH;oBACI,IAAI,EAAE;wBACF,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,MAAmB,EAAE,EAAE,CAAC,CAAC;4BAC3C,EAAE,EAAE,MAAM,CAAC,EAAE;4BACb,IAAI,EAAE,MAAM,CAAC,IAAI;4BACjB,eAAe,EAAE,MAAM,CAAC,gBAAgB;yBAC3C,CAAC,CAAC;wBACH,KAAK,EAAE,OAAO,CAAC,MAAM;qBACxB;oBACD,UAAU,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE;iBAC9B;aACJ,CAAC;QACN,CAAC;QACD,KAAK,QAAQ,CAAC,CAAC,CAAC;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AE,EAAE,CAAgB,CAAC;YAE3F,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,QAAQ,EAAE;gBAC/C,IAAI;gBACJ,gBAAgB,EAAE,eAAe;aACpC,CAAC,CAAC;YAEH,OAAO;gBACH;oBACI,IAAI,EAAE;wBACF,QAAQ,EAAE,MAAM,CAAC,EAAE;wBACnB,IAAI,EAAE,MAAM,CAAC,IAAI;wBACjB,eAAe,EAAE,MAAM,CAAC,gBAAgB;qBAC3C;oBACD,UAAU,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE;iBAC9B;aACJ,CAAC;QACN,CAAC;QACD,KAAK,QAAQ,CAAC,CAAC,CAAC;YACZ,MAAM,QAAQ,GAAG,IAAI,CAAC,gBAAgB,CAAC,UAAU,EAAE,KAAK,CAAW,CAAC;YACpE,MAAM,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;YAEpC,OAAO;gBACH;oBACI,IAAI,EAAE;wBACF,OAAO,EAAE,IAAI;wBACb,QAAQ;qBACX;oBACD,UAAU,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE;iBAC9B;aACJ,CAAC;QACN,CAAC;QACD;YACI,MAAM,IAAI,iCAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,kCAAkC,SAAS,EAAE,CAAC,CAAC;IACpG,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.handleGroupsOperation = handleGroupsOperation;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const letta_1 = require("../../shared/letta");
|
|
6
|
+
async function handleGroupsOperation(exec, index) {
|
|
7
|
+
const client = await (0, letta_1.getLettaProvider)(exec, index);
|
|
8
|
+
const operation = exec.getNodeParameter('operation', index);
|
|
9
|
+
switch (operation) {
|
|
10
|
+
case 'create': {
|
|
11
|
+
const jsonParameters = exec.getNodeParameter('jsonParameters', index, {});
|
|
12
|
+
const group = await client.createGroup(jsonParameters);
|
|
13
|
+
return [
|
|
14
|
+
{
|
|
15
|
+
json: group,
|
|
16
|
+
pairedItem: { item: index },
|
|
17
|
+
},
|
|
18
|
+
];
|
|
19
|
+
}
|
|
20
|
+
case 'list': {
|
|
21
|
+
const groups = await client.listGroups();
|
|
22
|
+
return [
|
|
23
|
+
{
|
|
24
|
+
json: {
|
|
25
|
+
groups,
|
|
26
|
+
total: groups.length,
|
|
27
|
+
},
|
|
28
|
+
pairedItem: { item: index },
|
|
29
|
+
},
|
|
30
|
+
];
|
|
31
|
+
}
|
|
32
|
+
case 'get': {
|
|
33
|
+
const groupId = exec.getNodeParameter('groupId', index);
|
|
34
|
+
const group = await client.getGroup(groupId);
|
|
35
|
+
return [
|
|
36
|
+
{
|
|
37
|
+
json: group,
|
|
38
|
+
pairedItem: { item: index },
|
|
39
|
+
},
|
|
40
|
+
];
|
|
41
|
+
}
|
|
42
|
+
case 'update': {
|
|
43
|
+
const groupId = exec.getNodeParameter('groupId', index);
|
|
44
|
+
const jsonParameters = exec.getNodeParameter('jsonParameters', index, {});
|
|
45
|
+
const group = await client.updateGroup(groupId, jsonParameters);
|
|
46
|
+
return [
|
|
47
|
+
{
|
|
48
|
+
json: group,
|
|
49
|
+
pairedItem: { item: index },
|
|
50
|
+
},
|
|
51
|
+
];
|
|
52
|
+
}
|
|
53
|
+
case 'delete': {
|
|
54
|
+
const groupId = exec.getNodeParameter('groupId', index);
|
|
55
|
+
await client.deleteGroup(groupId);
|
|
56
|
+
return [
|
|
57
|
+
{
|
|
58
|
+
json: {
|
|
59
|
+
deleted: true,
|
|
60
|
+
groupId,
|
|
61
|
+
},
|
|
62
|
+
pairedItem: { item: index },
|
|
63
|
+
},
|
|
64
|
+
];
|
|
65
|
+
}
|
|
66
|
+
default:
|
|
67
|
+
throw new n8n_workflow_1.NodeOperationError(exec.getNode(), `Unsupported groups operation: ${operation}`);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=groups.handler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"groups.handler.js","sourceRoot":"","sources":["../../../../nodes/UniversalAgent/handlers/groups.handler.ts"],"names":[],"mappings":";;AAGA,sDA2EC;AA9ED,+CAAyF;AACzF,8CAAsD;AAE/C,KAAK,UAAU,qBAAqB,CACvC,IAAuB,EACvB,KAAa;IAEb,MAAM,MAAM,GAAG,MAAM,IAAA,wBAAgB,EAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACnD,MAAM,SAAS,GAAG,IAAI,CAAC,gBAAgB,CAAC,WAAW,EAAE,KAAK,CAK5C,CAAC;IAEf,QAAQ,SAAS,EAAE,CAAC;QAChB,KAAK,QAAQ,CAAC,CAAC,CAAC;YACZ,MAAM,cAAc,GAAG,IAAI,CAAC,gBAAgB,CAAC,gBAAgB,EAAE,KAAK,EAAE,EAAE,CAAW,CAAC;YACpF,MAAM,KAAK,GAAG,MAAM,MAAM,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;YACvD,OAAO;gBACH;oBACI,IAAI,EAAE,KAAK;oBACX,UAAU,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE;iBAC9B;aACJ,CAAC;QACN,CAAC;QACD,KAAK,MAAM,CAAC,CAAC,CAAC;YACV,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,UAAU,EAAE,CAAC;YACzC,OAAO;gBACH;oBACI,IAAI,EAAE;wBACF,MAAM;wBACN,KAAK,EAAE,MAAM,CAAC,MAAM;qBACvB;oBACD,UAAU,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE;iBAC9B;aACJ,CAAC;QACN,CAAC;QACD,KAAK,KAAK,CAAC,CAAC,CAAC;YACT,MAAM,OAAO,GAAG,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,KAAK,CAAW,CAAC;YAClE,MAAM,KAAK,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;YAC7C,OAAO;gBACH;oBACI,IAAI,EAAE,KAAK;oBACX,UAAU,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE;iBAC9B;aACJ,CAAC;QACN,CAAC;QACD,KAAK,QAAQ,CAAC,CAAC,CAAC;YACZ,MAAM,OAAO,GAAG,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,KAAK,CAAW,CAAC;YAClE,MAAM,cAAc,GAAG,IAAI,CAAC,gBAAgB,CAAC,gBAAgB,EAAE,KAAK,EAAE,EAAE,CAAW,CAAC;YACpF,MAAM,KAAK,GAAG,MAAM,MAAM,CAAC,WAAW,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;YAChE,OAAO;gBACH;oBACI,IAAI,EAAE,KAAK;oBACX,UAAU,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE;iBAC9B;aACJ,CAAC;QACN,CAAC;QACD,KAAK,QAAQ,CAAC,CAAC,CAAC;YACZ,MAAM,OAAO,GAAG,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,KAAK,CAAW,CAAC;YAClE,MAAM,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;YAClC,OAAO;gBACH;oBACI,IAAI,EAAE;wBACF,OAAO,EAAE,IAAI;wBACb,OAAO;qBACV;oBACD,UAAU,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE;iBAC9B;aACJ,CAAC;QACN,CAAC;QACD;YACI,MAAM,IAAI,iCAAkB,CACxB,IAAI,CAAC,OAAO,EAAE,EACd,iCAAiC,SAAS,EAAE,CAC/C,CAAC;IACV,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.handleManageIdentityOperation = handleManageIdentityOperation;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const letta_1 = require("../../shared/letta");
|
|
6
|
+
async function handleManageIdentityOperation(exec, index) {
|
|
7
|
+
const client = await (0, letta_1.getLettaProvider)(exec, index);
|
|
8
|
+
const operation = exec.getNodeParameter('operation', index);
|
|
9
|
+
switch (operation) {
|
|
10
|
+
case 'upsert': {
|
|
11
|
+
const identifierKey = exec.getNodeParameter('identifierKey', index);
|
|
12
|
+
const name = exec.getNodeParameter('name', index, '');
|
|
13
|
+
const identityType = exec.getNodeParameter('identity_type', index, 'user');
|
|
14
|
+
const identity = await client.upsertIdentity(identifierKey, name || identifierKey, [], [], identityType);
|
|
15
|
+
return [
|
|
16
|
+
{
|
|
17
|
+
json: {
|
|
18
|
+
identityId: identity.id,
|
|
19
|
+
identifierKey: identity.identifierKey,
|
|
20
|
+
name: identity.name,
|
|
21
|
+
identityType: identity.identityType,
|
|
22
|
+
},
|
|
23
|
+
pairedItem: { item: index },
|
|
24
|
+
},
|
|
25
|
+
];
|
|
26
|
+
}
|
|
27
|
+
case 'delete': {
|
|
28
|
+
const identityId = exec.getNodeParameter('identityId', index);
|
|
29
|
+
await client.deleteIdentity(identityId);
|
|
30
|
+
return [
|
|
31
|
+
{
|
|
32
|
+
json: {
|
|
33
|
+
deleted: true,
|
|
34
|
+
identityId,
|
|
35
|
+
},
|
|
36
|
+
pairedItem: { item: index },
|
|
37
|
+
},
|
|
38
|
+
];
|
|
39
|
+
}
|
|
40
|
+
case 'get': {
|
|
41
|
+
const identityId = exec.getNodeParameter('identityId', index);
|
|
42
|
+
const identity = await client.getIdentity(identityId);
|
|
43
|
+
return [
|
|
44
|
+
{
|
|
45
|
+
json: {
|
|
46
|
+
identityId: identity.id,
|
|
47
|
+
identifierKey: identity.identifierKey,
|
|
48
|
+
name: identity.name,
|
|
49
|
+
properties: identity.properties,
|
|
50
|
+
},
|
|
51
|
+
pairedItem: { item: index },
|
|
52
|
+
},
|
|
53
|
+
];
|
|
54
|
+
}
|
|
55
|
+
case 'list': {
|
|
56
|
+
const identities = await client.listIdentities();
|
|
57
|
+
return [
|
|
58
|
+
{
|
|
59
|
+
json: {
|
|
60
|
+
identities,
|
|
61
|
+
total: identities.length,
|
|
62
|
+
},
|
|
63
|
+
pairedItem: { item: index },
|
|
64
|
+
},
|
|
65
|
+
];
|
|
66
|
+
}
|
|
67
|
+
case 'update': {
|
|
68
|
+
const identityId = exec.getNodeParameter('identityId', index);
|
|
69
|
+
const name = exec.getNodeParameter('name', index);
|
|
70
|
+
const identity = await client.updateIdentity(identityId, { name });
|
|
71
|
+
return [
|
|
72
|
+
{
|
|
73
|
+
json: {
|
|
74
|
+
identityId: identity.id,
|
|
75
|
+
identifierKey: identity.identifierKey,
|
|
76
|
+
name: identity.name,
|
|
77
|
+
},
|
|
78
|
+
pairedItem: { item: index },
|
|
79
|
+
},
|
|
80
|
+
];
|
|
81
|
+
}
|
|
82
|
+
default:
|
|
83
|
+
throw new n8n_workflow_1.NodeOperationError(exec.getNode(), `Unsupported manage identity operation: ${operation}`);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=identity.handler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identity.handler.js","sourceRoot":"","sources":["../../../../nodes/UniversalAgent/handlers/identity.handler.ts"],"names":[],"mappings":";;AAGA,sEAgGC;AAnGD,+CAAyF;AACzF,8CAAsD;AAE/C,KAAK,UAAU,6BAA6B,CAC/C,IAAuB,EACvB,KAAa;IAEb,MAAM,MAAM,GAAG,MAAM,IAAA,wBAAgB,EAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACnD,MAAM,SAAS,GAAG,IAAI,CAAC,gBAAgB,CAAC,WAAW,EAAE,KAAK,CAK5C,CAAC;IAEf,QAAQ,SAAS,EAAE,CAAC;QAChB,KAAK,QAAQ,CAAC,CAAC,CAAC;YACZ,MAAM,aAAa,GAAG,IAAI,CAAC,gBAAgB,CAAC,eAAe,EAAE,KAAK,CAAW,CAAC;YAC9E,MAAM,IAAI,GAAG,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE,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UAAU;qBAClC;oBACD,UAAU,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE;iBAC9B;aACJ,CAAC;QACN,CAAC;QACD,KAAK,MAAM,CAAC,CAAC,CAAC;YACV,MAAM,UAAU,GAAG,MAAM,MAAM,CAAC,cAAc,EAAE,CAAC;YACjD,OAAO;gBACH;oBACI,IAAI,EAAE;wBACF,UAAU;wBACV,KAAK,EAAE,UAAU,CAAC,MAAM;qBAC3B;oBACD,UAAU,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE;iBAC9B;aACJ,CAAC;QACN,CAAC;QACD,KAAK,QAAQ,CAAC,CAAC,CAAC;YACZ,MAAM,UAAU,GAAG,IAAI,CAAC,gBAAgB,CAAC,YAAY,EAAE,KAAK,CAAW,CAAC;YACxE,MAAM,IAAI,GAAG,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE,KAAK,CAAW,CAAC;YAE5D,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;YACnE,OAAO;gBACH;oBACI,IAAI,EAAE;wBACF,UAAU,EAAE,QAAQ,CAAC,EAAE;wBACvB,aAAa,EAAE,QAAQ,CAAC,aAAa;wBACrC,IAAI,EAAE,QAAQ,CAAC,IAAI;qBACtB;oBACD,UAAU,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE;iBAC9B;aACJ,CAAC;QACN,CAAC;QACD;YACI,MAAM,IAAI,iCAAkB,CACxB,IAAI,CAAC,OAAO,EAAE,EACd,0CAA0C,SAAS,EAAE,CACxD,CAAC;IACV,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.handleMcpServersOperation = handleMcpServersOperation;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const letta_1 = require("../../shared/letta");
|
|
6
|
+
async function handleMcpServersOperation(exec, index) {
|
|
7
|
+
const client = await (0, letta_1.getLettaProvider)(exec, index);
|
|
8
|
+
const operation = exec.getNodeParameter('operation', index);
|
|
9
|
+
switch (operation) {
|
|
10
|
+
case 'list': {
|
|
11
|
+
const servers = await client.listMcpServers();
|
|
12
|
+
return [
|
|
13
|
+
{
|
|
14
|
+
json: {
|
|
15
|
+
servers: servers.map((server) => ({
|
|
16
|
+
id: server.id,
|
|
17
|
+
name: server.name,
|
|
18
|
+
command: server.command,
|
|
19
|
+
status: server.status,
|
|
20
|
+
})),
|
|
21
|
+
total: servers.length,
|
|
22
|
+
},
|
|
23
|
+
pairedItem: { item: index },
|
|
24
|
+
},
|
|
25
|
+
];
|
|
26
|
+
}
|
|
27
|
+
case 'create': {
|
|
28
|
+
const name = exec.getNodeParameter('name', index);
|
|
29
|
+
const url = exec.getNodeParameter('url', index);
|
|
30
|
+
const server = await client.createMcpServer({
|
|
31
|
+
name,
|
|
32
|
+
url,
|
|
33
|
+
});
|
|
34
|
+
return [
|
|
35
|
+
{
|
|
36
|
+
json: {
|
|
37
|
+
serverId: server.id,
|
|
38
|
+
name: server.name,
|
|
39
|
+
command: server.command || server.url,
|
|
40
|
+
status: server.status,
|
|
41
|
+
},
|
|
42
|
+
pairedItem: { item: index },
|
|
43
|
+
},
|
|
44
|
+
];
|
|
45
|
+
}
|
|
46
|
+
case 'get': {
|
|
47
|
+
const serverId = exec.getNodeParameter('serverId', index);
|
|
48
|
+
const server = await client.getMcpServer(serverId);
|
|
49
|
+
return [
|
|
50
|
+
{
|
|
51
|
+
json: {
|
|
52
|
+
serverId: server.id,
|
|
53
|
+
name: server.name,
|
|
54
|
+
command: server.command || server.url,
|
|
55
|
+
status: server.status,
|
|
56
|
+
},
|
|
57
|
+
pairedItem: { item: index },
|
|
58
|
+
},
|
|
59
|
+
];
|
|
60
|
+
}
|
|
61
|
+
case 'update': {
|
|
62
|
+
const serverId = exec.getNodeParameter('serverId', index);
|
|
63
|
+
const name = exec.getNodeParameter('name', index);
|
|
64
|
+
const url = exec.getNodeParameter('url', index);
|
|
65
|
+
const server = await client.updateMcpServer(serverId, {
|
|
66
|
+
name,
|
|
67
|
+
url,
|
|
68
|
+
});
|
|
69
|
+
return [
|
|
70
|
+
{
|
|
71
|
+
json: {
|
|
72
|
+
serverId: server.id,
|
|
73
|
+
name: server.name,
|
|
74
|
+
command: server.command || server.url,
|
|
75
|
+
status: server.status,
|
|
76
|
+
},
|
|
77
|
+
pairedItem: { item: index },
|
|
78
|
+
},
|
|
79
|
+
];
|
|
80
|
+
}
|
|
81
|
+
case 'delete': {
|
|
82
|
+
const serverId = exec.getNodeParameter('serverId', index);
|
|
83
|
+
await client.deleteMcpServer(serverId);
|
|
84
|
+
return [
|
|
85
|
+
{
|
|
86
|
+
json: {
|
|
87
|
+
deleted: true,
|
|
88
|
+
serverId,
|
|
89
|
+
},
|
|
90
|
+
pairedItem: { item: index },
|
|
91
|
+
},
|
|
92
|
+
];
|
|
93
|
+
}
|
|
94
|
+
case 'refresh': {
|
|
95
|
+
const serverId = exec.getNodeParameter('serverId', index);
|
|
96
|
+
const server = await client.refreshMcpServer(serverId);
|
|
97
|
+
return [
|
|
98
|
+
{
|
|
99
|
+
json: {
|
|
100
|
+
serverId: server.id,
|
|
101
|
+
name: server.name,
|
|
102
|
+
command: server.command || server.url,
|
|
103
|
+
status: server.status,
|
|
104
|
+
refreshed: true,
|
|
105
|
+
},
|
|
106
|
+
pairedItem: { item: index },
|
|
107
|
+
},
|
|
108
|
+
];
|
|
109
|
+
}
|
|
110
|
+
default:
|
|
111
|
+
throw new n8n_workflow_1.NodeOperationError(exec.getNode(), `Unsupported MCP servers operation: ${operation}`);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
//# sourceMappingURL=mcp.handler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp.handler.js","sourceRoot":"","sources":["../../../../nodes/UniversalAgent/handlers/mcp.handler.ts"],"names":[],"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,MAAM,CAAC,MAAM;qBACxB;oBACD,UAAU,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE;iBAC9B;aACJ,CAAC;QACN,CAAC;QACD,KAAK,QAAQ,CAAC,CAAC,CAAC;YACZ,MAAM,QAAQ,GAAG,IAAI,CAAC,gBAAgB,CAAC,UAAU,EAAE,KAAK,CAAW,CAAC;YACpE,MAAM,MAAM,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;YAEvC,OAAO;gBACH;oBACI,IAAI,EAAE;wBACF,OAAO,EAAE,IAAI;wBACb,QAAQ;qBACX;oBACD,UAAU,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE;iBAC9B;aACJ,CAAC;QACN,CAAC;QACD,KAAK,SAAS,CAAC,CAAC,CAAC;YACb,MAAM,QAAQ,GAAG,IAAI,CAAC,gBAAgB,CAAC,UAAU,EAAE,KAAK,CAAW,CAAC;YACpE,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;YAEvD,OAAO;gBACH;oBACI,IAAI,EAAE;wBACF,QAAQ,EAAE,MAAM,CAAC,EAAE;wBACnB,IAAI,EAAE,MAAM,CAAC,IAAI;wBACjB,OAAO,EAAE,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,GAAG;wBACrC,MAAM,EAAE,MAAM,CAAC,MAAM;wBACrB,SAAS,EAAE,IAAI;qBAClB;oBACD,UAAU,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE;iBAC9B;aACJ,CAAC;QACN,CAAC;QACD;YACI,MAAM,IAAI,iCAAkB,CACxB,IAAI,CAAC,OAAO,EAAE,EACd,sCAAsC,SAAS,EAAE,CACpD,CAAC;IACV,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.handleModelsOperation = handleModelsOperation;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const letta_1 = require("../../shared/letta");
|
|
6
|
+
async function handleModelsOperation(exec, index) {
|
|
7
|
+
const client = await (0, letta_1.getLettaProvider)(exec, index);
|
|
8
|
+
const operation = exec.getNodeParameter('operation', index);
|
|
9
|
+
if (operation === 'list') {
|
|
10
|
+
let type = 'llm';
|
|
11
|
+
try {
|
|
12
|
+
type = exec.getNodeParameter('type', index, 'llm');
|
|
13
|
+
}
|
|
14
|
+
catch (error) {
|
|
15
|
+
}
|
|
16
|
+
if (type === 'embedding') {
|
|
17
|
+
const models = await client.listEmbeddingModels();
|
|
18
|
+
return [
|
|
19
|
+
{
|
|
20
|
+
json: {
|
|
21
|
+
models: models.map((model) => ({
|
|
22
|
+
id: model.id,
|
|
23
|
+
name: model.name,
|
|
24
|
+
dimensions: model.dimensions,
|
|
25
|
+
maxInputLength: model.max_input_length,
|
|
26
|
+
})),
|
|
27
|
+
total: models.length,
|
|
28
|
+
type: 'embedding',
|
|
29
|
+
},
|
|
30
|
+
pairedItem: { item: index },
|
|
31
|
+
},
|
|
32
|
+
];
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
const models = await client.listLlmModels();
|
|
36
|
+
return [
|
|
37
|
+
{
|
|
38
|
+
json: {
|
|
39
|
+
models: models.map((model) => ({
|
|
40
|
+
id: model.id,
|
|
41
|
+
name: model.name,
|
|
42
|
+
contextWindow: model.context_window,
|
|
43
|
+
maxOutputLength: model.max_output_length,
|
|
44
|
+
})),
|
|
45
|
+
total: models.length,
|
|
46
|
+
type: 'llm',
|
|
47
|
+
},
|
|
48
|
+
pairedItem: { item: index },
|
|
49
|
+
},
|
|
50
|
+
];
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
throw new n8n_workflow_1.NodeOperationError(exec.getNode(), `Unsupported models operation: ${operation}`);
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=models.handler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"models.handler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MAAM,CAAC,GAAG,CAAC,CAAC,KAAkB,EAAE,EAAE,CAAC,CAAC;4BACxC,EAAE,EAAE,KAAK,CAAC,EAAE;4BACZ,IAAI,EAAE,KAAK,CAAC,IAAI;4BAChB,aAAa,EAAE,KAAK,CAAC,cAAc;4BACnC,eAAe,EAAE,KAAK,CAAC,iBAAiB;yBAC3C,CAAC,CAAC;wBACH,KAAK,EAAE,MAAM,CAAC,MAAM;wBACpB,IAAI,EAAE,KAAK;qBACd;oBACD,UAAU,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE;iBAC9B;aACJ,CAAC;QACN,CAAC;IACL,CAAC;IAED,MAAM,IAAI,iCAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,iCAAiC,SAAS,EAAE,CAAC,CAAC;AAC/F,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.handleRunsOperation = handleRunsOperation;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const letta_1 = require("../../shared/letta");
|
|
6
|
+
async function handleRunsOperation(exec, index) {
|
|
7
|
+
const client = await (0, letta_1.getLettaProvider)(exec, index);
|
|
8
|
+
const operation = exec.getNodeParameter('operation', index);
|
|
9
|
+
switch (operation) {
|
|
10
|
+
case 'create': {
|
|
11
|
+
const jsonParameters = exec.getNodeParameter('jsonParameters', index, {});
|
|
12
|
+
const run = await client.createRun(jsonParameters);
|
|
13
|
+
return [
|
|
14
|
+
{
|
|
15
|
+
json: run,
|
|
16
|
+
pairedItem: { item: index },
|
|
17
|
+
},
|
|
18
|
+
];
|
|
19
|
+
}
|
|
20
|
+
case 'list': {
|
|
21
|
+
const runs = await client.listRuns();
|
|
22
|
+
return [
|
|
23
|
+
{
|
|
24
|
+
json: {
|
|
25
|
+
runs,
|
|
26
|
+
total: runs.length,
|
|
27
|
+
},
|
|
28
|
+
pairedItem: { item: index },
|
|
29
|
+
},
|
|
30
|
+
];
|
|
31
|
+
}
|
|
32
|
+
case 'get': {
|
|
33
|
+
const runId = exec.getNodeParameter('runId', index);
|
|
34
|
+
const run = await client.getRun(runId);
|
|
35
|
+
return [
|
|
36
|
+
{
|
|
37
|
+
json: run,
|
|
38
|
+
pairedItem: { item: index },
|
|
39
|
+
},
|
|
40
|
+
];
|
|
41
|
+
}
|
|
42
|
+
case 'delete': {
|
|
43
|
+
const runId = exec.getNodeParameter('runId', index);
|
|
44
|
+
await client.deleteRun(runId);
|
|
45
|
+
return [
|
|
46
|
+
{
|
|
47
|
+
json: {
|
|
48
|
+
deleted: true,
|
|
49
|
+
runId,
|
|
50
|
+
},
|
|
51
|
+
pairedItem: { item: index },
|
|
52
|
+
},
|
|
53
|
+
];
|
|
54
|
+
}
|
|
55
|
+
default:
|
|
56
|
+
throw new n8n_workflow_1.NodeOperationError(exec.getNode(), `Unsupported runs operation: ${operation}`);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=runs.handler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runs.handler.js","sourceRoot":"","sources":["../../../../nodes/UniversalAgent/handlers/runs.handler.ts"],"names":[],"mappings":";;AAGA,kDA+DC;AAlED,+CAAyF;AACzF,8CAAsD;AAE/C,KAAK,UAAU,mBAAmB,CACrC,IAAuB,EACvB,KAAa;IAEb,MAAM,MAAM,GAAG,MAAM,IAAA,wBAAgB,EAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACnD,MAAM,SAAS,GAAG,IAAI,CAAC,gBAAgB,CAAC,WAAW,EAAE,KAAK,CAI5C,CAAC;IAEf,QAAQ,SAAS,EAAE,CAAC;QAChB,KAAK,QAAQ,CAAC,CAAC,CAAC;YACZ,MAAM,cAAc,GAAG,IAAI,CAAC,gBAAgB,CAAC,gBAAgB,EAAE,KAAK,EAAE,EAAE,CAAW,CAAC;YACpF,MAAM,GAAG,GAAG,MAAM,M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use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.handleStepsOperation = handleStepsOperation;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const letta_1 = require("../../shared/letta");
|
|
6
|
+
async function handleStepsOperation(exec, index) {
|
|
7
|
+
const client = await (0, letta_1.getLettaProvider)(exec, index);
|
|
8
|
+
const operation = exec.getNodeParameter('operation', index);
|
|
9
|
+
switch (operation) {
|
|
10
|
+
case 'list': {
|
|
11
|
+
const jsonParameters = exec.getNodeParameter('jsonParameters', index, {});
|
|
12
|
+
const steps = await client.listSteps(jsonParameters);
|
|
13
|
+
return [
|
|
14
|
+
{
|
|
15
|
+
json: {
|
|
16
|
+
steps,
|
|
17
|
+
total: steps.length,
|
|
18
|
+
},
|
|
19
|
+
pairedItem: { item: index },
|
|
20
|
+
},
|
|
21
|
+
];
|
|
22
|
+
}
|
|
23
|
+
case 'get': {
|
|
24
|
+
const stepId = exec.getNodeParameter('stepId', index);
|
|
25
|
+
const step = await client.getStep(stepId);
|
|
26
|
+
return [
|
|
27
|
+
{
|
|
28
|
+
json: step,
|
|
29
|
+
pairedItem: { item: index },
|
|
30
|
+
},
|
|
31
|
+
];
|
|
32
|
+
}
|
|
33
|
+
default:
|
|
34
|
+
throw new n8n_workflow_1.NodeOperationError(exec.getNode(), `Unsupported steps operation: ${operation}`);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=steps.handler.js.map
|