@qilin-agent/client-ui-workspace 0.0.0-stage → 3.1.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/LICENSE +21 -0
- package/README.i18n.yaml +67 -0
- package/README.md +134 -2
- package/README.zh.md +135 -0
- package/lib/client.js +3698 -0
- package/lib/index.js +11 -0
- package/lib/types/client/AgentPresetChip.d.ts +10 -0
- package/lib/types/client/WorkbenchSwitchSeat.d.ts +15 -0
- package/lib/types/client/WorkspacePicker.d.ts +57 -0
- package/lib/types/client/contract/slots.d.ts +269 -0
- package/lib/types/client/index.d.ts +49 -0
- package/lib/types/client/locales.d.ts +170 -0
- package/lib/types/client/navigation.d.ts +193 -0
- package/lib/types/client/pin-order.d.ts +26 -0
- package/lib/types/client/rows/Rows.d.ts +116 -0
- package/lib/types/client/rows/WorkbenchSwitch.d.ts +29 -0
- package/lib/types/client/rows/WorkspaceBrowser.d.ts +8 -0
- package/lib/types/client/shortcuts.d.ts +39 -0
- package/lib/types/client/stores.d.ts +54 -0
- package/lib/types/client/subagent-lineage.d.ts +21 -0
- package/lib/types/client/tree.d.ts +187 -0
- package/lib/types/index.d.ts +9 -0
- package/package.json +87 -3
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
/** Workspace archive and directory UI capability. */
|
|
2
|
+
import { Service, type Context } from '@qilin-agent/kylin';
|
|
3
|
+
import type { ClientRemote, DirectoryListing, RemoteFailure, RemoteResult } from '@qilin-agent/api-remotes/client';
|
|
4
|
+
import type { ISessions, SessionTarget } from '@qilin-agent/api-session-controller/client';
|
|
5
|
+
import { type ObservableSnapshot } from '@qilin-agent/client-store';
|
|
6
|
+
import type { SubagentAddress } from '@qilin-agent/subagent/client';
|
|
7
|
+
import type { IWorkspaces, WorkspaceId } from '@qilin-agent/api-workspace-controller/client';
|
|
8
|
+
import type { SessionId } from '@qilin-agent/session/types';
|
|
9
|
+
import type { Workbench } from '@qilin-agent/client-ui-workbench/client';
|
|
10
|
+
import type { WorkspaceViewStoreActions } from './stores.ts';
|
|
11
|
+
/** The main-pane selection a navigation action publishes: one Session, or one direct-parent subagent address. */
|
|
12
|
+
export interface MainSelection {
|
|
13
|
+
readonly sessionId?: SessionId;
|
|
14
|
+
readonly subagentAddress?: SubagentAddress;
|
|
15
|
+
}
|
|
16
|
+
/** Workspace archive and directory operations consumed by Client UI domains. */
|
|
17
|
+
export interface UiWorkspace {
|
|
18
|
+
/**
|
|
19
|
+
* The persisted main-pane selection. The Session Controller owns the catalog and
|
|
20
|
+
* leaves view selection to navigation, so surfaces that need "the Session the
|
|
21
|
+
* shell is showing" read it here.
|
|
22
|
+
*/
|
|
23
|
+
readonly selection: ObservableSnapshot<MainSelection>;
|
|
24
|
+
/**
|
|
25
|
+
* Select a Session and show its Conversation as one UI navigation action.
|
|
26
|
+
* @param target - known Session identity or durable direct-parent subagent address to display.
|
|
27
|
+
*/
|
|
28
|
+
openSession(target: SessionTarget): void;
|
|
29
|
+
/**
|
|
30
|
+
* Connect a Workspace and open its Session unless a later navigation supersedes it.
|
|
31
|
+
* @param workspaceId - target Workspace.
|
|
32
|
+
* @param beforeOpen - optional synchronous preparation for the selected Session,
|
|
33
|
+
* skipped after supersession; a throw aborts the open and releases the retained reference.
|
|
34
|
+
* @returns completion; a superseded request may create a Session but does not open it.
|
|
35
|
+
*/
|
|
36
|
+
openWorkspace(workspaceId: WorkspaceId, beforeOpen?: (sessionId: SessionId) => void): Promise<void>;
|
|
37
|
+
/**
|
|
38
|
+
* Fork a Session and open the child unless a later navigation supersedes it.
|
|
39
|
+
* @param sessionId - source Session.
|
|
40
|
+
* @returns completion; a superseded request leaves its child available without selecting it.
|
|
41
|
+
*/
|
|
42
|
+
forkSession(sessionId: SessionId): Promise<void>;
|
|
43
|
+
/**
|
|
44
|
+
* Resolve the reusable or newly created blank Session for a Workspace.
|
|
45
|
+
* @param workspaceId - target Workspace.
|
|
46
|
+
* @returns a Session already addressable through the Session Controller.
|
|
47
|
+
*/
|
|
48
|
+
connectWorkspace(workspaceId: WorkspaceId): Promise<SessionId>;
|
|
49
|
+
/**
|
|
50
|
+
* Start a New Session flow and navigate to its Session.
|
|
51
|
+
* @param workspaceId - explicit target; absent inherits the current or most recent Workspace.
|
|
52
|
+
*/
|
|
53
|
+
startSession(workspaceId?: WorkspaceId): void;
|
|
54
|
+
/**
|
|
55
|
+
* Switch the current blank Session to an explicitly picked new-task preset
|
|
56
|
+
* (the hero chip's per-tag choice; the next new task already names it at
|
|
57
|
+
* create). A started or absent Session keeps its composition.
|
|
58
|
+
* @param presetId - the picked preset id.
|
|
59
|
+
*/
|
|
60
|
+
adoptBlankSessionPreset(presetId: string): void;
|
|
61
|
+
/**
|
|
62
|
+
* Archive a Session and clear it when it is the current selection.
|
|
63
|
+
* @param sessionId - Session to archive.
|
|
64
|
+
*/
|
|
65
|
+
archiveSession(sessionId: SessionId): Promise<void>;
|
|
66
|
+
/**
|
|
67
|
+
* Unarchive a Session, restoring it to its recorded Workspace position.
|
|
68
|
+
* @param sessionId - Session to unarchive.
|
|
69
|
+
*/
|
|
70
|
+
unarchiveSession(sessionId: SessionId): Promise<void>;
|
|
71
|
+
/**
|
|
72
|
+
* Pin a Session on the Host and front its saved position in every account that owns it.
|
|
73
|
+
* @param sessionId - Session to pin.
|
|
74
|
+
*/
|
|
75
|
+
pinSession(sessionId: SessionId): Promise<void>;
|
|
76
|
+
/**
|
|
77
|
+
* Unpin a Session on the Host; saved positions stay as they are.
|
|
78
|
+
* @param sessionId - Session to unpin.
|
|
79
|
+
*/
|
|
80
|
+
unpinSession(sessionId: SessionId): Promise<void>;
|
|
81
|
+
/**
|
|
82
|
+
* Open the Host-native directory picker.
|
|
83
|
+
* @returns the selected directory, or null when cancelled.
|
|
84
|
+
*/
|
|
85
|
+
pickDirectory(): Promise<string | null>;
|
|
86
|
+
/**
|
|
87
|
+
* List one Host directory level.
|
|
88
|
+
* @param path - directory path; absent selects the Host home.
|
|
89
|
+
* @param signal - cancellation for a superseded scan.
|
|
90
|
+
* @returns directory entries and breadcrumb ancestry.
|
|
91
|
+
*/
|
|
92
|
+
listDirectory(path?: string, signal?: AbortSignal): Promise<DirectoryListing>;
|
|
93
|
+
/**
|
|
94
|
+
* Create a child directory.
|
|
95
|
+
* @param path - existing parent directory.
|
|
96
|
+
* @param name - child directory name.
|
|
97
|
+
* @returns created absolute path.
|
|
98
|
+
*/
|
|
99
|
+
createDirectory(path: string, name: string): Promise<string>;
|
|
100
|
+
}
|
|
101
|
+
declare module '@qilin-agent/kylin' {
|
|
102
|
+
interface Context {
|
|
103
|
+
/** Cross-Controller Workspace navigation and directory UI capability. */
|
|
104
|
+
uiWorkspace: UiWorkspace;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
/** Structured directory failure exposed to directory UI consumers. */
|
|
108
|
+
export declare class DirectoryBrowseError extends Error {
|
|
109
|
+
readonly rpcError: RemoteFailure;
|
|
110
|
+
readonly name = "DirectoryBrowseError";
|
|
111
|
+
/** @param rpcError - Host directory business failure. */
|
|
112
|
+
constructor(rpcError: RemoteFailure);
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* The preset-switch caller the browsing region consumes: the one Remote method
|
|
116
|
+
* the blank-session tag rebind needs, stated structurally so consumers pass the
|
|
117
|
+
* live namespace or a test double without a cast.
|
|
118
|
+
*/
|
|
119
|
+
export interface AgentPresetSwitcher {
|
|
120
|
+
/**
|
|
121
|
+
* Switch one blank session's agent composition to a preset.
|
|
122
|
+
* @param id - the blank session to recompose.
|
|
123
|
+
* @param agentPreset - the preset id to compose from.
|
|
124
|
+
* @returns the recorded preset id, or a failure (`agent-preset/locked` once
|
|
125
|
+
* the session has started).
|
|
126
|
+
*/
|
|
127
|
+
select(id: SessionId, agentPreset: string): Promise<RemoteResult<string>>;
|
|
128
|
+
}
|
|
129
|
+
/** Implements Workspace archive and directory UI operations. */
|
|
130
|
+
declare class UiWorkspaceService extends Service implements UiWorkspace {
|
|
131
|
+
private readonly directoryPicker;
|
|
132
|
+
private readonly agentPresets;
|
|
133
|
+
private readonly workbench;
|
|
134
|
+
private readonly workspaces;
|
|
135
|
+
private readonly sessions;
|
|
136
|
+
private readonly view;
|
|
137
|
+
private readonly connecting;
|
|
138
|
+
private readonly lifetime;
|
|
139
|
+
/**
|
|
140
|
+
* The persisted main-pane selection. Published as the `mainSelection` root
|
|
141
|
+
* standard source, because the Session Controller owns the catalog and leaves
|
|
142
|
+
* view selection to navigation.
|
|
143
|
+
*/
|
|
144
|
+
readonly selection: import("@qilin-agent/client-store").SnapshotStore<MainSelection>;
|
|
145
|
+
private mainReference;
|
|
146
|
+
/**
|
|
147
|
+
* @param ctx - Client root Context.
|
|
148
|
+
* @param directoryPicker - the directory-picking Remote namespace.
|
|
149
|
+
* @param agentPresets - the preset-switch caller, for the blank-session
|
|
150
|
+
* tag rebind (D3: a blank session may switch presets; a started one may not).
|
|
151
|
+
* @param workbench - the tag state owner, supplying each new task's preset
|
|
152
|
+
* and the visibility fold the reuse rule checks.
|
|
153
|
+
* @param workspaces - pure Workspace Controller.
|
|
154
|
+
* @param sessions - pure Session Controller.
|
|
155
|
+
* @param view - the browser's viewing-store write set, which owns saved Session order.
|
|
156
|
+
*/
|
|
157
|
+
constructor(ctx: Context, directoryPicker: ClientRemote['directoryPicker'], agentPresets: AgentPresetSwitcher, workbench: Workbench, workspaces: IWorkspaces, sessions: ISessions, view: Pick<WorkspaceViewStoreActions, 'pinSessionOrder'>);
|
|
158
|
+
connectWorkspace(workspaceId: WorkspaceId): Promise<SessionId>;
|
|
159
|
+
/**
|
|
160
|
+
* Rebind every blank session of the current Workspace to the now-active
|
|
161
|
+
* tag's preset. Blank sessions carried over from the other tag would
|
|
162
|
+
* otherwise sit hidden in this tag's filtered list; a non-blank session
|
|
163
|
+
* stays exactly as it is (the Host refuses non-blank switches anyway).
|
|
164
|
+
*/
|
|
165
|
+
rebindBlanksAfterTagSwitch(): void;
|
|
166
|
+
/**
|
|
167
|
+
* Switch one blank session to the active tag's preset when the preset it
|
|
168
|
+
* was created under does not show under this tag. Fire-and-forget: the
|
|
169
|
+
* session stays usable either way, and a `locked` verdict means it engaged
|
|
170
|
+
* mid-rebind, so its own preset stands.
|
|
171
|
+
* @param id - the blank session to align.
|
|
172
|
+
*/
|
|
173
|
+
private rebindBlankToActiveTag;
|
|
174
|
+
adoptBlankSessionPreset(presetId: string): void;
|
|
175
|
+
openSession(target: SessionTarget): void;
|
|
176
|
+
openWorkspace(workspaceId: WorkspaceId, beforeOpen?: (sessionId: SessionId) => void): Promise<void>;
|
|
177
|
+
forkSession(sessionId: SessionId): Promise<void>;
|
|
178
|
+
startSession(workspaceId?: WorkspaceId): void;
|
|
179
|
+
archiveSession(sessionId: SessionId): Promise<void>;
|
|
180
|
+
unarchiveSession(sessionId: SessionId): Promise<void>;
|
|
181
|
+
pinSession(sessionId: SessionId): Promise<void>;
|
|
182
|
+
unpinSession(sessionId: SessionId): Promise<void>;
|
|
183
|
+
pickDirectory(): Promise<string | null>;
|
|
184
|
+
listDirectory(path?: string, signal?: AbortSignal): Promise<DirectoryListing>;
|
|
185
|
+
createDirectory(path: string, name: string): Promise<string>;
|
|
186
|
+
private watchNavigation;
|
|
187
|
+
/** @returns true when an archived current selection was cleared. */
|
|
188
|
+
private clearArchivedCurrent;
|
|
189
|
+
private clearMain;
|
|
190
|
+
private replaceMain;
|
|
191
|
+
}
|
|
192
|
+
export { UiWorkspaceService };
|
|
193
|
+
//# sourceMappingURL=navigation.d.ts.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The account memberships a pin order write reconciles against, derived from
|
|
3
|
+
* the same Host snapshots the browser orders by, so the UiWorkspace service
|
|
4
|
+
* completes the write without the browser in the loop.
|
|
5
|
+
*/
|
|
6
|
+
import type { SessionListState } from '@qilin-agent/api-session-controller/client';
|
|
7
|
+
import type { WorkspaceView } from '@qilin-agent/api-workspace-controller/client';
|
|
8
|
+
import type { SessionId } from '@qilin-agent/session/types';
|
|
9
|
+
/**
|
|
10
|
+
* Every account's complete membership: each Workspace, Ungrouped, and the flat list.
|
|
11
|
+
* @param workspaces - current Host Workspaces.
|
|
12
|
+
* @param list - current Session list snapshot.
|
|
13
|
+
* @returns membership per account key plus the summaries a reconciliation orders by.
|
|
14
|
+
*/
|
|
15
|
+
export declare function pinOrderSource(workspaces: readonly WorkspaceView[], list: SessionListState): {
|
|
16
|
+
members: Readonly<Record<string, readonly SessionId[]>>;
|
|
17
|
+
summaries: SessionListState['byId'];
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* The accounts a pinned Session leads: its group (or Ungrouped) and the flat list.
|
|
21
|
+
* @param workspaces - current Host Workspaces.
|
|
22
|
+
* @param sessionId - the Session being pinned.
|
|
23
|
+
* @returns the account keys a pin write fronts.
|
|
24
|
+
*/
|
|
25
|
+
export declare function pinOrderAccounts(workspaces: readonly WorkspaceView[], sessionId: SessionId): readonly string[];
|
|
26
|
+
//# sourceMappingURL=pin-order.d.ts.map
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import type { PropsRenderSlots } from '@qilin-agent/client-ui-slots';
|
|
2
|
+
import type { WorkspaceBrowserProps } from '../contract/slots.ts';
|
|
3
|
+
import type { GroupNode, SearchResultNode, SessionNode } from '../tree.ts';
|
|
4
|
+
/** The standard locale seat, prop-passed from the browser root. */
|
|
5
|
+
type RowTranslate = WorkspaceBrowserProps['t'];
|
|
6
|
+
/**
|
|
7
|
+
* Row drag wiring supplied by the tree owner. `drop` reports the half of the
|
|
8
|
+
* row where the pointer released so the owner can resolve an insert anchor.
|
|
9
|
+
*/
|
|
10
|
+
export interface RowDragProps {
|
|
11
|
+
/** Start dragging this row. */
|
|
12
|
+
start: () => void;
|
|
13
|
+
/** A compatible row drag is in flight. */
|
|
14
|
+
active: boolean;
|
|
15
|
+
/** Current marker on this row: insert line above, below, or none. */
|
|
16
|
+
marker: 'before' | 'after' | null;
|
|
17
|
+
/** Report the hovered half while a compatible drag passes over this row. */
|
|
18
|
+
hover: (half: 'before' | 'after') => void;
|
|
19
|
+
drop: (half: 'before' | 'after') => void;
|
|
20
|
+
end: () => void;
|
|
21
|
+
}
|
|
22
|
+
/** Drag lifecycle owned by a workspace row; its enclosing group owns hit testing. */
|
|
23
|
+
interface WorkspaceRowDragProps {
|
|
24
|
+
start: () => void;
|
|
25
|
+
end: () => void;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Project (workspace) header row: folder + title;
|
|
29
|
+
* hover reveals the chevron and create button, and dwelling on a real
|
|
30
|
+
* Workspace shows its hover card (the ungrouped bucket has none).
|
|
31
|
+
* `containsCurrent` arrives on the node (derivation fact, no renderer scan).
|
|
32
|
+
* @param props.group - derived group node.
|
|
33
|
+
* @param props.containsCurrentDescendant - highlight an ancestor even when its subtree is collapsed.
|
|
34
|
+
* @param props.onToggle - expand/collapse the group.
|
|
35
|
+
* @param props.onCreate - start a frontend Session inside this Workspace.
|
|
36
|
+
* @param props.drag - optional workspace-row drag wiring.
|
|
37
|
+
* @param props.home - host account home for POSIX hover-path abbreviation.
|
|
38
|
+
* @param props.t - the browser root's locale seat.
|
|
39
|
+
* @returns the row element.
|
|
40
|
+
*/
|
|
41
|
+
export declare function ProjectRowItem({ group, containsCurrentDescendant, onToggle, onCreate, actions, drag, home, t }: {
|
|
42
|
+
group: GroupNode;
|
|
43
|
+
containsCurrentDescendant?: boolean;
|
|
44
|
+
onToggle: () => void;
|
|
45
|
+
onCreate: () => void;
|
|
46
|
+
/** Real-Workspace actions; absent for the ungrouped bucket (no menu shown). */
|
|
47
|
+
actions?: {
|
|
48
|
+
rename: () => void;
|
|
49
|
+
delete: () => void;
|
|
50
|
+
} | undefined;
|
|
51
|
+
/** Present only for real Workspace rows in the grouped view. */
|
|
52
|
+
drag?: WorkspaceRowDragProps | undefined;
|
|
53
|
+
/** Host account home; POSIX home-rooted hover paths display as `~`. */
|
|
54
|
+
home?: string | undefined;
|
|
55
|
+
t: RowTranslate;
|
|
56
|
+
}): import("react").JSX.Element;
|
|
57
|
+
/** Child seats a Session row renders: its leading decoration and hover-card section. */
|
|
58
|
+
type SessionRowRenderSlots = PropsRenderSlots<'sidebar.session.row.leading' | 'sidebar.session.row.hover'>['renderSlot'];
|
|
59
|
+
/**
|
|
60
|
+
* One flat search result: title, Workspace context, and optional content
|
|
61
|
+
* excerpt. Search navigation opens the session only; it does not address an
|
|
62
|
+
* event inside the conversation.
|
|
63
|
+
* @param props.result - merged local/content search row.
|
|
64
|
+
* @param props.currentId - selected session id.
|
|
65
|
+
* @param props.onOpen - open the selected session.
|
|
66
|
+
* @param props.t - Workspace-browser translation seat.
|
|
67
|
+
* @returns the result button.
|
|
68
|
+
*/
|
|
69
|
+
export declare function SearchResultItem({ result, currentId, onOpen, t }: {
|
|
70
|
+
result: SearchResultNode;
|
|
71
|
+
currentId: string | undefined;
|
|
72
|
+
onOpen: (id: SearchResultNode['id']) => void;
|
|
73
|
+
t: RowTranslate;
|
|
74
|
+
}): import("react").JSX.Element;
|
|
75
|
+
/**
|
|
76
|
+
* One top-level 34px session row: status dot (pending user interaction outranks
|
|
77
|
+
* own or descendant activity), title, relative time, and the row actions menu.
|
|
78
|
+
* @param props.node - derived session node.
|
|
79
|
+
* @param props.currentId - selected session id (row highlight).
|
|
80
|
+
* @param props.now - epoch ms for relative-time formatting.
|
|
81
|
+
* @param props.onOpen - open a session by id.
|
|
82
|
+
* @param props.onRename - open the session rename dialog (id + current title).
|
|
83
|
+
* @param props.onFork - fork a session at its last completed turn.
|
|
84
|
+
* @param props.onArchive - archive a session by id.
|
|
85
|
+
* @param props.onPin - pin a session by id (leading its group and the flat list).
|
|
86
|
+
* @param props.onUnpin - drop a session's pin.
|
|
87
|
+
* @param props.onReveal - scroll this row into view after search navigation, then acknowledge it.
|
|
88
|
+
* @param props.drag - optional row-drag target wiring; blank rows cannot start a drag.
|
|
89
|
+
* @param props.t - the browser root's locale seat.
|
|
90
|
+
* @returns the session row.
|
|
91
|
+
*/
|
|
92
|
+
export declare function SessionNodeItem({ node, currentId, now, onOpen, onRename, onFork, onArchive, onPin, onUnpin, onReveal, drag, renderSlot, t, }: {
|
|
93
|
+
node: SessionNode;
|
|
94
|
+
currentId: string | undefined;
|
|
95
|
+
now: number;
|
|
96
|
+
onOpen: (id: SessionNode['id']) => void;
|
|
97
|
+
/** Open the browser-owned session rename dialog (row menu action). */
|
|
98
|
+
onRename: (id: SessionNode['id'], currentTitle: string) => void;
|
|
99
|
+
/** Fork a session at its last completed turn (row menu action). */
|
|
100
|
+
onFork: (id: SessionNode['id']) => void;
|
|
101
|
+
/** Archive this session (row menu action; commits without a dialog). */
|
|
102
|
+
onArchive: (id: SessionNode['id']) => void;
|
|
103
|
+
/** Pin this session ahead of unpinned rows (row menu and hover action). */
|
|
104
|
+
onPin: (id: SessionNode['id']) => void;
|
|
105
|
+
/** Drop this session's pin (row menu and hover action). */
|
|
106
|
+
onUnpin: (id: SessionNode['id']) => void;
|
|
107
|
+
/** Scroll this row into view after search navigation, then acknowledge it. */
|
|
108
|
+
onReveal?: (() => void) | undefined;
|
|
109
|
+
/** Present on reorderable-list rows so every row can remain a drop target. */
|
|
110
|
+
drag?: RowDragProps | undefined;
|
|
111
|
+
/** Child-seat renderer for the row's leading decoration and hover-card section. */
|
|
112
|
+
renderSlot: SessionRowRenderSlots;
|
|
113
|
+
t: RowTranslate;
|
|
114
|
+
}): import("react").JSX.Element;
|
|
115
|
+
export {};
|
|
116
|
+
//# sourceMappingURL=Rows.d.ts.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The dual-workbench switch: the active tag renders as an outlined pill with
|
|
3
|
+
* icon and label, the inactive tag collapses to an icon-only button. Visual
|
|
4
|
+
* order is constant (coding left, general right); the pill and icon roles
|
|
5
|
+
* swap with the active tag.
|
|
6
|
+
*/
|
|
7
|
+
import type { ReactNode } from 'react';
|
|
8
|
+
import type { WorkbenchTag } from '@qilin-agent/client-ui-workbench/client';
|
|
9
|
+
/**
|
|
10
|
+
* Render the two-tag switch. Both tags stay mounted and reachable — only the
|
|
11
|
+
* label of the inactive one is hidden — so the tab semantics of the previous
|
|
12
|
+
* segmented control carry over: roving tab stop on the selected tag,
|
|
13
|
+
* Left/Right to move selection.
|
|
14
|
+
* @param props.value - the active tag.
|
|
15
|
+
* @param props.onChange - selection requested by click or Left/Right.
|
|
16
|
+
* @param props.labels - localized tag names, keyed by tag; the inactive
|
|
17
|
+
* button's accessible name (its label is hidden).
|
|
18
|
+
* @param props.ariaLabel - localized accessible name for the tab list.
|
|
19
|
+
* @param props.panelId - DOM id of the panel the tabs control.
|
|
20
|
+
* @returns the tab list, without its panel.
|
|
21
|
+
*/
|
|
22
|
+
export declare function WorkbenchSwitch({ value, onChange, labels, ariaLabel, panelId }: {
|
|
23
|
+
value: WorkbenchTag;
|
|
24
|
+
onChange: (tag: WorkbenchTag) => void;
|
|
25
|
+
labels: Readonly<Record<WorkbenchTag, string>>;
|
|
26
|
+
ariaLabel: string;
|
|
27
|
+
panelId: string;
|
|
28
|
+
}): ReactNode;
|
|
29
|
+
//# sourceMappingURL=WorkbenchSwitch.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { WorkspaceBrowserProps } from '../contract/slots.ts';
|
|
2
|
+
/**
|
|
3
|
+
* Render the browsing region.
|
|
4
|
+
* @param props - composed slot props (shell owner share + store + injected actions).
|
|
5
|
+
* @returns the region element tree.
|
|
6
|
+
*/
|
|
7
|
+
export declare function WorkspaceBrowser({ wide, usePanelInfo, expandSidebar, useSessions, useSessionStatus, useWorkspaces, useStore, actions, startSession, open, renameSession, forkSession, renameWorkspace, deleteWorkspace, insertWorkspaceBefore, archiveSession, pinSession, unpinSession, createWorkspace, searchSessions, searchResultLimit, requestSearch, requestAddWorkspace, closeAddWorkspace, closeRenameRequest, setDirectoryBusy, useDirectoryFlow, useHostInfo, useWorkspaceShortcuts, useShortcuts, renderSlot, t, }: WorkspaceBrowserProps): import("react").JSX.Element;
|
|
8
|
+
//# sourceMappingURL=WorkspaceBrowser.d.ts.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/** Workspace command registration and browser-owned opening requests. */
|
|
2
|
+
import type { Context } from '@qilin-agent/kylin';
|
|
3
|
+
import { type SnapshotStore } from '@qilin-agent/client-store';
|
|
4
|
+
import type { SessionId } from '@qilin-agent/session/types';
|
|
5
|
+
import type { UiWorkspace } from './navigation.ts';
|
|
6
|
+
/** Transient requests consumed by the existing workspace browser. */
|
|
7
|
+
export interface WorkspaceShortcutState {
|
|
8
|
+
readonly searchRequest: number;
|
|
9
|
+
readonly addRequested: boolean;
|
|
10
|
+
readonly directoryBusy: boolean;
|
|
11
|
+
readonly renameTarget: {
|
|
12
|
+
readonly sessionId: SessionId;
|
|
13
|
+
readonly currentTitle: string;
|
|
14
|
+
} | null;
|
|
15
|
+
}
|
|
16
|
+
interface WorkspaceShortcutControls {
|
|
17
|
+
state: SnapshotStore<WorkspaceShortcutState>;
|
|
18
|
+
search: () => void;
|
|
19
|
+
add: () => void;
|
|
20
|
+
closeAdd: () => void;
|
|
21
|
+
directoryBusy: (busy: boolean) => void;
|
|
22
|
+
rename: (sessionId: SessionId, currentTitle: string) => void;
|
|
23
|
+
closeRename: () => void;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Create the private browser request source shared by commands and controls.
|
|
27
|
+
* @returns observable state and its complete mutation callbacks.
|
|
28
|
+
*/
|
|
29
|
+
export declare function createWorkspaceShortcutControls(): WorkspaceShortcutControls;
|
|
30
|
+
/**
|
|
31
|
+
* Register navigation commands against the existing workspace owner.
|
|
32
|
+
* @param ctx - plugin context with the shortcut, locale, and model services.
|
|
33
|
+
* @param navigation - session creation and forking from the pointer controls' navigation service.
|
|
34
|
+
* @param controls - browser-owned opening requests.
|
|
35
|
+
* @param archiveSession - shared archive action, including running-work confirmation and notices.
|
|
36
|
+
*/
|
|
37
|
+
export declare function installWorkspaceShortcuts(ctx: Context, navigation: Pick<UiWorkspace, 'startSession' | 'forkSession'>, controls: ReturnType<typeof createWorkspaceShortcutControls>, archiveSession: (sessionId: SessionId) => void): void;
|
|
38
|
+
export {};
|
|
39
|
+
//# sourceMappingURL=shortcuts.d.ts.map
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The workspace browser's viewing store: the session-list grouping mode,
|
|
3
|
+
* persisted across reloads. Module level exports the factory only (a
|
|
4
|
+
* module-level handle would pin the store identity across plugin reloads);
|
|
5
|
+
* register() receives the factory and the browser derives its PropsStore
|
|
6
|
+
* share from the return type.
|
|
7
|
+
*/
|
|
8
|
+
import { type EngineStoreHandle } from '@qilin-agent/client-store';
|
|
9
|
+
import type { SessionListState } from '@qilin-agent/api-session-controller/client';
|
|
10
|
+
import type { SessionId } from '@qilin-agent/session/types';
|
|
11
|
+
/** Browser-local order account for the hierarchy-free flat Session list. */
|
|
12
|
+
export declare const FLAT_SESSION_ORDER_KEY = "__flat_session_order__";
|
|
13
|
+
/** Session-list grouping mode: sibling Workspace sections, a Workspace tree, or one flat list. */
|
|
14
|
+
export type SessionGroupBy = 'workspace' | 'workspace-tree' | 'flat';
|
|
15
|
+
/** Session order: saved manual positions or current recency. */
|
|
16
|
+
export type SessionOrderBy = 'manual' | 'updated';
|
|
17
|
+
/** Workspace browser viewing state persisted across surface remounts and reloads. */
|
|
18
|
+
type WorkspaceViewState = {
|
|
19
|
+
groupBy: SessionGroupBy;
|
|
20
|
+
orderBy: SessionOrderBy;
|
|
21
|
+
/** Explicit group expansion keyed by Workspace identity, including descendants in tree mode. */
|
|
22
|
+
groupExpansion: Record<string, boolean>;
|
|
23
|
+
/** Saved manual order per Workspace group plus the browser-local flat-list account. */
|
|
24
|
+
sessionOrderByAccount: Record<string, string[]>;
|
|
25
|
+
};
|
|
26
|
+
/** What a pin order write reconciles a pinned Session's accounts against. */
|
|
27
|
+
export interface PinOrderSource {
|
|
28
|
+
/** Every account's complete membership: each Workspace, Ungrouped, and the flat list. */
|
|
29
|
+
members: Readonly<Record<string, readonly SessionId[]>>;
|
|
30
|
+
/** Session summaries the reconciliation orders new members by. */
|
|
31
|
+
summaries: SessionListState['byId'];
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Annotation twin of the actions literal below (the export needs a declared
|
|
35
|
+
* return type); drift fails assignability at the defineStore call.
|
|
36
|
+
*/
|
|
37
|
+
type WorkspaceViewActions = {
|
|
38
|
+
setGroupBy: (draft: WorkspaceViewState, mode: SessionGroupBy) => void;
|
|
39
|
+
setOrderBy: (draft: WorkspaceViewState, mode: SessionOrderBy, initialOrders: Readonly<Record<string, readonly string[]>>) => void;
|
|
40
|
+
setGroupExpanded: (draft: WorkspaceViewState, key: string, expanded: boolean) => void;
|
|
41
|
+
retainAccountKeys: (draft: WorkspaceViewState, workspaceKeys: readonly string[]) => void;
|
|
42
|
+
syncSessionOrders: (draft: WorkspaceViewState, orders: Readonly<Record<string, readonly string[]>>) => void;
|
|
43
|
+
setSessionOrder: (draft: WorkspaceViewState, accountKey: string, order: readonly string[], initialOrders: Readonly<Record<string, readonly string[]>>) => void;
|
|
44
|
+
pinSessionOrder: (draft: WorkspaceViewState, sessionId: SessionId, accountKeys: readonly string[], source: PinOrderSource) => void;
|
|
45
|
+
};
|
|
46
|
+
/** The bound write set of one viewing-store instance (what the UiWorkspace service drives). */
|
|
47
|
+
export type WorkspaceViewStoreActions = ReturnType<ReturnType<typeof createWorkspaceViewStore>['create']>['actions'];
|
|
48
|
+
/**
|
|
49
|
+
* Create the workspace browser viewing store handle.
|
|
50
|
+
* @returns the store handle (spec + type + identity + factory in one).
|
|
51
|
+
*/
|
|
52
|
+
export declare function createWorkspaceViewStore(): EngineStoreHandle<WorkspaceViewState, WorkspaceViewActions>;
|
|
53
|
+
export {};
|
|
54
|
+
//# sourceMappingURL=stores.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/** UI Workspace-owned projection of descendant counts from Session summaries. */
|
|
2
|
+
import type { SessionId } from '@qilin-agent/session/types';
|
|
3
|
+
interface LineageEntry {
|
|
4
|
+
readonly id: SessionId;
|
|
5
|
+
readonly parentId?: SessionId;
|
|
6
|
+
readonly origin?: 'subagent';
|
|
7
|
+
readonly running: boolean;
|
|
8
|
+
}
|
|
9
|
+
/** Descendant counts for one possible parent Session. */
|
|
10
|
+
export interface SubagentDescendantSummary {
|
|
11
|
+
readonly count: number;
|
|
12
|
+
readonly runningCount: number;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Index uninterrupted subagent descendants under each ancestor.
|
|
16
|
+
* @param summaries - Session summaries keyed by id.
|
|
17
|
+
* @returns descendant totals keyed by possible parent id.
|
|
18
|
+
*/
|
|
19
|
+
export declare function indexSubagentDescendants(summaries: Readonly<Record<SessionId, LineageEntry>>): ReadonlyMap<SessionId, SubagentDescendantSummary>;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=subagent-lineage.d.ts.map
|