@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/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 });