@massu/core 2.5.0 → 2.5.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/CHANGELOG.md +231 -0
- package/commands/massu-bearings.md +1 -1
- package/commands/massu-recap.md +16 -5
- package/dist/cli.js +716 -258
- package/dist/hooks/auto-learning-pipeline.js +297 -56
- package/dist/hooks/classify-failure.js +323 -25
- package/dist/hooks/cost-tracker.js +47 -10
- package/dist/hooks/fix-detector.js +94 -10
- package/dist/hooks/incident-pipeline.js +77 -10
- package/dist/hooks/intent-suggester.js +77 -10
- package/dist/hooks/memory-recall.js +77 -10
- package/dist/hooks/post-edit-context.js +125 -11
- package/dist/hooks/post-tool-use.js +44 -7
- package/dist/hooks/pre-compact.js +43 -7
- package/dist/hooks/pre-delete-check.js +125 -13
- package/dist/hooks/pre-tool-use-gate.js +135 -17
- package/dist/hooks/quality-event.js +47 -10
- package/dist/hooks/rule-enforcement-pipeline.js +77 -10
- package/dist/hooks/security-gate.js +75 -10
- package/dist/hooks/session-end.js +43 -7
- package/dist/hooks/session-start.js +144 -38
- package/dist/hooks/user-prompt.js +43 -7
- package/package.json +1 -1
|
@@ -1167,6 +1167,13 @@ var init_config = __esm({
|
|
|
1167
1167
|
});
|
|
1168
1168
|
LanguageFrameworkEntrySchema = z2.object({
|
|
1169
1169
|
framework: z2.string().optional(),
|
|
1170
|
+
// `source_dirs` is emitted by `init` (commands/init.ts:417) and existence-checked
|
|
1171
|
+
// by config validation (init.ts:868-876), but until 2026-08-14 it survived only via
|
|
1172
|
+
// `.passthrough()` — declared in the file, untyped in the schema. `lib/source-layout.ts`
|
|
1173
|
+
// derives the index builders' candidate set from it, so it is typed here rather than
|
|
1174
|
+
// read as an unknown: a consumer that has to shape-check its own SoT is one branch away
|
|
1175
|
+
// from silently contributing `undefined` to a path predicate.
|
|
1176
|
+
source_dirs: z2.array(z2.string()).optional(),
|
|
1170
1177
|
test_framework: z2.string().optional(),
|
|
1171
1178
|
test: z2.string().optional(),
|
|
1172
1179
|
runtime: z2.string().optional(),
|
|
@@ -1339,6 +1346,16 @@ var init_memory_vector = __esm({
|
|
|
1339
1346
|
}
|
|
1340
1347
|
});
|
|
1341
1348
|
|
|
1349
|
+
// src/lib/timestamps.ts
|
|
1350
|
+
function nowIso() {
|
|
1351
|
+
return (/* @__PURE__ */ new Date()).toISOString();
|
|
1352
|
+
}
|
|
1353
|
+
var init_timestamps = __esm({
|
|
1354
|
+
"src/lib/timestamps.ts"() {
|
|
1355
|
+
"use strict";
|
|
1356
|
+
}
|
|
1357
|
+
});
|
|
1358
|
+
|
|
1342
1359
|
// src/db-backup.ts
|
|
1343
1360
|
import { existsSync as existsSync5, mkdirSync as mkdirSync4, readdirSync, statSync, unlinkSync, copyFileSync, rmSync as rmSync4 } from "fs";
|
|
1344
1361
|
import { resolve as resolve3, join as join3, basename, dirname as dirname4 } from "path";
|
|
@@ -3695,8 +3712,8 @@ function linkSessionToTask(db, sessionId, taskId) {
|
|
|
3695
3712
|
}
|
|
3696
3713
|
function addConversationTurn(db, sessionId, turnNumber, userPrompt, assistantResponse, toolCallsJson, toolCallCount, promptTokens, responseTokens) {
|
|
3697
3714
|
const result = db.prepare(`
|
|
3698
|
-
INSERT INTO conversation_turns (session_id, turn_number, user_prompt, assistant_response, tool_calls_json, tool_call_count, prompt_tokens, response_tokens)
|
|
3699
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?)
|
|
3715
|
+
INSERT INTO conversation_turns (session_id, turn_number, user_prompt, assistant_response, tool_calls_json, tool_call_count, prompt_tokens, response_tokens, created_at)
|
|
3716
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
3700
3717
|
`).run(
|
|
3701
3718
|
sessionId,
|
|
3702
3719
|
turnNumber,
|
|
@@ -3705,14 +3722,15 @@ function addConversationTurn(db, sessionId, turnNumber, userPrompt, assistantRes
|
|
|
3705
3722
|
toolCallsJson,
|
|
3706
3723
|
toolCallCount,
|
|
3707
3724
|
promptTokens,
|
|
3708
|
-
responseTokens
|
|
3725
|
+
responseTokens,
|
|
3726
|
+
nowIso()
|
|
3709
3727
|
);
|
|
3710
3728
|
return Number(result.lastInsertRowid);
|
|
3711
3729
|
}
|
|
3712
3730
|
function addToolCallDetail(db, sessionId, turnNumber, toolName, inputSummary, inputSize, outputSize, success, filesInvolved) {
|
|
3713
3731
|
db.prepare(`
|
|
3714
|
-
INSERT INTO tool_call_details (session_id, turn_number, tool_name, tool_input_summary, tool_input_size, tool_output_size, tool_success, files_involved)
|
|
3715
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?)
|
|
3732
|
+
INSERT INTO tool_call_details (session_id, turn_number, tool_name, tool_input_summary, tool_input_size, tool_output_size, tool_success, files_involved, created_at)
|
|
3733
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
3716
3734
|
`).run(
|
|
3717
3735
|
sessionId,
|
|
3718
3736
|
turnNumber,
|
|
@@ -3721,7 +3739,8 @@ function addToolCallDetail(db, sessionId, turnNumber, toolName, inputSummary, in
|
|
|
3721
3739
|
inputSize,
|
|
3722
3740
|
outputSize,
|
|
3723
3741
|
success ? 1 : 0,
|
|
3724
|
-
filesInvolved ? JSON.stringify(filesInvolved) : null
|
|
3742
|
+
filesInvolved ? JSON.stringify(filesInvolved) : null,
|
|
3743
|
+
nowIso()
|
|
3725
3744
|
);
|
|
3726
3745
|
}
|
|
3727
3746
|
function getLastProcessedLine(db, sessionId) {
|
|
@@ -3980,6 +3999,7 @@ var init_memory_db = __esm({
|
|
|
3980
3999
|
init_db_driver();
|
|
3981
4000
|
init_config();
|
|
3982
4001
|
init_memory_vector();
|
|
4002
|
+
init_timestamps();
|
|
3983
4003
|
init_db_backup();
|
|
3984
4004
|
init_rule_delivery();
|
|
3985
4005
|
init_rule_candidate_store();
|
|
@@ -4312,6 +4332,20 @@ function entitledForTeamSharedPromotion(tier) {
|
|
|
4312
4332
|
// src/hooks/user-prompt.ts
|
|
4313
4333
|
init_rule_candidate_store();
|
|
4314
4334
|
init_hook_failure_signal();
|
|
4335
|
+
|
|
4336
|
+
// src/hooks/lib/is-direct-invocation.ts
|
|
4337
|
+
import { pathToFileURL } from "url";
|
|
4338
|
+
function isDirectInvocation(moduleUrl) {
|
|
4339
|
+
const entry = process.argv[1];
|
|
4340
|
+
if (!entry) return false;
|
|
4341
|
+
try {
|
|
4342
|
+
return moduleUrl === pathToFileURL(entry).href;
|
|
4343
|
+
} catch {
|
|
4344
|
+
return false;
|
|
4345
|
+
}
|
|
4346
|
+
}
|
|
4347
|
+
|
|
4348
|
+
// src/hooks/user-prompt.ts
|
|
4315
4349
|
async function main() {
|
|
4316
4350
|
try {
|
|
4317
4351
|
const input = await readStdin();
|
|
@@ -4588,4 +4622,6 @@ function readStdin() {
|
|
|
4588
4622
|
setTimeout(() => resolve5(data), 3e3);
|
|
4589
4623
|
});
|
|
4590
4624
|
}
|
|
4591
|
-
|
|
4625
|
+
if (isDirectInvocation(import.meta.url)) {
|
|
4626
|
+
main();
|
|
4627
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@massu/core",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "AI Engineering Governance MCP Server - Session memory, knowledge system, feature registry, code intelligence, rule enforcement, tiered tooling (12 free / 73 total), 56 workflow commands, 11 agents, 20+ patterns",
|
|
6
6
|
"main": "./dist/cli.js",
|