codex-computer-use-mcp 0.3.1 → 0.3.3
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/ARCHITECTURE.md +48 -36
- package/CHANGELOG.md +13 -0
- package/CONTRIBUTING.md +5 -4
- package/MIGRATION.md +22 -2
- package/PROOF.md +8 -5
- package/README.md +18 -18
- package/SECURITY.md +17 -9
- package/dist/direct-broker.d.ts +11 -1
- package/dist/direct-broker.js +159 -109
- package/dist/direct-broker.js.map +1 -1
- package/dist/mcp-server.js +1 -1
- package/dist/system.d.ts +11 -0
- package/dist/system.js +16 -4
- package/dist/system.js.map +1 -1
- package/integrations/pi/README.md +8 -9
- package/integrations/pi/index.ts +95 -12
- package/integrations/pi/mcp.json.example +1 -1
- package/npm-shrinkwrap.json +2 -2
- package/package.json +2 -1
package/ARCHITECTURE.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
Code Mode remains outside this package. See [ADR 0001: Keep Code Mode in a standalone MCP process](docs/adr/0001-standalone-code-mode-mcp.md).
|
|
4
4
|
|
|
5
|
+
## Design intent
|
|
6
|
+
|
|
7
|
+
This package is a thin transport adapter to the official signed Computer Use tools. It has no independent policy or security role. Codex and macOS remain authoritative for tool behavior, access decisions, and platform controls.
|
|
8
|
+
|
|
9
|
+
Preserve the official capability surface. Add adapter code only when the transport, zero-model-turn architecture, component compatibility, or process lifecycle requires it.
|
|
10
|
+
|
|
11
|
+
Canonical app resolution, same-app locking, focus completion telemetry, and metadata-only audit came from the earlier background-computer-use wrapper. The current release retains them for compatibility. They do not provide extra authorization or sandbox boundaries. This inventory does not justify extending them. A maintainer must explicitly approve their removal or material simplification.
|
|
12
|
+
|
|
5
13
|
## Official API evidence
|
|
6
14
|
|
|
7
15
|
The architecture uses public source and the installed signed binaries; it does not speak a private Computer Use socket protocol.
|
|
@@ -61,7 +69,7 @@ The relevant construction difference is the macOS responsible-process chain:
|
|
|
61
69
|
- unsupported: ad-hoc/no-Team-ID Node parent → signed helper;
|
|
62
70
|
- supported: Node/Pi → strict-valid OpenAI-signed app-bundled Codex (`2DC432GLL2`) → strict-valid OpenAI-signed helper (`2DC432GLL2`).
|
|
63
71
|
|
|
64
|
-
Process sampling confirmed the helper children were direct descendants of signed app-server; helper processes may create their own process groups. App-server and helper therefore share one private
|
|
72
|
+
Process sampling confirmed the helper children were direct descendants of signed app-server; helper processes may create their own process groups. App-server and helper therefore share one private broker-session cwd. One-shot MCP calls close that session after the call; Pi retains it only across the required `get_app_state` and following action. Cleanup preserves partial ancestry results, recovers any reparented process by that unique cwd, freezes the owned set to stability, then kills and verifies every process rather than assuming one PGID. Enumeration, freeze, or exit uncertainty fails cleanup closed. The app-server has the expected sandbox/application-group entitlement keys; the helper has OpenAI application/team identifiers, application groups, and keychain-access-group entitlements. Ordinary Node has no Team ID or entitlement set. The service's peer audit token is not exposed through the supported MCP layer. No private socket inspection, identity spoofing, copied signing material, re-signing, injection, or TCC change was attempted. The remaining enforcement boundary is therefore OS peer/responsible-process identity, not a missing public JSON field.
|
|
65
73
|
|
|
66
74
|
Command, environment, cwd, and config differences were also isolated: both paths invoke the same signed helper with `mcp`; the accepted path gives it a signed parent plus a private fixed cwd/config environment. Matching public MCP fields did not alter the raw error, while the signed-parent path succeeds without model credentials.
|
|
67
75
|
|
|
@@ -90,40 +98,42 @@ codex mcp-server model tools
|
|
|
90
98
|
nested prompts or result summaries
|
|
91
99
|
```
|
|
92
100
|
|
|
93
|
-
##
|
|
101
|
+
## Current adapter inventory
|
|
94
102
|
|
|
95
|
-
|
|
|
103
|
+
| Mechanism or former restriction | Role in the direct design | Current treatment |
|
|
96
104
|
|---|---|---|
|
|
97
|
-
| Reviewed ChatGPT/Codex/client paths |
|
|
98
|
-
| Strict signatures and OpenAI Team ID |
|
|
99
|
-
| Signed-parent/responsible-process chain |
|
|
100
|
-
| Private Sky socket/native-pipe access |
|
|
101
|
-
| Nested Codex model and prompt |
|
|
102
|
-
| Model selection and reasoning effort |
|
|
103
|
-
| Responses websocket prewarm on empty thread |
|
|
104
|
-
| Plugin/remote-control startup networking |
|
|
105
|
-
| Model-written multi-step task plan |
|
|
106
|
-
| Model result schema/summary |
|
|
107
|
-
| Streamed model-event target/method validation |
|
|
108
|
-
| Per-operation tool allowlists and call budgets |
|
|
109
|
-
| Task text, cleanup instructions, required-capabilities fields |
|
|
110
|
-
| Dictionary-only special policy |
|
|
111
|
-
| Wrapper app/intent allowlists in full mode |
|
|
112
|
-
| Safe/full wrapper modes |
|
|
113
|
-
| Wrapper approval prompts/configuration |
|
|
114
|
-
| Official first-party app access |
|
|
115
|
-
| macOS TCC |
|
|
116
|
-
| Exact ten-tool inventory/schema |
|
|
117
|
-
| Canonical bundle identity |
|
|
118
|
-
| Same-app kernel lock |
|
|
119
|
-
| Automatic background app launch |
|
|
120
|
-
| Global focus watcher and final sample |
|
|
121
|
-
| Timeout/cancellation process-tree termination |
|
|
122
|
-
|
|
|
123
|
-
| Codex token usage accounting |
|
|
124
|
-
| Content-safe private audit |
|
|
125
|
-
| Full-result spill files |
|
|
126
|
-
| Browser-host integration |
|
|
105
|
+
| Reviewed ChatGPT/Codex/client paths | official transport compatibility | current per-user installed-component contract plus exact legacy plugin layout; canonicalized and verified |
|
|
106
|
+
| Strict signatures and OpenAI Team ID | official component verification | retained to verify the selected signed transport components |
|
|
107
|
+
| Signed-parent/responsible-process chain | official transport requirement | retained through signed app-server |
|
|
108
|
+
| Private Sky socket/native-pipe access | unsupported/private route | prohibited |
|
|
109
|
+
| Nested Codex model and prompt | former compatibility layer | removed |
|
|
110
|
+
| Model selection and reasoning effort | former compatibility layer | removed; dummy unreachable provider prevents model transport |
|
|
111
|
+
| Responses websocket prewarm on empty thread | accidental app-server behavior | disabled with non-websocket dummy provider |
|
|
112
|
+
| Plugin/remote-control startup networking | accidental app-server behavior | corresponding features disabled |
|
|
113
|
+
| Model-written multi-step task plan | former compatibility layer | removed |
|
|
114
|
+
| Model result schema/summary | former compatibility layer | removed |
|
|
115
|
+
| Streamed model-event target/method validation | former compatibility layer | replaced by pre-dispatch typed call validation |
|
|
116
|
+
| Per-operation tool allowlists and call budgets | former wrapper policy | removed; one typed method per direct request |
|
|
117
|
+
| Task text, cleanup instructions, required-capabilities fields | former compatibility layer | removed |
|
|
118
|
+
| Dictionary-only special policy | former wrapper policy | removed |
|
|
119
|
+
| Wrapper app/intent allowlists in full mode | former wrapper policy | absent |
|
|
120
|
+
| Safe/full wrapper modes | former wrapper policy | removed; one durable no-permissions interface exposes all ten methods |
|
|
121
|
+
| Wrapper approval prompts/configuration | former wrapper policy | removed; no command, config, environment, or per-call selector remains |
|
|
122
|
+
| Official first-party app access | official Codex control | official Codex Full access auto-accepts normal empty-schema app approval elicitations; any elicitation app-server emits is forwarded unchanged |
|
|
123
|
+
| macOS TCC | official platform control | retained; never modified |
|
|
124
|
+
| Exact ten-tool inventory/schema | protocol compatibility check | retained and checked before each call |
|
|
125
|
+
| Canonical bundle identity | legacy wrapper behavior | retained for the current release contract; not an independent authorization boundary |
|
|
126
|
+
| Same-app kernel lock | legacy wrapper coordination | retained in one fixed per-user namespace shared across Pi/MCP state roots |
|
|
127
|
+
| Automatic background app launch | accidental wrapper behavior | removed; the official tool owns app behavior |
|
|
128
|
+
| Global focus watcher and final sample | legacy completion telemetry | retained for the current release contract; not a preventive sandbox |
|
|
129
|
+
| Timeout/cancellation process-tree termination | operational lifecycle | retained with strict enumeration, freeze, kill, stdio-close, and exit verification |
|
|
130
|
+
| Temporary broker-session cleanup | operational lifecycle | retained with isolated `CODEX_HOME`; Pi closes after the inspection-action pair, replacement inspection, or session shutdown |
|
|
131
|
+
| Codex token usage accounting | former compatibility layer | removed; no model turn exists |
|
|
132
|
+
| Content-safe private audit | legacy observability behavior | retained with direct-call fields; not an authorization mechanism |
|
|
133
|
+
| Full-result spill files | output hygiene | prohibited; truncation is in-memory only |
|
|
134
|
+
| Browser-host integration | out of scope | unchanged |
|
|
135
|
+
|
|
136
|
+
These roles explain the current code. They do not authorize new safeguards. Only propose hardening for a concrete, realistically reachable failure in the supported path.
|
|
127
137
|
|
|
128
138
|
## No-permissions and elicitation boundary
|
|
129
139
|
|
|
@@ -133,11 +143,13 @@ App-server is created with `approvalPolicy: "never"` and `sandbox: "danger-full-
|
|
|
133
143
|
|
|
134
144
|
The broker still handles any `mcpServer/elicitation/request` that app-server emits. Pi advertises OpenAI-form support and renders emitted form, OpenAI-form, and URL requests. Generic stdio MCP forwards supported standard modes as `elicitation/create`. The response path preserves `accept`, `decline`, `cancel`, structured content, and response metadata; no callback or compatible UI yields `cancel`, never an invented decision.
|
|
135
145
|
|
|
136
|
-
## Pi tool
|
|
146
|
+
## Pi tool and session boundary
|
|
147
|
+
|
|
148
|
+
The Pi extension registers and activates all ten official definitions on `session_start`, additively preserving active tools owned by Pi and other extensions. Keeping inspection and interaction methods on the same direct surface avoids provider-bound tool discovery creating a second, incompatible client binding.
|
|
137
149
|
|
|
138
|
-
|
|
150
|
+
For `get_app_state`, Pi starts one verified zero-turn app-server runtime and signed Computer Use client. The following direct interaction is serialized through that same runtime and thread, preserving the official active-app lease. The retained process tree is closed and verified after the action, before a replacement inspection, or during `session_shutdown`. One-shot MCP calls still start and close a broker session within the call. Exact inventory and schemas are revalidated before every dispatch in either path.
|
|
139
151
|
|
|
140
|
-
This
|
|
152
|
+
This lifecycle changes neither the schemas nor the no-permissions policy. Interaction definitions omit extra `promptSnippet` and `promptGuidelines` metadata and rely on their official descriptions.
|
|
141
153
|
|
|
142
154
|
## Output boundary
|
|
143
155
|
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
This changelog records user-visible changes from version 0.3.2 onwards.
|
|
4
|
+
|
|
5
|
+
## 0.3.3 - 2026-07-27
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- Support the macOS 27 `lsappinfo` `bundleID` output so frontmost-app detection can proceed to official Computer Use dispatch. [Brad Hallett](https://github.com/bradhallett) contributed this fix in [PR #6](https://github.com/tmustier/codex-computer-use-mcp/pull/6).
|
|
10
|
+
|
|
11
|
+
### Documentation
|
|
12
|
+
|
|
13
|
+
- Clarify that this package is a thin transport adapter and distinguish official transport requirements from retained legacy wrapper behavior in [PR #12](https://github.com/tmustier/codex-computer-use-mcp/pull/12).
|
package/CONTRIBUTING.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Contributing
|
|
2
2
|
|
|
3
|
-
Contributions are welcome, especially compatibility fixes, direct-protocol tests,
|
|
3
|
+
Contributions are welcome, especially compatibility fixes, direct-protocol tests, realistic regression coverage, and clearer host diagnostics.
|
|
4
4
|
|
|
5
5
|
## Setup
|
|
6
6
|
|
|
@@ -20,12 +20,13 @@ Development and live acceptance require macOS and the official ChatGPT Computer
|
|
|
20
20
|
- Do not add a nested model, action planner, prompt, subagent, or model-written result summary to direct dispatch.
|
|
21
21
|
- Do not use private pipes/sockets, credential extraction, app injection, re-signing, sender impersonation, TCC automation, or automatic approval acceptance.
|
|
22
22
|
- Keep app-server in a credential-free isolated `CODEX_HOME` with only official Computer Use configured.
|
|
23
|
-
- Add a regression test for
|
|
23
|
+
- Add a regression test for each concrete protocol, compatibility, lifecycle, or current-behavior fix.
|
|
24
24
|
- Never log or persist arguments, typed values, screenshots, app-state/result content, elicitation contents, prompts, credentials, or tokens.
|
|
25
|
-
-
|
|
25
|
+
- Do not add wrapper-side permission policy, risk classification, allowlists, gates, or speculative defence-in-depth on top of official Codex and macOS controls.
|
|
26
|
+
- Treat current focus checks as legacy post-action completion telemetry, not preventive isolation or a precedent for further hardening.
|
|
26
27
|
- Document reviewed ChatGPT component paths, launcher contracts, and upstream schema/API assumptions.
|
|
27
28
|
- Include strict core/Pi type checks, tests, build, audit, package inspection, and real-app acceptance evidence.
|
|
28
|
-
-
|
|
29
|
+
- Review material transport or published-behavior changes at the exact head, and keep findings tied to realistic supported paths.
|
|
29
30
|
|
|
30
31
|
Repository/package renaming, merge, npm publication, and GitHub release require separate maintainer approval.
|
|
31
32
|
|
package/MIGRATION.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Migration and rollback
|
|
2
2
|
|
|
3
|
-
Version 0.2.0 was the breaking direct-tool architecture change from version 0.1.0. Version 0.3.0
|
|
3
|
+
Version 0.2.0 was the breaking direct-tool architecture change from version 0.1.0. Version 0.3.0 added Pi progressive disclosure, version 0.3.1 followed ChatGPT's current per-user Computer Use component layout, version 0.3.2 restored one complete direct Pi surface with shared inspection-action session continuity, and version 0.3.3 adds macOS 27 compatibility. Use the relevant section below.
|
|
4
4
|
|
|
5
5
|
## What changes
|
|
6
6
|
|
|
@@ -88,6 +88,26 @@ ChatGPT 26.721 moved the signed Computer Use app out of the bundled plugin and i
|
|
|
88
88
|
|
|
89
89
|
The resolver does not read `HOME` or `CODEX_HOME` and has no arbitrary path override. Missing, symlinked, invalidly signed, or wrong-Team-ID clients fail closed.
|
|
90
90
|
|
|
91
|
+
## Upgrade from version 0.3.1 to 0.3.2
|
|
92
|
+
|
|
93
|
+
Version 0.3.2 activates all ten direct Pi tools at session start and retains one verified signed-client session across `get_app_state` and the following action.
|
|
94
|
+
|
|
95
|
+
1. Verify that npm resolves `codex-computer-use-mcp@0.3.2` exactly, then install that exact package.
|
|
96
|
+
2. Start a fresh Pi process; do not rely on hot reload for the retained process lifecycle.
|
|
97
|
+
3. Verify all ten `computer_use_*` tools are active through the direct extension binding.
|
|
98
|
+
4. With an unlocked Mac and a benign background app, call `computer_use_get_app_state`, then one harmless interaction against the same app.
|
|
99
|
+
5. Verify the state and action used one app-server runtime/thread, the action did not report an inactive Computer Use session, focus remained preserved, and cleanup completed.
|
|
100
|
+
|
|
101
|
+
The exact schemas, strict signature and OpenAI Team ID checks, canonical client and app resolution, Full access policy, zero-turn attestation, inventory validation, kernel lock, focus telemetry, process-tree cleanup, and content-safe audit remain mandatory.
|
|
102
|
+
|
|
103
|
+
## Upgrade from version 0.3.2 to 0.3.3
|
|
104
|
+
|
|
105
|
+
Version 0.3.3 accepts both the legacy `CFBundleIdentifier` key and the macOS 27 `bundleID` key from `lsappinfo`. This prevents frontmost-app detection from rejecting official Computer Use dispatch on macOS 27. No configuration migration is required.
|
|
106
|
+
|
|
107
|
+
1. Verify that npm resolves `codex-computer-use-mcp@0.3.3` exactly, then install that exact package.
|
|
108
|
+
2. Start a fresh Pi process so it loads the updated extension code.
|
|
109
|
+
3. On an unlocked Mac, run `computer_use_get_app_state` against a benign background app and verify that the result succeeds without moving focus.
|
|
110
|
+
|
|
91
111
|
## Rollback
|
|
92
112
|
|
|
93
113
|
1. Stop the current Pi process.
|
|
@@ -102,4 +122,4 @@ Direct state can be removed only after rollback evidence is captured and no proc
|
|
|
102
122
|
|
|
103
123
|
## Generic MCP gateway
|
|
104
124
|
|
|
105
|
-
If Pi uses `mcp.json`, retain `directTools: false`. Use the exact `0.3.
|
|
125
|
+
If Pi uses `mcp.json`, retain `directTools: false`. Use the exact `0.3.3` package shown in `integrations/pi/mcp.json.example`. During source acceptance, use a distinct temporary server name and source path, then remove it. The direct Pi adapter is the primary live path; do not leave the version 0.1 aggregate server active after the switch.
|
package/PROOF.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Direct architecture proof and acceptance record
|
|
2
2
|
|
|
3
|
-
This file records evidence for the 0.2 direct-tool branch. It
|
|
3
|
+
This file records evidence for the 0.2 direct-tool branch. It does not promise compatibility with future ChatGPT versions or authorize more wrapper safeguards. Historical proof for focus telemetry, locking, cleanup, and audit records released behavior. It does not give the wrapper an independent policy or security role.
|
|
4
4
|
|
|
5
5
|
## Supported direct path
|
|
6
6
|
|
|
@@ -76,8 +76,8 @@ Current branch tests cover:
|
|
|
76
76
|
- signed app-server elicitation forwarding, exact user responses, headless cancellation, and cancellation while a UI callback is pending;
|
|
77
77
|
- standard form/URL forwarding across a real MCP SDK client/server transport;
|
|
78
78
|
- Pi source registration for every direct capability with no nested planner, permission command, or wrapper-generated approval UI;
|
|
79
|
-
- Pi session-start
|
|
80
|
-
-
|
|
79
|
+
- Pi session-start registration and activation of all ten direct definitions while preserving unrelated active tools;
|
|
80
|
+
- one retained broker/client session across `get_app_state` and the following action, with deterministic active-app lease continuity and verified close;
|
|
81
81
|
- Pi form, opaque OpenAI-form, URL, decline, and headless-cancel elicitation handling.
|
|
82
82
|
|
|
83
83
|
## Official Full access approval probe
|
|
@@ -119,7 +119,10 @@ Evidence:
|
|
|
119
119
|
|
|
120
120
|
Earlier exploratory attempts exposed and fixed two acceptance-quality issues rather than being counted as proof: common `CMD+A` needed normalization to the official `Meta_L+a` key form, and TextEdit state restoration had to be reset before a fresh run. The final evidence above is from the corrected direct path.
|
|
121
121
|
|
|
122
|
-
## Pi 0.80.7 progressive-disclosure measurement
|
|
122
|
+
## Historical Pi 0.80.7 progressive-disclosure measurement
|
|
123
|
+
|
|
124
|
+
This measurement describes version 0.3.0 and 0.3.1. Version 0.3.2 intentionally supersedes progressive disclosure because it could leave direct interaction tools absent or make a provider-discovered interaction use a different client from direct `get_app_state`.
|
|
125
|
+
|
|
123
126
|
|
|
124
127
|
A fresh Pi 0.80.7 process loaded only the source Computer Use extension plus a read-only observer. All ten definitions were registered. The initial active Computer Use set was exactly:
|
|
125
128
|
|
|
@@ -130,7 +133,7 @@ Serializing names, descriptions, schemas, and prompt guidelines measured 6,063 b
|
|
|
130
133
|
|
|
131
134
|
A second fresh process exercised the exported activation path from inside a tool execution. Pi's tool result recorded the exact eight interaction names in `addedToolNames`; the before/after active sets retained both inspection tools and removed zero tools. The lazily activated definitions had no `promptSnippet` or `promptGuidelines`.
|
|
132
135
|
|
|
133
|
-
With `openai-codex/gpt-5.6-sol`, the first request reported 5,723 uncached input tokens. The immediately following request after additive activation reported 1,008 uncached input tokens and 5,632 cache-read tokens. This
|
|
136
|
+
With `openai-codex/gpt-5.6-sol`, the first request reported 5,723 uncached input tokens. The immediately following request after additive activation reported 1,008 uncached input tokens and 5,632 cache-read tokens. This was live provider evidence that the initial prefix remained reusable while Pi inserted the eight definitions at the tool-result load point. Version 0.3.2 removes that activation path in favor of complete direct registration and signed-client session continuity.
|
|
134
137
|
|
|
135
138
|
## Review and release status
|
|
136
139
|
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Codex Computer Use MCP
|
|
2
2
|
|
|
3
|
-
Version 0.3.
|
|
3
|
+
Version 0.3.3 exposes the official signed macOS Computer Use capabilities as direct typed tools for Pi and MCP clients. The calling agent chooses every tool and argument itself.
|
|
4
4
|
|
|
5
5
|
The primary path has:
|
|
6
6
|
|
|
@@ -33,9 +33,9 @@ Pi registers namespaced tools to avoid collisions with Pi's built-ins. The MCP s
|
|
|
33
33
|
|
|
34
34
|
The MCP façade preserves the official signed helper's tool descriptions, input schemas, and annotations exactly. The Pi façade preserves its descriptions and input schemas; Pi's tool API does not expose MCP annotations. In particular, all ten MCP methods have `destructiveHint: false`; the wrapper does not conflate changing UI state with destructive behavior or add argument restrictions absent from the official schemas.
|
|
35
35
|
|
|
36
|
-
Pi
|
|
36
|
+
Pi registers and activates all ten definitions together in every fresh session, while preserving active tools owned by Pi and other extensions. This prevents interaction methods from being absent or loaded through an incompatible provider binding.
|
|
37
37
|
|
|
38
|
-
As the official contract specifies, Pi—not a nested planner—calls `computer_use_get_app_state` once per assistant turn before interacting with an app, then chooses and executes actions itself.
|
|
38
|
+
As the official contract specifies, Pi—not a nested planner—calls `computer_use_get_app_state` once per assistant turn before interacting with an app, then chooses and executes actions itself. The adapter retains one verified app-server runtime and signed Computer Use client for that inspection-action pair, so the action reuses the official active-app session established by `get_app_state`. It closes and verifies the retained process tree after the action, when a new inspection supersedes it, or on Pi session shutdown.
|
|
39
39
|
|
|
40
40
|
## Authorization policy: durable no-permissions
|
|
41
41
|
|
|
@@ -43,13 +43,13 @@ As the official contract specifies, Pi—not a nested planner—calls `computer_
|
|
|
43
43
|
|
|
44
44
|
The app-server runtime uses the official Full access combination: `approvalPolicy: "never"` and `sandbox: "danger-full-access"`. In the pinned Codex host, that maps to a disabled permission profile and automatically accepts empty-schema MCP approval elicitations. Normal Computer Use app-access checks therefore proceed without a per-app prompt, just as they do in Codex Full access. The bridge does not edit the service's persistent per-bundle approval file. If app-server emits an elicitation instead of resolving it under Full access, the bridge still forwards it faithfully to the invoking client; unsupported clients return `cancel`, never a fabricated `accept` or `decline`.
|
|
45
45
|
|
|
46
|
-
No-permissions
|
|
46
|
+
No-permissions leaves the official and transport requirements unchanged:
|
|
47
47
|
|
|
48
|
-
- macOS Screen Recording, Accessibility,
|
|
49
|
-
-
|
|
50
|
-
-
|
|
51
|
-
|
|
52
|
-
- focus telemetry,
|
|
48
|
+
- macOS Screen Recording, Accessibility, and TCC controls remain authoritative;
|
|
49
|
+
- the adapter still selects and verifies the official signed components required for the supported transport;
|
|
50
|
+
- the wrapper verifies compatibility with the upstream ten-tool contract.
|
|
51
|
+
|
|
52
|
+
The current release also retains behavior from the earlier background-computer-use wrapper. This includes canonical app resolution, per-user/per-app coordination, focus completion telemetry, process cleanup, and metadata-only audit. These provide compatibility, lifecycle management, and observability. They do not provide extra authorization or a sandbox. Do not use them as a foundation for more wrapper safeguards.
|
|
53
53
|
|
|
54
54
|
## Why the signed app-server is required
|
|
55
55
|
|
|
@@ -67,7 +67,7 @@ See [`ARCHITECTURE.md`](ARCHITECTURE.md) for source links and the full restricti
|
|
|
67
67
|
|
|
68
68
|
- macOS
|
|
69
69
|
- Node.js 22 or newer
|
|
70
|
-
- Pi 0.80.7 or newer
|
|
70
|
+
- Pi 0.80.7 or newer
|
|
71
71
|
- official ChatGPT macOS app at `/Applications/ChatGPT.app`
|
|
72
72
|
- official Computer Use component installed by ChatGPT under `~/.codex/computer-use/`
|
|
73
73
|
|
|
@@ -77,16 +77,16 @@ The direct bridge starts app-server with a new private `CODEX_HOME` containing n
|
|
|
77
77
|
|
|
78
78
|
### Locked-screen limitation
|
|
79
79
|
|
|
80
|
-
Version 0.3.
|
|
80
|
+
Version 0.3.3 supports direct local calls in an unlocked macOS session. It does not support window or accessibility actions after the Mac locks.
|
|
81
81
|
|
|
82
|
-
OpenAI's [locked Computer Use](https://developers.openai.com/codex/app/computer-use#use-computer-use-while-your-mac-is-locked) is limited to active, trusted ChatGPT turns started from a connected device. It does not authorize other apps or local processes to unlock the Mac. This package uses local zero-turn dispatch, so targeted calls can fail with official error `-10005` while the Mac is locked. Support for locked local use remains a follow-up and is not part of version 0.3.
|
|
82
|
+
OpenAI's [locked Computer Use](https://developers.openai.com/codex/app/computer-use#use-computer-use-while-your-mac-is-locked) is limited to active, trusted ChatGPT turns started from a connected device. It does not authorize other apps or local processes to unlock the Mac. This package uses local zero-turn dispatch, so targeted calls can fail with official error `-10005` while the Mac is locked. Support for locked local use remains a follow-up and is not part of version 0.3.3.
|
|
83
83
|
|
|
84
84
|
## Pi integration
|
|
85
85
|
|
|
86
86
|
Install the exact release from npm:
|
|
87
87
|
|
|
88
88
|
```bash
|
|
89
|
-
pi install npm:codex-computer-use-mcp@0.3.
|
|
89
|
+
pi install npm:codex-computer-use-mcp@0.3.3
|
|
90
90
|
```
|
|
91
91
|
|
|
92
92
|
To evaluate a source checkout instead:
|
|
@@ -103,7 +103,7 @@ Command:
|
|
|
103
103
|
/computer-use-status
|
|
104
104
|
```
|
|
105
105
|
|
|
106
|
-
The native Pi adapter is the primary product path. It registers all ten typed tools directly,
|
|
106
|
+
The native Pi adapter is the primary product path. It registers and activates all ten typed tools directly, and routes the required `get_app_state` and following action through one retained signed-client session. It exposes no mode-changing command or wrapper-generated approval UI. Official app-access approval elicitations are resolved by Codex Full access before they reach Pi. Any elicitation that app-server does emit is shown through Pi's UI, and only the user's choice is returned to the service.
|
|
107
107
|
|
|
108
108
|
## MCP server
|
|
109
109
|
|
|
@@ -131,9 +131,9 @@ For Pi's generic MCP gateway, keep `directTools: false` so this powerful surface
|
|
|
131
131
|
|
|
132
132
|
The generic MCP server exposes the same no-permissions behavior: official Codex Full access, no wrapper permission gate, and all ten methods. App-access approvals are resolved inside the official host. Any standard form or URL elicitation that app-server emits is forwarded as an MCP `elicitation/create` request. The upstream client response is returned unchanged; unsupported or headless clients cancel rather than fabricate a decision.
|
|
133
133
|
|
|
134
|
-
##
|
|
134
|
+
## Execution and privacy
|
|
135
135
|
|
|
136
|
-
|
|
136
|
+
For the current released implementation, each call:
|
|
137
137
|
|
|
138
138
|
1. validates typed arguments;
|
|
139
139
|
2. applies the single durable no-permissions policy with no mode or prompt branch;
|
|
@@ -148,7 +148,7 @@ Each call:
|
|
|
148
148
|
11. rejects any model-turn notification, including during teardown;
|
|
149
149
|
12. combines partial-preserving ancestry enumeration with private-working-directory ownership recovery, then freezes, terminates, and verifies the app-server plus separately grouped or reparented helpers; finally it removes temporary state, releases the lock, and writes a content-safe audit with separate broker/lease cleanup evidence.
|
|
150
150
|
|
|
151
|
-
Focus
|
|
151
|
+
Focus telemetry is legacy completion behavior from the earlier background-computer-use wrapper. It does not provide an official Codex access control or a preventive macOS sandbox. The current release reports the call as failed if the target becomes frontmost. An individual official action may already have completed. Do not use this telemetry as a reason to add further defensive policy.
|
|
152
152
|
|
|
153
153
|
Tool results may contain visible target-app text or screenshots because that is the purpose of Computer Use. They return only to the invoking Pi/MCP client. Audits never retain arguments, typed values, screenshots, app-state payloads, result text, prompts, credentials, or tokens—only bounded metadata such as method, canonical/hashed app identity, byte counts, content types, outcome, focus, broker version, and zero-turn evidence.
|
|
154
154
|
|
|
@@ -172,7 +172,7 @@ npm pack --dry-run
|
|
|
172
172
|
|
|
173
173
|
Registry dependency tarballs are exact-pinned with integrity and the package includes `npm-shrinkwrap.json`.
|
|
174
174
|
|
|
175
|
-
See [`PROOF.md`](PROOF.md), [`SECURITY.md`](SECURITY.md), and [`CONTRIBUTING.md`](CONTRIBUTING.md).
|
|
175
|
+
See [`CHANGELOG.md`](CHANGELOG.md), [`PROOF.md`](PROOF.md), [`SECURITY.md`](SECURITY.md), and [`CONTRIBUTING.md`](CONTRIBUTING.md). Agent contributors must also follow [`AGENTS.md`](AGENTS.md). It records the maintainer's thin-adapter intent and review standard.
|
|
176
176
|
|
|
177
177
|
## License
|
|
178
178
|
|
package/SECURITY.md
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
## Reporting a vulnerability
|
|
4
4
|
|
|
5
|
-
Do not open a public issue for a vulnerability
|
|
5
|
+
Do not open a public issue for a concrete vulnerability in the supported production path. This includes realistic paths to untrusted component execution, unauthorized wrapper dispatch, credential or result-content exposure, or materially false completion reporting.
|
|
6
6
|
|
|
7
|
-
Use GitHub private vulnerability reporting. Include the affected commit
|
|
7
|
+
Use GitHub private vulnerability reporting. Include the affected commit and version, a small non-sensitive reproduction, and the expected and observed behavior. Provide evidence that the path is realistically reachable. State whether an official action completed before failure. Speculative hardening ideas without a reachable material effect are not vulnerability reports.
|
|
8
8
|
|
|
9
9
|
Never include credentials, tokens, customer/private content, sensitive screenshots, raw app-state payloads, elicitation contents, or private audit files.
|
|
10
10
|
|
|
@@ -16,7 +16,15 @@ The API requires a loaded thread ID. The bridge creates an empty, pathless, ephe
|
|
|
16
16
|
|
|
17
17
|
This is direct tool dispatch—not model orchestration.
|
|
18
18
|
|
|
19
|
-
##
|
|
19
|
+
## Authority and non-goals
|
|
20
|
+
|
|
21
|
+
This package is a thin adapter to official Codex Computer Use. Codex and macOS remain authoritative for tool behavior, app access, and platform permissions. The wrapper must not add permission policy, risk classification, app allowlists, action gates, content inspection, or speculative defence-in-depth.
|
|
22
|
+
|
|
23
|
+
The earlier background-computer-use wrapper provided canonical app resolution, same-app locking, focus completion telemetry, and metadata-only audit. The current release retains these legacy behaviors. They do not provide independent security or authorization boundaries. Do not expand them because a hypothetical safeguard is possible. A maintainer must explicitly approve their removal or material simplification because this changes the release contract.
|
|
24
|
+
|
|
25
|
+
## Current adapter invariants
|
|
26
|
+
|
|
27
|
+
These invariants describe the supported transport, zero-model-turn architecture, current released behavior, process lifecycle, and privacy contract. They are not a general security framework or a mandate to add safeguards.
|
|
20
28
|
|
|
21
29
|
1. Only the fixed app-bundled Codex path and reviewed official Computer Use layouts are allowed in production. The current client is resolved from the OS account home under `~/.codex/computer-use/`; `HOME`, `CODEX_HOME`, arbitrary paths, and symlinked layouts are not accepted. The former exact plugin-bundle layout is considered only when the current component is absent.
|
|
22
30
|
2. Both binaries pass strict code-signature verification and OpenAI Team ID `2DC432GLL2` checks before dispatch. A present current-layout client that fails verification never falls back.
|
|
@@ -24,15 +32,15 @@ This is direct tool dispatch—not model orchestration.
|
|
|
24
32
|
4. `no-permissions` is the only wrapper policy: all ten methods are exposed and no wrapper permission prompt is opened.
|
|
25
33
|
5. There is no config file, environment override, command, tool argument, per-call branch, or alternate safe/full route that an agent can select.
|
|
26
34
|
6. App-server uses the official Full access combination, `approvalPolicy: "never"` plus `sandbox: "danger-full-access"`. The pinned Codex host automatically accepts empty-schema MCP approval elicitations, so normal first-party app-access checks proceed without prompts. The wrapper does not synthesize this response or edit persistent per-app approvals. Any elicitation app-server emits is forwarded faithfully; an unavailable client cancels.
|
|
27
|
-
7.
|
|
28
|
-
8.
|
|
29
|
-
9.
|
|
35
|
+
7. As current legacy wrapper behavior, target selectors resolve to canonical installed bundle IDs before dispatch.
|
|
36
|
+
8. As current legacy wrapper coordination, same-app work is excluded across native Pi, generic MCP, and custom state roots with one fixed per-user kernel `lockf` lease namespace.
|
|
37
|
+
9. As current legacy completion telemetry, target focus events, periodic samples, watcher health, queued ASN resolution, and final state are checked. This is post-action reporting, not a preventive OS sandbox or an official Codex access control.
|
|
30
38
|
10. One direct request emits one official `mcpServer/tool/call`; no model turn, subagent, shell, web, plugin, prompt, or reachable model transport is available.
|
|
31
|
-
11. App-server and helper share one private
|
|
39
|
+
11. App-server and helper share one private broker-session working directory. One-shot calls close it immediately; Pi retains it only across the required `get_app_state` and following action, then closes it after the action, before replacement inspection, or on session shutdown. Cleanup combines strict ancestry enumeration (preserving partial results) with working-directory ownership recovery, freezes processes to a stable set, kills every owned process, awaits stdio closure, and verifies exit. This still finds a helper reparented by an early app-server exit; enumeration/freeze/exit uncertainty is fatal.
|
|
32
40
|
12. Protocol JSONL is bounded before an unterminated line can exceed 8 MB in memory.
|
|
33
41
|
13. Per-call `CODEX_HOME` and work directories are mode-private and recursively removed.
|
|
34
42
|
14. Only validated text/image result blocks cross to the invoking client. No full-result spill file is written.
|
|
35
|
-
15. Audits contain metadata only, including separate `brokerCleanupVerified` and `appLeaseReleased` evidence;
|
|
43
|
+
15. Audits contain metadata only, including separate `brokerCleanupVerified` and `appLeaseReleased` evidence. A retained Pi inspection truthfully records broker cleanup as pending (`false`); the paired action does not return if final retained-session cleanup fails. Lease-release failure changes the audited outcome before surfacing. Arguments, values, screenshots, app-state text, result content, prompts, approvals, credentials, and tokens are forbidden.
|
|
36
44
|
16. Policy rejections are audited; audit failure is fatal once a secure state path exists.
|
|
37
45
|
17. Runtime and development dependency tarballs are exact-pinned with integrity in `npm-shrinkwrap.json`.
|
|
38
46
|
|
|
@@ -56,6 +64,6 @@ Computer Use returns the official app-state text and screenshots to the invoking
|
|
|
56
64
|
|
|
57
65
|
## Supported versions
|
|
58
66
|
|
|
59
|
-
Only the latest approved release is supported. Version 0.3.
|
|
67
|
+
Only the latest approved release is supported. Version 0.3.3 supports direct local calls in an unlocked macOS session. Targeted local calls while the Mac is locked are not supported.
|
|
60
68
|
|
|
61
69
|
App-server is experimental and bundle paths or schemas can change. Drift fails closed until reviewed.
|
package/dist/direct-broker.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ export interface DirectBrokerResult {
|
|
|
25
25
|
elicitationRequests: number;
|
|
26
26
|
modelTurnsStarted: 0;
|
|
27
27
|
ephemeralThread: true;
|
|
28
|
-
brokerCleanupVerified:
|
|
28
|
+
brokerCleanupVerified: boolean;
|
|
29
29
|
}
|
|
30
30
|
export interface DirectBrokerOptions {
|
|
31
31
|
timeoutMs?: number;
|
|
@@ -90,5 +90,15 @@ export declare function verifyOfficialDirectBroker(options?: ResolveOfficialComp
|
|
|
90
90
|
client: OfficialComputerUseClient;
|
|
91
91
|
};
|
|
92
92
|
export declare function buildDirectAppServerArgs(mcpCwd?: string, clientPath?: string): string[];
|
|
93
|
+
export interface OfficialDirectToolSession {
|
|
94
|
+
call(method: DirectMethod, args: DirectToolArguments, options?: Pick<DirectBrokerOptions, "timeoutMs" | "signal" | "onElicitation" | "supportsOpenAiFormElicitation">): Promise<DirectBrokerResult>;
|
|
95
|
+
close(): Promise<void>;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Start one verified app-server runtime and retain its signed Computer Use MCP
|
|
99
|
+
* client across calls. Pi uses this for the required get_app_state -> action
|
|
100
|
+
* sequence; one-shot callers continue to use callOfficialDirectTool below.
|
|
101
|
+
*/
|
|
102
|
+
export declare function createOfficialDirectToolSession(options?: DirectBrokerOptions): Promise<OfficialDirectToolSession>;
|
|
93
103
|
export declare function callOfficialDirectTool(method: DirectMethod, args: DirectToolArguments, options?: DirectBrokerOptions): Promise<DirectBrokerResult>;
|
|
94
104
|
export {};
|