@personaai/runtime 0.11.0 → 0.13.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
@@ -829,6 +829,27 @@ var resetThread = async (_request, ctx) => {
829
829
  const thread = await ctx.client.threads.reset(requireParam(ctx.params, "id"));
830
830
  return json(200, thread);
831
831
  };
832
+ var listThreadFiles = async (_request, ctx) => {
833
+ const files = await ctx.client.threads.listFiles(requireParam(ctx.params, "id"));
834
+ return json(200, files);
835
+ };
836
+ var getThreadFile = async (request, ctx) => {
837
+ const path = requireQueryParam(request.query, "path");
838
+ const file = await ctx.client.threads.getFile(requireParam(ctx.params, "id"), path);
839
+ return json(200, file);
840
+ };
841
+ var writeThreadFile = async (request, ctx) => {
842
+ const body = requireBodyObject(request.body);
843
+ const path = requireStringField(body, "path");
844
+ const content = requireStringField(body, "content");
845
+ const file = await ctx.client.threads.writeFile(requireParam(ctx.params, "id"), path, content);
846
+ return json(200, file);
847
+ };
848
+ var deleteThreadFile = async (request, ctx) => {
849
+ const path = requireQueryParam(request.query, "path");
850
+ await ctx.client.threads.deleteFile(requireParam(ctx.params, "id"), path);
851
+ return noContent();
852
+ };
832
853
 
833
854
  // src/routes/voice.ts
834
855
  var createVoiceSession = async (request, ctx) => {
@@ -1354,6 +1375,57 @@ var deleteStoreFile = async (request, ctx) => {
1354
1375
  return noContent();
1355
1376
  };
1356
1377
 
1378
+ // src/routes/rcpSources.ts
1379
+ var listRcpSources = async (request, ctx) => {
1380
+ const items = await ctx.client.rcpSources.list({
1381
+ page: toInt(request.query.page),
1382
+ limit: toInt(request.query.limit),
1383
+ search: request.query.search
1384
+ });
1385
+ return json(200, items);
1386
+ };
1387
+ var createRcpSource = async (request, ctx) => {
1388
+ const body = requireBodyObject(request.body);
1389
+ const input = {
1390
+ name: requireStringField(body, "name"),
1391
+ url: requireStringField(body, "url"),
1392
+ description: typeof body.description === "string" ? body.description : void 0,
1393
+ authType: body.authType,
1394
+ secretRef: typeof body.secretRef === "string" ? body.secretRef : void 0,
1395
+ isEnabled: typeof body.isEnabled === "boolean" ? body.isEnabled : void 0,
1396
+ paramContextMap: Array.isArray(body.paramContextMap) ? body.paramContextMap : void 0
1397
+ };
1398
+ const source = await ctx.client.rcpSources.create(input);
1399
+ return json(201, source);
1400
+ };
1401
+ var getRcpSource = async (_request, ctx) => {
1402
+ const source = await ctx.client.rcpSources.get(requireParam(ctx.params, "id"));
1403
+ return json(200, source);
1404
+ };
1405
+ var updateRcpSource = async (request, ctx) => {
1406
+ const body = request.body ?? {};
1407
+ const source = await ctx.client.rcpSources.update(requireParam(ctx.params, "id"), body);
1408
+ return json(200, source);
1409
+ };
1410
+ var deleteRcpSource = async (_request, ctx) => {
1411
+ await ctx.client.rcpSources.delete(requireParam(ctx.params, "id"));
1412
+ return noContent();
1413
+ };
1414
+ var bulkDeleteRcpSources = async (request, ctx) => {
1415
+ const body = requireBodyObject(request.body);
1416
+ const ids = Array.isArray(body.ids) ? body.ids : [];
1417
+ const result = await ctx.client.rcpSources.bulkDelete(ids);
1418
+ return json(200, result);
1419
+ };
1420
+ var getRcpSourceUsage = async (_request, ctx) => {
1421
+ const usage = await ctx.client.rcpSources.getUsage(requireParam(ctx.params, "id"));
1422
+ return json(200, usage);
1423
+ };
1424
+ var testRcpSourceConnection = async (_request, ctx) => {
1425
+ const result = await ctx.client.rcpSources.testConnection(requireParam(ctx.params, "id"));
1426
+ return json(200, result);
1427
+ };
1428
+
1357
1429
  // src/routes/auditLogs.ts
1358
1430
  var listAuditLogs = async (request, ctx) => {
1359
1431
  const items = await ctx.client.auditLogs.list({
@@ -1525,6 +1597,7 @@ function resolveCapabilities(capabilities) {
1525
1597
  skills: capabilities?.skills ?? false,
1526
1598
  knowledge: capabilities?.knowledge ?? false,
1527
1599
  stores: capabilities?.stores ?? false,
1600
+ rcpSources: capabilities?.rcpSources ?? false,
1528
1601
  auditLogs: capabilities?.auditLogs ?? false,
1529
1602
  architect: capabilities?.architect ?? false,
1530
1603
  workflowsWrite: capabilities?.workflowsWrite ?? false
@@ -1545,6 +1618,10 @@ function buildRoutes(capabilities) {
1545
1618
  { method: "DELETE", pattern: ["threads", ":id"], handler: deleteThread },
1546
1619
  { method: "GET", pattern: ["threads", ":id", "messages"], handler: getThreadMessages },
1547
1620
  { method: "POST", pattern: ["threads", ":id", "reset"], handler: resetThread },
1621
+ { method: "GET", pattern: ["threads", ":id", "files"], handler: listThreadFiles },
1622
+ { method: "GET", pattern: ["threads", ":id", "file"], handler: getThreadFile },
1623
+ { method: "PUT", pattern: ["threads", ":id", "file"], handler: writeThreadFile },
1624
+ { method: "DELETE", pattern: ["threads", ":id", "file"], handler: deleteThreadFile },
1548
1625
  // Voice — always on, end-user-scoped real-time voice sessions
1549
1626
  // (powered by Gemini Live). Mints a ticket only; the host's own
1550
1627
  // frontend opens the WebSocket directly, this runtime never proxies it.
@@ -1703,6 +1780,18 @@ function buildRoutes(capabilities) {
1703
1780
  { method: "DELETE", pattern: ["stores", ":id", "file"], handler: deleteStoreFile }
1704
1781
  );
1705
1782
  }
1783
+ if (capabilities.rcpSources) {
1784
+ routes.push(
1785
+ { method: "GET", pattern: ["rcp-sources"], handler: listRcpSources },
1786
+ { method: "POST", pattern: ["rcp-sources"], handler: createRcpSource },
1787
+ { method: "POST", pattern: ["rcp-sources", "bulk-delete"], handler: bulkDeleteRcpSources },
1788
+ { method: "GET", pattern: ["rcp-sources", ":id"], handler: getRcpSource },
1789
+ { method: "PATCH", pattern: ["rcp-sources", ":id"], handler: updateRcpSource },
1790
+ { method: "DELETE", pattern: ["rcp-sources", ":id"], handler: deleteRcpSource },
1791
+ { method: "GET", pattern: ["rcp-sources", ":id", "usage"], handler: getRcpSourceUsage },
1792
+ { method: "POST", pattern: ["rcp-sources", ":id", "test"], handler: testRcpSourceConnection }
1793
+ );
1794
+ }
1706
1795
  if (capabilities.auditLogs) {
1707
1796
  routes.push({ method: "GET", pattern: ["audit-logs"], handler: listAuditLogs });
1708
1797
  }