oh-my-codex 0.8.0 → 0.8.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/README.de.md +7 -2
- package/README.es.md +7 -2
- package/README.fr.md +7 -2
- package/README.it.md +7 -2
- package/README.ja.md +7 -2
- package/README.ko.md +7 -2
- package/README.md +61 -11
- package/README.pt.md +7 -2
- package/README.ru.md +7 -2
- package/README.tr.md +7 -2
- package/README.vi.md +7 -2
- package/README.zh-TW.md +366 -0
- package/README.zh.md +7 -2
- package/dist/cli/__tests__/index.test.js +70 -4
- package/dist/cli/__tests__/index.test.js.map +1 -1
- package/dist/cli/__tests__/setup-skills-overwrite.test.js +100 -1
- package/dist/cli/__tests__/setup-skills-overwrite.test.js.map +1 -1
- package/dist/cli/__tests__/team.test.js +219 -1
- package/dist/cli/__tests__/team.test.js.map +1 -1
- package/dist/cli/catalog-contract.d.ts.map +1 -1
- package/dist/cli/catalog-contract.js +8 -2
- package/dist/cli/catalog-contract.js.map +1 -1
- package/dist/cli/index.d.ts +7 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +58 -12
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/setup.d.ts.map +1 -1
- package/dist/cli/setup.js +50 -17
- package/dist/cli/setup.js.map +1 -1
- package/dist/cli/team.d.ts.map +1 -1
- package/dist/cli/team.js +257 -0
- package/dist/cli/team.js.map +1 -1
- package/dist/config/__tests__/models.test.js +11 -11
- package/dist/config/__tests__/models.test.js.map +1 -1
- package/dist/config/models.d.ts +4 -3
- package/dist/config/models.d.ts.map +1 -1
- package/dist/config/models.js +6 -5
- package/dist/config/models.js.map +1 -1
- package/dist/hooks/__tests__/keyword-detector.test.js +46 -3
- package/dist/hooks/__tests__/keyword-detector.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-all-workers-idle.test.js +23 -7
- package/dist/hooks/__tests__/notify-hook-all-workers-idle.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-team-dispatch.test.js +176 -1
- package/dist/hooks/__tests__/notify-hook-team-dispatch.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-team-leader-nudge.test.js +61 -1
- package/dist/hooks/__tests__/notify-hook-team-leader-nudge.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-worker-idle.test.js +17 -7
- package/dist/hooks/__tests__/notify-hook-worker-idle.test.js.map +1 -1
- package/dist/hooks/__tests__/openclaw-setup-contract.test.js +26 -16
- package/dist/hooks/__tests__/openclaw-setup-contract.test.js.map +1 -1
- package/dist/hooks/keyword-detector.d.ts +2 -1
- package/dist/hooks/keyword-detector.d.ts.map +1 -1
- package/dist/hooks/keyword-detector.js +41 -4
- package/dist/hooks/keyword-detector.js.map +1 -1
- package/dist/hooks/keyword-registry.d.ts.map +1 -1
- package/dist/hooks/keyword-registry.js +5 -0
- package/dist/hooks/keyword-registry.js.map +1 -1
- package/dist/mcp/__tests__/path-traversal.test.js +9 -227
- package/dist/mcp/__tests__/path-traversal.test.js.map +1 -1
- package/dist/mcp/__tests__/state-server-schema.test.js +16 -20
- package/dist/mcp/__tests__/state-server-schema.test.js.map +1 -1
- package/dist/mcp/__tests__/state-server-team-tools.test.js +30 -487
- package/dist/mcp/__tests__/state-server-team-tools.test.js.map +1 -1
- package/dist/mcp/state-server.d.ts +179 -0
- package/dist/mcp/state-server.d.ts.map +1 -1
- package/dist/mcp/state-server.js +217 -1111
- package/dist/mcp/state-server.js.map +1 -1
- package/dist/mcp/team-server.d.ts.map +1 -1
- package/dist/mcp/team-server.js +28 -7
- package/dist/mcp/team-server.js.map +1 -1
- package/dist/notifications/__tests__/dispatch-cooldown.test.d.ts +5 -0
- package/dist/notifications/__tests__/dispatch-cooldown.test.d.ts.map +1 -0
- package/dist/notifications/__tests__/dispatch-cooldown.test.js +100 -0
- package/dist/notifications/__tests__/dispatch-cooldown.test.js.map +1 -0
- package/dist/notifications/__tests__/temp-mode.test.d.ts +2 -0
- package/dist/notifications/__tests__/temp-mode.test.d.ts.map +1 -0
- package/dist/notifications/__tests__/temp-mode.test.js +172 -0
- package/dist/notifications/__tests__/temp-mode.test.js.map +1 -0
- package/dist/notifications/config.d.ts.map +1 -1
- package/dist/notifications/config.js +59 -6
- package/dist/notifications/config.js.map +1 -1
- package/dist/notifications/dispatch-cooldown.d.ts +36 -0
- package/dist/notifications/dispatch-cooldown.d.ts.map +1 -0
- package/dist/notifications/dispatch-cooldown.js +109 -0
- package/dist/notifications/dispatch-cooldown.js.map +1 -0
- package/dist/notifications/index.d.ts +5 -0
- package/dist/notifications/index.d.ts.map +1 -1
- package/dist/notifications/index.js +39 -8
- package/dist/notifications/index.js.map +1 -1
- package/dist/notifications/temp-contract.d.ts +22 -0
- package/dist/notifications/temp-contract.d.ts.map +1 -0
- package/dist/notifications/temp-contract.js +147 -0
- package/dist/notifications/temp-contract.js.map +1 -0
- package/dist/notifications/types.d.ts +18 -0
- package/dist/notifications/types.d.ts.map +1 -1
- package/dist/openclaw/__tests__/config.test.js +81 -0
- package/dist/openclaw/__tests__/config.test.js.map +1 -1
- package/dist/openclaw/__tests__/dispatcher.test.js +50 -7
- package/dist/openclaw/__tests__/dispatcher.test.js.map +1 -1
- package/dist/openclaw/config.d.ts +4 -0
- package/dist/openclaw/config.d.ts.map +1 -1
- package/dist/openclaw/config.js +110 -16
- package/dist/openclaw/config.js.map +1 -1
- package/dist/openclaw/dispatcher.d.ts +10 -4
- package/dist/openclaw/dispatcher.d.ts.map +1 -1
- package/dist/openclaw/dispatcher.js +40 -10
- package/dist/openclaw/dispatcher.js.map +1 -1
- package/dist/openclaw/types.d.ts +5 -1
- package/dist/openclaw/types.d.ts.map +1 -1
- package/dist/team/__tests__/api-interop.test.d.ts +2 -0
- package/dist/team/__tests__/api-interop.test.d.ts.map +1 -0
- package/dist/team/__tests__/api-interop.test.js +1052 -0
- package/dist/team/__tests__/api-interop.test.js.map +1 -0
- package/dist/team/__tests__/mcp-comm.test.js +30 -0
- package/dist/team/__tests__/mcp-comm.test.js.map +1 -1
- package/dist/team/__tests__/runtime-cli.test.js +6 -0
- package/dist/team/__tests__/runtime-cli.test.js.map +1 -1
- package/dist/team/__tests__/runtime.test.js +52 -22
- package/dist/team/__tests__/runtime.test.js.map +1 -1
- package/dist/team/__tests__/tmux-claude-workers-demo.test.d.ts +2 -0
- package/dist/team/__tests__/tmux-claude-workers-demo.test.d.ts.map +1 -0
- package/dist/team/__tests__/tmux-claude-workers-demo.test.js +190 -0
- package/dist/team/__tests__/tmux-claude-workers-demo.test.js.map +1 -0
- package/dist/team/__tests__/tmux-session.test.js +45 -2
- package/dist/team/__tests__/tmux-session.test.js.map +1 -1
- package/dist/team/__tests__/worker-bootstrap.test.js +20 -12
- package/dist/team/__tests__/worker-bootstrap.test.js.map +1 -1
- package/dist/team/api-interop.d.ts +19 -0
- package/dist/team/api-interop.d.ts.map +1 -0
- package/dist/team/api-interop.js +578 -0
- package/dist/team/api-interop.js.map +1 -0
- package/dist/team/mcp-comm.d.ts.map +1 -1
- package/dist/team/mcp-comm.js +26 -0
- package/dist/team/mcp-comm.js.map +1 -1
- package/dist/team/runtime-cli.d.ts +3 -0
- package/dist/team/runtime-cli.d.ts.map +1 -1
- package/dist/team/runtime-cli.js +24 -2
- package/dist/team/runtime-cli.js.map +1 -1
- package/dist/team/runtime.d.ts.map +1 -1
- package/dist/team/runtime.js +67 -11
- package/dist/team/runtime.js.map +1 -1
- package/dist/team/scaling.js.map +1 -1
- package/dist/team/state/types.d.ts +1 -1
- package/dist/team/state/types.d.ts.map +1 -1
- package/dist/team/state.d.ts +1 -1
- package/dist/team/state.d.ts.map +1 -1
- package/dist/team/tmux-session.d.ts +1 -1
- package/dist/team/tmux-session.d.ts.map +1 -1
- package/dist/team/tmux-session.js +17 -5
- package/dist/team/tmux-session.js.map +1 -1
- package/dist/team/worker-bootstrap.d.ts.map +1 -1
- package/dist/team/worker-bootstrap.js +48 -19
- package/dist/team/worker-bootstrap.js.map +1 -1
- package/package.json +1 -1
- package/scripts/demo-claude-workers.sh +241 -0
- package/scripts/demo-team-e2e.sh +179 -0
- package/scripts/notify-hook/team-dispatch.js +186 -12
- package/scripts/notify-hook/team-leader-nudge.js +42 -2
- package/scripts/notify-hook/team-worker.js +63 -4
- package/skills/configure-notifications/SKILL.md +193 -185
- package/skills/omx-setup/SKILL.md +1 -1
- package/skills/team/SKILL.md +47 -5
- package/skills/worker/SKILL.md +40 -10
- package/templates/AGENTS.md +7 -3
- package/templates/catalog-manifest.json +26 -3
- package/skills/configure-discord/SKILL.md +0 -256
- package/skills/configure-openclaw/SKILL.md +0 -264
- package/skills/configure-slack/SKILL.md +0 -226
- package/skills/configure-telegram/SKILL.md +0 -232
package/templates/AGENTS.md
CHANGED
|
@@ -149,6 +149,8 @@ Do not ask for confirmation — just read the skill file and follow its instruct
|
|
|
149
149
|
| "ralph", "don't stop", "must complete", "keep going" | `$ralph` | Read `~/.agents/skills/ralph/SKILL.md`, execute persistence loop |
|
|
150
150
|
| "autopilot", "build me", "I want a" | `$autopilot` | Read `~/.agents/skills/autopilot/SKILL.md`, execute autonomous pipeline |
|
|
151
151
|
| "ultrawork", "ulw", "parallel" | `$ultrawork` | Read `~/.agents/skills/ultrawork/SKILL.md`, execute parallel agents |
|
|
152
|
+
| "ultraqa" | `$ultraqa` | Read `~/.agents/skills/ultraqa/SKILL.md`, run QA cycling workflow |
|
|
153
|
+
| "analyze", "investigate" | `$analyze` | Read `~/.agents/skills/analyze/SKILL.md`, run deep analysis |
|
|
152
154
|
| "plan this", "plan the", "let's plan" | `$plan` | Read `~/.agents/skills/plan/SKILL.md`, start planning workflow |
|
|
153
155
|
| "interview", "deep interview", "gather requirements", "interview me", "don't assume", "ouroboros" | `$deep-interview` | Read `~/.agents/skills/deep-interview/SKILL.md`, run Ouroboros-inspired Socratic ambiguity-gated interview workflow |
|
|
154
156
|
| "ralplan", "consensus plan" | `$ralplan` | Read `~/.agents/skills/ralplan/SKILL.md`, start consensus planning with RALPLAN-DR structured deliberation (short by default, `--deliberate` for high-risk) |
|
|
@@ -157,14 +159,16 @@ Do not ask for confirmation — just read the skill file and follow its instruct
|
|
|
157
159
|
| "cancel", "stop", "abort" | `$cancel` | Read `~/.agents/skills/cancel/SKILL.md`, cancel active modes |
|
|
158
160
|
| "tdd", "test first" | `$tdd` | Read `~/.agents/skills/tdd/SKILL.md`, start test-driven workflow |
|
|
159
161
|
| "fix build", "type errors" | `$build-fix` | Read `~/.agents/skills/build-fix/SKILL.md`, fix build errors |
|
|
160
|
-
| "review code" | `$code-review` | Read `~/.agents/skills/code-review/SKILL.md`, run code review |
|
|
162
|
+
| "review code", "code review", "code-review" | `$code-review` | Read `~/.agents/skills/code-review/SKILL.md`, run code review |
|
|
161
163
|
| "security review" | `$security-review` | Read `~/.agents/skills/security-review/SKILL.md`, run security audit |
|
|
162
164
|
| "web-clone", "clone site", "clone website", "copy webpage" | `$web-clone` | Read `~/.agents/skills/web-clone/SKILL.md`, start website cloning pipeline |
|
|
163
165
|
|
|
164
166
|
Detection rules:
|
|
165
167
|
- Keywords are case-insensitive and match anywhere in the user's message
|
|
166
|
-
- If
|
|
167
|
-
-
|
|
168
|
+
- If one or more explicit `$name` tokens are present, execute **all explicit skills left-to-right**.
|
|
169
|
+
- If multiple non-explicit keywords match, use the most specific (longest match).
|
|
170
|
+
- Conflict resolution: explicit `$name` invocation overrides keyword detection.
|
|
171
|
+
- If user explicitly invokes `/prompts:<name>`, treat it as direct prompt execution and do not auto-activate keyword skills unless explicit `$name` tokens are also present.
|
|
168
172
|
- The rest of the user's message (after keyword extraction) becomes the task description
|
|
169
173
|
|
|
170
174
|
Ralph / Ralplan execution gate:
|
|
@@ -234,19 +234,42 @@
|
|
|
234
234
|
"core": false,
|
|
235
235
|
"internalRequired": false
|
|
236
236
|
},
|
|
237
|
+
{
|
|
238
|
+
"name": "configure-notifications",
|
|
239
|
+
"category": "utility",
|
|
240
|
+
"status": "active",
|
|
241
|
+
"core": false,
|
|
242
|
+
"internalRequired": false
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
"name": "configure-discord",
|
|
246
|
+
"category": "utility",
|
|
247
|
+
"status": "merged",
|
|
248
|
+
"canonical": "configure-notifications",
|
|
249
|
+
"core": false,
|
|
250
|
+
"internalRequired": false
|
|
251
|
+
},
|
|
237
252
|
{
|
|
238
253
|
"name": "configure-telegram",
|
|
239
254
|
"category": "utility",
|
|
240
255
|
"status": "merged",
|
|
241
|
-
"canonical": "
|
|
256
|
+
"canonical": "configure-notifications",
|
|
242
257
|
"core": false,
|
|
243
258
|
"internalRequired": false
|
|
244
259
|
},
|
|
245
260
|
{
|
|
246
|
-
"name": "configure-
|
|
261
|
+
"name": "configure-slack",
|
|
262
|
+
"category": "utility",
|
|
263
|
+
"status": "merged",
|
|
264
|
+
"canonical": "configure-notifications",
|
|
265
|
+
"core": false,
|
|
266
|
+
"internalRequired": false
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
"name": "configure-openclaw",
|
|
247
270
|
"category": "utility",
|
|
248
271
|
"status": "merged",
|
|
249
|
-
"canonical": "
|
|
272
|
+
"canonical": "configure-notifications",
|
|
250
273
|
"core": false,
|
|
251
274
|
"internalRequired": false
|
|
252
275
|
},
|
|
@@ -1,256 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: configure-discord
|
|
3
|
-
description: Configure Discord webhook/bot notifications via natural language
|
|
4
|
-
triggers:
|
|
5
|
-
- "configure discord"
|
|
6
|
-
- "setup discord"
|
|
7
|
-
- "discord notifications"
|
|
8
|
-
- "discord webhook"
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
# Configure Discord Notifications
|
|
12
|
-
|
|
13
|
-
Set up Discord notifications so OMX can ping you when sessions end, need input, or complete background tasks.
|
|
14
|
-
|
|
15
|
-
## How This Skill Works
|
|
16
|
-
|
|
17
|
-
This is an interactive, natural-language configuration skill. Walk the user through setup by asking questions with AskUserQuestion. Write the result to `~/.codex/.omx-config.json`.
|
|
18
|
-
|
|
19
|
-
## Step 1: Detect Existing Configuration
|
|
20
|
-
|
|
21
|
-
```bash
|
|
22
|
-
CONFIG_FILE="$HOME/.codex/.omx-config.json"
|
|
23
|
-
|
|
24
|
-
if [ -f "$CONFIG_FILE" ]; then
|
|
25
|
-
# Check for existing discord config
|
|
26
|
-
HAS_DISCORD=$(jq -r '.notifications.discord.enabled // false' "$CONFIG_FILE" 2>/dev/null)
|
|
27
|
-
HAS_DISCORD_BOT=$(jq -r '.notifications["discord-bot"].enabled // false' "$CONFIG_FILE" 2>/dev/null)
|
|
28
|
-
WEBHOOK_URL=$(jq -r '.notifications.discord.webhookUrl // empty' "$CONFIG_FILE" 2>/dev/null)
|
|
29
|
-
MENTION=$(jq -r '.notifications.discord.mention // empty' "$CONFIG_FILE" 2>/dev/null)
|
|
30
|
-
|
|
31
|
-
if [ "$HAS_DISCORD" = "true" ] || [ "$HAS_DISCORD_BOT" = "true" ]; then
|
|
32
|
-
echo "EXISTING_CONFIG=true"
|
|
33
|
-
echo "WEBHOOK_CONFIGURED=$HAS_DISCORD"
|
|
34
|
-
echo "BOT_CONFIGURED=$HAS_DISCORD_BOT"
|
|
35
|
-
[ -n "$WEBHOOK_URL" ] && echo "WEBHOOK_URL=$WEBHOOK_URL"
|
|
36
|
-
[ -n "$MENTION" ] && echo "MENTION=$MENTION"
|
|
37
|
-
else
|
|
38
|
-
echo "EXISTING_CONFIG=false"
|
|
39
|
-
fi
|
|
40
|
-
else
|
|
41
|
-
echo "NO_CONFIG_FILE"
|
|
42
|
-
fi
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
If existing config is found, show the user what's currently configured and ask if they want to update or reconfigure.
|
|
46
|
-
|
|
47
|
-
## Step 2: Choose Discord Method
|
|
48
|
-
|
|
49
|
-
Use AskUserQuestion:
|
|
50
|
-
|
|
51
|
-
**Question:** "How would you like to send Discord notifications?"
|
|
52
|
-
|
|
53
|
-
**Options:**
|
|
54
|
-
1. **Webhook (Recommended)** - Create a webhook in your Discord channel. Simple, no bot needed. Just paste the URL.
|
|
55
|
-
2. **Bot API** - Use a Discord bot token + channel ID. More flexible, requires a bot application.
|
|
56
|
-
|
|
57
|
-
## Step 3A: Webhook Setup
|
|
58
|
-
|
|
59
|
-
If user chose Webhook:
|
|
60
|
-
|
|
61
|
-
Use AskUserQuestion:
|
|
62
|
-
|
|
63
|
-
**Question:** "Paste your Discord webhook URL. To create one: Server Settings > Integrations > Webhooks > New Webhook > Copy URL"
|
|
64
|
-
|
|
65
|
-
The user will type their webhook URL in the "Other" field.
|
|
66
|
-
|
|
67
|
-
**Validate** the URL:
|
|
68
|
-
- Must start with `https://discord.com/api/webhooks/` or `https://discordapp.com/api/webhooks/`
|
|
69
|
-
- If invalid, explain the format and ask again
|
|
70
|
-
|
|
71
|
-
## Step 3B: Bot API Setup
|
|
72
|
-
|
|
73
|
-
If user chose Bot API:
|
|
74
|
-
|
|
75
|
-
Ask two questions:
|
|
76
|
-
|
|
77
|
-
1. **"Paste your Discord bot token"** - From discord.com/developers > Your App > Bot > Token
|
|
78
|
-
2. **"Paste the channel ID"** - Right-click channel > Copy Channel ID (requires Developer Mode)
|
|
79
|
-
|
|
80
|
-
## Step 4: Configure Mention (User Ping)
|
|
81
|
-
|
|
82
|
-
Use AskUserQuestion:
|
|
83
|
-
|
|
84
|
-
**Question:** "Would you like notifications to mention (ping) someone?"
|
|
85
|
-
|
|
86
|
-
**Options:**
|
|
87
|
-
1. **Yes, mention a user** - Tag a specific user by their Discord user ID
|
|
88
|
-
2. **Yes, mention a role** - Tag a role by its role ID
|
|
89
|
-
3. **No mentions** - Just post the message without pinging anyone
|
|
90
|
-
|
|
91
|
-
### If user wants to mention a user:
|
|
92
|
-
|
|
93
|
-
Ask: "What is the Discord user ID to mention? (Right-click user > Copy User ID, requires Developer Mode)"
|
|
94
|
-
|
|
95
|
-
The mention format is: `<@USER_ID>` (e.g., `<@1465264645320474637>`)
|
|
96
|
-
|
|
97
|
-
### If user wants to mention a role:
|
|
98
|
-
|
|
99
|
-
Ask: "What is the Discord role ID to mention? (Server Settings > Roles > right-click role > Copy Role ID)"
|
|
100
|
-
|
|
101
|
-
The mention format is: `<@&ROLE_ID>` (e.g., `<@&123456789>`)
|
|
102
|
-
|
|
103
|
-
## Step 5: Configure Events
|
|
104
|
-
|
|
105
|
-
Use AskUserQuestion with multiSelect:
|
|
106
|
-
|
|
107
|
-
**Question:** "Which events should trigger Discord notifications?"
|
|
108
|
-
|
|
109
|
-
**Options (multiSelect: true):**
|
|
110
|
-
1. **Session end (Recommended)** - When a Codex session finishes
|
|
111
|
-
2. **Input needed** - When Codex is waiting for your response (great for long-running tasks)
|
|
112
|
-
3. **Session start** - When a new session begins
|
|
113
|
-
4. **Session continuing** - When a persistent mode keeps the session alive
|
|
114
|
-
|
|
115
|
-
Default selection: session-end + ask-user-question.
|
|
116
|
-
|
|
117
|
-
## Step 6: Optional Username Override
|
|
118
|
-
|
|
119
|
-
Use AskUserQuestion:
|
|
120
|
-
|
|
121
|
-
**Question:** "Custom bot display name? (Shows as the webhook sender name in Discord)"
|
|
122
|
-
|
|
123
|
-
**Options:**
|
|
124
|
-
1. **OMX (default)** - Display as "OMX"
|
|
125
|
-
2. **Codex CLI** - Display as "Codex CLI"
|
|
126
|
-
3. **Custom** - Enter a custom name
|
|
127
|
-
|
|
128
|
-
## Step 7: Write Configuration
|
|
129
|
-
|
|
130
|
-
Read the existing config, merge the new Discord settings, and write back:
|
|
131
|
-
|
|
132
|
-
```bash
|
|
133
|
-
CONFIG_FILE="$HOME/.codex/.omx-config.json"
|
|
134
|
-
mkdir -p "$(dirname "$CONFIG_FILE")"
|
|
135
|
-
|
|
136
|
-
if [ -f "$CONFIG_FILE" ]; then
|
|
137
|
-
EXISTING=$(cat "$CONFIG_FILE")
|
|
138
|
-
else
|
|
139
|
-
EXISTING='{}'
|
|
140
|
-
fi
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
### For Webhook method:
|
|
144
|
-
|
|
145
|
-
Build the notifications object with the collected values and merge into `.omx-config.json` using jq:
|
|
146
|
-
|
|
147
|
-
```bash
|
|
148
|
-
# WEBHOOK_URL, MENTION, USERNAME are collected from user
|
|
149
|
-
# EVENTS is the list of enabled events
|
|
150
|
-
|
|
151
|
-
echo "$EXISTING" | jq \
|
|
152
|
-
--arg url "$WEBHOOK_URL" \
|
|
153
|
-
--arg mention "$MENTION" \
|
|
154
|
-
--arg username "$USERNAME" \
|
|
155
|
-
'.notifications = (.notifications // {enabled: true}) |
|
|
156
|
-
.notifications.enabled = true |
|
|
157
|
-
.notifications.discord = {
|
|
158
|
-
enabled: true,
|
|
159
|
-
webhookUrl: $url,
|
|
160
|
-
mention: (if $mention == "" then null else $mention end),
|
|
161
|
-
username: (if $username == "" then null else $username end)
|
|
162
|
-
}' > "$CONFIG_FILE"
|
|
163
|
-
```
|
|
164
|
-
|
|
165
|
-
### For Bot API method:
|
|
166
|
-
|
|
167
|
-
```bash
|
|
168
|
-
echo "$EXISTING" | jq \
|
|
169
|
-
--arg token "$BOT_TOKEN" \
|
|
170
|
-
--arg channel "$CHANNEL_ID" \
|
|
171
|
-
--arg mention "$MENTION" \
|
|
172
|
-
'.notifications = (.notifications // {enabled: true}) |
|
|
173
|
-
.notifications.enabled = true |
|
|
174
|
-
.notifications["discord-bot"] = {
|
|
175
|
-
enabled: true,
|
|
176
|
-
botToken: $token,
|
|
177
|
-
channelId: $channel,
|
|
178
|
-
mention: (if $mention == "" then null else $mention end)
|
|
179
|
-
}' > "$CONFIG_FILE"
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
### Add event-specific config if user didn't select all events:
|
|
183
|
-
|
|
184
|
-
For each event NOT selected, disable it:
|
|
185
|
-
|
|
186
|
-
```bash
|
|
187
|
-
# Example: disable session-start if not selected
|
|
188
|
-
echo "$(cat "$CONFIG_FILE")" | jq \
|
|
189
|
-
'.notifications.events = (.notifications.events // {}) |
|
|
190
|
-
.notifications.events["session-start"] = {enabled: false}' > "$CONFIG_FILE"
|
|
191
|
-
```
|
|
192
|
-
|
|
193
|
-
## Step 8: Test the Configuration
|
|
194
|
-
|
|
195
|
-
After writing config, offer to send a test notification:
|
|
196
|
-
|
|
197
|
-
Use AskUserQuestion:
|
|
198
|
-
|
|
199
|
-
**Question:** "Send a test notification to verify the setup?"
|
|
200
|
-
|
|
201
|
-
**Options:**
|
|
202
|
-
1. **Yes, test now (Recommended)** - Send a test message to your Discord channel
|
|
203
|
-
2. **No, I'll test later** - Skip testing
|
|
204
|
-
|
|
205
|
-
### If testing:
|
|
206
|
-
|
|
207
|
-
```bash
|
|
208
|
-
# For webhook:
|
|
209
|
-
curl -s -o /dev/null -w "%{http_code}" \
|
|
210
|
-
-H "Content-Type: application/json" \
|
|
211
|
-
-d "{\"content\": \"${MENTION:+$MENTION\\n}OMX test notification - Discord is configured!\"}" \
|
|
212
|
-
"$WEBHOOK_URL"
|
|
213
|
-
```
|
|
214
|
-
|
|
215
|
-
Report success or failure. If it fails, help the user debug (check URL, permissions, etc.).
|
|
216
|
-
|
|
217
|
-
## Step 9: Confirm
|
|
218
|
-
|
|
219
|
-
Display the final configuration summary:
|
|
220
|
-
|
|
221
|
-
```
|
|
222
|
-
Discord Notifications Configured!
|
|
223
|
-
|
|
224
|
-
Method: Webhook / Bot API
|
|
225
|
-
Mention: <@1465264645320474637> (or "none")
|
|
226
|
-
Events: session-end, ask-user-question
|
|
227
|
-
Username: OMX
|
|
228
|
-
|
|
229
|
-
Config saved to: ~/.codex/.omx-config.json
|
|
230
|
-
|
|
231
|
-
You can also set these via environment variables:
|
|
232
|
-
OMX_DISCORD_WEBHOOK_URL=https://discord.com/api/webhooks/...
|
|
233
|
-
OMX_DISCORD_MENTION=<@1465264645320474637>
|
|
234
|
-
|
|
235
|
-
To reconfigure: /configure-discord
|
|
236
|
-
To configure Telegram: /configure-telegram
|
|
237
|
-
```
|
|
238
|
-
|
|
239
|
-
## Environment Variable Alternative
|
|
240
|
-
|
|
241
|
-
Users can skip this wizard entirely by setting env vars in their shell profile:
|
|
242
|
-
|
|
243
|
-
**Webhook method:**
|
|
244
|
-
```bash
|
|
245
|
-
export OMX_DISCORD_WEBHOOK_URL="https://discord.com/api/webhooks/..."
|
|
246
|
-
export OMX_DISCORD_MENTION="<@1465264645320474637>" # optional
|
|
247
|
-
```
|
|
248
|
-
|
|
249
|
-
**Bot API method:**
|
|
250
|
-
```bash
|
|
251
|
-
export OMX_DISCORD_NOTIFIER_BOT_TOKEN="your-bot-token"
|
|
252
|
-
export OMX_DISCORD_NOTIFIER_CHANNEL="your-channel-id"
|
|
253
|
-
export OMX_DISCORD_MENTION="<@1465264645320474637>" # optional
|
|
254
|
-
```
|
|
255
|
-
|
|
256
|
-
Env vars are auto-detected by the notification system without needing `.omx-config.json`.
|
|
@@ -1,264 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: configure-openclaw
|
|
3
|
-
description: Configure OpenClaw notification gateway via natural language
|
|
4
|
-
triggers:
|
|
5
|
-
- "configure openclaw"
|
|
6
|
-
- "setup openclaw"
|
|
7
|
-
- "openclaw notifications"
|
|
8
|
-
- "openclaw gateway"
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
# Configure OpenClaw Notifications
|
|
12
|
-
|
|
13
|
-
Set up OpenClaw as a notification gateway so OMX can route notification events to your OpenClaw hook endpoints (or a local command gateway).
|
|
14
|
-
|
|
15
|
-
## Runtime Schema Requirement (must match OMX)
|
|
16
|
-
|
|
17
|
-
Always write OpenClaw config under:
|
|
18
|
-
- `notifications.openclaw.enabled`
|
|
19
|
-
- `notifications.openclaw.gateways`
|
|
20
|
-
- `notifications.openclaw.hooks`
|
|
21
|
-
|
|
22
|
-
Do **not** use legacy keys like `gatewayType`, `endpoint`, or top-level `command`.
|
|
23
|
-
|
|
24
|
-
## How This Skill Works
|
|
25
|
-
|
|
26
|
-
This is an interactive setup wizard. Ask questions with AskUserQuestion, merge changes into `~/.codex/.omx-config.json`, and then run a verification flow with explicit pass/fail diagnostics.
|
|
27
|
-
|
|
28
|
-
## Step 1: Detect Existing OpenClaw Configuration
|
|
29
|
-
|
|
30
|
-
```bash
|
|
31
|
-
CONFIG_FILE="$HOME/.codex/.omx-config.json"
|
|
32
|
-
|
|
33
|
-
if [ -f "$CONFIG_FILE" ]; then
|
|
34
|
-
OPENCLAW_ENABLED=$(jq -r '.notifications.openclaw.enabled // false' "$CONFIG_FILE" 2>/dev/null)
|
|
35
|
-
GATEWAYS=$(jq -r '.notifications.openclaw.gateways // {} | keys | join(", ")' "$CONFIG_FILE" 2>/dev/null)
|
|
36
|
-
HOOKS=$(jq -r '.notifications.openclaw.hooks // {} | keys | join(", ")' "$CONFIG_FILE" 2>/dev/null)
|
|
37
|
-
|
|
38
|
-
echo "OPENCLAW_ENABLED=$OPENCLAW_ENABLED"
|
|
39
|
-
echo "GATEWAYS=${GATEWAYS:-none}"
|
|
40
|
-
echo "HOOKS=${HOOKS:-none}"
|
|
41
|
-
else
|
|
42
|
-
echo "NO_CONFIG_FILE"
|
|
43
|
-
fi
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
If existing config is found, show current gateways/hooks and ask whether to update or replace.
|
|
47
|
-
|
|
48
|
-
## Step 2: Choose Gateway Mode
|
|
49
|
-
|
|
50
|
-
Use AskUserQuestion:
|
|
51
|
-
|
|
52
|
-
**Question:** "Which OpenClaw gateway mode do you want to configure?"
|
|
53
|
-
|
|
54
|
-
**Options:**
|
|
55
|
-
1. **HTTP Gateway (Recommended)** - OMX POSTs JSON to your OpenClaw hook endpoint
|
|
56
|
-
2. **CLI Command Gateway** - OMX executes a local command template
|
|
57
|
-
|
|
58
|
-
## Step 3A: HTTP Gateway Setup
|
|
59
|
-
|
|
60
|
-
Collect three values:
|
|
61
|
-
1. Gateway name (default: `local`)
|
|
62
|
-
2. Hook base URL (example: `http://127.0.0.1:18789`)
|
|
63
|
-
3. OpenClaw hooks token
|
|
64
|
-
|
|
65
|
-
Build the endpoint URL as:
|
|
66
|
-
- Delivery endpoint: `${BASE_URL%/}/hooks/agent`
|
|
67
|
-
- Optional wake smoke endpoint: `${BASE_URL%/}/hooks/wake`
|
|
68
|
-
|
|
69
|
-
### Required validation checks
|
|
70
|
-
|
|
71
|
-
Run these checks and report each result:
|
|
72
|
-
|
|
73
|
-
1) **Hook token present**
|
|
74
|
-
```bash
|
|
75
|
-
[ -n "$HOOKS_TOKEN" ] && echo "PASS token provided" || echo "FAIL token missing"
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
2) **Gateway URL format and reachability**
|
|
79
|
-
```bash
|
|
80
|
-
case "$BASE_URL" in
|
|
81
|
-
http://*|https://*) echo "PASS URL format" ;;
|
|
82
|
-
*) echo "FAIL URL must start with http:// or https://" ;;
|
|
83
|
-
esac
|
|
84
|
-
|
|
85
|
-
curl -sS -o /dev/null -w "HTTP %{http_code}\n" "$BASE_URL" || echo "FAIL cannot reach base URL"
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
3) **Delivery endpoint probe (`/hooks/agent`)**
|
|
89
|
-
```bash
|
|
90
|
-
curl -sS -o /tmp/omx-openclaw-agent.json -w "HTTP %{http_code}\n" \
|
|
91
|
-
-X POST "${BASE_URL%/}/hooks/agent" \
|
|
92
|
-
-H "Authorization: Bearer $HOOKS_TOKEN" \
|
|
93
|
-
-H "Content-Type: application/json" \
|
|
94
|
-
-d '{"instruction":"OMX OpenClaw setup probe","event":"session-end","sessionId":"setup-smoke"}'
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
If probe is non-2xx or network fails, treat as setup failure and continue with diagnostics.
|
|
98
|
-
|
|
99
|
-
## Step 3B: CLI Command Gateway Setup
|
|
100
|
-
|
|
101
|
-
Collect:
|
|
102
|
-
- Gateway name (default: `local-command`)
|
|
103
|
-
- Command template (supports `{{event}}`, `{{instruction}}`, `{{sessionId}}`, `{{projectPath}}`)
|
|
104
|
-
|
|
105
|
-
Example:
|
|
106
|
-
```bash
|
|
107
|
-
~/.local/bin/my-notifier --event {{event}} --text {{instruction}}
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
### Dual env gate (must be explained)
|
|
111
|
-
|
|
112
|
-
CLI command gateways only run when **both** are set:
|
|
113
|
-
|
|
114
|
-
```bash
|
|
115
|
-
export OMX_OPENCLAW=1
|
|
116
|
-
export OMX_OPENCLAW_COMMAND=1
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
If `OMX_OPENCLAW_COMMAND` is missing, command gateway dispatch is blocked by design.
|
|
120
|
-
|
|
121
|
-
## Step 4: Select Hook Event Mappings
|
|
122
|
-
|
|
123
|
-
Use AskUserQuestion with multiSelect.
|
|
124
|
-
|
|
125
|
-
**Question:** "Which OMX events should trigger OpenClaw hooks?"
|
|
126
|
-
|
|
127
|
-
Recommended defaults:
|
|
128
|
-
- `session-end`
|
|
129
|
-
- `ask-user-question`
|
|
130
|
-
|
|
131
|
-
Optional:
|
|
132
|
-
- `session-start`
|
|
133
|
-
- `session-idle`
|
|
134
|
-
- `stop`
|
|
135
|
-
|
|
136
|
-
For each selected event, collect a short instruction template.
|
|
137
|
-
|
|
138
|
-
## Step 5: Write Schema-Aligned Config
|
|
139
|
-
|
|
140
|
-
Always merge into `~/.codex/.omx-config.json`.
|
|
141
|
-
|
|
142
|
-
### HTTP gateway example
|
|
143
|
-
|
|
144
|
-
```bash
|
|
145
|
-
jq \
|
|
146
|
-
--arg gatewayName "$GATEWAY_NAME" \
|
|
147
|
-
--arg url "${BASE_URL%/}/hooks/agent" \
|
|
148
|
-
--arg token "$HOOKS_TOKEN" \
|
|
149
|
-
'.notifications = (.notifications // {enabled: true}) |
|
|
150
|
-
.notifications.enabled = true |
|
|
151
|
-
.notifications.openclaw = (.notifications.openclaw // {}) |
|
|
152
|
-
.notifications.openclaw.enabled = true |
|
|
153
|
-
.notifications.openclaw.gateways = (.notifications.openclaw.gateways // {}) |
|
|
154
|
-
.notifications.openclaw.gateways[$gatewayName] = {
|
|
155
|
-
type: "http",
|
|
156
|
-
url: $url,
|
|
157
|
-
headers: {"Authorization": ("Bearer " + $token)}
|
|
158
|
-
}' "$CONFIG_FILE" > "$CONFIG_FILE.tmp" && mv "$CONFIG_FILE.tmp" "$CONFIG_FILE"
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
### Command gateway example
|
|
162
|
-
|
|
163
|
-
```bash
|
|
164
|
-
jq \
|
|
165
|
-
--arg gatewayName "$GATEWAY_NAME" \
|
|
166
|
-
--arg command "$COMMAND_TEMPLATE" \
|
|
167
|
-
'.notifications = (.notifications // {enabled: true}) |
|
|
168
|
-
.notifications.enabled = true |
|
|
169
|
-
.notifications.openclaw = (.notifications.openclaw // {}) |
|
|
170
|
-
.notifications.openclaw.enabled = true |
|
|
171
|
-
.notifications.openclaw.gateways = (.notifications.openclaw.gateways // {}) |
|
|
172
|
-
.notifications.openclaw.gateways[$gatewayName] = {
|
|
173
|
-
type: "command",
|
|
174
|
-
command: $command
|
|
175
|
-
}' "$CONFIG_FILE" > "$CONFIG_FILE.tmp" && mv "$CONFIG_FILE.tmp" "$CONFIG_FILE"
|
|
176
|
-
```
|
|
177
|
-
|
|
178
|
-
### Hook mapping example
|
|
179
|
-
|
|
180
|
-
```bash
|
|
181
|
-
jq \
|
|
182
|
-
--arg gatewayName "$GATEWAY_NAME" \
|
|
183
|
-
'.notifications.openclaw.hooks = (.notifications.openclaw.hooks // {}) |
|
|
184
|
-
.notifications.openclaw.hooks["session-end"] = {
|
|
185
|
-
enabled: true,
|
|
186
|
-
gateway: $gatewayName,
|
|
187
|
-
instruction: "OMX task completed for {{projectPath}}"
|
|
188
|
-
} |
|
|
189
|
-
.notifications.openclaw.hooks["ask-user-question"] = {
|
|
190
|
-
enabled: true,
|
|
191
|
-
gateway: $gatewayName,
|
|
192
|
-
instruction: "OMX needs input: {{question}}"
|
|
193
|
-
}' "$CONFIG_FILE" > "$CONFIG_FILE.tmp" && mv "$CONFIG_FILE.tmp" "$CONFIG_FILE"
|
|
194
|
-
```
|
|
195
|
-
|
|
196
|
-
## Step 6: Explain Activation Gates
|
|
197
|
-
|
|
198
|
-
Show this exactly:
|
|
199
|
-
|
|
200
|
-
```bash
|
|
201
|
-
# Required for OpenClaw integration
|
|
202
|
-
export OMX_OPENCLAW=1
|
|
203
|
-
|
|
204
|
-
# Required in addition for command gateways
|
|
205
|
-
export OMX_OPENCLAW_COMMAND=1
|
|
206
|
-
```
|
|
207
|
-
|
|
208
|
-
## Step 7: Verification Flow (required)
|
|
209
|
-
|
|
210
|
-
Run both checks for HTTP gateways:
|
|
211
|
-
|
|
212
|
-
### A) Wake smoke test (`/hooks/wake`)
|
|
213
|
-
|
|
214
|
-
```bash
|
|
215
|
-
curl -sS -X POST "${BASE_URL%/}/hooks/wake" \
|
|
216
|
-
-H "Authorization: Bearer $HOOKS_TOKEN" \
|
|
217
|
-
-H "Content-Type: application/json" \
|
|
218
|
-
-d '{"text":"OMX wake smoke test","mode":"now"}'
|
|
219
|
-
```
|
|
220
|
-
|
|
221
|
-
Expected pass signal: JSON includes `"ok":true`.
|
|
222
|
-
|
|
223
|
-
### B) Delivery verification (`/hooks/agent`) — not wake-only
|
|
224
|
-
|
|
225
|
-
```bash
|
|
226
|
-
curl -sS -o /tmp/omx-openclaw-delivery.json -w "HTTP %{http_code}\n" \
|
|
227
|
-
-X POST "${BASE_URL%/}/hooks/agent" \
|
|
228
|
-
-H "Authorization: Bearer $HOOKS_TOKEN" \
|
|
229
|
-
-H "Content-Type: application/json" \
|
|
230
|
-
-d '{"instruction":"OMX delivery verification","event":"session-end","sessionId":"verify-setup"}'
|
|
231
|
-
```
|
|
232
|
-
|
|
233
|
-
Expected pass signal: HTTP 2xx and response body confirms acceptance.
|
|
234
|
-
|
|
235
|
-
## Step 8: Pass/Fail Diagnostics Guidance
|
|
236
|
-
|
|
237
|
-
If verification fails, guide with this checklist:
|
|
238
|
-
- **401/403** → token missing/invalid; rotate token and update `Authorization` header.
|
|
239
|
-
- **404** → wrong path; verify `/hooks/agent` and `/hooks/wake` are enabled by OpenClaw hooks config.
|
|
240
|
-
- **5xx** → OpenClaw gateway runtime issue; check gateway logs and retry.
|
|
241
|
-
- **Timeout / connection refused** → gateway URL unreachable; confirm host/port and local firewall.
|
|
242
|
-
- **Command gateway disabled** → set both `OMX_OPENCLAW=1` and `OMX_OPENCLAW_COMMAND=1`.
|
|
243
|
-
|
|
244
|
-
## Step 9: Final Summary
|
|
245
|
-
|
|
246
|
-
Show:
|
|
247
|
-
- gateway mode + gateway name
|
|
248
|
-
- mapped events
|
|
249
|
-
- whether smoke test passed
|
|
250
|
-
- whether `/hooks/agent` delivery test passed
|
|
251
|
-
- exact env vars user still needs to export in shell profile
|
|
252
|
-
|
|
253
|
-
## Environment Variable Reference
|
|
254
|
-
|
|
255
|
-
```bash
|
|
256
|
-
# Required for all OpenClaw gateways
|
|
257
|
-
export OMX_OPENCLAW=1
|
|
258
|
-
|
|
259
|
-
# Required additionally for CLI command gateways
|
|
260
|
-
export OMX_OPENCLAW_COMMAND=1
|
|
261
|
-
|
|
262
|
-
# Optional debug logs
|
|
263
|
-
export OMX_OPENCLAW_DEBUG=1
|
|
264
|
-
```
|