@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
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
// Translates selected protocol MCP server definitions into Codex CLI TOML overrides.
|
|
2
|
+
const asRecord = (value) => value !== null && typeof value === 'object' && !Array.isArray(value)
|
|
3
|
+
? value
|
|
4
|
+
: {};
|
|
5
|
+
const tomlString = (value) => JSON.stringify(value.replace(/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/gu, '\uFFFD')).replace(/\u007F/gu, '\\u007F');
|
|
6
|
+
const CODEX_MCP_ID = /^[A-Za-z0-9_-]+$/u;
|
|
7
|
+
const ENVIRONMENT_REFERENCE = /\$\{[A-Za-z_][A-Za-z0-9_]*\}/u;
|
|
8
|
+
const tomlInlineTable = (value) => `{ ${Object.entries(value)
|
|
9
|
+
.sort(([left], [right]) => left.localeCompare(right))
|
|
10
|
+
.map(([key, item]) => `${tomlString(key)} = ${tomlString(item)}`)
|
|
11
|
+
.join(', ')} }`;
|
|
12
|
+
const environmentReference = (value) => /^\$\{([A-Za-z_][A-Za-z0-9_]*)\}$/u.exec(value)?.[1];
|
|
13
|
+
const bearerTokenReference = (header, value) => header.toLowerCase() === 'authorization' ? /^Bearer \$\{([A-Za-z_][A-Za-z0-9_]*)\}$/iu.exec(value)?.[1] : undefined;
|
|
14
|
+
const supportedTransport = (value) => value === undefined || value === 'stdio' || value === 'http' || value === 'streamable-http';
|
|
15
|
+
const override = (key, value) => ['-c', `${key}=${value}`];
|
|
16
|
+
const warnUnexpandedReferences = (id, field, value, warnings) => {
|
|
17
|
+
if (ENVIRONMENT_REFERENCE.test(value)) {
|
|
18
|
+
warnings.push(`codex MCP server '${id}' field '${field}' contains environment references that Codex does not expand.`);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
const projectStdioEnvironmentEntry = (id, name, value, literalEnvironment, environmentVariables, warnings) => {
|
|
22
|
+
if (typeof value !== 'string') {
|
|
23
|
+
warnings.push(`codex adapter dropped non-string MCP env entry '${name}' from server '${id}'.`);
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const environment = environmentReference(value);
|
|
27
|
+
if (environment === undefined) {
|
|
28
|
+
literalEnvironment[name] = value;
|
|
29
|
+
warnings.push(`codex MCP server '${id}' env entry '${name}' is literal and will be visible in process arguments.`);
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
if (name === environment) {
|
|
33
|
+
environmentVariables.push(environment);
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
warnings.push(`codex adapter cannot project MCP server '${id}' env entry '${name}': environment reference '${value}' would rename '${environment}'.`);
|
|
37
|
+
};
|
|
38
|
+
const projectHttpServer = (id, prefix, url, server, warnings) => {
|
|
39
|
+
warnUnexpandedReferences(id, 'url', url, warnings);
|
|
40
|
+
const args = [...override(`${prefix}.url`, tomlString(url))];
|
|
41
|
+
const literalHeaders = {};
|
|
42
|
+
const environmentHeaders = {};
|
|
43
|
+
let bearerTokenEnvironment;
|
|
44
|
+
for (const [header, value] of Object.entries(asRecord(server.headers))) {
|
|
45
|
+
if (typeof value !== 'string') {
|
|
46
|
+
warnings.push(`codex adapter dropped non-string MCP header '${header}' from server '${id}'.`);
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
const bearerToken = bearerTokenReference(header, value);
|
|
50
|
+
const environment = environmentReference(value);
|
|
51
|
+
if (bearerToken !== undefined)
|
|
52
|
+
bearerTokenEnvironment = bearerToken;
|
|
53
|
+
else if (environment === undefined) {
|
|
54
|
+
literalHeaders[header] = value;
|
|
55
|
+
warnings.push(`codex MCP server '${id}' header '${header}' is literal and will be visible in process arguments.`);
|
|
56
|
+
}
|
|
57
|
+
else
|
|
58
|
+
environmentHeaders[header] = environment;
|
|
59
|
+
}
|
|
60
|
+
if (Object.keys(literalHeaders).length > 0) {
|
|
61
|
+
args.push(...override(`${prefix}.http_headers`, tomlInlineTable(literalHeaders)));
|
|
62
|
+
}
|
|
63
|
+
if (Object.keys(environmentHeaders).length > 0) {
|
|
64
|
+
args.push(...override(`${prefix}.env_http_headers`, tomlInlineTable(environmentHeaders)));
|
|
65
|
+
}
|
|
66
|
+
if (bearerTokenEnvironment !== undefined) {
|
|
67
|
+
args.push(...override(`${prefix}.bearer_token_env_var`, tomlString(bearerTokenEnvironment)));
|
|
68
|
+
}
|
|
69
|
+
return args;
|
|
70
|
+
};
|
|
71
|
+
const projectStdioServer = (id, prefix, command, server, warnings) => {
|
|
72
|
+
warnUnexpandedReferences(id, 'command', command, warnings);
|
|
73
|
+
const args = [...override(`${prefix}.command`, tomlString(command))];
|
|
74
|
+
if (Array.isArray(server.args)) {
|
|
75
|
+
const commandArgs = [];
|
|
76
|
+
for (const [index, value] of server.args.entries()) {
|
|
77
|
+
if (typeof value === 'string') {
|
|
78
|
+
warnUnexpandedReferences(id, `args[${index}]`, value, warnings);
|
|
79
|
+
commandArgs.push(value);
|
|
80
|
+
}
|
|
81
|
+
else
|
|
82
|
+
warnings.push(`codex adapter dropped non-string MCP arg at index ${index} from server '${id}'.`);
|
|
83
|
+
}
|
|
84
|
+
args.push(...override(`${prefix}.args`, `[${commandArgs.map(tomlString).join(', ')}]`));
|
|
85
|
+
}
|
|
86
|
+
const literalEnvironment = {};
|
|
87
|
+
const environmentVariables = [];
|
|
88
|
+
for (const [name, value] of Object.entries(asRecord(server.env))) {
|
|
89
|
+
projectStdioEnvironmentEntry(id, name, value, literalEnvironment, environmentVariables, warnings);
|
|
90
|
+
}
|
|
91
|
+
if (Object.keys(literalEnvironment).length > 0) {
|
|
92
|
+
args.push(...override(`${prefix}.env`, tomlInlineTable(literalEnvironment)));
|
|
93
|
+
}
|
|
94
|
+
if (environmentVariables.length > 0) {
|
|
95
|
+
args.push(...override(`${prefix}.env_vars`, `[${environmentVariables
|
|
96
|
+
.sort((left, right) => left.localeCompare(right))
|
|
97
|
+
.map(tomlString)
|
|
98
|
+
.join(', ')}]`));
|
|
99
|
+
}
|
|
100
|
+
if (typeof server.cwd === 'string') {
|
|
101
|
+
warnUnexpandedReferences(id, 'cwd', server.cwd, warnings);
|
|
102
|
+
args.push(...override(`${prefix}.cwd`, tomlString(server.cwd)));
|
|
103
|
+
}
|
|
104
|
+
return args;
|
|
105
|
+
};
|
|
106
|
+
// Codex merges `-c` overrides with user and project `config.toml` and has no exclusive MCP mode, so
|
|
107
|
+
// selecting any server leaves lower-layer servers active. Reported as an adapter warning, which
|
|
108
|
+
// `--strict` makes fatal.
|
|
109
|
+
const ADDITIVE_PROJECTION_WARNING = 'codex MCP projection is additive: user and project MCP servers remain active because Codex has no strict isolation mode.';
|
|
110
|
+
/**
|
|
111
|
+
* Codex CLI `-c` values are TOML, not JSON. HTTP header values written as `${ENV_NAME}` are
|
|
112
|
+
* translated to `env_http_headers`, and `Authorization: Bearer ${ENV_NAME}` becomes
|
|
113
|
+
* `bearer_token_env_var`, so the secret itself stays out of argv. Other values must use Codex's
|
|
114
|
+
* literal `http_headers` because the protocol definition contains no environment reference.
|
|
115
|
+
*/
|
|
116
|
+
export const projectCodexMcpServers = (selectedIds, servers) => {
|
|
117
|
+
const args = [];
|
|
118
|
+
const warnings = [ADDITIVE_PROJECTION_WARNING];
|
|
119
|
+
for (const id of selectedIds) {
|
|
120
|
+
if (!CODEX_MCP_ID.test(id)) {
|
|
121
|
+
warnings.push(`codex adapter cannot project MCP server '${id}': id contains characters Codex -c key paths cannot express.`);
|
|
122
|
+
continue;
|
|
123
|
+
}
|
|
124
|
+
const server = asRecord(servers[id]);
|
|
125
|
+
const prefix = `mcp_servers.${id}`;
|
|
126
|
+
if (!supportedTransport(server.type)) {
|
|
127
|
+
const transport = typeof server.type === 'string' ? server.type : (JSON.stringify(server.type) ?? typeof server.type);
|
|
128
|
+
warnings.push(`codex adapter cannot project MCP server '${id}': transport '${transport}' is unsupported.`);
|
|
129
|
+
continue;
|
|
130
|
+
}
|
|
131
|
+
if (typeof server.url === 'string') {
|
|
132
|
+
args.push(...projectHttpServer(id, prefix, server.url, server, warnings));
|
|
133
|
+
continue;
|
|
134
|
+
}
|
|
135
|
+
if (typeof server.command === 'string') {
|
|
136
|
+
args.push(...projectStdioServer(id, prefix, server.command, server, warnings));
|
|
137
|
+
continue;
|
|
138
|
+
}
|
|
139
|
+
warnings.push(`codex adapter cannot project MCP server '${id}': expected a URL or command.`);
|
|
140
|
+
}
|
|
141
|
+
return { args, warnings };
|
|
142
|
+
};
|
|
143
|
+
//# sourceMappingURL=CodexMcp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodexMcp.js","sourceRoot":"","sources":["../../src/projection/CodexMcp.ts"],"names":[],"mappings":"AAAA,qFAAqF;AAErF,MAAM,QAAQ,GAAG,CAAC,KAAc,EAAqC,EAAE,CACrE,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;IAClE,CAAC,CAAE,KAA2C;IAC9C,CAAC,CAAC,EAAE,CAAC;AAET,MAAM,UAAU,GAAG,CAAC,KAAa,EAAU,EAAE,CAC3C,IAAI,CAAC,SAAS,CACZ,KAAK,CAAC,OAAO,CAAC,0EAA0E,EAAE,QAAQ,CAAC,CACpG,CAAC,OAAO,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;AACnC,MAAM,YAAY,GAAG,mBAAmB,CAAC;AACzC,MAAM,qBAAqB,GAAG,+BAA+B,CAAC;AAE9D,MAAM,eAAe,GAAG,CAAC,KAAuC,EAAU,EAAE,CAC1E,KAAK,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;KACvB,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;K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import type { CompositionPlan } from '../composer/Composition.js';
|
|
2
|
+
import type { Harness } from '../settings/Settings.js';
|
|
2
3
|
export interface MaterializedComposition {
|
|
3
4
|
readonly rootDirectory: string;
|
|
4
5
|
/** Absolute path to the composed system prompt written for the run. */
|
|
@@ -12,6 +13,7 @@ export interface MaterializedComposition {
|
|
|
12
13
|
/** Subagents whose merged agent definition could not be materialized. */
|
|
13
14
|
readonly skippedSubagents: readonly string[];
|
|
14
15
|
}
|
|
16
|
+
export declare const writeMcpConfig: (path: string, mcpServers: Readonly<Record<string, unknown>>) => void;
|
|
15
17
|
/**
|
|
16
18
|
* Overlays native harness configuration into the runtime root. Inputs arrive highest precedence
|
|
17
19
|
* first, so copying in reverse order lets higher layers replace matching files. Symlinked overlay
|
|
@@ -19,4 +21,4 @@ export interface MaterializedComposition {
|
|
|
19
21
|
*/
|
|
20
22
|
export declare const materializeConfigurationOverlays: (sourceDirectories: readonly string[], rootDirectory: string) => void;
|
|
21
23
|
/** Writes composed identity, skills, subagents, and selected MCP servers into the runtime root. */
|
|
22
|
-
export declare const materializeComposition: (composition: CompositionPlan, rootDirectory: string) => MaterializedComposition;
|
|
24
|
+
export declare const materializeComposition: (composition: CompositionPlan, rootDirectory: string, harness: Harness) => MaterializedComposition;
|
|
@@ -28,6 +28,10 @@ const writeGeneratedFile = (path, content) => {
|
|
|
28
28
|
removeTargetTypeConflict(path, 'file');
|
|
29
29
|
writeFileSync(path, content);
|
|
30
30
|
};
|
|
31
|
+
const serializeMcpConfig = (mcpServers) => `${JSON.stringify({ mcpServers }, null, 2)}\n`;
|
|
32
|
+
export const writeMcpConfig = (path, mcpServers) => {
|
|
33
|
+
writeGeneratedFile(path, serializeMcpConfig(mcpServers));
|
|
34
|
+
};
|
|
31
35
|
const safeName = (value) => value.replace(/[^a-zA-Z0-9._-]+/g, '-');
|
|
32
36
|
/**
|
|
33
37
|
* Overlays native harness configuration into the runtime root. Inputs arrive highest precedence
|
|
@@ -162,7 +166,7 @@ const materializeIdentity = (composition, rootDirectory) => {
|
|
|
162
166
|
return { systemPromptPath, appendPromptPaths };
|
|
163
167
|
};
|
|
164
168
|
/** Writes composed identity, skills, subagents, and selected MCP servers into the runtime root. */
|
|
165
|
-
export const materializeComposition = (composition, rootDirectory) => {
|
|
169
|
+
export const materializeComposition = (composition, rootDirectory, harness) => {
|
|
166
170
|
mkdirSync(rootDirectory, { recursive: true });
|
|
167
171
|
const { systemPromptPath, appendPromptPaths } = materializeIdentity(composition, rootDirectory);
|
|
168
172
|
const skillDirectories = [];
|
|
@@ -177,8 +181,8 @@ export const materializeComposition = (composition, rootDirectory) => {
|
|
|
177
181
|
}
|
|
178
182
|
}
|
|
179
183
|
const skippedSubagents = materializeSubagents(composition.loadout.subagents, composition.loadout.composedSubagents, rootDirectory);
|
|
180
|
-
if (composition.loadout.mcp.length > 0) {
|
|
181
|
-
|
|
184
|
+
if (harness === 'claude' || (harness === 'pi' && composition.loadout.mcp.length > 0)) {
|
|
185
|
+
writeMcpConfig(join(rootDirectory, 'mcp.json'), composition.loadout.mcpServers);
|
|
182
186
|
}
|
|
183
187
|
return {
|
|
184
188
|
rootDirectory,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Materialize.js","sourceRoot":"","sources":["../../src/projection/Materialize.ts"],"names":[],"mappings":"AAAA,mGAAmG;AACnG,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACjG,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAG1C,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AAEjE,OAAO,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"Materialize.js","sourceRoot":"","sources":["../../src/projection/Materialize.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AAa,EAAE,UAAU,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IAClF,CAAC;IACD,OAAO;QACL,aAAa;QACb,gBAAgB;QAChB,iBAAiB;QACjB,gBAAgB;QAChB,aAAa;QACb,gBAAgB;KACjB,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,26 +1,36 @@
|
|
|
1
|
-
// Projects a harness-neutral CompositionPlan to a native pi
|
|
1
|
+
// Projects a harness-neutral CompositionPlan to a native pi, Claude Code, or Codex CLI launch.
|
|
2
2
|
import { readFileSync, writeFileSync } from 'node:fs';
|
|
3
3
|
import { join } from 'node:path';
|
|
4
4
|
import { PI_SESSION_DIRECTORY_ENV } from '../agents/PiSessionDirectory.js';
|
|
5
|
+
import { projectCodexMcpServers } from './CodexMcp.js';
|
|
5
6
|
import { materializeComposition, materializeConfigurationOverlays } from './Materialize.js';
|
|
6
7
|
import { toolArgs } from './Tools.js';
|
|
7
8
|
// Loadout elements a projection actually maps to native config. Anything else is reported
|
|
8
|
-
// unsupported so `--strict` catches silently-dropped selections. Baseline for
|
|
9
|
+
// unsupported so `--strict` catches silently-dropped selections. Baseline for pi and Claude is
|
|
9
10
|
// identity + skills + model + thinking + tools. Both harnesses express an allowlist and a denylist
|
|
10
11
|
// natively, so `tools` is unconditionally supported; a name projection cannot carry is a hard error
|
|
11
12
|
// from `toolArgs`, not an unsupported element. Pi also projects selected subagents and MCP servers
|
|
12
13
|
// into its runtime config directory, and projects `extensions` once the run path has resolved their
|
|
13
|
-
// install dirs (`extensionLoadDirs`).
|
|
14
|
+
// install dirs (`extensionLoadDirs`). Claude projects selected MCP servers through an explicit,
|
|
15
|
+
// isolated `--mcp-config`; plugins remain unsupported pending incremental parity (#183).
|
|
16
|
+
// Switched rather than chained so a harness added to `Harness` fails to compile here instead of
|
|
17
|
+
// silently inheriting another harness's element set — the exact silent drop this function prevents.
|
|
14
18
|
const supportedElements = (input) => {
|
|
15
|
-
const baseline = ['skills', 'model', 'thinking', 'tools'];
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
const baseline = ['identity', 'skills', 'model', 'thinking', 'tools'];
|
|
20
|
+
switch (input.harness) {
|
|
21
|
+
case 'claude':
|
|
22
|
+
return [...baseline, 'mcp'];
|
|
23
|
+
case 'codex':
|
|
24
|
+
return ['model', 'mcp'];
|
|
25
|
+
case 'pi': {
|
|
26
|
+
const pi = [...baseline, 'subagents', 'mcp', 'prompt_template'];
|
|
27
|
+
return input.extensionLoadDirs === undefined ? pi : [...pi, 'extensions'];
|
|
28
|
+
}
|
|
29
|
+
}
|
|
20
30
|
};
|
|
21
31
|
const loadoutElementsInUse = (composition) => {
|
|
22
32
|
const { loadout } = composition;
|
|
23
|
-
const present = [];
|
|
33
|
+
const present = ['identity'];
|
|
24
34
|
if (loadout.skills.length > 0)
|
|
25
35
|
present.push('skills');
|
|
26
36
|
if (loadout.subagents.length > 0)
|
|
@@ -81,17 +91,28 @@ const promptArgs = (composition, input, systemPromptPath, appendPromptPaths) =>
|
|
|
81
91
|
? ['--prompt-template', `${input.rootDirectory}/prompt-template.md`]
|
|
82
92
|
: []),
|
|
83
93
|
];
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
94
|
+
// Split from the thinking flag so each builder states positively what it emits: codex reports
|
|
95
|
+
// `thinking` unsupported, and reporting an element unsupported does not by itself suppress it.
|
|
96
|
+
const modelArg = (composition, flag) => composition.loadout.model === undefined ? [] : [flag, composition.loadout.model];
|
|
97
|
+
const thinkingArg = (composition, harness) => composition.loadout.thinking === undefined
|
|
98
|
+
? []
|
|
99
|
+
: [harness === 'pi' ? '--thinking' : '--effort', composition.loadout.thinking];
|
|
100
|
+
// MCP overrides lead and pass-through args trail so a pass-through positional (`exec "<prompt>"`)
|
|
101
|
+
// stays last, where codex expects its subcommand and prompt.
|
|
102
|
+
const buildCodexLaunchPlan = (composition, input, codexMcpArgs) => ({
|
|
103
|
+
command: 'codex',
|
|
104
|
+
// Root `-m` propagation through `exec` was verified empirically on codex-cli 0.145.0.
|
|
105
|
+
args: [...codexMcpArgs, ...modelArg(composition, '-m'), ...(input.passThroughArgs ?? [])],
|
|
106
|
+
env: {},
|
|
107
|
+
});
|
|
108
|
+
// Claude's user, project, and plugin MCP sources would otherwise merge into the composition, so the
|
|
109
|
+
// generated config is named explicitly and `--strict-mcp-config` suppresses every other layer.
|
|
110
|
+
const claudeMcpArgs = (mcpConfigPath) => [
|
|
111
|
+
'--mcp-config',
|
|
112
|
+
mcpConfigPath,
|
|
113
|
+
'--strict-mcp-config',
|
|
114
|
+
];
|
|
115
|
+
const buildPiOrClaudeLaunchPlan = (composition, input, materialized, appendPromptPaths) => {
|
|
95
116
|
const isPi = input.harness === 'pi';
|
|
96
117
|
const skillArgs = isPi ? composition.loadout.skills.flatMap((skill) => ['--skill', skill.slug]) : [];
|
|
97
118
|
const extensionArgs = isPi ? (input.extensionLoadDirs ?? []).flatMap((dir) => ['--extension', dir]) : [];
|
|
@@ -102,10 +123,12 @@ const buildLaunchPlan = (composition, input, systemPromptPath, appendPromptPaths
|
|
|
102
123
|
// variadic and stop only at the next `--flag`, and the prompt args that follow always start
|
|
103
124
|
// with one. Placed later they could swallow a pass-through positional. See Tools.ts.
|
|
104
125
|
...(composition.loadout.tools === undefined ? [] : toolArgs(input.harness, composition.loadout.tools)),
|
|
105
|
-
...promptArgs(composition, input, systemPromptPath, appendPromptPaths),
|
|
126
|
+
...promptArgs(composition, input, materialized.systemPromptPath, appendPromptPaths),
|
|
106
127
|
...skillArgs,
|
|
107
128
|
...extensionArgs,
|
|
108
|
-
...
|
|
129
|
+
...modelArg(composition, '--model'),
|
|
130
|
+
...thinkingArg(composition, input.harness),
|
|
131
|
+
...(isPi ? [] : claudeMcpArgs(join(input.rootDirectory, 'mcp.json'))),
|
|
109
132
|
...(input.passThroughArgs ?? []),
|
|
110
133
|
],
|
|
111
134
|
// The projection root is deleted after the run, so pi's default session store (a subdirectory
|
|
@@ -124,17 +147,31 @@ export const projectComposition = (composition, input) => {
|
|
|
124
147
|
if (input.harness === 'pi') {
|
|
125
148
|
materializeConfigurationOverlays(input.configurationOverlayDirectories ?? [], input.rootDirectory);
|
|
126
149
|
}
|
|
127
|
-
|
|
128
|
-
//
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
...(input.appendPromptPaths ?? []),
|
|
132
|
-
]);
|
|
150
|
+
// Materialization runs for every harness so containment and definition diagnostics are reported
|
|
151
|
+
// uniformly. Codex reads none of the generated files — it takes its MCP config in argv and has no
|
|
152
|
+
// config-directory projection yet — but the root is temporary, so the unused writes do not persist.
|
|
153
|
+
const materialized = materializeComposition(composition, input.rootDirectory, input.harness);
|
|
133
154
|
const unsupported = [
|
|
134
155
|
...unsupportedElements(composition, input),
|
|
135
156
|
...materialized.skippedSkills.map((slug) => `skill:${slug} (escaping symlink)`),
|
|
136
157
|
...materialized.skippedSubagents.map((slug) => `subagent:${slug} (invalid definition)`),
|
|
137
158
|
];
|
|
138
|
-
|
|
159
|
+
if (input.harness === 'codex') {
|
|
160
|
+
const codexMcp = projectCodexMcpServers(composition.loadout.mcp, composition.loadout.mcpServers);
|
|
161
|
+
const launch = buildCodexLaunchPlan(composition, input, codexMcp.args);
|
|
162
|
+
const warnings = [
|
|
163
|
+
...(input.appendPromptPaths?.length
|
|
164
|
+
? ['codex adapter does not project supplied append-prompt documents; they will be dropped.']
|
|
165
|
+
: []),
|
|
166
|
+
...codexMcp.warnings,
|
|
167
|
+
];
|
|
168
|
+
return { rootDirectory: input.rootDirectory, launch, unsupported, warnings };
|
|
169
|
+
}
|
|
170
|
+
// Caller documents follow the composition's own, so a persona is read against the agent it adopts.
|
|
171
|
+
const launch = buildPiOrClaudeLaunchPlan(composition, input, materialized, [
|
|
172
|
+
...materialized.appendPromptPaths,
|
|
173
|
+
...(input.appendPromptPaths ?? []),
|
|
174
|
+
]);
|
|
175
|
+
return { rootDirectory: input.rootDirectory, launch, unsupported, warnings: [] };
|
|
139
176
|
};
|
|
140
177
|
//# sourceMappingURL=ProjectHarness.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProjectHarness.js","sourceRoot":"","sources":["../../src/projection/ProjectHarness.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"ProjectHarness.js","sourceRoot":"","sources":["../../src/projection/ProjectHarness.ts"],"names":[],"mappings":"AAAA,+FAA+F;AAC/F,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAG3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAEvD,OAAO,EAAE,sBAAsB,EAAE,gCAAgC,EAAE,MAAM,kBAAkB,CAAC;AAE5F,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,0FAA0F;AAC1F,+FAA+F;AAC/F,mGAAmG;AACnG,oGAAoG;AACpG,mGAAmG;AACnG,oGAAoG;AACpG,gGAAgG;AAChG,yFAAyF;AACzF,gGAAgG;AAChG,oGAAoG;AACpG,MAAM,iBAAiB,GAAG,CAAC,KAAsB,EAAqB,EAAE;IACtE,MAAM,QAAQ,GAAG,CAAC,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;IACtE,QAAQ,KAAK,CAAC,OAAO,EAAE,CAAC;QACtB,KAAK,QAAQ;YACX,OAAO,CAAC,GAAG,QAAQ,EAAE,KAAK,CAAC,CAAC;QAC9B,KAAK,OAAO;YACV,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QAC1B,KAAK,IAAI,CAAC,CAAC,CAAC;YACV,MAAM,EAAE,GAA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selected harness cannot project. */
|
|
12
12
|
readonly unsupported: readonly string[];
|
|
13
|
+
/** Adapter limitations or malformed native configuration discovered during projection. */
|
|
14
|
+
readonly warnings: readonly string[];
|
|
13
15
|
}
|
|
14
16
|
export interface ProjectionInput {
|
|
15
17
|
readonly harness: Harness;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { LoadedSettingsFile } from '../settings/SettingsLoader.js';
|
|
2
|
+
import type { SourceReference } from '../settings/Settings.js';
|
|
3
|
+
import type { DeclaredRemoteSource } from '../sources/TransitiveSources.js';
|
|
4
|
+
import type { EffectiveResourceSet } from './Resource.js';
|
|
5
|
+
export declare const strictAmbiguityFailureMessage = "Strict mode: ambiguous resolution is fatal.";
|
|
6
|
+
export declare const sourceRefAmbiguityWarnings: (files: readonly LoadedSettingsFile[], effectiveSources: readonly SourceReference[], transitiveDeclarations: readonly DeclaredRemoteSource[]) => readonly string[];
|
|
7
|
+
export declare const slugAmbiguityWarnings: (set: EffectiveResourceSet) => readonly string[];
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { encodeRemoteSourceSelection, isRemoteSource, normalizeGitUri, normalizeRemoteSourceUri, redactSourceUriCredentials, } from '../sources/SourceCache.js';
|
|
2
|
+
export const strictAmbiguityFailureMessage = 'Strict mode: ambiguous resolution is fatal.';
|
|
3
|
+
const repositoryKey = (source) => redactSourceUriCredentials(normalizeGitUri(normalizeRemoteSourceUri(source)));
|
|
4
|
+
const repositoryDisplay = (source) => {
|
|
5
|
+
if (source.github !== undefined)
|
|
6
|
+
return `github:${source.github}`;
|
|
7
|
+
return redactSourceUriCredentials(normalizeGitUri(source.uri));
|
|
8
|
+
};
|
|
9
|
+
const refDisplay = (source) => source.ref ?? '(default)';
|
|
10
|
+
const directDeclarations = (files) => [...files]
|
|
11
|
+
.reverse()
|
|
12
|
+
.flatMap((file) => (file.settings.sources ?? [])
|
|
13
|
+
.filter(isRemoteSource)
|
|
14
|
+
.map((source) => ({ source, declaredBy: file.location.path })));
|
|
15
|
+
const replacedSourceListWarnings = (files, effectiveSources) => {
|
|
16
|
+
const replacingIndex = files.findLastIndex((file) => file.settings.sources !== undefined);
|
|
17
|
+
if (replacingIndex < 1)
|
|
18
|
+
return [];
|
|
19
|
+
const replacingFile = files[replacingIndex];
|
|
20
|
+
const effectiveRepositories = new Set(effectiveSources.filter(isRemoteSource).map(repositoryKey));
|
|
21
|
+
const reportedRepositories = new Set();
|
|
22
|
+
const warnings = [];
|
|
23
|
+
for (const file of files.slice(0, replacingIndex).reverse()) {
|
|
24
|
+
for (const source of (file.settings.sources ?? []).filter(isRemoteSource)) {
|
|
25
|
+
const key = repositoryKey(source);
|
|
26
|
+
if (effectiveRepositories.has(key) || reportedRepositories.has(key))
|
|
27
|
+
continue;
|
|
28
|
+
reportedRepositories.add(key);
|
|
29
|
+
warnings.push(`source '${repositoryDisplay(source)}' declared by '${file.location.path}' was replaced by '${replacingFile.location.path}' and is not in the effective configuration`);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return warnings;
|
|
33
|
+
};
|
|
34
|
+
const selectedDeclarations = (effectiveSources, direct, transitive) => {
|
|
35
|
+
const selectedDirect = effectiveSources.filter(isRemoteSource).map((source) => {
|
|
36
|
+
const selection = encodeRemoteSourceSelection(source);
|
|
37
|
+
// Every effective direct source came from one of the loaded files used to produce settings.
|
|
38
|
+
return direct.find((entry) => encodeRemoteSourceSelection(entry.source) === selection);
|
|
39
|
+
});
|
|
40
|
+
return [...selectedDirect, ...transitive];
|
|
41
|
+
};
|
|
42
|
+
export const sourceRefAmbiguityWarnings = (files, effectiveSources, transitiveDeclarations) => {
|
|
43
|
+
const direct = directDeclarations(files);
|
|
44
|
+
const declarations = [...direct, ...transitiveDeclarations];
|
|
45
|
+
const selected = selectedDeclarations(effectiveSources, direct, transitiveDeclarations);
|
|
46
|
+
const byRepository = new Map();
|
|
47
|
+
for (const declaration of declarations) {
|
|
48
|
+
const key = repositoryKey(declaration.source);
|
|
49
|
+
const entries = byRepository.get(key) ?? [];
|
|
50
|
+
entries.push(declaration);
|
|
51
|
+
byRepository.set(key, entries);
|
|
52
|
+
}
|
|
53
|
+
const warnings = [...replacedSourceListWarnings(files, effectiveSources)];
|
|
54
|
+
for (const entries of byRepository.values()) {
|
|
55
|
+
if (new Set(entries.map((entry) => entry.source.ref)).size < 2)
|
|
56
|
+
continue;
|
|
57
|
+
const key = repositoryKey(entries[0].source);
|
|
58
|
+
const winner = selected.find((entry) => repositoryKey(entry.source) === key);
|
|
59
|
+
if (winner === undefined)
|
|
60
|
+
continue;
|
|
61
|
+
const declarationsText = entries
|
|
62
|
+
.map((entry) => `'${entry.declaredBy}' declares ref '${refDisplay(entry.source)}'`)
|
|
63
|
+
.join('; ');
|
|
64
|
+
warnings.push(`Ambiguous source repository '${repositoryDisplay(entries[0].source)}': ${declarationsText}; declaration from '${winner.declaredBy}' at ref '${refDisplay(winner.source)}' won.`);
|
|
65
|
+
}
|
|
66
|
+
return warnings;
|
|
67
|
+
};
|
|
68
|
+
const slugWarning = (kind, resource, context) => {
|
|
69
|
+
const definitions = [resource.winner, ...resource.shadowed];
|
|
70
|
+
const labels = [...new Set(definitions.map((definition) => definition.layer.label))];
|
|
71
|
+
if (labels.length < 2)
|
|
72
|
+
return undefined;
|
|
73
|
+
return `Ambiguous ${kind} slug '${resource.slug}'${context ?? ''} is supplied by ${labels.map((label) => `'${label}'`).join(', ')}; '${resource.winner.layer.label}' won.`;
|
|
74
|
+
};
|
|
75
|
+
const resourceWarnings = (kind, resources, context) => resources === undefined
|
|
76
|
+
? []
|
|
77
|
+
: [...resources].flatMap((resource) => {
|
|
78
|
+
const warning = slugWarning(kind, resource, context);
|
|
79
|
+
return warning === undefined ? [] : [warning];
|
|
80
|
+
});
|
|
81
|
+
export const slugAmbiguityWarnings = (set) => [
|
|
82
|
+
...resourceWarnings('agent', set.resources.get('agent')?.values()),
|
|
83
|
+
...resourceWarnings('skill', set.resources.get('skill')?.values()),
|
|
84
|
+
...[...set.agentResources].flatMap(([agent, kinds]) => resourceWarnings('skill', kinds.get('skill')?.values(), ` for agent '${agent}'`)),
|
|
85
|
+
];
|
|
86
|
+
//# sourceMappingURL=AmbiguityWarnings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AmbiguityWarnings.js","sourceRoot":"","sources":["../../src/resolver/AmbiguityWarnings.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,2BAA2B,EAC3B,cAAc,EACd,eAAe,EACf,wBAAwB,EACxB,0BAA0B,GAC3B,MAAM,2BAA2B,CAAC;AAUnC,MAAM,CAAC,MAAM,6BAA6B,GAAG,6CAA6C,CAAC;AAE3F,MAAM,aAAa,GAAG,CAAC,MAA6B,EAAU,EAAE,CAC9D,0BAA0B,CAAC,eAAe,CAAC,wBAAwB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AAEhF,MAAM,iBAAiB,GAAG,CAAC,MAA6B,EAAU,EAAE;IAClE,IAAI,MAAM,CAAC,MAAM,KAAK,SAAS;QAAE,OAAO,UAAU,MAAM,CAAC,MAAM,EAAE,CAAC;IAClE,OAAO,0BAA0B,CAAC,eAAe,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;AACjE,CAAC,CAAC;AAEF,MAAM,UAAU,GAAG,CAAC,MAA6B,EAAU,EAAE,CAAC,MAAM,CAAC,GAAG,IAAI,WAAW,CAAC;AAExF,MAAM,kBAAkB,GAAG,CAAC,KAAoC,EAAgC,EAAE,CAChG,CAAC,GAAG,KAAK,CAAC;KACP,OAAO,EAAE;KACT,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAChB,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,IAAI,EAAE,CAAC;KAC1B,MAAM,CAAC,cAAc,CAAC;KACtB,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,C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,CAAC,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,EAAE,eAAe,KAAK,GAAG,CAAC,CACjF;CACF,CAAC"}
|
package/dist/resolver/Layer.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { RemoteSourceReference } from '../sources/SourceCache.js';
|
|
2
|
+
import type { DeclaredRemoteSource } from '../sources/TransitiveSources.js';
|
|
2
3
|
import type { Settings } from '../settings/Settings.js';
|
|
3
4
|
import type { Layer } from './Resource.js';
|
|
4
5
|
export interface LayerDiscoveryInput {
|
|
@@ -13,6 +14,8 @@ export interface LayerDiscoveryInput {
|
|
|
13
14
|
export declare const remoteSourceLayer: (repositoryPath: string, source: RemoteSourceReference) => Layer;
|
|
14
15
|
export interface LayerDiscoveryResult {
|
|
15
16
|
readonly layers: readonly Layer[];
|
|
17
|
+
/** Accepted transitive declarations, including duplicates, retained for ambiguity diagnostics. */
|
|
18
|
+
readonly transitiveDeclarations: readonly DeclaredRemoteSource[];
|
|
16
19
|
/**
|
|
17
20
|
* Configured remote sources whose cache is absent, reported with `outfitter sync` guidance rather
|
|
18
21
|
* than silently dropped (OFTR-004.2.18). Reported, never fatal: a private catalog the enterprise
|
|
@@ -20,9 +23,12 @@ export interface LayerDiscoveryResult {
|
|
|
20
23
|
* would deadlock every other command behind advice the user cannot act on (OFTR-004.2.15).
|
|
21
24
|
*/
|
|
22
25
|
readonly unsynchronized: readonly string[];
|
|
26
|
+
/** Non-fatal transitive-source skip warnings (unpinned refs, path sources, invalid settings). */
|
|
27
|
+
readonly warnings: readonly string[];
|
|
23
28
|
}
|
|
24
29
|
/**
|
|
25
|
-
* Orders layers highest precedence first: workspace `.agents`, then global `~/.agents`,
|
|
26
|
-
*
|
|
30
|
+
* Orders layers highest precedence first: workspace `.agents`, then global `~/.agents`, then
|
|
31
|
+
* configured sources in order, then transitive sources those catalogs declare, breadth-first
|
|
32
|
+
* (OFTR-004.6.1, OFTR-004.6.3). Only layers whose root exists on disk are included.
|
|
27
33
|
*/
|
|
28
34
|
export declare const discoverLayers: (input: LayerDiscoveryInput) => LayerDiscoveryResult;
|