@gramatr/opencode-plugin 0.21.0 → 0.21.1
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 +35 -33
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,34 +4,15 @@
|
|
|
4
4
|
|
|
5
5
|
# @gramatr/opencode-plugin
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
plugin events (`session.created`, `message.updated`, `tool.execute.before`,
|
|
9
|
-
`session.idle`, `session.compacted`) to grāmatr hooks — pre-classifying every
|
|
10
|
-
prompt through the remote MCP server at `api.gramatr.com/mcp`, restoring
|
|
11
|
-
session continuity on start, and enforcing git-gate hard rules before
|
|
12
|
-
destructive shell commands run. Same intelligent context engineering layer
|
|
13
|
-
used across Claude Code, ChatGPT, Cursor, Codex, and Gemini.
|
|
7
|
+
> Real-time intelligent context engineering, in OpenCode.
|
|
14
8
|
|
|
15
|
-
##
|
|
16
|
-
|
|
17
|
-
- **Cheaper, faster prompts.** A multi-head classification pipeline pre-routes
|
|
18
|
-
each request and replaces the tens-of-thousands-token system prompt you'd
|
|
19
|
-
otherwise hand-maintain. The effect compounds the longer you work.
|
|
20
|
-
- **Consistent behavior across sessions.** The same contract — directives plus
|
|
21
|
-
quality gates — runs on every prompt, so your AI acts the same on session
|
|
22
|
-
200 as on session 1.
|
|
23
|
-
- **Continuity across tools.** A session you start in OpenCode resumes
|
|
24
|
-
cleanly in Claude Code, Cursor, or the web — the handoff is persisted by
|
|
25
|
-
the same backend.
|
|
26
|
-
- **Auditable safety rails.** Per-prompt hard gates (e.g. `git push --force`
|
|
27
|
-
to `main` is blocked locally before the tool runs).
|
|
28
|
-
|
|
29
|
-
## Install
|
|
9
|
+
## Install in 30 seconds
|
|
30
10
|
|
|
31
11
|
Add both entries to your `opencode.json`:
|
|
32
12
|
|
|
33
13
|
```json
|
|
34
14
|
{
|
|
15
|
+
"$schema": "https://opencode.ai/config.json",
|
|
35
16
|
"mcp": {
|
|
36
17
|
"gramatr": {
|
|
37
18
|
"type": "remote",
|
|
@@ -45,21 +26,42 @@ Add both entries to your `opencode.json`:
|
|
|
45
26
|
}
|
|
46
27
|
```
|
|
47
28
|
|
|
48
|
-
OpenCode will fetch the
|
|
49
|
-
required
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
connect, OpenCode prompts you to visit a short URL and paste a user code —
|
|
56
|
-
the same flow used in SSH, WSL, and CI environments where a browser
|
|
57
|
-
redirect can't reach the client. Tokens are stored by OpenCode's MCP
|
|
58
|
-
client; the plugin never handles raw credentials.
|
|
29
|
+
Restart OpenCode. It will fetch the plugin from npm at startup (no global
|
|
30
|
+
install required) and prompt you through OAuth Device Authorization
|
|
31
|
+
([RFC 8628](https://datatracker.ietf.org/doc/html/rfc8628)) on first
|
|
32
|
+
connect — visit the short URL, paste the user code, you're in. Works in
|
|
33
|
+
SSH, WSL, and CI where browser redirects can't reach the client. Tokens
|
|
34
|
+
are stored by OpenCode's MCP client; the plugin never handles raw
|
|
35
|
+
credentials.
|
|
59
36
|
|
|
60
37
|
If you don't have a grāmatr account yet, sign up at
|
|
61
38
|
[gramatr.com](https://gramatr.com).
|
|
62
39
|
|
|
40
|
+
## What this gets you
|
|
41
|
+
|
|
42
|
+
- **Cheaper, faster prompts.** A multi-head classification pipeline pre-routes
|
|
43
|
+
each request and replaces the tens-of-thousands-token system prompt you'd
|
|
44
|
+
otherwise hand-maintain. The effect compounds the longer you work.
|
|
45
|
+
- **Consistent behavior across sessions.** The same contract — directives plus
|
|
46
|
+
quality gates — runs on every prompt, so your AI acts the same on session
|
|
47
|
+
200 as on session 1.
|
|
48
|
+
- **Continuity across tools.** A session you start in OpenCode resumes
|
|
49
|
+
cleanly in Claude Code, Cursor, or the web — the handoff is persisted by
|
|
50
|
+
the same backend.
|
|
51
|
+
- **Auditable safety rails.** Per-prompt hard gates (e.g. `git push --force`
|
|
52
|
+
to `main` is blocked locally before the tool runs).
|
|
53
|
+
|
|
54
|
+
## What this package is
|
|
55
|
+
|
|
56
|
+
`@gramatr/opencode-plugin` is a lifecycle plugin for [OpenCode](https://opencode.ai).
|
|
57
|
+
It maps OpenCode's plugin events (`session.created`, `message.updated`,
|
|
58
|
+
`tool.execute.before`, `session.idle`, `session.compacted`) to grāmatr
|
|
59
|
+
hooks — pre-classifying every prompt through the remote MCP server at
|
|
60
|
+
`api.gramatr.com/mcp`, restoring session continuity on start, and
|
|
61
|
+
enforcing git-gate hard rules before destructive shell commands run. The
|
|
62
|
+
same intelligent context engineering layer used across Claude Code,
|
|
63
|
+
ChatGPT, Cursor, Codex, and Gemini.
|
|
64
|
+
|
|
63
65
|
## How it works
|
|
64
66
|
|
|
65
67
|
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gramatr/opencode-plugin",
|
|
3
|
-
"version": "0.21.
|
|
3
|
+
"version": "0.21.1",
|
|
4
4
|
"description": "grāmatr lifecycle plugin for OpenCode — maps OpenCode plugin events to grāmatr hooks via the connected MCP client (route_request injection, session continuity, git-gate).",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"publishConfig": {
|