feat(plugins): merge Skill management into plugins
This commit is contained in:
@@ -5,7 +5,6 @@ import type {
|
||||
} from '../../shared/coding-plugins';
|
||||
import { isProjectWideCodingPluginId } from '../../shared/coding-plugins';
|
||||
import {
|
||||
CORE_CODING_SKILL_IDS,
|
||||
type CodingSkillId,
|
||||
} from '../../shared/coding-skills';
|
||||
import {
|
||||
@@ -218,13 +217,13 @@ function validateBinding(value: AccountBinding | null): AccountBinding | null {
|
||||
}
|
||||
|
||||
/**
|
||||
* A raw Skill ID is the public assignment key. Marketplace packages cannot
|
||||
* shadow a core Skill or an already accepted package owner; the project
|
||||
* A raw Skill ID is the public assignment key. Marketplace packages cannot
|
||||
* shadow a code-owned plugin Skill or an already accepted package owner; the project
|
||||
* assignment is retained, but the later package contributes no resources.
|
||||
*/
|
||||
function marketplaceSkillConflicts(records: readonly DefinitionRecord[]): ReadonlySet<string> {
|
||||
const blocked = new Set<string>();
|
||||
const owned = new Set<string>(CORE_CODING_SKILL_IDS);
|
||||
const owned = new Set<string>();
|
||||
for (const { definition } of records) {
|
||||
if (definition.provenance.source === 'marketplace') continue;
|
||||
for (const { id } of definition.skills) owned.add(id);
|
||||
@@ -282,19 +281,14 @@ export class EffectivePluginResolver {
|
||||
const blockedMarketplacePlugins = marketplaceSkillConflicts(definitions);
|
||||
const assigned = normalizeIds(input.assignedSkillIds);
|
||||
|
||||
const coreIds = new Set<string>(CORE_CODING_SKILL_IDS);
|
||||
const effectiveSkillIds: CodingSkillId[] = assigned.filter((id) => coreIds.has(id));
|
||||
const skillEntries: SkillEntry[] = effectiveSkillIds.map((id) => ({
|
||||
id,
|
||||
entryPath: `${id}/SKILL.md`,
|
||||
}));
|
||||
const effectiveSkillIds: CodingSkillId[] = [];
|
||||
const skillEntries: SkillEntry[] = [];
|
||||
const pluginReleaseIds: string[] = [];
|
||||
const toolDefinitions: CodingPluginToolDefinition[] = [];
|
||||
const runtimePolicies: RuntimePolicy[] = [];
|
||||
const unavailableReasons: PluginUnavailableReason[] = [];
|
||||
|
||||
// Child workers intentionally receive only core resources. Still validate
|
||||
// assignment IDs above so malformed project configuration remains visible.
|
||||
// Child workers intentionally receive no plugin-delivered Skill resources.
|
||||
if (input.role === 'child') {
|
||||
return freezeSnapshot({
|
||||
accountSessionId: accountSessionId(this.options, validateBinding(this.options.getAccountBinding?.() ?? null)),
|
||||
|
||||
Reference in New Issue
Block a user