@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.cjs CHANGED
@@ -154,7 +154,7 @@ function evictStaleRuns(runs, now, graceMs = DEFAULT_RUN_GRACE_MS, maxTracked =
154
154
  }
155
155
 
156
156
  // src/version.ts
157
- var RUNTIME_VERSION = "0.5.0";
157
+ var RUNTIME_VERSION = "0.5.2";
158
158
 
159
159
  // src/routes/health.ts
160
160
  var alwaysOnCapabilities = {
@@ -322,7 +322,10 @@ var RunDriver = class {
322
322
  interrupted: acc.interrupted,
323
323
  erroredInBand: acc.erroredInBand
324
324
  };
325
- await hooks?.afterRun?.(this.runCtx, result);
325
+ try {
326
+ await hooks?.afterRun?.(this.runCtx, result);
327
+ } catch {
328
+ }
326
329
  } catch (err) {
327
330
  await hooks?.onError?.(
328
331
  {
@@ -689,6 +692,13 @@ var listAgents = async (request, ctx) => {
689
692
  });
690
693
  return json(200, items);
691
694
  };
695
+ var getAgentMcpConnections = async (request, ctx) => {
696
+ const connections = await ctx.client.agents.getMcpConnections(
697
+ requireParam(ctx.params, "id"),
698
+ request.query.returnTo
699
+ );
700
+ return json(200, connections);
701
+ };
692
702
  var createAgent = async (request, ctx) => {
693
703
  const body = requireBodyObject(request.body);
694
704
  const input = {
@@ -1249,6 +1259,11 @@ function buildRoutes(capabilities) {
1249
1259
  method: "DELETE",
1250
1260
  pattern: ["mcps", ":id", "oauth", "owner", "connection"],
1251
1261
  handler: disconnectOwnerConnection
1262
+ },
1263
+ {
1264
+ method: "GET",
1265
+ pattern: ["agents", ":id", "mcp-connections"],
1266
+ handler: getAgentMcpConnections
1252
1267
  }
1253
1268
  ];
1254
1269
  if (capabilities.agentsWrite) {
@@ -1396,7 +1411,8 @@ function createRuntime(options) {
1396
1411
  let userId = null;
1397
1412
  if (match.route.requiresAuth !== false) {
1398
1413
  try {
1399
- userId = await options.resolveUser(request);
1414
+ const resolved = await options.resolveUser(request);
1415
+ userId = typeof resolved === "string" && resolved.length > 0 ? resolved : null;
1400
1416
  } catch {
1401
1417
  userId = null;
1402
1418
  }