Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .agents/plugins/marketplace.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"installation": "AVAILABLE",
"authentication": "ON_INSTALL"
},
"version": "0.4.0",
"version": "0.4.1",
"category": "productivity",
"tags": ["notifications", "terminal", "warp"]
},
Expand All @@ -26,7 +26,7 @@
"installation": "AVAILABLE",
"authentication": "ON_INSTALL"
},
"version": "0.4.0",
"version": "0.4.1",
"category": "productivity",
"tags": ["terminal", "warp", "oz"]
}
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ tests/test-hooks.sh Shell tests
## Plugins
- `warp`: `SessionStart`, `Stop`, `PermissionRequest`, `UserPromptSubmit`, `PostToolUse` notifications for Warp.
- `orchestration`: `SessionStart`, `UserPromptSubmit`, `PostToolUse`, `Stop`, `SessionEnd` parent-message delivery for Codex child runs, plus Oz skills.
Hook commands use `${PLUGIN_ROOT}/scripts/...`.
Hook commands use `${CLAUDE_PLUGIN_ROOT}/scripts/...`, the plugin root provided by
Codex.
## Local install
```sh
codex plugin marketplace add .
Expand All @@ -33,7 +34,7 @@ This uses a fake `oz` CLI and a temp `CODEX_HOME`.
It validates parent-message staging/drain/blocking and plugin manifests.
## Versioning
`plugins/warp/scripts/on-session-start.sh` emits `PLUGIN_VERSION`.
Current plugin version: `0.4.0`.
Current plugin version: `0.4.1`.
Keep it in sync with Warp's Codex plugin manager minimum version.
## Skills

Expand Down
2 changes: 1 addition & 1 deletion plugins/orchestration/.codex-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "orchestration",
"description": "Warp integration for Codex in Oz cloud agent environments, including parent-message delivery hooks and skills",
"version": "0.4.0",
"version": "0.4.1",
"author": {
"name": "Warp",
"url": "https://warp.dev"
Expand Down
10 changes: 5 additions & 5 deletions plugins/orchestration/hooks/hooks.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"hooks": [
{
"type": "command",
"command": "${PLUGIN_ROOT}/scripts/on-session-start.sh"
"command": "\"${CLAUDE_PLUGIN_ROOT}/scripts/on-session-start.sh\""
}
]
}
Expand All @@ -15,7 +15,7 @@
"hooks": [
{
"type": "command",
"command": "${PLUGIN_ROOT}/scripts/drain-mailbox.sh UserPromptSubmit"
"command": "\"${CLAUDE_PLUGIN_ROOT}/scripts/drain-mailbox.sh\" UserPromptSubmit"
}
]
}
Expand All @@ -26,7 +26,7 @@
"hooks": [
{
"type": "command",
"command": "${PLUGIN_ROOT}/scripts/drain-mailbox.sh PostToolUse"
"command": "\"${CLAUDE_PLUGIN_ROOT}/scripts/drain-mailbox.sh\" PostToolUse"
}
]
}
Expand All @@ -36,7 +36,7 @@
"hooks": [
{
"type": "command",
"command": "${PLUGIN_ROOT}/scripts/on-stop.sh"
"command": "\"${CLAUDE_PLUGIN_ROOT}/scripts/on-stop.sh\""
}
]
}
Expand All @@ -46,7 +46,7 @@
"hooks": [
{
"type": "command",
"command": "${PLUGIN_ROOT}/scripts/on-session-end.sh"
"command": "\"${CLAUDE_PLUGIN_ROOT}/scripts/on-session-end.sh\""
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/warp/.codex-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "warp",
"description": "Warp terminal integration for Codex - native notifications, and more to come",
"version": "0.4.0",
"version": "0.4.1",
"author": {
"name": "Warp",
"url": "https://warp.dev"
Expand Down
10 changes: 5 additions & 5 deletions plugins/warp/hooks/hooks.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"hooks": [
{
"type": "command",
"command": "${PLUGIN_ROOT}/scripts/on-session-start.sh"
"command": "\"${CLAUDE_PLUGIN_ROOT}/scripts/on-session-start.sh\""
}
]
}
Expand All @@ -15,7 +15,7 @@
"hooks": [
{
"type": "command",
"command": "${PLUGIN_ROOT}/scripts/on-stop.sh"
"command": "\"${CLAUDE_PLUGIN_ROOT}/scripts/on-stop.sh\""
}
]
}
Expand All @@ -25,7 +25,7 @@
"hooks": [
{
"type": "command",
"command": "${PLUGIN_ROOT}/scripts/on-permission-request.sh"
"command": "\"${CLAUDE_PLUGIN_ROOT}/scripts/on-permission-request.sh\""
}
]
}
Expand All @@ -35,7 +35,7 @@
"hooks": [
{
"type": "command",
"command": "${PLUGIN_ROOT}/scripts/on-prompt-submit.sh"
"command": "\"${CLAUDE_PLUGIN_ROOT}/scripts/on-prompt-submit.sh\""
}
]
}
Expand All @@ -45,7 +45,7 @@
"hooks": [
{
"type": "command",
"command": "${PLUGIN_ROOT}/scripts/on-post-tool-use.sh"
"command": "\"${CLAUDE_PLUGIN_ROOT}/scripts/on-post-tool-use.sh\""
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/warp/scripts/on-session-start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
set -euo pipefail

# Bump on every release; keep in sync with Warp's Codex plugin manager.
PLUGIN_VERSION="0.4.0"
PLUGIN_VERSION="0.4.1"

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$SCRIPT_DIR/should-use-structured.sh"
Expand Down
50 changes: 45 additions & 5 deletions tests/test-hooks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,51 @@ assert_file_exists "github workflow exists" "$REPO_ROOT/.github/workflows/test.y
assert_json_field "marketplace name" "$(cat "$REPO_ROOT/.agents/plugins/marketplace.json")" ".name" "codex-warp"
assert_json_field "warp plugin name" "$(cat "$REPO_ROOT/plugins/warp/.codex-plugin/plugin.json")" ".name" "warp"
assert_json_field "oz plugin name" "$(cat "$REPO_ROOT/plugins/orchestration/.codex-plugin/plugin.json")" ".name" "orchestration"
assert_contains "warp hooks use PLUGIN_ROOT" "$(cat "$REPO_ROOT/plugins/warp/hooks/hooks.json")" '${PLUGIN_ROOT}/scripts/on-session-start.sh'
assert_contains "warp hooks include prompt submit" "$(cat "$REPO_ROOT/plugins/warp/hooks/hooks.json")" '${PLUGIN_ROOT}/scripts/on-prompt-submit.sh'
assert_contains "warp hooks include post tool use" "$(cat "$REPO_ROOT/plugins/warp/hooks/hooks.json")" '${PLUGIN_ROOT}/scripts/on-post-tool-use.sh'
assert_contains "oz hooks use PLUGIN_ROOT" "$(cat "$REPO_ROOT/plugins/orchestration/hooks/hooks.json")" '${PLUGIN_ROOT}/scripts/drain-mailbox.sh UserPromptSubmit'
assert_contains "oz hooks include session end" "$(cat "$REPO_ROOT/plugins/orchestration/hooks/hooks.json")" '${PLUGIN_ROOT}/scripts/on-session-end.sh'
assert_contains "warp hooks use CLAUDE_PLUGIN_ROOT" "$(cat "$REPO_ROOT/plugins/warp/hooks/hooks.json")" '${CLAUDE_PLUGIN_ROOT}/scripts/on-session-start.sh'
assert_contains "warp hooks include prompt submit" "$(cat "$REPO_ROOT/plugins/warp/hooks/hooks.json")" '${CLAUDE_PLUGIN_ROOT}/scripts/on-prompt-submit.sh'
assert_contains "warp hooks include post tool use" "$(cat "$REPO_ROOT/plugins/warp/hooks/hooks.json")" '${CLAUDE_PLUGIN_ROOT}/scripts/on-post-tool-use.sh'
assert_contains "oz hooks use CLAUDE_PLUGIN_ROOT" "$(cat "$REPO_ROOT/plugins/orchestration/hooks/hooks.json")" '${CLAUDE_PLUGIN_ROOT}/scripts/drain-mailbox.sh'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: this assertion dropped the trailing UserPromptSubmit argument that the old "oz hooks use PLUGIN_ROOT" check verified, so it no longer confirms the argument survived the switch to a quoted path. Consider asserting the full string, e.g. '\"${CLAUDE_PLUGIN_ROOT}/scripts/drain-mailbox.sh\" UserPromptSubmit'.

assert_contains "oz hooks include session end" "$(cat "$REPO_ROOT/plugins/orchestration/hooks/hooks.json")" '${CLAUDE_PLUGIN_ROOT}/scripts/on-session-end.sh'

echo ""
echo "=== Codex plugin root contract ==="
unset OZ_PARENT_RUN_ID
WARP_PLUGIN_ROOT="$TEST_TMP/warp plugin with spaces"
ORCHESTRATION_PLUGIN_ROOT="$TEST_TMP/orchestration plugin with spaces"
ln -s "$REPO_ROOT/plugins/warp" "$WARP_PLUGIN_ROOT"
ln -s "$REPO_ROOT/plugins/orchestration" "$ORCHESTRATION_PLUGIN_ROOT"
WARP_HOOKS="$WARP_PLUGIN_ROOT/hooks/hooks.json"
ORCHESTRATION_HOOKS="$ORCHESTRATION_PLUGIN_ROOT/hooks/hooks.json"
SESSION_START_COMMAND=$(jq -r '.hooks.SessionStart[0].hooks[0].command' "$WARP_HOOKS")
STOP_COMMAND=$(jq -r '.hooks.Stop[0].hooks[0].command' "$WARP_HOOKS")
ORCHESTRATION_START_COMMAND=$(jq -r '.hooks.SessionStart[0].hooks[0].command' "$ORCHESTRATION_HOOKS")
ORCHESTRATION_STOP_COMMAND=$(jq -r '.hooks.Stop[0].hooks[0].command' "$ORCHESTRATION_HOOKS")

OUTPUT=$(printf '%s' "$HOOK_INPUT" | env -u PLUGIN_ROOT \
-u WARP_CLI_AGENT_PROTOCOL_VERSION -u WARP_CLIENT_VERSION \
CLAUDE_PLUGIN_ROOT="$WARP_PLUGIN_ROOT" sh -c "$SESSION_START_COMMAND")
STATUS=$?
assert_eq "session start resolves CLAUDE_PLUGIN_ROOT" "0" "$STATUS"
assert_eq "session start stays silent outside Warp" "" "$OUTPUT"

OUTPUT=$(printf '%s' "$HOOK_INPUT" | env -u PLUGIN_ROOT \
-u WARP_CLI_AGENT_PROTOCOL_VERSION -u WARP_CLIENT_VERSION \
CLAUDE_PLUGIN_ROOT="$WARP_PLUGIN_ROOT" sh -c "$STOP_COMMAND")
STATUS=$?
assert_eq "stop resolves CLAUDE_PLUGIN_ROOT" "0" "$STATUS"
assert_eq "stop stays silent outside Warp" "" "$OUTPUT"

OUTPUT=$(printf '%s' "$HOOK_INPUT" | env -u PLUGIN_ROOT -u OZ_PARENT_RUN_ID \
CLAUDE_PLUGIN_ROOT="$ORCHESTRATION_PLUGIN_ROOT" sh -c "$ORCHESTRATION_START_COMMAND")
STATUS=$?
assert_eq "orchestration start resolves CLAUDE_PLUGIN_ROOT" "0" "$STATUS"
assert_eq "orchestration start stays silent outside Oz" "" "$OUTPUT"

OUTPUT=$(printf '%s' "$HOOK_INPUT" | env -u PLUGIN_ROOT -u OZ_PARENT_RUN_ID \
CLAUDE_PLUGIN_ROOT="$ORCHESTRATION_PLUGIN_ROOT" sh -c "$ORCHESTRATION_STOP_COMMAND")
STATUS=$?
assert_eq "orchestration stop resolves CLAUDE_PLUGIN_ROOT" "0" "$STATUS"
assert_eq "orchestration stop stays silent outside Oz" "" "$OUTPUT"


echo ""
Expand Down