@mirrowel/opencode-subagent-explorer 0.1.0-dev.1

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.
@@ -0,0 +1,67 @@
1
+ /** @jsxImportSource @opentui/solid */
2
+ /**
3
+ * Subagent Explorer wizard library.
4
+ *
5
+ * The whole explorer TUI: session tree browser, detail view, deletion flows
6
+ * and idle cleanup, for the current session's subagent tree (nested children
7
+ * included, hidden/background agents flagged).
8
+ *
9
+ * The thin plugin entry lives in tui.tsx; embedding hosts (Config Studio)
10
+ * import mainMenu from here and drive it with their own TuiHostApi instance.
11
+ */
12
+ import type { TuiHostApi as TuiPluginApi } from "./tui-host.js";
13
+ import { type SessionLite, type SessionTreeNode } from "./sessions.js";
14
+ export type ExplorerRow = {
15
+ session: SessionLite;
16
+ depth: number;
17
+ running: boolean;
18
+ hidden: boolean;
19
+ };
20
+ export type ExplorerData = {
21
+ sessions: SessionLite[];
22
+ activeIDs: Set<string> | undefined;
23
+ activeKnown: boolean;
24
+ hidden: Set<string>;
25
+ configAgents: Set<string>;
26
+ };
27
+ export type TreeAction = {
28
+ type: "delete";
29
+ row: ExplorerRow;
30
+ } | {
31
+ type: "details";
32
+ row: ExplorerRow;
33
+ } | {
34
+ type: "cleanup";
35
+ } | {
36
+ type: "refresh";
37
+ } | {
38
+ type: "switch-root";
39
+ } | {
40
+ type: "size";
41
+ } | {
42
+ type: "exit";
43
+ };
44
+ export declare function loadExplorerData(api: TuiPluginApi, directory: string): Promise<ExplorerData | undefined>;
45
+ export declare function explorerRows(tree: SessionTreeNode[], data: ExplorerData): ExplorerRow[];
46
+ /**
47
+ * Pure dialog-height budget (same math as Config Studio's computeDialogRows):
48
+ * OpenCode's dialog backdrop anchors at terminalHeight / 4, so a panel
49
+ * taller than 75% of the terminal overflows the bottom edge. The percent
50
+ * drives the request; the backdrop budget caps it.
51
+ */
52
+ export declare function computeDialogRows(percent: number, terminalHeight: number, chromeRows: number, minRows: number): {
53
+ availableRows: number;
54
+ targetRows: number;
55
+ };
56
+ export declare function rowTitle(row: ExplorerRow): string;
57
+ export declare function SubagentTreeDialog(props: {
58
+ api: TuiPluginApi;
59
+ rows: ExplorerRow[];
60
+ rootTitle: string;
61
+ rootID: string;
62
+ activeKnown: boolean;
63
+ idleCount: number;
64
+ onDone: (value: TreeAction | undefined) => void;
65
+ }): import("solid-js").JSX.Element;
66
+ /** The explorer entry point: runs the tree browser loop until the user exits. */
67
+ export declare function mainMenu(api: TuiPluginApi): Promise<void>;