@agimon-ai/po-workflow 0.0.0-alpha.107 → 0.0.0-alpha.108

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.
@@ -750,16 +750,27 @@ function requestLaunch(send, sessionId, line, workflowPath) {
750
750
  }
751
751
  const HOST_ID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/iu;
752
752
  /**
753
- * The phone keys a session `<hostId>/<id>` while the hub names a run's owner by its bare id;
754
- * the owner joins the viewing session's host so ownership checks and navigation line up.
753
+ * The phone keys sessions `<hostId>/<id>` while the hub names owners and step agents by bare ids.
754
+ * Join them to the viewing session's host so ownership checks and navigation line up.
755
755
  */
756
756
  function onSessionHost(run, sessionId) {
757
757
  const separator = sessionId.indexOf("/");
758
758
  const host = sessionId.slice(0, Math.max(0, separator));
759
- if (run.ownerSessionId === void 0 || !HOST_ID.test(host) || run.ownerSessionId.startsWith(`${host}/`)) return run;
759
+ if (!HOST_ID.test(host)) return run;
760
+ const qualify = (id) => id.startsWith(`${host}/`) ? id : `${host}/${id}`;
760
761
  return {
761
762
  ...run,
762
- ownerSessionId: `${host}/${run.ownerSessionId}`
763
+ ownerSessionId: run.ownerSessionId === void 0 ? void 0 : qualify(run.ownerSessionId),
764
+ jobs: run.jobs.map((job) => ({
765
+ ...job,
766
+ steps: job.steps.map((step) => step.ref?.kind === "session" ? {
767
+ ...step,
768
+ ref: {
769
+ ...step.ref,
770
+ id: qualify(step.ref.id)
771
+ }
772
+ } : step)
773
+ }))
763
774
  };
764
775
  }
765
776
  /** The plugin's session data channel: 'workflow_runs' payloads into the store. */