@ai-outfitter/outfitter 1.5.0 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -2
- package/code/pi-extension/src/outfitter-extension.js +9 -1
- package/dist/agents/AgentLaunch.d.ts +2 -2
- package/dist/agents/AgentLaunch.js +4 -3
- package/dist/agents/AgentLaunch.js.map +1 -1
- package/dist/agents/ClaudeStatePersistence.d.ts +18 -0
- package/dist/agents/ClaudeStatePersistence.js +225 -0
- package/dist/agents/ClaudeStatePersistence.js.map +1 -0
- package/dist/cli/OutfitterCli.js +1 -1
- package/dist/cli/OutfitterCli.js.map +1 -1
- package/dist/cli/commands/DumpCommand.d.ts +1 -0
- package/dist/cli/commands/DumpCommand.js +11 -1
- package/dist/cli/commands/DumpCommand.js.map +1 -1
- package/dist/cli/commands/ListCommand.d.ts +2 -0
- package/dist/cli/commands/ListCommand.js +15 -4
- package/dist/cli/commands/ListCommand.js.map +1 -1
- package/dist/cli/commands/RunAgentCommand.js +85 -17
- package/dist/cli/commands/RunAgentCommand.js.map +1 -1
- package/dist/cli/commands/SyncCommand.d.ts +8 -3
- package/dist/cli/commands/SyncCommand.js +126 -21
- package/dist/cli/commands/SyncCommand.js.map +1 -1
- package/dist/cli/commands/ValidateCommand.js +1 -1
- package/dist/cli/commands/ValidateCommand.js.map +1 -1
- package/dist/projection/CodexMcp.d.ts +11 -0
- package/dist/projection/CodexMcp.js +143 -0
- package/dist/projection/CodexMcp.js.map +1 -0
- package/dist/projection/Materialize.d.ts +3 -1
- package/dist/projection/Materialize.js +7 -3
- package/dist/projection/Materialize.js.map +1 -1
- package/dist/projection/ProjectHarness.js +66 -29
- package/dist/projection/ProjectHarness.js.map +1 -1
- package/dist/projection/Projection.d.ts +2 -0
- package/dist/resolver/AmbiguityWarnings.d.ts +7 -0
- package/dist/resolver/AmbiguityWarnings.js +86 -0
- package/dist/resolver/AmbiguityWarnings.js.map +1 -0
- package/dist/resolver/Layer.d.ts +8 -2
- package/dist/resolver/Layer.js +48 -8
- package/dist/resolver/Layer.js.map +1 -1
- package/dist/resolver/ResolverContext.d.ts +3 -1
- package/dist/resolver/ResolverContext.js +11 -2
- package/dist/resolver/ResolverContext.js.map +1 -1
- package/dist/resolver/ResolverValidation.d.ts +12 -1
- package/dist/resolver/ResolverValidation.js +30 -20
- package/dist/resolver/ResolverValidation.js.map +1 -1
- package/dist/schemas/settings.schema.json +1 -1
- package/dist/schemas/system-extension-hook.schema.json +38 -0
- package/dist/settings/Settings.d.ts +1 -1
- package/dist/settings/Settings.js +1 -1
- package/dist/settings/Settings.js.map +1 -1
- package/dist/settings/SettingsLoader.js.map +1 -1
- package/dist/setup/DefaultCatalog.d.ts +18 -0
- package/dist/setup/DefaultCatalog.js +74 -13
- package/dist/setup/DefaultCatalog.js.map +1 -1
- package/dist/sources/SourceCache.d.ts +20 -0
- package/dist/sources/SourceCache.js +31 -1
- package/dist/sources/SourceCache.js.map +1 -1
- package/dist/sources/TransitiveSources.d.ts +45 -0
- package/dist/sources/TransitiveSources.js +179 -0
- package/dist/sources/TransitiveSources.js.map +1 -0
- package/dist/system/SystemExtensionHook.d.ts +34 -0
- package/dist/system/SystemExtensionHook.js +190 -0
- package/dist/system/SystemExtensionHook.js.map +1 -0
- package/dist/validation/SchemaValidator.d.ts +1 -1
- package/dist/validation/SchemaValidator.js +2 -0
- package/dist/validation/SchemaValidator.js.map +1 -1
- package/docs/architecture/state_writeback_strategy.md +15 -3
- package/docs/documentation/README.md +14 -1
- package/docs/documentation/catalogs.md +61 -2
- package/docs/documentation/cli.md +2 -1
- package/docs/documentation/concepts.md +2 -2
- package/docs/documentation/hooks.md +33 -0
- package/docs/documentation/in-cluster.md +2 -0
- package/docs/documentation/migration.md +1 -1
- package/docs/documentation/personas.md +1 -1
- package/docs/documentation/settings.md +1 -1
- package/docs/documentation/state.md +27 -0
- package/docs/documentation/support-matrix.md +34 -23
- package/docs/documentation/usecases/org-onboarding-sdlc-report.md +143 -0
- package/docs/documentation/usecases/persona-reviews.md +1 -1
- package/docs/philosophy.md +20 -0
- package/package.json +1 -1
- package/src/schemas/settings.schema.json +1 -1
- package/src/schemas/system-extension-hook.schema.json +38 -0
package/dist/resolver/Layer.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
// Builds the ordered `.agents` layer stack (workspace over global over remote sources) from settings.
|
|
2
2
|
import { existsSync } from 'node:fs';
|
|
3
3
|
import { join } from 'node:path';
|
|
4
|
-
import { createRemoteRepositoryCachePath, formatRemoteSourceDisplay, isRemoteSource,
|
|
4
|
+
import { createRemoteRepositoryCachePath, encodeRemoteSourceSelection, formatRemoteSourceDisplay, isRemoteSource, resolveSourcePayloadRoot, } from '../sources/SourceCache.js';
|
|
5
|
+
import { expandTransitiveSources } from '../sources/TransitiveSources.js';
|
|
5
6
|
const agentsRoot = (directory) => join(directory, '.agents');
|
|
6
7
|
/**
|
|
7
8
|
* Maps an already-materialized repository checkout to the layer `outfitter run` would resolve from
|
|
8
9
|
* it. `outfitter sync` reuses this against its temporary checkout so both agree on the payload root.
|
|
9
10
|
*/
|
|
10
11
|
export const remoteSourceLayer = (repositoryPath, source) => ({
|
|
11
|
-
root:
|
|
12
|
+
root: resolveSourcePayloadRoot(repositoryPath, source),
|
|
12
13
|
origin: 'source',
|
|
13
14
|
label: formatRemoteSourceDisplay(source),
|
|
14
15
|
});
|
|
@@ -16,8 +17,9 @@ const sourceLayer = (input, source) => isRemoteSource(source)
|
|
|
16
17
|
? remoteSourceLayer(createRemoteRepositoryCachePath(input.homeDirectory, source, input.settings.cacheDirectory), source)
|
|
17
18
|
: { root: source.path, origin: 'source', label: source.path };
|
|
18
19
|
/**
|
|
19
|
-
* Orders layers highest precedence first: workspace `.agents`, then global `~/.agents`,
|
|
20
|
-
*
|
|
20
|
+
* Orders layers highest precedence first: workspace `.agents`, then global `~/.agents`, then
|
|
21
|
+
* configured sources in order, then transitive sources those catalogs declare, breadth-first
|
|
22
|
+
* (OFTR-004.6.1, OFTR-004.6.3). Only layers whose root exists on disk are included.
|
|
21
23
|
*/
|
|
22
24
|
export const discoverLayers = (input) => {
|
|
23
25
|
const candidates = [
|
|
@@ -25,14 +27,52 @@ export const discoverLayers = (input) => {
|
|
|
25
27
|
{ root: agentsRoot(input.homeDirectory), origin: 'global', label: 'global' },
|
|
26
28
|
];
|
|
27
29
|
const unsynchronized = [];
|
|
28
|
-
|
|
29
|
-
|
|
30
|
+
const invalid = [];
|
|
31
|
+
const appendSourceLayer = (source) => {
|
|
32
|
+
// An absolute or escaping `path:` makes payload-root resolution throw; skip the source with a
|
|
33
|
+
// warning rather than crash every resolve command (list/validate/run/dump).
|
|
34
|
+
let layer;
|
|
35
|
+
try {
|
|
36
|
+
layer = sourceLayer(input, source);
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
invalid.push(`Configured source '${isRemoteSource(source) ? formatRemoteSourceDisplay(source) : source.path}' has an invalid path and was skipped.`);
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
30
42
|
if (isRemoteSource(source) && !existsSync(layer.root)) {
|
|
31
43
|
unsynchronized.push(`Configured remote source '${layer.label}' is not synchronized at '${layer.root}'. Run 'outfitter sync' to fetch it.`);
|
|
32
|
-
|
|
44
|
+
return;
|
|
33
45
|
}
|
|
34
46
|
candidates.push(layer);
|
|
47
|
+
};
|
|
48
|
+
// Deduplicate exact-duplicate configured sources so an identical entry listed twice yields one
|
|
49
|
+
// layer, not a self-shadowing pair (OFTR-004.6.6). Distinct subpaths stay distinct (path-aware).
|
|
50
|
+
const seenSources = new Set();
|
|
51
|
+
const directSources = (input.settings.sources ?? []).filter((source) => {
|
|
52
|
+
const key = isRemoteSource(source) ? encodeRemoteSourceSelection(source) : `path\0${source.path}`;
|
|
53
|
+
if (seenSources.has(key))
|
|
54
|
+
return false;
|
|
55
|
+
seenSources.add(key);
|
|
56
|
+
return true;
|
|
57
|
+
});
|
|
58
|
+
for (const source of directSources) {
|
|
59
|
+
appendSourceLayer(source);
|
|
60
|
+
}
|
|
61
|
+
const expansion = expandTransitiveSources({
|
|
62
|
+
directSources,
|
|
63
|
+
resolveCachedCheckoutRoot: (source) => {
|
|
64
|
+
const checkoutRoot = createRemoteRepositoryCachePath(input.homeDirectory, source, input.settings.cacheDirectory);
|
|
65
|
+
return existsSync(checkoutRoot) ? checkoutRoot : undefined;
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
for (const transitive of expansion.sources) {
|
|
69
|
+
appendSourceLayer(transitive.source);
|
|
35
70
|
}
|
|
36
|
-
return {
|
|
71
|
+
return {
|
|
72
|
+
layers: candidates.filter((layer) => existsSync(layer.root)),
|
|
73
|
+
transitiveDeclarations: expansion.declarations,
|
|
74
|
+
unsynchronized,
|
|
75
|
+
warnings: [...invalid, ...expansion.warnings],
|
|
76
|
+
};
|
|
37
77
|
};
|
|
38
78
|
//# sourceMappingURL=Layer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Layer.js","sourceRoot":"","sources":["../../src/resolver/Layer.ts"],"names":[],"mappings":"AAAA,sGAAsG;AACtG,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EACL,+BAA+B,EAC/B,yBAAyB,EACzB,cAAc,EACd,
|
|
1
|
+
{"version":3,"file":"Layer.js","sourceRoot":"","sources":["../../src/resolver/Layer.ts"],"names":[],"mappings":"AAAA,sGAAsG;AACtG,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EACL,+BAA+B,EAC/B,2BAA2B,EAC3B,yBAAyB,EACzB,cAAc,EACd,wBAAwB,GACzB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAW1E,MAAM,UAAU,GAAG,CAAC,SAA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AAM,EAAE,EAAE;YACpC,MAAM,YAAY,GAAG,+BAA+B,CAAC,KAAK,CAAC,aAAa,EAAE,MAAM,EAAE,KAAK,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;YACjH,OAAO,UAAU,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC;QAC7D,CAAC;KACF,CAAC,CAAC;IACH,KAAK,MAAM,UAAU,IAAI,SAAS,CAAC,OAAO,EAAE,CAAC;QAC3C,iBAAiB,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;IACvC,CAAC;IAED,OAAO;QACL,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC5D,sBAAsB,EAAE,SAAS,CAAC,YAAY;QAC9C,cAAc;QACd,QAAQ,EAAE,CAAC,GAAG,OAAO,EAAE,GAAG,SAAS,CAAC,QAAQ,CAAC;KAC9C,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -10,8 +10,10 @@ export interface ResolveResult {
|
|
|
10
10
|
/** The merged settings loaded during resolution, so callers need not reload them. */
|
|
11
11
|
readonly settings: Settings;
|
|
12
12
|
readonly settingsIssues: readonly SettingsLoadIssue[];
|
|
13
|
-
/** Non-fatal
|
|
13
|
+
/** Non-fatal guidance: uncached remote sources plus transitive-source skip warnings. */
|
|
14
14
|
readonly warnings: readonly string[];
|
|
15
|
+
/** Ambiguity-only subset, exposed so sync can report shared resolution diagnostics after fetching. */
|
|
16
|
+
readonly ambiguityWarnings: readonly string[];
|
|
15
17
|
}
|
|
16
18
|
/** The single shared resolution path used by list, validate, run, and dump. */
|
|
17
19
|
export declare const resolveEffectiveSet: (input: ResolveInput) => ResolveResult;
|
|
@@ -1,16 +1,25 @@
|
|
|
1
1
|
// Shared entry point that turns a home/project location into one effective resource set.
|
|
2
2
|
import { loadSettingsWithCachedRemoteSettings } from '../settings/SettingsLoader.js';
|
|
3
|
+
import { slugAmbiguityWarnings, sourceRefAmbiguityWarnings } from './AmbiguityWarnings.js';
|
|
3
4
|
import { discoverLayers } from './Layer.js';
|
|
4
5
|
import { resolveResources } from './Resolver.js';
|
|
5
6
|
/** The single shared resolution path used by list, validate, run, and dump. */
|
|
6
7
|
export const resolveEffectiveSet = (input) => {
|
|
7
8
|
const loadedSettings = loadSettingsWithCachedRemoteSettings(input);
|
|
8
9
|
const discovered = discoverLayers({ ...input, settings: loadedSettings.settings });
|
|
10
|
+
const set = resolveResources(discovered.layers);
|
|
11
|
+
const ambiguityWarnings = [
|
|
12
|
+
...sourceRefAmbiguityWarnings(loadedSettings.files,
|
|
13
|
+
// Settings merging always materializes the default empty source list.
|
|
14
|
+
loadedSettings.settings.sources, discovered.transitiveDeclarations),
|
|
15
|
+
...slugAmbiguityWarnings(set),
|
|
16
|
+
];
|
|
9
17
|
return {
|
|
10
|
-
set
|
|
18
|
+
set,
|
|
11
19
|
settings: loadedSettings.settings,
|
|
12
20
|
settingsIssues: loadedSettings.issues,
|
|
13
|
-
warnings: discovered.unsynchronized,
|
|
21
|
+
warnings: [...discovered.unsynchronized, ...discovered.warnings, ...ambiguityWarnings],
|
|
22
|
+
ambiguityWarnings,
|
|
14
23
|
};
|
|
15
24
|
};
|
|
16
25
|
//# sourceMappingURL=ResolverContext.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResolverContext.js","sourceRoot":"","sources":["../../src/resolver/ResolverContext.ts"],"names":[],"mappings":"AAAA,yFAAyF;AACzF,OAAO,EAAE,oCAAoC,EAAE,MAAM,+BAA+B,CAAC;AAGrF,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"ResolverContext.js","sourceRoot":"","sources":["../../src/resolver/ResolverContext.ts"],"names":[],"mappings":"AAAA,yFAAyF;AACzF,OAAO,EAAE,oCAAoC,EAAE,MAAM,+BAA+B,CAAC;AAGrF,OAAO,EAAE,qBAAqB,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AAC3F,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAkBjD,+EAA+E;AAC/E,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,KAAmB,EAAiB,EAAE;IACxE,MAAM,cAAc,GAAG,oCAAoC,CAAC,KAAK,CAAC,CAAC;IACnE,MAAM,UAAU,GAAG,cAAc,CAAC,EAAE,GAAG,KAAK,EAAE,QAAQ,EAAE,cAAc,CAAC,QAAQ,EAAE,CAAC,CAAC;IACnF,MAAM,GAAG,GAAG,gBAAgB,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;IAChD,MAAM,iBAAiB,GAAG;QACxB,GAAG,0BAA0B,CAC3B,cAAc,CAAC,KAAK;QACpB,sEAAsE;QACtE,cAAc,CAAC,QAAQ,CAAC,OAAQ,EAChC,UAAU,CAAC,sBAAsB,CAClC;QACD,GAAG,qBAAqB,CAAC,GAAG,CAAC;KAC9B,CAAC;IAEF,OAAO;QACL,GAAG;QACH,QAAQ,EAAE,cAAc,CAAC,QAAQ;QACjC,cAAc,EAAE,cAAc,CAAC,MAAM;QACrC,QAAQ,EAAE,CAAC,GAAG,UAAU,CAAC,cAAc,EAAE,GAAG,UAAU,CAAC,QAAQ,EAAE,GAAG,iBAAiB,CAAC;QACtF,iBAAiB;KAClB,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -4,8 +4,19 @@ export interface ValidationFinding {
|
|
|
4
4
|
readonly resource: string;
|
|
5
5
|
readonly message: string;
|
|
6
6
|
}
|
|
7
|
+
/**
|
|
8
|
+
* Options for {@link validateEffectiveSet}. `deferLoadoutResolution` downgrades an unresolved
|
|
9
|
+
* loadout slug reference from an error to a warning — used when validating a single remote source
|
|
10
|
+
* in isolation during `outfitter sync`, where a catalog may legitimately reference a skill supplied
|
|
11
|
+
* by a catalog it declares as a dependency (OFTR-004.6). Loadout wholeness is then authoritatively
|
|
12
|
+
* enforced against the merged effective set by `outfitter validate`; the run-time composer surfaces
|
|
13
|
+
* an unresolved reference as a non-fatal warning (OFTR-005.3.4), fatal only under `run --strict`.
|
|
14
|
+
*/
|
|
15
|
+
export interface ValidationOptions {
|
|
16
|
+
readonly deferLoadoutResolution?: boolean;
|
|
17
|
+
}
|
|
7
18
|
/**
|
|
8
19
|
* Collects validation findings across the effective set. `error` findings always fail validation;
|
|
9
20
|
* `warning` findings (such as shadowed definitions) fail only under `--strict`.
|
|
10
21
|
*/
|
|
11
|
-
export declare const validateEffectiveSet: (set: EffectiveResourceSet, projectDirectory?: string) => readonly ValidationFinding[];
|
|
22
|
+
export declare const validateEffectiveSet: (set: EffectiveResourceSet, projectDirectory?: string, options?: ValidationOptions) => readonly ValidationFinding[];
|
|
@@ -3,8 +3,12 @@ import { compose } from '../composer/Composer.js';
|
|
|
3
3
|
import { isSkillDocumentIssue, readSkillDocument } from '../skills/SkillDocument.js';
|
|
4
4
|
import { isAgentDefinitionIssue, readAgentDefinition } from './AgentDefinition.js';
|
|
5
5
|
import { agentLocalKinds, findResource, listAgentResources, listResources } from './Resource.js';
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
// Matches the composer's top-level unresolved-loadout warning wording (see `compose` in Composer.ts).
|
|
7
|
+
// It is deliberately coupled to that message; `resolver-validation.test.ts` drives the real composer,
|
|
8
|
+
// so a wording drift fails that test rather than silently disabling deferral.
|
|
9
|
+
const isUnresolvedLoadoutReference = (message) => /^loadout (?:skills|subagents) references unknown (?:skill|agent) '/.test(message);
|
|
10
|
+
const compositionWarningSeverity = (message, options) => isUnresolvedLoadoutReference(message) && !options.deferLoadoutResolution ? 'error' : 'warning';
|
|
11
|
+
const validateAgent = (set, agent, options, projectDirectory) => {
|
|
8
12
|
const definition = readAgentDefinition(agent.winner.path, agent.configPaths);
|
|
9
13
|
if (isAgentDefinitionIssue(definition)) {
|
|
10
14
|
return [{ severity: 'error', resource: `agent:${agent.slug}`, message: definition.message }];
|
|
@@ -22,7 +26,7 @@ const validateAgent = (set, agent, projectDirectory) => {
|
|
|
22
26
|
const compositionFindings = [
|
|
23
27
|
...composed.errors.map((message) => ({ severity: 'error', resource: `agent:${agent.slug}`, message })),
|
|
24
28
|
...composed.warnings.map((message) => ({
|
|
25
|
-
severity: compositionWarningSeverity(message),
|
|
29
|
+
severity: compositionWarningSeverity(message, options),
|
|
26
30
|
resource: `agent:${agent.slug}`,
|
|
27
31
|
message,
|
|
28
32
|
})),
|
|
@@ -76,34 +80,40 @@ const deduplicateFindings = (findings) => {
|
|
|
76
80
|
}
|
|
77
81
|
return [...deduplicated.values()];
|
|
78
82
|
};
|
|
83
|
+
// Validates one agent's local resources: the owning agent must resolve, and each local skill is
|
|
84
|
+
// document-checked; knowledge/commands are opaque file trees today, so only shadowing is surfaced.
|
|
85
|
+
const validateAgentLocalResources = (set, agentSlug) => {
|
|
86
|
+
const findings = [];
|
|
87
|
+
if (findResource(set, 'agent', agentSlug) === undefined) {
|
|
88
|
+
findings.push({
|
|
89
|
+
severity: 'error',
|
|
90
|
+
resource: `agent:${agentSlug}`,
|
|
91
|
+
message: 'agent-local resources require a resolvable owning agent.',
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
for (const kind of agentLocalKinds) {
|
|
95
|
+
for (const resource of listAgentResources(set, agentSlug, kind)) {
|
|
96
|
+
findings.push(...shadowFindings(resource));
|
|
97
|
+
if (kind === 'skill')
|
|
98
|
+
findings.push(...validateSkill(resource));
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return findings;
|
|
102
|
+
};
|
|
79
103
|
/**
|
|
80
104
|
* Collects validation findings across the effective set. `error` findings always fail validation;
|
|
81
105
|
* `warning` findings (such as shadowed definitions) fail only under `--strict`.
|
|
82
106
|
*/
|
|
83
|
-
export const validateEffectiveSet = (set, projectDirectory) => {
|
|
107
|
+
export const validateEffectiveSet = (set, projectDirectory, options = {}) => {
|
|
84
108
|
const findings = [];
|
|
85
109
|
for (const agent of listResources(set, 'agent')) {
|
|
86
|
-
findings.push(...validateAgent(set, agent, projectDirectory), ...reservedNamespaceFindings(agent));
|
|
110
|
+
findings.push(...validateAgent(set, agent, options, projectDirectory), ...reservedNamespaceFindings(agent));
|
|
87
111
|
}
|
|
88
112
|
for (const skill of listResources(set, 'skill')) {
|
|
89
113
|
findings.push(...validateSkill(skill));
|
|
90
114
|
}
|
|
91
115
|
for (const [agentSlug] of set.agentResources) {
|
|
92
|
-
|
|
93
|
-
findings.push({
|
|
94
|
-
severity: 'error',
|
|
95
|
-
resource: `agent:${agentSlug}`,
|
|
96
|
-
message: 'agent-local resources require a resolvable owning agent.',
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
for (const kind of agentLocalKinds) {
|
|
100
|
-
for (const resource of listAgentResources(set, agentSlug, kind)) {
|
|
101
|
-
findings.push(...shadowFindings(resource));
|
|
102
|
-
// Only skills have a document reader today; knowledge/commands are opaque file trees.
|
|
103
|
-
if (kind === 'skill')
|
|
104
|
-
findings.push(...validateSkill(resource));
|
|
105
|
-
}
|
|
106
|
-
}
|
|
116
|
+
findings.push(...validateAgentLocalResources(set, agentSlug));
|
|
107
117
|
}
|
|
108
118
|
for (const kind of ['agent', 'skill', 'knowledge', 'command']) {
|
|
109
119
|
for (const resource of listResources(set, kind)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResolverValidation.js","sourceRoot":"","sources":["../../src/resolver/ResolverValidation.ts"],"names":[],"mappings":"AAAA,uGAAuG;AACvG,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACrF,OAAO,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAEnF,OAAO,E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-
"default_harness": { "enum": ["pi", "claude"] },
|
|
8
|
+
"default_harness": { "enum": ["pi", "claude", "codex"] },
|
|
9
9
|
"cache_directory": { "type": "string", "minLength": 1 },
|
|
10
10
|
"state_persistence": {
|
|
11
11
|
"type": "object",
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://outfitter.dev/schemas/system-extension-hook.schema.json",
|
|
4
|
+
"title": "Outfitter system extension hook",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"required": ["name", "harnesses"],
|
|
7
|
+
"properties": {
|
|
8
|
+
"name": { "type": "string", "minLength": 1 },
|
|
9
|
+
"harnesses": {
|
|
10
|
+
"type": "object",
|
|
11
|
+
"minProperties": 1,
|
|
12
|
+
"properties": {
|
|
13
|
+
"pi": { "$ref": "#/$defs/harnessHook" },
|
|
14
|
+
"claude": { "$ref": "#/$defs/harnessHook" },
|
|
15
|
+
"codex": { "$ref": "#/$defs/harnessHook" }
|
|
16
|
+
},
|
|
17
|
+
"additionalProperties": false
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"additionalProperties": false,
|
|
21
|
+
"$defs": {
|
|
22
|
+
"harnessHook": {
|
|
23
|
+
"type": "object",
|
|
24
|
+
"properties": {
|
|
25
|
+
"extensions": {
|
|
26
|
+
"type": "array",
|
|
27
|
+
"items": { "type": "string", "pattern": "^/" }
|
|
28
|
+
},
|
|
29
|
+
"env": {
|
|
30
|
+
"type": "object",
|
|
31
|
+
"propertyNames": { "pattern": "^[A-Za-z_][A-Za-z0-9_]*$" },
|
|
32
|
+
"additionalProperties": { "type": "string" }
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"additionalProperties": false
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -7,7 +7,7 @@ export type SettingsValue = string | number | boolean | null | readonly Settings
|
|
|
7
7
|
};
|
|
8
8
|
export type CustomSettings = Readonly<Record<string, SettingsValue>>;
|
|
9
9
|
/** Harnesses Outfitter can launch a composed agent in. */
|
|
10
|
-
export declare const HARNESSES: readonly ["pi", "claude"];
|
|
10
|
+
export declare const HARNESSES: readonly ["pi", "claude", "codex"];
|
|
11
11
|
export type Harness = (typeof HARNESSES)[number];
|
|
12
12
|
/** Functional persistence strategies for adapter-declared state paths. */
|
|
13
13
|
export type StatePersistenceStrategy = 'symlink' | 'discard' | 'warn' | 'error' | 'prompt';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Settings.js","sourceRoot":"","sources":["../../src/settings/Settings.ts"],"names":[],"mappings":"AAQA,0DAA0D;AAC1D,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,IAAI,EAAE,QAAQ,CAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"Settings.js","sourceRoot":"","sources":["../../src/settings/Settings.ts"],"names":[],"mappings":"AAQA,0DAA0D;AAC1D,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,CAAU,CAAC;AAuC5D,MAAM,CAAC,MAAM,aAAa,GAAG,GAAa,EAAE,CAAC,CAAC;IAC5C,OAAO,EAAE,EAAE;IACX,cAAc,EAAE,EAAE;CACnB,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SettingsLoader.js","sourceRoot":"","sources":["../../src/settings/SettingsLoader.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAE/D,OAAO,EAAE,+BAA+B,EAAE,8BAA8B,EAAE,MAAM,2BAA2B,CAAC;AAE5G,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,+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AI,UAAU,CAAC,cAAc,CAAC,EAAE,CAAC;QAC/B,OAAO,cAAc,CAAC;IACxB,CAAC;IAED,OAAO,OAAO,CAAC,iBAAiB,EAAE,cAAc,CAAC,CAAC;AACpD,CAAC,CAAC"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import { syncRemoteRepositoryAtomically } from '../sources/GitRepository.js';
|
|
1
2
|
import type { RemoteSourceReference } from '../sources/SourceCache.js';
|
|
3
|
+
/** Fetches one repository into the cache. Injectable so tests exercise bootstrap hermetically. */
|
|
4
|
+
export type RepositorySync = typeof syncRemoteRepositoryAtomically;
|
|
2
5
|
export declare const defaultCatalogSource: {
|
|
3
6
|
readonly github: "ai-outfitter/default-profiles";
|
|
4
7
|
readonly ref: "v1.1.0";
|
|
@@ -9,6 +12,13 @@ export interface PinnedCatalogBootstrapInput {
|
|
|
9
12
|
readonly source: RemoteSourceReference & {
|
|
10
13
|
readonly ref: string;
|
|
11
14
|
};
|
|
15
|
+
readonly syncRepository?: RepositorySync;
|
|
16
|
+
/**
|
|
17
|
+
* Proves a fetched checkout is a usable catalog. Defaults to requiring `agents/` — the picker root
|
|
18
|
+
* must offer agents — but a dependency may legitimately ship only skills, so the closure relaxes
|
|
19
|
+
* this to any recognized `.agents` payload directory.
|
|
20
|
+
*/
|
|
21
|
+
readonly requirePayload?: (root: string) => boolean;
|
|
12
22
|
}
|
|
13
23
|
export interface PinnedCatalogBootstrapResult {
|
|
14
24
|
readonly root: string;
|
|
@@ -18,4 +28,12 @@ export interface PinnedCatalogBootstrapResult {
|
|
|
18
28
|
}
|
|
19
29
|
/** Fetches one immutable catalog revision into the same cache path used by normal source resolution. */
|
|
20
30
|
export declare const bootstrapPinnedCatalog: (input: PinnedCatalogBootstrapInput) => PinnedCatalogBootstrapResult;
|
|
31
|
+
/**
|
|
32
|
+
* Bootstraps a pinned catalog and the pinned `github:` closure it declares, so a fresh install can
|
|
33
|
+
* resolve a default profile whose skills live in a depended-on catalog (the founder profile's
|
|
34
|
+
* persona skills, shipped by community-profiles) without a manual `outfitter sync`. The root failing
|
|
35
|
+
* to fetch is fatal (existing behavior); a declared dependency failing to fetch is best-effort —
|
|
36
|
+
* resolution reports it as unsynchronized rather than blocking setup on it.
|
|
37
|
+
*/
|
|
38
|
+
export declare const bootstrapPinnedClosure: (input: PinnedCatalogBootstrapInput) => PinnedCatalogBootstrapResult;
|
|
21
39
|
export declare const bootstrapDefaultCatalog: (homeDirectory: string, cacheDirectory?: string) => PinnedCatalogBootstrapResult;
|
|
@@ -1,24 +1,37 @@
|
|
|
1
1
|
// Bootstraps the one canonical default catalog at the immutable revision shipped by Outfitter.
|
|
2
|
-
import {
|
|
2
|
+
import { statSync } from 'node:fs';
|
|
3
3
|
import { join } from 'node:path';
|
|
4
4
|
import { runGit, syncRemoteRepositoryAtomically, tryReadCleanHead } from '../sources/GitRepository.js';
|
|
5
|
-
import { createRemoteRepositoryCachePath, redactEmbeddedSourceCredentials } from '../sources/SourceCache.js';
|
|
5
|
+
import { createRemoteRepositoryCachePath, encodeRemoteSourceSelection, formatRemoteSourceDisplay, isImmutableRef, isVersionTagRef, redactEmbeddedSourceCredentials, } from '../sources/SourceCache.js';
|
|
6
|
+
import { readDeclaredRemoteSources } from '../sources/TransitiveSources.js';
|
|
6
7
|
export const defaultCatalogSource = {
|
|
7
8
|
github: 'ai-outfitter/default-profiles',
|
|
8
9
|
// TODO(release-automation): when default-profiles publishes a new Release Please tag, open a
|
|
9
10
|
// conventional dependency-bump commit in Outfitter so its next Release Please release ships it.
|
|
10
11
|
ref: 'v1.1.0',
|
|
11
12
|
};
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
// A recognized payload marker must be a real directory, not merely a path that exists: a repository
|
|
14
|
+
// committing a regular file named `agents` is not a catalog and must not validate as one.
|
|
15
|
+
const isDirectory = (path) => {
|
|
16
|
+
try {
|
|
17
|
+
return statSync(path).isDirectory();
|
|
18
|
+
}
|
|
19
|
+
catch {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
const hasAgentsDirectory = (root) => isDirectory(join(root, 'agents'));
|
|
24
|
+
// Any directory the resolver treats as a `.agents` payload container, colocated or at the root.
|
|
25
|
+
const hasAnyAgentsPayload = (root) => ['agents', 'skills', 'knowledge', 'commands'].some((directory) => isDirectory(join(root, directory))) ||
|
|
26
|
+
isDirectory(join(root, '.agents'));
|
|
14
27
|
const assertImmutableRef = (ref) => {
|
|
15
|
-
if (!
|
|
28
|
+
if (!isImmutableRef(ref)) {
|
|
16
29
|
throw new Error(`Default catalog ref '${ref}' must be a full commit SHA or version tag.`);
|
|
17
30
|
}
|
|
18
31
|
};
|
|
19
|
-
const resolveExpectedCommit = (root, ref) =>
|
|
20
|
-
const isPinnedCatalogCheckout = (root, ref) => {
|
|
21
|
-
if (!
|
|
32
|
+
const resolveExpectedCommit = (root, ref) => isVersionTagRef(ref) ? runGit(['-C', root, 'rev-parse', `refs/tags/${ref}^{commit}`]) : ref;
|
|
33
|
+
const isPinnedCatalogCheckout = (root, ref, hasPayload) => {
|
|
34
|
+
if (!hasPayload(root))
|
|
22
35
|
return false;
|
|
23
36
|
try {
|
|
24
37
|
return tryReadCleanHead(root) === resolveExpectedCommit(root, ref);
|
|
@@ -30,13 +43,14 @@ const isPinnedCatalogCheckout = (root, ref) => {
|
|
|
30
43
|
/** Fetches one immutable catalog revision into the same cache path used by normal source resolution. */
|
|
31
44
|
export const bootstrapPinnedCatalog = (input) => {
|
|
32
45
|
assertImmutableRef(input.source.ref);
|
|
46
|
+
const hasPayload = input.requirePayload ?? hasAgentsDirectory;
|
|
33
47
|
const root = createRemoteRepositoryCachePath(input.homeDirectory, input.source, input.cacheDirectory);
|
|
34
|
-
if (isPinnedCatalogCheckout(root, input.source.ref))
|
|
48
|
+
if (isPinnedCatalogCheckout(root, input.source.ref, hasPayload))
|
|
35
49
|
return { root, source: input.source };
|
|
36
50
|
try {
|
|
37
|
-
syncRemoteRepositoryAtomically({
|
|
51
|
+
(input.syncRepository ?? syncRemoteRepositoryAtomically)({
|
|
38
52
|
cachePath: root,
|
|
39
|
-
fetchRef:
|
|
53
|
+
fetchRef: isVersionTagRef(input.source.ref)
|
|
40
54
|
? `refs/tags/${input.source.ref}:refs/tags/${input.source.ref}`
|
|
41
55
|
: input.source.ref,
|
|
42
56
|
source: input.source,
|
|
@@ -45,7 +59,7 @@ export const bootstrapPinnedCatalog = (input) => {
|
|
|
45
59
|
// accepting a dirty tree here would cache one that `tryReadCleanHead` rejects on every
|
|
46
60
|
// subsequent read, re-fetching forever.
|
|
47
61
|
validate: (temporaryRoot) => {
|
|
48
|
-
if (!isPinnedCatalogCheckout(temporaryRoot, input.source.ref)) {
|
|
62
|
+
if (!isPinnedCatalogCheckout(temporaryRoot, input.source.ref, hasPayload)) {
|
|
49
63
|
throw new Error(`Fetched default catalog did not resolve to ${input.source.ref}.`);
|
|
50
64
|
}
|
|
51
65
|
return 0;
|
|
@@ -60,5 +74,52 @@ export const bootstrapPinnedCatalog = (input) => {
|
|
|
60
74
|
});
|
|
61
75
|
}
|
|
62
76
|
};
|
|
63
|
-
|
|
77
|
+
/**
|
|
78
|
+
* Bootstraps a pinned catalog and the pinned `github:` closure it declares, so a fresh install can
|
|
79
|
+
* resolve a default profile whose skills live in a depended-on catalog (the founder profile's
|
|
80
|
+
* persona skills, shipped by community-profiles) without a manual `outfitter sync`. The root failing
|
|
81
|
+
* to fetch is fatal (existing behavior); a declared dependency failing to fetch is best-effort —
|
|
82
|
+
* resolution reports it as unsynchronized rather than blocking setup on it.
|
|
83
|
+
*/
|
|
84
|
+
export const bootstrapPinnedClosure = (input) => {
|
|
85
|
+
const rootResult = bootstrapPinnedCatalog(input);
|
|
86
|
+
const visited = new Set([encodeRemoteSourceSelection(input.source)]);
|
|
87
|
+
let frontier = [
|
|
88
|
+
{ root: rootResult.root, label: formatRemoteSourceDisplay(input.source) },
|
|
89
|
+
];
|
|
90
|
+
while (frontier.length > 0) {
|
|
91
|
+
const next = [];
|
|
92
|
+
for (const parent of frontier) {
|
|
93
|
+
// A `github:` closure is always path-less, so the payload root is the checkout root.
|
|
94
|
+
for (const declared of readDeclaredRemoteSources(parent.root, parent.root, parent.label).sources) {
|
|
95
|
+
const key = encodeRemoteSourceSelection(declared.source);
|
|
96
|
+
if (visited.has(key))
|
|
97
|
+
continue;
|
|
98
|
+
visited.add(key);
|
|
99
|
+
try {
|
|
100
|
+
next.push({
|
|
101
|
+
root: bootstrapPinnedCatalog({
|
|
102
|
+
homeDirectory: input.homeDirectory,
|
|
103
|
+
cacheDirectory: input.cacheDirectory,
|
|
104
|
+
source: declared.source,
|
|
105
|
+
syncRepository: input.syncRepository,
|
|
106
|
+
// A dependency may ship only skills; do not require it to contain agents/.
|
|
107
|
+
requirePayload: hasAnyAgentsPayload,
|
|
108
|
+
}).root,
|
|
109
|
+
label: formatRemoteSourceDisplay(declared.source),
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
catch {
|
|
113
|
+
// Best-effort: a dependency that cannot be fetched is surfaced by resolution as an
|
|
114
|
+
// unsynchronized source (with `outfitter sync` guidance), never a setup-blocking throw.
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
frontier = next;
|
|
119
|
+
}
|
|
120
|
+
return rootResult;
|
|
121
|
+
};
|
|
122
|
+
/* v8 ignore next 2 -- the production entry fetches the real default catalog from github.com; tests
|
|
123
|
+
drive bootstrapPinnedClosure directly and SetupCommand injects a fake bootstrap. */
|
|
124
|
+
export const bootstrapDefaultCatalog = (homeDirectory, cacheDirectory) => bootstrapPinnedClosure({ homeDirectory, cacheDirectory, source: defaultCatalogSource });
|
|
64
125
|
//# sourceMappingURL=DefaultCatalog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultCatalog.js","sourceRoot":"","sources":["../../src/setup/DefaultCatalog.ts"],"names":[],"mappings":"AAAA,+FAA+F;AAC/F,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file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OAAO,UAAU,CAAC;AACpB,CAAC,CAAC;AAEF;sFACsF;AACtF,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,aAAqB,EAAE,cAAuB,EAAgC,EAAE,CACtH,sBAAsB,CAAC,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,EAAE,oBAAoB,EAAE,CAAC,CAAC"}
|
|
@@ -15,6 +15,10 @@ export declare const isRemoteSource: <T extends {
|
|
|
15
15
|
readonly uri?: string;
|
|
16
16
|
readonly github?: string;
|
|
17
17
|
}>(source: T) => source is T & RemoteSourceReference;
|
|
18
|
+
/** True for a ref that names one immutable revision: a full commit SHA or a version tag. */
|
|
19
|
+
export declare const isImmutableRef: (ref: string) => boolean;
|
|
20
|
+
/** True for an immutable ref that must be resolved to a commit via `rev-parse` (a version tag). */
|
|
21
|
+
export declare const isVersionTagRef: (ref: string) => boolean;
|
|
18
22
|
export declare const normalizeGitUri: (uri: string) => string;
|
|
19
23
|
export declare const normalizeRemoteSourceUri: (source: RemoteSourceReference) => string;
|
|
20
24
|
export declare const formatRemoteSourceDisplay: (source: RemoteSourceReference) => string;
|
|
@@ -23,7 +27,23 @@ export declare const redactSourceUriCredentials: (uri: string) => string;
|
|
|
23
27
|
export declare const redactEmbeddedSourceCredentials: (value: string) => string;
|
|
24
28
|
export declare const encodeSourceUri: (uri: string) => string;
|
|
25
29
|
export declare const encodeRemoteSource: (source: RemoteSourceReference) => string;
|
|
30
|
+
/**
|
|
31
|
+
* A source's graph identity for dedup, visited sets, and layer ordering. It differs from
|
|
32
|
+
* {@link encodeRemoteSource} (the *checkout cache* key) in two deliberate ways:
|
|
33
|
+
*
|
|
34
|
+
* - It includes the canonicalized `path`, because two sources into different subpaths of one repo+ref
|
|
35
|
+
* are distinct layers — deduping them on the path-less cache key would silently drop one.
|
|
36
|
+
* - It keys on the *raw* normalized URI, credentials included, not the redacted cache key. Two entries
|
|
37
|
+
* for the same repo with different credentials are distinct configured sources; collapsing them
|
|
38
|
+
* (the cache key redacts credentials, so both share it) could drop a valid source for a broken one.
|
|
39
|
+
* This value is used only in ephemeral in-memory dedup/visited sets — never persisted or logged —
|
|
40
|
+
* so carrying credentials here is safe (the cache path and every user-facing display use the
|
|
41
|
+
* redacted forms).
|
|
42
|
+
*/
|
|
43
|
+
export declare const encodeRemoteSourceSelection: (source: RemoteSourceReference) => string;
|
|
26
44
|
/** Resolves the one cache root used by sync, settings, layer discovery, and setup bootstrap. */
|
|
27
45
|
export declare const resolveRemoteRepositoryCacheRoot: (homeDirectory: string, cacheDirectory?: string) => string;
|
|
28
46
|
export declare const createRemoteRepositoryCachePath: (homeDirectory: string, source: RemoteSourceReference, cacheDirectory?: string) => string;
|
|
47
|
+
/** The `.agents` payload root a source selects inside its materialized repository checkout. */
|
|
48
|
+
export declare const resolveSourcePayloadRoot: (repositoryPath: string, source: RemoteSourceReference) => string;
|
|
29
49
|
export declare const resolveRemoteRepositorySubpath: (repositoryPath: string, subpath?: string) => string;
|