@damian87/omp 0.7.0 → 0.9.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/.github/skills/slack/SKILL.md +82 -0
- package/README.md +61 -34
- package/catalog/capabilities.json +46 -0
- package/catalog/skills-general.json +26 -0
- package/dist/src/cli.js +365 -3
- package/dist/src/cli.js.map +1 -1
- package/dist/src/copilot/version.js +10 -0
- package/dist/src/copilot/version.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 +56 -0
- package/dist/src/env/init.js +294 -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/notify.d.ts +35 -0
- package/dist/src/gateway/notify.js +261 -0
- package/dist/src/gateway/notify.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/gateway/target-parser.d.ts +76 -0
- package/dist/src/gateway/target-parser.js +105 -0
- package/dist/src/gateway/target-parser.js.map +1 -0
- package/dist/src/jira.js +2 -14
- package/dist/src/jira.js.map +1 -1
- package/dist/src/schedule/commands.js +1 -0
- package/dist/src/schedule/commands.js.map +1 -1
- package/dist/src/schedule/runner.d.ts +9 -0
- package/dist/src/schedule/runner.js +31 -1
- package/dist/src/schedule/runner.js.map +1 -1
- package/dist/src/schedule/types.d.ts +9 -0
- 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 +177 -0
- package/package.json +13 -4
- package/plugin.json +12 -4
- package/scripts/lib/version-check.mjs +3 -0
- package/dist/src/mcp/server.d.ts +0 -10
- package/dist/src/mcp/server.js +0 -44
- package/dist/src/mcp/server.js.map +0 -1
- package/dist/src/mcp/tools/daily-log.d.ts +0 -2
- package/dist/src/mcp/tools/daily-log.js +0 -148
- package/dist/src/mcp/tools/daily-log.js.map +0 -1
- package/dist/src/mcp/tools/index.d.ts +0 -9
- package/dist/src/mcp/tools/index.js +0 -15
- package/dist/src/mcp/tools/index.js.map +0 -1
- package/dist/src/mcp/tools/notepad.d.ts +0 -2
- package/dist/src/mcp/tools/notepad.js +0 -135
- package/dist/src/mcp/tools/notepad.js.map +0 -1
- package/dist/src/mcp/tools/project-memory.d.ts +0 -2
- package/dist/src/mcp/tools/project-memory.js +0 -91
- package/dist/src/mcp/tools/project-memory.js.map +0 -1
- package/dist/src/mcp/tools/shared-memory.d.ts +0 -2
- package/dist/src/mcp/tools/shared-memory.js +0 -148
- package/dist/src/mcp/tools/shared-memory.js.map +0 -1
- package/dist/src/mcp/tools/state.d.ts +0 -2
- package/dist/src/mcp/tools/state.js +0 -107
- package/dist/src/mcp/tools/state.js.map +0 -1
- package/dist/src/mcp/tools/trace.d.ts +0 -10
- package/dist/src/mcp/tools/trace.js +0 -102
- package/dist/src/mcp/tools/trace.js.map +0 -1
- package/dist/src/mcp/types.d.ts +0 -29
- package/dist/src/mcp/types.js +0 -7
- package/dist/src/mcp/types.js.map +0 -1
- package/dist/test/catalog.test.d.ts +0 -1
- package/dist/test/catalog.test.js +0 -21
- package/dist/test/catalog.test.js.map +0 -1
- package/dist/test/jira.test.d.ts +0 -1
- package/dist/test/jira.test.js +0 -26
- package/dist/test/jira.test.js.map +0 -1
- package/dist/test/lint.test.d.ts +0 -1
- package/dist/test/lint.test.js +0 -9
- package/dist/test/lint.test.js.map +0 -1
- package/dist/test/sync.test.d.ts +0 -1
- package/dist/test/sync.test.js +0 -15
- package/dist/test/sync.test.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serve.js","sourceRoot":"","sources":["../../../src/slack/serve.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,MAAmB;IACnD,MAAM,SAAS,GAAG,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;IACnD,MAAM,UAAU,CAAC,EAAE,UAAU,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;AAChD,CAAC"}
|
package/dist/src/team/tmux.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ export interface TmuxApi {
|
|
|
18
18
|
killSession(session: string): TmuxResult;
|
|
19
19
|
paneDead(target: string): boolean;
|
|
20
20
|
sessionExists(session: string): boolean;
|
|
21
|
+
listSessions(): string[];
|
|
21
22
|
}
|
|
22
23
|
export declare function makeTmux(runner?: TmuxRunner): TmuxApi;
|
|
23
24
|
export interface WaitForReadyOptions {
|
package/dist/src/team/tmux.js
CHANGED
|
@@ -68,6 +68,15 @@ export function makeTmux(runner = tmuxExec) {
|
|
|
68
68
|
const r = runner(["has-session", "-t", session]);
|
|
69
69
|
return r.status === 0;
|
|
70
70
|
},
|
|
71
|
+
listSessions() {
|
|
72
|
+
const r = runner(["list-sessions", "-F", "#{session_name}"]);
|
|
73
|
+
if (r.status !== 0)
|
|
74
|
+
return [];
|
|
75
|
+
return r.stdout
|
|
76
|
+
.split("\n")
|
|
77
|
+
.map((l) => l.trim())
|
|
78
|
+
.filter((l) => l.length > 0);
|
|
79
|
+
},
|
|
71
80
|
};
|
|
72
81
|
}
|
|
73
82
|
function sleep(ms) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tmux.js","sourceRoot":"","sources":["../../../src/team/tmux.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAU/C,MAAM,UAAU,QAAQ,CAAC,IAAc;IACrC,MAAM,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;IACxD,OAAO;QACL,MAAM,EAAE,CAAC,CAAC,MAAM,IAAI,EAAE;QACtB,MAAM,EAAE,CAAC,CAAC,MAAM,IAAI,EAAE;QACtB,MAAM,EAAE,CAAC,CAAC,MAAM,IAAI,CAAC;KACtB,CAAC;AACJ,CAAC;AAED,MAAM,SAAS,GAAG,0CAA0C,CAAC;AAC7D,MAAM,YAAY,GAAG;IACnB,mBAAmB;IACnB,iBAAiB;IACjB,sBAAsB;IACtB,wBAAwB;CACzB,CAAC;AAEF,0EAA0E;AAC1E,oDAAoD;AACpD,MAAM,aAAa,GAAG,uCAAuC,CAAC;AAE9D,MAAM,UAAU,cAAc,CAAC,QAAgB;IAC7C,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE;QAAE,OAAO,KAAK,CAAC;IACnC,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACnC,KAAK,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QAC3C,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAE,CAAC;QACvB,IAA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C"}
|
|
@@ -0,0 +1,177 @@
|
|
|
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.
|
|
145
|
+
|
|
146
|
+
## Outbound notifications (`omp gateway notify` + `/slack`)
|
|
147
|
+
|
|
148
|
+
The v0.8.0 inbound bridge above handles bidirectional chat (DM the bot → reply). For *outbound*
|
|
149
|
+
notifications (cron job results, ad-hoc "ping me when done", `/slack` in-session), you don't
|
|
150
|
+
need the gateway daemon running — outbound is a stateless REST call to `chat.postMessage`.
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
# Default target lives in ~/.omp/.env (set during `omp env init`):
|
|
154
|
+
SLACK_HOME_CHANNEL=C0BOQV5434G # channel ID, or a user ID like U0123ABCD
|
|
155
|
+
|
|
156
|
+
# One-shot send (uses SLACK_HOME_CHANNEL):
|
|
157
|
+
omp gateway notify --text "deploy finished"
|
|
158
|
+
|
|
159
|
+
# Explicit target overrides:
|
|
160
|
+
omp gateway notify --text "hi #releases" --target slack:C0RELEASE9
|
|
161
|
+
omp gateway notify --text "PR review please" --target slack:U0123ABCD # auto-DMs the user
|
|
162
|
+
|
|
163
|
+
# Inside Copilot — same thing via skill:
|
|
164
|
+
/slack the migration just finished cleanly
|
|
165
|
+
|
|
166
|
+
# Cron job posts its result at end-of-run:
|
|
167
|
+
omp schedule add --id pr-watch --cron "*/15 * * * *" --prompt "..." \
|
|
168
|
+
--notify-target slack:U0123ABCD
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
Accepted target prefixes: `C` (public channel), `G` (private channel), `D` (DM channel),
|
|
172
|
+
`U` (user — we auto-call `conversations.open` to convert to a DM). Append `:<thread_ts>` to
|
|
173
|
+
pin to a thread (or pass `--thread-ts`).
|
|
174
|
+
|
|
175
|
+
Failure codes (`omp gateway notify --json` returns them):
|
|
176
|
+
`MISSING_TOKEN`, `MISSING_TARGET`, `BAD_TARGET`, `BAD_HOME_CHANNEL`, `OPEN_FAILED`,
|
|
177
|
+
`POST_FAILED`, `RATE_LIMITED`, `TIMEOUT`, `NETWORK_ERROR`.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@damian87/omp",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "GitHub Copilot
|
|
3
|
+
"version": "0.9.2",
|
|
4
|
+
"description": "Multi-agent orchestration for GitHub Copilot CLI — autonomous loops (Autopilot, Ralph, UltraQA, Ultrawork), parallel tmux agent teams, a weighted-consensus model council, a Slack chat bridge, durable scheduled jobs, and in-session skills + custom agents. Zero learning curve.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -42,7 +42,15 @@
|
|
|
42
42
|
"copilot",
|
|
43
43
|
"skills",
|
|
44
44
|
"agents",
|
|
45
|
-
"slash-commands"
|
|
45
|
+
"slash-commands",
|
|
46
|
+
"orchestration",
|
|
47
|
+
"multi-agent",
|
|
48
|
+
"ai-agents",
|
|
49
|
+
"tmux",
|
|
50
|
+
"automation",
|
|
51
|
+
"autopilot",
|
|
52
|
+
"slack",
|
|
53
|
+
"cli"
|
|
46
54
|
],
|
|
47
55
|
"license": "MIT",
|
|
48
56
|
"engines": {
|
|
@@ -56,6 +64,7 @@
|
|
|
56
64
|
"vitest": "^3.1.4"
|
|
57
65
|
},
|
|
58
66
|
"dependencies": {
|
|
59
|
-
"@modelcontextprotocol/sdk": "^1.29.0"
|
|
67
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
68
|
+
"@slack/bolt": "^4.4.0"
|
|
60
69
|
}
|
|
61
70
|
}
|
package/plugin.json
CHANGED
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oh-my-copilot",
|
|
3
|
-
"description": "
|
|
4
|
-
"version": "0.
|
|
5
|
-
"author": {
|
|
3
|
+
"description": "Multi-agent orchestration skills for GitHub Copilot CLI — autopilot, ralph, ultrawork, ultraqa, team, council, code-review and more as in-session slash skills + custom agents.",
|
|
4
|
+
"version": "0.9.2",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "Damian Borek",
|
|
7
|
+
"email": "borekdamian@yahoo.pl"
|
|
8
|
+
},
|
|
6
9
|
"license": "MIT",
|
|
7
10
|
"repository": "https://github.com/damian87x/oh-my-copilot",
|
|
8
|
-
"keywords": [
|
|
11
|
+
"keywords": [
|
|
12
|
+
"copilot",
|
|
13
|
+
"skills",
|
|
14
|
+
"agents",
|
|
15
|
+
"slash-commands"
|
|
16
|
+
],
|
|
9
17
|
"skills": ".github/skills/",
|
|
10
18
|
"agents": ".github/agents/",
|
|
11
19
|
"instructions": ".github/copilot-instructions.md",
|
|
@@ -5,6 +5,7 @@ import { fileURLToPath } from "node:url";
|
|
|
5
5
|
const CACHE_TTL_MS = 6 * 60 * 60 * 1000;
|
|
6
6
|
const FETCH_TIMEOUT_MS = 2000;
|
|
7
7
|
const PACKAGE_NAME = "@damian87/omp";
|
|
8
|
+
const VERSION_OVERRIDE_ENV = "OMP_VERSION_OVERRIDE";
|
|
8
9
|
|
|
9
10
|
export function isNewer(latest, current) {
|
|
10
11
|
if (!latest || !current) return false;
|
|
@@ -21,6 +22,8 @@ export function formatUpdateNotice(current, latest) {
|
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
export function readCurrentVersion() {
|
|
25
|
+
const overriddenVersion = process.env[VERSION_OVERRIDE_ENV]?.trim();
|
|
26
|
+
if (overriddenVersion) return overriddenVersion;
|
|
24
27
|
try {
|
|
25
28
|
const here = dirname(fileURLToPath(import.meta.url));
|
|
26
29
|
const pkgPath = join(here, "..", "..", "package.json");
|
package/dist/src/mcp/server.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
2
|
-
import type { ToolDefinition } from "./types.js";
|
|
3
|
-
export interface ServerOptions {
|
|
4
|
-
name?: string;
|
|
5
|
-
version?: string;
|
|
6
|
-
tools: ToolDefinition[];
|
|
7
|
-
}
|
|
8
|
-
export declare function filterToolsByEnv(tools: ToolDefinition[], envValue?: string | undefined): ToolDefinition[];
|
|
9
|
-
export declare function buildMcpServer(options: ServerOptions): Server;
|
|
10
|
-
export declare function runMcpServer(options: ServerOptions): Promise<void>;
|
package/dist/src/mcp/server.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
2
|
-
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
3
|
-
import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
4
|
-
import { textResult } from "./types.js";
|
|
5
|
-
export function filterToolsByEnv(tools, envValue = process.env.OMP_DISABLE_TOOLS ?? process.env.OMC_DISABLE_TOOLS) {
|
|
6
|
-
if (!envValue)
|
|
7
|
-
return tools;
|
|
8
|
-
const disabled = new Set(envValue.split(",").map((s) => s.trim()).filter(Boolean));
|
|
9
|
-
if (disabled.size === 0)
|
|
10
|
-
return tools;
|
|
11
|
-
return tools.filter((t) => !disabled.has(t.category));
|
|
12
|
-
}
|
|
13
|
-
export function buildMcpServer(options) {
|
|
14
|
-
const server = new Server({ name: options.name ?? "oh-my-copilot", version: options.version ?? "0.1.0" }, { capabilities: { tools: {} } });
|
|
15
|
-
server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
16
|
-
tools: options.tools.map((t) => ({
|
|
17
|
-
name: t.name,
|
|
18
|
-
description: t.description,
|
|
19
|
-
inputSchema: t.inputSchema,
|
|
20
|
-
})),
|
|
21
|
-
}));
|
|
22
|
-
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
23
|
-
const tool = options.tools.find((t) => t.name === request.params.name);
|
|
24
|
-
if (!tool)
|
|
25
|
-
return textResult(`Unknown tool: ${request.params.name}`, true);
|
|
26
|
-
try {
|
|
27
|
-
const args = (request.params.arguments ?? {});
|
|
28
|
-
const result = await tool.handler(args);
|
|
29
|
-
return result;
|
|
30
|
-
}
|
|
31
|
-
catch (error) {
|
|
32
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
33
|
-
return textResult(`Error: ${message}`, true);
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
return server;
|
|
37
|
-
}
|
|
38
|
-
export async function runMcpServer(options) {
|
|
39
|
-
const server = buildMcpServer(options);
|
|
40
|
-
const transport = new StdioServerTransport();
|
|
41
|
-
await server.connect(transport);
|
|
42
|
-
console.error(`MCP server running (${options.tools.length} tools)`);
|
|
43
|
-
}
|
|
44
|
-
//# sourceMappingURL=server.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../../src/mcp/server.ts"],"names":[],"mappings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,CAAC,KAAK,CAAC,uBAAuB,OAAO,CAAC,KAAK,CAAC,MAAM,SAAS,CAAC,CAAC;AACtE,CAAC"}
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
import { existsSync, mkdirSync, readdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
|
|
2
|
-
import { dirname, join, resolve } from "node:path";
|
|
3
|
-
import { jsonResult, textResult } from "../types.js";
|
|
4
|
-
const DAY_FILE_RE = /^\d{4}-\d{2}-\d{2}\.md$/;
|
|
5
|
-
const READ_CHAR_BUDGET = 4000;
|
|
6
|
-
function pad(n) {
|
|
7
|
-
return String(n).padStart(2, "0");
|
|
8
|
-
}
|
|
9
|
-
function todayStr(d = new Date()) {
|
|
10
|
-
return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}`;
|
|
11
|
-
}
|
|
12
|
-
function timeStr(d = new Date()) {
|
|
13
|
-
return `${pad(d.getHours())}:${pad(d.getMinutes())}`;
|
|
14
|
-
}
|
|
15
|
-
function dailyDir(cwd) {
|
|
16
|
-
return join(resolve(cwd), ".omp", "memory", "daily");
|
|
17
|
-
}
|
|
18
|
-
function dayFile(cwd, date = todayStr()) {
|
|
19
|
-
return join(dailyDir(cwd), `${date}.md`);
|
|
20
|
-
}
|
|
21
|
-
function parseDay(text) {
|
|
22
|
-
let section = null;
|
|
23
|
-
const goalLines = [];
|
|
24
|
-
const log = [];
|
|
25
|
-
for (const line of text.split("\n")) {
|
|
26
|
-
if (/^#\s+/.test(line))
|
|
27
|
-
continue;
|
|
28
|
-
if (/^##\s+Goal\s*$/i.test(line)) {
|
|
29
|
-
section = "goal";
|
|
30
|
-
continue;
|
|
31
|
-
}
|
|
32
|
-
if (/^##\s+Log\s*$/i.test(line)) {
|
|
33
|
-
section = "log";
|
|
34
|
-
continue;
|
|
35
|
-
}
|
|
36
|
-
if (section === "goal")
|
|
37
|
-
goalLines.push(line);
|
|
38
|
-
// Preserve any non-empty line a user may have hand-written, verbatim (bullets,
|
|
39
|
-
// prose, indented sub-notes). Only blank spacer lines are dropped on round-trip.
|
|
40
|
-
else if (section === "log" && line.trim() !== "")
|
|
41
|
-
log.push(line);
|
|
42
|
-
}
|
|
43
|
-
return { goal: goalLines.join("\n").trim(), log };
|
|
44
|
-
}
|
|
45
|
-
function serializeDay(date, doc) {
|
|
46
|
-
const parts = [`# ${date}`, "", "## Goal", doc.goal.trim(), "", "## Log", ...doc.log];
|
|
47
|
-
return `${parts.join("\n").replace(/\n+$/, "")}\n`;
|
|
48
|
-
}
|
|
49
|
-
function readDay(cwd, date = todayStr()) {
|
|
50
|
-
const p = dayFile(cwd, date);
|
|
51
|
-
if (!existsSync(p))
|
|
52
|
-
return { goal: "", log: [] };
|
|
53
|
-
try {
|
|
54
|
-
return parseDay(readFileSync(p, "utf8"));
|
|
55
|
-
}
|
|
56
|
-
catch {
|
|
57
|
-
return { goal: "", log: [] };
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
function writeDay(cwd, doc, date = todayStr()) {
|
|
61
|
-
const p = dayFile(cwd, date);
|
|
62
|
-
mkdirSync(dirname(p), { recursive: true });
|
|
63
|
-
const tmp = `${p}.tmp.${process.pid}.${Date.now()}`;
|
|
64
|
-
writeFileSync(tmp, serializeDay(date, doc), "utf8");
|
|
65
|
-
renameSync(tmp, p);
|
|
66
|
-
}
|
|
67
|
-
function readRecent(cwd, days) {
|
|
68
|
-
const dir = dailyDir(cwd);
|
|
69
|
-
if (!existsSync(dir))
|
|
70
|
-
return "";
|
|
71
|
-
const files = readdirSync(dir)
|
|
72
|
-
.filter((f) => DAY_FILE_RE.test(f))
|
|
73
|
-
.sort()
|
|
74
|
-
.reverse()
|
|
75
|
-
.slice(0, Math.max(0, days) + 1);
|
|
76
|
-
let out = "";
|
|
77
|
-
for (const f of files) {
|
|
78
|
-
try {
|
|
79
|
-
out += `${readFileSync(join(dir, f), "utf8").trim()}\n\n`;
|
|
80
|
-
}
|
|
81
|
-
catch {
|
|
82
|
-
// skip unreadable day file
|
|
83
|
-
}
|
|
84
|
-
if (out.length > READ_CHAR_BUDGET) {
|
|
85
|
-
out = `${out.slice(0, READ_CHAR_BUDGET)}\n…(truncated)`;
|
|
86
|
-
break;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
return out.trim();
|
|
90
|
-
}
|
|
91
|
-
export const dailyLogTools = [
|
|
92
|
-
{
|
|
93
|
-
name: "daily_log_set_goal",
|
|
94
|
-
category: "daily_log",
|
|
95
|
-
description: "Set/replace today's Goal in .omp/memory/daily/<today>.md.",
|
|
96
|
-
inputSchema: {
|
|
97
|
-
type: "object",
|
|
98
|
-
properties: { goal: { type: "string" }, cwd: { type: "string" } },
|
|
99
|
-
required: ["goal"],
|
|
100
|
-
},
|
|
101
|
-
handler: (args) => {
|
|
102
|
-
const cwd = args.cwd ?? process.cwd();
|
|
103
|
-
const doc = readDay(cwd);
|
|
104
|
-
doc.goal = String(args.goal ?? "");
|
|
105
|
-
writeDay(cwd, doc);
|
|
106
|
-
return jsonResult({ ok: true, date: todayStr(), goal: doc.goal });
|
|
107
|
-
},
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
name: "daily_log_add",
|
|
111
|
-
category: "daily_log",
|
|
112
|
-
description: "Append a timestamped entry to today's Log in .omp/memory/daily/<today>.md.",
|
|
113
|
-
inputSchema: {
|
|
114
|
-
type: "object",
|
|
115
|
-
properties: { text: { type: "string" }, cwd: { type: "string" } },
|
|
116
|
-
required: ["text"],
|
|
117
|
-
},
|
|
118
|
-
handler: (args) => {
|
|
119
|
-
const cwd = args.cwd ?? process.cwd();
|
|
120
|
-
// Collapse to a single line so an entry can never contain a `## Goal`/`## Log`
|
|
121
|
-
// marker that parseDay would later misread as a section boundary.
|
|
122
|
-
const text = String(args.text ?? "")
|
|
123
|
-
.replace(/\s*\n\s*/g, " ")
|
|
124
|
-
.trim();
|
|
125
|
-
if (!text)
|
|
126
|
-
return jsonResult({ ok: false, error: "text is required" });
|
|
127
|
-
const doc = readDay(cwd);
|
|
128
|
-
doc.log.push(`- ${timeStr()} — ${text}`);
|
|
129
|
-
writeDay(cwd, doc);
|
|
130
|
-
return jsonResult({ ok: true, date: todayStr(), count: doc.log.length });
|
|
131
|
-
},
|
|
132
|
-
},
|
|
133
|
-
{
|
|
134
|
-
name: "daily_log_read",
|
|
135
|
-
category: "daily_log",
|
|
136
|
-
description: "Read the daily log for today plus the previous `days` days (default 1). Char-capped to ~4KB.",
|
|
137
|
-
inputSchema: {
|
|
138
|
-
type: "object",
|
|
139
|
-
properties: { days: { type: "number" }, cwd: { type: "string" } },
|
|
140
|
-
},
|
|
141
|
-
handler: (args) => {
|
|
142
|
-
const cwd = args.cwd ?? process.cwd();
|
|
143
|
-
const days = typeof args.days === "number" ? args.days : 1;
|
|
144
|
-
return textResult(readRecent(cwd, days) || "(no daily log entries)");
|
|
145
|
-
},
|
|
146
|
-
},
|
|
147
|
-
];
|
|
148
|
-
//# sourceMappingURL=daily-log.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"daily-log.js","sourceRoot":"","sources":["../../../../src/mcp/tools/daily-log.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACtG,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAuB,MAAM,aAAa,CAAC;AAO1E,MAAM,WAAW,GAAG,yBAAyB,CAAC;AAC9C,MAAM,gBAAgB,GAAG,IAAI,CAAC;AAE9B,SAAS,GAAG,CAAC,CAAS;IACpB,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AACpC,CAAC;AAED,SAAS,QAAQ,CAAC,CAAC,GAAG,IAAI,IAAI,EAAE;IAC9B,OAA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,IAAI,wBAAwB,CAAC,CAAC;QACvE,CAAC;KACF;CACF,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { ToolDefinition } from "../types.js";
|
|
2
|
-
import { stateTools } from "./state.js";
|
|
3
|
-
import { notepadTools } from "./notepad.js";
|
|
4
|
-
import { projectMemoryTools } from "./project-memory.js";
|
|
5
|
-
import { sharedMemoryTools } from "./shared-memory.js";
|
|
6
|
-
import { traceTools } from "./trace.js";
|
|
7
|
-
export declare const allTools: ToolDefinition[];
|
|
8
|
-
export { stateTools, notepadTools, projectMemoryTools, sharedMemoryTools, traceTools };
|
|
9
|
-
export { appendTraceEntry } from "./trace.js";
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { stateTools } from "./state.js";
|
|
2
|
-
import { notepadTools } from "./notepad.js";
|
|
3
|
-
import { projectMemoryTools } from "./project-memory.js";
|
|
4
|
-
import { sharedMemoryTools } from "./shared-memory.js";
|
|
5
|
-
import { traceTools } from "./trace.js";
|
|
6
|
-
export const allTools = [
|
|
7
|
-
...stateTools,
|
|
8
|
-
...notepadTools,
|
|
9
|
-
...projectMemoryTools,
|
|
10
|
-
...sharedMemoryTools,
|
|
11
|
-
...traceTools,
|
|
12
|
-
];
|
|
13
|
-
export { stateTools, notepadTools, projectMemoryTools, sharedMemoryTools, traceTools };
|
|
14
|
-
export { appendTraceEntry } from "./trace.js";
|
|
15
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/mcp/tools/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,MAAM,CAAC,MAAM,QAAQ,GAAqB;IACxC,GAAG,UAAU;IACb,GAAG,YAAY;IACf,GAAG,kBAAkB;IACrB,GAAG,iBAAiB;IACpB,GAAG,UAAU;CACd,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,UAAU,EAAE,CAAC;AACvF,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC"}
|