@right-link/paperclip-plugin-codex-remote 0.3.1 → 0.3.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/dist/chunk-FULSN5VN.js +5348 -0
- package/dist/chunk-YJYVA7CY.js +99 -0
- package/dist/chunk-ZLN6QQMX.js +3267 -0
- package/dist/cli/index.js +190 -2
- package/dist/index.js +28 -84
- package/dist/server/adapter.js +140 -135
- package/dist/server/index.js +41 -56
- package/dist/server-utils-C4H4WJOG.js +104 -0
- package/dist/ui/index.js +318 -3
- package/package.json +7 -5
- package/dist/cli/format-event.js +0 -213
- package/dist/cli/format-event.js.map +0 -1
- package/dist/cli/index.js.map +0 -1
- package/dist/cli/quota-probe.js +0 -97
- package/dist/cli/quota-probe.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/server/adapter.js.map +0 -1
- package/dist/server/adapter.test.js +0 -84
- package/dist/server/adapter.test.js.map +0 -1
- package/dist/server/codex-args.js +0 -60
- package/dist/server/codex-args.js.map +0 -1
- package/dist/server/codex-args.test.js +0 -94
- package/dist/server/codex-args.test.js.map +0 -1
- package/dist/server/codex-home.js +0 -378
- package/dist/server/codex-home.js.map +0 -1
- package/dist/server/codex-home.test.js +0 -244
- package/dist/server/codex-home.test.js.map +0 -1
- package/dist/server/execute.js +0 -906
- package/dist/server/execute.js.map +0 -1
- package/dist/server/execute.remote.test.js +0 -487
- package/dist/server/execute.remote.test.js.map +0 -1
- package/dist/server/index.js.map +0 -1
- package/dist/server/parse.js +0 -213
- package/dist/server/parse.js.map +0 -1
- package/dist/server/parse.test.js +0 -107
- package/dist/server/parse.test.js.map +0 -1
- package/dist/server/quota-spawn-error.test.js +0 -77
- package/dist/server/quota-spawn-error.test.js.map +0 -1
- package/dist/server/quota.js +0 -432
- package/dist/server/quota.js.map +0 -1
- package/dist/server/sandbox-env.js +0 -23
- package/dist/server/sandbox-env.js.map +0 -1
- package/dist/server/skills.js +0 -24
- package/dist/server/skills.js.map +0 -1
- package/dist/server/tailscale.js +0 -95
- package/dist/server/tailscale.js.map +0 -1
- package/dist/server/test.js +0 -811
- package/dist/server/test.js.map +0 -1
- package/dist/server/test.remote.test.js +0 -257
- package/dist/server/test.remote.test.js.map +0 -1
- package/dist/ui/build-config.js +0 -113
- package/dist/ui/build-config.js.map +0 -1
- package/dist/ui/build-config.test.js +0 -49
- package/dist/ui/build-config.test.js.map +0 -1
- package/dist/ui/index.js.map +0 -1
- package/dist/ui/parse-stdout.js +0 -261
- package/dist/ui/parse-stdout.js.map +0 -1
- package/dist/ui/parse-stdout.test.js +0 -77
- package/dist/ui/parse-stdout.test.js.map +0 -1
- package/dist/ui-parser.js.map +0 -1
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
// src/index.ts
|
|
2
|
+
var type = "codex_remote";
|
|
3
|
+
var label = "Codex (remote)";
|
|
4
|
+
var SANDBOX_INSTALL_COMMAND = "npm install -g @openai/codex";
|
|
5
|
+
var DEFAULT_CODEX_REMOTE_MODEL = "gpt-5.3-codex";
|
|
6
|
+
var DEFAULT_CODEX_REMOTE_BYPASS_APPROVALS_AND_SANDBOX = true;
|
|
7
|
+
var CODEX_REMOTE_FAST_MODE_SUPPORTED_MODELS = ["gpt-5.4"];
|
|
8
|
+
function normalizeModelId(model) {
|
|
9
|
+
return typeof model === "string" ? model.trim() : "";
|
|
10
|
+
}
|
|
11
|
+
function isCodexRemoteKnownModel(model) {
|
|
12
|
+
const normalizedModel = normalizeModelId(model);
|
|
13
|
+
if (!normalizedModel) return false;
|
|
14
|
+
return models.some((entry) => entry.id === normalizedModel);
|
|
15
|
+
}
|
|
16
|
+
function isCodexRemoteManualModel(model) {
|
|
17
|
+
const normalizedModel = normalizeModelId(model);
|
|
18
|
+
return Boolean(normalizedModel) && !isCodexRemoteKnownModel(normalizedModel);
|
|
19
|
+
}
|
|
20
|
+
function isCodexRemoteFastModeSupported(model) {
|
|
21
|
+
if (isCodexRemoteManualModel(model)) return true;
|
|
22
|
+
const normalizedModel = typeof model === "string" ? model.trim() : "";
|
|
23
|
+
return CODEX_REMOTE_FAST_MODE_SUPPORTED_MODELS.includes(
|
|
24
|
+
normalizedModel
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
var models = [
|
|
28
|
+
{ id: "gpt-5.4", label: "gpt-5.4" },
|
|
29
|
+
{ id: DEFAULT_CODEX_REMOTE_MODEL, label: DEFAULT_CODEX_REMOTE_MODEL },
|
|
30
|
+
{ id: "gpt-5.3-codex-spark", label: "gpt-5.3-codex-spark" },
|
|
31
|
+
{ id: "gpt-5", label: "gpt-5" },
|
|
32
|
+
{ id: "o3", label: "o3" },
|
|
33
|
+
{ id: "o4-mini", label: "o4-mini" },
|
|
34
|
+
{ id: "gpt-5-mini", label: "gpt-5-mini" },
|
|
35
|
+
{ id: "gpt-5-nano", label: "gpt-5-nano" },
|
|
36
|
+
{ id: "o3-mini", label: "o3-mini" },
|
|
37
|
+
{ id: "codex-mini-latest", label: "Codex Mini" }
|
|
38
|
+
];
|
|
39
|
+
var modelProfiles = [
|
|
40
|
+
{
|
|
41
|
+
key: "cheap",
|
|
42
|
+
label: "Cheap",
|
|
43
|
+
description: "Use the lowest-cost known Codex local model lane without changing the primary model.",
|
|
44
|
+
adapterConfig: {
|
|
45
|
+
model: "gpt-5.3-codex-spark",
|
|
46
|
+
// Spark is the cheap lane by model price; high effort keeps Codex coding behavior usable for delegated work.
|
|
47
|
+
modelReasoningEffort: "high"
|
|
48
|
+
},
|
|
49
|
+
source: "adapter_default"
|
|
50
|
+
}
|
|
51
|
+
];
|
|
52
|
+
var agentConfigurationDoc = `# codex_remote agent configuration
|
|
53
|
+
|
|
54
|
+
Adapter: codex_remote
|
|
55
|
+
|
|
56
|
+
Core fields:
|
|
57
|
+
- cwd (string, optional): default absolute working directory fallback for the agent process (created if missing when possible)
|
|
58
|
+
- instructionsFilePath (string, optional): absolute path to a markdown instructions file prepended to stdin prompt at runtime
|
|
59
|
+
- model (string, optional): Codex model id
|
|
60
|
+
- modelReasoningEffort (string, optional): reasoning effort override (minimal|low|medium|high|xhigh) passed via -c model_reasoning_effort=...
|
|
61
|
+
- promptTemplate (string, optional): run prompt template
|
|
62
|
+
- search (boolean, optional): run codex with --search
|
|
63
|
+
- fastMode (boolean, optional): enable Codex Fast mode; supported on GPT-5.4 and passed through for manual model IDs
|
|
64
|
+
- dangerouslyBypassApprovalsAndSandbox (boolean, optional): run with bypass flag
|
|
65
|
+
- command (string, optional): defaults to "codex"
|
|
66
|
+
- extraArgs (string[], optional): additional CLI args
|
|
67
|
+
- env (object, optional): KEY=VALUE environment variables
|
|
68
|
+
- workspaceStrategy (object, optional): execution workspace strategy; currently supports { type: "git_worktree", baseRef?, branchTemplate?, worktreeParentDir? }
|
|
69
|
+
- workspaceRuntime (object, optional): reserved for workspace runtime metadata; workspace runtime services are manually controlled from the workspace UI and are not auto-started by heartbeats
|
|
70
|
+
|
|
71
|
+
Operational fields:
|
|
72
|
+
- timeoutSec (number, optional): run timeout in seconds
|
|
73
|
+
- graceSec (number, optional): SIGTERM grace period in seconds
|
|
74
|
+
|
|
75
|
+
Notes:
|
|
76
|
+
- Prompts are piped via stdin (Codex receives "-" prompt argument).
|
|
77
|
+
- If instructionsFilePath is configured, Paperclip prepends that file's contents to the stdin prompt on every run.
|
|
78
|
+
- Codex exec automatically applies repo-scoped AGENTS.md instructions from the active workspace. Paperclip cannot suppress that discovery in exec mode, so repo AGENTS.md files may still apply even when you only configured an explicit instructionsFilePath.
|
|
79
|
+
- Paperclip injects desired local skills into the effective CODEX_HOME/skills/ directory at execution time so Codex can discover "$paperclip" and related skills without polluting the project working directory. In managed-home mode (the default) this is ~/.paperclip/instances/<id>/companies/<companyId>/codex-home/skills/; when CODEX_HOME is explicitly overridden in adapter config, that override is used instead.
|
|
80
|
+
- Unless explicitly overridden in adapter config, Paperclip runs Codex with a per-company managed CODEX_HOME under the active Paperclip instance and seeds auth/config from the shared Codex home (the CODEX_HOME env var, when set, or ~/.codex).
|
|
81
|
+
- Some model/tool combinations reject certain effort levels (for example minimal with web search enabled).
|
|
82
|
+
- Fast mode is supported on GPT-5.4 and manual model IDs. When enabled for those models, Paperclip applies \`service_tier="fast"\` and \`features.fast_mode=true\`.
|
|
83
|
+
- When Paperclip realizes a workspace/runtime for a run, it injects PAPERCLIP_WORKSPACE_* and PAPERCLIP_RUNTIME_* env vars for agent-side tooling.
|
|
84
|
+
`;
|
|
85
|
+
|
|
86
|
+
export {
|
|
87
|
+
type,
|
|
88
|
+
label,
|
|
89
|
+
SANDBOX_INSTALL_COMMAND,
|
|
90
|
+
DEFAULT_CODEX_REMOTE_MODEL,
|
|
91
|
+
DEFAULT_CODEX_REMOTE_BYPASS_APPROVALS_AND_SANDBOX,
|
|
92
|
+
CODEX_REMOTE_FAST_MODE_SUPPORTED_MODELS,
|
|
93
|
+
isCodexRemoteKnownModel,
|
|
94
|
+
isCodexRemoteManualModel,
|
|
95
|
+
isCodexRemoteFastModeSupported,
|
|
96
|
+
models,
|
|
97
|
+
modelProfiles,
|
|
98
|
+
agentConfigurationDoc
|
|
99
|
+
};
|