@opensip-cli/mcp 0.1.15
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/LICENSE +202 -0
- package/NOTICE +8 -0
- package/README.md +33 -0
- package/dist/__tests__/command-transport.test.d.ts +13 -0
- package/dist/__tests__/command-transport.test.d.ts.map +1 -0
- package/dist/__tests__/command-transport.test.js +63 -0
- package/dist/__tests__/command-transport.test.js.map +1 -0
- package/dist/__tests__/e2e-stdio.test.d.ts +16 -0
- package/dist/__tests__/e2e-stdio.test.d.ts.map +1 -0
- package/dist/__tests__/e2e-stdio.test.js +271 -0
- package/dist/__tests__/e2e-stdio.test.js.map +1 -0
- package/dist/__tests__/freshness.test.d.ts +9 -0
- package/dist/__tests__/freshness.test.d.ts.map +1 -0
- package/dist/__tests__/freshness.test.js +78 -0
- package/dist/__tests__/freshness.test.js.map +1 -0
- package/dist/__tests__/integration.test.d.ts +20 -0
- package/dist/__tests__/integration.test.d.ts.map +1 -0
- package/dist/__tests__/integration.test.js +178 -0
- package/dist/__tests__/integration.test.js.map +1 -0
- package/dist/__tests__/register-mcp-graph-adapters.test.d.ts +12 -0
- package/dist/__tests__/register-mcp-graph-adapters.test.d.ts.map +1 -0
- package/dist/__tests__/register-mcp-graph-adapters.test.js +47 -0
- package/dist/__tests__/register-mcp-graph-adapters.test.js.map +1 -0
- package/dist/__tests__/session-results-read-port.test.d.ts +13 -0
- package/dist/__tests__/session-results-read-port.test.d.ts.map +1 -0
- package/dist/__tests__/session-results-read-port.test.js +151 -0
- package/dist/__tests__/session-results-read-port.test.js.map +1 -0
- package/dist/__tests__/sqlite-graph-read-port.test.d.ts +12 -0
- package/dist/__tests__/sqlite-graph-read-port.test.d.ts.map +1 -0
- package/dist/__tests__/sqlite-graph-read-port.test.js +322 -0
- package/dist/__tests__/sqlite-graph-read-port.test.js.map +1 -0
- package/dist/__tests__/tool-descriptor.test.d.ts +9 -0
- package/dist/__tests__/tool-descriptor.test.d.ts.map +1 -0
- package/dist/__tests__/tool-descriptor.test.js +55 -0
- package/dist/__tests__/tool-descriptor.test.js.map +1 -0
- package/dist/catalog-generation.d.ts +22 -0
- package/dist/catalog-generation.d.ts.map +1 -0
- package/dist/catalog-generation.js +21 -0
- package/dist/catalog-generation.js.map +1 -0
- package/dist/command.d.ts +3 -0
- package/dist/command.d.ts.map +1 -0
- package/dist/command.js +111 -0
- package/dist/command.js.map +1 -0
- package/dist/freshness.d.ts +50 -0
- package/dist/freshness.d.ts.map +1 -0
- package/dist/freshness.js +96 -0
- package/dist/freshness.js.map +1 -0
- package/dist/graph-read-port.d.ts +111 -0
- package/dist/graph-read-port.d.ts.map +1 -0
- package/dist/graph-read-port.js +16 -0
- package/dist/graph-read-port.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp-error.d.ts +15 -0
- package/dist/mcp-error.d.ts.map +1 -0
- package/dist/mcp-error.js +5 -0
- package/dist/mcp-error.js.map +1 -0
- package/dist/register-mcp-graph-adapters.d.ts +3 -0
- package/dist/register-mcp-graph-adapters.d.ts.map +1 -0
- package/dist/register-mcp-graph-adapters.js +21 -0
- package/dist/register-mcp-graph-adapters.js.map +1 -0
- package/dist/result-dto.d.ts +63 -0
- package/dist/result-dto.d.ts.map +1 -0
- package/dist/result-dto.js +11 -0
- package/dist/result-dto.js.map +1 -0
- package/dist/results-read-port.d.ts +43 -0
- package/dist/results-read-port.d.ts.map +1 -0
- package/dist/results-read-port.js +13 -0
- package/dist/results-read-port.js.map +1 -0
- package/dist/server.d.ts +84 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +153 -0
- package/dist/server.js.map +1 -0
- package/dist/session-results-read-port.d.ts +42 -0
- package/dist/session-results-read-port.d.ts.map +1 -0
- package/dist/session-results-read-port.js +147 -0
- package/dist/session-results-read-port.js.map +1 -0
- package/dist/sqlite-graph-read-port.d.ts +88 -0
- package/dist/sqlite-graph-read-port.d.ts.map +1 -0
- package/dist/sqlite-graph-read-port.js +304 -0
- package/dist/sqlite-graph-read-port.js.map +1 -0
- package/dist/symbol-dto.d.ts +58 -0
- package/dist/symbol-dto.d.ts.map +1 -0
- package/dist/symbol-dto.js +12 -0
- package/dist/symbol-dto.js.map +1 -0
- package/dist/tool.d.ts +6 -0
- package/dist/tool.d.ts.map +1 -0
- package/dist/tool.js +33 -0
- package/dist/tool.js.map +1 -0
- package/dist/tools/__tests__/graph-handlers.test.d.ts +11 -0
- package/dist/tools/__tests__/graph-handlers.test.d.ts.map +1 -0
- package/dist/tools/__tests__/graph-handlers.test.js +415 -0
- package/dist/tools/__tests__/graph-handlers.test.js.map +1 -0
- package/dist/tools/__tests__/graph-walk.test.d.ts +9 -0
- package/dist/tools/__tests__/graph-walk.test.d.ts.map +1 -0
- package/dist/tools/__tests__/graph-walk.test.js +72 -0
- package/dist/tools/__tests__/graph-walk.test.js.map +1 -0
- package/dist/tools/__tests__/refresh-graph.test.d.ts +11 -0
- package/dist/tools/__tests__/refresh-graph.test.d.ts.map +1 -0
- package/dist/tools/__tests__/refresh-graph.test.js +100 -0
- package/dist/tools/__tests__/refresh-graph.test.js.map +1 -0
- package/dist/tools/__tests__/result-handlers.test.d.ts +9 -0
- package/dist/tools/__tests__/result-handlers.test.d.ts.map +1 -0
- package/dist/tools/__tests__/result-handlers.test.js +194 -0
- package/dist/tools/__tests__/result-handlers.test.js.map +1 -0
- package/dist/tools/__tests__/schemas.test.d.ts +10 -0
- package/dist/tools/__tests__/schemas.test.d.ts.map +1 -0
- package/dist/tools/__tests__/schemas.test.js +73 -0
- package/dist/tools/__tests__/schemas.test.js.map +1 -0
- package/dist/tools/blast-radius.d.ts +12 -0
- package/dist/tools/blast-radius.d.ts.map +1 -0
- package/dist/tools/blast-radius.js +33 -0
- package/dist/tools/blast-radius.js.map +1 -0
- package/dist/tools/call-walk-tool.d.ts +17 -0
- package/dist/tools/call-walk-tool.d.ts.map +1 -0
- package/dist/tools/call-walk-tool.js +46 -0
- package/dist/tools/call-walk-tool.js.map +1 -0
- package/dist/tools/callees-of.d.ts +12 -0
- package/dist/tools/callees-of.d.ts.map +1 -0
- package/dist/tools/callees-of.js +20 -0
- package/dist/tools/callees-of.js.map +1 -0
- package/dist/tools/find-dead-code.d.ts +11 -0
- package/dist/tools/find-dead-code.d.ts.map +1 -0
- package/dist/tools/find-dead-code.js +26 -0
- package/dist/tools/find-dead-code.js.map +1 -0
- package/dist/tools/get-agent-catalog.d.ts +12 -0
- package/dist/tools/get-agent-catalog.d.ts.map +1 -0
- package/dist/tools/get-agent-catalog.js +23 -0
- package/dist/tools/get-agent-catalog.js.map +1 -0
- package/dist/tools/get-architecture.d.ts +11 -0
- package/dist/tools/get-architecture.d.ts.map +1 -0
- package/dist/tools/get-architecture.js +26 -0
- package/dist/tools/get-architecture.js.map +1 -0
- package/dist/tools/get-latest-findings.d.ts +13 -0
- package/dist/tools/get-latest-findings.d.ts.map +1 -0
- package/dist/tools/get-latest-findings.js +38 -0
- package/dist/tools/get-latest-findings.js.map +1 -0
- package/dist/tools/get-symbol.d.ts +18 -0
- package/dist/tools/get-symbol.d.ts.map +1 -0
- package/dist/tools/get-symbol.js +44 -0
- package/dist/tools/get-symbol.js.map +1 -0
- package/dist/tools/graph-walk.d.ts +50 -0
- package/dist/tools/graph-walk.d.ts.map +1 -0
- package/dist/tools/graph-walk.js +89 -0
- package/dist/tools/graph-walk.js.map +1 -0
- package/dist/tools/list-runs.d.ts +11 -0
- package/dist/tools/list-runs.d.ts.map +1 -0
- package/dist/tools/list-runs.js +37 -0
- package/dist/tools/list-runs.js.map +1 -0
- package/dist/tools/refresh-graph.d.ts +22 -0
- package/dist/tools/refresh-graph.d.ts.map +1 -0
- package/dist/tools/refresh-graph.js +75 -0
- package/dist/tools/refresh-graph.js.map +1 -0
- package/dist/tools/register.d.ts +13 -0
- package/dist/tools/register.d.ts.map +1 -0
- package/dist/tools/register.js +40 -0
- package/dist/tools/register.js.map +1 -0
- package/dist/tools/schemas.d.ts +54 -0
- package/dist/tools/schemas.d.ts.map +1 -0
- package/dist/tools/schemas.js +59 -0
- package/dist/tools/schemas.js.map +1 -0
- package/dist/tools/search-symbols.d.ts +12 -0
- package/dist/tools/search-symbols.d.ts.map +1 -0
- package/dist/tools/search-symbols.js +37 -0
- package/dist/tools/search-symbols.js.map +1 -0
- package/dist/tools/show-run.d.ts +12 -0
- package/dist/tools/show-run.d.ts.map +1 -0
- package/dist/tools/show-run.js +40 -0
- package/dist/tools/show-run.js.map +1 -0
- package/dist/tools/tool-result.d.ts +29 -0
- package/dist/tools/tool-result.d.ts.map +1 -0
- package/dist/tools/tool-result.js +39 -0
- package/dist/tools/tool-result.js.map +1 -0
- package/dist/tools/trace-path.d.ts +12 -0
- package/dist/tools/trace-path.d.ts.map +1 -0
- package/dist/tools/trace-path.js +57 -0
- package/dist/tools/trace-path.js.map +1 -0
- package/dist/tools/types.d.ts +20 -0
- package/dist/tools/types.d.ts.map +1 -0
- package/dist/tools/types.js +11 -0
- package/dist/tools/types.js.map +1 -0
- package/dist/tools/who-calls.d.ts +12 -0
- package/dist/tools/who-calls.d.ts.map +1 -0
- package/dist/tools/who-calls.js +21 -0
- package/dist/tools/who-calls.js.map +1 -0
- package/package.json +104 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Catalog freshness mapping (ADR-0084).
|
|
3
|
+
*
|
|
4
|
+
* Reuses the graph engine's `classifyCatalog` verdict (never a filesystem mtime
|
|
5
|
+
* heuristic outside the engine) and maps the `CatalogVerdict` to the agent-facing
|
|
6
|
+
* {@link Freshness} DTO. Building the `ValidationContext` from the working tree
|
|
7
|
+
* (current file set + adapter cache key) is the server's wiring concern (Phase 3),
|
|
8
|
+
* supplied to the SQLite port as an injected provider — this module is the pure
|
|
9
|
+
* verdict→DTO mapping.
|
|
10
|
+
*
|
|
11
|
+
* Missing catalog ⇒ `{ fresh: false, reason: 'missing' }` (no auto-build). A
|
|
12
|
+
* loaded catalog whose freshness cannot be verified (no context provider wired)
|
|
13
|
+
* is reported `fresh: true` with its `builtAt` — matching `opensip graph lookup`,
|
|
14
|
+
* which serves the persisted catalog without re-verification.
|
|
15
|
+
*/
|
|
16
|
+
import type { Freshness } from './symbol-dto.js';
|
|
17
|
+
import type { Catalog } from '@opensip-cli/graph';
|
|
18
|
+
import type { CatalogVerdict, ValidationContext } from '@opensip-cli/graph/internal';
|
|
19
|
+
/** Freshness for an absent catalog — empty data, explicit refresh required. */
|
|
20
|
+
export declare function missingFreshness(): Freshness;
|
|
21
|
+
/** Freshness for a loaded catalog whose staleness was not verified (no context). */
|
|
22
|
+
export declare function unverifiedFreshness(builtAt: string): Freshness;
|
|
23
|
+
/** Map a {@link CatalogVerdict} (+ the served catalog's `builtAt`) to {@link Freshness}. */
|
|
24
|
+
export declare function freshnessFromVerdict(verdict: CatalogVerdict, builtAt: string): Freshness;
|
|
25
|
+
/** Classify a loaded catalog against the current working-tree context. */
|
|
26
|
+
export declare function classifyFreshness(catalog: Catalog, ctx: ValidationContext): Freshness;
|
|
27
|
+
/**
|
|
28
|
+
* Build the working-tree {@link ValidationContext} a real staleness check needs,
|
|
29
|
+
* derived from the catalog's OWN recorded inputs (Task 4.4).
|
|
30
|
+
*
|
|
31
|
+
* A fully-correct context (the one `runGraph`/the cache path builds) requires
|
|
32
|
+
* re-running discovery + the adapter `cacheKey` over the live tree. We implement
|
|
33
|
+
* the closest correct subset that needs no engine re-entry: the catalog persists
|
|
34
|
+
* its `filesFingerprint` (`<count>\n<path>|<mtime>|<size>` per file), so we
|
|
35
|
+
* recover the EXACT tracked file set (in the recorded order) and echo the
|
|
36
|
+
* catalog's own `language`/`cacheKey`. `classifyCatalog` then re-stats those
|
|
37
|
+
* files and recomputes the fingerprint — so any **mutated or deleted tracked
|
|
38
|
+
* file** flips the verdict to stale (`fresh === false`), which is what Phase 7
|
|
39
|
+
* asserts.
|
|
40
|
+
*
|
|
41
|
+
* Documented approximation: a brand-new source file (absent from the recorded
|
|
42
|
+
* set) is NOT detected as a staleness trigger without re-running discovery; and
|
|
43
|
+
* a language/tsconfig change is not detected (we echo the cached key rather than
|
|
44
|
+
* recomputing it). Those are catalog-additive changes the explicit `refresh_graph`
|
|
45
|
+
* op resolves. Mutations/deletions of tracked files — the common drift — ARE
|
|
46
|
+
* detected. Returns `undefined` when the catalog carries no fingerprint (older
|
|
47
|
+
* builds), leaving the port on its unverified-fresh fallback.
|
|
48
|
+
*/
|
|
49
|
+
export declare function workingTreeContextFromCatalog(catalog: Catalog): ValidationContext | undefined;
|
|
50
|
+
//# sourceMappingURL=freshness.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"freshness.d.ts","sourceRoot":"","sources":["../src/freshness.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAErF,+EAA+E;AAC/E,wBAAgB,gBAAgB,IAAI,SAAS,CAE5C;AAED,oFAAoF;AACpF,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CAE9D;AAED,4FAA4F;AAC5F,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,GAAG,SAAS,CAgBxF;AAED,0EAA0E;AAC1E,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,iBAAiB,GAAG,SAAS,CAErF;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,6BAA6B,CAAC,OAAO,EAAE,OAAO,GAAG,iBAAiB,GAAG,SAAS,CAU7F"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Catalog freshness mapping (ADR-0084).
|
|
3
|
+
*
|
|
4
|
+
* Reuses the graph engine's `classifyCatalog` verdict (never a filesystem mtime
|
|
5
|
+
* heuristic outside the engine) and maps the `CatalogVerdict` to the agent-facing
|
|
6
|
+
* {@link Freshness} DTO. Building the `ValidationContext` from the working tree
|
|
7
|
+
* (current file set + adapter cache key) is the server's wiring concern (Phase 3),
|
|
8
|
+
* supplied to the SQLite port as an injected provider — this module is the pure
|
|
9
|
+
* verdict→DTO mapping.
|
|
10
|
+
*
|
|
11
|
+
* Missing catalog ⇒ `{ fresh: false, reason: 'missing' }` (no auto-build). A
|
|
12
|
+
* loaded catalog whose freshness cannot be verified (no context provider wired)
|
|
13
|
+
* is reported `fresh: true` with its `builtAt` — matching `opensip graph lookup`,
|
|
14
|
+
* which serves the persisted catalog without re-verification.
|
|
15
|
+
*/
|
|
16
|
+
import { classifyCatalog } from '@opensip-cli/graph/internal';
|
|
17
|
+
/** Freshness for an absent catalog — empty data, explicit refresh required. */
|
|
18
|
+
export function missingFreshness() {
|
|
19
|
+
return { fresh: false, reason: 'missing' };
|
|
20
|
+
}
|
|
21
|
+
/** Freshness for a loaded catalog whose staleness was not verified (no context). */
|
|
22
|
+
export function unverifiedFreshness(builtAt) {
|
|
23
|
+
return { fresh: true, builtAt };
|
|
24
|
+
}
|
|
25
|
+
/** Map a {@link CatalogVerdict} (+ the served catalog's `builtAt`) to {@link Freshness}. */
|
|
26
|
+
export function freshnessFromVerdict(verdict, builtAt) {
|
|
27
|
+
switch (verdict.kind) {
|
|
28
|
+
case 'valid': {
|
|
29
|
+
return { fresh: true, builtAt };
|
|
30
|
+
}
|
|
31
|
+
case 'incremental': {
|
|
32
|
+
return {
|
|
33
|
+
fresh: false,
|
|
34
|
+
builtAt,
|
|
35
|
+
reason: `stale: ${String(verdict.changedFiles.length)} file(s) changed since build`,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
case 'invalid': {
|
|
39
|
+
return { fresh: false, builtAt, reason: `stale: ${verdict.reason}` };
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
/** Classify a loaded catalog against the current working-tree context. */
|
|
44
|
+
export function classifyFreshness(catalog, ctx) {
|
|
45
|
+
return freshnessFromVerdict(classifyCatalog(catalog, ctx), catalog.builtAt);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Build the working-tree {@link ValidationContext} a real staleness check needs,
|
|
49
|
+
* derived from the catalog's OWN recorded inputs (Task 4.4).
|
|
50
|
+
*
|
|
51
|
+
* A fully-correct context (the one `runGraph`/the cache path builds) requires
|
|
52
|
+
* re-running discovery + the adapter `cacheKey` over the live tree. We implement
|
|
53
|
+
* the closest correct subset that needs no engine re-entry: the catalog persists
|
|
54
|
+
* its `filesFingerprint` (`<count>\n<path>|<mtime>|<size>` per file), so we
|
|
55
|
+
* recover the EXACT tracked file set (in the recorded order) and echo the
|
|
56
|
+
* catalog's own `language`/`cacheKey`. `classifyCatalog` then re-stats those
|
|
57
|
+
* files and recomputes the fingerprint — so any **mutated or deleted tracked
|
|
58
|
+
* file** flips the verdict to stale (`fresh === false`), which is what Phase 7
|
|
59
|
+
* asserts.
|
|
60
|
+
*
|
|
61
|
+
* Documented approximation: a brand-new source file (absent from the recorded
|
|
62
|
+
* set) is NOT detected as a staleness trigger without re-running discovery; and
|
|
63
|
+
* a language/tsconfig change is not detected (we echo the cached key rather than
|
|
64
|
+
* recomputing it). Those are catalog-additive changes the explicit `refresh_graph`
|
|
65
|
+
* op resolves. Mutations/deletions of tracked files — the common drift — ARE
|
|
66
|
+
* detected. Returns `undefined` when the catalog carries no fingerprint (older
|
|
67
|
+
* builds), leaving the port on its unverified-fresh fallback.
|
|
68
|
+
*/
|
|
69
|
+
export function workingTreeContextFromCatalog(catalog) {
|
|
70
|
+
const fingerprint = catalog.filesFingerprint;
|
|
71
|
+
if (typeof fingerprint !== 'string')
|
|
72
|
+
return undefined;
|
|
73
|
+
const currentFiles = filesFromFingerprint(fingerprint);
|
|
74
|
+
if (currentFiles.length === 0)
|
|
75
|
+
return undefined;
|
|
76
|
+
return {
|
|
77
|
+
currentLanguage: catalog.language,
|
|
78
|
+
currentCacheKey: catalog.cacheKey,
|
|
79
|
+
currentFiles,
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
/** Recover the tracked file paths (in order) from a `computeFilesFingerprint` string. */
|
|
83
|
+
function filesFromFingerprint(fingerprint) {
|
|
84
|
+
const lines = fingerprint.split('\n');
|
|
85
|
+
const files = [];
|
|
86
|
+
// Line 0 is the leading file-count; each subsequent line is `path|mtime|size`.
|
|
87
|
+
for (let i = 1; i < lines.length; i++) {
|
|
88
|
+
const line = lines[i];
|
|
89
|
+
if (typeof line !== 'string' || line.length === 0)
|
|
90
|
+
continue;
|
|
91
|
+
const pipe = line.indexOf('|');
|
|
92
|
+
files.push(pipe === -1 ? line : line.slice(0, pipe));
|
|
93
|
+
}
|
|
94
|
+
return files;
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=freshness.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"freshness.js","sourceRoot":"","sources":["../src/freshness.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAM9D,+EAA+E;AAC/E,MAAM,UAAU,gBAAgB;IAC9B,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;AAC7C,CAAC;AAED,oFAAoF;AACpF,MAAM,UAAU,mBAAmB,CAAC,OAAe;IACjD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AAClC,CAAC;AAED,4FAA4F;AAC5F,MAAM,UAAU,oBAAoB,CAAC,OAAuB,EAAE,OAAe;IAC3E,QAAQ,OAAO,CAAC,IAAI,EAAE,CAAC;QACrB,KAAK,OAAO,CAAC,CAAC,CA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AI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACtC,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QACtB,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;YAAE,SAAS;QAC5D,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAC/B,KAAK,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;IACvD,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `GraphReadPort` — the narrow read interface every MCP graph tool handler
|
|
3
|
+
* depends on (ADR-0084). Handlers NEVER touch `CatalogRepo` / `Indexes`
|
|
4
|
+
* directly; they go through this port. Two named benefits justify the boundary:
|
|
5
|
+
* 1. **Test seam** — handlers are unit-tested against an in-memory fake port,
|
|
6
|
+
* no SQLite needed (Phase 6).
|
|
7
|
+
* 2. **Compile-time SaaS parity** — a handler cannot reach the storage layer,
|
|
8
|
+
* so an alternate (cloud) backend can substitute behind the same interface.
|
|
9
|
+
*
|
|
10
|
+
* Every read returns `Result<McpToolResult<T>, McpReadError>` (ADR-0084): the
|
|
11
|
+
* success arm carries `{ data, freshness }`; `throw` is reserved for the
|
|
12
|
+
* SQLite/Drizzle boundary inside the impl. A missing catalog is NOT an error —
|
|
13
|
+
* it surfaces as `freshness.fresh === false` with empty data and no auto-build.
|
|
14
|
+
*/
|
|
15
|
+
import type { McpReadError } from './mcp-error.js';
|
|
16
|
+
import type { Freshness, McpToolResult, SymbolRef } from './symbol-dto.js';
|
|
17
|
+
import type { Result } from '@opensip-cli/core';
|
|
18
|
+
/** Identity of the in-memory catalog generation a read was served from. */
|
|
19
|
+
export interface GraphGeneration {
|
|
20
|
+
/** ISO timestamp the served generation's catalog was built at. */
|
|
21
|
+
readonly builtAt: string;
|
|
22
|
+
}
|
|
23
|
+
/** A blast-radius score for one symbol (graph's canonical scoring — reused, not reinvented). */
|
|
24
|
+
export interface BlastDto {
|
|
25
|
+
readonly symbol: SymbolRef;
|
|
26
|
+
/** Direct (depth-1) caller count. */
|
|
27
|
+
readonly direct: number;
|
|
28
|
+
/** Transitive (depth 2..5) caller count. */
|
|
29
|
+
readonly transitive: number;
|
|
30
|
+
/** `direct + 0.5 × transitive`. */
|
|
31
|
+
readonly score: number;
|
|
32
|
+
}
|
|
33
|
+
/** One dead-code (orphan) finding projected from `graph:orphan-subtree`. */
|
|
34
|
+
export interface DeadCodeDto {
|
|
35
|
+
readonly symbol: SymbolRef;
|
|
36
|
+
/** The rule's human-readable message. */
|
|
37
|
+
readonly message: string;
|
|
38
|
+
}
|
|
39
|
+
/** The outcome of the `trace_path` tool: an ordered symbol chain. */
|
|
40
|
+
export interface PathTraceDto {
|
|
41
|
+
/** `true` when a call path `from → … → to` exists within the depth bound. */
|
|
42
|
+
readonly found: boolean;
|
|
43
|
+
/** The ordered path (empty when not found). */
|
|
44
|
+
readonly path: readonly SymbolRef[];
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* A walkable adjacency snapshot for one call direction. The MCP call-graph tools
|
|
48
|
+
* (`who_calls`/`callees_of`/`trace_path`) run the shared `boundedBfs` over this
|
|
49
|
+
* — the port exposes the engine's `Indexes.callers`/`callees` body-hash
|
|
50
|
+
* adjacency (twin-union per ADR-0003) plus a body-hash → {@link SymbolRef}
|
|
51
|
+
* resolver, so the single walk lives in MCP (rule of three) and the port never
|
|
52
|
+
* re-implements a parallel BFS.
|
|
53
|
+
*/
|
|
54
|
+
export interface AdjacencySnapshot {
|
|
55
|
+
/** Body-hash → neighbor body-hashes for this direction. */
|
|
56
|
+
readonly edges: ReadonlyMap<string, readonly string[]>;
|
|
57
|
+
/** Resolve a body hash to its representative {@link SymbolRef} (metadata only). */
|
|
58
|
+
resolve(bodyHash: string): SymbolRef | undefined;
|
|
59
|
+
}
|
|
60
|
+
/** One package-coupling row in the architecture summary. */
|
|
61
|
+
export interface ArchitecturePackageDto {
|
|
62
|
+
readonly name: string;
|
|
63
|
+
/** Distinct callee packages this package depends on. */
|
|
64
|
+
readonly couplingOut: number;
|
|
65
|
+
/** Distinct caller packages that depend on this one. */
|
|
66
|
+
readonly couplingIn: number;
|
|
67
|
+
}
|
|
68
|
+
/** A compact architecture overview: counts, languages, top-coupled packages, blast hotspots. */
|
|
69
|
+
export interface ArchitectureSummaryDto {
|
|
70
|
+
readonly functionCount: number;
|
|
71
|
+
readonly edgeCount: number;
|
|
72
|
+
/** Languages present in the catalog (single-language per catalog today). */
|
|
73
|
+
readonly languages: readonly string[];
|
|
74
|
+
readonly packages: readonly ArchitecturePackageDto[];
|
|
75
|
+
/** Highest-blast symbols (graph's canonical scoring), capped. */
|
|
76
|
+
readonly hotspots: readonly BlastDto[];
|
|
77
|
+
}
|
|
78
|
+
/** Options for {@link GraphReadPort.searchSymbols}. */
|
|
79
|
+
export interface SearchSymbolsOptions {
|
|
80
|
+
/** Max results before truncation (handler-clamped; impl applies a default). */
|
|
81
|
+
readonly limit?: number;
|
|
82
|
+
}
|
|
83
|
+
export interface GraphReadPort {
|
|
84
|
+
/** Identity of the current generation (`undefined` when no catalog is loaded). */
|
|
85
|
+
getGeneration(): Result<McpToolResult<GraphGeneration | undefined>, McpReadError>;
|
|
86
|
+
/** Resolve a `file:line:col` symbolId to its {@link SymbolRef}. */
|
|
87
|
+
resolveSymbolId(symbolId: string): Result<McpToolResult<SymbolRef | undefined>, McpReadError>;
|
|
88
|
+
/** Search symbols by simple name (substring, case-insensitive). */
|
|
89
|
+
searchSymbols(query: string, opts?: SearchSymbolsOptions): Result<McpToolResult<readonly SymbolRef[]>, McpReadError>;
|
|
90
|
+
/** All symbols declared in `file` enclosing (or starting at) `line`. */
|
|
91
|
+
findBySpan(file: string, line: number): Result<McpToolResult<readonly SymbolRef[]>, McpReadError>;
|
|
92
|
+
/** Reverse-call adjacency snapshot (who-calls): walked by MCP's `boundedBfs`. */
|
|
93
|
+
callerGraph(): Result<McpToolResult<AdjacencySnapshot>, McpReadError>;
|
|
94
|
+
/** Forward-call adjacency snapshot (callees): walked by MCP's `boundedBfs`. */
|
|
95
|
+
calleeGraph(): Result<McpToolResult<AdjacencySnapshot>, McpReadError>;
|
|
96
|
+
/** Blast radius of `symbolId` — graph's canonical `buildFeatures` scoring. */
|
|
97
|
+
blast(symbolId: string): Result<McpToolResult<BlastDto | undefined>, McpReadError>;
|
|
98
|
+
/** Orphan (dead-code) symbols via `graph:orphan-subtree` (no filesystem reads). */
|
|
99
|
+
deadCode(limit?: number): Result<McpToolResult<readonly DeadCodeDto[]>, McpReadError>;
|
|
100
|
+
/** Package-coupling architecture overview. */
|
|
101
|
+
architectureSummary(limit?: number): Result<McpToolResult<ArchitectureSummaryDto>, McpReadError>;
|
|
102
|
+
/**
|
|
103
|
+
* Rebuild the catalog (the single state-changing op) and swap the generation
|
|
104
|
+
* atomically. Async — runs the graph programmatic build at a genuine infra
|
|
105
|
+
* boundary. Wired in Phase 4.
|
|
106
|
+
*/
|
|
107
|
+
refresh(): Promise<Result<McpToolResult<GraphGeneration>, McpReadError>>;
|
|
108
|
+
/** The current freshness verdict (read without serving data). */
|
|
109
|
+
freshness(): Freshness;
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=graph-read-port.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph-read-port.d.ts","sourceRoot":"","sources":["../src/graph-read-port.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,SAAS,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C,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC,aAAa,CAAC,QAAQ,GAAG,SAAS,CAAC,EAAE,YAAY,CAAC,CAAC;IACnF,mFAAmF;IACnF,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,aAAa,CAAC,SAAS,WAAW,EAAE,CAAC,EAAE,YAAY,CAAC,CAAC;IACtF,8CAA8C;IAC9C,mBAAmB,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,aAAa,CAAC,sBAAsB,CAAC,EAAE,YAAY,CAAC,CAAC;IACjG;;;;OAIG;IACH,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,eAAe,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC;IACzE,iEAAiE;IACjE,SAAS,IAAI,SAAS,CAAC;CACxB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `GraphReadPort` — the narrow read interface every MCP graph tool handler
|
|
3
|
+
* depends on (ADR-0084). Handlers NEVER touch `CatalogRepo` / `Indexes`
|
|
4
|
+
* directly; they go through this port. Two named benefits justify the boundary:
|
|
5
|
+
* 1. **Test seam** — handlers are unit-tested against an in-memory fake port,
|
|
6
|
+
* no SQLite needed (Phase 6).
|
|
7
|
+
* 2. **Compile-time SaaS parity** — a handler cannot reach the storage layer,
|
|
8
|
+
* so an alternate (cloud) backend can substitute behind the same interface.
|
|
9
|
+
*
|
|
10
|
+
* Every read returns `Result<McpToolResult<T>, McpReadError>` (ADR-0084): the
|
|
11
|
+
* success arm carries `{ data, freshness }`; `throw` is reserved for the
|
|
12
|
+
* SQLite/Drizzle boundary inside the impl. A missing catalog is NOT an error —
|
|
13
|
+
* it surfaces as `freshness.fresh === false` with empty data and no auto-build.
|
|
14
|
+
*/
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=graph-read-port.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph-read-port.js","sourceRoot":"","sources":["../src/graph-read-port.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @opensip-cli/mcp public barrel.
|
|
3
|
+
*
|
|
4
|
+
* Re-exports the Tool descriptor the host loads by name through the bundled
|
|
5
|
+
* plugin path. The MCP server internals (ports, command, tools) are not public
|
|
6
|
+
* API — they are consumed only within this package and its test suites.
|
|
7
|
+
*/
|
|
8
|
+
export { mcpTool, mcpTool as tool, MCP_IDENTITY, MCP_STABLE_ID } from './tool.js';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @opensip-cli/mcp public barrel.
|
|
3
|
+
*
|
|
4
|
+
* Re-exports the Tool descriptor the host loads by name through the bundled
|
|
5
|
+
* plugin path. The MCP server internals (ports, command, tools) are not public
|
|
6
|
+
* API — they are consumed only within this package and its test suites.
|
|
7
|
+
*/
|
|
8
|
+
export { mcpTool, mcpTool as tool, MCP_IDENTITY, MCP_STABLE_ID } from './tool.js';
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The structured error the MCP read ports return in the failure arm of their
|
|
3
|
+
* `Result<T, E>` (ADR-0084). Ports return `Result` across domain boundaries;
|
|
4
|
+
* `throw` is reserved for genuine infra failures (SQLite/Drizzle, the
|
|
5
|
+
* `runGraph` child build). This is a plain DTO — not a thrown `Error`.
|
|
6
|
+
*/
|
|
7
|
+
export interface McpReadError {
|
|
8
|
+
/** Machine-readable reason, e.g. `'ambiguous-symbol'`, `'not-found'`. */
|
|
9
|
+
readonly code: string;
|
|
10
|
+
/** Human-readable detail (already scrubbed/truncated where relevant). */
|
|
11
|
+
readonly message: string;
|
|
12
|
+
}
|
|
13
|
+
/** Build an {@link McpReadError}. */
|
|
14
|
+
export declare function readError(code: string, message: string): McpReadError;
|
|
15
|
+
//# sourceMappingURL=mcp-error.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-error.d.ts","sourceRoot":"","sources":["../src/mcp-error.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B,yEAAyE;IACzE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,yEAAyE;IACzE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,qCAAqC;AACrC,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,YAAY,CAErE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-error.js","sourceRoot":"","sources":["../src/mcp-error.ts"],"names":[],"mappings":"AAaA,qCAAqC;AACrC,MAAM,UAAU,SAAS,CAAC,IAAY,EAAE,OAAe;IACrD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AAC3B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register-mcp-graph-adapters.d.ts","sourceRoot":"","sources":["../src/register-mcp-graph-adapters.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAE7D,eAAO,MAAM,uBAAuB,EAAE,mBAErC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// @fitness-ignore-file hot-paths-require-spans -- Registration wiring, not a runtime hot path: this registrar runs once per adapter at scope build (it just routes the contribution into the scope-owned registry). It mirrors graph's own internal registerGraphAdapter; the graph engine owns the span boundary and traces adapter work centrally per pipeline stage.
|
|
2
|
+
/**
|
|
3
|
+
* MCP's registrar for its `mcp-graph-adapter` capability domain (ADR-0084).
|
|
4
|
+
*
|
|
5
|
+
* Mirrors graph's `registerGraphAdapter` (graph `tool.ts`): a routed
|
|
6
|
+
* contribution (already shape-checked against the domain's `requiredKeys: ['id']`
|
|
7
|
+
* by the host) is registered into THIS run's scope-owned adapter registry.
|
|
8
|
+
*
|
|
9
|
+
* Why this works: graph's `contributeScope` runs for EVERY bundled tool (the host
|
|
10
|
+
* loops all contributing tools when building the RunScope), so `scope.graph.adapters`
|
|
11
|
+
* exists under `opensip mcp` even though the dispatched tool is `mcp`.
|
|
12
|
+
* `currentAdapterRegistry()` resolves that registry; MCP declares its OWN domain id
|
|
13
|
+
* (`mcp-graph-adapter`) with `markerKind: 'graph-adapter'`, so the host's
|
|
14
|
+
* bundled-pack lookup (keyed by markerKind) loads the same `graph-*` adapter packs
|
|
15
|
+
* under MCP's domain and routes each contribution through this registrar.
|
|
16
|
+
*/
|
|
17
|
+
import { currentAdapterRegistry } from '@opensip-cli/graph';
|
|
18
|
+
export const registerMcpGraphAdapter = (contribution) => {
|
|
19
|
+
currentAdapterRegistry().register(contribution);
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=register-mcp-graph-adapters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register-mcp-graph-adapters.js","sourceRoot":"","sources":["../src/register-mcp-graph-adapters.ts"],"names":[],"mappings":"AAAA,wWAAwW;AACxW;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,sBAAsB,EAA6B,MAAM,oBAAoB,CAAC;AAIvF,MAAM,CAAC,MAAM,uBAAuB,GAAwB,CAAC,YAAY,EAAE,EAAE;IAC3E,sBAAsB,EAAE,CAAC,QAAQ,CAAC,YAAoC,CAAC,CAAC;AAC1E,CAAC,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Result/history DTOs for the MCP {@link ResultsReadPort} (ADR-0084).
|
|
3
|
+
*
|
|
4
|
+
* Every result response carries session provenance + `recommendedNext` commands
|
|
5
|
+
* so an agent can drill in (or re-run) without guessing the CLI grammar. The
|
|
6
|
+
* payloads are the host-owned generic replay projection (the same decoded signal
|
|
7
|
+
* list `sessions show` produces) — never another tool's opaque payload
|
|
8
|
+
* vocabulary (ADR-0042 opacity boundary holds).
|
|
9
|
+
*/
|
|
10
|
+
import type { SignalEnvelope } from '@opensip-cli/contracts';
|
|
11
|
+
import type { SignalSeverity, ToolShortId } from '@opensip-cli/core';
|
|
12
|
+
/** The verdict-count block shared with `SignalEnvelope`. */
|
|
13
|
+
export type RunVerdictSummary = SignalEnvelope['verdict']['summary'];
|
|
14
|
+
/** A lean stored-run pointer (the `sessions list` row, agent-shaped). */
|
|
15
|
+
export interface RunSummary {
|
|
16
|
+
readonly id: string;
|
|
17
|
+
readonly tool: string;
|
|
18
|
+
readonly startedAt: string;
|
|
19
|
+
readonly completedAt: string;
|
|
20
|
+
readonly score: number;
|
|
21
|
+
readonly passed: boolean;
|
|
22
|
+
/** The `opensip sessions show … --json` command that replays this run. */
|
|
23
|
+
readonly showCommand: string;
|
|
24
|
+
/** Verdict counts when the stored payload carried a summary. */
|
|
25
|
+
readonly summary?: RunVerdictSummary;
|
|
26
|
+
}
|
|
27
|
+
/** Options for {@link ResultsReadPort.latestFindings}. */
|
|
28
|
+
export interface LatestFindingsOptions {
|
|
29
|
+
readonly tool: ToolShortId;
|
|
30
|
+
/** `errors` → errors-only, `warnings` → warnings-only, `all` → no severity filter. */
|
|
31
|
+
readonly severity?: 'errors' | 'warnings' | 'all';
|
|
32
|
+
/** Cap the returned findings (maps to the `top:<n>` filter). */
|
|
33
|
+
readonly limit?: number;
|
|
34
|
+
}
|
|
35
|
+
/** A compact finding row projected from a replayed envelope signal. */
|
|
36
|
+
export interface McpFinding {
|
|
37
|
+
readonly ruleId: string;
|
|
38
|
+
readonly message: string;
|
|
39
|
+
readonly severity: SignalSeverity;
|
|
40
|
+
readonly filePath?: string;
|
|
41
|
+
readonly line?: number;
|
|
42
|
+
readonly column?: number;
|
|
43
|
+
}
|
|
44
|
+
/** The `show_run` payload: the replayed envelope + its fidelity marker. */
|
|
45
|
+
export interface ShowRunData {
|
|
46
|
+
/** Always `'projection'` — replays are rebuilt from persisted data. */
|
|
47
|
+
readonly fidelity: 'projection';
|
|
48
|
+
readonly envelope: SignalEnvelope;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* The shared result-replay envelope: `data` + session provenance + (when a
|
|
52
|
+
* filter narrowed the signals) the agent filter metadata + `recommendedNext`
|
|
53
|
+
* follow-up commands.
|
|
54
|
+
*/
|
|
55
|
+
export interface McpResultReplay<T> {
|
|
56
|
+
readonly data: T;
|
|
57
|
+
readonly session?: RunSummary;
|
|
58
|
+
readonly filtersApplied?: readonly string[];
|
|
59
|
+
readonly originalSignalCount?: number;
|
|
60
|
+
readonly returnedSignalCount?: number;
|
|
61
|
+
readonly recommendedNext?: Record<string, string>;
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=result-dto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"result-dto.d.ts","sourceRoot":"","sources":["../src/result-dto.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,mBAAmB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,EAAE,cAAc,CAAC;CACnC;AAED;;;;GAIG;AACH,MAAM,WAAW,eAAe,CAAC,CAAC;IAChC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;IACjB,QAAQ,CAAC,OAAO,CAAC,EAAE,UAAU,CAAC;IAC9B,QAAQ,CAAC,cAAc,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5C,QAAQ,CAAC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IACtC,QAAQ,CAAC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IACtC,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACnD"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Result/history DTOs for the MCP {@link ResultsReadPort} (ADR-0084).
|
|
3
|
+
*
|
|
4
|
+
* Every result response carries session provenance + `recommendedNext` commands
|
|
5
|
+
* so an agent can drill in (or re-run) without guessing the CLI grammar. The
|
|
6
|
+
* payloads are the host-owned generic replay projection (the same decoded signal
|
|
7
|
+
* list `sessions show` produces) — never another tool's opaque payload
|
|
8
|
+
* vocabulary (ADR-0042 opacity boundary holds).
|
|
9
|
+
*/
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=result-dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"result-dto.js","sourceRoot":"","sources":["../src/result-dto.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `ResultsReadPort` — the narrow read interface the MCP result/history tool
|
|
3
|
+
* handlers depend on (ADR-0084). Kept separate from `GraphReadPort` because
|
|
4
|
+
* session reads and graph-catalog reads are distinct backends with distinct
|
|
5
|
+
* consumers (SRP) — each has exactly one production impl + one test fake.
|
|
6
|
+
*
|
|
7
|
+
* Result tools **never** re-execute the underlying OpenSIP tool; they replay
|
|
8
|
+
* persisted sessions only (paired with the `mcp-results-no-rerun` check). The
|
|
9
|
+
* impl reads through the `@opensip-cli/session-store` read API — it never names
|
|
10
|
+
* `SessionRepo` and never raw-queries the datastore.
|
|
11
|
+
*/
|
|
12
|
+
import type { McpReadError } from './mcp-error.js';
|
|
13
|
+
import type { LatestFindingsOptions, McpFinding, McpResultReplay, RunSummary, ShowRunData } from './result-dto.js';
|
|
14
|
+
import type { AgentCatalog } from '@opensip-cli/contracts';
|
|
15
|
+
import type { Result, ToolShortId } from '@opensip-cli/core';
|
|
16
|
+
/** Options for {@link ResultsReadPort.listRuns}. */
|
|
17
|
+
export interface ListRunsOptions {
|
|
18
|
+
readonly tool?: ToolShortId;
|
|
19
|
+
readonly limit?: number;
|
|
20
|
+
/** Omit heavy stored payloads (agent-friendly; defaults on in the impl). */
|
|
21
|
+
readonly summaryOnly?: boolean;
|
|
22
|
+
}
|
|
23
|
+
/** Options for {@link ResultsReadPort.showRun}. */
|
|
24
|
+
export interface ShowRunOptions {
|
|
25
|
+
/** Session id, or the sentinel `'latest'` (which requires `tool`). */
|
|
26
|
+
readonly ref: string;
|
|
27
|
+
readonly tool?: ToolShortId;
|
|
28
|
+
/** Agent ergonomics filters applied to the replayed envelope (ADR-0085). */
|
|
29
|
+
readonly filters?: readonly string[];
|
|
30
|
+
/** Request the minimal payload (handler presentation hint). */
|
|
31
|
+
readonly raw?: boolean;
|
|
32
|
+
}
|
|
33
|
+
export interface ResultsReadPort {
|
|
34
|
+
/** The self-describing agent command catalog. */
|
|
35
|
+
agentCatalog(): Result<AgentCatalog, McpReadError>;
|
|
36
|
+
/** List stored runs as lean {@link RunSummary} pointers. */
|
|
37
|
+
listRuns(opts?: ListRunsOptions): Result<readonly RunSummary[], McpReadError>;
|
|
38
|
+
/** Replay one stored run (resolve `ref`, decode, filter) — never re-run. */
|
|
39
|
+
showRun(opts: ShowRunOptions): Promise<Result<McpResultReplay<ShowRunData>, McpReadError>>;
|
|
40
|
+
/** The latest run's findings for `tool`, severity/limit-filtered. */
|
|
41
|
+
latestFindings(opts: LatestFindingsOptions): Promise<Result<McpResultReplay<readonly McpFinding[]>, McpReadError>>;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=results-read-port.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"results-read-port.d.ts","sourceRoot":"","sources":["../src/results-read-port.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EACV,qBAAqB,EACrB,UAAU,EACV,eAAe,EACf,UAAU,EACV,WAAW,EACZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAE7D,oDAAoD;AACpD,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,IAAI,CAAC,EAAE,WAAW,CAAC;IAC5B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,4EAA4E;IAC5E,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;CAChC;AAED,mDAAmD;AACnD,MAAM,WAAW,cAAc;IAC7B,sEAAsE;IACtE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,IAAI,CAAC,EAAE,WAAW,CAAC;IAC5B,4EAA4E;IAC5E,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,+DAA+D;IAC/D,QAAQ,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,eAAe;IAC9B,iDAAiD;IACjD,YAAY,IAAI,MAAM,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;IACnD,4DAA4D;IAC5D,QAAQ,CAAC,IAAI,CAAC,EAAE,eAAe,GAAG,MAAM,CAAC,SAAS,UAAU,EAAE,EAAE,YAAY,CAAC,CAAC;IAC9E,4EAA4E;IAC5E,OAAO,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC,WAAW,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC;IAC3F,qEAAqE;IACrE,cAAc,CACZ,IAAI,EAAE,qBAAqB,GAC1B,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC,SAAS,UAAU,EAAE,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC;CAC1E"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `ResultsReadPort` — the narrow read interface the MCP result/history tool
|
|
3
|
+
* handlers depend on (ADR-0084). Kept separate from `GraphReadPort` because
|
|
4
|
+
* session reads and graph-catalog reads are distinct backends with distinct
|
|
5
|
+
* consumers (SRP) — each has exactly one production impl + one test fake.
|
|
6
|
+
*
|
|
7
|
+
* Result tools **never** re-execute the underlying OpenSIP tool; they replay
|
|
8
|
+
* persisted sessions only (paired with the `mcp-results-no-rerun` check). The
|
|
9
|
+
* impl reads through the `@opensip-cli/session-store` read API — it never names
|
|
10
|
+
* `SessionRepo` and never raw-queries the datastore.
|
|
11
|
+
*/
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=results-read-port.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"results-read-port.js","sourceRoot":"","sources":["../src/results-read-port.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG"}
|
package/dist/server.d.ts
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The stdio MCP server (ADR-0084).
|
|
3
|
+
*
|
|
4
|
+
* `opensip mcp` is the first long-lived, BLOCKING command in opensip-cli. Two
|
|
5
|
+
* properties make its construction unusual and are the whole point of this file:
|
|
6
|
+
*
|
|
7
|
+
* 1. **Scope captured, never ambient.** The MCP SDK dispatches tool handlers
|
|
8
|
+
* off an internal EventEmitter, so `currentScope()` (AsyncLocalStorage) does
|
|
9
|
+
* NOT propagate into them — a handler that read `currentScope()` would find
|
|
10
|
+
* `undefined` and silently degrade (no datastore, no logger runId). The fix
|
|
11
|
+
* is to capture the `RunScope` at construction and re-enter it per call via
|
|
12
|
+
* `runWithScope(capturedScope, …)` (see {@link McpStdioServer.register}). The
|
|
13
|
+
* ports are likewise PRE-BUILT and injected; handlers never reach for scope.
|
|
14
|
+
*
|
|
15
|
+
* 2. **stdout is JSON-RPC only.** The stdio transport owns stdout for the
|
|
16
|
+
* protocol frames. Every diagnostic must go to stderr. The `@opensip-cli/core`
|
|
17
|
+
* structured logger never writes stdout (it writes the per-project log file
|
|
18
|
+
* and — in debug mode — stderr), so we route its sink to stderr for the serve
|
|
19
|
+
* lifetime via the `configureLogger` seam and emit only at decision points
|
|
20
|
+
* (`mcp.server.start|stop`, `mcp.tool.dispatch[.ok|.error]`). No `console.*`
|
|
21
|
+
* / `process.stdout.write` for diagnostics anywhere in the serve path.
|
|
22
|
+
*
|
|
23
|
+
* No tools are registered here yet — Phase 4 mounts the catalog onto this server
|
|
24
|
+
* through the {@link McpStdioServer.register} seam (which guarantees the
|
|
25
|
+
* scope-wrap for every handler). The server resolves its lifetime promise on
|
|
26
|
+
* stdin EOF (or a SIGINT-driven graceful close); it never calls `process.exit`,
|
|
27
|
+
* leaving the final exit code to the host command handler.
|
|
28
|
+
*/
|
|
29
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
30
|
+
import type { GraphReadPort } from './graph-read-port.js';
|
|
31
|
+
import type { ResultsReadPort } from './results-read-port.js';
|
|
32
|
+
import type { RunScope } from '@opensip-cli/core';
|
|
33
|
+
type SdkRegisterTool = McpServer['registerTool'];
|
|
34
|
+
export type { CallToolResult } from '@modelcontextprotocol/sdk/types.js';
|
|
35
|
+
/** Construction deps — captured ONCE; handlers never read ambient scope. */
|
|
36
|
+
export interface McpStdioServerDeps {
|
|
37
|
+
/**
|
|
38
|
+
* The `RunScope` the host entered for this invocation. Captured here and
|
|
39
|
+
* re-entered (`runWithScope`) around every tool handler — the load-bearing
|
|
40
|
+
* fix for the SDK's EventEmitter dispatch dropping AsyncLocalStorage.
|
|
41
|
+
*/
|
|
42
|
+
readonly scope: RunScope;
|
|
43
|
+
/** Pre-built graph read port (Phase 2). */
|
|
44
|
+
readonly graph: GraphReadPort;
|
|
45
|
+
/** Pre-built results/history read port (Phase 2). */
|
|
46
|
+
readonly results: ResultsReadPort;
|
|
47
|
+
/** Server version advertised in the handshake (the `@opensip-cli/mcp` version). */
|
|
48
|
+
readonly version: string;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* A long-lived stdio MCP server bound to one captured {@link RunScope}.
|
|
52
|
+
*
|
|
53
|
+
* Construct with pre-built ports + the captured scope, register tools through
|
|
54
|
+
* {@link register} (Phase 4), then `await serve()` — the promise resolves when
|
|
55
|
+
* the transport closes (stdin EOF / graceful SIGINT).
|
|
56
|
+
*/
|
|
57
|
+
export declare class McpStdioServer {
|
|
58
|
+
private readonly mcp;
|
|
59
|
+
private readonly transport;
|
|
60
|
+
private readonly scope;
|
|
61
|
+
private readonly version;
|
|
62
|
+
/** The graph read port handlers close over (Phase 4 reads it). */
|
|
63
|
+
readonly graph: GraphReadPort;
|
|
64
|
+
/** The results read port handlers close over (Phase 4 reads it). */
|
|
65
|
+
readonly results: ResultsReadPort;
|
|
66
|
+
constructor(deps: McpStdioServerDeps);
|
|
67
|
+
/**
|
|
68
|
+
* Register a tool, wrapping its handler so EVERY dispatch re-enters the
|
|
69
|
+
* captured scope (`runWithScope`) and is bracketed by `mcp.tool.dispatch`
|
|
70
|
+
* decision-point logging. The public signature is exactly the SDK's
|
|
71
|
+
* `registerTool` (full generic fidelity for the Phase-4 call sites); the thin
|
|
72
|
+
* forwarder casts internally because it is scope-/schema-agnostic.
|
|
73
|
+
*/
|
|
74
|
+
register: SdkRegisterTool;
|
|
75
|
+
/** Run one wrapped handler inside the captured scope, with decision logging. */
|
|
76
|
+
private dispatch;
|
|
77
|
+
/**
|
|
78
|
+
* Serve until the stdio transport closes. Resolves on stdin EOF (or a
|
|
79
|
+
* SIGINT-driven graceful close). Never calls `process.exit` — the host command
|
|
80
|
+
* handler resolves cleanly and owns the final exit code (ADR-0084).
|
|
81
|
+
*/
|
|
82
|
+
serve(): Promise<void>;
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAIpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAE9D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAYlD,KAAK,eAAe,GAAG,SAAS,CAAC,cAAc,CAAC,CAAC;AACjD,YAAY,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAEzE,4EAA4E;AAC5E,MAAM,WAAW,kBAAkB;IACjC;;;;OAIG;IACH,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC;IACzB,2CAA2C;IAC3C,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;IAC9B,qDAAqD;IACrD,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC;IAClC,mFAAmF;IACnF,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;;GAMG;AACH,qBAAa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAY;IAChC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAuB;IACjD,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAW;IACjC,OAAO,C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