humanish 0.100.1 → 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 +9 -9
- package/dist/actor-contract.js +15 -5
- 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 -5
- package/dist/restricted-codex-participant-policy.js +21 -49
- package/dist/restricted-codex-participant-policy.js.map +1 -1
- package/dist/restricted-codex-participant.d.ts +5 -1
- package/dist/restricted-codex-participant.js +158 -106
- 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 +24 -3
- package/dist/restricted-codex-session.js +208 -51
- package/dist/restricted-codex-session.js.map +1 -1
- package/dist/restricted-codex-transport.d.ts +11 -2
- package/dist/restricted-codex-transport.js +57 -6
- package/dist/restricted-codex-transport.js.map +1 -1
- package/docs/architecture/restricted-codex-analysis.md +7 -4
- package/docs/contracts/schemas.md +1 -1
- package/docs/goals/current.md +3 -3
- package/docs/ramp/README.md +4 -1
- 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
|
@@ -10,12 +10,16 @@ export declare const PARTICIPANT_LIMITS: Readonly<{
|
|
|
10
10
|
requestMs: 180000;
|
|
11
11
|
cleanupMs: 5000;
|
|
12
12
|
}>;
|
|
13
|
-
export declare const
|
|
14
|
-
export declare const
|
|
13
|
+
export declare const PARTICIPANT_TOOL_SCHEMA: Record<string, unknown>;
|
|
14
|
+
export declare const PARTICIPANT_FINAL_SCHEMA: {
|
|
15
15
|
type: string;
|
|
16
16
|
additionalProperties: boolean;
|
|
17
17
|
required: string[];
|
|
18
18
|
properties: {
|
|
19
|
+
outcome: {
|
|
20
|
+
type: string;
|
|
21
|
+
enum: string[];
|
|
22
|
+
};
|
|
19
23
|
summary: {
|
|
20
24
|
type: string;
|
|
21
25
|
minLength: number;
|
|
@@ -32,6 +36,8 @@ export declare const PARTICIPANT_CLOSING_SCHEMA: {
|
|
|
32
36
|
};
|
|
33
37
|
};
|
|
34
38
|
};
|
|
35
|
-
/** Humanish
|
|
36
|
-
export declare function
|
|
37
|
-
export declare function
|
|
39
|
+
/** Humanish tool arguments, validated before the shared executor sees a batch. */
|
|
40
|
+
export declare function parseParticipantTool(value: unknown): CuaTurn;
|
|
41
|
+
export declare function parseParticipantFinal(value: unknown): CuaTurn & {
|
|
42
|
+
closingReport: ParticipantClosingReport;
|
|
43
|
+
};
|
|
@@ -4,65 +4,37 @@ import { validClosingReport } from "./computer-use.js";
|
|
|
4
4
|
export const PARTICIPANT_PROFILE = Object.freeze({
|
|
5
5
|
schema: "humanish.actor-execution-profile.v1", transport: "codex-app-server", authentication: "chatgpt-account",
|
|
6
6
|
billing: "account-unknown", requestedModel: "gpt-6-astra", reasoningEffort: "low", cliVersion: "0.154.0",
|
|
7
|
-
toolPolicy: "
|
|
7
|
+
toolPolicy: "codex-ui-tools-v1", participantSchema: "humanish.codex-ui-tool.v1", memoryPolicy: "continuing-thread-v1"
|
|
8
8
|
});
|
|
9
9
|
export const PARTICIPANT_LIMITS = Object.freeze({ instructions: 64 * 1024, hint: 8 * 1024, narration: 2000, output: 256 * 1024, actions: 4, requestMs: 180_000, cleanupMs: 5000 });
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
function outputSchema(value) {
|
|
17
|
-
if (Array.isArray(value))
|
|
18
|
-
return value.map(outputSchema);
|
|
19
|
-
if (value === null || typeof value !== "object")
|
|
20
|
-
return value;
|
|
21
|
-
const result = Object.fromEntries(Object.entries(value).filter(([key]) => key !== "$schema")
|
|
22
|
-
.map(([key, v]) => [key === "oneOf" ? "anyOf" : key, outputSchema(v)]));
|
|
23
|
-
if (result.type === "object" && result.properties) {
|
|
24
|
-
const properties = result.properties;
|
|
25
|
-
const required = result.required;
|
|
26
|
-
for (const key of Object.keys(properties))
|
|
27
|
-
if (!required.includes(key))
|
|
28
|
-
properties[key] = { anyOf: [properties[key], { type: "null" }] };
|
|
29
|
-
result.required = Object.keys(properties);
|
|
30
|
-
}
|
|
31
|
-
return result;
|
|
32
|
-
}
|
|
33
|
-
export const PARTICIPANT_TURN_SCHEMA = outputSchema(z.toJSONSchema(envelope, { io: "input" }));
|
|
34
|
-
export const PARTICIPANT_CLOSING_SCHEMA = {
|
|
35
|
-
type: "object", additionalProperties: false, required: ["summary", "frictionReports"], properties: {
|
|
10
|
+
const toolInput = z.strictObject({ narration: z.string().max(PARTICIPANT_LIMITS.narration),
|
|
11
|
+
actions: z.array(browserControlActionSchema).min(1).max(PARTICIPANT_LIMITS.actions) });
|
|
12
|
+
export const PARTICIPANT_TOOL_SCHEMA = z.toJSONSchema(toolInput, { io: "input" });
|
|
13
|
+
export const PARTICIPANT_FINAL_SCHEMA = {
|
|
14
|
+
type: "object", additionalProperties: false, required: ["outcome", "summary", "frictionReports"], properties: {
|
|
15
|
+
outcome: { type: "string", enum: ["reached", "not_reached", "blocked"] },
|
|
36
16
|
summary: { type: "string", minLength: 1, maxLength: 4000 },
|
|
37
17
|
frictionReports: { type: "array", maxItems: 8, items: { type: "string", minLength: 1, maxLength: 2000 } }
|
|
38
18
|
}
|
|
39
19
|
};
|
|
40
|
-
/** Humanish
|
|
41
|
-
export function
|
|
20
|
+
/** Humanish tool arguments, validated before the shared executor sees a batch. */
|
|
21
|
+
export function parseParticipantTool(value) {
|
|
42
22
|
if (Buffer.byteLength(JSON.stringify(value) ?? "") > PARTICIPANT_LIMITS.output)
|
|
43
23
|
throw new Error("invalid_response");
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
if (!action || typeof action !== "object" || Array.isArray(action))
|
|
47
|
-
return action;
|
|
48
|
-
const result = { ...action };
|
|
49
|
-
if (result.kind === "click" && result.button === null)
|
|
50
|
-
delete result.button;
|
|
51
|
-
if (result.kind === "wait" && result.ms === null)
|
|
52
|
-
delete result.ms;
|
|
53
|
-
return result;
|
|
54
|
-
}) } : value;
|
|
55
|
-
const v = envelope.parse(normalized);
|
|
56
|
-
if (Buffer.byteLength(v.narration) > PARTICIPANT_LIMITS.narration ||
|
|
57
|
-
(v.done ? v.actions.length !== 0 || v.outcome === null || !v.narration.trim() : v.actions.length === 0 || v.outcome !== null)) {
|
|
24
|
+
const v = toolInput.parse(value);
|
|
25
|
+
if (Buffer.byteLength(v.narration) > PARTICIPANT_LIMITS.narration)
|
|
58
26
|
throw new Error("invalid_response");
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
...(v.narration ? { message: v.narration } : {}), ...(v.outcome === null ? {} : { outcome: v.outcome }) };
|
|
27
|
+
return { actions: v.actions.map(validateBrowserControlAction), pendingSafetyChecks: [], done: false,
|
|
28
|
+
...(v.narration ? { message: v.narration } : {}), providerRequestPending: true };
|
|
62
29
|
}
|
|
63
|
-
export function
|
|
64
|
-
if (!
|
|
30
|
+
export function parseParticipantFinal(value) {
|
|
31
|
+
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
32
|
+
throw new Error("invalid_response");
|
|
33
|
+
const { outcome, ...report } = value;
|
|
34
|
+
if ((outcome !== "reached" && outcome !== "not_reached" && outcome !== "blocked") || !validClosingReport(report))
|
|
65
35
|
throw new Error("invalid_response");
|
|
66
|
-
return {
|
|
36
|
+
return { actions: [], pendingSafetyChecks: [], done: true, outcome,
|
|
37
|
+
message: [report.summary, ...report.frictionReports].join("\n"),
|
|
38
|
+
closingReport: { summary: report.summary, frictionReports: [...report.frictionReports] } };
|
|
67
39
|
}
|
|
68
40
|
//# sourceMappingURL=restricted-codex-participant-policy.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"restricted-codex-participant-policy.js","sourceRoot":"","sources":["../src/restricted-codex-participant-policy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,0BAA0B,EAAE,4BAA4B,EAAE,MAAM,+BAA+B,CAAC;AACzG,OAAO,EAAE,kBAAkB,EAAgB,MAAM,mBAAmB,CAAC;AAGrE,MAAM,CAAC,MAAM,mBAAmB,GAAoC,MAAM,CAAC,MAAM,CAAC;IAChF,MAAM,EAAE,qCAAqC,EAAE,SAAS,EAAE,kBAAkB,EAAE,cAAc,EAAE,iBAAiB;IAC/G,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,aAAa,EAAE,eAAe,EAAE,KAAK,EAAE,UAAU,EAAE,SAAS;IACxG,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"restricted-codex-participant-policy.js","sourceRoot":"","sources":["../src/restricted-codex-participant-policy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,0BAA0B,EAAE,4BAA4B,EAAE,MAAM,+BAA+B,CAAC;AACzG,OAAO,EAAE,kBAAkB,EAAgB,MAAM,mBAAmB,CAAC;AAGrE,MAAM,CAAC,MAAM,mBAAmB,GAAoC,MAAM,CAAC,MAAM,CAAC;IAChF,MAAM,EAAE,qCAAqC,EAAE,SAAS,EAAE,kBAAkB,EAAE,cAAc,EAAE,iBAAiB;IAC/G,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,aAAa,EAAE,eAAe,EAAE,KAAK,EAAE,UAAU,EAAE,SAAS;IACxG,UAAU,EAAE,mBAAmB,EAAE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AC,kBAAkB,CAAC,CAAC;IACtJ,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,mBAAmB,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO;QAChE,OAAO,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,GAAG,MAAM,CAAC,eAAe,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QAC/D,aAAa,EAAE,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,eAAe,EAAE,CAAC,GAAG,MAAM,CAAC,eAAe,CAAC,EAAE,EAAE,CAAC;AAC/F,CAAC"}
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import type { CuaProvider } from "./computer-use.js";
|
|
2
2
|
import { type RestrictedCodexSessionOptions } from "./restricted-codex-session.js";
|
|
3
|
+
import type { ReasoningEffort } from "./reasoning-effort.js";
|
|
3
4
|
export type ParticipantProviderCloseResult = {
|
|
4
5
|
status: "confirmed" | "unconfirmed";
|
|
5
6
|
};
|
|
6
7
|
export interface RestrictedParticipantOptions {
|
|
7
8
|
session?: RestrictedCodexSessionOptions;
|
|
8
9
|
requestTimeoutMs?: number;
|
|
10
|
+
authMode?: "operator";
|
|
11
|
+
model?: string;
|
|
12
|
+
reasoningEffort?: ReasoningEffort;
|
|
9
13
|
}
|
|
10
|
-
/** One
|
|
14
|
+
/** One native tool-calling conversation; the existing CUA loop owns every input. */
|
|
11
15
|
export declare function createRestrictedCodexParticipant(options?: RestrictedParticipantOptions): {
|
|
12
16
|
provider: CuaProvider;
|
|
13
17
|
close(): Promise<ParticipantProviderCloseResult>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CuaProviderError, isCuaProviderError } from "./cua-provider-error.js";
|
|
2
2
|
import { validateBrowserControlPng } from "./browser-control-protocol.js";
|
|
3
3
|
import { createRestrictedCodexSession } from "./restricted-codex-session.js";
|
|
4
|
-
import { PARTICIPANT_PROFILE, PARTICIPANT_LIMITS as L,
|
|
4
|
+
import { PARTICIPANT_PROFILE, PARTICIPANT_LIMITS as L, PARTICIPANT_TOOL_SCHEMA, PARTICIPANT_FINAL_SCHEMA, parseParticipantTool, parseParticipantFinal } from "./restricted-codex-participant-policy.js";
|
|
5
5
|
const codeOf = (code) => {
|
|
6
6
|
if (code === "cancelled" || code === "timeout" || code === "refusal")
|
|
7
7
|
return code === "refusal" ? "refused" : code;
|
|
@@ -20,24 +20,61 @@ const codeOf = (code) => {
|
|
|
20
20
|
return "unavailable";
|
|
21
21
|
};
|
|
22
22
|
const noDispatch = () => ({ dispatched: false, usageComplete: false, cleanup: "confirmed" });
|
|
23
|
-
|
|
23
|
+
function deferred() {
|
|
24
|
+
let resolve, reject;
|
|
25
|
+
const promise = new Promise((yes, no) => { resolve = yes; reject = no; });
|
|
26
|
+
// A native request can settle during executor work or shutdown, between consumers.
|
|
27
|
+
void promise.catch(() => undefined);
|
|
28
|
+
return { promise, resolve, reject };
|
|
29
|
+
}
|
|
30
|
+
const TOOL_DESCRIPTION = `Act on the participant's browser through Humanish. Submit one to four UI actions and a short public comment; never private reasoning. Humanish returns a JSON STRING with execution acknowledgments and a fresh screenshot. In Code Mode use: const r = JSON.parse(await tools.humanish_ui({narration: "...", actions: [...]})); text({acknowledgments: r.acknowledgments, contextHint: r.contextHint, closing: r.closing}); image(r.imageUrl). Call serially and inspect each returned screenshot before deciding what to do next. Acknowledged input does not prove an application outcome. If closing is true, stop calling tools and give your final account.`;
|
|
31
|
+
/** One native tool-calling conversation; the existing CUA loop owns every input. */
|
|
24
32
|
export function createRestrictedCodexParticipant(options = {}) {
|
|
25
33
|
const timeoutMs = options.requestTimeoutMs ?? L.requestMs;
|
|
26
34
|
if (!Number.isSafeInteger(timeoutMs) || timeoutMs < 1 || timeoutMs > L.requestMs)
|
|
27
35
|
throw new CuaProviderError("request_rejected", noDispatch());
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
let
|
|
32
|
-
let
|
|
33
|
-
let
|
|
36
|
+
const operator = options.authMode === "operator";
|
|
37
|
+
const model = options.model ?? (operator ? undefined : PARTICIPANT_PROFILE.requestedModel);
|
|
38
|
+
const effort = options.reasoningEffort ?? "low";
|
|
39
|
+
let closed = false, failedCleanup = false, incompleteUsage = false, active = false, closingPhase = false;
|
|
40
|
+
let instructions, lastActionCount;
|
|
41
|
+
let continuation;
|
|
42
|
+
const events = [];
|
|
43
|
+
let waiter;
|
|
44
|
+
const emit = (event) => {
|
|
45
|
+
if (waiter) {
|
|
46
|
+
const current = waiter;
|
|
47
|
+
waiter = undefined;
|
|
48
|
+
current.resolve(event);
|
|
49
|
+
}
|
|
50
|
+
else
|
|
51
|
+
events.push(event);
|
|
52
|
+
};
|
|
53
|
+
const nextEvent = async () => {
|
|
54
|
+
const event = events.shift() ?? await (waiter ??= deferred()).promise;
|
|
55
|
+
if ("error" in event)
|
|
56
|
+
throw event.error;
|
|
57
|
+
return event.turn;
|
|
58
|
+
};
|
|
59
|
+
let nativeTask, pending;
|
|
34
60
|
let controller;
|
|
35
|
-
let
|
|
36
|
-
let closing;
|
|
61
|
+
let sessionClosing, closing;
|
|
37
62
|
let abortAt;
|
|
38
|
-
|
|
63
|
+
const session = createRestrictedCodexSession({ ...options.session, participant: {
|
|
64
|
+
...(operator ? { authMode: "operator" } : {}), reasoningEffort: effort,
|
|
65
|
+
tool: { name: "humanish_ui", description: TOOL_DESCRIPTION, inputSchema: PARTICIPANT_TOOL_SCHEMA,
|
|
66
|
+
async call(args) {
|
|
67
|
+
if (closed || closingPhase || continuation || !active)
|
|
68
|
+
throw new Error("Unexpected participant tool call");
|
|
69
|
+
const turn = parseParticipantTool(args);
|
|
70
|
+
const reply = deferred();
|
|
71
|
+
continuation = reply;
|
|
72
|
+
lastActionCount = turn.actions.length;
|
|
73
|
+
emit({ turn });
|
|
74
|
+
return reply.promise;
|
|
75
|
+
} }
|
|
76
|
+
} });
|
|
39
77
|
const closeSession = () => sessionClosing ??= Promise.resolve().then(() => session.close()).catch(() => false).then(confirmed => {
|
|
40
|
-
sessionSettled = true;
|
|
41
78
|
if (!confirmed)
|
|
42
79
|
failedCleanup = true;
|
|
43
80
|
return confirmed;
|
|
@@ -46,115 +83,135 @@ export function createRestrictedCodexParticipant(options = {}) {
|
|
|
46
83
|
closed = true;
|
|
47
84
|
abortAt ??= performance.now();
|
|
48
85
|
controller?.abort();
|
|
86
|
+
continuation?.reject(new Error("Participant closed"));
|
|
87
|
+
continuation = undefined;
|
|
49
88
|
void closeSession();
|
|
50
|
-
cleanupTimer ??= setTimeout(() => { if (pending || !sessionSettled)
|
|
51
|
-
failedCleanup = true; }, Math.max(0, L.cleanupMs - (performance.now() - abortAt)));
|
|
52
89
|
};
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
if (signal.aborted)
|
|
59
|
-
onAbort();
|
|
60
|
-
try {
|
|
61
|
-
if (own.signal.aborted || closed)
|
|
62
|
-
throw new CuaProviderError("cancelled", receipt);
|
|
63
|
-
if (typeof req.instructions !== "string" || Buffer.byteLength(req.instructions) > L.instructions ||
|
|
64
|
-
(req.contextHint !== undefined && (typeof req.contextHint !== "string" || Buffer.byteLength(req.contextHint) > L.hint)) ||
|
|
65
|
-
req.previousResponseId !== undefined || (req.acknowledgedSafetyChecks?.length ?? 0) > 0 ||
|
|
66
|
-
(instructions !== undefined && instructions !== req.instructions))
|
|
67
|
-
throw new CuaProviderError("request_rejected", receipt);
|
|
68
|
-
const frame = req.observation.screenshot;
|
|
90
|
+
function launch(req, imageUrl) {
|
|
91
|
+
active = true;
|
|
92
|
+
controller = new AbortController();
|
|
93
|
+
nativeTask = (async () => {
|
|
94
|
+
let receipt = noDispatch(), usage;
|
|
69
95
|
try {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
96
|
+
const result = await session.run({ ...(model === undefined ? {} : { model }),
|
|
97
|
+
instructions: `${instructions}\n\nYou are the study participant throughout this conversation, including its closing account. Use only the supplied screenshots and humanish_ui tool to interact. The tool returns a JSON string: parse it, inspect acknowledgments, and display imageUrl with Code Mode image(). Do not print the image data URL as text. Keep your persona and earlier observations throughout the session. Speak publicly about your experience, never reveal private reasoning. Completed inputs do not prove application outcomes; verify on the next screenshot. When the task ends, return only the required final JSON with outcome, summary and frictionReports. Report observed confusion and recovered mistakes as well as blockers. Do not invent observations.`,
|
|
98
|
+
evidence: JSON.stringify({ phase: closingPhase ? "closing" : "interaction", contextHint: req.contextHint ?? null,
|
|
99
|
+
instruction: closingPhase ? "Interaction has ended. Do not call tools; give your closing account."
|
|
100
|
+
: "Use humanish_ui to act. Inspect each result before choosing the next batch. Finish when appropriate.",
|
|
101
|
+
width: req.observation.screenshot.readUInt32BE(16), height: req.observation.screenshot.readUInt32BE(20),
|
|
102
|
+
previousExecution: req.previousExecution ?? null }),
|
|
103
|
+
images: [{ evidenceId: "current-frame", dataUrl: imageUrl }], schema: PARTICIPANT_FINAL_SCHEMA,
|
|
104
|
+
maxOutputTokens: null, timeoutMs, signal: controller.signal });
|
|
105
|
+
receipt = { dispatched: result.dispatched, usageComplete: result.usageComplete,
|
|
106
|
+
cleanup: result.errorCode === "codex_cleanup_failed" ? "unconfirmed" : "confirmed" };
|
|
107
|
+
usage = result.usage ?? undefined;
|
|
108
|
+
if (result.dispatched && !result.usageComplete)
|
|
109
|
+
incompleteUsage = true;
|
|
110
|
+
if (receipt.cleanup === "unconfirmed")
|
|
111
|
+
failedCleanup = true;
|
|
112
|
+
if (closed || controller.signal.aborted)
|
|
113
|
+
throw new CuaProviderError(failedCleanup ? "cleanup_unconfirmed" : "cancelled", receipt, usage, result.failurePhase);
|
|
114
|
+
if (result.status !== "completed" || result.errorCode !== null)
|
|
115
|
+
throw new CuaProviderError(codeOf(result.errorCode), receipt, usage, result.failurePhase);
|
|
116
|
+
let turn;
|
|
117
|
+
try {
|
|
118
|
+
turn = parseParticipantFinal(result.output);
|
|
82
119
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
instructions: `${instructions}\n\nYou are the study participant throughout this conversation, including its closing account. Use the screenshots, your conversation history and explicit input acknowledgments. Describe your experience as public participant speech, never private reasoning. Earlier proposals and completed inputs are not independent proof of their application outcomes. Preserve uncertainty and do not invent observations. Never use tools or request integrations. Follow the current phase instruction and supplied JSON schema.`,
|
|
88
|
-
evidence: JSON.stringify({ phase: debrief ? "closing" : "interaction",
|
|
89
|
-
instruction: debrief ? "The interaction has ended. Give only a closing summary and frictionReports about what you observed; do not propose actions."
|
|
90
|
-
: "Continue with one to four browser actions, or explicitly finish with no actions and your outcome.",
|
|
91
|
-
width: frame.readUInt32BE(16), height: frame.readUInt32BE(20),
|
|
92
|
-
contextHint: req.contextHint ?? null, memoryPolicy: PARTICIPANT_PROFILE.memoryPolicy, previousExecution: previousExecution ?? null }),
|
|
93
|
-
images: [{ evidenceId: "current-frame", dataUrl: `data:image/png;base64,${frame.toString("base64")}` }],
|
|
94
|
-
schema: debrief ? PARTICIPANT_CLOSING_SCHEMA : PARTICIPANT_TURN_SCHEMA, maxOutputTokens: null, timeoutMs, signal: own.signal });
|
|
95
|
-
receipt = { dispatched: result.dispatched, usageComplete: result.usageComplete,
|
|
96
|
-
cleanup: result.errorCode === "codex_cleanup_failed" ? "unconfirmed" : "confirmed" };
|
|
97
|
-
usage = result.usage ?? undefined;
|
|
98
|
-
if (receipt.cleanup === "unconfirmed") {
|
|
99
|
-
failedCleanup = true;
|
|
100
|
-
revoke();
|
|
120
|
+
catch {
|
|
121
|
+
throw new CuaProviderError("invalid_response", receipt, usage, "response");
|
|
122
|
+
}
|
|
123
|
+
emit({ turn: { ...turn, ...(usage === undefined ? {} : { usage: { ...usage, turns: result.inferenceUsage ?? [] } }), providerRequest: receipt } });
|
|
101
124
|
}
|
|
102
|
-
|
|
103
|
-
incompleteUsage
|
|
104
|
-
if (closed || own.signal.aborted)
|
|
105
|
-
throw new CuaProviderError(receipt.cleanup === "unconfirmed" ? "cleanup_unconfirmed" : "cancelled", receipt, usage, result.failurePhase);
|
|
106
|
-
if (result.status !== "completed" || result.errorCode !== null) {
|
|
125
|
+
catch (error) {
|
|
126
|
+
incompleteUsage ||= receipt.dispatched !== false && !receipt.usageComplete;
|
|
107
127
|
revoke();
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
let turn;
|
|
111
|
-
try {
|
|
112
|
-
turn = debrief ? { actions: [], pendingSafetyChecks: [], done: true, closingReport: parseParticipantClosing(result.output) }
|
|
113
|
-
: parseParticipantTurn(result.output);
|
|
128
|
+
emit({ error: isCuaProviderError(error) ? error
|
|
129
|
+
: new CuaProviderError("process_failed", { dispatched: "unknown", usageComplete: false, cleanup: "unconfirmed" }, usage) });
|
|
114
130
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
throw new CuaProviderError("invalid_response", receipt, usage, "response");
|
|
131
|
+
finally {
|
|
132
|
+
active = false;
|
|
118
133
|
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
return
|
|
124
|
-
|
|
125
|
-
catch (error) {
|
|
126
|
-
if (isCuaProviderError(error))
|
|
127
|
-
throw error;
|
|
128
|
-
failedCleanup = true;
|
|
129
|
-
incompleteUsage = true;
|
|
134
|
+
})();
|
|
135
|
+
}
|
|
136
|
+
async function execute(req, signal, debrief) {
|
|
137
|
+
if (events.length)
|
|
138
|
+
return nextEvent();
|
|
139
|
+
if (signal.aborted) {
|
|
130
140
|
revoke();
|
|
131
|
-
throw new CuaProviderError("
|
|
141
|
+
throw new CuaProviderError("cancelled", noDispatch());
|
|
142
|
+
}
|
|
143
|
+
if (typeof req.instructions !== "string" || Buffer.byteLength(req.instructions) > L.instructions ||
|
|
144
|
+
(req.contextHint !== undefined && (typeof req.contextHint !== "string" || Buffer.byteLength(req.contextHint) > L.hint)) ||
|
|
145
|
+
req.previousResponseId !== undefined || (req.acknowledgedSafetyChecks?.length ?? 0) > 0 ||
|
|
146
|
+
(instructions !== undefined && instructions !== req.instructions))
|
|
147
|
+
throw new CuaProviderError("request_rejected", noDispatch());
|
|
148
|
+
const frame = req.observation.screenshot;
|
|
149
|
+
try {
|
|
150
|
+
if (!Buffer.isBuffer(frame))
|
|
151
|
+
throw new Error();
|
|
152
|
+
validateBrowserControlPng(frame);
|
|
153
|
+
}
|
|
154
|
+
catch {
|
|
155
|
+
throw new CuaProviderError("request_rejected", noDispatch());
|
|
156
|
+
}
|
|
157
|
+
const acknowledgments = req.previousExecution?.actions;
|
|
158
|
+
if ((continuation && acknowledgments === undefined) || (acknowledgments !== undefined &&
|
|
159
|
+
(lastActionCount === undefined || !Array.isArray(acknowledgments) || acknowledgments.length !== lastActionCount ||
|
|
160
|
+
acknowledgments.some((a, i) => !a || a.index !== i || !["completed", "skipped", "not_dispatched", "outcome_uncertain"].includes(a.status))))) {
|
|
161
|
+
throw new CuaProviderError("request_rejected", noDispatch());
|
|
162
|
+
}
|
|
163
|
+
const onAbort = () => { revoke(); };
|
|
164
|
+
signal.addEventListener("abort", onAbort, { once: true });
|
|
165
|
+
try {
|
|
166
|
+
instructions ??= req.instructions;
|
|
167
|
+
closingPhase = debrief;
|
|
168
|
+
const imageUrl = `data:image/png;base64,${frame.toString("base64")}`;
|
|
169
|
+
if (continuation) {
|
|
170
|
+
const reply = continuation;
|
|
171
|
+
continuation = undefined;
|
|
172
|
+
reply.resolve(JSON.stringify({ acknowledgments: acknowledgments.map(({ index, status }) => ({ index, status })), imageUrl,
|
|
173
|
+
contextHint: req.contextHint ?? null, closing: debrief }));
|
|
174
|
+
}
|
|
175
|
+
else if (!active)
|
|
176
|
+
launch(req, imageUrl);
|
|
177
|
+
else
|
|
178
|
+
throw new CuaProviderError("busy", noDispatch());
|
|
179
|
+
return await nextEvent();
|
|
132
180
|
}
|
|
133
181
|
finally {
|
|
182
|
+
// The shared loop aborts each request's signal after it yields. The native
|
|
183
|
+
// turn must remain alive while Humanish executes and records its actions.
|
|
134
184
|
signal.removeEventListener("abort", onAbort);
|
|
135
185
|
}
|
|
136
186
|
}
|
|
137
187
|
const start = (req, signal, debrief) => {
|
|
138
|
-
if (closed)
|
|
188
|
+
if (closed && events.length === 0)
|
|
139
189
|
return Promise.reject(new CuaProviderError("request_rejected", noDispatch()));
|
|
140
190
|
if (pending)
|
|
141
191
|
return Promise.reject(new CuaProviderError("busy", noDispatch()));
|
|
142
|
-
const
|
|
143
|
-
controller = own;
|
|
144
|
-
const task = execute(req, signal, debrief, own);
|
|
192
|
+
const task = execute(req, signal, debrief);
|
|
145
193
|
pending = task;
|
|
146
|
-
void task.finally(() => { if (pending === task)
|
|
147
|
-
pending = undefined;
|
|
148
|
-
controller = undefined;
|
|
149
|
-
} }).catch(() => undefined);
|
|
194
|
+
void task.finally(() => { if (pending === task)
|
|
195
|
+
pending = undefined; }).catch(() => undefined);
|
|
150
196
|
return task;
|
|
151
197
|
};
|
|
152
198
|
const provider = {
|
|
153
|
-
id: "
|
|
154
|
-
|
|
155
|
-
|
|
199
|
+
id: "codex-participant", requiresFrame: true, requestPolicy: "fail_closed",
|
|
200
|
+
get version() { return session.resolvedModel ?? model; },
|
|
201
|
+
get executionProfile() {
|
|
202
|
+
if (!operator)
|
|
203
|
+
return PARTICIPANT_PROFILE;
|
|
204
|
+
return session.authentication === "chatgpt-account" && session.resolvedModel
|
|
205
|
+
? { ...PARTICIPANT_PROFILE, requestedModel: session.resolvedModel, reasoningEffort: effort } : undefined;
|
|
206
|
+
},
|
|
207
|
+
modelSettings: { reasoningEffort: effort },
|
|
208
|
+
capabilities: { headless: true, structuredTrace: true, lanes: ["computer-use"], producesScreenshots: true, byoModel: operator,
|
|
156
209
|
preGrantableApprovals: false, inProcessTools: false, license: "proprietary" },
|
|
157
|
-
get
|
|
210
|
+
get pendingRequestUsage() {
|
|
211
|
+
const usage = session.pendingUsage;
|
|
212
|
+
return usage === undefined ? undefined : { ...usage, turns: session.pendingInferenceUsage ?? [] };
|
|
213
|
+
},
|
|
214
|
+
get interactionUsageIncomplete() { return incompleteUsage || active; }, get historyTurnsOmitted() { return 0; },
|
|
158
215
|
nextTurn: (req, signal) => start(req, signal, false), debrief: (req, signal) => start(req, signal, true)
|
|
159
216
|
};
|
|
160
217
|
return { provider, close: () => {
|
|
@@ -164,19 +221,14 @@ export function createRestrictedCodexParticipant(options = {}) {
|
|
|
164
221
|
closing = (async () => {
|
|
165
222
|
let timer;
|
|
166
223
|
try {
|
|
167
|
-
const
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
})]);
|
|
171
|
-
if (!settled)
|
|
224
|
+
const confirmed = await Promise.race([Promise.all([nativeTask, closeSession()]).then(([, ok]) => ok),
|
|
225
|
+
new Promise(resolve => { timer = setTimeout(() => resolve(false), Math.max(0, L.cleanupMs - (performance.now() - abortAt))); })]);
|
|
226
|
+
if (!confirmed)
|
|
172
227
|
failedCleanup = true;
|
|
173
228
|
return { status: failedCleanup ? "unconfirmed" : "confirmed" };
|
|
174
229
|
}
|
|
175
230
|
finally {
|
|
176
231
|
clearTimeout(timer);
|
|
177
|
-
clearTimeout(cleanupTimer);
|
|
178
|
-
lastActionCount = undefined;
|
|
179
|
-
instructions = undefined;
|
|
180
232
|
}
|
|
181
233
|
})();
|
|
182
234
|
return closing;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"restricted-codex-participant.js","sourceRoot":"","sources":["../src/restricted-codex-participant.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAA6B,MAAM,yBAAyB,CAAC;AAC1G,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,EAAE,4BAA4B,EAAsC,MAAM,+BAA+B,CAAC;AAEjH,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,IAAI,CAAC,EAAE,uBAAuB,EAAE,0BAA0B,EACxG,oBAAoB,EAAE,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AC,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC;wBAClG,IAAI,OAAO,CAAQ,OAAO,CAAC,EAAE,GAAG,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,SAAS,GAAG,CAAC,WAAW,CAAC,GAAG,EAAE,GAAG,OAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;oBAC5I,IAAI,CAAC,SAAS;wBAAE,aAAa,GAAG,IAAI,CAAC;oBACrC,OAAO,EAAE,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,WAAW,EAAoC,CAAC;gBACnG,CAAC;wBAAS,CAAC;oBAAC,YAAY,CAAC,KAAK,CAAC,CAAC;gBAAC,CAAC;YACpC,CAAC,CAAC,EAAE,CAAC;YACL,OAAO,OAAO,CAAC;QACjB,CAAC,EAAE,CAAC;AACN,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ReasoningEffort } from "./reasoning-effort.js";
|
|
1
2
|
/** Versioned, deliberately narrow profile qualified with an account-backed vision turn.
|
|
2
3
|
* The CLI still advertises code-mode tools: disabling their host is the enforcement
|
|
3
4
|
* boundary. Feature names alone are not proof that a tool has been removed. */
|
|
@@ -12,7 +13,7 @@ export declare const RESTRICTED_CODEX_ANALYSIS_IDENTITY: {
|
|
|
12
13
|
export declare const RESTRICTED_CODEX_ANALYSIS_MODELS: readonly ["gpt-6-astra"];
|
|
13
14
|
export type RestrictedCodexAnalysisErrorCode = "invalid_request" | "cancelled" | "timeout" | "response_too_large" | "invalid_response" | "refusal" | "output_incomplete" | "codex_unavailable" | "codex_unsupported_version" | "codex_unsupported_platform" | "codex_login_required" | "codex_unsupported_auth" | "codex_unsafe_configuration" | "codex_model_unavailable" | "codex_protocol_error" | "codex_tool_call" | "codex_process_failed" | "codex_cleanup_failed" | "codex_busy";
|
|
14
15
|
export interface RestrictedCodexRequest {
|
|
15
|
-
model
|
|
16
|
+
model?: string | undefined;
|
|
16
17
|
instructions: string;
|
|
17
18
|
evidence: string;
|
|
18
19
|
images: {
|
|
@@ -35,6 +36,7 @@ export interface RestrictedCodexResult {
|
|
|
35
36
|
status: "completed" | "incomplete" | "refused" | "failed" | "cancelled" | "timed_out";
|
|
36
37
|
output: unknown;
|
|
37
38
|
usage: RestrictedCodexUsage | null;
|
|
39
|
+
inferenceUsage?: RestrictedCodexUsage[];
|
|
38
40
|
usageComplete: boolean;
|
|
39
41
|
dispatched: boolean;
|
|
40
42
|
errorCode: RestrictedCodexAnalysisErrorCode | null;
|
|
@@ -45,13 +47,18 @@ export declare const CODEX_MAX_STDOUT_BYTES: number;
|
|
|
45
47
|
export declare const CODEX_MAX_EVENTS = 65536;
|
|
46
48
|
export declare const CODEX_IMAGE: RegExp;
|
|
47
49
|
export declare const codexRecord: (value: unknown) => Record<string, unknown>;
|
|
48
|
-
export
|
|
50
|
+
export interface RestrictedCodexConfigMode {
|
|
51
|
+
participantCodeMode?: boolean;
|
|
52
|
+
reasoningEffort?: ReasoningEffort;
|
|
53
|
+
operatorAuth?: boolean;
|
|
54
|
+
}
|
|
55
|
+
export declare function restrictedCodexConfig(model: string | undefined, mode?: RestrictedCodexConfigMode): {
|
|
49
56
|
toml: string;
|
|
50
57
|
overrides: Record<string, unknown>;
|
|
51
58
|
};
|
|
52
59
|
/** Inspect before thread/start, which could otherwise start inherited integrations. */
|
|
53
|
-
export declare function admitsRestrictedCodexConfig(raw: unknown, configPath: string, model: string): boolean;
|
|
54
|
-
export declare function admitsRestrictedCodexThread(raw: unknown, model: string, cwd: string): boolean;
|
|
55
|
-
export declare function restrictedCodexRequestError(request: RestrictedCodexRequest): RestrictedCodexAnalysisErrorCode | null;
|
|
60
|
+
export declare function admitsRestrictedCodexConfig(raw: unknown, configPath: string, model: string | undefined, mode?: RestrictedCodexConfigMode): boolean;
|
|
61
|
+
export declare function admitsRestrictedCodexThread(raw: unknown, model: string, cwd: string, reasoningEffort?: ReasoningEffort): boolean;
|
|
62
|
+
export declare function restrictedCodexRequestError(request: RestrictedCodexRequest, operatorParticipant?: boolean): RestrictedCodexAnalysisErrorCode | null;
|
|
56
63
|
export declare function restrictedCodexUsage(raw: unknown): RestrictedCodexUsage | null;
|
|
57
64
|
export declare function restrictedCodexFailure(errorCode: RestrictedCodexAnalysisErrorCode, dispatched?: boolean, usage?: RestrictedCodexUsage | null): RestrictedCodexResult;
|