@unblocklabs/unblock-codex-prompt 0.5.0 → 0.5.1

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/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Unblock Codex Prompt
2
2
 
3
3
  A small, explicit prompt-management bridge for dedicated OpenClaw Mac agents.
4
- **Version 0.5.0.** The bridge supports OpenClaw/Codex 2026.10.5 and newer
4
+ **Version 0.5.1.** The bridge supports OpenClaw/Codex 2026.10.5 and newer
5
5
  stable releases with a reviewed context-assembly layout, and agents running
6
6
  through the Claude CLI backend, whose whole system prompt it replaces through
7
7
  OpenClaw's public `before_prompt_build` hook without patching OpenClaw core.
@@ -138,7 +138,9 @@ appends its model identity line. The prompt is, in order, with nothing else adde
138
138
 
139
139
  1. the Claude fleet policy (`runtime=claude`), never the Codex policy;
140
140
  2. the memory reference (`## Memory reference`);
141
- 3. each of `AGENTS.md`, `SOUL.md`, `IDENTITY.md`, `USER.md` and `BOOTSTRAP.md` that
141
+ 3. local media context naming `<run-workspace>/media` as a generated-media staging
142
+ directory, rather than an arbitrary `/tmp` directory that media loaders may reject;
143
+ 4. each of `AGENTS.md`, `SOUL.md`, `IDENTITY.md`, `USER.md` and `BOOTSTRAP.md` that
142
144
  exists in the run's workspace and is not empty, under a `## <absolute path>` header.
143
145
  That is OpenClaw's own workspace bootstrap set without `MEMORY.md`, whose body is
144
146
  never included. As in OpenClaw, `BOOTSTRAP.md` goes only to primary user or manual
@@ -160,6 +162,29 @@ error, without prompt text, and that run keeps OpenClaw's own prompt. Other agen
160
162
  other providers, and paused or never-enrolled agents are left alone. When the hook
161
163
  returns nothing, OpenClaw's prompt applies unchanged.
162
164
 
165
+ **Attachments and local media.**
166
+
167
+ The prompt hook does not receive or change channel attachment settings. For iMessage
168
+ nodes that should receive attachments, explicitly enable forwarding:
169
+
170
+ ```sh
171
+ openclaw config set channels.imessage.includeAttachments true --strict-json
172
+ ```
173
+
174
+ For a named iMessage account, set the value under
175
+ `channels.imessage.accounts.<accountId>.includeAttachments` instead. OpenClaw defaults
176
+ this setting to false: without it, an incoming image can be absent from the agent's
177
+ turn even when the file exists in Messages. Restart the Gateway to re-subscribe the
178
+ iMessage watcher, then verify with an incoming image in a permitted conversation.
179
+ The plugin never changes channel settings during installation, sync or refresh.
180
+
181
+ Claude's local media context is rebuilt from the run's workspace every turn, including
182
+ subagent sessions. It names `<run-workspace>/media` for generated files that OpenClaw
183
+ must view or send; the directory is not created by the prompt hook. Paths returned by
184
+ OpenClaw's media tools remain usable. This does not widen media roots or change file
185
+ permissions. A `path-not-allowed` media error is different from macOS Full Disk Access:
186
+ use a supported staging path rather than granting arbitrary `/tmp` access.
187
+
163
188
  **Skills.** Claude gets the session skills through OpenClaw's native `openclaw-skills`
164
189
  Claude plugin mount, which is not part of the system prompt and is kept.
165
190
 
@@ -318,7 +343,7 @@ Claude CLI process. It uses a temporary state directory and changes nothing inst
318
343
  npm ci
319
344
  npm run preflight
320
345
  npm pack
321
- openclaw plugins install ./unblocklabs-unblock-codex-prompt-0.5.0.tgz --force --accept-capabilities
346
+ openclaw plugins install ./unblocklabs-unblock-codex-prompt-0.5.1.tgz --force --accept-capabilities
322
347
  ```
323
348
 
324
349
  Include the plugin in `plugins.allow` if applicable, then configure:
@@ -599,7 +624,7 @@ inline in the patch, so it does not depend on the plugin runtime).
599
624
 
600
625
  ```sh
601
626
  npm run preflight
602
- npm run release:check -- v0.5.0
627
+ npm run release:check -- v0.5.1
603
628
  ```
604
629
 
605
630
  Tests cover compilation, explicit refresh, native/private-body exclusion,
@@ -609,7 +634,7 @@ proof and limits.
609
634
 
610
635
  Install with
611
636
  the packed archive above for an unreleased candidate. After publication, use
612
- `openclaw plugins install npm:@unblocklabs/unblock-codex-prompt@0.5.0 --accept-capabilities`.
637
+ `openclaw plugins install npm:@unblocklabs/unblock-codex-prompt@0.5.1 --accept-capabilities`.
613
638
  The existing [GitHub Release workflow](RELEASING.md) publishes npm only when a
614
639
  GitHub Release is published. Normal pushes do not release the package.
615
640
 
@@ -24,8 +24,8 @@ export type SkippedFile = {
24
24
  };
25
25
  /**
26
26
  * The complete Claude CLI system prompt for the managed agent: the Claude policy, the memory
27
- * reference, then each present, non-empty workspace file under its absolute path. Files are read
28
- * on every call, so an edit applies to the next turn. Nothing else is added.
27
+ * reference, local media context, then each present, non-empty workspace file under its absolute
28
+ * path. Files and the run's workspace are resolved on every call.
29
29
  */
30
30
  export declare function buildClaudeSystemPrompt(managed: ClaudeManagedContext, workspaceDir: string, maxChars: number, options?: {
31
31
  totalMaxChars?: number;
@@ -97,8 +97,8 @@ async function readWorkspaceFile(root, path, skipped) {
97
97
  }
98
98
  /**
99
99
  * The complete Claude CLI system prompt for the managed agent: the Claude policy, the memory
100
- * reference, then each present, non-empty workspace file under its absolute path. Files are read
101
- * on every call, so an edit applies to the next turn. Nothing else is added.
100
+ * reference, local media context, then each present, non-empty workspace file under its absolute
101
+ * path. Files and the run's workspace are resolved on every call.
102
102
  */
103
103
  export async function buildClaudeSystemPrompt(managed, workspaceDir, maxChars, options = {}) {
104
104
  let remaining = options.totalMaxChars ?? DEFAULT_BOOTSTRAP_TOTAL_MAX_CHARS;
@@ -113,7 +113,10 @@ export async function buildClaudeSystemPrompt(managed, workspaceDir, maxChars, o
113
113
  throw error;
114
114
  root = null;
115
115
  }
116
- const sections = [managed.policy, managed.agentContext];
116
+ // OpenClaw's agent-scoped media roots include the run's workspace. Keep a concrete staging
117
+ // path when replacing the host prompt; an arbitrary task directory under /tmp is not a media root.
118
+ const mediaContext = `## Local media context\nGenerated-media staging directory: ${join(workspace, "media")}\nFor generated images or files that OpenClaw must view or send, use this directory or paths returned by OpenClaw media tools. Arbitrary /tmp directories are not automatically allowed by media loaders. These path hints do not grant filesystem access or bypass media checks.`;
119
+ const sections = [managed.policy, managed.agentContext, mediaContext];
117
120
  if (root !== null) {
118
121
  for (const name of CLAUDE_WORKSPACE_FILES) {
119
122
  if (name === "BOOTSTRAP.md" && options.includeBootstrap === false)
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "unblock-codex-prompt",
3
3
  "name": "Unblock Codex Prompt",
4
- "version": "0.5.0",
4
+ "version": "0.5.1",
5
5
  "description": "Maintain an agent-scoped fleet prompt for Codex (model_instructions_file) and Claude CLI (before_prompt_build hook).",
6
6
  "activation": { "onStartup": true },
7
7
  "configSchema": {
@@ -20,7 +20,7 @@
20
20
  "uiHints": {
21
21
  "agentId": { "label": "OpenClaw agent ID", "help": "Only this agent's prompt is managed (on Claude CLI, its claude-cli runs, subagent sessions included). Defaults to main." },
22
22
  "agentName": { "label": "Legacy agent name (unused)", "help": "Accepted for existing configs only. Identity comes from agent documents; shared prompt text comes only from promptUrl." },
23
- "frozenContext": { "label": "Managed prompt bridge", "help": "Required: true. Codex: replaces base instructions and OpenClaw generic policy on reviewed OpenClaw/Codex >=2026.10.5 layouts. Claude CLI: replaces OpenClaw's entire system prompt through the public before_prompt_build hook (policy, memory reference and the workspace AGENTS, SOUL, IDENTITY, USER, TOOLS, HEARTBEAT and BOOTSTRAP files, read every turn); no OpenClaw core patch. Needs hooks.allowConversationAccess: true and allowPromptInjection not false. Runtimes come from the agent's configured model policy at explicit sync. SOUL, IDENTITY, USER and AGENTS stay live." },
23
+ "frozenContext": { "label": "Managed prompt bridge", "help": "Required: true. Codex: replaces base instructions and OpenClaw generic policy on reviewed OpenClaw/Codex >=2026.10.5 layouts. Claude CLI: replaces OpenClaw's entire system prompt through the public before_prompt_build hook (policy, memory reference, local media context and the workspace AGENTS, SOUL, IDENTITY, USER and BOOTSTRAP files, read every turn); no OpenClaw core patch. Needs hooks.allowConversationAccess: true and allowPromptInjection not false. Runtimes come from the agent's configured model policy at explicit sync. SOUL, IDENTITY, USER and AGENTS stay live." },
24
24
  "promptUrl": { "label": "Fleet prompt endpoint", "help": "Required public HTTPS plain-text endpoint with X-Prompt-Revision SHA-256. The only shared-policy source. After initial sync, refreshed daily and when overdue on startup without refreshing agent context. No bundled prompt fallback." },
25
25
  "suppressExplicitDelegationPrompt": { "label": "Compact managed Codex instructions", "help": "Manage a model_catalog_json override: suppress explicit-only delegation and Default-mode prose, trim role introductions and compact full-access/never-approval text. Runtime mechanics and permissions are unchanged. Refreshed daily from the configured provider. Requires frozenContext and an available provider env_key. Generated-file edits are replaced on refresh." },
26
26
  "disabledCodexSkills": { "label": "Codex skills to remove", "help": "Plugin names (all of their skills) or exact skill names to disable in Codex's native skills list. Defaults to ChatGPT Pages and Pets. Applied through a managed [[skills.config]] block at startup, sync and daily refresh; other skills are untouched. Set [] to stop managing Codex skills." }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unblocklabs/unblock-codex-prompt",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "description": "Manage a shared fleet prompt for an OpenClaw agent on Codex and Claude CLI.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",