@mastra/core 0.1.22 → 0.1.24
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/agents/openai/assistant.d.ts +6 -3
- package/dist/agents/openai/assistant.d.ts.map +1 -1
- package/dist/agents/vector-sync.d.ts.map +1 -1
- package/dist/core.cjs.development.js +48 -48
- package/dist/core.cjs.development.js.map +1 -1
- package/dist/core.cjs.production.min.js +1 -1
- package/dist/core.cjs.production.min.js.map +1 -1
- package/dist/core.esm.js +52 -48
- package/dist/core.esm.js.map +1 -1
- package/dist/framework.d.ts +13 -6
- package/dist/framework.d.ts.map +1 -1
- package/dist/integration.d.ts +0 -1
- package/dist/integration.d.ts.map +1 -1
- package/dist/utils/inngest.d.ts +1 -0
- package/dist/utils/inngest.d.ts.map +1 -1
- package/dist/workflows/handler.d.ts +5 -0
- package/dist/workflows/handler.d.ts.map +1 -1
- package/dist/workflows/runner.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -52,13 +52,15 @@ export declare function getAssistantAgentHandler(logger?: Logger<{
|
|
|
52
52
|
}) => Promise<OpenAI.Beta.Threads.Runs.Run & {
|
|
53
53
|
_request_id?: string | null;
|
|
54
54
|
}>;
|
|
55
|
-
handleRunStatus: ({ threadId, run, }: {
|
|
55
|
+
handleRunStatus: ({ threadId, run, callback, }: {
|
|
56
56
|
run: OpenAI.Beta.Threads.Runs.Run;
|
|
57
57
|
threadId: string;
|
|
58
|
+
callback?: (run: OpenAI.Beta.Threads.Run) => void;
|
|
58
59
|
}) => Promise<any>;
|
|
59
|
-
handleRequiresAction: ({ threadId, run, }: {
|
|
60
|
+
handleRequiresAction: ({ threadId, run, callback, }: {
|
|
60
61
|
threadId: string;
|
|
61
62
|
run: OpenAI.Beta.Threads.Runs.Run;
|
|
63
|
+
callback?: (run: OpenAI.Beta.Threads.Run) => void;
|
|
62
64
|
}) => Promise<any>;
|
|
63
65
|
createUserMessage: ({ threadId, content, }: {
|
|
64
66
|
threadId: string;
|
|
@@ -66,9 +68,10 @@ export declare function getAssistantAgentHandler(logger?: Logger<{
|
|
|
66
68
|
}) => Promise<OpenAI.Beta.Threads.Messages.Message & {
|
|
67
69
|
_request_id?: string | null;
|
|
68
70
|
}>;
|
|
69
|
-
watchRun: ({ runId, threadId, }: {
|
|
71
|
+
watchRun: ({ runId, threadId, callback, }: {
|
|
70
72
|
runId?: string;
|
|
71
73
|
threadId: string;
|
|
74
|
+
callback?: (run: OpenAI.Beta.Threads.Run) => void;
|
|
72
75
|
}) => Promise<any>;
|
|
73
76
|
}>;
|
|
74
77
|
//# sourceMappingURL=assistant.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assistant.d.ts","sourceRoot":"","sources":["../../../src/agents/openai/assistant.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAOrD,wBAAgB,2BAA2B,CACzC,MAAM,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,gBAAgB,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC,4DAQC;IACD,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,6BAA6B,CAAC;CACrE;;GA8BF;AAED,wBAAgB,2BAA2B,CACzC,MAAM,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,gBAAgB,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACjB,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C1B,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACrD;AAED,eAAO,MAAM,kBAAkB,8BA4B9B,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,EACjC,MAAM,GACP,EAAE;IACD,MAAM,EAAE,MAAM,CAAC;CAChB,GAAG,cAAc,EAAE,CA2DnB;AAED,wBAAgB,oBAAoB;;;;EAOnC;AAED,wBAAgB,uBAAuB;;;;EAOtC;AAED,wBAAgB,eAAe;;;;EAM9B;AAED,wBAAsB,wCAAwC,CAAC,EAC7D,MAAM,GACP,EAAE;IACD,MAAM,EAAE,MAAM,CAAC;CAChB,iBA2BA"}
|
|
@@ -1890,7 +1890,8 @@ var makeCallback = function makeCallback(framework) {
|
|
|
1890
1890
|
var APP_ID = 'mastra';
|
|
1891
1891
|
var client$1 = /*#__PURE__*/new inngest.Inngest({
|
|
1892
1892
|
id: APP_ID,
|
|
1893
|
-
eventKey: process.env.INNGEST_EVENT_KEY
|
|
1893
|
+
eventKey: process.env.INNGEST_EVENT_KEY,
|
|
1894
|
+
baseUrl: process.env.INNGEST_URL
|
|
1894
1895
|
});
|
|
1895
1896
|
|
|
1896
1897
|
function readBlueprintSync(filePath) {
|
|
@@ -4638,11 +4639,8 @@ function _blueprintRunner() {
|
|
|
4638
4639
|
});
|
|
4639
4640
|
case 19:
|
|
4640
4641
|
ranSuccessfully = _context4.sent;
|
|
4641
|
-
console.log('====Full context====', {
|
|
4642
|
-
fullCtx: fullCtx
|
|
4643
|
-
});
|
|
4644
4642
|
if (!ranSuccessfully) {
|
|
4645
|
-
_context4.next =
|
|
4643
|
+
_context4.next = 25;
|
|
4646
4644
|
break;
|
|
4647
4645
|
}
|
|
4648
4646
|
logger.info({
|
|
@@ -4655,7 +4653,7 @@ function _blueprintRunner() {
|
|
|
4655
4653
|
return _context4.abrupt("return", {
|
|
4656
4654
|
fullCtx: fullCtx
|
|
4657
4655
|
});
|
|
4658
|
-
case
|
|
4656
|
+
case 25:
|
|
4659
4657
|
logger.error({
|
|
4660
4658
|
type: RegisteredLogger.WORKFLOW,
|
|
4661
4659
|
destinationPath: "" + blueprint.id,
|
|
@@ -4666,7 +4664,7 @@ function _blueprintRunner() {
|
|
|
4666
4664
|
return _context4.abrupt("return", {
|
|
4667
4665
|
fullCtx: null
|
|
4668
4666
|
});
|
|
4669
|
-
case
|
|
4667
|
+
case 27:
|
|
4670
4668
|
case "end":
|
|
4671
4669
|
return _context4.stop();
|
|
4672
4670
|
}
|
|
@@ -5746,7 +5744,6 @@ function _syncAndWriteVectorProviderIndexesToLocal() {
|
|
|
5746
5744
|
while (1) switch (_context15.prev = _context15.next) {
|
|
5747
5745
|
case 0:
|
|
5748
5746
|
mastra = _ref14.mastra;
|
|
5749
|
-
// TODO: Return in prod ? or do somethif different
|
|
5750
5747
|
vectorProviders = mastra.config.agents.vectorProvider;
|
|
5751
5748
|
pullVectorProviderIndexes = /*#__PURE__*/function () {
|
|
5752
5749
|
var _ref16 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee11(_ref15) {
|
|
@@ -5885,9 +5882,9 @@ function getAgentSystemApis(_ref) {
|
|
|
5885
5882
|
case 19:
|
|
5886
5883
|
run = _context.sent;
|
|
5887
5884
|
message = run == null || (_run$content = run.content) == null || (_run$content = _run$content[0]) == null || (_run$content = _run$content.text) == null ? void 0 : _run$content.value;
|
|
5888
|
-
_answer2 = run == null || (_run$content2 = run.content) == null
|
|
5885
|
+
_answer2 = run == null || (_run$content2 = run.content) == null || (_run$content2 = _run$content2.find(function (m) {
|
|
5889
5886
|
return m.toolName === 'answer';
|
|
5890
|
-
}).args;
|
|
5887
|
+
})) == null ? void 0 : _run$content2.args;
|
|
5891
5888
|
return _context.abrupt("return", {
|
|
5892
5889
|
message: message,
|
|
5893
5890
|
answer: _answer2
|
|
@@ -5915,18 +5912,18 @@ if (process.env.OPENAI_API_KEY) {
|
|
|
5915
5912
|
function createAssistantAgentHandler(logger) {
|
|
5916
5913
|
return /*#__PURE__*/function () {
|
|
5917
5914
|
var _createAssistantAgent = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref) {
|
|
5918
|
-
var name, instructions, model, tools,
|
|
5915
|
+
var name, instructions, model, tools, assistant;
|
|
5919
5916
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
5920
5917
|
while (1) switch (_context.prev = _context.next) {
|
|
5921
5918
|
case 0:
|
|
5922
|
-
name = _ref.name, instructions = _ref.instructions, model = _ref.model, tools = _ref.tools
|
|
5919
|
+
name = _ref.name, instructions = _ref.instructions, model = _ref.model, tools = _ref.tools;
|
|
5923
5920
|
_context.next = 3;
|
|
5924
5921
|
return client.beta.assistants.create({
|
|
5925
5922
|
name: name,
|
|
5926
5923
|
model: model,
|
|
5927
5924
|
instructions: instructions,
|
|
5928
|
-
tools: tools
|
|
5929
|
-
response_format
|
|
5925
|
+
tools: tools
|
|
5926
|
+
//response_format,
|
|
5930
5927
|
});
|
|
5931
5928
|
case 3:
|
|
5932
5929
|
assistant = _context.sent;
|
|
@@ -5965,15 +5962,16 @@ function updateAssistantAgentHandler(logger) {
|
|
|
5965
5962
|
while (1) switch (_context2.prev = _context2.next) {
|
|
5966
5963
|
case 0:
|
|
5967
5964
|
assistantId = _ref2.assistantId, name = _ref2.name, instructions = _ref2.instructions, model = _ref2.model, tools = _ref2.tools, response_format = _ref2.response_format;
|
|
5968
|
-
|
|
5965
|
+
console.log('response_format', response_format);
|
|
5966
|
+
_context2.next = 4;
|
|
5969
5967
|
return client.beta.assistants.update(assistantId, {
|
|
5970
5968
|
name: name,
|
|
5971
5969
|
model: model,
|
|
5972
5970
|
instructions: instructions,
|
|
5973
|
-
tools: tools
|
|
5974
|
-
response_format
|
|
5971
|
+
tools: tools
|
|
5972
|
+
//response_format,
|
|
5975
5973
|
});
|
|
5976
|
-
case
|
|
5974
|
+
case 4:
|
|
5977
5975
|
assistant = _context2.sent;
|
|
5978
5976
|
logger == null || logger.info({
|
|
5979
5977
|
destinationPath: "" + assistant.id,
|
|
@@ -5990,7 +5988,7 @@ function updateAssistantAgentHandler(logger) {
|
|
|
5990
5988
|
}
|
|
5991
5989
|
}, null, 2)
|
|
5992
5990
|
});
|
|
5993
|
-
case
|
|
5991
|
+
case 6:
|
|
5994
5992
|
case "end":
|
|
5995
5993
|
return _context2.stop();
|
|
5996
5994
|
}
|
|
@@ -6016,11 +6014,11 @@ function getAssistantAgentHandler(logger) {
|
|
|
6016
6014
|
agent = _context11.sent;
|
|
6017
6015
|
handleRunStatus = /*#__PURE__*/function () {
|
|
6018
6016
|
var _ref5 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(_ref4) {
|
|
6019
|
-
var threadId, run, _messages$data, messages;
|
|
6017
|
+
var threadId, run, callback, _messages$data, messages;
|
|
6020
6018
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
6021
6019
|
while (1) switch (_context3.prev = _context3.next) {
|
|
6022
6020
|
case 0:
|
|
6023
|
-
threadId = _ref4.threadId, run = _ref4.run;
|
|
6021
|
+
threadId = _ref4.threadId, run = _ref4.run, callback = _ref4.callback;
|
|
6024
6022
|
if (!(run.status === 'completed')) {
|
|
6025
6023
|
_context3.next = 8;
|
|
6026
6024
|
break;
|
|
@@ -6032,17 +6030,19 @@ function getAssistantAgentHandler(logger) {
|
|
|
6032
6030
|
return _context3.abrupt("return", (_messages$data = messages.data) == null ? void 0 : _messages$data[0]);
|
|
6033
6031
|
case 8:
|
|
6034
6032
|
if (!(run.status === 'requires_action')) {
|
|
6035
|
-
_context3.next =
|
|
6033
|
+
_context3.next = 15;
|
|
6036
6034
|
break;
|
|
6037
6035
|
}
|
|
6038
|
-
|
|
6036
|
+
callback == null || callback(run);
|
|
6037
|
+
_context3.next = 12;
|
|
6039
6038
|
return handleRequiresAction({
|
|
6040
6039
|
run: run,
|
|
6041
|
-
threadId: threadId
|
|
6040
|
+
threadId: threadId,
|
|
6041
|
+
callback: callback
|
|
6042
6042
|
});
|
|
6043
|
-
case
|
|
6043
|
+
case 12:
|
|
6044
6044
|
return _context3.abrupt("return", _context3.sent);
|
|
6045
|
-
case
|
|
6045
|
+
case 15:
|
|
6046
6046
|
console.error('Run did not complete:', run);
|
|
6047
6047
|
logger == null || logger.error({
|
|
6048
6048
|
destinationPath: "" + id,
|
|
@@ -6057,7 +6057,7 @@ function getAssistantAgentHandler(logger) {
|
|
|
6057
6057
|
}, null, 2)
|
|
6058
6058
|
});
|
|
6059
6059
|
return _context3.abrupt("return", run == null ? void 0 : run.last_error);
|
|
6060
|
-
case
|
|
6060
|
+
case 18:
|
|
6061
6061
|
case "end":
|
|
6062
6062
|
return _context3.stop();
|
|
6063
6063
|
}
|
|
@@ -6069,13 +6069,13 @@ function getAssistantAgentHandler(logger) {
|
|
|
6069
6069
|
}();
|
|
6070
6070
|
handleRequiresAction = /*#__PURE__*/function () {
|
|
6071
6071
|
var _ref7 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(_ref6) {
|
|
6072
|
-
var threadId, run, toolOutputs;
|
|
6072
|
+
var threadId, run, callback, toolOutputs;
|
|
6073
6073
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
6074
6074
|
while (1) switch (_context5.prev = _context5.next) {
|
|
6075
6075
|
case 0:
|
|
6076
|
-
threadId = _ref6.threadId, run = _ref6.run;
|
|
6076
|
+
threadId = _ref6.threadId, run = _ref6.run, callback = _ref6.callback;
|
|
6077
6077
|
if (!(run.required_action && run.required_action.submit_tool_outputs && run.required_action.submit_tool_outputs.tool_calls)) {
|
|
6078
|
-
_context5.next =
|
|
6078
|
+
_context5.next = 22;
|
|
6079
6079
|
break;
|
|
6080
6080
|
}
|
|
6081
6081
|
_context5.t0 = _.compact;
|
|
@@ -6192,19 +6192,19 @@ function getAssistantAgentHandler(logger) {
|
|
|
6192
6192
|
});
|
|
6193
6193
|
return _context5.abrupt("return", handleRunStatus({
|
|
6194
6194
|
threadId: threadId,
|
|
6195
|
-
run: run
|
|
6195
|
+
run: run,
|
|
6196
|
+
callback: callback
|
|
6196
6197
|
}));
|
|
6197
6198
|
case 11:
|
|
6198
6199
|
if (!(toolOutputs && (toolOutputs == null ? void 0 : toolOutputs.length) > 0)) {
|
|
6199
|
-
_context5.next =
|
|
6200
|
+
_context5.next = 19;
|
|
6200
6201
|
break;
|
|
6201
6202
|
}
|
|
6202
|
-
|
|
6203
|
-
_context5.next = 15;
|
|
6203
|
+
_context5.next = 14;
|
|
6204
6204
|
return client.beta.threads.runs.submitToolOutputsAndPoll(threadId, run.id, {
|
|
6205
6205
|
tool_outputs: toolOutputs
|
|
6206
6206
|
});
|
|
6207
|
-
case
|
|
6207
|
+
case 14:
|
|
6208
6208
|
run = _context5.sent;
|
|
6209
6209
|
logger == null || logger.info({
|
|
6210
6210
|
destinationPath: "" + id,
|
|
@@ -6218,9 +6218,9 @@ function getAssistantAgentHandler(logger) {
|
|
|
6218
6218
|
}, null, 2)
|
|
6219
6219
|
});
|
|
6220
6220
|
console.log('Tool outputs submitted successfully.');
|
|
6221
|
-
_context5.next =
|
|
6221
|
+
_context5.next = 21;
|
|
6222
6222
|
break;
|
|
6223
|
-
case
|
|
6223
|
+
case 19:
|
|
6224
6224
|
logger == null || logger.info({
|
|
6225
6225
|
destinationPath: "" + id,
|
|
6226
6226
|
statusCode: 404,
|
|
@@ -6231,12 +6231,13 @@ function getAssistantAgentHandler(logger) {
|
|
|
6231
6231
|
}, null, 2)
|
|
6232
6232
|
});
|
|
6233
6233
|
console.log('No tool outputs to submit.');
|
|
6234
|
-
case
|
|
6234
|
+
case 21:
|
|
6235
6235
|
return _context5.abrupt("return", handleRunStatus({
|
|
6236
6236
|
threadId: threadId,
|
|
6237
|
-
run: run
|
|
6237
|
+
run: run,
|
|
6238
|
+
callback: callback
|
|
6238
6239
|
}));
|
|
6239
|
-
case
|
|
6240
|
+
case 22:
|
|
6240
6241
|
case "end":
|
|
6241
6242
|
return _context5.stop();
|
|
6242
6243
|
}
|
|
@@ -6346,11 +6347,11 @@ function getAssistantAgentHandler(logger) {
|
|
|
6346
6347
|
}(),
|
|
6347
6348
|
watchRun: function () {
|
|
6348
6349
|
var _watchRun = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee10(_ref13) {
|
|
6349
|
-
var runId, threadId, run;
|
|
6350
|
+
var runId, threadId, callback, run;
|
|
6350
6351
|
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
6351
6352
|
while (1) switch (_context10.prev = _context10.next) {
|
|
6352
6353
|
case 0:
|
|
6353
|
-
runId = _ref13.runId, threadId = _ref13.threadId;
|
|
6354
|
+
runId = _ref13.runId, threadId = _ref13.threadId, callback = _ref13.callback;
|
|
6354
6355
|
if (!runId) {
|
|
6355
6356
|
_context10.next = 7;
|
|
6356
6357
|
break;
|
|
@@ -6389,7 +6390,8 @@ function getAssistantAgentHandler(logger) {
|
|
|
6389
6390
|
case 11:
|
|
6390
6391
|
return _context10.abrupt("return", handleRunStatus({
|
|
6391
6392
|
threadId: threadId,
|
|
6392
|
-
run: run
|
|
6393
|
+
run: run,
|
|
6394
|
+
callback: callback
|
|
6393
6395
|
}));
|
|
6394
6396
|
case 12:
|
|
6395
6397
|
case "end":
|
|
@@ -7883,9 +7885,7 @@ var Mastra = /*#__PURE__*/function () {
|
|
|
7883
7885
|
var v = _ref30[1];
|
|
7884
7886
|
return _extends({}, acc, v);
|
|
7885
7887
|
}, {});
|
|
7886
|
-
console.log('got finalApis==='
|
|
7887
|
-
finalApis: finalApis
|
|
7888
|
-
});
|
|
7888
|
+
console.log('got finalApis===');
|
|
7889
7889
|
return _context14.abrupt("return", getAgent({
|
|
7890
7890
|
connectionId: connectionId,
|
|
7891
7891
|
agent: agentBlueprint,
|
|
@@ -7908,11 +7908,11 @@ var Mastra = /*#__PURE__*/function () {
|
|
|
7908
7908
|
return _regeneratorRuntime().wrap(function _callee15$(_context15) {
|
|
7909
7909
|
while (1) switch (_context15.prev = _context15.next) {
|
|
7910
7910
|
case 0:
|
|
7911
|
-
_context15.next =
|
|
7911
|
+
_context15.next = 3;
|
|
7912
7912
|
return syncAndWriteVectorProviderIndexesToLocal({
|
|
7913
7913
|
mastra: this
|
|
7914
7914
|
});
|
|
7915
|
-
case
|
|
7915
|
+
case 3:
|
|
7916
7916
|
case "end":
|
|
7917
7917
|
return _context15.stop();
|
|
7918
7918
|
}
|