@prom.codes/saver 0.1.3 → 0.1.4

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/README.md +14 -17
  2. package/dist/bin.js +13 -2
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -9,21 +9,16 @@ caveats and destructive sequences **verbatim**.
9
9
  It is the third prom.codes tool, alongside **prom.codes Context** (code retrieval)
10
10
  and **prom.codes Memory** (agent memory).
11
11
 
12
- ## Quick start
13
-
14
- ```jsonc
15
- // Claude Desktop / Cursor MCP config
16
- {
17
- "mcpServers": {
18
- "saver": {
19
- "command": "npx",
20
- "args": ["-y", "@prom.codes/saver@latest"],
21
- "env": { "PROMETHEUS_WORKSPACE_ROOT": "/absolute/path/to/your/repo" }
22
- }
23
- }
24
- }
12
+ ## Quick start (Claude Code)
13
+
14
+ ```bash
15
+ claude mcp add saver -- npx -y @prom.codes/saver@latest
25
16
  ```
26
17
 
18
+ No key needed. `claude mcp add` defaults to local scope; add `--scope project`
19
+ for a committable `.mcp.json`. Other hosts (Cursor, VS Code) use the same
20
+ command/args in their own config.
21
+
27
22
  Then ask your agent to run `setup` once per workspace. Levels: `lite` (filler
28
23
  only), `balanced` (default — lean, not terse), `aggressive` (telegraphic, opt-in,
29
24
  never for code/destructive work). The rules keep code, caveats, destructive steps
@@ -31,8 +26,10 @@ and anything the agent needs later **verbatim** — it shapes phrasing, never wh
31
26
  agent does or remembers.
32
27
 
33
28
  No database and no native modules — `npx` works turnkey everywhere (Node ≥ 20.10).
34
- An API key is **optional**: Saver works fully without one, and accepts the same
35
- `PROMETHEUS_API_KEY` (`prom_live_…`) as prom.codes Context and Memory to tie the
36
- install to your account.
29
+ The workspace is auto-detected (Claude Code `CLAUDE_PROJECT_DIR`); set
30
+ `PROMETHEUS_WORKSPACE_ROOT` only to target a different folder. An API key is
31
+ **optional**: the Saver works fully without one, and accepts the same
32
+ `PROMETHEUS_API_KEY` (`prom_live_<tag>_<secret>`) as prom.codes Context and
33
+ Memory to tie the install to your account.
37
34
 
38
- Docs: https://prom.codes/docs
35
+ Docs: https://prom.codes/docs/mcp/saver
package/dist/bin.js CHANGED
@@ -1,7 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  // dist/bin.js
4
- import { resolve } from "node:path";
5
4
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
6
5
 
7
6
  // dist/key.js
@@ -14,6 +13,18 @@ function classifyKey(raw) {
14
13
  return KEY_PATTERN.test(key) ? "valid" : "malformed";
15
14
  }
16
15
 
16
+ // dist/workspace.js
17
+ import { resolve } from "node:path";
18
+ function resolveWorkspaceRoot(env = process.env) {
19
+ const explicit = (env.PROMETHEUS_WORKSPACE_ROOT ?? "").trim();
20
+ if (explicit !== "")
21
+ return resolve(explicit);
22
+ const claude = (env.CLAUDE_PROJECT_DIR ?? "").trim();
23
+ if (claude !== "")
24
+ return resolve(claude);
25
+ return resolve(process.cwd());
26
+ }
27
+
17
28
  // dist/tools.js
18
29
  import { z } from "zod";
19
30
 
@@ -180,7 +191,7 @@ function createServer(deps, options = {}) {
180
191
 
181
192
  // dist/bin.js
182
193
  async function main() {
183
- const workspaceRoot = resolve(process.env.PROMETHEUS_WORKSPACE_ROOT ?? process.cwd());
194
+ const workspaceRoot = resolveWorkspaceRoot(process.env);
184
195
  const rawKey = process.env[API_KEY_ENV];
185
196
  const keyState = classifyKey(rawKey);
186
197
  const requireKey = /^(1|true|yes|on)$/i.test(process.env[REQUIRE_KEY_ENV] ?? "");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom.codes/saver",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "prom.codes Saver — cut token cost without cutting quality, as an MCP installer.",
5
5
  "type": "module",
6
6
  "bin": {