@pcircle/memesh 4.5.0 → 4.5.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.
- package/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/.mcp.json +1 -1
- package/README.de.md +2 -5
- package/README.es.md +5 -8
- package/README.fr.md +3 -6
- package/README.ja.md +5 -8
- package/README.ko.md +5 -8
- package/README.md +28 -10
- package/README.pt.md +3 -6
- package/README.th.md +3 -6
- package/README.vi.md +3 -6
- package/README.zh-CN.md +5 -8
- package/README.zh-TW.md +5 -8
- package/dashboard/dist/index.html +9 -9
- package/dist/cli/view.d.ts.map +1 -1
- package/dist/cli/view.js +2 -2
- package/dist/cli/view.js.map +1 -1
- package/dist/core/analytics.d.ts +3 -3
- package/dist/core/analytics.d.ts.map +1 -1
- package/dist/core/analytics.js.map +1 -1
- package/dist/core/config.d.ts +0 -1
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +2 -1
- package/dist/core/config.js.map +1 -1
- package/dist/core/demo.d.ts +2 -2
- package/dist/core/demo.d.ts.map +1 -1
- package/dist/core/demo.js.map +1 -1
- package/dist/core/doctor.d.ts +1 -0
- package/dist/core/doctor.d.ts.map +1 -1
- package/dist/core/doctor.js +191 -47
- package/dist/core/doctor.js.map +1 -1
- package/dist/core/dreamer.d.ts +15 -7
- package/dist/core/dreamer.d.ts.map +1 -1
- package/dist/core/dreamer.js +310 -35
- package/dist/core/dreamer.js.map +1 -1
- package/dist/core/embedder.d.ts +2 -1
- package/dist/core/embedder.d.ts.map +1 -1
- package/dist/core/embedder.js +22 -1
- package/dist/core/embedder.js.map +1 -1
- package/dist/core/extractor.d.ts.map +1 -1
- package/dist/core/extractor.js +2 -1
- package/dist/core/extractor.js.map +1 -1
- package/dist/core/graph.d.ts +4 -4
- package/dist/core/graph.d.ts.map +1 -1
- package/dist/core/graph.js.map +1 -1
- package/dist/core/install-hooks.d.ts +1 -0
- package/dist/core/install-hooks.d.ts.map +1 -1
- package/dist/core/install-hooks.js +0 -0
- package/dist/core/install-hooks.js.map +1 -1
- package/dist/core/kg-backfill.d.ts +4 -4
- package/dist/core/kg-backfill.d.ts.map +1 -1
- package/dist/core/kg-backfill.js +1 -1
- package/dist/core/kg-backfill.js.map +1 -1
- package/dist/core/lesson-engine.d.ts +1 -0
- package/dist/core/lesson-engine.d.ts.map +1 -1
- package/dist/core/lesson-engine.js +1 -0
- package/dist/core/lesson-engine.js.map +1 -1
- package/dist/core/lifecycle.d.ts +4 -4
- package/dist/core/lifecycle.d.ts.map +1 -1
- package/dist/core/lifecycle.js +1 -1
- package/dist/core/lifecycle.js.map +1 -1
- package/dist/core/llm-client.d.ts.map +1 -1
- package/dist/core/llm-client.js +3 -6
- package/dist/core/llm-client.js.map +1 -1
- package/dist/core/llm-telemetry.d.ts +4 -4
- package/dist/core/llm-telemetry.d.ts.map +1 -1
- package/dist/core/llm-telemetry.js +1 -1
- package/dist/core/llm-telemetry.js.map +1 -1
- package/dist/core/memory-tool.d.ts.map +1 -1
- package/dist/core/memory-tool.js +4 -0
- package/dist/core/memory-tool.js.map +1 -1
- package/dist/core/operations.d.ts.map +1 -1
- package/dist/core/operations.js +22 -7
- package/dist/core/operations.js.map +1 -1
- package/dist/core/paths.d.ts +3 -0
- package/dist/core/paths.d.ts.map +1 -1
- package/dist/core/paths.js +67 -1
- package/dist/core/paths.js.map +1 -1
- package/dist/core/patterns.d.ts +2 -2
- package/dist/core/patterns.d.ts.map +1 -1
- package/dist/core/patterns.js.map +1 -1
- package/dist/core/project-tags.d.ts +3 -3
- package/dist/core/project-tags.d.ts.map +1 -1
- package/dist/core/project-tags.js.map +1 -1
- package/dist/core/projects.d.ts +2 -2
- package/dist/core/projects.d.ts.map +1 -1
- package/dist/core/projects.js.map +1 -1
- package/dist/core/schema-export.d.ts.map +1 -1
- package/dist/core/schema-export.js +0 -34
- package/dist/core/schema-export.js.map +1 -1
- package/dist/core/serializer.d.ts.map +1 -1
- package/dist/core/serializer.js +45 -4
- package/dist/core/serializer.js.map +1 -1
- package/dist/core/stats.d.ts +2 -2
- package/dist/core/stats.d.ts.map +1 -1
- package/dist/core/stats.js.map +1 -1
- package/dist/core/transcript-extractor.d.ts +5 -6
- package/dist/core/transcript-extractor.d.ts.map +1 -1
- package/dist/core/transcript-extractor.js +4 -24
- package/dist/core/transcript-extractor.js.map +1 -1
- package/dist/core/transcript-source.d.ts.map +1 -1
- package/dist/core/transcript-source.js.map +1 -1
- package/dist/core/types.d.ts +17 -7
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js +2 -0
- package/dist/core/types.js.map +1 -1
- package/dist/db.d.ts +5 -5
- package/dist/db.d.ts.map +1 -1
- package/dist/db.js +155 -17
- package/dist/db.js.map +1 -1
- package/dist/knowledge-graph.d.ts +3 -2
- package/dist/knowledge-graph.d.ts.map +1 -1
- package/dist/knowledge-graph.js +19 -10
- package/dist/knowledge-graph.js.map +1 -1
- package/dist/mcp/server.js +2 -1
- package/dist/mcp/server.js.map +1 -1
- package/dist/skills-manifest.json +28 -33
- package/dist/storage/conflicts.d.ts +3 -3
- package/dist/storage/conflicts.d.ts.map +1 -1
- package/dist/storage/conflicts.js.map +1 -1
- package/dist/storage/fts-index.d.ts +4 -4
- package/dist/storage/fts-index.d.ts.map +1 -1
- package/dist/storage/fts-index.js.map +1 -1
- package/dist/storage/sqlite.d.ts +20 -0
- package/dist/storage/sqlite.d.ts.map +1 -0
- package/dist/storage/sqlite.js +64 -0
- package/dist/storage/sqlite.js.map +1 -0
- package/dist/storage/vector-index.d.ts +3 -0
- package/dist/storage/vector-index.d.ts.map +1 -0
- package/dist/storage/vector-index.js +7 -0
- package/dist/storage/vector-index.js.map +1 -0
- package/dist/transports/cli/cli.d.ts.map +1 -1
- package/dist/transports/cli/cli.js +126 -84
- package/dist/transports/cli/cli.js.map +1 -1
- package/dist/transports/http/retired-routes.d.ts.map +1 -1
- package/dist/transports/http/retired-routes.js +1 -0
- package/dist/transports/http/retired-routes.js.map +1 -1
- package/dist/transports/http/server.d.ts.map +1 -1
- package/dist/transports/http/server.js +48 -29
- package/dist/transports/http/server.js.map +1 -1
- package/dist/transports/mcp/handlers.d.ts +4 -96
- package/dist/transports/mcp/handlers.d.ts.map +1 -1
- package/dist/transports/mcp/handlers.js +24 -58
- package/dist/transports/mcp/handlers.js.map +1 -1
- package/dist/transports/schemas.d.ts +10 -30
- package/dist/transports/schemas.d.ts.map +1 -1
- package/dist/transports/schemas.js +5 -29
- package/dist/transports/schemas.js.map +1 -1
- package/hooks/hooks.json +0 -10
- package/package.json +6 -10
- package/scripts/hooks/_generated/core-paths.js +67 -1
- package/scripts/hooks/_generated/sqlite.js +71 -0
- package/scripts/hooks/_shared.js +286 -195
- package/scripts/hooks/post-commit.js +52 -10
- package/scripts/hooks/pre-compact.js +10 -7
- package/scripts/hooks/pre-edit-recall.js +4 -8
- package/scripts/hooks/session-start.js +95 -47
- package/scripts/hooks/session-summary.js +120 -52
- package/scripts/hooks/user-prompt-intent.js +3 -2
- package/skills/memesh/SKILL.md +1 -2
- package/dist/core/skill-usage-log.d.ts +0 -11
- package/dist/core/skill-usage-log.d.ts.map +0 -1
- package/dist/core/skill-usage-log.js +0 -125
- package/dist/core/skill-usage-log.js.map +0 -1
- package/dist/core/verifier.d.ts +0 -40
- package/dist/core/verifier.d.ts.map +0 -1
- package/dist/core/verifier.js +0 -206
- package/dist/core/verifier.js.map +0 -1
- package/dist/mcp/launcher.d.ts +0 -3
- package/dist/mcp/launcher.d.ts.map +0 -1
- package/dist/mcp/launcher.js +0 -37
- package/dist/mcp/launcher.js.map +0 -1
- package/scripts/hooks/pre-bash-orchestration-nudge.js +0 -155
- package/scripts/postinstall-rebuild.mjs +0 -41
- package/skills/agentic-orchestration/SKILL.md +0 -399
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { NAMESPACES } from '../core/types.js';
|
|
2
3
|
const sanitizeName = (s) => s.replace(/[\r\n\t]+/g, ' ').trim();
|
|
3
4
|
const nameField = z.string().min(1).max(255).transform(sanitizeName).refine(s => s.length > 0, {
|
|
4
5
|
message: 'Name must not be blank after sanitization',
|
|
@@ -12,14 +13,14 @@ export const RememberSchema = z.object({
|
|
|
12
13
|
.array(z.object({ to: z.string().min(1).max(255), type: z.string().min(1).max(100) }))
|
|
13
14
|
.max(50)
|
|
14
15
|
.optional(),
|
|
15
|
-
namespace: z.enum(
|
|
16
|
+
namespace: z.enum(NAMESPACES).optional(),
|
|
16
17
|
});
|
|
17
18
|
export const RecallSchema = z.object({
|
|
18
19
|
query: z.string().max(1000).optional(),
|
|
19
20
|
tag: z.string().max(255).optional(),
|
|
20
21
|
limit: z.number().int().min(1).max(100).optional(),
|
|
21
22
|
include_archived: z.boolean().optional(),
|
|
22
|
-
namespace: z.enum(
|
|
23
|
+
namespace: z.enum(NAMESPACES).optional(),
|
|
23
24
|
cross_project: z.boolean().optional(),
|
|
24
25
|
});
|
|
25
26
|
export const ForgetSchema = z.object({
|
|
@@ -28,7 +29,7 @@ export const ForgetSchema = z.object({
|
|
|
28
29
|
});
|
|
29
30
|
export const ExportSchema = z.object({
|
|
30
31
|
tag: z.string().max(255).optional(),
|
|
31
|
-
namespace: z.
|
|
32
|
+
namespace: z.enum(NAMESPACES).optional(),
|
|
32
33
|
limit: z.number().int().min(1).max(10000).optional(),
|
|
33
34
|
});
|
|
34
35
|
export const ExportResultSchema = z.object({
|
|
@@ -46,7 +47,7 @@ export const ExportResultSchema = z.object({
|
|
|
46
47
|
});
|
|
47
48
|
export const ImportSchema = z.object({
|
|
48
49
|
data: ExportResultSchema,
|
|
49
|
-
namespace: z.
|
|
50
|
+
namespace: z.enum(NAMESPACES).optional(),
|
|
50
51
|
merge_strategy: z.enum(['skip', 'overwrite', 'append']),
|
|
51
52
|
});
|
|
52
53
|
export const LearnSchema = z.object({
|
|
@@ -60,29 +61,4 @@ export const UserPatternsSchema = z.object({
|
|
|
60
61
|
categories: z.array(z.enum(['workSchedule', 'toolPreferences', 'focusAreas', 'workflow', 'strengths', 'learningAreas'])).optional()
|
|
61
62
|
.describe('Specific categories to return. Omit for all.'),
|
|
62
63
|
});
|
|
63
|
-
const ExternalCheckSchema = z.object({
|
|
64
|
-
pass: z.boolean(),
|
|
65
|
-
summary: z.string().max(2000).optional(),
|
|
66
|
-
});
|
|
67
|
-
export const VerifyAgentWorkSchema = z.object({
|
|
68
|
-
agent_id: z.string().min(1).max(255)
|
|
69
|
-
.describe('Identifier for the agent whose work is being verified.'),
|
|
70
|
-
workdir: z.string().min(1).max(1000)
|
|
71
|
-
.describe('Absolute path to the git working tree the agent edited.'),
|
|
72
|
-
base: z.string().max(255).optional()
|
|
73
|
-
.describe('Git ref/sha to diff against. Defaults to merge-base with origin/main.'),
|
|
74
|
-
claim: z.object({
|
|
75
|
-
expected_files: z.number().int().min(0).max(1000).optional(),
|
|
76
|
-
}).optional()
|
|
77
|
-
.describe('Numbers the agent claimed in its summary, used for cross-checking.'),
|
|
78
|
-
report: z.object({
|
|
79
|
-
pass: z.boolean(),
|
|
80
|
-
typecheck: ExternalCheckSchema.optional(),
|
|
81
|
-
tests: ExternalCheckSchema.optional(),
|
|
82
|
-
lint: ExternalCheckSchema.optional(),
|
|
83
|
-
build: ExternalCheckSchema.optional(),
|
|
84
|
-
summary: z.string().max(2000).optional(),
|
|
85
|
-
}).optional()
|
|
86
|
-
.describe('Pre-computed report from a verification gate hook. If omitted, only reality-check runs.'),
|
|
87
|
-
});
|
|
88
64
|
//# sourceMappingURL=schemas.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../src/transports/schemas.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../src/transports/schemas.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,CAAC,EAAE,MA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I,CAAC,CAAC,MAAM,EAAE,WAAW,EAAE,QAAQ,CAAC,CAAC;CACxD,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC;IAClC,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC;IAChC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE;IAC3C,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE;IAC3C,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,QAAQ,EAAE;CAC5D,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,cAAc,EAAE,iBAAiB,EAAE,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;SAChI,QAAQ,CAAC,8CAA8C,CAAC;CAC5D,CAAC,CAAC"}
|
package/hooks/hooks.json
CHANGED
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pcircle/memesh",
|
|
3
|
-
"version": "4.5.
|
|
3
|
+
"version": "4.5.1",
|
|
4
4
|
"description": "MeMesh — Local memory for Claude Code and MCP coding agents. One SQLite file, zero cloud required.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"bin": {
|
|
8
8
|
"memesh": "dist/transports/cli/cli.js",
|
|
9
|
-
"memesh-mcp": "dist/mcp/
|
|
9
|
+
"memesh-mcp": "dist/mcp/server.js",
|
|
10
10
|
"memesh-http": "dist/transports/http/server.js",
|
|
11
11
|
"memesh-view": "dist/cli/view.js"
|
|
12
12
|
},
|
|
@@ -16,7 +16,6 @@
|
|
|
16
16
|
".mcp.json",
|
|
17
17
|
"hooks/hooks.json",
|
|
18
18
|
"scripts/hooks/",
|
|
19
|
-
"scripts/postinstall-rebuild.mjs",
|
|
20
19
|
"scripts/upgrade-plugin.sh",
|
|
21
20
|
"skills/",
|
|
22
21
|
".claude-plugin/",
|
|
@@ -24,7 +23,6 @@
|
|
|
24
23
|
"LICENSE"
|
|
25
24
|
],
|
|
26
25
|
"scripts": {
|
|
27
|
-
"postinstall": "node scripts/postinstall-rebuild.mjs",
|
|
28
26
|
"build": "node scripts/check-schema-drift.mjs && tsc && node scripts/generate-hook-core.mjs && node scripts/copy-cli-assets.mjs && node scripts/set-executable-bits.mjs && node scripts/generate-skills-manifest.mjs && npm run build:dashboard && node scripts/smoke-test.mjs",
|
|
29
27
|
"build:dashboard": "node scripts/build-dashboard.mjs",
|
|
30
28
|
"test": "vitest",
|
|
@@ -34,9 +32,9 @@
|
|
|
34
32
|
"verify:release": "npm run lint && npm run typecheck && node scripts/check-version-coherence.mjs && node scripts/check-generated-mirror.mjs && node scripts/check-doc-claims.mjs && node scripts/audit/verification-audit.mjs && npm run audit:prod",
|
|
35
33
|
"prepublishOnly": "npm run build && npm run verify:release && npm run test:isolated && npm run test:packaged",
|
|
36
34
|
"typecheck": "tsc -p tsconfig.check.json && tsc -p tsconfig.check-dashboard.json",
|
|
37
|
-
"lint": "eslint src/ scripts/ --max-warnings 0",
|
|
38
|
-
"lint:fix": "eslint src/ scripts/ --fix",
|
|
39
|
-
"start": "node dist/mcp/
|
|
35
|
+
"lint": "eslint src/ scripts/ tests/ dashboard/src/ --max-warnings 0",
|
|
36
|
+
"lint:fix": "eslint src/ scripts/ tests/ dashboard/src/ --fix",
|
|
37
|
+
"start": "node dist/mcp/server.js",
|
|
40
38
|
"bench:longmemeval": "node benchmarks/longmemeval/run.mjs --mode A --dataset /tmp/longmemeval_s.json",
|
|
41
39
|
"test:isolated": "node scripts/run-tests-isolated.mjs",
|
|
42
40
|
"test:coverage": "node scripts/run-tests-isolated.mjs --coverage"
|
|
@@ -61,7 +59,6 @@
|
|
|
61
59
|
},
|
|
62
60
|
"dependencies": {
|
|
63
61
|
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
64
|
-
"better-sqlite3": "^12.9.0",
|
|
65
62
|
"commander": "^14.0.3",
|
|
66
63
|
"express": "^5.2.1",
|
|
67
64
|
"express-rate-limit": "8.5.1",
|
|
@@ -88,7 +85,6 @@
|
|
|
88
85
|
"@preact/preset-vite": "^2.10.5",
|
|
89
86
|
"@testing-library/jest-dom": "^6.9.1",
|
|
90
87
|
"@testing-library/preact": "^3.2.4",
|
|
91
|
-
"@types/better-sqlite3": "^7.6.13",
|
|
92
88
|
"@types/express": "^5.0.6",
|
|
93
89
|
"@types/node": "25.6.2",
|
|
94
90
|
"@vitest/coverage-v8": "4.1.5",
|
|
@@ -100,6 +96,6 @@
|
|
|
100
96
|
"vitest": "4.1.5"
|
|
101
97
|
},
|
|
102
98
|
"engines": {
|
|
103
|
-
"node": ">=22.
|
|
99
|
+
"node": ">=22.13.0"
|
|
104
100
|
}
|
|
105
101
|
}
|
|
@@ -6,8 +6,10 @@
|
|
|
6
6
|
// always-on capture path survives a missing or stale dist/ while staying
|
|
7
7
|
// byte-locked to core — eliminating the hand-mirror drift behind the P0 FTS bug.
|
|
8
8
|
// ============================================================================
|
|
9
|
+
import fs from 'fs';
|
|
9
10
|
import os from 'os';
|
|
10
11
|
import path from 'path';
|
|
12
|
+
import { createHash } from 'crypto';
|
|
11
13
|
import { execFileSync } from 'child_process';
|
|
12
14
|
export function homeDir() {
|
|
13
15
|
const home = process.env.HOME;
|
|
@@ -49,7 +51,15 @@ function resolveProjectIdentity(cwd) {
|
|
|
49
51
|
const root = tryGit(cwd, ['rev-parse', '--show-toplevel']);
|
|
50
52
|
if (root)
|
|
51
53
|
return path.basename(root);
|
|
52
|
-
|
|
54
|
+
let real;
|
|
55
|
+
try {
|
|
56
|
+
real = fs.realpathSync.native(cwd);
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
real = path.resolve(cwd);
|
|
60
|
+
}
|
|
61
|
+
const suffix = createHash('sha256').update(real).digest('hex').slice(0, 8);
|
|
62
|
+
return `${path.basename(real)}-${suffix}`;
|
|
53
63
|
}
|
|
54
64
|
function tryGit(cwd, args) {
|
|
55
65
|
try {
|
|
@@ -75,3 +85,59 @@ export function slugFromRemoteUrl(url) {
|
|
|
75
85
|
export function _clearProjectNameCache() {
|
|
76
86
|
projectNameCache.clear();
|
|
77
87
|
}
|
|
88
|
+
export const SECRET_PATTERN_SOURCES = [
|
|
89
|
+
'-----BEGIN[A-Z ]*PRIVATE KEY-----[\\s\\S]*?-----END[A-Z ]*PRIVATE KEY-----',
|
|
90
|
+
'-----BEGIN[A-Z ]*PRIVATE KEY-----[\\s\\S]*?(?=\\n[ \\t]*\\n|$)',
|
|
91
|
+
'(?:postgres|postgresql|mysql|mariadb|mongodb(?:\\+srv)?|redis|rediss|amqp|amqps)://[^\\s:@/]+:[^\\s:@/]+@',
|
|
92
|
+
'eyJ[A-Za-z0-9_-]{8,}\\.[A-Za-z0-9_-]{8,}\\.[A-Za-z0-9_-]{8,}',
|
|
93
|
+
'SG\\.[A-Za-z0-9_-]{16,}\\.[A-Za-z0-9_-]{16,}',
|
|
94
|
+
'[srp]k_(?:live|test)_[A-Za-z0-9]{16,}',
|
|
95
|
+
'npm_[A-Za-z0-9]{36}',
|
|
96
|
+
'sk-ant-[A-Za-z0-9_-]{16,}',
|
|
97
|
+
'sk-[A-Za-z0-9_-]{16,}',
|
|
98
|
+
'sk_[A-Za-z0-9]{16,}',
|
|
99
|
+
'ghp_[A-Za-z0-9]{30,}',
|
|
100
|
+
'gho_[A-Za-z0-9]{30,}',
|
|
101
|
+
'gh[sur]_[A-Za-z0-9]{30,}',
|
|
102
|
+
'github_pat_[A-Za-z0-9_]{20,}',
|
|
103
|
+
'A(?:KIA|SIA)[A-Z0-9]{16}',
|
|
104
|
+
'AIza[A-Za-z0-9_-]{30,}',
|
|
105
|
+
'xox[baprs]-[A-Za-z0-9-]{10,}',
|
|
106
|
+
'Bearer(?:\\s|\\\\[nrt])+[A-Za-z0-9_.\\-]{16,}',
|
|
107
|
+
];
|
|
108
|
+
export function redactSecrets(input) {
|
|
109
|
+
let out = input;
|
|
110
|
+
for (const s of SECRET_PATTERN_SOURCES)
|
|
111
|
+
out = out.replace(new RegExp(s, 'gi'), '***REDACTED***');
|
|
112
|
+
return out;
|
|
113
|
+
}
|
|
114
|
+
export function redactUserPaths(text) {
|
|
115
|
+
const home = homeDir();
|
|
116
|
+
const roots = new Set();
|
|
117
|
+
const add = (root) => {
|
|
118
|
+
if (!root || !path.isAbsolute(root))
|
|
119
|
+
return;
|
|
120
|
+
roots.add(root);
|
|
121
|
+
try {
|
|
122
|
+
roots.add(fs.realpathSync(root));
|
|
123
|
+
}
|
|
124
|
+
catch { }
|
|
125
|
+
};
|
|
126
|
+
add(home);
|
|
127
|
+
const isInside = (child) => {
|
|
128
|
+
const rel = path.relative(home, child);
|
|
129
|
+
return rel !== '' && !rel.startsWith('..') && !path.isAbsolute(rel);
|
|
130
|
+
};
|
|
131
|
+
for (const dir of [memeshDir(), path.dirname(getDbPath())]) {
|
|
132
|
+
if (dir && !isInside(dir))
|
|
133
|
+
add(dir);
|
|
134
|
+
}
|
|
135
|
+
const flags = process.platform === 'linux' ? 'g' : 'gi';
|
|
136
|
+
let out = text;
|
|
137
|
+
for (const root of [...roots].sort((a, b) => b.length - a.length)) {
|
|
138
|
+
const escaped = root.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
139
|
+
const body = escaped.replace(/\\\\|\//g, '[\\\\/]{1,2}');
|
|
140
|
+
out = out.replace(new RegExp(`(?<?)${body}(?=[\\\\/]|$)`, flags), '~');
|
|
141
|
+
}
|
|
142
|
+
return out;
|
|
143
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
// ============================================================================
|
|
2
|
+
// AUTO-GENERATED from src/storage/sqlite.ts — DO NOT EDIT BY HAND.
|
|
3
|
+
// Regenerate with: npm run build (scripts/generate-hook-core.mjs)
|
|
4
|
+
//
|
|
5
|
+
// Claude Code hooks import this committed copy instead of dist/, so the
|
|
6
|
+
// always-on capture path survives a missing or stale dist/ while staying
|
|
7
|
+
// byte-locked to core — eliminating the hand-mirror drift behind the P0 FTS bug.
|
|
8
|
+
// ============================================================================
|
|
9
|
+
import { createRequire } from 'node:module';
|
|
10
|
+
function loadNodeSqlite() {
|
|
11
|
+
const require = createRequire(import.meta.url);
|
|
12
|
+
const original = process.emitWarning;
|
|
13
|
+
process.emitWarning = function (warning, ...rest) {
|
|
14
|
+
const text = typeof warning === 'string' ? warning : String(warning?.message ?? warning);
|
|
15
|
+
if (text.includes('SQLite is an experimental feature'))
|
|
16
|
+
return;
|
|
17
|
+
return original.call(process, warning, ...rest);
|
|
18
|
+
};
|
|
19
|
+
try {
|
|
20
|
+
return require('node:sqlite');
|
|
21
|
+
}
|
|
22
|
+
catch (err) {
|
|
23
|
+
const detail = err instanceof Error ? err.message : String(err);
|
|
24
|
+
throw new Error(`memesh needs Node's built-in SQLite, which this runtime (${process.version}) does not provide. ` +
|
|
25
|
+
'It became usable without a flag in Node 22.13.0 — upgrade Node to 22.13 or newer and run memesh again. ' +
|
|
26
|
+
`(${detail})`, { cause: err });
|
|
27
|
+
}
|
|
28
|
+
finally {
|
|
29
|
+
process.emitWarning = original;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
const { DatabaseSync } = loadNodeSqlite();
|
|
33
|
+
const BUSY_TIMEOUT_MS = 5000;
|
|
34
|
+
export class MemeshDatabase extends DatabaseSync {
|
|
35
|
+
#depth = 0;
|
|
36
|
+
constructor(path, options = {}) {
|
|
37
|
+
super(path, options);
|
|
38
|
+
this.pragma(`busy_timeout = ${BUSY_TIMEOUT_MS}`);
|
|
39
|
+
}
|
|
40
|
+
pragma(statement) {
|
|
41
|
+
this.exec(`PRAGMA ${statement}`);
|
|
42
|
+
}
|
|
43
|
+
transaction(fn) {
|
|
44
|
+
const run = (mode, ...args) => {
|
|
45
|
+
const nested = this.#depth > 0;
|
|
46
|
+
const savepoint = `memesh_sp_${this.#depth}`;
|
|
47
|
+
this.exec(nested ? `SAVEPOINT ${savepoint}` : `BEGIN${mode}`);
|
|
48
|
+
this.#depth++;
|
|
49
|
+
try {
|
|
50
|
+
const result = fn(...args);
|
|
51
|
+
this.exec(nested ? `RELEASE ${savepoint}` : 'COMMIT');
|
|
52
|
+
return result;
|
|
53
|
+
}
|
|
54
|
+
catch (err) {
|
|
55
|
+
try {
|
|
56
|
+
this.exec(nested ? `ROLLBACK TO ${savepoint}` : 'ROLLBACK');
|
|
57
|
+
if (nested)
|
|
58
|
+
this.exec(`RELEASE ${savepoint}`);
|
|
59
|
+
}
|
|
60
|
+
catch { }
|
|
61
|
+
throw err;
|
|
62
|
+
}
|
|
63
|
+
finally {
|
|
64
|
+
this.#depth--;
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
const callable = ((...args) => run('', ...args));
|
|
68
|
+
callable.immediate = (...args) => run(' IMMEDIATE', ...args);
|
|
69
|
+
return callable;
|
|
70
|
+
}
|
|
71
|
+
}
|