dsh-agent-team-presets 0.2.0 → 0.3.0
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/NOTICE +29 -0
- package/README.md +61 -12
- package/README.zh.md +60 -11
- package/assets/card-patches/dsh-better-sidebar-0.32.0.client.js.gz +0 -0
- package/assets/card-patches/dsh-context-0.84.0.client.js.gz +0 -0
- package/assets/card-patches/licenses/dsh-better-sidebar-LICENSE +21 -0
- package/assets/card-patches/licenses/dsh-context-LICENSE +201 -0
- package/lib/client.js +9068 -2097
- package/lib/index.js +3084 -1212
- package/lib/typert.host.js +7454 -1720
- package/lib/typert.remote-client.d.ts +16 -1
- package/lib/typert.remote-client.d.ts.map +1 -0
- package/lib/typert.remote-client.js +7383 -1649
- package/lib/types/application.d.ts +24 -1
- package/lib/types/application.js +77 -34
- package/lib/types/builtin-skill.js +7 -13
- package/lib/types/card-patches.d.ts +104 -0
- package/lib/types/card-patches.js +275 -0
- package/lib/types/client/CardPatchView.d.ts +27 -0
- package/lib/types/client/CardPatchView.js +80 -0
- package/lib/types/client/ComposerTeamSelect.d.ts +1 -1
- package/lib/types/client/ComposerTeamSelect.js +100 -7
- package/lib/types/client/TeamImportDialog.js +1 -1
- package/lib/types/client/TeamListView.js +8 -7
- package/lib/types/client/TeamPresetsSection.js +13 -5
- package/lib/types/client/TeamRosterAction.d.ts +15 -0
- package/lib/types/client/TeamRosterAction.js +205 -0
- package/lib/types/client/agent-card-badges.d.ts +47 -0
- package/lib/types/client/agent-card-badges.js +61 -0
- package/lib/types/client/card-patches-controller.d.ts +152 -0
- package/lib/types/client/card-patches-controller.js +211 -0
- package/lib/types/client/index.js +42 -5
- package/lib/types/client/locales.d.ts +1 -1
- package/lib/types/client/locales.js +118 -12
- package/lib/types/client/team-presets-controller.d.ts +20 -0
- package/lib/types/client/team-presets-controller.js +15 -0
- package/lib/types/execution.d.ts +2 -2
- package/lib/types/execution.js +13 -11
- package/lib/types/index.js +90 -22
- package/lib/types/member-runtime.d.ts +40 -2
- package/lib/types/member-runtime.js +70 -2
- package/lib/types/member-store.d.ts +9 -0
- package/lib/types/member-store.js +13 -1
- package/lib/types/presentation.d.ts +12 -5
- package/lib/types/presentation.js +63 -10
- package/lib/types/preset-tools.js +3 -9
- package/lib/types/team-runtime.d.ts +25 -0
- package/lib/types/team-runtime.js +50 -0
- package/lib/types/tool-catalog.d.ts +64 -1
- package/lib/types/tool-catalog.js +103 -0
- package/lib/types/types.d.ts +69 -0
- package/package.json +52 -49
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The card-patch integrations page: one row per supported target plugin, what
|
|
3
|
+
* its installed bundle currently is, and the one action that state allows.
|
|
4
|
+
*
|
|
5
|
+
* The page never decides whether a patch is applicable — the Host classifies the
|
|
6
|
+
* installed bytes — and it never claims a patch is working on its own: a row is
|
|
7
|
+
* "active" only when the running browser actually has the replacement's service,
|
|
8
|
+
* which happens after a restart and a reload, not when the file is written.
|
|
9
|
+
*/
|
|
10
|
+
import type { CardPatchesController } from './card-patches-controller.ts';
|
|
11
|
+
import type { TeamPresetsLocaleKey } from './locales.ts';
|
|
12
|
+
/** Page copy reader. */
|
|
13
|
+
type Translate = (key: TeamPresetsLocaleKey) => string;
|
|
14
|
+
/** Props of the integrations page. */
|
|
15
|
+
export interface CardPatchViewProps {
|
|
16
|
+
/** Page state and the two write actions. */
|
|
17
|
+
readonly controller: CardPatchesController;
|
|
18
|
+
/** Page copy reader. */
|
|
19
|
+
readonly t: Translate;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Render the integrations page.
|
|
23
|
+
* @param props - the controller and the page copy.
|
|
24
|
+
* @returns the target rows and the confirmation dialog.
|
|
25
|
+
*/
|
|
26
|
+
export declare function CardPatchView({ controller, t }: CardPatchViewProps): import("react").JSX.Element;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* The card-patch integrations page: one row per supported target plugin, what
|
|
4
|
+
* its installed bundle currently is, and the one action that state allows.
|
|
5
|
+
*
|
|
6
|
+
* The page never decides whether a patch is applicable — the Host classifies the
|
|
7
|
+
* installed bytes — and it never claims a patch is working on its own: a row is
|
|
8
|
+
* "active" only when the running browser actually has the replacement's service,
|
|
9
|
+
* which happens after a restart and a reload, not when the file is written.
|
|
10
|
+
*/
|
|
11
|
+
import { useEffect, useState } from 'react';
|
|
12
|
+
import { Button, Modal, StateDot } from '@deepseek-ai/dsh-client-ui-primitives';
|
|
13
|
+
import css from './CardPatchView.module.css';
|
|
14
|
+
/** Locale key naming one bundle state. */
|
|
15
|
+
const STATE_KEYS = {
|
|
16
|
+
absent: 'patchStateAbsent',
|
|
17
|
+
unsupported: 'patchStateUnsupported',
|
|
18
|
+
pristine: 'patchStatePristine',
|
|
19
|
+
patched: 'patchStatePatched',
|
|
20
|
+
foreign: 'patchStateForeign',
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Render the integrations page.
|
|
24
|
+
* @param props - the controller and the page copy.
|
|
25
|
+
* @returns the target rows and the confirmation dialog.
|
|
26
|
+
*/
|
|
27
|
+
export function CardPatchView({ controller, t }) {
|
|
28
|
+
const [state, setState] = useState(controller.getSnapshot());
|
|
29
|
+
const [pending, setPending] = useState(undefined);
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
setState(controller.getSnapshot());
|
|
32
|
+
return controller.subscribe(() => { setState(controller.getSnapshot()); });
|
|
33
|
+
}, [controller]);
|
|
34
|
+
if (state.status === 'unavailable') {
|
|
35
|
+
return _jsx("p", { className: css.empty, role: "status", children: t('patchUnavailable') });
|
|
36
|
+
}
|
|
37
|
+
if (state.status === 'loading') {
|
|
38
|
+
return _jsx("p", { className: css.empty, role: "status", children: t('loading') });
|
|
39
|
+
}
|
|
40
|
+
return (_jsxs("div", { className: css.page, children: [_jsx("p", { className: css.intro, children: t('patchIntro') }), state.result !== undefined && _jsx(ResultLine, { result: state.result, t: t }), _jsx("ul", { className: css.rows, children: state.targets.map(target => (_jsx(Row, { target: target, live: state.live.includes(target.id), busy: state.busy === target.id, phase: state.busy === target.id ? state.phase : undefined, t: t, onAct: action => { setPending({ target, action }); } }, target.id))) }), pending === undefined ? null : (_jsx(ConfirmDialog, { target: pending.target, action: pending.action, t: t, onCancel: () => { setPending(undefined); }, onConfirm: () => {
|
|
41
|
+
const { target, action } = pending;
|
|
42
|
+
setPending(undefined);
|
|
43
|
+
void (action === 'install' ? controller.install(target.id) : controller.uninstall(target.id));
|
|
44
|
+
} }))] }));
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Report the last install or restore.
|
|
48
|
+
* @param props - the outcome and the page copy.
|
|
49
|
+
* @returns the status line.
|
|
50
|
+
*/
|
|
51
|
+
function ResultLine({ result, t }) {
|
|
52
|
+
const text = result.ok
|
|
53
|
+
? t(result.state === 'patched' ? 'patchInstalledOk' : 'patchRemovedOk')
|
|
54
|
+
: t('patchRefused');
|
|
55
|
+
return (_jsxs("p", { className: result.ok ? css.result : css.resultFailed, role: "status", children: [text, result.detail === undefined ? null : _jsxs("span", { className: css.detail, children: [" \u2014 ", result.detail] })] }));
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Render one target with its state and the action that state allows.
|
|
59
|
+
* @param props - the row facts and the action callback.
|
|
60
|
+
* @returns the row.
|
|
61
|
+
*/
|
|
62
|
+
function Row({ target, live, busy, phase, t, onAct }) {
|
|
63
|
+
// Only the two actionable states offer a button; every other state explains
|
|
64
|
+
// itself instead of presenting a control the Host would refuse.
|
|
65
|
+
const action = target.state === 'pristine'
|
|
66
|
+
? 'install'
|
|
67
|
+
: target.state === 'patched' ? 'uninstall' : undefined;
|
|
68
|
+
// A patched bundle that has not been served yet is the one case where the row
|
|
69
|
+
// must say "restart", because nothing is wrong with the file itself.
|
|
70
|
+
const waiting = target.state === 'patched' && !live;
|
|
71
|
+
return (_jsxs("li", { className: css.row, children: [_jsxs("div", { className: css.rowHead, children: [_jsx("code", { className: css.packageName, children: target.packageName }), _jsx("span", { className: css.badge, "data-state": target.state, children: t(STATE_KEYS[target.state]) }), target.state === 'patched' && live ? _jsx("span", { className: css.live, children: t('patchActive') }) : null] }), _jsxs("dl", { className: css.meta, children: [_jsx("dt", { children: t('patchSupported') }), _jsx("dd", { children: target.supportedVersion }), _jsx("dt", { children: t('patchInstalledVersion') }), _jsx("dd", { children: target.installedVersion ?? '—' }), _jsx("dt", { children: t('patchSource') }), _jsx("dd", { className: css.source, children: target.source })] }), target.detail === undefined ? null : _jsx("p", { className: css.detail, children: target.detail }), busy && phase !== undefined ? (_jsxs("p", { className: css.progress, role: "status", children: [_jsx(StateDot, { state: "ongoing", size: 13 }), phase === 'applying' ? t('patchApplying') : t('patchWaiting')] })) : null, waiting ? _jsx("p", { className: css.hint, children: t('patchPendingHint') }) : null, action === undefined ? null : (_jsx("div", { className: css.actions, children: _jsx(Button, { variant: action === 'install' ? 'primary' : 'outline', disabled: busy, onClick: () => { onAct(action); }, children: busy ? t('patchWorking') : t(action === 'install' ? 'patchInstall' : 'patchUninstall') }) }))] }));
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Ask before touching another plugin's installed files.
|
|
75
|
+
* @param props - the row, the action, and the two outcomes.
|
|
76
|
+
* @returns the dialog.
|
|
77
|
+
*/
|
|
78
|
+
function ConfirmDialog({ target, action, t, onCancel, onConfirm }) {
|
|
79
|
+
return (_jsxs(Modal, { open: true, onClose: onCancel, title: t(action === 'install' ? 'patchInstallTitle' : 'patchUninstallTitle'), closeLabel: t('close'), footer: (_jsxs(_Fragment, { children: [_jsx(Button, { variant: "outline", onClick: onCancel, children: t('cancel') }), _jsx(Button, { variant: "primary", onClick: onConfirm, children: t(action === 'install' ? 'patchInstall' : 'patchUninstall') })] })), children: [_jsx("p", { children: t(action === 'install' ? 'patchInstallBody' : 'patchUninstallBody') }), _jsxs("dl", { className: css.meta, children: [_jsx("dt", { children: t('patchPackage') }), _jsx("dd", { children: _jsx("code", { children: target.packageName }) }), _jsx("dt", { children: t('patchFile') }), _jsx("dd", { children: _jsx("code", { children: `${target.packageName}/lib/client.js` }) }), _jsx("dt", { children: t('patchSupported') }), _jsx("dd", { children: target.supportedVersion })] })] }));
|
|
80
|
+
}
|
|
@@ -13,4 +13,4 @@ export type ComposerTeamSelectProps = PropsRuntime<'conversation.input.left'> &
|
|
|
13
13
|
* @param props - the Session identity, the page's locale reader, and the selection writers.
|
|
14
14
|
* @returns the Team trigger, the picker with its member panel, and a notice when the last selection write failed.
|
|
15
15
|
*/
|
|
16
|
-
export declare function ComposerTeamSelect(props: ComposerTeamSelectProps): import("react").JSX.Element;
|
|
16
|
+
export declare function ComposerTeamSelect(props: ComposerTeamSelectProps): import("react").JSX.Element | null;
|
|
@@ -5,7 +5,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
5
5
|
*
|
|
6
6
|
* It sits in the composer tool row after the permission control.
|
|
7
7
|
*/
|
|
8
|
-
import { useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
8
|
+
import { useEffect, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore } from 'react';
|
|
9
9
|
import { IconChevronDownOutlineRegular } from '@deepseek-ai/dsh-client-ui-primitives';
|
|
10
10
|
import { selectedMember, selectedRoleId, selectedTeam } from "../presets.js";
|
|
11
11
|
import { TEAM_SERIES } from "../team-catalog.js";
|
|
@@ -13,6 +13,27 @@ import { matchTeam, orderedCategories, queryTokens, teamOrigin } from "../team-s
|
|
|
13
13
|
import { groupTeams, matchesCategoryFilter } from "./team-grouping.js";
|
|
14
14
|
import { FORM_ISSUE_KEYS, selectionFailureText } from "./locales.js";
|
|
15
15
|
import css from './ComposerTeamSelect.module.css';
|
|
16
|
+
/** The empty library state a build without a Team Skill service reports. */
|
|
17
|
+
const NO_SKILL_STATE = {
|
|
18
|
+
status: 'unavailable',
|
|
19
|
+
library: undefined,
|
|
20
|
+
selectedId: undefined,
|
|
21
|
+
detail: undefined,
|
|
22
|
+
busy: false,
|
|
23
|
+
message: undefined,
|
|
24
|
+
failed: false,
|
|
25
|
+
issue: undefined,
|
|
26
|
+
file: undefined,
|
|
27
|
+
fileText: undefined,
|
|
28
|
+
scan: undefined,
|
|
29
|
+
canOpenScanFolder: false,
|
|
30
|
+
scanFolderPath: undefined,
|
|
31
|
+
scanFolderNotice: undefined,
|
|
32
|
+
};
|
|
33
|
+
/** Subscription used when this build composes no Team Skill library. */
|
|
34
|
+
const NO_SKILL_UPDATES = () => () => { };
|
|
35
|
+
/** Snapshot reader used when this build composes no Team Skill library. */
|
|
36
|
+
const readNoSkillState = () => NO_SKILL_STATE;
|
|
16
37
|
/** How long the member panel survives while the pointer crosses the gap to it. */
|
|
17
38
|
const PANEL_GRACE_MS = 140;
|
|
18
39
|
/** Gap between the picker and the panel, matching the dock's CSS gap. */
|
|
@@ -39,6 +60,18 @@ function memberRouteLabel(providers, member) {
|
|
|
39
60
|
const parts = [provider?.name ?? member.provider, model?.name ?? member.model].filter(part => part.trim() !== '');
|
|
40
61
|
return parts.length === 0 ? undefined : parts.join(' · ');
|
|
41
62
|
}
|
|
63
|
+
/** Stable tag palette index for one skill id, so a skill keeps its colour. */
|
|
64
|
+
function skillTagStyle(skillId) {
|
|
65
|
+
let hash = 0;
|
|
66
|
+
for (let index = 0; index < skillId.length; index += 1) {
|
|
67
|
+
hash = (hash * 31 + skillId.charCodeAt(index)) % 360;
|
|
68
|
+
}
|
|
69
|
+
return {
|
|
70
|
+
background: `hsl(${hash} 70% 93%)`,
|
|
71
|
+
borderColor: `hsl(${hash} 55% 82%)`,
|
|
72
|
+
color: `hsl(${hash} 45% 32%)`,
|
|
73
|
+
};
|
|
74
|
+
}
|
|
42
75
|
/**
|
|
43
76
|
* Render the composer's Team picker.
|
|
44
77
|
* @param props - the Session identity, the page's locale reader, and the selection writers.
|
|
@@ -47,6 +80,17 @@ function memberRouteLabel(providers, member) {
|
|
|
47
80
|
export function ComposerTeamSelect(props) {
|
|
48
81
|
const { t, sessionId } = props;
|
|
49
82
|
const state = props.useTeamPresets(snapshot => snapshot);
|
|
83
|
+
// The official Team-mode switch lives in the model menu. Team presets pick
|
|
84
|
+
// members through the subagent runtime, so the switch is the product's answer
|
|
85
|
+
// to "may this Session run a Team at all": while it is off, the control that
|
|
86
|
+
// would apply one is not offered. A deployment that composes no Team service
|
|
87
|
+
// publishes no projection, and then nothing else can gate the control.
|
|
88
|
+
const teamMode = props.useProjection('agentTeam');
|
|
89
|
+
// Team Skills bound to a member's role are what that member can load, so the
|
|
90
|
+
// panel offering a one-to-one chat names them; a bound skill is otherwise
|
|
91
|
+
// invisible until the member's first turn.
|
|
92
|
+
const skills = props.skills;
|
|
93
|
+
const skillsState = useSyncExternalStore(skills?.subscribe ?? NO_SKILL_UPDATES, skills?.getSnapshot ?? readNoSkillState);
|
|
50
94
|
const [open, setOpen] = useState(false);
|
|
51
95
|
// The Team whose member panel is showing: a hover or a keyboard focus keeps it
|
|
52
96
|
// up while the pointer crosses the gap between the picker and the panel.
|
|
@@ -98,6 +142,29 @@ export function ComposerTeamSelect(props) {
|
|
|
98
142
|
const [source, setSource] = useState('all');
|
|
99
143
|
const [series, setSeries] = useState('all');
|
|
100
144
|
const [categoryId, setCategoryId] = useState('');
|
|
145
|
+
/**
|
|
146
|
+
* Team Skills bound to each member role of the Team whose panel is open.
|
|
147
|
+
*
|
|
148
|
+
* Only the roles' own bindings count: a captain's skills are not a member's,
|
|
149
|
+
* and a skill the library does not list has nothing to show.
|
|
150
|
+
*/
|
|
151
|
+
const skillNamesByRole = useMemo(() => {
|
|
152
|
+
const byRole = new Map();
|
|
153
|
+
const assets = skillsState.library?.assets ?? [];
|
|
154
|
+
if (hoverTeamId === undefined)
|
|
155
|
+
return byRole;
|
|
156
|
+
for (const asset of assets) {
|
|
157
|
+
for (const binding of asset.bindings) {
|
|
158
|
+
if (binding.teamId !== hoverTeamId || binding.captain)
|
|
159
|
+
continue;
|
|
160
|
+
const names = byRole.get(binding.roleId) ?? [];
|
|
161
|
+
if (!names.includes(asset.skillId))
|
|
162
|
+
names.push(asset.skillId);
|
|
163
|
+
byRole.set(binding.roleId, names);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
return byRole;
|
|
167
|
+
}, [skillsState.library, hoverTeamId]);
|
|
101
168
|
/** Cancel a pending panel close, so a hover that continues keeps the panel up. */
|
|
102
169
|
const cancelHoverClose = () => {
|
|
103
170
|
if (hoverTimer.current === undefined)
|
|
@@ -176,8 +243,13 @@ export function ComposerTeamSelect(props) {
|
|
|
176
243
|
setPanelPlacement('right');
|
|
177
244
|
return;
|
|
178
245
|
}
|
|
179
|
-
|
|
180
|
-
|
|
246
|
+
// A flipped panel must stay inside the element that clips the composer:
|
|
247
|
+
// reaching the viewport edge is not enough when the composer itself ends
|
|
248
|
+
// further in, and a panel under that edge would be cut in half.
|
|
249
|
+
const clipRect = dockNode.offsetParent instanceof HTMLElement ? dockNode.offsetParent.getBoundingClientRect() : undefined;
|
|
250
|
+
const leftEdge = dockRect.left - PANEL_GAP_PX - width;
|
|
251
|
+
const leftLimit = Math.max(clipRect?.left ?? 0, PANEL_VIEWPORT_MARGIN_PX) + PANEL_VIEWPORT_MARGIN_PX;
|
|
252
|
+
setPanelPlacement(leftEdge >= leftLimit ? 'left' : 'overlay');
|
|
181
253
|
};
|
|
182
254
|
measure();
|
|
183
255
|
window.addEventListener('resize', measure);
|
|
@@ -223,11 +295,29 @@ export function ComposerTeamSelect(props) {
|
|
|
223
295
|
}
|
|
224
296
|
schedulePanelClose();
|
|
225
297
|
};
|
|
298
|
+
if (teamMode !== undefined && teamMode.enabled !== true)
|
|
299
|
+
return null;
|
|
226
300
|
return (_jsxs(_Fragment, { children: [_jsxs("span", { className: css.wrap, ref: popover, children: [_jsxs("button", { type: "button", className: activeMember === undefined ? css.trigger : `${css.trigger} ${css.triggerMember}`, disabled: !writable, "aria-haspopup": "listbox", "aria-expanded": open, title: failure ?? issue ?? (missing ? `${missingLabel}. ${t('composerMissingHint')}` : t('composerHint')), onClick: () => { setOpen(value => !value); }, children: [accent === ''
|
|
227
301
|
? null
|
|
228
|
-
: (_jsx("span", { className: css.accentDot, style: { background: accent }, "aria-hidden": true })), _jsx("span", { className: css.triggerLabel, "aria-label": t('composerTitle'), children: triggerLabel }), _jsx("span", { className: css.triggerIcon, children: _jsx(IconChevronDownOutlineRegular, { size: 14 }) })] }), open ? (_jsxs("div", { className: css.dock, ref: dock, onBlur: onDockBlur, children: [_jsxs("div", { className: css.popover, role: "listbox", "aria-label": t('composeTitle'), children: [_jsxs("div", { className: css.popHead, children: [_jsx("span", { children: t('composeTitle') }), _jsx("button", { type: "button", className: css.popClose, onClick: () => { closePicker(); }, children: t('composeClose') })] }), _jsx("input", { className: css.popSearch, autoFocus: true, value: query, placeholder: t('composeSearch'), onChange: (event) => { setQuery(event.target.value); } }), _jsxs("div", { className: css.
|
|
229
|
-
|
|
230
|
-
|
|
302
|
+
: (_jsx("span", { className: css.accentDot, style: { background: accent }, "aria-hidden": true })), _jsx("span", { className: css.triggerLabel, "aria-label": t('composerTitle'), children: triggerLabel }), _jsx("span", { className: css.triggerIcon, children: _jsx(IconChevronDownOutlineRegular, { size: 14 }) })] }), open ? (_jsxs("div", { className: css.dock, ref: dock, onBlur: onDockBlur, children: [_jsxs("div", { className: css.popover, role: "listbox", "aria-label": t('composeTitle'), children: [_jsxs("div", { className: css.popHead, children: [_jsx("span", { children: t('composeTitle') }), _jsx("button", { type: "button", className: css.popClose, onClick: () => { closePicker(); }, children: t('composeClose') })] }), _jsx("input", { className: css.popSearch, autoFocus: true, value: query, placeholder: t('composeSearch'), onChange: (event) => { setQuery(event.target.value); } }), _jsxs("div", { className: css.popFilters, children: [_jsxs("label", { className: css.popFilterRow, children: [_jsx("span", { className: css.popFilterLabel, children: t('filterSource') }), _jsxs("select", { className: css.popSelect, value: source, onChange: (event) => {
|
|
303
|
+
const next = event.target.value;
|
|
304
|
+
setSource(next === 'builtin' || next === 'custom' ? next : 'all');
|
|
305
|
+
setSeries('all');
|
|
306
|
+
setCategoryId('');
|
|
307
|
+
}, children: [_jsx("option", { value: "all", children: t('listAll') }), _jsx("option", { value: "builtin", children: t('listBuiltin') }), _jsx("option", { value: "custom", children: t('listCustom') })] })] }), _jsxs("label", { className: css.popFilterRow, children: [_jsx("span", { className: css.popFilterLabel, children: t('filterCategory') }), _jsxs("select", { className: css.popSelect, value: series !== 'all' ? `series:${series}` : categoryId === '' ? '' : `category:${categoryId}`, onChange: (event) => {
|
|
308
|
+
const next = event.target.value;
|
|
309
|
+
if (next.startsWith('series:')) {
|
|
310
|
+
const id = next.slice('series:'.length);
|
|
311
|
+
const known = TEAM_SERIES.find(entry => entry.id === id);
|
|
312
|
+
setSeries(known === undefined ? 'all' : known.id);
|
|
313
|
+
setCategoryId('');
|
|
314
|
+
return;
|
|
315
|
+
}
|
|
316
|
+
setSeries('all');
|
|
317
|
+
setCategoryId(next.startsWith('category:') ? next.slice('category:'.length) : '');
|
|
318
|
+
}, children: [_jsx("option", { value: "", children: t('listAll') }), source === 'custom' ? null : TEAM_SERIES.map(entry => (_jsx("option", { value: `series:${entry.id}`, children: entry.id === 'classic-development' ? t('seriesDevelopment') : t('seriesWorkModes') }, entry.id))), source === 'builtin' ? null : categories.map(entry => (_jsx("option", { value: `category:${entry.id}`, children: entry.name }, entry.id))), source === 'custom' && categories.length === 0
|
|
319
|
+
? _jsx("option", { value: "", disabled: true, children: t('filterNoCategory') })
|
|
320
|
+
: null] })] })] }), _jsxs("div", { className: css.popList, children: [_jsxs("button", { type: "button", className: `${css.popOption} ${selection === undefined ? css.popOptionActive : ''}`, onClick: () => { choose(undefined); }, children: [_jsx("span", { className: css.popOptionName, children: t('composerNone') }), _jsx("span", { className: css.popOptionSub, children: t('composeNoneSub') })] }), missing ? (_jsxs("button", { type: "button", className: css.popOption, disabled: true, children: [_jsx("span", { className: css.popOptionName, children: missingLabel }), _jsx("span", { className: css.popOptionSub, children: t('composerMissingHint') })] })) : null, groups.map(group => group.teams.length === 0 ? null : (_jsxs("div", { children: [_jsx("div", { className: css.popGroup, children: groupLabel(group) }), group.teams.map((team) => (_jsxs("button", { type: "button", role: "option", "aria-selected": selection?.teamId === team.id, className: `${css.popOption} ${selection?.teamId === team.id ? css.popOptionActive : ''}`, onClick: () => { choose(team.id); }, onMouseEnter: () => { showPanel(team.id); }, onMouseLeave: schedulePanelClose, onFocus: () => { showPanel(team.id); }, onBlur: schedulePanelClose, children: [_jsx("span", { className: css.popOptionName, children: team.name === '' ? team.id : team.name }), _jsx("span", { className: css.popOptionSub, title: team.description, children: team.description || team.metadata?.summary || '' })] }, team.id)))] }, group.id))), groups.every(group => group.teams.length === 0) ? _jsx("div", { className: css.popEmpty, children: t('composeEmpty') }) : null] })] }), hoverTeam === undefined ? null : (_jsxs("div", { ref: panel, className: `${css.memberPanel} ${panelPlacement === 'left' ? css.memberPanelLeft : panelPlacement === 'overlay' ? css.memberPanelOverlay : ''}`, role: "group", "aria-label": t('composePanelTitle'), onMouseEnter: cancelHoverClose, onMouseLeave: schedulePanelClose, children: [_jsxs("div", { className: css.panelHead, children: [_jsx("span", { className: css.panelTitle, children: t('composePanelTitle') }), _jsx("span", { className: css.panelTeam, children: hoverTeam.name === '' ? hoverTeam.id : hoverTeam.name })] }), _jsx("div", { className: css.panelSection, children: t('composePanelCaptain') }), _jsxs("button", { type: "button", className: `${css.panelRow} ${isActiveCaptain(hoverTeam) ? css.panelRowActive : ''}`, "aria-pressed": isActiveCaptain(hoverTeam), title: t('composePanelCaptainHint'), onClick: () => { choose(hoverTeam.id); }, children: [_jsxs("span", { className: css.panelRowHead, children: [_jsx("span", { className: css.panelDot, style: hoverTeam.captain.color === '' ? undefined : { background: hoverTeam.captain.color }, "aria-hidden": true }), _jsx("span", { className: css.panelName, children: hoverTeam.captain.name.trim() === '' ? t('composePanelCaptain') : hoverTeam.captain.name }), _jsx("span", { className: css.panelBadge, children: t('composePanelCaptain') })] }), _jsx("span", { className: css.panelRoute, children: t('composePanelSessionModel') }), hoverTeam.captain.description.trim() === '' ? null : _jsx("span", { className: css.panelDesc, children: hoverTeam.captain.description })] }), _jsx("div", { className: css.panelSection, children: t('composePanelMembers') }), hoverTeam.members.length === 0
|
|
231
321
|
? _jsx("div", { className: css.panelEmpty, children: t('composePanelEmptyMembers') })
|
|
232
322
|
: hoverTeam.members.map((member, index) => {
|
|
233
323
|
// A member without a stable identity cannot be named by a
|
|
@@ -235,10 +325,13 @@ export function ComposerTeamSelect(props) {
|
|
|
235
325
|
// than offered as a click that would write nothing usable.
|
|
236
326
|
const selectable = member.id !== undefined && member.id.trim() !== '';
|
|
237
327
|
const route = memberRouteLabel(state.providers, member) ?? t('composePanelSessionModel');
|
|
328
|
+
// Only this member's own role bindings: a captain's skills and
|
|
329
|
+
// another role's skills are not what this conversation loads.
|
|
330
|
+
const boundNames = member.id === undefined ? [] : skillNamesByRole.get(member.id) ?? [];
|
|
238
331
|
return (_jsxs("button", { type: "button", className: `${css.panelRow} ${isActiveMember(hoverTeam, member) ? css.panelRowActive : ''}`, "aria-pressed": isActiveMember(hoverTeam, member), disabled: !selectable, title: selectable ? t('composePanelSoloHint') : t('composePanelNoId'), onClick: () => {
|
|
239
332
|
if (member.id === undefined || member.id.trim() === '')
|
|
240
333
|
return;
|
|
241
334
|
chooseMember(hoverTeam.id, member.id);
|
|
242
|
-
}, children: [_jsxs("span", { className: css.panelRowHead, children: [_jsx("span", { className: css.panelDot, style: member.color === '' ? undefined : { background: member.color }, "aria-hidden": true }), _jsx("span", { className: css.panelName, children: member.name.trim() === '' ? (member.id ?? t('composePanelMembers')) : member.name })] }), _jsx("span", { className: css.panelRoute, children: route }), member.description.trim() === '' ? null : _jsx("span", { className: css.panelDesc, children: member.description }), selectable ? null : _jsx("span", { className: css.panelDesc, children: t('composePanelNoId') })] }, member.id ?? `${hoverTeam.id}:${index}`));
|
|
335
|
+
}, children: [_jsxs("span", { className: css.panelRowHead, children: [_jsx("span", { className: css.panelDot, style: member.color === '' ? undefined : { background: member.color }, "aria-hidden": true }), _jsx("span", { className: css.panelName, children: member.name.trim() === '' ? (member.id ?? t('composePanelMembers')) : member.name })] }), _jsx("span", { className: css.panelRoute, children: route }), member.description.trim() === '' ? null : _jsx("span", { className: css.panelDesc, children: member.description }), boundNames.length === 0 ? null : (_jsx("span", { className: css.panelSkillTags, children: boundNames.map(name => (_jsx("span", { className: css.panelSkillTag, style: skillTagStyle(name), children: name }, name))) })), selectable ? null : _jsx("span", { className: css.panelDesc, children: t('composePanelNoId') })] }, member.id ?? `${hoverTeam.id}:${index}`));
|
|
243
336
|
}), _jsx("div", { className: css.panelHint, children: hoverTeam.members.length === 0 ? t('composePanelCaptainHint') : t('composePanelSoloHint') })] }))] })) : null] }), failure === undefined ? null : _jsx("span", { className: css.failure, role: "status", children: failure })] }));
|
|
244
337
|
}
|
|
@@ -55,5 +55,5 @@ export function TeamImportDialog(props) {
|
|
|
55
55
|
}, {
|
|
56
56
|
replace: t('importMemberReplace'),
|
|
57
57
|
rename: t('importMemberRename'),
|
|
58
|
-
})] }, name))) })] }))] }))] }));
|
|
58
|
+
})] }, name))) })] }))] })), _jsx("p", { className: css.dialogNote, children: t('importNote') })] }));
|
|
59
59
|
}
|
|
@@ -4,7 +4,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
4
4
|
* opens that Team's own page.
|
|
5
5
|
*/
|
|
6
6
|
import { useMemo, useRef, useState } from 'react';
|
|
7
|
-
import { Button } from '@deepseek-ai/dsh-client-ui-primitives';
|
|
7
|
+
import { Button, Modal } from '@deepseek-ai/dsh-client-ui-primitives';
|
|
8
8
|
import { matchTeam, queryTokens, teamOrigin } from "../team-search.js";
|
|
9
9
|
import { TEAM_SERIES, teamSeriesOf } from "../team-catalog.js";
|
|
10
10
|
import css from './TeamPresetsSection.module.css';
|
|
@@ -16,6 +16,7 @@ import css from './TeamPresetsSection.module.css';
|
|
|
16
16
|
export function TeamListView(props) {
|
|
17
17
|
const { t, disabled } = props;
|
|
18
18
|
const fileInput = useRef(null);
|
|
19
|
+
const [confirmRestore, setConfirmRestore] = useState(false);
|
|
19
20
|
const [query, setQuery] = useState('');
|
|
20
21
|
const [source, setSource] = useState('all');
|
|
21
22
|
const [series, setSeries] = useState('all');
|
|
@@ -32,17 +33,17 @@ export function TeamListView(props) {
|
|
|
32
33
|
const matchesQuery = tokens.length === 0 || matchTeam(team, tokens) !== undefined;
|
|
33
34
|
return matchesSource && matchesSeries && matchesCategory && matchesQuery;
|
|
34
35
|
}), [props.teams, props.teamCategories, source, series, category, tokens]);
|
|
35
|
-
return (_jsxs(_Fragment, { children: [_jsxs("header", { className: css.pageHead, children: [_jsx("h2", { className: css.title, children: t('title') }), _jsx("p", { className: css.intro, children: t('description') })] }), _jsxs("div", { className: css.
|
|
36
|
+
return (_jsxs(_Fragment, { children: [_jsxs("header", { className: css.pageHead, children: [_jsx("h2", { className: css.title, children: t('title') }), _jsx("p", { className: css.intro, children: t('description') })] }), _jsxs("div", { className: css.toolbar, children: [_jsxs("div", { className: css.toolbarGroup, children: [_jsx(Button, { size: "sm", variant: "primary", disabled: disabled, onClick: props.onCreate, children: t('newTeam') }), _jsx(Button, { size: "sm", variant: "outline", disabled: disabled, title: t('importNote'), onClick: () => { fileInput.current?.click(); }, children: t('importPreset') })] }), _jsxs("div", { className: css.toolbarGroup, children: [props.onManageCategories === undefined ? null : (_jsx(Button, { size: "sm", variant: "outline", onClick: props.onManageCategories, children: t('categoryManagePage') })), _jsx(Button, { size: "sm", variant: "ghost", disabled: disabled, onClick: () => { setConfirmRestore(true); }, children: t('restoreDefaults') })] }), _jsx("input", { ref: fileInput, className: css.fileInput, type: "file", accept: "application/json,.json", disabled: disabled, onChange: (event) => {
|
|
36
37
|
const file = event.target.files?.[0];
|
|
37
38
|
// Clearing the value lets the same document be chosen twice in a row.
|
|
38
39
|
event.target.value = '';
|
|
39
40
|
if (file !== undefined)
|
|
40
41
|
props.onImport(file);
|
|
41
|
-
} })] }), _jsx("
|
|
42
|
+
} })] }), confirmRestore ? (_jsx(Modal, { open: true, onClose: () => { setConfirmRestore(false); }, title: t('restoreConfirmTitle'), closeLabel: t('close'), footer: (_jsxs(_Fragment, { children: [_jsx(Button, { variant: "outline", onClick: () => { setConfirmRestore(false); }, children: t('cancel') }), _jsx(Button, { variant: "primary", onClick: () => { setConfirmRestore(false); props.onRestoreDefaults(); }, children: t('restoreConfirmAction') })] })), children: _jsx("p", { className: css.dialogCopy, children: t('restoreConfirmBody') }) })) : null, props.importError === undefined
|
|
42
43
|
? null
|
|
43
|
-
: _jsx("p", { className: css.warn, role: "status", children: t(props.importError) }), _jsx("div", { className: css.listToolbar, children: _jsx("input", { className: css.listSearch, value: query, placeholder: t('listSearch'), onChange: (event) => { setQuery(event.target.value); } }) }), _jsxs("div", { className: css.filterRow, children: [_jsx("span", { className: css.filterLabel, children: t('filterSource') }), _jsx("button", { type: "button", className: `${css.chip} ${source === 'all' ? css.chipActive : ''}`, onClick: () => { setSource('all'); }, children: t('listAll') }), _jsx("button", { type: "button", className: `${css.chip} ${source === 'builtin' ? css.chipActive : ''}`, onClick: () => { setSource('builtin'); setCategory(''); }, children: t('listBuiltin') }), _jsx("button", { type: "button", className: `${css.chip} ${source === 'custom' ? css.chipActive : ''}`, onClick: () => { setSource('custom'); setSeries('all'); }, children: t('listCustom') })] }), _jsxs("div", { className: css.filterRow, children: [_jsx("span", { className: css.filterLabel, children: t('filterCategory') }), _jsx("button", { type: "button", className: `${css.chip} ${series === 'all' && category === '' ? css.chipActive : ''}`, onClick: () => { setSeries('all'); setCategory(''); }, children: t('listAll') }), source !== 'custom' ? TEAM_SERIES.map(entry => (_jsx("button", { type: "button", className: `${css.chip} ${series === entry.id ? css.chipActive : ''}`, onClick: () => { setSeries(series === entry.id ? 'all' : entry.id); setCategory(''); }, children: entry.id === 'classic-development' ? t('seriesDevelopment') : t('seriesWorkModes') }, entry.id))) : null, source !== 'builtin' ? [...(props.categories ?? [])].sort((left, right) => left.order - right.order).map(entry => (_jsx("button", { type: "button", className: `${css.chip} ${category === entry.id ? css.chipActive : ''}`, onClick: () => { setCategory(category === entry.id ? '' : entry.id); setSeries('all'); }, children: entry.name }, entry.id))) : null, source === 'custom' && (props.categories ?? []).length === 0
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
: _jsx("p", { className: css.warn, role: "status", children: t(props.importError) }), _jsx("div", { className: css.listToolbar, children: _jsx("input", { className: css.listSearch, value: query, placeholder: t('listSearch'), onChange: (event) => { setQuery(event.target.value); } }) }), _jsxs("div", { className: css.filters, children: [_jsxs("div", { className: css.filterRow, children: [_jsx("span", { className: css.filterLabel, children: t('filterSource') }), _jsx("button", { type: "button", className: `${css.chip} ${source === 'all' ? css.chipActive : ''}`, onClick: () => { setSource('all'); }, children: t('listAll') }), _jsx("button", { type: "button", className: `${css.chip} ${source === 'builtin' ? css.chipActive : ''}`, onClick: () => { setSource('builtin'); setCategory(''); }, children: t('listBuiltin') }), _jsx("button", { type: "button", className: `${css.chip} ${source === 'custom' ? css.chipActive : ''}`, onClick: () => { setSource('custom'); setSeries('all'); }, children: t('listCustom') })] }), _jsxs("div", { className: css.filterRow, children: [_jsx("span", { className: css.filterLabel, children: t('filterCategory') }), _jsx("button", { type: "button", className: `${css.chip} ${series === 'all' && category === '' ? css.chipActive : ''}`, onClick: () => { setSeries('all'); setCategory(''); }, children: t('listAll') }), source !== 'custom' ? TEAM_SERIES.map(entry => (_jsx("button", { type: "button", className: `${css.chip} ${series === entry.id ? css.chipActive : ''}`, onClick: () => { setSeries(series === entry.id ? 'all' : entry.id); setCategory(''); }, children: entry.id === 'classic-development' ? t('seriesDevelopment') : t('seriesWorkModes') }, entry.id))) : null, source !== 'builtin' ? [...(props.categories ?? [])].sort((left, right) => left.order - right.order).map(entry => (_jsx("button", { type: "button", className: `${css.chip} ${category === entry.id ? css.chipActive : ''}`, onClick: () => { setCategory(category === entry.id ? '' : entry.id); setSeries('all'); }, children: entry.name }, entry.id))) : null, source === 'custom' && (props.categories ?? []).length === 0
|
|
45
|
+
? _jsx("span", { className: css.filterLabel, children: t('filterNoCategory') })
|
|
46
|
+
: null] })] }), _jsxs("div", { className: css.resultsHead, children: [_jsx("span", { className: css.resultCount, children: t('listResultCount').replace('{count}', String(visible.length)) }), _jsx("span", { className: css.resultNote, children: t('listNoInject') })] }), props.teams.length === 0
|
|
46
47
|
? _jsx("p", { className: css.emptyPage, children: t('emptyTeams') })
|
|
47
|
-
: (_jsxs("ul", { className: css.rows, children: [visible.length === 0 ? _jsx("li", { className: css.rowsEmpty, children: t('listNoMatch') }) : null, visible.map(team => (_jsxs("li", { className: css.card, "data-series": teamSeriesOf(team.id) ?? '', children: [_jsxs("button", { type: "button", className: css.rowMain, onClick: () => { props.onOpen(team.id); }, children: [_jsx("span", { className: css.dot, style: team.captain.color === '' ? undefined : { background: team.captain.color }, "aria-hidden": true }), _jsxs("span", { className: css.rowText, children: [_jsx("span", { className: css.rowName, children: team.name === '' ? team.id : team.name }), _jsx("span", { className: css.rowMeta, children: `${String(team.members.length)} ${t('memberCount')} · ${t('captainFollowsSession')}` })] })] }), _jsxs("span", { className: css.rowActions, children: [_jsx(Button, { size: "sm", variant: "ghost", onClick: () => { props.onExport(team.id); }, children: t('exportPreset') }), _jsx(Button, { size: "sm", variant: "ghost", disabled: disabled, onClick: () => { props.onDuplicate(team.id); }, children: t('duplicate') }), _jsx(Button, { size: "sm", variant: "ghost", disabled: disabled, onClick: () => { props.onDelete(team.id); }, children: t('remove') })] })] }, team.id)))] }))] }));
|
|
48
|
+
: (_jsxs("ul", { className: css.rows, children: [visible.length === 0 ? _jsx("li", { className: css.rowsEmpty, children: t('listNoMatch') }) : null, visible.map(team => (_jsxs("li", { className: css.card, "data-series": teamSeriesOf(team.id) ?? '', children: [_jsxs("button", { type: "button", className: css.rowMain, onClick: () => { props.onOpen(team.id); }, children: [_jsx("span", { className: css.dot, style: team.captain.color === '' ? undefined : { background: team.captain.color }, "aria-hidden": true }), _jsxs("span", { className: css.rowText, children: [_jsx("span", { className: css.rowName, children: team.name === '' ? team.id : team.name }), _jsx("span", { className: css.rowMeta, children: `${String(team.members.length)} ${t('memberCount')} · ${t('captainFollowsSession')}` })] })] }), _jsxs("span", { className: css.rowActions, children: [_jsx(Button, { size: "sm", variant: "ghost", title: t('importNote'), onClick: () => { props.onExport(team.id); }, children: t('exportPreset') }), _jsx(Button, { size: "sm", variant: "ghost", disabled: disabled, onClick: () => { props.onDuplicate(team.id); }, children: t('duplicate') }), _jsx(Button, { size: "sm", variant: "ghost", disabled: disabled, onClick: () => { props.onDelete(team.id); }, children: t('remove') })] })] }, team.id)))] }))] }));
|
|
48
49
|
}
|
|
@@ -11,6 +11,7 @@ import { TeamCategoryManager } from "./TeamCategoryManager.js";
|
|
|
11
11
|
import { TeamImportDialog } from "./TeamImportDialog.js";
|
|
12
12
|
import { TeamListView } from "./TeamListView.js";
|
|
13
13
|
import { TeamSkillsView } from "./TeamSkillsView.js";
|
|
14
|
+
import { CardPatchView } from "./CardPatchView.js";
|
|
14
15
|
import { defaultImportResolution, executionStateOf, unnamedTeamsOf } from "./team-presets-controller.js";
|
|
15
16
|
import { downloadPresetText, presetFileName, readPresetFile } from "./preset-file.js";
|
|
16
17
|
import { DEFAULTS_NOTICE_KEYS, DISCLOSURE_NOTICE_KEYS, EXECUTION_NOTICE_KEYS, FORM_ISSUE_KEYS, IMPORT_FAILURE_KEYS, selectionFailureText } from "./locales.js";
|
|
@@ -106,9 +107,9 @@ export function TeamPresetsSection(props) {
|
|
|
106
107
|
const { t } = props;
|
|
107
108
|
const state = props.useTeamPresets(snapshot => snapshot);
|
|
108
109
|
const [view, setView] = useState({ kind: 'list' });
|
|
109
|
-
//
|
|
110
|
-
// Skill library
|
|
111
|
-
// service
|
|
110
|
+
// Three pages share one settings section: the Team presets, the private Team
|
|
111
|
+
// Skill library, and the optional card-patch integrations. A page whose
|
|
112
|
+
// service this build does not have is simply absent from the tab bar.
|
|
112
113
|
const [tab, setTab] = useState('teams');
|
|
113
114
|
const [importError, setImportError] = useState(undefined);
|
|
114
115
|
const [importPlan, setImportPlan] = useState(undefined);
|
|
@@ -121,7 +122,14 @@ export function TeamPresetsSection(props) {
|
|
|
121
122
|
// the reference is stable and the effect does not re-run per render.
|
|
122
123
|
useEffect(() => { refreshCatalogue(); }, [refreshCatalogue]);
|
|
123
124
|
if (tab === 'skills' && props.skills !== undefined) {
|
|
124
|
-
return (_jsxs("div", { children: [_jsxs("div", { role: "tablist", className: css.tabs, children: [_jsx(TabButton, { active: false, onClick: () => { setTab('teams'); }, children: t('tabTeams') }), _jsx(TabButton, { active: true, onClick: () => { setTab('skills'); }, children: t('tabSkills') })
|
|
125
|
+
return (_jsxs("div", { children: [_jsxs("div", { role: "tablist", className: css.tabs, children: [_jsx(TabButton, { active: false, onClick: () => { setTab('teams'); }, children: t('tabTeams') }), _jsx(TabButton, { active: true, onClick: () => { setTab('skills'); }, children: t('tabSkills') }), props.cardPatches === undefined
|
|
126
|
+
? null
|
|
127
|
+
: _jsx(TabButton, { active: false, onClick: () => { setTab('links'); }, children: t('tabLinks') })] }), _jsx(TeamSkillsView, { controller: props.skills, t: t })] }));
|
|
128
|
+
}
|
|
129
|
+
if (tab === 'links' && props.cardPatches !== undefined) {
|
|
130
|
+
return (_jsxs("div", { children: [_jsxs("div", { role: "tablist", className: css.tabs, children: [_jsx(TabButton, { active: false, onClick: () => { setTab('teams'); }, children: t('tabTeams') }), props.skills === undefined
|
|
131
|
+
? null
|
|
132
|
+
: _jsx(TabButton, { active: false, onClick: () => { setTab('skills'); }, children: t('tabSkills') }), _jsx(TabButton, { active: true, onClick: () => { setTab('links'); }, children: t('tabLinks') })] }), _jsx(CardPatchView, { controller: props.cardPatches, t: t })] }));
|
|
125
133
|
}
|
|
126
134
|
if (state.status !== 'ready') {
|
|
127
135
|
// The status line names the condition instead of showing one "unavailable"
|
|
@@ -203,7 +211,7 @@ export function TeamPresetsSection(props) {
|
|
|
203
211
|
const agent = team === undefined || active.kind !== 'agent'
|
|
204
212
|
? undefined
|
|
205
213
|
: active.slot === 'captain' ? team.captain : team.members[active.slot];
|
|
206
|
-
return (_jsxs("div", { className: css.section, children: [_jsxs("div", { role: "tablist", className: css.tabs, children: [_jsx(TabButton, { active: tab === 'teams', onClick: () => { setTab('teams'); }, children: t('tabTeams') }), props.skills === undefined ? null : _jsx(TabButton, { active: tab === 'skills', onClick: () => { setTab('skills'); }, children: t('tabSkills') })] }), _jsxs("div", { className: css.page, children: [active.kind === 'categories' && (_jsx(TeamCategoryManager, { categories: state.categories, teamCategories: state.teamCategories, disabled: disabled, t: t, onBack: () => { setView({ kind: 'list' }); }, onAdd: (name) => { void props.addCategory(name); }, onRename: (id, name) => { void props.renameCategory(id, name); }, onMove: (id, delta) => { void props.moveCategory(id, delta); }, onRemove: (id) => { void props.removeCategory(id); } })), active.kind === 'list' && (_jsx(TeamListView, { teams: teamList, t: t, disabled: disabled, importError: importError, categories: categoriesForList, onManageCategories: () => { setView({ kind: 'categories' }); }, teamCategories: state.teamCategories, onOpen: openTeam, onCreate: () => { openTeam(props.createTeam()); }, onImport: (file) => { void importDocument(file); }, onExport: exportDocument, onRestoreDefaults: () => {
|
|
214
|
+
return (_jsxs("div", { className: css.section, children: [_jsxs("div", { role: "tablist", className: css.tabs, children: [_jsx(TabButton, { active: tab === 'teams', onClick: () => { setTab('teams'); }, children: t('tabTeams') }), props.skills === undefined ? null : _jsx(TabButton, { active: tab === 'skills', onClick: () => { setTab('skills'); }, children: t('tabSkills') }), props.cardPatches === undefined ? null : _jsx(TabButton, { active: tab === 'links', onClick: () => { setTab('links'); }, children: t('tabLinks') })] }), _jsxs("div", { className: css.page, children: [active.kind === 'categories' && (_jsx(TeamCategoryManager, { categories: state.categories, teamCategories: state.teamCategories, disabled: disabled, t: t, onBack: () => { setView({ kind: 'list' }); }, onAdd: (name) => { void props.addCategory(name); }, onRename: (id, name) => { void props.renameCategory(id, name); }, onMove: (id, delta) => { void props.moveCategory(id, delta); }, onRemove: (id) => { void props.removeCategory(id); } })), active.kind === 'list' && (_jsx(TeamListView, { teams: teamList, t: t, disabled: disabled, importError: importError, categories: categoriesForList, onManageCategories: () => { setView({ kind: 'categories' }); }, teamCategories: state.teamCategories, onOpen: openTeam, onCreate: () => { openTeam(props.createTeam()); }, onImport: (file) => { void importDocument(file); }, onExport: exportDocument, onRestoreDefaults: () => {
|
|
207
215
|
props.restoreDefaults();
|
|
208
216
|
void props.skills?.restoreBuiltinBindings();
|
|
209
217
|
}, onDuplicate: (teamId) => {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The conversation-header Team roster.
|
|
3
|
+
*
|
|
4
|
+
* Ported from the rc.1 official `agent-team` header action: same slot, same
|
|
5
|
+
* order, same icon/label/hover-popover behaviour and stylesheet. rc.2 folded
|
|
6
|
+
* Teams into the subagent tree and kept only the task board, so the roster rows
|
|
7
|
+
* are reconstructed from this plugin's member snapshots instead of the removed
|
|
8
|
+
* Team projection.
|
|
9
|
+
*/
|
|
10
|
+
import type { InjectFace, PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots';
|
|
11
|
+
import type { TeamRosterInjected } from './team-presets-controller.ts';
|
|
12
|
+
/** Full props of the Team conversation-header action. */
|
|
13
|
+
export type TeamRosterActionProps = PropsRuntime<'conversation.session.header.actions'> & InjectFace<TeamRosterInjected> & PropsLocale<'settings.agentTeamPresets'>;
|
|
14
|
+
/** Render the summoned-member roster as the header's Team action. */
|
|
15
|
+
export declare function TeamRosterAction({ sessionId, openTeammate, roster, useProjection, t, }: TeamRosterActionProps): import("react").JSX.Element | null;
|