@damian87/omp 0.7.0 → 0.8.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/README.md +29 -0
- package/dist/src/cli.js +310 -1
- package/dist/src/cli.js.map +1 -1
- package/dist/src/env/dotenv.d.ts +41 -0
- package/dist/src/env/dotenv.js +112 -0
- package/dist/src/env/dotenv.js.map +1 -0
- package/dist/src/env/init.d.ts +50 -0
- package/dist/src/env/init.js +276 -0
- package/dist/src/env/init.js.map +1 -0
- package/dist/src/gateway/connector.d.ts +37 -0
- package/dist/src/gateway/connector.js +12 -0
- package/dist/src/gateway/connector.js.map +1 -0
- package/dist/src/gateway/connectors/slack.d.ts +69 -0
- package/dist/src/gateway/connectors/slack.js +159 -0
- package/dist/src/gateway/connectors/slack.js.map +1 -0
- package/dist/src/gateway/registry.d.ts +29 -0
- package/dist/src/gateway/registry.js +37 -0
- package/dist/src/gateway/registry.js.map +1 -0
- package/dist/src/gateway/runtime.d.ts +58 -0
- package/dist/src/gateway/runtime.js +105 -0
- package/dist/src/gateway/runtime.js.map +1 -0
- package/dist/src/jira.js +2 -14
- package/dist/src/jira.js.map +1 -1
- package/dist/src/slack/config.d.ts +32 -0
- package/dist/src/slack/config.js +52 -0
- package/dist/src/slack/config.js.map +1 -0
- package/dist/src/slack/handler.d.ts +48 -0
- package/dist/src/slack/handler.js +68 -0
- package/dist/src/slack/handler.js.map +1 -0
- package/dist/src/slack/serve.d.ts +8 -0
- package/dist/src/slack/serve.js +7 -0
- package/dist/src/slack/serve.js.map +1 -0
- package/dist/src/team/tmux.d.ts +1 -0
- package/dist/src/team/tmux.js +9 -0
- package/dist/src/team/tmux.js.map +1 -1
- package/docs/slack-setup.md +144 -0
- package/package.json +3 -2
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
# Slack → Copilot bridge (`omp gateway`)
|
|
2
|
+
|
|
3
|
+
Drive a running GitHub Copilot CLI session from Slack: DM the bot (or @mention it in a
|
|
4
|
+
channel) and it forwards your message to Copilot over the `comms`/tmux bridge, then posts
|
|
5
|
+
Copilot's reply back **in-thread**.
|
|
6
|
+
|
|
7
|
+
It uses **Socket Mode**, so it needs **no public URL** — it runs from your laptop behind NAT.
|
|
8
|
+
|
|
9
|
+
Slack is the first connector that runs under the generic `omp gateway` runtime. Future
|
|
10
|
+
connectors (Telegram, Discord, webhooks) plug into the same `gateway serve` command.
|
|
11
|
+
|
|
12
|
+
## 1. Create the Slack app (from manifest)
|
|
13
|
+
|
|
14
|
+
Go to <https://api.slack.com/apps> → **Create New App** → **From an app manifest** → pick your
|
|
15
|
+
workspace → paste this YAML:
|
|
16
|
+
|
|
17
|
+
```yaml
|
|
18
|
+
display_information:
|
|
19
|
+
name: omp-copilot
|
|
20
|
+
description: Bridge to a local GitHub Copilot CLI session
|
|
21
|
+
features:
|
|
22
|
+
bot_user:
|
|
23
|
+
display_name: omp-copilot
|
|
24
|
+
always_online: true
|
|
25
|
+
app_home:
|
|
26
|
+
messages_tab_enabled: true
|
|
27
|
+
messages_tab_read_only_enabled: false
|
|
28
|
+
oauth_config:
|
|
29
|
+
scopes:
|
|
30
|
+
bot:
|
|
31
|
+
- app_mentions:read
|
|
32
|
+
- chat:write
|
|
33
|
+
- im:history
|
|
34
|
+
- im:read
|
|
35
|
+
- im:write
|
|
36
|
+
# add channels:history only if you also want channel @mentions in public channels
|
|
37
|
+
settings:
|
|
38
|
+
event_subscriptions:
|
|
39
|
+
bot_events:
|
|
40
|
+
- app_mention
|
|
41
|
+
- message.im
|
|
42
|
+
interactivity:
|
|
43
|
+
is_enabled: false
|
|
44
|
+
org_deploy_enabled: false
|
|
45
|
+
socket_mode_enabled: true
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## 2. Get the two tokens
|
|
49
|
+
|
|
50
|
+
- **App-level token (xapp-…)** — *Basic Information → App-Level Tokens → Generate* with scope
|
|
51
|
+
**`connections:write`**. This is `SLACK_APP_TOKEN` (Socket Mode).
|
|
52
|
+
- **Bot token (xoxb-…)** — *Install App* to your workspace, then *OAuth & Permissions →
|
|
53
|
+
Bot User OAuth Token*. This is `SLACK_BOT_TOKEN`.
|
|
54
|
+
|
|
55
|
+
(Optional) find your own Slack user ID (profile → ⋯ → Copy member ID, `U…`) to lock the bot to
|
|
56
|
+
just you via `SLACK_ALLOWED_USERS`.
|
|
57
|
+
|
|
58
|
+
## 3. Run the bridge
|
|
59
|
+
|
|
60
|
+
The bridge talks to Copilot through the `comms` layer, so a Copilot tmux session must be
|
|
61
|
+
running first.
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
# Terminal A — a running Copilot session (or `omp` to launch one)
|
|
65
|
+
tmux new-session -d -s omp-9999 # any omp-<digits> name; or run: omp
|
|
66
|
+
|
|
67
|
+
# Terminal B — write ~/.omp/.env once, then run the gateway.
|
|
68
|
+
#
|
|
69
|
+
# `omp env init` is interactive: it prints the exact Slack-admin pages to
|
|
70
|
+
# pull each token from, prompts you, and writes ~/.omp/.env (chmod 600).
|
|
71
|
+
# `omp` then auto-loads that file on every invocation — no `source` step.
|
|
72
|
+
# Shell exports always win, so a one-off override like
|
|
73
|
+
# `SLACK_BOT_TOKEN=other omp gateway serve` still works.
|
|
74
|
+
omp env init
|
|
75
|
+
|
|
76
|
+
# Re-running shows masked existing values and asks before overwriting.
|
|
77
|
+
#
|
|
78
|
+
# Scripted form (CI, automation) — PREFER env vars over flags so tokens
|
|
79
|
+
# never land in shell history, `ps`, or CI logs:
|
|
80
|
+
# OMP_INIT_BOT_TOKEN=xoxb-… OMP_INIT_APP_TOKEN=xapp-… \
|
|
81
|
+
# OMP_INIT_SESSION=omp-9999 OMP_INIT_USERS=U1,U2 \
|
|
82
|
+
# omp env init --force
|
|
83
|
+
# (--bot-token / --app-token still work but emit a stderr warning;
|
|
84
|
+
# silence it with OMP_INIT_NO_WARN=1 only when you know it's safe.)
|
|
85
|
+
|
|
86
|
+
omp gateway serve # auto-loads ~/.omp/.env first
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Alternative: shell exports still work for CI or one-off sessions:
|
|
90
|
+
```bash
|
|
91
|
+
export SLACK_BOT_TOKEN=xoxb-...
|
|
92
|
+
export SLACK_APP_TOKEN=xapp-...
|
|
93
|
+
omp gateway serve
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
To restrict the gateway to a subset of connectors (useful when more connectors land):
|
|
97
|
+
```bash
|
|
98
|
+
omp gateway serve --only slack
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Preflight without connecting:
|
|
102
|
+
```bash
|
|
103
|
+
omp gateway status # per-connector readiness: tokens present + copilot session resolvable
|
|
104
|
+
omp gateway status --json # machine-readable; exit 0 when ready
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
`omp slack serve` and `omp slack doctor` still work as **deprecated aliases** that forward
|
|
108
|
+
to `omp gateway serve --only slack` and `omp gateway status --only slack` — so any existing
|
|
109
|
+
scripts keep running.
|
|
110
|
+
|
|
111
|
+
## 4. Use it
|
|
112
|
+
|
|
113
|
+
- **DM** the bot: `what files changed in the last commit?` → Copilot's answer threads back.
|
|
114
|
+
- **@mention** in a channel the bot is in: `@omp-copilot summarize this repo`.
|
|
115
|
+
|
|
116
|
+
## Behavior
|
|
117
|
+
|
|
118
|
+
- DMs always respond; channels respond only on @mention (set `SLACK_REQUIRE_MENTION=false` to
|
|
119
|
+
respond to every channel message the bot can see).
|
|
120
|
+
- Non-allowlisted users are silently ignored (when `SLACK_ALLOWED_USERS` is set and not `*`).
|
|
121
|
+
- Errors come back as friendly replies: no running Copilot session, offline, Copilot busy, or
|
|
122
|
+
a timeout note if Copilot is still working.
|
|
123
|
+
- Replies post in the message's thread (`thread_ts`).
|
|
124
|
+
|
|
125
|
+
## Config reference
|
|
126
|
+
|
|
127
|
+
| Env var | Required | Meaning |
|
|
128
|
+
|---|---|---|
|
|
129
|
+
| `SLACK_BOT_TOKEN` | yes | Bot token `xoxb-…` |
|
|
130
|
+
| `SLACK_APP_TOKEN` | yes | App-level token `xapp-…` (scope `connections:write`) |
|
|
131
|
+
| `SLACK_ALLOWED_USERS` | no | CSV of user IDs; `*` or unset = everyone |
|
|
132
|
+
| `SLACK_REQUIRE_MENTION` | no | `true` (default) / `false` — require @mention in channels |
|
|
133
|
+
| `COPILOT_TMUX_SESSION` | no | Pin the Copilot session; otherwise auto-discovered |
|
|
134
|
+
|
|
135
|
+
## Notes / limits (v1)
|
|
136
|
+
|
|
137
|
+
- Inbound chat only (Slack → Copilot → reply). Outbound notifications are a future addition.
|
|
138
|
+
- `SLACK_REQUIRE_MENTION=false` currently has no effect in **channels**: v1 only subscribes to
|
|
139
|
+
DMs (`message.im`) and `app_mention`, so non-mention channel messages are never delivered to the
|
|
140
|
+
bot. (Responding to every channel message would need the `channels:history` scope and a
|
|
141
|
+
`message.channels` subscription — a future addition.) It works as expected in DMs.
|
|
142
|
+
- One Copilot session at a time (multiple `omp-<digits>` sessions → the bridge reports the
|
|
143
|
+
ambiguity and asks you to pin `COPILOT_TMUX_SESSION`).
|
|
144
|
+
- `omp gateway serve` is a long-running foreground process — run it under tmux/systemd to keep it up.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@damian87/omp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "GitHub Copilot project skills catalog and Jira handoff tools.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -56,6 +56,7 @@
|
|
|
56
56
|
"vitest": "^3.1.4"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@modelcontextprotocol/sdk": "^1.29.0"
|
|
59
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
60
|
+
"@slack/bolt": "^4.4.0"
|
|
60
61
|
}
|
|
61
62
|
}
|