@getcatalystiq/agent-plane-ui 0.1.31 → 0.1.32

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.cjs CHANGED
@@ -581,7 +581,8 @@ function RunListPage({ initialData }) {
581
581
  /* @__PURE__ */ jsxRuntime.jsx(Th, { align: "right", children: "Cost" }),
582
582
  /* @__PURE__ */ jsxRuntime.jsx(Th, { align: "right", children: "Turns" }),
583
583
  /* @__PURE__ */ jsxRuntime.jsx(Th, { align: "right", children: "Duration" }),
584
- /* @__PURE__ */ jsxRuntime.jsx(Th, { children: "Created" })
584
+ /* @__PURE__ */ jsxRuntime.jsx(Th, { children: "Created" }),
585
+ /* @__PURE__ */ jsxRuntime.jsx(Th, {})
585
586
  ] }),
586
587
  /* @__PURE__ */ jsxRuntime.jsxs("tbody", { children: [
587
588
  runs.map((r) => /* @__PURE__ */ jsxRuntime.jsxs(AdminTableRow, { children: [
@@ -602,13 +603,47 @@ function RunListPage({ initialData }) {
602
603
  ] }),
603
604
  /* @__PURE__ */ jsxRuntime.jsx("td", { className: "p-3 text-right", children: r.num_turns }),
604
605
  /* @__PURE__ */ jsxRuntime.jsx("td", { className: "p-3 text-right text-muted-foreground text-xs", children: r.duration_ms > 0 ? `${(r.duration_ms / 1e3).toFixed(1)}s` : "\u2014" }),
605
- /* @__PURE__ */ jsxRuntime.jsx("td", { className: "p-3 text-muted-foreground text-xs", children: /* @__PURE__ */ jsxRuntime.jsx(LocalDate, { value: r.created_at }) })
606
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: "p-3 text-muted-foreground text-xs", children: /* @__PURE__ */ jsxRuntime.jsx(LocalDate, { value: r.created_at }) }),
607
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: "p-3", children: (r.status === "failed" || r.status === "cancelled" || r.status === "timed_out") && /* @__PURE__ */ jsxRuntime.jsx(RerunRowButton, { agentId: r.agent_id, prompt: r.prompt }) })
606
608
  ] }, r.id)),
607
- runs.length === 0 && /* @__PURE__ */ jsxRuntime.jsx(EmptyRow, { colSpan: 9, children: "No runs found" })
609
+ runs.length === 0 && /* @__PURE__ */ jsxRuntime.jsx(EmptyRow, { colSpan: 10, children: "No runs found" })
608
610
  ] })
609
611
  ] })
610
612
  ] });
611
613
  }
614
+ function RerunRowButton({ agentId, prompt }) {
615
+ const [rerunning, setRerunning] = React4.useState(false);
616
+ const client = chunkXXF4U7WL_cjs.useAgentPlaneClient();
617
+ const { onNavigate, basePath } = chunkXXF4U7WL_cjs.useNavigation();
618
+ const { toast: toast2 } = useToast();
619
+ async function handleRerun(e) {
620
+ e.preventDefault();
621
+ e.stopPropagation();
622
+ setRerunning(true);
623
+ try {
624
+ const stream = await client.runs.create({ agent_id: agentId, prompt });
625
+ let newRunId = null;
626
+ for await (const event of stream) {
627
+ if (event.type === "run_started") {
628
+ newRunId = event.run_id;
629
+ break;
630
+ }
631
+ }
632
+ if (newRunId) {
633
+ onNavigate(`${basePath}/runs/${newRunId}`);
634
+ }
635
+ } catch (err) {
636
+ toast2({
637
+ title: "Failed to rerun",
638
+ description: err instanceof Error ? err.message : "Unknown error",
639
+ variant: "destructive"
640
+ });
641
+ } finally {
642
+ setRerunning(false);
643
+ }
644
+ }
645
+ return /* @__PURE__ */ jsxRuntime.jsx(chunkXXF4U7WL_cjs.Button, { variant: "ghost", size: "sm", onClick: handleRerun, disabled: rerunning, children: rerunning ? "\u2026" : "Rerun" });
646
+ }
612
647
  function buildConversation(events) {
613
648
  const items = [];
614
649
  const toolCallMap = /* @__PURE__ */ new Map();
@@ -951,6 +986,7 @@ function RunDetailPage({ runId, initialData, initialTranscript }) {
951
986
  }
952
987
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6", children: [
953
988
  (run.status === "running" || run.status === "pending") && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-end", children: /* @__PURE__ */ jsxRuntime.jsx(CancelRunButton, { runId: run.id, onCancelled: () => mutate(`run-${runId}`) }) }),
989
+ (run.status === "failed" || run.status === "cancelled" || run.status === "timed_out") && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-end", children: /* @__PURE__ */ jsxRuntime.jsx(RerunButton, { agentId: run.agent_id, prompt: run.prompt }) }),
954
990
  run.triggered_by === "a2a" && run.requested_by_key_name && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
955
991
  /* @__PURE__ */ jsxRuntime.jsx(chunkXXF4U7WL_cjs.Badge, { variant: "outline", className: "text-[10px]", children: "A2A" }),
956
992
  /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
@@ -1036,6 +1072,37 @@ function RunDetailPage({ runId, initialData, initialTranscript }) {
1036
1072
  ] }) })
1037
1073
  ] });
1038
1074
  }
1075
+ function RerunButton({ agentId, prompt }) {
1076
+ const [rerunning, setRerunning] = React4.useState(false);
1077
+ const client = chunkXXF4U7WL_cjs.useAgentPlaneClient();
1078
+ const { onNavigate, basePath } = chunkXXF4U7WL_cjs.useNavigation();
1079
+ const { toast: toast2 } = useToast();
1080
+ async function handleRerun() {
1081
+ setRerunning(true);
1082
+ try {
1083
+ const stream = await client.runs.create({ agent_id: agentId, prompt });
1084
+ let newRunId = null;
1085
+ for await (const event of stream) {
1086
+ if (event.type === "run_started") {
1087
+ newRunId = event.run_id;
1088
+ break;
1089
+ }
1090
+ }
1091
+ if (newRunId) {
1092
+ onNavigate(`${basePath}/runs/${newRunId}`);
1093
+ }
1094
+ } catch (err) {
1095
+ toast2({
1096
+ title: "Failed to rerun",
1097
+ description: err instanceof Error ? err.message : "Unknown error",
1098
+ variant: "destructive"
1099
+ });
1100
+ } finally {
1101
+ setRerunning(false);
1102
+ }
1103
+ }
1104
+ return /* @__PURE__ */ jsxRuntime.jsx(chunkXXF4U7WL_cjs.Button, { variant: "outline", size: "sm", onClick: handleRerun, disabled: rerunning, children: rerunning ? "Rerunning\u2026" : "\u21BB Rerun" });
1105
+ }
1039
1106
  function CancelRunButton({ runId, onCancelled }) {
1040
1107
  const [open, setOpen] = React4.useState(false);
1041
1108
  const [cancelling, setCancelling] = React4.useState(false);
package/dist/index.d.cts CHANGED
@@ -107,6 +107,14 @@ interface AgentPlaneClient {
107
107
  runs: {
108
108
  list(params?: Record<string, unknown>): Promise<unknown>;
109
109
  get(runId: string): Promise<unknown>;
110
+ create(params: {
111
+ agent_id: string;
112
+ prompt: string;
113
+ }, options?: {
114
+ signal?: AbortSignal;
115
+ }): Promise<AsyncIterable<StreamEventLike> & {
116
+ run_id?: string | null;
117
+ }>;
110
118
  cancel(runId: string): Promise<unknown>;
111
119
  transcript(runId: string): Promise<unknown>;
112
120
  transcriptArray(runId: string): Promise<unknown[]>;
package/dist/index.d.ts CHANGED
@@ -107,6 +107,14 @@ interface AgentPlaneClient {
107
107
  runs: {
108
108
  list(params?: Record<string, unknown>): Promise<unknown>;
109
109
  get(runId: string): Promise<unknown>;
110
+ create(params: {
111
+ agent_id: string;
112
+ prompt: string;
113
+ }, options?: {
114
+ signal?: AbortSignal;
115
+ }): Promise<AsyncIterable<StreamEventLike> & {
116
+ run_id?: string | null;
117
+ }>;
110
118
  cancel(runId: string): Promise<unknown>;
111
119
  transcript(runId: string): Promise<unknown>;
112
120
  transcriptArray(runId: string): Promise<unknown[]>;
package/dist/index.js CHANGED
@@ -556,7 +556,8 @@ function RunListPage({ initialData }) {
556
556
  /* @__PURE__ */ jsx(Th, { align: "right", children: "Cost" }),
557
557
  /* @__PURE__ */ jsx(Th, { align: "right", children: "Turns" }),
558
558
  /* @__PURE__ */ jsx(Th, { align: "right", children: "Duration" }),
559
- /* @__PURE__ */ jsx(Th, { children: "Created" })
559
+ /* @__PURE__ */ jsx(Th, { children: "Created" }),
560
+ /* @__PURE__ */ jsx(Th, {})
560
561
  ] }),
561
562
  /* @__PURE__ */ jsxs("tbody", { children: [
562
563
  runs.map((r) => /* @__PURE__ */ jsxs(AdminTableRow, { children: [
@@ -577,13 +578,47 @@ function RunListPage({ initialData }) {
577
578
  ] }),
578
579
  /* @__PURE__ */ jsx("td", { className: "p-3 text-right", children: r.num_turns }),
579
580
  /* @__PURE__ */ jsx("td", { className: "p-3 text-right text-muted-foreground text-xs", children: r.duration_ms > 0 ? `${(r.duration_ms / 1e3).toFixed(1)}s` : "\u2014" }),
580
- /* @__PURE__ */ jsx("td", { className: "p-3 text-muted-foreground text-xs", children: /* @__PURE__ */ jsx(LocalDate, { value: r.created_at }) })
581
+ /* @__PURE__ */ jsx("td", { className: "p-3 text-muted-foreground text-xs", children: /* @__PURE__ */ jsx(LocalDate, { value: r.created_at }) }),
582
+ /* @__PURE__ */ jsx("td", { className: "p-3", children: (r.status === "failed" || r.status === "cancelled" || r.status === "timed_out") && /* @__PURE__ */ jsx(RerunRowButton, { agentId: r.agent_id, prompt: r.prompt }) })
581
583
  ] }, r.id)),
582
- runs.length === 0 && /* @__PURE__ */ jsx(EmptyRow, { colSpan: 9, children: "No runs found" })
584
+ runs.length === 0 && /* @__PURE__ */ jsx(EmptyRow, { colSpan: 10, children: "No runs found" })
583
585
  ] })
584
586
  ] })
585
587
  ] });
586
588
  }
589
+ function RerunRowButton({ agentId, prompt }) {
590
+ const [rerunning, setRerunning] = useState(false);
591
+ const client = useAgentPlaneClient();
592
+ const { onNavigate, basePath } = useNavigation();
593
+ const { toast: toast2 } = useToast();
594
+ async function handleRerun(e) {
595
+ e.preventDefault();
596
+ e.stopPropagation();
597
+ setRerunning(true);
598
+ try {
599
+ const stream = await client.runs.create({ agent_id: agentId, prompt });
600
+ let newRunId = null;
601
+ for await (const event of stream) {
602
+ if (event.type === "run_started") {
603
+ newRunId = event.run_id;
604
+ break;
605
+ }
606
+ }
607
+ if (newRunId) {
608
+ onNavigate(`${basePath}/runs/${newRunId}`);
609
+ }
610
+ } catch (err) {
611
+ toast2({
612
+ title: "Failed to rerun",
613
+ description: err instanceof Error ? err.message : "Unknown error",
614
+ variant: "destructive"
615
+ });
616
+ } finally {
617
+ setRerunning(false);
618
+ }
619
+ }
620
+ return /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "sm", onClick: handleRerun, disabled: rerunning, children: rerunning ? "\u2026" : "Rerun" });
621
+ }
587
622
  function buildConversation(events) {
588
623
  const items = [];
589
624
  const toolCallMap = /* @__PURE__ */ new Map();
@@ -926,6 +961,7 @@ function RunDetailPage({ runId, initialData, initialTranscript }) {
926
961
  }
927
962
  return /* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [
928
963
  (run.status === "running" || run.status === "pending") && /* @__PURE__ */ jsx("div", { className: "flex items-center justify-end", children: /* @__PURE__ */ jsx(CancelRunButton, { runId: run.id, onCancelled: () => mutate(`run-${runId}`) }) }),
964
+ (run.status === "failed" || run.status === "cancelled" || run.status === "timed_out") && /* @__PURE__ */ jsx("div", { className: "flex items-center justify-end", children: /* @__PURE__ */ jsx(RerunButton, { agentId: run.agent_id, prompt: run.prompt }) }),
929
965
  run.triggered_by === "a2a" && run.requested_by_key_name && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
930
966
  /* @__PURE__ */ jsx(Badge, { variant: "outline", className: "text-[10px]", children: "A2A" }),
931
967
  /* @__PURE__ */ jsxs("span", { children: [
@@ -1011,6 +1047,37 @@ function RunDetailPage({ runId, initialData, initialTranscript }) {
1011
1047
  ] }) })
1012
1048
  ] });
1013
1049
  }
1050
+ function RerunButton({ agentId, prompt }) {
1051
+ const [rerunning, setRerunning] = useState(false);
1052
+ const client = useAgentPlaneClient();
1053
+ const { onNavigate, basePath } = useNavigation();
1054
+ const { toast: toast2 } = useToast();
1055
+ async function handleRerun() {
1056
+ setRerunning(true);
1057
+ try {
1058
+ const stream = await client.runs.create({ agent_id: agentId, prompt });
1059
+ let newRunId = null;
1060
+ for await (const event of stream) {
1061
+ if (event.type === "run_started") {
1062
+ newRunId = event.run_id;
1063
+ break;
1064
+ }
1065
+ }
1066
+ if (newRunId) {
1067
+ onNavigate(`${basePath}/runs/${newRunId}`);
1068
+ }
1069
+ } catch (err) {
1070
+ toast2({
1071
+ title: "Failed to rerun",
1072
+ description: err instanceof Error ? err.message : "Unknown error",
1073
+ variant: "destructive"
1074
+ });
1075
+ } finally {
1076
+ setRerunning(false);
1077
+ }
1078
+ }
1079
+ return /* @__PURE__ */ jsx(Button, { variant: "outline", size: "sm", onClick: handleRerun, disabled: rerunning, children: rerunning ? "Rerunning\u2026" : "\u21BB Rerun" });
1080
+ }
1014
1081
  function CancelRunButton({ runId, onCancelled }) {
1015
1082
  const [open, setOpen] = useState(false);
1016
1083
  const [cancelling, setCancelling] = useState(false);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getcatalystiq/agent-plane-ui",
3
- "version": "0.1.31",
3
+ "version": "0.1.32",
4
4
  "description": "Embeddable React component library for AgentPlane",
5
5
  "type": "module",
6
6
  "exports": {