dsh-agent-team-presets 0.3.3 → 0.3.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.
Files changed (50) hide show
  1. package/NOTICE +4 -3
  2. package/README.md +2 -2
  3. package/README.zh.md +2 -2
  4. package/assets/card-patches/catalog.json +10 -0
  5. package/assets/card-patches/dsh-context-0.87.0.client.js.gz +0 -0
  6. package/docs/builtin-team-skills.md +4 -4
  7. package/docs/builtin-team-skills.zh.md +4 -4
  8. package/docs/guide/install.md +1 -1
  9. package/docs/guide/install.zh.md +1 -1
  10. package/docs/guide/integrations.md +1 -1
  11. package/docs/guide/integrations.zh.md +1 -1
  12. package/docs/guide/team-skills.md +21 -9
  13. package/docs/guide/team-skills.zh.md +21 -9
  14. package/icon.webp +0 -0
  15. package/lib/client.js +952 -176
  16. package/lib/index.js +560 -297
  17. package/lib/typert.host.js +402 -29
  18. package/lib/typert.remote-client.d.ts +9 -9
  19. package/lib/typert.remote-client.d.ts.map +1 -1
  20. package/lib/typert.remote-client.js +402 -29
  21. package/lib/types/client/TeamImportDialog.d.ts +4 -15
  22. package/lib/types/client/TeamImportDialog.js +29 -25
  23. package/lib/types/client/TeamPresetsSection.js +14 -5
  24. package/lib/types/client/TeamSkillsView.d.ts +3 -3
  25. package/lib/types/client/TeamSkillsView.js +56 -12
  26. package/lib/types/client/locales.d.ts +1 -1
  27. package/lib/types/client/locales.js +60 -8
  28. package/lib/types/client/team-presets-controller.d.ts +15 -2
  29. package/lib/types/client/team-presets-controller.js +86 -30
  30. package/lib/types/client/team-skills-controller.d.ts +14 -5
  31. package/lib/types/client/team-skills-controller.js +71 -37
  32. package/lib/types/index.js +5 -7
  33. package/lib/types/preset-editor.js +3 -4
  34. package/lib/types/preset-transfer.d.ts +1 -1
  35. package/lib/types/presets.d.ts +21 -23
  36. package/lib/types/presets.js +72 -36
  37. package/lib/types/team-skills/import.d.ts +17 -7
  38. package/lib/types/team-skills/import.js +115 -21
  39. package/lib/types/team-skills/index.d.ts +1 -12
  40. package/lib/types/team-skills/index.js +3 -26
  41. package/lib/types/team-skills/manager.d.ts +3 -3
  42. package/lib/types/team-skills/manager.js +39 -81
  43. package/lib/types/team-skills/official-bindings.d.ts +29 -0
  44. package/lib/types/team-skills/official-bindings.js +51 -0
  45. package/lib/types/team-skills/service.d.ts +7 -12
  46. package/lib/types/team-skills/service.js +125 -56
  47. package/lib/types/team-skills/store.d.ts +16 -6
  48. package/lib/types/team-skills/store.js +119 -14
  49. package/lib/types/types.d.ts +18 -4
  50. package/package.json +4 -1
@@ -1,13 +1,5 @@
1
- /**
2
- * Conflict dialog for one Team import.
3
- *
4
- * The document's Team name, captain name, and member names are the keys an
5
- * import matches on, so each one that the target Team already uses is resolved
6
- * here: overwrite the configured agent, or add the imported one under a name
7
- * that is still free. Choosing a new Team name makes the whole document a new
8
- * Team, which is why the agent collisions disappear with that choice.
9
- */
10
- import type { TeamPresetImportPlan, TeamPresetImportResolution } from './team-presets-controller.ts';
1
+ /** Review one Team import and resolve any naming conflicts before staging. */
2
+ import type { TeamPresetImportPlan, TeamPresetImportResolution, TeamPresetImportSkillRow } from './team-presets-controller.ts';
11
3
  import type { TeamPresetsLocaleKey } from './locales.ts';
12
4
  /** Props of the import conflict dialog. */
13
5
  export interface TeamImportDialogProps {
@@ -15,12 +7,9 @@ export interface TeamImportDialogProps {
15
7
  readonly plan: TeamPresetImportPlan;
16
8
  /** Page copy reader. */
17
9
  readonly t: (key: TeamPresetsLocaleKey) => string;
10
+ readonly previewSkills: (resolution: TeamPresetImportResolution) => readonly TeamPresetImportSkillRow[];
18
11
  readonly onCancel: () => void;
19
12
  readonly onConfirm: (resolution: TeamPresetImportResolution) => void;
20
13
  }
21
- /**
22
- * Render the collision dialog for one import.
23
- * @param props - the plan, the page copy, and the two outcomes.
24
- * @returns the dialog; the caller mounts it only while an import is pending.
25
- */
14
+ /** Render a pending import, including any declaration that could not resolve. */
26
15
  export declare function TeamImportDialog(props: TeamImportDialogProps): import("react").JSX.Element;
@@ -1,13 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- /**
3
- * Conflict dialog for one Team import.
4
- *
5
- * The document's Team name, captain name, and member names are the keys an
6
- * import matches on, so each one that the target Team already uses is resolved
7
- * here: overwrite the configured agent, or add the imported one under a name
8
- * that is still free. Choosing a new Team name makes the whole document a new
9
- * Team, which is why the agent collisions disappear with that choice.
10
- */
2
+ /** Review one Team import and resolve any naming conflicts before staging. */
11
3
  import { useState } from 'react';
12
4
  import { Button, Input, Modal } from '@deepseek-ai/dsh-client-ui-primitives';
13
5
  import css from './TeamPresetsSection.module.css';
@@ -23,11 +15,17 @@ import css from './TeamPresetsSection.module.css';
23
15
  function choices(name, value, onChange, labels, autofocus = false) {
24
16
  return (_jsxs("span", { className: css.choiceRow, children: [_jsxs("label", { className: css.choice, children: [_jsx("input", { type: "radio", name: name, checked: value === 'replace', ...autofocus ? { 'data-modal-autofocus': true } : {}, onChange: () => { onChange('replace'); } }), _jsx("span", { children: labels.replace })] }), _jsxs("label", { className: css.choice, children: [_jsx("input", { type: "radio", name: name, checked: value === 'rename', onChange: () => { onChange('rename'); } }), _jsx("span", { children: labels.rename })] })] }));
25
17
  }
26
- /**
27
- * Render the collision dialog for one import.
28
- * @param props - the plan, the page copy, and the two outcomes.
29
- * @returns the dialog; the caller mounts it only while an import is pending.
30
- */
18
+ const skillStatusKeys = {
19
+ 'unknown-skill': 'importSkillUnknown',
20
+ 'missing-role': 'importSkillRoleMissing',
21
+ 'ambiguous-role': 'importSkillRoleAmbiguous',
22
+ 'catalog-ignored': 'importSkillCatalogIgnored',
23
+ 'eligible': 'importSkillEligible',
24
+ 'asset-missing': 'importSkillAssetMissing',
25
+ 'library-unavailable': 'importSkillLibraryUnavailable',
26
+ 'local-override': 'importSkillLocalOverride',
27
+ };
28
+ /** Render a pending import, including any declaration that could not resolve. */
31
29
  export function TeamImportDialog(props) {
32
30
  const { plan, t } = props;
33
31
  const [teamChoice, setTeamChoice] = useState('replace');
@@ -35,19 +33,20 @@ export function TeamImportDialog(props) {
35
33
  const [captainChoice, setCaptainChoice] = useState('replace');
36
34
  const [memberChoices, setMemberChoices] = useState({});
37
35
  const memberChoice = (name) => memberChoices[name] ?? 'replace';
38
- const agentCollisions = teamChoice === 'replace'
36
+ const teamCollision = plan.targetIndex !== undefined;
37
+ const agentCollisions = teamCollision && teamChoice === 'replace'
39
38
  && (plan.captainConflict !== '' || plan.memberConflicts.length > 0);
40
- return (_jsxs(Modal, { open: true, onClose: props.onCancel, title: t('importConflictTitle'), closeLabel: t('close'), footer: (_jsxs(_Fragment, { children: [_jsx(Button, { variant: "outline", onClick: props.onCancel, children: t('cancel') }), _jsx(Button, { variant: "primary", onClick: () => {
41
- props.onConfirm({
42
- team: teamChoice,
43
- teamName,
44
- captain: captainChoice,
45
- members: Object.fromEntries(plan.memberConflicts.map(name => [name, memberChoice(name)])),
46
- });
47
- }, children: t('importConfirm') })] })), children: [_jsxs("section", { className: css.conflict, children: [_jsx("span", { className: css.conflictLead, children: t('importTeamConflict') }), _jsx("span", { className: css.conflictName, children: plan.targetName }), choices('import-team', teamChoice, setTeamChoice, {
39
+ const resolution = {
40
+ team: teamCollision ? teamChoice : 'rename',
41
+ teamName,
42
+ captain: captainChoice,
43
+ members: Object.fromEntries(plan.memberConflicts.map(name => [name, memberChoice(name)])),
44
+ };
45
+ const rows = props.previewSkills(resolution);
46
+ return (_jsxs(Modal, { open: true, onClose: props.onCancel, title: t(teamCollision ? 'importConflictTitle' : 'importPreviewTitle'), closeLabel: t('close'), footer: (_jsxs(_Fragment, { children: [_jsx(Button, { variant: "outline", onClick: props.onCancel, children: t('cancel') }), _jsx(Button, { variant: "primary", onClick: () => { props.onConfirm(resolution); }, children: t('importConfirm') })] })), children: [teamCollision && (_jsxs("section", { className: css.conflict, children: [_jsx("span", { className: css.conflictLead, children: t('importTeamConflict') }), _jsx("span", { className: css.conflictName, children: plan.targetName }), choices('import-team', teamChoice, setTeamChoice, {
48
47
  replace: t('importTeamReplace'),
49
48
  rename: t('importTeamRename'),
50
- }, true), teamChoice === 'rename' ? (_jsxs("div", { className: css.field, children: [_jsx("span", { className: css.fieldLabel, children: t('importNewTeamName') }), _jsx(Input, { className: css.input ?? '', value: teamName, onChange: (event) => { setTeamName(event.target.value); } })] })) : null] }), !agentCollisions ? null : (_jsxs(_Fragment, { children: [plan.captainConflict === '' ? null : (_jsxs("section", { className: css.conflict, children: [_jsx("span", { className: css.conflictLead, children: t('importCaptainConflict') }), _jsx("span", { className: css.conflictName, children: plan.captainConflict }), choices('import-captain', captainChoice, setCaptainChoice, {
49
+ }, true), teamChoice === 'rename' ? (_jsxs("div", { className: css.field, children: [_jsx("span", { className: css.fieldLabel, children: t('importNewTeamName') }), _jsx(Input, { className: css.input ?? '', value: teamName, onChange: (event) => { setTeamName(event.target.value); } })] })) : null] })), !agentCollisions ? null : (_jsxs(_Fragment, { children: [plan.captainConflict === '' ? null : (_jsxs("section", { className: css.conflict, children: [_jsx("span", { className: css.conflictLead, children: t('importCaptainConflict') }), _jsx("span", { className: css.conflictName, children: plan.captainConflict }), choices('import-captain', captainChoice, setCaptainChoice, {
51
50
  replace: t('importCaptainReplace'),
52
51
  rename: t('importCaptainRename'),
53
52
  })] })), plan.memberConflicts.length === 0 ? null : (_jsxs("section", { className: css.conflict, children: [_jsx("span", { className: css.conflictLead, children: t('importMemberConflict') }), _jsx("ul", { className: css.plainRows, children: plan.memberConflicts.map(name => (_jsxs("li", { className: css.conflictMember, children: [_jsx("span", { className: css.conflictName, children: name }), choices(`import-member-${name}`, memberChoice(name), (next) => {
@@ -55,5 +54,10 @@ export function TeamImportDialog(props) {
55
54
  }, {
56
55
  replace: t('importMemberReplace'),
57
56
  rename: t('importMemberRename'),
58
- })] }, name))) })] }))] })), _jsx("p", { className: css.dialogNote, children: t('importNote') })] }));
57
+ })] }, name))) })] }))] })), ['preset', 'catalog'].map(source => {
58
+ const group = rows.filter(row => row.source === source);
59
+ if (group.length === 0)
60
+ return null;
61
+ return (_jsxs("section", { className: css.conflict, "aria-live": "polite", children: [_jsx("h3", { className: css.conflictLead, children: t(source === 'preset' ? 'importSkillDeclarations' : 'importSkillCatalog') }), _jsx("ul", { className: css.plainRows, children: group.map((row, index) => (_jsxs("li", { className: css.conflictMember, children: [_jsxs("strong", { className: css.conflictName, children: [row.skillId, " \u00B7 ", row.roleName] }), _jsx("span", { children: t(skillStatusKeys[row.status]) })] }, `${row.skillId}:${row.roleName}:${index}`))) })] }, source));
62
+ }), _jsx("p", { className: css.dialogNote, children: t('importDraftNote') })] }));
59
63
  }
@@ -3,7 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  * The Agent Team presets settings page: three stacked pages — the Team list,
4
4
  * one Team's roster, and one captain or member — with a shared save footer.
5
5
  */
6
- import { useEffect, useState } from 'react';
6
+ import { useEffect, useState, useSyncExternalStore } from 'react';
7
7
  import { Button } from '@deepseek-ai/dsh-client-ui-primitives';
8
8
  import { TeamAgentView } from "./TeamAgentView.js";
9
9
  import { TeamEditorView } from "./TeamEditorView.js";
@@ -17,6 +17,8 @@ import { defaultImportResolution, executionStateOf, unnamedTeamsOf } from "./tea
17
17
  import { downloadPresetText, presetFileName, readPresetFile } from "./preset-file.js";
18
18
  import { DEFAULTS_NOTICE_KEYS, DISCLOSURE_NOTICE_KEYS, EXECUTION_NOTICE_KEYS, FORM_ISSUE_KEYS, IMPORT_FAILURE_KEYS, selectionFailureText } from "./locales.js";
19
19
  import css from './TeamPresetsSection.module.css';
20
+ const noSkillUpdates = () => () => { };
21
+ const noSkillSnapshot = () => undefined;
20
22
  /**
21
23
  * One tab in the section's own tab bar.
22
24
  * @param props - active state, click handler, and label.
@@ -116,7 +118,9 @@ export function TeamPresetsSection(props) {
116
118
  const [importPlan, setImportPlan] = useState(undefined);
117
119
  // Each inspection replaces the pending dialog, whose choices must not survive it.
118
120
  const [importGeneration, setImportGeneration] = useState(0);
119
- const { refreshCatalogue } = props;
121
+ const { refreshCatalogue, skills } = props;
122
+ const skillState = useSyncExternalStore(skills?.subscribe ?? noSkillUpdates, skills?.getSnapshot ?? noSkillSnapshot);
123
+ const importAssets = skillState?.status === 'ready' ? skillState.library?.assets : undefined;
120
124
  // The settings shell mounts only the active section, so this runs on every
121
125
  // open: a route the deployment gained while the client was running must be
122
126
  // offered without a reload. The inject face is cached per registration, so
@@ -172,12 +176,17 @@ export function TeamPresetsSection(props) {
172
176
  return;
173
177
  }
174
178
  setImportError(undefined);
175
- if (inspection.plan.targetIndex === undefined) {
176
- openTeam(props.applyImport(inspection.plan, defaultImportResolution(inspection.plan)));
179
+ const resolution = defaultImportResolution(inspection.plan);
180
+ const preview = props.previewImport(inspection.plan, resolution, importAssets);
181
+ if (inspection.plan.targetIndex === undefined && preview.length === 0) {
182
+ setImportPlan(undefined);
183
+ openTeam(props.applyImport(inspection.plan, resolution));
177
184
  return;
178
185
  }
179
186
  setImportGeneration(generation => generation + 1);
180
187
  setImportPlan(inspection.plan);
188
+ if (preview.length > 0)
189
+ void skills?.refresh();
181
190
  }
182
191
  /**
183
192
  * Write one Team out as a shareable document.
@@ -245,7 +254,7 @@ export function TeamPresetsSection(props) {
245
254
  props.removeMember(teamIndex, memberSlot);
246
255
  openTeam(team.id);
247
256
  },
248
- } }))] }), importPlan === undefined ? null : (_jsx(TeamImportDialog, { plan: importPlan, t: t, onCancel: () => { setImportPlan(undefined); }, onConfirm: (resolution) => {
257
+ } }))] }), importPlan === undefined ? null : (_jsx(TeamImportDialog, { plan: importPlan, t: t, previewSkills: resolution => props.previewImport(importPlan, resolution, importAssets), onCancel: () => { setImportPlan(undefined); }, onConfirm: (resolution) => {
249
258
  const created = props.applyImport(importPlan, resolution);
250
259
  setImportPlan(undefined);
251
260
  openTeam(created);
@@ -6,14 +6,14 @@
6
6
  * The library page owns discovery: search, the built-in/custom segment, and the
7
7
  * three actions the prototype puts in the title row. The detail page owns one
8
8
  * skill: its file tree and editor, its member references, and the deletion the
9
- * Host refuses while a member still holds it. Assignment itself belongs to the
10
- * member page, so this file never invents a second place to bind a skill.
9
+ * Host refuses while a member still holds it. A built-in skill can be copied
10
+ * here with the option to move its role bindings to the editable copy.
11
11
  * @module dsh-agent-team-presets/client/TeamSkillsView
12
12
  */
13
13
  import type { TeamSkillsController } from './team-skills-controller.ts';
14
14
  import { type TeamPresetsLocaleKey } from './locales.ts';
15
15
  /** Locale keys this panel reads. */
16
- export type TeamSkillsLocaleKey = 'originBuiltin' | 'originCustom' | 'originOverride' | 'skillsTitle' | 'skillsSub' | 'skillsNote' | 'skillsNew' | 'skillsImport' | 'skillsOpenFolder' | 'skillsOpenAssetFolder' | 'skillsSearch' | 'skillsAll' | 'skillsBuiltin' | 'skillsCustom' | 'skillsFiles' | 'skillsBound' | 'skillsEmpty' | 'skillsResources' | 'skillsSaveFile' | 'skillsEditable' | 'skillsReadonly' | 'skillsMakeCopy' | 'skillsResetCopy' | 'skillsBindings' | 'skillsNoBinding' | 'skillsUnbind' | 'skillsDeps' | 'skillsNoDeps' | 'skillsDelete' | 'skillsDeleteTitle' | 'skillsDeleteBody' | 'skillsDeleteBlocked' | 'skillsDeleteBoundWarning' | 'skillsDeleteBuiltinWarning' | 'skillsCancel' | 'skillsConfirm' | 'skillsName' | 'skillsDesc' | 'skillsNewTitle' | 'skillsVersion' | 'skillsOverrideOn' | 'skillsBlockedAssign' | 'skillsMcpUnverified' | 'skillsNameClash' | 'skillsNameClashBody' | 'skillsDeclared' | 'skillsFound' | 'skillsMissing' | 'skillsScan' | 'skillsScanHint' | 'skillsScanSummary' | 'skillsScanEmpty' | 'skillsScanImported' | 'skillsScanExisting' | 'skillsScanInvalid' | 'skillsScanMissingSkill' | 'skillsScanInvalidFrontmatter' | 'skillsScanInvalidName' | 'skillsScanMissingDescription' | 'skillsScanTooLarge' | 'skillsScanSymlink' | 'skillsScanNotDirectory' | 'skillsScanUnreadable' | 'skillsScanDuplicate' | 'skillsScanInstallRefused' | 'skillsOpenScanFolder' | 'skillsCopyScanFolder' | 'skillsScanFolderOpened' | 'skillsScanFolderCopied' | 'skillsScanFolderCopyFailed';
16
+ export type TeamSkillsLocaleKey = 'originBuiltin' | 'originCustom' | 'originOverride' | 'skillsTitle' | 'skillsSub' | 'skillsNote' | 'skillsNew' | 'skillsImport' | 'skillsOpenFolder' | 'skillsOpenAssetFolder' | 'skillsSearch' | 'skillsAll' | 'skillsBuiltin' | 'skillsCustom' | 'skillsFiles' | 'skillsBound' | 'skillsEmpty' | 'skillsResources' | 'skillsSaveFile' | 'skillsEditable' | 'skillsReadonly' | 'skillsMakeCopy' | 'skillsMakeCopyTitle' | 'skillsMakeCopySwitchBindings' | 'skillsMakeCopySwitchIssue' | 'skillsResetCopy' | 'skillsBindings' | 'skillsNoBinding' | 'skillsUnbind' | 'skillsDeps' | 'skillsNoDeps' | 'skillsDelete' | 'skillsDeleteTitle' | 'skillsDeleteBody' | 'skillsDeleteBlocked' | 'skillsDeleteBoundWarning' | 'skillsDeleteBuiltinWarning' | 'skillsCancel' | 'skillsConfirm' | 'skillsName' | 'skillsDesc' | 'skillsNewTitle' | 'skillsVersion' | 'skillsOverrideOn' | 'skillsBlockedAssign' | 'skillsMcpUnverified' | 'skillsNameClash' | 'skillsNameClashBody' | 'skillsDeclared' | 'skillsFound' | 'skillsMissing' | 'skillsScan' | 'skillsScanHint' | 'skillsScanSummary' | 'skillsScanEmpty' | 'skillsScanImported' | 'skillsScanExisting' | 'skillsScanUpdated' | 'skillsScanInvalid' | 'skillsScanSourceMissing' | 'skillsScanMissingSkill' | 'skillsScanInvalidFrontmatter' | 'skillsScanInvalidName' | 'skillsScanMissingDescription' | 'skillsScanTooLarge' | 'skillsScanSymlink' | 'skillsScanNotDirectory' | 'skillsScanUnreadable' | 'skillsScanDuplicate' | 'skillsScanInstallRefused' | 'skillsScanBuiltinNameConflict' | 'skillsScanCopyNameConflict' | 'skillsScanDuplicateSourceName' | 'skillsScanSourceMissingReason' | 'skillsScanSourceChanged' | 'skillsInboxChanges' | 'skillsInboxNew' | 'skillsInboxUpdated' | 'skillsIgnoredDependencyFields' | 'skillsOpenScanFolder' | 'skillsCopyScanFolder' | 'skillsScanFolderOpened' | 'skillsScanFolderCopied' | 'skillsScanFolderCopyFailed';
17
17
  /** Props of {@link TeamSkillsView}. */
18
18
  export interface TeamSkillsViewProps {
19
19
  /** Page state and actions. */
@@ -7,12 +7,12 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
7
7
  * The library page owns discovery: search, the built-in/custom segment, and the
8
8
  * three actions the prototype puts in the title row. The detail page owns one
9
9
  * skill: its file tree and editor, its member references, and the deletion the
10
- * Host refuses while a member still holds it. Assignment itself belongs to the
11
- * member page, so this file never invents a second place to bind a skill.
10
+ * Host refuses while a member still holds it. A built-in skill can be copied
11
+ * here with the option to move its role bindings to the editable copy.
12
12
  * @module dsh-agent-team-presets/client/TeamSkillsView
13
13
  */
14
14
  import { useEffect, useMemo, useState } from 'react';
15
- import { Button } from '@deepseek-ai/dsh-client-ui-primitives';
15
+ import { Button, Modal } from '@deepseek-ai/dsh-client-ui-primitives';
16
16
  import css from './TeamSkillsView.module.css';
17
17
  // The library filters are the same control as the Team list's chips, so they use the
18
18
  // very same classes rather than a lookalike set that can drift.
@@ -47,6 +47,18 @@ const SCAN_REASON_KEYS = {
47
47
  'duplicate': 'skillsScanDuplicate',
48
48
  'duplicate-path': 'skillsScanDuplicate',
49
49
  'install-refused': 'skillsScanInstallRefused',
50
+ 'builtin-name-conflict': 'skillsScanBuiltinNameConflict',
51
+ 'copy-name-conflict': 'skillsScanCopyNameConflict',
52
+ 'duplicate-source-name': 'skillsScanDuplicateSourceName',
53
+ 'source-missing': 'skillsScanSourceMissingReason',
54
+ 'source-changed': 'skillsScanSourceChanged',
55
+ };
56
+ const SCAN_STATUS_KEYS = {
57
+ imported: 'skillsScanImported',
58
+ existing: 'skillsScanExisting',
59
+ updated: 'skillsScanUpdated',
60
+ invalid: 'skillsScanInvalid',
61
+ missing: 'skillsScanSourceMissing',
50
62
  };
51
63
  /** One scan row's explanation, localized when the scanner's code is known. */
52
64
  function scanReasonText(entry, t) {
@@ -54,6 +66,19 @@ function scanReasonText(entry, t) {
54
66
  const label = entry.reason === undefined ? '' : key === undefined ? entry.reason : t(key);
55
67
  return entry.detail === undefined ? label : `${label} (${entry.detail})`;
56
68
  }
69
+ function ignoredDependencyText(fields, t) {
70
+ return t('skillsIgnoredDependencyFields').replace('{fields}', () => fields.join(', '));
71
+ }
72
+ function ScanRows({ entries, pending = false, t }) {
73
+ return (_jsx("ul", { className: css.scanList, children: entries.map(entry => {
74
+ const needsAttention = entry.status === 'invalid' || entry.status === 'missing';
75
+ const status = pending && entry.status === 'imported' ? 'skillsInboxNew'
76
+ : pending && entry.status === 'updated' ? 'skillsInboxUpdated' : SCAN_STATUS_KEYS[entry.status];
77
+ const tone = needsAttention ? css.tagWarn : !pending && entry.status !== 'existing' ? css.tagOk : '';
78
+ const fields = entry.ignoredDependencyFields ?? [];
79
+ return (_jsxs("li", { className: css.scanRow, children: [_jsx("span", { className: css.scanFolder, children: entry.folder }), _jsx("span", { className: `${css.tag} ${tone}`, children: t(status) }), _jsx("span", { className: css.muted, children: needsAttention ? scanReasonText(entry, t) : entry.assetId ?? entry.skillId ?? '' }), fields.length === 0 ? null : _jsx("span", { className: css.muted, children: ignoredDependencyText(fields, t) })] }, `${entry.folder}:${entry.status}:${entry.assetId ?? entry.skillId ?? ''}`));
80
+ }) }));
81
+ }
57
82
  function originLabel(asset, t) {
58
83
  if (asset.origin === 'builtin')
59
84
  return t('originBuiltin');
@@ -73,11 +98,12 @@ export function TeamSkillsView(props) {
73
98
  const [creating, setCreating] = useState(false);
74
99
  const [name, setName] = useState('');
75
100
  const [description, setDescription] = useState('');
101
+ const [copy, setCopy] = useState(undefined);
76
102
  const [confirmDelete, setConfirmDelete] = useState(false);
77
103
  const [deleteOutcome, setDeleteOutcome] = useState(undefined);
78
104
  useEffect(() => {
79
105
  const unsubscribe = controller.subscribe(() => { setState(controller.getSnapshot()); });
80
- void controller.refresh();
106
+ void controller.refresh(true);
81
107
  return unsubscribe;
82
108
  }, [controller]);
83
109
  useEffect(() => { setDraft(state.fileText ?? ''); }, [state.fileText]);
@@ -90,8 +116,10 @@ export function TeamSkillsView(props) {
90
116
  const haystack = `${skillLabel(asset.skillId, t)} ${asset.skillId} ${asset.description}`.toLocaleLowerCase();
91
117
  return matchesOrigin && matchesCategory && query.trim().split(/\s+/u).every(token => haystack.includes(token.toLocaleLowerCase()));
92
118
  }), [assets, origin, category, query, t]);
93
- const detail = state.detail;
94
- const selected = page.kind === 'detail' ? assets.find(asset => asset.id === page.assetId) : undefined;
119
+ const detail = page.kind === 'detail' && state.detail?.asset.id === page.assetId ? state.detail : undefined;
120
+ const copyTitle = detail === undefined ? '' : t('skillsMakeCopyTitle').replace('{skill}', () => skillLabel(detail.asset.skillId, t));
121
+ const ignoredFields = detail?.ignoredDependencyFields ?? [];
122
+ const inboxChanges = (state.inboxChanges ?? []).filter(entry => entry.status !== 'existing');
95
123
  /**
96
124
  * Pick a folder and hand its files to the Host.
97
125
  * @param list - the picker's files.
@@ -105,13 +133,15 @@ export function TeamSkillsView(props) {
105
133
  const path = relative === '' ? file.name : relative.includes('/') ? relative.slice(relative.indexOf('/') + 1) : relative;
106
134
  files.push({ path, content: new Uint8Array(await file.arrayBuffer()) });
107
135
  }
108
- await controller.importFolder(files);
136
+ const assetId = await controller.importFolder(files);
137
+ if (assetId !== undefined)
138
+ setPage({ kind: 'detail', assetId });
109
139
  };
110
140
  if (state.status === 'unavailable') {
111
141
  return (_jsxs("div", { className: css.page, children: [_jsx("h2", { className: css.title, children: t('skillsTitle') }), _jsx("div", { className: css.info, children: state.issue ?? t('skillsEmpty') })] }));
112
142
  }
113
143
  if (page.kind === 'detail') {
114
- return (_jsxs("div", { className: css.page, children: [_jsxs("button", { type: "button", className: css.crumb, onClick: () => { setPage({ kind: 'list' }); setConfirmDelete(false); setDeleteOutcome(undefined); }, children: ["\u2039 ", t('skillsTitle')] }), detail === undefined || selected === undefined ? _jsx("div", { className: css.empty, children: t('skillsEmpty') }) : (_jsxs(_Fragment, { children: [_jsxs("h2", { className: css.title, children: [skillLabel(detail.asset.skillId, t), " ", _jsx("span", { className: css.muted, children: detail.asset.skillId })] }), _jsx("p", { className: css.sub, children: detail.asset.description }), _jsxs("div", { className: css.pills, children: [_jsxs("span", { className: `${chips.originTag} ${originTone(chips, detail.asset.origin)}`, children: [originLabel(detail.asset, t), " \u00B7 ", detail.asset.editable ? t('skillsEditable') : t('skillsReadonly')] }), _jsxs("span", { className: css.tag, children: [t('skillsVersion'), " ", detail.asset.version] }), _jsxs("span", { className: css.tag, children: [detail.asset.fileCount, " ", t('skillsFiles')] }), detail.asset.updateAvailable === true ? _jsx("span", { className: `${css.tag} ${css.tagWarn}`, children: t('skillsOverrideOn') }) : null, (detail.asset.clashesWith?.length ?? 0) > 0 ? _jsx("span", { className: `${css.tag} ${css.tagWarn}`, children: t('skillsNameClash') }) : null] }), (detail.asset.clashesWith?.length ?? 0) > 0 ? (_jsxs("div", { className: css.info, children: [t('skillsNameClashBody'), "\uFF1A", [detail.asset.id, ...(detail.asset.clashesWith ?? [])].join(' / ')] })) : null, (() => {
144
+ return (_jsxs("div", { className: css.page, children: [_jsxs("button", { type: "button", className: css.crumb, onClick: () => { setPage({ kind: 'list' }); setCopy(undefined); setConfirmDelete(false); setDeleteOutcome(undefined); }, children: ["\u2039 ", t('skillsTitle')] }), detail === undefined ? _jsx("div", { className: css.empty, children: t('skillsEmpty') }) : (_jsxs(_Fragment, { children: [_jsxs("h2", { className: css.title, children: [skillLabel(detail.asset.skillId, t), " ", _jsx("span", { className: css.muted, children: detail.asset.skillId })] }), _jsx("p", { className: css.sub, children: detail.asset.description }), _jsxs("div", { className: css.pills, children: [_jsxs("span", { className: `${chips.originTag} ${originTone(chips, detail.asset.origin)}`, children: [originLabel(detail.asset, t), " \u00B7 ", detail.asset.editable ? t('skillsEditable') : t('skillsReadonly')] }), _jsxs("span", { className: css.tag, children: [t('skillsVersion'), " ", detail.asset.version] }), _jsxs("span", { className: css.tag, children: [detail.asset.fileCount, " ", t('skillsFiles')] }), detail.asset.updateAvailable === true ? _jsx("span", { className: `${css.tag} ${css.tagWarn}`, children: t('skillsOverrideOn') }) : null, (detail.asset.clashesWith?.length ?? 0) > 0 ? _jsx("span", { className: `${css.tag} ${css.tagWarn}`, children: t('skillsNameClash') }) : null] }), (detail.asset.clashesWith?.length ?? 0) > 0 ? (_jsxs("div", { className: css.info, children: [t('skillsNameClashBody'), "\uFF1A", [detail.asset.id, ...(detail.asset.clashesWith ?? [])].join(' / ')] })) : null, (() => {
115
145
  const missing = (detail.dependencies?.executables ?? []).filter(row => !row.found);
116
146
  const unverified = detail.asset.mcpServers;
117
147
  if (missing.length === 0 && unverified.length === 0)
@@ -119,11 +149,20 @@ export function TeamSkillsView(props) {
119
149
  return (_jsx("div", { className: `${css.info} ${missing.length > 0 ? css.infoError : ''}`, children: missing.length > 0
120
150
  ? _jsxs("span", { children: [t('skillsBlockedAssign'), "\uFF1A", missing.map(row => row.name).join(', ')] })
121
151
  : _jsxs("span", { children: [t('skillsMcpUnverified'), "\uFF1A", unverified.join(', ')] }) }));
122
- })(), _jsx("div", { className: css.sectionTitle, children: t('skillsResources') }), _jsxs("div", { className: css.fileArea, children: [_jsx("div", { className: css.fileTree, children: detail.files.map(file => (_jsxs("button", { type: "button", className: state.file === file.path ? css.active : '', onClick: () => { void controller.openFile(file.path); }, children: [file.path.includes('/') ? '↳ ' : '◫ ', file.path] }, file.path))) }), _jsxs("div", { className: css.fileEditor, children: [_jsxs("div", { className: css.fileTop, children: [_jsx("span", { children: state.file ?? 'SKILL.md' }), _jsx("span", { children: detail.asset.editable ? t('skillsEditable') : t('skillsReadonly') })] }), _jsx("textarea", { className: css.code, spellCheck: false, value: draft, readOnly: !detail.asset.editable, onChange: (event) => { setDraft(event.target.value); } })] })] }), _jsxs("div", { className: css.actions, children: [detail.asset.editable ? (_jsx(Button, { onClick: () => { void controller.saveFile(state.file ?? 'SKILL.md', draft); }, children: t('skillsSaveFile') })) : (_jsx(Button, { onClick: () => { void controller.createOverride(detail.asset.skillId); }, children: t('skillsMakeCopy') })), detail.asset.origin === 'override'
152
+ })(), ignoredFields.length === 0 ? null : (_jsx("div", { className: css.info, children: ignoredDependencyText(ignoredFields, t) })), detail.bindingSwitchIssue === undefined ? null : (_jsx("div", { className: `${css.info} ${css.infoError}`, role: "status", children: t('skillsMakeCopySwitchIssue').replace('{issue}', () => detail.bindingSwitchIssue ?? '') })), _jsx("div", { className: css.sectionTitle, children: t('skillsResources') }), _jsxs("div", { className: css.fileArea, children: [_jsx("div", { className: css.fileTree, children: detail.files.map(file => (_jsxs("button", { type: "button", className: state.file === file.path ? css.active : '', onClick: () => { void controller.openFile(file.path); }, children: [file.path.includes('/') ? '↳ ' : '◫ ', file.path] }, file.path))) }), _jsxs("div", { className: css.fileEditor, children: [_jsxs("div", { className: css.fileTop, children: [_jsx("span", { children: state.file ?? 'SKILL.md' }), _jsx("span", { children: detail.asset.editable ? t('skillsEditable') : t('skillsReadonly') })] }), _jsx("textarea", { className: css.code, spellCheck: false, value: draft, readOnly: !detail.asset.editable, onChange: (event) => { setDraft(event.target.value); } })] })] }), _jsxs("div", { className: css.actions, children: [detail.asset.editable ? (_jsx(Button, { onClick: () => { void controller.saveFile(state.file ?? 'SKILL.md', draft); }, children: t('skillsSaveFile') })) : (_jsx(Button, { disabled: state.busy, onClick: () => { setCopy({ switchBindings: false, attempted: false }); }, children: t('skillsMakeCopy') })), detail.asset.origin === 'override'
123
153
  ? _jsx(Button, { onClick: () => { void controller.resetOverride(detail.asset.id); }, children: t('skillsResetCopy') })
124
154
  : null, _jsx(Button, { onClick: () => { void navigator.clipboard?.writeText(detail.directory); }, children: t('skillsOpenAssetFolder') }), _jsx(Button, { onClick: () => { setConfirmDelete(true); setDeleteOutcome(undefined); }, children: t('skillsDelete') })] }), _jsxs("div", { className: css.panel, children: [_jsxs("div", { className: css.panelTitle, children: [t('skillsBindings'), " \u00B7 ", detail.asset.bindings.length] }), detail.asset.bindings.length === 0 ? _jsx("div", { className: css.muted, children: t('skillsNoBinding') }) : detail.asset.bindings.map(row => (_jsxs("div", { className: css.bindRow, children: [_jsx("span", { className: css.dot }), _jsxs("span", { className: css.main, children: [_jsx("span", { className: css.rowTitle, children: row.teamName }), _jsx("span", { className: css.rowSub, children: row.roleName })] }), _jsx("button", { type: "button", className: css.mini, onClick: () => { void controller.unassign(row.teamId, row.roleId); }, children: t('skillsUnbind') })] }, `${row.teamId}:${row.roleId}`)))] }), _jsxs("div", { className: css.panel, children: [_jsx("div", { className: css.panelTitle, children: t('skillsDeps') }), (detail.asset.mcpServers.length === 0 && (detail.dependencies?.executables.length ?? 0) === 0)
125
155
  ? _jsx("div", { className: css.muted, children: t('skillsNoDeps') })
126
- : (_jsxs(_Fragment, { children: [detail.asset.mcpServers.map(server => (_jsxs("div", { className: css.muted, children: ["MCP \u00B7 ", server, " ", _jsx("span", { className: css.tag, children: t('skillsDeclared') })] }, server))), (detail.dependencies?.executables ?? []).map(row => (_jsxs("div", { className: css.muted, children: [row.name, " ", _jsx("span", { className: `${css.tag} ${row.found ? css.tagOk : css.tagWarn}`, children: row.found ? t('skillsFound') : t('skillsMissing') })] }, row.name)))] }))] }), state.message === undefined ? null : (_jsx("div", { className: `${css.message} ${state.failed ? css.messageFailed : ''}`, children: state.message })), confirmDelete ? (_jsx("div", { className: css.dialogBackdrop, onClick: () => {
156
+ : (_jsxs(_Fragment, { children: [detail.asset.mcpServers.map(server => (_jsxs("div", { className: css.muted, children: ["MCP \u00B7 ", server, " ", _jsx("span", { className: css.tag, children: t('skillsDeclared') })] }, server))), (detail.dependencies?.executables ?? []).map(row => (_jsxs("div", { className: css.muted, children: [row.name, " ", _jsx("span", { className: `${css.tag} ${row.found ? css.tagOk : css.tagWarn}`, children: row.found ? t('skillsFound') : t('skillsMissing') })] }, row.name)))] }))] }), state.message === undefined || copy !== undefined ? null : (_jsx("div", { className: `${css.message} ${state.failed ? css.messageFailed : ''}`, children: state.message })), copy === undefined ? null : (_jsxs(Modal, { open: true, headless: true, title: copyTitle, className: css.dialog ?? '', backdropBlur: false, onClose: () => { if (!state.busy)
157
+ setCopy(undefined); }, children: [_jsx("h2", { children: copyTitle }), _jsxs("label", { className: css.label, children: [_jsx("input", { type: "checkbox", "data-modal-autofocus": true, checked: copy.switchBindings, disabled: state.busy, onChange: (event) => { setCopy({ ...copy, switchBindings: event.target.checked }); } }), t('skillsMakeCopySwitchBindings').replace('{count}', String(detail.asset.bindings.length))] }), copy.attempted && state.message !== undefined ? (_jsx("div", { className: `${css.message} ${css.messageFailed}`, role: "alert", children: state.message })) : null, _jsxs("div", { className: css.dialogActions, children: [_jsx(Button, { disabled: state.busy, onClick: () => { setCopy(undefined); }, children: t('skillsCancel') }), _jsx(Button, { disabled: state.busy, onClick: () => {
158
+ setCopy({ ...copy, attempted: true });
159
+ void controller.createOverride(detail.asset.skillId, copy.switchBindings).then(assetId => {
160
+ if (assetId === undefined)
161
+ return;
162
+ setPage({ kind: 'detail', assetId });
163
+ setCopy(undefined);
164
+ });
165
+ }, children: t('skillsMakeCopy') })] })] })), confirmDelete ? (_jsx("div", { className: css.dialogBackdrop, onClick: () => {
127
166
  setConfirmDelete(false);
128
167
  setDeleteOutcome(undefined);
129
168
  }, children: _jsxs("div", { className: css.dialog, role: "dialog", "aria-modal": "true", onClick: (event) => { event.stopPropagation(); }, children: [_jsx("h2", { children: t('skillsDeleteTitle') }), _jsx("p", { className: css.muted, children: t('skillsDeleteBody') }), detail.asset.origin === 'builtin' ? (_jsx("div", { className: `${css.info} ${css.infoError}`, style: { margin: '12px 0 0' }, children: _jsx("strong", { children: t('skillsDeleteBuiltinWarning') }) })) : null, detail.asset.bindings.length > 0 ? (_jsxs("div", { className: `${css.info} ${css.infoError}`, style: { margin: '12px 0 0', display: 'flex', flexDirection: 'column', gap: '6px' }, children: [_jsx("div", { children: _jsx("strong", { children: t('skillsDeleteBoundWarning') }) }), _jsx("div", { style: { display: 'flex', flexDirection: 'column', gap: '4px', fontSize: '12px', maxHeight: '140px', overflowY: 'auto' }, children: detail.asset.bindings.map(b => (_jsxs("div", { children: ["\u2022 ", b.teamName, " \u2192 ", b.roleName] }, `${b.teamId}:${b.roleId}`))) })] })) : null, deleteOutcome?.ok === false && deleteOutcome.blockers.length > 0 ? (_jsxs("div", { className: `${css.info} ${css.infoError}`, style: { margin: '12px 0 0', display: 'flex', flexDirection: 'column', gap: '6px' }, children: [_jsx("div", { children: _jsx("strong", { children: t('skillsDeleteBlocked') }) }), _jsx("div", { style: { display: 'flex', flexDirection: 'column', gap: '4px', fontSize: '12px' }, children: deleteOutcome.blockers.map((blocker, idx) => (_jsxs("div", { children: ["\u2022 ", blocker.detail || blocker.kind] }, idx))) })] })) : null, _jsxs("div", { className: css.dialogActions, children: [_jsx(Button, { onClick: () => { setConfirmDelete(false); setDeleteOutcome(undefined); }, children: t('skillsCancel') }), _jsx(Button, { disabled: detail.asset.origin === 'builtin' || detail.asset.bindings.length > 0, onClick: () => {
@@ -140,11 +179,16 @@ export function TeamSkillsView(props) {
140
179
  }, children: t('skillsConfirm') })] })] }) })) : null] }))] }));
141
180
  }
142
181
  return (_jsxs("div", { className: css.page, children: [_jsxs("div", { className: css.headRow, children: [_jsxs("div", { className: css.headText, children: [_jsx("h2", { className: css.title, children: t('skillsTitle') }), _jsx("p", { className: css.sub, children: t('skillsSub') })] }), _jsxs("div", { className: css.titleActions, children: [_jsx(Button, { variant: "outline", onClick: () => { setCreating(true); }, children: t('skillsNew') }), _jsx(Button, { variant: "outline", onClick: () => { void controller.openScanFolder(); }, children: state.canOpenScanFolder ? t('skillsOpenScanFolder') : t('skillsCopyScanFolder') })] })] }), _jsxs("div", { className: css.info, children: ["\u24D8 ", _jsx("span", { children: t('skillsNote') })] }), state.scanFolderNotice === undefined ? null : (_jsx("div", { className: css.info, children: _jsx("span", { children: t(state.scanFolderNotice === 'opened' ? 'skillsScanFolderOpened'
143
- : state.scanFolderNotice === 'copied' ? 'skillsScanFolderCopied' : 'skillsScanFolderCopyFailed') }) })), _jsxs("div", { className: css.actions, children: [_jsx("input", { id: "team-skill-import", type: "file", multiple: true, style: { display: 'none' }, onChange: (event) => { void importFolder(event.target.files); }, webkitdirectory: '' }), _jsx(Button, { variant: "outline", onClick: () => { document.getElementById('team-skill-import')?.click(); }, children: t('skillsImport') }), _jsx(Button, { variant: "outline", onClick: () => { void controller.scanImportFolder(); }, children: t('skillsScan') })] }), state.scan === undefined ? null : (_jsxs("div", { className: css.scan, children: [_jsx("div", { className: css.scanHead, children: t('skillsScanSummary')
182
+ : state.scanFolderNotice === 'copied' ? 'skillsScanFolderCopied' : 'skillsScanFolderCopyFailed') }) })), _jsxs("div", { className: css.actions, children: [_jsx("input", { id: "team-skill-import", type: "file", multiple: true, style: { display: 'none' }, onChange: (event) => {
183
+ void importFolder(event.target.files);
184
+ event.target.value = '';
185
+ }, webkitdirectory: '' }), _jsx(Button, { variant: "outline", disabled: state.busy, onClick: () => { document.getElementById('team-skill-import')?.click(); }, children: t('skillsImport') }), _jsx(Button, { variant: "outline", disabled: state.busy, onClick: () => { void controller.scanImportFolder(); }, children: t('skillsScan') })] }), inboxChanges.length === 0 ? null : (_jsxs("div", { className: css.scan, children: [_jsx("div", { className: css.scanHead, role: "status", children: t('skillsInboxChanges').replace('{count}', String(inboxChanges.length)) }), _jsx(ScanRows, { entries: inboxChanges, pending: true, t: t })] })), state.scan === undefined ? null : (_jsxs("div", { className: css.scan, children: [_jsx("div", { className: css.scanHead, children: t('skillsScanSummary')
144
186
  .replace('{scanned}', String(state.scan.scanned))
145
187
  .replace('{imported}', String(state.scan.imported))
188
+ .replace('{updated}', String(state.scan.updated ?? 0))
146
189
  .replace('{existing}', String(state.scan.existing))
147
- .replace('{invalid}', String(state.scan.invalid)) }), _jsxs("div", { className: css.muted, children: [t('skillsScanHint'), " ", state.scan.root] }), state.scan.entries.length === 0 ? _jsx("div", { className: css.muted, children: t('skillsScanEmpty') }) : (_jsx("ul", { className: css.scanList, children: state.scan.entries.map(entry => (_jsxs("li", { className: css.scanRow, children: [_jsx("span", { className: css.scanFolder, children: entry.folder }), _jsx("span", { className: `${css.tag} ${entry.status === 'imported' ? css.tagOk : entry.status === 'invalid' ? css.tagWarn : ''}`, children: t(entry.status === 'imported' ? 'skillsScanImported' : entry.status === 'existing' ? 'skillsScanExisting' : 'skillsScanInvalid') }), _jsx("span", { className: css.muted, children: entry.status === 'invalid' ? scanReasonText(entry, t) : entry.assetId ?? entry.skillId ?? '' })] }, entry.folder))) }))] })), _jsxs("div", { className: css.toolbar, children: [_jsx("input", { className: css.search, value: query, placeholder: t('skillsSearch'), onChange: (event) => { setQuery(event.target.value); } }), _jsxs("select", { className: chips.select, "aria-label": t('skillsCategoryAll'), value: category, onChange: (event) => { setCategory(event.target.value); }, children: [_jsx("option", { value: "all", children: t('skillsCategoryAll') }), SKILL_CATEGORIES.map(id => (_jsx("option", { value: id, children: t(SKILL_CATEGORY_LABELS[id]) }, id)))] })] }), _jsxs("div", { className: css.segment, children: [_jsx("button", { type: "button", className: `${chips.chip} ${origin === 'all' ? chips.chipActive : ''}`, onClick: () => { setOrigin('all'); }, children: t('skillsAll') }), _jsx("button", { type: "button", className: `${chips.chip} ${origin === 'builtin' ? chips.chipActive : ''}`, onClick: () => { setOrigin('builtin'); }, children: t('skillsBuiltin') }), _jsx("button", { type: "button", className: `${chips.chip} ${origin === 'custom' ? chips.chipActive : ''}`, onClick: () => { setOrigin('custom'); }, children: t('skillsCustom') })] }), _jsx("div", { className: css.rowlist, children: visible.length === 0 ? _jsx("div", { className: css.empty, children: assets.length === 0 ? t('skillsEmpty') : t('skillsFilterEmpty') }) : visible.map(asset => (_jsxs("button", { type: "button", className: css.row, onClick: () => { setPage({ kind: 'detail', assetId: asset.id }); void controller.select(asset.id); }, children: [_jsx("span", { className: `${css.dot} ${asset.origin === 'builtin' ? '' : css.dotCustom}` }), _jsxs("span", { className: css.main, children: [_jsxs("span", { className: css.rowTitle, children: [skillLabel(asset.skillId, t), _jsx("span", { className: css.muted, children: asset.skillId }), _jsx("span", { className: `${chips.originTag} ${originTone(chips, asset.origin)}`, children: originLabel(asset, t) }), asset.updateAvailable === true ? _jsx("span", { className: `${css.tag} ${css.tagWarn}`, children: t('skillsOverrideOn') }) : null] }), _jsxs("span", { className: css.rowSub, children: [asset.description, " \u00B7 ", asset.fileCount, " ", t('skillsFiles'), " \u00B7 ", t('skillsBound'), " ", asset.bindings.length] })] }), _jsx("span", { className: css.chev, children: "\u203A" })] }, asset.id))) }), state.message === undefined ? null : (_jsx("div", { className: `${css.message} ${state.failed ? css.messageFailed : ''}`, children: state.message })), creating ? (_jsx("div", { className: css.dialogBackdrop, onClick: () => { setCreating(false); }, children: _jsxs("div", { className: css.dialog, role: "dialog", "aria-modal": "true", onClick: (event) => { event.stopPropagation(); }, children: [_jsx("h2", { children: t('skillsNewTitle') }), _jsx("label", { className: css.label, children: t('skillsName') }), _jsx("input", { className: css.field, value: name, placeholder: "example-skill", onChange: (event) => { setName(event.target.value); } }), _jsx("label", { className: css.label, children: t('skillsDesc') }), _jsx("input", { className: css.field, value: description, placeholder: t('skillsDesc'), onChange: (event) => { setDescription(event.target.value); } }), _jsxs("div", { className: css.dialogActions, children: [_jsx(Button, { onClick: () => { setCreating(false); }, children: t('skillsCancel') }), _jsx(Button, { onClick: () => {
190
+ .replace('{missing}', String(state.scan.missing ?? 0))
191
+ .replace('{invalid}', String(state.scan.invalid)) }), _jsxs("div", { className: css.muted, children: [t('skillsScanHint'), " ", state.scan.root] }), state.scan.entries.length === 0 ? _jsx("div", { className: css.muted, children: t('skillsScanEmpty') }) : _jsx(ScanRows, { entries: state.scan.entries, t: t })] })), _jsxs("div", { className: css.toolbar, children: [_jsx("input", { className: css.search, value: query, placeholder: t('skillsSearch'), onChange: (event) => { setQuery(event.target.value); } }), _jsxs("select", { className: chips.select, "aria-label": t('skillsCategoryAll'), value: category, onChange: (event) => { setCategory(event.target.value); }, children: [_jsx("option", { value: "all", children: t('skillsCategoryAll') }), SKILL_CATEGORIES.map(id => (_jsx("option", { value: id, children: t(SKILL_CATEGORY_LABELS[id]) }, id)))] })] }), _jsxs("div", { className: css.segment, children: [_jsx("button", { type: "button", className: `${chips.chip} ${origin === 'all' ? chips.chipActive : ''}`, onClick: () => { setOrigin('all'); }, children: t('skillsAll') }), _jsx("button", { type: "button", className: `${chips.chip} ${origin === 'builtin' ? chips.chipActive : ''}`, onClick: () => { setOrigin('builtin'); }, children: t('skillsBuiltin') }), _jsx("button", { type: "button", className: `${chips.chip} ${origin === 'custom' ? chips.chipActive : ''}`, onClick: () => { setOrigin('custom'); }, children: t('skillsCustom') })] }), _jsx("div", { className: css.rowlist, children: visible.length === 0 ? _jsx("div", { className: css.empty, children: assets.length === 0 ? t('skillsEmpty') : t('skillsFilterEmpty') }) : visible.map(asset => (_jsxs("button", { type: "button", className: css.row, onClick: () => { setPage({ kind: 'detail', assetId: asset.id }); void controller.select(asset.id); }, children: [_jsx("span", { className: `${css.dot} ${asset.origin === 'builtin' ? '' : css.dotCustom}` }), _jsxs("span", { className: css.main, children: [_jsxs("span", { className: css.rowTitle, children: [skillLabel(asset.skillId, t), _jsx("span", { className: css.muted, children: asset.skillId }), _jsx("span", { className: `${chips.originTag} ${originTone(chips, asset.origin)}`, children: originLabel(asset, t) }), asset.updateAvailable === true ? _jsx("span", { className: `${css.tag} ${css.tagWarn}`, children: t('skillsOverrideOn') }) : null] }), _jsxs("span", { className: css.rowSub, children: [asset.description, " \u00B7 ", asset.fileCount, " ", t('skillsFiles'), " \u00B7 ", t('skillsBound'), " ", asset.bindings.length] })] }), _jsx("span", { className: css.chev, children: "\u203A" })] }, asset.id))) }), state.message === undefined ? null : (_jsx("div", { className: `${css.message} ${state.failed ? css.messageFailed : ''}`, children: state.message })), creating ? (_jsx("div", { className: css.dialogBackdrop, onClick: () => { setCreating(false); }, children: _jsxs("div", { className: css.dialog, role: "dialog", "aria-modal": "true", onClick: (event) => { event.stopPropagation(); }, children: [_jsx("h2", { children: t('skillsNewTitle') }), _jsx("label", { className: css.label, children: t('skillsName') }), _jsx("input", { className: css.field, value: name, placeholder: "example-skill", onChange: (event) => { setName(event.target.value); } }), _jsx("label", { className: css.label, children: t('skillsDesc') }), _jsx("input", { className: css.field, value: description, placeholder: t('skillsDesc'), onChange: (event) => { setDescription(event.target.value); } }), _jsxs("div", { className: css.dialogActions, children: [_jsx(Button, { onClick: () => { setCreating(false); }, children: t('skillsCancel') }), _jsx(Button, { onClick: () => {
148
192
  void controller.create(name, description).then(() => {
149
193
  setName('');
150
194
  setDescription('');
@@ -3,7 +3,7 @@ import type { TeamPresetImportFailure } from '../preset-transfer.ts';
3
3
  import type { TeamExecutionState, TeamSkillAssetView } from '../types.ts';
4
4
  import type { DefaultsRestore, TeamPresetsFormIssue, TeamSelectionFailure } from './team-presets-controller.ts';
5
5
  /** Locale keys this plugin renders. */
6
- export type TeamPresetsLocaleKey = 'nav' | 'title' | 'description' | 'newTeam' | 'duplicate' | 'remove' | 'removeMember' | 'teamList' | 'emptyTeams' | 'emptySelection' | 'memberCount' | 'teamName' | 'teamNamePlaceholder' | 'teamDescription' | 'captain' | 'captainHint' | 'members' | 'addMember' | 'membersHint' | 'agentName' | 'agentNamePlaceholder' | 'agentColor' | 'agentDescription' | 'route' | 'routeInherit' | 'provider' | 'model' | 'effort' | 'effortDefault' | 'captainModelHint' | 'captainFollowsSession' | 'modelsPartial' | 'modelsFailed' | 'tools' | 'toolsHint' | 'toolMode' | 'toolsDefault' | 'toolsCustom' | 'toolsAllHint' | 'toolsEmpty' | 'toolsScoped' | 'toolsSelectAll' | 'toolsClear' | 'toolsRemove' | 'toolsUnavailable' | 'toolsLoading' | 'toolsFailed' | 'toolsNoCatalog' | 'toolsCaptainOnly' | 'toolsGroupPresets' | 'toolsGroupMcp' | 'toolsGroupOther' | 'toolsInvert' | 'composerMissing' | 'composerMissingHint' | 'systemPrompt' | 'systemPromptPlaceholder' | 'systemPromptHint' | 'promptWarnBraces' | 'save' | 'saving' | 'saveFailed' | 'discard' | 'unsaved' | 'readOnly' | 'unavailable' | 'sectionLoading' | 'formIssueSettingsUnavailable' | 'formIssueNamespaceMissing' | 'formIssueSchemaRejected' | 'selectionUnavailable' | 'selectionRefused' | 'selectionFailed' | 'teamNameRequired' | 'externalUpdateOne' | 'externalUpdateMany' | 'externalUpdateOverriddenOne' | 'externalUpdateOverriddenMany' | 'executionBusy' | 'executionBusyShared' | 'executionIdle' | 'executionUnknown' | 'executionPtcOverridden' | 'externalAddedOne' | 'externalAddedMany' | 'externalRemovedOne' | 'externalRemovedMany' | 'externalRemovedEditedOne' | 'externalRemovedEditedMany' | 'back' | 'backToList' | 'editCaptain' | 'editMember' | 'teamSections' | 'agentSections' | 'modelSection' | 'promptSection' | 'toolsSection' | 'identitySection' | 'emptyMembers' | 'inheritSession' | 'deleteAgent' | 'roleCaptain' | 'roleMember' | 'composerTitle' | 'composerNone' | 'composerHint' | 'trigger' | 'loading' | 'unavailable' | 'roster' | 'model' | 'open' | 'current' | 'memberStatus.running' | 'memberStatus.inactive' | 'presetMemberBadge' | 'presetMemberBadgeHint' | 'tasks' | 'empty' | 'owner' | 'unowned' | 'blockedBy' | 'writeScopes' | 'ready' | 'blocked' | 'task.expand' | 'task.collapse' | 'status.pending' | 'status.in_progress' | 'status.completed' | 'importPreset' | 'exportPreset' | 'importNote' | 'importConfirm' | 'cancel' | 'close' | 'restoreDefaults' | 'restoreDefaultsHint' | 'defaultsRestored' | 'defaultsUnchanged' | 'restoreMissingHint' | 'importConflictTitle' | 'importTeamConflict' | 'importTeamReplace' | 'importTeamRename' | 'importNewTeamName' | 'importCaptainConflict' | 'importCaptainReplace' | 'importCaptainRename' | 'importMemberConflict' | 'importMemberReplace' | 'importMemberRename' | 'importInvalidJson' | 'importInvalidFormat' | 'importUnsupportedVersion' | 'importUnsupportedFields' | 'importDuplicateMembers' | 'importTooManyMembers' | 'importTooLarge' | 'importInvalidMetadata' | 'skillsEmpty' | 'skillsImport' | 'skillsNew' | 'skillsSave' | 'skillsDelete' | 'skillsAssign' | 'skillsUnassign' | 'skillsBuiltinList' | 'skillsFiles' | 'skillsBindings' | 'skillsNamePlaceholder' | 'skillsDescriptionPlaceholder' | 'skillsRoot' | 'skillsRefresh' | 'tabLinks' | 'patchIntro' | 'patchUnavailable' | 'patchStateAbsent' | 'patchStateUnsupported' | 'patchStatePristine' | 'patchStatePatched' | 'patchStateForeign' | 'patchUnsupportedReason' | 'patchActive' | 'patchSupported' | 'patchInstalledVersion' | 'patchSource' | 'patchPendingHint' | 'patchApplying' | 'patchWaiting' | 'patchInstall' | 'patchUninstall' | 'patchWorking' | 'patchInstallTitle' | 'patchUninstallTitle' | 'patchInstallBody' | 'patchUninstallBody' | 'patchPackage' | 'patchFile' | 'patchInstalledOk' | 'patchRemovedOk' | 'patchRefused' | 'skillsScan' | 'skillsScanHint' | 'skillsScanSummary' | 'skillsScanEmpty' | 'skillsScanImported' | 'skillsScanExisting' | 'skillsScanInvalid' | 'skillsScanMissingSkill' | 'skillsScanInvalidFrontmatter' | 'skillsScanInvalidName' | 'skillsScanMissingDescription' | 'skillsScanTooLarge' | 'skillsScanSymlink' | 'skillsScanNotDirectory' | 'skillsScanUnreadable' | 'skillsScanDuplicate' | 'skillsScanInstallRefused' | 'skillsOpenScanFolder' | 'skillsCopyScanFolder' | 'skillsScanFolderOpened' | 'skillsScanFolderCopied' | 'skillsScanFolderCopyFailed' | 'skillsOverride' | 'skillsReset' | 'skillsBody' | 'tabTeams' | 'tabSkills' | 'skillsHint' | 'skillsAssignTitle' | 'skillsAssignHint' | 'skillsAssignEmpty' | 'skillsNameClash' | 'skillsNameClashBody' | 'skillsBlockedAssign' | 'skillsMcpUnverified' | 'skillsDeclared' | 'skillsFound' | 'skillsMissing' | 'categoryRename' | 'categoryUp' | 'categoryDown' | 'categoryManagePage' | 'categoryTitle' | 'categorySub' | 'categoryTeams' | 'categorySave' | 'categoryRemove' | 'categoryNote' | 'categoryManage' | 'categoryFold' | 'categoryName' | 'categoryAdd' | 'categoryEmpty' | 'categoryOf' | 'categoryNone' | 'metadataTitle' | 'metadataOnlyDisplay' | 'metadataNote' | 'metadataFold' | 'metadataUnfold' | 'metadataSummary' | 'metadataTags' | 'metadataTagsHint' | 'metadataUseCases' | 'metadataQuickPrompts' | 'metadataNotes' | 'filterSource' | 'filterCategory' | 'filterNoCategory' | 'listSearch' | 'listAll' | 'listBuiltin' | 'listCustom' | 'seriesDevelopment' | 'seriesWorkModes' | 'listMatched' | 'listNoInject' | 'listNoMatch' | 'listResultCount' | 'restoreConfirmTitle' | 'restoreConfirmBody' | 'restoreConfirmAction' | 'composeTitle' | 'composeClose' | 'composeSearch' | 'composeAll' | 'composeFilterCategory' | 'composeCategoryAll' | 'composeUncategorized' | 'composeNoneSub' | 'composeSeriesDev' | 'composeSeriesModes' | 'composeEmpty' | 'composePanelTitle' | 'composePanelCaptain' | 'composePanelMembers' | 'composePanelSessionModel' | 'composePanelCaptainHint' | 'composePanelSoloHint' | 'composePanelEmptyMembers' | 'composePanelNoId' | 'composerMissingMember' | 'originBuiltin' | 'originCustom' | 'originOverride' | 'skillsTitle' | 'skillsSub' | 'skillsNote' | 'skillsOpenFolder' | 'skillsOpenAssetFolder' | 'skillsSearch' | 'skillsAll' | 'skillsBuiltin' | 'skillsCustom' | 'skillsBound' | 'skillsResources' | 'skillsSaveFile' | 'skillsEditable' | 'skillsReadonly' | 'skillsMakeCopy' | 'skillsResetCopy' | 'skillsNoBinding' | 'skillsUnbind' | 'skillsDeps' | 'skillsNoDeps' | 'skillsDeleteTitle' | 'skillsDeleteBody' | 'skillsDeleteBlocked' | 'skillsDeleteBoundWarning' | 'skillsDeleteBuiltinWarning' | 'skillsCancel' | 'skillsConfirm' | 'skillsName' | 'skillsDesc' | 'skillsNewTitle' | 'skillsVersion' | 'skillsOverrideOn' | 'skillAgentLeaderCommunication' | 'skillLeaderMediumTaskWorkflow' | 'skillLeaderLongTaskOrchestration' | 'skillAgentSubagentOrchestration' | 'skillFullstackAdvisor' | 'skillExecutorShortTaskWorkflow' | 'skillGithubRepositoryPresentation' | 'skillGitReleaseHygiene' | 'skillGrilling' | 'skillResearch' | 'skillFrontendEngineeringWorkflow' | 'skillBackendArchitectureWorkflow' | 'skillIndependentCodeReviewWorkflow' | 'skillsCategoryAll' | 'skillsCategoryWorkflow' | 'skillsCategoryDelivery' | 'skillsCategoryMethod' | 'skillsCategoryCustom' | 'skillsFilterEmpty';
6
+ export type TeamPresetsLocaleKey = 'nav' | 'title' | 'description' | 'newTeam' | 'duplicate' | 'remove' | 'removeMember' | 'teamList' | 'emptyTeams' | 'emptySelection' | 'memberCount' | 'teamName' | 'teamNamePlaceholder' | 'teamDescription' | 'captain' | 'captainHint' | 'members' | 'addMember' | 'membersHint' | 'agentName' | 'agentNamePlaceholder' | 'agentColor' | 'agentDescription' | 'route' | 'routeInherit' | 'provider' | 'model' | 'effort' | 'effortDefault' | 'captainModelHint' | 'captainFollowsSession' | 'modelsPartial' | 'modelsFailed' | 'tools' | 'toolsHint' | 'toolMode' | 'toolsDefault' | 'toolsCustom' | 'toolsAllHint' | 'toolsEmpty' | 'toolsScoped' | 'toolsSelectAll' | 'toolsClear' | 'toolsRemove' | 'toolsUnavailable' | 'toolsLoading' | 'toolsFailed' | 'toolsNoCatalog' | 'toolsCaptainOnly' | 'toolsGroupPresets' | 'toolsGroupMcp' | 'toolsGroupOther' | 'toolsInvert' | 'composerMissing' | 'composerMissingHint' | 'systemPrompt' | 'systemPromptPlaceholder' | 'systemPromptHint' | 'promptWarnBraces' | 'save' | 'saving' | 'saveFailed' | 'discard' | 'unsaved' | 'readOnly' | 'unavailable' | 'sectionLoading' | 'formIssueSettingsUnavailable' | 'formIssueNamespaceMissing' | 'formIssueSchemaRejected' | 'selectionUnavailable' | 'selectionRefused' | 'selectionFailed' | 'teamNameRequired' | 'externalUpdateOne' | 'externalUpdateMany' | 'externalUpdateOverriddenOne' | 'externalUpdateOverriddenMany' | 'executionBusy' | 'executionBusyShared' | 'executionIdle' | 'executionUnknown' | 'executionPtcOverridden' | 'externalAddedOne' | 'externalAddedMany' | 'externalRemovedOne' | 'externalRemovedMany' | 'externalRemovedEditedOne' | 'externalRemovedEditedMany' | 'back' | 'backToList' | 'editCaptain' | 'editMember' | 'teamSections' | 'agentSections' | 'modelSection' | 'promptSection' | 'toolsSection' | 'identitySection' | 'emptyMembers' | 'inheritSession' | 'deleteAgent' | 'roleCaptain' | 'roleMember' | 'composerTitle' | 'composerNone' | 'composerHint' | 'trigger' | 'loading' | 'unavailable' | 'roster' | 'model' | 'open' | 'current' | 'memberStatus.running' | 'memberStatus.inactive' | 'presetMemberBadge' | 'presetMemberBadgeHint' | 'tasks' | 'empty' | 'owner' | 'unowned' | 'blockedBy' | 'writeScopes' | 'ready' | 'blocked' | 'task.expand' | 'task.collapse' | 'status.pending' | 'status.in_progress' | 'status.completed' | 'importPreset' | 'exportPreset' | 'importNote' | 'importConfirm' | 'cancel' | 'close' | 'restoreDefaults' | 'restoreDefaultsHint' | 'defaultsRestored' | 'defaultsUnchanged' | 'restoreMissingHint' | 'importConflictTitle' | 'importTeamConflict' | 'importTeamReplace' | 'importTeamRename' | 'importNewTeamName' | 'importCaptainConflict' | 'importCaptainReplace' | 'importCaptainRename' | 'importMemberConflict' | 'importMemberReplace' | 'importMemberRename' | 'importPreviewTitle' | 'importDraftNote' | 'importSkillDeclarations' | 'importSkillCatalog' | 'importSkillUnknown' | 'importSkillRoleMissing' | 'importSkillRoleAmbiguous' | 'importSkillCatalogIgnored' | 'importSkillEligible' | 'importSkillAssetMissing' | 'importSkillLibraryUnavailable' | 'importSkillLocalOverride' | 'importInvalidJson' | 'importInvalidFormat' | 'importUnsupportedVersion' | 'importUnsupportedFields' | 'importDuplicateMembers' | 'importTooManyMembers' | 'importTooLarge' | 'importInvalidMetadata' | 'skillsEmpty' | 'skillsImport' | 'skillsNew' | 'skillsSave' | 'skillsDelete' | 'skillsAssign' | 'skillsUnassign' | 'skillsBuiltinList' | 'skillsFiles' | 'skillsBindings' | 'skillsNamePlaceholder' | 'skillsDescriptionPlaceholder' | 'skillsRoot' | 'skillsRefresh' | 'tabLinks' | 'patchIntro' | 'patchUnavailable' | 'patchStateAbsent' | 'patchStateUnsupported' | 'patchStatePristine' | 'patchStatePatched' | 'patchStateForeign' | 'patchUnsupportedReason' | 'patchActive' | 'patchSupported' | 'patchInstalledVersion' | 'patchSource' | 'patchPendingHint' | 'patchApplying' | 'patchWaiting' | 'patchInstall' | 'patchUninstall' | 'patchWorking' | 'patchInstallTitle' | 'patchUninstallTitle' | 'patchInstallBody' | 'patchUninstallBody' | 'patchPackage' | 'patchFile' | 'patchInstalledOk' | 'patchRemovedOk' | 'patchRefused' | 'skillsScan' | 'skillsScanHint' | 'skillsScanSummary' | 'skillsScanEmpty' | 'skillsScanImported' | 'skillsScanExisting' | 'skillsScanUpdated' | 'skillsScanInvalid' | 'skillsScanSourceMissing' | 'skillsScanMissingSkill' | 'skillsScanInvalidFrontmatter' | 'skillsScanInvalidName' | 'skillsScanMissingDescription' | 'skillsScanTooLarge' | 'skillsScanSymlink' | 'skillsScanNotDirectory' | 'skillsScanUnreadable' | 'skillsScanDuplicate' | 'skillsScanInstallRefused' | 'skillsScanBuiltinNameConflict' | 'skillsScanCopyNameConflict' | 'skillsScanDuplicateSourceName' | 'skillsScanSourceMissingReason' | 'skillsScanSourceChanged' | 'skillsInboxChanges' | 'skillsInboxNew' | 'skillsInboxUpdated' | 'skillsIgnoredDependencyFields' | 'skillsOpenScanFolder' | 'skillsCopyScanFolder' | 'skillsScanFolderOpened' | 'skillsScanFolderCopied' | 'skillsScanFolderCopyFailed' | 'skillsOverride' | 'skillsReset' | 'skillsBody' | 'tabTeams' | 'tabSkills' | 'skillsHint' | 'skillsAssignTitle' | 'skillsAssignHint' | 'skillsAssignEmpty' | 'skillsNameClash' | 'skillsNameClashBody' | 'skillsBlockedAssign' | 'skillsMcpUnverified' | 'skillsDeclared' | 'skillsFound' | 'skillsMissing' | 'categoryRename' | 'categoryUp' | 'categoryDown' | 'categoryManagePage' | 'categoryTitle' | 'categorySub' | 'categoryTeams' | 'categorySave' | 'categoryRemove' | 'categoryNote' | 'categoryManage' | 'categoryFold' | 'categoryName' | 'categoryAdd' | 'categoryEmpty' | 'categoryOf' | 'categoryNone' | 'metadataTitle' | 'metadataOnlyDisplay' | 'metadataNote' | 'metadataFold' | 'metadataUnfold' | 'metadataSummary' | 'metadataTags' | 'metadataTagsHint' | 'metadataUseCases' | 'metadataQuickPrompts' | 'metadataNotes' | 'filterSource' | 'filterCategory' | 'filterNoCategory' | 'listSearch' | 'listAll' | 'listBuiltin' | 'listCustom' | 'seriesDevelopment' | 'seriesWorkModes' | 'listMatched' | 'listNoInject' | 'listNoMatch' | 'listResultCount' | 'restoreConfirmTitle' | 'restoreConfirmBody' | 'restoreConfirmAction' | 'composeTitle' | 'composeClose' | 'composeSearch' | 'composeAll' | 'composeFilterCategory' | 'composeCategoryAll' | 'composeUncategorized' | 'composeNoneSub' | 'composeSeriesDev' | 'composeSeriesModes' | 'composeEmpty' | 'composePanelTitle' | 'composePanelCaptain' | 'composePanelMembers' | 'composePanelSessionModel' | 'composePanelCaptainHint' | 'composePanelSoloHint' | 'composePanelEmptyMembers' | 'composePanelNoId' | 'composerMissingMember' | 'originBuiltin' | 'originCustom' | 'originOverride' | 'skillsTitle' | 'skillsSub' | 'skillsNote' | 'skillsOpenFolder' | 'skillsOpenAssetFolder' | 'skillsSearch' | 'skillsAll' | 'skillsBuiltin' | 'skillsCustom' | 'skillsBound' | 'skillsResources' | 'skillsSaveFile' | 'skillsEditable' | 'skillsReadonly' | 'skillsMakeCopy' | 'skillsMakeCopyTitle' | 'skillsMakeCopySwitchBindings' | 'skillsMakeCopySwitchIssue' | 'skillsResetCopy' | 'skillsNoBinding' | 'skillsUnbind' | 'skillsDeps' | 'skillsNoDeps' | 'skillsDeleteTitle' | 'skillsDeleteBody' | 'skillsDeleteBlocked' | 'skillsDeleteBoundWarning' | 'skillsDeleteBuiltinWarning' | 'skillsCancel' | 'skillsConfirm' | 'skillsName' | 'skillsDesc' | 'skillsNewTitle' | 'skillsVersion' | 'skillsOverrideOn' | 'skillAgentLeaderCommunication' | 'skillLeaderMediumTaskWorkflow' | 'skillLeaderLongTaskOrchestration' | 'skillAgentSubagentOrchestration' | 'skillFullstackAdvisor' | 'skillExecutorShortTaskWorkflow' | 'skillGithubRepositoryPresentation' | 'skillGitReleaseHygiene' | 'skillGrilling' | 'skillResearch' | 'skillFrontendEngineeringWorkflow' | 'skillBackendArchitectureWorkflow' | 'skillIndependentCodeReviewWorkflow' | 'skillsCategoryAll' | 'skillsCategoryWorkflow' | 'skillsCategoryDelivery' | 'skillsCategoryMethod' | 'skillsCategoryCustom' | 'skillsFilterEmpty';
7
7
  /** Locale namespace owned by this plugin. */
8
8
  export declare const NS = "settings.agentTeamPresets";
9
9
  /** English copy. */
@@ -134,7 +134,8 @@ export const en = {
134
134
  composerMissingHint: 'This is not No team. An unapplicable selection denies tools; a running task keeps its old policy until idle. Choose a valid Team or No team.',
135
135
  importPreset: 'Import preset',
136
136
  exportPreset: 'Export',
137
- importNote: 'A shared document carries names, descriptions, system prompts, and colors. Model routes and tool permissions stay local.',
137
+ importNote: 'A shared document carries names, descriptions, system prompts, colors, display metadata, and built-in skill declarations. Model routes and tool permissions stay local.',
138
+ importDraftNote: 'Import stages the preset as a draft. Save to apply it. Skill defaults respect existing local overrides and manual unbinding.',
138
139
  restoreDefaults: 'Restore built-in presets',
139
140
  restoreDefaultsHint: 'Puts every preset this plugin ships back to its shipped name, description, prompts, colors, and roster. The model routes and tool permissions you configured stay as they are, and teams you created yourself are not touched.',
140
141
  defaultsRestored: 'Default presets restored in this draft. Save to apply them.',
@@ -154,6 +155,17 @@ export const en = {
154
155
  importMemberConflict: 'These members already exist in that team',
155
156
  importMemberReplace: 'Replace that member',
156
157
  importMemberRename: 'Add it renamed',
158
+ importPreviewTitle: 'Review preset import',
159
+ importSkillDeclarations: 'Preset skill declarations',
160
+ importSkillCatalog: 'Built-in team defaults',
161
+ importSkillUnknown: 'Invalid declaration. Only built-in skills are supported.',
162
+ importSkillRoleMissing: 'Invalid declaration. The role does not exist.',
163
+ importSkillRoleAmbiguous: 'Invalid declaration. The role does not resolve to a unique slot.',
164
+ importSkillCatalogIgnored: 'This team ID uses the built-in catalog rules.',
165
+ importSkillEligible: 'Eligible for automatic binding after saving.',
166
+ importSkillAssetMissing: 'The built-in asset is missing. The declaration is kept for automatic binding when the asset becomes available.',
167
+ importSkillLibraryUnavailable: 'Asset availability could not be checked. The declaration is kept.',
168
+ importSkillLocalOverride: 'This role’s existing local override takes precedence.',
157
169
  importInvalidJson: 'That file is not valid JSON.',
158
170
  importInvalidFormat: 'That file is not a Team preset document.',
159
171
  importUnsupportedVersion: 'That document was written by a newer version of this plugin.',
@@ -206,11 +218,13 @@ export const en = {
206
218
  patchRefused: 'Nothing changed.',
207
219
  skillsScan: 'Scan import folder',
208
220
  skillsScanHint: 'Folder path:',
209
- skillsScanSummary: 'Scanned {scanned}: imported {imported}, already present {existing}, refused {invalid}.',
221
+ skillsScanSummary: 'Scanned {scanned}. Imported {imported}, updated {updated}, unchanged {existing}, missing {missing}, refused {invalid}.',
210
222
  skillsScanEmpty: 'No skill folder was found in the import folder.',
211
223
  skillsScanImported: 'imported',
212
- skillsScanExisting: 'already present',
224
+ skillsScanExisting: 'unchanged',
225
+ skillsScanUpdated: 'updated',
213
226
  skillsScanInvalid: 'refused',
227
+ skillsScanSourceMissing: 'source missing',
214
228
  skillsScanMissingSkill: 'missing SKILL.md',
215
229
  skillsScanInvalidFrontmatter: 'invalid frontmatter',
216
230
  skillsScanInvalidName: 'name is not kebab-case',
@@ -221,6 +235,15 @@ export const en = {
221
235
  skillsScanUnreadable: 'cannot be read',
222
236
  skillsScanDuplicate: 'same skill name',
223
237
  skillsScanInstallRefused: 'publish refused',
238
+ skillsScanBuiltinNameConflict: 'name matches a built-in skill',
239
+ skillsScanCopyNameConflict: 'name matches an existing local copy',
240
+ skillsScanDuplicateSourceName: 'another source folder declares this skill name',
241
+ skillsScanSourceMissingReason: 'the previously imported source folder is missing',
242
+ skillsScanSourceChanged: 'source changed during the scan. Scan again.',
243
+ skillsInboxChanges: 'Changes in the import folder ({count})',
244
+ skillsInboxNew: 'new skill',
245
+ skillsInboxUpdated: 'update available',
246
+ skillsIgnoredDependencyFields: 'Dependency fields ignored on import ({fields}). Use set_team_skill_dependencies to configure this skill’s dependencies.',
224
247
  skillsOpenScanFolder: 'Open scan folder',
225
248
  skillsCopyScanFolder: 'Copy scan folder path',
226
249
  skillsScanFolderOpened: 'The scan folder is open. Put one skill folder inside it, then scan.',
@@ -250,7 +273,10 @@ export const en = {
250
273
  skillsEditable: 'editable',
251
274
  skillsReadonly: 'read-only original',
252
275
  skillsMakeCopy: 'Create an editable copy',
253
- skillsResetCopy: 'Reset to the built-in copy',
276
+ skillsMakeCopyTitle: 'Create an editable copy of {skill}?',
277
+ skillsMakeCopySwitchBindings: 'Switch currently bound roles to the copy ({count})',
278
+ skillsMakeCopySwitchIssue: 'The editable copy was created. Role bindings could not be switched. {issue}',
279
+ skillsResetCopy: 'Reset copy and switch roles back to the built-in skill',
254
280
  skillsNoBinding: 'Not assigned to any member yet',
255
281
  skillsUnbind: 'Remove',
256
282
  skillsDeps: 'MCP and runtime dependencies',
@@ -494,7 +520,8 @@ export const zh = {
494
520
  composerMissingHint: '这不是“不使用团队”。无法应用时权限保持拒绝;进行中的任务保留旧策略直到空闲。请改选有效团队或“不使用团队”。',
495
521
  importPreset: '导入预设',
496
522
  exportPreset: '导出',
497
- importNote: '共享文档只携带名称、描述、系统提示词和颜色;模型路由与工具权限保留在本地。',
523
+ importNote: '共享文档携带名称、描述、系统提示词、颜色、展示信息和内置技能声明。模型路由与工具权限保留在本地。',
524
+ importDraftNote: '导入会暂存为草稿,保存后生效。技能默认规则会保留已有的本地副本绑定和手动解绑。',
498
525
  restoreDefaults: '恢复内置预设',
499
526
  restoreDefaultsHint: '把插件自带的预设全部恢复到出厂的名称、说明、提示词、颜色和成员名单;你为它们配置的模型路由与工具权限保持不变,你自己创建的团队完全不受影响。',
500
527
  defaultsRestored: '默认预设已恢复到草稿,保存后生效。',
@@ -514,6 +541,17 @@ export const zh = {
514
541
  importMemberConflict: '该团队已存在这些队员',
515
542
  importMemberReplace: '替换该队员',
516
543
  importMemberRename: '重命名后新增',
544
+ importPreviewTitle: '预览预设导入',
545
+ importSkillDeclarations: '预设技能声明',
546
+ importSkillCatalog: '内置团队默认技能',
547
+ importSkillUnknown: '声明无效,仅支持插件内置技能。',
548
+ importSkillRoleMissing: '声明无效,找不到该角色。',
549
+ importSkillRoleAmbiguous: '声明无效,无法唯一确定该角色。',
550
+ importSkillCatalogIgnored: '该团队 ID 使用内置团队默认规则。',
551
+ importSkillEligible: '保存后符合自动绑定条件。',
552
+ importSkillAssetMissing: '当前缺少该内置资产。声明会保留,资产可用后可自动补绑。',
553
+ importSkillLibraryUnavailable: '暂时无法核实资产是否可用。声明会保留。',
554
+ importSkillLocalOverride: '该角色已有对应的本地副本绑定,将优先保留。',
517
555
  importInvalidJson: '该文件不是合法的 JSON。',
518
556
  importInvalidFormat: '该文件不是团队预设文档。',
519
557
  importUnsupportedVersion: '该文档由更新版本的插件生成。',
@@ -566,11 +604,13 @@ export const zh = {
566
604
  patchRefused: '未做任何修改。',
567
605
  skillsScan: '扫描导入目录',
568
606
  skillsScanHint: '目录路径:',
569
- skillsScanSummary: '已检查 {scanned} 个:新增 {imported},已存在 {existing},无法导入 {invalid}。',
607
+ skillsScanSummary: '已扫描 {scanned} 个目录。导入 {imported},更新 {updated},无变化 {existing},来源缺失 {missing},无法导入 {invalid}。',
570
608
  skillsScanEmpty: '导入目录里没有发现技能文件夹。',
571
609
  skillsScanImported: '已导入',
572
- skillsScanExisting: '已存在',
610
+ skillsScanExisting: '无变化',
611
+ skillsScanUpdated: '已更新',
573
612
  skillsScanInvalid: '无法导入',
613
+ skillsScanSourceMissing: '来源缺失',
574
614
  skillsScanMissingSkill: '缺少 SKILL.md',
575
615
  skillsScanInvalidFrontmatter: 'frontmatter 格式不正确',
576
616
  skillsScanInvalidName: 'name 不符合 kebab-case',
@@ -581,6 +621,15 @@ export const zh = {
581
621
  skillsScanUnreadable: '无法读取',
582
622
  skillsScanDuplicate: '技能名重复',
583
623
  skillsScanInstallRefused: '发布被拒绝',
624
+ skillsScanBuiltinNameConflict: '与内置技能同名',
625
+ skillsScanCopyNameConflict: '与已有本地副本同名',
626
+ skillsScanDuplicateSourceName: '另一个来源目录已声明此技能名',
627
+ skillsScanSourceMissingReason: '此前导入该技能的来源目录已缺失',
628
+ skillsScanSourceChanged: '来源在扫描期间发生了变化,请重新扫描。',
629
+ skillsInboxChanges: '导入目录有变动({count})',
630
+ skillsInboxNew: '新技能',
631
+ skillsInboxUpdated: '有更新',
632
+ skillsIgnoredDependencyFields: '导入时已忽略依赖字段({fields})。请使用 set_team_skill_dependencies 配置此技能的依赖。',
584
633
  skillsOpenScanFolder: '打开扫描技能目录',
585
634
  skillsCopyScanFolder: '复制扫描技能目录',
586
635
  skillsScanFolderOpened: '已打开扫描目录。把一个技能文件夹放进去后点扫描即可。',
@@ -610,7 +659,10 @@ export const zh = {
610
659
  skillsEditable: '可编辑',
611
660
  skillsReadonly: '只读原版',
612
661
  skillsMakeCopy: '创建本地可编辑副本',
613
- skillsResetCopy: '恢复为插件内置版本',
662
+ skillsMakeCopyTitle: '创建「{skill}」的本地可编辑副本?',
663
+ skillsMakeCopySwitchBindings: '将当前绑定此技能的角色切换到副本({count})',
664
+ skillsMakeCopySwitchIssue: '已创建可编辑副本。未能切换角色绑定。{issue}',
665
+ skillsResetCopy: '重置副本并将角色切回内置技能',
614
666
  skillsNoBinding: '尚未分配给任何成员',
615
667
  skillsUnbind: '解除绑定',
616
668
  skillsDeps: 'MCP 及运行环境依赖',