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
|
@@ -17,25 +17,31 @@ const empty = (value) => value === null || value === undefined
|
|
|
17
17
|
const count = (value) => Number.isSafeInteger(value) && value >= 0 && value <= 1e12;
|
|
18
18
|
const disabledFeatures = ["apps", "plugins", "hooks", "shell_tool", "shell_snapshot", "view_image", "image_generation",
|
|
19
19
|
"skill_search", "skill_mcp_dependency_install", "multi_agent", "multi_agent_v2", "browser_use", "browser_use_external",
|
|
20
|
-
"computer_use", "memories", "external_agent_memory_import", "goals", "sleep_tool", "tool_suggest",
|
|
21
|
-
"
|
|
20
|
+
"computer_use", "memories", "external_agent_memory_import", "goals", "sleep_tool", "tool_suggest",
|
|
21
|
+
"default_mode_request_user_input", "unbounded_connection_retries",
|
|
22
22
|
"workspace_dependencies", "remote_plugin", "recommended_plugins", "in_app_local_automation"];
|
|
23
|
-
|
|
23
|
+
const codeModeFeatures = ["code_mode", "code_mode_host", "code_mode_only"];
|
|
24
|
+
export function restrictedCodexConfig(model, mode = {}) {
|
|
25
|
+
const reasoningEffort = mode.reasoningEffort ?? "low", codeMode = mode.participantCodeMode === true;
|
|
24
26
|
const overrides = {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
+
model_provider: "openai", model_reasoning_effort: reasoningEffort, approval_policy: "never", sandbox_mode: "read-only",
|
|
28
|
+
project_doc_max_bytes: 0, web_search: "disabled", "history.persistence": "none",
|
|
27
29
|
"analytics.enabled": false, "features.skip_host_skill_discovery": true, "skills.bundled.enabled": false,
|
|
28
30
|
"agents.enabled": false, "agents.max_threads": 1, "agents.max_depth": 1
|
|
29
31
|
};
|
|
32
|
+
if (model !== undefined)
|
|
33
|
+
overrides.model = model;
|
|
34
|
+
if (!mode.operatorAuth)
|
|
35
|
+
overrides.forced_login_method = "chatgpt";
|
|
30
36
|
for (const name of disabledFeatures)
|
|
31
37
|
overrides[`features.${name}`] = false;
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
38
|
+
for (const name of codeModeFeatures)
|
|
39
|
+
overrides[`features.${name}`] = codeMode;
|
|
40
|
+
const toml = `${model === undefined ? "" : `model = ${JSON.stringify(model)}\n`}model_provider = "openai"
|
|
41
|
+
model_reasoning_effort = ${JSON.stringify(reasoningEffort)}
|
|
35
42
|
approval_policy = "never"
|
|
36
43
|
sandbox_mode = "read-only"
|
|
37
|
-
forced_login_method = "chatgpt"
|
|
38
|
-
project_doc_max_bytes = 0
|
|
44
|
+
${mode.operatorAuth ? "" : "forced_login_method = \"chatgpt\"\n"}project_doc_max_bytes = 0
|
|
39
45
|
web_search = "disabled"
|
|
40
46
|
[history]
|
|
41
47
|
persistence = "none"
|
|
@@ -44,6 +50,7 @@ enabled = false
|
|
|
44
50
|
[features]
|
|
45
51
|
skip_host_skill_discovery = true
|
|
46
52
|
${disabledFeatures.map(name => `${name} = false`).join("\n")}
|
|
53
|
+
${codeModeFeatures.map(name => `${name} = ${codeMode}`).join("\n")}
|
|
47
54
|
[skills.bundled]
|
|
48
55
|
enabled = false
|
|
49
56
|
[agents]
|
|
@@ -54,60 +61,78 @@ max_depth = 1
|
|
|
54
61
|
return { toml, overrides };
|
|
55
62
|
}
|
|
56
63
|
/** Inspect before thread/start, which could otherwise start inherited integrations. */
|
|
57
|
-
export function admitsRestrictedCodexConfig(raw, configPath, model) {
|
|
64
|
+
export function admitsRestrictedCodexConfig(raw, configPath, model, mode = {}) {
|
|
58
65
|
const root = codexRecord(raw), config = codexRecord(root.config), features = codexRecord(config.features);
|
|
59
66
|
if (!Array.isArray(root.layers) || root.layers.length === 0)
|
|
60
67
|
return false;
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
68
|
+
if (!mode.operatorAuth) {
|
|
69
|
+
let ownLayer = false;
|
|
70
|
+
for (const rawLayer of root.layers) {
|
|
71
|
+
const layer = codexRecord(rawLayer), name = codexRecord(layer.name);
|
|
72
|
+
if (name.type === "user" && name.file === configPath && name.profile === null
|
|
73
|
+
&& (layer.disabledReason === null || layer.disabledReason === undefined)) {
|
|
74
|
+
if (ownLayer)
|
|
75
|
+
return false;
|
|
76
|
+
ownLayer = true;
|
|
77
|
+
}
|
|
78
|
+
else if (name.type !== "system" || !empty(layer.config))
|
|
67
79
|
return false;
|
|
68
|
-
ownLayer = true;
|
|
69
80
|
}
|
|
70
|
-
|
|
81
|
+
if (!ownLayer)
|
|
71
82
|
return false;
|
|
72
83
|
}
|
|
73
|
-
|
|
74
|
-
|
|
84
|
+
const reasoningEffort = mode.reasoningEffort ?? "low", codeMode = mode.participantCodeMode === true;
|
|
85
|
+
const inheritedModel = config.model;
|
|
86
|
+
const modelAdmitted = model === undefined && mode.operatorAuth
|
|
87
|
+
? inheritedModel === undefined || inheritedModel === null
|
|
88
|
+
|| (typeof inheritedModel === "string" && inheritedModel.length > 0 && inheritedModel.length <= 200)
|
|
89
|
+
: inheritedModel === model;
|
|
90
|
+
if (!modelAdmitted
|
|
91
|
+
|| config.model_provider !== "openai" || config.model_reasoning_effort !== reasoningEffort
|
|
92
|
+
|| (!mode.operatorAuth && config.forced_login_method !== "chatgpt") || config.sandbox_mode !== "read-only" || config.approval_policy !== "never"
|
|
75
93
|
|| config.project_doc_max_bytes !== 0 || config.web_search !== "disabled" || features.skip_host_skill_discovery !== true
|
|
76
94
|
|| codexRecord(config.history).persistence !== "none" || codexRecord(config.analytics).enabled !== false
|
|
77
|
-
|| disabledFeatures.some(name => features[name] !== false)
|
|
95
|
+
|| disabledFeatures.some(name => features[name] !== false)
|
|
96
|
+
|| codeModeFeatures.some(name => features[name] !== codeMode))
|
|
78
97
|
return false;
|
|
79
98
|
const agents = codexRecord(config.agents), skills = codexRecord(config.skills);
|
|
80
99
|
if (agents.enabled !== false || agents.max_concurrent_threads_per_session !== 1 || agents.max_depth !== 1
|
|
81
100
|
|| codexRecord(skills.bundled).enabled !== false || Object.keys(skills).some(key => key !== "bundled"))
|
|
82
101
|
return false;
|
|
83
|
-
|
|
84
|
-
"
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
102
|
+
if (!mode.operatorAuth) {
|
|
103
|
+
for (const key of ["mcp_servers", "plugins", "hooks", "notify", "instructions", "developer_instructions", "permissions",
|
|
104
|
+
"profiles", "projects", "model_providers", "experimental_compact_prompt_file", "experimental_model_instructions_file", "model_instructions_file",
|
|
105
|
+
"model_catalog_json", "openai_base_url", "orchestrator", "experimental_thread_store", "experimental_thread_store_endpoint",
|
|
106
|
+
"experimental_realtime_ws_base_url", "experimental_realtime_webrtc_call_base_url", "forced_chatgpt_workspace_id",
|
|
107
|
+
"log_dir", "sqlite_home", "otel", "marketplaces", "js_repl_node_path", "js_repl_node_module_dirs", "responses_api_metadata",
|
|
108
|
+
"compact_prompt", "profile", "default_permissions", "auto_review", "apps", "browser_use", "computer_use", "desktop", "memories", "realtime"])
|
|
109
|
+
if (!empty(config[key]))
|
|
110
|
+
return false;
|
|
111
|
+
if (Object.values(codexRecord(config.shell_environment_policy)).some(value => !empty(value)))
|
|
90
112
|
return false;
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
return config.cli_auth_credentials_store === "file" && config.chatgpt_base_url === "https://chatgpt.com/backend-api/";
|
|
113
|
+
}
|
|
114
|
+
return mode.operatorAuth || (config.cli_auth_credentials_store === "file" && config.chatgpt_base_url === "https://chatgpt.com/backend-api/");
|
|
94
115
|
}
|
|
95
|
-
export function admitsRestrictedCodexThread(raw, model, cwd) {
|
|
116
|
+
export function admitsRestrictedCodexThread(raw, model, cwd, reasoningEffort = "low") {
|
|
96
117
|
const value = codexRecord(raw), thread = codexRecord(value.thread), sandbox = codexRecord(value.sandbox);
|
|
97
118
|
return typeof thread.id === "string" && thread.id.length > 0 && thread.id.length <= 200
|
|
98
119
|
&& thread.ephemeral === true && thread.model === model && thread.modelProvider === "openai"
|
|
99
|
-
&& thread.reasoningEffort ===
|
|
120
|
+
&& thread.reasoningEffort === reasoningEffort && thread.cliVersion === RESTRICTED_CODEX_ANALYSIS_IDENTITY.cliVersion
|
|
100
121
|
&& Array.isArray(thread.environments) && thread.environments.length === 0 && thread.path === null
|
|
101
|
-
&& value.model === model && value.modelProvider === "openai" && value.reasoningEffort ===
|
|
122
|
+
&& value.model === model && value.modelProvider === "openai" && value.reasoningEffort === reasoningEffort
|
|
102
123
|
&& value.cwd === cwd && thread.cwd === cwd && value.approvalPolicy === "never"
|
|
103
124
|
&& sandbox.type === "readOnly" && sandbox.networkAccess === false
|
|
104
125
|
&& Array.isArray(value.instructionSources) && value.instructionSources.length === 0
|
|
105
126
|
&& Array.isArray(value.runtimeWorkspaceRoots) && value.runtimeWorkspaceRoots.length === 0;
|
|
106
127
|
}
|
|
107
|
-
export function restrictedCodexRequestError(request) {
|
|
128
|
+
export function restrictedCodexRequestError(request, operatorParticipant = false) {
|
|
108
129
|
if (request.signal?.aborted)
|
|
109
130
|
return "cancelled";
|
|
110
|
-
if (
|
|
131
|
+
if (operatorParticipant) {
|
|
132
|
+
if (request.model !== undefined && (typeof request.model !== "string" || request.model.length === 0 || request.model.length > 200))
|
|
133
|
+
return "codex_model_unavailable";
|
|
134
|
+
}
|
|
135
|
+
else if (!RESTRICTED_CODEX_ANALYSIS_MODELS.some(model => model === request.model))
|
|
111
136
|
return "codex_model_unavailable";
|
|
112
137
|
if (request.maxOutputTokens !== null || !Number.isSafeInteger(request.timeoutMs) || request.timeoutMs < 1 || request.timeoutMs > 600_000
|
|
113
138
|
|| typeof request.instructions !== "string" || typeof request.evidence !== "string" || !Array.isArray(request.images)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"restricted-codex-policy.js","sourceRoot":"","sources":["../src/restricted-codex-policy.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"restricted-codex-policy.js","sourceRoot":"","sources":["../src/restricted-codex-policy.ts"],"names":[],"mappings":"AAEA;;+EAE+E;AAC/E,MAAM,CAAC,MAAM,kCAAkC,GAAG;IAChD,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,aAAa,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS;IACtF,UAAU,EAAE,qBAAqB,EAAE,eAAe,EAAE,KAAK;C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I,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC;AACrE,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { ReasoningEffort } from "./reasoning-effort.js";
|
|
2
|
+
import { type RestrictedCodexRequest, type RestrictedCodexResult, type RestrictedCodexUsage } from "./restricted-codex-policy.js";
|
|
2
3
|
import { type RestrictedCodexSpawn } from "./restricted-codex-transport.js";
|
|
3
4
|
/** Internal host dependencies. None of these options is accepted from a study artifact. */
|
|
4
5
|
export interface RestrictedCodexSessionOptions {
|
|
@@ -9,10 +10,34 @@ export interface RestrictedCodexSessionOptions {
|
|
|
9
10
|
platform?: NodeJS.Platform;
|
|
10
11
|
arch?: string;
|
|
11
12
|
spawnFn?: RestrictedCodexSpawn;
|
|
13
|
+
participant?: {
|
|
14
|
+
authMode?: "operator";
|
|
15
|
+
reasoningEffort?: ReasoningEffort;
|
|
16
|
+
tool: {
|
|
17
|
+
name: string;
|
|
18
|
+
description: string;
|
|
19
|
+
inputSchema: Record<string, unknown>;
|
|
20
|
+
call(args: unknown): Promise<string>;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
12
23
|
}
|
|
13
|
-
/**
|
|
14
|
-
|
|
24
|
+
/** Official npm launcher target map for the Unix hosts supported by this transport. */
|
|
25
|
+
export declare function restrictedCodexNpmTarget(platform: NodeJS.Platform, arch: string): {
|
|
26
|
+
triple: string;
|
|
27
|
+
packageName: string;
|
|
28
|
+
} | undefined;
|
|
29
|
+
/** Analysts/readiness keep their one-shot lifetime; participants own a session. */
|
|
15
30
|
export declare function runRestrictedCodexSession(request: RestrictedCodexRequest, options?: RestrictedCodexSessionOptions, readinessOnly?: boolean): Promise<RestrictedCodexResult>;
|
|
31
|
+
/** One private process and conversation per owner. Only completed turns may continue. */
|
|
32
|
+
export interface RestrictedCodexSession {
|
|
33
|
+
readonly pendingUsage?: RestrictedCodexUsage | undefined;
|
|
34
|
+
readonly pendingInferenceUsage?: RestrictedCodexUsage[] | undefined;
|
|
35
|
+
readonly resolvedModel?: string | undefined;
|
|
36
|
+
readonly authentication?: "chatgpt-account" | "api-key" | undefined;
|
|
37
|
+
run(request: RestrictedCodexRequest, readinessOnly?: boolean): Promise<RestrictedCodexResult>;
|
|
38
|
+
close(): Promise<boolean>;
|
|
39
|
+
}
|
|
40
|
+
export declare function createRestrictedCodexSession(options?: RestrictedCodexSessionOptions): RestrictedCodexSession;
|
|
16
41
|
export declare function checkRestrictedCodexSessionReadiness(input?: {
|
|
17
42
|
signal?: AbortSignal;
|
|
18
43
|
timeoutMs?: number;
|