Skip to content
Open
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
8 changes: 8 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,11 @@ jobs:
bash "$f" || failed=1
done
exit $failed

windows-plugin-tests:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Run PowerShell tests
shell: powershell
run: .\tests\test-hooks.ps1
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ This repo is a native Codex plugin marketplace for local/dev and Oz cloud-agent
.github/workflows/test.yml GitHub Actions shell test workflow
plugins/warp/.codex-plugin/plugin.json Warp notification plugin manifest
plugins/warp/hooks/hooks.json Warp notification hook config
plugins/warp/scripts/ Warp notification hook scripts only
plugins/warp/scripts/ Warp notification hook scripts for POSIX shells and Windows PowerShell
plugins/orchestration/.codex-plugin/plugin.json
plugins/orchestration/hooks/hooks.json
plugins/orchestration/scripts/ Oz parent-message listener, drain, and lifecycle scripts
plugins/orchestration/scripts/ Oz parent-message listener, drain, and lifecycle scripts for POSIX shells and Windows PowerShell
plugins/orchestration/skills/ Oz orchestration skills
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 `${PLUGIN_ROOT}/scripts/...`; Windows overrides use Codex's `commandWindows` hook field to run `.ps1` entrypoints.
## Local install
```sh
codex plugin marketplace add .
Expand All @@ -33,10 +33,11 @@ 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.
## Requirements
- Codex CLI with plugin support
- `jq`
- `jq` for POSIX shell hooks
- Windows PowerShell for Windows hook overrides
## License
MIT — see [LICENSE](LICENSE).
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
15 changes: 10 additions & 5 deletions plugins/orchestration/hooks/hooks.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"hooks": [
{
"type": "command",
"command": "${PLUGIN_ROOT}/scripts/on-session-start.sh"
"command": "${PLUGIN_ROOT}/scripts/on-session-start.sh",
"commandWindows": "powershell.exe -NoProfile -ExecutionPolicy Bypass -File \"${PLUGIN_ROOT}/scripts/on-session-start.ps1\""
}
]
}
Expand All @@ -15,7 +16,8 @@
"hooks": [
{
"type": "command",
"command": "${PLUGIN_ROOT}/scripts/drain-mailbox.sh UserPromptSubmit"
"command": "${PLUGIN_ROOT}/scripts/drain-mailbox.sh UserPromptSubmit",
"commandWindows": "powershell.exe -NoProfile -ExecutionPolicy Bypass -File \"${PLUGIN_ROOT}/scripts/drain-mailbox.ps1\" UserPromptSubmit"
}
]
}
Expand All @@ -26,7 +28,8 @@
"hooks": [
{
"type": "command",
"command": "${PLUGIN_ROOT}/scripts/drain-mailbox.sh PostToolUse"
"command": "${PLUGIN_ROOT}/scripts/drain-mailbox.sh PostToolUse",
"commandWindows": "powershell.exe -NoProfile -ExecutionPolicy Bypass -File \"${PLUGIN_ROOT}/scripts/drain-mailbox.ps1\" PostToolUse"
}
]
}
Expand All @@ -36,7 +39,8 @@
"hooks": [
{
"type": "command",
"command": "${PLUGIN_ROOT}/scripts/on-stop.sh"
"command": "${PLUGIN_ROOT}/scripts/on-stop.sh",
"commandWindows": "powershell.exe -NoProfile -ExecutionPolicy Bypass -File \"${PLUGIN_ROOT}/scripts/on-stop.ps1\""
}
]
}
Expand All @@ -46,7 +50,8 @@
"hooks": [
{
"type": "command",
"command": "${PLUGIN_ROOT}/scripts/on-session-end.sh"
"command": "${PLUGIN_ROOT}/scripts/on-session-end.sh",
"commandWindows": "powershell.exe -NoProfile -ExecutionPolicy Bypass -File \"${PLUGIN_ROOT}/scripts/on-session-end.ps1\""
}
]
}
Expand Down
34 changes: 34 additions & 0 deletions plugins/orchestration/scripts/drain-mailbox.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
param(
[Parameter(Mandatory = $true)]
[string]$HookEvent
)

. "$PSScriptRoot\oz-parent-common.ps1"

$state = Import-HookState
if ($null -eq $state) {
exit 0
}

if (Test-ListenerLifecycleManagedExternally) {
$output = Write-DriverHookAdditionalContext $HookEvent $state.StateDir
if ($null -ne $output) {
$output
Confirm-DriverHookOutput $state.StateDir
}
exit 0
}

$maxContextChars = 6000
$parsedMaxContextChars = 0
if ([int]::TryParse($env:OZ_PARENT_MAX_CONTEXT_CHARS, [ref]$parsedMaxContextChars) -and $parsedMaxContextChars -gt 0) {
$maxContextChars = $parsedMaxContextChars
}

$parentContext = New-ParentContextFromStagedMessages $state.StateDir $maxContextChars
if ($null -eq $parentContext) {
exit 0
}

Confirm-AndRemoveStagedMessages $state.StateDir $parentContext.SurfacedIds
Write-HookAdditionalContext $HookEvent $parentContext.Context
11 changes: 11 additions & 0 deletions plugins/orchestration/scripts/on-session-end.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
. "$PSScriptRoot\oz-parent-common.ps1"

$state = New-HookState
if ($null -eq $state) {
exit 0
}
if (Test-ListenerLifecycleManagedExternally) {
exit 0
}

Clear-HookState $state.StateDir
12 changes: 12 additions & 0 deletions plugins/orchestration/scripts/on-session-start.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
. "$PSScriptRoot\oz-parent-common.ps1"

$state = New-HookState
if ($null -eq $state) {
exit 0
}
if (Test-ListenerLifecycleManagedExternally) {
exit 0
}

New-StateDir $state.StateDir
Start-ListenerIfNeeded (Join-Path $PSScriptRoot "oz-parent-listener.ps1") $state.StateDir
11 changes: 11 additions & 0 deletions plugins/orchestration/scripts/on-stop.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
. "$PSScriptRoot\oz-parent-common.ps1"

$state = Import-HookState
if ($null -eq $state) {
exit 0
}

$output = Write-StopBlockIfPending $state.StateDir
if ($null -ne $output) {
$output
}
Loading