@x1a0f3n9/dsh-client-ui-commands 0.1.5-rc.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,12 @@
1
+ //#region lib/types/index.js
2
+ /**
3
+ * Command UI plugin, node half. Pure UI plugin: the empty apply exists so
4
+ * the plugin appears in the host cordis.yml / Loader; the browser half ships
5
+ * via exports["./client"], discovered through the package.json dsh.client
6
+ * declaration. The host command registry itself mounts separately
7
+ * (bootHost + CommandUiRuntime).
8
+ */
9
+ /** Host plugin body — no host-side behavior for the command UI plugin. */
10
+ function apply() {}
11
+ //#endregion
12
+ export { apply };
@@ -0,0 +1,16 @@
1
+ import type { PropsLocale } from '@x1a0f3n9/dsh-client-ui-slots';
2
+ import type { PopupSelectController } from './popup.ts';
3
+ /** Injected business face of the popupSelect overlay entry. */
4
+ export interface PopupSelectInjected {
5
+ /** The session's shell controller (state store + verbs; the view never touches the open-context type). */
6
+ popup: PopupSelectController;
7
+ }
8
+ /** Full shell props: injected face + the locale seat. */
9
+ export type PopupSelectViewProps = PopupSelectInjected & PropsLocale<'command'>;
10
+ /**
11
+ * Render the popupSelect shell overlay entry.
12
+ * @param props - injected face: the session's shell controller; `t` rides the standard locale seat.
13
+ * @returns the select card while open; null while closed.
14
+ */
15
+ export declare function PopupSelectView({ popup, t }: PopupSelectViewProps): import("react").JSX.Element | null;
16
+ //# sourceMappingURL=PopupSelectView.d.ts.map
@@ -0,0 +1,106 @@
1
+ /**
2
+ * Frozen contract of the client command surface. Types only. The
3
+ * CommandUiRuntime (`ctx.commandUi`) implements this face; business packages
4
+ * consume `register` alone.
5
+ */
6
+ import type { ComponentType } from 'react';
7
+ import type { Context as ClientContext } from '@deepseek-ai/cordis';
8
+ import type { ClientSessionContext } from '@x1a0f3n9/dsh-client-ui-input-trigger/client';
9
+ import type { IconProps } from '@x1a0f3n9/dsh-client-ui-primitives';
10
+ /** Copy for an option that must be acknowledged before onSelect can run. */
11
+ export interface SelectConfirmation {
12
+ readonly title: string;
13
+ readonly description: string;
14
+ readonly acknowledgeLabel: string;
15
+ readonly cancelLabel: string;
16
+ readonly confirmLabel: string;
17
+ }
18
+ /** One option row of a popupSelect shell. */
19
+ export interface SelectOption {
20
+ readonly id: string;
21
+ readonly label: string;
22
+ readonly detail?: string;
23
+ readonly active?: boolean;
24
+ /** Optional in-page risk gate owned by the shared popup shell. */
25
+ readonly confirmation?: SelectConfirmation;
26
+ }
27
+ /**
28
+ * Business registration for the popupSelect command kind. Data is
29
+ * self-served: options/onSelect use the business package's own protocol.
30
+ * The shell component is owned by ui-commands; business never sees it. Both
31
+ * callbacks receive the ClientSessionContext captured at popup open.
32
+ */
33
+ export interface PopupSelectSpec {
34
+ readonly kind: 'popupSelect';
35
+ options(session: ClientSessionContext, signal: AbortSignal): Promise<readonly SelectOption[]>;
36
+ onSelect(option: SelectOption, session: ClientSessionContext): void | Promise<void>;
37
+ }
38
+ /**
39
+ * Business registration for the action command kind: a bare invocation
40
+ * consumes the trigger token and runs one client-side callback. It submits nothing, so an
41
+ * attachment-carrying draft never refuses it.
42
+ */
43
+ export interface ActionSpec {
44
+ readonly kind: 'action';
45
+ /**
46
+ * Run the action for one session.
47
+ * @param session - the ClientSessionContext captured at invocation.
48
+ */
49
+ run(session: ClientSessionContext): void;
50
+ }
51
+ /** The UI behavior of a contribution or decoration. */
52
+ export type CommandUiSpec = PopupSelectSpec | ActionSpec;
53
+ /**
54
+ * One client-owned command contribution: a slash-menu entry whose behavior
55
+ * lives entirely on the client (no host descriptor). Merged with the host
56
+ * catalog by name — a collision with a host command fails loud at candidate
57
+ * synthesis, never shadows. Row copy is read on every candidate pass, so a
58
+ * locale change reaches the next menu open without re-registration.
59
+ */
60
+ export interface CommandContribution {
61
+ /** Command name without the leading slash (unique across contributions). */
62
+ readonly name: string;
63
+ /** Localized menu row title; the name itself when absent. */
64
+ label?(): string;
65
+ /** Localized menu row description; the row shows none when absent. */
66
+ description?(): string;
67
+ /** Menu row glyph from the shared icon set. */
68
+ readonly icon?: ComponentType<IconProps>;
69
+ /** Capability filter, called with a fresh projection per candidate pass. */
70
+ available(session: ClientSessionContext): boolean;
71
+ /** The command's UI behavior. */
72
+ readonly ui: CommandUiSpec;
73
+ }
74
+ /**
75
+ * A UI decoration hung on one HOST command: what its BARE invocation does on
76
+ * this client. Not a second command — the host command keeps its catalog
77
+ * row, its argument claim (space / argued enter), and its lifecycle logging;
78
+ * the decoration replaces only the bare menu-pick/enter with a popup whose
79
+ * onSelect typically submits a completed line back through command.execute.
80
+ * A decoration never manufactures a row: a name with no host catalog entry
81
+ * in the session's directory simply never reaches the decoration.
82
+ */
83
+ export interface CommandDecoration {
84
+ /** The HOST command name this decorates (without the leading slash). */
85
+ readonly name: string;
86
+ /** Capability filter, called with a fresh projection per bare invocation. */
87
+ available(session: ClientSessionContext): boolean;
88
+ /** The bare-invocation UI. */
89
+ readonly ui: CommandUiSpec;
90
+ }
91
+ /** The `ctx.commandUi` service face visible to business packages. */
92
+ export interface CommandUiContract {
93
+ /**
94
+ * Register one client command contribution; effect disposer. Duplicate
95
+ * names throw at registration.
96
+ */
97
+ register(contribution: CommandContribution): () => void;
98
+ /**
99
+ * Hang a bare-invocation decoration on one host command; effect disposer.
100
+ * Duplicate names throw at registration.
101
+ */
102
+ decorate(decoration: CommandDecoration): () => void;
103
+ /** Resolve the per-session popup controller for one session scope (wiring/overlay layer). */
104
+ popupFor(actx: ClientContext): unknown;
105
+ }
106
+ //# sourceMappingURL=contract.d.ts.map
@@ -0,0 +1,75 @@
1
+ /**
2
+ * Command-directory cache keyed by session: one entry per served catalog —
3
+ * every session is agent-backed, so `command.list({sessionId})` is the only
4
+ * request fields. Each entry keeps the single-flight / soft-hard invalidation
5
+ * / epoch-guard behavior of the original global cache; the session-key axis
6
+ * is the only extra dimension.
7
+ */
8
+ import type { CommandDescriptor } from '@x1a0f3n9/dsh-commands/types';
9
+ import type { SessionId } from '@x1a0f3n9/dsh-session/types';
10
+ export type { CommandDescriptor } from '@x1a0f3n9/dsh-commands/types';
11
+ /**
12
+ * cold = never pulled; pending = pull in flight with nothing servable;
13
+ * ready = snapshot serving (a soft-invalidate repull keeps this status);
14
+ * failed = last winning pull rejected, snapshot dropped.
15
+ */
16
+ export type DirectoryStatus = 'cold' | 'pending' | 'ready' | 'failed';
17
+ /** Injected pull (the service binds command.list off the root connection). */
18
+ export type FetchCommands = (sessionId: SessionId) => Promise<readonly CommandDescriptor[]>;
19
+ /** The session-keyed directory cache. Plain class — the owning service wires events and RPC. */
20
+ export declare class CommandDirectory {
21
+ private readonly fetchCommands;
22
+ private readonly entries;
23
+ constructor(fetchCommands: FetchCommands);
24
+ /**
25
+ * Current cache status for one session.
26
+ * @param sessionId - session key.
27
+ * @returns the entry status (cold when never touched).
28
+ */
29
+ status(sessionId: SessionId): DirectoryStatus;
30
+ /**
31
+ * Synchronous command lookup over one Session's ready catalog; exact names precede localized aliases.
32
+ * @param sessionId - session key.
33
+ * @param name - typed command spelling without the leading slash.
34
+ * @returns the descriptor, or undefined when absent or the entry is not ready.
35
+ */
36
+ resolve(sessionId: SessionId, name: string): CommandDescriptor | undefined;
37
+ /** Soft invalidation (commands-changed): background repull on every touched key; ready snapshots keep serving. */
38
+ invalidateAll(): void;
39
+ /**
40
+ * Drop one Session's obsolete composition-specific snapshot and prewarm its replacement.
41
+ * @param sessionId - Session whose effective command composition changed.
42
+ */
43
+ resetSession(sessionId: SessionId): void;
44
+ /**
45
+ * Hard reset on reconnect: every entry drops its snapshot (the agent world
46
+ * may have changed shape across the generation) and prewarms.
47
+ */
48
+ resetConnected(): void;
49
+ /**
50
+ * Fire-and-forget prewarm of one session (the command source's scope-birth
51
+ * warm hook lands here).
52
+ * @param sessionId - session key.
53
+ */
54
+ warm(sessionId: SessionId): void;
55
+ /**
56
+ * Start one pull for one session. Publishes ready/failed only while it is
57
+ * still the key's latest pull (epoch guard); a ready snapshot is not
58
+ * demoted while the pull flies.
59
+ * @param sessionId - session key.
60
+ * @returns settled when this pull's outcome is published or discarded.
61
+ */
62
+ refresh(sessionId: SessionId): Promise<void>;
63
+ /**
64
+ * Strong-wait until one session's catalog is servable (the enter-
65
+ * adjudication "directory must be reached" rule): ready returns at once;
66
+ * cold/failed launch a fresh pull; pending joins the flying one. Rejects
67
+ * when the awaited pull fails or the signal aborts.
68
+ * @param sessionId - session key.
69
+ * @param signal - attempt-scoped abort (the SubmitAttempt signal).
70
+ * @returns the hot command snapshot.
71
+ */
72
+ ensureReady(sessionId: SessionId, signal: AbortSignal): Promise<readonly CommandDescriptor[]>;
73
+ private entry;
74
+ }
75
+ //# sourceMappingURL=directory.d.ts.map
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Command UI plugin, browser half: CommandUiRuntime (`ctx.commandUi`) owning the
3
+ * capability-keyed directory cache, the '/' command source, the client
4
+ * contribution registry, and the per-session popupSelect controllers; the
5
+ * popupSelect shell self-registers into conversation.input.overlay with
6
+ * per-session resolution.
7
+ */
8
+ import type { Context as ClientContext } from '@deepseek-ai/cordis';
9
+ import { CommandUiRuntime } from './service.ts';
10
+ import { type CommandKey } from './locales.ts';
11
+ export { CommandUiRuntime } from './service.ts';
12
+ export { CommandDirectory } from './directory.ts';
13
+ export type { CommandDescriptor, DirectoryStatus } from './directory.ts';
14
+ export { filterOptions, PopupSelectController } from './popup.ts';
15
+ export type { PopupSelectDeps, PopupSpec, PopupState, TokenSegment } from './popup.ts';
16
+ export type { PopupSelectInjected, PopupSelectViewProps } from './PopupSelectView.tsx';
17
+ export type { ActionSpec, CommandContribution, CommandDecoration, CommandUiContract, CommandUiSpec, PopupSelectSpec, SelectConfirmation, SelectOption, } from './contract.ts';
18
+ export type { CommandKey } from './locales.ts';
19
+ declare module '@deepseek-ai/cordis' {
20
+ interface Context {
21
+ commandUi: CommandUiRuntime;
22
+ }
23
+ }
24
+ declare module '@x1a0f3n9/dsh-client-ui-slots' {
25
+ interface LocaleNamespaceMap {
26
+ /** The menu rows' and the popupSelect shell's copy. */
27
+ command: CommandKey;
28
+ }
29
+ }
30
+ /** Required services: the '/' source registry, session scopes, commands Remote, and locale registry. */
31
+ export declare const inject: string[];
32
+ /**
33
+ * Mount the command service and its per-session popupSelect overlay.
34
+ * @param ctx - client root context.
35
+ */
36
+ export declare function apply(ctx: ClientContext): void;
37
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,71 @@
1
+ /**
2
+ * `command` namespace dictionaries: the composer menu's section headings,
3
+ * the client face (title, description, claim token) of the built-in Host
4
+ * commands whose catalog descriptors carry English text only, and the
5
+ * popupSelect shell's copy.
6
+ */
7
+ /** Simplified Chinese dictionary (the key-set source of truth). */
8
+ export declare const zh: {
9
+ 'section.add': string;
10
+ 'section.commands': string;
11
+ 'label.goal': string;
12
+ 'label.plan': string;
13
+ 'label.feedback': string;
14
+ 'label.compact': string;
15
+ 'label.permission': string;
16
+ 'label.export': string;
17
+ 'description.goal': string;
18
+ 'description.plan': string;
19
+ 'description.feedback': string;
20
+ 'description.compact': string;
21
+ 'description.permission': string;
22
+ 'description.export': string;
23
+ 'token.goal': string;
24
+ 'token.plan': string;
25
+ 'token.feedback': string;
26
+ 'token.compact': string;
27
+ 'token.permission': string;
28
+ 'token.export': string;
29
+ 'search.placeholder': string;
30
+ 'search.aria': string;
31
+ 'status.loading': string;
32
+ 'status.applying': string;
33
+ 'status.empty': string;
34
+ 'overlay.aria': string;
35
+ 'listbox.aria': string;
36
+ 'notice.attachmentsUnsupported': string;
37
+ };
38
+ /** The command namespace key union. */
39
+ export type CommandKey = keyof typeof zh;
40
+ /** English dictionary, checked complete against the zh key set. */
41
+ export declare const en: {
42
+ 'section.add': string;
43
+ 'section.commands': string;
44
+ 'label.goal': string;
45
+ 'label.plan': string;
46
+ 'label.feedback': string;
47
+ 'label.compact': string;
48
+ 'label.permission': string;
49
+ 'label.export': string;
50
+ 'description.goal': string;
51
+ 'description.plan': string;
52
+ 'description.feedback': string;
53
+ 'description.compact': string;
54
+ 'description.permission': string;
55
+ 'description.export': string;
56
+ 'token.goal': string;
57
+ 'token.plan': string;
58
+ 'token.feedback': string;
59
+ 'token.compact': string;
60
+ 'token.permission': string;
61
+ 'token.export': string;
62
+ 'search.placeholder': string;
63
+ 'search.aria': string;
64
+ 'status.loading': string;
65
+ 'status.applying': string;
66
+ 'status.empty': string;
67
+ 'overlay.aria': string;
68
+ 'listbox.aria': string;
69
+ 'notice.attachmentsUnsupported': string;
70
+ };
71
+ //# sourceMappingURL=locales.d.ts.map
@@ -0,0 +1,154 @@
1
+ import type { SnapshotStore } from '@x1a0f3n9/dsh-client-store';
2
+ import type { TokenSpan } from '@x1a0f3n9/dsh-client-ui-input-trigger/client';
3
+ import type { SelectOption } from './contract.ts';
4
+ /**
5
+ * The command token segment snapshotted at shell-open time, replayed to the
6
+ * injected {@link PopupSelectDeps.consume} callback after a successful
7
+ * selection. The Input side guards it: a menu-path span consumes iff draftRev
8
+ * is unchanged, an enter-path line iff the trimmed draft still equals the
9
+ * bare token.
10
+ */
11
+ export type TokenSegment = {
12
+ readonly via: 'menu';
13
+ readonly span: TokenSpan;
14
+ } | {
15
+ readonly via: 'enter';
16
+ readonly token: string;
17
+ };
18
+ /**
19
+ * Structural business spec the shell settles against — the popupSelect half
20
+ * of CommandUiSpec, generic in the context value the opener captures (the
21
+ * session wiring passes its session projection; the controller only carries
22
+ * it from open() to the callbacks).
23
+ */
24
+ export interface PopupSpec<TCtx> {
25
+ /** Load the option rows once per open (retry after failure reuses the same signal). */
26
+ options(context: TCtx, signal: AbortSignal): Promise<readonly SelectOption[]>;
27
+ /** Settle the picked option against the open-time context. */
28
+ onSelect(option: SelectOption, context: TCtx): void | Promise<void>;
29
+ }
30
+ /** Injected session-wiring callbacks of one controller (tests pass fakes). */
31
+ export interface PopupSelectDeps {
32
+ /**
33
+ * Consume the open-time token segment after a successful onSelect (the
34
+ * wiring dispatches the consume-token event to the opening session).
35
+ * @param segment - the open-time token segment snapshot.
36
+ * @returns whether the token was consumed; false (CAS miss) is benign and
37
+ * never retried.
38
+ */
39
+ consume(segment: TokenSegment): boolean;
40
+ /** Return focus to the session composer (successful settle and Escape close paths). */
41
+ focusComposer(): void;
42
+ }
43
+ /** Popup shell state (the shell component renders from here; closed = render null). */
44
+ export interface PopupState {
45
+ readonly open: boolean;
46
+ /** Command name the shell is open for (null while closed). */
47
+ readonly command: string | null;
48
+ /** Options-load lifecycle; 'failed' keeps the shell open for retry(). */
49
+ readonly status: 'pending' | 'ready' | 'failed';
50
+ /** Options as loaded — never re-fetched per keystroke; views render {@link filterOptions} over them. */
51
+ readonly options: readonly SelectOption[];
52
+ /** Local filter text over the loaded options. */
53
+ readonly search: string;
54
+ /** Highlight index into the filtered row list (0 when empty/pending). */
55
+ readonly active: number;
56
+ /** A select() settlement is in flight: further select/search/highlight no-op until it settles. */
57
+ readonly submitting: boolean;
58
+ /** Option waiting for explicit risk acknowledgement; null during normal selection. */
59
+ readonly confirming: SelectOption | null;
60
+ /** Caller-controlled checkbox state for the pending confirmation. */
61
+ readonly acknowledged: boolean;
62
+ /** Surfaced settlement failure (options load or onSelect); null when none. */
63
+ readonly error: string | null;
64
+ }
65
+ /**
66
+ * Filter option rows against the shell's local search text (case-insensitive
67
+ * substring over label and detail; blank search keeps every row).
68
+ * @param options - the loaded rows.
69
+ * @param search - the shell's search text.
70
+ * @returns the rows the shell shows and highlights over.
71
+ */
72
+ export declare function filterOptions(options: readonly SelectOption[], search: string): readonly SelectOption[];
73
+ /**
74
+ * Headless controller of one session's popupSelect shell. Late settlements
75
+ * lose their write rights through binding identity: dismiss/dispose/reopen
76
+ * swap the binding, so a settling options fetch or onSelect that no longer
77
+ * matches writes nothing and consumes nothing.
78
+ */
79
+ export declare class PopupSelectController<TCtx = unknown> {
80
+ private readonly deps;
81
+ /** Shell state store (the overlay component subscribes here). */
82
+ readonly state: SnapshotStore<PopupState>;
83
+ private binding;
84
+ /**
85
+ * @param deps - session-wiring callbacks (token consumption + composer focus).
86
+ */
87
+ constructor(deps: PopupSelectDeps);
88
+ /**
89
+ * Open the shell for one command: publish pending state and fetch options
90
+ * once through the business spec. A reopen supersedes the previous shell
91
+ * (its options fetch is aborted, its late settlements are dropped).
92
+ * @param command - command name the shell serves.
93
+ * @param spec - the registered popupSelect spec.
94
+ * @param context - open-time context snapshot, handed verbatim to options/onSelect.
95
+ * @param segment - open-time token segment snapshot for post-select consumption.
96
+ */
97
+ open(command: string, spec: PopupSpec<TCtx>, context: TCtx, segment: TokenSegment): void;
98
+ /** Run the one options fetch of a binding; settlement rights die with the binding. */
99
+ private load;
100
+ /** Re-run a failed options fetch (search survives; no-op unless status is 'failed'). */
101
+ retry(): void;
102
+ /**
103
+ * Replace the local search text (pure local filter — the provider is never
104
+ * re-queried) and rebase the highlight onto the new filtered list.
105
+ * @param search - the shell search input's text.
106
+ */
107
+ setSearch(search: string): void;
108
+ /**
109
+ * Move the highlight across the filtered rows (wraps around; no-op unless
110
+ * options are ready and no selection is in flight).
111
+ * @param dir - +1 down, -1 up.
112
+ */
113
+ move(dir: 1 | -1): void;
114
+ /**
115
+ * Set the highlight directly (pointer hover; no-op unless ready, idle, and
116
+ * in filtered range).
117
+ * @param index - filtered-row index.
118
+ */
119
+ highlight(index: number): void;
120
+ /**
121
+ * Select one filtered row: single-flight — the first call enters
122
+ * `submitting` and later calls no-op until it settles. Success consumes the
123
+ * open-time token segment (a false CAS answer is benign), closes, and
124
+ * returns focus to the composer. Failure keeps the shell open with search,
125
+ * highlight, and token intact, surfaces the error, and re-arms select as
126
+ * the retry.
127
+ * @param index - filtered-row index (callers pass the highlight or the clicked row).
128
+ * @returns settled when the attempt has closed the shell or surfaced its failure.
129
+ */
130
+ select(index: number): Promise<void>;
131
+ /**
132
+ * Update the explicit checkbox for the currently pending risk gate.
133
+ * @param acknowledged - whether the user has acknowledged the displayed risk.
134
+ */
135
+ acknowledge(acknowledged: boolean): void;
136
+ /** Cancel only the risk gate and return to the still-open option picker. */
137
+ cancelConfirmation(): void;
138
+ /** Settle the gated option only after the checkbox is acknowledged. */
139
+ confirm(): Promise<void>;
140
+ /** Run the business settlement for an already admitted option. */
141
+ private settle;
142
+ /**
143
+ * Close the shell; aborts a flying options fetch and revokes settlement
144
+ * rights. An outside pointer interaction dismisses plainly (the click's own
145
+ * target takes focus); Escape passes focusComposer to return focus explicitly.
146
+ * @param opts - focusComposer: also restore composer focus (Escape path).
147
+ */
148
+ dismiss(opts?: {
149
+ readonly focusComposer?: boolean;
150
+ }): void;
151
+ /** Scope-teardown disposer: abort in-flight work and clear state (no focus side effect). */
152
+ dispose(): void;
153
+ }
154
+ //# sourceMappingURL=popup.d.ts.map
@@ -0,0 +1,23 @@
1
+ import type { InputTriggerCandidate } from '@x1a0f3n9/dsh-client-ui-input-trigger/client';
2
+ import type { TranslateNS } from '@x1a0f3n9/dsh-client-locale/client';
3
+ import type { CommandDescriptor } from '@x1a0f3n9/dsh-commands/types';
4
+ /** The menu's two sections. */
5
+ export type MenuSection = 'add' | 'commands';
6
+ /**
7
+ * The localized menu face of a catalog row.
8
+ * @param descriptor - effective Host command descriptor.
9
+ * @param t - the `command` namespace translator.
10
+ * @returns title, description, and glyph for a built-in command; undefined
11
+ * for any other row, which keeps its catalog description.
12
+ */
13
+ export declare function builtinRowFace(descriptor: CommandDescriptor, t: TranslateNS<'command'>): Pick<InputTriggerCandidate, 'label' | 'description' | 'icon'> | undefined;
14
+ /**
15
+ * Arrange the empty-query menu: the Add section, then the Commands section,
16
+ * each in usage order, with unlisted rows closing Commands in their input
17
+ * order; each row carries its section heading.
18
+ * @param rows - the visible candidates in catalog-then-contribution order.
19
+ * @param t - the `command` namespace translator.
20
+ * @returns the sectioned rows.
21
+ */
22
+ export declare function sectionRows(rows: readonly InputTriggerCandidate[], t: TranslateNS<'command'>): readonly InputTriggerCandidate[];
23
+ //# sourceMappingURL=presentation.d.ts.map
@@ -0,0 +1,35 @@
1
+ /** Command identity and localized input spelling over the effective Host catalog. */
2
+ import type { CommandDescriptor } from '@x1a0f3n9/dsh-commands/types';
3
+ import type { TranslateNS } from '@x1a0f3n9/dsh-client-locale/client';
4
+ declare const BUILTINS: {
5
+ readonly goal: "@x1a0f3n9/dsh-command-goal";
6
+ readonly plan: "@x1a0f3n9/dsh-plan-mode";
7
+ readonly feedback: "@x1a0f3n9/dsh-command-feedback";
8
+ readonly compact: "@x1a0f3n9/dsh-command-compact";
9
+ readonly permission: "@x1a0f3n9/dsh-permission-presets";
10
+ readonly export: "@x1a0f3n9/dsh-session-log-export";
11
+ };
12
+ /** Names whose first-party definitions have localized client presentation. */
13
+ export type BuiltinCommandName = keyof typeof BUILTINS;
14
+ /**
15
+ * Identify a first-party definition without interpreting its display copy.
16
+ * @param descriptor - effective Host descriptor after scoped shadowing.
17
+ * @returns its first-party name, or undefined for another definition.
18
+ */
19
+ export declare function builtinCommandName(descriptor: CommandDescriptor): BuiltinCommandName | undefined;
20
+ /**
21
+ * Select the input spelling for a menu-picked command.
22
+ * @param descriptor - effective Host descriptor.
23
+ * @param t - command-namespace translator.
24
+ * @returns localized spelling for a known definition, otherwise its registered name.
25
+ */
26
+ export declare function claimToken(descriptor: CommandDescriptor, t: TranslateNS<'command'>): string;
27
+ /**
28
+ * Resolve typed spelling against the current Session's effective definitions.
29
+ * @param token - typed name without its leading slash.
30
+ * @param descriptors - effective descriptors in the Session's ready catalog.
31
+ * @returns the matching descriptor; aliases never select an unrelated scoped override.
32
+ */
33
+ export declare function resolveCommand(token: string, descriptors: readonly CommandDescriptor[]): CommandDescriptor | undefined;
34
+ export {};
35
+ //# sourceMappingURL=resolution.d.ts.map