@mneme-ai/mcp 1.1.1 → 1.3.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/dist/index.d.ts.map +1 -1
- package/dist/index.js +75 -343
- package/dist/index.js.map +1 -1
- package/dist/tools/_capabilities.d.ts +14 -0
- package/dist/tools/_capabilities.d.ts.map +1 -0
- package/dist/tools/_capabilities.js +90 -0
- package/dist/tools/_capabilities.js.map +1 -0
- package/dist/tools/_lifecycle.d.ts +51 -0
- package/dist/tools/_lifecycle.d.ts.map +1 -0
- package/dist/tools/_lifecycle.js +124 -0
- package/dist/tools/_lifecycle.js.map +1 -0
- package/dist/tools/_molecules.d.ts +22 -0
- package/dist/tools/_molecules.d.ts.map +1 -0
- package/dist/tools/_molecules.js +142 -0
- package/dist/tools/_molecules.js.map +1 -0
- package/dist/tools/_registry.d.ts +16 -0
- package/dist/tools/_registry.d.ts.map +1 -0
- package/dist/tools/_registry.js +57 -0
- package/dist/tools/_registry.js.map +1 -0
- package/dist/tools/_runtime.d.ts +32 -0
- package/dist/tools/_runtime.d.ts.map +1 -0
- package/dist/tools/_runtime.js +78 -0
- package/dist/tools/_runtime.js.map +1 -0
- package/dist/tools/_smart_do.d.ts +14 -0
- package/dist/tools/_smart_do.d.ts.map +1 -0
- package/dist/tools/_smart_do.js +49 -0
- package/dist/tools/_smart_do.js.map +1 -0
- package/dist/tools/_types.d.ts +118 -0
- package/dist/tools/_types.d.ts.map +1 -0
- package/dist/tools/_types.js +34 -0
- package/dist/tools/_types.js.map +1 -0
- package/dist/tools/audit.d.ts +9 -0
- package/dist/tools/audit.d.ts.map +1 -0
- package/dist/tools/audit.js +233 -0
- package/dist/tools/audit.js.map +1 -0
- package/dist/tools/forensics.d.ts +7 -0
- package/dist/tools/forensics.d.ts.map +1 -0
- package/dist/tools/forensics.js +189 -0
- package/dist/tools/forensics.js.map +1 -0
- package/dist/tools/insights.d.ts +7 -0
- package/dist/tools/insights.d.ts.map +1 -0
- package/dist/tools/insights.js +40 -0
- package/dist/tools/insights.js.map +1 -0
- package/dist/tools/lab.d.ts +7 -0
- package/dist/tools/lab.d.ts.map +1 -0
- package/dist/tools/lab.js +93 -0
- package/dist/tools/lab.js.map +1 -0
- package/dist/tools/memory.d.ts +10 -0
- package/dist/tools/memory.d.ts.map +1 -0
- package/dist/tools/memory.js +463 -0
- package/dist/tools/memory.js.map +1 -0
- package/dist/tools/meta.d.ts +7 -0
- package/dist/tools/meta.d.ts.map +1 -0
- package/dist/tools/meta.js +20 -0
- package/dist/tools/meta.js.map +1 -0
- package/dist/tools/people.d.ts +10 -0
- package/dist/tools/people.d.ts.map +1 -0
- package/dist/tools/people.js +73 -0
- package/dist/tools/people.js.map +1 -0
- package/dist/tools/quality.d.ts +6 -0
- package/dist/tools/quality.d.ts.map +1 -0
- package/dist/tools/quality.js +57 -0
- package/dist/tools/quality.js.map +1 -0
- package/dist/tools/quant.d.ts +7 -0
- package/dist/tools/quant.d.ts.map +1 -0
- package/dist/tools/quant.js +26 -0
- package/dist/tools/quant.js.map +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_smart_do.js","sourceRoot":"","sources":["../../src/tools/_smart_do.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAG3C,MAAM,CAAC,MAAM,WAAW,GAAc;IACpC,IAAI,EAAE,gBAAgB;IACtB,QAAQ,EAAE,MAAM;IAChB,WAAW,EACT,mHAAmH;QACnH,iHAAiH;QACjH,gHAAgH;QAChH,mFAAmF;IACrF,QAAQ,EAAE;QACR,yCAAyC;QACzC,sCAAsC;KACvC;IACD,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,qDAAqD,EAAE;SAC/F;QACD,QAAQ,EAAE,CAAC,QAAQ,CAAC;KACrB;IACD,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE;QAC1B,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;QAC5C,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,OAAO;gBACL,IAAI,EAAE,EAAE;gBACR,MAAM,EAAE,uCAAuC;gBAC/C,UAAU,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE;aAC7B,CAAC;QACJ,CAAC;QACD,MAAM,IAAI,GAAG,MAAM,UAAU,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;QAChE,OAAO;YACL,IAAI;YACJ,MAAM,EACJ,+GAA+G;YACjH,QAAQ,EAAE,EAAE;YACZ,UAAU,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE;SAChC,CAAC;IACJ,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP tool type system — the contract every Mneme tool implements.
|
|
3
|
+
*
|
|
4
|
+
* Design principle: every response carries WISDOM, not just data. AI clients
|
|
5
|
+
* shouldn't need to interpret raw JSON — Mneme pre-digests each finding into
|
|
6
|
+
* a 1-3 sentence narrative the AI can quote (or paraphrase) directly to the
|
|
7
|
+
* user. Citations live in `data`, the human meaning lives in `wisdom`.
|
|
8
|
+
*/
|
|
9
|
+
import type { Tool, CallToolResult } from "@modelcontextprotocol/sdk/types.js";
|
|
10
|
+
import type { git, store, EmbeddingProvider } from "@mneme-ai/core";
|
|
11
|
+
/** Categories for the syllabus tool — AI student reads this index first
|
|
12
|
+
* and learns what kind of question goes to which group of tools. */
|
|
13
|
+
export type ToolCategory = "memory" | "people" | "audit" | "forensics" | "insights" | "quality" | "quant" | "lab" | "meta";
|
|
14
|
+
/** Wrapped response — every tool returns this shape so AI gets data + wisdom
|
|
15
|
+
* + cross-references + Second-Brain teaching in one consistent envelope.
|
|
16
|
+
*
|
|
17
|
+
* Architectural intent: the AI tool is the BASE REACTOR. Mneme is the
|
|
18
|
+
* NUCLEAR CORE. Every tool call doesn't just return data — it teaches the
|
|
19
|
+
* AI how to interpret + present + COMPOSE the result with other atoms,
|
|
20
|
+
* triggering a chain reaction of wisdom across the AI's session.
|
|
21
|
+
*/
|
|
22
|
+
export interface ToolResponse<TData = unknown> {
|
|
23
|
+
/** Structured data the AI parses + uses */
|
|
24
|
+
data: TData;
|
|
25
|
+
/** 1-3 sentences in plain English explaining what the data means.
|
|
26
|
+
* AI quotes or paraphrases this when answering the user. */
|
|
27
|
+
wisdom: string;
|
|
28
|
+
/** Tool names the AI might call next for deeper context.
|
|
29
|
+
* Example: after `mneme.people.atrophy` → suggest `mneme.people.passport` */
|
|
30
|
+
followUp?: string[];
|
|
31
|
+
/** Confidence + caveats — when to trust this, when to flag heuristic limits */
|
|
32
|
+
confidence?: {
|
|
33
|
+
level: "high" | "medium" | "low";
|
|
34
|
+
notes?: string;
|
|
35
|
+
};
|
|
36
|
+
/** Second Brain layer — teaches the AI HOW to use this result.
|
|
37
|
+
* This is what triggers the chain reaction of wisdom. */
|
|
38
|
+
secondBrain?: SecondBrain;
|
|
39
|
+
}
|
|
40
|
+
/** Second Brain — meta-instructions embedded in every tool response.
|
|
41
|
+
* Sets off the chain reaction: AI sees compose hints, fires more tool
|
|
42
|
+
* calls, those compositions become molecules, frequent molecules promote
|
|
43
|
+
* to compounds. The system gets smarter with every interaction. */
|
|
44
|
+
export interface SecondBrain {
|
|
45
|
+
/** How the AI should PRESENT this result to the user.
|
|
46
|
+
* Example: "Render top-5 fading areas as a horizontal bar chart with
|
|
47
|
+
* scores 0-100. Color scores < 30 in red. Don't show raw JSON." */
|
|
48
|
+
presentation?: string;
|
|
49
|
+
/** Suggested molecules — atom combinations that yield deeper insight.
|
|
50
|
+
* AI student can fire these in parallel for richer answers. */
|
|
51
|
+
compose?: ComposeSuggestion[];
|
|
52
|
+
/** Lifecycle metadata — for tracking new combinations and auto-promoting
|
|
53
|
+
* frequent ones into named compounds. */
|
|
54
|
+
lifecycle?: ToolLifecycle;
|
|
55
|
+
}
|
|
56
|
+
/** A suggested composition — "if you ran THIS atom, the natural next step
|
|
57
|
+
* is to fire THESE atoms together to form THIS molecule." */
|
|
58
|
+
export interface ComposeSuggestion {
|
|
59
|
+
/** Name for the resulting molecule, e.g. "succession_plan" */
|
|
60
|
+
molecule: string;
|
|
61
|
+
/** The atoms (other Mneme tool names) that form this molecule together */
|
|
62
|
+
atoms: string[];
|
|
63
|
+
/** When the AI should suggest / auto-fire this composition */
|
|
64
|
+
when: string;
|
|
65
|
+
/** Optional: a sample answer template the AI can adapt */
|
|
66
|
+
example?: string;
|
|
67
|
+
}
|
|
68
|
+
/** Lifecycle data for tracking new combinations + promoting them. */
|
|
69
|
+
export interface ToolLifecycle {
|
|
70
|
+
/** True if this combination is novel for the current repo's library */
|
|
71
|
+
isNewCombination?: boolean;
|
|
72
|
+
/** If non-null, the AI should ASK the user whether to save this
|
|
73
|
+
* combination as a named compound under this alias */
|
|
74
|
+
suggestSaveAs?: string;
|
|
75
|
+
/** How many times the user has run this exact combination —
|
|
76
|
+
* used by auto-promotion logic (≥3 = promote to compound) */
|
|
77
|
+
invocationCount?: number;
|
|
78
|
+
}
|
|
79
|
+
/** Runtime context passed to every handler — single source of truth.
|
|
80
|
+
* Built once per MCP server lifetime, reused across all calls. */
|
|
81
|
+
export interface ToolRuntime {
|
|
82
|
+
cwd: string;
|
|
83
|
+
meta: Awaited<ReturnType<typeof git.getRepoMeta>>;
|
|
84
|
+
store: store.MnemeStore;
|
|
85
|
+
embedder: EmbeddingProvider;
|
|
86
|
+
}
|
|
87
|
+
/** A Mneme tool definition — one per CLI command we expose via MCP.
|
|
88
|
+
*
|
|
89
|
+
* description: write it like a good lesson title — *include WHEN to use + examples*.
|
|
90
|
+
* AI tool selection is mostly description-matching; vague descriptions = wrong picks.
|
|
91
|
+
*
|
|
92
|
+
* triggers: example user phrases that should fire this tool. The AI doesn't
|
|
93
|
+
* see triggers directly, but we use them in the syllabus + as anchor for
|
|
94
|
+
* description quality reviews. */
|
|
95
|
+
export interface MnemeTool<TArgs = Record<string, unknown>, TData = unknown> {
|
|
96
|
+
/** MCP tool name — must match `^mneme\.[a-z_]+\.[a-z_]+$` for grouping */
|
|
97
|
+
name: string;
|
|
98
|
+
/** Category for the capabilities syllabus */
|
|
99
|
+
category: ToolCategory;
|
|
100
|
+
/** Rich description: 2-4 sentences. Include WHEN to use + 2-3 example user
|
|
101
|
+
* phrases this should match. The AI picks tools by matching user intent
|
|
102
|
+
* to descriptions, so be specific. */
|
|
103
|
+
description: string;
|
|
104
|
+
/** Example user queries that should trigger this tool. Used for
|
|
105
|
+
* syllabus generation + description-quality review. */
|
|
106
|
+
triggers: string[];
|
|
107
|
+
/** JSON Schema for input parameters */
|
|
108
|
+
inputSchema: Tool["inputSchema"];
|
|
109
|
+
/** Async handler — receives runtime + parsed args */
|
|
110
|
+
handler: (runtime: ToolRuntime, args: TArgs) => Promise<ToolResponse<TData>>;
|
|
111
|
+
}
|
|
112
|
+
/** Convert a wrapped tool response into MCP's expected CallToolResult.
|
|
113
|
+
* We serialise the entire envelope (data + wisdom + followUp + confidence)
|
|
114
|
+
* so the AI sees the full picture in one shot. */
|
|
115
|
+
export declare function toCallResult(r: ToolResponse): CallToolResult;
|
|
116
|
+
/** Convert a thrown error into MCP's expected error result */
|
|
117
|
+
export declare function toErrorResult(message: string): CallToolResult;
|
|
118
|
+
//# sourceMappingURL=_types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_types.d.ts","sourceRoot":"","sources":["../../src/tools/_types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAC/E,OAAO,KAAK,EAAE,GAAG,EAAE,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AAC,EAAE,MAAM,CAAC;CAC1B;AAED;mEACmE;AACnE,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC;IAClD,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC;IACxB,QAAQ,EAAE,iBAAiB,CAAC;CAC7B;AAED;;;;;;;mCAOmC;AACnC,MAAM,WAAW,SAAS,CAAC,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,KAAK,GAAG,OAAO;IACzE,0EAA0E;IAC1E,IAAI,EAAE,MAAM,CAAC;IACb,6CAA6C;IAC7C,QAAQ,EAAE,YAAY,CAAC;IACvB;;2CAEuC;IACvC,WAAW,EAAE,MAAM,CAAC;IACpB;4DACwD;IACxD,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,uCAAuC;IACvC,WAAW,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;IACjC,qDAAqD;IACrD,OAAO,EAAE,CAAC,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,KAAK,KAAK,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;CAC9E;AAED;;mDAEmD;AACnD,wBAAgB,YAAY,CAAC,CAAC,EAAE,YAAY,GAAG,cAAc,CAkB5D;AAED,8DAA8D;AAC9D,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,cAAc,CAK7D"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP tool type system — the contract every Mneme tool implements.
|
|
3
|
+
*
|
|
4
|
+
* Design principle: every response carries WISDOM, not just data. AI clients
|
|
5
|
+
* shouldn't need to interpret raw JSON — Mneme pre-digests each finding into
|
|
6
|
+
* a 1-3 sentence narrative the AI can quote (or paraphrase) directly to the
|
|
7
|
+
* user. Citations live in `data`, the human meaning lives in `wisdom`.
|
|
8
|
+
*/
|
|
9
|
+
/** Convert a wrapped tool response into MCP's expected CallToolResult.
|
|
10
|
+
* We serialise the entire envelope (data + wisdom + followUp + confidence)
|
|
11
|
+
* so the AI sees the full picture in one shot. */
|
|
12
|
+
export function toCallResult(r) {
|
|
13
|
+
return {
|
|
14
|
+
content: [
|
|
15
|
+
{
|
|
16
|
+
type: "text",
|
|
17
|
+
text: JSON.stringify({
|
|
18
|
+
data: r.data,
|
|
19
|
+
wisdom: r.wisdom,
|
|
20
|
+
followUp: r.followUp ?? [],
|
|
21
|
+
confidence: r.confidence ?? { level: "medium" },
|
|
22
|
+
}, null, 2),
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
/** Convert a thrown error into MCP's expected error result */
|
|
28
|
+
export function toErrorResult(message) {
|
|
29
|
+
return {
|
|
30
|
+
isError: true,
|
|
31
|
+
content: [{ type: "text", text: message }],
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=_types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_types.js","sourceRoot":"","sources":["../../src/tools/_types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AA0HH;;mDAEmD;AACnD,MAAM,UAAU,YAAY,CAAC,CAAe;IAC1C,OAAO;QACL,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAClB;oBACE,IAAI,EAAE,CAAC,CAAC,IAAI;oBACZ,MAAM,EAAE,CAAC,CAAC,MAAM;oBAChB,QAAQ,EAAE,CAAC,CAAC,QAAQ,IAAI,EAAE;oBAC1B,UAAU,EAAE,CAAC,CAAC,UAAU,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE;iBAChD,EACD,IAAI,EACJ,CAAC,CACF;aACF;SACF;KACF,CAAC;AACJ,CAAC;AAED,8DAA8D;AAC9D,MAAM,UAAU,aAAa,CAAC,OAAe;IAC3C,OAAO;QACL,OAAO,EAAE,IAAI;QACb,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;KAC3C,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI Session Audit — the trust certificate for every AI-driven commit.
|
|
3
|
+
*
|
|
4
|
+
* Vendor-neutral. Works against any AI tool whose commits land in `git log`.
|
|
5
|
+
* Each tool here is a different "mode" of the audit pipeline.
|
|
6
|
+
*/
|
|
7
|
+
import type { MnemeTool } from "./_types.js";
|
|
8
|
+
export declare const auditTools: MnemeTool[];
|
|
9
|
+
//# sourceMappingURL=audit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audit.d.ts","sourceRoot":"","sources":["../../src/tools/audit.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,eAAO,MAAM,UAAU,EAAE,SAAS,EAsOjC,CAAC"}
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI Session Audit — the trust certificate for every AI-driven commit.
|
|
3
|
+
*
|
|
4
|
+
* Vendor-neutral. Works against any AI tool whose commits land in `git log`.
|
|
5
|
+
* Each tool here is a different "mode" of the audit pipeline.
|
|
6
|
+
*/
|
|
7
|
+
import { runCliJson } from "./_runtime.js";
|
|
8
|
+
export const auditTools = [
|
|
9
|
+
{
|
|
10
|
+
name: "mneme.audit.baseline",
|
|
11
|
+
category: "audit",
|
|
12
|
+
description: "Snapshot the repo's behavior, types, perf, and sample-command outputs BEFORE letting an AI work on it. " +
|
|
13
|
+
"Stores the snapshot in .mneme/audit-baseline.json for later certify-time comparison. " +
|
|
14
|
+
"Use this WHEN: user is about to start an AI-driven coding session and wants a 'before' snapshot to grade against.",
|
|
15
|
+
triggers: [
|
|
16
|
+
"snapshot before AI works",
|
|
17
|
+
"audit baseline",
|
|
18
|
+
"เก็บ baseline ก่อน AI ทำงาน",
|
|
19
|
+
],
|
|
20
|
+
inputSchema: { type: "object", properties: {} },
|
|
21
|
+
handler: async (rt) => {
|
|
22
|
+
const data = await runCliJson(rt.meta.rootPath, "audit", ["--baseline"]);
|
|
23
|
+
return {
|
|
24
|
+
data,
|
|
25
|
+
wisdom: "Baseline captured. Ask user to let their AI work, then run mneme.audit.certify when done to compare.",
|
|
26
|
+
followUp: ["mneme.audit.trace", "mneme.audit.certify"],
|
|
27
|
+
confidence: { level: "high" },
|
|
28
|
+
};
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
name: "mneme.audit.trace",
|
|
33
|
+
category: "audit",
|
|
34
|
+
description: "After AI worked: capture the diff + detect WHICH AI tool produced the commit (Claude Code · Cursor · Codex · Devin · ...). " +
|
|
35
|
+
"Use this WHEN user asks: 'what did the AI just change?', 'which AI tool wrote this commit?', 'show me the AI session trace'.",
|
|
36
|
+
triggers: [
|
|
37
|
+
"what did the AI change?",
|
|
38
|
+
"which AI tool wrote this?",
|
|
39
|
+
"audit trace",
|
|
40
|
+
],
|
|
41
|
+
inputSchema: { type: "object", properties: {} },
|
|
42
|
+
handler: async (rt) => {
|
|
43
|
+
const data = await runCliJson(rt.meta.rootPath, "audit", ["--trace"]);
|
|
44
|
+
return {
|
|
45
|
+
data,
|
|
46
|
+
wisdom: "Trace captured. Use mneme.audit.verify next to check whether the AI's commit message matches the actual diff.",
|
|
47
|
+
followUp: ["mneme.audit.verify", "mneme.audit.certify"],
|
|
48
|
+
confidence: { level: "high" },
|
|
49
|
+
};
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
name: "mneme.audit.verify",
|
|
54
|
+
category: "audit",
|
|
55
|
+
description: "Leviathan-style narrative-vs-reality check: does the AI's commit message ACTUALLY match the diff? " +
|
|
56
|
+
"Catches AI gaslighting (e.g. 'no change to db.ts' but the diff has 3 lines in db.ts). " +
|
|
57
|
+
"Use this WHEN user asks: 'is the AI lying about its changes?', 'verify the commit narrative', 'AI gaslight check'.",
|
|
58
|
+
triggers: [
|
|
59
|
+
"is the AI lying?",
|
|
60
|
+
"verify commit narrative",
|
|
61
|
+
"AI gaslight check",
|
|
62
|
+
],
|
|
63
|
+
inputSchema: { type: "object", properties: {} },
|
|
64
|
+
handler: async (rt) => {
|
|
65
|
+
const data = await runCliJson(rt.meta.rootPath, "audit", ["--verify"]);
|
|
66
|
+
return {
|
|
67
|
+
data,
|
|
68
|
+
wisdom: "Verification complete. If contradictions are found, escalate to mneme.audit.certify for the full trust certificate.",
|
|
69
|
+
followUp: ["mneme.audit.certify"],
|
|
70
|
+
confidence: { level: "high" },
|
|
71
|
+
};
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
name: "mneme.audit.certify",
|
|
76
|
+
category: "audit",
|
|
77
|
+
description: "The flagship: 5-axis trust certificate for an AI commit (behavioral parity · API contract · test pass rate · perf · narrative match). " +
|
|
78
|
+
"Plus forensic axes (TIME / FILES / STYLE / SIZE). Returns PASS / WARN / FAIL with structured findings. " +
|
|
79
|
+
"Use this WHEN user asks: 'is this commit safe?', 'grade the AI's homework', 'CI gate the AI commit', " +
|
|
80
|
+
"'final trust certificate', 'should I merge this?'.",
|
|
81
|
+
triggers: [
|
|
82
|
+
"grade the AI commit",
|
|
83
|
+
"is this commit safe to merge?",
|
|
84
|
+
"trust certificate",
|
|
85
|
+
"audit certify",
|
|
86
|
+
],
|
|
87
|
+
inputSchema: {
|
|
88
|
+
type: "object",
|
|
89
|
+
properties: {
|
|
90
|
+
explain: { type: "boolean", description: "Add plain-English narrative summary" },
|
|
91
|
+
strict: { type: "boolean", description: "Treat skipped axes as fail (compliance mode)" },
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
handler: async (rt, args) => {
|
|
95
|
+
const cliArgs = ["--certify"];
|
|
96
|
+
if (args["explain"])
|
|
97
|
+
cliArgs.push("--explain");
|
|
98
|
+
if (args["strict"])
|
|
99
|
+
cliArgs.push("--strict");
|
|
100
|
+
const data = await runCliJson(rt.meta.rootPath, "audit", cliArgs);
|
|
101
|
+
const verdict = data?.verdict ?? "unknown";
|
|
102
|
+
const wisdom = verdict === "PASS"
|
|
103
|
+
? "AI commit PASSED all 5 axes — safe to merge."
|
|
104
|
+
: verdict === "WARN"
|
|
105
|
+
? "AI commit has WARNINGS — review the flagged axes before merging."
|
|
106
|
+
: verdict === "FAIL"
|
|
107
|
+
? "AI commit FAILED — do NOT merge until issues are resolved. See findings array for details."
|
|
108
|
+
: "Audit completed; check the data field for the verdict.";
|
|
109
|
+
return {
|
|
110
|
+
data,
|
|
111
|
+
wisdom,
|
|
112
|
+
followUp: verdict !== "PASS" ? ["mneme.audit.report", "mneme.forensics.vulns"] : [],
|
|
113
|
+
confidence: { level: "high" },
|
|
114
|
+
};
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
name: "mneme.audit.report",
|
|
119
|
+
category: "audit",
|
|
120
|
+
description: "Generate a Markdown audit-trail report (SOX / SOC2 / EU AI Act 2026 compliant) of the most recent AI session. " +
|
|
121
|
+
"Use this WHEN user asks: 'export audit report', 'compliance trail', 'markdown for the auditor'.",
|
|
122
|
+
triggers: [
|
|
123
|
+
"compliance audit report",
|
|
124
|
+
"markdown audit trail",
|
|
125
|
+
"export for SOC2",
|
|
126
|
+
],
|
|
127
|
+
inputSchema: {
|
|
128
|
+
type: "object",
|
|
129
|
+
properties: {
|
|
130
|
+
outPath: { type: "string", description: "Where to write the markdown" },
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
handler: async (rt, args) => {
|
|
134
|
+
const cliArgs = ["--report"];
|
|
135
|
+
if (args["outPath"])
|
|
136
|
+
cliArgs.push("--out", String(args["outPath"]));
|
|
137
|
+
const data = await runCliJson(rt.meta.rootPath, "audit", cliArgs);
|
|
138
|
+
return {
|
|
139
|
+
data,
|
|
140
|
+
wisdom: `Markdown report generated. Compliance-ready for SOX / SOC2 / EU AI Act 2026.`,
|
|
141
|
+
followUp: [],
|
|
142
|
+
confidence: { level: "high" },
|
|
143
|
+
};
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
name: "mneme.audit.deps",
|
|
148
|
+
category: "audit",
|
|
149
|
+
description: "Cross-check this repo's dependencies against OSV.dev — known CVEs and GHSA advisories per package. " +
|
|
150
|
+
"Use this WHEN user asks: 'are our deps safe?', 'CVE scan', 'OSV check', 'security audit of dependencies', " +
|
|
151
|
+
"'do we have vulnerable packages?'.",
|
|
152
|
+
triggers: [
|
|
153
|
+
"scan dependencies for CVEs",
|
|
154
|
+
"OSV check",
|
|
155
|
+
"are our deps safe?",
|
|
156
|
+
],
|
|
157
|
+
inputSchema: { type: "object", properties: {} },
|
|
158
|
+
handler: async (rt) => {
|
|
159
|
+
const data = await runCliJson(rt.meta.rootPath, "deps", ["audit"]);
|
|
160
|
+
const advisories = data?.advisories?.length ?? 0;
|
|
161
|
+
const wisdom = advisories === 0
|
|
162
|
+
? "No known CVEs or GHSAs in current dependency tree."
|
|
163
|
+
: `${advisories} advisor${advisories === 1 ? "y" : "ies"} found across the dependency tree. Check the data.advisories array for severity + fixed-in versions.`;
|
|
164
|
+
return {
|
|
165
|
+
data,
|
|
166
|
+
wisdom,
|
|
167
|
+
followUp: advisories > 0 ? ["mneme.forensics.vulns"] : [],
|
|
168
|
+
confidence: { level: "high" },
|
|
169
|
+
};
|
|
170
|
+
},
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
name: "mneme.audit.conscience",
|
|
174
|
+
category: "audit",
|
|
175
|
+
description: "Risk-score a PR against the repo's own history of regrets, hotfixes, and reverts. " +
|
|
176
|
+
"Use this WHEN user asks: 'is this PR risky based on history?', 'conscience review of these files', " +
|
|
177
|
+
"'historical risk score for the changes'.",
|
|
178
|
+
triggers: [
|
|
179
|
+
"PR risk based on history",
|
|
180
|
+
"conscience review",
|
|
181
|
+
"ตรวจ PR ตามประวัติ",
|
|
182
|
+
],
|
|
183
|
+
inputSchema: {
|
|
184
|
+
type: "object",
|
|
185
|
+
properties: {
|
|
186
|
+
files: { type: "array", items: { type: "string" }, description: "File paths to review" },
|
|
187
|
+
dualJury: { type: "boolean", description: "Run with dual-jury (more conservative)" },
|
|
188
|
+
},
|
|
189
|
+
},
|
|
190
|
+
handler: async (rt, args) => {
|
|
191
|
+
const files = args["files"] ?? [];
|
|
192
|
+
const cliArgs = files.length ? files : [];
|
|
193
|
+
if (args["dualJury"])
|
|
194
|
+
cliArgs.push("--dual-jury");
|
|
195
|
+
const data = await runCliJson(rt.meta.rootPath, "conscience", cliArgs);
|
|
196
|
+
const risk = data?.risk ?? "unknown";
|
|
197
|
+
const wisdom = `Conscience risk verdict: ${risk}. Based on similar past changes in this repo.`;
|
|
198
|
+
return {
|
|
199
|
+
data,
|
|
200
|
+
wisdom,
|
|
201
|
+
followUp: risk === "HIGH" ? ["mneme.insights.premortem", "mneme.audit.certify"] : [],
|
|
202
|
+
confidence: { level: "medium" },
|
|
203
|
+
};
|
|
204
|
+
},
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
name: "mneme.audit.ledger",
|
|
208
|
+
category: "audit",
|
|
209
|
+
description: "Tamper-evident audit log of all AI-driven commits with HMAC + Ed25519 signatures. SOX / SOC2 ready. " +
|
|
210
|
+
"Use this WHEN user asks: 'show audit log', 'tamper-evident trail', 'all AI sessions in this repo'.",
|
|
211
|
+
triggers: [
|
|
212
|
+
"audit log of AI sessions",
|
|
213
|
+
"tamper-evident trail",
|
|
214
|
+
],
|
|
215
|
+
inputSchema: {
|
|
216
|
+
type: "object",
|
|
217
|
+
properties: {
|
|
218
|
+
since: { type: "string", description: "ISO date — only entries since" },
|
|
219
|
+
},
|
|
220
|
+
},
|
|
221
|
+
handler: async (rt, args) => {
|
|
222
|
+
const cliArgs = args["since"] ? ["--since", String(args["since"])] : [];
|
|
223
|
+
const data = await runCliJson(rt.meta.rootPath, "ledger", cliArgs);
|
|
224
|
+
return {
|
|
225
|
+
data,
|
|
226
|
+
wisdom: "Audit ledger entries returned. Each entry is HMAC-chained + Ed25519-signed for tamper-evidence.",
|
|
227
|
+
followUp: ["mneme.audit.report"],
|
|
228
|
+
confidence: { level: "high" },
|
|
229
|
+
};
|
|
230
|
+
},
|
|
231
|
+
},
|
|
232
|
+
];
|
|
233
|
+
//# sourceMappingURL=audit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audit.js","sourceRoot":"","sources":["../../src/tools/audit.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAG3C,MAAM,CAAC,MAAM,UAAU,GAAgB;IACrC;QACE,IAAI,EAAE,sBAAsB;QAC5B,QAAQ,EAAE,OAAO;QACjB,WAAW,EACT,yGAAyG;YACzG,uFAAuF;YACvF,mHAAmH;QACrH,QAAQ,EAAE;YACR,0BAA0B;YAC1B,gBAAgB;YAChB,6BAA6B;SAC9B;QACD,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,EAAE;QAC/C,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE;YACpB,MAAM,IAAI,GAAG,MAAM,UAAU,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;YACzE,OAAO;gBACL,IAAI;gBACJ,MAAM,EAAE,sGAAsG;gBAC9G,QAAQ,EAAE,CAAC,mBAAmB,EAAE,qBAAqB,CAAC;gBACtD,UAAU,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE;aAC9B,CAAC;QACJ,CAAC;KACF;IACD;QACE,IAAI,EAAE,mBAAmB;QACzB,QAAQ,EAAE,OAAO;QACjB,WAAW,EACT,6HAA6H;YAC7H,8HAA8H;QAChI,QAAQ,EA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|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Forensics — applied forensic science for code: Bayesian author attribution,
|
|
3
|
+
* stack-aware vuln hunt, insider-threat anomaly, ENFSI verbal scale.
|
|
4
|
+
*/
|
|
5
|
+
import type { MnemeTool } from "./_types.js";
|
|
6
|
+
export declare const forensicsTools: MnemeTool[];
|
|
7
|
+
//# sourceMappingURL=forensics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"forensics.d.ts","sourceRoot":"","sources":["../../src/tools/forensics.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,eAAO,MAAM,cAAc,EAAE,SAAS,EA2LrC,CAAC"}
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Forensics — applied forensic science for code: Bayesian author attribution,
|
|
3
|
+
* stack-aware vuln hunt, insider-threat anomaly, ENFSI verbal scale.
|
|
4
|
+
*/
|
|
5
|
+
import { runCliJson } from "./_runtime.js";
|
|
6
|
+
export const forensicsTools = [
|
|
7
|
+
{
|
|
8
|
+
name: "mneme.forensics.vulns",
|
|
9
|
+
category: "forensics",
|
|
10
|
+
description: "Scan git history for security holes (51 patterns across SQL injection, XSS, hardcoded secrets, XXE, SSRF, " +
|
|
11
|
+
"auth bypass, CSRF, etc.). Each finding is Bayesian-filtered: posterior = stack-prior × AST-evidence, so non-applicable " +
|
|
12
|
+
"rules are dropped before they leave the scanner. " +
|
|
13
|
+
"Use this WHEN user asks: 'find security issues', 'vuln scan', 'CWE check', 'what security holes are hiding?'.",
|
|
14
|
+
triggers: [
|
|
15
|
+
"find security issues",
|
|
16
|
+
"vulnerability scan",
|
|
17
|
+
"หา bug ความปลอดภัย",
|
|
18
|
+
"scan for SQL injection",
|
|
19
|
+
],
|
|
20
|
+
inputSchema: {
|
|
21
|
+
type: "object",
|
|
22
|
+
properties: {
|
|
23
|
+
top: { type: "number", description: "Top N findings (default 50)" },
|
|
24
|
+
minPosterior: { type: "number", description: "Minimum posterior threshold (default 0.3)" },
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
handler: async (rt, args) => {
|
|
28
|
+
const cliArgs = [];
|
|
29
|
+
if (args["top"])
|
|
30
|
+
cliArgs.push("--top", String(args["top"]));
|
|
31
|
+
if (args["minPosterior"])
|
|
32
|
+
cliArgs.push("--min-posterior", String(args["minPosterior"]));
|
|
33
|
+
const data = await runCliJson(rt.meta.rootPath, "forensics vulns", cliArgs);
|
|
34
|
+
const findings = data?.findings?.length ?? 0;
|
|
35
|
+
const wisdom = findings === 0
|
|
36
|
+
? "No vulnerabilities surfaced above the posterior threshold. Clean."
|
|
37
|
+
: `${findings} candidate vulnerabilit${findings === 1 ? "y" : "ies"} surfaced. Each is a CANDIDATE for human review — verify before action.`;
|
|
38
|
+
return {
|
|
39
|
+
data,
|
|
40
|
+
wisdom,
|
|
41
|
+
followUp: findings > 0 ? ["mneme.forensics.show", "mneme.forensics.suppress"] : [],
|
|
42
|
+
confidence: { level: "medium", notes: "Findings are heuristic — Bayesian-filtered but always verify before treating as confirmed." },
|
|
43
|
+
};
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: "mneme.forensics.anomaly",
|
|
48
|
+
category: "forensics",
|
|
49
|
+
description: "Insider-threat / credential-compromise detector: flag commits whose timing, file footprint, or style deviates " +
|
|
50
|
+
"from the author's baseline. Use this WHEN user asks: 'any suspicious commits?', 'insider threat scan', " +
|
|
51
|
+
"'is this account compromised?', 'unusual commits'.",
|
|
52
|
+
triggers: [
|
|
53
|
+
"any suspicious commits?",
|
|
54
|
+
"insider threat scan",
|
|
55
|
+
"compromised account check",
|
|
56
|
+
],
|
|
57
|
+
inputSchema: { type: "object", properties: {} },
|
|
58
|
+
handler: async (rt) => {
|
|
59
|
+
const data = await runCliJson(rt.meta.rootPath, "forensics anomaly");
|
|
60
|
+
const flagged = data?.anomalies?.length ?? 0;
|
|
61
|
+
const wisdom = flagged === 0
|
|
62
|
+
? "No anomalies detected — all commits match author baselines."
|
|
63
|
+
: `${flagged} suspicious commit${flagged === 1 ? "" : "s"} flagged. Each deviates from the author's normal pattern (timing, files, or style).`;
|
|
64
|
+
return {
|
|
65
|
+
data,
|
|
66
|
+
wisdom,
|
|
67
|
+
followUp: flagged > 0 ? ["mneme.forensics.match", "mneme.forensics.attribute"] : [],
|
|
68
|
+
confidence: { level: "medium", notes: "Anomaly ≠ proof of malice. Treat as 'investigate', not 'accuse'." },
|
|
69
|
+
};
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
name: "mneme.forensics.match",
|
|
74
|
+
category: "forensics",
|
|
75
|
+
description: "Likelihood-ratio test: 'Did Alice REALLY write this commit?'. Returns ENFSI verbal-scale verdict + LR. " +
|
|
76
|
+
"Use this WHEN user asks: 'is this commit really by X?', 'verify authorship', 'did Alice write a3f9b21?'.",
|
|
77
|
+
triggers: [
|
|
78
|
+
"did Alice write this commit?",
|
|
79
|
+
"verify commit authorship",
|
|
80
|
+
"ตรวจสอบ author จริงๆ",
|
|
81
|
+
],
|
|
82
|
+
inputSchema: {
|
|
83
|
+
type: "object",
|
|
84
|
+
properties: {
|
|
85
|
+
commit: { type: "string", description: "Commit hash or HEAD-relative ref" },
|
|
86
|
+
author: { type: "string", description: "Suspected author email" },
|
|
87
|
+
},
|
|
88
|
+
required: ["commit", "author"],
|
|
89
|
+
},
|
|
90
|
+
handler: async (rt, args) => {
|
|
91
|
+
const data = await runCliJson(rt.meta.rootPath, "forensics match", [String(args["commit"]), String(args["author"])]);
|
|
92
|
+
const verdict = data?.verdict ?? "?";
|
|
93
|
+
const wisdom = `ENFSI verdict: ${verdict}. Likelihood ratio shown in data.lr. Higher LR = stronger evidence FOR the claimed author.`;
|
|
94
|
+
return {
|
|
95
|
+
data,
|
|
96
|
+
wisdom,
|
|
97
|
+
followUp: ["mneme.forensics.attribute"],
|
|
98
|
+
confidence: { level: "medium", notes: "Stylometric matching, not cryptographic proof." },
|
|
99
|
+
};
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
name: "mneme.forensics.attribute",
|
|
104
|
+
category: "forensics",
|
|
105
|
+
description: "Rank ALL candidate authors for a commit by stylometric likelihood. " +
|
|
106
|
+
"Use this WHEN user asks: 'who most likely wrote this?', 'attribute this commit', 'authorship ranking'.",
|
|
107
|
+
triggers: [
|
|
108
|
+
"who most likely wrote this commit?",
|
|
109
|
+
"attribute this commit",
|
|
110
|
+
],
|
|
111
|
+
inputSchema: {
|
|
112
|
+
type: "object",
|
|
113
|
+
properties: {
|
|
114
|
+
commit: { type: "string", description: "Commit hash or HEAD-relative ref (default HEAD)" },
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
handler: async (rt, args) => {
|
|
118
|
+
const cliArgs = args["commit"] ? [String(args["commit"])] : [];
|
|
119
|
+
const data = await runCliJson(rt.meta.rootPath, "forensics attribute", cliArgs);
|
|
120
|
+
const top = data?.ranking?.[0];
|
|
121
|
+
const wisdom = top
|
|
122
|
+
? `Most likely author: ${top.author} (likelihood ratio ${top.lr.toFixed(2)}). Full ranking in data.ranking.`
|
|
123
|
+
: "No candidates ranked.";
|
|
124
|
+
return {
|
|
125
|
+
data,
|
|
126
|
+
wisdom,
|
|
127
|
+
followUp: top ? ["mneme.forensics.match"] : [],
|
|
128
|
+
confidence: { level: "medium" },
|
|
129
|
+
};
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
name: "mneme.forensics.show",
|
|
134
|
+
category: "forensics",
|
|
135
|
+
description: "Open a single forensics finding by ID — full context, the line of code, recommended fix. " +
|
|
136
|
+
"Use this WHEN user wants to dig into a specific finding from `mneme.forensics.vulns`.",
|
|
137
|
+
triggers: [
|
|
138
|
+
"show finding 988c6155",
|
|
139
|
+
"details of this vuln",
|
|
140
|
+
],
|
|
141
|
+
inputSchema: {
|
|
142
|
+
type: "object",
|
|
143
|
+
properties: {
|
|
144
|
+
id: { type: "string", description: "Finding ID from vulns scan" },
|
|
145
|
+
},
|
|
146
|
+
required: ["id"],
|
|
147
|
+
},
|
|
148
|
+
handler: async (rt, args) => {
|
|
149
|
+
const data = await runCliJson(rt.meta.rootPath, "show", [String(args["id"])]);
|
|
150
|
+
return {
|
|
151
|
+
data,
|
|
152
|
+
wisdom: "Finding context loaded. The data includes file/line, code excerpt, CWE, and any recommended fix.",
|
|
153
|
+
followUp: ["mneme.forensics.suppress"],
|
|
154
|
+
confidence: { level: "high" },
|
|
155
|
+
};
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
name: "mneme.forensics.suppress",
|
|
160
|
+
category: "forensics",
|
|
161
|
+
description: "Mark a finding as a false positive — won't appear in future scans. Saved to .mneme/suppressions.json. " +
|
|
162
|
+
"Use this WHEN user has reviewed a finding and confirmed it's not a real issue.",
|
|
163
|
+
triggers: [
|
|
164
|
+
"suppress this finding",
|
|
165
|
+
"mark as false positive",
|
|
166
|
+
],
|
|
167
|
+
inputSchema: {
|
|
168
|
+
type: "object",
|
|
169
|
+
properties: {
|
|
170
|
+
id: { type: "string", description: "Finding ID" },
|
|
171
|
+
reason: { type: "string", description: "Why this is a false positive" },
|
|
172
|
+
},
|
|
173
|
+
required: ["id"],
|
|
174
|
+
},
|
|
175
|
+
handler: async (rt, args) => {
|
|
176
|
+
const cliArgs = [String(args["id"])];
|
|
177
|
+
if (args["reason"])
|
|
178
|
+
cliArgs.push("--reason", String(args["reason"]));
|
|
179
|
+
const data = await runCliJson(rt.meta.rootPath, "suppress", cliArgs);
|
|
180
|
+
return {
|
|
181
|
+
data,
|
|
182
|
+
wisdom: `Finding suppressed. Future scans will skip it.`,
|
|
183
|
+
followUp: [],
|
|
184
|
+
confidence: { level: "high" },
|
|
185
|
+
};
|
|
186
|
+
},
|
|
187
|
+
},
|
|
188
|
+
];
|
|
189
|
+
//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,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;YACrE,OAAO;gBACL,IAAI;gBACJ,MAAM,EAAE,gDAAgD;gBACxD,QAAQ,EAAE,EAAE;gBACZ,UAAU,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE;aAC9B,CAAC;QACJ,CAAC;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Insights — applied storytelling, regret-mining, and prediction over git history.
|
|
3
|
+
* 24 tools that surface narrative, friction, and risk patterns the user can act on.
|
|
4
|
+
*/
|
|
5
|
+
import type { MnemeTool } from "./_types.js";
|
|
6
|
+
export declare const insightsTools: MnemeTool[];
|
|
7
|
+
//# sourceMappingURL=insights.d.ts.map
|