@personaai/runtime 0.10.0 → 0.11.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 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 names `@personaai/nextjs`/`@personaai/express`/`@personaai/nestjs` are deprecated shims.
430
+ wrap, not a replacement for them. `@personaai/adapters` (unified `express`/`nextjs`/`nestjs` via subpaths, Wave 3) has shipped — legacy names `@personaai/nextjs`/`@personaai/express`/`@personaai/nestjs` are deprecated shims.
431
431
 
432
432
  ## Roadmap
433
433
 
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 });