@open-agent-toolkit/cli 0.1.45 → 0.1.48
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/assets/agents/oat-phase-implementer.md +202 -191
- package/assets/agents/oat-reviewer.md +12 -2
- package/assets/config/dispatch-matrix-recommendation.json +120 -13
- package/assets/docs/cli-utilities/config-and-local-state.md +7 -0
- package/assets/docs/cli-utilities/configuration.md +183 -84
- package/assets/docs/cli-utilities/workflow-gates.md +161 -27
- package/assets/docs/contributing/skills.md +14 -8
- package/assets/docs/provider-sync/config.md +5 -1
- package/assets/docs/provider-sync/manifest-and-drift.md +6 -1
- package/assets/docs/provider-sync/providers.md +42 -5
- package/assets/docs/provider-sync/scope-and-surface.md +3 -2
- package/assets/docs/reference/cli-reference.md +3 -1
- package/assets/docs/reference/oat-directory-structure.md +27 -26
- package/assets/docs/workflows/projects/artifacts.md +31 -1
- package/assets/docs/workflows/projects/dispatch-ceiling.md +235 -174
- package/assets/docs/workflows/projects/implementation-execution.md +283 -253
- package/assets/docs/workflows/projects/lifecycle.md +26 -5
- package/assets/docs/workflows/projects/reviews.md +27 -2
- package/assets/migration/pjm-restructure.md +1 -1
- package/assets/public-package-versions.json +4 -4
- package/assets/skills/oat-project-implement/SKILL.md +347 -178
- package/assets/skills/oat-project-import-plan/SKILL.md +173 -16
- package/assets/skills/oat-project-next/SKILL.md +2 -2
- package/assets/skills/oat-project-plan/SKILL.md +122 -92
- package/assets/skills/oat-project-plan-writing/SKILL.md +246 -15
- package/assets/skills/oat-project-quick-start/SKILL.md +156 -94
- package/assets/skills/oat-project-review-provide/SKILL.md +94 -22
- package/dist/commands/config/index.d.ts +2 -2
- package/dist/commands/config/index.d.ts.map +1 -1
- package/dist/commands/config/index.js +129 -53
- package/dist/commands/doctor/index.d.ts +2 -2
- package/dist/commands/doctor/index.d.ts.map +1 -1
- package/dist/commands/doctor/index.js +102 -31
- package/dist/commands/gate/index.d.ts +7 -1
- package/dist/commands/gate/index.d.ts.map +1 -1
- package/dist/commands/gate/index.js +544 -67
- package/dist/commands/gate/review-verdict.d.ts +16 -0
- package/dist/commands/gate/review-verdict.d.ts.map +1 -1
- package/dist/commands/gate/review-verdict.js +72 -9
- package/dist/commands/project/dispatch-ceiling/index.d.ts.map +1 -1
- package/dist/commands/project/dispatch-ceiling/index.js +586 -23
- package/dist/commands/providers/codex/index.d.ts +4 -0
- package/dist/commands/providers/codex/index.d.ts.map +1 -0
- package/dist/commands/providers/codex/index.js +7 -0
- package/dist/commands/providers/codex/materialize.d.ts +5 -0
- package/dist/commands/providers/codex/materialize.d.ts.map +1 -0
- package/dist/commands/providers/codex/materialize.js +157 -0
- package/dist/commands/providers/index.d.ts +2 -2
- package/dist/commands/providers/index.d.ts.map +1 -1
- package/dist/commands/providers/index.js +4 -2
- package/dist/commands/providers/providers.types.d.ts +23 -0
- package/dist/commands/providers/providers.types.d.ts.map +1 -1
- package/dist/commands/shared/codex-strays.d.ts.map +1 -1
- package/dist/commands/shared/codex-strays.js +11 -1
- package/dist/commands/shared/frontmatter.d.ts +4 -0
- package/dist/commands/shared/frontmatter.d.ts.map +1 -1
- package/dist/commands/shared/frontmatter.js +23 -0
- package/dist/commands/status/index.d.ts +5 -1
- package/dist/commands/status/index.d.ts.map +1 -1
- package/dist/commands/status/index.js +10 -4
- package/dist/commands/sync/index.d.ts.map +1 -1
- package/dist/commands/sync/index.js +10 -3
- package/dist/commands/sync/sync.types.d.ts +5 -1
- package/dist/commands/sync/sync.types.d.ts.map +1 -1
- package/dist/config/dispatch-ceiling-preset.d.ts +4 -0
- package/dist/config/dispatch-ceiling-preset.d.ts.map +1 -1
- package/dist/config/dispatch-ceiling-preset.js +3 -0
- package/dist/config/dispatch-policy-options.d.ts +20 -0
- package/dist/config/dispatch-policy-options.d.ts.map +1 -0
- package/dist/config/dispatch-policy-options.js +96 -0
- package/dist/config/oat-config.d.ts +25 -2
- package/dist/config/oat-config.d.ts.map +1 -1
- package/dist/config/oat-config.js +154 -24
- package/dist/config/resolve.d.ts +8 -0
- package/dist/config/resolve.d.ts.map +1 -1
- package/dist/config/resolve.js +66 -2
- package/dist/engine/index.d.ts +1 -1
- package/dist/engine/index.d.ts.map +1 -1
- package/dist/engine/index.js +1 -1
- package/dist/engine/scanner.d.ts +1 -0
- package/dist/engine/scanner.d.ts.map +1 -1
- package/dist/engine/scanner.js +17 -1
- package/dist/fs/paths.d.ts +4 -0
- package/dist/fs/paths.d.ts.map +1 -1
- package/dist/fs/paths.js +18 -1
- package/dist/providers/ceiling/registry.d.ts +8 -5
- package/dist/providers/ceiling/registry.d.ts.map +1 -1
- package/dist/providers/ceiling/registry.js +25 -7
- package/dist/providers/codex/codec/catalog.d.ts +14 -0
- package/dist/providers/codex/codec/catalog.d.ts.map +1 -0
- package/dist/providers/codex/codec/catalog.js +21 -0
- package/dist/providers/codex/codec/config-merge.d.ts +6 -0
- package/dist/providers/codex/codec/config-merge.d.ts.map +1 -1
- package/dist/providers/codex/codec/config-merge.js +7 -0
- package/dist/providers/codex/codec/materialize.d.ts +16 -0
- package/dist/providers/codex/codec/materialize.d.ts.map +1 -0
- package/dist/providers/codex/codec/materialize.js +58 -0
- package/dist/providers/codex/codec/shared.d.ts +20 -0
- package/dist/providers/codex/codec/shared.d.ts.map +1 -1
- package/dist/providers/codex/codec/shared.js +107 -6
- package/dist/providers/codex/codec/sync-extension.d.ts +7 -1
- package/dist/providers/codex/codec/sync-extension.d.ts.map +1 -1
- package/dist/providers/codex/codec/sync-extension.js +299 -52
- package/dist/providers/identity/availability.d.ts +24 -1
- package/dist/providers/identity/availability.d.ts.map +1 -1
- package/dist/providers/identity/availability.js +253 -19
- package/dist/providers/identity/stamp.d.ts.map +1 -1
- package/dist/providers/identity/stamp.js +4 -0
- package/dist/shared/types.d.ts +1 -0
- package/dist/shared/types.d.ts.map +1 -1
- package/dist/shared/types.js +4 -0
- package/package.json +2 -2
package/dist/engine/scanner.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { readdir } from 'node:fs/promises';
|
|
2
2
|
import { join, resolve } from 'node:path';
|
|
3
3
|
import { CliError } from '../errors/index.js';
|
|
4
|
-
import {
|
|
4
|
+
import { resolveAssetsRoot } from '../fs/assets.js';
|
|
5
|
+
import { SCOPE_CONTENT_TYPES, USER_SCOPE_MANAGED_AGENT_FILES, } from '../shared/types.js';
|
|
5
6
|
function canonicalDirectoryName(contentType) {
|
|
6
7
|
if (contentType === 'skill') {
|
|
7
8
|
return 'skills';
|
|
@@ -42,6 +43,21 @@ async function readEntries(dirPath) {
|
|
|
42
43
|
throw error;
|
|
43
44
|
}
|
|
44
45
|
}
|
|
46
|
+
export async function scanBundledManagedCodexAgents() {
|
|
47
|
+
const agentsDir = join(await resolveAssetsRoot(), 'agents');
|
|
48
|
+
const entries = await readEntries(agentsDir);
|
|
49
|
+
const available = new Set(entries.filter((entry) => entry.isFile).map((entry) => entry.name));
|
|
50
|
+
const missing = USER_SCOPE_MANAGED_AGENT_FILES.filter((name) => !available.has(name));
|
|
51
|
+
if (missing.length > 0) {
|
|
52
|
+
throw new CliError(`Bundled managed Codex role definitions are unavailable: ${missing.join(', ')}. Reinstall or rebuild OAT before running user sync.`);
|
|
53
|
+
}
|
|
54
|
+
return USER_SCOPE_MANAGED_AGENT_FILES.map((name) => ({
|
|
55
|
+
name,
|
|
56
|
+
type: 'agent',
|
|
57
|
+
canonicalPath: join(agentsDir, name),
|
|
58
|
+
isFile: true,
|
|
59
|
+
}));
|
|
60
|
+
}
|
|
45
61
|
export async function scanCanonical(basePath, scope) {
|
|
46
62
|
const scopeRoot = resolve(basePath);
|
|
47
63
|
const entries = [];
|
package/dist/fs/paths.d.ts
CHANGED
|
@@ -5,5 +5,9 @@ export declare function resolveScopeRoot(scope: ConcreteScope, cwd: string, home
|
|
|
5
5
|
export declare function toPosixPath(pathValue: string): string;
|
|
6
6
|
export declare function normalizeToPosixPath(pathValue: string): string;
|
|
7
7
|
export declare function validatePathWithinScope(candidatePath: string, scopeRoot: string): string;
|
|
8
|
+
export declare function validateRealPathWithinScope(candidatePath: string, scopeRoot: string): Promise<{
|
|
9
|
+
realScopeRoot: string;
|
|
10
|
+
realPath: string;
|
|
11
|
+
}>;
|
|
8
12
|
export {};
|
|
9
13
|
//# sourceMappingURL=paths.d.ts.map
|
package/dist/fs/paths.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/fs/paths.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAE3C,KAAK,aAAa,GAAG,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAE3C,wBAAsB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAiBrE;AAED,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,aAAa,EACpB,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,GACX,MAAM,CAMR;AAED,wBAAgB,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAErD;AAED,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAE9D;AAED,wBAAgB,uBAAuB,CACrC,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,MAAM,GAChB,MAAM,CAcR"}
|
|
1
|
+
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/fs/paths.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAE3C,KAAK,aAAa,GAAG,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAE3C,wBAAsB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAiBrE;AAED,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,aAAa,EACpB,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,GACX,MAAM,CAMR;AAED,wBAAgB,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAErD;AAED,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAE9D;AAED,wBAAgB,uBAAuB,CACrC,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,MAAM,GAChB,MAAM,CAcR;AAED,wBAAsB,2BAA2B,CAC/C,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC;IAAE,aAAa,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC,CAsBtD"}
|
package/dist/fs/paths.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { access } from 'node:fs/promises';
|
|
1
|
+
import { access, realpath } from 'node:fs/promises';
|
|
2
2
|
import { dirname, posix, resolve, sep } from 'node:path';
|
|
3
3
|
import { CliError } from '../errors/index.js';
|
|
4
4
|
export async function resolveProjectRoot(cwd) {
|
|
@@ -40,3 +40,20 @@ export function validatePathWithinScope(candidatePath, scopeRoot) {
|
|
|
40
40
|
}
|
|
41
41
|
return resolvedCandidatePath;
|
|
42
42
|
}
|
|
43
|
+
export async function validateRealPathWithinScope(candidatePath, scopeRoot) {
|
|
44
|
+
const resolvedCandidatePath = validatePathWithinScope(candidatePath, scopeRoot);
|
|
45
|
+
let realScopeRoot;
|
|
46
|
+
let realCandidatePath;
|
|
47
|
+
try {
|
|
48
|
+
[realScopeRoot, realCandidatePath] = await Promise.all([
|
|
49
|
+
realpath(resolve(scopeRoot)),
|
|
50
|
+
realpath(resolvedCandidatePath),
|
|
51
|
+
]);
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
const detail = error instanceof Error ? `: ${error.message}` : '';
|
|
55
|
+
throw new CliError(`Unable to resolve real path for ${candidatePath} within scope root ${scopeRoot}${detail}`);
|
|
56
|
+
}
|
|
57
|
+
validatePathWithinScope(realCandidatePath, realScopeRoot);
|
|
58
|
+
return { realScopeRoot, realPath: realCandidatePath };
|
|
59
|
+
}
|
|
@@ -8,23 +8,26 @@
|
|
|
8
8
|
* ceiling intent with these adapters to decide enforced/advisory/unsupported and
|
|
9
9
|
* to produce concrete dispatch args — skills never re-implement this logic.
|
|
10
10
|
*
|
|
11
|
-
* Codex enforces via sync-time
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* enforces via the per-call Task `model` argument (no variant files). Every other
|
|
15
|
-
* provider is advisory by default.
|
|
11
|
+
* Codex enforces via sync-time materialized role variants selected from matrix
|
|
12
|
+
* model+effort targets. Claude enforces via the per-call Task `model` argument
|
|
13
|
+
* (no variant files). Every other provider is advisory by default.
|
|
16
14
|
*/
|
|
17
15
|
export type EnforcementMechanism = 'pinned-variant' | 'model-arg' | 'none';
|
|
18
16
|
export type CeilingRole = 'implementer' | 'reviewer';
|
|
19
17
|
export interface CeilingCompileContext {
|
|
20
18
|
/** The orchestrator's own tier, used to detect above-orchestrator upgrades. */
|
|
21
19
|
orchestratorTier?: string;
|
|
20
|
+
target?: {
|
|
21
|
+
model?: string;
|
|
22
|
+
effort?: string;
|
|
23
|
+
} | null;
|
|
22
24
|
}
|
|
23
25
|
export type CeilingDispatchArgs = {
|
|
24
26
|
variant: string;
|
|
25
27
|
} | {
|
|
26
28
|
model: string;
|
|
27
29
|
} | null;
|
|
30
|
+
export declare function isDirectDispatchRoleName(value: string): boolean;
|
|
28
31
|
export interface ProviderCeilingAdapter {
|
|
29
32
|
provider: string;
|
|
30
33
|
supportsCeiling: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/providers/ceiling/registry.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/providers/ceiling/registry.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;GAaG;AAEH,MAAM,MAAM,oBAAoB,GAAG,gBAAgB,GAAG,WAAW,GAAG,MAAM,CAAC;AAE3E,MAAM,MAAM,WAAW,GAAG,aAAa,GAAG,UAAU,CAAC;AAErD,MAAM,WAAW,qBAAqB;IACpC,+EAA+E;IAC/E,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,MAAM,CAAC,EAAE;QACP,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,GAAG,IAAI,CAAC;CACV;AAED,MAAM,MAAM,mBAAmB,GAC3B;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,GACnB;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GACjB,IAAI,CAAC;AAKT,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAE/D;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,OAAO,CAAC;IACzB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,SAAS,EAAE,oBAAoB,CAAC;IAChC;;;OAGG;IACH,qBAAqB,CACnB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,WAAW,EACjB,GAAG,EAAE,qBAAqB,GACzB,mBAAmB,CAAC;IACvB;;;;OAIG;IACH,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,qBAAqB,GAAG,OAAO,CAAC;CACtE;AAMD,wEAAwE;AACxE,eAAO,MAAM,iBAAiB,EAAE,SAAS,MAAM,EAK9C,CAAC;AA4GF;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,sBAAsB,CAE1E"}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { VALID_CLAUDE_DISPATCH_CEILINGS, VALID_CODEX_DISPATCH_CEILINGS, } from '../../config/oat-config.js';
|
|
2
|
-
|
|
2
|
+
import { buildCodexMaterializedTargetRoleName } from '../codex/codec/shared.js';
|
|
3
|
+
const DIRECT_DISPATCH_ROLE_PATTERN = /^oat-(?:phase-implementer|reviewer)(?:-|$)/;
|
|
4
|
+
export function isDirectDispatchRoleName(value) {
|
|
5
|
+
return DIRECT_DISPATCH_ROLE_PATTERN.test(value.trim());
|
|
6
|
+
}
|
|
7
|
+
/** Codex materialized-role base names (must match sync-extension output). */
|
|
3
8
|
const CODEX_IMPLEMENTER_ROLE = 'oat-phase-implementer';
|
|
4
9
|
const CODEX_REVIEWER_ROLE = 'oat-reviewer';
|
|
5
10
|
/** Claude tier order, low → high, for above-orchestrator comparison. */
|
|
@@ -14,15 +19,27 @@ const codexAdapter = {
|
|
|
14
19
|
supportsCeiling: true,
|
|
15
20
|
validValues: [...VALID_CODEX_DISPATCH_CEILINGS],
|
|
16
21
|
mechanism: 'pinned-variant',
|
|
17
|
-
compileToDispatchArgs(value, role) {
|
|
22
|
+
compileToDispatchArgs(value, role, ctx) {
|
|
18
23
|
if (!VALID_CODEX_DISPATCH_CEILINGS.includes(value)) {
|
|
19
24
|
return null;
|
|
20
25
|
}
|
|
26
|
+
const target = ctx.target;
|
|
27
|
+
if (!target?.model ||
|
|
28
|
+
!target.effort ||
|
|
29
|
+
isDirectDispatchRoleName(target.model)) {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
21
32
|
const baseRole = role === 'reviewer' ? CODEX_REVIEWER_ROLE : CODEX_IMPLEMENTER_ROLE;
|
|
22
|
-
return {
|
|
33
|
+
return {
|
|
34
|
+
variant: buildCodexMaterializedTargetRoleName({
|
|
35
|
+
agentName: baseRole,
|
|
36
|
+
model: target.model,
|
|
37
|
+
effort: target.effort,
|
|
38
|
+
}),
|
|
39
|
+
};
|
|
23
40
|
},
|
|
24
|
-
// Codex enforces via effort
|
|
25
|
-
// above-orchestrator upgrade path to verify.
|
|
41
|
+
// Codex enforces via materialized model+effort roles, not model tier; there
|
|
42
|
+
// is no above-orchestrator upgrade path to verify.
|
|
26
43
|
verifyOnDispatch() {
|
|
27
44
|
return false;
|
|
28
45
|
},
|
|
@@ -44,7 +61,8 @@ const claudeAdapter = {
|
|
|
44
61
|
validValues: [...VALID_CLAUDE_DISPATCH_CEILINGS],
|
|
45
62
|
mechanism: 'model-arg',
|
|
46
63
|
compileToDispatchArgs(value) {
|
|
47
|
-
if (
|
|
64
|
+
if (isDirectDispatchRoleName(value) ||
|
|
65
|
+
!VALID_CLAUDE_DISPATCH_CEILINGS.includes(value)) {
|
|
48
66
|
return null;
|
|
49
67
|
}
|
|
50
68
|
return { model: value };
|
|
@@ -61,7 +79,7 @@ const cursorAdapter = {
|
|
|
61
79
|
mechanism: 'model-arg',
|
|
62
80
|
compileToDispatchArgs(value) {
|
|
63
81
|
const model = value.trim();
|
|
64
|
-
return model ? { model } : null;
|
|
82
|
+
return model && !isDirectDispatchRoleName(model) ? { model } : null;
|
|
65
83
|
},
|
|
66
84
|
// Cursor model slugs do not share a total order, so upgrade verification is
|
|
67
85
|
// not meaningful here; availability is checked by the identity oracle layer.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export { SUPPORTED_CODEX_ROLE_TARGETS } from './shared.js';
|
|
2
|
+
export declare const SUPPORTED_CODEX_BASE_ROLES: readonly ["oat-phase-implementer", "oat-reviewer"];
|
|
3
|
+
export interface SupportedCodexRoleCatalogueEntry {
|
|
4
|
+
baseRole: (typeof SUPPORTED_CODEX_BASE_ROLES)[number];
|
|
5
|
+
model: string;
|
|
6
|
+
effort: string;
|
|
7
|
+
roleName: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function isSupportedCodexRoleTarget(target: {
|
|
10
|
+
model: string;
|
|
11
|
+
effort: string;
|
|
12
|
+
}): boolean;
|
|
13
|
+
export declare function expandSupportedCodexRoleCatalogue(): SupportedCodexRoleCatalogueEntry[];
|
|
14
|
+
//# sourceMappingURL=catalog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../../../src/providers/codex/codec/catalog.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAC;AAExD,eAAO,MAAM,0BAA0B,oDAG7B,CAAC;AAEX,MAAM,WAAW,gCAAgC;IAC/C,QAAQ,EAAE,CAAC,OAAO,0BAA0B,CAAC,CAAC,MAAM,CAAC,CAAC;IACtD,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,wBAAgB,0BAA0B,CAAC,MAAM,EAAE;IACjD,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,GAAG,OAAO,CAKV;AAED,wBAAgB,iCAAiC,IAAI,gCAAgC,EAAE,CAYtF"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { buildCodexMaterializedRoleName } from './materialize.js';
|
|
2
|
+
import { SUPPORTED_CODEX_ROLE_TARGETS } from './shared.js';
|
|
3
|
+
export { SUPPORTED_CODEX_ROLE_TARGETS } from './shared.js';
|
|
4
|
+
export const SUPPORTED_CODEX_BASE_ROLES = [
|
|
5
|
+
'oat-phase-implementer',
|
|
6
|
+
'oat-reviewer',
|
|
7
|
+
];
|
|
8
|
+
export function isSupportedCodexRoleTarget(target) {
|
|
9
|
+
return SUPPORTED_CODEX_ROLE_TARGETS.some((supported) => supported.model === target.model && supported.effort === target.effort);
|
|
10
|
+
}
|
|
11
|
+
export function expandSupportedCodexRoleCatalogue() {
|
|
12
|
+
return SUPPORTED_CODEX_BASE_ROLES.flatMap((baseRole) => SUPPORTED_CODEX_ROLE_TARGETS.map((target) => ({
|
|
13
|
+
baseRole,
|
|
14
|
+
...target,
|
|
15
|
+
roleName: buildCodexMaterializedRoleName({
|
|
16
|
+
agentName: baseRole,
|
|
17
|
+
model: target.model,
|
|
18
|
+
effort: target.effort,
|
|
19
|
+
}),
|
|
20
|
+
}))).sort((left, right) => left.roleName.localeCompare(right.roleName));
|
|
21
|
+
}
|
|
@@ -8,10 +8,16 @@ export interface CodexConfigMergeArgs {
|
|
|
8
8
|
desiredRoles: CodexManagedRoleConfig[];
|
|
9
9
|
staleManagedRoles?: string[];
|
|
10
10
|
}
|
|
11
|
+
export interface CodexSingleRoleConfigMergeArgs {
|
|
12
|
+
existingContent: string | null;
|
|
13
|
+
role: CodexManagedRoleConfig;
|
|
14
|
+
staleManagedRoles?: string[];
|
|
15
|
+
}
|
|
11
16
|
export interface CodexConfigMergeResult {
|
|
12
17
|
mergedContent: string;
|
|
13
18
|
changed: boolean;
|
|
14
19
|
removedRoles: string[];
|
|
15
20
|
}
|
|
16
21
|
export declare function mergeCodexConfig({ existingContent, desiredRoles, staleManagedRoles, }: CodexConfigMergeArgs): CodexConfigMergeResult;
|
|
22
|
+
export declare function mergeCodexConfigForRole({ existingContent, role, staleManagedRoles, }: CodexSingleRoleConfigMergeArgs): CodexConfigMergeResult;
|
|
17
23
|
//# sourceMappingURL=config-merge.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-merge.d.ts","sourceRoot":"","sources":["../../../../src/providers/codex/codec/config-merge.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,oBAAoB;IACnC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,YAAY,EAAE,sBAAsB,EAAE,CAAC;IACvC,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC9B;AAED,MAAM,WAAW,sBAAsB;IACrC,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAiCD,wBAAgB,gBAAgB,CAAC,EAC/B,eAAe,EACf,YAAY,EACZ,iBAAsB,GACvB,EAAE,oBAAoB,GAAG,sBAAsB,CAsC/C"}
|
|
1
|
+
{"version":3,"file":"config-merge.d.ts","sourceRoot":"","sources":["../../../../src/providers/codex/codec/config-merge.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,oBAAoB;IACnC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,YAAY,EAAE,sBAAsB,EAAE,CAAC;IACvC,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC9B;AAED,MAAM,WAAW,8BAA8B;IAC7C,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,IAAI,EAAE,sBAAsB,CAAC;IAC7B,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC9B;AAED,MAAM,WAAW,sBAAsB;IACrC,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAiCD,wBAAgB,gBAAgB,CAAC,EAC/B,eAAe,EACf,YAAY,EACZ,iBAAsB,GACvB,EAAE,oBAAoB,GAAG,sBAAsB,CAsC/C;AAED,wBAAgB,uBAAuB,CAAC,EACtC,eAAe,EACf,IAAI,EACJ,iBAAsB,GACvB,EAAE,8BAA8B,GAAG,sBAAsB,CAMzD"}
|
|
@@ -59,3 +59,10 @@ export function mergeCodexConfig({ existingContent, desiredRoles, staleManagedRo
|
|
|
59
59
|
removedRoles,
|
|
60
60
|
};
|
|
61
61
|
}
|
|
62
|
+
export function mergeCodexConfigForRole({ existingContent, role, staleManagedRoles = [], }) {
|
|
63
|
+
return mergeCodexConfig({
|
|
64
|
+
existingContent,
|
|
65
|
+
desiredRoles: [role],
|
|
66
|
+
staleManagedRoles,
|
|
67
|
+
});
|
|
68
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { CanonicalAgentDocument } from '../../../agents/canonical/index.js';
|
|
2
|
+
import { type CodexRoleExport } from './export-to-codex.js';
|
|
3
|
+
export interface CodexMaterializeRoleOptions {
|
|
4
|
+
agent: CanonicalAgentDocument;
|
|
5
|
+
model: string;
|
|
6
|
+
effort: string;
|
|
7
|
+
roleName?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface CodexMaterializedRoleNameOptions {
|
|
10
|
+
agentName: string;
|
|
11
|
+
model: string;
|
|
12
|
+
effort: string;
|
|
13
|
+
}
|
|
14
|
+
export declare function buildCodexMaterializedRoleName({ agentName, model, effort, }: CodexMaterializedRoleNameOptions): string;
|
|
15
|
+
export declare function materializeCodexRole({ agent, model, effort, roleName, }: CodexMaterializeRoleOptions): CodexRoleExport;
|
|
16
|
+
//# sourceMappingURL=materialize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"materialize.d.ts","sourceRoot":"","sources":["../../../../src/providers/codex/codec/materialize.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAGhE,OAAO,EACL,KAAK,eAAe,EAErB,MAAM,mBAAmB,CAAC;AAM3B,MAAM,WAAW,2BAA2B;IAC1C,KAAK,EAAE,sBAAsB,CAAC;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,gCAAgC;IAC/C,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAUD,wBAAgB,8BAA8B,CAAC,EAC7C,SAAS,EACT,KAAK,EACL,MAAM,GACP,EAAE,gCAAgC,GAAG,MAAM,CAY3C;AAWD,wBAAgB,oBAAoB,CAAC,EACnC,KAAK,EACL,KAAK,EACL,MAAM,EACN,QAAQ,GACT,EAAE,2BAA2B,GAAG,eAAe,CA+B/C"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { CliError } from '../../../errors/index.js';
|
|
2
|
+
import { exportCanonicalAgentToCodexRole, } from './export-to-codex.js';
|
|
3
|
+
import { buildCodexMaterializedTargetRoleName, sanitizeCodexRoleName, } from './shared.js';
|
|
4
|
+
function requireNonEmpty(value, label) {
|
|
5
|
+
const normalized = value.trim();
|
|
6
|
+
if (!normalized) {
|
|
7
|
+
throw new CliError(`Cannot materialize Codex role: missing ${label}.`);
|
|
8
|
+
}
|
|
9
|
+
return normalized;
|
|
10
|
+
}
|
|
11
|
+
export function buildCodexMaterializedRoleName({ agentName, model, effort, }) {
|
|
12
|
+
const roleName = buildCodexMaterializedTargetRoleName({
|
|
13
|
+
agentName,
|
|
14
|
+
model,
|
|
15
|
+
effort,
|
|
16
|
+
});
|
|
17
|
+
if (!roleName) {
|
|
18
|
+
throw new CliError('Cannot materialize Codex role: missing role name.');
|
|
19
|
+
}
|
|
20
|
+
return roleName;
|
|
21
|
+
}
|
|
22
|
+
function codexExtensionObject(agent) {
|
|
23
|
+
const extension = agent.extensions.x_codex;
|
|
24
|
+
if (!extension || typeof extension !== 'object' || Array.isArray(extension)) {
|
|
25
|
+
return {};
|
|
26
|
+
}
|
|
27
|
+
return { ...extension };
|
|
28
|
+
}
|
|
29
|
+
export function materializeCodexRole({ agent, model, effort, roleName, }) {
|
|
30
|
+
const materializedModel = requireNonEmpty(model, 'model');
|
|
31
|
+
const materializedEffort = requireNonEmpty(effort, 'effort');
|
|
32
|
+
const materializedRoleName = roleName
|
|
33
|
+
? sanitizeCodexRoleName(roleName)
|
|
34
|
+
: buildCodexMaterializedRoleName({
|
|
35
|
+
agentName: agent.name,
|
|
36
|
+
model: materializedModel,
|
|
37
|
+
effort: materializedEffort,
|
|
38
|
+
});
|
|
39
|
+
if (!materializedRoleName) {
|
|
40
|
+
throw new CliError('Cannot materialize Codex role: missing role name.');
|
|
41
|
+
}
|
|
42
|
+
return exportCanonicalAgentToCodexRole({
|
|
43
|
+
...agent,
|
|
44
|
+
name: materializedRoleName,
|
|
45
|
+
frontmatter: {
|
|
46
|
+
...agent.frontmatter,
|
|
47
|
+
name: materializedRoleName,
|
|
48
|
+
},
|
|
49
|
+
extensions: {
|
|
50
|
+
...agent.extensions,
|
|
51
|
+
x_codex: {
|
|
52
|
+
...codexExtensionObject(agent),
|
|
53
|
+
model: materializedModel,
|
|
54
|
+
model_reasoning_effort: materializedEffort,
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
}
|
|
@@ -1,7 +1,27 @@
|
|
|
1
1
|
export declare const OAT_MANAGED_ROLE_HEADER = "# oat-managed: true";
|
|
2
2
|
export declare const OAT_MANAGED_ROLE_NAME_PREFIX = "# oat-role: ";
|
|
3
|
+
export declare const OAT_MANAGED_ROLE_OWNER_PREFIX = "# oat-owner: ";
|
|
4
|
+
export type CodexRoleOwner = 'supported-catalogue' | 'user-config' | 'project-config';
|
|
5
|
+
export declare const SUPPORTED_CODEX_ROLE_TARGETS: readonly ({
|
|
6
|
+
model: string;
|
|
7
|
+
effort: "high" | "medium" | "low" | "xhigh";
|
|
8
|
+
} | {
|
|
9
|
+
model: string;
|
|
10
|
+
effort: "high" | "medium" | "low" | "xhigh";
|
|
11
|
+
} | {
|
|
12
|
+
model: string;
|
|
13
|
+
effort: string;
|
|
14
|
+
})[];
|
|
3
15
|
export declare function sanitizeCodexRoleName(input: string): string;
|
|
16
|
+
export declare function normalizeCodexRoleName(input: string): string;
|
|
17
|
+
export declare function buildCodexMaterializedTargetRoleName(options: {
|
|
18
|
+
agentName: string;
|
|
19
|
+
model: string;
|
|
20
|
+
effort: string;
|
|
21
|
+
}): string;
|
|
4
22
|
export declare function isOatManagedCodexRoleFile(content: string, roleName?: string): boolean;
|
|
5
23
|
export declare function withOatManagedCodexHeader(roleName: string, tomlBody: string): string;
|
|
24
|
+
export declare function readOatManagedCodexRoleOwner(content: string): CodexRoleOwner | null;
|
|
25
|
+
export declare function withOatManagedCodexRoleOwner(content: string, owner: CodexRoleOwner): string;
|
|
6
26
|
export declare function stringifyToml(object: Record<string, unknown>): string;
|
|
7
27
|
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../../src/providers/codex/codec/shared.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../../src/providers/codex/codec/shared.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,uBAAuB,wBAAwB,CAAC;AAC7D,eAAO,MAAM,4BAA4B,iBAAiB,CAAC;AAC3D,eAAO,MAAM,6BAA6B,kBAAkB,CAAC;AAE7D,MAAM,MAAM,cAAc,GACtB,qBAAqB,GACrB,aAAa,GACb,gBAAgB,CAAC;AAoBrB,eAAO,MAAM,4BAA4B;;;;;;;;;IAa/B,CAAC;AAEX,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAO5D;AAQD,wBAAgB,oCAAoC,CAAC,OAAO,EAAE;IAC5D,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,GAAG,MAAM,CAiBT;AAgDD,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,MAAM,EACf,QAAQ,CAAC,EAAE,MAAM,GAChB,OAAO,CAOT;AAED,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,GACf,MAAM,CAER;AAED,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,MAAM,GACd,cAAc,GAAG,IAAI,CAEvB;AAED,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,cAAc,GACpB,MAAM,CAkBR;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAErE"}
|
|
@@ -1,21 +1,122 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
1
2
|
import TOML from '@iarna/toml';
|
|
2
3
|
export const OAT_MANAGED_ROLE_HEADER = '# oat-managed: true';
|
|
3
4
|
export const OAT_MANAGED_ROLE_NAME_PREFIX = '# oat-role: ';
|
|
5
|
+
export const OAT_MANAGED_ROLE_OWNER_PREFIX = '# oat-owner: ';
|
|
6
|
+
const CODEX_ROLE_MARKER_PATTERN = /^# oat-role: ([a-zA-Z0-9_-]+)$/;
|
|
7
|
+
const CODEX_OWNER_MARKER_PATTERN = /^# oat-owner: (supported-catalogue|user-config|project-config)$/;
|
|
8
|
+
const STANDARD_SUPPORTED_CODEX_EFFORTS = [
|
|
9
|
+
'low',
|
|
10
|
+
'medium',
|
|
11
|
+
'high',
|
|
12
|
+
'xhigh',
|
|
13
|
+
];
|
|
14
|
+
export const SUPPORTED_CODEX_ROLE_TARGETS = [
|
|
15
|
+
...STANDARD_SUPPORTED_CODEX_EFFORTS.map((effort) => ({
|
|
16
|
+
model: 'gpt-5.6-luna',
|
|
17
|
+
effort,
|
|
18
|
+
})),
|
|
19
|
+
...STANDARD_SUPPORTED_CODEX_EFFORTS.map((effort) => ({
|
|
20
|
+
model: 'gpt-5.6-terra',
|
|
21
|
+
effort,
|
|
22
|
+
})),
|
|
23
|
+
...[...STANDARD_SUPPORTED_CODEX_EFFORTS, 'max'].map((effort) => ({
|
|
24
|
+
model: 'gpt-5.6-sol',
|
|
25
|
+
effort,
|
|
26
|
+
})),
|
|
27
|
+
];
|
|
4
28
|
export function sanitizeCodexRoleName(input) {
|
|
5
|
-
return input.
|
|
29
|
+
return normalizeCodexRoleName(input.replace(/\.md$/i, ''));
|
|
30
|
+
}
|
|
31
|
+
export function normalizeCodexRoleName(input) {
|
|
32
|
+
return input
|
|
33
|
+
.trim()
|
|
34
|
+
.toLowerCase()
|
|
35
|
+
.replace(/[^a-z0-9_-]+/g, '-')
|
|
36
|
+
.replace(/-{2,}/g, '-')
|
|
37
|
+
.replace(/^-+|-+$/g, '');
|
|
38
|
+
}
|
|
39
|
+
function isSupportedCodexRoleTarget(model, effort) {
|
|
40
|
+
return SUPPORTED_CODEX_ROLE_TARGETS.some((supported) => supported.model === model && supported.effort === effort);
|
|
41
|
+
}
|
|
42
|
+
export function buildCodexMaterializedTargetRoleName(options) {
|
|
43
|
+
const normalizedAgentName = sanitizeCodexRoleName(options.agentName);
|
|
44
|
+
const normalizedModel = normalizeCodexRoleName(options.model);
|
|
45
|
+
const normalizedEffort = normalizeCodexRoleName(options.effort);
|
|
46
|
+
const customTargetSuffix = isSupportedCodexRoleTarget(options.model, options.effort)
|
|
47
|
+
? ''
|
|
48
|
+
: `-${createHash('sha256')
|
|
49
|
+
.update(`${options.model}\0${options.effort}`)
|
|
50
|
+
.digest('hex')
|
|
51
|
+
.slice(0, 10)}`;
|
|
52
|
+
return normalizeCodexRoleName(`${normalizedAgentName}-${normalizedModel}-${normalizedEffort}${customTargetSuffix}`);
|
|
53
|
+
}
|
|
54
|
+
function parseOatManagedCodexRoleHeader(content) {
|
|
55
|
+
const lines = content
|
|
56
|
+
.split('\n')
|
|
57
|
+
.map((line) => (line.endsWith('\r') ? line.slice(0, -1) : line));
|
|
58
|
+
const headerLines = [];
|
|
59
|
+
for (const line of lines) {
|
|
60
|
+
if (!line.startsWith('# oat-')) {
|
|
61
|
+
break;
|
|
62
|
+
}
|
|
63
|
+
headerLines.push(line);
|
|
64
|
+
}
|
|
65
|
+
if (headerLines.length < 2 ||
|
|
66
|
+
headerLines.length > 3 ||
|
|
67
|
+
headerLines[0] !== OAT_MANAGED_ROLE_HEADER) {
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
const roleMatch = CODEX_ROLE_MARKER_PATTERN.exec(headerLines[1]);
|
|
71
|
+
if (!roleMatch) {
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
let owner = null;
|
|
75
|
+
let ownerLineIndex = null;
|
|
76
|
+
if (headerLines.length === 3) {
|
|
77
|
+
const ownerMatch = CODEX_OWNER_MARKER_PATTERN.exec(headerLines[2]);
|
|
78
|
+
if (!ownerMatch) {
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
owner = ownerMatch[1];
|
|
82
|
+
ownerLineIndex = 2;
|
|
83
|
+
}
|
|
84
|
+
return {
|
|
85
|
+
roleName: roleMatch[1],
|
|
86
|
+
roleLineIndex: 1,
|
|
87
|
+
owner,
|
|
88
|
+
ownerLineIndex,
|
|
89
|
+
};
|
|
6
90
|
}
|
|
7
91
|
export function isOatManagedCodexRoleFile(content, roleName) {
|
|
8
|
-
|
|
92
|
+
const header = parseOatManagedCodexRoleHeader(content);
|
|
93
|
+
if (!header) {
|
|
9
94
|
return false;
|
|
10
95
|
}
|
|
11
|
-
|
|
12
|
-
return true;
|
|
13
|
-
}
|
|
14
|
-
return content.includes(`${OAT_MANAGED_ROLE_NAME_PREFIX}${roleName}`);
|
|
96
|
+
return roleName === undefined || header.roleName === roleName;
|
|
15
97
|
}
|
|
16
98
|
export function withOatManagedCodexHeader(roleName, tomlBody) {
|
|
17
99
|
return `${OAT_MANAGED_ROLE_HEADER}\n${OAT_MANAGED_ROLE_NAME_PREFIX}${roleName}\n${tomlBody}`;
|
|
18
100
|
}
|
|
101
|
+
export function readOatManagedCodexRoleOwner(content) {
|
|
102
|
+
return parseOatManagedCodexRoleHeader(content)?.owner ?? null;
|
|
103
|
+
}
|
|
104
|
+
export function withOatManagedCodexRoleOwner(content, owner) {
|
|
105
|
+
const header = parseOatManagedCodexRoleHeader(content);
|
|
106
|
+
if (!header) {
|
|
107
|
+
return content;
|
|
108
|
+
}
|
|
109
|
+
const lines = content.split('\n');
|
|
110
|
+
const ownerLine = `${OAT_MANAGED_ROLE_OWNER_PREFIX}${owner}`;
|
|
111
|
+
const usesCarriageReturn = lines[header.roleLineIndex]?.endsWith('\r') ?? false;
|
|
112
|
+
const encodedOwnerLine = `${ownerLine}${usesCarriageReturn ? '\r' : ''}`;
|
|
113
|
+
if (header.ownerLineIndex !== null) {
|
|
114
|
+
lines[header.ownerLineIndex] = encodedOwnerLine;
|
|
115
|
+
return lines.join('\n');
|
|
116
|
+
}
|
|
117
|
+
lines.splice(header.roleLineIndex + 1, 0, encodedOwnerLine);
|
|
118
|
+
return lines.join('\n');
|
|
119
|
+
}
|
|
19
120
|
export function stringifyToml(object) {
|
|
20
121
|
return TOML.stringify(object);
|
|
21
122
|
}
|
|
@@ -21,7 +21,12 @@ export interface CodexExtensionApplyResult {
|
|
|
21
21
|
failed: number;
|
|
22
22
|
skipped: number;
|
|
23
23
|
}
|
|
24
|
-
|
|
24
|
+
interface CodexMaterializationTargetOptions {
|
|
25
|
+
userConfigDir?: string;
|
|
26
|
+
projectPath?: string | null;
|
|
27
|
+
env?: NodeJS.ProcessEnv;
|
|
28
|
+
}
|
|
29
|
+
export declare function computeCodexProjectExtensionPlan(scopeRoot: string, canonicalEntries: CanonicalEntry[], allowedCanonicalPaths?: string[], options?: CodexMaterializationTargetOptions): Promise<CodexExtensionPlan>;
|
|
25
30
|
export declare function applyCodexProjectExtensionPlan(scopeRoot: string, plan: CodexExtensionPlan): Promise<CodexExtensionApplyResult>;
|
|
26
31
|
export declare function hasCodexExtensionChanges(plan: CodexExtensionPlan): boolean;
|
|
27
32
|
export declare function summarizeCodexExtension(plan: CodexExtensionPlan): {
|
|
@@ -29,4 +34,5 @@ export declare function summarizeCodexExtension(plan: CodexExtensionPlan): {
|
|
|
29
34
|
skipped: number;
|
|
30
35
|
};
|
|
31
36
|
export declare function toCodexExtensionOperations(plan: CodexExtensionPlan): CodexExtensionOperation[];
|
|
37
|
+
export {};
|
|
32
38
|
//# sourceMappingURL=sync-extension.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync-extension.d.ts","sourceRoot":"","sources":["../../../../src/providers/codex/codec/sync-extension.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sync-extension.d.ts","sourceRoot":"","sources":["../../../../src/providers/codex/codec/sync-extension.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAqBpD,MAAM,MAAM,oBAAoB,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,CAAC;AAC3E,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,QAAQ,CAAC;AAErD,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,oBAAoB,CAAC;IAC7B,MAAM,EAAE,oBAAoB,CAAC;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,4BAA6B,SAAQ,uBAAuB;IAC3E,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,4BAA4B,EAAE,CAAC;IAC3C,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,mBAAmB,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,yBAAyB;IACxC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB;AAgBD,UAAU,iCAAiC;IACzC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;CACzB;AAwhBD,wBAAsB,gCAAgC,CACpD,SAAS,EAAE,MAAM,EACjB,gBAAgB,EAAE,cAAc,EAAE,EAClC,qBAAqB,CAAC,EAAE,MAAM,EAAE,EAChC,OAAO,GAAE,iCAAsC,GAC9C,OAAO,CAAC,kBAAkB,CAAC,CA+I7B;AAED,wBAAsB,8BAA8B,CAClD,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,kBAAkB,GACvB,OAAO,CAAC,yBAAyB,CAAC,CA6BpC;AAED,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAE1E;AAED,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,kBAAkB,GAAG;IACjE,iBAAiB,EAAE,MAAM,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;CACjB,CAaA;AAED,wBAAgB,0BAA0B,CACxC,IAAI,EAAE,kBAAkB,GACvB,uBAAuB,EAAE,CAQ3B"}
|