prism-mcp-server 20.0.8 → 20.2.0
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 +49 -12
- package/dist/boundaries/boundaries.js +2 -2
- package/dist/cli.js +62 -0
- package/dist/connect.js +560 -0
- package/dist/onboarding/wizard.js +6 -29
- package/dist/tools/__tests__/layer1Integration.test.js +97 -5
- package/dist/tools/prismInferHandler.js +128 -12
- package/dist/utils/entitlements.js +38 -10
- package/dist/utils/inferenceMetrics.js +19 -1
- package/dist/utils/layer1.js +57 -10
- package/dist/utils/modelPicker.js +12 -3
- package/package.json +3 -1
- package/dist/utils/groundingVerifier.js +0 -203
package/README.md
CHANGED
|
@@ -18,6 +18,32 @@ A paid subscription adds cloud sync, higher model tiers, and team features throu
|
|
|
18
18
|
|
|
19
19
|
---
|
|
20
20
|
|
|
21
|
+
## What's New in v20.2.0
|
|
22
|
+
|
|
23
|
+
### One Command Connects Every Supported Host
|
|
24
|
+
Install Prism globally and run `prism connect`. It detects Claude Code, Claude
|
|
25
|
+
Desktop on macOS, Windows, and Linux (beta), Cursor, Gemini CLI, and Codex, then safely registers the
|
|
26
|
+
server from the installed package. Existing custom entries are untouched;
|
|
27
|
+
`--dry-run` previews changes and `--refresh` updates only Prism-managed entries.
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## What's New in v20.1.0
|
|
32
|
+
|
|
33
|
+
### Every Inference Outcome Is Now Observable
|
|
34
|
+
`prism_infer` gains a failure contract: pass `escalation: "report"` and every call returns a structured `gate_outcome` — `success`, `degraded` (gate-failed output served anyway, explicitly flagged), or `refused` (typed, with reason, instead of a thrown error). Degraded output can no longer serve silently.
|
|
35
|
+
|
|
36
|
+
### Big Prompts Work Locally
|
|
37
|
+
Prompts over 4000 chars were blanket-refused when cloud was off. Now the full text gets a deterministic reserved-keyword scan plus a head+middle+tail excerpt classification — clean oversize prompts serve locally with a distinct `UNCERTAIN_LENGTH` audit marker. Clinical/reserved handling is unchanged (and its keyword floor got stronger).
|
|
38
|
+
|
|
39
|
+
### No More Silent Truncation
|
|
40
|
+
Tier context limits now match the live Modelfiles (27b/9b are 4096-token models; 4b/2b are 32768 — the old table had it backwards). Tiers that can't hold your prompt are skipped with a visible `ctx_insufficient` reason; if nothing fits, you get the full prompt on cloud or a loud error — never an answer computed from a silently-clipped prompt.
|
|
41
|
+
|
|
42
|
+
### Know Which Plan You're Actually Running Under
|
|
43
|
+
Entitlements carry a `source` field: `portal` (real), `unconfigured` (free by design), or `fallback_free` (portal unreachable — free limits ASSUMED). Pass `strict_entitlements: true` to fail loud instead of running degraded.
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
21
47
|
## What's New in v20.0.8
|
|
22
48
|
|
|
23
49
|
### verify_behavior Works Again
|
|
@@ -81,20 +107,31 @@ External contributions now require signing the [Individual CLA](./CLA.md). The C
|
|
|
81
107
|
|
|
82
108
|
## Quickstart
|
|
83
109
|
|
|
84
|
-
The free tier needs no account, no API key, and no cloud.
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
"command": "npx",
|
|
91
|
-
"args": ["-y", "prism-mcp-server"]
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}
|
|
110
|
+
The free tier needs no account, no API key, and no cloud. Install Prism, then
|
|
111
|
+
register it with every supported MCP host already installed on your machine:
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
npm install --global prism-mcp-server
|
|
115
|
+
prism connect
|
|
95
116
|
```
|
|
96
117
|
|
|
97
|
-
|
|
118
|
+
`prism connect` detects Claude Code, Claude Desktop (macOS/Windows/Linux), Cursor,
|
|
119
|
+
Gemini CLI, and Codex.
|
|
120
|
+
Use `prism connect --all` to target all five, `--host <name>` for one host, or
|
|
121
|
+
`--dry-run` to preview the files that would change. Existing `prism` and
|
|
122
|
+
`prism-mcp` entries are never overwritten by default. `--refresh` updates only
|
|
123
|
+
an entry previously created by Prism; custom entries remain untouched.
|
|
124
|
+
Close the target MCP hosts before a non-dry-run registration so they cannot
|
|
125
|
+
edit their configuration at the same time.
|
|
126
|
+
|
|
127
|
+
Codex registration preserves `~/.codex/config.toml` and appends only a marked
|
|
128
|
+
Prism-managed block. `CODEX_HOME` is respected when set and must already exist,
|
|
129
|
+
matching Codex's own contract. Restart Codex CLI, the
|
|
130
|
+
IDE extension, or the ChatGPT desktop app after connecting.
|
|
131
|
+
|
|
132
|
+
Restart the connected host and your agent now has memory backed by a local
|
|
133
|
+
SQLite database (`~/.prism-mcp/data.db`). See [IDE setup](docs/IDE_SETUP.md)
|
|
134
|
+
for manual configuration and host-specific paths.
|
|
98
135
|
|
|
99
136
|
**Optional — local model fleet** for offline tool-routing. Pull whichever fits your hardware:
|
|
100
137
|
|
|
@@ -17,12 +17,12 @@
|
|
|
17
17
|
* BOUNDARIES_VERSION is still used by markContextLoaded for session
|
|
18
18
|
* drift detection — bump it when the safety contract changes.
|
|
19
19
|
*/
|
|
20
|
-
export const BOUNDARIES_VERSION = "
|
|
20
|
+
export const BOUNDARIES_VERSION = "4";
|
|
21
21
|
export const BOUNDARIES_TEXT = `
|
|
22
22
|
Safety boundaries are enforced in code — shown so hosts avoid wasted round-trips.
|
|
23
23
|
|
|
24
24
|
- **Crisis/self-harm** inputs are intercepted before reaching any model.
|
|
25
|
-
- **BCBA reserved categories** (restraint, seclusion, physical management, dosing)
|
|
25
|
+
- **BCBA reserved categories** (restraint, seclusion, physical management, dosing): Layer 1 classifies; RESERVED/UNCERTAIN escalate to cloud or are refused. A keyword backstop covers classifier failure; oversize prompts get a full-text keyword scan + excerpt classification.
|
|
26
26
|
- **Dangerous output** (restraint instructions, overdose methods, self-harm guidance) is blocked regardless of host.
|
|
27
27
|
- AAC access is never restricted as a consequence.
|
|
28
28
|
`.trim();
|
package/dist/cli.js
CHANGED
|
@@ -8,11 +8,73 @@ import { getSetting } from './storage/configStorage.js';
|
|
|
8
8
|
import { PRISM_USER_ID, SERVER_CONFIG } from './config.js';
|
|
9
9
|
import { getCurrentGitState } from './utils/git.js';
|
|
10
10
|
import { sessionLoadContextHandler, sessionSaveLedgerHandler, sessionSaveHandoffHandler } from './tools/ledgerHandlers.js';
|
|
11
|
+
import { connectHosts, normalizeHostName } from './connect.js';
|
|
11
12
|
const program = new Command();
|
|
12
13
|
program
|
|
13
14
|
.name('prism')
|
|
14
15
|
.description('Prism — The Mind Palace for AI Agents')
|
|
15
16
|
.version(SERVER_CONFIG.version);
|
|
17
|
+
// ─── prism connect ────────────────────────────────────────────
|
|
18
|
+
// Registers this installed package with supported MCP hosts. The
|
|
19
|
+
// merge is additive: an existing `prism` or `prism-mcp` entry is
|
|
20
|
+
// reported and left byte-for-byte untouched.
|
|
21
|
+
program
|
|
22
|
+
.command('connect')
|
|
23
|
+
.description('Register Prism with installed MCP hosts (close hosts before writing)')
|
|
24
|
+
.option('--host <name>', 'Target one host: claude-code, claude-desktop, cursor, gemini, or codex')
|
|
25
|
+
.option('--all', 'Target all supported hosts instead of auto-detecting installed hosts')
|
|
26
|
+
.option('--dry-run', 'Preview configuration changes without writing files')
|
|
27
|
+
.option('--refresh', 'Refresh only entries previously created by Prism; custom entries stay untouched')
|
|
28
|
+
.action((options) => {
|
|
29
|
+
try {
|
|
30
|
+
if (!options.dryRun) {
|
|
31
|
+
console.log('Close target MCP hosts before registration so they cannot edit configuration concurrently.');
|
|
32
|
+
}
|
|
33
|
+
const hosts = options.host ? [normalizeHostName(options.host)] : undefined;
|
|
34
|
+
const summary = connectHosts({
|
|
35
|
+
all: !!options.all,
|
|
36
|
+
dryRun: !!options.dryRun,
|
|
37
|
+
refresh: !!options.refresh,
|
|
38
|
+
hosts,
|
|
39
|
+
});
|
|
40
|
+
if (summary.results.length === 0) {
|
|
41
|
+
console.error('No supported MCP hosts detected. Use --host <name> or --all to target one explicitly.');
|
|
42
|
+
process.exitCode = 1;
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
for (const result of summary.results) {
|
|
46
|
+
if (result.status === 'registered') {
|
|
47
|
+
console.log(`✓ ${result.label}: registered (${result.path})`);
|
|
48
|
+
}
|
|
49
|
+
else if (result.status === 'would-register') {
|
|
50
|
+
console.log(`• ${result.label}: would register (${result.path})`);
|
|
51
|
+
}
|
|
52
|
+
else if (result.status === 'refreshed') {
|
|
53
|
+
console.log(`✓ ${result.label}: Prism-managed entry refreshed (${result.path})`);
|
|
54
|
+
}
|
|
55
|
+
else if (result.status === 'would-refresh') {
|
|
56
|
+
console.log(`• ${result.label}: would refresh Prism-managed entry (${result.path})`);
|
|
57
|
+
}
|
|
58
|
+
else if (result.status === 'existing') {
|
|
59
|
+
console.log(`− ${result.label}: already registered — untouched (${result.path})`);
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
console.error(`✗ ${result.label}: ${result.message || 'registration failed'} (${result.path})`);
|
|
63
|
+
process.exitCode = 1;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
if (options.dryRun) {
|
|
67
|
+
console.log('\nDry run complete — no files changed.');
|
|
68
|
+
}
|
|
69
|
+
if (!summary.usedApiKey) {
|
|
70
|
+
console.log('PRISM_SYNALUX_API_KEY is not set; new registrations use local/free mode.');
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
catch (err) {
|
|
74
|
+
console.error(`Connect failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
75
|
+
process.exitCode = 1;
|
|
76
|
+
}
|
|
77
|
+
});
|
|
16
78
|
// ─── prism load <project> ─────────────────────────────────────
|
|
17
79
|
// Loads session context using the same storage layer as the MCP
|
|
18
80
|
// session_load_context tool. Works with both SQLite and Supabase.
|