diff --git a/codex-rs/app-server-protocol/schema/json/ClientRequest.json b/codex-rs/app-server-protocol/schema/json/ClientRequest.json index 7c94419844..05d3a6ec74 100644 --- a/codex-rs/app-server-protocol/schema/json/ClientRequest.json +++ b/codex-rs/app-server-protocol/schema/json/ClientRequest.json @@ -660,6 +660,224 @@ ], "type": "object" }, + "FileSystemAccessMode": { + "description": "Access mode for a filesystem entry.\n\nWhen two equally specific entries target the same path, we compare these by conflict precedence rather than by capability breadth: `none` beats `write`, and `write` beats `read`.", + "enum": [ + "read", + "write", + "none" + ], + "type": "string" + }, + "FileSystemPath": { + "oneOf": [ + { + "properties": { + "path": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "type": { + "enum": [ + "path" + ], + "title": "PathFileSystemPathType", + "type": "string" + } + }, + "required": [ + "path", + "type" + ], + "title": "PathFileSystemPath", + "type": "object" + }, + { + "properties": { + "type": { + "enum": [ + "special" + ], + "title": "SpecialFileSystemPathType", + "type": "string" + }, + "value": { + "$ref": "#/definitions/FileSystemSpecialPath" + } + }, + "required": [ + "type", + "value" + ], + "title": "SpecialFileSystemPath", + "type": "object" + } + ] + }, + "FileSystemSandboxEntry": { + "properties": { + "access": { + "$ref": "#/definitions/FileSystemAccessMode" + }, + "path": { + "$ref": "#/definitions/FileSystemPath" + } + }, + "required": [ + "access", + "path" + ], + "type": "object" + }, + "FileSystemSandboxKind": { + "enum": [ + "restricted", + "unrestricted", + "external-sandbox" + ], + "type": "string" + }, + "FileSystemSandboxPolicy": { + "properties": { + "entries": { + "items": { + "$ref": "#/definitions/FileSystemSandboxEntry" + }, + "type": "array" + }, + "kind": { + "$ref": "#/definitions/FileSystemSandboxKind" + } + }, + "required": [ + "kind" + ], + "type": "object" + }, + "FileSystemSpecialPath": { + "oneOf": [ + { + "properties": { + "kind": { + "enum": [ + "root" + ], + "type": "string" + } + }, + "required": [ + "kind" + ], + "title": "RootFileSystemSpecialPath", + "type": "object" + }, + { + "properties": { + "kind": { + "enum": [ + "minimal" + ], + "type": "string" + } + }, + "required": [ + "kind" + ], + "title": "MinimalFileSystemSpecialPath", + "type": "object" + }, + { + "properties": { + "kind": { + "enum": [ + "current_working_directory" + ], + "type": "string" + } + }, + "required": [ + "kind" + ], + "title": "CurrentWorkingDirectoryFileSystemSpecialPath", + "type": "object" + }, + { + "properties": { + "kind": { + "enum": [ + "project_roots" + ], + "type": "string" + }, + "subpath": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "kind" + ], + "title": "KindFileSystemSpecialPath", + "type": "object" + }, + { + "properties": { + "kind": { + "enum": [ + "tmpdir" + ], + "type": "string" + } + }, + "required": [ + "kind" + ], + "title": "TmpdirFileSystemSpecialPath", + "type": "object" + }, + { + "properties": { + "kind": { + "enum": [ + "slash_tmp" + ], + "type": "string" + } + }, + "required": [ + "kind" + ], + "title": "SlashTmpFileSystemSpecialPath", + "type": "object" + }, + { + "description": "WARNING: `:special_path` tokens are part of config compatibility. Do not make older runtimes reject newly introduced tokens. New parser support should be additive, while unknown values must stay representable so config from a newer Codex degrades to warn-and-ignore instead of failing to load. Codex 0.112.0 rejected unknown values here, which broke forward compatibility for newer config. Preserves future special-path tokens so older runtimes can ignore them without rejecting config authored by a newer release.", + "properties": { + "kind": { + "enum": [ + "unknown" + ], + "type": "string" + }, + "path": { + "type": "string" + }, + "subpath": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "kind", + "path" + ], + "type": "object" + } + ] + }, "FsCopyParams": { "description": "Copy a file or directory tree on the host filesystem.", "properties": { @@ -675,6 +893,17 @@ "description": "Required for directory copies; ignored for file copies.", "type": "boolean" }, + "sandboxPolicy": { + "anyOf": [ + { + "$ref": "#/definitions/FileSystemSandboxPolicy" + }, + { + "type": "null" + } + ], + "description": "Optional sandbox policy for re-invoking this filesystem operation under a sandbox." + }, "sourcePath": { "allOf": [ { @@ -707,6 +936,17 @@ "boolean", "null" ] + }, + "sandboxPolicy": { + "anyOf": [ + { + "$ref": "#/definitions/FileSystemSandboxPolicy" + }, + { + "type": "null" + } + ], + "description": "Optional sandbox policy for re-invoking this filesystem operation under a sandbox." } }, "required": [ @@ -724,6 +964,17 @@ } ], "description": "Absolute path to inspect." + }, + "sandboxPolicy": { + "anyOf": [ + { + "$ref": "#/definitions/FileSystemSandboxPolicy" + }, + { + "type": "null" + } + ], + "description": "Optional sandbox policy for re-invoking this filesystem operation under a sandbox." } }, "required": [ @@ -741,6 +992,17 @@ } ], "description": "Absolute directory path to read." + }, + "sandboxPolicy": { + "anyOf": [ + { + "$ref": "#/definitions/FileSystemSandboxPolicy" + }, + { + "type": "null" + } + ], + "description": "Optional sandbox policy for re-invoking this filesystem operation under a sandbox." } }, "required": [ @@ -758,6 +1020,17 @@ } ], "description": "Absolute path to read." + }, + "sandboxPolicy": { + "anyOf": [ + { + "$ref": "#/definitions/FileSystemSandboxPolicy" + }, + { + "type": "null" + } + ], + "description": "Optional sandbox policy for re-invoking this filesystem operation under a sandbox." } }, "required": [ @@ -789,6 +1062,17 @@ "boolean", "null" ] + }, + "sandboxPolicy": { + "anyOf": [ + { + "$ref": "#/definitions/FileSystemSandboxPolicy" + }, + { + "type": "null" + } + ], + "description": "Optional sandbox policy for re-invoking this filesystem operation under a sandbox." } }, "required": [ @@ -840,6 +1124,17 @@ } ], "description": "Absolute path to write." + }, + "sandboxPolicy": { + "anyOf": [ + { + "$ref": "#/definitions/FileSystemSandboxPolicy" + }, + { + "type": "null" + } + ], + "description": "Optional sandbox policy for re-invoking this filesystem operation under a sandbox." } }, "required": [ diff --git a/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json b/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json index a589903032..393ce5e2ce 100644 --- a/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json +++ b/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json @@ -7449,6 +7449,224 @@ "title": "FileChangeOutputDeltaNotification", "type": "object" }, + "FileSystemAccessMode": { + "description": "Access mode for a filesystem entry.\n\nWhen two equally specific entries target the same path, we compare these by conflict precedence rather than by capability breadth: `none` beats `write`, and `write` beats `read`.", + "enum": [ + "read", + "write", + "none" + ], + "type": "string" + }, + "FileSystemPath": { + "oneOf": [ + { + "properties": { + "path": { + "$ref": "#/definitions/v2/AbsolutePathBuf" + }, + "type": { + "enum": [ + "path" + ], + "title": "PathFileSystemPathType", + "type": "string" + } + }, + "required": [ + "path", + "type" + ], + "title": "PathFileSystemPath", + "type": "object" + }, + { + "properties": { + "type": { + "enum": [ + "special" + ], + "title": "SpecialFileSystemPathType", + "type": "string" + }, + "value": { + "$ref": "#/definitions/v2/FileSystemSpecialPath" + } + }, + "required": [ + "type", + "value" + ], + "title": "SpecialFileSystemPath", + "type": "object" + } + ] + }, + "FileSystemSandboxEntry": { + "properties": { + "access": { + "$ref": "#/definitions/v2/FileSystemAccessMode" + }, + "path": { + "$ref": "#/definitions/v2/FileSystemPath" + } + }, + "required": [ + "access", + "path" + ], + "type": "object" + }, + "FileSystemSandboxKind": { + "enum": [ + "restricted", + "unrestricted", + "external-sandbox" + ], + "type": "string" + }, + "FileSystemSandboxPolicy": { + "properties": { + "entries": { + "items": { + "$ref": "#/definitions/v2/FileSystemSandboxEntry" + }, + "type": "array" + }, + "kind": { + "$ref": "#/definitions/v2/FileSystemSandboxKind" + } + }, + "required": [ + "kind" + ], + "type": "object" + }, + "FileSystemSpecialPath": { + "oneOf": [ + { + "properties": { + "kind": { + "enum": [ + "root" + ], + "type": "string" + } + }, + "required": [ + "kind" + ], + "title": "RootFileSystemSpecialPath", + "type": "object" + }, + { + "properties": { + "kind": { + "enum": [ + "minimal" + ], + "type": "string" + } + }, + "required": [ + "kind" + ], + "title": "MinimalFileSystemSpecialPath", + "type": "object" + }, + { + "properties": { + "kind": { + "enum": [ + "current_working_directory" + ], + "type": "string" + } + }, + "required": [ + "kind" + ], + "title": "CurrentWorkingDirectoryFileSystemSpecialPath", + "type": "object" + }, + { + "properties": { + "kind": { + "enum": [ + "project_roots" + ], + "type": "string" + }, + "subpath": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "kind" + ], + "title": "KindFileSystemSpecialPath", + "type": "object" + }, + { + "properties": { + "kind": { + "enum": [ + "tmpdir" + ], + "type": "string" + } + }, + "required": [ + "kind" + ], + "title": "TmpdirFileSystemSpecialPath", + "type": "object" + }, + { + "properties": { + "kind": { + "enum": [ + "slash_tmp" + ], + "type": "string" + } + }, + "required": [ + "kind" + ], + "title": "SlashTmpFileSystemSpecialPath", + "type": "object" + }, + { + "description": "WARNING: `:special_path` tokens are part of config compatibility. Do not make older runtimes reject newly introduced tokens. New parser support should be additive, while unknown values must stay representable so config from a newer Codex degrades to warn-and-ignore instead of failing to load. Codex 0.112.0 rejected unknown values here, which broke forward compatibility for newer config. Preserves future special-path tokens so older runtimes can ignore them without rejecting config authored by a newer release.", + "properties": { + "kind": { + "enum": [ + "unknown" + ], + "type": "string" + }, + "path": { + "type": "string" + }, + "subpath": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "kind", + "path" + ], + "type": "object" + } + ] + }, "FileUpdateChange": { "properties": { "diff": { @@ -7514,6 +7732,17 @@ "description": "Required for directory copies; ignored for file copies.", "type": "boolean" }, + "sandboxPolicy": { + "anyOf": [ + { + "$ref": "#/definitions/v2/FileSystemSandboxPolicy" + }, + { + "type": "null" + } + ], + "description": "Optional sandbox policy for re-invoking this filesystem operation under a sandbox." + }, "sourcePath": { "allOf": [ { @@ -7554,6 +7783,17 @@ "boolean", "null" ] + }, + "sandboxPolicy": { + "anyOf": [ + { + "$ref": "#/definitions/v2/FileSystemSandboxPolicy" + }, + { + "type": "null" + } + ], + "description": "Optional sandbox policy for re-invoking this filesystem operation under a sandbox." } }, "required": [ @@ -7579,6 +7819,17 @@ } ], "description": "Absolute path to inspect." + }, + "sandboxPolicy": { + "anyOf": [ + { + "$ref": "#/definitions/v2/FileSystemSandboxPolicy" + }, + { + "type": "null" + } + ], + "description": "Optional sandbox policy for re-invoking this filesystem operation under a sandbox." } }, "required": [ @@ -7653,6 +7904,17 @@ } ], "description": "Absolute directory path to read." + }, + "sandboxPolicy": { + "anyOf": [ + { + "$ref": "#/definitions/v2/FileSystemSandboxPolicy" + }, + { + "type": "null" + } + ], + "description": "Optional sandbox policy for re-invoking this filesystem operation under a sandbox." } }, "required": [ @@ -7690,6 +7952,17 @@ } ], "description": "Absolute path to read." + }, + "sandboxPolicy": { + "anyOf": [ + { + "$ref": "#/definitions/v2/FileSystemSandboxPolicy" + }, + { + "type": "null" + } + ], + "description": "Optional sandbox policy for re-invoking this filesystem operation under a sandbox." } }, "required": [ @@ -7738,6 +8011,17 @@ "boolean", "null" ] + }, + "sandboxPolicy": { + "anyOf": [ + { + "$ref": "#/definitions/v2/FileSystemSandboxPolicy" + }, + { + "type": "null" + } + ], + "description": "Optional sandbox policy for re-invoking this filesystem operation under a sandbox." } }, "required": [ @@ -7831,6 +8115,17 @@ } ], "description": "Absolute path to write." + }, + "sandboxPolicy": { + "anyOf": [ + { + "$ref": "#/definitions/v2/FileSystemSandboxPolicy" + }, + { + "type": "null" + } + ], + "description": "Optional sandbox policy for re-invoking this filesystem operation under a sandbox." } }, "required": [ diff --git a/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.v2.schemas.json b/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.v2.schemas.json index f041f8aae8..890d1c3919 100644 --- a/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.v2.schemas.json +++ b/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.v2.schemas.json @@ -4117,6 +4117,224 @@ "title": "FileChangeOutputDeltaNotification", "type": "object" }, + "FileSystemAccessMode": { + "description": "Access mode for a filesystem entry.\n\nWhen two equally specific entries target the same path, we compare these by conflict precedence rather than by capability breadth: `none` beats `write`, and `write` beats `read`.", + "enum": [ + "read", + "write", + "none" + ], + "type": "string" + }, + "FileSystemPath": { + "oneOf": [ + { + "properties": { + "path": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "type": { + "enum": [ + "path" + ], + "title": "PathFileSystemPathType", + "type": "string" + } + }, + "required": [ + "path", + "type" + ], + "title": "PathFileSystemPath", + "type": "object" + }, + { + "properties": { + "type": { + "enum": [ + "special" + ], + "title": "SpecialFileSystemPathType", + "type": "string" + }, + "value": { + "$ref": "#/definitions/FileSystemSpecialPath" + } + }, + "required": [ + "type", + "value" + ], + "title": "SpecialFileSystemPath", + "type": "object" + } + ] + }, + "FileSystemSandboxEntry": { + "properties": { + "access": { + "$ref": "#/definitions/FileSystemAccessMode" + }, + "path": { + "$ref": "#/definitions/FileSystemPath" + } + }, + "required": [ + "access", + "path" + ], + "type": "object" + }, + "FileSystemSandboxKind": { + "enum": [ + "restricted", + "unrestricted", + "external-sandbox" + ], + "type": "string" + }, + "FileSystemSandboxPolicy": { + "properties": { + "entries": { + "items": { + "$ref": "#/definitions/FileSystemSandboxEntry" + }, + "type": "array" + }, + "kind": { + "$ref": "#/definitions/FileSystemSandboxKind" + } + }, + "required": [ + "kind" + ], + "type": "object" + }, + "FileSystemSpecialPath": { + "oneOf": [ + { + "properties": { + "kind": { + "enum": [ + "root" + ], + "type": "string" + } + }, + "required": [ + "kind" + ], + "title": "RootFileSystemSpecialPath", + "type": "object" + }, + { + "properties": { + "kind": { + "enum": [ + "minimal" + ], + "type": "string" + } + }, + "required": [ + "kind" + ], + "title": "MinimalFileSystemSpecialPath", + "type": "object" + }, + { + "properties": { + "kind": { + "enum": [ + "current_working_directory" + ], + "type": "string" + } + }, + "required": [ + "kind" + ], + "title": "CurrentWorkingDirectoryFileSystemSpecialPath", + "type": "object" + }, + { + "properties": { + "kind": { + "enum": [ + "project_roots" + ], + "type": "string" + }, + "subpath": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "kind" + ], + "title": "KindFileSystemSpecialPath", + "type": "object" + }, + { + "properties": { + "kind": { + "enum": [ + "tmpdir" + ], + "type": "string" + } + }, + "required": [ + "kind" + ], + "title": "TmpdirFileSystemSpecialPath", + "type": "object" + }, + { + "properties": { + "kind": { + "enum": [ + "slash_tmp" + ], + "type": "string" + } + }, + "required": [ + "kind" + ], + "title": "SlashTmpFileSystemSpecialPath", + "type": "object" + }, + { + "description": "WARNING: `:special_path` tokens are part of config compatibility. Do not make older runtimes reject newly introduced tokens. New parser support should be additive, while unknown values must stay representable so config from a newer Codex degrades to warn-and-ignore instead of failing to load. Codex 0.112.0 rejected unknown values here, which broke forward compatibility for newer config. Preserves future special-path tokens so older runtimes can ignore them without rejecting config authored by a newer release.", + "properties": { + "kind": { + "enum": [ + "unknown" + ], + "type": "string" + }, + "path": { + "type": "string" + }, + "subpath": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "kind", + "path" + ], + "type": "object" + } + ] + }, "FileUpdateChange": { "properties": { "diff": { @@ -4182,6 +4400,17 @@ "description": "Required for directory copies; ignored for file copies.", "type": "boolean" }, + "sandboxPolicy": { + "anyOf": [ + { + "$ref": "#/definitions/FileSystemSandboxPolicy" + }, + { + "type": "null" + } + ], + "description": "Optional sandbox policy for re-invoking this filesystem operation under a sandbox." + }, "sourcePath": { "allOf": [ { @@ -4222,6 +4451,17 @@ "boolean", "null" ] + }, + "sandboxPolicy": { + "anyOf": [ + { + "$ref": "#/definitions/FileSystemSandboxPolicy" + }, + { + "type": "null" + } + ], + "description": "Optional sandbox policy for re-invoking this filesystem operation under a sandbox." } }, "required": [ @@ -4247,6 +4487,17 @@ } ], "description": "Absolute path to inspect." + }, + "sandboxPolicy": { + "anyOf": [ + { + "$ref": "#/definitions/FileSystemSandboxPolicy" + }, + { + "type": "null" + } + ], + "description": "Optional sandbox policy for re-invoking this filesystem operation under a sandbox." } }, "required": [ @@ -4321,6 +4572,17 @@ } ], "description": "Absolute directory path to read." + }, + "sandboxPolicy": { + "anyOf": [ + { + "$ref": "#/definitions/FileSystemSandboxPolicy" + }, + { + "type": "null" + } + ], + "description": "Optional sandbox policy for re-invoking this filesystem operation under a sandbox." } }, "required": [ @@ -4358,6 +4620,17 @@ } ], "description": "Absolute path to read." + }, + "sandboxPolicy": { + "anyOf": [ + { + "$ref": "#/definitions/FileSystemSandboxPolicy" + }, + { + "type": "null" + } + ], + "description": "Optional sandbox policy for re-invoking this filesystem operation under a sandbox." } }, "required": [ @@ -4406,6 +4679,17 @@ "boolean", "null" ] + }, + "sandboxPolicy": { + "anyOf": [ + { + "$ref": "#/definitions/FileSystemSandboxPolicy" + }, + { + "type": "null" + } + ], + "description": "Optional sandbox policy for re-invoking this filesystem operation under a sandbox." } }, "required": [ @@ -4499,6 +4783,17 @@ } ], "description": "Absolute path to write." + }, + "sandboxPolicy": { + "anyOf": [ + { + "$ref": "#/definitions/FileSystemSandboxPolicy" + }, + { + "type": "null" + } + ], + "description": "Optional sandbox policy for re-invoking this filesystem operation under a sandbox." } }, "required": [ diff --git a/codex-rs/app-server-protocol/schema/json/v2/FsCopyParams.json b/codex-rs/app-server-protocol/schema/json/v2/FsCopyParams.json index 2994fcac81..1295f9dbdb 100644 --- a/codex-rs/app-server-protocol/schema/json/v2/FsCopyParams.json +++ b/codex-rs/app-server-protocol/schema/json/v2/FsCopyParams.json @@ -4,6 +4,224 @@ "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" + }, + "FileSystemAccessMode": { + "description": "Access mode for a filesystem entry.\n\nWhen two equally specific entries target the same path, we compare these by conflict precedence rather than by capability breadth: `none` beats `write`, and `write` beats `read`.", + "enum": [ + "read", + "write", + "none" + ], + "type": "string" + }, + "FileSystemPath": { + "oneOf": [ + { + "properties": { + "path": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "type": { + "enum": [ + "path" + ], + "title": "PathFileSystemPathType", + "type": "string" + } + }, + "required": [ + "path", + "type" + ], + "title": "PathFileSystemPath", + "type": "object" + }, + { + "properties": { + "type": { + "enum": [ + "special" + ], + "title": "SpecialFileSystemPathType", + "type": "string" + }, + "value": { + "$ref": "#/definitions/FileSystemSpecialPath" + } + }, + "required": [ + "type", + "value" + ], + "title": "SpecialFileSystemPath", + "type": "object" + } + ] + }, + "FileSystemSandboxEntry": { + "properties": { + "access": { + "$ref": "#/definitions/FileSystemAccessMode" + }, + "path": { + "$ref": "#/definitions/FileSystemPath" + } + }, + "required": [ + "access", + "path" + ], + "type": "object" + }, + "FileSystemSandboxKind": { + "enum": [ + "restricted", + "unrestricted", + "external-sandbox" + ], + "type": "string" + }, + "FileSystemSandboxPolicy": { + "properties": { + "entries": { + "items": { + "$ref": "#/definitions/FileSystemSandboxEntry" + }, + "type": "array" + }, + "kind": { + "$ref": "#/definitions/FileSystemSandboxKind" + } + }, + "required": [ + "kind" + ], + "type": "object" + }, + "FileSystemSpecialPath": { + "oneOf": [ + { + "properties": { + "kind": { + "enum": [ + "root" + ], + "type": "string" + } + }, + "required": [ + "kind" + ], + "title": "RootFileSystemSpecialPath", + "type": "object" + }, + { + "properties": { + "kind": { + "enum": [ + "minimal" + ], + "type": "string" + } + }, + "required": [ + "kind" + ], + "title": "MinimalFileSystemSpecialPath", + "type": "object" + }, + { + "properties": { + "kind": { + "enum": [ + "current_working_directory" + ], + "type": "string" + } + }, + "required": [ + "kind" + ], + "title": "CurrentWorkingDirectoryFileSystemSpecialPath", + "type": "object" + }, + { + "properties": { + "kind": { + "enum": [ + "project_roots" + ], + "type": "string" + }, + "subpath": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "kind" + ], + "title": "KindFileSystemSpecialPath", + "type": "object" + }, + { + "properties": { + "kind": { + "enum": [ + "tmpdir" + ], + "type": "string" + } + }, + "required": [ + "kind" + ], + "title": "TmpdirFileSystemSpecialPath", + "type": "object" + }, + { + "properties": { + "kind": { + "enum": [ + "slash_tmp" + ], + "type": "string" + } + }, + "required": [ + "kind" + ], + "title": "SlashTmpFileSystemSpecialPath", + "type": "object" + }, + { + "description": "WARNING: `:special_path` tokens are part of config compatibility. Do not make older runtimes reject newly introduced tokens. New parser support should be additive, while unknown values must stay representable so config from a newer Codex degrades to warn-and-ignore instead of failing to load. Codex 0.112.0 rejected unknown values here, which broke forward compatibility for newer config. Preserves future special-path tokens so older runtimes can ignore them without rejecting config authored by a newer release.", + "properties": { + "kind": { + "enum": [ + "unknown" + ], + "type": "string" + }, + "path": { + "type": "string" + }, + "subpath": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "kind", + "path" + ], + "type": "object" + } + ] } }, "description": "Copy a file or directory tree on the host filesystem.", @@ -20,6 +238,17 @@ "description": "Required for directory copies; ignored for file copies.", "type": "boolean" }, + "sandboxPolicy": { + "anyOf": [ + { + "$ref": "#/definitions/FileSystemSandboxPolicy" + }, + { + "type": "null" + } + ], + "description": "Optional sandbox policy for re-invoking this filesystem operation under a sandbox." + }, "sourcePath": { "allOf": [ { diff --git a/codex-rs/app-server-protocol/schema/json/v2/FsCreateDirectoryParams.json b/codex-rs/app-server-protocol/schema/json/v2/FsCreateDirectoryParams.json index a1ac4a8dc5..220b904810 100644 --- a/codex-rs/app-server-protocol/schema/json/v2/FsCreateDirectoryParams.json +++ b/codex-rs/app-server-protocol/schema/json/v2/FsCreateDirectoryParams.json @@ -4,6 +4,224 @@ "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" + }, + "FileSystemAccessMode": { + "description": "Access mode for a filesystem entry.\n\nWhen two equally specific entries target the same path, we compare these by conflict precedence rather than by capability breadth: `none` beats `write`, and `write` beats `read`.", + "enum": [ + "read", + "write", + "none" + ], + "type": "string" + }, + "FileSystemPath": { + "oneOf": [ + { + "properties": { + "path": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "type": { + "enum": [ + "path" + ], + "title": "PathFileSystemPathType", + "type": "string" + } + }, + "required": [ + "path", + "type" + ], + "title": "PathFileSystemPath", + "type": "object" + }, + { + "properties": { + "type": { + "enum": [ + "special" + ], + "title": "SpecialFileSystemPathType", + "type": "string" + }, + "value": { + "$ref": "#/definitions/FileSystemSpecialPath" + } + }, + "required": [ + "type", + "value" + ], + "title": "SpecialFileSystemPath", + "type": "object" + } + ] + }, + "FileSystemSandboxEntry": { + "properties": { + "access": { + "$ref": "#/definitions/FileSystemAccessMode" + }, + "path": { + "$ref": "#/definitions/FileSystemPath" + } + }, + "required": [ + "access", + "path" + ], + "type": "object" + }, + "FileSystemSandboxKind": { + "enum": [ + "restricted", + "unrestricted", + "external-sandbox" + ], + "type": "string" + }, + "FileSystemSandboxPolicy": { + "properties": { + "entries": { + "items": { + "$ref": "#/definitions/FileSystemSandboxEntry" + }, + "type": "array" + }, + "kind": { + "$ref": "#/definitions/FileSystemSandboxKind" + } + }, + "required": [ + "kind" + ], + "type": "object" + }, + "FileSystemSpecialPath": { + "oneOf": [ + { + "properties": { + "kind": { + "enum": [ + "root" + ], + "type": "string" + } + }, + "required": [ + "kind" + ], + "title": "RootFileSystemSpecialPath", + "type": "object" + }, + { + "properties": { + "kind": { + "enum": [ + "minimal" + ], + "type": "string" + } + }, + "required": [ + "kind" + ], + "title": "MinimalFileSystemSpecialPath", + "type": "object" + }, + { + "properties": { + "kind": { + "enum": [ + "current_working_directory" + ], + "type": "string" + } + }, + "required": [ + "kind" + ], + "title": "CurrentWorkingDirectoryFileSystemSpecialPath", + "type": "object" + }, + { + "properties": { + "kind": { + "enum": [ + "project_roots" + ], + "type": "string" + }, + "subpath": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "kind" + ], + "title": "KindFileSystemSpecialPath", + "type": "object" + }, + { + "properties": { + "kind": { + "enum": [ + "tmpdir" + ], + "type": "string" + } + }, + "required": [ + "kind" + ], + "title": "TmpdirFileSystemSpecialPath", + "type": "object" + }, + { + "properties": { + "kind": { + "enum": [ + "slash_tmp" + ], + "type": "string" + } + }, + "required": [ + "kind" + ], + "title": "SlashTmpFileSystemSpecialPath", + "type": "object" + }, + { + "description": "WARNING: `:special_path` tokens are part of config compatibility. Do not make older runtimes reject newly introduced tokens. New parser support should be additive, while unknown values must stay representable so config from a newer Codex degrades to warn-and-ignore instead of failing to load. Codex 0.112.0 rejected unknown values here, which broke forward compatibility for newer config. Preserves future special-path tokens so older runtimes can ignore them without rejecting config authored by a newer release.", + "properties": { + "kind": { + "enum": [ + "unknown" + ], + "type": "string" + }, + "path": { + "type": "string" + }, + "subpath": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "kind", + "path" + ], + "type": "object" + } + ] } }, "description": "Create a directory on the host filesystem.", @@ -22,6 +240,17 @@ "boolean", "null" ] + }, + "sandboxPolicy": { + "anyOf": [ + { + "$ref": "#/definitions/FileSystemSandboxPolicy" + }, + { + "type": "null" + } + ], + "description": "Optional sandbox policy for re-invoking this filesystem operation under a sandbox." } }, "required": [ diff --git a/codex-rs/app-server-protocol/schema/json/v2/FsGetMetadataParams.json b/codex-rs/app-server-protocol/schema/json/v2/FsGetMetadataParams.json index c70287493c..050960f597 100644 --- a/codex-rs/app-server-protocol/schema/json/v2/FsGetMetadataParams.json +++ b/codex-rs/app-server-protocol/schema/json/v2/FsGetMetadataParams.json @@ -4,6 +4,224 @@ "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" + }, + "FileSystemAccessMode": { + "description": "Access mode for a filesystem entry.\n\nWhen two equally specific entries target the same path, we compare these by conflict precedence rather than by capability breadth: `none` beats `write`, and `write` beats `read`.", + "enum": [ + "read", + "write", + "none" + ], + "type": "string" + }, + "FileSystemPath": { + "oneOf": [ + { + "properties": { + "path": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "type": { + "enum": [ + "path" + ], + "title": "PathFileSystemPathType", + "type": "string" + } + }, + "required": [ + "path", + "type" + ], + "title": "PathFileSystemPath", + "type": "object" + }, + { + "properties": { + "type": { + "enum": [ + "special" + ], + "title": "SpecialFileSystemPathType", + "type": "string" + }, + "value": { + "$ref": "#/definitions/FileSystemSpecialPath" + } + }, + "required": [ + "type", + "value" + ], + "title": "SpecialFileSystemPath", + "type": "object" + } + ] + }, + "FileSystemSandboxEntry": { + "properties": { + "access": { + "$ref": "#/definitions/FileSystemAccessMode" + }, + "path": { + "$ref": "#/definitions/FileSystemPath" + } + }, + "required": [ + "access", + "path" + ], + "type": "object" + }, + "FileSystemSandboxKind": { + "enum": [ + "restricted", + "unrestricted", + "external-sandbox" + ], + "type": "string" + }, + "FileSystemSandboxPolicy": { + "properties": { + "entries": { + "items": { + "$ref": "#/definitions/FileSystemSandboxEntry" + }, + "type": "array" + }, + "kind": { + "$ref": "#/definitions/FileSystemSandboxKind" + } + }, + "required": [ + "kind" + ], + "type": "object" + }, + "FileSystemSpecialPath": { + "oneOf": [ + { + "properties": { + "kind": { + "enum": [ + "root" + ], + "type": "string" + } + }, + "required": [ + "kind" + ], + "title": "RootFileSystemSpecialPath", + "type": "object" + }, + { + "properties": { + "kind": { + "enum": [ + "minimal" + ], + "type": "string" + } + }, + "required": [ + "kind" + ], + "title": "MinimalFileSystemSpecialPath", + "type": "object" + }, + { + "properties": { + "kind": { + "enum": [ + "current_working_directory" + ], + "type": "string" + } + }, + "required": [ + "kind" + ], + "title": "CurrentWorkingDirectoryFileSystemSpecialPath", + "type": "object" + }, + { + "properties": { + "kind": { + "enum": [ + "project_roots" + ], + "type": "string" + }, + "subpath": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "kind" + ], + "title": "KindFileSystemSpecialPath", + "type": "object" + }, + { + "properties": { + "kind": { + "enum": [ + "tmpdir" + ], + "type": "string" + } + }, + "required": [ + "kind" + ], + "title": "TmpdirFileSystemSpecialPath", + "type": "object" + }, + { + "properties": { + "kind": { + "enum": [ + "slash_tmp" + ], + "type": "string" + } + }, + "required": [ + "kind" + ], + "title": "SlashTmpFileSystemSpecialPath", + "type": "object" + }, + { + "description": "WARNING: `:special_path` tokens are part of config compatibility. Do not make older runtimes reject newly introduced tokens. New parser support should be additive, while unknown values must stay representable so config from a newer Codex degrades to warn-and-ignore instead of failing to load. Codex 0.112.0 rejected unknown values here, which broke forward compatibility for newer config. Preserves future special-path tokens so older runtimes can ignore them without rejecting config authored by a newer release.", + "properties": { + "kind": { + "enum": [ + "unknown" + ], + "type": "string" + }, + "path": { + "type": "string" + }, + "subpath": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "kind", + "path" + ], + "type": "object" + } + ] } }, "description": "Request metadata for an absolute path.", @@ -15,6 +233,17 @@ } ], "description": "Absolute path to inspect." + }, + "sandboxPolicy": { + "anyOf": [ + { + "$ref": "#/definitions/FileSystemSandboxPolicy" + }, + { + "type": "null" + } + ], + "description": "Optional sandbox policy for re-invoking this filesystem operation under a sandbox." } }, "required": [ diff --git a/codex-rs/app-server-protocol/schema/json/v2/FsReadDirectoryParams.json b/codex-rs/app-server-protocol/schema/json/v2/FsReadDirectoryParams.json index e531fe9f03..b3bb9cb151 100644 --- a/codex-rs/app-server-protocol/schema/json/v2/FsReadDirectoryParams.json +++ b/codex-rs/app-server-protocol/schema/json/v2/FsReadDirectoryParams.json @@ -4,6 +4,224 @@ "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" + }, + "FileSystemAccessMode": { + "description": "Access mode for a filesystem entry.\n\nWhen two equally specific entries target the same path, we compare these by conflict precedence rather than by capability breadth: `none` beats `write`, and `write` beats `read`.", + "enum": [ + "read", + "write", + "none" + ], + "type": "string" + }, + "FileSystemPath": { + "oneOf": [ + { + "properties": { + "path": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "type": { + "enum": [ + "path" + ], + "title": "PathFileSystemPathType", + "type": "string" + } + }, + "required": [ + "path", + "type" + ], + "title": "PathFileSystemPath", + "type": "object" + }, + { + "properties": { + "type": { + "enum": [ + "special" + ], + "title": "SpecialFileSystemPathType", + "type": "string" + }, + "value": { + "$ref": "#/definitions/FileSystemSpecialPath" + } + }, + "required": [ + "type", + "value" + ], + "title": "SpecialFileSystemPath", + "type": "object" + } + ] + }, + "FileSystemSandboxEntry": { + "properties": { + "access": { + "$ref": "#/definitions/FileSystemAccessMode" + }, + "path": { + "$ref": "#/definitions/FileSystemPath" + } + }, + "required": [ + "access", + "path" + ], + "type": "object" + }, + "FileSystemSandboxKind": { + "enum": [ + "restricted", + "unrestricted", + "external-sandbox" + ], + "type": "string" + }, + "FileSystemSandboxPolicy": { + "properties": { + "entries": { + "items": { + "$ref": "#/definitions/FileSystemSandboxEntry" + }, + "type": "array" + }, + "kind": { + "$ref": "#/definitions/FileSystemSandboxKind" + } + }, + "required": [ + "kind" + ], + "type": "object" + }, + "FileSystemSpecialPath": { + "oneOf": [ + { + "properties": { + "kind": { + "enum": [ + "root" + ], + "type": "string" + } + }, + "required": [ + "kind" + ], + "title": "RootFileSystemSpecialPath", + "type": "object" + }, + { + "properties": { + "kind": { + "enum": [ + "minimal" + ], + "type": "string" + } + }, + "required": [ + "kind" + ], + "title": "MinimalFileSystemSpecialPath", + "type": "object" + }, + { + "properties": { + "kind": { + "enum": [ + "current_working_directory" + ], + "type": "string" + } + }, + "required": [ + "kind" + ], + "title": "CurrentWorkingDirectoryFileSystemSpecialPath", + "type": "object" + }, + { + "properties": { + "kind": { + "enum": [ + "project_roots" + ], + "type": "string" + }, + "subpath": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "kind" + ], + "title": "KindFileSystemSpecialPath", + "type": "object" + }, + { + "properties": { + "kind": { + "enum": [ + "tmpdir" + ], + "type": "string" + } + }, + "required": [ + "kind" + ], + "title": "TmpdirFileSystemSpecialPath", + "type": "object" + }, + { + "properties": { + "kind": { + "enum": [ + "slash_tmp" + ], + "type": "string" + } + }, + "required": [ + "kind" + ], + "title": "SlashTmpFileSystemSpecialPath", + "type": "object" + }, + { + "description": "WARNING: `:special_path` tokens are part of config compatibility. Do not make older runtimes reject newly introduced tokens. New parser support should be additive, while unknown values must stay representable so config from a newer Codex degrades to warn-and-ignore instead of failing to load. Codex 0.112.0 rejected unknown values here, which broke forward compatibility for newer config. Preserves future special-path tokens so older runtimes can ignore them without rejecting config authored by a newer release.", + "properties": { + "kind": { + "enum": [ + "unknown" + ], + "type": "string" + }, + "path": { + "type": "string" + }, + "subpath": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "kind", + "path" + ], + "type": "object" + } + ] } }, "description": "List direct child names for a directory.", @@ -15,6 +233,17 @@ } ], "description": "Absolute directory path to read." + }, + "sandboxPolicy": { + "anyOf": [ + { + "$ref": "#/definitions/FileSystemSandboxPolicy" + }, + { + "type": "null" + } + ], + "description": "Optional sandbox policy for re-invoking this filesystem operation under a sandbox." } }, "required": [ diff --git a/codex-rs/app-server-protocol/schema/json/v2/FsReadFileParams.json b/codex-rs/app-server-protocol/schema/json/v2/FsReadFileParams.json index e1df6018c1..f22d1e5e58 100644 --- a/codex-rs/app-server-protocol/schema/json/v2/FsReadFileParams.json +++ b/codex-rs/app-server-protocol/schema/json/v2/FsReadFileParams.json @@ -4,6 +4,224 @@ "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" + }, + "FileSystemAccessMode": { + "description": "Access mode for a filesystem entry.\n\nWhen two equally specific entries target the same path, we compare these by conflict precedence rather than by capability breadth: `none` beats `write`, and `write` beats `read`.", + "enum": [ + "read", + "write", + "none" + ], + "type": "string" + }, + "FileSystemPath": { + "oneOf": [ + { + "properties": { + "path": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "type": { + "enum": [ + "path" + ], + "title": "PathFileSystemPathType", + "type": "string" + } + }, + "required": [ + "path", + "type" + ], + "title": "PathFileSystemPath", + "type": "object" + }, + { + "properties": { + "type": { + "enum": [ + "special" + ], + "title": "SpecialFileSystemPathType", + "type": "string" + }, + "value": { + "$ref": "#/definitions/FileSystemSpecialPath" + } + }, + "required": [ + "type", + "value" + ], + "title": "SpecialFileSystemPath", + "type": "object" + } + ] + }, + "FileSystemSandboxEntry": { + "properties": { + "access": { + "$ref": "#/definitions/FileSystemAccessMode" + }, + "path": { + "$ref": "#/definitions/FileSystemPath" + } + }, + "required": [ + "access", + "path" + ], + "type": "object" + }, + "FileSystemSandboxKind": { + "enum": [ + "restricted", + "unrestricted", + "external-sandbox" + ], + "type": "string" + }, + "FileSystemSandboxPolicy": { + "properties": { + "entries": { + "items": { + "$ref": "#/definitions/FileSystemSandboxEntry" + }, + "type": "array" + }, + "kind": { + "$ref": "#/definitions/FileSystemSandboxKind" + } + }, + "required": [ + "kind" + ], + "type": "object" + }, + "FileSystemSpecialPath": { + "oneOf": [ + { + "properties": { + "kind": { + "enum": [ + "root" + ], + "type": "string" + } + }, + "required": [ + "kind" + ], + "title": "RootFileSystemSpecialPath", + "type": "object" + }, + { + "properties": { + "kind": { + "enum": [ + "minimal" + ], + "type": "string" + } + }, + "required": [ + "kind" + ], + "title": "MinimalFileSystemSpecialPath", + "type": "object" + }, + { + "properties": { + "kind": { + "enum": [ + "current_working_directory" + ], + "type": "string" + } + }, + "required": [ + "kind" + ], + "title": "CurrentWorkingDirectoryFileSystemSpecialPath", + "type": "object" + }, + { + "properties": { + "kind": { + "enum": [ + "project_roots" + ], + "type": "string" + }, + "subpath": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "kind" + ], + "title": "KindFileSystemSpecialPath", + "type": "object" + }, + { + "properties": { + "kind": { + "enum": [ + "tmpdir" + ], + "type": "string" + } + }, + "required": [ + "kind" + ], + "title": "TmpdirFileSystemSpecialPath", + "type": "object" + }, + { + "properties": { + "kind": { + "enum": [ + "slash_tmp" + ], + "type": "string" + } + }, + "required": [ + "kind" + ], + "title": "SlashTmpFileSystemSpecialPath", + "type": "object" + }, + { + "description": "WARNING: `:special_path` tokens are part of config compatibility. Do not make older runtimes reject newly introduced tokens. New parser support should be additive, while unknown values must stay representable so config from a newer Codex degrades to warn-and-ignore instead of failing to load. Codex 0.112.0 rejected unknown values here, which broke forward compatibility for newer config. Preserves future special-path tokens so older runtimes can ignore them without rejecting config authored by a newer release.", + "properties": { + "kind": { + "enum": [ + "unknown" + ], + "type": "string" + }, + "path": { + "type": "string" + }, + "subpath": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "kind", + "path" + ], + "type": "object" + } + ] } }, "description": "Read a file from the host filesystem.", @@ -15,6 +233,17 @@ } ], "description": "Absolute path to read." + }, + "sandboxPolicy": { + "anyOf": [ + { + "$ref": "#/definitions/FileSystemSandboxPolicy" + }, + { + "type": "null" + } + ], + "description": "Optional sandbox policy for re-invoking this filesystem operation under a sandbox." } }, "required": [ diff --git a/codex-rs/app-server-protocol/schema/json/v2/FsRemoveParams.json b/codex-rs/app-server-protocol/schema/json/v2/FsRemoveParams.json index d6289d46d0..77f923bdbc 100644 --- a/codex-rs/app-server-protocol/schema/json/v2/FsRemoveParams.json +++ b/codex-rs/app-server-protocol/schema/json/v2/FsRemoveParams.json @@ -4,6 +4,224 @@ "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" + }, + "FileSystemAccessMode": { + "description": "Access mode for a filesystem entry.\n\nWhen two equally specific entries target the same path, we compare these by conflict precedence rather than by capability breadth: `none` beats `write`, and `write` beats `read`.", + "enum": [ + "read", + "write", + "none" + ], + "type": "string" + }, + "FileSystemPath": { + "oneOf": [ + { + "properties": { + "path": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "type": { + "enum": [ + "path" + ], + "title": "PathFileSystemPathType", + "type": "string" + } + }, + "required": [ + "path", + "type" + ], + "title": "PathFileSystemPath", + "type": "object" + }, + { + "properties": { + "type": { + "enum": [ + "special" + ], + "title": "SpecialFileSystemPathType", + "type": "string" + }, + "value": { + "$ref": "#/definitions/FileSystemSpecialPath" + } + }, + "required": [ + "type", + "value" + ], + "title": "SpecialFileSystemPath", + "type": "object" + } + ] + }, + "FileSystemSandboxEntry": { + "properties": { + "access": { + "$ref": "#/definitions/FileSystemAccessMode" + }, + "path": { + "$ref": "#/definitions/FileSystemPath" + } + }, + "required": [ + "access", + "path" + ], + "type": "object" + }, + "FileSystemSandboxKind": { + "enum": [ + "restricted", + "unrestricted", + "external-sandbox" + ], + "type": "string" + }, + "FileSystemSandboxPolicy": { + "properties": { + "entries": { + "items": { + "$ref": "#/definitions/FileSystemSandboxEntry" + }, + "type": "array" + }, + "kind": { + "$ref": "#/definitions/FileSystemSandboxKind" + } + }, + "required": [ + "kind" + ], + "type": "object" + }, + "FileSystemSpecialPath": { + "oneOf": [ + { + "properties": { + "kind": { + "enum": [ + "root" + ], + "type": "string" + } + }, + "required": [ + "kind" + ], + "title": "RootFileSystemSpecialPath", + "type": "object" + }, + { + "properties": { + "kind": { + "enum": [ + "minimal" + ], + "type": "string" + } + }, + "required": [ + "kind" + ], + "title": "MinimalFileSystemSpecialPath", + "type": "object" + }, + { + "properties": { + "kind": { + "enum": [ + "current_working_directory" + ], + "type": "string" + } + }, + "required": [ + "kind" + ], + "title": "CurrentWorkingDirectoryFileSystemSpecialPath", + "type": "object" + }, + { + "properties": { + "kind": { + "enum": [ + "project_roots" + ], + "type": "string" + }, + "subpath": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "kind" + ], + "title": "KindFileSystemSpecialPath", + "type": "object" + }, + { + "properties": { + "kind": { + "enum": [ + "tmpdir" + ], + "type": "string" + } + }, + "required": [ + "kind" + ], + "title": "TmpdirFileSystemSpecialPath", + "type": "object" + }, + { + "properties": { + "kind": { + "enum": [ + "slash_tmp" + ], + "type": "string" + } + }, + "required": [ + "kind" + ], + "title": "SlashTmpFileSystemSpecialPath", + "type": "object" + }, + { + "description": "WARNING: `:special_path` tokens are part of config compatibility. Do not make older runtimes reject newly introduced tokens. New parser support should be additive, while unknown values must stay representable so config from a newer Codex degrades to warn-and-ignore instead of failing to load. Codex 0.112.0 rejected unknown values here, which broke forward compatibility for newer config. Preserves future special-path tokens so older runtimes can ignore them without rejecting config authored by a newer release.", + "properties": { + "kind": { + "enum": [ + "unknown" + ], + "type": "string" + }, + "path": { + "type": "string" + }, + "subpath": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "kind", + "path" + ], + "type": "object" + } + ] } }, "description": "Remove a file or directory tree from the host filesystem.", @@ -29,6 +247,17 @@ "boolean", "null" ] + }, + "sandboxPolicy": { + "anyOf": [ + { + "$ref": "#/definitions/FileSystemSandboxPolicy" + }, + { + "type": "null" + } + ], + "description": "Optional sandbox policy for re-invoking this filesystem operation under a sandbox." } }, "required": [ diff --git a/codex-rs/app-server-protocol/schema/json/v2/FsWriteFileParams.json b/codex-rs/app-server-protocol/schema/json/v2/FsWriteFileParams.json index e1b5eabd98..dfafb36202 100644 --- a/codex-rs/app-server-protocol/schema/json/v2/FsWriteFileParams.json +++ b/codex-rs/app-server-protocol/schema/json/v2/FsWriteFileParams.json @@ -4,6 +4,224 @@ "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" + }, + "FileSystemAccessMode": { + "description": "Access mode for a filesystem entry.\n\nWhen two equally specific entries target the same path, we compare these by conflict precedence rather than by capability breadth: `none` beats `write`, and `write` beats `read`.", + "enum": [ + "read", + "write", + "none" + ], + "type": "string" + }, + "FileSystemPath": { + "oneOf": [ + { + "properties": { + "path": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "type": { + "enum": [ + "path" + ], + "title": "PathFileSystemPathType", + "type": "string" + } + }, + "required": [ + "path", + "type" + ], + "title": "PathFileSystemPath", + "type": "object" + }, + { + "properties": { + "type": { + "enum": [ + "special" + ], + "title": "SpecialFileSystemPathType", + "type": "string" + }, + "value": { + "$ref": "#/definitions/FileSystemSpecialPath" + } + }, + "required": [ + "type", + "value" + ], + "title": "SpecialFileSystemPath", + "type": "object" + } + ] + }, + "FileSystemSandboxEntry": { + "properties": { + "access": { + "$ref": "#/definitions/FileSystemAccessMode" + }, + "path": { + "$ref": "#/definitions/FileSystemPath" + } + }, + "required": [ + "access", + "path" + ], + "type": "object" + }, + "FileSystemSandboxKind": { + "enum": [ + "restricted", + "unrestricted", + "external-sandbox" + ], + "type": "string" + }, + "FileSystemSandboxPolicy": { + "properties": { + "entries": { + "items": { + "$ref": "#/definitions/FileSystemSandboxEntry" + }, + "type": "array" + }, + "kind": { + "$ref": "#/definitions/FileSystemSandboxKind" + } + }, + "required": [ + "kind" + ], + "type": "object" + }, + "FileSystemSpecialPath": { + "oneOf": [ + { + "properties": { + "kind": { + "enum": [ + "root" + ], + "type": "string" + } + }, + "required": [ + "kind" + ], + "title": "RootFileSystemSpecialPath", + "type": "object" + }, + { + "properties": { + "kind": { + "enum": [ + "minimal" + ], + "type": "string" + } + }, + "required": [ + "kind" + ], + "title": "MinimalFileSystemSpecialPath", + "type": "object" + }, + { + "properties": { + "kind": { + "enum": [ + "current_working_directory" + ], + "type": "string" + } + }, + "required": [ + "kind" + ], + "title": "CurrentWorkingDirectoryFileSystemSpecialPath", + "type": "object" + }, + { + "properties": { + "kind": { + "enum": [ + "project_roots" + ], + "type": "string" + }, + "subpath": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "kind" + ], + "title": "KindFileSystemSpecialPath", + "type": "object" + }, + { + "properties": { + "kind": { + "enum": [ + "tmpdir" + ], + "type": "string" + } + }, + "required": [ + "kind" + ], + "title": "TmpdirFileSystemSpecialPath", + "type": "object" + }, + { + "properties": { + "kind": { + "enum": [ + "slash_tmp" + ], + "type": "string" + } + }, + "required": [ + "kind" + ], + "title": "SlashTmpFileSystemSpecialPath", + "type": "object" + }, + { + "description": "WARNING: `:special_path` tokens are part of config compatibility. Do not make older runtimes reject newly introduced tokens. New parser support should be additive, while unknown values must stay representable so config from a newer Codex degrades to warn-and-ignore instead of failing to load. Codex 0.112.0 rejected unknown values here, which broke forward compatibility for newer config. Preserves future special-path tokens so older runtimes can ignore them without rejecting config authored by a newer release.", + "properties": { + "kind": { + "enum": [ + "unknown" + ], + "type": "string" + }, + "path": { + "type": "string" + }, + "subpath": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "kind", + "path" + ], + "type": "object" + } + ] } }, "description": "Write a file on the host filesystem.", @@ -19,6 +237,17 @@ } ], "description": "Absolute path to write." + }, + "sandboxPolicy": { + "anyOf": [ + { + "$ref": "#/definitions/FileSystemSandboxPolicy" + }, + { + "type": "null" + } + ], + "description": "Optional sandbox policy for re-invoking this filesystem operation under a sandbox." } }, "required": [ diff --git a/codex-rs/app-server-protocol/schema/typescript/FileSystemAccessMode.ts b/codex-rs/app-server-protocol/schema/typescript/FileSystemAccessMode.ts new file mode 100644 index 0000000000..ccaa07a8bf --- /dev/null +++ b/codex-rs/app-server-protocol/schema/typescript/FileSystemAccessMode.ts @@ -0,0 +1,12 @@ +// GENERATED CODE! DO NOT MODIFY BY HAND! + +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +/** + * Access mode for a filesystem entry. + * + * When two equally specific entries target the same path, we compare these by + * conflict precedence rather than by capability breadth: `none` beats + * `write`, and `write` beats `read`. + */ +export type FileSystemAccessMode = "read" | "write" | "none"; diff --git a/codex-rs/app-server-protocol/schema/typescript/FileSystemPath.ts b/codex-rs/app-server-protocol/schema/typescript/FileSystemPath.ts new file mode 100644 index 0000000000..3b022f1744 --- /dev/null +++ b/codex-rs/app-server-protocol/schema/typescript/FileSystemPath.ts @@ -0,0 +1,7 @@ +// GENERATED CODE! DO NOT MODIFY BY HAND! + +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { AbsolutePathBuf } from "./AbsolutePathBuf"; +import type { FileSystemSpecialPath } from "./FileSystemSpecialPath"; + +export type FileSystemPath = { "type": "path", path: AbsolutePathBuf, } | { "type": "special", value: FileSystemSpecialPath, }; diff --git a/codex-rs/app-server-protocol/schema/typescript/FileSystemSandboxEntry.ts b/codex-rs/app-server-protocol/schema/typescript/FileSystemSandboxEntry.ts new file mode 100644 index 0000000000..f37cd0d63e --- /dev/null +++ b/codex-rs/app-server-protocol/schema/typescript/FileSystemSandboxEntry.ts @@ -0,0 +1,7 @@ +// GENERATED CODE! DO NOT MODIFY BY HAND! + +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { FileSystemAccessMode } from "./FileSystemAccessMode"; +import type { FileSystemPath } from "./FileSystemPath"; + +export type FileSystemSandboxEntry = { path: FileSystemPath, access: FileSystemAccessMode, }; diff --git a/codex-rs/app-server-protocol/schema/typescript/FileSystemSandboxKind.ts b/codex-rs/app-server-protocol/schema/typescript/FileSystemSandboxKind.ts new file mode 100644 index 0000000000..cfeb7aa107 --- /dev/null +++ b/codex-rs/app-server-protocol/schema/typescript/FileSystemSandboxKind.ts @@ -0,0 +1,5 @@ +// GENERATED CODE! DO NOT MODIFY BY HAND! + +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type FileSystemSandboxKind = "restricted" | "unrestricted" | "external-sandbox"; diff --git a/codex-rs/app-server-protocol/schema/typescript/FileSystemSandboxPolicy.ts b/codex-rs/app-server-protocol/schema/typescript/FileSystemSandboxPolicy.ts new file mode 100644 index 0000000000..d49eeace76 --- /dev/null +++ b/codex-rs/app-server-protocol/schema/typescript/FileSystemSandboxPolicy.ts @@ -0,0 +1,7 @@ +// GENERATED CODE! DO NOT MODIFY BY HAND! + +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { FileSystemSandboxEntry } from "./FileSystemSandboxEntry"; +import type { FileSystemSandboxKind } from "./FileSystemSandboxKind"; + +export type FileSystemSandboxPolicy = { kind: FileSystemSandboxKind, entries?: Array, }; diff --git a/codex-rs/app-server-protocol/schema/typescript/FileSystemSpecialPath.ts b/codex-rs/app-server-protocol/schema/typescript/FileSystemSpecialPath.ts new file mode 100644 index 0000000000..8ba7b433a6 --- /dev/null +++ b/codex-rs/app-server-protocol/schema/typescript/FileSystemSpecialPath.ts @@ -0,0 +1,5 @@ +// GENERATED CODE! DO NOT MODIFY BY HAND! + +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type FileSystemSpecialPath = { "kind": "root" } | { "kind": "minimal" } | { "kind": "current_working_directory" } | { "kind": "project_roots", subpath?: string, } | { "kind": "tmpdir" } | { "kind": "slash_tmp" } | { "kind": "unknown", path: string, subpath?: string, }; diff --git a/codex-rs/app-server-protocol/schema/typescript/index.ts b/codex-rs/app-server-protocol/schema/typescript/index.ts index 09c388337f..b4dbc74103 100644 --- a/codex-rs/app-server-protocol/schema/typescript/index.ts +++ b/codex-rs/app-server-protocol/schema/typescript/index.ts @@ -16,6 +16,12 @@ export type { ExecCommandApprovalParams } from "./ExecCommandApprovalParams"; export type { ExecCommandApprovalResponse } from "./ExecCommandApprovalResponse"; export type { ExecPolicyAmendment } from "./ExecPolicyAmendment"; export type { FileChange } from "./FileChange"; +export type { FileSystemAccessMode } from "./FileSystemAccessMode"; +export type { FileSystemPath } from "./FileSystemPath"; +export type { FileSystemSandboxEntry } from "./FileSystemSandboxEntry"; +export type { FileSystemSandboxKind } from "./FileSystemSandboxKind"; +export type { FileSystemSandboxPolicy } from "./FileSystemSandboxPolicy"; +export type { FileSystemSpecialPath } from "./FileSystemSpecialPath"; export type { ForcedLoginMethod } from "./ForcedLoginMethod"; export type { FunctionCallOutputBody } from "./FunctionCallOutputBody"; export type { FunctionCallOutputContentItem } from "./FunctionCallOutputContentItem"; diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/FsCopyParams.ts b/codex-rs/app-server-protocol/schema/typescript/v2/FsCopyParams.ts index 8f1ec8d4e0..407fd15749 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/FsCopyParams.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/FsCopyParams.ts @@ -2,6 +2,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { AbsolutePathBuf } from "../AbsolutePathBuf"; +import type { FileSystemSandboxPolicy } from "../FileSystemSandboxPolicy"; /** * Copy a file or directory tree on the host filesystem. @@ -18,4 +19,8 @@ destinationPath: AbsolutePathBuf, /** * Required for directory copies; ignored for file copies. */ -recursive?: boolean, }; +recursive?: boolean, +/** + * Optional sandbox policy for re-invoking this filesystem operation under a sandbox. + */ +sandboxPolicy?: FileSystemSandboxPolicy | null, }; diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/FsCreateDirectoryParams.ts b/codex-rs/app-server-protocol/schema/typescript/v2/FsCreateDirectoryParams.ts index 2afc9950ba..f7914f98f9 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/FsCreateDirectoryParams.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/FsCreateDirectoryParams.ts @@ -2,6 +2,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { AbsolutePathBuf } from "../AbsolutePathBuf"; +import type { FileSystemSandboxPolicy } from "../FileSystemSandboxPolicy"; /** * Create a directory on the host filesystem. @@ -14,4 +15,8 @@ path: AbsolutePathBuf, /** * Whether parent directories should also be created. Defaults to `true`. */ -recursive?: boolean | null, }; +recursive?: boolean | null, +/** + * Optional sandbox policy for re-invoking this filesystem operation under a sandbox. + */ +sandboxPolicy?: FileSystemSandboxPolicy | null, }; diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/FsGetMetadataParams.ts b/codex-rs/app-server-protocol/schema/typescript/v2/FsGetMetadataParams.ts index 38e46c7b1c..0fc3c80c28 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/FsGetMetadataParams.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/FsGetMetadataParams.ts @@ -2,6 +2,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { AbsolutePathBuf } from "../AbsolutePathBuf"; +import type { FileSystemSandboxPolicy } from "../FileSystemSandboxPolicy"; /** * Request metadata for an absolute path. @@ -10,4 +11,8 @@ export type FsGetMetadataParams = { /** * Absolute path to inspect. */ -path: AbsolutePathBuf, }; +path: AbsolutePathBuf, +/** + * Optional sandbox policy for re-invoking this filesystem operation under a sandbox. + */ +sandboxPolicy?: FileSystemSandboxPolicy | null, }; diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/FsReadDirectoryParams.ts b/codex-rs/app-server-protocol/schema/typescript/v2/FsReadDirectoryParams.ts index 770eea3a35..8ed0dfafaf 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/FsReadDirectoryParams.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/FsReadDirectoryParams.ts @@ -2,6 +2,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { AbsolutePathBuf } from "../AbsolutePathBuf"; +import type { FileSystemSandboxPolicy } from "../FileSystemSandboxPolicy"; /** * List direct child names for a directory. @@ -10,4 +11,8 @@ export type FsReadDirectoryParams = { /** * Absolute directory path to read. */ -path: AbsolutePathBuf, }; +path: AbsolutePathBuf, +/** + * Optional sandbox policy for re-invoking this filesystem operation under a sandbox. + */ +sandboxPolicy?: FileSystemSandboxPolicy | null, }; diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/FsReadFileParams.ts b/codex-rs/app-server-protocol/schema/typescript/v2/FsReadFileParams.ts index f389b44fc5..ffcc512ca8 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/FsReadFileParams.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/FsReadFileParams.ts @@ -2,6 +2,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { AbsolutePathBuf } from "../AbsolutePathBuf"; +import type { FileSystemSandboxPolicy } from "../FileSystemSandboxPolicy"; /** * Read a file from the host filesystem. @@ -10,4 +11,8 @@ export type FsReadFileParams = { /** * Absolute path to read. */ -path: AbsolutePathBuf, }; +path: AbsolutePathBuf, +/** + * Optional sandbox policy for re-invoking this filesystem operation under a sandbox. + */ +sandboxPolicy?: FileSystemSandboxPolicy | null, }; diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/FsRemoveParams.ts b/codex-rs/app-server-protocol/schema/typescript/v2/FsRemoveParams.ts index c9f02eb008..9395f3dce1 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/FsRemoveParams.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/FsRemoveParams.ts @@ -2,6 +2,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { AbsolutePathBuf } from "../AbsolutePathBuf"; +import type { FileSystemSandboxPolicy } from "../FileSystemSandboxPolicy"; /** * Remove a file or directory tree from the host filesystem. @@ -18,4 +19,8 @@ recursive?: boolean | null, /** * Whether missing paths should be ignored. Defaults to `true`. */ -force?: boolean | null, }; +force?: boolean | null, +/** + * Optional sandbox policy for re-invoking this filesystem operation under a sandbox. + */ +sandboxPolicy?: FileSystemSandboxPolicy | null, }; diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/FsWriteFileParams.ts b/codex-rs/app-server-protocol/schema/typescript/v2/FsWriteFileParams.ts index 7c22abdb3a..7a12e0bf33 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/FsWriteFileParams.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/FsWriteFileParams.ts @@ -2,6 +2,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { AbsolutePathBuf } from "../AbsolutePathBuf"; +import type { FileSystemSandboxPolicy } from "../FileSystemSandboxPolicy"; /** * Write a file on the host filesystem. @@ -14,4 +15,8 @@ path: AbsolutePathBuf, /** * File contents encoded as base64. */ -dataBase64: string, }; +dataBase64: string, +/** + * Optional sandbox policy for re-invoking this filesystem operation under a sandbox. + */ +sandboxPolicy?: FileSystemSandboxPolicy | null, }; diff --git a/codex-rs/app-server-protocol/src/schema_fixtures.rs b/codex-rs/app-server-protocol/src/schema_fixtures.rs index 56dcf33a4d..ca208dda33 100644 --- a/codex-rs/app-server-protocol/src/schema_fixtures.rs +++ b/codex-rs/app-server-protocol/src/schema_fixtures.rs @@ -17,6 +17,7 @@ use std::collections::BTreeMap; use std::collections::HashSet; use std::path::Path; use std::path::PathBuf; +use std::process::Command; use ts_rs::TS; use ts_rs::TypeVisitor; @@ -52,6 +53,17 @@ pub fn read_schema_fixture_subtree( #[doc(hidden)] pub fn generate_typescript_schema_fixture_subtree_for_tests() -> Result>> { + let files = generate_typescript_schema_fixture_subtree(SchemaFixtureOptions::default())?; + + Ok(files + .into_iter() + .map(|(path, content)| (path, content.into_bytes())) + .collect()) +} + +fn generate_typescript_schema_fixture_subtree( + options: SchemaFixtureOptions, +) -> Result> { let mut files = BTreeMap::new(); let mut seen = HashSet::new(); @@ -66,13 +78,12 @@ pub fn generate_typescript_schema_fixture_subtree_for_tests() -> Result(&mut files, &mut seen)?; - filter_experimental_ts_tree(&mut files)?; + if !options.experimental_api { + filter_experimental_ts_tree(&mut files)?; + } generate_index_ts_tree(&mut files); - Ok(files - .into_iter() - .map(|(path, content)| (path, content.into_bytes())) - .collect()) + Ok(files) } /// Regenerates `schema/typescript/` and `schema/json/`. @@ -95,19 +106,52 @@ pub fn write_schema_fixtures_with_options( ensure_empty_dir(&typescript_out_dir)?; ensure_empty_dir(&json_out_dir)?; - crate::generate_ts_with_options( + write_typescript_schema_fixture_subtree( &typescript_out_dir, + &generate_typescript_schema_fixture_subtree(options)?, prettier, - crate::GenerateTsOptions { - experimental_api: options.experimental_api, - ..crate::GenerateTsOptions::default() - }, )?; crate::generate_json_with_experimental(&json_out_dir, options.experimental_api)?; Ok(()) } +fn write_typescript_schema_fixture_subtree( + output_dir: &Path, + files: &BTreeMap, + prettier: Option<&Path>, +) -> Result<()> { + let mut ts_files = Vec::with_capacity(files.len()); + for (relative_path, content) in files { + let output_path = output_dir.join(relative_path); + if let Some(parent) = output_path.parent() { + std::fs::create_dir_all(parent) + .with_context(|| format!("failed to create {}", parent.display()))?; + } + let output = format!("{GENERATED_TS_HEADER}{content}"); + std::fs::write(&output_path, output) + .with_context(|| format!("failed to write {}", output_path.display()))?; + ts_files.push(output_path); + } + + if let Some(prettier_bin) = prettier + && !ts_files.is_empty() + { + let status = Command::new(prettier_bin) + .arg("--write") + .arg("--log-level") + .arg("warn") + .args(ts_files.iter().map(|path| path.as_os_str())) + .status() + .with_context(|| format!("failed to invoke Prettier at {}", prettier_bin.display()))?; + if !status.success() { + anyhow::bail!("Prettier failed with status {status}"); + } + } + + Ok(()) +} + fn ensure_empty_dir(dir: &Path) -> Result<()> { if dir.exists() { std::fs::remove_dir_all(dir)