prism-mcp-server 9.2.0 β†’ 9.2.1

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 +9 -4
  2. package/dist/cli.js +37 -39
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -778,8 +778,9 @@ The Generator strips the `console.log`, resubmits, and the next `EVALUATE` retur
778
778
 
779
779
  ## πŸ†• What's New
780
780
 
781
- > **Current release: v9.1.0 β€” Task Router v2 & Local Agent Hardening**
781
+ > **Current release: v9.2.1 β€” CLI Full Feature Parity**
782
782
 
783
+ - πŸ’» **v9.2.1 β€” CLI Full Feature Parity:** `prism load` text mode now delegates to the real `session_load_context` handler, giving CLI-only users the same enriched output as MCP clients: morning briefings, reality drift detection, SDM intuitive recall, visual memory index, role-scoped skill injection, behavioral warnings, importance scores, and agent identity. JSON mode now includes `agent_name` from dashboard settings. Session loader script PATH fix for Homebrew/nvm/volta environments.
783
784
  - 🚦 **v9.1.0 β€” Task Router v2:** File-type complexity signal for intelligent code-vs-config routing, 6-signal weighted heuristic engine, multi-step false-positive fix, expanded file extension classification. Local agent hardened with buffered streaming, system prompts, memory trimming, and stateful `/api/chat` API.
784
785
  - πŸ”’ **v9.0.5 β€” JWKS Auth Security Hardening:** JWT audience/issuer claim validation (`PRISM_JWT_AUDIENCE`, `PRISM_JWT_ISSUER`), structured error logging for JWT failures, typed `PrismAuthenticatedRequest` interface, 11 new JWKS unit tests, Smithery server card fix. Vendor-neutral β€” tested with Auth0, AgentLair ([llms.txt](https://agentlair.com/llms.txt)), Keycloak, and custom JWKS endpoints.
785
786
  - 🧠 **v9.0.0 β€” Autonomous Cognitive OS:** Token-Economic Reinforcement Learning (Surprisal Gate + Cognitive Budget), Affect-Tagged Memory (valence-scored retrieval), and Episodicβ†’Semantic Consolidation. Your agents learn compression and develop intuition. β†’ [Cognitive OS](#-autonomous-cognitive-os-v90)
@@ -844,12 +845,16 @@ Every other AI coding pipeline has a fatal flaw: it asks the same model that wro
844
845
 
845
846
  ## πŸ’» CLI Reference
846
847
 
847
- Prism includes a CLI for environments where MCP tools aren't available (CI/CD pipelines, Bash scripts, non-MCP IDEs like Antigravity):
848
+ Prism includes a CLI for environments where MCP tools aren't available (CI/CD pipelines, Bash scripts, non-MCP IDEs like Antigravity).
849
+
850
+ **Text mode** delegates to the real `session_load_context` handler β€” full feature parity with MCP clients, including morning briefings, reality drift detection, SDM intuitive recall, visual memory, role-scoped skills, behavioral warnings, and agent identity.
851
+
852
+ **JSON mode** emits a structured envelope for programmatic consumption (scripts, CI/CD, session loaders).
848
853
 
849
854
  ```bash
850
- # Load session context (same output as session_load_context MCP tool)
855
+ # Load session context (full enrichments β€” same as MCP tool)
851
856
  prism load my-project # Human-readable, standard depth
852
- prism load my-project --level deep # Full context
857
+ prism load my-project --level deep # Full context with all enrichments
853
858
  prism load my-project --level quick --json # Machine-readable JSON
854
859
  prism load my-project --role dev --json # Role-scoped loading
855
860
 
package/dist/cli.js CHANGED
@@ -7,6 +7,7 @@ import { getStorage, closeStorage } from './storage/index.js';
7
7
  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
+ import { sessionLoadContextHandler } from './tools/ledgerHandlers.js';
10
11
  const program = new Command();
11
12
  program
12
13
  .name('prism')
@@ -17,6 +18,15 @@ program
17
18
  // session_load_context tool. Works with both SQLite and Supabase.
18
19
  // Designed for environments that cannot use MCP tools directly
19
20
  // (Antigravity, Bash scripts, CI/CD pipelines).
21
+ //
22
+ // TEXT MODE: Delegates to the real sessionLoadContextHandler for
23
+ // full feature parity β€” morning briefing, reality drift detection,
24
+ // SDM recall, visual memory, skill injection, behavioral warnings,
25
+ // importance scores, recent validations. Any future MCP enrichments
26
+ // automatically appear in CLI too.
27
+ //
28
+ // JSON MODE: Structured envelope for programmatic consumption
29
+ // (session loader scripts, CI/CD pipelines, etc.).
20
30
  program
21
31
  .command('load <project>')
22
32
  .description('Load session context for a project (same output as session_load_context MCP tool)')
@@ -31,27 +41,21 @@ program
31
41
  console.error(`Error: Invalid level "${level}". Must be one of: ${validLevels.join(', ')}`);
32
42
  process.exit(1);
33
43
  }
34
- // Use the shared storage singleton (respects PRISM_STORAGE, dashboard config, etc.)
35
- const storage = await getStorage();
36
- const effectiveRole = role || await getSetting('default_role', '') || undefined;
37
- const data = await storage.loadContext(project, level, PRISM_USER_ID, effectiveRole);
38
- if (!data) {
39
- if (jsonOutput) {
44
+ if (jsonOutput) {
45
+ // ── JSON mode: structured output for programmatic consumption ──
46
+ const storage = await getStorage();
47
+ const effectiveRole = role || await getSetting('default_role', '') || undefined;
48
+ const agentName = await getSetting('agent_name', '') || undefined;
49
+ const data = await storage.loadContext(project, level, PRISM_USER_ID, effectiveRole);
50
+ if (!data) {
40
51
  console.log(JSON.stringify({ error: `No session context found for project "${project}"` }));
52
+ await closeStorage();
53
+ process.exit(0);
41
54
  }
42
- else {
43
- console.log(`No session context found for project "${project}" at level ${level}.`);
44
- console.log('This project has no previous session history. Starting fresh.');
45
- }
46
- await closeStorage();
47
- process.exit(0);
48
- }
49
- const d = data;
50
- // Gather git state for enrichment
51
- const gitState = getCurrentGitState();
52
- if (jsonOutput) {
53
- // Machine-readable JSON envelope β€” matches what prism_session_loader.sh produced
55
+ const d = data;
56
+ const gitState = getCurrentGitState();
54
57
  const output = {
58
+ agent_name: agentName || null,
55
59
  handoff: [{
56
60
  project,
57
61
  role: effectiveRole || d.role || 'global',
@@ -77,29 +81,23 @@ program
77
81
  console.log(JSON.stringify(output, null, 2));
78
82
  }
79
83
  else {
80
- // Human-readable formatted output (same format as MCP tool)
81
- let output = `πŸ“‹ Session context for "${project}" (${level}):\n\n`;
82
- if (d.last_summary)
83
- output += `πŸ“ Last Summary: ${d.last_summary}\n`;
84
- if (d.active_branch)
85
- output += `🌿 Active Branch: ${d.active_branch}\n`;
86
- if (d.key_context)
87
- output += `πŸ’‘ Key Context: ${d.key_context}\n`;
88
- if (d.pending_todo?.length) {
89
- output += `\nβœ… Open TODOs:\n` + d.pending_todo.map((t) => ` - ${t}`).join('\n') + '\n';
90
- }
91
- if (d.active_decisions?.length) {
92
- output += `\nβš–οΈ Active Decisions:\n` + d.active_decisions.map((dec) => ` - ${dec}`).join('\n') + '\n';
93
- }
94
- if (d.keywords?.length) {
95
- output += `\nπŸ”‘ Keywords: ${d.keywords.join(', ')}\n`;
96
- }
97
- if (d.recent_sessions?.length) {
98
- output += `\n⏳ Recent Sessions:\n` + d.recent_sessions.map((s) => ` [${s.session_date?.split('T')[0]}] ${s.summary}`).join('\n') + '\n';
84
+ // ── Text mode: full parity with MCP session_load_context ──
85
+ // Delegates to the real handler so all enrichments (morning briefing,
86
+ // reality drift, SDM recall, visual memory, skill injection,
87
+ // behavioral warnings, etc.) are included automatically.
88
+ const result = await sessionLoadContextHandler({ project, level, role });
89
+ // Surface handler-level errors (e.g. invalid args, storage failures)
90
+ if (result.isError) {
91
+ console.error(result.content[0]?.text || 'Unknown error loading context');
92
+ await closeStorage();
93
+ process.exit(1);
99
94
  }
100
- if (d.version != null) {
101
- output += `\nπŸ”‘ Session version: ${d.version}. Pass expected_version: ${d.version} when saving handoff.`;
95
+ let output = '';
96
+ if (result.content?.[0]) {
97
+ output = result.content[0].text;
102
98
  }
99
+ // Append git state (not included in the MCP handler output)
100
+ const gitState = getCurrentGitState();
103
101
  if (gitState.isRepo) {
104
102
  output += `\n\nπŸ”§ Git: ${gitState.branch} @ ${gitState.commitSha?.substring(0, 7)} (Prism v${SERVER_CONFIG.version})`;
105
103
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prism-mcp-server",
3
- "version": "9.2.0",
3
+ "version": "9.2.1",
4
4
  "mcpName": "io.github.dcostenco/prism-mcp",
5
5
  "description": "The Mind Palace for AI Agents β€” a true Cognitive Architecture with Hebbian learning (episodicβ†’semantic consolidation), ACT-R spreading activation (multi-hop causal reasoning), uncertainty-aware rejection gates (agents that know when they don't know), adversarial evaluation (anti-sycophancy), fail-closed Dark Factory pipelines, persistent memory (SQLite/Supabase), multi-agent Hivemind, time travel & visual dashboard. Zero-config local mode.",
6
6
  "module": "index.ts",