@deepseek-ai/dsh-client-ui-sidebar-right 0.1.5-alpha.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.
package/lib/index.js ADDED
@@ -0,0 +1,6 @@
1
+ //#region lib/types/index.js
2
+ /** Pure host half; the whole Sidebar lives in the browser export. */
3
+ /** Host plugin body: the Sidebar contributes nothing to the host tree. */
4
+ function apply() {}
5
+ //#endregion
6
+ export { apply };
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Navigation parameters, typed by what is being opened.
3
+ *
4
+ * Two declaration-merged maps. `SidebarRightResourceParamsMap` is keyed by
5
+ * resource type — the segment after `dsh-resource://` — and filled by the
6
+ * package that owns that type (the `file` provider adds `file: { line?: number }`);
7
+ * `SidebarRightTabParamsMap` is keyed by tab kind and filled by a page type that
8
+ * takes parameters (neither shipped page does). Values are JSON-shaped by
9
+ * convention; nothing validates them at run time, because caller and body meet
10
+ * at a typed same-process boundary. A body narrows `navigation.params` by the
11
+ * scheme and type of `navigation.address`.
12
+ *
13
+ * The unions below are spelled as indexed accesses over a record rather than as
14
+ * `A | B`: in a program where no package has augmented a map, both sides of such
15
+ * a union resolve to `undefined`, which the type-aware lint reads as a duplicated
16
+ * constituent. The indexed access names the same union without the pair.
17
+ */
18
+ /** The values of a record, as one union. */
19
+ type ValuesOf<T> = T[keyof T];
20
+ /** Resource type → the parameters a resource of that type accepts. Merge-extensible. */
21
+ export interface SidebarRightResourceParamsMap {
22
+ }
23
+ /** What `openResource` accepts as `params`: a declared resource type's parameters, or `undefined` for none. */
24
+ export type SidebarRightResourceParams = ValuesOf<{
25
+ declared: SidebarRightResourceParamsMap[keyof SidebarRightResourceParamsMap];
26
+ none: undefined;
27
+ }>;
28
+ /** Tab kind → the parameters a page of that kind accepts. Merge-extensible. */
29
+ export interface SidebarRightTabParamsMap {
30
+ }
31
+ /**
32
+ * What `openTab(kind)` accepts as `params` for one kind: its declared parameters,
33
+ * or `undefined` for none; a kind that declares none accepts only `undefined`.
34
+ */
35
+ export type SidebarRightTabParamsFor<K extends string> = (K extends keyof SidebarRightTabParamsMap ? SidebarRightTabParamsMap[K] : never) | undefined;
36
+ /** Every declared page kind's parameters, or `undefined` for none. */
37
+ export type SidebarRightTabParams = ValuesOf<{
38
+ declared: SidebarRightTabParamsMap[keyof SidebarRightTabParamsMap];
39
+ none: undefined;
40
+ }>;
41
+ /** What a body may find in `navigation.params`: either map's values, or `undefined` when the opener gave none. */
42
+ export type SidebarRightNavigationParams = ValuesOf<{
43
+ resource: SidebarRightResourceParams;
44
+ tab: SidebarRightTabParams;
45
+ }>;
46
+ export {};
47
+ //# sourceMappingURL=params.d.ts.map
@@ -0,0 +1,35 @@
1
+ /**
2
+ * The guide tab's identity, the page-address scheme, and the seed factory.
3
+ *
4
+ * These live in the contract because two sides need them and neither may read
5
+ * the other: the store seeds every new pane with a guide tab, and the guide
6
+ * domain registers the type under the same kind.
7
+ *
8
+ * The docking kit treats `kind` as opaque, so these strings mean something only
9
+ * here and in the registry. Both types go through the same two stages any other
10
+ * type would use — the guide is not special in the machinery, only in being
11
+ * always available.
12
+ */
13
+ import type { TabId, TabRecord } from '@deepseek-ai/dsh-client-ui-dockkit';
14
+ /** The guide tab's kind. */
15
+ export declare const GUIDE_KIND = "guide";
16
+ /**
17
+ * The address a page tab is recorded under: `sidebar://<kind>`. The scheme is
18
+ * this package's bookkeeping for `openTab`, spelled here and nowhere else; a
19
+ * caller names the kind and never sees or composes the address.
20
+ * @param kind - the page type's kind.
21
+ * @returns the page's address.
22
+ */
23
+ export declare function pageAddress(kind: string): string;
24
+ /**
25
+ * Build the guide tab a new pane is seeded with.
26
+ *
27
+ * The title is captured at mint time because it goes into the surface's
28
+ * operation sequence, which records what happened and must not change meaning
29
+ * later. A language change relabels the type, not tabs already open.
30
+ * @param id - tab id minted by the caller.
31
+ * @param title - the guide type's display name at mint time.
32
+ * @returns the guide tab record.
33
+ */
34
+ export declare function makeGuideTab(id: TabId, title: string): TabRecord;
35
+ //# sourceMappingURL=seed.d.ts.map
@@ -0,0 +1,152 @@
1
+ import type { PaneId, TabRecord } from '@deepseek-ai/dsh-client-ui-dockkit';
2
+ import type { SlotHookFactory } from '@deepseek-ai/dsh-client-ui-slots';
3
+ import type { TabHookContext } from '../tab-info.ts';
4
+ import type { SidebarRightKey } from '../locales.ts';
5
+ import type { SidebarRightNavigationParams, SidebarRightResourceParams, SidebarRightTabParamsFor } from './params.ts';
6
+ declare module '@deepseek-ai/dsh-client-ui-slots' {
7
+ interface LocaleNamespaceMap {
8
+ /** Right-Sidebar chrome, docking-kit vocabulary, and guide copy. */
9
+ sidebarRight: SidebarRightKey;
10
+ }
11
+ interface SlotMap {
12
+ /**
13
+ * One tab's body, dispatched with the `id` of the type in force for
14
+ * `tab.kind`. A tab type registers here under its definition's `id` and
15
+ * receives every tab of that kind, in every pane, docked or floating. A kind
16
+ * with no type in force renders the owner's "nothing can view this" notice
17
+ * rather than an empty pane.
18
+ */
19
+ 'sidebar.right.pane.tab': {
20
+ kind: 'keyed';
21
+ scope: 'session';
22
+ hookContext: TabHookContext;
23
+ inject: SidebarRightTabInjected;
24
+ };
25
+ /**
26
+ * A tab's title as its chip (and a floating panel's header) shows it,
27
+ * dispatched with the same key and information hook as the body. A type with a
28
+ * live title — a terminal named after its shell, a chat after its first
29
+ * line — registers here and reads its own store; one without registers
30
+ * nothing and the chip shows the registry's `title(address)` text captured
31
+ * at open time.
32
+ */
33
+ 'sidebar.right.pane.tab.title': {
34
+ kind: 'keyed';
35
+ scope: 'session';
36
+ hookContext: TabHookContext;
37
+ inject: SidebarRightTabInjected;
38
+ };
39
+ /**
40
+ * The guide tab's body. Selectors run in chain order and the first
41
+ * non-declining entry replaces the shipped guide entirely; with no entry, or
42
+ * with every entry declining, the shipped guide renders.
43
+ */
44
+ 'sidebar.right.tab.guide': {
45
+ kind: 'chain';
46
+ scope: 'session';
47
+ hookContext: UseSidebarRightTabInfo;
48
+ inject: {
49
+ hooks: {
50
+ tabInfo: SlotHookFactory<'sidebar.right.tab.guide', UseSidebarRightTabInfo>;
51
+ };
52
+ };
53
+ };
54
+ /**
55
+ * Extra items at the end of one tab's actions menu, in registration order.
56
+ * Entries decide their own visibility from the tab they are given. Without a
57
+ * registrant the menu shows only the kit's own layout actions.
58
+ */
59
+ 'sidebar.right.tab.menu.item': {
60
+ kind: 'list';
61
+ scope: 'session';
62
+ owner: SidebarRightTabMenuOwnerProps;
63
+ };
64
+ }
65
+ }
66
+ /** Where a tab was last navigated to: what the `open` that created or revealed it carried. */
67
+ export interface SidebarRightTabNavigation {
68
+ /** The address opened; for a tab record this is its `contentId`. */
69
+ readonly address: string;
70
+ /** The opener's `params` (see `contract/params.ts`); `undefined` when it gave none. */
71
+ readonly params: SidebarRightNavigationParams;
72
+ /**
73
+ * Incremented on every navigation to this tab, whether or not `params`
74
+ * changed, so a body can act on "navigated again" alone. `0` for a record
75
+ * nobody opened by address: a seeded guide, or a tab restored by undo.
76
+ */
77
+ readonly revision: number;
78
+ }
79
+ /** Where an open from a tab lands. Without any of these it lands in the pane holding the tab at call time. */
80
+ export interface SidebarRightTabPlacement {
81
+ /** Land a new tab in this pane instead. */
82
+ readonly paneId?: PaneId;
83
+ /** Defaults to `true`: a tab already showing the same content is focused instead of a second one opening. */
84
+ readonly revealIfOpened?: boolean;
85
+ /** `true` opens in this tab's place — its pane and strip slot — and closes this tab in the same step. */
86
+ readonly replaceTab?: boolean;
87
+ }
88
+ /** The actions one tab may take on itself; each acts on the session the tab is in. */
89
+ export interface SidebarRightTabActions {
90
+ /**
91
+ * Open a resource from this tab; see `ISidebarRight.openResource`.
92
+ * @param address - a `dsh-resource://` address.
93
+ * @param options - placement and the resource's navigation parameters.
94
+ */
95
+ openResource(address: string, options?: SidebarRightTabPlacement & {
96
+ readonly params?: SidebarRightResourceParams;
97
+ }): void;
98
+ /**
99
+ * Open a page type from this tab; see `ISidebarRight.openTab`.
100
+ * @param kind - the page type's kind.
101
+ * @param options - placement and that kind's navigation parameters.
102
+ */
103
+ openTab<K extends string>(kind: K, options?: SidebarRightTabPlacement & {
104
+ readonly params?: SidebarRightTabParamsFor<K>;
105
+ }): void;
106
+ /** Close this tab. */
107
+ close(): void;
108
+ }
109
+ /** Live information shared by a tab's body, title, and guide replacement. */
110
+ export interface SidebarRightTabInfo {
111
+ readonly sidebar: {
112
+ readonly expanded: boolean;
113
+ /** Presentation selected by manual mode or viewport width; preserved while collapsed. */
114
+ readonly fullscreen: boolean;
115
+ };
116
+ readonly panel: {
117
+ readonly id: PaneId;
118
+ };
119
+ readonly tab: TabRecord & {
120
+ /** Docked bodies need an expanded sidebar and an active tab; expanded titles include inactive tabs. Floats stay visible. */
121
+ readonly visible: boolean;
122
+ readonly navigation: SidebarRightTabNavigation;
123
+ /** Aborted only when the record disappears or this plugin unloads, not on hide or session switch. */
124
+ readonly signal: AbortSignal;
125
+ readonly actions: SidebarRightTabActions;
126
+ };
127
+ }
128
+ /**
129
+ * Read current tab information through the slot framework's subscriptions.
130
+ * @returns the sidebar presentation, containing pane, and live tab record.
131
+ */
132
+ export type UseSidebarRightTabInfo = () => SidebarRightTabInfo;
133
+ /** The slot-owned hook shared by every tab body and title registration. */
134
+ export interface SidebarRightTabInjected {
135
+ hooks: {
136
+ tabInfo: SlotHookFactory<'sidebar.right.pane.tab', UseSidebarRightTabInfo>;
137
+ };
138
+ }
139
+ /** Owner share of one tab-menu item occurrence. */
140
+ export interface SidebarRightTabMenuOwnerProps {
141
+ /** The tab whose menu is open. */
142
+ tab: TabRecord;
143
+ /**
144
+ * Dismiss the menu.
145
+ *
146
+ * An item that acts MUST call this: the menu is the kit's, and it closes on
147
+ * its own actions only. An item that leaves it open leaves a menu floating
148
+ * over content the action may have just replaced.
149
+ */
150
+ dismiss: () => void;
151
+ }
152
+ //# sourceMappingURL=slots.d.ts.map
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Browser half: fill the frame's right column with the panel, put the expand
3
+ * button in the conversation header, and own the seats a tab type registers
4
+ * into.
5
+ *
6
+ * Two seats share one session-scoped store, which the slot runtime allows
7
+ * because both are session-scoped (a handle may not span scopes). The panel seat
8
+ * in the frame draws the surface normally or fullscreen, retaining the track
9
+ * on wide viewports; the header's corner seat draws the way back in
10
+ * while the panel is hidden. The store is the layout's only source of truth; the docking
11
+ * kit's pure planners compute every change and the store records them, one
12
+ * history entry per intent.
13
+ *
14
+ * The frame is a base package and never injects this one. What it needs —
15
+ * whether the panel is shown and whether it wants a track — arrives through its
16
+ * own `ctx.layout` action face, reported by the seat that knows both facts.
17
+ *
18
+ * Tab types register in two stages: the type itself into `ctx.sidebarRightTabs`,
19
+ * its body into the keyed `sidebar.right.pane.tab` seat under the same kind. The
20
+ * guide registers through those stages unmodified, exactly as a type shipped
21
+ * from another package does — `ui-sidebar-textpreview` is the live proof.
22
+ */
23
+ import type { Context as ClientContext } from '@deepseek-ai/cordis';
24
+ import { type SidebarRightController } from './service.ts';
25
+ import { SidebarRightTabRegistry } from './tab-registry.ts';
26
+ export type { RightbarSeatProps, SidebarRightInjected, SidebarRightPresentation } from './shell/SidebarRight.tsx';
27
+ export type { GuideBodyProps, GuideInjected } from './tabs/guide/GuideBody.tsx';
28
+ export type { ExpandButtonProps } from './shell/ExpandButton.tsx';
29
+ export type { SidebarRightState, SurfaceState } from './stores.ts';
30
+ export type { ISidebarRight, SidebarRightBinding, SidebarRightOpenResourceOptions, SidebarRightOpenTabOptions, SidebarRightPlacement, SurfaceActions, } from './service.ts';
31
+ export type { SidebarRightGuideBox, SidebarRightGuideEntry, SidebarRightTabClaim, SidebarRightTabDefinition, SidebarRightTabPriority, } from './tab-registry.ts';
32
+ export type { SidebarRightTabInfo, SidebarRightTabInjected, UseSidebarRightTabInfo, SidebarRightTabActions, SidebarRightTabMenuOwnerProps, SidebarRightTabNavigation, SidebarRightTabPlacement, } from './contract/slots.ts';
33
+ export type { SidebarRightNavigationParams, SidebarRightResourceParams, SidebarRightResourceParamsMap, SidebarRightTabParams, SidebarRightTabParamsFor, SidebarRightTabParamsMap, } from './contract/params.ts';
34
+ export type { FloatRect, PaneId, TabId, TabRecord } from '@deepseek-ai/dsh-client-ui-dockkit';
35
+ export type { PinResource, SidebarRightNavigator, TabOccurrence } from './tab-domain.ts';
36
+ export type { SidebarRightKey } from './locales.ts';
37
+ export type { OpenContentIntent } from './stores.ts';
38
+ /** Required browser services: the slot registry, the frame's panel actions, copy, and the resource model. */
39
+ export declare const inject: string[];
40
+ declare module '@deepseek-ai/cordis' {
41
+ interface Context {
42
+ /** Right-Sidebar navigation and presentation face. */
43
+ sidebarRight: SidebarRightController;
44
+ /** Right-Sidebar tab-type registry (stage one of a tab type's registration). */
45
+ sidebarRightTabs: SidebarRightTabRegistry;
46
+ }
47
+ }
48
+ /**
49
+ * Client plugin body: provide the registry and the navigation face, register the
50
+ * panel seat and the rail seat over one store with their extension children, and
51
+ * register the guide type through the same public two-stage path any other type
52
+ * uses.
53
+ * @param ctx - client root context carrying the slot registry, the frame's face, and copy.
54
+ */
55
+ export declare function apply(ctx: ClientContext): void;
56
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,19 @@
1
+ /**
2
+ * The docking kit's vocabulary, in the product's language.
3
+ *
4
+ * The kit renders no string of its own, so every word a user reads inside it is
5
+ * handed over from here. This is a projection of the dictionary, not a second
6
+ * home for copy: the strings live in `locales.ts`.
7
+ */
8
+ import type { DockLabels } from '@deepseek-ai/dsh-client-ui-dockkit';
9
+ import type { TranslateNS } from '@deepseek-ai/dsh-client-locale/client';
10
+ /**
11
+ * Project the dictionary into the kit's label contract.
12
+ *
13
+ * Called during render, so a language change reaches the kit with the next one —
14
+ * the kit caches no copy to invalidate.
15
+ * @param t - namespace-bound translate.
16
+ * @returns every string the kit renders.
17
+ */
18
+ export declare function dockLabels(t: TranslateNS<'sidebarRight'>): DockLabels;
19
+ //# sourceMappingURL=labels.d.ts.map
@@ -0,0 +1,48 @@
1
+ /**
2
+ * `sidebarRight` namespace dictionaries.
3
+ *
4
+ * Everything a user reads in this column is here, including the strings handed
5
+ * to the docking kit — the kit renders no copy of its own, so its whole
6
+ * vocabulary is this package's to own and translate.
7
+ */
8
+ /** Simplified Chinese dictionary and key-set source of truth. */
9
+ export declare const zh: {
10
+ 'chrome.expand': string;
11
+ 'chrome.collapse': string;
12
+ 'chrome.toFullscreen': string;
13
+ 'chrome.exitFullscreen': string;
14
+ 'dock.emptyPane': string;
15
+ 'dock.splitPane': string;
16
+ 'dock.splitPaneDisabled': string;
17
+ 'dock.splitPaneNarrow': string;
18
+ 'dock.closeTab': string;
19
+ 'dock.addTab': string;
20
+ 'dock.dockFloat': string;
21
+ 'dock.closeFloat': string;
22
+ 'tab.guide.title': string;
23
+ 'tab.unavailable': string;
24
+ 'guide.lead': string;
25
+ 'guide.body': string;
26
+ };
27
+ /** Right-Sidebar dictionary key union. */
28
+ export type SidebarRightKey = keyof typeof zh;
29
+ /** English dictionary, checked against the Chinese key set. */
30
+ export declare const en: {
31
+ 'chrome.expand': string;
32
+ 'chrome.collapse': string;
33
+ 'chrome.toFullscreen': string;
34
+ 'chrome.exitFullscreen': string;
35
+ 'dock.emptyPane': string;
36
+ 'dock.splitPane': string;
37
+ 'dock.splitPaneDisabled': string;
38
+ 'dock.splitPaneNarrow': string;
39
+ 'dock.closeTab': string;
40
+ 'dock.addTab': string;
41
+ 'dock.dockFloat': string;
42
+ 'dock.closeFloat': string;
43
+ 'tab.guide.title': string;
44
+ 'tab.unavailable': string;
45
+ 'guide.lead': string;
46
+ 'guide.body': string;
47
+ };
48
+ //# sourceMappingURL=locales.d.ts.map
@@ -0,0 +1,300 @@
1
+ /**
2
+ * `ctx.sidebarRight`: what other plugins may ask of this column.
3
+ *
4
+ * The surface is per session and its state lives in that session's store
5
+ * instance, which the slot runtime mints per session and a root service cannot
6
+ * reach on its own. Two paths lead in. The mounted seat publishes its binding —
7
+ * session id, bound actions, its surface — for exactly as long as it is mounted,
8
+ * and every command on the public face goes through that binding; a command
9
+ * arriving with no seat mounted has no session to act on and fails loudly rather
10
+ * than writing into a surface nobody is drawing. And the plugin adopts each
11
+ * session's store instance as the runtime mints it, so the controller reaches
12
+ * any session's store by id and syncs the Tab domain from that store's commits.
13
+ *
14
+ * A tab's own actions (`tabActions`) aim at the session the tab is in, not at
15
+ * the mounted one: they run through that session's adopted store, so a callback
16
+ * fired after the user switched sessions still lands where its tab is, and they
17
+ * do nothing for a session whose store was never minted.
18
+ *
19
+ * `openResource` and `openTab` are the navigation controller, and every way
20
+ * into the column is a call to one of them: the conversation's file links, a
21
+ * tool row's line reference, the strip's add control, a guide entry box, a file
22
+ * tree's rows. A resource is claimed through the registry by address; a page is
23
+ * named by kind and recorded at the address this package composes for it. Both
24
+ * hand the store one settled intent and record the navigation in the Tab
25
+ * domain. Placement is the caller's option, never a type's property.
26
+ *
27
+ * Wiring follows `LayoutController.attachPanels`: the registration hands the
28
+ * service its store actions, and the service is the face other plugins hold.
29
+ */
30
+ import type { FloatRect, PaneId, TabId, TabRecord } from '@deepseek-ai/dsh-client-ui-dockkit';
31
+ import type { BoundActions } from '@deepseek-ai/dsh-client-ui-slots';
32
+ import type { SessionId } from '@deepseek-ai/dsh-session/types';
33
+ import type { SidebarRightResourceParams, SidebarRightTabParamsFor } from './contract/params.ts';
34
+ import type { SidebarRightTabRegistry } from './tab-registry.ts';
35
+ import type { SidebarRightState, SurfaceState } from './stores.ts';
36
+ import type { createSidebarRightStore } from './stores.ts';
37
+ import { TabDomain, type PinResource } from './tab-domain.ts';
38
+ /** The seat's bound action set. */
39
+ export type SurfaceActions = BoundActions<ReturnType<typeof createSidebarRightStore>>;
40
+ /** One session's store instance as the slot runtime minted it: its actions and its observable snapshot. */
41
+ export interface SidebarRightSurfaceStore {
42
+ readonly actions: SurfaceActions;
43
+ getSnapshot(): SidebarRightState;
44
+ subscribe(listener: () => void): () => void;
45
+ }
46
+ /** One adoption of a session's store; the token a release compares against. */
47
+ interface Adoption {
48
+ readonly store: SidebarRightSurfaceStore;
49
+ readonly unsubscribe: () => void;
50
+ }
51
+ /**
52
+ * Create the public controller and the plugin-private store adoption callback.
53
+ * Adoption subscribes without reconciling; the first store commit creates occurrences.
54
+ * @param tabs - registered tab types.
55
+ * @param pin - resource retention for an occurrence's lifetime.
56
+ * @returns the controller and a callback releasing exactly its own adoption.
57
+ */
58
+ export declare function createSidebarRightController(tabs: SidebarRightTabRegistry, pin: PinResource): {
59
+ controller: SidebarRightController;
60
+ adopt: (sessionId: SessionId, store: SidebarRightSurfaceStore) => () => void;
61
+ };
62
+ /** Everything a command needs, as the mounted seat sees it. */
63
+ export interface SidebarRightBinding {
64
+ /** The session the mounted seat is drawing. */
65
+ readonly sessionId: SessionId;
66
+ /** The seat's store's bound actions; every action names the session it acts on. */
67
+ readonly actions: SurfaceActions;
68
+ /**
69
+ * The seat's store surfaces as last committed, keyed by session id; the
70
+ * mounted session's is `surfaces[sessionId]`, absent before the seat's first
71
+ * open. The runtime mints one store per session, so this holds that session.
72
+ */
73
+ readonly surfaces: Readonly<Record<string, SurfaceState>>;
74
+ /**
75
+ * The room rule's verdict for a docked pane, as the kit last measured it:
76
+ * whether two working halves would fit. Unmeasured panes fit.
77
+ */
78
+ readonly canSplitPane: (paneId: PaneId) => boolean;
79
+ }
80
+ /** Where an open lands; every field is optional and the defaults are the common case. */
81
+ export interface SidebarRightPlacement {
82
+ /** Land a new tab in this pane instead of the active docked one. */
83
+ readonly paneId?: PaneId;
84
+ /** Take this tab's place — its pane and its strip slot — and close it in the same step. */
85
+ readonly replaceTab?: TabId;
86
+ /**
87
+ * Defaults to `true`: a tab already showing the same (kind, contentId) is
88
+ * focused and handed `params`. `false` opens another tab regardless.
89
+ */
90
+ readonly revealIfOpened?: boolean;
91
+ }
92
+ /** How a caller wants a resource opened. */
93
+ export interface SidebarRightOpenResourceOptions extends SidebarRightPlacement {
94
+ /** Name the opening type instead of letting the registry rank claims; its `canOpen` still applies. */
95
+ readonly kind?: string;
96
+ /** The resource's navigation parameters, typed by resource type; delivered as `navigation.params`. */
97
+ readonly params?: SidebarRightResourceParams;
98
+ }
99
+ /** How a caller wants a page type opened. */
100
+ export interface SidebarRightOpenTabOptions<K extends string = string> extends SidebarRightPlacement {
101
+ /** That kind's navigation parameters, typed by kind; delivered as `navigation.params`. */
102
+ readonly params?: SidebarRightTabParamsFor<K>;
103
+ }
104
+ /** The outward right-Sidebar face (`ctx.sidebarRight`). */
105
+ export interface ISidebarRight {
106
+ /**
107
+ * Open a resource: claim it, place it, reveal the column, record the navigation.
108
+ *
109
+ * Without `options.kind` the registry ranks the types whose globs and
110
+ * `canOpen` accept the address and the best band wins; with it, that kind's
111
+ * type in force opens the address (its `canOpen` still applies). An address
112
+ * outside `dsh-resource://`, or one no type will open, is a wiring mistake,
113
+ * not a user error, so it throws. The column expands in the same step,
114
+ * because content the user cannot see is not opened.
115
+ * @param address - a `dsh-resource://<type>/…` address.
116
+ * @param options - placement, the opening type, and navigation parameters.
117
+ */
118
+ openResource(address: string, options?: SidebarRightOpenResourceOptions): void;
119
+ /**
120
+ * Open a page type by kind: the type in force for it, at the address this
121
+ * package records pages under. A kind nothing registered throws.
122
+ * @param kind - the page type's kind.
123
+ * @param options - placement and that kind's navigation parameters.
124
+ */
125
+ openTab<K extends string>(kind: K, options?: SidebarRightOpenTabOptions<K>): void;
126
+ /**
127
+ * Close one tab of the mounted session.
128
+ * @param tabId - the tab to close.
129
+ */
130
+ close(tabId: TabId): void;
131
+ /**
132
+ * The active tab of the active pane.
133
+ * @returns the record, or `undefined` when no seat is mounted.
134
+ */
135
+ active(): TabRecord | undefined;
136
+ /**
137
+ * Whether the column is currently showing its panel.
138
+ * @returns `true` while expanded; `false` while collapsed to its rail.
139
+ */
140
+ isExpanded(): boolean;
141
+ /** Collapse an expanded column, or expand a collapsed one. Recorded in the sequence. */
142
+ toggleExpanded(): void;
143
+ /**
144
+ * Focus a tab and the pane holding it, raising a floating one. Recorded.
145
+ * @param tabId - the tab; one that does not exist is left alone.
146
+ */
147
+ focus(tabId: TabId): void;
148
+ /**
149
+ * Split a docked pane to its right and seed the new pane, under the same
150
+ * pane budget and room rule as the strip's split control. Recorded when it
151
+ * splits.
152
+ * @param paneId - the pane to split; defaults to the active docked pane.
153
+ * @returns the new pane's id, or `undefined` when nothing was split: the pane
154
+ * is missing or floating, the budget is spent, or two halves would not fit.
155
+ */
156
+ split(paneId?: PaneId): PaneId | undefined;
157
+ /**
158
+ * Take a docked tab out into a floating panel. Recorded.
159
+ * @param tabId - the tab; one that is missing or already floating is left alone.
160
+ * @param rect - the panel's rectangle; defaults to the cascade from the last panel.
161
+ */
162
+ float(tabId: TabId, rect?: FloatRect): void;
163
+ /**
164
+ * Return a floating panel's tab to the active docked pane. Recorded.
165
+ * @param paneId - the floating pane; one that is missing or docked is left alone.
166
+ */
167
+ dock(paneId: PaneId): void;
168
+ }
169
+ /** Cross-plugin right-Sidebar face (ctx.sidebarRight). */
170
+ export declare class SidebarRightController implements ISidebarRight {
171
+ private readonly tabs;
172
+ private readonly adopted;
173
+ private binding;
174
+ /**
175
+ * The Tab domain this controller navigates into; synced from each adopted
176
+ * store's commits, read by the seat for each body's owner share.
177
+ */
178
+ readonly tabDomain: TabDomain;
179
+ /**
180
+ * @param tabs - the tab-type registry consulted to claim an address.
181
+ * @param pin - `ctx.resources.pin`, which the Tab domain holds addresses with.
182
+ * @param adopted - plugin-owned session stores used by occurrence actions.
183
+ */
184
+ constructor(tabs: SidebarRightTabRegistry, pin: PinResource, adopted?: Map<SessionId, Adoption>);
185
+ /**
186
+ * Adopt the mounted seat's binding, replacing any previous one.
187
+ *
188
+ * Called from the seat while it is mounted, and released when it leaves.
189
+ * @param binding - the mounted seat's session, actions, and the store's surfaces.
190
+ * @returns a release callback that clears exactly this binding.
191
+ */
192
+ bind(binding: SidebarRightBinding): () => void;
193
+ /**
194
+ * Open a resource: claim it, place it, reveal the column, record the navigation.
195
+ * @param address - a `dsh-resource://<type>/…` address.
196
+ * @param options - placement, the opening type, and navigation parameters.
197
+ */
198
+ openResource(address: string, options?: SidebarRightOpenResourceOptions): void;
199
+ /**
200
+ * Open a page type by kind at the address this package records pages under.
201
+ * @param kind - the page type's kind.
202
+ * @param options - placement and that kind's navigation parameters.
203
+ */
204
+ openTab<K extends string>(kind: K, options?: SidebarRightOpenTabOptions<K>): void;
205
+ /**
206
+ * Open a resource in one session, for a tab's own action; nothing happens
207
+ * for a session whose store was never adopted or whose adoption was released.
208
+ * Not part of `ISidebarRight`: the Tab domain's path.
209
+ * @param sessionId - the session the acting tab is in.
210
+ * @param address - a `dsh-resource://<type>/…` address.
211
+ * @param options - placement, the opening type, and navigation parameters.
212
+ */
213
+ openResourceIn(sessionId: SessionId, address: string, options?: SidebarRightOpenResourceOptions): void;
214
+ /**
215
+ * Open a page type in one session, for a tab's own action; nothing happens
216
+ * for a session whose store was never adopted or whose adoption was released.
217
+ * Not part of `ISidebarRight`: the Tab domain's path.
218
+ * @param sessionId - the session the acting tab is in.
219
+ * @param kind - the page type's kind.
220
+ * @param options - placement and that kind's navigation parameters.
221
+ */
222
+ openTabIn<K extends string>(sessionId: SessionId, kind: K, options?: SidebarRightOpenTabOptions<K>): void;
223
+ /**
224
+ * Close a tab of one session, for the tab's own action; nothing happens
225
+ * for a session whose store was never adopted or whose adoption was released.
226
+ * Not part of `ISidebarRight`: the Tab domain's path.
227
+ * @param sessionId - the session the tab is in.
228
+ * @param tabId - the tab to close.
229
+ */
230
+ closeIn(sessionId: SessionId, tabId: TabId): void;
231
+ /** Claim a resource and place it in one session; an address outside the scheme or one no type claims throws. */
232
+ private placeResource;
233
+ /** Place a page type in one session at the address pages are recorded under; an unregistered kind throws. */
234
+ private placeTab;
235
+ /** The steps both opens share: one store intent, and the navigation record for the tab it settles on. */
236
+ private place;
237
+ /**
238
+ * Close one tab of the mounted session.
239
+ * @param tabId - the tab to close.
240
+ */
241
+ close(tabId: TabId): void;
242
+ /**
243
+ * The active tab of the active pane.
244
+ * @returns the record, or `undefined` with no mounted surface.
245
+ */
246
+ active(): TabRecord | undefined;
247
+ /**
248
+ * Whether the column is currently showing its panel.
249
+ * @returns `true` while expanded; `false` while collapsed or with no mounted surface.
250
+ */
251
+ isExpanded(): boolean;
252
+ /** Collapse an expanded column, or expand a collapsed one. */
253
+ toggleExpanded(): void;
254
+ /**
255
+ * Focus a tab and the pane holding it; a missing tab is left alone.
256
+ * @param tabId - the tab to focus.
257
+ */
258
+ focus(tabId: TabId): void;
259
+ /**
260
+ * Split a docked pane to its right when the budget and the room rule allow.
261
+ * @param paneId - the pane to split; defaults to the active docked pane.
262
+ * @returns the new pane's id, or `undefined` when nothing was split.
263
+ */
264
+ split(paneId?: PaneId): PaneId | undefined;
265
+ /**
266
+ * Take a docked tab out into a floating panel; a missing or floating tab is left alone.
267
+ * @param tabId - the tab to float.
268
+ * @param rect - the panel's rectangle; defaults to the cascade from the last panel.
269
+ */
270
+ float(tabId: TabId, rect?: FloatRect): void;
271
+ /**
272
+ * Return a floating panel's tab to the active docked pane; a missing or docked pane is left alone.
273
+ * @param paneId - the floating pane.
274
+ */
275
+ dock(paneId: PaneId): void;
276
+ /**
277
+ * Step the mounted session's surface back one intent.
278
+ *
279
+ * @internal Not part of the product: the sequence is an architectural fact
280
+ * with no user-facing control yet. Kept reachable for tests.
281
+ */
282
+ _undo(): void;
283
+ /**
284
+ * Step the mounted session's surface forward one intent.
285
+ *
286
+ * @internal See `_undo`.
287
+ */
288
+ _redo(): void;
289
+ /** The mounted session's surface; `undefined` without a seat or before its first open. */
290
+ private mounted;
291
+ /**
292
+ * The store actions a tab's own action on `sessionId` runs through: that
293
+ * session's adopted store. `undefined` — nothing to act on — for a session
294
+ * whose store was never minted or whose adoption was released.
295
+ */
296
+ private actionsFor;
297
+ private require;
298
+ }
299
+ export {};
300
+ //# sourceMappingURL=service.d.ts.map