@personaai/runtime 0.10.0 → 0.12.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/index.d.cts CHANGED
@@ -207,6 +207,8 @@ interface RuntimeCapabilities {
207
207
  knowledge?: boolean;
208
208
  /** Vector store CRUD and file read/write. @default false */
209
209
  stores?: boolean;
210
+ /** RCP (REST Connector Protocol) source CRUD + Test Connection. @default false */
211
+ rcpSources?: boolean;
210
212
  /** Security/compliance audit log read access. @default false */
211
213
  auditLogs?: boolean;
212
214
  /** The Architect co-pilot — builds/edits Agents on the caller's behalf via tool calls. @default false */
package/dist/index.d.ts CHANGED
@@ -207,6 +207,8 @@ interface RuntimeCapabilities {
207
207
  knowledge?: boolean;
208
208
  /** Vector store CRUD and file read/write. @default false */
209
209
  stores?: boolean;
210
+ /** RCP (REST Connector Protocol) source CRUD + Test Connection. @default false */
211
+ rcpSources?: boolean;
210
212
  /** Security/compliance audit log read access. @default false */
211
213
  auditLogs?: boolean;
212
214
  /** The Architect co-pilot — builds/edits Agents on the caller's behalf via tool calls. @default false */
package/dist/index.js CHANGED
@@ -692,6 +692,7 @@ function parseArchitectBody(body) {
692
692
  }
693
693
  return {
694
694
  messages: b.messages,
695
+ threadId: typeof b.threadId === "string" ? b.threadId : void 0,
695
696
  resume: b.resume ?? void 0
696
697
  };
697
698
  }
@@ -700,6 +701,7 @@ var architectRoute = async (request, ctx) => {
700
701
  logger.debug("architectRoute start", { userId: request.userId });
701
702
  const body = parseArchitectBody(request.body);
702
703
  logger.trace("architectRoute body", {
704
+ threadId: body.threadId,
703
705
  messageCount: body.messages?.length ?? 0,
704
706
  hasResume: !!body.resume
705
707
  });
@@ -707,18 +709,20 @@ var architectRoute = async (request, ctx) => {
707
709
  const runCtx = {
708
710
  userId,
709
711
  kind: "architect",
712
+ threadId: body.threadId,
710
713
  messages: body.messages
711
714
  };
712
- logger.debug("beforeRun hook (architect)", { userId });
715
+ logger.debug("beforeRun hook (architect)", { userId, threadId: body.threadId });
713
716
  await ctx.hooks?.beforeRun?.(runCtx);
714
717
  logger.trace("beforeRun completed (architect)");
715
- logger.debug("starting architect stream");
718
+ logger.debug("starting architect stream", { threadId: body.threadId });
716
719
  const stream = ctx.client.architect.stream({
717
720
  messages: body.messages,
721
+ threadId: body.threadId,
718
722
  resume: body.resume
719
723
  });
720
724
  const runId = crypto.randomUUID();
721
- logger.info("architect run created", { runId, userId });
725
+ logger.info("architect run created", { runId, userId, threadId: body.threadId });
722
726
  const driver = new RunDriver(runId, runCtx, stream, ctx.hooks, ctx.mode);
723
727
  ctx.runs.set(runId, driver);
724
728
  logger.debug("architect driver registered", { runId, trackedRuns: ctx.runs.size });
@@ -1350,6 +1354,57 @@ var deleteStoreFile = async (request, ctx) => {
1350
1354
  return noContent();
1351
1355
  };
1352
1356
 
1357
+ // src/routes/rcpSources.ts
1358
+ var listRcpSources = async (request, ctx) => {
1359
+ const items = await ctx.client.rcpSources.list({
1360
+ page: toInt(request.query.page),
1361
+ limit: toInt(request.query.limit),
1362
+ search: request.query.search
1363
+ });
1364
+ return json(200, items);
1365
+ };
1366
+ var createRcpSource = async (request, ctx) => {
1367
+ const body = requireBodyObject(request.body);
1368
+ const input = {
1369
+ name: requireStringField(body, "name"),
1370
+ url: requireStringField(body, "url"),
1371
+ description: typeof body.description === "string" ? body.description : void 0,
1372
+ authType: body.authType,
1373
+ secretRef: typeof body.secretRef === "string" ? body.secretRef : void 0,
1374
+ isEnabled: typeof body.isEnabled === "boolean" ? body.isEnabled : void 0,
1375
+ paramContextMap: Array.isArray(body.paramContextMap) ? body.paramContextMap : void 0
1376
+ };
1377
+ const source = await ctx.client.rcpSources.create(input);
1378
+ return json(201, source);
1379
+ };
1380
+ var getRcpSource = async (_request, ctx) => {
1381
+ const source = await ctx.client.rcpSources.get(requireParam(ctx.params, "id"));
1382
+ return json(200, source);
1383
+ };
1384
+ var updateRcpSource = async (request, ctx) => {
1385
+ const body = request.body ?? {};
1386
+ const source = await ctx.client.rcpSources.update(requireParam(ctx.params, "id"), body);
1387
+ return json(200, source);
1388
+ };
1389
+ var deleteRcpSource = async (_request, ctx) => {
1390
+ await ctx.client.rcpSources.delete(requireParam(ctx.params, "id"));
1391
+ return noContent();
1392
+ };
1393
+ var bulkDeleteRcpSources = async (request, ctx) => {
1394
+ const body = requireBodyObject(request.body);
1395
+ const ids = Array.isArray(body.ids) ? body.ids : [];
1396
+ const result = await ctx.client.rcpSources.bulkDelete(ids);
1397
+ return json(200, result);
1398
+ };
1399
+ var getRcpSourceUsage = async (_request, ctx) => {
1400
+ const usage = await ctx.client.rcpSources.getUsage(requireParam(ctx.params, "id"));
1401
+ return json(200, usage);
1402
+ };
1403
+ var testRcpSourceConnection = async (_request, ctx) => {
1404
+ const result = await ctx.client.rcpSources.testConnection(requireParam(ctx.params, "id"));
1405
+ return json(200, result);
1406
+ };
1407
+
1353
1408
  // src/routes/auditLogs.ts
1354
1409
  var listAuditLogs = async (request, ctx) => {
1355
1410
  const items = await ctx.client.auditLogs.list({
@@ -1521,6 +1576,7 @@ function resolveCapabilities(capabilities) {
1521
1576
  skills: capabilities?.skills ?? false,
1522
1577
  knowledge: capabilities?.knowledge ?? false,
1523
1578
  stores: capabilities?.stores ?? false,
1579
+ rcpSources: capabilities?.rcpSources ?? false,
1524
1580
  auditLogs: capabilities?.auditLogs ?? false,
1525
1581
  architect: capabilities?.architect ?? false,
1526
1582
  workflowsWrite: capabilities?.workflowsWrite ?? false
@@ -1699,6 +1755,18 @@ function buildRoutes(capabilities) {
1699
1755
  { method: "DELETE", pattern: ["stores", ":id", "file"], handler: deleteStoreFile }
1700
1756
  );
1701
1757
  }
1758
+ if (capabilities.rcpSources) {
1759
+ routes.push(
1760
+ { method: "GET", pattern: ["rcp-sources"], handler: listRcpSources },
1761
+ { method: "POST", pattern: ["rcp-sources"], handler: createRcpSource },
1762
+ { method: "POST", pattern: ["rcp-sources", "bulk-delete"], handler: bulkDeleteRcpSources },
1763
+ { method: "GET", pattern: ["rcp-sources", ":id"], handler: getRcpSource },
1764
+ { method: "PATCH", pattern: ["rcp-sources", ":id"], handler: updateRcpSource },
1765
+ { method: "DELETE", pattern: ["rcp-sources", ":id"], handler: deleteRcpSource },
1766
+ { method: "GET", pattern: ["rcp-sources", ":id", "usage"], handler: getRcpSourceUsage },
1767
+ { method: "POST", pattern: ["rcp-sources", ":id", "test"], handler: testRcpSourceConnection }
1768
+ );
1769
+ }
1702
1770
  if (capabilities.auditLogs) {
1703
1771
  routes.push({ method: "GET", pattern: ["audit-logs"], handler: listAuditLogs });
1704
1772
  }