@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.
Files changed (60) hide show
  1. package/dist/chunk-FULSN5VN.js +5348 -0
  2. package/dist/chunk-YJYVA7CY.js +99 -0
  3. package/dist/chunk-ZLN6QQMX.js +3267 -0
  4. package/dist/cli/index.js +190 -2
  5. package/dist/index.js +28 -84
  6. package/dist/server/adapter.js +140 -135
  7. package/dist/server/index.js +41 -56
  8. package/dist/server-utils-C4H4WJOG.js +104 -0
  9. package/dist/ui/index.js +318 -3
  10. package/package.json +7 -5
  11. package/dist/cli/format-event.js +0 -213
  12. package/dist/cli/format-event.js.map +0 -1
  13. package/dist/cli/index.js.map +0 -1
  14. package/dist/cli/quota-probe.js +0 -97
  15. package/dist/cli/quota-probe.js.map +0 -1
  16. package/dist/index.js.map +0 -1
  17. package/dist/server/adapter.js.map +0 -1
  18. package/dist/server/adapter.test.js +0 -84
  19. package/dist/server/adapter.test.js.map +0 -1
  20. package/dist/server/codex-args.js +0 -60
  21. package/dist/server/codex-args.js.map +0 -1
  22. package/dist/server/codex-args.test.js +0 -94
  23. package/dist/server/codex-args.test.js.map +0 -1
  24. package/dist/server/codex-home.js +0 -378
  25. package/dist/server/codex-home.js.map +0 -1
  26. package/dist/server/codex-home.test.js +0 -244
  27. package/dist/server/codex-home.test.js.map +0 -1
  28. package/dist/server/execute.js +0 -906
  29. package/dist/server/execute.js.map +0 -1
  30. package/dist/server/execute.remote.test.js +0 -487
  31. package/dist/server/execute.remote.test.js.map +0 -1
  32. package/dist/server/index.js.map +0 -1
  33. package/dist/server/parse.js +0 -213
  34. package/dist/server/parse.js.map +0 -1
  35. package/dist/server/parse.test.js +0 -107
  36. package/dist/server/parse.test.js.map +0 -1
  37. package/dist/server/quota-spawn-error.test.js +0 -77
  38. package/dist/server/quota-spawn-error.test.js.map +0 -1
  39. package/dist/server/quota.js +0 -432
  40. package/dist/server/quota.js.map +0 -1
  41. package/dist/server/sandbox-env.js +0 -23
  42. package/dist/server/sandbox-env.js.map +0 -1
  43. package/dist/server/skills.js +0 -24
  44. package/dist/server/skills.js.map +0 -1
  45. package/dist/server/tailscale.js +0 -95
  46. package/dist/server/tailscale.js.map +0 -1
  47. package/dist/server/test.js +0 -811
  48. package/dist/server/test.js.map +0 -1
  49. package/dist/server/test.remote.test.js +0 -257
  50. package/dist/server/test.remote.test.js.map +0 -1
  51. package/dist/ui/build-config.js +0 -113
  52. package/dist/ui/build-config.js.map +0 -1
  53. package/dist/ui/build-config.test.js +0 -49
  54. package/dist/ui/build-config.test.js.map +0 -1
  55. package/dist/ui/index.js.map +0 -1
  56. package/dist/ui/parse-stdout.js +0 -261
  57. package/dist/ui/parse-stdout.js.map +0 -1
  58. package/dist/ui/parse-stdout.test.js +0 -77
  59. package/dist/ui/parse-stdout.test.js.map +0 -1
  60. 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
+ };