@ai-outfitter/outfitter 1.0.2 → 1.1.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 +33 -23
- package/code/enterprise/cli/privateCatalogGate.cjs +3 -3
- package/code/pi-extension/src/outfitter-runtime-extension.js +45 -6
- package/dist/cli/OutfitterCli.js +4 -7
- package/dist/cli/OutfitterCli.js.map +1 -1
- package/dist/cli/commands/DumpCommand.js +8 -3
- package/dist/cli/commands/DumpCommand.js.map +1 -1
- package/dist/cli/commands/ListCommand.js +4 -3
- package/dist/cli/commands/ListCommand.js.map +1 -1
- package/dist/cli/commands/PiRuntimeLaunch.d.ts +14 -4
- package/dist/cli/commands/PiRuntimeLaunch.js +23 -27
- package/dist/cli/commands/PiRuntimeLaunch.js.map +1 -1
- package/dist/cli/commands/RunAgentCommand.js +8 -3
- package/dist/cli/commands/RunAgentCommand.js.map +1 -1
- package/dist/cli/commands/SetupCommand.d.ts +1 -1
- package/dist/cli/commands/SetupCommand.js +6 -13
- package/dist/cli/commands/SetupCommand.js.map +1 -1
- package/dist/cli/commands/SyncCommand.d.ts +31 -0
- package/dist/cli/commands/SyncCommand.js +162 -0
- package/dist/cli/commands/SyncCommand.js.map +1 -0
- package/dist/cli/commands/ValidateCommand.js +4 -2
- package/dist/cli/commands/ValidateCommand.js.map +1 -1
- package/dist/composer/Composer.js +1 -0
- package/dist/composer/Composer.js.map +1 -1
- package/dist/composer/Composition.d.ts +2 -0
- package/dist/paths/RepositoryAssets.d.ts +4 -0
- package/dist/paths/RepositoryAssets.js +26 -0
- package/dist/paths/RepositoryAssets.js.map +1 -0
- package/dist/resolver/AgentDefinition.d.ts +2 -0
- package/dist/resolver/AgentDefinition.js +2 -0
- package/dist/resolver/AgentDefinition.js.map +1 -1
- package/dist/resolver/Layer.d.ts +17 -1
- package/dist/resolver/Layer.js +23 -15
- package/dist/resolver/Layer.js.map +1 -1
- package/dist/resolver/ResolverContext.d.ts +2 -0
- package/dist/resolver/ResolverContext.js +7 -2
- package/dist/resolver/ResolverContext.js.map +1 -1
- package/dist/schemas/agent.schema.json +1 -0
- package/dist/settings/SettingsLoader.d.ts +12 -3
- package/dist/settings/SettingsLoader.js +25 -11
- package/dist/settings/SettingsLoader.js.map +1 -1
- package/dist/setup/DefaultCatalog.d.ts +2 -1
- package/dist/setup/DefaultCatalog.js +25 -50
- package/dist/setup/DefaultCatalog.js.map +1 -1
- package/dist/sources/GitRepository.d.ts +28 -0
- package/dist/sources/GitRepository.js +139 -0
- package/dist/sources/GitRepository.js.map +1 -0
- package/dist/sources/PrivateCatalogGate.d.ts +27 -0
- package/dist/sources/PrivateCatalogGate.js +23 -0
- package/dist/sources/PrivateCatalogGate.js.map +1 -0
- package/dist/sources/SourceCache.d.ts +11 -1
- package/dist/sources/SourceCache.js +11 -2
- package/dist/sources/SourceCache.js.map +1 -1
- package/dist/version/OutfitterVersion.d.ts +1 -0
- package/dist/version/OutfitterVersion.js +8 -0
- package/dist/version/OutfitterVersion.js.map +1 -0
- package/docs/documentation/README.md +46 -31
- package/docs/documentation/actions.md +3 -1
- package/docs/documentation/agents.md +5 -0
- package/docs/documentation/catalogs.md +10 -2
- package/docs/documentation/cli.md +11 -3
- package/docs/documentation/concepts.md +6 -6
- package/docs/documentation/conventions.md +55 -0
- package/docs/documentation/in-cluster.md +35 -0
- package/docs/documentation/recurring-runs.md +27 -0
- package/docs/documentation/settings.md +4 -2
- package/docs/documentation/subagents.md +16 -5
- package/docs/documentation/usecases/flaky-test-postmortems.md +20 -0
- package/docs/documentation/usecases/grafana-alert-investigator.md +18 -0
- package/docs/documentation/usecases/resident-agents.md +36 -0
- package/docs/documentation/usecases/self-improving-skills.md +19 -0
- package/docs/documentation/usecases/shared-conventions.md +47 -0
- package/package.json +1 -1
- package/src/schemas/agent.schema.json +1 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type GitHubRepositoryVisibilityClassifier, type PrivateCatalogPrompt, type PrivateCatalogSourceGate } from '../../sources/PrivateCatalogGate.js';
|
|
2
|
+
import type { CommandObject } from './CommandObject.js';
|
|
3
|
+
export type SyncStatus = 'updated' | 'unchanged' | 'skipped' | 'failed';
|
|
4
|
+
export type SyncSourceKind = 'remote_settings' | 'source';
|
|
5
|
+
export interface SyncSourceResult {
|
|
6
|
+
readonly kind: SyncSourceKind;
|
|
7
|
+
readonly uri: string;
|
|
8
|
+
readonly cachePath: string;
|
|
9
|
+
readonly status: SyncStatus;
|
|
10
|
+
readonly message?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface SyncCommandResult {
|
|
13
|
+
readonly exitCode: number;
|
|
14
|
+
readonly messages: readonly string[];
|
|
15
|
+
readonly results: readonly SyncSourceResult[];
|
|
16
|
+
}
|
|
17
|
+
export interface SyncCommandInput {
|
|
18
|
+
readonly homeDirectory: string;
|
|
19
|
+
readonly projectDirectory: string;
|
|
20
|
+
}
|
|
21
|
+
export interface SyncCommandDependencies {
|
|
22
|
+
readonly homeDirectory?: string;
|
|
23
|
+
readonly projectDirectory?: string;
|
|
24
|
+
readonly classifier?: GitHubRepositoryVisibilityClassifier;
|
|
25
|
+
readonly prompt?: PrivateCatalogPrompt;
|
|
26
|
+
readonly privateCatalogGate?: PrivateCatalogSourceGate;
|
|
27
|
+
readonly writeLine?: (message: string) => void;
|
|
28
|
+
}
|
|
29
|
+
/** Validates local settings, syncs remote settings, reloads, then syncs resulting remote sources. */
|
|
30
|
+
export declare const executeSyncCommand: (input: SyncCommandInput, dependencies?: Pick<SyncCommandDependencies, "classifier" | "prompt" | "privateCatalogGate">) => SyncCommandResult;
|
|
31
|
+
export declare const createSyncCommand: (dependencies?: SyncCommandDependencies) => CommandObject;
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
// Implements deterministic remote-settings-first source synchronization.
|
|
2
|
+
import { existsSync } from 'node:fs';
|
|
3
|
+
import { Command } from 'commander';
|
|
4
|
+
import { remoteSourceLayer } from '../../resolver/Layer.js';
|
|
5
|
+
import { resolveResources } from '../../resolver/Resolver.js';
|
|
6
|
+
import { validateEffectiveSet } from '../../resolver/ResolverValidation.js';
|
|
7
|
+
import { createSettingsLoadPlan, discoverSettingsLoadPlan, formatSettingsIssue, loadSettings, loadSettingsFiles, loadSettingsWithCachedRemoteSettings, resolveRemoteSettingsPath, } from '../../settings/SettingsLoader.js';
|
|
8
|
+
import { syncRemoteRepositoryAtomically } from '../../sources/GitRepository.js';
|
|
9
|
+
import { createEnterprisePrivateCatalogGate, } from '../../sources/PrivateCatalogGate.js';
|
|
10
|
+
import { createRemoteRepositoryCachePath, formatRemoteSourceDisplay, isRemoteSource, redactEmbeddedSourceCredentials, } from '../../sources/SourceCache.js';
|
|
11
|
+
import { resolveHomeDirectory, resolveProjectDirectory } from './ProcessDefaults.js';
|
|
12
|
+
const formatSettingsIssues = (heading, issues) => [
|
|
13
|
+
heading,
|
|
14
|
+
...issues.map((issue) => `failed: ${formatSettingsIssue(issue)}`),
|
|
15
|
+
];
|
|
16
|
+
const formatResult = (result) => `${result.status}: ${result.kind} ${result.uri} -> ${result.cachePath}${result.message === undefined ? '' : ` (${result.message})`}`;
|
|
17
|
+
const formatCaughtError = (error) => {
|
|
18
|
+
/* v8 ignore else -- repository synchronization throws Error instances. */
|
|
19
|
+
if (error instanceof Error)
|
|
20
|
+
return error.message;
|
|
21
|
+
return String(error);
|
|
22
|
+
};
|
|
23
|
+
const validateRemoteSettingsCheckout = (repositoryPath, source) => {
|
|
24
|
+
const settingsPath = resolveRemoteSettingsPath(repositoryPath, source.path);
|
|
25
|
+
if (!existsSync(settingsPath)) {
|
|
26
|
+
throw new Error(`Remote settings file '${source.path}' was not found in the fetched repository.`);
|
|
27
|
+
}
|
|
28
|
+
const loaded = loadSettingsFiles(createSettingsLoadPlan([{ scope: 'remote', path: settingsPath }]));
|
|
29
|
+
if (loaded.issues.length > 0) {
|
|
30
|
+
throw new Error(`Fetched remote settings are invalid: ${loaded.issues.map(formatSettingsIssue).join('; ')}`);
|
|
31
|
+
}
|
|
32
|
+
return 0;
|
|
33
|
+
};
|
|
34
|
+
const validateSourceCheckout = (repositoryPath, source) => {
|
|
35
|
+
const layer = remoteSourceLayer(repositoryPath, source);
|
|
36
|
+
if (!existsSync(layer.root)) {
|
|
37
|
+
throw new Error(`Configured source path '${source.path}' was not found in the fetched repository.`);
|
|
38
|
+
}
|
|
39
|
+
const findings = validateEffectiveSet(resolveResources([layer]));
|
|
40
|
+
const errors = findings.filter((finding) => finding.severity === 'error');
|
|
41
|
+
if (errors.length > 0) {
|
|
42
|
+
throw new Error(`Fetched source is invalid: ${errors.map((finding) => `${finding.resource} ${finding.message}`).join('; ')}`);
|
|
43
|
+
}
|
|
44
|
+
return findings.length;
|
|
45
|
+
};
|
|
46
|
+
/** Runs the private-catalog gate over one phase's sources, then fetches everything it allowed. */
|
|
47
|
+
const syncPhase = (input) => {
|
|
48
|
+
const gated = input.gate.filter(input.sources, input.cacheDirectory);
|
|
49
|
+
const synced = gated.allowedSources.map((source) => {
|
|
50
|
+
const cachePath = createRemoteRepositoryCachePath(input.homeDirectory, source, input.cacheDirectory);
|
|
51
|
+
const uri = formatRemoteSourceDisplay(source);
|
|
52
|
+
try {
|
|
53
|
+
const result = syncRemoteRepositoryAtomically({
|
|
54
|
+
cachePath,
|
|
55
|
+
source,
|
|
56
|
+
validate: (repositoryPath) => input.validate(repositoryPath, source),
|
|
57
|
+
});
|
|
58
|
+
return {
|
|
59
|
+
kind: input.kind,
|
|
60
|
+
uri,
|
|
61
|
+
cachePath,
|
|
62
|
+
status: result.status,
|
|
63
|
+
message: result.warnings === 0 ? undefined : `validated with ${result.warnings} warning(s)`,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
catch (error) {
|
|
67
|
+
return {
|
|
68
|
+
kind: input.kind,
|
|
69
|
+
uri,
|
|
70
|
+
cachePath,
|
|
71
|
+
status: 'failed',
|
|
72
|
+
message: redactEmbeddedSourceCredentials(formatCaughtError(error)),
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
return {
|
|
77
|
+
allowedSources: gated.allowedSources,
|
|
78
|
+
messages: gated.messages,
|
|
79
|
+
results: [...gated.skippedResults.map((result) => ({ ...result, kind: input.kind })), ...synced],
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
const finishSync = (mergedIssues, remoteSettingsPhase, sourcePhase) => {
|
|
83
|
+
const results = [...remoteSettingsPhase.results, ...sourcePhase.results];
|
|
84
|
+
const settingsMessages = mergedIssues.length === 0
|
|
85
|
+
? []
|
|
86
|
+
: formatSettingsIssues('Merged settings contain errors after remote-settings synchronization.', mergedIssues);
|
|
87
|
+
const messages = [
|
|
88
|
+
...remoteSettingsPhase.messages,
|
|
89
|
+
...remoteSettingsPhase.results.map(formatResult),
|
|
90
|
+
...settingsMessages,
|
|
91
|
+
...sourcePhase.messages,
|
|
92
|
+
...sourcePhase.results.map(formatResult),
|
|
93
|
+
];
|
|
94
|
+
if (results.length === 0 && mergedIssues.length === 0) {
|
|
95
|
+
messages.push('No remote sources are configured.');
|
|
96
|
+
}
|
|
97
|
+
return {
|
|
98
|
+
exitCode: mergedIssues.length > 0 || results.some((result) => result.status === 'failed') ? 1 : 0,
|
|
99
|
+
messages,
|
|
100
|
+
results,
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
/** Validates local settings, syncs remote settings, reloads, then syncs resulting remote sources. */
|
|
104
|
+
export const executeSyncCommand = (input, dependencies = {}) => {
|
|
105
|
+
const local = loadSettings(discoverSettingsLoadPlan(input));
|
|
106
|
+
if (local.issues.length > 0) {
|
|
107
|
+
return {
|
|
108
|
+
exitCode: 1,
|
|
109
|
+
messages: formatSettingsIssues('Local settings are invalid; no sources were synchronized.', local.issues),
|
|
110
|
+
results: [],
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
const gate = dependencies.privateCatalogGate ??
|
|
114
|
+
createEnterprisePrivateCatalogGate({
|
|
115
|
+
homeDirectory: input.homeDirectory,
|
|
116
|
+
classifier: dependencies.classifier,
|
|
117
|
+
prompt: dependencies.prompt,
|
|
118
|
+
});
|
|
119
|
+
const remoteSettingsPhase = syncPhase({
|
|
120
|
+
kind: 'remote_settings',
|
|
121
|
+
sources: local.settings.remoteSettings,
|
|
122
|
+
homeDirectory: input.homeDirectory,
|
|
123
|
+
cacheDirectory: local.settings.cacheDirectory,
|
|
124
|
+
gate,
|
|
125
|
+
validate: validateRemoteSettingsCheckout,
|
|
126
|
+
});
|
|
127
|
+
const merged = loadSettingsWithCachedRemoteSettings(input, {
|
|
128
|
+
remoteSettingsReferences: remoteSettingsPhase.allowedSources,
|
|
129
|
+
localSettings: local,
|
|
130
|
+
});
|
|
131
|
+
const sourcePhase = syncPhase({
|
|
132
|
+
kind: 'source',
|
|
133
|
+
sources: merged.settings.sources.filter(isRemoteSource),
|
|
134
|
+
homeDirectory: input.homeDirectory,
|
|
135
|
+
cacheDirectory: merged.settings.cacheDirectory,
|
|
136
|
+
gate,
|
|
137
|
+
validate: validateSourceCheckout,
|
|
138
|
+
});
|
|
139
|
+
return finishSync(merged.issues, remoteSettingsPhase, sourcePhase);
|
|
140
|
+
};
|
|
141
|
+
export const createSyncCommand = (dependencies = {}) => ({
|
|
142
|
+
name: 'sync',
|
|
143
|
+
description: 'Synchronize configured remote settings and sources into the local cache.',
|
|
144
|
+
register(program) {
|
|
145
|
+
program.addCommand(new Command('sync')
|
|
146
|
+
.description('Synchronize configured remote settings and sources into the local cache.')
|
|
147
|
+
.action(() => {
|
|
148
|
+
const result = executeSyncCommand({
|
|
149
|
+
homeDirectory: resolveHomeDirectory(dependencies.homeDirectory),
|
|
150
|
+
projectDirectory: resolveProjectDirectory(dependencies.projectDirectory),
|
|
151
|
+
}, dependencies);
|
|
152
|
+
for (const message of result.messages) {
|
|
153
|
+
/* v8 ignore next -- console fallback is direct CLI behavior; tests inject a writer. */
|
|
154
|
+
(dependencies.writeLine ?? console.log)(message);
|
|
155
|
+
}
|
|
156
|
+
/* v8 ignore next -- process exit wiring is covered by CLI smoke behavior. */
|
|
157
|
+
if (result.exitCode !== 0)
|
|
158
|
+
process.exitCode = result.exitCode;
|
|
159
|
+
}));
|
|
160
|
+
},
|
|
161
|
+
});
|
|
162
|
+
//# sourceMappingURL=SyncCommand.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SyncCommand.js","sourceRoot":"","sources":["../../../src/cli/commands/SyncCommand.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAC5E,OAAO,EACL,sBAAsB,EACtB,wBAAwB,EACxB,mBAAmB,EACnB,YAAY,EACZ,iBAAiB,EACjB,oCAAoC,EACpC,yBAAyB,GAC1B,MAAM,kCAAkC,CAAC;AAG1C,OAAO,EAAE,8BAA8B,EAAE,MAAM,gCAAgC,CAAC;AAChF,OAAO,EACL,kCAAkC,GAInC,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EACL,+BAA+B,EAC/B,yBAAyB,EACzB,cAAc,EACd,+BAA+B,GAChC,MAAM,8BAA8B,CAAC;AAGtC,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAuCrF,MAAM,oBAAoB,GAAG,CAAC,OAAe,EAAE,MAAoC,EAAqB,EAAE,CAAC;IACzG,OAAO;IACP,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,WAAW,mBAAmB,CAAC,KAAK,CAAC,EAAE,CAAC;CAClE,CAAC;AAEF,MAAM,YAAY,GAAG,CAAC,MAAwB,EAAU,EAAE,CACxD,GAAG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CACb,CAAC;YACF,KAAK,MAAM,OAAO,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;gBACtC,uFAAuF;gBACvF,CAAC,YAAY,CAAC,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC;YACnD,CAAC;YACD,6EAA6E;YAC7E,IAAI,MAAM,CAAC,QAAQ,KAAK,CAAC;gBAAE,OAAO,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;QAChE,CAAC,CAAC,CACL,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
import { Command } from 'commander';
|
|
3
3
|
import { resolveEffectiveSet } from '../../resolver/ResolverContext.js';
|
|
4
4
|
import { validateEffectiveSet } from '../../resolver/ResolverValidation.js';
|
|
5
|
+
import { formatSettingsIssue } from '../../settings/SettingsLoader.js';
|
|
5
6
|
import { resolveHomeDirectory, resolveProjectDirectory } from './ProcessDefaults.js';
|
|
6
7
|
const settingsFindings = (messages) => messages.map((message) => ({ severity: 'error', resource: 'settings', message }));
|
|
7
8
|
export const executeValidateCommand = (input) => {
|
|
8
|
-
const { set, settingsIssues } = resolveEffectiveSet(input);
|
|
9
|
+
const { set, settingsIssues, warnings } = resolveEffectiveSet(input);
|
|
9
10
|
const findings = [
|
|
10
|
-
...settingsFindings(settingsIssues.map(
|
|
11
|
+
...settingsFindings(settingsIssues.map(formatSettingsIssue)),
|
|
12
|
+
...warnings.map((message) => ({ severity: 'warning', resource: 'settings', message })),
|
|
11
13
|
...validateEffectiveSet(set),
|
|
12
14
|
];
|
|
13
15
|
const hasErrors = findings.some((finding) => finding.severity === 'error');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ValidateCommand.js","sourceRoot":"","sources":["../../../src/cli/commands/ValidateCommand.ts"],"names":[],"mappings":"AAAA,qFAAqF;AAErF,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAA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AChB,WAAW,EAAE,4EAA4E;IACzF,QAAQ,CAAC,OAAgB;QACvB,OAAO,CAAC,UAAU,CAChB,IAAI,OAAO,CAAC,UAAU,CAAC;aACpB,WAAW,CAAC,4EAA4E,CAAC;aACzF,MAAM,CAAC,UAAU,EAAE,4DAA4D,CAAC;aAChF,MAAM,CAAC,QAAQ,EAAE,wBAAwB,CAAC;aAC1C,MAAM,CAAC,CAAC,OAA6C,EAAE,EAAE;YACxD,+FAA+F;YAC/F,MAAM,aAAa,GAAG,oBAAoB,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC;YACvE,MAAM,gBAAgB,GAAG,uBAAuB,CAAC,YAAY,CAAC,gBAAgB,CAAC,CAAC;YAChF,MAAM,MAAM,GAAG,sBAAsB,CAAC;gBACpC,aAAa;gBACb,gBAAgB;gBAChB,MAAM,EAAE,OAAO,CAAC,MAAM;gBACtB,IAAI,EAAE,OAAO,CAAC,IAAI;aACnB,CAAC,CAAC;YAEH,KAAK,MAAM,OAAO,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;gBACtC,uFAAuF;gBACvF,CAAC,YAAY,CAAC,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC;YACnD,CAAC;YAED,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;gBACf,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;YACvB,CAAC;QACH,CAAC,CAAC,CACL,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -62,6 +62,7 @@ export const compose = (set, agentSlug) => {
|
|
|
62
62
|
systemPrompt: readRootFile(set, 'system-prompt.md'),
|
|
63
63
|
sharedContext: readRootFile(set, 'agents.md'),
|
|
64
64
|
agentBody: definition.body,
|
|
65
|
+
label: definition.label,
|
|
65
66
|
description: definition.description,
|
|
66
67
|
},
|
|
67
68
|
loadout: composeLoadout(set, agentSlug, definition.loadout, warnings),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version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AO,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;AAC9B,CAAC,CAAC"}
|
|
@@ -7,6 +7,8 @@ export interface ComposedIdentity {
|
|
|
7
7
|
readonly sharedContext?: string;
|
|
8
8
|
/** The selected agent's `agent.md` markdown body. */
|
|
9
9
|
readonly agentBody: string;
|
|
10
|
+
/** Human-readable profile name for interactive harness UI. */
|
|
11
|
+
readonly label?: string;
|
|
10
12
|
readonly description?: string;
|
|
11
13
|
}
|
|
12
14
|
/** A loadout with its slug references resolved against the effective set. */
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Resolves a `code/`-relative asset path, or undefined when neither layout provides it. */
|
|
2
|
+
export declare const findRepositoryCodeAsset: (relativePath: string) => string | undefined;
|
|
3
|
+
export declare const resolveRepositoryCodeAsset: (relativePath: string) => string;
|
|
4
|
+
export declare const readRepositoryCodeAsset: (relativePath: string) => string;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// Resolves support files shipped from the repository's `code/` tree. They live at `code/<asset>` in
|
|
2
|
+
// the repository layout and at `code/cli/code/<asset>` in the packaged npm layout; both relative
|
|
3
|
+
// depths are encoded here only, so a packaging change is a one-file edit.
|
|
4
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
5
|
+
import { fileURLToPath } from 'node:url';
|
|
6
|
+
/** Resolves a `code/`-relative asset path, or undefined when neither layout provides it. */
|
|
7
|
+
export const findRepositoryCodeAsset = (relativePath) => {
|
|
8
|
+
const sourcePath = fileURLToPath(new URL(`../../../${relativePath}`, import.meta.url));
|
|
9
|
+
const packagePath = fileURLToPath(new URL(`../../code/${relativePath}`, import.meta.url));
|
|
10
|
+
/* v8 ignore else -- packaged layout is exercised by the npm package smoke test. */
|
|
11
|
+
if (existsSync(sourcePath))
|
|
12
|
+
return sourcePath;
|
|
13
|
+
/* v8 ignore next 3 -- packaged layout is covered by the package smoke test. */
|
|
14
|
+
if (existsSync(packagePath))
|
|
15
|
+
return packagePath;
|
|
16
|
+
return undefined;
|
|
17
|
+
};
|
|
18
|
+
export const resolveRepositoryCodeAsset = (relativePath) => {
|
|
19
|
+
const path = findRepositoryCodeAsset(relativePath);
|
|
20
|
+
/* v8 ignore next -- support files ship with the package, so they always resolve in practice. */
|
|
21
|
+
if (path === undefined)
|
|
22
|
+
throw new Error(`Outfitter support file '${relativePath}' was not found.`);
|
|
23
|
+
return path;
|
|
24
|
+
};
|
|
25
|
+
export const readRepositoryCodeAsset = (relativePath) => readFileSync(resolveRepositoryCodeAsset(relativePath), 'utf8');
|
|
26
|
+
//# sourceMappingURL=RepositoryAssets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RepositoryAssets.js","sourceRoot":"","sources":["../../src/paths/RepositoryAssets.ts"],"names":[],"mappings":"AAAA,oGAAoG;AACpG,iGAAiG;AACjG,0EAA0E;AAC1E,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,4FAA4F;AAC5F,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,YAAoB,EAAsB,EAAE;IAClF,MAAM,UAAU,GAAG,aAAa,CAAC,IAAI,GAAG,CAAC,YAAY,YAAY,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IACvF,MAAM,WAAW,GAAG,aAAa,CAAC,IAAI,GAAG,CAAC,cAAc,YAAY,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IAE1F,mFAAmF;IACnF,IAAI,UAAU,CAAC,UAAU,CAAC;QAAE,OAAO,UAAU,CAAC;IAC9C,+EAA+E;IAC/E,IAAI,UAAU,CAAC,WAAW,CAAC;QAAE,OAAO,WAAW,CAAC;IAChD,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,YAAoB,EAAU,EAAE;IACzE,MAAM,IAAI,GAAG,uBAAuB,CAAC,YAAY,CAAC,CAAC;IACnD,gGAAgG;IAChG,IAAI,IAAI,KAAK,SAAS;QAAE,MAAM,IAAI,KAAK,CAAC,2BAA2B,YAAY,kBAAkB,CAAC,CAAC;IACnG,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,YAAoB,EAAU,EAAE,CACtE,YAAY,CAAC,0BAA0B,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC,CAAC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { Loadout } from './Resource.js';
|
|
2
2
|
export interface AgentDefinition {
|
|
3
3
|
readonly name: string;
|
|
4
|
+
/** Human-readable profile name shown in interactive harness UI. */
|
|
5
|
+
readonly label?: string;
|
|
4
6
|
readonly description?: string;
|
|
5
7
|
/** Markdown body after the frontmatter — the agent's identity prose. */
|
|
6
8
|
readonly body: string;
|
|
@@ -37,6 +37,7 @@ export const splitFrontmatter = (content) => {
|
|
|
37
37
|
};
|
|
38
38
|
const asStringArray = (value) => Array.isArray(value) ? value.filter((entry) => typeof entry === 'string') : [];
|
|
39
39
|
const asString = (value) => (typeof value === 'string' ? value : undefined);
|
|
40
|
+
const readMarkdownHeading = (body) => /^#\s+(.+)$/mu.exec(body)?.[1]?.trim();
|
|
40
41
|
const loadoutFromRecord = (record) => {
|
|
41
42
|
const tools = record.tools;
|
|
42
43
|
return {
|
|
@@ -105,6 +106,7 @@ export const parseAgentDefinition = (content, configPaths, agentPath) => {
|
|
|
105
106
|
}
|
|
106
107
|
return {
|
|
107
108
|
name: frontmatter.record.name,
|
|
109
|
+
label: asString(frontmatter.record.label)?.trim() || readMarkdownHeading(frontmatter.body),
|
|
108
110
|
description: asString(frontmatter.record.description),
|
|
109
111
|
body: frontmatter.body,
|
|
110
112
|
loadout: loadoutFromRecord(merged),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgentDefinition.js","sourceRoot":"","sources":["../../src/resolver/AgentDefinition.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAChG,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAElE,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"AgentDefinition.js","sourceRoot":"","sources":["../../src/resolver/AgentDefinition.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAChG,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAElE,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAiB7C,MAAM,CAAC,MAAM,sBAAsB,GAAG,CACpC,KAA+B,EACA,EAAE,CAAC,SAAS,IAAI,KAAK,CAAC;AAEvD,0GAA0G;AAC1G,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,QAAQ;IACR,WAAW;IACX,KAAK;IACL,YAAY;IACZ,SAAS;IACT,OAAO;IACP,UAAU;IACV,OAAO;CACC,CAAC;AAEX,0FAA0F;AAC1F,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,MAAyC,EAA2B,EAAE,CACpG,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,IAAI,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AAOlG,oEAAoE;AACpE,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,OAAe,EAAgC,EAAE;IAChF,MAAM,KAA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AC;IAC5C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,4BAA4B,MAAM,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC;IACnF,CAAC;IAED,OAAO,oBAAoB,CAAC,OAAO,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC;AAC/D,CAAC,CAAC"}
|
package/dist/resolver/Layer.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { RemoteSourceReference } from '../sources/SourceCache.js';
|
|
1
2
|
import type { Settings } from '../settings/Settings.js';
|
|
2
3
|
import type { Layer } from './Resource.js';
|
|
3
4
|
export interface LayerDiscoveryInput {
|
|
@@ -5,8 +6,23 @@ export interface LayerDiscoveryInput {
|
|
|
5
6
|
readonly projectDirectory: string;
|
|
6
7
|
readonly settings: Settings;
|
|
7
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* Maps an already-materialized repository checkout to the layer `outfitter run` would resolve from
|
|
11
|
+
* it. `outfitter sync` reuses this against its temporary checkout so both agree on the payload root.
|
|
12
|
+
*/
|
|
13
|
+
export declare const remoteSourceLayer: (repositoryPath: string, source: RemoteSourceReference) => Layer;
|
|
14
|
+
export interface LayerDiscoveryResult {
|
|
15
|
+
readonly layers: readonly Layer[];
|
|
16
|
+
/**
|
|
17
|
+
* Configured remote sources whose cache is absent, reported with `outfitter sync` guidance rather
|
|
18
|
+
* than silently dropped (OFTR-004.2.18). Reported, never fatal: a private catalog the enterprise
|
|
19
|
+
* gate skips is never cached, so `outfitter sync` skips it again and exits 0 — aborting here
|
|
20
|
+
* would deadlock every other command behind advice the user cannot act on (OFTR-004.2.15).
|
|
21
|
+
*/
|
|
22
|
+
readonly unsynchronized: readonly string[];
|
|
23
|
+
}
|
|
8
24
|
/**
|
|
9
25
|
* Orders layers highest precedence first: workspace `.agents`, then global `~/.agents`,
|
|
10
26
|
* then configured sources in order. Only layers whose root exists on disk are included.
|
|
11
27
|
*/
|
|
12
|
-
export declare const discoverLayers: (input: LayerDiscoveryInput) =>
|
|
28
|
+
export declare const discoverLayers: (input: LayerDiscoveryInput) => LayerDiscoveryResult;
|
package/dist/resolver/Layer.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
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 {
|
|
4
|
+
import { createRemoteRepositoryCachePath, formatRemoteSourceDisplay, isRemoteSource, resolveRemoteRepositorySubpath, } from '../sources/SourceCache.js';
|
|
5
5
|
const agentsRoot = (directory) => join(directory, '.agents');
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
};
|
|
6
|
+
/**
|
|
7
|
+
* Maps an already-materialized repository checkout to the layer `outfitter run` would resolve from
|
|
8
|
+
* it. `outfitter sync` reuses this against its temporary checkout so both agree on the payload root.
|
|
9
|
+
*/
|
|
10
|
+
export const remoteSourceLayer = (repositoryPath, source) => ({
|
|
11
|
+
root: source.path === undefined ? repositoryPath : resolveRemoteRepositorySubpath(repositoryPath, source.path),
|
|
12
|
+
origin: 'source',
|
|
13
|
+
label: formatRemoteSourceDisplay(source),
|
|
14
|
+
});
|
|
15
|
+
const sourceLayer = (input, source) => isRemoteSource(source)
|
|
16
|
+
? remoteSourceLayer(createRemoteRepositoryCachePath(input.homeDirectory, source, input.settings.cacheDirectory), source)
|
|
17
|
+
: { root: source.path, origin: 'source', label: source.path };
|
|
18
18
|
/**
|
|
19
19
|
* Orders layers highest precedence first: workspace `.agents`, then global `~/.agents`,
|
|
20
20
|
* then configured sources in order. Only layers whose root exists on disk are included.
|
|
@@ -23,8 +23,16 @@ export const discoverLayers = (input) => {
|
|
|
23
23
|
const candidates = [
|
|
24
24
|
{ root: agentsRoot(input.projectDirectory), origin: 'workspace', label: 'workspace' },
|
|
25
25
|
{ root: agentsRoot(input.homeDirectory), origin: 'global', label: 'global' },
|
|
26
|
-
...(input.settings.sources ?? []).map((source) => sourceLayer(input, source)),
|
|
27
26
|
];
|
|
28
|
-
|
|
27
|
+
const unsynchronized = [];
|
|
28
|
+
for (const source of input.settings.sources ?? []) {
|
|
29
|
+
const layer = sourceLayer(input, source);
|
|
30
|
+
if (isRemoteSource(source) && !existsSync(layer.root)) {
|
|
31
|
+
unsynchronized.push(`Configured remote source '${layer.label}' is not synchronized at '${layer.root}'. Run 'outfitter sync' to fetch it.`);
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
candidates.push(layer);
|
|
35
|
+
}
|
|
36
|
+
return { layers: candidates.filter((layer) => existsSync(layer.root)), unsynchronized };
|
|
29
37
|
};
|
|
30
38
|
//# 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,
|
|
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,8BAA8B,GAC/B,MAAM,2BAA2B,CAAC;AAWnC,MAAM,UAAU,GAAG,CAAC,SAAiB,EAAU,EAAE,CAAC,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;AAE7E;;;GAGG;AACH,MAAM,CAAC,MAAM,iBA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AAU,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;YACtD,cAAc,CAAC,IAAI,CACjB,6BAA6B,KAAK,CAAC,KAAK,6BAA6B,KAAK,CAAC,IAAI,sCAAsC,CACtH,CAAC;YACF,SAAS;QACX,CAAC;QACD,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACzB,CAAC;IAED,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,EAAE,cAAc,EAAE,CAAC;AAC1F,CAAC,CAAC"}
|
|
@@ -10,6 +10,8 @@ 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 `outfitter sync` guidance for configured remote sources with no cache. */
|
|
14
|
+
readonly warnings: readonly string[];
|
|
13
15
|
}
|
|
14
16
|
/** The single shared resolution path used by list, validate, run, and dump. */
|
|
15
17
|
export declare const resolveEffectiveSet: (input: ResolveInput) => ResolveResult;
|
|
@@ -5,7 +5,12 @@ import { resolveResources } from './Resolver.js';
|
|
|
5
5
|
/** The single shared resolution path used by list, validate, run, and dump. */
|
|
6
6
|
export const resolveEffectiveSet = (input) => {
|
|
7
7
|
const loadedSettings = loadSettingsWithCachedRemoteSettings(input);
|
|
8
|
-
const
|
|
9
|
-
return {
|
|
8
|
+
const discovered = discoverLayers({ ...input, settings: loadedSettings.settings });
|
|
9
|
+
return {
|
|
10
|
+
set: resolveResources(discovered.layers),
|
|
11
|
+
settings: loadedSettings.settings,
|
|
12
|
+
settingsIssues: loadedSettings.issues,
|
|
13
|
+
warnings: discovered.unsynchronized,
|
|
14
|
+
};
|
|
10
15
|
};
|
|
11
16
|
//# 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,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAgBjD,+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;IAEnF,OAAO;QACL,GAAG,EAAE,gBAAgB,CAAC,UAAU,CAAC,MAAM,CAAC;QACxC,QAAQ,EAAE,cAAc,CAAC,QAAQ;QACjC,cAAc,EAAE,cAAc,CAAC,MAAM;QACrC,QAAQ,EAAE,UAAU,CAAC,cAAc;KACpC,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -26,9 +26,18 @@ export interface SettingsDiscoveryInput {
|
|
|
26
26
|
readonly projectDirectory: string;
|
|
27
27
|
}
|
|
28
28
|
export declare const createSettingsLoadPlan: (locations: readonly SettingsLocation[]) => SettingsLoadPlan;
|
|
29
|
+
/** The one rendering of a settings issue every command reports. */
|
|
30
|
+
export declare const formatSettingsIssue: (issue: SettingsLoadIssue) => string;
|
|
29
31
|
export declare const discoverSettingsLoadPlan: (input: SettingsDiscoveryInput) => SettingsLoadPlan;
|
|
30
|
-
export declare const discoverRemoteSettingsLoadPlan: (homeDirectory: string, remoteSettings: readonly RemoteSettingsReference[]) => SettingsLoadPlan;
|
|
31
|
-
export declare const resolveCachedRemoteSettingsPath: (homeDirectory: string, source: RemoteSettingsReference) => string;
|
|
32
|
+
export declare const discoverRemoteSettingsLoadPlan: (homeDirectory: string, remoteSettings: readonly RemoteSettingsReference[], cacheDirectory?: string) => SettingsLoadPlan;
|
|
33
|
+
export declare const resolveCachedRemoteSettingsPath: (homeDirectory: string, source: RemoteSettingsReference, cacheDirectory?: string) => string;
|
|
34
|
+
export declare const resolveRemoteSettingsPath: (repositoryPath: string, path: string) => string;
|
|
32
35
|
export declare const loadSettingsFiles: (plan: SettingsLoadPlan) => SettingsLoadResult;
|
|
33
36
|
export declare const loadSettings: (plan: SettingsLoadPlan) => LoadedSettings;
|
|
34
|
-
export
|
|
37
|
+
export interface CachedRemoteSettingsOptions {
|
|
38
|
+
/** Remote settings to fold in instead of the ones the local settings declare. */
|
|
39
|
+
readonly remoteSettingsReferences?: readonly RemoteSettingsReference[];
|
|
40
|
+
/** An already-loaded local stack, so callers that just read it do not parse every file twice. */
|
|
41
|
+
readonly localSettings?: LoadedSettings;
|
|
42
|
+
}
|
|
43
|
+
export declare const loadSettingsWithCachedRemoteSettings: (input: SettingsDiscoveryInput, options?: CachedRemoteSettingsOptions) => LoadedSettings;
|
|
@@ -8,6 +8,8 @@ import { mergeSettingsStack } from './SettingsMerger.js';
|
|
|
8
8
|
export const createSettingsLoadPlan = (locations) => ({
|
|
9
9
|
locations,
|
|
10
10
|
});
|
|
11
|
+
/** The one rendering of a settings issue every command reports. */
|
|
12
|
+
export const formatSettingsIssue = (issue) => `${issue.filePath}#${issue.path} ${issue.message}`;
|
|
11
13
|
const agentsSettings = (directory, ...rest) => join(directory, '.agents', ...rest);
|
|
12
14
|
// Ordered lowest-to-highest precedence so later files fold over earlier ones during merge.
|
|
13
15
|
export const discoverSettingsLoadPlan = (input) => createSettingsLoadPlan([
|
|
@@ -16,11 +18,14 @@ export const discoverSettingsLoadPlan = (input) => createSettingsLoadPlan([
|
|
|
16
18
|
{ scope: 'project', path: agentsSettings(input.projectDirectory, 'settings.yml') },
|
|
17
19
|
{ scope: 'project-local', path: agentsSettings(input.projectDirectory, 'settings.local.yml') },
|
|
18
20
|
]);
|
|
19
|
-
export const discoverRemoteSettingsLoadPlan = (homeDirectory, remoteSettings) => discoverRemoteSettingsLocations(homeDirectory, remoteSettings).plan;
|
|
20
|
-
export const resolveCachedRemoteSettingsPath = (homeDirectory, source) => {
|
|
21
|
-
const repositoryPath = createRemoteRepositoryCachePath(homeDirectory, source);
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
export const discoverRemoteSettingsLoadPlan = (homeDirectory, remoteSettings, cacheDirectory) => discoverRemoteSettingsLocations(homeDirectory, remoteSettings, cacheDirectory).plan;
|
|
22
|
+
export const resolveCachedRemoteSettingsPath = (homeDirectory, source, cacheDirectory) => {
|
|
23
|
+
const repositoryPath = createRemoteRepositoryCachePath(homeDirectory, source, cacheDirectory);
|
|
24
|
+
return resolveRemoteSettingsPath(repositoryPath, source.path);
|
|
25
|
+
};
|
|
26
|
+
export const resolveRemoteSettingsPath = (repositoryPath, path) => {
|
|
27
|
+
const configuredPath = resolveRemoteRepositorySubpath(repositoryPath, path);
|
|
28
|
+
if (existsSync(configuredPath) || path !== 'settings.yml') {
|
|
24
29
|
return configuredPath;
|
|
25
30
|
}
|
|
26
31
|
const nestedAgentsSettingsPath = resolveRemoteRepositorySubpath(repositoryPath, '.agents/settings.yml');
|
|
@@ -43,13 +48,13 @@ export const loadSettings = (plan) => {
|
|
|
43
48
|
settings: mergeSettingsStack(result.files.map((file) => file.settings)),
|
|
44
49
|
};
|
|
45
50
|
};
|
|
46
|
-
export const loadSettingsWithCachedRemoteSettings = (input,
|
|
47
|
-
const localSettings = loadSettings(discoverSettingsLoadPlan(input));
|
|
48
|
-
const remoteSettingsReferences =
|
|
51
|
+
export const loadSettingsWithCachedRemoteSettings = (input, options = {}) => {
|
|
52
|
+
const localSettings = options.localSettings ?? loadSettings(discoverSettingsLoadPlan(input));
|
|
53
|
+
const remoteSettingsReferences = options.remoteSettingsReferences ?? localSettings.settings.remoteSettings;
|
|
49
54
|
if (localSettings.issues.length > 0 || remoteSettingsReferences.length === 0) {
|
|
50
55
|
return localSettings;
|
|
51
56
|
}
|
|
52
|
-
const remoteSettingsLocations = discoverRemoteSettingsLocations(input.homeDirectory, remoteSettingsReferences);
|
|
57
|
+
const remoteSettingsLocations = discoverRemoteSettingsLocations(input.homeDirectory, remoteSettingsReferences, localSettings.settings.cacheDirectory);
|
|
53
58
|
const remoteSettings = loadSettings(remoteSettingsLocations.plan);
|
|
54
59
|
const files = [...remoteSettings.files, ...localSettings.files];
|
|
55
60
|
const issues = [...remoteSettingsLocations.issues, ...remoteSettings.issues, ...localSettings.issues];
|
|
@@ -59,14 +64,23 @@ export const loadSettingsWithCachedRemoteSettings = (input, remoteSettingsRefere
|
|
|
59
64
|
settings: mergeSettingsStack(files.map((file) => file.settings)),
|
|
60
65
|
};
|
|
61
66
|
};
|
|
62
|
-
const discoverRemoteSettingsLocations = (homeDirectory, remoteSettings) => {
|
|
67
|
+
const discoverRemoteSettingsLocations = (homeDirectory, remoteSettings, cacheDirectory) => {
|
|
63
68
|
const locations = [];
|
|
64
69
|
const issues = [];
|
|
65
70
|
for (const [index, source] of remoteSettings.entries()) {
|
|
66
71
|
try {
|
|
72
|
+
const path = resolveCachedRemoteSettingsPath(homeDirectory, source, cacheDirectory);
|
|
73
|
+
if (!existsSync(path)) {
|
|
74
|
+
issues.push({
|
|
75
|
+
filePath: `remote_settings[${index}]`,
|
|
76
|
+
path: `/remote_settings/${index}`,
|
|
77
|
+
message: `Cached remote settings '${path}' are missing. Run 'outfitter sync' to fetch configured remote settings.`,
|
|
78
|
+
});
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
67
81
|
locations.push({
|
|
68
82
|
scope: 'remote',
|
|
69
|
-
path
|
|
83
|
+
path,
|
|
70
84
|
});
|
|
71
85
|
}
|
|
72
86
|
catch (error) {
|