getprismo 0.1.14 → 0.1.16

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
@@ -182,6 +182,15 @@ npx getprismo shield search "auth expected 200"
182
182
  npx getprismo shield search "AUTH_FAILURE" --json
183
183
  ```
184
184
 
185
+ when `watch` detects tool-output floods or repeated command loops, it now recommends this flow directly:
186
+
187
+ ```text
188
+ Shield Plan
189
+ Run: npx getprismo shield -- <noisy command>
190
+ Then: npx getprismo shield search "<error text>"
191
+ MCP: prismo_shield_run -> prismo_shield_search
192
+ ```
193
+
185
194
  this is intentionally not magic interception yet. it is a safe local-first primitive you can tell agents to use for noisy commands.
186
195
 
187
196
  ---
@@ -800,3 +809,8 @@ npx getprismo mcp --help
800
809
  npx getprismo cc --help
801
810
  npx getprismo scan --help
802
811
  ```
812
+
813
+ More docs:
814
+
815
+ - [MCP setup and tools](docs/mcp.md)
816
+ - [Live demo flow](docs/live-demo.md)
@@ -0,0 +1,115 @@
1
+ # PrismoDev Live Demo
2
+
3
+ Use this flow to show the full product loop on a real repo.
4
+
5
+ ## 1. Before Session: Doctor
6
+
7
+ ```bash
8
+ npx getprismo doctor
9
+ ```
10
+
11
+ Shows:
12
+
13
+ - before/after repo score
14
+ - missing `.claudeignore` / `.cursorignore`
15
+ - generated artifacts exposed to AI context
16
+ - compact `.prismo/` context packs
17
+ - recommended next starting context
18
+
19
+ ## 2. During Session: Watch
20
+
21
+ ```bash
22
+ npx getprismo watch --once
23
+ ```
24
+
25
+ Shows:
26
+
27
+ - context pressure
28
+ - session size
29
+ - recent context growth
30
+ - repeated file reads
31
+ - generated artifact leaks
32
+ - possible loops
33
+ - shield recommendation when command output is flooding context
34
+
35
+ If watch sees noisy output, the important part is:
36
+
37
+ ```text
38
+ Shield Plan
39
+ Run: npx getprismo shield -- <noisy command>
40
+ Then: npx getprismo shield search "<error text>"
41
+ MCP: prismo_shield_run -> prismo_shield_search
42
+ ```
43
+
44
+ ## 3. Noisy Commands: Shield
45
+
46
+ ```bash
47
+ npx getprismo shield -- npm test
48
+ npx getprismo shield search "AUTH_FAILURE"
49
+ npx getprismo shield last
50
+ ```
51
+
52
+ Shows:
53
+
54
+ - compact command summary
55
+ - useful error lines
56
+ - full output stored locally
57
+ - searchable SQLite FTS index when `sqlite3` is available
58
+
59
+ Full output stays in:
60
+
61
+ ```text
62
+ .prismo/shield/runs/
63
+ ```
64
+
65
+ ## 4. Agent-Native Mode: MCP
66
+
67
+ ```bash
68
+ npx getprismo mcp /path/to/repo
69
+ ```
70
+
71
+ Demo prompt:
72
+
73
+ ```text
74
+ Use Prismo MCP to run the failing test through shield. Search the stored output for the root error. Do not paste the full test log into the chat.
75
+ ```
76
+
77
+ Expected MCP tool flow:
78
+
79
+ 1. `prismo_shield_run`
80
+ 2. `prismo_shield_search`
81
+ 3. `prismo_context_pack` if the agent needs scoped repo context
82
+
83
+ ## 5. After Session: Timeline
84
+
85
+ ```bash
86
+ npx getprismo cc timeline
87
+ ```
88
+
89
+ Shows:
90
+
91
+ - generated artifacts that entered context
92
+ - repeated file/path mentions
93
+ - repeated command/tool patterns
94
+ - suggested cleanup action
95
+
96
+ ## Screenshot Commands
97
+
98
+ For a quick terminal screenshot:
99
+
100
+ ```bash
101
+ npx getprismo doctor
102
+ ```
103
+
104
+ For the proactive story:
105
+
106
+ ```bash
107
+ npx getprismo watch --once
108
+ ```
109
+
110
+ For the MCP/shield story:
111
+
112
+ ```bash
113
+ npx getprismo shield -- npm test
114
+ npx getprismo shield search "error"
115
+ ```
package/docs/mcp.md ADDED
@@ -0,0 +1,76 @@
1
+ # PrismoDev MCP
2
+
3
+ PrismoDev can run as a local MCP server so compatible coding agents can inspect token waste, run noisy commands through shield, search stored output, and request scoped context without pasting huge logs into chat.
4
+
5
+ ## Start
6
+
7
+ ```bash
8
+ npx getprismo mcp /path/to/your/repo
9
+ ```
10
+
11
+ ## Generic MCP Config
12
+
13
+ ```json
14
+ {
15
+ "mcpServers": {
16
+ "prismodev": {
17
+ "command": "npx",
18
+ "args": ["-y", "getprismo", "mcp", "/path/to/your/repo"]
19
+ }
20
+ }
21
+ }
22
+ ```
23
+
24
+ For local development from this repo:
25
+
26
+ ```json
27
+ {
28
+ "mcpServers": {
29
+ "prismodev": {
30
+ "command": "node",
31
+ "args": ["/path/to/prismodev/bin/prismo.js", "mcp", "/path/to/your/repo"]
32
+ }
33
+ }
34
+ }
35
+ ```
36
+
37
+ ## Tools
38
+
39
+ - `prismo_scan`: scan repo context/token waste
40
+ - `prismo_doctor_dry_run`: preview doctor payoff without writing files
41
+ - `prismo_watch_snapshot`: inspect live context pressure
42
+ - `prismo_shield_run`: run a noisy command and store full output locally
43
+ - `prismo_shield_search`: search stored shield output
44
+ - `prismo_shield_last`: list recent shielded command runs
45
+ - `prismo_context_pack`: generate or preview scoped context packs
46
+ - `prismo_firewall`: create a scoped context policy for a task
47
+ - `prismo_cc_timeline`: inspect Claude Code session postmortems
48
+
49
+ ## Best Workflow
50
+
51
+ Ask your agent:
52
+
53
+ ```text
54
+ Run the failing test command through Prismo shield, then search the stored output for the real error. Do not paste the full log into chat.
55
+ ```
56
+
57
+ The agent should call:
58
+
59
+ 1. `prismo_shield_run`
60
+ 2. `prismo_shield_search`
61
+
62
+ This keeps full stdout/stderr in `.prismo/shield/runs/` and only brings the useful failure snippet back into the model context.
63
+
64
+ ## Watch Integration
65
+
66
+ When `npx getprismo watch` detects a tool-output flood or repeated command loop, it now prints a Shield Plan:
67
+
68
+ ```text
69
+ Shield Plan
70
+ Tool output is flooding context; shield the command so full logs stay local.
71
+ Run: npx getprismo shield -- <noisy command>
72
+ Then: npx getprismo shield search "<error text>"
73
+ MCP: prismo_shield_run -> prismo_shield_search
74
+ ```
75
+
76
+ That is the intended live-session recovery path.
@@ -947,7 +947,7 @@ function getTokenBudgetStatus(activeSession, tokenBudget) {
947
947
 
948
948
  function getRecommendedWatchAction(activeSession, warnings) {
949
949
  if (!activeSession) return `${NPX_COMMAND} setup`;
950
- if (activeSession.loopSuspicion) return "Pause the loop, summarize the failure once, then start a fresh scoped session.";
950
+ if (activeSession.estimatedToolTokens >= 150000 || activeSession.loopSuspicion) return `${NPX_COMMAND} shield -- <noisy command>`;
951
951
  if ((activeSession.generatedArtifacts || []).length || getActionableRepeatedPaths(activeSession, 1).length) return `${NPX_COMMAND} doctor`;
952
952
  if (activeSession.recentContextGrowth >= 250000) return "Start a fresh coding-agent session with a scoped Prismo context prompt.";
953
953
  if (warnings.some((warning) => warning.includes("Tool/output"))) return `${NPX_COMMAND} context`;
@@ -956,6 +956,41 @@ function getRecommendedWatchAction(activeSession, warnings) {
956
956
  return `${NPX_COMMAND} scan --usage`;
957
957
  }
958
958
 
959
+ function buildShieldPlan(activeSession, liveAction) {
960
+ if (!activeSession || !liveAction) return null;
961
+ const shieldCauses = new Set(["tool-output-flood", "possible-loop"]);
962
+ const hasRepeatedCommand = Boolean(activeSession.repeatedCommands?.[0]);
963
+ const highToolOutput = activeSession.estimatedToolTokens >= 150000;
964
+ if (!shieldCauses.has(liveAction.cause) && !hasRepeatedCommand && !highToolOutput) return null;
965
+
966
+ const repeatedCommand = activeSession.repeatedCommands?.[0]?.value || null;
967
+ const cliCommand = repeatedCommand
968
+ ? `${NPX_COMMAND} shield -- ${repeatedCommand}`
969
+ : `${NPX_COMMAND} shield -- <noisy command>`;
970
+ const searchHint = liveAction.cause === "possible-loop"
971
+ ? "Search the stored output for the stable error text before rerunning the command."
972
+ : "Search the stored output for the failure token, filename, or exception instead of loading the full log.";
973
+
974
+ return {
975
+ reason: liveAction.cause === "possible-loop"
976
+ ? "Repeated command/output loop detected; shield the command and search stored output before reruns."
977
+ : "Tool output is flooding context; shield the command so full logs stay local.",
978
+ command: cliCommand,
979
+ commandTemplate: `${NPX_COMMAND} shield -- <command>`,
980
+ searchCommand: `${NPX_COMMAND} shield search "<error text>"`,
981
+ mcp: {
982
+ runTool: "prismo_shield_run",
983
+ searchTool: "prismo_shield_search",
984
+ workflow: "Call prismo_shield_run with the noisy command, then prismo_shield_search for the relevant error text.",
985
+ },
986
+ next: [
987
+ repeatedCommand ? `Run the command through shield: ${cliCommand}` : `Run the noisy command through shield: ${cliCommand}`,
988
+ searchHint,
989
+ "Give the agent the compact shield summary first; inspect full stdout/stderr only if needed.",
990
+ ],
991
+ };
992
+ }
993
+
959
994
  function buildLiveAction(activeSession, warnings, budgetStatus = null) {
960
995
  if (!activeSession) {
961
996
  return {
@@ -1103,6 +1138,7 @@ function buildLiveSessionView(summary) {
1103
1138
  const actionableRepeatedPaths = activeSession ? getActionableRepeatedPaths(activeSession, 5) : [];
1104
1139
  const generatedArtifactGroups = activeSession ? summarizeGeneratedArtifacts(activeSession.generatedArtifacts || [], 5) : [];
1105
1140
  const liveAction = buildLiveAction(activeSession, warnings, budgetStatus);
1141
+ const shieldPlan = buildShieldPlan(activeSession, liveAction);
1106
1142
  return {
1107
1143
  activeSession: activeSession
1108
1144
  ? {
@@ -1137,7 +1173,10 @@ function buildLiveSessionView(summary) {
1137
1173
  highestRisk: summary.sessions.reduce((risk, session) => (getRiskRank(session.contextRisk) > getRiskRank(risk) ? session.contextRisk : risk), "Low"),
1138
1174
  budget: budgetStatus,
1139
1175
  warnings,
1140
- liveAction,
1176
+ liveAction: {
1177
+ ...liveAction,
1178
+ shieldPlan,
1179
+ },
1141
1180
  recommendedAction: getRecommendedWatchAction(activeSession, warnings),
1142
1181
  nextCommands: Array.from(new Set([
1143
1182
  `${NPX_COMMAND} doctor`,
@@ -1316,6 +1355,14 @@ function renderWatchTerminal(summary) {
1316
1355
  lines.push(live.liveAction.summary);
1317
1356
  live.liveAction.now.slice(0, 4).forEach((step, index) => lines.push(`${index + 1}. ${step}`));
1318
1357
  if (live.liveAction.rescueAvailable) lines.push(`Rescue: ${live.liveAction.rescueCommand}`);
1358
+ if (live.liveAction.shieldPlan) {
1359
+ lines.push("");
1360
+ lines.push("Shield Plan");
1361
+ lines.push(live.liveAction.shieldPlan.reason);
1362
+ lines.push(`Run: ${live.liveAction.shieldPlan.command}`);
1363
+ lines.push(`Then: ${live.liveAction.shieldPlan.searchCommand}`);
1364
+ lines.push(`MCP: ${live.liveAction.shieldPlan.mcp.runTool} -> ${live.liveAction.shieldPlan.mcp.searchTool}`);
1365
+ }
1319
1366
  lines.push("");
1320
1367
  if (active.actionableRepeatedPaths?.length || active.generatedArtifactGroups?.length || active.repeatedCommands.length) {
1321
1368
  lines.push("Signals");
@@ -1366,6 +1413,13 @@ function renderRescuePrompt(summary) {
1366
1413
  lines.push("");
1367
1414
  lines.push("Do this now:");
1368
1415
  live.liveAction.now.forEach((step, index) => lines.push(`${index + 1}. ${step}`));
1416
+ if (live.liveAction.shieldPlan) {
1417
+ lines.push("");
1418
+ lines.push("For noisy commands, use Prismo shield instead of loading full output into this chat:");
1419
+ lines.push(`- CLI: ${live.liveAction.shieldPlan.command}`);
1420
+ lines.push(`- Search stored output: ${live.liveAction.shieldPlan.searchCommand}`);
1421
+ lines.push(`- MCP workflow: ${live.liveAction.shieldPlan.mcp.workflow}`);
1422
+ }
1369
1423
  lines.push("");
1370
1424
  lines.push("Before reading or editing anything else, summarize:");
1371
1425
  lines.push("- files changed so far");
@@ -1405,6 +1459,11 @@ function renderLiveGuardrails(summary) {
1405
1459
  lines.push("## Effective Immediately");
1406
1460
  lines.push("");
1407
1461
  live.liveAction.now.forEach((step) => lines.push(`- ${step}`));
1462
+ if (live.liveAction.shieldPlan) {
1463
+ lines.push(`- Run noisy commands through Prismo shield: \`${live.liveAction.shieldPlan.command}\`.`);
1464
+ lines.push(`- Search stored command output with: \`${live.liveAction.shieldPlan.searchCommand}\`.`);
1465
+ lines.push(`- If MCP tools are available, use \`${live.liveAction.shieldPlan.mcp.runTool}\` then \`${live.liveAction.shieldPlan.mcp.searchTool}\`.`);
1466
+ }
1408
1467
  lines.push("- Keep command output short; prefer filtered errors, small ranges, and summaries over full logs.");
1409
1468
  lines.push("- Do not read generated artifacts, lockfiles, caches, build output, coverage, or logs unless explicitly required.");
1410
1469
  lines.push("- Before broad exploration, summarize the current task, changed files, current failure, and next smallest useful file/test.");
@@ -1477,6 +1536,10 @@ function renderContextThrottle(summary) {
1477
1536
  live.liveAction.now.slice(0, 4).forEach((step) => lines.push(`- ${step}`));
1478
1537
  lines.push("- Keep the next tool call narrow enough to summarize in one screen.");
1479
1538
  }
1539
+ if (live.liveAction.shieldPlan) {
1540
+ lines.push(`- Run noisy commands through shield: \`${live.liveAction.shieldPlan.command}\`.`);
1541
+ lines.push(`- Search shield output instead of reloading full logs: \`${live.liveAction.shieldPlan.searchCommand}\`.`);
1542
+ }
1480
1543
  if (active?.actionableRepeatedPaths?.length) {
1481
1544
  lines.push("");
1482
1545
  lines.push("## Blocked Re-Reads");
@@ -1547,6 +1610,7 @@ function buildWatchEvent(summary) {
1547
1610
  toolOutputTokens: active.estimatedToolTokens || 0,
1548
1611
  budget,
1549
1612
  warnings: live.warnings || [],
1613
+ shieldPlan: live.liveAction.shieldPlan || null,
1550
1614
  repeatedFiles: repeated.slice(0, 5),
1551
1615
  artifactGroups: artifacts.slice(0, 5),
1552
1616
  signature: signatureParts.join("::"),
@@ -1621,6 +1685,11 @@ function renderWatchReport(summary) {
1621
1685
  lines.push(`- Cause: ${live.liveAction.cause} (${live.liveAction.confidence} confidence)`);
1622
1686
  lines.push(`- ${live.liveAction.summary}`);
1623
1687
  live.liveAction.now.forEach((step) => lines.push(`- ${step}`));
1688
+ if (live.liveAction.shieldPlan) {
1689
+ lines.push(`- Shield noisy command output: \`${live.liveAction.shieldPlan.command}\``);
1690
+ lines.push(`- Search shielded output: \`${live.liveAction.shieldPlan.searchCommand}\``);
1691
+ lines.push(`- MCP workflow: \`${live.liveAction.shieldPlan.mcp.runTool}\` -> \`${live.liveAction.shieldPlan.mcp.searchTool}\``);
1692
+ }
1624
1693
  if (summary.guardrailsPath) {
1625
1694
  lines.push(`- Guardrails: ${summary.guardrailsPath}`);
1626
1695
  lines.push(`- Rescue prompt: ${summary.rescuePath}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "getprismo",
3
- "version": "0.1.14",
3
+ "version": "0.1.16",
4
4
  "description": "Local AI coding workflow scanner for Codex, Claude Code, Cursor, and token-waste diagnostics.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/shanirsh/prismodev#readme",
@@ -24,12 +24,13 @@
24
24
  "access": "public"
25
25
  },
26
26
  "bin": {
27
- "prismo": "bin/prismo.js"
27
+ "prismo": "bin/prismo.js",
28
+ "getprismo": "bin/prismo.js"
28
29
  },
29
30
  "files": [
30
31
  "bin/",
31
32
  "lib/",
32
- "docs/prismodev-user-testing.md",
33
+ "docs/",
33
34
  "README.md",
34
35
  "LICENSE",
35
36
  "NOTICE"