|
|
@@ -4,7 +4,7 @@
|
|
|
*
|
|
|
* The section declares `settings.plugins.tab`; its own `configurable` tab then
|
|
|
* declares `settings.plugin.item` and renders whatever cards were registered
|
|
|
- * into it. The three cards this package ships are the host-plane sections the
|
|
|
+ * into it. The cards this package ships are the host-plane sections the
|
|
|
* deployment already exposes; each binds its namespace through the client
|
|
|
* settings scope, which keeps them unaware of one another and of other tabs.
|
|
|
*/
|
|
|
@@ -25,10 +25,14 @@ import { BashCard } from './BashCard.tsx'
|
|
|
import { ConfigurablePluginsTab } from './ConfigurablePluginsTab.tsx'
|
|
|
import { PluginsSettingsSection } from './PluginsSettingsSection.tsx'
|
|
|
import type { PluginsSettingsSectionInjected, PluginsSettingsTabEntry } from './PluginsSettingsSection.tsx'
|
|
|
+import { SubagentModelSelectionCard } from './SubagentModelSelectionCard.tsx'
|
|
|
import { WebSearchCard } from './WebSearchCard.tsx'
|
|
|
import { AGENT_LOOP_NS, AgentLoopCardController } from './agent-loop-card-controller.ts'
|
|
|
import { SHELL_NS, BashCardController } from './bash-card-controller.ts'
|
|
|
import { ConfigurablePluginsTabController } from './tab-store.ts'
|
|
|
+import {
|
|
|
+ SUBAGENT_MODEL_SELECTION_NS, SubagentModelSelectionCardController,
|
|
|
+} from './subagent-model-selection-card-controller.ts'
|
|
|
import { WEB_SEARCH_NS, WebSearchCardController } from './web-search-card-controller.ts'
|
|
|
import { en, zh } from './locales.ts'
|
|
|
|
|
|
@@ -44,6 +48,9 @@ export type {
|
|
|
export type { AgentLoopCardFace, AgentLoopCardState } from './agent-loop-card-controller.ts'
|
|
|
export type { BashCardFace, BashCardState } from './bash-card-controller.ts'
|
|
|
export type { WebSearchCardFace, WebSearchCardState } from './web-search-card-controller.ts'
|
|
|
+export type {
|
|
|
+ SubagentModelSelectionCardFace, SubagentModelSelectionCardState,
|
|
|
+} from './subagent-model-selection-card-controller.ts'
|
|
|
|
|
|
/** Dictionary namespace owned by this plugin. */
|
|
|
const NS = 'settings.plugins'
|
|
|
@@ -63,6 +70,9 @@ export function apply(ctx: ClientContext): void {
|
|
|
const agentLoop = new AgentLoopCardController(ctx.settingsScope.bind({ namespace: AGENT_LOOP_NS }))
|
|
|
const webSearch = new WebSearchCardController(
|
|
|
ctx.settingsScope.bind({ namespace: WEB_SEARCH_NS }), ctx.remote.credentials)
|
|
|
+ const subagentModelSelection = new SubagentModelSelectionCardController(
|
|
|
+ ctx.settingsScope.bind({ namespace: SUBAGENT_MODEL_SELECTION_NS }),
|
|
|
+ )
|
|
|
|
|
|
// The credential a card reports is not part of any settings section, so its
|
|
|
// scope publishes nothing when one is written. This is the only signal that
|
|
|
@@ -71,6 +81,7 @@ export function apply(ctx: ClientContext): void {
|
|
|
() => ctx.remote.$on('credentials/reference-updated', (ref) => { webSearch.refreshCredential(ref) }),
|
|
|
'ui-settings-plugins: credential invalidations',
|
|
|
)
|
|
|
+ ctx.effect(() => () => { subagentModelSelection.dispose() }, 'ui-settings-plugins: subagent preference')
|
|
|
|
|
|
// The shared SettingsScope mirror updates after document commits and reconnects.
|
|
|
const configurable = new ConfigurablePluginsTabController(
|
|
|
@@ -130,7 +141,7 @@ export function apply(ctx: ClientContext): void {
|
|
|
}, PluginsSettingsSection))
|
|
|
|
|
|
// The existing configuration page is one ordinary tab. It keeps ownership
|
|
|
- // of the card slot and the three shipped card contributions below.
|
|
|
+ // of the card slot and the shipped card contributions below.
|
|
|
ctx.slots.inject('settings.plugins.tab', () => ctx.slots.register({
|
|
|
name: 'settings.plugins.tab',
|
|
|
id: 'configurable',
|
|
|
@@ -142,6 +153,12 @@ export function apply(ctx: ClientContext): void {
|
|
|
}, ConfigurablePluginsTab))
|
|
|
|
|
|
ctx.slots.inject('settings.plugin.item', function* () {
|
|
|
+ yield ctx.slots.register({
|
|
|
+ name: 'settings.plugin.item',
|
|
|
+ key: SUBAGENT_MODEL_SELECTION_NS,
|
|
|
+ locale: NS,
|
|
|
+ inject: () => subagentModelSelection.inject(),
|
|
|
+ }, SubagentModelSelectionCard)
|
|
|
yield ctx.slots.register({
|
|
|
name: 'settings.plugin.item',
|
|
|
key: SHELL_NS,
|