@particle-academy/prism-acp 0.5.0 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -0
- package/dist/codex/driver.js +2 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -92,6 +92,18 @@ in the direction that spends money silently. Names are compared
|
|
|
92
92
|
case-insensitively, because Windows environment names are case-insensitive and
|
|
93
93
|
`anthropic_api_key` reaches a child exactly as the uppercase spelling does.
|
|
94
94
|
|
|
95
|
+
The allow-list withholds every variable not named in it, credentials and
|
|
96
|
+
non-credentials alike. If the child needs an orchestrator session or terminal
|
|
97
|
+
id, a callback URL, or a feature flag, name it in `allowEnv` or it will not
|
|
98
|
+
arrive. This failure is silent: the child can start and appear healthy while
|
|
99
|
+
being unable to identify itself, rather than reporting a missing variable.
|
|
100
|
+
An allowed variable whose parent value is `''` is forwarded as an empty string.
|
|
101
|
+
That can be worse than omitting it: a referenced-but-unset value in an MCP
|
|
102
|
+
config can stop every server in that file. When there is no value to give,
|
|
103
|
+
omit the variable instead of passing its name with a blank value. `childEnv`
|
|
104
|
+
does not filter blanks for you, because an intentionally empty value can be
|
|
105
|
+
meaningful for some variable names and the package will not guess which.
|
|
106
|
+
|
|
95
107
|
Nothing here mutates `process.env`. A workspace may hold an API key on purpose —
|
|
96
108
|
other consumers beside this one legitimately bill per token — so the child's
|
|
97
109
|
environment is constructed and the ambient one is left alone.
|
|
@@ -155,6 +167,18 @@ drivers because their measured resume behavior differs. Codex thread ids are
|
|
|
155
167
|
the provider's own captured ids and are the same ids accepted by its resume
|
|
156
168
|
method; ACP-minted ids are refused.
|
|
157
169
|
|
|
170
|
+
The human half of the conversation differs too. Against a real Claude child,
|
|
171
|
+
the CLI did not echo the client's prompt as `user_message_chunk`, and loading
|
|
172
|
+
its session replayed zero updates. A Claude client cannot reconstruct the whole
|
|
173
|
+
conversation from ACP alone; record the human turn yourself. Codex's mapping
|
|
174
|
+
does emit text from `userMessage` items as `user_message_chunk` during history
|
|
175
|
+
replay, so a Codex `session/load` will carry that human text. The mapping also
|
|
176
|
+
does this for live items, so a live Codex turn may echo the client's own prompt
|
|
177
|
+
as `user_message_chunk`; this is what our mapping allows, not a claim about
|
|
178
|
+
every Codex frame. Record the human turn yourself for both providers, and treat
|
|
179
|
+
a live `user_message_chunk` as the agent's record of what it received, not as
|
|
180
|
+
new input to append again.
|
|
181
|
+
|
|
158
182
|
### Refusing an unknown id at load, not a turn later
|
|
159
183
|
|
|
160
184
|
Pass `probeSession` and an id naming **no** conversation is refused by
|
|
@@ -298,6 +322,14 @@ A client then speaks ACP on those pipes. Several sessions run at once, each with
|
|
|
298
322
|
its own agent process, its own in-flight turn and its own updates — tagged with
|
|
299
323
|
the session they belong to, because a room of agents shares one stream.
|
|
300
324
|
|
|
325
|
+
### Commit streamed messages at the turn boundary
|
|
326
|
+
|
|
327
|
+
`agent_message_chunk` and `agent_thought_chunk` carry no message id. The turn
|
|
328
|
+
boundary is the only delimiter between replies, so commit the accumulated
|
|
329
|
+
message there. Clearing the in-flight message without committing loses the
|
|
330
|
+
reply (including the whole reply in a single-message turn); not clearing it
|
|
331
|
+
appends the next turn to the previous one.
|
|
332
|
+
|
|
301
333
|
## Development
|
|
302
334
|
|
|
303
335
|
```sh
|
package/dist/codex/driver.js
CHANGED
|
@@ -963,6 +963,8 @@ export class CodexDriver {
|
|
|
963
963
|
this.#turnDeadlineExpiresAt = 0;
|
|
964
964
|
}
|
|
965
965
|
#hasOutstandingWork() {
|
|
966
|
+
// If this driver adds client-served fs/* or terminal/* calls, their in-flight
|
|
967
|
+
// ACP requests belong here too; a slow client tool is outstanding work.
|
|
966
968
|
return this.#pendingApprovals.size > 0 || this.#activeItemIds.size > 0;
|
|
967
969
|
}
|
|
968
970
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@particle-academy/prism-acp",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.2",
|
|
4
4
|
"description": "Speak the Agent Client Protocol to a coding-agent CLI the user has already authenticated. No API key, no third-party adapter.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|