@justmpm/firebase-audit 0.4.1 → 0.4.2
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/{chunk-GOLWQBD5.js → chunk-SKD4TKFU.js} +45 -0
- package/dist/index.js +1 -1
- package/dist/mcp-cli.js +1 -1
- package/dist/mcp.d.ts +1 -1
- package/dist/mcp.js +1 -1
- package/package.json +1 -1
|
@@ -13,13 +13,58 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
|
13
13
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
14
14
|
import { z } from "zod";
|
|
15
15
|
import { createRequire } from "module";
|
|
16
|
+
import { readFileSync, existsSync } from "fs";
|
|
17
|
+
import { dirname, join } from "path";
|
|
18
|
+
import { fileURLToPath } from "url";
|
|
16
19
|
var require2 = createRequire(import.meta.url);
|
|
17
20
|
var pkg = require2("../package.json");
|
|
21
|
+
var pkgDir = join(dirname(fileURLToPath(import.meta.url)), "..");
|
|
22
|
+
function readPkgText(rel) {
|
|
23
|
+
try {
|
|
24
|
+
const p = join(pkgDir, rel);
|
|
25
|
+
if (!existsSync(p)) return null;
|
|
26
|
+
return readFileSync(p, "utf-8");
|
|
27
|
+
} catch {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
var FALLBACK_SKILL = [
|
|
32
|
+
"# firebase-audit-skill (fallback)",
|
|
33
|
+
"",
|
|
34
|
+
"1. Descobrir projeto (firebase.json, firestore.rules, firestore.indexes.json).",
|
|
35
|
+
"2. Executar scan (strict no CI). Sem adapter resolvido \u2192 UNKNOWN, nunca adivinhar.",
|
|
36
|
+
"3. CONFIRMED corrige agora; PROBABLE investiga; NOT_OBSERVED/UNKNOWN n\xE3o afirma.",
|
|
37
|
+
"4. Corrigir c\xF3digo, nunca o contrato para esconder finding."
|
|
38
|
+
].join("\n");
|
|
18
39
|
function createMcpServer() {
|
|
19
40
|
const server = new McpServer({
|
|
20
41
|
name: "firebase-audit-mcp-server",
|
|
21
42
|
version: pkg.version
|
|
22
43
|
});
|
|
44
|
+
server.registerTool(
|
|
45
|
+
"firebase_audit_skill",
|
|
46
|
+
{
|
|
47
|
+
title: "Firebase Audit Skill (guia do agente)",
|
|
48
|
+
description: "LEIA ANTES de auditar: sequ\xEAncia obrigat\xF3ria, travas (nunca mude o contrato para esconder finding, nunca afirme sem evid\xEAncia, nunca diga 'unused') e Emulador. Retorna o guia oficial da vers\xE3o instalada + modelo de contrato. Sempre sincronizado \u2014 dispensa skill copiada.",
|
|
49
|
+
inputSchema: {}
|
|
50
|
+
},
|
|
51
|
+
async () => {
|
|
52
|
+
const skill = readPkgText(join("skill", "SKILL.md")) ?? FALLBACK_SKILL;
|
|
53
|
+
const template = readPkgText(join("templates", "firebase-audit.yaml")) ?? "";
|
|
54
|
+
const text = [
|
|
55
|
+
`# firebase-audit v${pkg.version} \u2014 guia do agente`,
|
|
56
|
+
"",
|
|
57
|
+
skill,
|
|
58
|
+
"",
|
|
59
|
+
"## Modelo de contrato (templates/firebase-audit.yaml)",
|
|
60
|
+
"",
|
|
61
|
+
"```yaml",
|
|
62
|
+
template,
|
|
63
|
+
"```"
|
|
64
|
+
].join("\n");
|
|
65
|
+
return { content: [{ type: "text", text }] };
|
|
66
|
+
}
|
|
67
|
+
);
|
|
23
68
|
server.registerTool(
|
|
24
69
|
"firebase_audit_scan",
|
|
25
70
|
{
|
package/dist/index.js
CHANGED
package/dist/mcp-cli.js
CHANGED
package/dist/mcp.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
|
3
3
|
/**
|
|
4
4
|
* MCP Server do firebase-audit.
|
|
5
5
|
*
|
|
6
|
-
* Expõe scan/check/verify/drift via protocolo MCP (stdio).
|
|
6
|
+
* Expõe skill + scan/check/verify/drift via protocolo MCP (stdio).
|
|
7
7
|
* Mesma lógica da biblioteca — sem duplicação (chama scan/verify/drift direto).
|
|
8
8
|
*
|
|
9
9
|
* Uso:
|
package/dist/mcp.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@justmpm/firebase-audit",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"description": "Auditor de consistência e segurança para projetos Firebase: código + Rules + índices + contrato vs comportamento. Static-first, nunca inventa certeza.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"firebase",
|