humanish 0.100.0 → 0.101.0
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/dist/actor-contract.d.ts +10 -10
- package/dist/actor-contract.js +15 -4
- package/dist/actor-contract.js.map +1 -1
- package/dist/computer-use.d.ts +13 -2
- package/dist/computer-use.js +108 -24
- package/dist/computer-use.js.map +1 -1
- package/dist/cua-actor-lab.js +34 -15
- package/dist/cua-actor-lab.js.map +1 -1
- package/dist/local-agent-cli.d.ts +10 -0
- package/dist/local-agent-cli.js +23 -7
- package/dist/local-agent-cli.js.map +1 -1
- package/dist/observer-app.html +1 -1
- package/dist/restricted-codex-participant-policy.d.ts +11 -7
- package/dist/restricted-codex-participant-policy.js +22 -51
- package/dist/restricted-codex-participant-policy.js.map +1 -1
- package/dist/restricted-codex-participant.d.ts +6 -2
- package/dist/restricted-codex-participant.js +166 -107
- package/dist/restricted-codex-participant.js.map +1 -1
- package/dist/restricted-codex-policy.d.ts +12 -5
- package/dist/restricted-codex-policy.js +62 -37
- package/dist/restricted-codex-policy.js.map +1 -1
- package/dist/restricted-codex-session.d.ts +28 -3
- package/dist/restricted-codex-session.js +440 -218
- package/dist/restricted-codex-session.js.map +1 -1
- package/dist/restricted-codex-transport.d.ts +15 -4
- package/dist/restricted-codex-transport.js +71 -8
- package/dist/restricted-codex-transport.js.map +1 -1
- package/docs/architecture/restricted-codex-analysis.md +17 -5
- package/docs/contracts/schemas.md +1 -1
- package/docs/goals/current.md +3 -3
- package/docs/ramp/README.md +7 -1
- package/docs/release/0.100.1-participant-continuity.md +20 -0
- package/docs/release/0.101.0-codex-ui-tools.md +28 -0
- package/package.json +1 -1
- package/dist/local-agent-appserver.d.ts +0 -44
- package/dist/local-agent-appserver.js +0 -269
- package/dist/local-agent-appserver.js.map +0 -1
|
@@ -1,269 +0,0 @@
|
|
|
1
|
-
// A codex app-server THREAD as the computer-use brain, instead of a fresh `codex exec` per turn.
|
|
2
|
-
//
|
|
3
|
-
// WHY THIS REPLACED THE ONE-SHOT VERSION, measured on this machine:
|
|
4
|
-
// `codex exec` per turn ~9s every turn, and every turn starts cold
|
|
5
|
-
// app-server thread ~500ms ONCE, then 2.7s / 5.8s / 8.9s per turn
|
|
6
|
-
//
|
|
7
|
-
// The speed is the smaller half. `codex exec` boots a CLI, loads config, agents and MCP servers on
|
|
8
|
-
// every single turn, and — the part that actually matters — hands the model a conversation that
|
|
9
|
-
// begins fresh each time. A participant driving a desktop that way has AMNESIA: it cannot remember
|
|
10
|
-
// that it already tried the menu, because nothing carried. A thread remembers, which is how the
|
|
11
|
-
// OpenAI computer-use provider has always worked (previous_response_id), and it is the difference
|
|
12
|
-
// between studying one participant and studying sixty strangers who each see one screenshot.
|
|
13
|
-
//
|
|
14
|
-
// The protocol is not guessed: `codex app-server generate-json-schema` emits it, and it gives us
|
|
15
|
-
// exactly what this loop needs — `turn/start` takes `input: [{type:"localImage", path}, ...]`,
|
|
16
|
-
// an `outputSchema` that constrains the reply (so no fence-scraping), and per-turn `effort` and
|
|
17
|
-
// `model` overrides described as applying "for this turn and subsequent turns".
|
|
18
|
-
import { spawn } from "node:child_process";
|
|
19
|
-
import readline from "node:readline";
|
|
20
|
-
import { declaredOutcomeOf, toCuaActions } from "./local-agent-cli.js";
|
|
21
|
-
/** Newline-delimited JSON-RPC over the child's stdio — the framing codex-app-server.ts uses. */
|
|
22
|
-
export function stdioTransport(child) {
|
|
23
|
-
const rl = readline.createInterface({ input: child.stdout });
|
|
24
|
-
const pending = new Map();
|
|
25
|
-
const waiters = [];
|
|
26
|
-
let nextId = 0;
|
|
27
|
-
rl.on("line", (line) => {
|
|
28
|
-
let message;
|
|
29
|
-
try {
|
|
30
|
-
message = JSON.parse(line);
|
|
31
|
-
}
|
|
32
|
-
catch {
|
|
33
|
-
return; // the server also logs non-JSON; ignore rather than crash the run
|
|
34
|
-
}
|
|
35
|
-
const id = message.id;
|
|
36
|
-
if (typeof id === "number" && pending.has(id)) {
|
|
37
|
-
const entry = pending.get(id);
|
|
38
|
-
pending.delete(id);
|
|
39
|
-
if (message.error !== undefined) {
|
|
40
|
-
entry.reject(new Error(`codex app-server: ${JSON.stringify(message.error).slice(0, 300)}`));
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
entry.resolve((message.result ?? {}));
|
|
44
|
-
}
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
if (typeof message.method === "string") {
|
|
48
|
-
for (let index = waiters.length - 1; index >= 0; index -= 1) {
|
|
49
|
-
if (waiters[index].method === message.method) {
|
|
50
|
-
waiters.splice(index, 1)[0].resolve(message);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
return {
|
|
56
|
-
request: async (method, params) => await new Promise((resolve, reject) => {
|
|
57
|
-
const id = (nextId += 1);
|
|
58
|
-
pending.set(id, { resolve, reject });
|
|
59
|
-
child.stdin.write(`${JSON.stringify({ jsonrpc: "2.0", id, method, params })}\n`);
|
|
60
|
-
}),
|
|
61
|
-
notify: (method, params) => {
|
|
62
|
-
child.stdin.write(`${JSON.stringify({ method, params })}\n`);
|
|
63
|
-
},
|
|
64
|
-
awaitNotification: async (method, timeoutMs) => await new Promise((resolve, reject) => {
|
|
65
|
-
const timer = setTimeout(() => reject(new Error(`timed out waiting for ${method}`)), timeoutMs);
|
|
66
|
-
waiters.push({
|
|
67
|
-
method,
|
|
68
|
-
resolve: (value) => {
|
|
69
|
-
clearTimeout(timer);
|
|
70
|
-
resolve(value);
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
}),
|
|
74
|
-
close: () => {
|
|
75
|
-
rl.close();
|
|
76
|
-
child.kill();
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
export const APP_SERVER_CAPABILITIES = {
|
|
81
|
-
headless: true,
|
|
82
|
-
structuredTrace: true,
|
|
83
|
-
lanes: ["computer-use"],
|
|
84
|
-
producesScreenshots: true,
|
|
85
|
-
byoModel: true,
|
|
86
|
-
preGrantableApprovals: false,
|
|
87
|
-
inProcessTools: false,
|
|
88
|
-
license: "open"
|
|
89
|
-
};
|
|
90
|
-
/** The reply shape a turn is constrained to. Strict mode: every property in `required`. */
|
|
91
|
-
export function turnOutputSchema() {
|
|
92
|
-
return {
|
|
93
|
-
type: "object",
|
|
94
|
-
additionalProperties: false,
|
|
95
|
-
required: ["reasoning", "done", "message", "outcome", "actions"],
|
|
96
|
-
properties: {
|
|
97
|
-
reasoning: { type: "string" },
|
|
98
|
-
done: { type: "boolean" },
|
|
99
|
-
message: { type: ["string", "null"] },
|
|
100
|
-
outcome: { type: ["string", "null"], enum: ["reached", "not_reached", "blocked", null] },
|
|
101
|
-
actions: {
|
|
102
|
-
type: "array",
|
|
103
|
-
items: {
|
|
104
|
-
type: "object",
|
|
105
|
-
additionalProperties: false,
|
|
106
|
-
required: ["kind", "x", "y", "text", "keys", "ms"],
|
|
107
|
-
properties: {
|
|
108
|
-
kind: { type: "string", enum: ["click", "double_click", "type", "keypress", "scroll", "wait", "done"] },
|
|
109
|
-
x: { type: ["integer", "null"] },
|
|
110
|
-
y: { type: ["integer", "null"] },
|
|
111
|
-
text: { type: ["string", "null"] },
|
|
112
|
-
keys: { type: ["array", "null"], items: { type: "string" } },
|
|
113
|
-
ms: { type: ["integer", "null"] }
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
function readNested(value, keys) {
|
|
121
|
-
let current = value;
|
|
122
|
-
for (const key of keys) {
|
|
123
|
-
if (typeof current !== "object" || current === null)
|
|
124
|
-
return undefined;
|
|
125
|
-
current = current[key];
|
|
126
|
-
}
|
|
127
|
-
return typeof current === "string" ? current : undefined;
|
|
128
|
-
}
|
|
129
|
-
/**
|
|
130
|
-
* Start a thread and return a provider that spends it, one `turn/start` per computer-use turn.
|
|
131
|
-
*
|
|
132
|
-
* The thread is started EAGERLY (before the first screenshot) so the ~500ms handshake is paid
|
|
133
|
-
* while the sandbox is still booting rather than inside turn one.
|
|
134
|
-
*/
|
|
135
|
-
export async function startAppServerSession(options = {}) {
|
|
136
|
-
const timeoutMs = options.timeoutMs ?? 180_000;
|
|
137
|
-
const cwd = options.cwd ?? process.cwd();
|
|
138
|
-
const effort = options.reasoningEffort ?? "low";
|
|
139
|
-
let child;
|
|
140
|
-
let transport = options.transport;
|
|
141
|
-
if (transport === undefined) {
|
|
142
|
-
child = spawn("codex", ["app-server"], { cwd, stdio: ["pipe", "pipe", "pipe"] });
|
|
143
|
-
// The server logs to stderr; draining it keeps the pipe from filling and stalling the run.
|
|
144
|
-
child.stderr.resume();
|
|
145
|
-
transport = stdioTransport(child);
|
|
146
|
-
}
|
|
147
|
-
await transport.request("initialize", {
|
|
148
|
-
clientInfo: { name: "humanish_cli", title: "Humanish CLI", version: "0.1.0" },
|
|
149
|
-
capabilities: {}
|
|
150
|
-
});
|
|
151
|
-
transport.notify("initialized", {});
|
|
152
|
-
const thread = await transport.request("thread/start", {
|
|
153
|
-
cwd,
|
|
154
|
-
// The participant is here to look at a screen, not to touch this machine. read-only + never
|
|
155
|
-
// is the same bound the one-shot version had, declared once for the whole thread.
|
|
156
|
-
approvalPolicy: "never",
|
|
157
|
-
sandbox: "read-only",
|
|
158
|
-
serviceName: "humanish",
|
|
159
|
-
// Nothing about this study belongs in the operator's codex history.
|
|
160
|
-
ephemeral: true,
|
|
161
|
-
...(options.baseInstructions === undefined ? {} : { baseInstructions: options.baseInstructions }),
|
|
162
|
-
...(options.model === undefined ? {} : { model: options.model })
|
|
163
|
-
});
|
|
164
|
-
const threadId = readNested(thread, ["thread", "id"]);
|
|
165
|
-
if (threadId === undefined) {
|
|
166
|
-
transport.close();
|
|
167
|
-
throw new Error("codex app-server did not return a thread id");
|
|
168
|
-
}
|
|
169
|
-
const provider = {
|
|
170
|
-
id: "local-agent-codex-app-server",
|
|
171
|
-
version: options.model ?? "codex app-server (local, operator-authenticated)",
|
|
172
|
-
modelSettings: { reasoningEffort: effort },
|
|
173
|
-
capabilities: APP_SERVER_CAPABILITIES,
|
|
174
|
-
requiresFrame: true,
|
|
175
|
-
async nextTurn(request, signal) {
|
|
176
|
-
const frame = request.observation.screenshot;
|
|
177
|
-
if (frame === undefined) {
|
|
178
|
-
throw new Error("the codex app-server provider needs a screenshot and this observation has none");
|
|
179
|
-
}
|
|
180
|
-
const { mkdtemp, rm, writeFile } = await import("node:fs/promises");
|
|
181
|
-
const { tmpdir } = await import("node:os");
|
|
182
|
-
const path = await import("node:path");
|
|
183
|
-
const work = await mkdtemp(path.join(tmpdir(), "humanish-appserver-"));
|
|
184
|
-
try {
|
|
185
|
-
const shot = path.join(work, "screen.png");
|
|
186
|
-
await writeFile(shot, frame);
|
|
187
|
-
const hint = request.contextHint === undefined ? "" : `\n\nNote from the harness: ${request.contextHint}`;
|
|
188
|
-
const completed = transport.awaitNotification("turn/completed", timeoutMs);
|
|
189
|
-
await transport.request("turn/start", {
|
|
190
|
-
threadId,
|
|
191
|
-
cwd,
|
|
192
|
-
approvalPolicy: "never",
|
|
193
|
-
sandboxPolicy: { type: "readOnly" },
|
|
194
|
-
// Per-turn, because a lane declares it and the schema says it applies to this turn and
|
|
195
|
-
// the ones after — so a lane that raises effort raises it from that point on.
|
|
196
|
-
effort,
|
|
197
|
-
...(options.model === undefined ? {} : { model: options.model }),
|
|
198
|
-
outputSchema: turnOutputSchema(),
|
|
199
|
-
input: [
|
|
200
|
-
{ type: "localImage", path: shot },
|
|
201
|
-
{
|
|
202
|
-
type: "text",
|
|
203
|
-
// The persona already lives in baseInstructions; this is only the turn's ask, which
|
|
204
|
-
// is why it stays this short.
|
|
205
|
-
text: `This is the current screen. What do you do next? When you set done=true, set outcome: reached if the task is finished, blocked if something in the app stopped you, not_reached if you are stopping for another reason.${hint}`,
|
|
206
|
-
text_elements: []
|
|
207
|
-
}
|
|
208
|
-
]
|
|
209
|
-
});
|
|
210
|
-
const abort = signal === undefined
|
|
211
|
-
? undefined
|
|
212
|
-
: new Promise((_resolve, reject) => {
|
|
213
|
-
signal.addEventListener("abort", () => reject(new Error("run stopped")), { once: true });
|
|
214
|
-
});
|
|
215
|
-
const note = await (abort === undefined ? completed : Promise.race([completed, abort]));
|
|
216
|
-
return turnFromNotification(note);
|
|
217
|
-
}
|
|
218
|
-
finally {
|
|
219
|
-
await rm(work, { recursive: true, force: true }).catch(() => undefined);
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
};
|
|
223
|
-
return {
|
|
224
|
-
provider,
|
|
225
|
-
close: () => {
|
|
226
|
-
transport?.close();
|
|
227
|
-
child?.kill();
|
|
228
|
-
}
|
|
229
|
-
};
|
|
230
|
-
}
|
|
231
|
-
/** Read a `turn/completed` notification into a CuaTurn. Exported for tests. */
|
|
232
|
-
export function turnFromNotification(note) {
|
|
233
|
-
const params = (note.params ?? {});
|
|
234
|
-
const turn = (params.turn ?? {});
|
|
235
|
-
// Read the protocol, do not guess it: `turn/completed` carries `turn.items`, and the model's
|
|
236
|
-
// answer is the LAST `agentMessage` item, whose `text` is a plain string. The first cut of this
|
|
237
|
-
// looked for `turn.output`, found nothing, and silently produced an empty turn — which the loop
|
|
238
|
-
// read as "the participant is finished", ending a live study after one screenshot.
|
|
239
|
-
const items = Array.isArray(turn.items) ? turn.items : [];
|
|
240
|
-
const message = [...items].reverse().find((item) => item.type === "agentMessage");
|
|
241
|
-
const text = typeof message?.text === "string" ? message.text : "";
|
|
242
|
-
let parsed;
|
|
243
|
-
try {
|
|
244
|
-
// `outputSchema` constrains it to JSON, but a fence costs nothing to tolerate.
|
|
245
|
-
const fenced = /```(?:json)?\s*([\s\S]*?)```/.exec(text);
|
|
246
|
-
parsed = JSON.parse((fenced?.[1] ?? text).trim());
|
|
247
|
-
}
|
|
248
|
-
catch {
|
|
249
|
-
// A turn whose constrained output did not arrive is a BROKEN turn, never an empty one: an
|
|
250
|
-
// empty turn reads to the loop as "the participant chose to do nothing".
|
|
251
|
-
throw new Error(`codex app-server returned no structured turn output (${text.slice(0, 160)})`);
|
|
252
|
-
}
|
|
253
|
-
const actions = toCuaActions(Array.isArray(parsed.actions) ? parsed.actions : []);
|
|
254
|
-
return {
|
|
255
|
-
actions,
|
|
256
|
-
pendingSafetyChecks: [],
|
|
257
|
-
// EXPLICIT only. The first version also inferred done from "no actions plus a message", and
|
|
258
|
-
// that inference ended a live study on turn one with a 7-second "goal_satisfied": the model
|
|
259
|
-
// narrated the screen, chose no action, and the provider called it finished. The schema
|
|
260
|
-
// guarantees a `done` boolean, so there is nothing to infer.
|
|
261
|
-
done: parsed.done === true,
|
|
262
|
-
...(declaredOutcomeOf(parsed.outcome) === undefined ? {} : { outcome: declaredOutcomeOf(parsed.outcome) }),
|
|
263
|
-
...(typeof parsed.reasoning === "string" && parsed.reasoning.length > 0 ? { reasoning: parsed.reasoning } : {}),
|
|
264
|
-
...(typeof parsed.message === "string" && parsed.message.length > 0 ? { message: parsed.message } : {})
|
|
265
|
-
// No `usage`: a subscription thread reports nothing we could price, and a number invented here
|
|
266
|
-
// is what would make the run's cost line a lie.
|
|
267
|
-
};
|
|
268
|
-
}
|
|
269
|
-
//# sourceMappingURL=local-agent-appserver.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"local-agent-appserver.js","sourceRoot":"","sources":["../src/local-agent-appserver.ts"],"names":[],"mappings":"AAAA,iGAAiG;AACjG,EAAE;AACF,oEAAoE;AACpE,4EAA4E;AAC5E,+EAA+E;AAC/E,EAAE;AACF,mGAAmG;AACnG,gGAAgG;AAChG,mGAAmG;AACnG,gGAAgG;AAChG,kGAAkG;AAClG,6FAA6F;AAC7F,EAAE;AACF,iGAAiG;AACjG,+FAA+F;AAC/F,gGAAgG;AAChG,gFAAgF;AAEhF,OAAO,EAAE,KAAK,EAAuC,MAAM,oBAAoB,CAAC;AAChF,OAAO,QAAQ,MAAM,eAAe,CAAC;AAKrC,OAAO,EAAE,iBAAiB,EAAE,YA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