@agimon-ai/po-workflow 0.0.0-alpha.20 → 0.0.0-alpha.21

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.
@@ -129,7 +129,7 @@ function formatRunDuration(elapsedMs) {
129
129
  //#region src/extensions/workspaces/sessions/(frontend)/_lib/workflowActivity.ts
130
130
  const PAUSED_STATES = /* @__PURE__ */ new Set(["paused", "pause_requested"]);
131
131
  function workflowRunIdentity(run) {
132
- return `${run.workspace}/${run.runKey}`;
132
+ return `${run.workspace}/${run.routeKey ?? run.runKey}`;
133
133
  }
134
134
  /** Whether the session runs this workflow itself; a record from an older hub names no owner and means the viewer. */
135
135
  function ownsRun(run, sessionId) {
@@ -1595,12 +1595,12 @@ function ArtifactPreview({ content, rawUrl, raw }) {
1595
1595
  /** One artifact, read-only, in its own tab. */
1596
1596
  function artifactTab(run, path) {
1597
1597
  return {
1598
- id: `${TAB_ID_PREFIX$1}${run.workspace}-${run.runKey}-${path}`.replace(/[^\w-]+/g, "-"),
1598
+ id: `${TAB_ID_PREFIX$1}${run.workspace}-${run.routeKey ?? run.runKey}-${path}`.replace(/[^\w-]+/g, "-"),
1599
1599
  label: path.split("/").pop() ?? path,
1600
1600
  panel: (props) => /* @__PURE__ */ jsx(ArtifactViewerPanel, {
1601
1601
  ...props,
1602
1602
  workspace: run.workspace,
1603
- runKey: run.runKey,
1603
+ runKey: run.routeKey ?? run.runKey,
1604
1604
  path
1605
1605
  })
1606
1606
  };
@@ -1734,7 +1734,7 @@ function ArtifactsPane({ run, sessionId, onOpen }) {
1734
1734
  const read = () => {
1735
1735
  if (reading) return;
1736
1736
  reading = true;
1737
- fetchArtifacts(run.workspace, run.runKey, sessionId).then((result) => {
1737
+ fetchArtifacts(run.workspace, run.routeKey ?? run.runKey, sessionId).then((result) => {
1738
1738
  if (!live) return;
1739
1739
  if ("error" in result) {
1740
1740
  setError(result.error);
@@ -1755,15 +1755,16 @@ function ArtifactsPane({ run, sessionId, onOpen }) {
1755
1755
  }, [
1756
1756
  run.workspace,
1757
1757
  run.runKey,
1758
+ run.routeKey,
1758
1759
  run.stage,
1759
1760
  sessionId
1760
1761
  ]);
1761
1762
  return /* @__PURE__ */ jsx(ArtifactList, {
1762
1763
  listing,
1763
1764
  error,
1764
- onLoadDirectory: (directory) => fetchArtifacts(run.workspace, run.runKey, sessionId, directory),
1765
+ onLoadDirectory: (directory) => fetchArtifacts(run.workspace, run.routeKey ?? run.runKey, sessionId, directory),
1765
1766
  onOpen,
1766
- onOpenDirectory: () => openRunDirectory(run.workspace, run.runKey, sessionId)
1767
+ onOpenDirectory: () => openRunDirectory(run.workspace, run.routeKey ?? run.runKey, sessionId)
1767
1768
  });
1768
1769
  }
1769
1770
  /** Directory-first file tree with declared output metadata and lazy folder reads. */
@@ -2001,7 +2002,7 @@ function StepSteerComposer({ run, sessionId, step }) {
2001
2002
  setSending(true);
2002
2003
  setError(void 0);
2003
2004
  try {
2004
- const result = await steerStep(run.workspace, run.runKey, message, sessionId, step);
2005
+ const result = await steerStep(run.workspace, run.routeKey ?? run.runKey, message, sessionId, step);
2005
2006
  if ("error" in result) {
2006
2007
  setError(result.error);
2007
2008
  return;
@@ -2090,13 +2091,13 @@ const CTRL_A_CODE = 64;
2090
2091
  function stepTerminalTab(run, job, step) {
2091
2092
  const target = {
2092
2093
  workspace: run.workspace,
2093
- runKey: run.runKey,
2094
+ runKey: run.routeKey ?? run.runKey,
2094
2095
  job,
2095
2096
  ...step === void 0 ? {} : { step }
2096
2097
  };
2097
2098
  const label = step ?? job;
2098
2099
  return {
2099
- id: `${TAB_ID_PREFIX}${run.workspace}-${run.runKey}-${job}${step === void 0 ? "" : `-${step}`}`.replace(/[^\w-]+/g, "-"),
2100
+ id: `${TAB_ID_PREFIX}${run.workspace}-${run.routeKey ?? run.runKey}-${job}${step === void 0 ? "" : `-${step}`}`.replace(/[^\w-]+/g, "-"),
2100
2101
  label: `${run.displayName} › ${label}`,
2101
2102
  panel: (props) => /* @__PURE__ */ jsx(StepTerminalPanel, {
2102
2103
  ...props,
@@ -2175,7 +2176,7 @@ function StepHeader({ run, target, children }) {
2175
2176
  */
2176
2177
  function StepTerminalPanel(props) {
2177
2178
  const { sessionId, target, renderSessionTranscript } = props;
2178
- const run = useStore(workflows.store, (state) => workflows.select(state, sessionId).runs).find((candidate) => candidate.workspace === target.workspace && candidate.runKey === target.runKey);
2179
+ const run = useStore(workflows.store, (state) => workflows.select(state, sessionId).runs).find((candidate) => candidate.workspace === target.workspace && (candidate.routeKey ?? candidate.runKey) === target.runKey);
2179
2180
  const sessionRef = stepSessionRef(run, target);
2180
2181
  if (sessionRef !== void 0 && renderSessionTranscript !== void 0) return /* @__PURE__ */ jsxs("div", {
2181
2182
  "data-testid": "step-conversation-panel",
@@ -2348,6 +2349,10 @@ function StepTerminal({ sessionId, target, run }) {
2348
2349
  /* @__PURE__ */ jsxs("div", {
2349
2350
  ref: screenRef,
2350
2351
  "data-testid": "step-terminal-screen",
2352
+ role: "textbox",
2353
+ "aria-label": "Workflow terminal",
2354
+ "aria-multiline": "true",
2355
+ "aria-readonly": token === void 0,
2351
2356
  tabIndex: 0,
2352
2357
  onKeyDown,
2353
2358
  className: `min-h-0 flex-1 overflow-y-auto rounded-md border bg-po-deep px-4 py-3 font-mono text-sm leading-tight text-po-text outline-none ${held ? "border-po-blue/60" : "border-po-border"}`,
@@ -2657,7 +2662,7 @@ function DeleteWorkflowDialog({ run, sessionId, onClose, onDeleted }) {
2657
2662
  const confirm = () => {
2658
2663
  setDeleting(true);
2659
2664
  setError(void 0);
2660
- deleteWorkflowRun(run.workspace, run.runKey, sessionId).then((result) => {
2665
+ deleteWorkflowRun(run.workspace, run.routeKey ?? run.runKey, sessionId).then((result) => {
2661
2666
  if ("error" in result) {
2662
2667
  setDeleting(false);
2663
2668
  setError(result.error);
@@ -2720,7 +2725,7 @@ function StopWorkflowButton({ run, sessionId }) {
2720
2725
  const stop = () => {
2721
2726
  setStopping(true);
2722
2727
  setError(void 0);
2723
- stopWorkflowRun(run.workspace, run.runKey, sessionId).then((result) => {
2728
+ stopWorkflowRun(run.workspace, run.routeKey ?? run.runKey, sessionId).then((result) => {
2724
2729
  if (!("error" in result)) return;
2725
2730
  setStopping(false);
2726
2731
  setError(result.error);