@arvo-tools/agentic 0.2.0 → 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.
- package/dist/Agent/AgentDefaults.d.ts +28 -0
- package/dist/Agent/AgentDefaults.d.ts.map +1 -0
- package/dist/Agent/AgentDefaults.js +154 -0
- package/dist/Agent/AgentDefaults.js.map +1 -0
- package/dist/Agent/agentLoop.d.ts +109 -0
- package/dist/Agent/agentLoop.d.ts.map +1 -0
- package/dist/Agent/agentLoop.js +391 -0
- package/dist/Agent/agentLoop.js.map +1 -0
- package/dist/Agent/agentTool.d.ts +4 -0
- package/dist/Agent/agentTool.d.ts.map +1 -0
- package/dist/Agent/agentTool.js +111 -0
- package/dist/Agent/agentTool.js.map +1 -0
- package/dist/Agent/index.d.ts +18 -0
- package/dist/Agent/index.d.ts.map +1 -0
- package/dist/Agent/index.js +293 -0
- package/dist/Agent/index.js.map +1 -0
- package/dist/Agent/schema.d.ts +363 -0
- package/dist/Agent/schema.d.ts.map +1 -0
- package/dist/Agent/schema.js +51 -0
- package/dist/Agent/schema.js.map +1 -0
- package/dist/Agent/types.d.ts +135 -0
- package/dist/Agent/types.d.ts.map +1 -0
- package/dist/Agent/types.js +3 -0
- package/dist/Agent/types.js.map +1 -0
- package/dist/Agent/utils.d.ts +31 -0
- package/dist/Agent/utils.d.ts.map +1 -0
- package/dist/Agent/utils.js +345 -0
- package/dist/Agent/utils.js.map +1 -0
- package/dist/Integrations/MCPClient.d.ts +80 -0
- package/dist/Integrations/MCPClient.d.ts.map +1 -0
- package/dist/Integrations/MCPClient.js +292 -0
- package/dist/Integrations/MCPClient.js.map +1 -0
- package/dist/Integrations/openai.d.ts +10 -0
- package/dist/Integrations/openai.d.ts.map +1 -0
- package/dist/Integrations/openai.js +353 -0
- package/dist/Integrations/openai.js.map +1 -0
- package/dist/index.d.ts +10 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +24 -3
- package/dist/index.js.map +1 -1
- package/dist/interfaces.mcp.d.ts +26 -0
- package/dist/interfaces.mcp.d.ts.map +1 -0
- package/dist/interfaces.mcp.js +3 -0
- package/dist/interfaces.mcp.js.map +1 -0
- package/dist/types.d.ts +7 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/package.json +9 -2
|
@@ -0,0 +1,353 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
13
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
var __values = (this && this.__values) || function(o) {
|
|
39
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
40
|
+
if (m) return m.call(o);
|
|
41
|
+
if (o && typeof o.length === "number") return {
|
|
42
|
+
next: function () {
|
|
43
|
+
if (o && i >= o.length) o = void 0;
|
|
44
|
+
return { value: o && o[i++], done: !o };
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
48
|
+
};
|
|
49
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50
|
+
exports.openaiLLMIntegration = void 0;
|
|
51
|
+
var openinference_semantic_conventions_1 = require("@arizeai/openinference-semantic-conventions");
|
|
52
|
+
var api_1 = require("@opentelemetry/api");
|
|
53
|
+
var arvo_core_1 = require("arvo-core");
|
|
54
|
+
var zod_to_json_schema_1 = require("zod-to-json-schema");
|
|
55
|
+
var utils_1 = require("../Agent/utils");
|
|
56
|
+
var formatMessagesForOpenAI = function (messages, systemPrompt) {
|
|
57
|
+
var e_1, _a, e_2, _b;
|
|
58
|
+
var _c;
|
|
59
|
+
var formattedMessages = [];
|
|
60
|
+
if (systemPrompt) {
|
|
61
|
+
formattedMessages.push({
|
|
62
|
+
role: 'system',
|
|
63
|
+
content: systemPrompt,
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
var toolResponseMap = {};
|
|
67
|
+
try {
|
|
68
|
+
for (var messages_1 = __values(messages), messages_1_1 = messages_1.next(); !messages_1_1.done; messages_1_1 = messages_1.next()) {
|
|
69
|
+
var message = messages_1_1.value;
|
|
70
|
+
if (message.role === 'user' && message.content.type === 'tool_result') {
|
|
71
|
+
toolResponseMap[message.content.toolUseId] = message.content;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
76
|
+
finally {
|
|
77
|
+
try {
|
|
78
|
+
if (messages_1_1 && !messages_1_1.done && (_a = messages_1.return)) _a.call(messages_1);
|
|
79
|
+
}
|
|
80
|
+
finally { if (e_1) throw e_1.error; }
|
|
81
|
+
}
|
|
82
|
+
try {
|
|
83
|
+
for (var messages_2 = __values(messages), messages_2_1 = messages_2.next(); !messages_2_1.done; messages_2_1 = messages_2.next()) {
|
|
84
|
+
var message = messages_2_1.value;
|
|
85
|
+
if (message.role === 'user') {
|
|
86
|
+
if (message.content.type === 'text') {
|
|
87
|
+
formattedMessages.push({
|
|
88
|
+
role: 'user',
|
|
89
|
+
content: message.content.content,
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
else if (message.content.type === 'media' && message.content.contentType.type === 'image') {
|
|
93
|
+
formattedMessages.push({
|
|
94
|
+
role: 'user',
|
|
95
|
+
content: [
|
|
96
|
+
{
|
|
97
|
+
type: 'image_url',
|
|
98
|
+
image_url: {
|
|
99
|
+
url: message.content.content,
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
],
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
else if (message.content.type === 'media' && message.content.contentType.type === 'file') {
|
|
106
|
+
formattedMessages.push({
|
|
107
|
+
role: 'user',
|
|
108
|
+
content: [
|
|
109
|
+
{
|
|
110
|
+
type: 'file',
|
|
111
|
+
file: {
|
|
112
|
+
filename: message.content.contentType.filename,
|
|
113
|
+
file_data: message.content.content,
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
],
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
else if (message.role === 'assistant') {
|
|
121
|
+
if (message.content.type === 'text') {
|
|
122
|
+
formattedMessages.push({
|
|
123
|
+
role: 'assistant',
|
|
124
|
+
content: message.content.content,
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
else if (message.content.type === 'tool_use') {
|
|
128
|
+
formattedMessages.push({
|
|
129
|
+
role: 'assistant',
|
|
130
|
+
tool_calls: [
|
|
131
|
+
{
|
|
132
|
+
type: 'function',
|
|
133
|
+
id: message.content.toolUseId,
|
|
134
|
+
function: {
|
|
135
|
+
name: message.content.name,
|
|
136
|
+
arguments: JSON.stringify(message.content.input),
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
],
|
|
140
|
+
});
|
|
141
|
+
var toolResult = toolResponseMap[message.content.toolUseId];
|
|
142
|
+
formattedMessages.push({
|
|
143
|
+
role: 'tool',
|
|
144
|
+
tool_call_id: message.content.toolUseId,
|
|
145
|
+
content: (_c = toolResult === null || toolResult === void 0 ? void 0 : toolResult.content) !== null && _c !== void 0 ? _c : JSON.stringify({ error: 'No tool response' }),
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
152
|
+
finally {
|
|
153
|
+
try {
|
|
154
|
+
if (messages_2_1 && !messages_2_1.done && (_b = messages_2.return)) _b.call(messages_2);
|
|
155
|
+
}
|
|
156
|
+
finally { if (e_2) throw e_2.error; }
|
|
157
|
+
}
|
|
158
|
+
return formattedMessages;
|
|
159
|
+
};
|
|
160
|
+
var openaiLLMIntegration = function (client, config) {
|
|
161
|
+
return function (_a, _b) { return __awaiter(void 0, [_a, _b], void 0, function (_c, _d) {
|
|
162
|
+
var _e;
|
|
163
|
+
var _messages = _c.messages, _system = _c.system, tools = _c.tools, outputFormat = _c.outputFormat, lifecycle = _c.lifecycle, toolInteractions = _c.toolInteractions;
|
|
164
|
+
var otelInfo = _d.otelInfo;
|
|
165
|
+
return __generator(this, function (_f) {
|
|
166
|
+
switch (_f.label) {
|
|
167
|
+
case 0: return [4 /*yield*/, arvo_core_1.ArvoOpenTelemetry.getInstance().startActiveSpan({
|
|
168
|
+
name: "LLM.invoke<".concat(lifecycle === 'init' ? 'init' : lifecycle === 'tool_result' ? 'resume' : 'output_validation_feedback', ">"),
|
|
169
|
+
disableSpanManagement: true,
|
|
170
|
+
context: {
|
|
171
|
+
inheritFrom: 'TRACE_HEADERS',
|
|
172
|
+
traceHeaders: otelInfo.headers,
|
|
173
|
+
},
|
|
174
|
+
spanOptions: {
|
|
175
|
+
attributes: (_e = {},
|
|
176
|
+
_e[openinference_semantic_conventions_1.SemanticConventions.OPENINFERENCE_SPAN_KIND] = openinference_semantic_conventions_1.OpenInferenceSpanKind.LLM,
|
|
177
|
+
_e),
|
|
178
|
+
},
|
|
179
|
+
fn: function (span) { return __awaiter(void 0, void 0, void 0, function () {
|
|
180
|
+
var llmModel, llmInvocationParams, messages, system, limitMessage, toolDef, tools_1, tools_1_1, tool, formattedMessages, responseFormat, completion, choice, llmUsage, executionUnits, toolRequests, _a, _b, toolCall, content, e_3;
|
|
181
|
+
var e_4, _c, e_5, _d;
|
|
182
|
+
var _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
183
|
+
return __generator(this, function (_s) {
|
|
184
|
+
switch (_s.label) {
|
|
185
|
+
case 0:
|
|
186
|
+
llmModel = (_e = config === null || config === void 0 ? void 0 : config.model) !== null && _e !== void 0 ? _e : 'gpt-4o';
|
|
187
|
+
llmInvocationParams = {
|
|
188
|
+
temperature: (_f = config === null || config === void 0 ? void 0 : config.temperature) !== null && _f !== void 0 ? _f : 0,
|
|
189
|
+
maxTokens: (_g = config === null || config === void 0 ? void 0 : config.maxTokens) !== null && _g !== void 0 ? _g : 4096,
|
|
190
|
+
};
|
|
191
|
+
messages = _messages.map(function (item) {
|
|
192
|
+
if (lifecycle === 'init')
|
|
193
|
+
return item;
|
|
194
|
+
if (item.content.type === 'media') {
|
|
195
|
+
return {
|
|
196
|
+
role: item.role,
|
|
197
|
+
content: {
|
|
198
|
+
type: 'text',
|
|
199
|
+
content: "Media file (type: ".concat(item.content.contentType.type, "@").concat(item.content.contentType.format, ") already parsed and looked at. No need for you to look at it again"),
|
|
200
|
+
},
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
return item;
|
|
204
|
+
});
|
|
205
|
+
system = _system;
|
|
206
|
+
if (toolInteractions.exhausted) {
|
|
207
|
+
limitMessage = (0, arvo_core_1.cleanString)("\n **CRITICAL WARNING: You have reached your tool interaction limit!**\n You must answer the original question using all the data available to you. \n You have run out of tool call budget. No more tool calls are allowed any more.\n If you cannot answer the query well. Then mention what you have done briefly, what\n can you answer based on the collected data, what data is missing and why you cannot \n answer any further. \n ");
|
|
208
|
+
messages.push({
|
|
209
|
+
role: 'user',
|
|
210
|
+
content: {
|
|
211
|
+
type: 'text',
|
|
212
|
+
content: limitMessage,
|
|
213
|
+
},
|
|
214
|
+
});
|
|
215
|
+
system = "".concat(system, "\n\n").concat(limitMessage);
|
|
216
|
+
}
|
|
217
|
+
(0, utils_1.setOpenInferenceInputAttr)({
|
|
218
|
+
llm: {
|
|
219
|
+
provider: 'openai',
|
|
220
|
+
system: 'openai',
|
|
221
|
+
model: llmModel,
|
|
222
|
+
invocationParam: llmInvocationParams,
|
|
223
|
+
},
|
|
224
|
+
messages: messages,
|
|
225
|
+
system: system,
|
|
226
|
+
tools: tools,
|
|
227
|
+
}, span);
|
|
228
|
+
_s.label = 1;
|
|
229
|
+
case 1:
|
|
230
|
+
_s.trys.push([1, 3, 4, 5]);
|
|
231
|
+
toolDef = [];
|
|
232
|
+
try {
|
|
233
|
+
for (tools_1 = __values(tools), tools_1_1 = tools_1.next(); !tools_1_1.done; tools_1_1 = tools_1.next()) {
|
|
234
|
+
tool = tools_1_1.value;
|
|
235
|
+
toolDef.push({
|
|
236
|
+
type: 'function',
|
|
237
|
+
function: {
|
|
238
|
+
name: tool.name,
|
|
239
|
+
description: tool.description,
|
|
240
|
+
parameters: tool.inputSchema,
|
|
241
|
+
},
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
246
|
+
finally {
|
|
247
|
+
try {
|
|
248
|
+
if (tools_1_1 && !tools_1_1.done && (_c = tools_1.return)) _c.call(tools_1);
|
|
249
|
+
}
|
|
250
|
+
finally { if (e_4) throw e_4.error; }
|
|
251
|
+
}
|
|
252
|
+
formattedMessages = formatMessagesForOpenAI(messages, system);
|
|
253
|
+
responseFormat = outputFormat.type === 'json'
|
|
254
|
+
? {
|
|
255
|
+
type: 'json_schema',
|
|
256
|
+
json_schema: {
|
|
257
|
+
name: 'response_schema',
|
|
258
|
+
description: 'The required response schema',
|
|
259
|
+
// biome-ignore lint/suspicious/noExplicitAny: Make the typescript compiler ignore. Otherwise, it emits error "Type instantiation is excessively deep and possibly infinite. ts(2589)"
|
|
260
|
+
schema: (0, zod_to_json_schema_1.zodToJsonSchema)(outputFormat.format),
|
|
261
|
+
},
|
|
262
|
+
}
|
|
263
|
+
: undefined;
|
|
264
|
+
return [4 /*yield*/, client.chat.completions.create({
|
|
265
|
+
model: llmModel,
|
|
266
|
+
max_tokens: llmInvocationParams.maxTokens,
|
|
267
|
+
temperature: llmInvocationParams.temperature,
|
|
268
|
+
tools: toolDef.length ? toolDef : undefined,
|
|
269
|
+
messages: formattedMessages,
|
|
270
|
+
response_format: responseFormat,
|
|
271
|
+
})];
|
|
272
|
+
case 2:
|
|
273
|
+
completion = _s.sent();
|
|
274
|
+
choice = completion.choices[0];
|
|
275
|
+
llmUsage = {
|
|
276
|
+
tokens: {
|
|
277
|
+
prompt: (_j = (_h = completion.usage) === null || _h === void 0 ? void 0 : _h.prompt_tokens) !== null && _j !== void 0 ? _j : 0,
|
|
278
|
+
completion: (_l = (_k = completion.usage) === null || _k === void 0 ? void 0 : _k.completion_tokens) !== null && _l !== void 0 ? _l : 0,
|
|
279
|
+
},
|
|
280
|
+
};
|
|
281
|
+
executionUnits = (_o = (_m = config === null || config === void 0 ? void 0 : config.executionunits) === null || _m === void 0 ? void 0 : _m.call(config, llmUsage.tokens.prompt, llmUsage.tokens.completion)) !== null && _o !== void 0 ? _o : llmUsage.tokens.prompt + llmUsage.tokens.completion;
|
|
282
|
+
(0, utils_1.setOpenInferenceUsageOutputAttr)(llmUsage, span);
|
|
283
|
+
if ((_p = choice === null || choice === void 0 ? void 0 : choice.message) === null || _p === void 0 ? void 0 : _p.tool_calls) {
|
|
284
|
+
toolRequests = [];
|
|
285
|
+
try {
|
|
286
|
+
for (_a = __values(choice.message
|
|
287
|
+
.tool_calls), _b = _a.next(); !_b.done; _b = _a.next()) {
|
|
288
|
+
toolCall = _b.value;
|
|
289
|
+
try {
|
|
290
|
+
toolRequests.push({
|
|
291
|
+
toolUseId: toolCall.id,
|
|
292
|
+
name: toolCall.function.name,
|
|
293
|
+
input: JSON.parse(toolCall.function.arguments),
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
catch (_t) {
|
|
297
|
+
// Skip malformed tool calls
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
302
|
+
finally {
|
|
303
|
+
try {
|
|
304
|
+
if (_b && !_b.done && (_d = _a.return)) _d.call(_a);
|
|
305
|
+
}
|
|
306
|
+
finally { if (e_5) throw e_5.error; }
|
|
307
|
+
}
|
|
308
|
+
if (toolRequests.length) {
|
|
309
|
+
(0, utils_1.setOpenInferenceToolCallOutputAttr)({ toolCalls: toolRequests }, span);
|
|
310
|
+
return [2 /*return*/, {
|
|
311
|
+
type: 'tool_call',
|
|
312
|
+
toolRequests: toolRequests,
|
|
313
|
+
usage: llmUsage,
|
|
314
|
+
executionUnits: executionUnits,
|
|
315
|
+
}];
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
content = (_r = (_q = choice === null || choice === void 0 ? void 0 : choice.message) === null || _q === void 0 ? void 0 : _q.content) !== null && _r !== void 0 ? _r : '';
|
|
319
|
+
(0, utils_1.setOpenInferenceResponseOutputAttr)({ response: content }, span);
|
|
320
|
+
if (outputFormat.type === 'json') {
|
|
321
|
+
return [2 /*return*/, {
|
|
322
|
+
type: 'json',
|
|
323
|
+
content: content || '{}',
|
|
324
|
+
parsedContent: (0, utils_1.tryParseJson)(content || '{}'),
|
|
325
|
+
usage: llmUsage,
|
|
326
|
+
executionUnits: executionUnits,
|
|
327
|
+
}];
|
|
328
|
+
}
|
|
329
|
+
return [2 /*return*/, {
|
|
330
|
+
type: 'text',
|
|
331
|
+
content: content,
|
|
332
|
+
usage: llmUsage,
|
|
333
|
+
executionUnits: executionUnits,
|
|
334
|
+
}];
|
|
335
|
+
case 3:
|
|
336
|
+
e_3 = _s.sent();
|
|
337
|
+
span.setStatus({ code: api_1.SpanStatusCode.ERROR, message: e_3 === null || e_3 === void 0 ? void 0 : e_3.message });
|
|
338
|
+
throw e_3;
|
|
339
|
+
case 4:
|
|
340
|
+
span.end();
|
|
341
|
+
return [7 /*endfinally*/];
|
|
342
|
+
case 5: return [2 /*return*/];
|
|
343
|
+
}
|
|
344
|
+
});
|
|
345
|
+
}); },
|
|
346
|
+
})];
|
|
347
|
+
case 1: return [2 /*return*/, _f.sent()];
|
|
348
|
+
}
|
|
349
|
+
});
|
|
350
|
+
}); };
|
|
351
|
+
};
|
|
352
|
+
exports.openaiLLMIntegration = openaiLLMIntegration;
|
|
353
|
+
//# sourceMappingURL=openai.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openai.js","sourceRoot":"","sources":["../../src/Integrations/openai.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kGAGqD;AACrD,0CAAoD;AACpD,uCAA2D;AAK3D,yDAAqD;AASrD,wCAMwB;AAExB,IAAM,uBAAuB,GAAG,UAC9B,QAA8C,EAC9C,YAA2B;;;IAE3B,IAAM,iBAAiB,GAAiC,EAAE,CAAC;IAE3D,IAAI,YAAY,EAAE,CAAC;QACjB,iBAAiB,CAAC,IAAI,CAAC;YACrB,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,YAAY;SACtB,CAAC,CAAC;IACL,CAAC;IAED,IAAM,eAAe,GAA2C,EAAE,CAAC;;QACnE,KAAsB,IAAA,aAAA,SAAA,QAAQ,CAAA,kCAAA,wDAAE,CAAC;YAA5B,IAAM,OAAO,qBAAA;YAChB,IAAI,OAAO,CAAC,IAAI,KAAK,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC,IAAI,KAAK,aAAa,EAAE,CAAC;gBACtE,eAAe,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;YAC/D,CAAC;QACH,CAAC;;;;;;;;;;QAED,KAAsB,IAAA,aAAA,SAAA,QAAQ,CAAA,kCAAA,wDAAE,CAAC;YAA5B,IAAM,OAAO,qBAAA;YAChB,IAAI,OAAO,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;gBAC5B,IAAI,OAAO,CAAC,OAAO,CAAC,IAAI,KAAK,M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A,SAyKE,EAAA;;;SAAA;AA7KJ,CA6KI,CAAC;AAvLM,QAAA,oBAAoB,wBAuL1B"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,11 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { createArvoAgent } from './Agent';
|
|
2
|
+
export { AgentDefaults } from './Agent/AgentDefaults';
|
|
3
|
+
export { createAgentTool } from './Agent/agentTool';
|
|
4
|
+
export { AgentMediaContentSchema, AgentMessageContentSchema, AgentMessageSchema, AgentTextContentSchema, AgentToolCallContentSchema, AgentToolResultContentSchema, } from './Agent/schema';
|
|
5
|
+
export type { AgentContextBuilder, AgentInternalTool, AgentLLMContext, AgentLLMIntegration, AgentLLMIntegrationOutput, AgentLLMIntegrationParam, AgentMediaContent, AgentMessage, AgentMessageContent, AgentOutputBuilder, AgentServiceContract, AgentTextContent, AgentToolCallContent, AgentToolDefinition, AgentToolResultContent, AnyArvoContract, AnyArvoOrchestratorContract, CreateArvoAgentParam, NonEmptyArray, PromiseLike, } from './Agent/types';
|
|
6
|
+
export { setOpenInferenceInputAttr, setOpenInferenceResponseOutputAttr, setOpenInferenceToolCallOutputAttr, setOpenInferenceUsageOutputAttr, tryParseJson, } from './Agent/utils';
|
|
7
|
+
export { MCPClient } from './Integrations/MCPClient';
|
|
8
|
+
export { openaiLLMIntegration } from './Integrations/openai';
|
|
9
|
+
export type { IMCPClient } from './interfaces.mcp';
|
|
10
|
+
export type { OtelInfoType } from './types';
|
|
2
11
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EACL,uBAAuB,EACvB,yBAAyB,EACzB,kBAAkB,EAClB,sBAAsB,EACtB,0BAA0B,EAC1B,4BAA4B,GAC7B,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACV,mBAAmB,EACnB,iBAAiB,EACjB,eAAe,EACf,mBAAmB,EACnB,yBAAyB,EACzB,wBAAwB,EACxB,iBAAiB,EACjB,YAAY,EACZ,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,EACnB,sBAAsB,EACtB,eAAe,EACf,2BAA2B,EAC3B,oBAAoB,EACpB,aAAa,EACb,WAAW,GACZ,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,yBAAyB,EACzB,kCAAkC,EAClC,kCAAkC,EAClC,+BAA+B,EAC/B,YAAY,GACb,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAE7D,YAAY,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
var
|
|
5
|
-
exports.
|
|
3
|
+
exports.openaiLLMIntegration = exports.MCPClient = exports.tryParseJson = exports.setOpenInferenceUsageOutputAttr = exports.setOpenInferenceToolCallOutputAttr = exports.setOpenInferenceResponseOutputAttr = exports.setOpenInferenceInputAttr = exports.AgentToolResultContentSchema = exports.AgentToolCallContentSchema = exports.AgentTextContentSchema = exports.AgentMessageSchema = exports.AgentMessageContentSchema = exports.AgentMediaContentSchema = exports.createAgentTool = exports.AgentDefaults = exports.createArvoAgent = void 0;
|
|
4
|
+
var Agent_1 = require("./Agent");
|
|
5
|
+
Object.defineProperty(exports, "createArvoAgent", { enumerable: true, get: function () { return Agent_1.createArvoAgent; } });
|
|
6
|
+
var AgentDefaults_1 = require("./Agent/AgentDefaults");
|
|
7
|
+
Object.defineProperty(exports, "AgentDefaults", { enumerable: true, get: function () { return AgentDefaults_1.AgentDefaults; } });
|
|
8
|
+
var agentTool_1 = require("./Agent/agentTool");
|
|
9
|
+
Object.defineProperty(exports, "createAgentTool", { enumerable: true, get: function () { return agentTool_1.createAgentTool; } });
|
|
10
|
+
var schema_1 = require("./Agent/schema");
|
|
11
|
+
Object.defineProperty(exports, "AgentMediaContentSchema", { enumerable: true, get: function () { return schema_1.AgentMediaContentSchema; } });
|
|
12
|
+
Object.defineProperty(exports, "AgentMessageContentSchema", { enumerable: true, get: function () { return schema_1.AgentMessageContentSchema; } });
|
|
13
|
+
Object.defineProperty(exports, "AgentMessageSchema", { enumerable: true, get: function () { return schema_1.AgentMessageSchema; } });
|
|
14
|
+
Object.defineProperty(exports, "AgentTextContentSchema", { enumerable: true, get: function () { return schema_1.AgentTextContentSchema; } });
|
|
15
|
+
Object.defineProperty(exports, "AgentToolCallContentSchema", { enumerable: true, get: function () { return schema_1.AgentToolCallContentSchema; } });
|
|
16
|
+
Object.defineProperty(exports, "AgentToolResultContentSchema", { enumerable: true, get: function () { return schema_1.AgentToolResultContentSchema; } });
|
|
17
|
+
var utils_1 = require("./Agent/utils");
|
|
18
|
+
Object.defineProperty(exports, "setOpenInferenceInputAttr", { enumerable: true, get: function () { return utils_1.setOpenInferenceInputAttr; } });
|
|
19
|
+
Object.defineProperty(exports, "setOpenInferenceResponseOutputAttr", { enumerable: true, get: function () { return utils_1.setOpenInferenceResponseOutputAttr; } });
|
|
20
|
+
Object.defineProperty(exports, "setOpenInferenceToolCallOutputAttr", { enumerable: true, get: function () { return utils_1.setOpenInferenceToolCallOutputAttr; } });
|
|
21
|
+
Object.defineProperty(exports, "setOpenInferenceUsageOutputAttr", { enumerable: true, get: function () { return utils_1.setOpenInferenceUsageOutputAttr; } });
|
|
22
|
+
Object.defineProperty(exports, "tryParseJson", { enumerable: true, get: function () { return utils_1.tryParseJson; } });
|
|
23
|
+
var MCPClient_1 = require("./Integrations/MCPClient");
|
|
24
|
+
Object.defineProperty(exports, "MCPClient", { enumerable: true, get: function () { return MCPClient_1.MCPClient; } });
|
|
25
|
+
var openai_1 = require("./Integrations/openai");
|
|
26
|
+
Object.defineProperty(exports, "openaiLLMIntegration", { enumerable: true, get: function () { return openai_1.openaiLLMIntegration; } });
|
|
6
27
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,iCAA0C;AAAjC,wGAAA,eAAe,OAAA;AACxB,uDAAsD;AAA7C,8GAAA,aAAa,OAAA;AACtB,+CAAoD;AAA3C,4GAAA,eAAe,OAAA;AACxB,yCAOwB;AANtB,iHAAA,uBAAuB,OAAA;AACvB,mHAAA,yBAAyB,OAAA;AACzB,4GAAA,kBAAkB,OAAA;AAClB,gHAAA,sBAAsB,OAAA;AACtB,oHAAA,0BAA0B,OAAA;AAC1B,sHAAA,4BAA4B,OAAA;AAwB9B,uCAMuB;AALrB,kHAAA,yBAAyB,OAAA;AACzB,2HAAA,kCAAkC,OAAA;AAClC,2HAAA,kCAAkC,OAAA;AAClC,wHAAA,+BAA+B,OAAA;AAC/B,qGAAA,YAAY,OAAA;AAEd,sDAAqD;AAA5C,sGAAA,SAAS,OAAA;AAClB,gDAA6D;AAApD,8GAAA,oBAAoB,OAAA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { OtelInfoType } from './types';
|
|
2
|
+
export interface IMCPClient {
|
|
3
|
+
connect: (config: {
|
|
4
|
+
otelInfo: OtelInfoType;
|
|
5
|
+
}) => Promise<void>;
|
|
6
|
+
invokeTool: (param: {
|
|
7
|
+
name: string;
|
|
8
|
+
arguments?: Record<string, unknown> | null;
|
|
9
|
+
}, config: {
|
|
10
|
+
otelInfo: OtelInfoType;
|
|
11
|
+
}) => Promise<string>;
|
|
12
|
+
disconnect: (config: {
|
|
13
|
+
otelInfo: OtelInfoType;
|
|
14
|
+
}) => Promise<void>;
|
|
15
|
+
getTools: (config: {
|
|
16
|
+
otelInfo: OtelInfoType;
|
|
17
|
+
}) => Promise<{
|
|
18
|
+
name: string;
|
|
19
|
+
description: string;
|
|
20
|
+
inputSchema: Record<string, any>;
|
|
21
|
+
}[]>;
|
|
22
|
+
getToolPriority(config: {
|
|
23
|
+
otelInfo: OtelInfoType;
|
|
24
|
+
}): Promise<Record<string, number>>;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=interfaces.mcp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces.mcp.d.ts","sourceRoot":"","sources":["../src/interfaces.mcp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,CAAC,MAAM,EAAE;QAAE,QAAQ,EAAE,YAAY,CAAA;KAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/D,UAAU,EAAE,CACV,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAA;KAAE,EACnE,MAAM,EAAE;QAAE,QAAQ,EAAE,YAAY,CAAA;KAAE,KAC/B,OAAO,CAAC,MAAM,CAAC,CAAC;IACrB,UAAU,EAAE,CAAC,MAAM,EAAE;QAAE,QAAQ,EAAE,YAAY,CAAA;KAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAClE,QAAQ,EAAE,CAAC,MAAM,EAAE;QAAE,QAAQ,EAAE,YAAY,CAAA;KAAE,KAAK,OAAO,CACvD;QACE,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,MAAM,CAAC;QAEpB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KAClC,EAAE,CACJ,CAAC;IACF,eAAe,CAAC,MAAM,EAAE;QAAE,QAAQ,EAAE,YAAY,CAAA;KAAE,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACtF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces.mcp.js","sourceRoot":"","sources":["../src/interfaces.mcp.ts"],"names":[],"mappings":""}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAEtD,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,IAAI,CAAC;IACX,OAAO,EAAE,oBAAoB,CAAC;CAC/B,CAAC"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arvo-tools/agentic",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Agentic toolset for building applications using arvo-core and arvo-event-handler",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -25,8 +25,15 @@
|
|
|
25
25
|
"access": "public"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
+
"@arizeai/openinference-semantic-conventions": "^2.1.2",
|
|
29
|
+
"@modelcontextprotocol/sdk": "^1.22.0",
|
|
30
|
+
"@opentelemetry/api": "1.9.0",
|
|
28
31
|
"arvo-core": "^3.0.19",
|
|
29
|
-
"arvo-event-handler": "^3.0.19"
|
|
32
|
+
"arvo-event-handler": "^3.0.19",
|
|
33
|
+
"openai": "^6.9.1",
|
|
34
|
+
"uuid": "^13.0.0",
|
|
35
|
+
"zod": "^3.25.74",
|
|
36
|
+
"zod-to-json-schema": "^3.24.6"
|
|
30
37
|
},
|
|
31
38
|
"devDependencies": {
|
|
32
39
|
"@types/node": "^24.10.1"
|