@gramatr/opencode-plugin 0.20.82 → 0.20.84

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.
Files changed (3) hide show
  1. package/LICENSE +71 -26
  2. package/README.md +104 -0
  3. package/package.json +1 -1
package/LICENSE CHANGED
@@ -1,18 +1,19 @@
1
- Gramatr License v1.0
1
+ grāmatr License v1.0
2
2
 
3
- Copyright (c) gramatr. All rights reserved.
3
+ Copyright (c) 2025-2026 gramatr, LLC. All rights reserved.
4
4
 
5
5
  1. License grant
6
6
 
7
- Subject to the terms of this license, gramatr grants you a limited, revocable,
8
- non-exclusive, non-transferable, non-sublicensable license to install and use
9
- the gramatr client software solely as a client for authorized gramatr services.
7
+ Subject to the terms of this license, gramatr, LLC grants you a limited,
8
+ revocable, non-exclusive, non-transferable, non-sublicensable license to install
9
+ and use the grāmatr client software solely as a client for authorized grāmatr
10
+ services.
10
11
 
11
12
  2. Permitted use
12
13
 
13
14
  You may:
14
15
  - install and use the client software for personal or internal business use;
15
- - connect the software to gramatr-hosted services or other gramatr-authorized
16
+ - connect the software to grāmatr-hosted services or other grāmatr-authorized
16
17
  service endpoints;
17
18
  - make copies only as necessary for backup, installation, and normal use.
18
19
 
@@ -22,39 +23,42 @@ You may not:
22
23
  - sell, sublicense, rent, lease, distribute, publish, or otherwise make the
23
24
  software available to third parties as a standalone product;
24
25
  - modify, create derivative works of, reverse engineer, decompile, or
25
- disassemble the software, except to the limited extent such restriction is
26
- prohibited by applicable law;
26
+ disassemble the software, except (i) to the limited extent such restriction
27
+ is prohibited by applicable law, and (ii) for the purposes expressly
28
+ permitted by 17 U.S.C. § 1201(f) (interoperability) and § 1201(g)
29
+ (encryption research);
27
30
  - use the software to access or operate an unauthorized competing hosted
28
- service based on gramatr technology;
31
+ service based on grāmatr technology;
29
32
  - remove or alter any proprietary notices, trademarks, or attribution;
30
- - use the software in violation of applicable law or the gramatr service terms.
33
+ - use the software in violation of applicable law or the grāmatr service terms.
31
34
 
32
35
  4. Server and service components
33
36
 
34
37
  The server-side components of this repository (including but not limited to the
35
38
  intelligence layer, persistence layer, gateway, and MCP server) are proprietary
36
- and confidential. No license is granted for hosting, deploying, or operating the
37
- server components outside of gramatr-authorized infrastructure.
39
+ and confidential to gramatr, LLC. No license is granted for hosting, deploying,
40
+ or operating the server components outside of infrastructure authorized by
41
+ gramatr, LLC.
38
42
 
39
43
  5. Service dependency
40
44
 
41
- The client software is intended to be used with authenticated gramatr backend
45
+ The client software is intended to be used with authenticated grāmatr backend
42
46
  services. Access to those services may require an account, API key, accepted
43
- terms, and an active subscription or other authorization. gramatr may change,
44
- suspend, or discontinue service access in accordance with applicable service
45
- terms.
47
+ terms, and an active subscription or other authorization. gramatr, LLC may
48
+ change, suspend, or discontinue service access in accordance with applicable
49
+ service terms.
46
50
 
47
51
  6. Ownership
48
52
 
49
- The software is licensed, not sold. gramatr and its licensors retain all
53
+ The software is licensed, not sold. gramatr, LLC and its licensors retain all
50
54
  right, title, and interest in and to the software, including all intellectual
51
55
  property rights.
52
56
 
53
57
  7. Updates
54
58
 
55
- gramatr may provide updates, patches, or new versions under this same license
56
- or under updated license terms. Continued use of an updated version constitutes
57
- acceptance of the updated terms if they are presented to you.
59
+ gramatr, LLC may provide updates, patches, or new versions under this same
60
+ license or under updated license terms. Continued use of an updated version
61
+ constitutes acceptance of the updated terms if they are presented to you.
58
62
 
59
63
  8. Termination
60
64
 
@@ -62,7 +66,10 @@ This license terminates automatically if you violate these terms. Upon
62
66
  termination, you must stop using the software and delete all copies in your
63
67
  possession or control.
64
68
 
65
- 9. Disclaimer
69
+ 9. DISCLAIMER OF WARRANTIES — READ CAREFULLY
70
+
71
+ This section disclaims warranties to the maximum extent permitted by applicable
72
+ law, including Mo. Rev. Stat. § 400.2-316. Read it carefully.
66
73
 
67
74
  THE SOFTWARE IS PROVIDED "AS IS" AND "AS AVAILABLE," WITHOUT WARRANTIES OF ANY
68
75
  KIND, WHETHER EXPRESS, IMPLIED, OR STATUTORY, INCLUDING IMPLIED WARRANTIES OF
@@ -71,7 +78,7 @@ TO THE MAXIMUM EXTENT PERMITTED BY LAW.
71
78
 
72
79
  10. Limitation of liability
73
80
 
74
- TO THE MAXIMUM EXTENT PERMITTED BY LAW, GRAMATR WILL NOT BE LIABLE FOR ANY
81
+ TO THE MAXIMUM EXTENT PERMITTED BY LAW, GRAMATR, LLC WILL NOT BE LIABLE FOR ANY
75
82
  INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL, EXEMPLARY, OR PUNITIVE DAMAGES,
76
83
  OR FOR ANY LOSS OF DATA, REVENUE, PROFITS, GOODWILL, OR BUSINESS INTERRUPTION,
77
84
  ARISING OUT OF OR RELATED TO THE SOFTWARE OR ITS USE, EVEN IF ADVISED OF THE
@@ -79,7 +86,45 @@ POSSIBILITY OF SUCH DAMAGES.
79
86
 
80
87
  11. Governing terms
81
88
 
82
- Use of the gramatr backend service is governed separately by gramatr Terms of
83
- Service and Privacy Policy. If there is a conflict between this license and the
84
- service terms with respect to backend service use, the service terms control
85
- for backend access and service behavior.
89
+ Use of the grāmatr backend service is governed separately by the gramatr, LLC
90
+ Terms of Service (https://gramatr.com/terms/) and Privacy Policy
91
+ (https://gramatr.com/privacy/). If there is a conflict between this license
92
+ and the service terms with respect to backend service use, the service terms
93
+ control for backend access and service behavior.
94
+
95
+ 12. Trademarks
96
+
97
+ "grāmatr", "gramatr", and the grāmatr logo are trademarks of gramatr, LLC. All
98
+ other product names, logos, and brands are the property of their respective
99
+ owners. Nothing in this license grants you any right to use those marks except
100
+ as required for accurate attribution permitted by applicable law.
101
+
102
+ 13. Governing law and venue
103
+
104
+ This license is governed by and construed in accordance with the laws of the
105
+ State of Missouri, without regard to its conflict-of-law principles. The
106
+ exclusive venue for any dispute arising under or relating to this license shall
107
+ be the state and federal courts located in St. Louis County, Missouri, and the
108
+ parties consent to the personal jurisdiction of those courts.
109
+
110
+ 14. Severability
111
+
112
+ If any provision of this license is held to be invalid, illegal, or
113
+ unenforceable by a court of competent jurisdiction, that provision shall be
114
+ enforced to the maximum extent permissible and the remaining provisions shall
115
+ continue in full force and effect.
116
+
117
+ 15. Consumer-rights savings
118
+
119
+ Nothing in this license waives or limits any non-waivable right under the
120
+ Missouri Merchandising Practices Act (Mo. Rev. Stat. §§ 407.010 et seq.) or
121
+ analogous consumer-protection statutes of the user's state of residence. Where
122
+ a provision of this license is unenforceable against a consumer under such
123
+ statutes, that provision shall be read down to the minimum extent necessary
124
+ for enforceability and the remainder of this license shall remain in effect.
125
+
126
+ 16. Notice and contact
127
+
128
+ Notices to gramatr, LLC under this license may be sent to legal@gramatr.com.
129
+ gramatr, LLC may give notice to you by email to the address associated with
130
+ your account or by posting in the grāmatr product surface.
package/README.md ADDED
@@ -0,0 +1,104 @@
1
+ <p align="center">
2
+ <img alt="grāmatr" src="https://gramatr.com/brand/g-dark-sq.png" width="128" height="128">
3
+ </p>
4
+
5
+ # @gramatr/opencode-plugin
6
+
7
+ grāmatr lifecycle plugin for [OpenCode](https://opencode.ai). Maps OpenCode's
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.
14
+
15
+ ## What you get
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
30
+
31
+ Add both entries to your `opencode.json`:
32
+
33
+ ```json
34
+ {
35
+ "mcp": {
36
+ "gramatr": {
37
+ "type": "remote",
38
+ "url": "https://api.gramatr.com/mcp",
39
+ "enabled": true
40
+ }
41
+ },
42
+ "plugin": [
43
+ "@gramatr/opencode-plugin"
44
+ ]
45
+ }
46
+ ```
47
+
48
+ OpenCode will fetch the package from npm on next start. No global install
49
+ required.
50
+
51
+ ## Authentication
52
+
53
+ The remote MCP connector authenticates via OAuth 2.0 Device Authorization
54
+ Grant ([RFC 8628](https://datatracker.ietf.org/doc/html/rfc8628)). On first
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.
59
+
60
+ If you don't have a grāmatr account yet, sign up at
61
+ [gramatr.com](https://gramatr.com).
62
+
63
+ ## How it works
64
+
65
+ ```
66
+ OpenCode
67
+
68
+ ├── plugin: @gramatr/opencode-plugin ──┐
69
+ │ │ lifecycle events
70
+ │ │ (session.created, message.updated, …)
71
+ │ ▼
72
+ └── mcp.gramatr (remote, OAuth) ──► api.gramatr.com/mcp
73
+ (route_request, load_handoff,
74
+ save_reflection, …)
75
+ ```
76
+
77
+ The plugin is a thin connector: every grāmatr hook is invoked against the
78
+ already-connected remote MCP server declared in the `mcp` block — there is
79
+ no local binary, no `execSync`, no shell-out. Guidance from the server is
80
+ injected into the active session as a `noReply` system message so the model
81
+ sees it before formulating its next response.
82
+
83
+ When OpenCode's plugin API exposes a typed `client.callTool()`, the
84
+ connector will switch to direct MCP tool invocation and drop the
85
+ prompt-injection path.
86
+
87
+ ## Requirements
88
+
89
+ - OpenCode with `@opencode-ai/plugin` ≥ 1.0.0
90
+ - Node.js ≥ 22
91
+ - Network access to `https://api.gramatr.com/mcp`
92
+
93
+ ## Links
94
+
95
+ - Docs: [gramatr.com/docs](https://gramatr.com/docs)
96
+ - OpenCode plugin reference: [opencode.ai/docs/plugins](https://opencode.ai/docs/plugins/)
97
+ - Source manifest: [`contracts/mcp/opencode-plugin-manifest.yaml`](https://github.com/gramatr/gramatr/blob/main/contracts/mcp/opencode-plugin-manifest.yaml)
98
+ - Privacy: [gramatr.com/privacy](https://gramatr.com/privacy/)
99
+ - Terms: [gramatr.com/terms](https://gramatr.com/terms/)
100
+ - Support: [support@gramatr.com](mailto:support@gramatr.com)
101
+
102
+ ## License
103
+
104
+ See [LICENSE](LICENSE) in this package.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gramatr/opencode-plugin",
3
- "version": "0.20.82",
3
+ "version": "0.20.84",
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": {