@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/README.md +2 -2
- package/dist/docs/.nojekyll +1 -0
- package/dist/index.cjs +71 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +71 -3
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -160,7 +160,7 @@ how to enable them safely.
|
|
|
160
160
|
| `GET` | `/stores/:id/files` | `stores` | `client.stores.listFiles(id)` |
|
|
161
161
|
| `GET`/`PUT`/`DELETE` | `/stores/:id/file` | `stores` | `client.stores.getFile/writeFile/deleteFile(id, {path, content?})` |
|
|
162
162
|
| `GET` | `/audit-logs` | `auditLogs` | `client.auditLogs.list({page, limit, eventType})` |
|
|
163
|
-
| `POST` | `/architect` | `architect` | `client.architect.stream({messages, resume})`, streamed out as SSE, same `x-persona-run-id`/reconnect mechanics as `/chat`. No `agentId` — the Architect builds/edits the caller's own Agents. |
|
|
163
|
+
| `POST` | `/architect` | `architect` | `client.architect.stream({messages, threadId, resume})`, streamed out as SSE, same `x-persona-run-id`/reconnect mechanics as `/chat`. No `agentId` — the Architect builds/edits the caller's own Agents. `threadId` resumes a named Architect conversation (has no effect without an asserted external user). |
|
|
164
164
|
| `GET` | `/architect/:runId/resume` | `architect` | Reattaches to the matching `POST /architect` run. |
|
|
165
165
|
| `POST` | `/workflows` | `workflowsWrite` | `client.workflows.create(input)` |
|
|
166
166
|
| `GET`/`PATCH`/`DELETE` | `/workflows/:id` | `workflowsWrite` | `client.workflows.get/update/delete(id)` |
|
|
@@ -427,7 +427,7 @@ genuine unclosed gap or an intentional package boundary, not an oversight:
|
|
|
427
427
|
per mount; anything finer belongs in `resolveUser` or a hook, not the runtime.
|
|
428
428
|
- Framework adapters beyond the shipped ones (`@personaai/node`, `@personaai/fastify`,
|
|
429
429
|
`@personaai/hono`) — **by design**, not a gap: this package is the foundation they're meant to
|
|
430
|
-
wrap, not a replacement for them. `@personaai/adapters` (unified `express`/`nextjs`/`nestjs` via subpaths, Wave 3) has shipped — legacy
|
|
430
|
+
wrap, not a replacement for them. `@personaai/adapters` (unified `express`/`nextjs`/`nestjs` via subpaths, Wave 3) has shipped — the legacy standalone `@personaai/nextjs`/`@personaai/express`/`@personaai/nestjs` packages were removed from the repo (2026-09-14); their last-published versions are frozen and deprecated on the registry.
|
|
431
431
|
|
|
432
432
|
## Roadmap
|
|
433
433
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false.
|
package/dist/index.cjs
CHANGED
|
@@ -720,6 +720,7 @@ function parseArchitectBody(body) {
|
|
|
720
720
|
}
|
|
721
721
|
return {
|
|
722
722
|
messages: b.messages,
|
|
723
|
+
threadId: typeof b.threadId === "string" ? b.threadId : void 0,
|
|
723
724
|
resume: b.resume ?? void 0
|
|
724
725
|
};
|
|
725
726
|
}
|
|
@@ -728,6 +729,7 @@ var architectRoute = async (request, ctx) => {
|
|
|
728
729
|
logger.debug("architectRoute start", { userId: request.userId });
|
|
729
730
|
const body = parseArchitectBody(request.body);
|
|
730
731
|
logger.trace("architectRoute body", {
|
|
732
|
+
threadId: body.threadId,
|
|
731
733
|
messageCount: body.messages?.length ?? 0,
|
|
732
734
|
hasResume: !!body.resume
|
|
733
735
|
});
|
|
@@ -735,18 +737,20 @@ var architectRoute = async (request, ctx) => {
|
|
|
735
737
|
const runCtx = {
|
|
736
738
|
userId,
|
|
737
739
|
kind: "architect",
|
|
740
|
+
threadId: body.threadId,
|
|
738
741
|
messages: body.messages
|
|
739
742
|
};
|
|
740
|
-
logger.debug("beforeRun hook (architect)", { userId });
|
|
743
|
+
logger.debug("beforeRun hook (architect)", { userId, threadId: body.threadId });
|
|
741
744
|
await ctx.hooks?.beforeRun?.(runCtx);
|
|
742
745
|
logger.trace("beforeRun completed (architect)");
|
|
743
|
-
logger.debug("starting architect stream");
|
|
746
|
+
logger.debug("starting architect stream", { threadId: body.threadId });
|
|
744
747
|
const stream = ctx.client.architect.stream({
|
|
745
748
|
messages: body.messages,
|
|
749
|
+
threadId: body.threadId,
|
|
746
750
|
resume: body.resume
|
|
747
751
|
});
|
|
748
752
|
const runId = crypto.randomUUID();
|
|
749
|
-
logger.info("architect run created", { runId, userId });
|
|
753
|
+
logger.info("architect run created", { runId, userId, threadId: body.threadId });
|
|
750
754
|
const driver = new RunDriver(runId, runCtx, stream, ctx.hooks, ctx.mode);
|
|
751
755
|
ctx.runs.set(runId, driver);
|
|
752
756
|
logger.debug("architect driver registered", { runId, trackedRuns: ctx.runs.size });
|
|
@@ -1378,6 +1382,57 @@ var deleteStoreFile = async (request, ctx) => {
|
|
|
1378
1382
|
return noContent();
|
|
1379
1383
|
};
|
|
1380
1384
|
|
|
1385
|
+
// src/routes/rcpSources.ts
|
|
1386
|
+
var listRcpSources = async (request, ctx) => {
|
|
1387
|
+
const items = await ctx.client.rcpSources.list({
|
|
1388
|
+
page: toInt(request.query.page),
|
|
1389
|
+
limit: toInt(request.query.limit),
|
|
1390
|
+
search: request.query.search
|
|
1391
|
+
});
|
|
1392
|
+
return json(200, items);
|
|
1393
|
+
};
|
|
1394
|
+
var createRcpSource = async (request, ctx) => {
|
|
1395
|
+
const body = requireBodyObject(request.body);
|
|
1396
|
+
const input = {
|
|
1397
|
+
name: requireStringField(body, "name"),
|
|
1398
|
+
url: requireStringField(body, "url"),
|
|
1399
|
+
description: typeof body.description === "string" ? body.description : void 0,
|
|
1400
|
+
authType: body.authType,
|
|
1401
|
+
secretRef: typeof body.secretRef === "string" ? body.secretRef : void 0,
|
|
1402
|
+
isEnabled: typeof body.isEnabled === "boolean" ? body.isEnabled : void 0,
|
|
1403
|
+
paramContextMap: Array.isArray(body.paramContextMap) ? body.paramContextMap : void 0
|
|
1404
|
+
};
|
|
1405
|
+
const source = await ctx.client.rcpSources.create(input);
|
|
1406
|
+
return json(201, source);
|
|
1407
|
+
};
|
|
1408
|
+
var getRcpSource = async (_request, ctx) => {
|
|
1409
|
+
const source = await ctx.client.rcpSources.get(requireParam(ctx.params, "id"));
|
|
1410
|
+
return json(200, source);
|
|
1411
|
+
};
|
|
1412
|
+
var updateRcpSource = async (request, ctx) => {
|
|
1413
|
+
const body = request.body ?? {};
|
|
1414
|
+
const source = await ctx.client.rcpSources.update(requireParam(ctx.params, "id"), body);
|
|
1415
|
+
return json(200, source);
|
|
1416
|
+
};
|
|
1417
|
+
var deleteRcpSource = async (_request, ctx) => {
|
|
1418
|
+
await ctx.client.rcpSources.delete(requireParam(ctx.params, "id"));
|
|
1419
|
+
return noContent();
|
|
1420
|
+
};
|
|
1421
|
+
var bulkDeleteRcpSources = async (request, ctx) => {
|
|
1422
|
+
const body = requireBodyObject(request.body);
|
|
1423
|
+
const ids = Array.isArray(body.ids) ? body.ids : [];
|
|
1424
|
+
const result = await ctx.client.rcpSources.bulkDelete(ids);
|
|
1425
|
+
return json(200, result);
|
|
1426
|
+
};
|
|
1427
|
+
var getRcpSourceUsage = async (_request, ctx) => {
|
|
1428
|
+
const usage = await ctx.client.rcpSources.getUsage(requireParam(ctx.params, "id"));
|
|
1429
|
+
return json(200, usage);
|
|
1430
|
+
};
|
|
1431
|
+
var testRcpSourceConnection = async (_request, ctx) => {
|
|
1432
|
+
const result = await ctx.client.rcpSources.testConnection(requireParam(ctx.params, "id"));
|
|
1433
|
+
return json(200, result);
|
|
1434
|
+
};
|
|
1435
|
+
|
|
1381
1436
|
// src/routes/auditLogs.ts
|
|
1382
1437
|
var listAuditLogs = async (request, ctx) => {
|
|
1383
1438
|
const items = await ctx.client.auditLogs.list({
|
|
@@ -1549,6 +1604,7 @@ function resolveCapabilities(capabilities) {
|
|
|
1549
1604
|
skills: capabilities?.skills ?? false,
|
|
1550
1605
|
knowledge: capabilities?.knowledge ?? false,
|
|
1551
1606
|
stores: capabilities?.stores ?? false,
|
|
1607
|
+
rcpSources: capabilities?.rcpSources ?? false,
|
|
1552
1608
|
auditLogs: capabilities?.auditLogs ?? false,
|
|
1553
1609
|
architect: capabilities?.architect ?? false,
|
|
1554
1610
|
workflowsWrite: capabilities?.workflowsWrite ?? false
|
|
@@ -1727,6 +1783,18 @@ function buildRoutes(capabilities) {
|
|
|
1727
1783
|
{ method: "DELETE", pattern: ["stores", ":id", "file"], handler: deleteStoreFile }
|
|
1728
1784
|
);
|
|
1729
1785
|
}
|
|
1786
|
+
if (capabilities.rcpSources) {
|
|
1787
|
+
routes.push(
|
|
1788
|
+
{ method: "GET", pattern: ["rcp-sources"], handler: listRcpSources },
|
|
1789
|
+
{ method: "POST", pattern: ["rcp-sources"], handler: createRcpSource },
|
|
1790
|
+
{ method: "POST", pattern: ["rcp-sources", "bulk-delete"], handler: bulkDeleteRcpSources },
|
|
1791
|
+
{ method: "GET", pattern: ["rcp-sources", ":id"], handler: getRcpSource },
|
|
1792
|
+
{ method: "PATCH", pattern: ["rcp-sources", ":id"], handler: updateRcpSource },
|
|
1793
|
+
{ method: "DELETE", pattern: ["rcp-sources", ":id"], handler: deleteRcpSource },
|
|
1794
|
+
{ method: "GET", pattern: ["rcp-sources", ":id", "usage"], handler: getRcpSourceUsage },
|
|
1795
|
+
{ method: "POST", pattern: ["rcp-sources", ":id", "test"], handler: testRcpSourceConnection }
|
|
1796
|
+
);
|
|
1797
|
+
}
|
|
1730
1798
|
if (capabilities.auditLogs) {
|
|
1731
1799
|
routes.push({ method: "GET", pattern: ["audit-logs"], handler: listAuditLogs });
|
|
1732
1800
|
}
|