periderm-cli 0.1.35 → 0.1.36

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/dist/index.js CHANGED
@@ -31,7 +31,7 @@ const program = new Command();
31
31
  program
32
32
  .name("periderm")
33
33
  .description("A pre-launch checklist.")
34
- .version("0.1.32");
34
+ .version("0.1.36");
35
35
  // Easter egg: `periderm bless` — hidden, undocumented
36
36
  program
37
37
  .command("bless", { hidden: true })
@@ -40,6 +40,13 @@ export function renderMarkdown(r) {
40
40
  lines.push("No findings. Ship it.");
41
41
  return lines.join("\n");
42
42
  }
43
+ const isMobile = r.meta?.projectProfile === "mobile-app" || r.meta?.stacks?.some(s => ["react-native", "expo", "flutter", "swift-ios"].includes(s));
44
+ if (isMobile) {
45
+ lines.push("## Mobile Launch Advice");
46
+ lines.push("");
47
+ lines.push("> **Note on Legal & SEO:** We've skipped web SEO and on-page Legal & Compliance checks because this is a mobile project. However, mobile apps typically link to external web pages for their Terms and Privacy Policies. Make sure your externally hosted legal pages are complete, up to date, and correctly state your data collection practices (especially for app store review).");
48
+ lines.push("");
49
+ }
43
50
  lines.push("## How to use this report");
44
51
  lines.push("");
45
52
  lines.push("Each finding below has a **Why it matters**, an **Exact fix**, and an **AI prompt** you can paste directly into your coding assistant. Fix the criticals first, then the highs, then re-run `periderm scan`.");
@@ -19,7 +19,29 @@ const TRIAGE_PROMPT = `You triage scan findings for false positives. Return ONLY
19
19
  Remove findings that clearly do not apply given project context (e.g. favicon missing when nonstandard icon exists, legal pages not needed on admin-only internal tools, accessibility on internal admin panels).
20
20
 
21
21
  Keep real security and cost issues. Be conservative — when unsure, keep the finding.`;
22
+ import { readConfig } from "../config.js";
22
23
  async function groqJson(apiKey, system, user) {
24
+ const cfg = readConfig();
25
+ if (cfg.token && cfg.apiUrl) {
26
+ try {
27
+ const res = await fetch(`${cfg.apiUrl}/api/public/deep-review`, {
28
+ method: "POST",
29
+ headers: { "Content-Type": "application/json", "x-periderm-token": cfg.token },
30
+ body: JSON.stringify({ system, user }),
31
+ });
32
+ if (res.ok) {
33
+ const data = (await res.json());
34
+ if (data.valid && data.content) {
35
+ return JSON.parse(data.content);
36
+ }
37
+ }
38
+ }
39
+ catch {
40
+ // Fallback to direct Groq API if backend fails or network error
41
+ }
42
+ }
43
+ if (!apiKey)
44
+ return null;
23
45
  try {
24
46
  const res = await fetch("https://api.groq.com/openai/v1/chat/completions", {
25
47
  method: "POST",
@@ -29,7 +29,7 @@ export async function scan(root, options = {}) {
29
29
  onProgress?.({ type: "phase", label: "Analyzing project context…" });
30
30
  let ctx = await detectProjectContext(root, files);
31
31
  const groqKey = resolveGroqApiKey(options.groqApiKey);
32
- const useAi = enableAiContext !== false && !!groqKey;
32
+ const useAi = enableAiContext !== false;
33
33
  if (useAi) {
34
34
  ctx = await enhanceContextWithGroq(ctx, buildContextSummary(ctx, root, relFiles), groqKey);
35
35
  }
@@ -84,8 +84,8 @@ export async function scan(root, options = {}) {
84
84
  onProgress?.({ type: "phase", label: "Applying project context filters…" });
85
85
  let findings = rawFindings.filter((f) => !shouldSkipFinding(f, ctx));
86
86
  const contextFilteredCount = rawFindings.length - findings.length;
87
- if (useAi && findings.length > 0) {
88
- onProgress?.({ type: "phase", label: "AI triage (removing false positives)…" });
87
+ if (useAi) {
88
+ onProgress?.({ type: "phase", label: "Triaging findings with AI…" });
89
89
  findings = await triageFindingsWithGroq(findings, ctx, groqKey);
90
90
  }
91
91
  onProgress?.({ type: "phase", label: "Computing launch verdict…" });
@@ -40,6 +40,7 @@ const ADMIN_ONLY_SKIP = new Set([
40
40
  "SEO & Discoverability",
41
41
  ]);
42
42
  const MOBILE_SKIP = new Set([
43
+ "Legal & Compliance",
43
44
  "SEO & Discoverability",
44
45
  "Polish & Embarrassment Risks",
45
46
  ]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "periderm-cli",
3
- "version": "0.1.35",
3
+ "version": "0.1.36",
4
4
  "description": "Pre-launch scanner for web and mobile codebases. Context-aware checks for JS, TS, Flutter, React Native, and Swift.",
5
5
  "type": "module",
6
6
  "bin": {