gramatr 0.3.47 → 0.3.49

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 CHANGED
@@ -1,78 +1,108 @@
1
- # grāmatr Client Package
1
+ # gramatr
2
2
 
3
- This package contains the shared grāmatr client runtime plus per-target adapters.
3
+ **Intelligence layer for AI coding agents.** Pre-classifies every request so Claude Code, Codex, and Gemini CLI spend tokens on your work, not on routing overhead.
4
4
 
5
- Current target model:
5
+ ## What it does
6
6
 
7
- - local / thick-client targets
8
- - `claude-code`
9
- - `codex`
10
- - hosted / remote targets
11
- - `remote-mcp`
12
- - `claude-web`
13
- - `chatgpt-web`
7
+ gramatr sits between you and your AI agent. Before the agent sees your prompt, gramatr's decision router (BERT classifiers running in <5ms) pre-classifies:
14
8
 
15
- The important distinction is that hosted targets are not local hook installs. They use remote MCP or future hosted-client packaging.
9
+ - **Effort level** instant, fast, standard, extended, advanced, deep, comprehensive
10
+ - **Intent type** — search, retrieve, create, update, analyze, generate
11
+ - **Skill matching** — which of 25 capabilities are relevant
12
+ - **Memory tier** — what context to pre-load from your knowledge graph
13
+ - **Reverse engineering** — what you want, what you don't want, gotchas
16
14
 
17
- ## CLI
15
+ The agent receives this as a pre-computed intelligence packet, saving ~2,700 tokens per request that would otherwise be spent on the agent figuring out what you need.
18
16
 
19
- The package exposes a `gramatr` CLI:
17
+ ## Install
20
18
 
21
19
  ```bash
22
- gramatr install
23
- gramatr install claude-code
24
- gramatr install codex
25
- gramatr install all
26
- gramatr detect
27
- gramatr doctor
28
- gramatr migrate
29
- gramatr migrate --apply
30
- gramatr upgrade
20
+ npx gramatr install claude-code
31
21
  ```
32
22
 
33
- ## Command Behavior
23
+ That's it. One command installs hooks, registers the MCP server, and configures your AI agent.
34
24
 
35
- - `gramatr install`
36
- - interactive local target selection
37
- - installs local adapter(s)
38
- - prints remote target guidance separately
39
- - `gramatr detect`
40
- - reports detected local targets and known hosted targets
41
- - `gramatr doctor`
42
- - reports current target detection, payload presence, and stale legacy artifacts
43
- - `gramatr migrate`
44
- - dry-run legacy cleanup and Claude config sanitization
45
- - `gramatr migrate --apply`
46
- - applies legacy cleanup and configuration sanitization
47
- - `gramatr upgrade`
48
- - performs migration cleanup when needed, then re-syncs detected local targets
25
+ ### Non-interactive (CI, remote provisioning)
49
26
 
50
- ## Thin-Client Default
27
+ ```bash
28
+ npx gramatr install claude-code --yes --name "Your Name" --timezone "America/Chicago"
29
+ ```
51
30
 
52
- Claude installs now default to the thin-client hook set.
31
+ ### Supported platforms
53
32
 
54
- Optional Claude UX hooks are disabled by default and can be enabled with:
33
+ | Platform | Status | Install |
34
+ |---|---|---|
35
+ | Claude Code | Stable | `npx gramatr install claude-code` |
36
+ | OpenAI Codex | Stable | Auto-detected during install |
37
+ | Google Gemini CLI | Stable | Auto-detected during install |
38
+ | Claude Desktop | Coming soon | — |
39
+ | ChatGPT Desktop | Coming soon | — |
55
40
 
56
- ```bash
57
- GMTR_ENABLE_OPTIONAL_CLAUDE_UX=1
41
+ ## How it works
42
+
43
+ ```
44
+ You type a prompt
45
+ |
46
+ gramatr hooks intercept (UserPromptSubmit)
47
+ |
48
+ Decision router classifies in <5ms (BERT on GPU)
49
+ |
50
+ Intelligence packet injected into agent context
51
+ |
52
+ Agent receives pre-classified request
53
+ = skips routing overhead
54
+ = starts working immediately
55
+ = saves ~2,700 tokens per request
58
56
  ```
59
57
 
60
- ## Development
58
+ ### The flywheel
61
59
 
62
- Install dependencies:
60
+ Every interaction trains the classifier. Memory powers routing, routing generates patterns, patterns improve routing. The system gets smarter with use.
63
61
 
64
- ```bash
65
- pnpm install --frozen-lockfile
66
- ```
62
+ ## Architecture
67
63
 
68
- Run package tests:
64
+ gramatr is a thin client + smart server:
69
65
 
70
- ```bash
71
- pnpm --filter @aios-v2/client test
66
+ - **Client** (this package): 29 files, ~290KB. Hooks into your AI agent, forwards to server.
67
+ - **Server**: Decision routing engine (BERT + Qwen), knowledge graph (PostgreSQL + pgvector), pattern learning.
68
+ - **Protocol**: MCP (Model Context Protocol) for Claude Code/Codex, REST API for web/mobile.
69
+
70
+ The client never stores intelligence locally. The server delivers everything: behavioral rules, skill routing, agent composition, ISC scaffolds, capability audits.
71
+
72
+ ## What gets installed
73
+
74
+ ```
75
+ ~/gmtr-client/ # Client runtime
76
+ hooks/ # 8 lifecycle hooks
77
+ core/ # Shared routing + session logic
78
+ bin/ # Status line, login, utilities
79
+ CLAUDE.md # Minimal behavioral framework
80
+ ~/.claude/settings.json # Hook configuration (merged, not overwritten)
81
+ ~/.claude.json # MCP server registration
82
+ ~/.gmtr.json # Auth token (canonical source)
72
83
  ```
73
84
 
74
- Run target detection locally:
85
+ ## Commands
75
86
 
76
87
  ```bash
77
- pnpm --filter @aios-v2/client exec bun bin/gramatr.ts detect
88
+ gramatr install # Interactive target selection
89
+ gramatr install claude-code # Install for Claude Code
90
+ gramatr detect # Show detected AI platforms
91
+ gramatr doctor # Health check (coming soon)
92
+ gramatr uninstall # Clean removal
93
+ gramatr --version # Show version
78
94
  ```
95
+
96
+ ## Requirements
97
+
98
+ - Node.js 20+
99
+ - One of: Claude Code, OpenAI Codex, Google Gemini CLI
100
+
101
+ ## Links
102
+
103
+ - [gramatr.com](https://gramatr.com)
104
+ - [GitHub](https://github.com/gramatr/gramatr)
105
+
106
+ ## License
107
+
108
+ MIT
package/core/version.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  /** Auto-generated by version-sync.ts — do not edit */
2
- export const VERSION = '0.3.47';
2
+ export const VERSION = '0.3.49';
package/gemini/install.ts CHANGED
@@ -130,7 +130,12 @@ async function resolveApiKey(home: string): Promise<string | null> {
130
130
  log(' Environment token is invalid.');
131
131
  }
132
132
 
133
- // 3. Prompt
133
+ // 3. Prompt (skip in non-interactive mode)
134
+ const nonInteractive = process.argv.includes('--yes') || process.argv.includes('-y') || !process.stdin.isTTY;
135
+ if (nonInteractive) {
136
+ log(' Non-interactive: no token found. Run gmtr-login after install.');
137
+ return null;
138
+ }
134
139
  const prompted = await promptForApiKey();
135
140
  if (prompted) {
136
141
  log(' Testing token...');
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "gramatr",
3
- "version": "0.3.47",
4
- "description": "gramatr — your cross-agent AI brain. Intelligence layer for Claude Code, Codex, Gemini CLI.",
3
+ "version": "0.3.49",
4
+ "description": "gramatr — intelligence layer for AI coding agents. Pre-classifies every request so Claude Code, Codex, and Gemini CLI spend tokens on your work, not on routing overhead.",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
@@ -12,13 +12,20 @@
12
12
  "keywords": [
13
13
  "ai",
14
14
  "claude",
15
+ "claude-code",
16
+ "codex",
17
+ "gemini",
15
18
  "mcp",
19
+ "mcp-server",
20
+ "ai-agent",
16
21
  "intelligence",
17
- "routing",
22
+ "decision-routing",
18
23
  "classifier",
19
- "memory",
20
- "codex",
21
- "gemini"
24
+ "bert",
25
+ "prompt-engineering",
26
+ "token-savings",
27
+ "hooks",
28
+ "developer-tools"
22
29
  ],
23
30
  "bin": {
24
31
  "gramatr": "./bin/gramatr.js"