@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.
- package/README.md +14 -17
- package/dist/bin.js +13 -2
- 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
|
-
```
|
|
15
|
-
|
|
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
|
-
|
|
35
|
-
`
|
|
36
|
-
|
|
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 =
|
|
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] ?? "");
|