File size: 8,685 Bytes
50ae831
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "definitions": {
    "AbsolutePathBuf": {
      "description": "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.",
      "type": "string"
    },
    "ConfigLayerMetadata": {
      "properties": {
        "name": {
          "$ref": "#/definitions/ConfigLayerSource"
        },
        "version": {
          "type": "string"
        }
      },
      "required": [
        "name",
        "version"
      ],
      "type": "object"
    },
    "ConfigLayerSource": {
      "oneOf": [
        {
          "description": "Default configuration supplied with the installed Codex package.",
          "properties": {
            "file": {
              "allOf": [
                {
                  "$ref": "#/definitions/AbsolutePathBuf"
                }
              ],
              "description": "Path to the packaged default configuration file."
            },
            "type": {
              "enum": [
                "packagedDefaults"
              ],
              "title": "PackagedDefaultsConfigLayerSourceType",
              "type": "string"
            }
          },
          "required": [
            "file",
            "type"
          ],
          "title": "PackagedDefaultsConfigLayerSource",
          "type": "object"
        },
        {
          "description": "Managed preferences layer delivered by MDM (macOS only).",
          "properties": {
            "domain": {
              "type": "string"
            },
            "key": {
              "type": "string"
            },
            "type": {
              "enum": [
                "mdm"
              ],
              "title": "MdmConfigLayerSourceType",
              "type": "string"
            }
          },
          "required": [
            "domain",
            "key",
            "type"
          ],
          "title": "MdmConfigLayerSource",
          "type": "object"
        },
        {
          "description": "Managed config layer from a file (usually `managed_config.toml`).",
          "properties": {
            "file": {
              "allOf": [
                {
                  "$ref": "#/definitions/AbsolutePathBuf"
                }
              ],
              "description": "This is the path to the system config.toml file, though it is not guaranteed to exist."
            },
            "type": {
              "enum": [
                "system"
              ],
              "title": "SystemConfigLayerSourceType",
              "type": "string"
            }
          },
          "required": [
            "file",
            "type"
          ],
          "title": "SystemConfigLayerSource",
          "type": "object"
        },
        {
          "description": "Enterprise-managed config layer delivered by the cloud config bundle.",
          "properties": {
            "id": {
              "description": "Stable identifier for the delivered layer.",
              "type": "string"
            },
            "name": {
              "description": "Admin-facing name for the delivered layer. This is surfaced in diagnostics so users know which cloud layer needs administrator attention.",
              "type": "string"
            },
            "type": {
              "enum": [
                "enterpriseManaged"
              ],
              "title": "EnterpriseManagedConfigLayerSourceType",
              "type": "string"
            }
          },
          "required": [
            "id",
            "name",
            "type"
          ],
          "title": "EnterpriseManagedConfigLayerSource",
          "type": "object"
        },
        {
          "description": "User config layer from $CODEX_HOME/config.toml. This layer is special in that it is expected to be: - writable by the user - generally outside the workspace directory",
          "properties": {
            "file": {
              "allOf": [
                {
                  "$ref": "#/definitions/AbsolutePathBuf"
                }
              ],
              "description": "This is the path to the user's config.toml file, though it is not guaranteed to exist."
            },
            "profile": {
              "description": "Name of the selected profile-v2 config layered on top of the base user config, when this layer represents one.",
              "type": [
                "string",
                "null"
              ]
            },
            "type": {
              "enum": [
                "user"
              ],
              "title": "UserConfigLayerSourceType",
              "type": "string"
            }
          },
          "required": [
            "file",
            "type"
          ],
          "title": "UserConfigLayerSource",
          "type": "object"
        },
        {
          "description": "Path to a .codex/ folder within a project. There could be multiple of these between `cwd` and the project/repo root.",
          "properties": {
            "dotCodexFolder": {
              "$ref": "#/definitions/AbsolutePathBuf"
            },
            "type": {
              "enum": [
                "project"
              ],
              "title": "ProjectConfigLayerSourceType",
              "type": "string"
            }
          },
          "required": [
            "dotCodexFolder",
            "type"
          ],
          "title": "ProjectConfigLayerSource",
          "type": "object"
        },
        {
          "description": "Session-layer overrides supplied via `-c`/`--config`.",
          "properties": {
            "type": {
              "enum": [
                "sessionFlags"
              ],
              "title": "SessionFlagsConfigLayerSourceType",
              "type": "string"
            }
          },
          "required": [
            "type"
          ],
          "title": "SessionFlagsConfigLayerSource",
          "type": "object"
        },
        {
          "description": "`managed_config.toml` was designed to be a config that was loaded as the last layer on top of everything else. This scheme did not quite work out as intended, but we keep this variant as a \"best effort\" while we phase out `managed_config.toml` in favor of `requirements.toml`.",
          "properties": {
            "file": {
              "$ref": "#/definitions/AbsolutePathBuf"
            },
            "type": {
              "enum": [
                "legacyManagedConfigTomlFromFile"
              ],
              "title": "LegacyManagedConfigTomlFromFileConfigLayerSourceType",
              "type": "string"
            }
          },
          "required": [
            "file",
            "type"
          ],
          "title": "LegacyManagedConfigTomlFromFileConfigLayerSource",
          "type": "object"
        },
        {
          "properties": {
            "type": {
              "enum": [
                "legacyManagedConfigTomlFromMdm"
              ],
              "title": "LegacyManagedConfigTomlFromMdmConfigLayerSourceType",
              "type": "string"
            }
          },
          "required": [
            "type"
          ],
          "title": "LegacyManagedConfigTomlFromMdmConfigLayerSource",
          "type": "object"
        }
      ]
    },
    "OverriddenMetadata": {
      "properties": {
        "effectiveValue": true,
        "message": {
          "type": "string"
        },
        "overridingLayer": {
          "$ref": "#/definitions/ConfigLayerMetadata"
        }
      },
      "required": [
        "effectiveValue",
        "message",
        "overridingLayer"
      ],
      "type": "object"
    },
    "WriteStatus": {
      "enum": [
        "ok",
        "okOverridden"
      ],
      "type": "string"
    }
  },
  "properties": {
    "filePath": {
      "allOf": [
        {
          "$ref": "#/definitions/AbsolutePathBuf"
        }
      ],
      "description": "Canonical path to the config file that was written."
    },
    "overriddenMetadata": {
      "anyOf": [
        {
          "$ref": "#/definitions/OverriddenMetadata"
        },
        {
          "type": "null"
        }
      ]
    },
    "status": {
      "$ref": "#/definitions/WriteStatus"
    },
    "version": {
      "type": "string"
    }
  },
  "required": [
    "filePath",
    "status",
    "version"
  ],
  "title": "ConfigWriteResponse",
  "type": "object"
}