dsh-agent-team-presets 0.3.2 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE +57 -3
- package/README.md +73 -398
- package/README.zh.md +79 -404
- package/assets/card-patches/catalog.json +20 -0
- package/assets/card-patches/dsh-context-0.85.0.client.js.gz +0 -0
- package/assets/card-patches/dsh-context-0.85.1.client.js.gz +0 -0
- package/assets/skills/agent-leader-communication/SKILL.md +100 -0
- package/assets/skills/agent-subagent-orchestration/SKILL.md +56 -0
- package/assets/skills/agent-subagent-orchestration/references/executor-parallel-execution.md +56 -0
- package/assets/skills/agent-subagent-orchestration/references/leader-discovery.md +53 -0
- package/assets/skills/agent-subagent-orchestration/references/subagent-communication.md +58 -0
- package/assets/skills/backend-architecture-workflow/SKILL.md +55 -0
- package/assets/skills/backend-architecture-workflow/references/README.md +9 -0
- package/assets/skills/backend-architecture-workflow/references/architecture-audit.md +70 -0
- package/assets/skills/backend-architecture-workflow/references/architecture-decay-risks.md +75 -0
- package/assets/skills/backend-architecture-workflow/references/architecture-design.md +151 -0
- package/assets/skills/backend-architecture-workflow/references/bugfix-regression.md +63 -0
- package/assets/skills/backend-architecture-workflow/references/complex-bug-diagnosis.md +104 -0
- package/assets/skills/executor-short-task-workflow/SKILL.md +48 -0
- package/assets/skills/executor-short-task-workflow/references/agent-communication.md +44 -0
- package/assets/skills/executor-short-task-workflow/references/verification-and-reporting.md +45 -0
- package/assets/skills/frontend-engineering-workflow/SKILL.md +47 -0
- package/assets/skills/frontend-engineering-workflow/references/README.md +7 -0
- package/assets/skills/frontend-engineering-workflow/references/frontend-implementation.md +46 -0
- package/assets/skills/frontend-engineering-workflow/references/visual-design.md +43 -0
- package/assets/skills/frontend-engineering-workflow/references/visual-qa.md +126 -0
- package/assets/skills/fullstack-advisor/SKILL.md +50 -0
- package/assets/skills/fullstack-advisor/references/brooks-principles.md +51 -0
- package/assets/skills/fullstack-advisor/references/consultant-communication.md +51 -0
- package/assets/skills/fullstack-advisor/references/consultation-workflow.md +71 -0
- package/assets/skills/git-release-hygiene/SKILL.md +33 -21
- package/assets/skills/git-release-hygiene/references/git-safety.md +66 -0
- package/assets/skills/git-release-hygiene/references/pr-changelog.md +98 -0
- package/assets/skills/git-release-hygiene/references/release-standard.md +139 -0
- package/assets/skills/git-release-hygiene/references/validation-checklist.md +42 -0
- package/assets/skills/github-repository-presentation/SKILL.md +49 -130
- package/assets/skills/github-repository-presentation/references/bilingual-writing.md +43 -0
- package/assets/skills/github-repository-presentation/references/documentation-architecture.md +156 -0
- package/assets/skills/github-repository-presentation/references/readme-standard.md +273 -0
- package/assets/skills/github-repository-presentation/references/release-notes.md +70 -0
- package/assets/skills/github-repository-presentation/references/validation-checklist.md +47 -0
- package/assets/skills/independent-code-review-workflow/SKILL.md +60 -0
- package/assets/skills/independent-code-review-workflow/references/README.md +9 -0
- package/assets/skills/independent-code-review-workflow/references/decay-risks.md +99 -0
- package/assets/skills/independent-code-review-workflow/references/review-checklist.md +53 -0
- package/assets/skills/independent-code-review-workflow/references/review-methodology.md +113 -0
- package/assets/skills/independent-code-review-workflow/references/review-severity.md +49 -0
- package/assets/skills/independent-code-review-workflow/references/test-quality-review.md +71 -0
- package/assets/skills/leader-long-task-orchestration/SKILL.md +49 -0
- package/assets/skills/leader-long-task-orchestration/references/delivery-plan-template.md +73 -0
- package/assets/skills/leader-long-task-orchestration/references/product-alignment.md +46 -0
- package/assets/skills/leader-long-task-orchestration/references/rolling-wave-planning.md +32 -0
- package/assets/skills/leader-long-task-orchestration/references/technical-decisions-and-escalation.md +34 -0
- package/assets/skills/leader-medium-task-workflow/SKILL.md +55 -0
- package/assets/skills/leader-medium-task-workflow/references/task-board-and-leader-todo.md +41 -0
- package/docs/builtin-team-skills.md +82 -0
- package/docs/builtin-team-skills.zh.md +82 -0
- package/docs/builtin-teams.md +62 -0
- package/docs/builtin-teams.zh.md +62 -0
- package/docs/developer/architecture.md +54 -0
- package/docs/developer/architecture.zh.md +54 -0
- package/docs/guide/install.md +86 -0
- package/docs/guide/install.zh.md +86 -0
- package/docs/guide/integrations.md +50 -0
- package/docs/guide/integrations.zh.md +50 -0
- package/docs/guide/team-skills.md +56 -0
- package/docs/guide/team-skills.zh.md +56 -0
- package/docs/guide/using-teams.md +92 -0
- package/docs/guide/using-teams.zh.md +92 -0
- package/docs/index.md +53 -0
- package/docs/index.zh.md +53 -0
- package/docs/reference/tools-and-permissions.md +62 -0
- package/docs/reference/tools-and-permissions.zh.md +62 -0
- package/docs/reference/troubleshooting.md +59 -0
- package/docs/reference/troubleshooting.zh.md +59 -0
- package/lib/client.js +515 -85
- package/lib/index.js +442 -87
- package/lib/typert.host.js +15 -15
- package/lib/typert.remote-client.d.ts.map +1 -1
- package/lib/typert.remote-client.js +15 -15
- package/lib/types/client/CardPatchView.js +21 -1
- package/lib/types/client/ComposerTeamSelect.js +24 -8
- package/lib/types/client/TeamAgentView.d.ts +1 -1
- package/lib/types/client/TeamAgentView.js +11 -6
- package/lib/types/client/TeamSkillsView.d.ts +2 -1
- package/lib/types/client/TeamSkillsView.js +10 -5
- package/lib/types/client/locales.d.ts +41 -2
- package/lib/types/client/locales.js +125 -0
- package/lib/types/index.js +52 -12
- package/lib/types/team-catalog.d.ts +50 -3
- package/lib/types/team-catalog.js +214 -43
- package/lib/types/team-mode.d.ts +48 -0
- package/lib/types/team-mode.js +64 -0
- package/lib/types/team-skills/index.d.ts +13 -3
- package/lib/types/team-skills/index.js +21 -2
- package/lib/types/team-skills/manager.d.ts +21 -12
- package/lib/types/team-skills/manager.js +88 -53
- package/lib/types/team-skills/service.js +18 -7
- package/lib/types/team-skills/store.d.ts +11 -0
- package/lib/types/team-skills/store.js +32 -1
- package/package.json +18 -2
|
@@ -50,6 +50,17 @@ export interface TeamSkillDeleteOutcome {
|
|
|
50
50
|
readonly warnings: readonly string[];
|
|
51
51
|
}
|
|
52
52
|
/** The Team Skill library plus its role bindings. */
|
|
53
|
+
/**
|
|
54
|
+
* Whether two assets are the shipped copy and its own editable copy.
|
|
55
|
+
*
|
|
56
|
+
* They share a name because they ARE the same skill: the override is the shipped
|
|
57
|
+
* body with the user's edits. Presenting that pair as a name clash made an
|
|
58
|
+
* ordinary "I made a local copy" state read as a defect.
|
|
59
|
+
* @param left - one asset.
|
|
60
|
+
* @param right - the other asset.
|
|
61
|
+
* @returns true when one is the shipped copy and the other its override.
|
|
62
|
+
*/
|
|
63
|
+
export declare function sanctionedCopy(left: TeamSkillAsset, right: TeamSkillAsset): boolean;
|
|
53
64
|
export declare class TeamSkillManager {
|
|
54
65
|
private readonly store;
|
|
55
66
|
private bindings;
|
|
@@ -132,18 +143,16 @@ export declare class TeamSkillManager {
|
|
|
132
143
|
reconcile(): Promise<void>;
|
|
133
144
|
private reconcileNow;
|
|
134
145
|
/**
|
|
135
|
-
*
|
|
146
|
+
* Move every role holding one asset onto another.
|
|
136
147
|
*
|
|
137
|
-
*
|
|
138
|
-
*
|
|
139
|
-
*
|
|
140
|
-
*
|
|
141
|
-
*
|
|
142
|
-
*
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
*/
|
|
146
|
-
private seededAssetId;
|
|
148
|
+
* Used by "restore to the built-in version": the roles reading a local copy
|
|
149
|
+
* have to read the shipped one again, or the restore would only change bytes
|
|
150
|
+
* nobody is bound to.
|
|
151
|
+
* @param fromAssetId - asset the roles hold now.
|
|
152
|
+
* @param toAssetId - asset they should hold.
|
|
153
|
+
* @returns the number of bindings moved.
|
|
154
|
+
*/
|
|
155
|
+
replaceAssetBindings(fromAssetId: string, toAssetId: string): Promise<number>;
|
|
147
156
|
private mutate;
|
|
148
157
|
/**
|
|
149
158
|
* Find text mentions of one skill name inside another asset.
|
|
@@ -206,7 +215,7 @@ export declare class TeamSkillManager {
|
|
|
206
215
|
* and reconcile to restore the official default bindings.
|
|
207
216
|
* @param teamIds - optional list of team identities to restore; defaults to all built-in teams.
|
|
208
217
|
*/
|
|
209
|
-
restoreBuiltinBindings(teamIds?: readonly string[]): Promise<void>;
|
|
218
|
+
restoreBuiltinBindings(teamIds?: readonly string[] | null): Promise<void>;
|
|
210
219
|
/**
|
|
211
220
|
* Persist the bindings document atomically enough for a UI write.
|
|
212
221
|
* @returns after the document is on disk.
|
|
@@ -92,6 +92,20 @@ function seedOwner(key) {
|
|
|
92
92
|
return undefined;
|
|
93
93
|
}
|
|
94
94
|
/** The Team Skill library plus its role bindings. */
|
|
95
|
+
/**
|
|
96
|
+
* Whether two assets are the shipped copy and its own editable copy.
|
|
97
|
+
*
|
|
98
|
+
* They share a name because they ARE the same skill: the override is the shipped
|
|
99
|
+
* body with the user's edits. Presenting that pair as a name clash made an
|
|
100
|
+
* ordinary "I made a local copy" state read as a defect.
|
|
101
|
+
* @param left - one asset.
|
|
102
|
+
* @param right - the other asset.
|
|
103
|
+
* @returns true when one is the shipped copy and the other its override.
|
|
104
|
+
*/
|
|
105
|
+
export function sanctionedCopy(left, right) {
|
|
106
|
+
return (left.origin === 'builtin' && right.origin === 'override' && right.officialSkillId === left.skillId)
|
|
107
|
+
|| (right.origin === 'builtin' && left.origin === 'override' && left.officialSkillId === right.skillId);
|
|
108
|
+
}
|
|
95
109
|
export class TeamSkillManager {
|
|
96
110
|
store;
|
|
97
111
|
bindings = [];
|
|
@@ -381,70 +395,67 @@ export class TeamSkillManager {
|
|
|
381
395
|
const roleId = isCaptain ? CAPTAIN_ROLE : memberRole === CAPTAIN_ROLE ? undefined : memberRole;
|
|
382
396
|
if (roleId === undefined)
|
|
383
397
|
continue;
|
|
384
|
-
// A default names the shipped skill,
|
|
385
|
-
//
|
|
386
|
-
//
|
|
387
|
-
//
|
|
388
|
-
//
|
|
389
|
-
//
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
const assetId = this.seededAssetId(declaration.skillId);
|
|
393
|
-
if (assetId === undefined)
|
|
398
|
+
// A default names the shipped skill, and the shipped copy is what it
|
|
399
|
+
// binds. A local copy is bound when the user creates one (that is what
|
|
400
|
+
// `replaceBuiltinBindings` does at creation time) and never by this
|
|
401
|
+
// pass: resolving a declaration onto a same-named copy here made the
|
|
402
|
+
// default follow whatever the user happened to have edited, so deleting
|
|
403
|
+
// or restoring the copy could not return a role to the shipped skill.
|
|
404
|
+
const assetId = `builtin:${declaration.skillId}`;
|
|
405
|
+
if (this.store.get(assetId) === undefined)
|
|
394
406
|
continue;
|
|
395
|
-
// The marker is keyed by the DECLARATION,
|
|
396
|
-
//
|
|
397
|
-
//
|
|
407
|
+
// The marker is keyed by the DECLARATION, not by the asset a role
|
|
408
|
+
// happens to hold: a copy can appear or disappear between restarts, and
|
|
409
|
+
// a key that followed it would stop matching the marker a user's
|
|
398
410
|
// explicit unbind wrote, resurrecting a default they removed.
|
|
399
|
-
const key = JSON.stringify([team.id, roleId,
|
|
400
|
-
const
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
//
|
|
406
|
-
//
|
|
407
|
-
if (
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
}
|
|
411
|
+
const key = JSON.stringify([team.id, roleId, assetId]);
|
|
412
|
+
const holdsSkill = this.bindings.some(row => {
|
|
413
|
+
if (row.teamId !== team.id || row.roleId !== roleId)
|
|
414
|
+
return false;
|
|
415
|
+
return this.store.get(row.assetId)?.skillId === declaration.skillId;
|
|
416
|
+
});
|
|
417
|
+
// A role that still holds a copy of this skill keeps it: an explicit
|
|
418
|
+
// assignment outranks a default.
|
|
419
|
+
if (holdsSkill)
|
|
420
|
+
continue;
|
|
421
|
+
// The marker means "this default was offered and the user removed it",
|
|
422
|
+
// so re-adding would resurrect an explicit unbind. The paths that DO
|
|
423
|
+
// return a missing default -- deleting the copy, restoring it -- clear
|
|
424
|
+
// the marker themselves before reconciling.
|
|
425
|
+
if (this.seeded.has(key))
|
|
415
426
|
continue;
|
|
416
|
-
}
|
|
417
427
|
this.seeded.add(key);
|
|
418
|
-
|
|
419
|
-
this.bindings.push({ teamId: team.id, roleId, assetId, ...(roleId === CAPTAIN_ROLE ? { captain: true } : {}) });
|
|
420
|
-
}
|
|
428
|
+
this.bindings.push({ teamId: team.id, roleId, assetId, ...(roleId === CAPTAIN_ROLE ? { captain: true } : {}) });
|
|
421
429
|
}
|
|
422
430
|
}
|
|
423
431
|
if (JSON.stringify([this.bindings, [...this.seeded]]) !== before)
|
|
424
432
|
await this.flush();
|
|
425
433
|
}
|
|
426
434
|
/**
|
|
427
|
-
*
|
|
435
|
+
* Move every role holding one asset onto another.
|
|
428
436
|
*
|
|
429
|
-
*
|
|
430
|
-
*
|
|
431
|
-
*
|
|
432
|
-
*
|
|
433
|
-
*
|
|
434
|
-
*
|
|
435
|
-
* @param skillId - shipped skill identity the default names.
|
|
436
|
-
* @returns the asset identity to bind, or undefined when neither copy exists.
|
|
437
|
+
* Used by "restore to the built-in version": the roles reading a local copy
|
|
438
|
+
* have to read the shipped one again, or the restore would only change bytes
|
|
439
|
+
* nobody is bound to.
|
|
440
|
+
* @param fromAssetId - asset the roles hold now.
|
|
441
|
+
* @param toAssetId - asset they should hold.
|
|
442
|
+
* @returns the number of bindings moved.
|
|
437
443
|
*/
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
444
|
+
async replaceAssetBindings(fromAssetId, toAssetId) {
|
|
445
|
+
return this.mutate(async () => {
|
|
446
|
+
if (this.store.get(toAssetId) === undefined)
|
|
447
|
+
return 0;
|
|
448
|
+
let moved = 0;
|
|
449
|
+
this.bindings = this.bindings.map((row) => {
|
|
450
|
+
if (row.assetId !== fromAssetId)
|
|
451
|
+
return row;
|
|
452
|
+
moved += 1;
|
|
453
|
+
return { ...row, assetId: toAssetId };
|
|
454
|
+
});
|
|
455
|
+
if (moved > 0)
|
|
456
|
+
await this.flush();
|
|
457
|
+
return moved;
|
|
458
|
+
});
|
|
448
459
|
}
|
|
449
460
|
mutate(operation) {
|
|
450
461
|
const result = this.pending.then(async () => {
|
|
@@ -576,12 +587,36 @@ export class TeamSkillManager {
|
|
|
576
587
|
*/
|
|
577
588
|
async restoreBuiltinBindings(teamIds) {
|
|
578
589
|
return this.mutate(async () => {
|
|
579
|
-
|
|
590
|
+
// "Restore these Teams" with nothing named means all of them: the page
|
|
591
|
+
// calls this without arguments, and a remote call can deliver that absence
|
|
592
|
+
// as `[]`, `null` or an empty object. Treating any of those as a filter is
|
|
593
|
+
// what made the whole restore a silent no-op that still answered 200, so
|
|
594
|
+
// only a real, non-empty array narrows the set.
|
|
595
|
+
const requested = Array.isArray(teamIds) ? teamIds : [];
|
|
596
|
+
const targets = new Set(requested.length === 0 ? BUILTIN_TEAM_IDS : requested);
|
|
580
597
|
this.seeded = new Set([...this.seeded].filter(key => {
|
|
581
598
|
const owner = seedOwner(key);
|
|
582
599
|
return owner === undefined || !targets.has(owner[0]);
|
|
583
600
|
}));
|
|
601
|
+
// "Restore built-in presets" restores the shipped defaults, which are the
|
|
602
|
+
// shipped skills. A role still reading an override of a declared skill is
|
|
603
|
+
// returned to the shipped copy, or the restore would leave the visible
|
|
604
|
+
// binding on the user's own asset and look like it did nothing.
|
|
605
|
+
this.bindings = this.bindings.map((row) => {
|
|
606
|
+
if (!targets.has(row.teamId))
|
|
607
|
+
return row;
|
|
608
|
+
const asset = this.store.get(row.assetId);
|
|
609
|
+
if (asset?.origin !== 'override' || asset.officialSkillId === undefined)
|
|
610
|
+
return row;
|
|
611
|
+
const builtinId = `builtin:${asset.officialSkillId}`;
|
|
612
|
+
return this.store.get(builtinId) === undefined ? row : { ...row, assetId: builtinId };
|
|
613
|
+
});
|
|
584
614
|
await this.reconcileNow();
|
|
615
|
+
// `reconcileNow` flushes only when IT changed something. The conversion
|
|
616
|
+
// above already mutated the list, so its own before/after reads as "no
|
|
617
|
+
// change" and nothing would reach the disk: the restore appeared to do
|
|
618
|
+
// nothing, and the next restart brought the old bindings back.
|
|
619
|
+
await this.flush();
|
|
585
620
|
});
|
|
586
621
|
}
|
|
587
622
|
/**
|
|
@@ -46,7 +46,7 @@ import { mkdir, readdir } from 'node:fs/promises';
|
|
|
46
46
|
import { join } from 'node:path';
|
|
47
47
|
import { Remote, TypertRemoteService } from '@deepseek-ai/dsh-typert-protocol';
|
|
48
48
|
import { buildSkillPackage, decodeImportFiles } from "./import.js";
|
|
49
|
-
import { CAPTAIN_ROLE } from "./manager.js";
|
|
49
|
+
import { CAPTAIN_ROLE, sanctionedCopy } from "./manager.js";
|
|
50
50
|
import { assertNoSymlinks } from "./paths.js";
|
|
51
51
|
import { inspectSkillDirectory } from "./store.js";
|
|
52
52
|
/** Text the page shows when this deployment could not open its store. */
|
|
@@ -163,12 +163,13 @@ let TeamSkillService = (() => {
|
|
|
163
163
|
fileCount: asset.files.length,
|
|
164
164
|
totalBytes: asset.files.reduce((sum, file) => sum + file.size, 0),
|
|
165
165
|
mcpServers: asset.dependencies.mcpServers.map(server => server.serverName),
|
|
166
|
-
// A name can legitimately exist under several origins
|
|
167
|
-
//
|
|
168
|
-
//
|
|
169
|
-
//
|
|
166
|
+
// A name can legitimately exist under several origins, but two of them are
|
|
167
|
+
// the SAME skill: the shipped copy and an override derived from it. That
|
|
168
|
+
// pair is a sanctioned copy, not a clash, and reporting it made a healthy
|
|
169
|
+
// library look broken. Anything else sharing the name is a real clash the
|
|
170
|
+
// page has to state, because nothing overwrites anything.
|
|
170
171
|
clashesWith: this.config.store.list()
|
|
171
|
-
.filter(other => other.id !== asset.id && other.skillId === asset.skillId)
|
|
172
|
+
.filter(other => other.id !== asset.id && other.skillId === asset.skillId && !sanctionedCopy(asset, other))
|
|
172
173
|
.map(other => other.id),
|
|
173
174
|
bindings: this.config.manager.bindingSummaries(assetId),
|
|
174
175
|
};
|
|
@@ -458,7 +459,13 @@ let TeamSkillService = (() => {
|
|
|
458
459
|
if (issue !== undefined)
|
|
459
460
|
return { ok: false, reason: 'unavailable', detail: issue };
|
|
460
461
|
try {
|
|
461
|
-
await this.config.store.resetOverride(assetId);
|
|
462
|
+
const reset = await this.config.store.resetOverride(assetId);
|
|
463
|
+
// "Restore to the built-in version" has to put the roles back on the
|
|
464
|
+
// shipped copy: leaving them on a copy whose content merely equals the
|
|
465
|
+
// shipped one would keep the default bound to the user's own asset.
|
|
466
|
+
if (reset.officialSkillId !== undefined) {
|
|
467
|
+
await this.config.manager.replaceAssetBindings(assetId, `builtin:${reset.officialSkillId}`);
|
|
468
|
+
}
|
|
462
469
|
}
|
|
463
470
|
catch (error) {
|
|
464
471
|
return { ok: false, reason: 'reset-refused', detail: String(error) };
|
|
@@ -556,6 +563,10 @@ let TeamSkillService = (() => {
|
|
|
556
563
|
await this.config.manager.restoreBuiltinBindings(teamIds);
|
|
557
564
|
}
|
|
558
565
|
catch (error) {
|
|
566
|
+
// A swallowed error here reads on the page as "nothing happened", which is
|
|
567
|
+
// indistinguishable from "there was nothing to restore". Log it, and keep
|
|
568
|
+
// returning the issue so the page can name the failure too.
|
|
569
|
+
this.ctx.logger.warn('agent-team-presets: restoring built-in Team Skill bindings failed: %s', String(error));
|
|
559
570
|
return { ...await this.library(), issue: String(error) };
|
|
560
571
|
}
|
|
561
572
|
this.config.resync();
|
|
@@ -43,6 +43,17 @@ export declare class TeamSkillStore {
|
|
|
43
43
|
private migrateLayout;
|
|
44
44
|
list(): readonly TeamSkillAsset[];
|
|
45
45
|
get(assetId: string): TeamSkillAsset | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* Resolve one skill by its name rather than by asset identity.
|
|
48
|
+
*
|
|
49
|
+
* Several assets may legitimately share a name: the shipped copy, a local
|
|
50
|
+
* override of it, and a skill the user imported under the same name. The
|
|
51
|
+
* shipped copy wins, because a name denotes the skill the plugin ships — a
|
|
52
|
+
* user's own copy must never shadow it for a caller that only said the name.
|
|
53
|
+
* Callers that know which copy they mean pass the asset id instead.
|
|
54
|
+
* @param skillId - kebab-case skill name.
|
|
55
|
+
* @returns the shipped copy when it exists, else the best local one.
|
|
56
|
+
*/
|
|
46
57
|
bySkillId(skillId: string): TeamSkillAsset | undefined;
|
|
47
58
|
/** Commit all nested store mutations once; failures restore memory and version folders. */
|
|
48
59
|
transaction<T>(operation: () => Promise<T>): Promise<T>;
|
|
@@ -328,9 +328,23 @@ export class TeamSkillStore {
|
|
|
328
328
|
}
|
|
329
329
|
list() { return [...this.table.values()].sort((a, b) => a.skillId.localeCompare(b.skillId) || a.id.localeCompare(b.id)); }
|
|
330
330
|
get(assetId) { return this.table.get(assetId); }
|
|
331
|
+
/**
|
|
332
|
+
* Resolve one skill by its name rather than by asset identity.
|
|
333
|
+
*
|
|
334
|
+
* Several assets may legitimately share a name: the shipped copy, a local
|
|
335
|
+
* override of it, and a skill the user imported under the same name. The
|
|
336
|
+
* shipped copy wins, because a name denotes the skill the plugin ships — a
|
|
337
|
+
* user's own copy must never shadow it for a caller that only said the name.
|
|
338
|
+
* Callers that know which copy they mean pass the asset id instead.
|
|
339
|
+
* @param skillId - kebab-case skill name.
|
|
340
|
+
* @returns the shipped copy when it exists, else the best local one.
|
|
341
|
+
*/
|
|
331
342
|
bySkillId(skillId) {
|
|
332
343
|
const candidates = this.list().filter(asset => asset.skillId === skillId);
|
|
333
|
-
return candidates.find(asset => asset.origin === '
|
|
344
|
+
return candidates.find(asset => asset.origin === 'builtin')
|
|
345
|
+
?? candidates.find(asset => asset.origin === 'override')
|
|
346
|
+
?? candidates.find(asset => asset.origin === 'custom')
|
|
347
|
+
?? candidates[0];
|
|
334
348
|
}
|
|
335
349
|
/** Commit all nested store mutations once; failures restore memory and version folders. */
|
|
336
350
|
async transaction(operation) {
|
|
@@ -367,6 +381,23 @@ export class TeamSkillStore {
|
|
|
367
381
|
if (!checked.ok)
|
|
368
382
|
throw new Error(`invalid skill package: ${checked.reason}`);
|
|
369
383
|
assetDirectoryName(package_.name);
|
|
384
|
+
// The English skill name is the identity every other surface uses: a
|
|
385
|
+
// binding names it, a preset document exports it, and the model addresses
|
|
386
|
+
// the skill by it. Two assets may therefore share it only when one is a
|
|
387
|
+
// sanctioned copy of the other -- an override IS the shipped skill, edited.
|
|
388
|
+
// A user skill or import taking a name that already belongs to another
|
|
389
|
+
// skill is refused here rather than allowed to shadow it, which is what
|
|
390
|
+
// made "bind `git-release-hygiene`" ambiguous in the first place. The
|
|
391
|
+
// shipped set is authoritative: installing a builtin always proceeds, so a
|
|
392
|
+
// legacy same-named user skill can neither block a release nor win a
|
|
393
|
+
// binding (bindings resolve by the builtin's identity).
|
|
394
|
+
if (options.origin !== 'builtin') {
|
|
395
|
+
const clash = [...this.table.values()].find(asset => asset.skillId === package_.name && asset.id !== options.id
|
|
396
|
+
&& !(options.origin === 'override' && asset.origin === 'builtin'));
|
|
397
|
+
if (clash !== undefined) {
|
|
398
|
+
throw new Error(`the skill name "${package_.name}" already belongs to ${clash.id}; a skill name is the identity a binding uses`);
|
|
399
|
+
}
|
|
400
|
+
}
|
|
370
401
|
const target = this.assetPath(options.id, options.version);
|
|
371
402
|
const manifest = this.manifestPath(options.id, options.version);
|
|
372
403
|
await assertNoSymlinks(target);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-agent-team-presets",
|
|
3
3
|
"description": "Reusable Agent Team presets for DeepSeek Harness: a captain plus members with their own prompt, model, reasoning effort, and tools.",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.3",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agent-presets",
|
|
7
7
|
"agent-teams",
|
|
@@ -163,6 +163,22 @@
|
|
|
163
163
|
"assets/card-patches",
|
|
164
164
|
"LICENSE",
|
|
165
165
|
"NOTICE",
|
|
166
|
-
"README.md"
|
|
166
|
+
"README.md",
|
|
167
|
+
"docs/index.md",
|
|
168
|
+
"docs/index.zh.md",
|
|
169
|
+
"docs/builtin-teams.md",
|
|
170
|
+
"docs/builtin-teams.zh.md",
|
|
171
|
+
"docs/builtin-team-skills.md",
|
|
172
|
+
"docs/builtin-team-skills.zh.md",
|
|
173
|
+
"docs/guide/install.md",
|
|
174
|
+
"docs/guide/install.zh.md",
|
|
175
|
+
"docs/guide/using-teams.md",
|
|
176
|
+
"docs/guide/using-teams.zh.md",
|
|
177
|
+
"docs/guide/team-skills.md",
|
|
178
|
+
"docs/guide/team-skills.zh.md",
|
|
179
|
+
"docs/guide/integrations.md",
|
|
180
|
+
"docs/guide/integrations.zh.md",
|
|
181
|
+
"docs/reference",
|
|
182
|
+
"docs/developer"
|
|
167
183
|
]
|
|
168
184
|
}
|