import { _ as _sfc_main$3, a as _sfc_main$1$1, b as _sfc_main$2, c as _sfc_main$2$1 } from './Card-m9yESRg-.mjs';
import { v as vueExports, d as useRoute$1, u as useHead, s as serverRenderer_cjs_prodExports, a as __nuxt_component_0$1, e as _sfc_main$8, b as useFetch, c as useIntervalFn } from './server.mjs';
import { _ as _sfc_main$5 } from './Badge-BnQthhyg.mjs';
import { _ as _sfc_main$1 } from './Alert-BgLL0z9r.mjs';
import { _ as __nuxt_component_2, f as formatDateTime, a as formatTokens } from './format-Cs0yxEHy.mjs';
import { _ as _sfc_main$4 } from './Separator-D2l1Gitd.mjs';
import '../../index.mjs';
import '@anthropic-ai/claude-agent-sdk';
import '@octokit/webhooks';
import 'node:events';
import 'node:buffer';
import 'node:fs';
import 'node:path';
import 'node:crypto';
import 'node:process';
import 'consola';
import '@octokit/graphql';
import 'zod';
import '@octokit/auth-app';
import 'node:os';
import '@libsql/client';
import 'liquidjs';
import 'js-yaml';
import 'node:child_process';
import '@chat-adapter/github';
import '@chat-adapter/slack';
import 'chat';
import 'chat-adapter-asana';
import 'better-auth';
import 'better-auth/plugins';
import 'bun:sqlite';
import 'better-auth/db/migration';
import 'node:url';
import '@iconify/utils';
import 'rou3';
import 'better-auth/client/plugins';
import 'better-auth/vue';
import 'perfect-debounce';
import 'tailwindcss/colors';
import 'node:stream';
import '../routes/renderer.mjs';
import 'vue-bundle-renderer/runtime';
import 'vue/server-renderer';
import 'unhead/server';
import 'devalue';
import 'unhead/utils';
import 'vue';

function useIssueDetail(identifier, intervalMs = 3e3) {
  const id = vueExports.computed(() => typeof identifier === "function" ? identifier() : identifier.value);
  const { data: detail, error: fetchError, status, refresh } = useFetch(
    () => `/api/v1/${encodeURIComponent(id.value)}`,
    { lazy: true, watch: [id] },
    "$00DCgfmJXm"
    /* nuxt-injected */
  );
  const error = vueExports.computed(() => fetchError.value?.message ?? null);
  const loading = vueExports.computed(() => status.value === "pending" && !detail.value);
  const { pause } = useIntervalFn(refresh, intervalMs);
  vueExports.onScopeDispose(pause);
  return { detail, error, loading, refresh };
}
const _sfc_main = /* @__PURE__ */ vueExports.defineComponent({
  __name: "[identifier]",
  __ssrInlineRender: true,
  setup(__props) {
    const route = useRoute$1();
    const identifier = vueExports.computed(() => route.params.identifier);
    useHead({ title: () => `${identifier.value} — Agent Please` });
    const { detail, loading, error } = useIssueDetail(identifier);
    const tokens = vueExports.computed(() => detail.value?.running?.tokens ?? null);
    return (_ctx, _push, _parent, _attrs) => {
      const _component_UDashboardPanel = _sfc_main$3;
      const _component_UDashboardNavbar = _sfc_main$2$1;
      const _component_UButton = _sfc_main$8;
      const _component_UBadge = _sfc_main$5;
      const _component_UAlert = _sfc_main$1;
      const _component_USkeleton = _sfc_main$1$1;
      const _component_UCard = _sfc_main$2;
      const _component_StateBadge = __nuxt_component_2;
      const _component_USeparator = _sfc_main$4;
      const _component_NuxtLink = __nuxt_component_0$1;
      _push(serverRenderer_cjs_prodExports.ssrRenderComponent(_component_UDashboardPanel, _attrs, {
        header: vueExports.withCtx((_, _push2, _parent2, _scopeId) => {
          if (_push2) {
            _push2(serverRenderer_cjs_prodExports.ssrRenderComponent(_component_UDashboardNavbar, null, {
              left: vueExports.withCtx((_2, _push3, _parent3, _scopeId2) => {
                if (_push3) {
                  _push3(`<div class="flex items-center gap-3"${_scopeId2}>`);
                  _push3(serverRenderer_cjs_prodExports.ssrRenderComponent(_component_UButton, {
                    icon: "i-lucide-arrow-left",
                    variant: "ghost",
                    size: "sm",
                    to: "/"
                  }, null, _parent3, _scopeId2));
                  _push3(`<span class="text-lg font-bold"${_scopeId2}>${serverRenderer_cjs_prodExports.ssrInterpolate(vueExports.unref(identifier))}</span>`);
                  if (vueExports.unref(detail)) {
                    _push3(serverRenderer_cjs_prodExports.ssrRenderComponent(_component_UBadge, {
                      color: vueExports.unref(detail).status === "running" ? "primary" : "warning",
                      variant: "subtle"
                    }, {
                      default: vueExports.withCtx((_3, _push4, _parent4, _scopeId3) => {
                        if (_push4) {
                          _push4(`${serverRenderer_cjs_prodExports.ssrInterpolate(vueExports.unref(detail).status)}`);
                        } else {
                          return [
                            vueExports.createTextVNode(vueExports.toDisplayString(vueExports.unref(detail).status), 1)
                          ];
                        }
                      }),
                      _: 1
                    }, _parent3, _scopeId2));
                  } else {
                    _push3(`<!---->`);
                  }
                  _push3(`</div>`);
                } else {
                  return [
                    vueExports.createVNode("div", { class: "flex items-center gap-3" }, [
                      vueExports.createVNode(_component_UButton, {
                        icon: "i-lucide-arrow-left",
                        variant: "ghost",
                        size: "sm",
                        to: "/"
                      }),
                      vueExports.createVNode("span", { class: "text-lg font-bold" }, vueExports.toDisplayString(vueExports.unref(identifier)), 1),
                      vueExports.unref(detail) ? (vueExports.openBlock(), vueExports.createBlock(_component_UBadge, {
                        key: 0,
                        color: vueExports.unref(detail).status === "running" ? "primary" : "warning",
                        variant: "subtle"
                      }, {
                        default: vueExports.withCtx(() => [
                          vueExports.createTextVNode(vueExports.toDisplayString(vueExports.unref(detail).status), 1)
                        ]),
                        _: 1
                      }, 8, ["color"])) : vueExports.createCommentVNode("", true)
                    ])
                  ];
                }
              }),
              _: 1
            }, _parent2, _scopeId));
          } else {
            return [
              vueExports.createVNode(_component_UDashboardNavbar, null, {
                left: vueExports.withCtx(() => [
                  vueExports.createVNode("div", { class: "flex items-center gap-3" }, [
                    vueExports.createVNode(_component_UButton, {
                      icon: "i-lucide-arrow-left",
                      variant: "ghost",
                      size: "sm",
                      to: "/"
                    }),
                    vueExports.createVNode("span", { class: "text-lg font-bold" }, vueExports.toDisplayString(vueExports.unref(identifier)), 1),
                    vueExports.unref(detail) ? (vueExports.openBlock(), vueExports.createBlock(_component_UBadge, {
                      key: 0,
                      color: vueExports.unref(detail).status === "running" ? "primary" : "warning",
                      variant: "subtle"
                    }, {
                      default: vueExports.withCtx(() => [
                        vueExports.createTextVNode(vueExports.toDisplayString(vueExports.unref(detail).status), 1)
                      ]),
                      _: 1
                    }, 8, ["color"])) : vueExports.createCommentVNode("", true)
                  ])
                ]),
                _: 1
              })
            ];
          }
        }),
        body: vueExports.withCtx((_, _push2, _parent2, _scopeId) => {
          if (_push2) {
            _push2(`<div class="space-y-6 p-6"${_scopeId}>`);
            if (vueExports.unref(error)) {
              _push2(serverRenderer_cjs_prodExports.ssrRenderComponent(_component_UAlert, {
                color: "error",
                variant: "subtle",
                title: vueExports.unref(error),
                icon: "i-lucide-alert-circle"
              }, null, _parent2, _scopeId));
            } else {
              _push2(`<!---->`);
            }
            if (vueExports.unref(loading)) {
              _push2(`<div class="space-y-4"${_scopeId}>`);
              _push2(serverRenderer_cjs_prodExports.ssrRenderComponent(_component_USkeleton, { class: "h-32 w-full rounded-xl" }, null, _parent2, _scopeId));
              _push2(serverRenderer_cjs_prodExports.ssrRenderComponent(_component_USkeleton, { class: "h-48 w-full rounded-xl" }, null, _parent2, _scopeId));
              _push2(`</div>`);
            } else if (vueExports.unref(detail)) {
              _push2(`<!--[-->`);
              if (vueExports.unref(detail).running) {
                _push2(serverRenderer_cjs_prodExports.ssrRenderComponent(_component_UCard, null, {
                  header: vueExports.withCtx((_2, _push3, _parent3, _scopeId2) => {
                    if (_push3) {
                      _push3(`<span class="font-semibold"${_scopeId2}>Session</span>`);
                    } else {
                      return [
                        vueExports.createVNode("span", { class: "font-semibold" }, "Session")
                      ];
                    }
                  }),
                  default: vueExports.withCtx((_2, _push3, _parent3, _scopeId2) => {
                    if (_push3) {
                      _push3(`<div class="space-y-3 text-sm"${_scopeId2}><div class="grid grid-cols-2 gap-2"${_scopeId2}><div${_scopeId2}><span class="text-muted"${_scopeId2}>State</span><div${_scopeId2}>`);
                      _push3(serverRenderer_cjs_prodExports.ssrRenderComponent(_component_StateBadge, {
                        state: vueExports.unref(detail).running.state
                      }, null, _parent3, _scopeId2));
                      _push3(`</div></div><div${_scopeId2}><span class="text-muted"${_scopeId2}>Turns</span><div class="tabular-nums font-medium"${_scopeId2}>${serverRenderer_cjs_prodExports.ssrInterpolate(vueExports.unref(detail).running.turn_count)}</div></div><div${_scopeId2}><span class="text-muted"${_scopeId2}>Started</span><div class="tabular-nums"${_scopeId2}>${serverRenderer_cjs_prodExports.ssrInterpolate(vueExports.unref(formatDateTime)(vueExports.unref(detail).running.started_at))}</div></div><div${_scopeId2}><span class="text-muted"${_scopeId2}>Last Event</span><div${_scopeId2}>${serverRenderer_cjs_prodExports.ssrInterpolate(vueExports.unref(detail).running.last_event ?? "—")}</div></div></div>`);
                      _push3(serverRenderer_cjs_prodExports.ssrRenderComponent(_component_USeparator, null, null, _parent3, _scopeId2));
                      if (vueExports.unref(tokens)) {
                        _push3(`<div class="flex gap-6"${_scopeId2}><div${_scopeId2}><span class="text-muted"${_scopeId2}>Input</span><div class="tabular-nums"${_scopeId2}>${serverRenderer_cjs_prodExports.ssrInterpolate(vueExports.unref(formatTokens)(vueExports.unref(tokens).input_tokens))}</div></div><div${_scopeId2}><span class="text-muted"${_scopeId2}>Output</span><div class="tabular-nums"${_scopeId2}>${serverRenderer_cjs_prodExports.ssrInterpolate(vueExports.unref(formatTokens)(vueExports.unref(tokens).output_tokens))}</div></div><div${_scopeId2}><span class="text-muted"${_scopeId2}>Total</span><div class="tabular-nums font-medium"${_scopeId2}>${serverRenderer_cjs_prodExports.ssrInterpolate(vueExports.unref(formatTokens)(vueExports.unref(tokens).total_tokens))}</div></div></div>`);
                      } else {
                        _push3(`<!---->`);
                      }
                      if (vueExports.unref(detail).running.session_id) {
                        _push3(`<div${_scopeId2}><span class="text-muted"${_scopeId2}>Session ID</span><div class="font-mono text-xs break-all"${_scopeId2}>`);
                        _push3(serverRenderer_cjs_prodExports.ssrRenderComponent(_component_NuxtLink, {
                          to: `/sessions/${encodeURIComponent(vueExports.unref(detail).running.session_id)}`,
                          class: "text-primary hover:underline"
                        }, {
                          default: vueExports.withCtx((_3, _push4, _parent4, _scopeId3) => {
                            if (_push4) {
                              _push4(`${serverRenderer_cjs_prodExports.ssrInterpolate(vueExports.unref(detail).running.session_id)}`);
                            } else {
                              return [
                                vueExports.createTextVNode(vueExports.toDisplayString(vueExports.unref(detail).running.session_id), 1)
                              ];
                            }
                          }),
                          _: 1
                        }, _parent3, _scopeId2));
                        _push3(`</div></div>`);
                      } else {
                        _push3(`<!---->`);
                      }
                      if (vueExports.unref(detail).running.last_message) {
                        _push3(`<div${_scopeId2}><span class="text-muted"${_scopeId2}>Last Message</span><div class="text-xs whitespace-pre-wrap"${_scopeId2}>${serverRenderer_cjs_prodExports.ssrInterpolate(vueExports.unref(detail).running.last_message)}</div></div>`);
                      } else {
                        _push3(`<!---->`);
                      }
                      _push3(`</div>`);
                    } else {
                      return [
                        vueExports.createVNode("div", { class: "space-y-3 text-sm" }, [
                          vueExports.createVNode("div", { class: "grid grid-cols-2 gap-2" }, [
                            vueExports.createVNode("div", null, [
                              vueExports.createVNode("span", { class: "text-muted" }, "State"),
                              vueExports.createVNode("div", null, [
                                vueExports.createVNode(_component_StateBadge, {
                                  state: vueExports.unref(detail).running.state
                                }, null, 8, ["state"])
                              ])
                            ]),
                            vueExports.createVNode("div", null, [
                              vueExports.createVNode("span", { class: "text-muted" }, "Turns"),
                              vueExports.createVNode("div", { class: "tabular-nums font-medium" }, vueExports.toDisplayString(vueExports.unref(detail).running.turn_count), 1)
                            ]),
                            vueExports.createVNode("div", null, [
                              vueExports.createVNode("span", { class: "text-muted" }, "Started"),
                              vueExports.createVNode("div", { class: "tabular-nums" }, vueExports.toDisplayString(vueExports.unref(formatDateTime)(vueExports.unref(detail).running.started_at)), 1)
                            ]),
                            vueExports.createVNode("div", null, [
                              vueExports.createVNode("span", { class: "text-muted" }, "Last Event"),
                              vueExports.createVNode("div", null, vueExports.toDisplayString(vueExports.unref(detail).running.last_event ?? "—"), 1)
                            ])
                          ]),
                          vueExports.createVNode(_component_USeparator),
                          vueExports.unref(tokens) ? (vueExports.openBlock(), vueExports.createBlock("div", {
                            key: 0,
                            class: "flex gap-6"
                          }, [
                            vueExports.createVNode("div", null, [
                              vueExports.createVNode("span", { class: "text-muted" }, "Input"),
                              vueExports.createVNode("div", { class: "tabular-nums" }, vueExports.toDisplayString(vueExports.unref(formatTokens)(vueExports.unref(tokens).input_tokens)), 1)
                            ]),
                            vueExports.createVNode("div", null, [
                              vueExports.createVNode("span", { class: "text-muted" }, "Output"),
                              vueExports.createVNode("div", { class: "tabular-nums" }, vueExports.toDisplayString(vueExports.unref(formatTokens)(vueExports.unref(tokens).output_tokens)), 1)
                            ]),
                            vueExports.createVNode("div", null, [
                              vueExports.createVNode("span", { class: "text-muted" }, "Total"),
                              vueExports.createVNode("div", { class: "tabular-nums font-medium" }, vueExports.toDisplayString(vueExports.unref(formatTokens)(vueExports.unref(tokens).total_tokens)), 1)
                            ])
                          ])) : vueExports.createCommentVNode("", true),
                          vueExports.unref(detail).running.session_id ? (vueExports.openBlock(), vueExports.createBlock("div", { key: 1 }, [
                            vueExports.createVNode("span", { class: "text-muted" }, "Session ID"),
                            vueExports.createVNode("div", { class: "font-mono text-xs break-all" }, [
                              vueExports.createVNode(_component_NuxtLink, {
                                to: `/sessions/${encodeURIComponent(vueExports.unref(detail).running.session_id)}`,
                                class: "text-primary hover:underline"
                              }, {
                                default: vueExports.withCtx(() => [
                                  vueExports.createTextVNode(vueExports.toDisplayString(vueExports.unref(detail).running.session_id), 1)
                                ]),
                                _: 1
                              }, 8, ["to"])
                            ])
                          ])) : vueExports.createCommentVNode("", true),
                          vueExports.unref(detail).running.last_message ? (vueExports.openBlock(), vueExports.createBlock("div", { key: 2 }, [
                            vueExports.createVNode("span", { class: "text-muted" }, "Last Message"),
                            vueExports.createVNode("div", { class: "text-xs whitespace-pre-wrap" }, vueExports.toDisplayString(vueExports.unref(detail).running.last_message), 1)
                          ])) : vueExports.createCommentVNode("", true)
                        ])
                      ];
                    }
                  }),
                  _: 1
                }, _parent2, _scopeId));
              } else {
                _push2(`<!---->`);
              }
              if (vueExports.unref(detail).retry) {
                _push2(serverRenderer_cjs_prodExports.ssrRenderComponent(_component_UCard, null, {
                  header: vueExports.withCtx((_2, _push3, _parent3, _scopeId2) => {
                    if (_push3) {
                      _push3(`<span class="font-semibold"${_scopeId2}>Retry</span>`);
                    } else {
                      return [
                        vueExports.createVNode("span", { class: "font-semibold" }, "Retry")
                      ];
                    }
                  }),
                  default: vueExports.withCtx((_2, _push3, _parent3, _scopeId2) => {
                    if (_push3) {
                      _push3(`<div class="space-y-2 text-sm"${_scopeId2}><div class="grid grid-cols-2 gap-2"${_scopeId2}><div${_scopeId2}><span class="text-muted"${_scopeId2}>Attempt</span><div class="tabular-nums font-medium"${_scopeId2}>${serverRenderer_cjs_prodExports.ssrInterpolate(vueExports.unref(detail).retry.attempt)}</div></div><div${_scopeId2}><span class="text-muted"${_scopeId2}>Due At</span><div class="tabular-nums"${_scopeId2}>${serverRenderer_cjs_prodExports.ssrInterpolate(vueExports.unref(formatDateTime)(vueExports.unref(detail).retry.due_at))}</div></div></div>`);
                      if (vueExports.unref(detail).retry.error) {
                        _push3(`<div${_scopeId2}><span class="text-muted"${_scopeId2}>Error</span><div class="text-error text-xs whitespace-pre-wrap"${_scopeId2}>${serverRenderer_cjs_prodExports.ssrInterpolate(vueExports.unref(detail).retry.error)}</div></div>`);
                      } else {
                        _push3(`<!---->`);
                      }
                      _push3(`</div>`);
                    } else {
                      return [
                        vueExports.createVNode("div", { class: "space-y-2 text-sm" }, [
                          vueExports.createVNode("div", { class: "grid grid-cols-2 gap-2" }, [
                            vueExports.createVNode("div", null, [
                              vueExports.createVNode("span", { class: "text-muted" }, "Attempt"),
                              vueExports.createVNode("div", { class: "tabular-nums font-medium" }, vueExports.toDisplayString(vueExports.unref(detail).retry.attempt), 1)
                            ]),
                            vueExports.createVNode("div", null, [
                              vueExports.createVNode("span", { class: "text-muted" }, "Due At"),
                              vueExports.createVNode("div", { class: "tabular-nums" }, vueExports.toDisplayString(vueExports.unref(formatDateTime)(vueExports.unref(detail).retry.due_at)), 1)
                            ])
                          ]),
                          vueExports.unref(detail).retry.error ? (vueExports.openBlock(), vueExports.createBlock("div", { key: 0 }, [
                            vueExports.createVNode("span", { class: "text-muted" }, "Error"),
                            vueExports.createVNode("div", { class: "text-error text-xs whitespace-pre-wrap" }, vueExports.toDisplayString(vueExports.unref(detail).retry.error), 1)
                          ])) : vueExports.createCommentVNode("", true)
                        ])
                      ];
                    }
                  }),
                  _: 1
                }, _parent2, _scopeId));
              } else {
                _push2(`<!---->`);
              }
              if (vueExports.unref(detail).recent_events.length > 0) {
                _push2(serverRenderer_cjs_prodExports.ssrRenderComponent(_component_UCard, null, {
                  header: vueExports.withCtx((_2, _push3, _parent3, _scopeId2) => {
                    if (_push3) {
                      _push3(`<span class="font-semibold"${_scopeId2}>Recent Events</span>`);
                    } else {
                      return [
                        vueExports.createVNode("span", { class: "font-semibold" }, "Recent Events")
                      ];
                    }
                  }),
                  default: vueExports.withCtx((_2, _push3, _parent3, _scopeId2) => {
                    if (_push3) {
                      _push3(`<!--[-->`);
                      serverRenderer_cjs_prodExports.ssrRenderList(vueExports.unref(detail).recent_events, (event, i) => {
                        _push3(`<div class="flex gap-3 text-sm py-1"${_scopeId2}><span class="tabular-nums text-muted shrink-0"${_scopeId2}>${serverRenderer_cjs_prodExports.ssrInterpolate(vueExports.unref(formatDateTime)(event.at))}</span>`);
                        _push3(serverRenderer_cjs_prodExports.ssrRenderComponent(_component_UBadge, {
                          variant: "outline",
                          class: "shrink-0"
                        }, {
                          default: vueExports.withCtx((_3, _push4, _parent4, _scopeId3) => {
                            if (_push4) {
                              _push4(`${serverRenderer_cjs_prodExports.ssrInterpolate(event.event)}`);
                            } else {
                              return [
                                vueExports.createTextVNode(vueExports.toDisplayString(event.event), 1)
                              ];
                            }
                          }),
                          _: 2
                        }, _parent3, _scopeId2));
                        if (event.message) {
                          _push3(`<span class="truncate text-muted"${serverRenderer_cjs_prodExports.ssrRenderAttr("title", event.message)}${_scopeId2}>${serverRenderer_cjs_prodExports.ssrInterpolate(event.message)}</span>`);
                        } else {
                          _push3(`<!---->`);
                        }
                        _push3(`</div>`);
                      });
                      _push3(`<!--]-->`);
                    } else {
                      return [
                        (vueExports.openBlock(true), vueExports.createBlock(vueExports.Fragment, null, vueExports.renderList(vueExports.unref(detail).recent_events, (event, i) => {
                          return vueExports.openBlock(), vueExports.createBlock("div", {
                            key: i,
                            class: "flex gap-3 text-sm py-1"
                          }, [
                            vueExports.createVNode("span", { class: "tabular-nums text-muted shrink-0" }, vueExports.toDisplayString(vueExports.unref(formatDateTime)(event.at)), 1),
                            vueExports.createVNode(_component_UBadge, {
                              variant: "outline",
                              class: "shrink-0"
                            }, {
                              default: vueExports.withCtx(() => [
                                vueExports.createTextVNode(vueExports.toDisplayString(event.event), 1)
                              ]),
                              _: 2
                            }, 1024),
                            event.message ? (vueExports.openBlock(), vueExports.createBlock("span", {
                              key: 0,
                              class: "truncate text-muted",
                              title: event.message
                            }, vueExports.toDisplayString(event.message), 9, ["title"])) : vueExports.createCommentVNode("", true)
                          ]);
                        }), 128))
                      ];
                    }
                  }),
                  _: 1
                }, _parent2, _scopeId));
              } else {
                _push2(`<!---->`);
              }
              _push2(`<div class="text-xs text-muted"${_scopeId}> Workspace: <code class="font-mono"${_scopeId}>${serverRenderer_cjs_prodExports.ssrInterpolate(vueExports.unref(detail).workspace.path)}</code></div><!--]-->`);
            } else {
              _push2(`<!---->`);
            }
            _push2(`</div>`);
          } else {
            return [
              vueExports.createVNode("div", { class: "space-y-6 p-6" }, [
                vueExports.unref(error) ? (vueExports.openBlock(), vueExports.createBlock(_component_UAlert, {
                  key: 0,
                  color: "error",
                  variant: "subtle",
                  title: vueExports.unref(error),
                  icon: "i-lucide-alert-circle"
                }, null, 8, ["title"])) : vueExports.createCommentVNode("", true),
                vueExports.unref(loading) ? (vueExports.openBlock(), vueExports.createBlock("div", {
                  key: 1,
                  class: "space-y-4"
                }, [
                  vueExports.createVNode(_component_USkeleton, { class: "h-32 w-full rounded-xl" }),
                  vueExports.createVNode(_component_USkeleton, { class: "h-48 w-full rounded-xl" })
                ])) : vueExports.unref(detail) ? (vueExports.openBlock(), vueExports.createBlock(vueExports.Fragment, { key: 2 }, [
                  vueExports.unref(detail).running ? (vueExports.openBlock(), vueExports.createBlock(_component_UCard, { key: 0 }, {
                    header: vueExports.withCtx(() => [
                      vueExports.createVNode("span", { class: "font-semibold" }, "Session")
                    ]),
                    default: vueExports.withCtx(() => [
                      vueExports.createVNode("div", { class: "space-y-3 text-sm" }, [
                        vueExports.createVNode("div", { class: "grid grid-cols-2 gap-2" }, [
                          vueExports.createVNode("div", null, [
                            vueExports.createVNode("span", { class: "text-muted" }, "State"),
                            vueExports.createVNode("div", null, [
                              vueExports.createVNode(_component_StateBadge, {
                                state: vueExports.unref(detail).running.state
                              }, null, 8, ["state"])
                            ])
                          ]),
                          vueExports.createVNode("div", null, [
                            vueExports.createVNode("span", { class: "text-muted" }, "Turns"),
                            vueExports.createVNode("div", { class: "tabular-nums font-medium" }, vueExports.toDisplayString(vueExports.unref(detail).running.turn_count), 1)
                          ]),
                          vueExports.createVNode("div", null, [
                            vueExports.createVNode("span", { class: "text-muted" }, "Started"),
                            vueExports.createVNode("div", { class: "tabular-nums" }, vueExports.toDisplayString(vueExports.unref(formatDateTime)(vueExports.unref(detail).running.started_at)), 1)
                          ]),
                          vueExports.createVNode("div", null, [
                            vueExports.createVNode("span", { class: "text-muted" }, "Last Event"),
                            vueExports.createVNode("div", null, vueExports.toDisplayString(vueExports.unref(detail).running.last_event ?? "—"), 1)
                          ])
                        ]),
                        vueExports.createVNode(_component_USeparator),
                        vueExports.unref(tokens) ? (vueExports.openBlock(), vueExports.createBlock("div", {
                          key: 0,
                          class: "flex gap-6"
                        }, [
                          vueExports.createVNode("div", null, [
                            vueExports.createVNode("span", { class: "text-muted" }, "Input"),
                            vueExports.createVNode("div", { class: "tabular-nums" }, vueExports.toDisplayString(vueExports.unref(formatTokens)(vueExports.unref(tokens).input_tokens)), 1)
                          ]),
                          vueExports.createVNode("div", null, [
                            vueExports.createVNode("span", { class: "text-muted" }, "Output"),
                            vueExports.createVNode("div", { class: "tabular-nums" }, vueExports.toDisplayString(vueExports.unref(formatTokens)(vueExports.unref(tokens).output_tokens)), 1)
                          ]),
                          vueExports.createVNode("div", null, [
                            vueExports.createVNode("span", { class: "text-muted" }, "Total"),
                            vueExports.createVNode("div", { class: "tabular-nums font-medium" }, vueExports.toDisplayString(vueExports.unref(formatTokens)(vueExports.unref(tokens).total_tokens)), 1)
                          ])
                        ])) : vueExports.createCommentVNode("", true),
                        vueExports.unref(detail).running.session_id ? (vueExports.openBlock(), vueExports.createBlock("div", { key: 1 }, [
                          vueExports.createVNode("span", { class: "text-muted" }, "Session ID"),
                          vueExports.createVNode("div", { class: "font-mono text-xs break-all" }, [
                            vueExports.createVNode(_component_NuxtLink, {
                              to: `/sessions/${encodeURIComponent(vueExports.unref(detail).running.session_id)}`,
                              class: "text-primary hover:underline"
                            }, {
                              default: vueExports.withCtx(() => [
                                vueExports.createTextVNode(vueExports.toDisplayString(vueExports.unref(detail).running.session_id), 1)
                              ]),
                              _: 1
                            }, 8, ["to"])
                          ])
                        ])) : vueExports.createCommentVNode("", true),
                        vueExports.unref(detail).running.last_message ? (vueExports.openBlock(), vueExports.createBlock("div", { key: 2 }, [
                          vueExports.createVNode("span", { class: "text-muted" }, "Last Message"),
                          vueExports.createVNode("div", { class: "text-xs whitespace-pre-wrap" }, vueExports.toDisplayString(vueExports.unref(detail).running.last_message), 1)
                        ])) : vueExports.createCommentVNode("", true)
                      ])
                    ]),
                    _: 1
                  })) : vueExports.createCommentVNode("", true),
                  vueExports.unref(detail).retry ? (vueExports.openBlock(), vueExports.createBlock(_component_UCard, { key: 1 }, {
                    header: vueExports.withCtx(() => [
                      vueExports.createVNode("span", { class: "font-semibold" }, "Retry")
                    ]),
                    default: vueExports.withCtx(() => [
                      vueExports.createVNode("div", { class: "space-y-2 text-sm" }, [
                        vueExports.createVNode("div", { class: "grid grid-cols-2 gap-2" }, [
                          vueExports.createVNode("div", null, [
                            vueExports.createVNode("span", { class: "text-muted" }, "Attempt"),
                            vueExports.createVNode("div", { class: "tabular-nums font-medium" }, vueExports.toDisplayString(vueExports.unref(detail).retry.attempt), 1)
                          ]),
                          vueExports.createVNode("div", null, [
                            vueExports.createVNode("span", { class: "text-muted" }, "Due At"),
                            vueExports.createVNode("div", { class: "tabular-nums" }, vueExports.toDisplayString(vueExports.unref(formatDateTime)(vueExports.unref(detail).retry.due_at)), 1)
                          ])
                        ]),
                        vueExports.unref(detail).retry.error ? (vueExports.openBlock(), vueExports.createBlock("div", { key: 0 }, [
                          vueExports.createVNode("span", { class: "text-muted" }, "Error"),
                          vueExports.createVNode("div", { class: "text-error text-xs whitespace-pre-wrap" }, vueExports.toDisplayString(vueExports.unref(detail).retry.error), 1)
                        ])) : vueExports.createCommentVNode("", true)
                      ])
                    ]),
                    _: 1
                  })) : vueExports.createCommentVNode("", true),
                  vueExports.unref(detail).recent_events.length > 0 ? (vueExports.openBlock(), vueExports.createBlock(_component_UCard, { key: 2 }, {
                    header: vueExports.withCtx(() => [
                      vueExports.createVNode("span", { class: "font-semibold" }, "Recent Events")
                    ]),
                    default: vueExports.withCtx(() => [
                      (vueExports.openBlock(true), vueExports.createBlock(vueExports.Fragment, null, vueExports.renderList(vueExports.unref(detail).recent_events, (event, i) => {
                        return vueExports.openBlock(), vueExports.createBlock("div", {
                          key: i,
                          class: "flex gap-3 text-sm py-1"
                        }, [
                          vueExports.createVNode("span", { class: "tabular-nums text-muted shrink-0" }, vueExports.toDisplayString(vueExports.unref(formatDateTime)(event.at)), 1),
                          vueExports.createVNode(_component_UBadge, {
                            variant: "outline",
                            class: "shrink-0"
                          }, {
                            default: vueExports.withCtx(() => [
                              vueExports.createTextVNode(vueExports.toDisplayString(event.event), 1)
                            ]),
                            _: 2
                          }, 1024),
                          event.message ? (vueExports.openBlock(), vueExports.createBlock("span", {
                            key: 0,
                            class: "truncate text-muted",
                            title: event.message
                          }, vueExports.toDisplayString(event.message), 9, ["title"])) : vueExports.createCommentVNode("", true)
                        ]);
                      }), 128))
                    ]),
                    _: 1
                  })) : vueExports.createCommentVNode("", true),
                  vueExports.createVNode("div", { class: "text-xs text-muted" }, [
                    vueExports.createTextVNode(" Workspace: "),
                    vueExports.createVNode("code", { class: "font-mono" }, vueExports.toDisplayString(vueExports.unref(detail).workspace.path), 1)
                  ])
                ], 64)) : vueExports.createCommentVNode("", true)
              ])
            ];
          }
        }),
        _: 1
      }, _parent));
    };
  }
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
  const ssrContext = vueExports.useSSRContext();
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("pages/issues/[identifier].vue");
  return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};

export { _sfc_main as default };
//# sourceMappingURL=_identifier_-u8aQI-B5.mjs.map
