codex-config 0.1.0 → 0.3.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 +66 -18
- package/config.schema.json +5534 -0
- package/config.toml.template +3 -11
- package/dist/cli.js +10 -6
- package/dist/cli.js.map +1 -1
- package/dist/codex-migrations.d.ts +4 -0
- package/dist/codex-migrations.js +178 -0
- package/dist/codex-migrations.js.map +1 -0
- package/dist/codex-policy.d.ts +17 -0
- package/dist/codex-policy.js +250 -0
- package/dist/codex-policy.js.map +1 -0
- package/dist/codex-target.generated.d.ts +60 -0
- package/dist/codex-target.generated.js +127 -0
- package/dist/codex-target.generated.js.map +1 -0
- package/dist/commands.d.ts +17 -1
- package/dist/commands.js +94 -18
- package/dist/commands.js.map +1 -1
- package/dist/paths.d.ts +4 -1
- package/dist/paths.js +18 -3
- package/dist/paths.js.map +1 -1
- package/dist/toml-merge.d.ts +2 -1
- package/dist/toml-merge.js +31 -0
- package/dist/toml-merge.js.map +1 -1
- package/package.json +6 -3
package/config.toml.template
CHANGED
|
@@ -1,32 +1,24 @@
|
|
|
1
1
|
approval_policy = "never"
|
|
2
|
-
|
|
2
|
+
default_permissions = ":danger-full-access"
|
|
3
3
|
model_reasoning_effort = "high"
|
|
4
4
|
plan_mode_reasoning_effort = "high"
|
|
5
5
|
web_search = "live"
|
|
6
|
-
model = "gpt-5.
|
|
7
|
-
#model_context_window = 1050000
|
|
8
|
-
personality = "friendly"
|
|
6
|
+
model = "gpt-5.6-sol"
|
|
9
7
|
# model_reasoning_summary options: "auto", "concise", "detailed", "none"
|
|
10
8
|
model_reasoning_summary = "concise"
|
|
11
9
|
service_tier = "fast"
|
|
12
|
-
suppress_unstable_features_warning = true
|
|
13
10
|
|
|
14
11
|
[analytics]
|
|
15
12
|
enabled = false
|
|
16
13
|
|
|
17
14
|
[features]
|
|
18
|
-
multi_agent = true
|
|
19
|
-
image_detail_original = true
|
|
20
15
|
memories = true
|
|
21
|
-
terminal_resize_reflow = true
|
|
22
|
-
goals = true
|
|
23
16
|
|
|
24
17
|
[tui]
|
|
25
18
|
alternate_screen = "never"
|
|
26
19
|
status_line = ["model-with-reasoning", "project-name", "context-used", "weekly-limit", "fast-mode", "five-hour-limit"]
|
|
27
|
-
terminal_title = ["
|
|
20
|
+
terminal_title = ["activity", "project-name", "run-state", "task-progress"]
|
|
28
21
|
|
|
29
22
|
[memories]
|
|
30
23
|
use_memories = true
|
|
31
24
|
generate_memories = true
|
|
32
|
-
|
package/dist/cli.js
CHANGED
|
@@ -4,15 +4,16 @@ import { applyConfig, diffConfig, doctor, formatDoctorText, formatTextResult, }
|
|
|
4
4
|
let jsonMode = false;
|
|
5
5
|
program
|
|
6
6
|
.name("codex-config")
|
|
7
|
-
.description("
|
|
8
|
-
.version("0.
|
|
7
|
+
.description("Keep the active Codex config aligned with the supported GPT-5.6 family.")
|
|
8
|
+
.version("0.3.0")
|
|
9
9
|
.option("--json", "print machine-readable JSON");
|
|
10
10
|
program
|
|
11
11
|
.command("apply")
|
|
12
12
|
.description("Apply the template to the target config.")
|
|
13
13
|
.option("--target <path>", "target config.toml path")
|
|
14
|
+
.option("-p, --profile <name>", "target $CODEX_HOME/<name>.config.toml")
|
|
14
15
|
.option("--template <path>", "template config.toml path")
|
|
15
|
-
.option("--
|
|
16
|
+
.option("-f, --force", "overwrite template-covered keys that already exist")
|
|
16
17
|
.option("--dry-run", "show planned changes without writing")
|
|
17
18
|
.option("--json", "print machine-readable JSON")
|
|
18
19
|
.action(async (options) => {
|
|
@@ -24,8 +25,9 @@ program
|
|
|
24
25
|
.command("diff")
|
|
25
26
|
.description("Show whether applying the template would change the target.")
|
|
26
27
|
.option("--target <path>", "target config.toml path")
|
|
28
|
+
.option("-p, --profile <name>", "target $CODEX_HOME/<name>.config.toml")
|
|
27
29
|
.option("--template <path>", "template config.toml path")
|
|
28
|
-
.option("--
|
|
30
|
+
.option("-f, --force", "compare using force behavior")
|
|
29
31
|
.option("--json", "print machine-readable JSON")
|
|
30
32
|
.action(async (options) => {
|
|
31
33
|
jsonMode = shouldUseJson(options);
|
|
@@ -36,8 +38,9 @@ program
|
|
|
36
38
|
.command("check")
|
|
37
39
|
.description("Exit nonzero when the target is not up to date with the template.")
|
|
38
40
|
.option("--target <path>", "target config.toml path")
|
|
41
|
+
.option("-p, --profile <name>", "target $CODEX_HOME/<name>.config.toml")
|
|
39
42
|
.option("--template <path>", "template config.toml path")
|
|
40
|
-
.option("--
|
|
43
|
+
.option("-f, --force", "check using force behavior")
|
|
41
44
|
.option("--json", "print machine-readable JSON")
|
|
42
45
|
.action(async (options) => {
|
|
43
46
|
jsonMode = shouldUseJson(options);
|
|
@@ -49,8 +52,9 @@ program
|
|
|
49
52
|
});
|
|
50
53
|
program
|
|
51
54
|
.command("doctor")
|
|
52
|
-
.description("Validate
|
|
55
|
+
.description("Validate the target against the pinned Codex schema and GPT-5.6 policy.")
|
|
53
56
|
.option("--target <path>", "target config.toml path")
|
|
57
|
+
.option("-p, --profile <name>", "target $CODEX_HOME/<name>.config.toml")
|
|
54
58
|
.option("--template <path>", "template config.toml path")
|
|
55
59
|
.option("--json", "print machine-readable JSON")
|
|
56
60
|
.action(async (options) => {
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EACL,WAAW,EACX,UAAU,EACV,MAAM,EACN,gBAAgB,EAChB,gBAAgB,GAEjB,MAAM,eAAe,CAAC;AAOvB,IAAI,QAAQ,GAAG,KAAK,CAAC;AAErB,OAAO;KACJ,IAAI,CAAC,cAAc,CAAC;KACpB,WAAW,CAAC,
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,O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O,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;QACxF,OAAO;IACT,CAAC;IACD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,OAAO,IAAI,CAAC,CAAC;AAC9C,CAAC;AAED,SAAS,aAAa,CAAC,OAAmB;IACxC,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,EAAsB,CAAC,IAAI,CAAC,CAAC;AAC1E,CAAC;AAED,SAAS,wBAAwB,CAAC,KAAc;IAC9C,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,CAAC,MAAM,IAAI,KAAK,CAAC,EAAE,CAAC;QACtE,OAAO,KAAK,CAAC;IACf,CAAC;IACD,MAAM,IAAI,GAAI,KAA4B,CAAC,IAAI,CAAC;IAChD,OAAO,IAAI,KAAK,yBAAyB,IAAI,IAAI,KAAK,mBAAmB,CAAC;AAC5E,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type ConfigChangePlan } from "./toml-merge.js";
|
|
2
|
+
export declare function planCodexMigrations(targetText: string): ConfigChangePlan;
|
|
3
|
+
export declare const STATUS_LINE_LEGACY_IDS: readonly string[];
|
|
4
|
+
export declare const TERMINAL_TITLE_LEGACY_IDS: readonly string[];
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { parse, stringify } from "smol-toml";
|
|
2
|
+
import { CODEX_TARGET } from "./codex-target.generated.js";
|
|
3
|
+
import { planConfigChange, planConfigRemovals, } from "./toml-merge.js";
|
|
4
|
+
const SANDBOX_PERMISSION_PROFILES = {
|
|
5
|
+
"danger-full-access": ":danger-full-access",
|
|
6
|
+
"workspace-write": ":workspace",
|
|
7
|
+
"read-only": ":read-only",
|
|
8
|
+
};
|
|
9
|
+
const STATUS_LINE_ALIASES = {
|
|
10
|
+
"model-name": "model",
|
|
11
|
+
project: "project-name",
|
|
12
|
+
"project-root": "project-name",
|
|
13
|
+
status: "run-state",
|
|
14
|
+
approval: "approval-mode",
|
|
15
|
+
"context-usage": "context-used",
|
|
16
|
+
"session-id": "thread-id",
|
|
17
|
+
};
|
|
18
|
+
const TERMINAL_TITLE_ALIASES = {
|
|
19
|
+
project: "project-name",
|
|
20
|
+
spinner: "activity",
|
|
21
|
+
status: "run-state",
|
|
22
|
+
thread: "thread-title",
|
|
23
|
+
"context-usage": "context-used",
|
|
24
|
+
"session-id": "thread-id",
|
|
25
|
+
"model-name": "model",
|
|
26
|
+
};
|
|
27
|
+
export function planCodexMigrations(targetText) {
|
|
28
|
+
const parsed = parseTarget(targetText);
|
|
29
|
+
const migrationValues = {};
|
|
30
|
+
const featureUpdates = {};
|
|
31
|
+
const supportedModels = new Set(CODEX_TARGET.models.map((model) => model.id));
|
|
32
|
+
if (hasPath(parsed, ["model"])) {
|
|
33
|
+
const model = getPath(parsed, ["model"]);
|
|
34
|
+
if (typeof model !== "string" || !supportedModels.has(model)) {
|
|
35
|
+
migrationValues.model = CODEX_TARGET.defaultModel;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
const sandboxMode = getPath(parsed, ["sandbox_mode"]);
|
|
39
|
+
const defaultPermissions = getPath(parsed, ["default_permissions"]);
|
|
40
|
+
const migratedPermissionProfile = typeof sandboxMode === "string" ? SANDBOX_PERMISSION_PROFILES[sandboxMode] : undefined;
|
|
41
|
+
if (defaultPermissions === undefined && migratedPermissionProfile) {
|
|
42
|
+
migrationValues.default_permissions = migratedPermissionProfile;
|
|
43
|
+
}
|
|
44
|
+
for (const [alias, canonical] of Object.entries(CODEX_TARGET.legacyFeatureAliases)) {
|
|
45
|
+
if (alias === "web_search" || !hasPath(parsed, ["features", alias])) {
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
if (!CODEX_TARGET.removedFeatureKeys.includes(canonical) &&
|
|
49
|
+
!hasPath(parsed, ["features", canonical])) {
|
|
50
|
+
featureUpdates[canonical] = getPath(parsed, ["features", alias]);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
const legacyUnifiedExec = getPath(parsed, ["experimental_use_unified_exec_tool"]);
|
|
54
|
+
if (legacyUnifiedExec !== undefined &&
|
|
55
|
+
!hasPath(parsed, ["features", "unified_exec"]) &&
|
|
56
|
+
!Object.prototype.hasOwnProperty.call(featureUpdates, "unified_exec")) {
|
|
57
|
+
featureUpdates.unified_exec = legacyUnifiedExec;
|
|
58
|
+
}
|
|
59
|
+
const legacyWebSearchPaths = [
|
|
60
|
+
["features", "web_search"],
|
|
61
|
+
["features", "web_search_cached"],
|
|
62
|
+
["features", "web_search_request"],
|
|
63
|
+
];
|
|
64
|
+
if (getPath(parsed, ["web_search"]) === undefined &&
|
|
65
|
+
legacyWebSearchPaths.some((path) => hasPath(parsed, path))) {
|
|
66
|
+
migrationValues.web_search = legacyWebSearchMode(parsed);
|
|
67
|
+
}
|
|
68
|
+
if (Object.keys(featureUpdates).length > 0) {
|
|
69
|
+
migrationValues.features = featureUpdates;
|
|
70
|
+
}
|
|
71
|
+
const tuiUpdates = {};
|
|
72
|
+
const statusLine = getPath(parsed, ["tui", "status_line"]);
|
|
73
|
+
const migratedStatusLine = migrateAliases(statusLine, STATUS_LINE_ALIASES);
|
|
74
|
+
if (migratedStatusLine) {
|
|
75
|
+
tuiUpdates.status_line = migratedStatusLine;
|
|
76
|
+
}
|
|
77
|
+
const terminalTitle = getPath(parsed, ["tui", "terminal_title"]);
|
|
78
|
+
const migratedTerminalTitle = migrateAliases(terminalTitle, TERMINAL_TITLE_ALIASES);
|
|
79
|
+
if (migratedTerminalTitle) {
|
|
80
|
+
tuiUpdates.terminal_title = migratedTerminalTitle;
|
|
81
|
+
}
|
|
82
|
+
if (Object.keys(tuiUpdates).length > 0) {
|
|
83
|
+
migrationValues.tui = tuiUpdates;
|
|
84
|
+
}
|
|
85
|
+
const updatePlan = planConfigChange({
|
|
86
|
+
targetText,
|
|
87
|
+
templateText: stringify(migrationValues),
|
|
88
|
+
mode: "override",
|
|
89
|
+
});
|
|
90
|
+
const removalPaths = [];
|
|
91
|
+
if (hasPath(parsed, ["personality"])) {
|
|
92
|
+
removalPaths.push(["personality"]);
|
|
93
|
+
}
|
|
94
|
+
if (hasPath(parsed, ["experimental_use_unified_exec_tool"])) {
|
|
95
|
+
removalPaths.push(["experimental_use_unified_exec_tool"]);
|
|
96
|
+
}
|
|
97
|
+
if (hasPath(parsed, ["sandbox_mode"]) &&
|
|
98
|
+
(defaultPermissions !== undefined || migratedPermissionProfile !== undefined)) {
|
|
99
|
+
removalPaths.push(["sandbox_mode"]);
|
|
100
|
+
}
|
|
101
|
+
for (const key of CODEX_TARGET.removedFeatureKeys) {
|
|
102
|
+
if (hasPath(parsed, ["features", key])) {
|
|
103
|
+
removalPaths.push(["features", key]);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
for (const alias of Object.keys(CODEX_TARGET.legacyFeatureAliases)) {
|
|
107
|
+
if (hasPath(parsed, ["features", alias])) {
|
|
108
|
+
removalPaths.push(["features", alias]);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
for (const key of ["web_search_cached", "web_search_request"]) {
|
|
112
|
+
if (hasPath(parsed, ["features", key])) {
|
|
113
|
+
removalPaths.push(["features", key]);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
const removalPlan = planConfigRemovals(updatePlan.outputText, removalPaths);
|
|
117
|
+
return combinePlans(updatePlan, removalPlan);
|
|
118
|
+
}
|
|
119
|
+
export const STATUS_LINE_LEGACY_IDS = Object.freeze(Object.keys(STATUS_LINE_ALIASES));
|
|
120
|
+
export const TERMINAL_TITLE_LEGACY_IDS = Object.freeze(Object.keys(TERMINAL_TITLE_ALIASES));
|
|
121
|
+
function parseTarget(text) {
|
|
122
|
+
try {
|
|
123
|
+
return parse(text);
|
|
124
|
+
}
|
|
125
|
+
catch (error) {
|
|
126
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
127
|
+
throw new Error(`Invalid target TOML: ${message}`);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
function migrateAliases(value, aliases) {
|
|
131
|
+
if (!Array.isArray(value) || value.some((item) => typeof item !== "string")) {
|
|
132
|
+
return undefined;
|
|
133
|
+
}
|
|
134
|
+
const migrated = [...new Set(value.map((item) => aliases[item] ?? item))];
|
|
135
|
+
return JSON.stringify(migrated) === JSON.stringify(value) ? undefined : migrated;
|
|
136
|
+
}
|
|
137
|
+
function legacyWebSearchMode(parsed) {
|
|
138
|
+
if (getPath(parsed, ["features", "web_search_cached"]) === true) {
|
|
139
|
+
return "cached";
|
|
140
|
+
}
|
|
141
|
+
if (getPath(parsed, ["features", "web_search_request"]) === true ||
|
|
142
|
+
getPath(parsed, ["features", "web_search"]) === true) {
|
|
143
|
+
return "live";
|
|
144
|
+
}
|
|
145
|
+
return "disabled";
|
|
146
|
+
}
|
|
147
|
+
function combinePlans(first, second) {
|
|
148
|
+
const operations = [...first.operations, ...second.operations];
|
|
149
|
+
return {
|
|
150
|
+
changed: first.changed || second.changed,
|
|
151
|
+
outputText: second.outputText,
|
|
152
|
+
operations,
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
function getPath(value, path) {
|
|
156
|
+
let current = value;
|
|
157
|
+
for (const segment of path) {
|
|
158
|
+
if (!isRecord(current) || !Object.prototype.hasOwnProperty.call(current, segment)) {
|
|
159
|
+
return undefined;
|
|
160
|
+
}
|
|
161
|
+
current = current[segment];
|
|
162
|
+
}
|
|
163
|
+
return current;
|
|
164
|
+
}
|
|
165
|
+
function hasPath(value, path) {
|
|
166
|
+
let current = value;
|
|
167
|
+
for (const segment of path) {
|
|
168
|
+
if (!isRecord(current) || !Object.prototype.hasOwnProperty.call(current, segment)) {
|
|
169
|
+
return false;
|
|
170
|
+
}
|
|
171
|
+
current = current[segment];
|
|
172
|
+
}
|
|
173
|
+
return true;
|
|
174
|
+
}
|
|
175
|
+
function isRecord(value) {
|
|
176
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
177
|
+
}
|
|
178
|
+
//# sourceMappingURL=codex-migrations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codex-migrations.js","sourceRoot":"","sources":["../src/codex-migrations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EACL,gBAAgB,EAChB,kBAAkB,GAGnB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,2BAA2B,GAAqC;IACpE,oBAAoB,EAAE,qBAAqB;IAC3C,iBAAiB,EAAE,YAAY;IAC/B,WAAW,EAAE,YAAY;CAC1B,CAAC;AAEF,MAAM,mBAAmB,GAAqC;IAC5D,YAAY,EAAE,OAAO;IACrB,OAAO,EAAE,cAAc;IACvB,cAAc,EAAE,cAAc;IAC9B,MAAM,EAAE,WAAW;IACnB,QAAQ,EAAE,eAAe;IACzB,eAAe,EAAE,cAAc;IAC/B,YAAY,EAAE,WAAW;CAC1B,CAAC;AAEF,MAAM,sBAAsB,GAAqC;IAC/D,OAAO,EAAE,cAAc;IACvB,OAAO,EAAE,UAAU;IACnB,MAAM,EAAE,WAAW;IACnB,MAAM,EAAE,cAAc;IACtB,eAAe,EAAE,cAAc;IAC/B,YAAY,EAAE,WAAW;IACzB,YAAY,EAAE,OAAO;CACtB,CAAC;AAEF,MAAM,UAAU,mBAAmB,CAAC,UAAkB;IACpD,MAAM,MAAM,GAAG,WAAW,CAAC,UAAU,CAAC,CAAC;IACvC,MAAM,eAAe,GAA4B,EAAE,CAAC;IACpD,MAAM,cAAc,GAA4B,EAAE,CAAC;IACnD,MAAM,eAAe,GAAG,IAAI,GAAG,CAAS,YAAY,CAAC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face ConfigIssue {
|
|
3
|
+
severity: "error" | "warning";
|
|
4
|
+
code: string;
|
|
5
|
+
path: string;
|
|
6
|
+
message: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ConfigInspection {
|
|
9
|
+
valid: boolean;
|
|
10
|
+
clean: boolean;
|
|
11
|
+
issues: ConfigIssue[];
|
|
12
|
+
}
|
|
13
|
+
export declare function inspectCodexConfig(text: string, label: string, options: {
|
|
14
|
+
requireModel: boolean;
|
|
15
|
+
}): Promise<ConfigInspection>;
|
|
16
|
+
export declare function formatConfigIssues(label: string, inspection: ConfigInspection): string;
|
|
17
|
+
export { CODEX_TARGET };
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
import { readFile } from "node:fs/promises";
|
|
2
|
+
import { Ajv } from "ajv/dist/ajv.js";
|
|
3
|
+
import { parse } from "smol-toml";
|
|
4
|
+
import { STATUS_LINE_LEGACY_IDS, TERMINAL_TITLE_LEGACY_IDS } from "./codex-migrations.js";
|
|
5
|
+
import { CODEX_TARGET } from "./codex-target.generated.js";
|
|
6
|
+
import { defaultSchemaPath } from "./paths.js";
|
|
7
|
+
let validatorPromise;
|
|
8
|
+
export async function inspectCodexConfig(text, label, options) {
|
|
9
|
+
let parsed;
|
|
10
|
+
try {
|
|
11
|
+
parsed = parse(text);
|
|
12
|
+
}
|
|
13
|
+
catch (error) {
|
|
14
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
15
|
+
return inspectionFromIssues([
|
|
16
|
+
{
|
|
17
|
+
severity: "error",
|
|
18
|
+
code: "invalid_toml",
|
|
19
|
+
path: "",
|
|
20
|
+
message: `Invalid ${label} TOML: ${message}`,
|
|
21
|
+
},
|
|
22
|
+
]);
|
|
23
|
+
}
|
|
24
|
+
const issues = [];
|
|
25
|
+
const validator = await configValidator();
|
|
26
|
+
if (!validator(parsed)) {
|
|
27
|
+
issues.push(...(validator.errors ?? []).map(schemaIssue));
|
|
28
|
+
}
|
|
29
|
+
issues.push(...policyIssues(parsed, options));
|
|
30
|
+
return inspectionFromIssues(deduplicateIssues(issues));
|
|
31
|
+
}
|
|
32
|
+
export function formatConfigIssues(label, inspection) {
|
|
33
|
+
return inspection.issues
|
|
34
|
+
.map((issue) => {
|
|
35
|
+
const location = issue.path ? ` at ${issue.path}` : "";
|
|
36
|
+
return `${label}${location}: ${issue.message}`;
|
|
37
|
+
})
|
|
38
|
+
.join("\n");
|
|
39
|
+
}
|
|
40
|
+
export { CODEX_TARGET };
|
|
41
|
+
async function configValidator() {
|
|
42
|
+
validatorPromise ??= readFile(defaultSchemaPath(), "utf8").then((text) => {
|
|
43
|
+
const schema = JSON.parse(text);
|
|
44
|
+
const ajv = new Ajv({ allErrors: true, strict: false, validateFormats: false });
|
|
45
|
+
return ajv.compile(schema);
|
|
46
|
+
});
|
|
47
|
+
return validatorPromise;
|
|
48
|
+
}
|
|
49
|
+
function policyIssues(parsed, options) {
|
|
50
|
+
const issues = [];
|
|
51
|
+
const modelValue = getPath(parsed, ["model"]);
|
|
52
|
+
const model = typeof modelValue === "string"
|
|
53
|
+
? CODEX_TARGET.models.find((candidate) => candidate.id === modelValue)
|
|
54
|
+
: undefined;
|
|
55
|
+
if (modelValue === undefined && options.requireModel) {
|
|
56
|
+
issues.push({
|
|
57
|
+
severity: "error",
|
|
58
|
+
code: "model_required",
|
|
59
|
+
path: "model",
|
|
60
|
+
message: `A GPT-5.6 model is required; use ${CODEX_TARGET.defaultModel}.`,
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
else if (modelValue !== undefined && !model) {
|
|
64
|
+
issues.push({
|
|
65
|
+
severity: "error",
|
|
66
|
+
code: "unsupported_model",
|
|
67
|
+
path: "model",
|
|
68
|
+
message: `Only ${CODEX_TARGET.models.map((candidate) => candidate.id).join(", ")} are supported.`,
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
if (model) {
|
|
72
|
+
for (const path of [["model_reasoning_effort"], ["plan_mode_reasoning_effort"]]) {
|
|
73
|
+
const effort = getPath(parsed, path);
|
|
74
|
+
if (typeof effort === "string" && !model.reasoningEfforts.includes(effort)) {
|
|
75
|
+
issues.push({
|
|
76
|
+
severity: "error",
|
|
77
|
+
code: "unsupported_reasoning_effort",
|
|
78
|
+
path: path.join("."),
|
|
79
|
+
message: `${model.id} supports reasoning efforts: ${model.reasoningEfforts.join(", ")}.`,
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
const serviceTier = getPath(parsed, ["service_tier"]);
|
|
84
|
+
if (typeof serviceTier === "string") {
|
|
85
|
+
const canonicalTier = serviceTier === "fast" ? "priority" : serviceTier;
|
|
86
|
+
if (canonicalTier !== "default" && !model.serviceTiers.includes(canonicalTier)) {
|
|
87
|
+
issues.push({
|
|
88
|
+
severity: "error",
|
|
89
|
+
code: "unsupported_service_tier",
|
|
90
|
+
path: "service_tier",
|
|
91
|
+
message: `${model.id} supports service tiers: default, ${model.serviceTiers.join(", ")} (fast is an alias for priority).`,
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
if (hasPath(parsed, ["personality"]) && !model?.supportsPersonality) {
|
|
97
|
+
issues.push({
|
|
98
|
+
severity: "warning",
|
|
99
|
+
code: "unsupported_personality",
|
|
100
|
+
path: "personality",
|
|
101
|
+
message: "GPT-5.6 models use model-owned personality instructions and ignore this selector.",
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
if (hasPath(parsed, ["sandbox_mode"])) {
|
|
105
|
+
issues.push({
|
|
106
|
+
severity: "warning",
|
|
107
|
+
code: "legacy_sandbox_mode",
|
|
108
|
+
path: "sandbox_mode",
|
|
109
|
+
message: "Use the built-in default_permissions profile instead.",
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
if (hasPath(parsed, ["experimental_use_unified_exec_tool"])) {
|
|
113
|
+
issues.push({
|
|
114
|
+
severity: "warning",
|
|
115
|
+
code: "legacy_feature_alias",
|
|
116
|
+
path: "experimental_use_unified_exec_tool",
|
|
117
|
+
message: "Use features.unified_exec instead of this legacy top-level toggle.",
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
if (hasPath(parsed, ["profile"])) {
|
|
121
|
+
issues.push({
|
|
122
|
+
severity: "error",
|
|
123
|
+
code: "legacy_profile_selector",
|
|
124
|
+
path: "profile",
|
|
125
|
+
message: "Inline profile selection is no longer supported; use `codex --profile <name>` with `$CODEX_HOME/<name>.config.toml`.",
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
const legacyProfiles = getPath(parsed, ["profiles"]);
|
|
129
|
+
if (isRecord(legacyProfiles) && Object.keys(legacyProfiles).length > 0) {
|
|
130
|
+
issues.push({
|
|
131
|
+
severity: "warning",
|
|
132
|
+
code: "legacy_profiles",
|
|
133
|
+
path: "profiles",
|
|
134
|
+
message: "Inline profile tables are no longer consumed; move each profile to `$CODEX_HOME/<name>.config.toml`.",
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
for (const [alias, canonical] of Object.entries(CODEX_TARGET.legacyFeatureAliases)) {
|
|
138
|
+
if (!hasPath(parsed, ["features", alias])) {
|
|
139
|
+
continue;
|
|
140
|
+
}
|
|
141
|
+
const message = CODEX_TARGET.removedFeatureKeys.includes(canonical)
|
|
142
|
+
? "This legacy alias maps to a removed feature and should be deleted."
|
|
143
|
+
: alias === "web_search"
|
|
144
|
+
? "Use the top-level web_search mode instead of this legacy feature alias."
|
|
145
|
+
: `Use features.${canonical} instead of this legacy feature alias.`;
|
|
146
|
+
issues.push({
|
|
147
|
+
severity: "warning",
|
|
148
|
+
code: "legacy_feature_alias",
|
|
149
|
+
path: `features.${alias}`,
|
|
150
|
+
message,
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
for (const key of CODEX_TARGET.removedFeatureKeys) {
|
|
154
|
+
if (hasPath(parsed, ["features", key])) {
|
|
155
|
+
issues.push({
|
|
156
|
+
severity: "warning",
|
|
157
|
+
code: "removed_feature",
|
|
158
|
+
path: `features.${key}`,
|
|
159
|
+
message: "This feature flag is a removed compatibility no-op.",
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
for (const key of CODEX_TARGET.deprecatedFeatureKeys) {
|
|
164
|
+
if (hasPath(parsed, ["features", key])) {
|
|
165
|
+
issues.push({
|
|
166
|
+
severity: "warning",
|
|
167
|
+
code: "deprecated_feature",
|
|
168
|
+
path: `features.${key}`,
|
|
169
|
+
message: "This feature flag is deprecated in the targeted Codex source.",
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
appendLegacyIdIssues(issues, parsed, ["tui", "status_line"], STATUS_LINE_LEGACY_IDS);
|
|
174
|
+
appendLegacyIdIssues(issues, parsed, ["tui", "terminal_title"], TERMINAL_TITLE_LEGACY_IDS);
|
|
175
|
+
return issues;
|
|
176
|
+
}
|
|
177
|
+
function appendLegacyIdIssues(issues, parsed, path, legacyIds) {
|
|
178
|
+
const value = getPath(parsed, path);
|
|
179
|
+
if (Array.isArray(value) &&
|
|
180
|
+
value.some((item) => typeof item === "string" && legacyIds.includes(item))) {
|
|
181
|
+
issues.push({
|
|
182
|
+
severity: "warning",
|
|
183
|
+
code: "legacy_tui_id",
|
|
184
|
+
path: path.join("."),
|
|
185
|
+
message: "Use the current canonical TUI item identifiers.",
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
function schemaIssue(error) {
|
|
190
|
+
const path = jsonPointerToPath(error.instancePath);
|
|
191
|
+
const unknownProperty = error.keyword === "additionalProperties" &&
|
|
192
|
+
typeof error.params.additionalProperty === "string"
|
|
193
|
+
? error.params.additionalProperty
|
|
194
|
+
: undefined;
|
|
195
|
+
return {
|
|
196
|
+
severity: "error",
|
|
197
|
+
code: `schema_${error.keyword}`,
|
|
198
|
+
path: [path, unknownProperty].filter(Boolean).join("."),
|
|
199
|
+
message: error.message ?? "Does not match the Codex configuration schema.",
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
function jsonPointerToPath(pointer) {
|
|
203
|
+
return pointer
|
|
204
|
+
.split("/")
|
|
205
|
+
.slice(1)
|
|
206
|
+
.map((segment) => segment.replaceAll("~1", "/").replaceAll("~0", "~"))
|
|
207
|
+
.join(".");
|
|
208
|
+
}
|
|
209
|
+
function inspectionFromIssues(issues) {
|
|
210
|
+
return {
|
|
211
|
+
valid: issues.every((issue) => issue.severity !== "error"),
|
|
212
|
+
clean: issues.length === 0,
|
|
213
|
+
issues,
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
function deduplicateIssues(issues) {
|
|
217
|
+
const seen = new Set();
|
|
218
|
+
return issues.filter((issue) => {
|
|
219
|
+
const key = `${issue.code}\u0000${issue.path}\u0000${issue.message}`;
|
|
220
|
+
if (seen.has(key)) {
|
|
221
|
+
return false;
|
|
222
|
+
}
|
|
223
|
+
seen.add(key);
|
|
224
|
+
return true;
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
function getPath(value, path) {
|
|
228
|
+
let current = value;
|
|
229
|
+
for (const segment of path) {
|
|
230
|
+
if (!isRecord(current) || !Object.prototype.hasOwnProperty.call(current, segment)) {
|
|
231
|
+
return undefined;
|
|
232
|
+
}
|
|
233
|
+
current = current[segment];
|
|
234
|
+
}
|
|
235
|
+
return current;
|
|
236
|
+
}
|
|
237
|
+
function hasPath(value, path) {
|
|
238
|
+
let current = value;
|
|
239
|
+
for (const segment of path) {
|
|
240
|
+
if (!isRecord(current) || !Object.prototype.hasOwnProperty.call(current, segment)) {
|
|
241
|
+
return false;
|
|
242
|
+
}
|
|
243
|
+
current = current[segment];
|
|
244
|
+
}
|
|
245
|
+
return true;
|
|
246
|
+
}
|
|
247
|
+
function isRecord(value) {
|
|
248
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
249
|
+
}
|
|
250
|
+
//# sourceMappingURL=codex-policy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codex-policy.js","sourceRoot":"","sources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AM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE,CAAC;YAClF,OAAO,KAAK,CAAC;QACf,CAAC;QACD,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC7B,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
export declare const CODEX_TARGET: {
|
|
2
|
+
readonly sourceRevision: "5c19155cbd93bfa099016e7487259f61669823ff";
|
|
3
|
+
readonly sourceCommitDate: "2026-07-11T04:15:42Z";
|
|
4
|
+
readonly minimumClientVersion: "0.144.0";
|
|
5
|
+
readonly defaultModel: "gpt-5.6-sol";
|
|
6
|
+
readonly models: readonly [{
|
|
7
|
+
readonly id: "gpt-5.6-sol";
|
|
8
|
+
readonly displayName: "GPT-5.6-Sol";
|
|
9
|
+
readonly contextWindow: 372000;
|
|
10
|
+
readonly reasoningEfforts: readonly ["low", "medium", "high", "xhigh", "max", "ultra"];
|
|
11
|
+
readonly defaultReasoningEffort: "low";
|
|
12
|
+
readonly defaultReasoningSummary: "none";
|
|
13
|
+
readonly supportsVerbosity: true;
|
|
14
|
+
readonly serviceTiers: readonly ["priority"];
|
|
15
|
+
readonly minimumClientVersion: "0.144.0";
|
|
16
|
+
readonly toolMode: "code_mode_only";
|
|
17
|
+
readonly multiAgentVersion: "v2";
|
|
18
|
+
readonly supportsPersonality: false;
|
|
19
|
+
}, {
|
|
20
|
+
readonly id: "gpt-5.6-terra";
|
|
21
|
+
readonly displayName: "GPT-5.6-Terra";
|
|
22
|
+
readonly contextWindow: 372000;
|
|
23
|
+
readonly reasoningEfforts: readonly ["low", "medium", "high", "xhigh", "max", "ultra"];
|
|
24
|
+
readonly defaultReasoningEffort: "medium";
|
|
25
|
+
readonly defaultReasoningSummary: "none";
|
|
26
|
+
readonly supportsVerbosity: true;
|
|
27
|
+
readonly serviceTiers: readonly ["priority"];
|
|
28
|
+
readonly minimumClientVersion: "0.144.0";
|
|
29
|
+
readonly toolMode: "code_mode_only";
|
|
30
|
+
readonly multiAgentVersion: "v2";
|
|
31
|
+
readonly supportsPersonality: false;
|
|
32
|
+
}, {
|
|
33
|
+
readonly id: "gpt-5.6-luna";
|
|
34
|
+
readonly displayName: "GPT-5.6-Luna";
|
|
35
|
+
readonly contextWindow: 372000;
|
|
36
|
+
readonly reasoningEfforts: readonly ["low", "medium", "high", "xhigh", "max"];
|
|
37
|
+
readonly defaultReasoningEffort: "medium";
|
|
38
|
+
readonly defaultReasoningSummary: "none";
|
|
39
|
+
readonly supportsVerbosity: true;
|
|
40
|
+
readonly serviceTiers: readonly ["priority"];
|
|
41
|
+
readonly minimumClientVersion: "0.144.0";
|
|
42
|
+
readonly toolMode: "code_mode_only";
|
|
43
|
+
readonly multiAgentVersion: "v1";
|
|
44
|
+
readonly supportsPersonality: false;
|
|
45
|
+
}];
|
|
46
|
+
readonly removedFeatureKeys: readonly ["apply_patch_freeform", "apps_mcp_path_override", "codex_git_commit", "collaboration_modes", "elevated_windows_sandbox", "experimental_windows_sandbox", "external_migration", "image_detail_original", "js_repl", "js_repl_tools_only", "multi_agent_mode", "plugin_hooks", "remote_control", "remote_models", "request_rule", "resize_all_images", "responses_websockets", "responses_websockets_v2", "search_tool", "skill_env_var_dependency_prompt", "sqlite", "steer", "terminal_resize_reflow", "tool_search", "tool_search_always_defer_mcp_tools", "tui_app_server", "unavailable_dummy_tools", "undo", "use_linux_sandbox_bwrap", "workspace_owner_usage_nudge"];
|
|
47
|
+
readonly deprecatedFeatureKeys: readonly ["use_legacy_landlock", "web_search_cached", "web_search_request"];
|
|
48
|
+
readonly legacyFeatureAliases: {
|
|
49
|
+
readonly codex_hooks: "hooks";
|
|
50
|
+
readonly collab: "multi_agent";
|
|
51
|
+
readonly connectors: "apps";
|
|
52
|
+
readonly enable_experimental_windows_sandbox: "experimental_windows_sandbox";
|
|
53
|
+
readonly experimental_use_unified_exec_tool: "unified_exec";
|
|
54
|
+
readonly imagegenext: "image_generation";
|
|
55
|
+
readonly memory_tool: "memories";
|
|
56
|
+
readonly request_permissions: "exec_permission_approvals";
|
|
57
|
+
readonly telepathy: "chronicle";
|
|
58
|
+
readonly web_search: "web_search_request";
|
|
59
|
+
};
|
|
60
|
+
};
|