@mono-labs/tracker 0.1.274 → 0.1.280
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/dashboard/cli.js +42 -0
- package/dist/dashboard/server.d.ts.map +1 -1
- package/dist/dashboard/server.js +466 -3
- package/dist/dashboard/watcher.d.ts +1 -1
- package/dist/dashboard/watcher.d.ts.map +1 -1
- package/dist/dashboard/watcher.js +1 -1
- package/dist/executor/action-executor.d.ts +3 -3
- package/dist/executor/action-executor.d.ts.map +1 -1
- package/dist/executor/action-executor.js +2 -2
- package/dist/executor/actions/extract-action.d.ts +4 -0
- package/dist/executor/actions/extract-action.d.ts.map +1 -0
- package/dist/executor/actions/extract-action.js +85 -0
- package/dist/executor/actions/index.d.ts +4 -0
- package/dist/executor/actions/index.d.ts.map +1 -1
- package/dist/executor/actions/index.js +9 -1
- package/dist/executor/actions/insert-action.d.ts +4 -0
- package/dist/executor/actions/insert-action.d.ts.map +1 -0
- package/dist/executor/actions/insert-action.js +74 -0
- package/dist/executor/actions/move-action.d.ts +4 -0
- package/dist/executor/actions/move-action.d.ts.map +1 -0
- package/dist/executor/actions/move-action.js +83 -0
- package/dist/executor/actions/remove-action.d.ts +2 -2
- package/dist/executor/actions/remove-action.d.ts.map +1 -1
- package/dist/executor/actions/remove-action.js +70 -6
- package/dist/executor/actions/rename-action.d.ts +2 -2
- package/dist/executor/actions/rename-action.d.ts.map +1 -1
- package/dist/executor/actions/rename-action.js +69 -6
- package/dist/executor/actions/replace-action.d.ts +2 -2
- package/dist/executor/actions/replace-action.d.ts.map +1 -1
- package/dist/executor/actions/replace-action.js +65 -6
- package/dist/executor/actions/wrap-action.d.ts +4 -0
- package/dist/executor/actions/wrap-action.d.ts.map +1 -0
- package/dist/executor/actions/wrap-action.js +97 -0
- package/dist/executor/index.d.ts +1 -1
- package/dist/executor/index.d.ts.map +1 -1
- package/dist/executor/index.js +21 -1
- package/dist/governance/deprecation-tracker.d.ts +21 -0
- package/dist/governance/deprecation-tracker.d.ts.map +1 -0
- package/dist/governance/deprecation-tracker.js +55 -0
- package/dist/governance/index.d.ts +5 -0
- package/dist/governance/index.d.ts.map +1 -0
- package/dist/governance/index.js +7 -0
- package/dist/governance/security-gate.d.ts +15 -0
- package/dist/governance/security-gate.d.ts.map +1 -0
- package/dist/governance/security-gate.js +40 -0
- package/dist/governance/security-gate.test.d.ts +2 -0
- package/dist/governance/security-gate.test.d.ts.map +1 -0
- package/dist/governance/security-gate.test.js +67 -0
- package/dist/index.d.ts +13 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +20 -1
- package/dist/integrations/ai-suggest.d.ts +8 -0
- package/dist/integrations/ai-suggest.d.ts.map +1 -0
- package/dist/integrations/ai-suggest.js +106 -0
- package/dist/integrations/github-issues.d.ts +8 -0
- package/dist/integrations/github-issues.d.ts.map +1 -0
- package/dist/integrations/github-issues.js +84 -0
- package/dist/integrations/index.d.ts +5 -0
- package/dist/integrations/index.d.ts.map +1 -0
- package/dist/integrations/index.js +9 -0
- package/dist/integrations/jira-issues.d.ts +8 -0
- package/dist/integrations/jira-issues.d.ts.map +1 -0
- package/dist/integrations/jira-issues.js +93 -0
- package/dist/manager/health-score.d.ts +3 -0
- package/dist/manager/health-score.d.ts.map +1 -0
- package/dist/manager/health-score.js +32 -0
- package/dist/manager/index.d.ts +3 -0
- package/dist/manager/index.d.ts.map +1 -1
- package/dist/manager/index.js +5 -1
- package/dist/manager/notation-manager.test.js +5 -1
- package/dist/manager/projection.d.ts +15 -0
- package/dist/manager/projection.d.ts.map +1 -0
- package/dist/manager/projection.js +56 -0
- package/dist/scanner/action-serializer.d.ts +4 -0
- package/dist/scanner/action-serializer.d.ts.map +1 -0
- package/dist/scanner/action-serializer.js +54 -0
- package/dist/scanner/attribute-parser.d.ts +2 -0
- package/dist/scanner/attribute-parser.d.ts.map +1 -1
- package/dist/scanner/attribute-parser.js +11 -0
- package/dist/scanner/git-blame.d.ts +3 -0
- package/dist/scanner/git-blame.d.ts.map +1 -0
- package/dist/scanner/git-blame.js +81 -0
- package/dist/scanner/index.d.ts +1 -0
- package/dist/scanner/index.d.ts.map +1 -1
- package/dist/scanner/index.js +4 -1
- package/dist/scanner/notation-parser.d.ts.map +1 -1
- package/dist/scanner/notation-parser.js +3 -1
- package/dist/storage/config-loader.d.ts +6 -0
- package/dist/storage/config-loader.d.ts.map +1 -1
- package/dist/storage/config-loader.js +10 -0
- package/dist/storage/index.d.ts +4 -1
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +4 -1
- package/dist/storage/snapshot-storage.d.ts +16 -0
- package/dist/storage/snapshot-storage.d.ts.map +1 -0
- package/dist/storage/snapshot-storage.js +106 -0
- package/dist/storage/snapshot-storage.test.d.ts +2 -0
- package/dist/storage/snapshot-storage.test.d.ts.map +1 -0
- package/dist/storage/snapshot-storage.test.js +117 -0
- package/dist/types/config.d.ts +22 -0
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/config.js +5 -1
- package/dist/types/enums.d.ts +1 -0
- package/dist/types/enums.d.ts.map +1 -1
- package/dist/types/enums.js +1 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/notation.d.ts +9 -0
- package/dist/types/notation.d.ts.map +1 -1
- package/dist-dashboard/assets/index-CzsCRhkp.js +197 -0
- package/dist-dashboard/assets/index-DUqAN9SG.css +1 -0
- package/dist-dashboard/index.html +12 -1
- package/package.json +33 -8
- package/dist-dashboard/assets/index-Bi4tCz8P.js +0 -62
|
@@ -33,10 +33,18 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.loadSecrets = loadSecrets;
|
|
36
37
|
exports.loadConfig = loadConfig;
|
|
37
38
|
const fs = __importStar(require("fs"));
|
|
38
39
|
const path = __importStar(require("path"));
|
|
39
40
|
const types_1 = require("../types");
|
|
41
|
+
function loadSecrets() {
|
|
42
|
+
return {
|
|
43
|
+
githubToken: process.env.TRACKER_GITHUB_TOKEN || undefined,
|
|
44
|
+
jiraToken: process.env.TRACKER_JIRA_TOKEN || undefined,
|
|
45
|
+
aiKey: process.env.TRACKER_AI_KEY || undefined,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
40
48
|
function loadConfig(projectRoot) {
|
|
41
49
|
const configPath = path.join(projectRoot, 'tracker.config.json');
|
|
42
50
|
let userConfig = {};
|
|
@@ -50,6 +58,8 @@ function loadConfig(projectRoot) {
|
|
|
50
58
|
return {
|
|
51
59
|
...types_1.DEFAULT_CONFIG,
|
|
52
60
|
...userConfig,
|
|
61
|
+
securityGate: { ...types_1.DEFAULT_CONFIG.securityGate, ...userConfig.securityGate },
|
|
62
|
+
integrations: { ...types_1.DEFAULT_CONFIG.integrations, ...userConfig.integrations },
|
|
53
63
|
rootDir: projectRoot,
|
|
54
64
|
};
|
|
55
65
|
}
|
package/dist/storage/index.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
export { JsonlStorage } from './jsonl-storage';
|
|
2
|
-
export { loadConfig } from './config-loader';
|
|
2
|
+
export { loadConfig, loadSecrets } from './config-loader';
|
|
3
|
+
export type { ResolvedSecrets } from './config-loader';
|
|
4
|
+
export { SnapshotStorage } from './snapshot-storage';
|
|
5
|
+
export type { Snapshot } from './snapshot-storage';
|
|
3
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/storage/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/storage/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC9C,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AACzD,YAAY,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACpD,YAAY,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA"}
|
package/dist/storage/index.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.loadConfig = exports.JsonlStorage = void 0;
|
|
3
|
+
exports.SnapshotStorage = exports.loadSecrets = exports.loadConfig = exports.JsonlStorage = void 0;
|
|
4
4
|
var jsonl_storage_1 = require("./jsonl-storage");
|
|
5
5
|
Object.defineProperty(exports, "JsonlStorage", { enumerable: true, get: function () { return jsonl_storage_1.JsonlStorage; } });
|
|
6
6
|
var config_loader_1 = require("./config-loader");
|
|
7
7
|
Object.defineProperty(exports, "loadConfig", { enumerable: true, get: function () { return config_loader_1.loadConfig; } });
|
|
8
|
+
Object.defineProperty(exports, "loadSecrets", { enumerable: true, get: function () { return config_loader_1.loadSecrets; } });
|
|
9
|
+
var snapshot_storage_1 = require("./snapshot-storage");
|
|
10
|
+
Object.defineProperty(exports, "SnapshotStorage", { enumerable: true, get: function () { return snapshot_storage_1.SnapshotStorage; } });
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { NotationStats } from '../types';
|
|
2
|
+
export interface Snapshot {
|
|
3
|
+
date: string;
|
|
4
|
+
stats: NotationStats;
|
|
5
|
+
healthScore: number;
|
|
6
|
+
}
|
|
7
|
+
export declare class SnapshotStorage {
|
|
8
|
+
private filePath;
|
|
9
|
+
constructor(filePath: string);
|
|
10
|
+
private ensureDirectory;
|
|
11
|
+
readAll(): Promise<Snapshot[]>;
|
|
12
|
+
readRange(days: number): Promise<Snapshot[]>;
|
|
13
|
+
append(snapshot: Snapshot): Promise<void>;
|
|
14
|
+
getLatestDate(): Promise<string | null>;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=snapshot-storage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snapshot-storage.d.ts","sourceRoot":"","sources":["../../src/storage/snapshot-storage.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAE7C,MAAM,WAAW,QAAQ;IACxB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,aAAa,CAAA;IACpB,WAAW,EAAE,MAAM,CAAA;CACnB;AAID,qBAAa,eAAe;IAC3B,OAAO,CAAC,QAAQ,CAAQ;gBAEZ,QAAQ,EAAE,MAAM;YAId,eAAe;IAKvB,OAAO,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;IAmB9B,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IAS5C,MAAM,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAuBzC,aAAa,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;CAK7C"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.SnapshotStorage = void 0;
|
|
37
|
+
const fs = __importStar(require("fs"));
|
|
38
|
+
const path = __importStar(require("path"));
|
|
39
|
+
const MAX_SNAPSHOTS = 365;
|
|
40
|
+
class SnapshotStorage {
|
|
41
|
+
filePath;
|
|
42
|
+
constructor(filePath) {
|
|
43
|
+
this.filePath = filePath;
|
|
44
|
+
}
|
|
45
|
+
async ensureDirectory() {
|
|
46
|
+
const dir = path.dirname(this.filePath);
|
|
47
|
+
await fs.promises.mkdir(dir, { recursive: true });
|
|
48
|
+
}
|
|
49
|
+
async readAll() {
|
|
50
|
+
try {
|
|
51
|
+
const content = await fs.promises.readFile(this.filePath, 'utf-8');
|
|
52
|
+
const lines = content.trim().split('\n').filter(Boolean);
|
|
53
|
+
const snapshots = [];
|
|
54
|
+
for (const line of lines) {
|
|
55
|
+
try {
|
|
56
|
+
snapshots.push(JSON.parse(line));
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
// Skip corrupt lines
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return snapshots;
|
|
63
|
+
}
|
|
64
|
+
catch (err) {
|
|
65
|
+
if (err.code === 'ENOENT')
|
|
66
|
+
return [];
|
|
67
|
+
throw err;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
async readRange(days) {
|
|
71
|
+
const all = await this.readAll();
|
|
72
|
+
if (days <= 0)
|
|
73
|
+
return all;
|
|
74
|
+
const cutoff = new Date();
|
|
75
|
+
cutoff.setDate(cutoff.getDate() - days);
|
|
76
|
+
const cutoffStr = cutoff.toISOString().slice(0, 10);
|
|
77
|
+
return all.filter((s) => s.date >= cutoffStr);
|
|
78
|
+
}
|
|
79
|
+
async append(snapshot) {
|
|
80
|
+
await this.ensureDirectory();
|
|
81
|
+
let snapshots = await this.readAll();
|
|
82
|
+
// Replace existing entry for the same date
|
|
83
|
+
const existingIdx = snapshots.findIndex((s) => s.date === snapshot.date);
|
|
84
|
+
if (existingIdx !== -1) {
|
|
85
|
+
snapshots[existingIdx] = snapshot;
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
snapshots.push(snapshot);
|
|
89
|
+
}
|
|
90
|
+
// Prune to max entries
|
|
91
|
+
if (snapshots.length > MAX_SNAPSHOTS) {
|
|
92
|
+
snapshots = snapshots.slice(snapshots.length - MAX_SNAPSHOTS);
|
|
93
|
+
}
|
|
94
|
+
const tmpPath = this.filePath + '.tmp';
|
|
95
|
+
const content = snapshots.map((s) => JSON.stringify(s)).join('\n') + '\n';
|
|
96
|
+
await fs.promises.writeFile(tmpPath, content, 'utf-8');
|
|
97
|
+
await fs.promises.rename(tmpPath, this.filePath);
|
|
98
|
+
}
|
|
99
|
+
async getLatestDate() {
|
|
100
|
+
const all = await this.readAll();
|
|
101
|
+
if (all.length === 0)
|
|
102
|
+
return null;
|
|
103
|
+
return all[all.length - 1].date;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
exports.SnapshotStorage = SnapshotStorage;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snapshot-storage.test.d.ts","sourceRoot":"","sources":["../../src/storage/snapshot-storage.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
const vitest_1 = require("vitest");
|
|
37
|
+
const fs = __importStar(require("fs"));
|
|
38
|
+
const path = __importStar(require("path"));
|
|
39
|
+
const os = __importStar(require("os"));
|
|
40
|
+
const snapshot_storage_1 = require("./snapshot-storage");
|
|
41
|
+
function makeSnapshot(date, total = 10, healthScore = 80) {
|
|
42
|
+
return {
|
|
43
|
+
date,
|
|
44
|
+
stats: {
|
|
45
|
+
total,
|
|
46
|
+
byType: { TODO: total },
|
|
47
|
+
byPriority: {},
|
|
48
|
+
byStatus: { open: total },
|
|
49
|
+
byTag: {},
|
|
50
|
+
byAssignee: {},
|
|
51
|
+
overdue: 0,
|
|
52
|
+
blocked: 0,
|
|
53
|
+
totalDebtHours: 0,
|
|
54
|
+
},
|
|
55
|
+
healthScore,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
(0, vitest_1.describe)('SnapshotStorage', () => {
|
|
59
|
+
let tmpDir;
|
|
60
|
+
let filePath;
|
|
61
|
+
let storage;
|
|
62
|
+
(0, vitest_1.beforeEach)(async () => {
|
|
63
|
+
tmpDir = await fs.promises.mkdtemp(path.join(os.tmpdir(), 'tracker-snap-'));
|
|
64
|
+
filePath = path.join(tmpDir, 'snapshots.jsonl');
|
|
65
|
+
storage = new snapshot_storage_1.SnapshotStorage(filePath);
|
|
66
|
+
});
|
|
67
|
+
(0, vitest_1.afterEach)(async () => {
|
|
68
|
+
await fs.promises.rm(tmpDir, { recursive: true, force: true });
|
|
69
|
+
});
|
|
70
|
+
(0, vitest_1.it)('readAll returns empty array when file missing', async () => {
|
|
71
|
+
const result = await storage.readAll();
|
|
72
|
+
(0, vitest_1.expect)(result).toEqual([]);
|
|
73
|
+
});
|
|
74
|
+
(0, vitest_1.it)('append and readAll round-trip', async () => {
|
|
75
|
+
const snap = makeSnapshot('2026-01-15');
|
|
76
|
+
await storage.append(snap);
|
|
77
|
+
const all = await storage.readAll();
|
|
78
|
+
(0, vitest_1.expect)(all).toHaveLength(1);
|
|
79
|
+
(0, vitest_1.expect)(all[0].date).toBe('2026-01-15');
|
|
80
|
+
(0, vitest_1.expect)(all[0].healthScore).toBe(80);
|
|
81
|
+
});
|
|
82
|
+
(0, vitest_1.it)('replaces existing entry for the same date', async () => {
|
|
83
|
+
await storage.append(makeSnapshot('2026-01-15', 10, 80));
|
|
84
|
+
await storage.append(makeSnapshot('2026-01-15', 20, 60));
|
|
85
|
+
const all = await storage.readAll();
|
|
86
|
+
(0, vitest_1.expect)(all).toHaveLength(1);
|
|
87
|
+
(0, vitest_1.expect)(all[0].stats.total).toBe(20);
|
|
88
|
+
(0, vitest_1.expect)(all[0].healthScore).toBe(60);
|
|
89
|
+
});
|
|
90
|
+
(0, vitest_1.it)('readRange filters by days', async () => {
|
|
91
|
+
const today = new Date().toISOString().slice(0, 10);
|
|
92
|
+
const oldDate = '2020-01-01';
|
|
93
|
+
await storage.append(makeSnapshot(oldDate));
|
|
94
|
+
await storage.append(makeSnapshot(today));
|
|
95
|
+
const recent = await storage.readRange(30);
|
|
96
|
+
(0, vitest_1.expect)(recent).toHaveLength(1);
|
|
97
|
+
(0, vitest_1.expect)(recent[0].date).toBe(today);
|
|
98
|
+
});
|
|
99
|
+
(0, vitest_1.it)('prunes to 365 entries', async () => {
|
|
100
|
+
for (let i = 0; i < 370; i++) {
|
|
101
|
+
const date = `2025-${String(Math.floor(i / 28) + 1).padStart(2, '0')}-${String((i % 28) + 1).padStart(2, '0')}`;
|
|
102
|
+
await storage.append(makeSnapshot(date, i));
|
|
103
|
+
}
|
|
104
|
+
const all = await storage.readAll();
|
|
105
|
+
(0, vitest_1.expect)(all.length).toBeLessThanOrEqual(365);
|
|
106
|
+
});
|
|
107
|
+
(0, vitest_1.it)('getLatestDate returns null when empty', async () => {
|
|
108
|
+
const date = await storage.getLatestDate();
|
|
109
|
+
(0, vitest_1.expect)(date).toBeNull();
|
|
110
|
+
});
|
|
111
|
+
(0, vitest_1.it)('getLatestDate returns last date', async () => {
|
|
112
|
+
await storage.append(makeSnapshot('2026-01-01'));
|
|
113
|
+
await storage.append(makeSnapshot('2026-02-15'));
|
|
114
|
+
const date = await storage.getLatestDate();
|
|
115
|
+
(0, vitest_1.expect)(date).toBe('2026-02-15');
|
|
116
|
+
});
|
|
117
|
+
});
|
package/dist/types/config.d.ts
CHANGED
|
@@ -1,11 +1,33 @@
|
|
|
1
1
|
import type { MarkerType } from './enums';
|
|
2
|
+
export interface SecurityGateConfig {
|
|
3
|
+
enabled: boolean;
|
|
4
|
+
blockOnCritical: boolean;
|
|
5
|
+
blockOnHigh: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface IntegrationsConfig {
|
|
8
|
+
github?: {
|
|
9
|
+
owner: string;
|
|
10
|
+
repo: string;
|
|
11
|
+
};
|
|
12
|
+
jira?: {
|
|
13
|
+
baseUrl: string;
|
|
14
|
+
project: string;
|
|
15
|
+
};
|
|
16
|
+
ai?: {
|
|
17
|
+
model?: string;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
2
20
|
export interface TrackerConfig {
|
|
3
21
|
rootDir: string;
|
|
4
22
|
include: string[];
|
|
5
23
|
exclude: string[];
|
|
6
24
|
markers: MarkerType[];
|
|
7
25
|
storagePath: string;
|
|
26
|
+
snapshotPath: string;
|
|
8
27
|
idPrefix: string;
|
|
28
|
+
gitBlame: boolean;
|
|
29
|
+
securityGate: SecurityGateConfig;
|
|
30
|
+
integrations: IntegrationsConfig;
|
|
9
31
|
}
|
|
10
32
|
export declare const DEFAULT_CONFIG: TrackerConfig;
|
|
11
33
|
//# sourceMappingURL=config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/types/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAEzC,MAAM,WAAW,aAAa;IAC7B,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,OAAO,EAAE,UAAU,EAAE,CAAA;IACrB,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/types/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAEzC,MAAM,WAAW,kBAAkB;IAClC,OAAO,EAAE,OAAO,CAAA;IAChB,eAAe,EAAE,OAAO,CAAA;IACxB,WAAW,EAAE,OAAO,CAAA;CACpB;AAED,MAAM,WAAW,kBAAkB;IAClC,MAAM,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAA;IACxC,IAAI,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAA;IAC3C,EAAE,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CACvB;AAED,MAAM,WAAW,aAAa;IAC7B,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,OAAO,EAAE,UAAU,EAAE,CAAA;IACrB,WAAW,EAAE,MAAM,CAAA;IACnB,YAAY,EAAE,MAAM,CAAA;IACpB,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,OAAO,CAAA;IACjB,YAAY,EAAE,kBAAkB,CAAA;IAChC,YAAY,EAAE,kBAAkB,CAAA;CAChC;AAED,eAAO,MAAM,cAAc,EAAE,aAW5B,CAAA"}
|
package/dist/types/config.js
CHANGED
|
@@ -5,7 +5,11 @@ exports.DEFAULT_CONFIG = {
|
|
|
5
5
|
rootDir: '.',
|
|
6
6
|
include: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
|
|
7
7
|
exclude: ['**/node_modules/**', '**/dist/**', '**/build/**', '**/.git/**'],
|
|
8
|
-
markers: ['TODO', 'FIXME', 'BUG', 'HACK', 'NOTE', 'OPTIMIZE', 'SECURITY'],
|
|
8
|
+
markers: ['TODO', 'FIXME', 'BUG', 'HACK', 'NOTE', 'OPTIMIZE', 'SECURITY', 'DEPRECATION'],
|
|
9
9
|
storagePath: '.tracker/notations.jsonl',
|
|
10
|
+
snapshotPath: '.tracker/snapshots.jsonl',
|
|
10
11
|
idPrefix: 'N',
|
|
12
|
+
gitBlame: false,
|
|
13
|
+
securityGate: { enabled: false, blockOnCritical: true, blockOnHigh: false },
|
|
14
|
+
integrations: {},
|
|
11
15
|
};
|
package/dist/types/enums.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export declare const MarkerType: {
|
|
|
6
6
|
readonly NOTE: "NOTE";
|
|
7
7
|
readonly OPTIMIZE: "OPTIMIZE";
|
|
8
8
|
readonly SECURITY: "SECURITY";
|
|
9
|
+
readonly DEPRECATION: "DEPRECATION";
|
|
9
10
|
};
|
|
10
11
|
export type MarkerType = (typeof MarkerType)[keyof typeof MarkerType];
|
|
11
12
|
export declare const Priority: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enums.d.ts","sourceRoot":"","sources":["../../src/types/enums.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU
|
|
1
|
+
{"version":3,"file":"enums.d.ts","sourceRoot":"","sources":["../../src/types/enums.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU;;;;;;;;;CASb,CAAA;AACV,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,OAAO,UAAU,CAAC,CAAA;AAErE,eAAO,MAAM,QAAQ;;;;;;CAMX,CAAA;AACV,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,QAAQ,CAAC,CAAC,MAAM,OAAO,QAAQ,CAAC,CAAA;AAE/D,eAAO,MAAM,SAAS;;;;;;CAMZ,CAAA;AACV,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,OAAO,SAAS,CAAC,CAAA;AAElE,eAAO,MAAM,MAAM;;;;;CAKT,CAAA;AACV,MAAM,MAAM,MAAM,GAAG,CAAC,OAAO,MAAM,CAAC,CAAC,MAAM,OAAO,MAAM,CAAC,CAAA;AAEzD,eAAO,MAAM,eAAe;;;;CAIlB,CAAA;AACV,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,OAAO,eAAe,CAAC,CAAA"}
|
package/dist/types/enums.js
CHANGED
package/dist/types/index.d.ts
CHANGED
|
@@ -2,6 +2,6 @@ export { MarkerType, Priority, RiskLevel, Status, CompoundingRate } from './enum
|
|
|
2
2
|
export type { ActionVerb, NotationAction, ActionArgs, ReplaceArgs, RemoveArgs, RenameArgs, InsertArgs, ExtractArgs, MoveArgs, WrapInArgs, GenericArgs, } from './action';
|
|
3
3
|
export { ActionVerb as ActionVerbEnum } from './action';
|
|
4
4
|
export type { Notation, SourceLocation, PerformanceImpact, TechnicalDebt, NotationQuery, NotationStats, } from './notation';
|
|
5
|
-
export type { TrackerConfig } from './config';
|
|
5
|
+
export type { TrackerConfig, SecurityGateConfig, IntegrationsConfig } from './config';
|
|
6
6
|
export { DEFAULT_CONFIG } from './config';
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAClF,YAAY,EACX,UAAU,EACV,cAAc,EACd,UAAU,EACV,WAAW,EACX,UAAU,EACV,UAAU,EACV,UAAU,EACV,WAAW,EACX,QAAQ,EACR,UAAU,EACV,WAAW,GACX,MAAM,UAAU,CAAA;AACjB,OAAO,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,UAAU,CAAA;AACvD,YAAY,EACX,QAAQ,EACR,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,aAAa,EACb,aAAa,GACb,MAAM,YAAY,CAAA;AACnB,YAAY,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAClF,YAAY,EACX,UAAU,EACV,cAAc,EACd,UAAU,EACV,WAAW,EACX,UAAU,EACV,UAAU,EACV,UAAU,EACV,WAAW,EACX,QAAQ,EACR,UAAU,EACV,WAAW,GACX,MAAM,UAAU,CAAA;AACjB,OAAO,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,UAAU,CAAA;AACvD,YAAY,EACX,QAAQ,EACR,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,aAAa,EACb,aAAa,GACb,MAAM,YAAY,CAAA;AACnB,YAAY,EAAE,aAAa,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAA;AACrF,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA"}
|
package/dist/types/notation.d.ts
CHANGED
|
@@ -32,6 +32,15 @@ export interface Notation {
|
|
|
32
32
|
createdDate?: string;
|
|
33
33
|
performance?: PerformanceImpact;
|
|
34
34
|
debt?: TechnicalDebt;
|
|
35
|
+
eolDate?: string;
|
|
36
|
+
replacement?: string;
|
|
37
|
+
blame?: {
|
|
38
|
+
author: string;
|
|
39
|
+
email: string;
|
|
40
|
+
date: string;
|
|
41
|
+
commitHash: string;
|
|
42
|
+
};
|
|
43
|
+
linkedIssue?: string;
|
|
35
44
|
actions: NotationAction[];
|
|
36
45
|
relationships: string[];
|
|
37
46
|
rawBlock: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notation.d.ts","sourceRoot":"","sources":["../../src/types/notation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AACvF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAE9C,MAAM,WAAW,cAAc;IAC9B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,iBAAiB;IACjC,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;CACZ;AAED,MAAM,WAAW,aAAa;IAC7B,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,eAAe,CAAA;CAC5B;AAED,MAAM,WAAW,QAAQ;IACxB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,UAAU,CAAA;IAChB,WAAW,EAAE,MAAM,CAAA;IACnB,IAAI,EAAE,MAAM,EAAE,CAAA;IACd,WAAW,EAAE,MAAM,EAAE,CAAA;IACrB,QAAQ,EAAE,cAAc,CAAA;IACxB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,QAAQ,CAAA;IACnB,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,EAAE,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,WAAW,CAAC,EAAE,iBAAiB,CAAA;IAC/B,IA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