@pedrocivita/tocket 2.4.0 → 2.6.3
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 +229 -18
- package/dist/commands/agents-md.cmd.d.ts +2 -0
- package/dist/commands/agents-md.cmd.js +166 -0
- package/dist/commands/agents-md.cmd.js.map +1 -0
- package/dist/commands/dashboard.js +2 -0
- package/dist/commands/dashboard.js.map +1 -1
- package/dist/commands/decide.cmd.d.ts +2 -0
- package/dist/commands/decide.cmd.js +70 -0
- package/dist/commands/decide.cmd.js.map +1 -0
- package/dist/commands/diff.cmd.d.ts +15 -0
- package/dist/commands/diff.cmd.js +106 -0
- package/dist/commands/diff.cmd.js.map +1 -0
- package/dist/commands/doctor.cmd.d.ts +13 -0
- package/dist/commands/doctor.cmd.js +159 -11
- package/dist/commands/doctor.cmd.js.map +1 -1
- package/dist/commands/eject.cmd.d.ts +1 -1
- package/dist/commands/eject.cmd.js +3 -1
- package/dist/commands/eject.cmd.js.map +1 -1
- package/dist/commands/generate.cmd.js +7 -1
- package/dist/commands/generate.cmd.js.map +1 -1
- package/dist/commands/handoff.cmd.d.ts +14 -0
- package/dist/commands/handoff.cmd.js +131 -0
- package/dist/commands/handoff.cmd.js.map +1 -0
- package/dist/commands/init.cmd.js +64 -11
- package/dist/commands/init.cmd.js.map +1 -1
- package/dist/commands/scaffold.cmd.d.ts +2 -0
- package/dist/commands/scaffold.cmd.js +118 -0
- package/dist/commands/scaffold.cmd.js.map +1 -0
- package/dist/commands/suite.cmd.d.ts +2 -0
- package/dist/commands/suite.cmd.js +386 -0
- package/dist/commands/suite.cmd.js.map +1 -0
- package/dist/commands/validate.cmd.js +1 -0
- package/dist/commands/validate.cmd.js.map +1 -1
- package/dist/commands/work.cmd.d.ts +2 -0
- package/dist/commands/work.cmd.js +48 -0
- package/dist/commands/work.cmd.js.map +1 -0
- package/dist/eval/decide-eval.d.ts +28 -0
- package/dist/eval/decide-eval.js +34 -0
- package/dist/eval/decide-eval.js.map +1 -0
- package/dist/eval/triage-eval.d.ts +46 -0
- package/dist/eval/triage-eval.js +174 -0
- package/dist/eval/triage-eval.js.map +1 -0
- package/dist/index.js +15 -1
- package/dist/index.js.map +1 -1
- package/dist/mcp/index.d.ts +2 -0
- package/dist/mcp/index.js +7 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/server.d.ts +4 -0
- package/dist/mcp/server.js +360 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/templates/memory-bank.d.ts +11 -0
- package/dist/templates/memory-bank.js +456 -329
- package/dist/templates/memory-bank.js.map +1 -1
- package/dist/tests/agents.test.js +59 -1
- package/dist/tests/agents.test.js.map +1 -1
- package/dist/tests/decide.test.d.ts +1 -0
- package/dist/tests/decide.test.js +483 -0
- package/dist/tests/decide.test.js.map +1 -0
- package/dist/tests/diff.test.d.ts +1 -0
- package/dist/tests/diff.test.js +119 -0
- package/dist/tests/diff.test.js.map +1 -0
- package/dist/tests/doctor.test.js +73 -1
- package/dist/tests/doctor.test.js.map +1 -1
- package/dist/tests/eject.test.js +3 -0
- package/dist/tests/eject.test.js.map +1 -1
- package/dist/tests/git.test.js +32 -1
- package/dist/tests/git.test.js.map +1 -1
- package/dist/tests/handoff.test.d.ts +1 -0
- package/dist/tests/handoff.test.js +97 -0
- package/dist/tests/handoff.test.js.map +1 -0
- package/dist/tests/helpers.d.ts +4 -0
- package/dist/tests/helpers.js +9 -0
- package/dist/tests/helpers.js.map +1 -0
- package/dist/tests/helpers.test.d.ts +1 -0
- package/dist/tests/helpers.test.js +16 -0
- package/dist/tests/helpers.test.js.map +1 -0
- package/dist/tests/init.test.js +53 -2
- package/dist/tests/init.test.js.map +1 -1
- package/dist/tests/loop.test.d.ts +1 -0
- package/dist/tests/loop.test.js +153 -0
- package/dist/tests/loop.test.js.map +1 -0
- package/dist/tests/memory-bank.test.js +53 -1
- package/dist/tests/memory-bank.test.js.map +1 -1
- package/dist/tests/suite.test.d.ts +1 -0
- package/dist/tests/suite.test.js +199 -0
- package/dist/tests/suite.test.js.map +1 -0
- package/dist/tests/triage.test.d.ts +1 -0
- package/dist/tests/triage.test.js +152 -0
- package/dist/tests/triage.test.js.map +1 -0
- package/dist/tests/work.test.d.ts +1 -0
- package/dist/tests/work.test.js +276 -0
- package/dist/tests/work.test.js.map +1 -0
- package/dist/tests/xml.test.d.ts +1 -0
- package/dist/tests/xml.test.js +139 -0
- package/dist/tests/xml.test.js.map +1 -0
- package/dist/utils/agents.d.ts +23 -0
- package/dist/utils/agents.js +82 -0
- package/dist/utils/agents.js.map +1 -1
- package/dist/utils/appmaps.d.ts +65 -0
- package/dist/utils/appmaps.js +280 -0
- package/dist/utils/appmaps.js.map +1 -0
- package/dist/utils/decide.d.ts +178 -0
- package/dist/utils/decide.js +623 -0
- package/dist/utils/decide.js.map +1 -0
- package/dist/utils/git.d.ts +2 -0
- package/dist/utils/git.js +35 -1
- package/dist/utils/git.js.map +1 -1
- package/dist/utils/jev.d.ts +83 -0
- package/dist/utils/jev.js +190 -0
- package/dist/utils/jev.js.map +1 -0
- package/dist/utils/triage.d.ts +87 -0
- package/dist/utils/triage.js +241 -0
- package/dist/utils/triage.js.map +1 -0
- package/dist/utils/work.d.ts +72 -0
- package/dist/utils/work.js +225 -0
- package/dist/utils/work.js.map +1 -0
- package/dist/utils/xml.d.ts +22 -0
- package/dist/utils/xml.js +54 -0
- package/dist/utils/xml.js.map +1 -0
- package/package.json +53 -50
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* POC C eval: heuristic/Jev triage vs human labels + stability + naive baseline.
|
|
4
|
+
*
|
|
5
|
+
* npm run eval:triage
|
|
6
|
+
*/
|
|
7
|
+
import { mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
8
|
+
import { dirname, join } from "node:path";
|
|
9
|
+
import { parseLastRun } from "../utils/appmaps.js";
|
|
10
|
+
import { heuristicCase, naiveIfElseChoice, selectResults, } from "../utils/triage.js";
|
|
11
|
+
export const AGREEMENT_HYPOTHESIS = 0.8;
|
|
12
|
+
export const STABILITY_KILL = 0.3;
|
|
13
|
+
export const CHANCE_BASELINE = 0.25;
|
|
14
|
+
export function loadExpected(path) {
|
|
15
|
+
return JSON.parse(readFileSync(path, "utf-8"));
|
|
16
|
+
}
|
|
17
|
+
export function evaluateTriage(lastRunPath, expectedPath) {
|
|
18
|
+
const expected = loadExpected(expectedPath);
|
|
19
|
+
const run = parseLastRun(readFileSync(lastRunPath, "utf-8"));
|
|
20
|
+
const selected = selectResults(run, expected.include_low_confidence);
|
|
21
|
+
const first = new Map(selected.map((result) => [result.id, heuristicCase(result).choice]));
|
|
22
|
+
const second = new Map(selected.map((result) => [result.id, heuristicCase(result).choice]));
|
|
23
|
+
const expectedById = new Map(expected.cases.map((item) => [item.id, item]));
|
|
24
|
+
const disagreements = [];
|
|
25
|
+
let agreed = 0;
|
|
26
|
+
let naiveAgreed = 0;
|
|
27
|
+
let unstable = 0;
|
|
28
|
+
for (const item of expected.cases) {
|
|
29
|
+
const result = selected.find((row) => row.id === item.id);
|
|
30
|
+
if (!result) {
|
|
31
|
+
disagreements.push({
|
|
32
|
+
id: item.id,
|
|
33
|
+
expected: item.expected,
|
|
34
|
+
got: "escalate",
|
|
35
|
+
flavor: `${item.flavor} (missing from selected results)`,
|
|
36
|
+
});
|
|
37
|
+
continue;
|
|
38
|
+
}
|
|
39
|
+
const got = first.get(item.id);
|
|
40
|
+
const again = second.get(item.id);
|
|
41
|
+
if (got !== again)
|
|
42
|
+
unstable += 1;
|
|
43
|
+
if (got === item.expected)
|
|
44
|
+
agreed += 1;
|
|
45
|
+
else if (got) {
|
|
46
|
+
disagreements.push({
|
|
47
|
+
id: item.id,
|
|
48
|
+
expected: item.expected,
|
|
49
|
+
got,
|
|
50
|
+
flavor: item.flavor,
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
if (naiveIfElseChoice(result) === item.expected)
|
|
54
|
+
naiveAgreed += 1;
|
|
55
|
+
}
|
|
56
|
+
const total = expected.cases.length;
|
|
57
|
+
const agreement = total === 0 ? 0 : agreed / total;
|
|
58
|
+
const naiveAgreement = total === 0 ? 0 : naiveAgreed / total;
|
|
59
|
+
const unstableRate = total === 0 ? 0 : unstable / total;
|
|
60
|
+
const reasons = [];
|
|
61
|
+
let verdict = "PASS";
|
|
62
|
+
if (unstableRate >= STABILITY_KILL) {
|
|
63
|
+
verdict = "FAIL";
|
|
64
|
+
reasons.push(`Stability kill: ${pct(unstableRate)} of cases changed across 2 identical runs (threshold ${pct(STABILITY_KILL)}).`);
|
|
65
|
+
}
|
|
66
|
+
if (agreement <= CHANCE_BASELINE || agreement <= naiveAgreement) {
|
|
67
|
+
verdict = "FAIL";
|
|
68
|
+
reasons.push(`Kill: agreement ${pct(agreement)} ≤ chance ${pct(CHANCE_BASELINE)} or naive if-else ${pct(naiveAgreement)}.`);
|
|
69
|
+
}
|
|
70
|
+
if (agreement < AGREEMENT_HYPOTHESIS && verdict !== "FAIL") {
|
|
71
|
+
verdict = "FAIL";
|
|
72
|
+
reasons.push(`Hypothesis miss: agreement ${pct(agreement)} < ${pct(AGREEMENT_HYPOTHESIS)}.`);
|
|
73
|
+
}
|
|
74
|
+
if (verdict === "PASS") {
|
|
75
|
+
reasons.push(`Dry-run heuristic agrees with human labels on ${agreed}/${total} (${pct(agreement)}), beats chance (${pct(CHANCE_BASELINE)}) and naive if-else (${pct(naiveAgreement)}), unstable ${pct(unstableRate)}.`);
|
|
76
|
+
reasons.push("Live Jev Choice was not scored (no TYPESAFE_API_KEY in this eval). Hypothesis for live Jev remains GRAY.");
|
|
77
|
+
}
|
|
78
|
+
return {
|
|
79
|
+
total,
|
|
80
|
+
agreed,
|
|
81
|
+
agreement,
|
|
82
|
+
naiveAgreed,
|
|
83
|
+
naiveAgreement,
|
|
84
|
+
chance: CHANCE_BASELINE,
|
|
85
|
+
unstable,
|
|
86
|
+
unstableRate,
|
|
87
|
+
disagreements,
|
|
88
|
+
verdict,
|
|
89
|
+
reasons,
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
export function pct(value) {
|
|
93
|
+
return `${(value * 100).toFixed(1)}%`;
|
|
94
|
+
}
|
|
95
|
+
export function renderResultsMd(result) {
|
|
96
|
+
const rows = result.disagreements.length
|
|
97
|
+
? result.disagreements
|
|
98
|
+
.map((item) => `| ${item.id} | ${item.expected} | ${item.got} | ${item.flavor} |`)
|
|
99
|
+
.join("\n")
|
|
100
|
+
: "| _none_ | | | |";
|
|
101
|
+
return `# POC C — suite triage eval
|
|
102
|
+
|
|
103
|
+
## Verdict
|
|
104
|
+
|
|
105
|
+
| Surface | Verdict | Why |
|
|
106
|
+
| --- | --- | --- |
|
|
107
|
+
| Dry-run heuristic stub | **${result.verdict}** | ${result.agreed}/${result.total} (${pct(result.agreement)}) vs ≥80%; unstable ${pct(result.unstableRate)} |
|
|
108
|
+
| Live Jev Choice | **GRAY** | TYPESAFE_API_KEY unset; System One was not scored |
|
|
109
|
+
| Hypothesis as stated (Jev ≥80%) | **GRAY** | Needs a live key run on the same fixtures |
|
|
110
|
+
|
|
111
|
+
Kill not triggered on the stub: agreement is above chance (${pct(result.chance)}) and naive if-else (${pct(result.naiveAgreement)}); instability is below 30%.
|
|
112
|
+
|
|
113
|
+
Hypothesis: a Jev Choice among {retry, escalate, ignore, rewrite-locator} agrees with a human-labeled judgment ≥80% on a small fixture set.
|
|
114
|
+
|
|
115
|
+
| Metric | Value |
|
|
116
|
+
| --- | --- |
|
|
117
|
+
| Cases | ${result.total} |
|
|
118
|
+
| Heuristic agreement | ${result.agreed}/${result.total} (${pct(result.agreement)}) |
|
|
119
|
+
| Naive if-else agreement | ${result.naiveAgreed}/${result.total} (${pct(result.naiveAgreement)}) |
|
|
120
|
+
| Chance (4-way) | ${pct(result.chance)} |
|
|
121
|
+
| Unstable (2 identical runs) | ${result.unstable}/${result.total} (${pct(result.unstableRate)}) |
|
|
122
|
+
| Live Jev | not scored (TYPESAFE_API_KEY unset) |
|
|
123
|
+
|
|
124
|
+
## Reasons
|
|
125
|
+
|
|
126
|
+
${result.reasons.map((line) => `- ${line}`).join("\n")}
|
|
127
|
+
|
|
128
|
+
## Sample disagreements
|
|
129
|
+
|
|
130
|
+
| ID | Expected | Got | Flavor |
|
|
131
|
+
| --- | --- | --- | --- |
|
|
132
|
+
${rows}
|
|
133
|
+
|
|
134
|
+
## How to reproduce
|
|
135
|
+
|
|
136
|
+
\`\`\`bash
|
|
137
|
+
npm run eval:triage
|
|
138
|
+
tocket suite triage --from fixtures/triage/last-run.json --include-low-confidence --dry-run
|
|
139
|
+
\`\`\`
|
|
140
|
+
`;
|
|
141
|
+
}
|
|
142
|
+
function repoRoot() {
|
|
143
|
+
return join(import.meta.dirname, "..", "..");
|
|
144
|
+
}
|
|
145
|
+
function main() {
|
|
146
|
+
const root = repoRoot();
|
|
147
|
+
const lastRunPath = join(root, "fixtures", "triage", "last-run.json");
|
|
148
|
+
const expectedPath = join(root, "fixtures", "triage-expected.json");
|
|
149
|
+
const result = evaluateTriage(lastRunPath, expectedPath);
|
|
150
|
+
const md = renderResultsMd(result);
|
|
151
|
+
const outPath = join(root, "fixtures", "triage", "results.md");
|
|
152
|
+
mkdirSync(dirname(outPath), { recursive: true });
|
|
153
|
+
writeFileSync(outPath, md, "utf-8");
|
|
154
|
+
console.log(`agreement ${result.agreed}/${result.total} (${pct(result.agreement)})`);
|
|
155
|
+
console.log(`naive ${result.naiveAgreed}/${result.total} (${pct(result.naiveAgreement)})`);
|
|
156
|
+
console.log(`chance ${pct(result.chance)}`);
|
|
157
|
+
console.log(`unstable ${result.unstable}/${result.total} (${pct(result.unstableRate)})`);
|
|
158
|
+
console.log(`verdict ${result.verdict}`);
|
|
159
|
+
if (result.disagreements.length > 0) {
|
|
160
|
+
console.log("disagreements:");
|
|
161
|
+
for (const item of result.disagreements) {
|
|
162
|
+
console.log(` ${item.id}: expected ${item.expected}, got ${item.got} (${item.flavor})`);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
console.log(`wrote ${outPath}`);
|
|
166
|
+
if (result.verdict === "FAIL") {
|
|
167
|
+
process.exitCode = 1;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
const invoked = process.argv[1]?.includes("triage-eval");
|
|
171
|
+
if (invoked) {
|
|
172
|
+
main();
|
|
173
|
+
}
|
|
174
|
+
//# sourceMappingURL=triage-eval.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"triage-eval.js","sourceRoot":"","sources":["../../src/eval/triage-eval.ts"],"names":[],"mappings":";AACA;;;;GAIG;AAEH,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,aAAa,GAEd,MAAM,oBAAoB,CAAC;AAE5B,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,CAAC;AACxC,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,CAAC;AAClC,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,CAAC;AAsCpC,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,CAAiB,CAAC;AACjE,CAAC;AAED,MAAM,UAAU,cAAc,CAC5B,WAAmB,EACnB,YAAoB;IAEpB,MAAM,QAAQ,GAAG,YAAY,CAAC,YAAY,CAAC,CAAC;IAC5C,MAAM,GAAG,GAAG,YAAY,CAAC,YAAY,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC;IAC7D,MAAM,QAAQ,GAAG,aAAa,CAAC,GAAG,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC;IACrE,MAAM,KAAK,GA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Ac,IAAI,CAAC,QAAQ,SAAS,IAAI,CAAC,GAAG,KAAK,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;QAC3F,CAAC;IACH,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,SAAS,OAAO,EAAE,CAAC,CAAC;IAEhC,IAAI,MAAM,CAAC,OAAO,KAAK,MAAM,EAAE,CAAC;QAC9B,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACvB,CAAC;AACH,CAAC;AAED,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,aAAa,CAAC,CAAC;AACzD,IAAI,OAAO,EAAE,CAAC;IACZ,IAAI,EAAE,CAAC;AACT,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -12,11 +12,18 @@ import { registerFocusCommand } from "./commands/focus.cmd.js";
|
|
|
12
12
|
import { registerStatusCommand } from "./commands/status.cmd.js";
|
|
13
13
|
import { registerDoctorCommand } from "./commands/doctor.cmd.js";
|
|
14
14
|
import { registerLintCommand } from "./commands/lint.cmd.js";
|
|
15
|
+
import { registerDiffCommand } from "./commands/diff.cmd.js";
|
|
16
|
+
import { registerHandoffCommand } from "./commands/handoff.cmd.js";
|
|
17
|
+
import { registerAgentsMdCommand } from "./commands/agents-md.cmd.js";
|
|
18
|
+
import { registerScaffoldCommand } from "./commands/scaffold.cmd.js";
|
|
19
|
+
import { registerSuiteCommand } from "./commands/suite.cmd.js";
|
|
20
|
+
import { registerDecideCommand } from "./commands/decide.cmd.js";
|
|
21
|
+
import { registerWorkCommand } from "./commands/work.cmd.js";
|
|
15
22
|
const pkg = JSON.parse(readFileSync(join(import.meta.dirname, "..", "package.json"), "utf-8"));
|
|
16
23
|
const program = new Command();
|
|
17
24
|
program
|
|
18
25
|
.name("tocket")
|
|
19
|
-
.description("
|
|
26
|
+
.description("Shared project notebook (.context/). decide writes the next move; workers execute.")
|
|
20
27
|
.version(pkg.version);
|
|
21
28
|
registerInitCommand(program);
|
|
22
29
|
registerGenerateCommand(program);
|
|
@@ -28,6 +35,13 @@ registerFocusCommand(program);
|
|
|
28
35
|
registerStatusCommand(program);
|
|
29
36
|
registerDoctorCommand(program);
|
|
30
37
|
registerLintCommand(program);
|
|
38
|
+
registerDiffCommand(program);
|
|
39
|
+
registerHandoffCommand(program);
|
|
40
|
+
registerAgentsMdCommand(program);
|
|
41
|
+
registerScaffoldCommand(program);
|
|
42
|
+
registerSuiteCommand(program);
|
|
43
|
+
registerDecideCommand(program);
|
|
44
|
+
registerWorkCommand(program);
|
|
31
45
|
// No-args: show interactive dashboard (TTY) or help (non-TTY)
|
|
32
46
|
const args = process.argv.slice(2);
|
|
33
47
|
if (args.length === 0 && process.stdin.isTTY) {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,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AAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACnC,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;IAC7C,MAAM,EAAE,aAAa,EAAE,GAAG,MAAM,MAAM,CAAC,yBAAyB,CAAC,CAAC;IAClE,MAAM,aAAa,CAAC,OAAO,CAAC,CAAC;AAC/B,CAAC;KAAM,CAAC;IACN,OAAO,CAAC,KAAK,EAAE,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/mcp/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IAC5B,OAAO,CAAC,KAAK,CAAC,6BAA6B,EAAE,KAAK,CAAC,CAAC;IACpD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
2
|
+
import { ListToolsRequestSchema, CallToolRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
3
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
4
|
+
import { existsSync, readFileSync, writeFileSync, readdirSync, statSync } from "node:fs";
|
|
5
|
+
import { join } from "node:path";
|
|
6
|
+
/**
|
|
7
|
+
* Context file names that can be read/written
|
|
8
|
+
*/
|
|
9
|
+
const CONTEXT_FILES = [
|
|
10
|
+
"activeContext.md",
|
|
11
|
+
"systemPatterns.md",
|
|
12
|
+
"techContext.md",
|
|
13
|
+
"productContext.md",
|
|
14
|
+
"progress.md",
|
|
15
|
+
];
|
|
16
|
+
/**
|
|
17
|
+
* Validate and normalize context file name
|
|
18
|
+
*/
|
|
19
|
+
function isValidContextFile(file) {
|
|
20
|
+
return CONTEXT_FILES.includes(file);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Get absolute path to context directory
|
|
24
|
+
*/
|
|
25
|
+
function getContextDir() {
|
|
26
|
+
const cwd = process.cwd();
|
|
27
|
+
return join(cwd, ".context");
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Get absolute path to a context file
|
|
31
|
+
*/
|
|
32
|
+
function getContextFilePath(file) {
|
|
33
|
+
return join(getContextDir(), file);
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Check if a file exists in the context directory
|
|
37
|
+
*/
|
|
38
|
+
function contextFileExists(file) {
|
|
39
|
+
return existsSync(getContextFilePath(file));
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Get list of all available context files in the workspace
|
|
43
|
+
*/
|
|
44
|
+
function getAvailableContextFiles() {
|
|
45
|
+
const contextDir = getContextDir();
|
|
46
|
+
if (!existsSync(contextDir)) {
|
|
47
|
+
return [];
|
|
48
|
+
}
|
|
49
|
+
return readdirSync(contextDir)
|
|
50
|
+
.filter((f) => f.endsWith(".md"))
|
|
51
|
+
.sort();
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Get list of all Tocket-managed files in the workspace
|
|
55
|
+
*/
|
|
56
|
+
function getTocketManagedFiles() {
|
|
57
|
+
const cwd = process.cwd();
|
|
58
|
+
const files = [];
|
|
59
|
+
// Add .context files
|
|
60
|
+
const contextDir = getContextDir();
|
|
61
|
+
if (existsSync(contextDir)) {
|
|
62
|
+
const contextFiles = readdirSync(contextDir);
|
|
63
|
+
contextFiles.forEach((f) => {
|
|
64
|
+
files.push(`.context/${f}`);
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
// Add TOCKET.md
|
|
68
|
+
if (existsSync(join(cwd, "TOCKET.md"))) {
|
|
69
|
+
files.push("TOCKET.md");
|
|
70
|
+
}
|
|
71
|
+
// Add agent config files
|
|
72
|
+
const agentFiles = ["CLAUDE.md", "GEMINI.md", "ARCHITECT.md"];
|
|
73
|
+
agentFiles.forEach((f) => {
|
|
74
|
+
if (existsSync(join(cwd, f))) {
|
|
75
|
+
files.push(f);
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
return files.sort();
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Compute workspace status
|
|
82
|
+
*/
|
|
83
|
+
function getWorkspaceStatus() {
|
|
84
|
+
const cwd = process.cwd();
|
|
85
|
+
const contextDir = getContextDir();
|
|
86
|
+
const hasWorkspace = existsSync(contextDir);
|
|
87
|
+
let currentFocus = "";
|
|
88
|
+
let stalenessHours = null;
|
|
89
|
+
if (hasWorkspace && contextFileExists("activeContext.md")) {
|
|
90
|
+
try {
|
|
91
|
+
const content = readFileSync(getContextFilePath("activeContext.md"), "utf-8");
|
|
92
|
+
// Extract current focus from "## Current Focus" section
|
|
93
|
+
const focusMatch = content.match(/## Current Focus\s*\n+(.+)/);
|
|
94
|
+
if (focusMatch?.[1]) {
|
|
95
|
+
const line = focusMatch[1].trim();
|
|
96
|
+
if (!line.startsWith("_") && !line.includes("No active tasks")) {
|
|
97
|
+
currentFocus = line.length > 100 ? line.substring(0, 97) + "..." : line;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
// Compute staleness in hours
|
|
101
|
+
const stats = statSync(getContextFilePath("activeContext.md"));
|
|
102
|
+
stalenessHours = Math.floor((Date.now() - stats.mtimeMs) / (1000 * 60 * 60));
|
|
103
|
+
}
|
|
104
|
+
catch (e) {
|
|
105
|
+
// Ignore errors reading activeContext
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
// Try to extract project name from package.json
|
|
109
|
+
let projectName = "unknown";
|
|
110
|
+
try {
|
|
111
|
+
const pkgPath = join(cwd, "package.json");
|
|
112
|
+
if (existsSync(pkgPath)) {
|
|
113
|
+
const pkg = JSON.parse(readFileSync(pkgPath, "utf-8"));
|
|
114
|
+
projectName = pkg.name || "unknown";
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
catch (e) {
|
|
118
|
+
// Ignore errors
|
|
119
|
+
}
|
|
120
|
+
return {
|
|
121
|
+
projectName,
|
|
122
|
+
currentFocus,
|
|
123
|
+
hasWorkspace,
|
|
124
|
+
stalenessHours,
|
|
125
|
+
contextFiles: getAvailableContextFiles(),
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Start the MCP server
|
|
130
|
+
*/
|
|
131
|
+
export async function startServer() {
|
|
132
|
+
const server = new Server({
|
|
133
|
+
name: "tocket-context-server",
|
|
134
|
+
version: "1.0.0",
|
|
135
|
+
});
|
|
136
|
+
/**
|
|
137
|
+
* List available tools
|
|
138
|
+
*/
|
|
139
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
140
|
+
const tools = [
|
|
141
|
+
{
|
|
142
|
+
name: "tocket_read_context",
|
|
143
|
+
description: "Read the contents of a .context/ file (activeContext, systemPatterns, techContext, productContext, or progress)",
|
|
144
|
+
inputSchema: {
|
|
145
|
+
type: "object",
|
|
146
|
+
properties: {
|
|
147
|
+
file: {
|
|
148
|
+
type: "string",
|
|
149
|
+
enum: CONTEXT_FILES,
|
|
150
|
+
description: "The context file to read",
|
|
151
|
+
},
|
|
152
|
+
},
|
|
153
|
+
required: ["file"],
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
name: "tocket_update_context",
|
|
158
|
+
description: "Update the contents of a .context/ file",
|
|
159
|
+
inputSchema: {
|
|
160
|
+
type: "object",
|
|
161
|
+
properties: {
|
|
162
|
+
file: {
|
|
163
|
+
type: "string",
|
|
164
|
+
enum: CONTEXT_FILES,
|
|
165
|
+
description: "The context file to update",
|
|
166
|
+
},
|
|
167
|
+
content: {
|
|
168
|
+
type: "string",
|
|
169
|
+
description: "The new content to write to the file",
|
|
170
|
+
},
|
|
171
|
+
},
|
|
172
|
+
required: ["file", "content"],
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
name: "tocket_get_status",
|
|
177
|
+
description: "Get a summary of the current Tocket workspace (project name, focus, staleness, file list)",
|
|
178
|
+
inputSchema: {
|
|
179
|
+
type: "object",
|
|
180
|
+
properties: {},
|
|
181
|
+
},
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
name: "tocket_read_protocol",
|
|
185
|
+
description: "Read the full Tocket protocol specification (TOCKET.md)",
|
|
186
|
+
inputSchema: {
|
|
187
|
+
type: "object",
|
|
188
|
+
properties: {},
|
|
189
|
+
},
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
name: "tocket_list_files",
|
|
193
|
+
description: "List all Tocket-managed files (.context files, TOCKET.md, agent config files)",
|
|
194
|
+
inputSchema: {
|
|
195
|
+
type: "object",
|
|
196
|
+
properties: {},
|
|
197
|
+
},
|
|
198
|
+
},
|
|
199
|
+
];
|
|
200
|
+
return { tools };
|
|
201
|
+
});
|
|
202
|
+
/**
|
|
203
|
+
* Handle tool calls
|
|
204
|
+
*/
|
|
205
|
+
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
206
|
+
const { name, arguments: args } = request.params;
|
|
207
|
+
const typedArgs = (args ?? {});
|
|
208
|
+
try {
|
|
209
|
+
switch (name) {
|
|
210
|
+
case "tocket_read_context": {
|
|
211
|
+
const file = typedArgs.file;
|
|
212
|
+
if (!isValidContextFile(file)) {
|
|
213
|
+
return {
|
|
214
|
+
content: [
|
|
215
|
+
{
|
|
216
|
+
type: "text",
|
|
217
|
+
text: `Invalid context file: ${file}. Valid files are: ${CONTEXT_FILES.join(", ")}`,
|
|
218
|
+
},
|
|
219
|
+
],
|
|
220
|
+
isError: true,
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
if (!contextFileExists(file)) {
|
|
224
|
+
return {
|
|
225
|
+
content: [
|
|
226
|
+
{
|
|
227
|
+
type: "text",
|
|
228
|
+
text: `Context file not found: ${file}`,
|
|
229
|
+
},
|
|
230
|
+
],
|
|
231
|
+
isError: true,
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
const content = readFileSync(getContextFilePath(file), "utf-8");
|
|
235
|
+
return {
|
|
236
|
+
content: [
|
|
237
|
+
{
|
|
238
|
+
type: "text",
|
|
239
|
+
text: content,
|
|
240
|
+
},
|
|
241
|
+
],
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
case "tocket_update_context": {
|
|
245
|
+
const file = typedArgs.file;
|
|
246
|
+
const content = typedArgs.content;
|
|
247
|
+
if (!isValidContextFile(file)) {
|
|
248
|
+
return {
|
|
249
|
+
content: [
|
|
250
|
+
{
|
|
251
|
+
type: "text",
|
|
252
|
+
text: `Invalid context file: ${file}. Valid files are: ${CONTEXT_FILES.join(", ")}`,
|
|
253
|
+
},
|
|
254
|
+
],
|
|
255
|
+
isError: true,
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
if (!content || typeof content !== "string") {
|
|
259
|
+
return {
|
|
260
|
+
content: [
|
|
261
|
+
{
|
|
262
|
+
type: "text",
|
|
263
|
+
text: "Content must be a non-empty string",
|
|
264
|
+
},
|
|
265
|
+
],
|
|
266
|
+
isError: true,
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
const filePath = getContextFilePath(file);
|
|
270
|
+
writeFileSync(filePath, content, "utf-8");
|
|
271
|
+
return {
|
|
272
|
+
content: [
|
|
273
|
+
{
|
|
274
|
+
type: "text",
|
|
275
|
+
text: `Successfully updated ${file} (${content.length} bytes)`,
|
|
276
|
+
},
|
|
277
|
+
],
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
case "tocket_get_status": {
|
|
281
|
+
const status = getWorkspaceStatus();
|
|
282
|
+
const statusText = `Project: ${status.projectName}
|
|
283
|
+
Has Workspace: ${status.hasWorkspace}
|
|
284
|
+
Current Focus: ${status.currentFocus || "(none)"}
|
|
285
|
+
Staleness: ${status.stalenessHours !== null ? `${status.stalenessHours} hours ago` : "N/A"}
|
|
286
|
+
Context Files: ${status.contextFiles.length > 0 ? status.contextFiles.join(", ") : "none"}`;
|
|
287
|
+
return {
|
|
288
|
+
content: [
|
|
289
|
+
{
|
|
290
|
+
type: "text",
|
|
291
|
+
text: statusText,
|
|
292
|
+
},
|
|
293
|
+
],
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
case "tocket_read_protocol": {
|
|
297
|
+
const cwd = process.cwd();
|
|
298
|
+
const protocolPath = join(cwd, "TOCKET.md");
|
|
299
|
+
if (!existsSync(protocolPath)) {
|
|
300
|
+
return {
|
|
301
|
+
content: [
|
|
302
|
+
{
|
|
303
|
+
type: "text",
|
|
304
|
+
text: "TOCKET.md protocol file not found in the current directory",
|
|
305
|
+
},
|
|
306
|
+
],
|
|
307
|
+
isError: true,
|
|
308
|
+
};
|
|
309
|
+
}
|
|
310
|
+
const content = readFileSync(protocolPath, "utf-8");
|
|
311
|
+
return {
|
|
312
|
+
content: [
|
|
313
|
+
{
|
|
314
|
+
type: "text",
|
|
315
|
+
text: content,
|
|
316
|
+
},
|
|
317
|
+
],
|
|
318
|
+
};
|
|
319
|
+
}
|
|
320
|
+
case "tocket_list_files": {
|
|
321
|
+
const files = getTocketManagedFiles();
|
|
322
|
+
return {
|
|
323
|
+
content: [
|
|
324
|
+
{
|
|
325
|
+
type: "text",
|
|
326
|
+
text: files.length > 0 ? files.join("\n") : "(no Tocket files found)",
|
|
327
|
+
},
|
|
328
|
+
],
|
|
329
|
+
};
|
|
330
|
+
}
|
|
331
|
+
default:
|
|
332
|
+
return {
|
|
333
|
+
content: [
|
|
334
|
+
{
|
|
335
|
+
type: "text",
|
|
336
|
+
text: `Unknown tool: ${name}`,
|
|
337
|
+
},
|
|
338
|
+
],
|
|
339
|
+
isError: true,
|
|
340
|
+
};
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
catch (error) {
|
|
344
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
345
|
+
return {
|
|
346
|
+
content: [
|
|
347
|
+
{
|
|
348
|
+
type: "text",
|
|
349
|
+
text: `Error: ${errorMessage}`,
|
|
350
|
+
},
|
|
351
|
+
],
|
|
352
|
+
isError: true,
|
|
353
|
+
};
|
|
354
|
+
}
|
|
355
|
+
});
|
|
356
|
+
// Start the server on stdio
|
|
357
|
+
const transport = new StdioServerTransport();
|
|
358
|
+
await server.connect(transport);
|
|
359
|
+
}
|
|
360
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/mcp/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EACL,sBAAsB,EACtB,qBAAqB,GAEtB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACzF,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC;;GAEG;AACH,MAAM,aAAa,GAAG;IACpB,kBAAkB;IAClB,mBAAmB;IACnB,gBAAgB;IAChB,mBAAmB;IACnB,aAAa;CACL,CAAC;AAIX;;GAEG;AACH,SAAS,kBAAkB,CAAC,IAAY;IACtC,OAAO,aAAa,CAAC,QAAQ,CAAC,IAAmB,CAAC,CAAC;AACrD,CAAC;AAED;;GAEG;AACH,SAAS,aAAa;IACpB,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAC1B,OAAO,IAAI,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;AAC/B,CAAC;AAED;;GAEG;AACH,SAAS,kBAAkB,CAAC,IAAiB;IAC3C,OAAO,IAAI,CAAC,aAAa,EAAE,EAAE,IAAI,CAAC,CAAC;AACrC,CAAC;AAED;;GAEG;A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IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAClC,CAAC"}
|
|
@@ -18,3 +18,14 @@ export declare const techContextMd: (projectName: string, stack?: StackInfo) =>
|
|
|
18
18
|
export declare const progressMd: (projectName: string) => string;
|
|
19
19
|
export declare const cursorrulesMd: (projectName: string, description: string, architectFile?: string) => string;
|
|
20
20
|
export declare const tocketMd: (projectName: string, executorFile?: string, architectFile?: string) => string;
|
|
21
|
+
/** Shared decide/work/gate rules for AGENTS.md (init template and `tocket agents-md`). */
|
|
22
|
+
export declare function agentsProtocolSection(): string;
|
|
23
|
+
export declare const agentsMd: (projectName: string, description: string, executorName?: string, architectName?: string) => string;
|
|
24
|
+
/** Official portable skill for Cursor / Claude / Codex. Written by `tocket init`. */
|
|
25
|
+
export declare const TOCKET_SKILL_REL = ".agents/skills/tocket/SKILL.md";
|
|
26
|
+
/** Catalog path so `npx skills add pedrocivita/tocket --skill tocket` can discover it. */
|
|
27
|
+
export declare const TOCKET_SKILL_CATALOG_REL = "skills/tocket/SKILL.md";
|
|
28
|
+
export declare const TOCKET_SKILLS_ADD = "npx skills add pedrocivita/tocket --skill tocket";
|
|
29
|
+
export declare const TOCKET_AGENT_PHRASE = "Before expensive tools: tocket decide --dry-run, or read .context/decisions/.";
|
|
30
|
+
export declare function tocketConventionsHint(): string;
|
|
31
|
+
export declare const tocketSkillMd: () => string;
|