@ai-outfitter/outfitter 0.10.0 → 1.0.1
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/.outfitter/skills/outfitter/SKILL.md +67 -37
- package/README.md +57 -35
- package/code/enterprise/cli/privateCatalogSettings.cjs +2 -2
- package/code/enterprise/pi-extension/privateCatalogOnboarding.js +5 -8
- package/code/enterprise/shared/privateCatalogPolicy.cjs +5 -5
- package/code/pi-extension/src/outfitter-extension.js +365 -547
- package/code/pi-extension/src/outfitter-runtime-extension.js +160 -0
- package/dist/agents/AgentLaunch.d.ts +9 -1
- package/dist/agents/AgentLaunch.js +19 -0
- package/dist/agents/AgentLaunch.js.map +1 -1
- package/dist/agents/PiCredentialPersistence.d.ts +6 -0
- package/dist/agents/PiCredentialPersistence.js +33 -0
- package/dist/agents/PiCredentialPersistence.js.map +1 -0
- package/dist/cli/OutfitterCli.js +10 -18
- package/dist/cli/OutfitterCli.js.map +1 -1
- package/dist/cli/commands/CommandObject.d.ts +0 -5
- package/dist/cli/commands/CommandObject.js +1 -4
- package/dist/cli/commands/CommandObject.js.map +1 -1
- package/dist/cli/commands/DumpCommand.d.ts +19 -0
- package/dist/cli/commands/DumpCommand.js +54 -0
- package/dist/cli/commands/DumpCommand.js.map +1 -0
- package/dist/cli/commands/ListCommand.d.ts +17 -0
- package/dist/cli/commands/ListCommand.js +77 -0
- package/dist/cli/commands/ListCommand.js.map +1 -0
- package/dist/cli/commands/PiRuntimeLaunch.d.ts +8 -0
- package/dist/cli/commands/PiRuntimeLaunch.js +47 -0
- package/dist/cli/commands/PiRuntimeLaunch.js.map +1 -0
- package/dist/cli/commands/ProcessDefaults.d.ts +2 -0
- package/dist/cli/commands/ProcessDefaults.js +5 -0
- package/dist/cli/commands/ProcessDefaults.js.map +1 -0
- package/dist/cli/commands/RunAgentCommand.d.ts +46 -0
- package/dist/cli/commands/RunAgentCommand.js +176 -0
- package/dist/cli/commands/RunAgentCommand.js.map +1 -0
- package/dist/cli/commands/SetupCommand.d.ts +38 -6
- package/dist/cli/commands/SetupCommand.js +194 -232
- package/dist/cli/commands/SetupCommand.js.map +1 -1
- package/dist/cli/commands/ValidateCommand.d.ts +20 -0
- package/dist/cli/commands/ValidateCommand.js +54 -0
- package/dist/cli/commands/ValidateCommand.js.map +1 -0
- package/dist/composer/Composer.d.ts +11 -0
- package/dist/composer/Composer.js +72 -0
- package/dist/composer/Composer.js.map +1 -0
- package/dist/composer/Composition.d.ts +33 -0
- package/dist/composer/Composition.js +2 -0
- package/dist/composer/Composition.js.map +1 -0
- package/dist/dump/Containment.d.ts +8 -0
- package/dist/dump/Containment.js +22 -0
- package/dist/dump/Containment.js.map +1 -0
- package/dist/dump/Dump.d.ts +8 -0
- package/dist/dump/Dump.js +182 -0
- package/dist/dump/Dump.js.map +1 -0
- package/dist/extensions/PiExtensionCache.d.ts +30 -0
- package/dist/extensions/PiExtensionCache.js +92 -0
- package/dist/extensions/PiExtensionCache.js.map +1 -0
- package/dist/fs/TypeConflict.d.ts +6 -0
- package/dist/fs/TypeConflict.js +21 -0
- package/dist/fs/TypeConflict.js.map +1 -0
- package/dist/paths/OutfitterCache.d.ts +6 -0
- package/dist/paths/OutfitterCache.js +17 -0
- package/dist/paths/OutfitterCache.js.map +1 -0
- package/dist/projection/Materialize.d.ts +24 -0
- package/dist/projection/Materialize.js +83 -0
- package/dist/projection/Materialize.js.map +1 -0
- package/dist/projection/ProjectHarness.d.ts +5 -0
- package/dist/projection/ProjectHarness.js +77 -0
- package/dist/projection/ProjectHarness.js.map +1 -0
- package/dist/projection/Projection.d.ts +23 -0
- package/dist/projection/Projection.js +2 -0
- package/dist/projection/Projection.js.map +1 -0
- package/dist/resolver/AgentDefinition.d.ts +30 -0
- package/dist/resolver/AgentDefinition.js +123 -0
- package/dist/resolver/AgentDefinition.js.map +1 -0
- package/dist/resolver/Layer.d.ts +12 -0
- package/dist/resolver/Layer.js +30 -0
- package/dist/resolver/Layer.js.map +1 -0
- package/dist/resolver/Resolver.d.ts +3 -0
- package/dist/resolver/Resolver.js +163 -0
- package/dist/resolver/Resolver.js.map +1 -0
- package/dist/resolver/ResolverContext.d.ts +15 -0
- package/dist/resolver/ResolverContext.js +11 -0
- package/dist/resolver/ResolverContext.js.map +1 -0
- package/dist/resolver/ResolverValidation.d.ts +11 -0
- package/dist/resolver/ResolverValidation.js +112 -0
- package/dist/resolver/ResolverValidation.js.map +1 -0
- package/dist/resolver/Resource.d.ts +88 -0
- package/dist/resolver/Resource.js +34 -0
- package/dist/resolver/Resource.js.map +1 -0
- package/dist/schemas/agent.schema.json +48 -0
- package/dist/schemas/settings.schema.json +32 -9
- package/dist/settings/Settings.d.ts +34 -5
- package/dist/settings/Settings.js +3 -1
- package/dist/settings/Settings.js.map +1 -1
- package/dist/settings/SettingsLoader.d.ts +1 -1
- package/dist/settings/SettingsLoader.js +23 -22
- package/dist/settings/SettingsLoader.js.map +1 -1
- package/dist/settings/SettingsMerger.js +12 -10
- package/dist/settings/SettingsMerger.js.map +1 -1
- package/dist/setup/DefaultCatalog.d.ts +20 -0
- package/dist/setup/DefaultCatalog.js +89 -0
- package/dist/setup/DefaultCatalog.js.map +1 -0
- package/dist/setup/Setup.d.ts +43 -0
- package/dist/setup/Setup.js +261 -0
- package/dist/setup/Setup.js.map +1 -0
- package/dist/skills/SkillDocument.d.ts +6 -1
- package/dist/skills/SkillDocument.js.map +1 -1
- package/dist/sources/SourceCache.d.ts +19 -0
- package/dist/{profiles/ProfileCache.js → sources/SourceCache.js} +22 -18
- package/dist/sources/SourceCache.js.map +1 -0
- package/dist/validation/SchemaValidator.d.ts +1 -1
- package/dist/validation/SchemaValidator.js +4 -13
- package/dist/validation/SchemaValidator.js.map +1 -1
- package/docs/architecture/state_writeback_strategy.md +54 -122
- package/docs/documentation/README.md +33 -12
- package/docs/documentation/actions.md +35 -52
- package/docs/documentation/agents.md +109 -0
- package/docs/documentation/best-practices.md +25 -63
- package/docs/documentation/catalogs.md +126 -0
- package/docs/documentation/cli.md +39 -41
- package/docs/documentation/concepts.md +66 -23
- package/docs/documentation/dump-and-bake.md +30 -0
- package/docs/documentation/first-time-cli-agent-users.md +8 -8
- package/docs/documentation/getting-started.md +28 -8
- package/docs/documentation/hooks.md +20 -0
- package/docs/documentation/iterating-on-profiles.md +56 -70
- package/docs/documentation/local-development.md +84 -0
- package/docs/documentation/migration.md +39 -0
- package/docs/documentation/personas.md +41 -0
- package/docs/documentation/porting-claude.md +54 -0
- package/docs/documentation/profiles.md +16 -169
- package/docs/documentation/settings.md +61 -0
- package/docs/documentation/skills.md +98 -290
- package/docs/documentation/state.md +24 -62
- package/docs/documentation/subagents.md +37 -0
- package/docs/documentation/support-matrix.md +40 -35
- package/docs/documentation/switching-to-outfitter.md +75 -81
- package/docs/documentation/tasks.md +13 -0
- package/docs/documentation/usecases/engineering.md +67 -84
- package/docs/documentation/usecases/organization-profile-catalog.md +83 -111
- package/docs/documentation/usecases/persona-reviews.md +133 -139
- package/docs/philosophy.md +2 -2
- package/package.json +3 -3
- package/src/schemas/agent.schema.json +48 -0
- package/src/schemas/settings.schema.json +32 -9
- package/dist/agents/AdapterProfileControls.d.ts +0 -21
- package/dist/agents/AdapterProfileControls.js +0 -76
- package/dist/agents/AdapterProfileControls.js.map +0 -1
- package/dist/agents/AdapterStatePaths.d.ts +0 -12
- package/dist/agents/AdapterStatePaths.js +0 -46
- package/dist/agents/AdapterStatePaths.js.map +0 -1
- package/dist/agents/AgentAdapter.d.ts +0 -44
- package/dist/agents/AgentAdapter.js +0 -2
- package/dist/agents/AgentAdapter.js.map +0 -1
- package/dist/agents/AgentRegistry.d.ts +0 -6
- package/dist/agents/AgentRegistry.js +0 -17
- package/dist/agents/AgentRegistry.js.map +0 -1
- package/dist/agents/LaunchResources.d.ts +0 -17
- package/dist/agents/LaunchResources.js +0 -61
- package/dist/agents/LaunchResources.js.map +0 -1
- package/dist/agents/OutfitterSkill.d.ts +0 -11
- package/dist/agents/OutfitterSkill.js +0 -128
- package/dist/agents/OutfitterSkill.js.map +0 -1
- package/dist/agents/ResourceIdentity.d.ts +0 -2
- package/dist/agents/ResourceIdentity.js +0 -51
- package/dist/agents/ResourceIdentity.js.map +0 -1
- package/dist/agents/claude/ClaudeAdapter.d.ts +0 -2
- package/dist/agents/claude/ClaudeAdapter.js +0 -148
- package/dist/agents/claude/ClaudeAdapter.js.map +0 -1
- package/dist/agents/claude/ClaudeCompositeProfileWriter.d.ts +0 -5
- package/dist/agents/claude/ClaudeCompositeProfileWriter.js +0 -7
- package/dist/agents/claude/ClaudeCompositeProfileWriter.js.map +0 -1
- package/dist/agents/pi/PiAdapter.d.ts +0 -2
- package/dist/agents/pi/PiAdapter.js +0 -363
- package/dist/agents/pi/PiAdapter.js.map +0 -1
- package/dist/agents/pi/PiArgs.d.ts +0 -2
- package/dist/agents/pi/PiArgs.js +0 -15
- package/dist/agents/pi/PiArgs.js.map +0 -1
- package/dist/agents/pi/PiCompositeProfileWriter.d.ts +0 -5
- package/dist/agents/pi/PiCompositeProfileWriter.js +0 -7
- package/dist/agents/pi/PiCompositeProfileWriter.js.map +0 -1
- package/dist/agents/pi/PiExtensionCache.d.ts +0 -12
- package/dist/agents/pi/PiExtensionCache.js +0 -195
- package/dist/agents/pi/PiExtensionCache.js.map +0 -1
- package/dist/agents/pi/PiMcpConfig.d.ts +0 -2
- package/dist/agents/pi/PiMcpConfig.js +0 -114
- package/dist/agents/pi/PiMcpConfig.js.map +0 -1
- package/dist/agents/pi/PiSettingsMergePolicy.d.ts +0 -17
- package/dist/agents/pi/PiSettingsMergePolicy.js +0 -59
- package/dist/agents/pi/PiSettingsMergePolicy.js.map +0 -1
- package/dist/agents/pi/PiSkillSources.d.ts +0 -8
- package/dist/agents/pi/PiSkillSources.js +0 -73
- package/dist/agents/pi/PiSkillSources.js.map +0 -1
- package/dist/cli/commands/FirstRunWelcomeProfile.d.ts +0 -11
- package/dist/cli/commands/FirstRunWelcomeProfile.js +0 -110
- package/dist/cli/commands/FirstRunWelcomeProfile.js.map +0 -1
- package/dist/cli/commands/PiLoginLaunch.d.ts +0 -22
- package/dist/cli/commands/PiLoginLaunch.js +0 -170
- package/dist/cli/commands/PiLoginLaunch.js.map +0 -1
- package/dist/cli/commands/RunCommand.d.ts +0 -36
- package/dist/cli/commands/RunCommand.js +0 -345
- package/dist/cli/commands/RunCommand.js.map +0 -1
- package/dist/cli/commands/SyncCommand.d.ts +0 -46
- package/dist/cli/commands/SyncCommand.js +0 -244
- package/dist/cli/commands/SyncCommand.js.map +0 -1
- package/dist/cli/commands/WelcomeCommand.d.ts +0 -56
- package/dist/cli/commands/WelcomeCommand.js +0 -224
- package/dist/cli/commands/WelcomeCommand.js.map +0 -1
- package/dist/cli/commands/assets/outfitter-ascii.txt +0 -5
- package/dist/cli/commands/profile/Command.d.ts +0 -7
- package/dist/cli/commands/profile/Command.js +0 -24
- package/dist/cli/commands/profile/Command.js.map +0 -1
- package/dist/cli/commands/profile/CreateCommand.d.ts +0 -19
- package/dist/cli/commands/profile/CreateCommand.js +0 -115
- package/dist/cli/commands/profile/CreateCommand.js.map +0 -1
- package/dist/cli/commands/profile/LintCommand.d.ts +0 -19
- package/dist/cli/commands/profile/LintCommand.js +0 -155
- package/dist/cli/commands/profile/LintCommand.js.map +0 -1
- package/dist/cli/commands/profile/ListCommand.d.ts +0 -19
- package/dist/cli/commands/profile/ListCommand.js +0 -91
- package/dist/cli/commands/profile/ListCommand.js.map +0 -1
- package/dist/cli/commands/profile/Shared.d.ts +0 -9
- package/dist/cli/commands/profile/Shared.js +0 -10
- package/dist/cli/commands/profile/Shared.js.map +0 -1
- package/dist/cli/commands/run/RunFirstRunOnboarding.d.ts +0 -7
- package/dist/cli/commands/run/RunFirstRunOnboarding.js +0 -52
- package/dist/cli/commands/run/RunFirstRunOnboarding.js.map +0 -1
- package/dist/cli/commands/run/RunLaunchSummary.d.ts +0 -2
- package/dist/cli/commands/run/RunLaunchSummary.js +0 -35
- package/dist/cli/commands/run/RunLaunchSummary.js.map +0 -1
- package/dist/cli/commands/run/RunProfileResolution.d.ts +0 -39
- package/dist/cli/commands/run/RunProfileResolution.js +0 -128
- package/dist/cli/commands/run/RunProfileResolution.js.map +0 -1
- package/dist/cli/commands/run/RunStateWritePrompt.d.ts +0 -2
- package/dist/cli/commands/run/RunStateWritePrompt.js +0 -29
- package/dist/cli/commands/run/RunStateWritePrompt.js.map +0 -1
- package/dist/cli/commands/setup/SetupPrompts.d.ts +0 -14
- package/dist/cli/commands/setup/SetupPrompts.js +0 -296
- package/dist/cli/commands/setup/SetupPrompts.js.map +0 -1
- package/dist/cli/commands/setup/SetupSourceImport.d.ts +0 -5
- package/dist/cli/commands/setup/SetupSourceImport.js +0 -177
- package/dist/cli/commands/setup/SetupSourceImport.js.map +0 -1
- package/dist/cli/commands/setup/SetupSourceLaunch.d.ts +0 -4
- package/dist/cli/commands/setup/SetupSourceLaunch.js +0 -65
- package/dist/cli/commands/setup/SetupSourceLaunch.js.map +0 -1
- package/dist/cli/commands/setup/SetupStarterSource.d.ts +0 -21
- package/dist/cli/commands/setup/SetupStarterSource.js +0 -133
- package/dist/cli/commands/setup/SetupStarterSource.js.map +0 -1
- package/dist/cli/commands/setup/SetupTypes.d.ts +0 -91
- package/dist/cli/commands/setup/SetupTypes.js +0 -26
- package/dist/cli/commands/setup/SetupTypes.js.map +0 -1
- package/dist/compositeProfile/CompositeProfile.d.ts +0 -8
- package/dist/compositeProfile/CompositeProfile.js +0 -6
- package/dist/compositeProfile/CompositeProfile.js.map +0 -1
- package/dist/compositeProfile/CompositeProfileAssembler.d.ts +0 -12
- package/dist/compositeProfile/CompositeProfileAssembler.js +0 -32
- package/dist/compositeProfile/CompositeProfileAssembler.js.map +0 -1
- package/dist/compositeProfile/CompositeProfileCleanup.d.ts +0 -9
- package/dist/compositeProfile/CompositeProfileCleanup.js +0 -87
- package/dist/compositeProfile/CompositeProfileCleanup.js.map +0 -1
- package/dist/compositeProfile/CompositeProfileFile.d.ts +0 -16
- package/dist/compositeProfile/CompositeProfileFile.js +0 -16
- package/dist/compositeProfile/CompositeProfileFile.js.map +0 -1
- package/dist/compositeProfile/CompositeProfileTemplate.d.ts +0 -15
- package/dist/compositeProfile/CompositeProfileTemplate.js +0 -65
- package/dist/compositeProfile/CompositeProfileTemplate.js.map +0 -1
- package/dist/compositeProfile/CompositeProfileWatcher.d.ts +0 -18
- package/dist/compositeProfile/CompositeProfileWatcher.js +0 -46
- package/dist/compositeProfile/CompositeProfileWatcher.js.map +0 -1
- package/dist/compositeProfile/StatePersistence.d.ts +0 -39
- package/dist/compositeProfile/StatePersistence.js +0 -249
- package/dist/compositeProfile/StatePersistence.js.map +0 -1
- package/dist/fs/SafeSymlink.d.ts +0 -13
- package/dist/fs/SafeSymlink.js +0 -50
- package/dist/fs/SafeSymlink.js.map +0 -1
- package/dist/profiles/Profile.d.ts +0 -60
- package/dist/profiles/Profile.js +0 -7
- package/dist/profiles/Profile.js.map +0 -1
- package/dist/profiles/ProfileCache.d.ts +0 -8
- package/dist/profiles/ProfileCache.js.map +0 -1
- package/dist/profiles/ProfileLoader.d.ts +0 -28
- package/dist/profiles/ProfileLoader.js +0 -299
- package/dist/profiles/ProfileLoader.js.map +0 -1
- package/dist/profiles/ProfileMerger.d.ts +0 -19
- package/dist/profiles/ProfileMerger.js +0 -112
- package/dist/profiles/ProfileMerger.js.map +0 -1
- package/dist/profiles/ProfileSource.d.ts +0 -35
- package/dist/profiles/ProfileSource.js +0 -13
- package/dist/profiles/ProfileSource.js.map +0 -1
- package/dist/profiles/PromptIncludes.d.ts +0 -32
- package/dist/profiles/PromptIncludes.js +0 -147
- package/dist/profiles/PromptIncludes.js.map +0 -1
- package/dist/prompts/SystemPromptExport.d.ts +0 -16
- package/dist/prompts/SystemPromptExport.js +0 -81
- package/dist/prompts/SystemPromptExport.js.map +0 -1
- package/dist/schemas/profile-source.schema.json +0 -29
- package/dist/schemas/profile.schema.json +0 -200
- package/dist/skills/ProfileSkillResolution.d.ts +0 -21
- package/dist/skills/ProfileSkillResolution.js +0 -88
- package/dist/skills/ProfileSkillResolution.js.map +0 -1
- package/dist/skills/SkillCatalog.d.ts +0 -41
- package/dist/skills/SkillCatalog.js +0 -119
- package/dist/skills/SkillCatalog.js.map +0 -1
- package/dist/skills/SkillResolution.d.ts +0 -34
- package/dist/skills/SkillResolution.js +0 -217
- package/dist/skills/SkillResolution.js.map +0 -1
- package/docs/documentation/profile-repository.md +0 -179
- package/src/schemas/SchemaDocument.ts +0 -20
- package/src/schemas/profile-source.schema.json +0 -29
- package/src/schemas/profile.schema.json +0 -200
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
// Resolves a profile's selected skill IDs into generated skill sources before adapter launch.
|
|
2
|
-
import { join } from 'node:path';
|
|
3
|
-
import { inferProfileIncludeSourceRoot } from '../profiles/PromptIncludes.js';
|
|
4
|
-
import { skillControlEntryIdentity } from '../agents/LaunchResources.js';
|
|
5
|
-
import { discoverSkillCatalog } from './SkillCatalog.js';
|
|
6
|
-
import { resolveSkillEntries, } from './SkillResolution.js';
|
|
7
|
-
/**
|
|
8
|
-
* Resolves catalog skill IDs in `controls.skills` (generic and adapter-scoped) to
|
|
9
|
-
* generated skill directories, so adapters keep receiving plain path sources.
|
|
10
|
-
*/
|
|
11
|
-
export const resolveProfileSkillControls = (input) => {
|
|
12
|
-
const catalog = discoverSkillCatalog({
|
|
13
|
-
projectDirectory: input.projectDirectory,
|
|
14
|
-
profileLayers: input.profileLayers,
|
|
15
|
-
sourcePaths: input.sourcePaths,
|
|
16
|
-
});
|
|
17
|
-
const diagnostics = [];
|
|
18
|
-
const outputDirectory = input.outputDirectory === undefined ? undefined : join(input.outputDirectory, 'outfitter', 'skills');
|
|
19
|
-
// One skill ID materializes once; selecting it from several control scopes reuses
|
|
20
|
-
// the same generated directory, and conflicting reference sets are an error.
|
|
21
|
-
const materializationCache = new Map();
|
|
22
|
-
const resolveEntries = (entries, scope) => {
|
|
23
|
-
const resolution = resolveSkillEntries({
|
|
24
|
-
entries: entries.map((entry) => toSkillEntryInput(entry, scope, input.profileLayers)),
|
|
25
|
-
catalog,
|
|
26
|
-
projectDirectory: input.projectDirectory,
|
|
27
|
-
outputDirectory,
|
|
28
|
-
materializationCache,
|
|
29
|
-
});
|
|
30
|
-
diagnostics.push(...resolution.diagnostics);
|
|
31
|
-
return resolution.sources;
|
|
32
|
-
};
|
|
33
|
-
const controls = resolveSkillControls(input.profile.controls, resolveEntries);
|
|
34
|
-
diagnostics.push(...createShadowedSkillDiagnostics(catalog, input.profile.controls));
|
|
35
|
-
return { profile: { ...input.profile, controls }, diagnostics };
|
|
36
|
-
};
|
|
37
|
-
const resolveSkillControls = (controls, resolveEntries) => ({
|
|
38
|
-
...controls,
|
|
39
|
-
...(controls.skills === undefined ? {} : { skills: resolveEntries(controls.skills, 'skills') }),
|
|
40
|
-
...(controls.pi?.skills === undefined
|
|
41
|
-
? {}
|
|
42
|
-
: { pi: { ...controls.pi, skills: resolveEntries(controls.pi.skills, 'pi') } }),
|
|
43
|
-
...(controls.claude?.skills === undefined
|
|
44
|
-
? {}
|
|
45
|
-
: { claude: { ...controls.claude, skills: resolveEntries(controls.claude.skills, 'claude') } }),
|
|
46
|
-
});
|
|
47
|
-
/**
|
|
48
|
-
* Profile-added `file` references resolve from the repository containing the
|
|
49
|
-
* declaring profile. The lookup stays within the entry's own control scope so an
|
|
50
|
-
* object selection in another scope cannot supply the wrong repository root.
|
|
51
|
-
*/
|
|
52
|
-
const toSkillEntryInput = (entry, scope, profileLayers) => {
|
|
53
|
-
if (typeof entry === 'string') {
|
|
54
|
-
return { entry };
|
|
55
|
-
}
|
|
56
|
-
const identity = skillControlEntryIdentity(entry);
|
|
57
|
-
const declaringLayer = [...profileLayers]
|
|
58
|
-
.reverse()
|
|
59
|
-
.find((layer) => readScopedSkillEntries(layer.profile.controls, scope).some((layerEntry) => typeof layerEntry !== 'string' && skillControlEntryIdentity(layerEntry) === identity));
|
|
60
|
-
return {
|
|
61
|
-
entry,
|
|
62
|
-
profileReferenceRoot: declaringLayer === undefined
|
|
63
|
-
? undefined
|
|
64
|
-
: inferProfileIncludeSourceRoot({
|
|
65
|
-
sourceRootPath: declaringLayer.sourceRootPath,
|
|
66
|
-
profilePath: declaringLayer.profilePath,
|
|
67
|
-
}),
|
|
68
|
-
};
|
|
69
|
-
};
|
|
70
|
-
const readScopedSkillEntries = (controls, scope) => (scope === 'skills' ? controls.skills : controls[scope]?.skills) ?? [];
|
|
71
|
-
const readLayerSkillEntries = (controls) => [
|
|
72
|
-
...(controls.skills ?? []),
|
|
73
|
-
...(controls.pi?.skills ?? []),
|
|
74
|
-
...(controls.claude?.skills ?? []),
|
|
75
|
-
];
|
|
76
|
-
/** Reports shadowing only for IDs the profile actually selects. */
|
|
77
|
-
const createShadowedSkillDiagnostics = (catalog, controls) => {
|
|
78
|
-
const selectedIds = new Set(readLayerSkillEntries(controls).map((entry) => (typeof entry === 'string' ? entry : entry.id)));
|
|
79
|
-
return catalog.shadowed
|
|
80
|
-
.filter((shadow) => selectedIds.has(shadow.selected.id))
|
|
81
|
-
.map((shadow) => ({
|
|
82
|
-
severity: 'warning',
|
|
83
|
-
path: shadow.shadowedDirectory,
|
|
84
|
-
message: `Skill ID '${shadow.selected.id}' is supplied by ${shadow.selected.origin} ('${shadow.selected.directory}') ` +
|
|
85
|
-
`and shadows '${shadow.shadowedDirectory}'.`,
|
|
86
|
-
}));
|
|
87
|
-
};
|
|
88
|
-
//# sourceMappingURL=ProfileSkillResolution.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ProfileSkillResolution.js","sourceRoot":"","sources":["../../src/skills/ProfileSkillResolution.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAIjC,OAAO,EAAE,6BAA6B,EAAE,MAAM,+BAA+B,CAAC;AAC9E,OAAO,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AACzE,OAAO,EAAE,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AAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAC/F,CAAC;IAEF,OAAO,OAAO,CAAC,QAAQ;SACpB,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;SACvD,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QAChB,QAAQ,EAAE,SAAS;QACnB,IAAI,EAAE,MAAM,CAAC,iBAAiB;QAC9B,OAAO,EACL,aAAa,MAAM,CAAC,QAAQ,CAAC,EAAE,oBAAoB,MAAM,CAAC,QAAQ,CAAC,MAAM,MAAM,MAAM,CAAC,QAAQ,CAAC,SAAS,KAAK;YAC7G,gBAAgB,MAAM,CAAC,iBAAiB,IAAI;KAC/C,CAAC,CAAC,CAAC;AACR,CAAC,CAAC"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
export interface SkillCatalogRoot {
|
|
2
|
-
/** Directory scanned for `<skill-id>/SKILL.md` entries. */
|
|
3
|
-
readonly skillsDirectory: string;
|
|
4
|
-
/** Root that skill `file` references resolve from (the repository containing the skill). */
|
|
5
|
-
readonly referenceRoot: string;
|
|
6
|
-
/** Human-readable origin for shadowing diagnostics. */
|
|
7
|
-
readonly origin: string;
|
|
8
|
-
}
|
|
9
|
-
export interface SkillCatalogEntry {
|
|
10
|
-
readonly id: string;
|
|
11
|
-
readonly directory: string;
|
|
12
|
-
readonly skillPath: string;
|
|
13
|
-
readonly referenceRoot: string;
|
|
14
|
-
readonly origin: string;
|
|
15
|
-
}
|
|
16
|
-
export interface SkillCatalog {
|
|
17
|
-
readonly entries: ReadonlyMap<string, SkillCatalogEntry>;
|
|
18
|
-
readonly shadowed: readonly {
|
|
19
|
-
readonly selected: SkillCatalogEntry;
|
|
20
|
-
readonly shadowedDirectory: string;
|
|
21
|
-
}[];
|
|
22
|
-
}
|
|
23
|
-
export interface SkillCatalogInput {
|
|
24
|
-
readonly projectDirectory?: string;
|
|
25
|
-
/** Directory-profile resource roots contributing bundled `skills/` folders. */
|
|
26
|
-
readonly profileLayers?: readonly {
|
|
27
|
-
readonly sourceRootPath?: string;
|
|
28
|
-
readonly resourceRootPath?: string;
|
|
29
|
-
}[];
|
|
30
|
-
/** Materialized configured profile-source paths, in configured (precedence) order. */
|
|
31
|
-
readonly sourcePaths?: readonly string[];
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Builds the skill ID catalog following layer precedence: project-local, project,
|
|
35
|
-
* bundled directory-profile skills (highest-precedence layer first), then
|
|
36
|
-
* configured sources (later entries outrank earlier ones, matching profile
|
|
37
|
-
* precedence). The first root supplying an ID wins; later roots are reported as
|
|
38
|
-
* shadowed.
|
|
39
|
-
*/
|
|
40
|
-
export declare const discoverSkillCatalog: (input: SkillCatalogInput) => SkillCatalog;
|
|
41
|
-
export declare const createSkillCatalogRoots: (input: SkillCatalogInput) => readonly SkillCatalogRoot[];
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
// Discovers catalog skills across project, directory-profile, and configured-source roots.
|
|
2
|
-
import { existsSync, readdirSync, statSync } from 'node:fs';
|
|
3
|
-
import { basename, dirname, join } from 'node:path';
|
|
4
|
-
import { inferProfileIncludeSourceRoot } from '../profiles/PromptIncludes.js';
|
|
5
|
-
import { isValidSkillId } from './SkillDocument.js';
|
|
6
|
-
/**
|
|
7
|
-
* Builds the skill ID catalog following layer precedence: project-local, project,
|
|
8
|
-
* bundled directory-profile skills (highest-precedence layer first), then
|
|
9
|
-
* configured sources (later entries outrank earlier ones, matching profile
|
|
10
|
-
* precedence). The first root supplying an ID wins; later roots are reported as
|
|
11
|
-
* shadowed.
|
|
12
|
-
*/
|
|
13
|
-
export const discoverSkillCatalog = (input) => {
|
|
14
|
-
const entries = new Map();
|
|
15
|
-
const shadowed = [];
|
|
16
|
-
for (const root of createSkillCatalogRoots(input)) {
|
|
17
|
-
for (const entry of readSkillCatalogRootEntries(root)) {
|
|
18
|
-
const selected = entries.get(entry.id);
|
|
19
|
-
if (selected === undefined) {
|
|
20
|
-
entries.set(entry.id, entry);
|
|
21
|
-
}
|
|
22
|
-
else if (selected.directory !== entry.directory) {
|
|
23
|
-
shadowed.push({ selected, shadowedDirectory: entry.directory });
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
return { entries, shadowed };
|
|
28
|
-
};
|
|
29
|
-
export const createSkillCatalogRoots = (input) => {
|
|
30
|
-
const roots = [];
|
|
31
|
-
if (input.projectDirectory !== undefined) {
|
|
32
|
-
roots.push({
|
|
33
|
-
skillsDirectory: join(input.projectDirectory, '.outfitter', 'local', 'skills'),
|
|
34
|
-
referenceRoot: input.projectDirectory,
|
|
35
|
-
origin: 'project-local skills',
|
|
36
|
-
}, {
|
|
37
|
-
skillsDirectory: join(input.projectDirectory, '.outfitter', 'skills'),
|
|
38
|
-
referenceRoot: input.projectDirectory,
|
|
39
|
-
origin: 'project skills',
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
// Profile layers arrive lowest-precedence first (see ProfileMerger); reverse so
|
|
43
|
-
// the selected profile's bundled skill outranks an inherited base profile's.
|
|
44
|
-
for (const layer of [...(input.profileLayers ?? [])].reverse()) {
|
|
45
|
-
if (layer.resourceRootPath === undefined) {
|
|
46
|
-
continue;
|
|
47
|
-
}
|
|
48
|
-
roots.push({
|
|
49
|
-
skillsDirectory: join(layer.resourceRootPath, 'skills'),
|
|
50
|
-
referenceRoot: inferProfileIncludeSourceRoot({
|
|
51
|
-
sourceRootPath: layer.sourceRootPath,
|
|
52
|
-
profilePath: join(layer.resourceRootPath, 'profile.yml'),
|
|
53
|
-
/* v8 ignore next -- directory profiles always sit under a source root. */
|
|
54
|
-
}) ?? layer.resourceRootPath,
|
|
55
|
-
origin: `profile '${basename(layer.resourceRootPath)}' skills`,
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
// Later configured sources outrank earlier ones for profiles; mirror that here.
|
|
59
|
-
for (const sourcePath of [...(input.sourcePaths ?? [])].reverse()) {
|
|
60
|
-
const catalogRoot = resolveCatalogRoot(sourcePath);
|
|
61
|
-
roots.push({
|
|
62
|
-
skillsDirectory: join(catalogRoot, 'skills'),
|
|
63
|
-
referenceRoot: basename(catalogRoot) === '.outfitter' ? dirname(catalogRoot) : catalogRoot,
|
|
64
|
-
origin: `source '${sourcePath}'`,
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
return dedupeSkillCatalogRoots(roots);
|
|
68
|
-
};
|
|
69
|
-
/**
|
|
70
|
-
* The catalog root is the directory containing `profiles/`. A source path that
|
|
71
|
-
* points directly at the profiles directory resolves to its parent.
|
|
72
|
-
*/
|
|
73
|
-
const resolveCatalogRoot = (sourcePath) => basename(sourcePath) === 'profiles' ? dirname(sourcePath) : sourcePath;
|
|
74
|
-
const dedupeSkillCatalogRoots = (roots) => {
|
|
75
|
-
const seen = new Set();
|
|
76
|
-
return roots.filter((root) => {
|
|
77
|
-
if (seen.has(root.skillsDirectory)) {
|
|
78
|
-
return false;
|
|
79
|
-
}
|
|
80
|
-
seen.add(root.skillsDirectory);
|
|
81
|
-
return true;
|
|
82
|
-
});
|
|
83
|
-
};
|
|
84
|
-
const readSkillCatalogRootEntries = (root) => readOptionalDirectoryNames(root.skillsDirectory)
|
|
85
|
-
.filter((name) => isValidSkillId(name) && existsSync(join(root.skillsDirectory, name, 'SKILL.md')))
|
|
86
|
-
.sort()
|
|
87
|
-
.map((name) => ({
|
|
88
|
-
id: name,
|
|
89
|
-
directory: join(root.skillsDirectory, name),
|
|
90
|
-
skillPath: join(root.skillsDirectory, name, 'SKILL.md'),
|
|
91
|
-
referenceRoot: root.referenceRoot,
|
|
92
|
-
origin: root.origin,
|
|
93
|
-
}));
|
|
94
|
-
const readOptionalDirectoryNames = (directory) => {
|
|
95
|
-
try {
|
|
96
|
-
return readdirSync(directory, { withFileTypes: true })
|
|
97
|
-
.filter((entry) => entry.isDirectory() || isSymlinkedDirectory(join(directory, entry.name), entry.isSymbolicLink()))
|
|
98
|
-
.map((entry) => entry.name);
|
|
99
|
-
}
|
|
100
|
-
catch (error) {
|
|
101
|
-
if (isMissingPathError(error)) {
|
|
102
|
-
return [];
|
|
103
|
-
}
|
|
104
|
-
throw new Error(`Could not read skills directory '${directory}': ${String(error)}`, { cause: error });
|
|
105
|
-
}
|
|
106
|
-
};
|
|
107
|
-
const isSymlinkedDirectory = (path, isSymbolicLink) => {
|
|
108
|
-
if (!isSymbolicLink) {
|
|
109
|
-
return false;
|
|
110
|
-
}
|
|
111
|
-
try {
|
|
112
|
-
return statSync(path).isDirectory();
|
|
113
|
-
}
|
|
114
|
-
catch {
|
|
115
|
-
return false;
|
|
116
|
-
}
|
|
117
|
-
};
|
|
118
|
-
const isMissingPathError = (error) => error !== null && typeof error === 'object' && 'code' in error && error.code === 'ENOENT';
|
|
119
|
-
//# sourceMappingURL=SkillCatalog.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SkillCatalog.js","sourceRoot":"","sources":["../../src/skills/SkillCatalog.ts"],"names":[],"mappings":"AAAA,2FAA2F;AAC3F,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEpD,OAAO,EAAE,6BAA6B,EAAE,MAAM,+BAA+B,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAgCpD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,KAAwB,EAAgB,EAAE;IAC7E,MAAM,OAAO,GAAG,IAAI,GAAG,EAA6B,CAAC;IACrD,MAAM,QAAQ,GAAmF,EAAE,CAAC;IAEpG,KAAK,MAAM,IAAI,IAAI,uBAAuB,CAAC,KAAK,CAAC,EAAE,CAAC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KAAK,CAAC,cAAc,EAAE,CAAC,CAC5G;aACA,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,kBAAkB,CAAC,KAAK,CAAC,EAAE,CAAC;YAC9B,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,MAAM,IAAI,KAAK,CAAC,oCAAoC,SAAS,MAAM,MAAM,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;IACxG,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,oBAAoB,GAAG,CAAC,IAAY,EAAE,cAAuB,EAAW,EAAE;IAC9E,IAAI,CAAC,cAAc,EAAE,CAAC;QACpB,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,CAAC;QACH,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC;IACtC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,kBAAkB,GAAG,CAAC,KAAc,EAAW,EAAE,CACrD,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,IAAI,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ,CAAC"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import type { SkillControlEntry } from '../profiles/Profile.js';
|
|
2
|
-
import type { SkillCatalog } from './SkillCatalog.js';
|
|
3
|
-
export interface SkillResolutionDiagnostic {
|
|
4
|
-
readonly severity: 'error' | 'warning';
|
|
5
|
-
readonly path: string;
|
|
6
|
-
readonly message: string;
|
|
7
|
-
}
|
|
8
|
-
export interface SkillEntryInput {
|
|
9
|
-
readonly entry: SkillControlEntry;
|
|
10
|
-
/** Root for `file` references appended by the declaring profile. */
|
|
11
|
-
readonly profileReferenceRoot?: string;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Shared across control scopes so one skill ID materializes once; a second
|
|
15
|
-
* selection reuses the generated directory, and differing reference sets error.
|
|
16
|
-
*/
|
|
17
|
-
export type SkillMaterializationCache = Map<string, {
|
|
18
|
-
readonly referencesKey: string;
|
|
19
|
-
readonly generatedDirectory?: string;
|
|
20
|
-
}>;
|
|
21
|
-
export interface SkillResolutionInput {
|
|
22
|
-
readonly entries: readonly SkillEntryInput[];
|
|
23
|
-
readonly catalog: SkillCatalog;
|
|
24
|
-
readonly projectDirectory?: string;
|
|
25
|
-
/** When set, resolved skills are copied here as `<id>/` with materialized references. */
|
|
26
|
-
readonly outputDirectory?: string;
|
|
27
|
-
readonly materializationCache?: SkillMaterializationCache;
|
|
28
|
-
}
|
|
29
|
-
export interface SkillResolutionResult {
|
|
30
|
-
/** Skill sources in entry order: generated directories for resolved IDs, original strings otherwise. */
|
|
31
|
-
readonly sources: readonly string[];
|
|
32
|
-
readonly diagnostics: readonly SkillResolutionDiagnostic[];
|
|
33
|
-
}
|
|
34
|
-
export declare const resolveSkillEntries: (input: SkillResolutionInput) => SkillResolutionResult;
|
|
@@ -1,217 +0,0 @@
|
|
|
1
|
-
// Resolves selected skill IDs, validates references, and materializes generated skills.
|
|
2
|
-
import { copyFileSync, cpSync, existsSync, mkdirSync, realpathSync, statSync } from 'node:fs';
|
|
3
|
-
import { basename, isAbsolute, join, relative, sep } from 'node:path';
|
|
4
|
-
import { isSkillDocumentIssue, isValidSkillId, readSkillDocument, skillMaterializationSections, } from './SkillDocument.js';
|
|
5
|
-
export const resolveSkillEntries = (input) => {
|
|
6
|
-
const sources = [];
|
|
7
|
-
const diagnostics = [];
|
|
8
|
-
for (const entryInput of input.entries) {
|
|
9
|
-
const outcome = resolveSkillEntry(input, entryInput);
|
|
10
|
-
sources.push(...outcome.sources);
|
|
11
|
-
diagnostics.push(...outcome.diagnostics);
|
|
12
|
-
}
|
|
13
|
-
return { sources, diagnostics };
|
|
14
|
-
};
|
|
15
|
-
const resolveSkillEntry = (input, entryInput) => {
|
|
16
|
-
const { entry, profileReferenceRoot } = entryInput;
|
|
17
|
-
const selection = typeof entry === 'string' ? { id: entry } : entry;
|
|
18
|
-
const catalogEntry = input.catalog.entries.get(selection.id);
|
|
19
|
-
if (catalogEntry === undefined) {
|
|
20
|
-
return resolveUncataloguedEntry(entry, selection.id);
|
|
21
|
-
}
|
|
22
|
-
const references = selection.references ?? [];
|
|
23
|
-
const referencesKey = JSON.stringify(references);
|
|
24
|
-
const cached = input.materializationCache?.get(selection.id);
|
|
25
|
-
if (cached !== undefined) {
|
|
26
|
-
return resolveCachedEntry(cached, referencesKey, selection.id);
|
|
27
|
-
}
|
|
28
|
-
const resolved = resolveCatalogSkill({
|
|
29
|
-
catalogEntry,
|
|
30
|
-
references,
|
|
31
|
-
profileReferenceRoot,
|
|
32
|
-
projectDirectory: input.projectDirectory,
|
|
33
|
-
outputDirectory: input.outputDirectory,
|
|
34
|
-
});
|
|
35
|
-
input.materializationCache?.set(selection.id, {
|
|
36
|
-
referencesKey,
|
|
37
|
-
generatedDirectory: resolved.generatedDirectory,
|
|
38
|
-
});
|
|
39
|
-
return { sources: toEntrySources(resolved.generatedDirectory), diagnostics: resolved.diagnostics };
|
|
40
|
-
};
|
|
41
|
-
const resolveCachedEntry = (cached, referencesKey, id) => {
|
|
42
|
-
if (cached.referencesKey !== referencesKey) {
|
|
43
|
-
return {
|
|
44
|
-
sources: [],
|
|
45
|
-
diagnostics: [
|
|
46
|
-
{
|
|
47
|
-
severity: 'error',
|
|
48
|
-
path: `controls.skills/${id}`,
|
|
49
|
-
message: `Skill '${id}' is selected with conflicting reference sets across control scopes.`,
|
|
50
|
-
},
|
|
51
|
-
],
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
return { sources: toEntrySources(cached.generatedDirectory), diagnostics: [] };
|
|
55
|
-
};
|
|
56
|
-
const toEntrySources = (generatedDirectory) => generatedDirectory === undefined ? [] : [generatedDirectory];
|
|
57
|
-
const resolveUncataloguedEntry = (entry, id) => {
|
|
58
|
-
if (typeof entry !== 'string') {
|
|
59
|
-
return {
|
|
60
|
-
sources: [],
|
|
61
|
-
diagnostics: [
|
|
62
|
-
{
|
|
63
|
-
severity: 'error',
|
|
64
|
-
path: `controls.skills/${id}`,
|
|
65
|
-
message: `Skill ID '${id}' does not resolve in any skills directory.`,
|
|
66
|
-
},
|
|
67
|
-
],
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
if (isValidSkillId(entry)) {
|
|
71
|
-
return {
|
|
72
|
-
sources: [entry],
|
|
73
|
-
diagnostics: [
|
|
74
|
-
{
|
|
75
|
-
severity: 'warning',
|
|
76
|
-
path: `controls.skills/${entry}`,
|
|
77
|
-
message: `Skill '${entry}' does not resolve in any skills directory; passing it through as a path source.`,
|
|
78
|
-
},
|
|
79
|
-
],
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
return { sources: [entry], diagnostics: [] };
|
|
83
|
-
};
|
|
84
|
-
const resolveCatalogSkill = (input) => {
|
|
85
|
-
const { catalogEntry } = input;
|
|
86
|
-
const diagnostics = [];
|
|
87
|
-
const document = readSkillDocument(catalogEntry.skillPath);
|
|
88
|
-
if (isSkillDocumentIssue(document)) {
|
|
89
|
-
return { diagnostics: [{ severity: 'error', path: document.path, message: document.message }] };
|
|
90
|
-
}
|
|
91
|
-
if (document.name !== catalogEntry.id) {
|
|
92
|
-
return {
|
|
93
|
-
diagnostics: [
|
|
94
|
-
{
|
|
95
|
-
severity: 'error',
|
|
96
|
-
path: catalogEntry.skillPath,
|
|
97
|
-
message: `SKILL.md 'name' ('${document.name}') must match its directory name ('${catalogEntry.id}').`,
|
|
98
|
-
},
|
|
99
|
-
],
|
|
100
|
-
};
|
|
101
|
-
}
|
|
102
|
-
const materializations = planSkillMaterializations(input, document, diagnostics);
|
|
103
|
-
if (diagnostics.some((diagnostic) => diagnostic.severity === 'error') || input.outputDirectory === undefined) {
|
|
104
|
-
return { diagnostics };
|
|
105
|
-
}
|
|
106
|
-
const generatedDirectory = join(input.outputDirectory, catalogEntry.id);
|
|
107
|
-
cpSync(catalogEntry.directory, generatedDirectory, { recursive: true });
|
|
108
|
-
for (const materialization of materializations) {
|
|
109
|
-
const sectionDirectory = join(generatedDirectory, materialization.section);
|
|
110
|
-
mkdirSync(sectionDirectory, { recursive: true });
|
|
111
|
-
// copyFileSync preserves the source mode, so materialized scripts stay executable.
|
|
112
|
-
copyFileSync(materialization.sourcePath, join(sectionDirectory, materialization.destinationName));
|
|
113
|
-
}
|
|
114
|
-
return { generatedDirectory, diagnostics };
|
|
115
|
-
};
|
|
116
|
-
const planSkillMaterializations = (input, document, diagnostics) => {
|
|
117
|
-
const materializations = [];
|
|
118
|
-
for (const section of skillMaterializationSections) {
|
|
119
|
-
const entries = [
|
|
120
|
-
...document[section].map((reference) => ({ reference, fileRoot: input.catalogEntry.referenceRoot })),
|
|
121
|
-
// Profile-added references resolve `file` from the declaring profile's repository.
|
|
122
|
-
...(section === 'references'
|
|
123
|
-
? input.references.map((reference) => ({
|
|
124
|
-
reference,
|
|
125
|
-
fileRoot: input.profileReferenceRoot ?? input.projectDirectory ?? input.catalogEntry.referenceRoot,
|
|
126
|
-
}))
|
|
127
|
-
: []),
|
|
128
|
-
];
|
|
129
|
-
materializations.push(...planSectionMaterializations(input, section, entries, diagnostics));
|
|
130
|
-
}
|
|
131
|
-
return materializations;
|
|
132
|
-
};
|
|
133
|
-
const planSectionMaterializations = (input, section, entries, diagnostics) => {
|
|
134
|
-
const materializations = [];
|
|
135
|
-
const destinationNames = new Set();
|
|
136
|
-
for (const { reference, fileRoot } of entries) {
|
|
137
|
-
const resolved = resolveReferenceMaterialization({
|
|
138
|
-
reference,
|
|
139
|
-
section,
|
|
140
|
-
fileRoot,
|
|
141
|
-
projectDirectory: input.projectDirectory,
|
|
142
|
-
skillPath: input.catalogEntry.skillPath,
|
|
143
|
-
});
|
|
144
|
-
if (resolved === undefined) {
|
|
145
|
-
continue;
|
|
146
|
-
}
|
|
147
|
-
if ('message' in resolved) {
|
|
148
|
-
diagnostics.push(resolved);
|
|
149
|
-
continue;
|
|
150
|
-
}
|
|
151
|
-
if (destinationNames.has(resolved.destinationName)) {
|
|
152
|
-
diagnostics.push({
|
|
153
|
-
severity: 'error',
|
|
154
|
-
path: input.catalogEntry.skillPath,
|
|
155
|
-
message: `Destination '${section}/${resolved.destinationName}' is declared more than once.`,
|
|
156
|
-
});
|
|
157
|
-
continue;
|
|
158
|
-
}
|
|
159
|
-
// Checked against the source skill directory during planning so lint reports
|
|
160
|
-
// shipped-file collisions without materializing anything.
|
|
161
|
-
if (existsSync(join(input.catalogEntry.directory, section, resolved.destinationName))) {
|
|
162
|
-
diagnostics.push({
|
|
163
|
-
severity: 'error',
|
|
164
|
-
path: input.catalogEntry.skillPath,
|
|
165
|
-
message: `Destination '${section}/${resolved.destinationName}' collides with a file ` +
|
|
166
|
-
`already shipped by skill '${input.catalogEntry.id}'.`,
|
|
167
|
-
});
|
|
168
|
-
continue;
|
|
169
|
-
}
|
|
170
|
-
destinationNames.add(resolved.destinationName);
|
|
171
|
-
materializations.push(resolved);
|
|
172
|
-
}
|
|
173
|
-
return materializations;
|
|
174
|
-
};
|
|
175
|
-
const describeReference = (reference, fileRoot, projectDirectory) => 'repo_file' in reference
|
|
176
|
-
? { declaredPath: reference.repo_file, root: projectDirectory, kind: 'repo_file', rootLabel: 'project' }
|
|
177
|
-
: { declaredPath: reference.file, root: fileRoot, kind: 'file', rootLabel: 'catalog' };
|
|
178
|
-
const resolveReferenceMaterialization = (input) => {
|
|
179
|
-
const { declaredPath, root, kind, rootLabel } = describeReference(input.reference, input.fileRoot, input.projectDirectory);
|
|
180
|
-
const error = (message) => ({
|
|
181
|
-
severity: 'error',
|
|
182
|
-
path: input.skillPath,
|
|
183
|
-
message,
|
|
184
|
-
});
|
|
185
|
-
if (root === undefined) {
|
|
186
|
-
return error(`Reference ${kind} '${declaredPath}' has no ${rootLabel} root to resolve from.`);
|
|
187
|
-
}
|
|
188
|
-
const sourcePath = isAbsolute(declaredPath) ? declaredPath : join(root, declaredPath);
|
|
189
|
-
if (!existsSync(sourcePath)) {
|
|
190
|
-
// A consuming project may not contain a repo_file target; the reference is omitted.
|
|
191
|
-
return kind === 'repo_file' ? undefined : error(`Reference file '${declaredPath}' was not found under '${root}'.`);
|
|
192
|
-
}
|
|
193
|
-
if (!statSync(sourcePath).isFile()) {
|
|
194
|
-
return error(`Reference ${kind} '${declaredPath}' must be a regular file.`);
|
|
195
|
-
}
|
|
196
|
-
if (escapesRoot(sourcePath, root)) {
|
|
197
|
-
return error(`Reference ${kind} '${declaredPath}' resolves outside its ${rootLabel} root '${root}'.`);
|
|
198
|
-
}
|
|
199
|
-
return { section: input.section, sourcePath, destinationName: basename(declaredPath) };
|
|
200
|
-
};
|
|
201
|
-
/** Targets must remain within their root after following symlinks. */
|
|
202
|
-
const escapesRoot = (sourcePath, root) => {
|
|
203
|
-
let resolvedSource;
|
|
204
|
-
let resolvedRoot;
|
|
205
|
-
try {
|
|
206
|
-
resolvedSource = realpathSync(sourcePath);
|
|
207
|
-
resolvedRoot = realpathSync(root);
|
|
208
|
-
}
|
|
209
|
-
catch {
|
|
210
|
-
/* v8 ignore next 2 -- existsSync guards the source; a vanished root is a race we treat as escaping. */
|
|
211
|
-
return true;
|
|
212
|
-
}
|
|
213
|
-
const relativePath = relative(resolvedRoot, resolvedSource);
|
|
214
|
-
// A bare '..' or a '../' prefix escapes; a sibling name like '..config' does not.
|
|
215
|
-
return relativePath === '..' || relativePath.startsWith(`..${sep}`) || isAbsolute(relativePath);
|
|
216
|
-
};
|
|
217
|
-
//# sourceMappingURL=SkillResolution.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SkillResolution.js","sourceRoot":"","sources":["../../src/skills/SkillResolution.ts"],"names":[],"mappings":"AAAA,wFAAwF;AACxF,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,UAAU,E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