@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
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/NOTICE
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
OpenSIP CLI
|
|
2
|
+
Copyright 2026 opensip-ai
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
5
|
+
this software except in compliance with the License. A copy of the License is
|
|
6
|
+
included in the LICENSE file and is also available at:
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
package/README.md
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<!-- Generated by scripts/build-package-readmes.mjs — do not edit by hand.
|
|
2
|
+
Change the package's "description" (or the generator template) and run
|
|
3
|
+
`pnpm docs:readmes`. CI enforces sync via `pnpm docs:readmes:check`. -->
|
|
4
|
+
|
|
5
|
+
# @opensip-cli/mcp
|
|
6
|
+
|
|
7
|
+
> MCP server exposing the OpenSIP call graph and stored results to coding agents over stdio
|
|
8
|
+
|
|
9
|
+
This package is the **engine** behind a first-party `opensip-cli` tool. The CLI bundles it — you do not normally install it directly.
|
|
10
|
+
|
|
11
|
+
Part of [**opensip-cli**](https://github.com/opensip-ai/opensip-cli) — an open-source codebase intelligence CLI: fitness checks (`fit`), static call-graph analysis (`graph`), simulation (`sim`), and advisory reduction audits (`yagni`).
|
|
12
|
+
|
|
13
|
+
**Distribution model:** the published `opensip-cli` npm package is a full-stack bundle of first-party tools, check packs, and language adapters. Third-party tools install separately via the `opensipTools` manifest and host allowlist; a slim install without bundled tools is not a current goal.
|
|
14
|
+
|
|
15
|
+
## Install
|
|
16
|
+
|
|
17
|
+
Most users install the CLI, which bundles the first-party tools:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
curl -fsSL https://opensip.ai/cli/install.sh | bash
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
This package is published for the CLI and advanced plugin authors; most users should not install `@opensip-cli/mcp` directly.
|
|
24
|
+
|
|
25
|
+
## Documentation
|
|
26
|
+
|
|
27
|
+
- 📚 Project docs: https://opensip.ai/docs/opensip-cli/
|
|
28
|
+
- 🧭 Package catalog (what every package does): https://github.com/opensip-ai/opensip-cli/blob/v0.1.15/docs/public/70-reference/02-package-catalog.md
|
|
29
|
+
- 📦 Source: https://github.com/opensip-ai/opensip-cli/tree/v0.1.15/packages/mcp
|
|
30
|
+
|
|
31
|
+
## License
|
|
32
|
+
|
|
33
|
+
Apache-2.0 © opensip-ai
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `opensip mcp` is a TRANSPORT, not a run (Task 6.1 §Observability).
|
|
3
|
+
*
|
|
4
|
+
* - It owns stdout for JSON-RPC: `output: 'raw-stream'` + `rawStreamReason:
|
|
5
|
+
* 'mcp-stdio'`, project-scoped.
|
|
6
|
+
* - It records NO session: the command returns no `ToolSessionContribution`, and
|
|
7
|
+
* MCP source never names `SessionRepo` / a `persist*Session` / a
|
|
8
|
+
* `runSession.record` writer (host-owned-run-timing). Verified structurally
|
|
9
|
+
* across the whole package source (the same symbols the dogfood self-checks
|
|
10
|
+
* forbid — asserted here as an explicit unit, not just at CI).
|
|
11
|
+
*/
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=command-transport.test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-transport.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/command-transport.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `opensip mcp` is a TRANSPORT, not a run (Task 6.1 §Observability).
|
|
3
|
+
*
|
|
4
|
+
* - It owns stdout for JSON-RPC: `output: 'raw-stream'` + `rawStreamReason:
|
|
5
|
+
* 'mcp-stdio'`, project-scoped.
|
|
6
|
+
* - It records NO session: the command returns no `ToolSessionContribution`, and
|
|
7
|
+
* MCP source never names `SessionRepo` / a `persist*Session` / a
|
|
8
|
+
* `runSession.record` writer (host-owned-run-timing). Verified structurally
|
|
9
|
+
* across the whole package source (the same symbols the dogfood self-checks
|
|
10
|
+
* forbid — asserted here as an explicit unit, not just at CI).
|
|
11
|
+
*/
|
|
12
|
+
import { readdirSync, readFileSync } from 'node:fs';
|
|
13
|
+
import { join } from 'node:path';
|
|
14
|
+
import { fileURLToPath } from 'node:url';
|
|
15
|
+
import { describe, expect, it } from 'vitest';
|
|
16
|
+
import { mcpCommandSpec } from '../command.js';
|
|
17
|
+
const SRC_DIR = fileURLToPath(new URL('..', import.meta.url));
|
|
18
|
+
/** Every production `.ts` under `src/` (excludes `__tests__/` and `*.test.ts`). */
|
|
19
|
+
function productionSources(dir) {
|
|
20
|
+
const out = [];
|
|
21
|
+
for (const entry of readdirSync(dir, { withFileTypes: true })) {
|
|
22
|
+
if (entry.name === '__tests__')
|
|
23
|
+
continue;
|
|
24
|
+
const full = join(dir, entry.name);
|
|
25
|
+
if (entry.isDirectory()) {
|
|
26
|
+
out.push(...productionSources(full));
|
|
27
|
+
}
|
|
28
|
+
else if (entry.name.endsWith('.ts') && !entry.name.endsWith('.test.ts')) {
|
|
29
|
+
out.push(full);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return out;
|
|
33
|
+
}
|
|
34
|
+
describe('mcp command — raw-stream transport contract', () => {
|
|
35
|
+
it('owns stdout for JSON-RPC via the documented raw-stream escape hatch', () => {
|
|
36
|
+
expect(mcpCommandSpec.output).toBe('raw-stream');
|
|
37
|
+
expect(mcpCommandSpec.rawStreamReason).toBe('mcp-stdio');
|
|
38
|
+
expect(mcpCommandSpec.scope).toBe('project');
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
describe('mcp source — no session-record writer (transport, not a run)', () => {
|
|
42
|
+
const sources = productionSources(SRC_DIR);
|
|
43
|
+
const contents = new Map(sources.map((f) => [f, readFileSync(f, 'utf8')]));
|
|
44
|
+
it('discovers the production source set', () => {
|
|
45
|
+
expect(sources.length).toBeGreaterThan(0);
|
|
46
|
+
});
|
|
47
|
+
it('never USES SessionRepo (reads sessions only through the read API; prose mentions are fine)', () => {
|
|
48
|
+
// The host-owned-run-timing invariant forbids importing/instantiating the
|
|
49
|
+
// writer — not naming it in a doc-comment that explains the constraint.
|
|
50
|
+
const offenders = [...contents]
|
|
51
|
+
.filter(([, c]) => /\bnew\s+SessionRepo\b/.test(c) || /import[^;]*\bSessionRepo\b[^;]*from/.test(c))
|
|
52
|
+
.map(([f]) => f);
|
|
53
|
+
expect(offenders, `SessionRepo must not be imported/instantiated:\n${offenders.join('\n')}`).toEqual([]);
|
|
54
|
+
});
|
|
55
|
+
it('never returns a ToolSessionContribution or calls a session writer', () => {
|
|
56
|
+
const forbidden = ['ToolSessionContribution', 'persistSession', 'runSession.record'];
|
|
57
|
+
for (const needle of forbidden) {
|
|
58
|
+
const offenders = [...contents].filter(([, c]) => c.includes(needle)).map(([f]) => f);
|
|
59
|
+
expect(offenders, `${needle} must not appear in MCP source:\n${offenders.join('\n')}`).toEqual([]);
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
//# sourceMappingURL=command-transport.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-transport.test.js","sourceRoot":"","sources":["../../src/__tests__/command-transport.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAE9C,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,MAAM,OAAO,GAAG,aAAa,CAAC,IAAI,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAE9D,mFAAmF;AACnF,SAAS,iBAAiB,CAAC,GAAW;IACpC,MAAM,GAAG,GAAa,EAAE,CAAC;IACzB,KAAK,MAAM,KAAK,IAAI,WAAW,CAAC,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AAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* E2E stdio (Task 6.3) — the proof that scope survives the SDK round-trip.
|
|
3
|
+
*
|
|
4
|
+
* Spawns the REAL built CLI (`node packages/cli/dist/index.js mcp`) and drives it
|
|
5
|
+
* with the MCP SDK client over a `StdioClientTransport`. This is the gap the
|
|
6
|
+
* review flagged: an SDK handler dispatches off an EventEmitter, so a tool call
|
|
7
|
+
* proves the captured `RunScope` (datastore + ports) survives a real
|
|
8
|
+
* SDK-dispatched handler — not just `initialize`.
|
|
9
|
+
*
|
|
10
|
+
* Requires `dist/` (the real CLI + mcp) — it FAILS LOUDLY if missing (no silent
|
|
11
|
+
* skip). Fixture A pre-seeds a real catalog + a fit session; fixture B has no
|
|
12
|
+
* catalog (to prove `refresh_graph` builds once the bundled graph adapter loads
|
|
13
|
+
* under the mcp-owned run — i.e. the real `loadOwningToolCapabilities` path).
|
|
14
|
+
*/
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=e2e-stdio.test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"e2e-stdio.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/e2e-stdio.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG"}
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* E2E stdio (Task 6.3) — the proof that scope survives the SDK round-trip.
|
|
3
|
+
*
|
|
4
|
+
* Spawns the REAL built CLI (`node packages/cli/dist/index.js mcp`) and drives it
|
|
5
|
+
* with the MCP SDK client over a `StdioClientTransport`. This is the gap the
|
|
6
|
+
* review flagged: an SDK handler dispatches off an EventEmitter, so a tool call
|
|
7
|
+
* proves the captured `RunScope` (datastore + ports) survives a real
|
|
8
|
+
* SDK-dispatched handler — not just `initialize`.
|
|
9
|
+
*
|
|
10
|
+
* Requires `dist/` (the real CLI + mcp) — it FAILS LOUDLY if missing (no silent
|
|
11
|
+
* skip). Fixture A pre-seeds a real catalog + a fit session; fixture B has no
|
|
12
|
+
* catalog (to prove `refresh_graph` builds once the bundled graph adapter loads
|
|
13
|
+
* under the mcp-owned run — i.e. the real `loadOwningToolCapabilities` path).
|
|
14
|
+
*/
|
|
15
|
+
import { mkdirSync, mkdtempSync, rmSync, writeFileSync, existsSync } from 'node:fs';
|
|
16
|
+
import { tmpdir } from 'node:os';
|
|
17
|
+
import { join } from 'node:path';
|
|
18
|
+
import { fileURLToPath } from 'node:url';
|
|
19
|
+
import { Client } from '@modelcontextprotocol/sdk/client/index.js';
|
|
20
|
+
import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js';
|
|
21
|
+
import { applyToolContributeScope, resolveProjectPaths, RunScope, runWithScope, } from '@opensip-cli/core';
|
|
22
|
+
import { DataStoreFactory } from '@opensip-cli/datastore';
|
|
23
|
+
import { currentAdapterRegistry, graphTool } from '@opensip-cli/graph';
|
|
24
|
+
import { runGraph } from '@opensip-cli/graph/internal';
|
|
25
|
+
import { typescriptGraphAdapter } from '@opensip-cli/graph-typescript';
|
|
26
|
+
import { SessionRepo } from '@opensip-cli/session-store';
|
|
27
|
+
import { afterAll, beforeAll, describe, expect, it } from 'vitest';
|
|
28
|
+
const CLI_DIST = fileURLToPath(new URL('../../../../packages/cli/dist/index.js', import.meta.url));
|
|
29
|
+
const TSCONFIG = JSON.stringify({
|
|
30
|
+
compilerOptions: {
|
|
31
|
+
target: 'ES2022',
|
|
32
|
+
module: 'Node16',
|
|
33
|
+
moduleResolution: 'Node16',
|
|
34
|
+
strict: true,
|
|
35
|
+
rootDir: '.',
|
|
36
|
+
},
|
|
37
|
+
include: ['**/*.ts'],
|
|
38
|
+
});
|
|
39
|
+
const CONFIG_YML = [
|
|
40
|
+
'globalExcludes:',
|
|
41
|
+
" - 'node_modules/**'",
|
|
42
|
+
'targets:',
|
|
43
|
+
' ts-source:',
|
|
44
|
+
" description: 'TypeScript source'",
|
|
45
|
+
' languages: [typescript]',
|
|
46
|
+
' concerns: [backend]',
|
|
47
|
+
' include:',
|
|
48
|
+
" - '**/*.ts'",
|
|
49
|
+
'fitness:',
|
|
50
|
+
' failOnErrors: 0',
|
|
51
|
+
' failOnWarnings: 0',
|
|
52
|
+
' disabledChecks: []',
|
|
53
|
+
'',
|
|
54
|
+
].join('\n');
|
|
55
|
+
const SOURCE = [
|
|
56
|
+
'export function main(): number { return helper(); }',
|
|
57
|
+
'function helper(): number { return 1; }',
|
|
58
|
+
'function unused(): number { return 7; }',
|
|
59
|
+
'',
|
|
60
|
+
].join('\n');
|
|
61
|
+
const SAFE_ENV = Object.fromEntries(Object.entries(process.env).filter(([, v]) => v !== undefined));
|
|
62
|
+
/** Materialize a fixture project layout; returns the project root. */
|
|
63
|
+
function scaffold() {
|
|
64
|
+
const root = mkdtempSync(join(tmpdir(), 'mcp-e2e-'));
|
|
65
|
+
mkdirSync(join(root, 'opensip-cli', '.runtime'), { recursive: true });
|
|
66
|
+
writeFileSync(join(root, 'opensip-cli.config.yml'), CONFIG_YML, 'utf8');
|
|
67
|
+
writeFileSync(join(root, 'tsconfig.json'), TSCONFIG, 'utf8');
|
|
68
|
+
writeFileSync(join(root, 'index.ts'), SOURCE, 'utf8');
|
|
69
|
+
return root;
|
|
70
|
+
}
|
|
71
|
+
/** Open the project datastore at its canonical path. */
|
|
72
|
+
function openProjectStore(root) {
|
|
73
|
+
const path = `${resolveProjectPaths(root).runtimeDir}/datastore.sqlite`;
|
|
74
|
+
return DataStoreFactory.open({ backend: 'sqlite', path });
|
|
75
|
+
}
|
|
76
|
+
/** Spawn `opensip mcp --cwd root` and connect an MCP client over stdio. */
|
|
77
|
+
async function connect(root) {
|
|
78
|
+
const transport = new StdioClientTransport({
|
|
79
|
+
command: process.execPath,
|
|
80
|
+
args: [CLI_DIST, 'mcp', '--cwd', root],
|
|
81
|
+
env: SAFE_ENV,
|
|
82
|
+
cwd: root,
|
|
83
|
+
stderr: 'pipe',
|
|
84
|
+
});
|
|
85
|
+
const conn = {
|
|
86
|
+
client: new Client({ name: 'e2e', version: '0.0.0' }),
|
|
87
|
+
transport,
|
|
88
|
+
stderr: '',
|
|
89
|
+
};
|
|
90
|
+
transport.stderr?.on('data', (chunk) => {
|
|
91
|
+
conn.stderr += chunk.toString('utf8');
|
|
92
|
+
});
|
|
93
|
+
await conn.client.connect(transport);
|
|
94
|
+
return conn;
|
|
95
|
+
}
|
|
96
|
+
/** Call a tool and parse its single JSON text payload. */
|
|
97
|
+
async function call(conn, name, args = {}) {
|
|
98
|
+
const result = await conn.client.callTool({ name, arguments: args });
|
|
99
|
+
const content = result.content;
|
|
100
|
+
const first = content[0];
|
|
101
|
+
return JSON.parse(first?.text ?? '{}');
|
|
102
|
+
}
|
|
103
|
+
let fixtureA;
|
|
104
|
+
let fixtureB;
|
|
105
|
+
let helperSymbolId;
|
|
106
|
+
let helperFile;
|
|
107
|
+
let helperLine;
|
|
108
|
+
/**
|
|
109
|
+
* A seeded run keyed by the per-tool LAYOUT KEY — the value `get_latest_findings`
|
|
110
|
+
* / `show_run` accept and that sessions are stored under. `validToolIds` is now
|
|
111
|
+
* built from `identity.layoutKey ?? identity.name`, so `fit`/`sim`/`graph`/`yagni`
|
|
112
|
+
* all resolve + replay. `graph` (layoutKey `'graph'`) is used here.
|
|
113
|
+
*/
|
|
114
|
+
function graphSession(root) {
|
|
115
|
+
return {
|
|
116
|
+
id: 'graph-e2e-1',
|
|
117
|
+
tool: 'graph',
|
|
118
|
+
startedAt: '2026-05-21T12:00:00.000Z',
|
|
119
|
+
completedAt: '2026-05-21T12:00:30.000Z',
|
|
120
|
+
cwd: root,
|
|
121
|
+
recipe: 'default',
|
|
122
|
+
score: 90,
|
|
123
|
+
passed: true,
|
|
124
|
+
durationMs: 30_000,
|
|
125
|
+
payload: {
|
|
126
|
+
summary: { total: 1, passed: 0, failed: 1, errors: 0, warnings: 1 },
|
|
127
|
+
checks: [
|
|
128
|
+
{
|
|
129
|
+
checkSlug: 'graph:large-function',
|
|
130
|
+
passed: false,
|
|
131
|
+
violationCount: 1,
|
|
132
|
+
durationMs: 5,
|
|
133
|
+
findings: [
|
|
134
|
+
{
|
|
135
|
+
ruleId: 'graph:large-function',
|
|
136
|
+
message: 'a seeded finding',
|
|
137
|
+
severity: 'warning',
|
|
138
|
+
filePath: 'index.ts',
|
|
139
|
+
line: 1,
|
|
140
|
+
violationCount: 1,
|
|
141
|
+
},
|
|
142
|
+
],
|
|
143
|
+
},
|
|
144
|
+
],
|
|
145
|
+
},
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
beforeAll(async () => {
|
|
149
|
+
if (!existsSync(CLI_DIST)) {
|
|
150
|
+
throw new Error(`e2e requires the built CLI at ${CLI_DIST}. Run \`pnpm build\` before the MCP test suite.`);
|
|
151
|
+
}
|
|
152
|
+
// Fixture A: seed a REAL catalog + a fit session into the project datastore.
|
|
153
|
+
fixtureA = scaffold();
|
|
154
|
+
const store = openProjectStore(fixtureA);
|
|
155
|
+
const scope = new RunScope();
|
|
156
|
+
applyToolContributeScope(scope, graphTool);
|
|
157
|
+
const outcome = await runWithScope(scope, () => {
|
|
158
|
+
currentAdapterRegistry().register(typescriptGraphAdapter);
|
|
159
|
+
return runGraph({ cwd: fixtureA, datastore: store });
|
|
160
|
+
});
|
|
161
|
+
const catalog = outcome.catalog;
|
|
162
|
+
if (catalog === null)
|
|
163
|
+
throw new Error('e2e seeding failed: runGraph produced no catalog');
|
|
164
|
+
// Recover helper's symbolId from the seeded catalog.
|
|
165
|
+
for (const occs of Object.values(catalog.functions)) {
|
|
166
|
+
for (const occ of occs) {
|
|
167
|
+
if (occ.simpleName === 'helper') {
|
|
168
|
+
helperSymbolId = `${occ.filePath}:${String(occ.line)}:${String(occ.column)}`;
|
|
169
|
+
helperFile = occ.filePath;
|
|
170
|
+
helperLine = occ.line;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
new SessionRepo(store).save(graphSession(fixtureA));
|
|
175
|
+
store.close();
|
|
176
|
+
if (!helperSymbolId)
|
|
177
|
+
throw new Error('e2e seeding failed: helper symbol not found in catalog');
|
|
178
|
+
// Fixture B: a project with NO catalog (refresh_graph must build it).
|
|
179
|
+
fixtureB = scaffold();
|
|
180
|
+
}, 120_000);
|
|
181
|
+
afterAll(() => {
|
|
182
|
+
if (fixtureA)
|
|
183
|
+
rmSync(fixtureA, { recursive: true, force: true });
|
|
184
|
+
if (fixtureB)
|
|
185
|
+
rmSync(fixtureB, { recursive: true, force: true });
|
|
186
|
+
});
|
|
187
|
+
describe('MCP e2e over real stdio', () => {
|
|
188
|
+
it('handshakes and lists all 13 tools', async () => {
|
|
189
|
+
const conn = await connect(fixtureA);
|
|
190
|
+
try {
|
|
191
|
+
const tools = await conn.client.listTools();
|
|
192
|
+
expect(tools.tools).toHaveLength(13);
|
|
193
|
+
const names = tools.tools.map((t) => t.name).sort();
|
|
194
|
+
expect(names).toContain('get_symbol');
|
|
195
|
+
expect(names).toContain('who_calls');
|
|
196
|
+
expect(names).toContain('get_latest_findings');
|
|
197
|
+
expect(names).toContain('refresh_graph');
|
|
198
|
+
}
|
|
199
|
+
finally {
|
|
200
|
+
await conn.client.close();
|
|
201
|
+
}
|
|
202
|
+
}, 60_000);
|
|
203
|
+
it('survives an SDK-dispatched who_calls / get_symbol (scope reaches the handler)', async () => {
|
|
204
|
+
const conn = await connect(fixtureA);
|
|
205
|
+
try {
|
|
206
|
+
// who_calls: proves the captured RunScope (datastore + graph port) reached
|
|
207
|
+
// an EventEmitter-dispatched handler — not just `initialize`.
|
|
208
|
+
const who = await call(conn, 'who_calls', { symbolId: helperSymbolId, depth: 5 });
|
|
209
|
+
const callers = who.data;
|
|
210
|
+
expect(callers.some((c) => c.qualifiedName.includes('main'))).toBe(true);
|
|
211
|
+
// get_symbol over file+line resolves to a stable symbolId.
|
|
212
|
+
const sym = await call(conn, 'get_symbol', { file: helperFile, line: helperLine });
|
|
213
|
+
const resolved = (sym.data ?? sym.candidates?.[0]);
|
|
214
|
+
expect(resolved.symbolId).toBe(helperSymbolId);
|
|
215
|
+
}
|
|
216
|
+
finally {
|
|
217
|
+
await conn.client.close();
|
|
218
|
+
}
|
|
219
|
+
}, 60_000);
|
|
220
|
+
it('serves the result-first path: get_latest_findings replays a seeded run (never re-runs)', async () => {
|
|
221
|
+
const conn = await connect(fixtureA);
|
|
222
|
+
try {
|
|
223
|
+
const out = await call(conn, 'get_latest_findings', { tool: 'graph' });
|
|
224
|
+
const findings = out.data;
|
|
225
|
+
expect(findings.some((f) => f.ruleId === 'graph:large-function')).toBe(true);
|
|
226
|
+
expect(out.session).toMatchObject({ tool: 'graph' });
|
|
227
|
+
}
|
|
228
|
+
finally {
|
|
229
|
+
await conn.client.close();
|
|
230
|
+
}
|
|
231
|
+
}, 60_000);
|
|
232
|
+
it('reports freshness.fresh === false after a tracked file is mutated (stale catalog)', async () => {
|
|
233
|
+
// Mutate a tracked source file → the persisted fingerprint no longer matches.
|
|
234
|
+
writeFileSync(join(fixtureA, 'index.ts'), SOURCE + '\nexport function added(): number { return 2; }\n', 'utf8');
|
|
235
|
+
const conn = await connect(fixtureA);
|
|
236
|
+
try {
|
|
237
|
+
const arch = await call(conn, 'get_architecture', {});
|
|
238
|
+
expect(arch.freshness.fresh).toBe(false);
|
|
239
|
+
}
|
|
240
|
+
finally {
|
|
241
|
+
await conn.client.close();
|
|
242
|
+
}
|
|
243
|
+
// Restore so the fixture is reusable / idempotent.
|
|
244
|
+
writeFileSync(join(fixtureA, 'index.ts'), SOURCE, 'utf8');
|
|
245
|
+
}, 60_000);
|
|
246
|
+
it('refresh_graph builds a catalog on a project that has none (adapters load under the mcp run)', async () => {
|
|
247
|
+
const conn = await connect(fixtureB);
|
|
248
|
+
try {
|
|
249
|
+
const refreshed = await call(conn, 'refresh_graph', {});
|
|
250
|
+
expect(typeof refreshed.builtAt).toBe('string');
|
|
251
|
+
expect(typeof refreshed.durationMs).toBe('number');
|
|
252
|
+
// After the rebuild, the catalog is fresh and queryable.
|
|
253
|
+
const search = await call(conn, 'search_symbols', { query: 'helper' });
|
|
254
|
+
expect(search.data.length).toBeGreaterThan(0);
|
|
255
|
+
}
|
|
256
|
+
finally {
|
|
257
|
+
await conn.client.close();
|
|
258
|
+
}
|
|
259
|
+
}, 120_000);
|
|
260
|
+
it('exits cleanly on stdin close and keeps stdout pure JSON-RPC (diagnostics on stderr)', async () => {
|
|
261
|
+
const conn = await connect(fixtureA);
|
|
262
|
+
// Every prior frame parsed by the SDK is itself proof stdout carried only
|
|
263
|
+
// JSON-RPC (a stray stdout line would break the framed parse). Diagnostics
|
|
264
|
+
// ride stderr — assert the structured start event landed there.
|
|
265
|
+
await conn.client.listTools();
|
|
266
|
+
await conn.client.close();
|
|
267
|
+
// A graceful close resolves; the child process is torn down by the transport.
|
|
268
|
+
expect(conn.stderr).toContain('mcp.server.start');
|
|
269
|
+
}, 60_000);
|
|
270
|
+
});
|
|
271
|
+
//# sourceMappingURL=e2e-stdio.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"e2e-stdio.test.js","sourceRoot":"","sources":["../../src/__tests__/e2e-stdio.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACpF,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,wBAAwB,EACxB,mBAAmB,EACnB,QAAQ,EACR,YAAY,GACb,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,gBAAgB,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,EAAE,CAAC,qFAAqF,EAAE,KAAK,IAAI,EAAE;QACnG,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,QAAQ,CAAC,CAAC;QACrC,0EAA0E;QAC1E,2EAA2E;QAC3E,gEAAgE;QAChE,MAAM,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC;QAC9B,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;QAC1B,8EAA8E;QAC9E,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,kBAAkB,CAAC,CAAC;IACpD,CAAC,EAAE,MAAM,CAAC,CAAC;AACb,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Catalog freshness mapping (Task 6.1 — Persistence/freshness).
|
|
3
|
+
*
|
|
4
|
+
* Maps the graph engine's `CatalogVerdict` to the agent-facing `Freshness` DTO,
|
|
5
|
+
* and recovers the working-tree `ValidationContext` from a catalog's recorded
|
|
6
|
+
* `filesFingerprint`. Pure verdict→DTO logic — no engine re-entry.
|
|
7
|
+
*/
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=freshness.test.d.ts.map
|