@personaai/runtime 0.5.0 → 0.5.2

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/index.js CHANGED
@@ -126,7 +126,7 @@ function evictStaleRuns(runs, now, graceMs = DEFAULT_RUN_GRACE_MS, maxTracked =
126
126
  }
127
127
 
128
128
  // src/version.ts
129
- var RUNTIME_VERSION = "0.5.0";
129
+ var RUNTIME_VERSION = "0.5.2";
130
130
 
131
131
  // src/routes/health.ts
132
132
  var alwaysOnCapabilities = {
@@ -294,7 +294,10 @@ var RunDriver = class {
294
294
  interrupted: acc.interrupted,
295
295
  erroredInBand: acc.erroredInBand
296
296
  };
297
- await hooks?.afterRun?.(this.runCtx, result);
297
+ try {
298
+ await hooks?.afterRun?.(this.runCtx, result);
299
+ } catch {
300
+ }
298
301
  } catch (err) {
299
302
  await hooks?.onError?.(
300
303
  {
@@ -661,6 +664,13 @@ var listAgents = async (request, ctx) => {
661
664
  });
662
665
  return json(200, items);
663
666
  };
667
+ var getAgentMcpConnections = async (request, ctx) => {
668
+ const connections = await ctx.client.agents.getMcpConnections(
669
+ requireParam(ctx.params, "id"),
670
+ request.query.returnTo
671
+ );
672
+ return json(200, connections);
673
+ };
664
674
  var createAgent = async (request, ctx) => {
665
675
  const body = requireBodyObject(request.body);
666
676
  const input = {
@@ -1221,6 +1231,11 @@ function buildRoutes(capabilities) {
1221
1231
  method: "DELETE",
1222
1232
  pattern: ["mcps", ":id", "oauth", "owner", "connection"],
1223
1233
  handler: disconnectOwnerConnection
1234
+ },
1235
+ {
1236
+ method: "GET",
1237
+ pattern: ["agents", ":id", "mcp-connections"],
1238
+ handler: getAgentMcpConnections
1224
1239
  }
1225
1240
  ];
1226
1241
  if (capabilities.agentsWrite) {
@@ -1368,7 +1383,8 @@ function createRuntime(options) {
1368
1383
  let userId = null;
1369
1384
  if (match.route.requiresAuth !== false) {
1370
1385
  try {
1371
- userId = await options.resolveUser(request);
1386
+ const resolved = await options.resolveUser(request);
1387
+ userId = typeof resolved === "string" && resolved.length > 0 ? resolved : null;
1372
1388
  } catch {
1373
1389
  userId = null;
1374
1390
  }