conductor-oss 0.18.2 → 0.18.3
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/README.md +1 -21
- package/package.json +5 -5
- package/web/.next/standalone/packages/web/.next/BUILD_ID +1 -1
- package/web/.next/standalone/packages/web/.next/app-path-routes-manifest.json +0 -2
- package/web/.next/standalone/packages/web/.next/build-manifest.json +2 -2
- package/web/.next/standalone/packages/web/.next/prerender-manifest.json +3 -3
- package/web/.next/standalone/packages/web/.next/routes-manifest.json +0 -16
- package/web/.next/standalone/packages/web/.next/server/app/_global-error.html +2 -2
- package/web/.next/standalone/packages/web/.next/server/app/_global-error.rsc +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/_not-found/page/server-reference-manifest.json +7 -7
- package/web/.next/standalone/packages/web/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/_not-found.html +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/_not-found.rsc +4 -4
- package/web/.next/standalone/packages/web/.next/server/app/_not-found.segments/_full.segment.rsc +4 -4
- package/web/.next/standalone/packages/web/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/_not-found.segments/_index.segment.rsc +4 -4
- package/web/.next/standalone/packages/web/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/web/.next/standalone/packages/web/.next/server/app/api/access/route.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/api/agents/route.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/api/app-update/route.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/api/attachments/route.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/api/auth/session/route.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/api/boards/comments/route.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/api/boards/route.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/api/config/route.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/api/context-files/open/route.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/api/context-files/route.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/api/events/route.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/api/executor/health/route.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/api/filesystem/directory/route.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/api/filesystem/pick-directory/route.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/api/github/repos/route.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/api/github/webhook/route.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/api/health/boards/route.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/api/health/sessions/route.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/api/notifications/route.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/api/preferences/route.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/api/remote-access/route.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/api/repositories/[id]/route.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/api/repositories/route.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/actions/route.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/archive/route.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/checks/route.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/diff/route.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/feed/route.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/feedback/route.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/files/route.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/interrupt/route.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/kill/route.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/output/route.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/preview/dom/route.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/preview/route.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/preview/screenshot/route.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/restore/route.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/route.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/terminal/connection/route.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/terminal/snapshot/route.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/api/sessions/route.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/api/spawn/route.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/api/workspaces/branches/route.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/api/workspaces/route.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/page/react-loadable-manifest.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/page/server-reference-manifest.json +7 -7
- package/web/.next/standalone/packages/web/.next/server/app/page.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/sessions/[id]/page/server-reference-manifest.json +7 -7
- package/web/.next/standalone/packages/web/.next/server/app/sessions/[id]/page.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/sessions/[id]/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/sign-in/[[...sign-in]]/page/server-reference-manifest.json +7 -7
- package/web/.next/standalone/packages/web/.next/server/app/sign-in/[[...sign-in]]/page.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/sign-in/[[...sign-in]]/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/unlock/page/server-reference-manifest.json +7 -7
- package/web/.next/standalone/packages/web/.next/server/app/unlock/page.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/unlock/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app-paths-manifest.json +0 -2
- package/web/.next/standalone/packages/web/.next/server/chunks/ssr/{[root-of-the-server]__da08a50a._.js → [root-of-the-server]__20d5f3d2._.js} +2 -2
- package/web/.next/standalone/packages/web/.next/server/chunks/ssr/[root-of-the-server]__379d412d._.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/chunks/ssr/[root-of-the-server]__749fe4b2._.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/chunks/ssr/{[root-of-the-server]__992cdcf8._.js → [root-of-the-server]__7e8cb25c._.js} +2 -2
- package/web/.next/standalone/packages/web/.next/server/chunks/ssr/[root-of-the-server]__c92de424._.js +3 -0
- package/web/.next/standalone/packages/web/.next/server/chunks/ssr/_0e1412de._.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/chunks/ssr/_532f707d._.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/chunks/ssr/_69e05fca._.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/chunks/ssr/_7db952ae._.js +3 -0
- package/web/.next/standalone/packages/web/.next/server/chunks/ssr/_80efe193._.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/chunks/ssr/_c0f0e227._.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/chunks/ssr/_f36ddaa9._.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/chunks/ssr/{node_modules_5646ec2d._.js → node_modules_0c16b10c._.js} +1 -1
- package/web/.next/standalone/packages/web/.next/server/chunks/ssr/node_modules_@clerk_nextjs_dist_esm_app-router_8f8a4bec._.js +3 -0
- package/web/.next/standalone/packages/web/.next/server/chunks/ssr/{node_modules_@clerk_nextjs_dist_esm_app-router_4f296b1d._.js → node_modules_@clerk_nextjs_dist_esm_app-router_b92af890._.js} +2 -2
- package/web/.next/standalone/packages/web/.next/server/chunks/ssr/{node_modules_6d2fa1ea._.js → node_modules_ec4cd8a2._.js} +1 -1
- package/web/.next/standalone/packages/web/.next/server/functions-config-manifest.json +0 -2
- package/web/.next/standalone/packages/web/.next/server/pages/404.html +1 -1
- package/web/.next/standalone/packages/web/.next/server/pages/500.html +2 -2
- package/web/.next/standalone/packages/web/.next/server/server-reference-manifest.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/server-reference-manifest.json +8 -8
- package/web/.next/{static/chunks/9331c73d4edcd945.js → standalone/packages/web/.next/static/chunks/1a90fb2f85154bcc.js} +1 -1
- package/web/.next/standalone/packages/web/.next/static/chunks/{c1e720eabb98af26.js → 1bdd2123a45ba58c.js} +1 -1
- package/web/.next/{static/chunks/1684a3f76eefe776.js → standalone/packages/web/.next/static/chunks/1e6e51cb4f906baa.js} +1 -1
- package/web/.next/standalone/packages/web/.next/static/chunks/{301802e8e898dd01.js → 27756dc916c1e477.js} +1 -1
- package/web/.next/standalone/packages/web/.next/static/chunks/65bc9229d60adf9f.css +4 -0
- package/web/.next/{static/chunks/267e541b481c3c75.js → standalone/packages/web/.next/static/chunks/7630100be1c763fc.js} +1 -1
- package/web/.next/standalone/packages/web/.next/static/chunks/{655db4d21daaca4d.js → 7d66c96327f5fd43.js} +1 -1
- package/web/.next/standalone/packages/web/.next/static/chunks/{8d05dc3b261207bb.js → 962bd9b2967657d6.js} +1 -1
- package/web/.next/{static/chunks/179d5fdedb569ec3.js → standalone/packages/web/.next/static/chunks/995113d11fe53a63.js} +1 -1
- package/web/.next/standalone/packages/web/.next/static/chunks/{58a9b117e5684e7c.js → c9f2a58585434ce0.js} +1 -1
- package/web/.next/standalone/packages/web/.next/static/chunks/dbd9fbeb4e10c4dc.js +1 -0
- package/web/.next/standalone/packages/web/.next/static/chunks/{810a3d36795ae9fd.js → df2796ef26c6da4f.js} +5 -5
- package/web/.next/standalone/packages/web/src/lib/sessionState.ts +0 -473
- package/web/.next/{standalone/packages/web/.next/static/chunks/9331c73d4edcd945.js → static/chunks/1a90fb2f85154bcc.js} +1 -1
- package/web/.next/static/chunks/{c1e720eabb98af26.js → 1bdd2123a45ba58c.js} +1 -1
- package/web/.next/{standalone/packages/web/.next/static/chunks/1684a3f76eefe776.js → static/chunks/1e6e51cb4f906baa.js} +1 -1
- package/web/.next/static/chunks/{301802e8e898dd01.js → 27756dc916c1e477.js} +1 -1
- package/web/.next/static/chunks/65bc9229d60adf9f.css +4 -0
- package/web/.next/{standalone/packages/web/.next/static/chunks/267e541b481c3c75.js → static/chunks/7630100be1c763fc.js} +1 -1
- package/web/.next/static/chunks/{655db4d21daaca4d.js → 7d66c96327f5fd43.js} +1 -1
- package/web/.next/static/chunks/{8d05dc3b261207bb.js → 962bd9b2967657d6.js} +1 -1
- package/web/.next/{standalone/packages/web/.next/static/chunks/179d5fdedb569ec3.js → static/chunks/995113d11fe53a63.js} +1 -1
- package/web/.next/static/chunks/{58a9b117e5684e7c.js → c9f2a58585434ce0.js} +1 -1
- package/web/.next/static/chunks/dbd9fbeb4e10c4dc.js +1 -0
- package/web/.next/static/chunks/{810a3d36795ae9fd.js → df2796ef26c6da4f.js} +5 -5
- package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/feed/stream/route/app-paths-manifest.json +0 -3
- package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/feed/stream/route/build-manifest.json +0 -11
- package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/feed/stream/route/server-reference-manifest.json +0 -4
- package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/feed/stream/route.js +0 -10
- package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/feed/stream/route.js.map +0 -5
- package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/feed/stream/route.js.nft.json +0 -1
- package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/feed/stream/route_client-reference-manifest.js +0 -2
- package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/output/stream/route/app-paths-manifest.json +0 -3
- package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/output/stream/route/build-manifest.json +0 -11
- package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/output/stream/route/server-reference-manifest.json +0 -4
- package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/output/stream/route.js +0 -10
- package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/output/stream/route.js.map +0 -5
- package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/output/stream/route.js.nft.json +0 -1
- package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/output/stream/route_client-reference-manifest.js +0 -2
- package/web/.next/standalone/packages/web/.next/server/chunks/29f24__next-internal_server_app_api_sessions_[id]_feed_stream_route_actions_1262f517.js +0 -3
- package/web/.next/standalone/packages/web/.next/server/chunks/43d70_next-internal_server_app_api_sessions_[id]_output_stream_route_actions_9bfa500e.js +0 -3
- package/web/.next/standalone/packages/web/.next/server/chunks/[root-of-the-server]__d74c0f7a._.js +0 -3
- package/web/.next/standalone/packages/web/.next/server/chunks/[root-of-the-server]__ddad8d14._.js +0 -3
- package/web/.next/standalone/packages/web/.next/server/chunks/[root-of-the-server]__ede5c8ca._.js +0 -3
- package/web/.next/standalone/packages/web/.next/server/chunks/[root-of-the-server]__f3d09d5c._.js +0 -3
- package/web/.next/standalone/packages/web/.next/server/chunks/ssr/[root-of-the-server]__a565f9a3._.js +0 -3
- package/web/.next/standalone/packages/web/.next/server/chunks/ssr/_307d7608._.js +0 -3
- package/web/.next/standalone/packages/web/.next/server/chunks/ssr/_3ed93faf._.js +0 -3
- package/web/.next/standalone/packages/web/.next/server/chunks/ssr/_62d206cc._.js +0 -3
- package/web/.next/standalone/packages/web/.next/server/chunks/ssr/node_modules_@clerk_nextjs_dist_esm_app-router_599a1810._.js +0 -3
- package/web/.next/standalone/packages/web/.next/static/chunks/06eb75e40dff98f1.css +0 -4
- package/web/.next/standalone/packages/web/.next/static/chunks/a8cd591e904d769e.js +0 -1
- package/web/.next/standalone/packages/web/src/app/api/sessions/[id]/feed/stream/route.ts +0 -80
- package/web/.next/standalone/packages/web/src/app/api/sessions/[id]/output/stream/route.ts +0 -80
- package/web/.next/standalone/packages/web/src/components/Dashboard.tsx +0 -3444
- package/web/.next/standalone/packages/web/src/components/TerminalView.tsx +0 -770
- package/web/.next/standalone/packages/web/src/components/sessions/ChatPanel.tsx +0 -2097
- package/web/.next/standalone/packages/web/src/hooks/useSessionFeed.ts +0 -10
- package/web/.next/standalone/packages/web/src/hooks/useSessionOutputStream.ts +0 -166
- package/web/.next/standalone/packages/web/src/lib/chatFeed.ts +0 -196
- package/web/.next/static/chunks/06eb75e40dff98f1.css +0 -4
- package/web/.next/static/chunks/a8cd591e904d769e.js +0 -1
- /package/web/.next/standalone/packages/web/.next/static/{FHjp9qazH2xWUCRt6mqg4 → bfEstB7nf2ym3CDoSi2cy}/_buildManifest.js +0 -0
- /package/web/.next/standalone/packages/web/.next/static/{FHjp9qazH2xWUCRt6mqg4 → bfEstB7nf2ym3CDoSi2cy}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/standalone/packages/web/.next/static/{FHjp9qazH2xWUCRt6mqg4 → bfEstB7nf2ym3CDoSi2cy}/_ssgManifest.js +0 -0
- /package/web/.next/static/{FHjp9qazH2xWUCRt6mqg4 → bfEstB7nf2ym3CDoSi2cy}/_buildManifest.js +0 -0
- /package/web/.next/static/{FHjp9qazH2xWUCRt6mqg4 → bfEstB7nf2ym3CDoSi2cy}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/static/{FHjp9qazH2xWUCRt6mqg4 → bfEstB7nf2ym3CDoSi2cy}/_ssgManifest.js +0 -0
|
@@ -1,63 +1,17 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { useEffect, useMemo, useReducer, useState } from "react";
|
|
4
|
-
import type { NormalizedChatEntry } from "@/lib/chatFeed";
|
|
5
4
|
import { subscribeToSnapshotEvents } from "@/lib/liveEvents";
|
|
6
|
-
import type { SessionRuntimeStatus } from "@/lib/sessionRuntimeStatus";
|
|
7
5
|
import {
|
|
8
|
-
TERMINAL_STATUSES,
|
|
9
6
|
type DashboardSession,
|
|
10
7
|
type SSESessionEvent,
|
|
11
8
|
type SSESnapshotSession,
|
|
12
9
|
} from "@/lib/types";
|
|
13
10
|
|
|
14
11
|
const ACTIVE_SESSIONS_POLL_INTERVAL_MS = 15_000;
|
|
15
|
-
const ACTIVE_FEED_POLL_INTERVAL_MS = 4_000;
|
|
16
|
-
const FEED_RECORD_EVICTION_DELAY_MS = 15_000;
|
|
17
|
-
const DEFAULT_FEED_WINDOW_LIMIT = 120;
|
|
18
|
-
const MAX_FEED_WINDOW_LIMIT = 240;
|
|
19
12
|
|
|
20
13
|
type Listener = () => void;
|
|
21
14
|
|
|
22
|
-
type SessionFeedResponse = {
|
|
23
|
-
entries?: NormalizedChatEntry[];
|
|
24
|
-
totalEntries?: number | null;
|
|
25
|
-
windowLimit?: number | null;
|
|
26
|
-
truncated?: boolean | null;
|
|
27
|
-
sessionStatus?: string | null;
|
|
28
|
-
error?: string | null;
|
|
29
|
-
parserState?: {
|
|
30
|
-
kind?: string | null;
|
|
31
|
-
message?: string | null;
|
|
32
|
-
command?: string | null;
|
|
33
|
-
} | null;
|
|
34
|
-
runtimeStatus?: SessionRuntimeStatus | null;
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
type SessionFeedStreamMessage =
|
|
38
|
-
| SessionFeedResponse
|
|
39
|
-
| {
|
|
40
|
-
type: "append";
|
|
41
|
-
entries?: NormalizedChatEntry[];
|
|
42
|
-
totalEntries?: number | null;
|
|
43
|
-
windowLimit?: number | null;
|
|
44
|
-
truncated?: boolean | null;
|
|
45
|
-
sessionStatus?: string | null;
|
|
46
|
-
error?: string | null;
|
|
47
|
-
parserState?: SessionFeedResponse["parserState"];
|
|
48
|
-
runtimeStatus?: SessionRuntimeStatus | null;
|
|
49
|
-
}
|
|
50
|
-
| {
|
|
51
|
-
type: "replace";
|
|
52
|
-
payload?: SessionFeedResponse | null;
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
export interface SessionParserState {
|
|
56
|
-
kind: string;
|
|
57
|
-
message: string;
|
|
58
|
-
command: string | null;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
15
|
type SessionsStoreState = {
|
|
62
16
|
sessionsById: Map<string, DashboardSession>;
|
|
63
17
|
orderedIds: string[];
|
|
@@ -73,26 +27,6 @@ type SessionsStoreState = {
|
|
|
73
27
|
visibilityHandler: (() => void) | null;
|
|
74
28
|
};
|
|
75
29
|
|
|
76
|
-
type FeedRecord = {
|
|
77
|
-
entries: NormalizedChatEntry[];
|
|
78
|
-
totalEntries: number;
|
|
79
|
-
windowLimit: number;
|
|
80
|
-
truncated: boolean;
|
|
81
|
-
loading: boolean;
|
|
82
|
-
error: string | null;
|
|
83
|
-
sessionStatus: string | null;
|
|
84
|
-
parserState: SessionParserState | null;
|
|
85
|
-
runtimeStatus: SessionRuntimeStatus | null;
|
|
86
|
-
initialized: boolean;
|
|
87
|
-
activeConsumers: number;
|
|
88
|
-
inFlight: boolean;
|
|
89
|
-
pending: boolean;
|
|
90
|
-
eventSource: EventSource | null;
|
|
91
|
-
pollTimer: number | null;
|
|
92
|
-
disposeTimer: number | null;
|
|
93
|
-
listeners: Set<Listener>;
|
|
94
|
-
};
|
|
95
|
-
|
|
96
30
|
const sessionsStore: SessionsStoreState = {
|
|
97
31
|
sessionsById: new Map(),
|
|
98
32
|
orderedIds: [],
|
|
@@ -109,10 +43,6 @@ const sessionsStore: SessionsStoreState = {
|
|
|
109
43
|
};
|
|
110
44
|
|
|
111
45
|
const sessionListeners = new Set<Listener>();
|
|
112
|
-
const feedStore = new Map<string, FeedRecord>();
|
|
113
|
-
let activeFeedConsumers = 0;
|
|
114
|
-
let feedFocusHandler: (() => void) | null = null;
|
|
115
|
-
let feedVisibilityHandler: (() => void) | null = null;
|
|
116
46
|
|
|
117
47
|
function emitSessionChange() {
|
|
118
48
|
for (const listener of sessionListeners) {
|
|
@@ -120,12 +50,6 @@ function emitSessionChange() {
|
|
|
120
50
|
}
|
|
121
51
|
}
|
|
122
52
|
|
|
123
|
-
function emitFeedChange(record: FeedRecord) {
|
|
124
|
-
for (const listener of record.listeners) {
|
|
125
|
-
listener();
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
|
|
129
53
|
function sortSessionIdsByCreatedAt(sessionsById: Map<string, DashboardSession>): string[] {
|
|
130
54
|
return [...sessionsById.values()]
|
|
131
55
|
.sort((left, right) => right.createdAt.localeCompare(left.createdAt))
|
|
@@ -515,400 +439,3 @@ export function useSharedSession(
|
|
|
515
439
|
};
|
|
516
440
|
}
|
|
517
441
|
|
|
518
|
-
function normalizeParserState(value: SessionFeedResponse["parserState"]): SessionParserState | null {
|
|
519
|
-
if (!value || typeof value !== "object") return null;
|
|
520
|
-
const kind = typeof value.kind === "string" ? value.kind.trim() : "";
|
|
521
|
-
const message = typeof value.message === "string" ? value.message.trim() : "";
|
|
522
|
-
const command = typeof value.command === "string" && value.command.trim().length > 0
|
|
523
|
-
? value.command.trim()
|
|
524
|
-
: null;
|
|
525
|
-
if (!kind || !message) return null;
|
|
526
|
-
return { kind, message, command };
|
|
527
|
-
}
|
|
528
|
-
|
|
529
|
-
function ensureFeedRecord(sessionId: string): FeedRecord {
|
|
530
|
-
const existing = feedStore.get(sessionId);
|
|
531
|
-
if (existing) {
|
|
532
|
-
return existing;
|
|
533
|
-
}
|
|
534
|
-
|
|
535
|
-
const created: FeedRecord = {
|
|
536
|
-
entries: [],
|
|
537
|
-
totalEntries: 0,
|
|
538
|
-
windowLimit: DEFAULT_FEED_WINDOW_LIMIT,
|
|
539
|
-
truncated: false,
|
|
540
|
-
loading: true,
|
|
541
|
-
error: null,
|
|
542
|
-
sessionStatus: null,
|
|
543
|
-
parserState: null,
|
|
544
|
-
runtimeStatus: null,
|
|
545
|
-
initialized: false,
|
|
546
|
-
activeConsumers: 0,
|
|
547
|
-
inFlight: false,
|
|
548
|
-
pending: false,
|
|
549
|
-
eventSource: null,
|
|
550
|
-
pollTimer: null,
|
|
551
|
-
disposeTimer: null,
|
|
552
|
-
listeners: new Set(),
|
|
553
|
-
};
|
|
554
|
-
feedStore.set(sessionId, created);
|
|
555
|
-
return created;
|
|
556
|
-
}
|
|
557
|
-
|
|
558
|
-
function feedPollDelay(): number {
|
|
559
|
-
return ACTIVE_FEED_POLL_INTERVAL_MS;
|
|
560
|
-
}
|
|
561
|
-
|
|
562
|
-
function feedsRealtimeEnabled(): boolean {
|
|
563
|
-
return document.visibilityState === "visible";
|
|
564
|
-
}
|
|
565
|
-
|
|
566
|
-
function clearFeedPolling(record: FeedRecord) {
|
|
567
|
-
if (record.pollTimer !== null) {
|
|
568
|
-
window.clearTimeout(record.pollTimer);
|
|
569
|
-
record.pollTimer = null;
|
|
570
|
-
}
|
|
571
|
-
}
|
|
572
|
-
|
|
573
|
-
function clearFeedDisposal(record: FeedRecord) {
|
|
574
|
-
if (record.disposeTimer !== null) {
|
|
575
|
-
window.clearTimeout(record.disposeTimer);
|
|
576
|
-
record.disposeTimer = null;
|
|
577
|
-
}
|
|
578
|
-
}
|
|
579
|
-
|
|
580
|
-
function scheduleFeedDisposal(sessionId: string, record: FeedRecord) {
|
|
581
|
-
clearFeedDisposal(record);
|
|
582
|
-
if (record.activeConsumers > 0 || record.listeners.size > 0) {
|
|
583
|
-
return;
|
|
584
|
-
}
|
|
585
|
-
|
|
586
|
-
record.disposeTimer = window.setTimeout(() => {
|
|
587
|
-
if (record.activeConsumers > 0 || record.listeners.size > 0) {
|
|
588
|
-
return;
|
|
589
|
-
}
|
|
590
|
-
clearFeedPolling(record);
|
|
591
|
-
record.eventSource?.close();
|
|
592
|
-
record.eventSource = null;
|
|
593
|
-
feedStore.delete(sessionId);
|
|
594
|
-
}, FEED_RECORD_EVICTION_DELAY_MS);
|
|
595
|
-
}
|
|
596
|
-
|
|
597
|
-
function closeFeedTransport(record: FeedRecord) {
|
|
598
|
-
clearFeedPolling(record);
|
|
599
|
-
record.eventSource?.close();
|
|
600
|
-
record.eventSource = null;
|
|
601
|
-
}
|
|
602
|
-
|
|
603
|
-
function clampFeedWindowLimit(value: number | null | undefined): number {
|
|
604
|
-
if (typeof value !== "number" || !Number.isFinite(value)) {
|
|
605
|
-
return DEFAULT_FEED_WINDOW_LIMIT;
|
|
606
|
-
}
|
|
607
|
-
return Math.min(MAX_FEED_WINDOW_LIMIT, Math.max(1, Math.trunc(value)));
|
|
608
|
-
}
|
|
609
|
-
|
|
610
|
-
function trimFeedEntries(entries: NormalizedChatEntry[], windowLimit: number): NormalizedChatEntry[] {
|
|
611
|
-
if (entries.length <= windowLimit) {
|
|
612
|
-
return entries;
|
|
613
|
-
}
|
|
614
|
-
return entries.slice(entries.length - windowLimit);
|
|
615
|
-
}
|
|
616
|
-
|
|
617
|
-
function applyFeedPayload(record: FeedRecord, payload: SessionFeedResponse) {
|
|
618
|
-
const windowLimit = clampFeedWindowLimit(payload.windowLimit);
|
|
619
|
-
const entries = Array.isArray(payload.entries) ? payload.entries : [];
|
|
620
|
-
record.entries = trimFeedEntries(entries, windowLimit);
|
|
621
|
-
record.totalEntries = typeof payload.totalEntries === "number" && Number.isFinite(payload.totalEntries)
|
|
622
|
-
? Math.max(record.entries.length, Math.trunc(payload.totalEntries))
|
|
623
|
-
: record.entries.length;
|
|
624
|
-
record.windowLimit = windowLimit;
|
|
625
|
-
record.truncated = payload.truncated === true || record.totalEntries > record.entries.length;
|
|
626
|
-
record.sessionStatus = typeof payload.sessionStatus === "string" ? payload.sessionStatus : null;
|
|
627
|
-
record.parserState = normalizeParserState(payload.parserState);
|
|
628
|
-
record.runtimeStatus = payload.runtimeStatus && typeof payload.runtimeStatus === "object"
|
|
629
|
-
? payload.runtimeStatus
|
|
630
|
-
: null;
|
|
631
|
-
record.error = typeof payload.error === "string" && payload.error.trim().length > 0
|
|
632
|
-
? payload.error.trim()
|
|
633
|
-
: null;
|
|
634
|
-
record.loading = false;
|
|
635
|
-
record.initialized = true;
|
|
636
|
-
emitFeedChange(record);
|
|
637
|
-
}
|
|
638
|
-
|
|
639
|
-
function applyFeedStreamMessage(record: FeedRecord, message: SessionFeedStreamMessage) {
|
|
640
|
-
if (message && typeof message === "object" && "type" in message && message.type === "append") {
|
|
641
|
-
const appendedEntries = Array.isArray(message.entries) ? message.entries : [];
|
|
642
|
-
const nextWindowLimit = clampFeedWindowLimit(message.windowLimit ?? record.windowLimit);
|
|
643
|
-
record.entries = appendedEntries.length > 0
|
|
644
|
-
? trimFeedEntries([...record.entries, ...appendedEntries], nextWindowLimit)
|
|
645
|
-
: record.entries;
|
|
646
|
-
record.totalEntries = typeof message.totalEntries === "number" && Number.isFinite(message.totalEntries)
|
|
647
|
-
? Math.max(record.entries.length, Math.trunc(message.totalEntries))
|
|
648
|
-
: record.totalEntries + appendedEntries.length;
|
|
649
|
-
record.windowLimit = nextWindowLimit;
|
|
650
|
-
record.truncated = message.truncated === true || record.totalEntries > record.entries.length;
|
|
651
|
-
record.sessionStatus = typeof message.sessionStatus === "string" ? message.sessionStatus : record.sessionStatus;
|
|
652
|
-
record.parserState = normalizeParserState(message.parserState) ?? record.parserState;
|
|
653
|
-
record.runtimeStatus = message.runtimeStatus && typeof message.runtimeStatus === "object"
|
|
654
|
-
? message.runtimeStatus
|
|
655
|
-
: record.runtimeStatus;
|
|
656
|
-
record.error = typeof message.error === "string" && message.error.trim().length > 0
|
|
657
|
-
? message.error.trim()
|
|
658
|
-
: null;
|
|
659
|
-
record.loading = false;
|
|
660
|
-
record.initialized = true;
|
|
661
|
-
emitFeedChange(record);
|
|
662
|
-
return;
|
|
663
|
-
}
|
|
664
|
-
|
|
665
|
-
if (message && typeof message === "object" && "type" in message && message.type === "replace") {
|
|
666
|
-
applyFeedPayload(record, message.payload ?? {});
|
|
667
|
-
return;
|
|
668
|
-
}
|
|
669
|
-
|
|
670
|
-
applyFeedPayload(record, message as SessionFeedResponse);
|
|
671
|
-
}
|
|
672
|
-
|
|
673
|
-
async function refreshFeedRecord(sessionId: string, record = ensureFeedRecord(sessionId)): Promise<void> {
|
|
674
|
-
if (record.inFlight) {
|
|
675
|
-
record.pending = true;
|
|
676
|
-
return;
|
|
677
|
-
}
|
|
678
|
-
|
|
679
|
-
record.inFlight = true;
|
|
680
|
-
do {
|
|
681
|
-
record.pending = false;
|
|
682
|
-
try {
|
|
683
|
-
const search = new URLSearchParams({
|
|
684
|
-
limit: String(DEFAULT_FEED_WINDOW_LIMIT),
|
|
685
|
-
});
|
|
686
|
-
const response = await fetch(`/api/sessions/${encodeURIComponent(sessionId)}/feed?${search.toString()}`, {
|
|
687
|
-
cache: "no-store",
|
|
688
|
-
});
|
|
689
|
-
if (!response.ok) {
|
|
690
|
-
throw new Error(`Failed to load chat feed: ${response.status}`);
|
|
691
|
-
}
|
|
692
|
-
applyFeedPayload(record, await response.json());
|
|
693
|
-
} catch (error) {
|
|
694
|
-
record.error = error instanceof Error ? error.message : "Failed to load chat feed";
|
|
695
|
-
record.loading = false;
|
|
696
|
-
emitFeedChange(record);
|
|
697
|
-
}
|
|
698
|
-
} while (record.pending);
|
|
699
|
-
record.inFlight = false;
|
|
700
|
-
}
|
|
701
|
-
|
|
702
|
-
function scheduleFeedPolling(sessionId: string, record: FeedRecord) {
|
|
703
|
-
clearFeedPolling(record);
|
|
704
|
-
if (record.activeConsumers === 0 || record.eventSource || !feedsRealtimeEnabled()) {
|
|
705
|
-
return;
|
|
706
|
-
}
|
|
707
|
-
record.pollTimer = window.setTimeout(async () => {
|
|
708
|
-
if (record.activeConsumers === 0 || !feedsRealtimeEnabled()) {
|
|
709
|
-
return;
|
|
710
|
-
}
|
|
711
|
-
await refreshFeedRecord(sessionId, record);
|
|
712
|
-
scheduleFeedPolling(sessionId, record);
|
|
713
|
-
}, feedPollDelay());
|
|
714
|
-
}
|
|
715
|
-
|
|
716
|
-
function ensureFeedRecordTransport(sessionId: string, record: FeedRecord) {
|
|
717
|
-
if (record.activeConsumers === 0) {
|
|
718
|
-
closeFeedTransport(record);
|
|
719
|
-
return;
|
|
720
|
-
}
|
|
721
|
-
|
|
722
|
-
if (!feedsRealtimeEnabled()) {
|
|
723
|
-
closeFeedTransport(record);
|
|
724
|
-
return;
|
|
725
|
-
}
|
|
726
|
-
|
|
727
|
-
if (!record.initialized && !record.inFlight) {
|
|
728
|
-
record.loading = true;
|
|
729
|
-
emitFeedChange(record);
|
|
730
|
-
void refreshFeedRecord(sessionId, record);
|
|
731
|
-
}
|
|
732
|
-
|
|
733
|
-
if (record.eventSource) {
|
|
734
|
-
return;
|
|
735
|
-
}
|
|
736
|
-
|
|
737
|
-
const search = new URLSearchParams({
|
|
738
|
-
limit: String(DEFAULT_FEED_WINDOW_LIMIT),
|
|
739
|
-
});
|
|
740
|
-
const source = new EventSource(`/api/sessions/${encodeURIComponent(sessionId)}/feed/stream?${search.toString()}`);
|
|
741
|
-
source.onmessage = (event) => {
|
|
742
|
-
try {
|
|
743
|
-
applyFeedStreamMessage(record, JSON.parse(event.data as string) as SessionFeedStreamMessage);
|
|
744
|
-
} catch {
|
|
745
|
-
// Ignore malformed stream payloads.
|
|
746
|
-
}
|
|
747
|
-
};
|
|
748
|
-
source.addEventListener("refresh", () => {
|
|
749
|
-
void refreshFeedRecord(sessionId, record);
|
|
750
|
-
});
|
|
751
|
-
source.onerror = () => {
|
|
752
|
-
source.close();
|
|
753
|
-
if (record.eventSource === source) {
|
|
754
|
-
record.eventSource = null;
|
|
755
|
-
}
|
|
756
|
-
if (record.activeConsumers > 0) {
|
|
757
|
-
scheduleFeedPolling(sessionId, record);
|
|
758
|
-
}
|
|
759
|
-
};
|
|
760
|
-
record.eventSource = source;
|
|
761
|
-
clearFeedPolling(record);
|
|
762
|
-
}
|
|
763
|
-
|
|
764
|
-
function syncFeedRecords(options?: { refreshVisible?: boolean }) {
|
|
765
|
-
for (const [sessionId, record] of feedStore) {
|
|
766
|
-
if (record.activeConsumers === 0) {
|
|
767
|
-
continue;
|
|
768
|
-
}
|
|
769
|
-
if (feedsRealtimeEnabled()) {
|
|
770
|
-
if (options?.refreshVisible) {
|
|
771
|
-
void refreshFeedRecord(sessionId, record);
|
|
772
|
-
}
|
|
773
|
-
ensureFeedRecordTransport(sessionId, record);
|
|
774
|
-
continue;
|
|
775
|
-
}
|
|
776
|
-
closeFeedTransport(record);
|
|
777
|
-
}
|
|
778
|
-
}
|
|
779
|
-
|
|
780
|
-
function attachFeedLifecycleListeners() {
|
|
781
|
-
if (feedFocusHandler || feedVisibilityHandler) {
|
|
782
|
-
return;
|
|
783
|
-
}
|
|
784
|
-
|
|
785
|
-
feedFocusHandler = () => {
|
|
786
|
-
if (activeFeedConsumers === 0 || !feedsRealtimeEnabled()) {
|
|
787
|
-
return;
|
|
788
|
-
}
|
|
789
|
-
syncFeedRecords({ refreshVisible: true });
|
|
790
|
-
};
|
|
791
|
-
|
|
792
|
-
feedVisibilityHandler = () => {
|
|
793
|
-
if (activeFeedConsumers === 0) {
|
|
794
|
-
return;
|
|
795
|
-
}
|
|
796
|
-
if (feedsRealtimeEnabled()) {
|
|
797
|
-
syncFeedRecords({ refreshVisible: true });
|
|
798
|
-
return;
|
|
799
|
-
}
|
|
800
|
-
syncFeedRecords();
|
|
801
|
-
};
|
|
802
|
-
|
|
803
|
-
window.addEventListener("focus", feedFocusHandler);
|
|
804
|
-
document.addEventListener("visibilitychange", feedVisibilityHandler);
|
|
805
|
-
}
|
|
806
|
-
|
|
807
|
-
function detachFeedLifecycleListeners() {
|
|
808
|
-
if (feedFocusHandler) {
|
|
809
|
-
window.removeEventListener("focus", feedFocusHandler);
|
|
810
|
-
feedFocusHandler = null;
|
|
811
|
-
}
|
|
812
|
-
if (feedVisibilityHandler) {
|
|
813
|
-
document.removeEventListener("visibilitychange", feedVisibilityHandler);
|
|
814
|
-
feedVisibilityHandler = null;
|
|
815
|
-
}
|
|
816
|
-
}
|
|
817
|
-
|
|
818
|
-
function activateFeedRecord(sessionId: string) {
|
|
819
|
-
const record = ensureFeedRecord(sessionId);
|
|
820
|
-
clearFeedDisposal(record);
|
|
821
|
-
activeFeedConsumers += 1;
|
|
822
|
-
record.activeConsumers += 1;
|
|
823
|
-
if (activeFeedConsumers === 1) {
|
|
824
|
-
attachFeedLifecycleListeners();
|
|
825
|
-
}
|
|
826
|
-
if (record.activeConsumers > 1) {
|
|
827
|
-
return;
|
|
828
|
-
}
|
|
829
|
-
ensureFeedRecordTransport(sessionId, record);
|
|
830
|
-
}
|
|
831
|
-
|
|
832
|
-
function deactivateFeedRecord(sessionId: string) {
|
|
833
|
-
const record = feedStore.get(sessionId);
|
|
834
|
-
if (!record) {
|
|
835
|
-
return;
|
|
836
|
-
}
|
|
837
|
-
activeFeedConsumers = Math.max(0, activeFeedConsumers - 1);
|
|
838
|
-
record.activeConsumers = Math.max(0, record.activeConsumers - 1);
|
|
839
|
-
if (record.activeConsumers > 0) {
|
|
840
|
-
return;
|
|
841
|
-
}
|
|
842
|
-
closeFeedTransport(record);
|
|
843
|
-
scheduleFeedDisposal(sessionId, record);
|
|
844
|
-
if (activeFeedConsumers === 0) {
|
|
845
|
-
detachFeedLifecycleListeners();
|
|
846
|
-
}
|
|
847
|
-
}
|
|
848
|
-
|
|
849
|
-
function subscribeFeedRecord(sessionId: string, listener: Listener): () => void {
|
|
850
|
-
const record = ensureFeedRecord(sessionId);
|
|
851
|
-
clearFeedDisposal(record);
|
|
852
|
-
record.listeners.add(listener);
|
|
853
|
-
return () => {
|
|
854
|
-
record.listeners.delete(listener);
|
|
855
|
-
scheduleFeedDisposal(sessionId, record);
|
|
856
|
-
};
|
|
857
|
-
}
|
|
858
|
-
|
|
859
|
-
export function useSharedSessionFeed(
|
|
860
|
-
sessionId: string | null | undefined,
|
|
861
|
-
options?: { enabled?: boolean },
|
|
862
|
-
) {
|
|
863
|
-
const enabled = options?.enabled ?? true;
|
|
864
|
-
const [, forceRender] = useReducer((value) => value + 1, 0);
|
|
865
|
-
|
|
866
|
-
useEffect(() => {
|
|
867
|
-
if (!sessionId || !enabled) {
|
|
868
|
-
return;
|
|
869
|
-
}
|
|
870
|
-
return subscribeFeedRecord(sessionId, () => forceRender());
|
|
871
|
-
}, [enabled, sessionId]);
|
|
872
|
-
|
|
873
|
-
useEffect(() => {
|
|
874
|
-
if (!sessionId) {
|
|
875
|
-
return;
|
|
876
|
-
}
|
|
877
|
-
if (!enabled) {
|
|
878
|
-
return;
|
|
879
|
-
}
|
|
880
|
-
activateFeedRecord(sessionId);
|
|
881
|
-
return () => {
|
|
882
|
-
deactivateFeedRecord(sessionId);
|
|
883
|
-
};
|
|
884
|
-
}, [enabled, sessionId]);
|
|
885
|
-
|
|
886
|
-
if (!sessionId || !enabled) {
|
|
887
|
-
return {
|
|
888
|
-
entries: [] as NormalizedChatEntry[],
|
|
889
|
-
totalEntries: 0,
|
|
890
|
-
windowLimit: DEFAULT_FEED_WINDOW_LIMIT,
|
|
891
|
-
truncated: false,
|
|
892
|
-
loading: false,
|
|
893
|
-
error: null,
|
|
894
|
-
sessionStatus: null,
|
|
895
|
-
parserState: null,
|
|
896
|
-
runtimeStatus: null,
|
|
897
|
-
refresh: async () => {},
|
|
898
|
-
};
|
|
899
|
-
}
|
|
900
|
-
|
|
901
|
-
const record = ensureFeedRecord(sessionId);
|
|
902
|
-
return {
|
|
903
|
-
entries: record.entries,
|
|
904
|
-
totalEntries: record.totalEntries,
|
|
905
|
-
windowLimit: record.windowLimit,
|
|
906
|
-
truncated: record.truncated,
|
|
907
|
-
loading: record.loading,
|
|
908
|
-
error: record.error,
|
|
909
|
-
sessionStatus: record.sessionStatus,
|
|
910
|
-
parserState: record.parserState,
|
|
911
|
-
runtimeStatus: record.runtimeStatus,
|
|
912
|
-
refresh: () => refreshFeedRecord(sessionId, record),
|
|
913
|
-
};
|
|
914
|
-
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,52808,e=>{"use strict";let t=new Set(["archived","done","killed","errored","terminated","merged","cleanup"]);function r(e){return"merged"===e.status||"archived"===e.status||"killed"===e.status||"errored"===e.status||"cleanup"===e.status||"done"===e.status||"terminated"===e.status||e.pr&&("merged"===e.pr.state||"closed"===e.pr.state)?"done":"mergeable"===e.status||"approved"===e.status||e.pr?.mergeability.mergeable?"merge":"waiting_input"===e.activity||"blocked"===e.activity||"needs_input"===e.status||"stuck"===e.status?"respond":"queued"===e.status?"pending":"exited"===e.activity?"respond":"ci_failed"===e.status||"changes_requested"===e.status||e.pr&&("failing"===e.pr.ciStatus||"changes_requested"===e.pr.reviewDecision||!e.pr.mergeability.noConflicts)?"review":"review_pending"===e.status||e.pr&&!e.pr.isDraft&&("pending"===e.pr.reviewDecision||"none"===e.pr.reviewDecision)?"pending":"working"}e.s(["TERMINAL_STATUSES",0,t,"getAttentionLevel",()=>r])},48256,84981,e=>{"use strict";var t=e.i(75254);let r=(0,t.default)("globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);e.s(["Globe",()=>r],48256);let s=(0,t.default)("square-terminal",[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]]);e.s(["default",()=>s],84981)},90993,e=>{"use strict";var t=e.i(43476),r=e.i(18620);let s=(0,e.i(71645).forwardRef)(({className:e,...s},n)=>(0,t.jsx)("div",{ref:n,className:(0,r.cn)("surface-card rounded-[var(--radius-md)] border",e),...s}));function n({className:e,...s}){return(0,t.jsx)("div",{className:(0,r.cn)("flex items-center gap-2 border-b border-[var(--vk-border)] px-3 py-2",e),...s})}function a({className:e,...s}){return(0,t.jsx)("div",{className:(0,r.cn)("px-3 py-2",e),...s})}s.displayName="Card",e.s(["Card",0,s,"CardContent",()=>a,"CardHeader",()=>n])},55716,e=>{"use strict";let t=(0,e.i(75254).default)("git-branch",[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]]);e.s(["GitBranch",()=>t],55716)},27025,e=>{"use strict";let t=(0,e.i(75254).default)("folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);e.s(["Folder",()=>t],27025)},78917,e=>{"use strict";let t=(0,e.i(75254).default)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);e.s(["ExternalLink",()=>t],78917)},90336,e=>{"use strict";var t=e.i(71645);function r(e){return!e||"object"!=typeof e||Array.isArray(e)?{}:{...e}}function s(){let[e,s]=(0,t.useState)(null),[n,a]=(0,t.useState)(!0),[i,l]=(0,t.useState)(null),o=(0,t.useRef)(!1),c=(0,t.useCallback)(async()=>{try{var e;let t,n,a,i=await fetch("/api/preferences"),o=await i.json().catch(()=>null);if(!i.ok)throw Error(o?.error??`Failed to load preferences: ${i.status}`);s((e=o?.preferences,t=r(e),a=(n=r(t.notifications)).soundFile,{onboardingAcknowledged:!0===t.onboardingAcknowledged,codingAgent:"string"==typeof t.codingAgent&&t.codingAgent.trim().length>0?t.codingAgent.trim():"claude-code",ide:"string"==typeof t.ide&&t.ide.trim().length>0?t.ide.trim():"vscode",markdownEditor:"string"==typeof t.markdownEditor&&t.markdownEditor.trim().length>0?t.markdownEditor.trim():"obsidian",markdownEditorPath:"string"==typeof t.markdownEditorPath?t.markdownEditorPath.trim():"",notifications:{soundEnabled:!1!==n.soundEnabled,soundFile:null===a?null:"string"==typeof a&&a.trim().length>0?a.trim():"abstract-sound-4"}})),l(null)}catch(e){s(null),l(e instanceof Error?e.message:"Failed to load preferences")}finally{a(!1)}},[]);return(0,t.useEffect)(()=>{o.current||(o.current=!0,c())},[c]),{preferences:e,loading:n,error:i,refresh:c}}e.s(["usePreferences",()=>s])},16715,e=>{"use strict";let t=(0,e.i(75254).default)("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);e.s(["RefreshCw",()=>t],16715)},64659,e=>{"use strict";let t=(0,e.i(75254).default)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);e.s(["ChevronDown",()=>t],64659)},55436,e=>{"use strict";let t=(0,e.i(75254).default)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);e.s(["Search",()=>t],55436)},63059,e=>{"use strict";let t=(0,e.i(75254).default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);e.s(["ChevronRight",()=>t],63059)},97878,e=>{"use strict";let t=new Set,r=new Set,s=null,n=null,a=null,i=null;function l(){return t.size>0||r.size>0}function o(){return"u"<typeof document||"visible"===document.visibilityState}function c(){s&&(s.close(),s=null)}function d(e){if(Array.isArray(e))return{type:"snapshot",sessions:e};if(!e||"object"!=typeof e)return null;let t=e.type;return"snapshot"!==t&&"snapshot_delta"!==t?null:Array.isArray(e.sessions)?e:null}function u(e){return e&&"object"==typeof e&&"boolean"==typeof e.enabled?e:null}function p(e){for(let r of t)r(e);let s=u(e.appUpdate);if(s)for(let e of r)e(s)}async function m(){if("function"!=typeof fetch)return;let e=(async()=>{try{let e=await fetch("/api/sessions");if(!e.ok)return;let t=await e.json().catch(()=>null),r=d(t);if(!r)return;p(r)}catch{}try{let t=await fetch("/api/app-update");if(!t.ok)return;let s=await t.json().catch(()=>null);var e=u(s);for(let t of r)t(e)}catch{}})();n=e.finally(()=>{n===e&&(n=null)}),await e}function x(){!s&&"u">typeof EventSource&&l()&&o()&&((s=new EventSource("/api/events")).onmessage=e=>{try{let t=d(JSON.parse(e.data));if(!t)return;p(t)}catch{}},s.addEventListener("refresh",()=>{n||m()}),s.onerror=()=>{l()&&o()||c()})}function h(){if(!l()){c(),a&&(window.removeEventListener("focus",a),a=null),i&&(document.removeEventListener("visibilitychange",i),i=null);return}(a||i||(a=()=>{l()&&o()&&(x(),n||m())},i=()=>{l()&&o()?(x(),n||m()):c()},window.addEventListener("focus",a),document.addEventListener("visibilitychange",i)),o())?x():c()}function v(e){return t.add(e),h(),()=>{t.delete(e),h()}}function f(e){return r.add(e),h(),()=>{r.delete(e),h()}}e.s(["subscribeToAppUpdateEvents",()=>f,"subscribeToSnapshotEvents",()=>v])},7233,e=>{"use strict";let t=(0,e.i(75254).default)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);e.s(["Plus",()=>t],7233)},45241,e=>{"use strict";var t=e.i(43476),r=e.i(71645),s=e.i(74080),n=e.i(7233),a=e.i(37727),i=e.i(18620),l=e.i(52808);let o=(0,e.i(75254).default)("archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);var c=e.i(55436),d=e.i(69242);let u=["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"];function p(e){let t=e.metadata.worktree?.trim()??"";return t&&t.replace(/\\/g,"/").replace(/\/+$/,"").includes("/worktrees/")?"worktree":"local"}function m(e){let t=e.branch?.trim();if(t)return t;let r=e.summary?.trim()||e.metadata.summary?.trim();return r||(e.status?.trim()?e.status.replace(/[_-]+/g," "):e.id.slice(0,8))}function x(){let[e,s]=(0,r.useState)(0);return(0,r.useEffect)(()=>{let e=window.setInterval(()=>{s(e=>(e+1)%u.length)},80);return()=>window.clearInterval(e)},[]),(0,t.jsx)("span",{"aria-hidden":"true",className:"inline-block select-none font-mono text-[18px] leading-none text-[var(--vk-text-strong)]",children:u[e]})}function h({running:e}){return e?(0,t.jsx)("span",{className:"mt-0.5 inline-flex h-5 w-5 shrink-0 items-center justify-center",children:(0,t.jsx)(x,{})}):null}function v({additions:e,deletions:r,isSelected:s}){return(0,t.jsx)("span",{className:(0,i.cn)("inline-flex shrink-0 items-center rounded-[10px] px-3 py-1.5 font-mono text-[12px] leading-none tabular-nums",s?"bg-[rgba(255,255,255,0.1)]":"bg-[rgba(255,255,255,0.06)]"),children:(0,t.jsxs)("span",{className:"inline-flex items-center gap-3",children:[(0,t.jsxs)("span",{className:"text-[#18c58f]",children:["+",e]}),(0,t.jsxs)("span",{className:"text-[#f26d6d]",children:["−",r]})]})})}function f(e,t,r){e.stopPropagation(),e.preventDefault(),r(t,{tab:"diff"})}function b({sessions:e,selectedId:s,onSelect:n,onArchive:a,onCreateWorkspace:u,showHeader:x=!0}){let[b,g]=(0,r.useState)(""),[k,y]=(0,r.useState)(null),[j,w]=(0,r.useState)(null),N=(0,r.useMemo)(()=>{let t=e.filter(e=>"archived"!==e.status);if(!b.trim())return t;let r=b.toLowerCase();return t.filter(e=>{let t=e.summary??"",s=e.branch??"",n=e.metadata.agent??"",a=p(e),i=m(e);return e.id.toLowerCase().includes(r)||e.projectId.toLowerCase().includes(r)||t.toLowerCase().includes(r)||s.toLowerCase().includes(r)||n.toLowerCase().includes(r)||a.toLowerCase().includes(r)||i.toLowerCase().includes(r)})},[b,e]),S=async(e,t)=>{if(e.stopPropagation(),e.preventDefault(),a&&k!==t){y(t);try{await a(t)}catch(e){console.error("Failed to archive session",e),w(t),window.setTimeout(()=>w(null),3e3)}finally{y(e=>e===t?null:e)}}},C=(0,r.useMemo)(()=>[...N].sort((e,t)=>new Date(t.lastActivityAt).getTime()-new Date(e.lastActivityAt).getTime()),[N]);return(0,t.jsxs)("div",{className:"flex h-full min-h-0 flex-col",children:[x&&(0,t.jsxs)("div",{className:"flex h-[33px] items-center gap-1 px-2",children:[(0,t.jsx)("p",{className:"text-[16px] text-[var(--vk-text-normal)]",children:"Workspaces"}),u&&(0,t.jsx)("button",{type:"button",onClick:u,className:"ml-auto inline-flex h-5 w-5 items-center justify-center rounded-[3px] text-[var(--vk-orange)] hover:bg-[var(--vk-bg-hover)] lg:hidden","aria-label":"New workspace",children:(0,t.jsx)("span",{className:"text-[14px]",children:"+"})})]}),(0,t.jsx)("div",{className:(0,i.cn)("flex h-[38px] items-center px-2 pb-1.5",!x&&"pt-1.5"),children:(0,t.jsxs)("label",{className:"flex h-[38px] flex-1 items-center rounded-[3px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 sm:h-[30px]",children:[(0,t.jsx)(c.Search,{className:"h-3.5 w-3.5 text-[var(--vk-text-muted)]"}),(0,t.jsx)("input",{value:b,onChange:e=>g(e.target.value),placeholder:"Search...",className:"ml-1.5 w-full bg-transparent text-[14px] text-[var(--vk-text-normal)] outline-none placeholder:text-[var(--vk-text-muted)]"})]})}),(0,t.jsx)("div",{className:"flex-1 overflow-y-auto px-2 pb-2",children:0===C.length?(0,t.jsx)("p",{className:"px-2 py-2 text-[14px] text-[var(--vk-text-muted)]",children:"No sessions"}):(0,t.jsx)("div",{className:"space-y-2",children:C.map(e=>{let r=(0,l.getAttentionLevel)(e),c=function(e){for(let t of[e.metadata.lastStderr,e.metadata.summary,e.summary]){if(!t)continue;let e=t.match(/(\d+)\s+insertions?\(\+\),\s+(\d+)\s+deletions?\(-\)/i);if(!e)continue;let r=Number.parseInt(e[1]??"0",10),s=Number.parseInt(e[2]??"0",10);if(Number.isFinite(r)&&Number.isFinite(s))return{additions:r,deletions:s}}return null}(e),u=function(e,t){let r=`${e.summary??""} ${e.metadata.summary??""}`.toLowerCase();if("killed"===e.status||r.includes("interrupted"))return{label:"Interrupted",className:"text-[var(--vk-orange)]"};switch(t){case"merge":return{label:"Ready",className:"text-[var(--vk-green)]"};case"respond":return{label:"Needs input",className:"text-[var(--vk-red)]"};case"review":return{label:"Review",className:"text-[var(--vk-orange)]"};case"working":return{label:"Running",className:"text-[#4e87f3]"};case"done":return{label:"Done",className:"text-[var(--vk-text-muted)]"};default:return{label:"Queued",className:"text-[var(--vk-text-muted)]"}}}(e,r),x=e.metadata.agent?.trim()||null,b=e.id===s,g="waiting_input"!==e.activity&&"blocked"!==e.activity&&("spawning"===e.status||"working"===e.status),y=k===e.id,w=j===e.id;return(0,t.jsxs)("div",{onClick:()=>n(e.id),onKeyDown:t=>{var r;return r=e.id,void(("Enter"===t.key||" "===t.key)&&(t.preventDefault(),n(r)))},role:"button",tabIndex:0,className:(0,i.cn)("group flex w-full items-start gap-3 rounded-[8px] border px-3 py-3 text-left transition-colors","[content-visibility:auto] [contain-intrinsic-size:92px]",b?"border-[rgba(234,122,42,0.28)] bg-[rgba(255,255,255,0.08)]":"border-[var(--vk-border)] bg-[rgba(255,255,255,0.02)] hover:bg-[var(--vk-bg-hover)]"),children:[(0,t.jsx)(h,{running:g}),(0,t.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("span",{className:"flex min-w-0 items-start gap-2",children:[(0,t.jsxs)("span",{className:"min-w-0 flex flex-1 items-center gap-2",children:[x?(0,t.jsx)("span",{className:"inline-flex h-5 w-5 shrink-0 items-center justify-center",title:x,"aria-label":`${x} agent`,children:(0,t.jsx)(d.AgentTileIcon,{seed:{label:x},className:"h-4 w-4"})}):null,(0,t.jsx)("span",{className:"min-w-0 truncate text-[14px] font-medium text-[var(--vk-text-strong)]",children:p(e)})]}),c?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"hidden shrink-0 sm:block",children:(0,t.jsx)("button",{type:"button",onClick:t=>f(t,e.id,n),onKeyDown:t=>{("Enter"===t.key||" "===t.key)&&f(t,e.id,n)},className:"rounded-[10px] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[var(--vk-orange)]","aria-label":`Open diff for session ${e.id}`,title:"Open diff tab",children:(0,t.jsx)(v,{additions:c.additions,deletions:c.deletions,isSelected:b})})}),(0,t.jsx)("span",{className:"shrink-0 rounded-[8px] bg-[rgba(255,255,255,0.06)] px-2.5 py-1 text-[11px] font-medium sm:hidden",children:(0,t.jsx)("span",{className:u.className,children:u.label})})]}):(0,t.jsx)("span",{className:"shrink-0 rounded-[8px] bg-[rgba(255,255,255,0.06)] px-2.5 py-1 text-[11px] font-medium",children:(0,t.jsx)("span",{className:u.className,children:u.label})})]}),(0,t.jsx)("span",{className:"mt-1 block truncate text-[12px] text-[var(--vk-text-muted)]",children:m(e)})]}),a?(0,t.jsx)("button",{type:"button",onClick:t=>void S(t,e.id),disabled:y,className:(0,i.cn)("mt-0.5 inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-[6px] border border-[var(--vk-border)] text-[var(--vk-text-muted)] transition sm:h-7 sm:w-7","opacity-70 group-hover:opacity-100 focus-visible:opacity-100","hover:border-[var(--vk-border)] hover:bg-[var(--vk-bg-hover)] hover:text-[var(--vk-text-normal)]",y&&"cursor-wait opacity-100"),"aria-label":`Archive session ${e.id}`,title:w?"Archive failed":"Archive session",children:(0,t.jsx)(o,{className:(0,i.cn)("h-3.5 w-3.5",w&&"text-red-400")})}):null]},e.id)})})})]})}var g=e.i(11077);let k=(0,r.memo)(function({projects:e,selectedProjectId:o,onSelectProject:c,onUnlinkProject:d,sessions:u,selectedSessionId:p,onSelectSession:m,onArchiveSession:x,onCreateWorkspace:h}){let[v,f]=(0,r.useState)(null),[k,y]=(0,r.useState)(null),[j,w]=(0,r.useState)(null),N=(0,r.useMemo)(()=>{let e=new Map;for(let t of u){if("archived"===t.status)continue;let r=e.get(t.projectId)??{total:0,active:0};r.total+=1,"done"!==(0,l.getAttentionLevel)(t)&&(r.active+=1),e.set(t.projectId,r)}return e},[u]),S=(0,r.useMemo)(()=>e.find(e=>e.id===k)??null,[k,e]);async function C(){if(d&&k){f(k),w(null);try{await d(k),y(null)}catch(e){w(e instanceof Error?e.message:"Failed to unlink project.")}finally{f(null)}}}return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex h-full min-h-0 w-full flex-col bg-[var(--vk-bg-panel)]",children:[(0,t.jsxs)("section",{className:"border-b border-[var(--vk-border)] px-4 py-4",children:[(0,t.jsx)("div",{className:"flex justify-center text-center",children:(0,t.jsx)("p",{className:"font-brand-header text-[22px] font-bold leading-none uppercase tracking-[0.32em] text-[var(--vk-text-strong)]",children:"Conductor"})}),(0,t.jsxs)("button",{type:"button",onClick:h,className:"mt-3 inline-flex h-11 w-full items-center justify-center gap-1 rounded-[6px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] sm:h-8","aria-label":"Add workspace",children:[(0,t.jsx)(n.Plus,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:"Add Workspace"})]})]}),(0,t.jsxs)("section",{className:"border-b border-[var(--vk-border)] pb-2 pt-1.5",children:[(0,t.jsx)("div",{className:"flex h-[28px] items-center px-3",children:(0,t.jsx)("p",{className:"text-[11px] uppercase tracking-[0.08em] text-[var(--vk-text-muted)]",children:"Projects"})}),(0,t.jsxs)("div",{className:"max-h-[260px] overflow-y-auto px-2",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>c(null),className:(0,i.cn)("mb-1.5 flex w-full items-center gap-3 rounded-[6px] px-3 py-2.5 text-left text-[14px] leading-[21px]",null===o?"bg-[var(--vk-bg-hover)] text-[var(--vk-text-normal)]":"text-[var(--vk-text-muted)] hover:bg-[var(--vk-bg-hover)]"),children:[(0,t.jsx)("span",{className:"h-2.5 w-2.5 rounded-full bg-[var(--vk-text-muted)]"}),(0,t.jsx)("span",{className:"truncate",children:"All projects"}),(0,t.jsx)("span",{className:"ml-auto text-[11px] text-[var(--vk-text-muted)]",children:e.length})]}),e.map(e=>{let r=o===e.id,s=N.get(e.id)??{total:0,active:0},n=v===e.id;return(0,t.jsxs)("div",{className:(0,i.cn)("group relative mb-1.5 flex items-center rounded-[6px]",r?"bg-[var(--vk-bg-hover)]":"hover:bg-[var(--vk-bg-hover)]"),children:[(0,t.jsxs)("button",{type:"button",onClick:()=>c(e.id),className:(0,i.cn)("flex min-w-0 flex-1 items-center gap-3 px-3 py-2.5 text-left text-[14px] leading-[21px]",r?"text-[var(--vk-text-normal)]":"text-[var(--vk-text-muted)]"),children:[(0,t.jsx)("span",{className:"mt-1 h-2.5 w-2.5 shrink-0 rounded-full bg-[#3c83f6]"}),(0,t.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,t.jsx)("span",{className:"block truncate",children:e.id}),e.description?(0,t.jsx)("span",{className:"block truncate text-[11px] text-[var(--vk-text-muted)]",children:e.description}):null]}),(0,t.jsxs)("span",{className:"shrink-0 text-right",children:[(0,t.jsxs)("span",{className:"block text-[11px] text-[var(--vk-text-normal)]",children:[s.active," active"]}),(0,t.jsxs)("span",{className:"block text-[10px] text-[var(--vk-text-muted)]",children:[s.total," total"]})]})]}),d&&(0,t.jsx)("button",{type:"button",disabled:n,onClick:t=>{t.stopPropagation(),w(null),y(e.id)},className:"mr-2 inline-flex shrink-0 items-center justify-center rounded-[4px] p-1 text-[var(--vk-text-muted)] hover:bg-[var(--vk-red)]/10 hover:text-[var(--vk-red)] disabled:opacity-50","aria-label":`Unlink ${e.id}`,title:"Unlink project",children:(0,t.jsx)(a.X,{className:"h-3.5 w-3.5"})})]},e.id)})]})]}),(0,t.jsx)("section",{className:"flex min-h-0 flex-1 flex-col pt-1.5",children:(0,t.jsx)(b,{sessions:u,selectedId:p,onSelect:m,onArchive:x,onCreateWorkspace:h,showHeader:!1})})]}),S&&"u">typeof document?(0,s.createPortal)((0,t.jsx)("div",{className:"fixed inset-0 z-[80] flex items-center justify-center bg-black/60 px-4",onClick:()=>{v||(y(null),w(null))},children:(0,t.jsxs)("div",{className:"surface-card w-full max-w-md rounded-[var(--radius-lg)] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] shadow-[0_28px_90px_rgba(0,0,0,0.55)]",onClick:e=>e.stopPropagation(),role:"dialog","aria-modal":"true","aria-labelledby":"unlink-project-title",children:[(0,t.jsxs)("div",{className:"border-b border-[var(--vk-border)] px-4 py-3",children:[(0,t.jsx)("h2",{id:"unlink-project-title",className:"text-[17px] font-medium text-[var(--vk-text-strong)]",children:"Unlink Project"}),(0,t.jsxs)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:["Remove ",(0,t.jsx)("span",{className:"font-medium text-[var(--vk-text-normal)]",children:S.id})," from this workspace configuration."]})]}),(0,t.jsxs)("div",{className:"space-y-3 px-4 py-4",children:[(0,t.jsx)("p",{className:"text-[13px] leading-5 text-[var(--vk-text-normal)]",children:"This only removes the project from Conductor. Repository files on disk are not deleted."}),j?(0,t.jsx)("div",{className:"rounded-[var(--radius-md)] border border-[var(--vk-red)]/35 bg-[color:color-mix(in_srgb,var(--vk-red)_12%,transparent)] px-3 py-2 text-[12px] text-[var(--vk-red)]",children:j}):null]}),(0,t.jsxs)("div",{className:"flex items-center justify-end gap-2 border-t border-[var(--vk-border)] px-4 py-3",children:[(0,t.jsx)(g.Button,{type:"button",variant:"ghost",onClick:()=>{y(null),w(null)},disabled:null!==v,children:"Cancel"}),(0,t.jsx)(g.Button,{type:"button",variant:"danger",onClick:()=>void C(),disabled:null!==v,children:v===S.id?"Unlinking...":"Unlink Project"})]})]})}),document.body):null]})});e.s(["WorkspaceSidebarPanel",0,k],45241)},93670,e=>{"use strict";var t=e.i(43476),r=e.i(71645),s=e.i(18566),n=e.i(94102),a=e.i(36832),i=e.i(80235),l=e.i(45241),o=e.i(93289),c=e.i(33489),d=e.i(2004),u=e.i(40142),p=e.i(89965);function m(){let e=(0,s.useParams)(),m=(0,s.useRouter)(),x=(0,s.useSearchParams)(),{projects:h}=(0,d.useConfig)(),{session:v}=(0,u.useSession)(e.id),{mobileSidebarOpen:f,desktopSidebarOpen:b,toggleSidebar:g,closeSidebarOnMobile:k}=(0,n.useResponsiveSidebarStateWithOptions)({initialDesktopOpen:!1}),y=f||b,{sessions:j,refresh:w}=(0,p.useSessions)(void 0,{enabled:y}),[N,S]=(0,r.useState)(null),[C,A]=(0,r.useState)(!1),E=(0,r.useMemo)(()=>{let e=x.get("tab");return"overview"!==e&&"preview"!==e&&"diff"!==e},[x])&&C,M=(0,r.useMemo)(()=>v?[v.projectId,v.branch].filter(Boolean).join(" · "):N||"Session",[v,N]);async function P(t){let r=await fetch(`/api/sessions/${encodeURIComponent(t)}/archive`,{method:"POST"}),s=await r.json().catch(()=>null);if(404===r.status&&(r=await fetch(`/api/sessions/${encodeURIComponent(t)}/actions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"archive"})}),s=await r.json().catch(()=>null)),!r.ok)throw Error(s?.error??`Failed to archive session: ${r.status}`);t===e.id?m.push("/"):await w()}return((0,r.useEffect)(()=>{v?.projectId?S(v.projectId):!N&&h.length>0&&S(h[0]?.id??null)},[v?.projectId,h,N]),(0,r.useEffect)(()=>{let e="function"==typeof window.matchMedia?window.matchMedia("(pointer: coarse)"):null,t=()=>{A((0,c.shouldUseCompactTerminalChrome)())};return t(),window.addEventListener("resize",t),e?.addEventListener?.("change",t),()=>{window.removeEventListener("resize",t),e?.removeEventListener?.("change",t)}},[]),e.id)?(0,t.jsxs)(a.AppShell,{mobileSidebarOpen:f,desktopSidebarOpen:b,onToggleSidebar:g,hideMobileSidebarToggle:E,sidebar:y?(0,t.jsx)(l.WorkspaceSidebarPanel,{projects:h,selectedProjectId:N,onSelectProject:e=>{null===e?m.push("/"):S(e)},sessions:j,selectedSessionId:e.id,onSelectSession:(e,t)=>{let r=new URLSearchParams;t?.tab&&r.set("tab",t.tab);let s=r.toString();m.push(s.length>0?`/sessions/${encodeURIComponent(e)}?${s}`:`/sessions/${encodeURIComponent(e)}`),k()},onArchiveSession:P,onCreateWorkspace:()=>{m.push("/")}}):null,children:[E?null:(0,t.jsx)(i.TopBar,{title:M}),(0,t.jsx)("div",{className:`flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden ${E?"bg-[#060404]":""}`,children:(0,t.jsx)(o.SessionDetail,{sessionId:e.id,initialSession:v,immersiveMobileMode:E,onOpenSidebar:g},e.id)})]}):(0,t.jsx)("div",{className:"flex h-dvh min-h-[100dvh] items-center justify-center",children:(0,t.jsx)("span",{className:"text-[13px] text-[var(--text-muted)]",children:"No session ID provided"})})}e.s(["default",()=>m])},18542,e=>{e.v(t=>Promise.all(["static/chunks/4f9d3a3c14fb43da.js"].map(t=>e.l(t))).then(()=>t(41386)))},140,e=>{e.v(t=>Promise.all(["static/chunks/179d5fdedb569ec3.js","static/chunks/810a3d36795ae9fd.js"].map(t=>e.l(t))).then(()=>t(24420)))},19493,e=>{e.v(t=>Promise.all(["static/chunks/df7d1fd1426fc74f.js","static/chunks/1382eff030c401e3.js"].map(t=>e.l(t))).then(()=>t(3934)))},85119,e=>{e.v(t=>Promise.all(["static/chunks/8a687801de88eaee.js","static/chunks/34500baf24f4b1ba.js"].map(t=>e.l(t))).then(()=>t(59028)))}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,52808,e=>{"use strict";let t=new Set(["archived","done","killed","errored","terminated","merged","cleanup"]);function r(e){return"merged"===e.status||"archived"===e.status||"killed"===e.status||"errored"===e.status||"cleanup"===e.status||"done"===e.status||"terminated"===e.status||e.pr&&("merged"===e.pr.state||"closed"===e.pr.state)?"done":"mergeable"===e.status||"approved"===e.status||e.pr?.mergeability.mergeable?"merge":"waiting_input"===e.activity||"blocked"===e.activity||"needs_input"===e.status||"stuck"===e.status?"respond":"queued"===e.status?"pending":"exited"===e.activity?"respond":"ci_failed"===e.status||"changes_requested"===e.status||e.pr&&("failing"===e.pr.ciStatus||"changes_requested"===e.pr.reviewDecision||!e.pr.mergeability.noConflicts)?"review":"review_pending"===e.status||e.pr&&!e.pr.isDraft&&("pending"===e.pr.reviewDecision||"none"===e.pr.reviewDecision)?"pending":"working"}e.s(["TERMINAL_STATUSES",0,t,"getAttentionLevel",()=>r])},48256,84981,e=>{"use strict";var t=e.i(75254);let r=(0,t.default)("globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);e.s(["Globe",()=>r],48256);let s=(0,t.default)("square-terminal",[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]]);e.s(["default",()=>s],84981)},90993,e=>{"use strict";var t=e.i(43476),r=e.i(18620);let s=(0,e.i(71645).forwardRef)(({className:e,...s},n)=>(0,t.jsx)("div",{ref:n,className:(0,r.cn)("surface-card rounded-[var(--radius-md)] border",e),...s}));function n({className:e,...s}){return(0,t.jsx)("div",{className:(0,r.cn)("flex items-center gap-2 border-b border-[var(--vk-border)] px-3 py-2",e),...s})}function a({className:e,...s}){return(0,t.jsx)("div",{className:(0,r.cn)("px-3 py-2",e),...s})}s.displayName="Card",e.s(["Card",0,s,"CardContent",()=>a,"CardHeader",()=>n])},55716,e=>{"use strict";let t=(0,e.i(75254).default)("git-branch",[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]]);e.s(["GitBranch",()=>t],55716)},27025,e=>{"use strict";let t=(0,e.i(75254).default)("folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);e.s(["Folder",()=>t],27025)},78917,e=>{"use strict";let t=(0,e.i(75254).default)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);e.s(["ExternalLink",()=>t],78917)},90336,e=>{"use strict";var t=e.i(71645);function r(e){return!e||"object"!=typeof e||Array.isArray(e)?{}:{...e}}function s(){let[e,s]=(0,t.useState)(null),[n,a]=(0,t.useState)(!0),[i,l]=(0,t.useState)(null),o=(0,t.useRef)(!1),c=(0,t.useCallback)(async()=>{try{var e;let t,n,a,i=await fetch("/api/preferences"),o=await i.json().catch(()=>null);if(!i.ok)throw Error(o?.error??`Failed to load preferences: ${i.status}`);s((e=o?.preferences,t=r(e),a=(n=r(t.notifications)).soundFile,{onboardingAcknowledged:!0===t.onboardingAcknowledged,codingAgent:"string"==typeof t.codingAgent&&t.codingAgent.trim().length>0?t.codingAgent.trim():"claude-code",ide:"string"==typeof t.ide&&t.ide.trim().length>0?t.ide.trim():"vscode",markdownEditor:"string"==typeof t.markdownEditor&&t.markdownEditor.trim().length>0?t.markdownEditor.trim():"obsidian",markdownEditorPath:"string"==typeof t.markdownEditorPath?t.markdownEditorPath.trim():"",notifications:{soundEnabled:!1!==n.soundEnabled,soundFile:null===a?null:"string"==typeof a&&a.trim().length>0?a.trim():"abstract-sound-4"}})),l(null)}catch(e){s(null),l(e instanceof Error?e.message:"Failed to load preferences")}finally{a(!1)}},[]);return(0,t.useEffect)(()=>{o.current||(o.current=!0,c())},[c]),{preferences:e,loading:n,error:i,refresh:c}}e.s(["usePreferences",()=>s])},16715,e=>{"use strict";let t=(0,e.i(75254).default)("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);e.s(["RefreshCw",()=>t],16715)},64659,e=>{"use strict";let t=(0,e.i(75254).default)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);e.s(["ChevronDown",()=>t],64659)},55436,e=>{"use strict";let t=(0,e.i(75254).default)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);e.s(["Search",()=>t],55436)},63059,e=>{"use strict";let t=(0,e.i(75254).default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);e.s(["ChevronRight",()=>t],63059)},97878,e=>{"use strict";let t=new Set,r=new Set,s=null,n=null,a=null,i=null;function l(){return t.size>0||r.size>0}function o(){return"u"<typeof document||"visible"===document.visibilityState}function c(){s&&(s.close(),s=null)}function d(e){if(Array.isArray(e))return{type:"snapshot",sessions:e};if(!e||"object"!=typeof e)return null;let t=e.type;return"snapshot"!==t&&"snapshot_delta"!==t?null:Array.isArray(e.sessions)?e:null}function u(e){return e&&"object"==typeof e&&"boolean"==typeof e.enabled?e:null}function p(e){for(let r of t)r(e);let s=u(e.appUpdate);if(s)for(let e of r)e(s)}async function m(){if("function"!=typeof fetch)return;let e=(async()=>{try{let e=await fetch("/api/sessions");if(!e.ok)return;let t=await e.json().catch(()=>null),r=d(t);if(!r)return;p(r)}catch{}try{let t=await fetch("/api/app-update");if(!t.ok)return;let s=await t.json().catch(()=>null);var e=u(s);for(let t of r)t(e)}catch{}})();n=e.finally(()=>{n===e&&(n=null)}),await e}function x(){!s&&"u">typeof EventSource&&l()&&o()&&((s=new EventSource("/api/events")).onmessage=e=>{try{let t=d(JSON.parse(e.data));if(!t)return;p(t)}catch{}},s.addEventListener("refresh",()=>{n||m()}),s.onerror=()=>{l()&&o()||c()})}function h(){if(!l()){c(),a&&(window.removeEventListener("focus",a),a=null),i&&(document.removeEventListener("visibilitychange",i),i=null);return}(a||i||(a=()=>{l()&&o()&&(x(),n||m())},i=()=>{l()&&o()?(x(),n||m()):c()},window.addEventListener("focus",a),document.addEventListener("visibilitychange",i)),o())?x():c()}function v(e){return t.add(e),h(),()=>{t.delete(e),h()}}function f(e){return r.add(e),h(),()=>{r.delete(e),h()}}e.s(["subscribeToAppUpdateEvents",()=>f,"subscribeToSnapshotEvents",()=>v])},7233,e=>{"use strict";let t=(0,e.i(75254).default)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);e.s(["Plus",()=>t],7233)},45241,e=>{"use strict";var t=e.i(43476),r=e.i(71645),s=e.i(74080),n=e.i(7233),a=e.i(37727),i=e.i(18620),l=e.i(52808);let o=(0,e.i(75254).default)("archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);var c=e.i(55436),d=e.i(69242);let u=["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"];function p(e){let t=e.metadata.worktree?.trim()??"";return t&&t.replace(/\\/g,"/").replace(/\/+$/,"").includes("/worktrees/")?"worktree":"local"}function m(e){let t=e.branch?.trim();if(t)return t;let r=e.summary?.trim()||e.metadata.summary?.trim();return r||(e.status?.trim()?e.status.replace(/[_-]+/g," "):e.id.slice(0,8))}function x(){let[e,s]=(0,r.useState)(0);return(0,r.useEffect)(()=>{let e=window.setInterval(()=>{s(e=>(e+1)%u.length)},80);return()=>window.clearInterval(e)},[]),(0,t.jsx)("span",{"aria-hidden":"true",className:"inline-block select-none font-mono text-[18px] leading-none text-[var(--vk-text-strong)]",children:u[e]})}function h({running:e}){return e?(0,t.jsx)("span",{className:"mt-0.5 inline-flex h-5 w-5 shrink-0 items-center justify-center",children:(0,t.jsx)(x,{})}):null}function v({additions:e,deletions:r,isSelected:s}){return(0,t.jsx)("span",{className:(0,i.cn)("inline-flex shrink-0 items-center rounded-[10px] px-3 py-1.5 font-mono text-[12px] leading-none tabular-nums",s?"bg-[rgba(255,255,255,0.1)]":"bg-[rgba(255,255,255,0.06)]"),children:(0,t.jsxs)("span",{className:"inline-flex items-center gap-3",children:[(0,t.jsxs)("span",{className:"text-[#18c58f]",children:["+",e]}),(0,t.jsxs)("span",{className:"text-[#f26d6d]",children:["−",r]})]})})}function f(e,t,r){e.stopPropagation(),e.preventDefault(),r(t,{tab:"diff"})}function b({sessions:e,selectedId:s,onSelect:n,onArchive:a,onCreateWorkspace:u,showHeader:x=!0}){let[b,g]=(0,r.useState)(""),[k,y]=(0,r.useState)(null),[j,w]=(0,r.useState)(null),N=(0,r.useMemo)(()=>{let t=e.filter(e=>"archived"!==e.status);if(!b.trim())return t;let r=b.toLowerCase();return t.filter(e=>{let t=e.summary??"",s=e.branch??"",n=e.metadata.agent??"",a=p(e),i=m(e);return e.id.toLowerCase().includes(r)||e.projectId.toLowerCase().includes(r)||t.toLowerCase().includes(r)||s.toLowerCase().includes(r)||n.toLowerCase().includes(r)||a.toLowerCase().includes(r)||i.toLowerCase().includes(r)})},[b,e]),S=async(e,t)=>{if(e.stopPropagation(),e.preventDefault(),a&&k!==t){y(t);try{await a(t)}catch(e){console.error("Failed to archive session",e),w(t),window.setTimeout(()=>w(null),3e3)}finally{y(e=>e===t?null:e)}}},C=(0,r.useMemo)(()=>[...N].sort((e,t)=>new Date(t.lastActivityAt).getTime()-new Date(e.lastActivityAt).getTime()),[N]);return(0,t.jsxs)("div",{className:"flex h-full min-h-0 flex-col",children:[x&&(0,t.jsxs)("div",{className:"flex h-[33px] items-center gap-1 px-2",children:[(0,t.jsx)("p",{className:"text-[16px] text-[var(--vk-text-normal)]",children:"Workspaces"}),u&&(0,t.jsx)("button",{type:"button",onClick:u,className:"ml-auto inline-flex h-5 w-5 items-center justify-center rounded-[3px] text-[var(--vk-orange)] hover:bg-[var(--vk-bg-hover)] lg:hidden","aria-label":"New workspace",children:(0,t.jsx)("span",{className:"text-[14px]",children:"+"})})]}),(0,t.jsx)("div",{className:(0,i.cn)("flex h-[38px] items-center px-2 pb-1.5",!x&&"pt-1.5"),children:(0,t.jsxs)("label",{className:"flex h-[38px] flex-1 items-center rounded-[3px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 sm:h-[30px]",children:[(0,t.jsx)(c.Search,{className:"h-3.5 w-3.5 text-[var(--vk-text-muted)]"}),(0,t.jsx)("input",{value:b,onChange:e=>g(e.target.value),placeholder:"Search...",className:"ml-1.5 w-full bg-transparent text-[14px] text-[var(--vk-text-normal)] outline-none placeholder:text-[var(--vk-text-muted)]"})]})}),(0,t.jsx)("div",{className:"flex-1 overflow-y-auto px-2 pb-2",children:0===C.length?(0,t.jsx)("p",{className:"px-2 py-2 text-[14px] text-[var(--vk-text-muted)]",children:"No sessions"}):(0,t.jsx)("div",{className:"space-y-2",children:C.map(e=>{let r=(0,l.getAttentionLevel)(e),c=function(e){for(let t of[e.metadata.lastStderr,e.metadata.summary,e.summary]){if(!t)continue;let e=t.match(/(\d+)\s+insertions?\(\+\),\s+(\d+)\s+deletions?\(-\)/i);if(!e)continue;let r=Number.parseInt(e[1]??"0",10),s=Number.parseInt(e[2]??"0",10);if(Number.isFinite(r)&&Number.isFinite(s))return{additions:r,deletions:s}}return null}(e),u=function(e,t){let r=`${e.summary??""} ${e.metadata.summary??""}`.toLowerCase();if("killed"===e.status||r.includes("interrupted"))return{label:"Interrupted",className:"text-[var(--vk-orange)]"};switch(t){case"merge":return{label:"Ready",className:"text-[var(--vk-green)]"};case"respond":return{label:"Needs input",className:"text-[var(--vk-red)]"};case"review":return{label:"Review",className:"text-[var(--vk-orange)]"};case"working":return{label:"Running",className:"text-[#4e87f3]"};case"done":return{label:"Done",className:"text-[var(--vk-text-muted)]"};default:return{label:"Queued",className:"text-[var(--vk-text-muted)]"}}}(e,r),x=e.metadata.agent?.trim()||null,b=e.id===s,g="waiting_input"!==e.activity&&"blocked"!==e.activity&&("spawning"===e.status||"working"===e.status),y=k===e.id,w=j===e.id;return(0,t.jsxs)("div",{onClick:()=>n(e.id),onKeyDown:t=>{var r;return r=e.id,void(("Enter"===t.key||" "===t.key)&&(t.preventDefault(),n(r)))},role:"button",tabIndex:0,className:(0,i.cn)("group flex w-full items-start gap-3 rounded-[8px] border px-3 py-3 text-left transition-colors","[content-visibility:auto] [contain-intrinsic-size:92px]",b?"border-[rgba(234,122,42,0.28)] bg-[rgba(255,255,255,0.08)]":"border-[var(--vk-border)] bg-[rgba(255,255,255,0.02)] hover:bg-[var(--vk-bg-hover)]"),children:[(0,t.jsx)(h,{running:g}),(0,t.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("span",{className:"flex min-w-0 items-start gap-2",children:[(0,t.jsxs)("span",{className:"min-w-0 flex flex-1 items-center gap-2",children:[x?(0,t.jsx)("span",{className:"inline-flex h-5 w-5 shrink-0 items-center justify-center",title:x,"aria-label":`${x} agent`,children:(0,t.jsx)(d.AgentTileIcon,{seed:{label:x},className:"h-4 w-4"})}):null,(0,t.jsx)("span",{className:"min-w-0 truncate text-[14px] font-medium text-[var(--vk-text-strong)]",children:p(e)})]}),c?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"hidden shrink-0 sm:block",children:(0,t.jsx)("button",{type:"button",onClick:t=>f(t,e.id,n),onKeyDown:t=>{("Enter"===t.key||" "===t.key)&&f(t,e.id,n)},className:"rounded-[10px] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[var(--vk-orange)]","aria-label":`Open diff for session ${e.id}`,title:"Open diff tab",children:(0,t.jsx)(v,{additions:c.additions,deletions:c.deletions,isSelected:b})})}),(0,t.jsx)("span",{className:"shrink-0 rounded-[8px] bg-[rgba(255,255,255,0.06)] px-2.5 py-1 text-[11px] font-medium sm:hidden",children:(0,t.jsx)("span",{className:u.className,children:u.label})})]}):(0,t.jsx)("span",{className:"shrink-0 rounded-[8px] bg-[rgba(255,255,255,0.06)] px-2.5 py-1 text-[11px] font-medium",children:(0,t.jsx)("span",{className:u.className,children:u.label})})]}),(0,t.jsx)("span",{className:"mt-1 block truncate text-[12px] text-[var(--vk-text-muted)]",children:m(e)})]}),a?(0,t.jsx)("button",{type:"button",onClick:t=>void S(t,e.id),disabled:y,className:(0,i.cn)("mt-0.5 inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-[6px] border border-[var(--vk-border)] text-[var(--vk-text-muted)] transition sm:h-7 sm:w-7","opacity-70 group-hover:opacity-100 focus-visible:opacity-100","hover:border-[var(--vk-border)] hover:bg-[var(--vk-bg-hover)] hover:text-[var(--vk-text-normal)]",y&&"cursor-wait opacity-100"),"aria-label":`Archive session ${e.id}`,title:w?"Archive failed":"Archive session",children:(0,t.jsx)(o,{className:(0,i.cn)("h-3.5 w-3.5",w&&"text-red-400")})}):null]},e.id)})})})]})}var g=e.i(11077);let k=(0,r.memo)(function({projects:e,selectedProjectId:o,onSelectProject:c,onUnlinkProject:d,sessions:u,selectedSessionId:p,onSelectSession:m,onArchiveSession:x,onCreateWorkspace:h}){let[v,f]=(0,r.useState)(null),[k,y]=(0,r.useState)(null),[j,w]=(0,r.useState)(null),N=(0,r.useMemo)(()=>{let e=new Map;for(let t of u){if("archived"===t.status)continue;let r=e.get(t.projectId)??{total:0,active:0};r.total+=1,"done"!==(0,l.getAttentionLevel)(t)&&(r.active+=1),e.set(t.projectId,r)}return e},[u]),S=(0,r.useMemo)(()=>e.find(e=>e.id===k)??null,[k,e]);async function C(){if(d&&k){f(k),w(null);try{await d(k),y(null)}catch(e){w(e instanceof Error?e.message:"Failed to unlink project.")}finally{f(null)}}}return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex h-full min-h-0 w-full flex-col bg-[var(--vk-bg-panel)]",children:[(0,t.jsxs)("section",{className:"border-b border-[var(--vk-border)] px-4 py-4",children:[(0,t.jsx)("div",{className:"flex justify-center text-center",children:(0,t.jsx)("p",{className:"font-brand-header text-[22px] font-bold leading-none uppercase tracking-[0.32em] text-[var(--vk-text-strong)]",children:"Conductor"})}),(0,t.jsxs)("button",{type:"button",onClick:h,className:"mt-3 inline-flex h-11 w-full items-center justify-center gap-1 rounded-[6px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] sm:h-8","aria-label":"Add workspace",children:[(0,t.jsx)(n.Plus,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:"Add Workspace"})]})]}),(0,t.jsxs)("section",{className:"border-b border-[var(--vk-border)] pb-2 pt-1.5",children:[(0,t.jsx)("div",{className:"flex h-[28px] items-center px-3",children:(0,t.jsx)("p",{className:"text-[11px] uppercase tracking-[0.08em] text-[var(--vk-text-muted)]",children:"Projects"})}),(0,t.jsxs)("div",{className:"max-h-[260px] overflow-y-auto px-2",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>c(null),className:(0,i.cn)("mb-1.5 flex w-full items-center gap-3 rounded-[6px] px-3 py-2.5 text-left text-[14px] leading-[21px]",null===o?"bg-[var(--vk-bg-hover)] text-[var(--vk-text-normal)]":"text-[var(--vk-text-muted)] hover:bg-[var(--vk-bg-hover)]"),children:[(0,t.jsx)("span",{className:"h-2.5 w-2.5 rounded-full bg-[var(--vk-text-muted)]"}),(0,t.jsx)("span",{className:"truncate",children:"All projects"}),(0,t.jsx)("span",{className:"ml-auto text-[11px] text-[var(--vk-text-muted)]",children:e.length})]}),e.map(e=>{let r=o===e.id,s=N.get(e.id)??{total:0,active:0},n=v===e.id;return(0,t.jsxs)("div",{className:(0,i.cn)("group relative mb-1.5 flex items-center rounded-[6px]",r?"bg-[var(--vk-bg-hover)]":"hover:bg-[var(--vk-bg-hover)]"),children:[(0,t.jsxs)("button",{type:"button",onClick:()=>c(e.id),className:(0,i.cn)("flex min-w-0 flex-1 items-center gap-3 px-3 py-2.5 text-left text-[14px] leading-[21px]",r?"text-[var(--vk-text-normal)]":"text-[var(--vk-text-muted)]"),children:[(0,t.jsx)("span",{className:"mt-1 h-2.5 w-2.5 shrink-0 rounded-full bg-[#3c83f6]"}),(0,t.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,t.jsx)("span",{className:"block truncate",children:e.id}),e.description?(0,t.jsx)("span",{className:"block truncate text-[11px] text-[var(--vk-text-muted)]",children:e.description}):null]}),(0,t.jsxs)("span",{className:"shrink-0 text-right",children:[(0,t.jsxs)("span",{className:"block text-[11px] text-[var(--vk-text-normal)]",children:[s.active," active"]}),(0,t.jsxs)("span",{className:"block text-[10px] text-[var(--vk-text-muted)]",children:[s.total," total"]})]})]}),d&&(0,t.jsx)("button",{type:"button",disabled:n,onClick:t=>{t.stopPropagation(),w(null),y(e.id)},className:"mr-2 inline-flex shrink-0 items-center justify-center rounded-[4px] p-1 text-[var(--vk-text-muted)] hover:bg-[var(--vk-red)]/10 hover:text-[var(--vk-red)] disabled:opacity-50","aria-label":`Unlink ${e.id}`,title:"Unlink project",children:(0,t.jsx)(a.X,{className:"h-3.5 w-3.5"})})]},e.id)})]})]}),(0,t.jsx)("section",{className:"flex min-h-0 flex-1 flex-col pt-1.5",children:(0,t.jsx)(b,{sessions:u,selectedId:p,onSelect:m,onArchive:x,onCreateWorkspace:h,showHeader:!1})})]}),S&&"u">typeof document?(0,s.createPortal)((0,t.jsx)("div",{className:"fixed inset-0 z-[80] flex items-center justify-center bg-black/60 px-4",onClick:()=>{v||(y(null),w(null))},children:(0,t.jsxs)("div",{className:"surface-card w-full max-w-md rounded-[var(--radius-lg)] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] shadow-[0_28px_90px_rgba(0,0,0,0.55)]",onClick:e=>e.stopPropagation(),role:"dialog","aria-modal":"true","aria-labelledby":"unlink-project-title",children:[(0,t.jsxs)("div",{className:"border-b border-[var(--vk-border)] px-4 py-3",children:[(0,t.jsx)("h2",{id:"unlink-project-title",className:"text-[17px] font-medium text-[var(--vk-text-strong)]",children:"Unlink Project"}),(0,t.jsxs)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:["Remove ",(0,t.jsx)("span",{className:"font-medium text-[var(--vk-text-normal)]",children:S.id})," from this workspace configuration."]})]}),(0,t.jsxs)("div",{className:"space-y-3 px-4 py-4",children:[(0,t.jsx)("p",{className:"text-[13px] leading-5 text-[var(--vk-text-normal)]",children:"This only removes the project from Conductor. Repository files on disk are not deleted."}),j?(0,t.jsx)("div",{className:"rounded-[var(--radius-md)] border border-[var(--vk-red)]/35 bg-[color:color-mix(in_srgb,var(--vk-red)_12%,transparent)] px-3 py-2 text-[12px] text-[var(--vk-red)]",children:j}):null]}),(0,t.jsxs)("div",{className:"flex items-center justify-end gap-2 border-t border-[var(--vk-border)] px-4 py-3",children:[(0,t.jsx)(g.Button,{type:"button",variant:"ghost",onClick:()=>{y(null),w(null)},disabled:null!==v,children:"Cancel"}),(0,t.jsx)(g.Button,{type:"button",variant:"danger",onClick:()=>void C(),disabled:null!==v,children:v===S.id?"Unlinking...":"Unlink Project"})]})]})}),document.body):null]})});e.s(["WorkspaceSidebarPanel",0,k],45241)},93670,e=>{"use strict";var t=e.i(43476),r=e.i(71645),s=e.i(18566),n=e.i(94102),a=e.i(36832),i=e.i(80235),l=e.i(45241),o=e.i(93289),c=e.i(33489),d=e.i(2004),u=e.i(40142),p=e.i(89965);function m(){let e=(0,s.useParams)(),m=(0,s.useRouter)(),x=(0,s.useSearchParams)(),{projects:h}=(0,d.useConfig)(),{session:v}=(0,u.useSession)(e.id),{mobileSidebarOpen:f,desktopSidebarOpen:b,toggleSidebar:g,closeSidebarOnMobile:k}=(0,n.useResponsiveSidebarStateWithOptions)({initialDesktopOpen:!1}),y=f||b,{sessions:j,refresh:w}=(0,p.useSessions)(void 0,{enabled:y}),[N,S]=(0,r.useState)(null),[C,A]=(0,r.useState)(!1),E=(0,r.useMemo)(()=>{let e=x.get("tab");return"overview"!==e&&"preview"!==e&&"diff"!==e},[x])&&C,M=(0,r.useMemo)(()=>v?[v.projectId,v.branch].filter(Boolean).join(" · "):N||"Session",[v,N]);async function P(t){let r=await fetch(`/api/sessions/${encodeURIComponent(t)}/archive`,{method:"POST"}),s=await r.json().catch(()=>null);if(404===r.status&&(r=await fetch(`/api/sessions/${encodeURIComponent(t)}/actions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"archive"})}),s=await r.json().catch(()=>null)),!r.ok)throw Error(s?.error??`Failed to archive session: ${r.status}`);t===e.id?m.push("/"):await w()}return((0,r.useEffect)(()=>{v?.projectId?S(v.projectId):!N&&h.length>0&&S(h[0]?.id??null)},[v?.projectId,h,N]),(0,r.useEffect)(()=>{let e="function"==typeof window.matchMedia?window.matchMedia("(pointer: coarse)"):null,t=()=>{A((0,c.shouldUseCompactTerminalChrome)())};return t(),window.addEventListener("resize",t),e?.addEventListener?.("change",t),()=>{window.removeEventListener("resize",t),e?.removeEventListener?.("change",t)}},[]),e.id)?(0,t.jsxs)(a.AppShell,{mobileSidebarOpen:f,desktopSidebarOpen:b,onToggleSidebar:g,hideMobileSidebarToggle:E,sidebar:y?(0,t.jsx)(l.WorkspaceSidebarPanel,{projects:h,selectedProjectId:N,onSelectProject:e=>{null===e?m.push("/"):S(e)},sessions:j,selectedSessionId:e.id,onSelectSession:(e,t)=>{let r=new URLSearchParams;t?.tab&&r.set("tab",t.tab);let s=r.toString();m.push(s.length>0?`/sessions/${encodeURIComponent(e)}?${s}`:`/sessions/${encodeURIComponent(e)}`),k()},onArchiveSession:P,onCreateWorkspace:()=>{m.push("/")}}):null,children:[E?null:(0,t.jsx)(i.TopBar,{title:M}),(0,t.jsx)("div",{className:`flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden ${E?"bg-[#060404]":""}`,children:(0,t.jsx)(o.SessionDetail,{sessionId:e.id,initialSession:v,immersiveMobileMode:E,onOpenSidebar:g},e.id)})]}):(0,t.jsx)("div",{className:"flex h-dvh min-h-[100dvh] items-center justify-center",children:(0,t.jsx)("span",{className:"text-[13px] text-[var(--text-muted)]",children:"No session ID provided"})})}e.s(["default",()=>m])},18542,e=>{e.v(t=>Promise.all(["static/chunks/4f9d3a3c14fb43da.js"].map(t=>e.l(t))).then(()=>t(41386)))},140,e=>{e.v(t=>Promise.all(["static/chunks/995113d11fe53a63.js","static/chunks/df2796ef26c6da4f.js"].map(t=>e.l(t))).then(()=>t(24420)))},19493,e=>{e.v(t=>Promise.all(["static/chunks/df7d1fd1426fc74f.js","static/chunks/1382eff030c401e3.js"].map(t=>e.l(t))).then(()=>t(3934)))},85119,e=>{e.v(t=>Promise.all(["static/chunks/8a687801de88eaee.js","static/chunks/34500baf24f4b1ba.js"].map(t=>e.l(t))).then(()=>t(59028)))}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,96755,e=>{"use strict";var l=e.i(95187);let t=(0,l.createServerReference)("00c6c838084145ec96d8683a4e4a2f6947eb105624",l.callServer,void 0,l.findSourceMapURL,"createOrReadKeylessAction");e.s(["createOrReadKeylessAction",()=>t])},37572,e=>{"use strict";var l=e.i(18566),t=e.i(71645),s=e.i(96755);let a=e=>{var a;let{children:i}=e,r=(null==(a=(0,l.useSelectedLayoutSegments)()[0])?void 0:a.startsWith("/_not-found"))||!1,[n,c]=t.default.useActionState(s.createOrReadKeylessAction,null);return((0,t.useEffect)(()=>{r||t.default.startTransition(()=>{c()})},[r]),t.default.isValidElement(i))?t.default.cloneElement(i,{key:null==n?void 0:n.publishableKey,publishableKey:null==n?void 0:n.publishableKey,__internal_keyless_claimKeylessApplicationUrl:null==n?void 0:n.claimUrl,__internal_keyless_copyInstanceKeysUrl:null==n?void 0:n.apiKeysUrl,__internal_bypassMissingPublishableKey:!0}):i};e.s(["KeylessCreatorOrReader",()=>a])}]);
|