omnish 1.6.6 → 2.0.0
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/CHANGELOG.md +32 -0
- package/README.md +26 -18
- package/config.example.json +1 -0
- package/dist/downloads/omnish-claude/install.sh +174 -0
- package/dist/downloads/omnish-claude/uninstall.sh +114 -0
- package/dist/downloads/omnish-claude.tar.gz +0 -0
- package/dist/downloads/omnish-cursor/install.sh +162 -0
- package/dist/downloads/omnish-cursor/uninstall.sh +107 -0
- package/dist/downloads/omnish-cursor.tar.gz +0 -0
- package/dist/index.js +424 -392
- package/dist/omnish-claude/README.md +80 -0
- package/dist/omnish-claude/hooks/omnish-notify.py +213 -0
- package/dist/omnish-claude/hooks/omnish-notify.sh +13 -0
- package/dist/omnish-claude/install.sh +174 -0
- package/dist/omnish-claude/omnish-notify.json.example +8 -0
- package/dist/omnish-claude/scripts/doctor.sh +99 -0
- package/dist/omnish-claude/skill/SKILL.md +39 -0
- package/dist/omnish-claude/skill/files-and-sharing.md +94 -0
- package/dist/omnish-claude/skill/notifications.md +113 -0
- package/dist/omnish-claude/skill/setup-paths.md +81 -0
- package/dist/omnish-claude/uninstall.sh +114 -0
- package/dist/omnish-cursor/README.md +176 -0
- package/dist/omnish-cursor/hooks/__pycache__/omnish-notify.cpython-313.pyc +0 -0
- package/dist/omnish-cursor/hooks/omnish-notify.py +563 -0
- package/dist/omnish-cursor/hooks/omnish-notify.sh +13 -0
- package/dist/omnish-cursor/hooks/omnish-session-start.sh +48 -0
- package/dist/omnish-cursor/install.sh +162 -0
- package/dist/omnish-cursor/omnish-notify.json.example +13 -0
- package/dist/omnish-cursor/rules/omnish-notify.mdc +45 -0
- package/dist/omnish-cursor/scripts/doctor.sh +126 -0
- package/dist/omnish-cursor/skill/SKILL.md +129 -0
- package/dist/omnish-cursor/skill/files-and-sharing.md +94 -0
- package/dist/omnish-cursor/skill/notifications.md +155 -0
- package/dist/omnish-cursor/skill/setup-paths.md +81 -0
- package/dist/omnish-cursor/uninstall.sh +107 -0
- package/dist/ui/assets/{index-aUJGrxrr.js → index-BwG51a2I.js} +10 -10
- package/dist/ui/index.html +16 -1
- package/package.json +12 -4
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
# Omnish notifications
|
|
2
|
+
|
|
3
|
+
Keep terminal noise local; push **curated, readable briefs** to mobile. Default destination: **`*`** (all allowlisted peers). Works on standalone and platform attached gateways.
|
|
4
|
+
|
|
5
|
+
## Status message format
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
omnish i -c '/sendto * -t <title> -- <brief>'
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
The brief supports **newlines** — use labeled sections instead of one long pipe-separated line:
|
|
12
|
+
|
|
13
|
+
```text
|
|
14
|
+
Status: Done
|
|
15
|
+
Chat: <conversation_id>
|
|
16
|
+
Workspace: myapp
|
|
17
|
+
|
|
18
|
+
You asked:
|
|
19
|
+
Fix notification formatting in cursor hooks
|
|
20
|
+
|
|
21
|
+
Outcome:
|
|
22
|
+
Updated hook to send multi-line summaries and follow-up messages when content is long.
|
|
23
|
+
|
|
24
|
+
Tools: 6 action(s)
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Message types:
|
|
28
|
+
|
|
29
|
+
| Type | When |
|
|
30
|
+
| ------------ | ------------------------------ |
|
|
31
|
+
| **Ack** | Task accepted |
|
|
32
|
+
| **Progress** | Major phase change (sparingly) |
|
|
33
|
+
| **Question** | Needs human input |
|
|
34
|
+
| **Done** | Finished with outcome |
|
|
35
|
+
| **Blocked** | Failure or dependency |
|
|
36
|
+
|
|
37
|
+
Rules:
|
|
38
|
+
|
|
39
|
+
1. Do not stream raw logs to chat.
|
|
40
|
+
2. Lead with key facts (status, chat id, workspace); use newlines between sections.
|
|
41
|
+
3. Summarize in the first message; send **follow-up messages** when the request or outcome needs more context — never chop mid-sentence without a follow-up.
|
|
42
|
+
4. Ask before sending files unless requested.
|
|
43
|
+
5. Include Cursor `conversation_id` when notifying from Cursor agent work.
|
|
44
|
+
|
|
45
|
+
## Cursor automatic notifications
|
|
46
|
+
|
|
47
|
+
Install the unified bundle:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
bash contrib/omnish-cursor/install.sh
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Stop hook sends when the agent **changed files** (Write/StrReplace/Delete) or hit an error. Read-only Shell/Grep investigation turns are skipped.
|
|
54
|
+
|
|
55
|
+
**Dedupe:** same chat + same user ask within `dedupe_minutes` (default 45) → no second ping.
|
|
56
|
+
|
|
57
|
+
**Follow-ups:** off by default (`send_followups: false`) to avoid mobile floods.
|
|
58
|
+
|
|
59
|
+
Config `~/.cursor/omnish-notify.json`:
|
|
60
|
+
|
|
61
|
+
```json
|
|
62
|
+
{
|
|
63
|
+
"enabled": true,
|
|
64
|
+
"peer": "*",
|
|
65
|
+
"min_assistant_chars": 120,
|
|
66
|
+
"notify_on_error": true,
|
|
67
|
+
"skip_aborted": true,
|
|
68
|
+
"include_full_chat_id": true,
|
|
69
|
+
"summary_max_chars": 300,
|
|
70
|
+
"followup_max_chars": 1000,
|
|
71
|
+
"max_followup_messages": 0,
|
|
72
|
+
"send_followups": false,
|
|
73
|
+
"dedupe_minutes": 45
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
| Key | Default | Meaning |
|
|
78
|
+
| ----------------------- | ------- | --------------------------------------------------- |
|
|
79
|
+
| `dedupe_minutes` | `45` | Suppress repeat pings for same chat + same user ask |
|
|
80
|
+
| `summary_max_chars` | `300` | Max length for outcome summary in main message |
|
|
81
|
+
| `followup_max_chars` | `1000` | Max chars per follow-up message (if enabled) |
|
|
82
|
+
| `max_followup_messages` | `0` | Extra messages after the main brief |
|
|
83
|
+
| `send_followups` | `false` | Send follow-ups for long requests/outcomes |
|
|
84
|
+
|
|
85
|
+
Log: `~/.cursor/hooks/omnish-notify.log`
|
|
86
|
+
|
|
87
|
+
## Manual and agent-driven sends
|
|
88
|
+
|
|
89
|
+
Helper script (from omnish repo root):
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
bash scripts/agent-notify.sh "Deploy Done" "Status: Done
|
|
93
|
+
|
|
94
|
+
Workspace: prod
|
|
95
|
+
Outcome: main branch live"
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Uses `OMNISH_PEER_KEY` if set, else `OMNISH_JOB_OWNER_PEER`, else `*`.
|
|
99
|
+
|
|
100
|
+
Env from `/run` and chat agent daemon:
|
|
101
|
+
|
|
102
|
+
| Variable | Purpose |
|
|
103
|
+
| ---------------------------- | ------------------------------------ |
|
|
104
|
+
| `OMNISH_PEER_KEY` | Initiator peer |
|
|
105
|
+
| `OMNISH_NOTIFY_CMD` | Template with `/sendto peer` |
|
|
106
|
+
| `OMNISH_COMMUNICATION_BRIEF` | Guidance when `recipesNotifyEnabled` |
|
|
107
|
+
|
|
108
|
+
For broadcast, omit `OMNISH_PEER_KEY` and use `/sendto *` explicitly.
|
|
109
|
+
|
|
110
|
+
## Chat-native notifications
|
|
111
|
+
|
|
112
|
+
**Background jobs** — notify on completion:
|
|
113
|
+
|
|
114
|
+
```text
|
|
115
|
+
/bg -N -n deploy git pull && npm run build
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
**Cowork** — conditional notify:
|
|
119
|
+
|
|
120
|
+
```text
|
|
121
|
+
/cowork set backup when failure
|
|
122
|
+
/cowork set heartbeat when state-change
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
**Board / specialists** — status via same `/sendto` pattern (see `docs/guides/system-agents-and-run.md`).
|
|
126
|
+
|
|
127
|
+
## Test notification
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
omnish i -c '/sendto * -t Omnish Test -- Status: Done
|
|
131
|
+
|
|
132
|
+
Outcome: cursor hook messaging ok'
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
Requires `omnish run` and non-empty allowlist (or platform token routing).
|
|
136
|
+
|
|
137
|
+
## Avoid duplicate pings
|
|
138
|
+
|
|
139
|
+
When Cursor stop hook is installed:
|
|
140
|
+
|
|
141
|
+
- Do **not** send manual Done for advice-only turns (redeploy, “run npm install on server”, repeated troubleshooting).
|
|
142
|
+
- Do **not** send a second Done if the hook already fired for that turn.
|
|
143
|
+
- Hook skips read-only tools and dedupes same user ask for 45 minutes.
|
|
144
|
+
|
|
145
|
+
Use Progress/Question/Blocked during work; let the hook handle final Done only when files changed.
|
|
146
|
+
|
|
147
|
+
## Troubleshooting
|
|
148
|
+
|
|
149
|
+
| Issue | Check |
|
|
150
|
+
| --------------- | ------------------------------------------------------ |
|
|
151
|
+
| No message | `omnish status`; gateway running; allowlist |
|
|
152
|
+
| Hook skips | Log file; turn may be trivial or aborted |
|
|
153
|
+
| Wrong recipient | `peer` in `omnish-notify.json` |
|
|
154
|
+
| Message chopped | Enable `send_followups`; raise `max_followup_messages` |
|
|
155
|
+
| Platform mode | Token + probe; allowlists on dashboard |
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# Omnish setup paths
|
|
2
|
+
|
|
3
|
+
Choose exactly one primary path. All paths end with **`omnish run`** on the machine that executes shell commands.
|
|
4
|
+
|
|
5
|
+
## Platform attached mode (recommended for multi-device)
|
|
6
|
+
|
|
7
|
+
Messengers (WhatsApp/Telegram) link on the **hosted platform**; each device runs `omnish run` with an account token.
|
|
8
|
+
|
|
9
|
+
1. Create account on platform dashboard (e.g. `https://tunnel.omnish.dev/dashboard/`).
|
|
10
|
+
2. Link WhatsApp (QR) and/or Telegram (bot token) on the dashboard; save allowlists there.
|
|
11
|
+
3. On each execution host:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install -g omnish
|
|
15
|
+
omnish platform login --url https://tunnel.omnish.dev --token YOUR_ACCOUNT_TOKEN
|
|
16
|
+
omnish config show platform # verify URL + token source (masked)
|
|
17
|
+
omnish platform probe # connectivity check
|
|
18
|
+
omnish run # foreground, or: omnish start
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
4. From allowlisted chat: `!pwd`, `!help`.
|
|
22
|
+
|
|
23
|
+
**Notes:**
|
|
24
|
+
|
|
25
|
+
- No local `omnish link` required for WhatsApp when fully platform-attached.
|
|
26
|
+
- Files: outbound `/send` and `omnish i /sendto` use device → platform → messenger; inbound media saves on **your device** paths.
|
|
27
|
+
- Docs: `docs/guides/platform-attached-mode.md`, `docs/guides/platform-reference.md`.
|
|
28
|
+
|
|
29
|
+
## Standalone WhatsApp
|
|
30
|
+
|
|
31
|
+
Shell and Baileys session on the same host.
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
npm install -g omnish
|
|
35
|
+
omnish link # scan QR (Linked devices)
|
|
36
|
+
omnish allow +15551234567 # E.164 allowlist
|
|
37
|
+
omnish run
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Private chats only (no groups). Session under data dir `auth/`. Re-link if session missing in `omnish status`.
|
|
41
|
+
|
|
42
|
+
## Standalone Telegram
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
npm install -g omnish
|
|
46
|
+
omnish link --tg YOUR_BOT_TOKEN
|
|
47
|
+
# message bot /id to learn your tg id, then:
|
|
48
|
+
omnish allow tg:123456789
|
|
49
|
+
omnish run
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Set `gatewayMode` to `telegram` or `both` in config if using both channels.
|
|
53
|
+
|
|
54
|
+
## Background gateway
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
omnish start # background pidfile
|
|
58
|
+
omnish stop
|
|
59
|
+
omnish service install # boot hints (systemd / LaunchAgent / Task Scheduler)
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
See `docs/guides/background-and-boot.md`.
|
|
63
|
+
|
|
64
|
+
## Verify any path
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
omnish status
|
|
68
|
+
omnish security --json # optional scriptable audit
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
From chat (allowlisted): `!echo omnish-ok`
|
|
72
|
+
|
|
73
|
+
## Common failures
|
|
74
|
+
|
|
75
|
+
| Symptom | Fix |
|
|
76
|
+
| ---------------------------------- | ---------------------------------------------------------------------- |
|
|
77
|
+
| `gateway process: not running` | `omnish run` or `omnish start` |
|
|
78
|
+
| `session: missing` (standalone WA) | `omnish link` |
|
|
79
|
+
| `denied` in logs | Add sender to allowlist; check LID mapping with `omnish run --verbose` |
|
|
80
|
+
| Platform probe fails | Check URL/token; `omnish config show platform` |
|
|
81
|
+
| `/sendto` no delivery | Gateway must run; allowlist non-empty for `*` |
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Remove Omnish Cursor bundle entries from ~/.cursor (keeps unrelated hooks).
|
|
3
|
+
set -euo pipefail
|
|
4
|
+
|
|
5
|
+
CURSOR_DIR="${CURSOR_DIR:-$HOME/.cursor}"
|
|
6
|
+
HOOKS_JSON="$CURSOR_DIR/hooks.json"
|
|
7
|
+
|
|
8
|
+
REMOVE_HOOKS=1
|
|
9
|
+
REMOVE_SKILL=1
|
|
10
|
+
REMOVE_CONFIG=0
|
|
11
|
+
|
|
12
|
+
usage() {
|
|
13
|
+
cat <<EOF
|
|
14
|
+
Usage: $(basename "$0") [options]
|
|
15
|
+
|
|
16
|
+
Remove Omnish Cursor integration installed by install.sh.
|
|
17
|
+
|
|
18
|
+
Options:
|
|
19
|
+
--hooks-only Remove hooks + rule + hooks.json entries only
|
|
20
|
+
--skill-only Remove ~/.cursor/skills/omnish only
|
|
21
|
+
--with-config Also delete ~/.cursor/omnish-notify.json
|
|
22
|
+
-h, --help Show this help
|
|
23
|
+
EOF
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
while [[ $# -gt 0 ]]; do
|
|
27
|
+
case "$1" in
|
|
28
|
+
--hooks-only)
|
|
29
|
+
REMOVE_HOOKS=1
|
|
30
|
+
REMOVE_SKILL=0
|
|
31
|
+
shift
|
|
32
|
+
;;
|
|
33
|
+
--skill-only)
|
|
34
|
+
REMOVE_HOOKS=0
|
|
35
|
+
REMOVE_SKILL=1
|
|
36
|
+
shift
|
|
37
|
+
;;
|
|
38
|
+
--with-config)
|
|
39
|
+
REMOVE_CONFIG=1
|
|
40
|
+
shift
|
|
41
|
+
;;
|
|
42
|
+
-h | --help)
|
|
43
|
+
usage
|
|
44
|
+
exit 0
|
|
45
|
+
;;
|
|
46
|
+
*)
|
|
47
|
+
echo "error: unknown option: $1" >&2
|
|
48
|
+
usage >&2
|
|
49
|
+
exit 1
|
|
50
|
+
;;
|
|
51
|
+
esac
|
|
52
|
+
done
|
|
53
|
+
|
|
54
|
+
OMNISH_COMMANDS=(
|
|
55
|
+
"./hooks/omnish-session-start.sh"
|
|
56
|
+
"./hooks/omnish-notify.sh"
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
if [[ "$REMOVE_HOOKS" -eq 1 && -f "$HOOKS_JSON" ]]; then
|
|
60
|
+
python3 - "$HOOKS_JSON" "${OMNISH_COMMANDS[@]}" <<'PY'
|
|
61
|
+
import json
|
|
62
|
+
import sys
|
|
63
|
+
from pathlib import Path
|
|
64
|
+
|
|
65
|
+
hooks_path = Path(sys.argv[1])
|
|
66
|
+
remove_cmds = set(sys.argv[2:])
|
|
67
|
+
data = json.loads(hooks_path.read_text(encoding="utf-8"))
|
|
68
|
+
hooks = data.get("hooks") or {}
|
|
69
|
+
changed = False
|
|
70
|
+
for event, entries in list(hooks.items()):
|
|
71
|
+
if not isinstance(entries, list):
|
|
72
|
+
continue
|
|
73
|
+
filtered = [
|
|
74
|
+
e for e in entries
|
|
75
|
+
if not (isinstance(e, dict) and e.get("command") in remove_cmds)
|
|
76
|
+
]
|
|
77
|
+
if len(filtered) != len(entries):
|
|
78
|
+
changed = True
|
|
79
|
+
hooks[event] = filtered
|
|
80
|
+
if changed:
|
|
81
|
+
hooks_path.write_text(json.dumps(data, indent=2) + "\n", encoding="utf-8")
|
|
82
|
+
print(f"updated {hooks_path} (removed omnish hook entries)")
|
|
83
|
+
else
|
|
84
|
+
print(f"no omnish hook entries in {hooks_path}")
|
|
85
|
+
PY
|
|
86
|
+
fi
|
|
87
|
+
|
|
88
|
+
if [[ "$REMOVE_HOOKS" -eq 1 ]]; then
|
|
89
|
+
rm -f \
|
|
90
|
+
"$CURSOR_DIR/hooks/omnish-notify.sh" \
|
|
91
|
+
"$CURSOR_DIR/hooks/omnish-notify.py" \
|
|
92
|
+
"$CURSOR_DIR/hooks/omnish-session-start.sh" \
|
|
93
|
+
"$CURSOR_DIR/rules/omnish-notify.mdc"
|
|
94
|
+
echo "removed hook scripts and omnish-notify rule"
|
|
95
|
+
fi
|
|
96
|
+
|
|
97
|
+
if [[ "$REMOVE_SKILL" -eq 1 ]]; then
|
|
98
|
+
rm -rf "$CURSOR_DIR/skills/omnish"
|
|
99
|
+
echo "removed $CURSOR_DIR/skills/omnish"
|
|
100
|
+
fi
|
|
101
|
+
|
|
102
|
+
if [[ "$REMOVE_CONFIG" -eq 1 ]]; then
|
|
103
|
+
rm -f "$CURSOR_DIR/omnish-notify.json"
|
|
104
|
+
echo "removed $CURSOR_DIR/omnish-notify.json"
|
|
105
|
+
fi
|
|
106
|
+
|
|
107
|
+
echo "Done. Restart Cursor if hooks were removed."
|