Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions sdk/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ await conn.disconnect();
| `startReview(target?, delivery?)` | Start a Codex review (`review/start`); defaults to uncommitted changes |
| `compactThread()` | Compact the active thread's context (`thread/compact/start`) |
| `readConfig(params?)` | Read the app-server's effective config (`config/read`) |
| `readConfigRequirements()` | Read enforced managed requirements (`configRequirements/read`) |
| `onApprovalRequest(method, handler)` | Handle server-initiated approval or MCP elicitation requests (returns unsubscribe fn) |
| `threadId` | The active thread id (`string \| undefined`) |
| `onAxonEvent(listener)` | Subscribe to all Axon events (returns unsubscribe fn) |
Expand Down
1 change: 1 addition & 0 deletions sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,7 @@ Like ACP/Claude, call `initialize()` after `connect()` — it runs the app-serve
| `startReview(target?, delivery?)` | Start a Codex review (`review/start`); defaults to reviewing uncommitted changes |
| `compactThread()` | Compact the active thread's context (`thread/compact/start`) |
| `readConfig(params?)` | Read the app-server's effective configuration (`config/read`) |
| `readConfigRequirements()` | Read the managed requirements the app-server enforces, such as allowed sandbox modes (`configRequirements/read`) |

**Listeners**:

Expand Down
2 changes: 2 additions & 0 deletions sdk/src/codex/connection.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ describe("CodexAxonConnection", () => {
await conn.connect();
await conn.startThread();
await conn.getAccountRateLimits();
await conn.readConfigRequirements();
await conn.getAccountTokenUsage();
await conn.readThread({ includeTurns: true });
await conn.setThreadName("renamed");
Expand All @@ -321,6 +322,7 @@ describe("CodexAxonConnection", () => {
const byMethod = Object.fromEntries(frames.map((frame) => [frame.method, frame]));
// Option<()> wire params: the field must be absent, not an empty object.
expect(byMethod["account/rateLimits/read"]).not.toHaveProperty("params");
expect(byMethod["configRequirements/read"]).not.toHaveProperty("params");
expect(byMethod["account/usage/read"]).not.toHaveProperty("params");
expect(byMethod["thread/read"]).toMatchObject({
params: { threadId: "thr-1", includeTurns: true },
Expand Down
13 changes: 13 additions & 0 deletions sdk/src/codex/connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import type {
CollaborationMode,
ConfigReadParams,
ConfigReadResponse,
ConfigRequirementsReadResponse,
GetAccountRateLimitsResponse,
GetAccountTokenUsageResponse,
InitializeParams,
Expand Down Expand Up @@ -745,6 +746,18 @@ export class CodexAxonConnection {
async readConfig(params: ConfigReadParams = {}): Promise<ConfigReadResponse> {
return (await this.request("config/read", params)) as ConfigReadResponse;
}
/**
* Reads the managed requirements the app-server enforces
* (`configRequirements/read`), such as allowed sandbox modes and permission
* profiles; `requirements` is null when none apply.
* Wire params are `Option<()>`: the params field must be omitted, not `{}`.
*/
async readConfigRequirements(): Promise<ConfigRequirementsReadResponse> {
return (await this.request(
"configRequirements/read",
undefined,
)) as ConfigRequirementsReadResponse;
}
/**
* Reads the account's current rate limits (`account/rateLimits/read`).
* Wire params are `Option<()>`: the params field must be omitted, not `{}`.
Expand Down
2 changes: 2 additions & 0 deletions sdk/src/codex/protocol/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ export type * from "./generated/index.js";
export type {
ConfigReadParams,
ConfigReadResponse,
ConfigRequirements,
ConfigRequirementsReadResponse,
GetAccountRateLimitsResponse,
GetAccountTokenUsageResponse,
ListMcpServerStatusParams,
Expand Down
Loading