mulch-cli 0.1.0 → 0.2.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/README.md +16 -2
- package/dist/cli.js +15 -2
- package/dist/cli.js.map +1 -1
- package/dist/commands/add.d.ts.map +1 -1
- package/dist/commands/add.js +20 -3
- package/dist/commands/add.js.map +1 -1
- package/dist/commands/compact.d.ts +3 -0
- package/dist/commands/compact.d.ts.map +1 -0
- package/dist/commands/compact.js +364 -0
- package/dist/commands/compact.js.map +1 -0
- package/dist/commands/delete.d.ts +3 -0
- package/dist/commands/delete.d.ts.map +1 -0
- package/dist/commands/delete.js +110 -0
- package/dist/commands/delete.js.map +1 -0
- package/dist/commands/doctor.d.ts +3 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +364 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/edit.d.ts.map +1 -1
- package/dist/commands/edit.js +103 -22
- package/dist/commands/edit.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +11 -1
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/learn.d.ts +12 -0
- package/dist/commands/learn.d.ts.map +1 -0
- package/dist/commands/learn.js +130 -0
- package/dist/commands/learn.js.map +1 -0
- package/dist/commands/onboard.d.ts +1 -0
- package/dist/commands/onboard.d.ts.map +1 -1
- package/dist/commands/onboard.js +31 -4
- package/dist/commands/onboard.js.map +1 -1
- package/dist/commands/prime.d.ts.map +1 -1
- package/dist/commands/prime.js +75 -17
- package/dist/commands/prime.js.map +1 -1
- package/dist/commands/prune.d.ts +5 -0
- package/dist/commands/prune.d.ts.map +1 -1
- package/dist/commands/prune.js +13 -1
- package/dist/commands/prune.js.map +1 -1
- package/dist/commands/query.d.ts.map +1 -1
- package/dist/commands/query.js +56 -15
- package/dist/commands/query.js.map +1 -1
- package/dist/commands/ready.d.ts +3 -0
- package/dist/commands/ready.d.ts.map +1 -0
- package/dist/commands/ready.js +160 -0
- package/dist/commands/ready.js.map +1 -0
- package/dist/commands/record.d.ts.map +1 -1
- package/dist/commands/record.js +136 -22
- package/dist/commands/record.js.map +1 -1
- package/dist/commands/search.d.ts.map +1 -1
- package/dist/commands/search.js +76 -26
- package/dist/commands/search.js.map +1 -1
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/commands/setup.js +59 -27
- package/dist/commands/setup.js.map +1 -1
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +24 -3
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/sync.d.ts +3 -0
- package/dist/commands/sync.d.ts.map +1 -0
- package/dist/commands/sync.js +176 -0
- package/dist/commands/sync.js.map +1 -0
- package/dist/commands/validate.d.ts.map +1 -1
- package/dist/commands/validate.js +30 -6
- package/dist/commands/validate.js.map +1 -1
- package/dist/schemas/record-schema.d.ts +108 -0
- package/dist/schemas/record-schema.d.ts.map +1 -1
- package/dist/schemas/record-schema.js +19 -0
- package/dist/schemas/record-schema.js.map +1 -1
- package/dist/schemas/record.d.ts +3 -0
- package/dist/schemas/record.d.ts.map +1 -1
- package/dist/utils/expertise.d.ts +1 -0
- package/dist/utils/expertise.d.ts.map +1 -1
- package/dist/utils/expertise.js +33 -0
- package/dist/utils/expertise.js.map +1 -1
- package/dist/utils/format.d.ts +2 -0
- package/dist/utils/format.d.ts.map +1 -1
- package/dist/utils/format.js +70 -13
- package/dist/utils/format.js.map +1 -1
- package/dist/utils/git.d.ts +6 -0
- package/dist/utils/git.d.ts.map +1 -0
- package/dist/utils/git.js +81 -0
- package/dist/utils/git.js.map +1 -0
- package/dist/utils/index.d.ts +4 -2
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +4 -2
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/json-output.d.ts +8 -0
- package/dist/utils/json-output.d.ts.map +1 -0
- package/dist/utils/json-output.js +7 -0
- package/dist/utils/json-output.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { execSync } from "node:child_process";
|
|
2
|
+
import { readFile } from "node:fs/promises";
|
|
3
|
+
import _Ajv from "ajv";
|
|
4
|
+
const Ajv = _Ajv.default ?? _Ajv;
|
|
5
|
+
import chalk from "chalk";
|
|
6
|
+
import { readConfig, getExpertisePath } from "../utils/config.js";
|
|
7
|
+
import { recordSchema } from "../schemas/record-schema.js";
|
|
8
|
+
import { outputJson, outputJsonError } from "../utils/json-output.js";
|
|
9
|
+
function isGitRepo(cwd) {
|
|
10
|
+
try {
|
|
11
|
+
execSync("git rev-parse --is-inside-work-tree", { cwd, stdio: "pipe" });
|
|
12
|
+
return true;
|
|
13
|
+
}
|
|
14
|
+
catch {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
function gitHasChanges(cwd) {
|
|
19
|
+
try {
|
|
20
|
+
const status = execSync("git status --porcelain .mulch/", { cwd, encoding: "utf-8", stdio: ["pipe", "pipe", "pipe"] });
|
|
21
|
+
return status.trim().length > 0;
|
|
22
|
+
}
|
|
23
|
+
catch {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function gitAdd(cwd) {
|
|
28
|
+
execSync("git add .mulch/", { cwd, stdio: "pipe" });
|
|
29
|
+
}
|
|
30
|
+
function gitCommit(cwd, message) {
|
|
31
|
+
return execSync(`git commit -m "${message.replace(/"/g, '\\"')}"`, { cwd, encoding: "utf-8", stdio: ["pipe", "pipe", "pipe"] });
|
|
32
|
+
}
|
|
33
|
+
async function validateExpertise(cwd) {
|
|
34
|
+
const config = await readConfig(cwd);
|
|
35
|
+
const domains = config.domains;
|
|
36
|
+
const ajv = new Ajv();
|
|
37
|
+
const validate = ajv.compile(recordSchema);
|
|
38
|
+
let totalRecords = 0;
|
|
39
|
+
const errors = [];
|
|
40
|
+
for (const domain of domains) {
|
|
41
|
+
const filePath = getExpertisePath(domain, cwd);
|
|
42
|
+
let content;
|
|
43
|
+
try {
|
|
44
|
+
content = await readFile(filePath, "utf-8");
|
|
45
|
+
}
|
|
46
|
+
catch {
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
const lines = content.split("\n");
|
|
50
|
+
for (let i = 0; i < lines.length; i++) {
|
|
51
|
+
const line = lines[i].trim();
|
|
52
|
+
if (line.length === 0)
|
|
53
|
+
continue;
|
|
54
|
+
totalRecords++;
|
|
55
|
+
const lineNumber = i + 1;
|
|
56
|
+
let parsed;
|
|
57
|
+
try {
|
|
58
|
+
parsed = JSON.parse(line);
|
|
59
|
+
}
|
|
60
|
+
catch {
|
|
61
|
+
errors.push({ domain, line: lineNumber, message: "Invalid JSON: failed to parse" });
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
64
|
+
if (!validate(parsed)) {
|
|
65
|
+
const schemaErrors = (validate.errors ?? []).map((err) => `${err.instancePath} ${err.message}`).join("; ");
|
|
66
|
+
errors.push({ domain, line: lineNumber, message: `Schema validation failed: ${schemaErrors}` });
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return { valid: errors.length === 0, totalRecords, errors };
|
|
71
|
+
}
|
|
72
|
+
export function registerSyncCommand(program) {
|
|
73
|
+
program
|
|
74
|
+
.command("sync")
|
|
75
|
+
.description("Validate, stage, and commit .mulch/ changes")
|
|
76
|
+
.option("--message <message>", "custom commit message")
|
|
77
|
+
.option("--no-validate", "skip validation step")
|
|
78
|
+
.action(async (options) => {
|
|
79
|
+
const jsonMode = program.opts().json === true;
|
|
80
|
+
const cwd = process.cwd();
|
|
81
|
+
// Check if we're in a git repo
|
|
82
|
+
if (!isGitRepo(cwd)) {
|
|
83
|
+
if (jsonMode) {
|
|
84
|
+
outputJsonError("sync", "Not in a git repository. Run this command from within a git repository.");
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
console.error(chalk.red("Error: not in a git repository."));
|
|
88
|
+
}
|
|
89
|
+
process.exitCode = 1;
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
// Validate (unless --no-validate)
|
|
93
|
+
if (options.validate !== false) {
|
|
94
|
+
try {
|
|
95
|
+
const result = await validateExpertise();
|
|
96
|
+
if (!result.valid) {
|
|
97
|
+
if (jsonMode) {
|
|
98
|
+
outputJson({
|
|
99
|
+
success: false,
|
|
100
|
+
command: "sync",
|
|
101
|
+
validated: false,
|
|
102
|
+
committed: false,
|
|
103
|
+
errors: result.errors,
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
console.error(chalk.red("Validation failed:"));
|
|
108
|
+
for (const err of result.errors) {
|
|
109
|
+
console.error(chalk.red(` ${err.domain}:${err.line} - ${err.message}`));
|
|
110
|
+
}
|
|
111
|
+
console.error(chalk.red("\nFix errors and retry, or use --no-validate to skip."));
|
|
112
|
+
}
|
|
113
|
+
process.exitCode = 1;
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
if (!jsonMode) {
|
|
117
|
+
console.log(chalk.green(`✔ Validated ${result.totalRecords} records`));
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
catch (err) {
|
|
121
|
+
if (jsonMode) {
|
|
122
|
+
outputJsonError("sync", `Validation error: ${err.message}`);
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
console.error(chalk.red(`Validation error: ${err.message}`));
|
|
126
|
+
}
|
|
127
|
+
process.exitCode = 1;
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
// Check for changes
|
|
132
|
+
if (!gitHasChanges(cwd)) {
|
|
133
|
+
if (jsonMode) {
|
|
134
|
+
outputJson({
|
|
135
|
+
success: true,
|
|
136
|
+
command: "sync",
|
|
137
|
+
validated: options.validate !== false,
|
|
138
|
+
committed: false,
|
|
139
|
+
message: "No changes to commit",
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
else {
|
|
143
|
+
console.log("No .mulch/ changes to commit.");
|
|
144
|
+
}
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
// Git add + commit
|
|
148
|
+
const commitMessage = options.message ?? "mulch: update expertise";
|
|
149
|
+
try {
|
|
150
|
+
gitAdd(cwd);
|
|
151
|
+
gitCommit(cwd, commitMessage);
|
|
152
|
+
if (jsonMode) {
|
|
153
|
+
outputJson({
|
|
154
|
+
success: true,
|
|
155
|
+
command: "sync",
|
|
156
|
+
validated: options.validate !== false,
|
|
157
|
+
committed: true,
|
|
158
|
+
message: commitMessage,
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
else {
|
|
162
|
+
console.log(chalk.green(`✔ Committed .mulch/ changes: "${commitMessage}"`));
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
catch (err) {
|
|
166
|
+
if (jsonMode) {
|
|
167
|
+
outputJsonError("sync", `Git error: ${err.message}`);
|
|
168
|
+
}
|
|
169
|
+
else {
|
|
170
|
+
console.error(chalk.red(`Git error: ${err.message}`));
|
|
171
|
+
}
|
|
172
|
+
process.exitCode = 1;
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
//# sourceMappingURL=sync.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync.js","sourceRoot":"","sources":["../../src/commands/sync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,IAAI,MAAM,KAAK,CAAC;AACvB,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC;AACjC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAEtE,SAAS,SA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AAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../src/commands/validate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../src/commands/validate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AASpC,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA+F9D"}
|
|
@@ -4,17 +4,20 @@ const Ajv = _Ajv.default ?? _Ajv;
|
|
|
4
4
|
import chalk from "chalk";
|
|
5
5
|
import { readConfig, getExpertisePath } from "../utils/config.js";
|
|
6
6
|
import { recordSchema } from "../schemas/record-schema.js";
|
|
7
|
+
import { outputJson } from "../utils/json-output.js";
|
|
7
8
|
export function registerValidateCommand(program) {
|
|
8
9
|
program
|
|
9
10
|
.command("validate")
|
|
10
11
|
.description("Validate expertise records against schemas")
|
|
11
12
|
.action(async () => {
|
|
13
|
+
const jsonMode = program.opts().json === true;
|
|
12
14
|
const config = await readConfig();
|
|
13
15
|
const domains = config.domains;
|
|
14
16
|
const ajv = new Ajv();
|
|
15
17
|
const validate = ajv.compile(recordSchema);
|
|
16
18
|
let totalRecords = 0;
|
|
17
19
|
let totalErrors = 0;
|
|
20
|
+
const errors = [];
|
|
18
21
|
for (const domain of domains) {
|
|
19
22
|
const filePath = getExpertisePath(domain);
|
|
20
23
|
let content;
|
|
@@ -38,25 +41,46 @@ export function registerValidateCommand(program) {
|
|
|
38
41
|
}
|
|
39
42
|
catch {
|
|
40
43
|
totalErrors++;
|
|
41
|
-
|
|
44
|
+
const msg = "Invalid JSON: failed to parse";
|
|
45
|
+
errors.push({ domain, line: lineNumber, message: msg });
|
|
46
|
+
if (!jsonMode) {
|
|
47
|
+
console.error(chalk.red(`${domain}:${lineNumber} - ${msg}`));
|
|
48
|
+
}
|
|
42
49
|
continue;
|
|
43
50
|
}
|
|
44
51
|
if (!validate(parsed)) {
|
|
45
52
|
totalErrors++;
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
53
|
+
const schemaErrors = (validate.errors ?? []).map((err) => `${err.instancePath} ${err.message}`).join("; ");
|
|
54
|
+
const msg = `Schema validation failed: ${schemaErrors}`;
|
|
55
|
+
errors.push({ domain, line: lineNumber, message: msg });
|
|
56
|
+
if (!jsonMode) {
|
|
57
|
+
console.error(chalk.red(`${domain}:${lineNumber} - Schema validation failed:`));
|
|
58
|
+
for (const err of validate.errors ?? []) {
|
|
59
|
+
console.error(chalk.red(` ${err.instancePath} ${err.message}`));
|
|
60
|
+
}
|
|
49
61
|
}
|
|
50
62
|
}
|
|
51
63
|
}
|
|
52
64
|
}
|
|
53
|
-
if (
|
|
65
|
+
if (jsonMode) {
|
|
66
|
+
outputJson({
|
|
67
|
+
success: totalErrors === 0,
|
|
68
|
+
command: "validate",
|
|
69
|
+
valid: totalErrors === 0,
|
|
70
|
+
totalRecords,
|
|
71
|
+
totalErrors,
|
|
72
|
+
errors,
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
else if (totalErrors > 0) {
|
|
54
76
|
console.log(chalk.red(`${totalRecords} records validated, ${totalErrors} errors found`));
|
|
55
|
-
process.exit(1);
|
|
56
77
|
}
|
|
57
78
|
else {
|
|
58
79
|
console.log(chalk.green(`${totalRecords} records validated, ${totalErrors} errors found`));
|
|
59
80
|
}
|
|
81
|
+
if (totalErrors > 0) {
|
|
82
|
+
process.exitCode = 1;
|
|
83
|
+
}
|
|
60
84
|
});
|
|
61
85
|
}
|
|
62
86
|
//# sourceMappingURL=validate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate.js","sourceRoot":"","sources":["../../src/commands/validate.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C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,uBAAuB,WAAW,eAAe,CACjE,CACF,CAAC;QACJ,CAAC;QAED,IAAI,WAAW,GAAG,CAAC,EAAE,CAAC;YACpB,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;QACvB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -30,6 +30,10 @@ export declare const recordSchema: {
|
|
|
30
30
|
readonly oneOf: readonly [{
|
|
31
31
|
readonly type: "object";
|
|
32
32
|
readonly properties: {
|
|
33
|
+
readonly id: {
|
|
34
|
+
readonly type: "string";
|
|
35
|
+
readonly pattern: "^mx-[0-9a-f]{4,8}$";
|
|
36
|
+
};
|
|
33
37
|
readonly type: {
|
|
34
38
|
readonly type: "string";
|
|
35
39
|
readonly const: "convention";
|
|
@@ -52,12 +56,30 @@ export declare const recordSchema: {
|
|
|
52
56
|
readonly type: "string";
|
|
53
57
|
};
|
|
54
58
|
};
|
|
59
|
+
readonly relates_to: {
|
|
60
|
+
readonly type: "array";
|
|
61
|
+
readonly items: {
|
|
62
|
+
readonly type: "string";
|
|
63
|
+
readonly pattern: "^mx-[0-9a-f]{4,8}$";
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
readonly supersedes: {
|
|
67
|
+
readonly type: "array";
|
|
68
|
+
readonly items: {
|
|
69
|
+
readonly type: "string";
|
|
70
|
+
readonly pattern: "^mx-[0-9a-f]{4,8}$";
|
|
71
|
+
};
|
|
72
|
+
};
|
|
55
73
|
};
|
|
56
74
|
readonly required: readonly ["type", "content", "classification", "recorded_at"];
|
|
57
75
|
readonly additionalProperties: false;
|
|
58
76
|
}, {
|
|
59
77
|
readonly type: "object";
|
|
60
78
|
readonly properties: {
|
|
79
|
+
readonly id: {
|
|
80
|
+
readonly type: "string";
|
|
81
|
+
readonly pattern: "^mx-[0-9a-f]{4,8}$";
|
|
82
|
+
};
|
|
61
83
|
readonly type: {
|
|
62
84
|
readonly type: "string";
|
|
63
85
|
readonly const: "pattern";
|
|
@@ -89,12 +111,30 @@ export declare const recordSchema: {
|
|
|
89
111
|
readonly type: "string";
|
|
90
112
|
};
|
|
91
113
|
};
|
|
114
|
+
readonly relates_to: {
|
|
115
|
+
readonly type: "array";
|
|
116
|
+
readonly items: {
|
|
117
|
+
readonly type: "string";
|
|
118
|
+
readonly pattern: "^mx-[0-9a-f]{4,8}$";
|
|
119
|
+
};
|
|
120
|
+
};
|
|
121
|
+
readonly supersedes: {
|
|
122
|
+
readonly type: "array";
|
|
123
|
+
readonly items: {
|
|
124
|
+
readonly type: "string";
|
|
125
|
+
readonly pattern: "^mx-[0-9a-f]{4,8}$";
|
|
126
|
+
};
|
|
127
|
+
};
|
|
92
128
|
};
|
|
93
129
|
readonly required: readonly ["type", "name", "description", "classification", "recorded_at"];
|
|
94
130
|
readonly additionalProperties: false;
|
|
95
131
|
}, {
|
|
96
132
|
readonly type: "object";
|
|
97
133
|
readonly properties: {
|
|
134
|
+
readonly id: {
|
|
135
|
+
readonly type: "string";
|
|
136
|
+
readonly pattern: "^mx-[0-9a-f]{4,8}$";
|
|
137
|
+
};
|
|
98
138
|
readonly type: {
|
|
99
139
|
readonly type: "string";
|
|
100
140
|
readonly const: "failure";
|
|
@@ -120,12 +160,30 @@ export declare const recordSchema: {
|
|
|
120
160
|
readonly type: "string";
|
|
121
161
|
};
|
|
122
162
|
};
|
|
163
|
+
readonly relates_to: {
|
|
164
|
+
readonly type: "array";
|
|
165
|
+
readonly items: {
|
|
166
|
+
readonly type: "string";
|
|
167
|
+
readonly pattern: "^mx-[0-9a-f]{4,8}$";
|
|
168
|
+
};
|
|
169
|
+
};
|
|
170
|
+
readonly supersedes: {
|
|
171
|
+
readonly type: "array";
|
|
172
|
+
readonly items: {
|
|
173
|
+
readonly type: "string";
|
|
174
|
+
readonly pattern: "^mx-[0-9a-f]{4,8}$";
|
|
175
|
+
};
|
|
176
|
+
};
|
|
123
177
|
};
|
|
124
178
|
readonly required: readonly ["type", "description", "resolution", "classification", "recorded_at"];
|
|
125
179
|
readonly additionalProperties: false;
|
|
126
180
|
}, {
|
|
127
181
|
readonly type: "object";
|
|
128
182
|
readonly properties: {
|
|
183
|
+
readonly id: {
|
|
184
|
+
readonly type: "string";
|
|
185
|
+
readonly pattern: "^mx-[0-9a-f]{4,8}$";
|
|
186
|
+
};
|
|
129
187
|
readonly type: {
|
|
130
188
|
readonly type: "string";
|
|
131
189
|
readonly const: "decision";
|
|
@@ -154,12 +212,30 @@ export declare const recordSchema: {
|
|
|
154
212
|
readonly type: "string";
|
|
155
213
|
};
|
|
156
214
|
};
|
|
215
|
+
readonly relates_to: {
|
|
216
|
+
readonly type: "array";
|
|
217
|
+
readonly items: {
|
|
218
|
+
readonly type: "string";
|
|
219
|
+
readonly pattern: "^mx-[0-9a-f]{4,8}$";
|
|
220
|
+
};
|
|
221
|
+
};
|
|
222
|
+
readonly supersedes: {
|
|
223
|
+
readonly type: "array";
|
|
224
|
+
readonly items: {
|
|
225
|
+
readonly type: "string";
|
|
226
|
+
readonly pattern: "^mx-[0-9a-f]{4,8}$";
|
|
227
|
+
};
|
|
228
|
+
};
|
|
157
229
|
};
|
|
158
230
|
readonly required: readonly ["type", "title", "rationale", "classification", "recorded_at"];
|
|
159
231
|
readonly additionalProperties: false;
|
|
160
232
|
}, {
|
|
161
233
|
readonly type: "object";
|
|
162
234
|
readonly properties: {
|
|
235
|
+
readonly id: {
|
|
236
|
+
readonly type: "string";
|
|
237
|
+
readonly pattern: "^mx-[0-9a-f]{4,8}$";
|
|
238
|
+
};
|
|
163
239
|
readonly type: {
|
|
164
240
|
readonly type: "string";
|
|
165
241
|
readonly const: "reference";
|
|
@@ -191,12 +267,30 @@ export declare const recordSchema: {
|
|
|
191
267
|
readonly type: "string";
|
|
192
268
|
};
|
|
193
269
|
};
|
|
270
|
+
readonly relates_to: {
|
|
271
|
+
readonly type: "array";
|
|
272
|
+
readonly items: {
|
|
273
|
+
readonly type: "string";
|
|
274
|
+
readonly pattern: "^mx-[0-9a-f]{4,8}$";
|
|
275
|
+
};
|
|
276
|
+
};
|
|
277
|
+
readonly supersedes: {
|
|
278
|
+
readonly type: "array";
|
|
279
|
+
readonly items: {
|
|
280
|
+
readonly type: "string";
|
|
281
|
+
readonly pattern: "^mx-[0-9a-f]{4,8}$";
|
|
282
|
+
};
|
|
283
|
+
};
|
|
194
284
|
};
|
|
195
285
|
readonly required: readonly ["type", "name", "description", "classification", "recorded_at"];
|
|
196
286
|
readonly additionalProperties: false;
|
|
197
287
|
}, {
|
|
198
288
|
readonly type: "object";
|
|
199
289
|
readonly properties: {
|
|
290
|
+
readonly id: {
|
|
291
|
+
readonly type: "string";
|
|
292
|
+
readonly pattern: "^mx-[0-9a-f]{4,8}$";
|
|
293
|
+
};
|
|
200
294
|
readonly type: {
|
|
201
295
|
readonly type: "string";
|
|
202
296
|
readonly const: "guide";
|
|
@@ -222,6 +316,20 @@ export declare const recordSchema: {
|
|
|
222
316
|
readonly type: "string";
|
|
223
317
|
};
|
|
224
318
|
};
|
|
319
|
+
readonly relates_to: {
|
|
320
|
+
readonly type: "array";
|
|
321
|
+
readonly items: {
|
|
322
|
+
readonly type: "string";
|
|
323
|
+
readonly pattern: "^mx-[0-9a-f]{4,8}$";
|
|
324
|
+
};
|
|
325
|
+
};
|
|
326
|
+
readonly supersedes: {
|
|
327
|
+
readonly type: "array";
|
|
328
|
+
readonly items: {
|
|
329
|
+
readonly type: "string";
|
|
330
|
+
readonly pattern: "^mx-[0-9a-f]{4,8}$";
|
|
331
|
+
};
|
|
332
|
+
};
|
|
225
333
|
};
|
|
226
334
|
readonly required: readonly ["type", "name", "description", "classification", "recorded_at"];
|
|
227
335
|
readonly additionalProperties: false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record-schema.d.ts","sourceRoot":"","sources":["../../src/schemas/record-schema.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"record-schema.d.ts","sourceRoot":"","sources":["../../src/schemas/record-schema.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+Hf,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
const linkArray = { type: "array", items: { type: "string", pattern: "^mx-[0-9a-f]{4,8}$" } };
|
|
1
2
|
export const recordSchema = {
|
|
2
3
|
$schema: "http://json-schema.org/draft-07/schema#",
|
|
3
4
|
title: "Mulch Expertise Record",
|
|
@@ -23,12 +24,15 @@ export const recordSchema = {
|
|
|
23
24
|
{
|
|
24
25
|
type: "object",
|
|
25
26
|
properties: {
|
|
27
|
+
id: { type: "string", pattern: "^mx-[0-9a-f]{4,8}$" },
|
|
26
28
|
type: { type: "string", const: "convention" },
|
|
27
29
|
content: { type: "string" },
|
|
28
30
|
classification: { $ref: "#/definitions/classification" },
|
|
29
31
|
recorded_at: { type: "string" },
|
|
30
32
|
evidence: { $ref: "#/definitions/evidence" },
|
|
31
33
|
tags: { type: "array", items: { type: "string" } },
|
|
34
|
+
relates_to: linkArray,
|
|
35
|
+
supersedes: linkArray,
|
|
32
36
|
},
|
|
33
37
|
required: ["type", "content", "classification", "recorded_at"],
|
|
34
38
|
additionalProperties: false,
|
|
@@ -36,6 +40,7 @@ export const recordSchema = {
|
|
|
36
40
|
{
|
|
37
41
|
type: "object",
|
|
38
42
|
properties: {
|
|
43
|
+
id: { type: "string", pattern: "^mx-[0-9a-f]{4,8}$" },
|
|
39
44
|
type: { type: "string", const: "pattern" },
|
|
40
45
|
name: { type: "string" },
|
|
41
46
|
description: { type: "string" },
|
|
@@ -44,6 +49,8 @@ export const recordSchema = {
|
|
|
44
49
|
recorded_at: { type: "string" },
|
|
45
50
|
evidence: { $ref: "#/definitions/evidence" },
|
|
46
51
|
tags: { type: "array", items: { type: "string" } },
|
|
52
|
+
relates_to: linkArray,
|
|
53
|
+
supersedes: linkArray,
|
|
47
54
|
},
|
|
48
55
|
required: ["type", "name", "description", "classification", "recorded_at"],
|
|
49
56
|
additionalProperties: false,
|
|
@@ -51,6 +58,7 @@ export const recordSchema = {
|
|
|
51
58
|
{
|
|
52
59
|
type: "object",
|
|
53
60
|
properties: {
|
|
61
|
+
id: { type: "string", pattern: "^mx-[0-9a-f]{4,8}$" },
|
|
54
62
|
type: { type: "string", const: "failure" },
|
|
55
63
|
description: { type: "string" },
|
|
56
64
|
resolution: { type: "string" },
|
|
@@ -58,6 +66,8 @@ export const recordSchema = {
|
|
|
58
66
|
recorded_at: { type: "string" },
|
|
59
67
|
evidence: { $ref: "#/definitions/evidence" },
|
|
60
68
|
tags: { type: "array", items: { type: "string" } },
|
|
69
|
+
relates_to: linkArray,
|
|
70
|
+
supersedes: linkArray,
|
|
61
71
|
},
|
|
62
72
|
required: ["type", "description", "resolution", "classification", "recorded_at"],
|
|
63
73
|
additionalProperties: false,
|
|
@@ -65,6 +75,7 @@ export const recordSchema = {
|
|
|
65
75
|
{
|
|
66
76
|
type: "object",
|
|
67
77
|
properties: {
|
|
78
|
+
id: { type: "string", pattern: "^mx-[0-9a-f]{4,8}$" },
|
|
68
79
|
type: { type: "string", const: "decision" },
|
|
69
80
|
title: { type: "string" },
|
|
70
81
|
rationale: { type: "string" },
|
|
@@ -73,6 +84,8 @@ export const recordSchema = {
|
|
|
73
84
|
recorded_at: { type: "string" },
|
|
74
85
|
evidence: { $ref: "#/definitions/evidence" },
|
|
75
86
|
tags: { type: "array", items: { type: "string" } },
|
|
87
|
+
relates_to: linkArray,
|
|
88
|
+
supersedes: linkArray,
|
|
76
89
|
},
|
|
77
90
|
required: ["type", "title", "rationale", "classification", "recorded_at"],
|
|
78
91
|
additionalProperties: false,
|
|
@@ -80,6 +93,7 @@ export const recordSchema = {
|
|
|
80
93
|
{
|
|
81
94
|
type: "object",
|
|
82
95
|
properties: {
|
|
96
|
+
id: { type: "string", pattern: "^mx-[0-9a-f]{4,8}$" },
|
|
83
97
|
type: { type: "string", const: "reference" },
|
|
84
98
|
name: { type: "string" },
|
|
85
99
|
description: { type: "string" },
|
|
@@ -88,6 +102,8 @@ export const recordSchema = {
|
|
|
88
102
|
recorded_at: { type: "string" },
|
|
89
103
|
evidence: { $ref: "#/definitions/evidence" },
|
|
90
104
|
tags: { type: "array", items: { type: "string" } },
|
|
105
|
+
relates_to: linkArray,
|
|
106
|
+
supersedes: linkArray,
|
|
91
107
|
},
|
|
92
108
|
required: ["type", "name", "description", "classification", "recorded_at"],
|
|
93
109
|
additionalProperties: false,
|
|
@@ -95,6 +111,7 @@ export const recordSchema = {
|
|
|
95
111
|
{
|
|
96
112
|
type: "object",
|
|
97
113
|
properties: {
|
|
114
|
+
id: { type: "string", pattern: "^mx-[0-9a-f]{4,8}$" },
|
|
98
115
|
type: { type: "string", const: "guide" },
|
|
99
116
|
name: { type: "string" },
|
|
100
117
|
description: { type: "string" },
|
|
@@ -102,6 +119,8 @@ export const recordSchema = {
|
|
|
102
119
|
recorded_at: { type: "string" },
|
|
103
120
|
evidence: { $ref: "#/definitions/evidence" },
|
|
104
121
|
tags: { type: "array", items: { type: "string" } },
|
|
122
|
+
relates_to: linkArray,
|
|
123
|
+
supersedes: linkArray,
|
|
105
124
|
},
|
|
106
125
|
required: ["type", "name", "description", "classification", "recorded_at"],
|
|
107
126
|
additionalProperties: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record-schema.js","sourceRoot":"","sources":["../../src/schemas/record-schema.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,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KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;gBAClD,UAAU,EAAE,SAAS;gBACrB,UAAU,EAAE,SAAS;aACtB;YACD,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,gBAAgB,EAAE,aAAa,CAAC;YAC1E,oBAAoB,EAAE,KAAK;SAC5B;KACF;CACO,CAAC"}
|
package/dist/schemas/record.d.ts
CHANGED
|
@@ -7,10 +7,13 @@ export interface Evidence {
|
|
|
7
7
|
file?: string;
|
|
8
8
|
}
|
|
9
9
|
interface BaseRecord {
|
|
10
|
+
id?: string;
|
|
10
11
|
classification: Classification;
|
|
11
12
|
recorded_at: string;
|
|
12
13
|
evidence?: Evidence;
|
|
13
14
|
tags?: string[];
|
|
15
|
+
relates_to?: string[];
|
|
16
|
+
supersedes?: string[];
|
|
14
17
|
}
|
|
15
18
|
export interface ConventionRecord extends BaseRecord {
|
|
16
19
|
type: "convention";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record.d.ts","sourceRoot":"","sources":["../../src/schemas/record.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG,YAAY,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,GAAG,WAAW,GAAG,OAAO,CAAC;AAEnG,MAAM,MAAM,cAAc,GAAG,cAAc,GAAG,UAAU,GAAG,eAAe,CAAC;AAE3E,MAAM,WAAW,QAAQ;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,UAAU,UAAU;IAClB,cAAc,EAAE,cAAc,CAAC;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"record.d.ts","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AE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,eAAgB,SAAQ,UAAU;IACjD,IAAI,EAAE,WAAW,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,MAAM,WAAW,WAAY,SAAQ,UAAU;IAC7C,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,MAAM,eAAe,GACvB,gBAAgB,GAChB,aAAa,GACb,aAAa,GACb,cAAc,GACd,eAAe,GACf,WAAW,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ExpertiseRecord } from "../schemas/record.js";
|
|
2
2
|
export declare function readExpertiseFile(filePath: string): Promise<ExpertiseRecord[]>;
|
|
3
|
+
export declare function generateRecordId(record: ExpertiseRecord): string;
|
|
3
4
|
export declare function appendRecord(filePath: string, record: ExpertiseRecord): Promise<void>;
|
|
4
5
|
export declare function createExpertiseFile(filePath: string): Promise<void>;
|
|
5
6
|
export declare function getFileModTime(filePath: string): Promise<Date | null>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expertise.d.ts","sourceRoot":"","sources":["../../src/utils/expertise.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"expertise.d.ts","sourceRoot":"","sources":["../../src/utils/expertise.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D,wBAAsB,iBAAiB,CACrC,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,eAAe,EAAE,CAAC,CAc5B;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,eAAe,GAAG,MAAM,CAuBhE;AAED,wBAAsB,YAAY,CAChC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,eAAe,GACtB,OAAO,CAAC,IAAI,CAAC,CAMf;AAED,wBAAsB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAEzE;AAED,wBAAsB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,CAO3E;AAED,wBAAsB,kBAAkB,CACtC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,eAAe,EAAE,GACzB,OAAO,CAAC,IAAI,CAAC,CAQf;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,eAAe,EAAE,GAAG,MAAM,CAE/D;AAED,wBAAgB,YAAY,CAC1B,OAAO,EAAE,eAAe,EAAE,EAC1B,IAAI,EAAE,MAAM,GACX,eAAe,EAAE,CAEnB;AAED,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,eAAe,EAAE,EAC3B,SAAS,EAAE,eAAe,GACzB;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,eAAe,CAAA;CAAE,GAAG,IAAI,CAyDnD;AAED,wBAAgB,aAAa,CAC3B,OAAO,EAAE,eAAe,EAAE,EAC1B,KAAK,EAAE,MAAM,GACZ,eAAe,EAAE,CAiBnB"}
|