@qilin-agent/client-ui-agent-preset 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/lib/index.js ADDED
@@ -0,0 +1,11 @@
1
+ //#region lib/types/index.js
2
+ /**
3
+ * Agent-preset surface plugin, node half. The empty apply exists so the plugin
4
+ * appears in the host cordis.yml / Loader; the browser half ships the
5
+ * General-settings row through exports["./client"], discovered from the
6
+ * package.json qilin.client declaration.
7
+ */
8
+ /** Host plugin body — no host-side behavior for this surface plugin. */
9
+ function apply() {}
10
+ //#endregion
11
+ export { apply };
@@ -0,0 +1,30 @@
1
+ /**
2
+ * The session header's agent-preset label.
3
+ *
4
+ * Read-only by construction: a session's composition is fixed once its
5
+ * conversation starts, and a header is only worth reading after that. Offering
6
+ * a control here would promise a switch the host refuses; naming what the
7
+ * session runs is the honest affordance, and the choice itself lives on the
8
+ * new-session screen ({@link AgentPresetSeat}).
9
+ */
10
+ import type { SnapshotStore } from '@qilin-agent/client-store';
11
+ import type { InjectFace, PropsLocale, PropsRuntime } from '@qilin-agent/client-ui-slots';
12
+ import type { AgentPresetSettingsState } from './settings-store.ts';
13
+ /** Registration-side business face for the header label. */
14
+ export interface AgentPresetLabelInjected {
15
+ hooks: {
16
+ /** Roster snapshot bound by the renderer as useAgentPresets. */
17
+ agentPresets: SnapshotStore<AgentPresetSettingsState>;
18
+ };
19
+ /** Read the roster, so the label can show a name rather than an id. */
20
+ load: () => Promise<void>;
21
+ }
22
+ /** Full component props. */
23
+ export type AgentPresetLabelProps = PropsRuntime<'conversation.session.header.actions'> & PropsLocale<'settings.agentPreset'> & InjectFace<AgentPresetLabelInjected>;
24
+ /**
25
+ * Render this session's agent-preset name beside its title.
26
+ * @param props - composed slot props.
27
+ * @returns the label, or null when the session records no preset.
28
+ */
29
+ export declare function AgentPresetLabel({ sessionId, useSessions, useAgentPresets, load, t, }: AgentPresetLabelProps): import("react").JSX.Element | null;
30
+ //# sourceMappingURL=AgentPresetLabel.d.ts.map
@@ -0,0 +1,40 @@
1
+ /**
2
+ * The agent-preset chip on the new-session screen, beside the workspace
3
+ * picker.
4
+ *
5
+ * It lives here rather than in the composer because the choice is only
6
+ * available before a conversation starts: once a turn has run, the session's
7
+ * history was produced under that preset's tools and the host refuses to swap
8
+ * them. A control that spends most of its life disabled belongs on the screen
9
+ * where it still works.
10
+ *
11
+ * The menu opens on the staged choice, which starts as the deployment default.
12
+ * Picking stages; the choice reaches a session when one becomes current.
13
+ */
14
+ import type { SnapshotStore } from '@qilin-agent/client-store';
15
+ import type { InjectFace, PropsLocale, PropsRuntime } from '@qilin-agent/client-ui-slots';
16
+ import type { AgentPresetSeatState } from './seat-store.ts';
17
+ /** Registration-side business face for the hero chip. */
18
+ export interface AgentPresetSeatInjected {
19
+ hooks: {
20
+ /** Seat snapshot bound by the renderer as useAgentPresetSeat. */
21
+ agentPresetSeat: SnapshotStore<AgentPresetSeatState>;
22
+ };
23
+ /** Read the roster when the chip first renders. */
24
+ load: () => Promise<void>;
25
+ /** Stage one preset for the next session; resolves to a refusal, or undefined. */
26
+ select: (id: string) => Promise<string | undefined>;
27
+ /** Acknowledge the refusal whose Toast finished. */
28
+ dismissRefusal: (error: AgentPresetSeatState['error']) => void;
29
+ /** Clear the one-shot introduce cue once the chip has played it. */
30
+ introduced: () => void;
31
+ }
32
+ /** Full component props. */
33
+ export type AgentPresetSeatProps = PropsRuntime<'conversation.hero.agentPreset'> & PropsLocale<'settings.agentPreset'> & InjectFace<AgentPresetSeatInjected>;
34
+ /**
35
+ * Render the new-session agent-preset chip.
36
+ * @param props - composed slot props.
37
+ * @returns the chip and any pending selection refusal, or null outside the main view.
38
+ */
39
+ export declare function AgentPresetSeat({ sessionId, useSessionRetainInfo, load, select, dismissRefusal, introduced, useAgentPresetSeat, t, }: AgentPresetSeatProps): import("react").JSX.Element | null;
40
+ //# sourceMappingURL=AgentPresetSeat.d.ts.map
@@ -0,0 +1,63 @@
1
+ /**
2
+ * Agent-presets settings section: the roster as cards, a copy dialog as the
3
+ * only way a preset is created, and a read-only viewer over the shipped
4
+ * compositions.
5
+ *
6
+ * The browser edits no composition text — a shipped preset opens read-only to
7
+ * be READ (it is the known-good composition a copy starts from), and a custom
8
+ * preset is edited in its own files, which is what the location action leads
9
+ * to. Deleting a preset leaves running sessions alone: a composition is
10
+ * mounted once at session creation and nothing re-reads the file.
11
+ */
12
+ import type { ReactNode } from 'react';
13
+ import type { SnapshotStore } from '@qilin-agent/client-store';
14
+ import type { InjectFace, PropsLocale, PropsRuntime } from '@qilin-agent/client-ui-slots';
15
+ import { type AgentPresetSectionState } from './section-store.ts';
16
+ /** Registration-side business face for the management section. */
17
+ export interface AgentPresetSectionInjected {
18
+ hooks: {
19
+ /** Page snapshot bound by the renderer as useAgentPresetSection. */
20
+ agentPresetSection: SnapshotStore<AgentPresetSectionState>;
21
+ };
22
+ /** Read the roster; called once when the section first renders. */
23
+ load: () => Promise<void>;
24
+ /** Open one shipped preset's composition in the read-only viewer. */
25
+ view: (id: string) => Promise<void>;
26
+ /** Close the read-only viewer. */
27
+ closeView: () => void;
28
+ /** Open the copy dialog over one preset. */
29
+ beginCopy: (from: string) => void;
30
+ /** Close the copy dialog, discarding the draft. */
31
+ cancelCopy: () => void;
32
+ /** Name the preset the copy creates. */
33
+ setCopyId: (id: string) => void;
34
+ /** Name the copy's display name. */
35
+ setCopyName: (name: string) => void;
36
+ /** Submit the copy. */
37
+ confirmCopy: () => Promise<void>;
38
+ /** Open one preset's directory, or reveal its path where there is no desktop. */
39
+ openLocation: (id: string) => Promise<void>;
40
+ /**
41
+ * Stage the self-referential preset and start a new session on it — the
42
+ * guided way to author a preset, beside copying. Absent when the surface
43
+ * is composed without the conversation flow to land the session in.
44
+ */
45
+ startCreatorDraft?: () => void;
46
+ /** Ask for delete confirmation, or dismiss it with null. */
47
+ confirmDelete: (id: string | null) => void;
48
+ /** Delete the preset awaiting confirmation. */
49
+ remove: () => Promise<void>;
50
+ /** Make one preset the default for sessions created later. */
51
+ makeDefault: (id: string) => Promise<void>;
52
+ /** Show or hide preset selection on new-session surfaces. */
53
+ setPickerVisible: (showPicker: boolean) => Promise<void>;
54
+ }
55
+ /** Full component props. */
56
+ export type AgentPresetSectionProps = PropsRuntime<'settings.section'> & PropsLocale<'settings.agentPreset'> & InjectFace<AgentPresetSectionInjected>;
57
+ /**
58
+ * Render the Agent presets section content column.
59
+ * @param props - composed slot props.
60
+ * @returns the section, or null when the deployment composes no presets.
61
+ */
62
+ export declare function AgentPresetSection(props: AgentPresetSectionProps): ReactNode;
63
+ //# sourceMappingURL=AgentPresetSection.d.ts.map
@@ -0,0 +1,21 @@
1
+ import type { SnapshotStore } from '@qilin-agent/client-store';
2
+ import type { InjectFace, PropsLocale, PropsRuntime } from '@qilin-agent/client-ui-slots';
3
+ import type { AgentPresetSettingsState } from './settings-store.ts';
4
+ /** Roster and navigation supplied by the preset plugin. */
5
+ export interface CreatePluginMenuItemInjected {
6
+ hooks: {
7
+ agentPresets: SnapshotStore<AgentPresetSettingsState>;
8
+ };
9
+ load: () => Promise<void>;
10
+ startCreatorDraft: () => void;
11
+ }
12
+ type CreatePluginMenuItemProps = PropsRuntime<'plugins.add.actions'> & PropsLocale<'settings.agentPreset'> & InjectFace<CreatePluginMenuItemInjected>;
13
+ /**
14
+ * Close the Add plugin menu before opening Creator without sending a message;
15
+ * the draft the visitor typed stays until they send it.
16
+ * @param props - locale, roster, dismissal and navigation callbacks.
17
+ * @returns a stable menu item that explains why Creator is unavailable.
18
+ */
19
+ export declare function CreatePluginMenuItem({ t, useAgentPresets, load, onDismiss, startCreatorDraft, }: CreatePluginMenuItemProps): import("react").JSX.Element;
20
+ export {};
21
+ //# sourceMappingURL=CreatePluginMenuItem.d.ts.map
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Agent-preset surface plugin, browser half — three surfaces over one roster:
3
+ * a chip on the new-session screen for the session about to start, a
4
+ * read-only label in the session header, and a settings section that manages
5
+ * the roster (copy, delete, default, and the way into a preset's own files).
6
+ *
7
+ * A running session keeps the composition it began with (the host refuses to
8
+ * adopt an existing session under a different preset). That is what splits
9
+ * the choice from the display: the hero chip is before-the-fact, while the
10
+ * header only reports what a session already runs. The default preset is
11
+ * edited where the roster is visible — the settings section's "make default"
12
+ * — so General settings carries no duplicate control for the same field.
13
+ */
14
+ import type { Context as ClientContext } from '@qilin-agent/kylin';
15
+ import { type AgentPresetSettingsKey } from './locales.ts';
16
+ declare module '@qilin-agent/client-ui-slots' {
17
+ interface LocaleNamespaceMap {
18
+ /** Agent-preset surface copy. */
19
+ 'settings.agentPreset': AgentPresetSettingsKey;
20
+ }
21
+ }
22
+ export type { AgentPresetLabelInjected, AgentPresetLabelProps } from './AgentPresetLabel.tsx';
23
+ export type { AgentPresetSeatInjected, AgentPresetSeatProps } from './AgentPresetSeat.tsx';
24
+ export type { AgentPresetSectionInjected, AgentPresetSectionProps } from './AgentPresetSection.tsx';
25
+ export type { AgentPresetSeatState } from './seat-store.ts';
26
+ export { draftBlocker, type AgentPresetSectionState, type CopyDraft, type PresetRow, type PresetView, } from './section-store.ts';
27
+ export type { AgentPresetOption, AgentPresetSettingsState } from './settings-store.ts';
28
+ export { AGENT_PRESET_SETTINGS_NS, writeDefaultPreset } from './settings-store.ts';
29
+ /** Required services (cordis fiber inject). */
30
+ export declare const inject: string[];
31
+ /**
32
+ * Mount the roster surfaces: hero chip, session-header label, settings section.
33
+ * @param ctx - the browser plugin context.
34
+ */
35
+ export declare function apply(ctx: ClientContext): void;
36
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,10 @@
1
+ /** Locale bundles for the agent-preset hero chip, header label, and management section. */
2
+ /** Locale keys these surfaces render. */
3
+ export type AgentPresetSettingsKey = 'error' | 'userTrust' | 'seatHint' | 'headerHint' | 'nav' | 'sectionIntro' | 'builtIn' | 'setDefault' | 'view' | 'presetStandardName' | 'presetStandardDescription' | 'presetPtcName' | 'presetPtcDescription' | 'presetCordisName' | 'presetCordisDescription' | 'duplicate' | 'duplicateUnavailable' | 'delete' | 'presetId' | 'presetIdPlaceholder' | 'copyOf' | 'displayName' | 'displayNamePlaceholder' | 'inUse' | 'selectionOffDefault' | 'noDescription' | 'builtInGroup' | 'customGroup' | 'brokenBadge' | 'brokenNoCopy' | 'switchRefused' | 'composition' | 'cancel' | 'close' | 'retry' | 'copyTitle' | 'copyIntro' | 'create' | 'creating' | 'creatorDraft' | 'createPlugin' | 'createPluginDescription' | 'createPluginChecking' | 'createPluginUnavailable' | 'createPluginMissing' | 'openLocation' | 'showLocation' | 'revealedPathLabel' | 'idRequired' | 'idInvalid' | 'idTaken' | 'deleteTitle' | 'deleteDescription' | 'deleteConfirm' | 'deleting' | 'showPicker' | 'showPickerBeta' | 'showPickerDescription' | 'enablePickerToSetDefault' | 'enablePickerToCreate';
4
+ /** English copy. */
5
+ export declare const en: Record<AgentPresetSettingsKey, string>;
6
+ /** Simplified Chinese copy. */
7
+ export declare const zh: Record<AgentPresetSettingsKey, string>;
8
+ export { presetDisplayText } from '@qilin-agent/agent-presets/display';
9
+ export type { PresetDisplaySource, PresetDisplayText } from '@qilin-agent/agent-presets/display';
10
+ //# sourceMappingURL=locales.d.ts.map
@@ -0,0 +1,121 @@
1
+ /**
2
+ * Hero-chip controller: which preset the NEXT session gets.
3
+ *
4
+ * The new-session screen has no session, so a pick is staged rather than
5
+ * applied. It reaches a session when one becomes current and is still blank —
6
+ * whether the workspace connect created it or reused an existing blank one,
7
+ * which is why staging cannot simply ride along on `sessions.create`.
8
+ *
9
+ * The stage is forgotten once applied. The next new session starts from the
10
+ * Host-effective default again.
11
+ */
12
+ import type { Context as ClientContext } from '@qilin-agent/kylin';
13
+ import type { SessionSummary } from '@qilin-agent/api-session-controller/client';
14
+ import { type SnapshotStore } from '@qilin-agent/client-store';
15
+ import type { AgentPresetOption } from './settings-store.ts';
16
+ /** Hero-chip snapshot. */
17
+ export interface AgentPresetSeatState {
18
+ /** Whether the new-session surface exposes preset selection. */
19
+ showPicker: boolean;
20
+ /** Presets the deployment supplies; empty means the chip renders nothing. */
21
+ options: readonly AgentPresetOption[];
22
+ /** The staged choice, empty until the roster loads. */
23
+ current: string;
24
+ /** An error message; explicit selection failures also carry the preset for a Toast. */
25
+ error: string | {
26
+ readonly preset: AgentPresetOption;
27
+ readonly reason: string;
28
+ } | null;
29
+ busy: boolean;
30
+ /**
31
+ * One-shot cue that the chip should introduce itself (the creator-draft
32
+ * entry staged the pick from another screen, so the user never touched the
33
+ * chip); the renderer clears it via `introduced()` once played.
34
+ */
35
+ introduce: boolean;
36
+ }
37
+ /** Mutable one-shot preset choice shared across Provider-bound seat controllers. */
38
+ export interface AgentPresetStage {
39
+ /** Preset awaiting application; absence means no staged choice. */
40
+ id: string | undefined;
41
+ /** Whether the receiving chip should announce the applied choice once. */
42
+ introduce: boolean;
43
+ }
44
+ /** Stages the next session's preset and applies it when one appears. */
45
+ export declare class AgentPresetSeatController {
46
+ private readonly ctx;
47
+ /** The session the hero is about to hand over to, when there is one. */
48
+ private readonly currentSession;
49
+ private readonly staged;
50
+ /** Chip snapshot the renderer subscribes to. */
51
+ readonly store: SnapshotStore<AgentPresetSeatState>;
52
+ /**
53
+ * The Host-effective default, so a consumed stage can fall back to it without
54
+ * re-reading the roster.
55
+ */
56
+ private fallback;
57
+ /** Only the newest roster read may publish after overlapping refreshes. */
58
+ private loadGeneration;
59
+ constructor(ctx: ClientContext,
60
+ /** The session the hero is about to hand over to, when there is one. */
61
+ currentSession: () => Pick<SessionSummary, 'id' | 'blank' | 'projectionValues'> | undefined, staged?: AgentPresetStage);
62
+ private set;
63
+ /**
64
+ * Read the roster and open the chip on the Host-effective default.
65
+ * @returns once the snapshot reflects the host.
66
+ */
67
+ load(): Promise<void>;
68
+ /**
69
+ * Stage one preset for the next session, applying it immediately when a
70
+ * blank session is already current.
71
+ *
72
+ * The refusal is returned as well as stored, because the two readers need
73
+ * different things from it: the chip's own label carries the standing state,
74
+ * while the caller that made this pick is the one that has to say why the
75
+ * label came back — and only it knows the pick was a person's, not the
76
+ * applier catching up with a session that just became current.
77
+ * @param id - the preset to stage.
78
+ * @returns the refusal text, or undefined once the pick settled.
79
+ */
80
+ select(id: string): Promise<string | undefined>;
81
+ /**
82
+ * Stage a pick WITHOUT the immediate apply, for a flow that starts the
83
+ * receiving session after the pick (the settings section's creator entry).
84
+ * `select()`'s immediate apply would meet the still-current running session
85
+ * and drop the stage as unservable; staging alone leaves it for the
86
+ * list-change applier, which fires when the started session becomes
87
+ * current.
88
+ * @param id - the preset to stage.
89
+ * @param introduce - true when the stage came from another screen and the
90
+ * chip should announce itself on the session it lands on.
91
+ */
92
+ stage(id: string, introduce?: boolean): void;
93
+ /**
94
+ * Capture the exact blank Session a Settings action may bring along.
95
+ * @returns its id, or undefined outside a blank Session.
96
+ */
97
+ blankSessionId(): SessionSummary['id'] | undefined;
98
+ /**
99
+ * Apply a Settings choice only if its captured Session is still current and
100
+ * blank. The selection uses the existing stage/apply path.
101
+ * @param expectedSessionId - blank Session captured before the Settings write.
102
+ * @param id - the effective default that the write persisted.
103
+ * @returns the Host refusal text, or undefined when applied or no longer relevant.
104
+ */
105
+ syncBlankSession(expectedSessionId: SessionSummary['id'], id: string): Promise<string | undefined>;
106
+ /** Acknowledge the introduction cue once the chip has played it. */
107
+ introduced(): void;
108
+ /** Acknowledge a displayed refusal without dismissing a newer attempt.
109
+ * @param refusal - the selection error whose Toast finished.
110
+ */
111
+ dismissRefusal(refusal: AgentPresetSeatState['error']): void;
112
+ /**
113
+ * Hand the staged choice to the current session, if there is one to take it.
114
+ *
115
+ * Called both by `select()` and by whoever observes the current session
116
+ * changing, because the session may appear either before or after the pick.
117
+ * @returns once the switch settled, or immediately when there is nothing to do.
118
+ */
119
+ apply(): Promise<void>;
120
+ }
121
+ //# sourceMappingURL=seat-store.d.ts.map
@@ -0,0 +1,212 @@
1
+ /**
2
+ * Agent-preset management controller: the roster as a list, a copy dialog as
3
+ * the only way a preset is created, and a read-only viewer over the shipped
4
+ * compositions.
5
+ *
6
+ * The browser edits no composition text. A new preset is a host-side copy of
7
+ * an existing one (`{ from, id, name? }` is all that crosses the wire), and
8
+ * everything after creation happens in the preset's own files — which is why
9
+ * the page's other job is getting the user TO those files: open the directory
10
+ * where the host has a desktop, show its path where it does not.
11
+ *
12
+ * The host stays the single fact source. Every mutation writes through the
13
+ * wire and the page re-reads the roster afterwards, because a copy changes
14
+ * more than the row it targeted.
15
+ */
16
+ import type { Context as ClientContext } from '@qilin-agent/kylin';
17
+ import { type SnapshotStore } from '@qilin-agent/client-store';
18
+ /** One preset row the page renders. */
19
+ export interface PresetRow {
20
+ /** Preset id and directory name; the display name falls back to it. */
21
+ id: string;
22
+ /** Display name the preset published, absent when it published none. */
23
+ name?: string;
24
+ /** One sentence on what the preset is for. */
25
+ description?: string;
26
+ /** Whether the preset ships with the deployment or was authored locally. */
27
+ trust: 'system' | 'user';
28
+ /** Whether a session that names no preset gets this one. */
29
+ isDefault: boolean;
30
+ /**
31
+ * Why the preset cannot compose a session, absent when it can. A broken
32
+ * row renders marked and unselectable — its directory still occupies the
33
+ * id, so deleting it (or fixing the files) is the way out, and this page
34
+ * is where both of those live.
35
+ */
36
+ broken?: string;
37
+ }
38
+ /** The copy dialog: a new id and optional display name over a fixed source. */
39
+ export interface CopyDraft {
40
+ /** The preset being copied. */
41
+ from: string;
42
+ /** Display name of the source, for the dialog title. */
43
+ fromTitle: string;
44
+ /** New preset id being typed; the directory name, so it is required. */
45
+ id: string;
46
+ /** Display name being typed; empty falls back to the id. */
47
+ name: string;
48
+ /** Whether the copy is in flight. */
49
+ saving: boolean;
50
+ /** The last copy failure, cleared by the next edit. */
51
+ error: string | null;
52
+ }
53
+ /** The read-only composition viewer over one shipped preset. */
54
+ export interface PresetView {
55
+ /** The preset whose composition is shown. */
56
+ id: string;
57
+ /** Display name, for the dialog title. */
58
+ title: string;
59
+ /** Composition text exactly as stored. */
60
+ content: string;
61
+ }
62
+ /** Page snapshot. */
63
+ export interface AgentPresetSectionState {
64
+ status: 'idle' | 'loading' | 'ready' | 'unavailable' | 'error';
65
+ /** Whole-load failure text; a copy failure stays on the dialog. */
66
+ error: string | null;
67
+ /** Whether the deployment configures a root new presets can be written to. */
68
+ authorable: boolean;
69
+ /** Whether the host can open a preset directory on a native desktop. */
70
+ hasDocument: boolean;
71
+ /** Whether new-session surfaces expose preset selection. */
72
+ showPicker: boolean;
73
+ /** Whether a mode-selection policy write is in flight. */
74
+ policySaving: boolean;
75
+ /** Every preset the deployment currently supplies. */
76
+ rows: readonly PresetRow[];
77
+ /** The open copy dialog, or null. */
78
+ copy: CopyDraft | null;
79
+ /** The open read-only viewer, or null. */
80
+ view: PresetView | null;
81
+ /** The preset awaiting delete confirmation. */
82
+ pendingDelete: string | null;
83
+ /** Whether a delete is in flight. */
84
+ deleting: boolean;
85
+ /**
86
+ * Preset directories shown as text because the host has no desktop opener
87
+ * — the answer `openDocument` gives instead of opening.
88
+ */
89
+ revealedPaths: Readonly<Record<string, string>>;
90
+ }
91
+ /**
92
+ * Why this copy cannot be submitted yet, as a locale key, or undefined when
93
+ * it can. Client-side only: the host re-checks the id and its answer is what
94
+ * the dialog reports on failure.
95
+ * @param draft - the open copy dialog.
96
+ * @param rows - the roster, for the collision check.
97
+ * @returns the blocking reason's locale key, or undefined when submittable.
98
+ */
99
+ export declare function draftBlocker(draft: CopyDraft, rows: readonly PresetRow[]): 'idRequired' | 'idInvalid' | 'idTaken' | undefined;
100
+ /** Reads the roster and drives the copy dialog, viewer, and location reveals. */
101
+ export declare class AgentPresetSectionController {
102
+ private readonly ctx;
103
+ /**
104
+ * Called after this page changes the roster DIRECTORY, so the other
105
+ * surfaces reading the same roster re-read it. A settings field moving is
106
+ * already announced by the host through the forwarded
107
+ * `settings/document-updated`; a directory copied or deleted here is not,
108
+ * and the new-session chip has no other way to learn a preset it should
109
+ * offer now exists.
110
+ */
111
+ private readonly rosterChanged;
112
+ /** Page snapshot the renderer subscribes to. */
113
+ readonly store: SnapshotStore<AgentPresetSectionState>;
114
+ /** The one roster load whose completion current callers await. */
115
+ private loadFlight;
116
+ private reloadRequested;
117
+ constructor(ctx: ClientContext,
118
+ /**
119
+ * Called after this page changes the roster DIRECTORY, so the other
120
+ * surfaces reading the same roster re-read it. A settings field moving is
121
+ * already announced by the host through the forwarded
122
+ * `settings/document-updated`; a directory copied or deleted here is not,
123
+ * and the new-session chip has no other way to learn a preset it should
124
+ * offer now exists.
125
+ */
126
+ rosterChanged?: () => void);
127
+ private set;
128
+ /** Read back and reflect the Host-effective default after a policy write. */
129
+ private confirmEffectiveDefault;
130
+ /**
131
+ * Show or hide new-session preset selection without changing the saved
132
+ * default. The Host roster resolves that saved default while selection is
133
+ * shown and the deployment default while it is hidden.
134
+ * @param showPicker - whether the new-session picker should be exposed.
135
+ * @param syncBlankSession - optional current-blank-task sync kept inside the saving state.
136
+ * @returns once the Host state and optional blank-task sync settle.
137
+ */
138
+ setPickerVisible(showPicker: boolean, syncBlankSession?: (id: string) => Promise<string | undefined>): Promise<void>;
139
+ private patchCopy;
140
+ /**
141
+ * Load the roster. An empty roster means the deployment composes no
142
+ * presets, which is a valid deployment rather than a failure — the section
143
+ * reports `unavailable` and renders nothing.
144
+ * @returns once the snapshot reflects the host.
145
+ */
146
+ load(): Promise<void>;
147
+ /** Coalesce invalidations without losing changes received during a read. */
148
+ private drainLoads;
149
+ /** Perform the section's one owned roster read. */
150
+ private loadOnce;
151
+ /**
152
+ * Open one shipped preset's composition in the read-only viewer.
153
+ * @param id - the preset to view.
154
+ * @returns once the composition loaded or the failure is on the page.
155
+ */
156
+ view(id: string): Promise<void>;
157
+ /** Close the read-only viewer. */
158
+ closeView(): void;
159
+ /**
160
+ * Open the copy dialog over one preset.
161
+ * @param from - the preset the copy will start from.
162
+ */
163
+ beginCopy(from: string): void;
164
+ /** Close the copy dialog, discarding whatever was typed. */
165
+ cancelCopy(): void;
166
+ /**
167
+ * Name the preset the copy creates.
168
+ * @param id - the id typed into the dialog.
169
+ */
170
+ setCopyId(id: string): void;
171
+ /**
172
+ * Name the copy's display name.
173
+ * @param name - the display name typed into the dialog.
174
+ */
175
+ setCopyName(name: string): void;
176
+ /**
177
+ * Submit the copy, re-read the roster, then take the user to the new
178
+ * preset's files — the directory opens where the host has a desktop, and
179
+ * its path appears on the new row where it does not.
180
+ * @returns once the copy settled and the page reflects it.
181
+ */
182
+ confirmCopy(): Promise<void>;
183
+ /**
184
+ * Open one preset's directory on the host desktop, or reveal its path on
185
+ * the row where the deployment has no opener to hand it to.
186
+ * @param id - the preset whose files the user wants.
187
+ * @returns once the host answered and the page reflects it.
188
+ */
189
+ openLocation(id: string): Promise<void>;
190
+ /**
191
+ * Ask for confirmation before deleting one preset.
192
+ * @param id - the preset to delete, or null to dismiss the confirmation.
193
+ */
194
+ confirmDelete(id: string | null): void;
195
+ /**
196
+ * Delete the preset awaiting confirmation, then re-read the roster.
197
+ *
198
+ * A session already composed from it keeps running: its composition was
199
+ * mounted at creation and nothing re-reads the file.
200
+ * @returns once the delete settled and the page reflects it.
201
+ */
202
+ remove(): Promise<void>;
203
+ /**
204
+ * Make one preset the default for sessions created later. Running sessions
205
+ * keep the composition they began with, so this never disturbs work.
206
+ * @param id - the preset to make default.
207
+ * @param syncBlankSession - optional current-blank-task sync kept inside the policy lock.
208
+ * @returns once the write and optional blank-task sync settle.
209
+ */
210
+ makeDefault(id: string, syncBlankSession?: (id: string) => Promise<string | undefined>): Promise<void>;
211
+ }
212
+ //# sourceMappingURL=section-store.d.ts.map