@mastra/core 0.1.20 → 0.1.22
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/agent-apis.d.ts +1 -0
- package/dist/agents/agent-apis.d.ts.map +1 -1
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/vercel/index.d.ts.map +1 -1
- package/dist/core.cjs.development.js +95 -58
- 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 +95 -58
- package/dist/core.esm.js.map +1 -1
- package/dist/framework.d.ts +8 -1
- package/dist/framework.d.ts.map +1 -1
- package/dist/workflows/handler.d.ts +12 -0
- package/dist/workflows/handler.d.ts.map +1 -1
- package/dist/workflows/runner.d.ts +7 -1
- package/dist/workflows/runner.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-apis.d.ts","sourceRoot":"","sources":["../../src/agents/agent-apis.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,wBAAgB,kBAAkB,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE;;;;;;;;;;;;;;;;;;;;;;8BAuB3B,GAAG
|
|
1
|
+
{"version":3,"file":"agent-apis.d.ts","sourceRoot":"","sources":["../../src/agents/agent-apis.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,wBAAgB,kBAAkB,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE;;;;;;;;;;;;;;;;;;;;;;8BAuB3B,GAAG;;;;IA4CxC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/agents/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1C,wBAAsB,QAAQ,CAAC,EAC7B,YAAY,EACZ,KAAK,EACL,IAAI,EACJ,MAAM,GACP,EAAE;IACD,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IACrC,MAAM,EAAE,GAAG,CAAC;CACb;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/agents/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1C,wBAAsB,QAAQ,CAAC,EAC7B,YAAY,EACZ,KAAK,EACL,IAAI,EACJ,MAAM,GACP,EAAE;IACD,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IACrC,MAAM,EAAE,GAAG,CAAC;CACb;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAsH49N,CAAC;;;;;;;iEAN79N;AAED,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/agents/vercel/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAkC,MAAM,IAAI,CAAC;AA6EjE,wBAAgB,iBAAiB,CAAC,EAChC,kBAAkB,EAClB,QAAY,EAC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AAC,EAAE;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,GAAG,CAAA;KAAE,CAAC;IACtD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,OAAO,CAAC,EAAE,WAAW,EAAE,CAAC;CACzB,gBAO2B;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,kDA4C7C"}
|
|
@@ -2041,7 +2041,7 @@ var createWorkflowHandler = function createWorkflowHandler(_ref3) {
|
|
|
2041
2041
|
event: 'workflow/run-automations'
|
|
2042
2042
|
}, /*#__PURE__*/function () {
|
|
2043
2043
|
var _ref5 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(_ref4) {
|
|
2044
|
-
var event, step, _event$data, trigger, payload, connectionId, getBlueprintsDirPath, blueprints, triggeredAndPublishedBlueprints, runs;
|
|
2044
|
+
var event, step, _event$data, trigger, payload, connectionId, getBlueprintsDirPath, blueprints, triggeredAndPublishedBlueprints, runs, data;
|
|
2045
2045
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
2046
2046
|
while (1) switch (_context3.prev = _context3.next) {
|
|
2047
2047
|
case 0:
|
|
@@ -2107,22 +2107,24 @@ var createWorkflowHandler = function createWorkflowHandler(_ref3) {
|
|
|
2107
2107
|
_context3.next = 12;
|
|
2108
2108
|
return Promise.all(runs);
|
|
2109
2109
|
case 12:
|
|
2110
|
+
data = _context3.sent;
|
|
2110
2111
|
return _context3.abrupt("return", {
|
|
2111
2112
|
event: event,
|
|
2112
|
-
body: "sync completed"
|
|
2113
|
+
body: "sync completed",
|
|
2114
|
+
data: data
|
|
2113
2115
|
});
|
|
2114
|
-
case
|
|
2115
|
-
_context3.prev =
|
|
2116
|
+
case 16:
|
|
2117
|
+
_context3.prev = 16;
|
|
2116
2118
|
_context3.t0 = _context3["catch"](1);
|
|
2117
2119
|
return _context3.abrupt("return", {
|
|
2118
2120
|
event: event,
|
|
2119
2121
|
body: "error occurred while running sync: " + _context3.t0
|
|
2120
2122
|
});
|
|
2121
|
-
case
|
|
2123
|
+
case 19:
|
|
2122
2124
|
case "end":
|
|
2123
2125
|
return _context3.stop();
|
|
2124
2126
|
}
|
|
2125
|
-
}, _callee3, null, [[1,
|
|
2127
|
+
}, _callee3, null, [[1, 16]]);
|
|
2126
2128
|
}));
|
|
2127
2129
|
return function (_x3) {
|
|
2128
2130
|
return _ref5.apply(this, arguments);
|
|
@@ -4208,11 +4210,11 @@ function runActionsRecursively(_x) {
|
|
|
4208
4210
|
}
|
|
4209
4211
|
function _runActionsRecursively() {
|
|
4210
4212
|
_runActionsRecursively = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref7) {
|
|
4211
|
-
var blueprintActions, frameworkApis, frameworkEvents, dataContext, blueprintId, runId, ctx, blueprintActionKVMap, logger, _loop, _ret, _iterator2, _step2;
|
|
4213
|
+
var blueprintActions, frameworkApis, frameworkEvents, dataContext, blueprintId, runId, ctx, blueprintActionKVMap, logger, order, _loop, _ret, _iterator2, _step2;
|
|
4212
4214
|
return _regeneratorRuntime().wrap(function _callee$(_context3) {
|
|
4213
4215
|
while (1) switch (_context3.prev = _context3.next) {
|
|
4214
4216
|
case 0:
|
|
4215
|
-
blueprintActions = _ref7.blueprintActions, frameworkApis = _ref7.frameworkApis, frameworkEvents = _ref7.frameworkEvents, dataContext = _ref7.dataContext, blueprintId = _ref7.blueprintId, runId = _ref7.runId, ctx = _ref7.ctx, blueprintActionKVMap = _ref7.blueprintActionKVMap, logger = _ref7.logger;
|
|
4217
|
+
blueprintActions = _ref7.blueprintActions, frameworkApis = _ref7.frameworkApis, frameworkEvents = _ref7.frameworkEvents, dataContext = _ref7.dataContext, blueprintId = _ref7.blueprintId, runId = _ref7.runId, ctx = _ref7.ctx, blueprintActionKVMap = _ref7.blueprintActionKVMap, logger = _ref7.logger, order = _ref7.order;
|
|
4216
4218
|
_loop = /*#__PURE__*/_regeneratorRuntime().mark(function _loop() {
|
|
4217
4219
|
var _action$subActions;
|
|
4218
4220
|
var action, concreteAction, hasValidBranch, _loop2, _ret2, _iterator3, _step3, defaultCondition, defaultAction, actionExecutor, _ref9, mastraConnectionId, actionPayload, resolvedPayload, resolvedSchema, data, executorResult, _ctx, subActions;
|
|
@@ -4308,7 +4310,8 @@ function _runActionsRecursively() {
|
|
|
4308
4310
|
runId: runId,
|
|
4309
4311
|
ctx: ctx,
|
|
4310
4312
|
blueprintActionKVMap: blueprintActionKVMap,
|
|
4311
|
-
logger: logger
|
|
4313
|
+
logger: logger,
|
|
4314
|
+
order: order + 1
|
|
4312
4315
|
});
|
|
4313
4316
|
case 22:
|
|
4314
4317
|
executorResult = _context.sent;
|
|
@@ -4390,7 +4393,8 @@ function _runActionsRecursively() {
|
|
|
4390
4393
|
ctx: ctx,
|
|
4391
4394
|
blueprintId: blueprintId,
|
|
4392
4395
|
blueprintActionKVMap: blueprintActionKVMap,
|
|
4393
|
-
logger: logger
|
|
4396
|
+
logger: logger,
|
|
4397
|
+
order: order + 1
|
|
4394
4398
|
});
|
|
4395
4399
|
case 26:
|
|
4396
4400
|
_context2.t1 = _context2.sent;
|
|
@@ -4483,7 +4487,9 @@ function _runActionsRecursively() {
|
|
|
4483
4487
|
v: false
|
|
4484
4488
|
});
|
|
4485
4489
|
case 57:
|
|
4486
|
-
dataContext[action.id] = executorResult
|
|
4490
|
+
dataContext[action.id] = _extends({}, executorResult, {
|
|
4491
|
+
workflowStepOrder: order
|
|
4492
|
+
});
|
|
4487
4493
|
if (!(action.type === "CONDITIONS" || (_action$subActions = action.subActions) != null && _action$subActions.length)) {
|
|
4488
4494
|
_context2.next = 65;
|
|
4489
4495
|
break;
|
|
@@ -4503,7 +4509,8 @@ function _runActionsRecursively() {
|
|
|
4503
4509
|
ctx: ctx,
|
|
4504
4510
|
blueprintId: blueprintId,
|
|
4505
4511
|
blueprintActionKVMap: blueprintActionKVMap,
|
|
4506
|
-
logger: logger
|
|
4512
|
+
logger: logger,
|
|
4513
|
+
order: order + 1
|
|
4507
4514
|
});
|
|
4508
4515
|
case 63:
|
|
4509
4516
|
_context2.t3 = _context2.sent;
|
|
@@ -4611,7 +4618,9 @@ function _blueprintRunner() {
|
|
|
4611
4618
|
message: 'Workflow run skipped'
|
|
4612
4619
|
})
|
|
4613
4620
|
});
|
|
4614
|
-
return _context4.abrupt("return"
|
|
4621
|
+
return _context4.abrupt("return", {
|
|
4622
|
+
fullCtx: null
|
|
4623
|
+
});
|
|
4615
4624
|
case 16:
|
|
4616
4625
|
blueprintActionKVMap = constructWorkflowContextBluePrint(blueprint);
|
|
4617
4626
|
_context4.next = 19;
|
|
@@ -4624,28 +4633,40 @@ function _blueprintRunner() {
|
|
|
4624
4633
|
blueprintActionKVMap: blueprintActionKVMap,
|
|
4625
4634
|
blueprintId: blueprint.id,
|
|
4626
4635
|
runId: '',
|
|
4627
|
-
logger: logger
|
|
4636
|
+
logger: logger,
|
|
4637
|
+
order: 0
|
|
4628
4638
|
});
|
|
4629
4639
|
case 19:
|
|
4630
4640
|
ranSuccessfully = _context4.sent;
|
|
4631
|
-
|
|
4632
|
-
|
|
4633
|
-
|
|
4634
|
-
|
|
4635
|
-
|
|
4636
|
-
|
|
4637
|
-
})
|
|
4638
|
-
});
|
|
4639
|
-
} else {
|
|
4640
|
-
logger.error({
|
|
4641
|
-
type: RegisteredLogger.WORKFLOW,
|
|
4642
|
-
destinationPath: "" + blueprint.id,
|
|
4643
|
-
message: JSON.stringify({
|
|
4644
|
-
message: 'Workflow run failed'
|
|
4645
|
-
})
|
|
4646
|
-
});
|
|
4641
|
+
console.log('====Full context====', {
|
|
4642
|
+
fullCtx: fullCtx
|
|
4643
|
+
});
|
|
4644
|
+
if (!ranSuccessfully) {
|
|
4645
|
+
_context4.next = 26;
|
|
4646
|
+
break;
|
|
4647
4647
|
}
|
|
4648
|
-
|
|
4648
|
+
logger.info({
|
|
4649
|
+
type: RegisteredLogger.WORKFLOW,
|
|
4650
|
+
destinationPath: "" + blueprint.id,
|
|
4651
|
+
message: JSON.stringify({
|
|
4652
|
+
message: 'Workflow run completed'
|
|
4653
|
+
})
|
|
4654
|
+
});
|
|
4655
|
+
return _context4.abrupt("return", {
|
|
4656
|
+
fullCtx: fullCtx
|
|
4657
|
+
});
|
|
4658
|
+
case 26:
|
|
4659
|
+
logger.error({
|
|
4660
|
+
type: RegisteredLogger.WORKFLOW,
|
|
4661
|
+
destinationPath: "" + blueprint.id,
|
|
4662
|
+
message: JSON.stringify({
|
|
4663
|
+
message: 'Workflow run failed'
|
|
4664
|
+
})
|
|
4665
|
+
});
|
|
4666
|
+
return _context4.abrupt("return", {
|
|
4667
|
+
fullCtx: null
|
|
4668
|
+
});
|
|
4669
|
+
case 28:
|
|
4649
4670
|
case "end":
|
|
4650
4671
|
return _context4.stop();
|
|
4651
4672
|
}
|
|
@@ -5811,7 +5832,7 @@ function getAgentSystemApis(_ref) {
|
|
|
5811
5832
|
}),
|
|
5812
5833
|
executor: function () {
|
|
5813
5834
|
var _executor = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref2) {
|
|
5814
|
-
var data, ctx, executor, result, _run$content, thread, run;
|
|
5835
|
+
var data, ctx, executor, _answer, result, answer, _result$toolCalls, _run$content, _run$content2, thread, run, message, _answer2;
|
|
5815
5836
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
5816
5837
|
while (1) switch (_context.prev = _context.next) {
|
|
5817
5838
|
case 0:
|
|
@@ -5823,27 +5844,31 @@ function getAgentSystemApis(_ref) {
|
|
|
5823
5844
|
});
|
|
5824
5845
|
case 3:
|
|
5825
5846
|
executor = _context.sent;
|
|
5826
|
-
console.log('executor====', {
|
|
5827
|
-
executor: executor
|
|
5828
|
-
});
|
|
5829
5847
|
if (executor) {
|
|
5830
|
-
_context.next =
|
|
5848
|
+
_context.next = 6;
|
|
5831
5849
|
break;
|
|
5832
5850
|
}
|
|
5833
5851
|
throw new Error('Could not create agent executor');
|
|
5834
|
-
case
|
|
5852
|
+
case 6:
|
|
5835
5853
|
if (!(typeof executor === 'function')) {
|
|
5836
5854
|
_context.next = 14;
|
|
5837
5855
|
break;
|
|
5838
5856
|
}
|
|
5839
|
-
_context.next =
|
|
5857
|
+
_context.next = 9;
|
|
5840
5858
|
return executor({
|
|
5841
5859
|
prompt: data == null ? void 0 : data.message
|
|
5842
5860
|
});
|
|
5843
|
-
case
|
|
5861
|
+
case 9:
|
|
5844
5862
|
result = _context.sent;
|
|
5863
|
+
if (Array.isArray(result.toolCalls)) {
|
|
5864
|
+
answer = (_result$toolCalls = result.toolCalls) == null ? void 0 : _result$toolCalls.find(function (_ref3) {
|
|
5865
|
+
var toolName = _ref3.toolName;
|
|
5866
|
+
return toolName === 'answer';
|
|
5867
|
+
});
|
|
5868
|
+
}
|
|
5845
5869
|
return _context.abrupt("return", {
|
|
5846
|
-
message: result == null ? void 0 : result.text
|
|
5870
|
+
message: result == null ? void 0 : result.text,
|
|
5871
|
+
answer: (_answer = answer) == null ? void 0 : _answer.args
|
|
5847
5872
|
});
|
|
5848
5873
|
case 14:
|
|
5849
5874
|
_context.next = 16;
|
|
@@ -5859,10 +5884,15 @@ function getAgentSystemApis(_ref) {
|
|
|
5859
5884
|
});
|
|
5860
5885
|
case 19:
|
|
5861
5886
|
run = _context.sent;
|
|
5887
|
+
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 ? void 0 : _run$content2.find(function (m) {
|
|
5889
|
+
return m.toolName === 'answer';
|
|
5890
|
+
}).args;
|
|
5862
5891
|
return _context.abrupt("return", {
|
|
5863
|
-
message:
|
|
5892
|
+
message: message,
|
|
5893
|
+
answer: _answer2
|
|
5864
5894
|
});
|
|
5865
|
-
case
|
|
5895
|
+
case 23:
|
|
5866
5896
|
case "end":
|
|
5867
5897
|
return _context.stop();
|
|
5868
5898
|
}
|
|
@@ -6537,7 +6567,7 @@ function createAgent(_ref6) {
|
|
|
6537
6567
|
});
|
|
6538
6568
|
return /*#__PURE__*/function () {
|
|
6539
6569
|
var _ref8 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(_ref7) {
|
|
6540
|
-
var prompt, argsForExecute;
|
|
6570
|
+
var prompt, argsForExecute, messages;
|
|
6541
6571
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
6542
6572
|
while (1) switch (_context4.prev = _context4.next) {
|
|
6543
6573
|
case 0:
|
|
@@ -6574,19 +6604,20 @@ function createAgent(_ref6) {
|
|
|
6574
6604
|
return onStepFinish;
|
|
6575
6605
|
}()
|
|
6576
6606
|
};
|
|
6577
|
-
|
|
6607
|
+
messages = [].concat(context, [{
|
|
6608
|
+
role: 'user',
|
|
6609
|
+
content: prompt
|
|
6610
|
+
}, {
|
|
6611
|
+
role: 'system',
|
|
6612
|
+
content: agent_instructions
|
|
6613
|
+
}]);
|
|
6614
|
+
_context4.next = 5;
|
|
6578
6615
|
return ai.generateText(_extends({
|
|
6579
|
-
messages:
|
|
6580
|
-
role: 'user',
|
|
6581
|
-
content: prompt
|
|
6582
|
-
}, {
|
|
6583
|
-
role: 'system',
|
|
6584
|
-
content: agent_instructions
|
|
6585
|
-
}])
|
|
6616
|
+
messages: messages
|
|
6586
6617
|
}, argsForExecute));
|
|
6587
|
-
case 4:
|
|
6588
|
-
return _context4.abrupt("return", _context4.sent);
|
|
6589
6618
|
case 5:
|
|
6619
|
+
return _context4.abrupt("return", _context4.sent);
|
|
6620
|
+
case 6:
|
|
6590
6621
|
case "end":
|
|
6591
6622
|
return _context4.stop();
|
|
6592
6623
|
}
|
|
@@ -6611,7 +6642,7 @@ function getAgent(_x) {
|
|
|
6611
6642
|
function _getAgent() {
|
|
6612
6643
|
_getAgent = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(_ref) {
|
|
6613
6644
|
var _agent$model$provider, _agent$model$provider2;
|
|
6614
|
-
var connectionId, agent, apis, logger, tools, toolMap, getAssistantAgent, assistant, _agent$model2, keyToModel, _tools, _toolMap, resultTool, schema, _agent$model;
|
|
6645
|
+
var connectionId, agent, apis, logger, tools, toolMap, getAssistantAgent, assistant, _agent$model2, keyToModel, _tools, _toolMap, resultTool, _agent$outputs, schema, _agent$model;
|
|
6615
6646
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
6616
6647
|
while (1) switch (_context3.prev = _context3.next) {
|
|
6617
6648
|
case 0:
|
|
@@ -6712,7 +6743,7 @@ function _getAgent() {
|
|
|
6712
6743
|
}, {});
|
|
6713
6744
|
resultTool = undefined;
|
|
6714
6745
|
if (agent.outputs.structured) {
|
|
6715
|
-
schema = Object.entries(agent.outputs.structured
|
|
6746
|
+
schema = Object.entries(agent.outputs.structured).reduce(function (memo, _ref5) {
|
|
6716
6747
|
var k = _ref5[0],
|
|
6717
6748
|
v = _ref5[1];
|
|
6718
6749
|
if (v.type === 'string') {
|
|
@@ -6728,7 +6759,7 @@ function _getAgent() {
|
|
|
6728
6759
|
return memo;
|
|
6729
6760
|
}, {});
|
|
6730
6761
|
resultTool = {
|
|
6731
|
-
description: agent.outputs.
|
|
6762
|
+
description: ((_agent$outputs = agent.outputs) == null ? void 0 : _agent$outputs.description) || 'Structured Output',
|
|
6732
6763
|
parameters: zod.z.object(schema)
|
|
6733
6764
|
};
|
|
6734
6765
|
}
|
|
@@ -6898,7 +6929,7 @@ var Mastra = /*#__PURE__*/function () {
|
|
|
6898
6929
|
this.runBlueprint = /*#__PURE__*/function () {
|
|
6899
6930
|
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref2) {
|
|
6900
6931
|
var _this$availableIntegr;
|
|
6901
|
-
var blueprint, _ref2$dataCtx, dataCtx, ctx, systemApis, systemEvents, availableIntegrations, availableIntegrationApis, availableIntegrationEvents, frameworkApis, frameworkEvents;
|
|
6932
|
+
var blueprint, _ref2$dataCtx, dataCtx, ctx, systemApis, systemEvents, availableIntegrations, availableIntegrationApis, availableIntegrationEvents, frameworkApis, frameworkEvents, blueprintResult;
|
|
6902
6933
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
6903
6934
|
while (1) switch (_context.prev = _context.next) {
|
|
6904
6935
|
case 0:
|
|
@@ -6931,6 +6962,9 @@ var Mastra = /*#__PURE__*/function () {
|
|
|
6931
6962
|
logger: _this.logger.get('WORKFLOW')
|
|
6932
6963
|
});
|
|
6933
6964
|
case 10:
|
|
6965
|
+
blueprintResult = _context.sent;
|
|
6966
|
+
return _context.abrupt("return", blueprintResult);
|
|
6967
|
+
case 12:
|
|
6934
6968
|
case "end":
|
|
6935
6969
|
return _context.stop();
|
|
6936
6970
|
}
|
|
@@ -7582,6 +7616,7 @@ var Mastra = /*#__PURE__*/function () {
|
|
|
7582
7616
|
case 27:
|
|
7583
7617
|
return _context8.abrupt("return", {
|
|
7584
7618
|
status: lastRun.status,
|
|
7619
|
+
output: lastRun.output,
|
|
7585
7620
|
startedAt: lastRun.run_started_at,
|
|
7586
7621
|
endedAt: lastRun.ended_at
|
|
7587
7622
|
});
|
|
@@ -7848,7 +7883,9 @@ var Mastra = /*#__PURE__*/function () {
|
|
|
7848
7883
|
var v = _ref30[1];
|
|
7849
7884
|
return _extends({}, acc, v);
|
|
7850
7885
|
}, {});
|
|
7851
|
-
console.log('got finalApis==='
|
|
7886
|
+
console.log('got finalApis===', {
|
|
7887
|
+
finalApis: finalApis
|
|
7888
|
+
});
|
|
7852
7889
|
return _context14.abrupt("return", getAgent({
|
|
7853
7890
|
connectionId: connectionId,
|
|
7854
7891
|
agent: agentBlueprint,
|