@qilin-agent/client-ui-settings-plugins 0.0.0-stage → 3.1.4

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,13 @@
1
+ //#region lib/types/index.js
2
+ /**
3
+ * Plugins settings surface, node half. The empty apply exists so the plugin
4
+ * appears in the host cordis.yml / Loader; the browser half owns the section
5
+ * and its configurable tab through exports["./client"], discovered from the
6
+ * package.json qilin.client declaration. Every section this page edits is owned
7
+ * by the Host plugin that registered it, so this package registers no
8
+ * namespace of its own.
9
+ */
10
+ /** Host plugin body — no host-side behavior for this surface plugin. */
11
+ function apply() {}
12
+ //#endregion
13
+ export { apply };
@@ -0,0 +1,12 @@
1
+ /** The agent loop's configuration page: how many tool calls one step may run at once. */
2
+ import type { InjectFace, PropsLocale, PropsRuntime } from '@qilin-agent/client-ui-slots';
3
+ import type { AgentLoopCardFace } from './agent-loop-card-controller.ts';
4
+ /** Props the renderer binds for the agent-loop page. */
5
+ export type AgentLoopCardProps = PropsRuntime<'plugins.item'> & PropsLocale<'settings.plugins'> & InjectFace<AgentLoopCardFace>;
6
+ /**
7
+ * Render the agent loop's one-liner or its configuration form, as the Plugins page asks.
8
+ * @param props - the view asked for, locale copy, the form snapshot, and its actions.
9
+ * @returns the one-liner, or the form.
10
+ */
11
+ export declare function AgentLoopCard(props: AgentLoopCardProps): string | import("react").JSX.Element;
12
+ //# sourceMappingURL=AgentLoopCard.d.ts.map
@@ -0,0 +1,12 @@
1
+ /** The shell plugin's configuration page: the limits every command the agent runs is bound by. */
2
+ import type { InjectFace, PropsLocale, PropsRuntime } from '@qilin-agent/client-ui-slots';
3
+ import type { BashCardFace } from './bash-card-controller.ts';
4
+ /** Props the renderer binds for the shell page. */
5
+ export type BashCardProps = PropsRuntime<'plugins.item'> & PropsLocale<'settings.plugins'> & InjectFace<BashCardFace>;
6
+ /**
7
+ * Render the shell plugin's one-liner or its configuration form, as the Plugins page asks.
8
+ * @param props - the view asked for, locale copy, the form snapshot, and its actions.
9
+ * @returns the one-liner, or the form.
10
+ */
11
+ export declare function BashCard(props: BashCardProps): string | import("react").JSX.Element;
12
+ //# sourceMappingURL=BashCard.d.ts.map
@@ -0,0 +1,12 @@
1
+ /** The Git plugin's configuration page: the binaries and limits every repository and pull-request call is bound by. */
2
+ import type { InjectFace, PropsLocale, PropsRuntime } from '@qilin-agent/client-ui-slots';
3
+ import type { GitCardFace } from './git-card-controller.ts';
4
+ /** Props the renderer binds for the Git page. */
5
+ export type GitCardProps = PropsRuntime<'plugins.item'> & PropsLocale<'settings.plugins'> & InjectFace<GitCardFace>;
6
+ /**
7
+ * Render the Git plugin's one-liner or its configuration form, as the Plugins page asks.
8
+ * @param props - the view asked for, locale copy, the form snapshot, and its actions.
9
+ * @returns the one-liner, or the form.
10
+ */
11
+ export declare function GitCard(props: GitCardProps): string | import("react").JSX.Element;
12
+ //# sourceMappingURL=GitCard.d.ts.map
@@ -0,0 +1,34 @@
1
+ /**
2
+ * One plugin's configuration form as its page on the Plugins page shows it:
3
+ * the read-only notice when the deployment stores settings read-only, the
4
+ * plugin's controls, and the save that writes every staged edit. The page
5
+ * draws the plugin's title and one-liner itself.
6
+ *
7
+ * Only a save writes. Leaving the page drops every staged edit, so the form
8
+ * discards on unmount and offers no discard control. A form whose namespace
9
+ * the Host stopped serving says so in place of its controls rather than
10
+ * showing fields nothing would accept.
11
+ */
12
+ import { type ReactNode } from 'react';
13
+ import type { SettingsFormShell } from '@qilin-agent/client-ui-primitives';
14
+ import type { PluginsSettingsLocaleKey } from './locales.ts';
15
+ /** Form chrome shared by every plugin configuration page. */
16
+ export interface PluginConfigFormProps {
17
+ /** Locale reader for this package's copy. */
18
+ t: (key: PluginsSettingsLocaleKey) => string;
19
+ /** The form state: availability, writability, and what a save would do. */
20
+ state: SettingsFormShell;
21
+ /** Write every staged edit. */
22
+ onSave: () => void;
23
+ /** Drop every staged edit; the form calls it when it leaves the page. */
24
+ onDiscard: () => void;
25
+ /** The plugin's controls. */
26
+ children: ReactNode;
27
+ }
28
+ /**
29
+ * Render one plugin's configuration form.
30
+ * @param props - the form state, its controls, and the save and discard actions.
31
+ * @returns the form, or the unavailable line while the namespace is not served.
32
+ */
33
+ export declare function PluginConfigForm(props: PluginConfigFormProps): import("react").JSX.Element;
34
+ //# sourceMappingURL=PluginConfigForm.d.ts.map
@@ -0,0 +1,27 @@
1
+ /** Plugins settings section: localized tabs around feature-owned pages. */
2
+ import type { HostObservable, InjectFace, PropsLocale, PropsRenderSlots, PropsRuntime } from '@qilin-agent/client-ui-slots';
3
+ import type { PluginsSettingsLocaleKey } from './locales.ts';
4
+ /** One tab projected from a `settings.plugins.tab` contribution. */
5
+ export interface PluginsSettingsTabEntry {
6
+ id: string;
7
+ order: number;
8
+ label: string;
9
+ }
10
+ /** Registration-side business face for the section. */
11
+ export interface PluginsSettingsSectionInjected {
12
+ hooks: {
13
+ /** Ordered, locale-aware projection of the Plugins tab ledger. */
14
+ tabs: HostObservable<readonly PluginsSettingsTabEntry[]>;
15
+ };
16
+ }
17
+ /** Props the renderer binds for the section. */
18
+ export type PluginsSettingsSectionProps = PropsRuntime<'settings.section'> & PropsLocale<'settings.plugins'> & PropsRenderSlots<'settings.plugins.tab'> & InjectFace<PluginsSettingsSectionInjected>;
19
+ /** Render one Plugins page whose contents arrive from feature-owned tabs; one contribution shows as the page itself. */
20
+ export declare function PluginsSettingsSection({ t, renderSlot, useTabs }: PluginsSettingsSectionProps): import("react").JSX.Element;
21
+ declare module '@qilin-agent/client-ui-slots' {
22
+ interface LocaleNamespaceMap {
23
+ /** Built-in plugins section and plugin configuration page copy. */
24
+ 'settings.plugins': PluginsSettingsLocaleKey;
25
+ }
26
+ }
27
+ //# sourceMappingURL=PluginsSettingsSection.d.ts.map
@@ -0,0 +1,12 @@
1
+ /** One settings card for Subagent delegation limits and model authorization. */
2
+ import type { InjectFace, PropsLocale, PropsRuntime } from '@qilin-agent/client-ui-slots';
3
+ import { type SubagentCardFace } from './subagent-card-controller.ts';
4
+ /** Framework-derived props for the shared Subagent settings card. */
5
+ export type SubagentCardProps = PropsRuntime<'plugins.item'> & PropsLocale<'settings.plugins'> & InjectFace<SubagentCardFace>;
6
+ /**
7
+ * Render the available Subagent settings with one configuration page and save footer.
8
+ * @param props - Locale, both form snapshots, and their shared actions.
9
+ * @returns The summary or the available settings form.
10
+ */
11
+ export declare function SubagentCard(props: SubagentCardProps): string | import("react").JSX.Element;
12
+ //# sourceMappingURL=SubagentCard.d.ts.map
@@ -0,0 +1,14 @@
1
+ /** Delegation-limit fields inside the shared Subagent settings card. */
2
+ import type { PropsLocale } from '@qilin-agent/client-ui-slots';
3
+ import type { SubagentLimitsCardFace, SubagentLimitsCardState } from './subagent-limits-card-controller.ts';
4
+ /** Plain state and edit callbacks supplied by the owning card. */
5
+ export type SubagentLimitsFieldsProps = PropsLocale<'settings.plugins'> & Pick<SubagentLimitsCardFace, 'edit' | 'resetField'> & {
6
+ state: SubagentLimitsCardState;
7
+ };
8
+ /**
9
+ * Render the depth and capacity fields with their original validation and reset behavior.
10
+ * @param props - Locale, staged fields, and edit callbacks.
11
+ * @returns Two responsive fields and their application rules.
12
+ */
13
+ export declare function SubagentLimitsFields(props: SubagentLimitsFieldsProps): import("react").JSX.Element;
14
+ //# sourceMappingURL=SubagentLimitsFields.d.ts.map
@@ -0,0 +1,14 @@
1
+ /** User control for model-selectable subagent delegation in new sessions. */
2
+ import type { PropsLocale } from '@qilin-agent/client-ui-slots';
3
+ import type { SubagentModelSelectionCardFace, SubagentModelSelectionCardState } from './subagent-model-selection-card-controller.ts';
4
+ /** Plain model state and callbacks supplied by the owning Subagent card. */
5
+ export type SubagentModelSelectionFieldsProps = PropsLocale<'settings.plugins'> & Pick<SubagentModelSelectionCardFace, 'toggleEnabled' | 'toggleModel' | 'retryCatalog'> & {
6
+ state: SubagentModelSelectionCardState;
7
+ };
8
+ /**
9
+ * Render the default-off preference and its exact adapter-route choices.
10
+ * @param props - locale copy, the card snapshot, and its toggle action.
11
+ * @returns the model permission and route choices inside the shared card.
12
+ */
13
+ export declare function SubagentModelSelectionFields(props: SubagentModelSelectionFieldsProps): import("react").JSX.Element;
14
+ //# sourceMappingURL=SubagentModelSelectionFields.d.ts.map
@@ -0,0 +1,16 @@
1
+ /**
2
+ * The web-search provider's configuration page: its endpoint, its per-request
3
+ * search budget, and the key — which is written through the credentials
4
+ * domain, never into the settings section, so the literal never rides a response.
5
+ */
6
+ import type { InjectFace, PropsLocale, PropsRuntime } from '@qilin-agent/client-ui-slots';
7
+ import type { WebSearchCardFace } from './web-search-card-controller.ts';
8
+ /** Props the renderer binds for the web-search page. */
9
+ export type WebSearchCardProps = PropsRuntime<'plugins.item'> & PropsLocale<'settings.plugins'> & InjectFace<WebSearchCardFace>;
10
+ /**
11
+ * Render the web-search provider's one-liner or its configuration form, as the Plugins page asks.
12
+ * @param props - the view asked for, locale copy, the form snapshot, and its actions.
13
+ * @returns the one-liner, or the form.
14
+ */
15
+ export declare function WebSearchCard(props: WebSearchCardProps): string | import("react").JSX.Element;
16
+ //# sourceMappingURL=WebSearchCard.d.ts.map
@@ -0,0 +1,43 @@
1
+ /** The agent-loop card's staged form over the `agent-loop` settings namespace. */
2
+ import type { SnapshotStore } from '@qilin-agent/client-store';
3
+ import type { ConfigForm } from '@qilin-agent/client-ui-settings/client';
4
+ import { type SettingsFormActions, type SettingsFieldState, type SettingsFormShell } from '@qilin-agent/client-ui-primitives';
5
+ /**
6
+ * Namespace of the agent loop's user-owned settings. Spelled here rather than
7
+ * imported: a client package must not depend on a Host package.
8
+ */
9
+ export declare const AGENT_LOOP_NS = "agent-loop";
10
+ /**
11
+ * The agent-loop fields this card edits. The Host section carries only this
12
+ * field — the composed `agents` array is deliberately not part of it.
13
+ */
14
+ export interface AgentLoopSettings {
15
+ /** Upper bound on parallel-safe tool calls in flight per step. */
16
+ maxParallelToolCalls?: number;
17
+ }
18
+ /** What the agent-loop card renders. */
19
+ export interface AgentLoopCardState extends SettingsFormShell {
20
+ /** Parallel tool-call cap. */
21
+ maxParallelToolCalls: SettingsFieldState;
22
+ }
23
+ /** The registration-side face the agent-loop card's slot entry injects. */
24
+ export interface AgentLoopCardFace extends SettingsFormActions {
25
+ hooks: {
26
+ /** Card snapshot bound by the renderer as useAgentLoopCard. */
27
+ agentLoopCard: SnapshotStore<AgentLoopCardState>;
28
+ };
29
+ }
30
+ /** Bridges the `agent-loop` scope onto the card's staged form. */
31
+ export declare class AgentLoopCardController {
32
+ private readonly form;
33
+ private readonly store;
34
+ /** @param scope - the bound settings scope for the `agent-loop` namespace. */
35
+ constructor(scope: ConfigForm<AgentLoopSettings>);
36
+ private projection;
37
+ /**
38
+ * Build the face the card's slot registration injects.
39
+ * @returns the card's snapshot and its form actions.
40
+ */
41
+ inject(): AgentLoopCardFace;
42
+ }
43
+ //# sourceMappingURL=agent-loop-card-controller.d.ts.map
@@ -0,0 +1,45 @@
1
+ /** The shell card's staged form over the `bash` settings namespace. */
2
+ import type { SnapshotStore } from '@qilin-agent/client-store';
3
+ import type { ConfigForm } from '@qilin-agent/client-ui-settings/client';
4
+ import { type SettingsFormActions, type SettingsFieldState, type SettingsFormShell } from '@qilin-agent/client-ui-primitives';
5
+ /**
6
+ * Namespace of the shell capability. Spelled here rather than imported: a
7
+ * client package must not depend on a Host package, and the executor families
8
+ * that own it spell the same value.
9
+ */
10
+ export declare const SHELL_NS = "shell";
11
+ /** The shell fields this card edits — a subset of the served schema by design. */
12
+ export interface BashSettings {
13
+ /** Foreground command timeout in milliseconds. */
14
+ timeoutMs?: number;
15
+ /** Per-stream in-memory output cap in bytes. */
16
+ maxOutputBytes?: number;
17
+ }
18
+ /** What the shell card renders. */
19
+ export interface BashCardState extends SettingsFormShell {
20
+ /** Command timeout in milliseconds. */
21
+ timeoutMs: SettingsFieldState;
22
+ /** Per-stream output cap in bytes. */
23
+ maxOutputBytes: SettingsFieldState;
24
+ }
25
+ /** The registration-side face the shell card's slot entry injects. */
26
+ export interface BashCardFace extends SettingsFormActions {
27
+ hooks: {
28
+ /** Card snapshot bound by the renderer as useBashCard. */
29
+ bashCard: SnapshotStore<BashCardState>;
30
+ };
31
+ }
32
+ /** Bridges the `bash` scope onto the shell card's staged form. */
33
+ export declare class BashCardController {
34
+ private readonly form;
35
+ private readonly store;
36
+ /** @param scope - the bound settings scope for the `bash` namespace. */
37
+ constructor(scope: ConfigForm<BashSettings>);
38
+ private projection;
39
+ /**
40
+ * Build the face the card's slot registration injects.
41
+ * @returns the card's snapshot and its form actions.
42
+ */
43
+ inject(): BashCardFace;
44
+ }
45
+ //# sourceMappingURL=bash-card-controller.d.ts.map
@@ -0,0 +1,69 @@
1
+ /** The Git card's staged form over the `workspace-git` settings namespace. */
2
+ import type { SnapshotStore } from '@qilin-agent/client-store';
3
+ import type { ConfigForm } from '@qilin-agent/client-ui-settings/client';
4
+ import { type SettingsFormActions, type SettingsFieldState, type SettingsFormShell } from '@qilin-agent/client-ui-primitives';
5
+ /**
6
+ * Namespace of the workspace Git service. Spelled here rather than imported:
7
+ * a client package must not depend on a Host package, and the service plugin
8
+ * that owns it spells the same value.
9
+ */
10
+ export declare const GIT_NS = "workspace-git";
11
+ /** The Git fields this card edits — the whole served schema. */
12
+ export interface GitSettings {
13
+ /** Git executable spawned for every repository call. */
14
+ gitBin?: string;
15
+ /** gh executable spawned for every pull-request call. */
16
+ ghBin?: string;
17
+ /** Timeout on one content or mutation command, in milliseconds. */
18
+ timeoutMs?: number;
19
+ /** Timeout on one repository-discovery command, in milliseconds. */
20
+ discoveryTimeoutMs?: number;
21
+ /** Timeout on one `gh` call, in milliseconds. */
22
+ ghTimeoutMs?: number;
23
+ /** Inclusive byte cap on one diff answer. */
24
+ maxDiffBytes?: number;
25
+ /** Character cap on the stderr carried by one error answer. */
26
+ maxStderrChars?: number;
27
+ /** Entry cap on one branch or pull-request list answer. */
28
+ maxListEntries?: number;
29
+ }
30
+ /** What the Git card renders. */
31
+ export interface GitCardState extends SettingsFormShell {
32
+ /** Git executable path. */
33
+ gitBin: SettingsFieldState;
34
+ /** gh executable path. */
35
+ ghBin: SettingsFieldState;
36
+ /** Content or mutation command timeout. */
37
+ timeoutMs: SettingsFieldState;
38
+ /** Repository-discovery command timeout. */
39
+ discoveryTimeoutMs: SettingsFieldState;
40
+ /** gh command timeout. */
41
+ ghTimeoutMs: SettingsFieldState;
42
+ /** Diff answer cap. */
43
+ maxDiffBytes: SettingsFieldState;
44
+ /** stderr answer cap. */
45
+ maxStderrChars: SettingsFieldState;
46
+ /** List entry cap. */
47
+ maxListEntries: SettingsFieldState;
48
+ }
49
+ /** The registration-side face the Git card's slot entry injects. */
50
+ export interface GitCardFace extends SettingsFormActions {
51
+ hooks: {
52
+ /** Card snapshot bound by the renderer as useGitCard. */
53
+ gitCard: SnapshotStore<GitCardState>;
54
+ };
55
+ }
56
+ /** Bridges the `workspace-git` scope onto the Git card's staged form. */
57
+ export declare class GitCardController {
58
+ private readonly form;
59
+ private readonly store;
60
+ /** @param scope - the bound settings scope for the `workspace-git` namespace. */
61
+ constructor(scope: ConfigForm<GitSettings>);
62
+ private projection;
63
+ /**
64
+ * Build the face the card's slot registration injects.
65
+ * @returns the card's snapshot and its form actions.
66
+ */
67
+ inject(): GitCardFace;
68
+ }
69
+ //# sourceMappingURL=git-card-controller.d.ts.map
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Built-in plugins settings surface and the official plugin configuration
3
+ * pages, browser half. The Settings section is the shell around the
4
+ * feature-owned tabs registered into `settings.plugins.tab` (the read-only
5
+ * inventory ships one); the configuration pages this package ships register
6
+ * into the Plugins page's `plugins.item` slot, for the host-plane namespaces
7
+ * the deployment exposes, and appear in the page's Official group. Each form
8
+ * binds its namespace through the client settings scope, which keeps the
9
+ * pages unaware of one another and of the section.
10
+ */
11
+ import type { Context as ClientContext } from '@qilin-agent/kylin';
12
+ export type { PluginsSettingsSectionInjected, PluginsSettingsSectionProps } from './PluginsSettingsSection.tsx';
13
+ export type { PluginConfigFormProps } from './PluginConfigForm.tsx';
14
+ export type { SettingsFieldProps } from '@qilin-agent/client-ui-primitives';
15
+ export type { SettingsFormActions, SettingsFieldSpec, SettingsFieldState, SettingsSecretSpec, SettingsFormShell, } from '@qilin-agent/client-ui-primitives';
16
+ export type { AgentLoopCardFace, AgentLoopCardState } from './agent-loop-card-controller.ts';
17
+ export type { BashCardFace, BashCardState } from './bash-card-controller.ts';
18
+ export type { WebSearchCardFace, WebSearchCardState } from './web-search-card-controller.ts';
19
+ /** Required services (cordis fiber inject). */
20
+ export declare const inject: string[];
21
+ /**
22
+ * Mount the built-in plugins section and the configuration pages this package ships.
23
+ * @param ctx - the browser plugin context.
24
+ */
25
+ export declare function apply(ctx: ClientContext): void;
26
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,8 @@
1
+ /** Locale bundles for the built-in plugins settings section and the plugin configuration pages. */
2
+ /** Locale keys these surfaces render. */
3
+ export type PluginsSettingsLocaleKey = 'nav' | 'title' | 'intro' | 'tabs' | 'empty' | 'overridden' | 'reset' | 'readOnly' | 'unavailable' | 'save' | 'saving' | 'saveFailed' | 'invalidNumber' | 'bashTitle' | 'bashDescription' | 'bashTimeoutMs' | 'bashTimeoutMsHint' | 'bashMaxOutputBytes' | 'bashMaxOutputBytesHint' | 'agentLoopTitle' | 'agentLoopDescription' | 'agentLoopMaxParallel' | 'agentLoopMaxParallelHint' | 'webSearchTitle' | 'webSearchDescription' | 'webSearchApiKey' | 'webSearchApiKeyHint' | 'webSearchApiKeySet' | 'webSearchApiKeyUnset' | 'webSearchBaseUrl' | 'webSearchBaseUrlHint' | 'webSearchMaxUses' | 'webSearchMaxUsesHint' | 'gitTitle' | 'gitDescription' | 'gitBin' | 'gitBinHint' | 'ghBin' | 'ghBinHint' | 'gitTimeoutMs' | 'gitTimeoutMsHint' | 'gitDiscoveryTimeoutMs' | 'gitDiscoveryTimeoutMsHint' | 'ghTimeoutMs' | 'ghTimeoutMsHint' | 'gitMaxDiffBytes' | 'gitMaxDiffBytesHint' | 'gitMaxStderrChars' | 'gitMaxStderrCharsHint' | 'gitMaxListEntries' | 'gitMaxListEntriesHint' | 'subagentTitle' | 'subagentDescription' | 'subagentLimitsTitle' | 'subagentMaxDepth' | 'subagentDepthHelpLabel' | 'subagentDepthHelp' | 'subagentDepthZero' | 'subagentDepthOne' | 'subagentDepthOverride' | 'subagentMaxActive' | 'subagentCapacityHelpLabel' | 'subagentCapacityHelp' | 'subagentDepthInvalid' | 'subagentCapacityInvalid' | 'subagentModelSelectionTitle' | 'subagentModelSelectionToggle' | 'subagentModelSelectionChoose' | 'subagentModelSelectionAllowed' | 'subagentModelSelectionLoading' | 'subagentModelSelectionLoadFailed' | 'subagentModelSelectionRetry' | 'subagentModelSelectionPartial' | 'subagentModelSelectionUnavailable' | 'subagentModelSelectionUnavailableGroup' | 'subagentModelSelectionEmpty' | 'subagentModelSelectionRequired' | 'subagentModelSelectionConflict' | 'subagentModelSelectionOff';
4
+ /** English copy. */
5
+ export declare const en: Record<PluginsSettingsLocaleKey, string>;
6
+ /** Simplified Chinese copy. */
7
+ export declare const zh: Record<PluginsSettingsLocaleKey, string>;
8
+ //# sourceMappingURL=locales.d.ts.map
@@ -0,0 +1,32 @@
1
+ /** Shared presentation and actions for the two Host-owned Subagent settings sections. */
2
+ import type { SettingsFormShell } from '@qilin-agent/client-ui-primitives';
3
+ import type { SubagentLimitsCardFace, SubagentLimitsCardState } from './subagent-limits-card-controller.ts';
4
+ import type { SubagentModelSelectionCardFace, SubagentModelSelectionCardState } from './subagent-model-selection-card-controller.ts';
5
+ /** Both existing form sources and the actions exposed by one Subagent card. */
6
+ export interface SubagentCardFace {
7
+ hooks: SubagentLimitsCardFace['hooks'] & SubagentModelSelectionCardFace['hooks'];
8
+ editLimit: SubagentLimitsCardFace['edit'];
9
+ resetLimit: SubagentLimitsCardFace['resetField'];
10
+ toggleEnabled: SubagentModelSelectionCardFace['toggleEnabled'];
11
+ toggleModel: SubagentModelSelectionCardFace['toggleModel'];
12
+ retryCatalog: SubagentModelSelectionCardFace['retryCatalog'];
13
+ /** Save valid drafts through their owning namespace controllers. */
14
+ save: () => void;
15
+ /** Discard both drafts without changing persisted settings. */
16
+ discard: () => void;
17
+ }
18
+ /**
19
+ * Derive the shared card state without duplicating either form's subscriptions.
20
+ * @param limits - Current delegation-limit form.
21
+ * @param models - Current model-authorization form.
22
+ * @returns Availability and settlement across the sections this Host serves.
23
+ */
24
+ export declare function subagentCardShell(limits: SubagentLimitsCardState, models: SubagentModelSelectionCardState): SettingsFormShell;
25
+ /**
26
+ * Compose one card from the existing forms; each write retains its namespace revision fence.
27
+ * @param limits - Limit form source and actions.
28
+ * @param models - Model form source and actions.
29
+ * @returns Framework-bound sources and shared save/discard actions.
30
+ */
31
+ export declare function subagentCardFace(limits: SubagentLimitsCardFace, models: SubagentModelSelectionCardFace): SubagentCardFace;
32
+ //# sourceMappingURL=subagent-card-controller.d.ts.map
@@ -0,0 +1,33 @@
1
+ /** Staged delegation limits backed by the Host's subagent settings section. */
2
+ import type { SnapshotStore } from '@qilin-agent/client-store';
3
+ import type { ConfigForm } from '@qilin-agent/client-ui-settings/client';
4
+ import { type SettingsFormActions, type SettingsFieldState, type SettingsFormShell } from '@qilin-agent/client-ui-primitives';
5
+ /** Host-owned delegation defaults and live capacity. */
6
+ export interface SubagentLimitsSettings {
7
+ maxDepth: number;
8
+ maxActiveSubagents: number;
9
+ }
10
+ /** Effective values and drafts presented by the limits card. */
11
+ export interface SubagentLimitsCardState extends SettingsFormShell {
12
+ maxDepth: SettingsFieldState;
13
+ maxActiveSubagents: SettingsFieldState;
14
+ }
15
+ /** Actions and observable state bound by the slot renderer. */
16
+ export interface SubagentLimitsCardFace extends SettingsFormActions {
17
+ hooks: {
18
+ subagentLimitsCard: SnapshotStore<SubagentLimitsCardState>;
19
+ };
20
+ }
21
+ /** Bind two independently resettable limits to one staged settings form. */
22
+ export declare class SubagentLimitsCardController {
23
+ private readonly form;
24
+ private readonly store;
25
+ /** @param scope - The Host's `subagent` settings section. */
26
+ constructor(scope: ConfigForm<SubagentLimitsSettings>);
27
+ /**
28
+ * Bind the limits editor to the slot renderer.
29
+ * @returns The limits snapshot and staged write actions.
30
+ */
31
+ inject(): SubagentLimitsCardFace;
32
+ }
33
+ //# sourceMappingURL=subagent-limits-card-controller.d.ts.map
@@ -0,0 +1,129 @@
1
+ /** Staged editor for the Host-owned subagent model allowlist. */
2
+ import type { Context as ClientContext } from '@qilin-agent/kylin';
3
+ import type { ModelProviderGroup } from '@qilin-agent/api-remotes/client';
4
+ import { type SnapshotStore } from '@qilin-agent/client-store';
5
+ import type { ConfigForm } from '@qilin-agent/client-ui-settings/client';
6
+ import type { SettingsFormShell } from '@qilin-agent/client-ui-primitives';
7
+ /** Namespace of the Host-owned subagent model-selection preference. */
8
+ export declare const SUBAGENT_MODEL_SELECTION_NS = "subagent-model-selection";
9
+ /** One exact provider/model route stored as user authorization. */
10
+ export interface AllowedSubagentModel {
11
+ provider: string;
12
+ model: string;
13
+ }
14
+ /** Settings fields stored for subagent model selection. */
15
+ export interface SubagentModelSelectionSettings {
16
+ /** Whether model-facing child route selection applies to new Sessions. */
17
+ enabled: boolean;
18
+ /** Exact child routes offered to newly composed top-level Sessions. */
19
+ allowedModels: AllowedSubagentModel[];
20
+ }
21
+ /** One catalog row joined with a stored route that may no longer be advertised. */
22
+ export interface SubagentModelCandidate extends AllowedSubagentModel {
23
+ /** Stable opaque identity used only for lookup. */
24
+ key: string;
25
+ /** Adapter-owned provider display name. */
26
+ providerName: string;
27
+ /** Adapter-owned model display name. */
28
+ modelName: string;
29
+ /** Whether the current adapter catalog advertises this exact route. */
30
+ available: boolean;
31
+ /** Whether the current draft authorizes this route. */
32
+ selected: boolean;
33
+ }
34
+ /** State rendered by the staged allowlist card. */
35
+ export interface SubagentModelSelectionCardState extends SettingsFormShell {
36
+ /** Whether the draft enables model-facing child route selection. */
37
+ enabled: boolean;
38
+ /** Live catalog joined with stored routes. */
39
+ candidates: readonly SubagentModelCandidate[];
40
+ /** Adapter-directory request state. */
41
+ catalogStatus: 'idle' | 'loading' | 'ready' | 'error';
42
+ /** Whether any provider-local catalog request failed. */
43
+ catalogPartial: boolean;
44
+ /** Whether a newer Host revision invalidated the current draft. */
45
+ conflicted: boolean;
46
+ }
47
+ /** Registration-side face for the subagent model-selection card. */
48
+ export interface SubagentModelSelectionCardFace {
49
+ hooks: {
50
+ /** Card snapshot bound by the renderer as useSubagentModelSelectionCard. */
51
+ subagentModelSelectionCard: SnapshotStore<SubagentModelSelectionCardState>;
52
+ };
53
+ /** Stage the enabled state; enabling also loads the adapter directory. */
54
+ toggleEnabled: () => void;
55
+ /** Stage one exact route as allowed or denied. */
56
+ toggleModel: (key: string) => void;
57
+ /** Retry the adapter directory. */
58
+ retryCatalog: () => void;
59
+ /** Persist the switch and exact routes as one revision-fenced mutation. */
60
+ save: () => void;
61
+ /** Drop the staged enabled state and route choices. */
62
+ discard: () => void;
63
+ }
64
+ /**
65
+ * Stable identity for one exact route; callers resolve it by lookup and never parse it.
66
+ * @param route - Provider/model route to identify.
67
+ * @returns Opaque key for lookup within the card.
68
+ */
69
+ export declare function subagentModelKey(route: AllowedSubagentModel): string;
70
+ /**
71
+ * Join live adapter metadata with stored routes that remain removable after disappearance.
72
+ * @param groups - Current model directory grouped by provider.
73
+ * @param stored - Routes in the effective settings value.
74
+ * @param selected - Opaque route keys selected in the current draft.
75
+ * @returns Candidate rows for the card.
76
+ */
77
+ export declare function subagentModelCandidates(groups: readonly ModelProviderGroup[], stored: readonly AllowedSubagentModel[], selected: ReadonlySet<string>): SubagentModelCandidate[];
78
+ /** Bridges one settings scope and the live adapter directory onto a staged card. */
79
+ export declare class SubagentModelSelectionCardController {
80
+ private readonly scope;
81
+ private readonly ctx;
82
+ private catalogGroups;
83
+ private catalogPartial;
84
+ private catalogStatus;
85
+ private draftEnabled;
86
+ private draftRoutes;
87
+ private draftRevision;
88
+ private saving;
89
+ private failed;
90
+ private conflicted;
91
+ private disposed;
92
+ private saveGeneration;
93
+ private catalogGeneration;
94
+ private readonly store;
95
+ private readonly unsubscribe;
96
+ /**
97
+ * @param scope - bound `subagent-model-selection` settings scope.
98
+ * @param ctx - the card plugin's context, whose `remote.session` namespace
99
+ * answers the Host model catalog.
100
+ */
101
+ constructor(scope: ConfigForm<SubagentModelSelectionSettings>, ctx: ClientContext);
102
+ /** Stop observing settings and suppress late directory/write settlements. */
103
+ dispose(): void;
104
+ /**
105
+ * Build the renderer face for this card.
106
+ * @returns The snapshot and staged card actions injected into the renderer.
107
+ */
108
+ inject(): SubagentModelSelectionCardFace;
109
+ private currentRoutes;
110
+ private currentEnabled;
111
+ private selected;
112
+ private enabled;
113
+ private beginDraft;
114
+ private toggleEnabled;
115
+ private toggleModel;
116
+ private clearDraft;
117
+ private discard;
118
+ private candidates;
119
+ private desiredRoutes;
120
+ private save;
121
+ /** Invalidate and reload model candidates after a Host model input changes. */
122
+ refreshCatalog(): void;
123
+ /** Drop Host-specific candidates and drafts, then reload after reconnecting. */
124
+ resetConnection(): void;
125
+ private loadCatalog;
126
+ private projection;
127
+ private publish;
128
+ }
129
+ //# sourceMappingURL=subagent-model-selection-card-controller.d.ts.map