simplify3x-connect 0.0.0-stage → 0.28.1
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 +21 -0
- package/README.md +117 -3
- package/dist/acText.d.ts +12 -0
- package/dist/acText.d.ts.map +1 -0
- package/dist/acText.js +44 -0
- package/dist/acText.js.map +1 -0
- package/dist/adapters/factory.d.ts +25 -0
- package/dist/adapters/factory.d.ts.map +1 -0
- package/dist/adapters/factory.js +55 -0
- package/dist/adapters/factory.js.map +1 -0
- package/dist/adapters/http.d.ts +62 -0
- package/dist/adapters/http.d.ts.map +1 -0
- package/dist/adapters/http.js +138 -0
- package/dist/adapters/http.js.map +1 -0
- package/dist/adapters/remoteMcp/adapter.d.ts +112 -0
- package/dist/adapters/remoteMcp/adapter.d.ts.map +1 -0
- package/dist/adapters/remoteMcp/adapter.js +259 -0
- package/dist/adapters/remoteMcp/adapter.js.map +1 -0
- package/dist/adapters/simplifyqa/adapter.d.ts +1390 -0
- package/dist/adapters/simplifyqa/adapter.d.ts.map +1 -0
- package/dist/adapters/simplifyqa/adapter.js +9126 -0
- package/dist/adapters/simplifyqa/adapter.js.map +1 -0
- package/dist/adapters/simplifyqa/apiFailureReason.d.ts +11 -0
- package/dist/adapters/simplifyqa/apiFailureReason.d.ts.map +1 -0
- package/dist/adapters/simplifyqa/apiFailureReason.js +35 -0
- package/dist/adapters/simplifyqa/apiFailureReason.js.map +1 -0
- package/dist/adapters/simplifyqa/desktopConditions.d.ts +50 -0
- package/dist/adapters/simplifyqa/desktopConditions.d.ts.map +1 -0
- package/dist/adapters/simplifyqa/desktopConditions.js +95 -0
- package/dist/adapters/simplifyqa/desktopConditions.js.map +1 -0
- package/dist/adapters/simplifyqa/executionFailures.d.ts +59 -0
- package/dist/adapters/simplifyqa/executionFailures.d.ts.map +1 -0
- package/dist/adapters/simplifyqa/executionFailures.js +641 -0
- package/dist/adapters/simplifyqa/executionFailures.js.map +1 -0
- package/dist/adapters/simplifyqa/failureCategory.d.ts +26 -0
- package/dist/adapters/simplifyqa/failureCategory.d.ts.map +1 -0
- package/dist/adapters/simplifyqa/failureCategory.js +208 -0
- package/dist/adapters/simplifyqa/failureCategory.js.map +1 -0
- package/dist/adapters/simplifyqa/failureReport.d.ts +50 -0
- package/dist/adapters/simplifyqa/failureReport.d.ts.map +1 -0
- package/dist/adapters/simplifyqa/failureReport.js +383 -0
- package/dist/adapters/simplifyqa/failureReport.js.map +1 -0
- package/dist/adapters/simplifyqa/failureTypes.d.ts +193 -0
- package/dist/adapters/simplifyqa/failureTypes.d.ts.map +1 -0
- package/dist/adapters/simplifyqa/failureTypes.js +8 -0
- package/dist/adapters/simplifyqa/failureTypes.js.map +1 -0
- package/dist/adapters/simplifyqa/flow.d.ts +58 -0
- package/dist/adapters/simplifyqa/flow.d.ts.map +1 -0
- package/dist/adapters/simplifyqa/flow.js +335 -0
- package/dist/adapters/simplifyqa/flow.js.map +1 -0
- package/dist/adapters/simplifyqa/functionMatch.d.ts +53 -0
- package/dist/adapters/simplifyqa/functionMatch.d.ts.map +1 -0
- package/dist/adapters/simplifyqa/functionMatch.js +110 -0
- package/dist/adapters/simplifyqa/functionMatch.js.map +1 -0
- package/dist/adapters/simplifyqa/heal/apply.d.ts +59 -0
- package/dist/adapters/simplifyqa/heal/apply.d.ts.map +1 -0
- package/dist/adapters/simplifyqa/heal/apply.js +213 -0
- package/dist/adapters/simplifyqa/heal/apply.js.map +1 -0
- package/dist/adapters/simplifyqa/heal/diagnose.d.ts +24 -0
- package/dist/adapters/simplifyqa/heal/diagnose.d.ts.map +1 -0
- package/dist/adapters/simplifyqa/heal/diagnose.js +211 -0
- package/dist/adapters/simplifyqa/heal/diagnose.js.map +1 -0
- package/dist/adapters/simplifyqa/heal/index.d.ts +37 -0
- package/dist/adapters/simplifyqa/heal/index.d.ts.map +1 -0
- package/dist/adapters/simplifyqa/heal/index.js +83 -0
- package/dist/adapters/simplifyqa/heal/index.js.map +1 -0
- package/dist/adapters/simplifyqa/heal/plan.d.ts +67 -0
- package/dist/adapters/simplifyqa/heal/plan.d.ts.map +1 -0
- package/dist/adapters/simplifyqa/heal/plan.js +338 -0
- package/dist/adapters/simplifyqa/heal/plan.js.map +1 -0
- package/dist/adapters/simplifyqa/heal/store.d.ts +10 -0
- package/dist/adapters/simplifyqa/heal/store.d.ts.map +1 -0
- package/dist/adapters/simplifyqa/heal/store.js +40 -0
- package/dist/adapters/simplifyqa/heal/store.js.map +1 -0
- package/dist/adapters/simplifyqa/mapLimit.d.ts +3 -0
- package/dist/adapters/simplifyqa/mapLimit.d.ts.map +1 -0
- package/dist/adapters/simplifyqa/mapLimit.js +14 -0
- package/dist/adapters/simplifyqa/mapLimit.js.map +1 -0
- package/dist/adapters/simplifyqa/mapper.d.ts +159 -0
- package/dist/adapters/simplifyqa/mapper.d.ts.map +1 -0
- package/dist/adapters/simplifyqa/mapper.js +1767 -0
- package/dist/adapters/simplifyqa/mapper.js.map +1 -0
- package/dist/adapters/simplifyqa/planTree.d.ts +31 -0
- package/dist/adapters/simplifyqa/planTree.d.ts.map +1 -0
- package/dist/adapters/simplifyqa/planTree.js +110 -0
- package/dist/adapters/simplifyqa/planTree.js.map +1 -0
- package/dist/adapters/simplifyqa/searchEngine.d.ts +254 -0
- package/dist/adapters/simplifyqa/searchEngine.d.ts.map +1 -0
- package/dist/adapters/simplifyqa/searchEngine.js +1248 -0
- package/dist/adapters/simplifyqa/searchEngine.js.map +1 -0
- package/dist/adapters/simplifyqa/searchRegistry.d.ts +117 -0
- package/dist/adapters/simplifyqa/searchRegistry.d.ts.map +1 -0
- package/dist/adapters/simplifyqa/searchRegistry.js +1664 -0
- package/dist/adapters/simplifyqa/searchRegistry.js.map +1 -0
- package/dist/adapters/simplifyqa/searchResolve.d.ts +84 -0
- package/dist/adapters/simplifyqa/searchResolve.d.ts.map +1 -0
- package/dist/adapters/simplifyqa/searchResolve.js +319 -0
- package/dist/adapters/simplifyqa/searchResolve.js.map +1 -0
- package/dist/adapters/simplifyqa/stepDiagnostics.d.ts +25 -0
- package/dist/adapters/simplifyqa/stepDiagnostics.d.ts.map +1 -0
- package/dist/adapters/simplifyqa/stepDiagnostics.js +89 -0
- package/dist/adapters/simplifyqa/stepDiagnostics.js.map +1 -0
- package/dist/adapters/simplifyqa/stepRules.d.ts +91 -0
- package/dist/adapters/simplifyqa/stepRules.d.ts.map +1 -0
- package/dist/adapters/simplifyqa/stepRules.js +228 -0
- package/dist/adapters/simplifyqa/stepRules.js.map +1 -0
- package/dist/adapters/types.d.ts +514 -0
- package/dist/adapters/types.d.ts.map +1 -0
- package/dist/adapters/types.js +2 -0
- package/dist/adapters/types.js.map +1 -0
- package/dist/adapters/walnut/actionTypes.d.ts +16 -0
- package/dist/adapters/walnut/actionTypes.d.ts.map +1 -0
- package/dist/adapters/walnut/actionTypes.js +178 -0
- package/dist/adapters/walnut/actionTypes.js.map +1 -0
- package/dist/adapters/walnut/adapter.d.ts +235 -0
- package/dist/adapters/walnut/adapter.d.ts.map +1 -0
- package/dist/adapters/walnut/adapter.js +1120 -0
- package/dist/adapters/walnut/adapter.js.map +1 -0
- package/dist/adapters/walnut/mapper.d.ts +55 -0
- package/dist/adapters/walnut/mapper.d.ts.map +1 -0
- package/dist/adapters/walnut/mapper.js +364 -0
- package/dist/adapters/walnut/mapper.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +38 -0
- package/dist/cli.js.map +1 -0
- package/dist/config.d.ts +109 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +272 -0
- package/dist/config.js.map +1 -0
- package/dist/connection.d.ts +105 -0
- package/dist/connection.d.ts.map +1 -0
- package/dist/connection.js +255 -0
- package/dist/connection.js.map +1 -0
- package/dist/domain/heal.d.ts +163 -0
- package/dist/domain/heal.d.ts.map +1 -0
- package/dist/domain/heal.js +55 -0
- package/dist/domain/heal.js.map +1 -0
- package/dist/domain/types.d.ts +1328 -0
- package/dist/domain/types.d.ts.map +1 -0
- package/dist/domain/types.js +8 -0
- package/dist/domain/types.js.map +1 -0
- package/dist/domain/validate.d.ts +3 -0
- package/dist/domain/validate.d.ts.map +1 -0
- package/dist/domain/validate.js +67 -0
- package/dist/domain/validate.js.map +1 -0
- package/dist/drafts/apiPatch.d.ts +9 -0
- package/dist/drafts/apiPatch.d.ts.map +1 -0
- package/dist/drafts/apiPatch.js +27 -0
- package/dist/drafts/apiPatch.js.map +1 -0
- package/dist/drafts/bulk.d.ts +24 -0
- package/dist/drafts/bulk.d.ts.map +1 -0
- package/dist/drafts/bulk.js +44 -0
- package/dist/drafts/bulk.js.map +1 -0
- package/dist/drafts/duplicate.d.ts +12 -0
- package/dist/drafts/duplicate.d.ts.map +1 -0
- package/dist/drafts/duplicate.js +59 -0
- package/dist/drafts/duplicate.js.map +1 -0
- package/dist/drafts/store.d.ts +91 -0
- package/dist/drafts/store.d.ts.map +1 -0
- package/dist/drafts/store.js +244 -0
- package/dist/drafts/store.js.map +1 -0
- package/dist/gateway.d.ts +37 -0
- package/dist/gateway.d.ts.map +1 -0
- package/dist/gateway.js +71 -0
- package/dist/gateway.js.map +1 -0
- package/dist/httpMain.d.ts +3 -0
- package/dist/httpMain.d.ts.map +1 -0
- package/dist/httpMain.js +20 -0
- package/dist/httpMain.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +46 -0
- package/dist/index.js.map +1 -0
- package/dist/initAgents.d.ts +2 -0
- package/dist/initAgents.d.ts.map +1 -0
- package/dist/initAgents.js +508 -0
- package/dist/initAgents.js.map +1 -0
- package/dist/log.d.ts +17 -0
- package/dist/log.d.ts.map +1 -0
- package/dist/log.js +49 -0
- package/dist/log.js.map +1 -0
- package/dist/mcpResult.d.ts +39 -0
- package/dist/mcpResult.d.ts.map +1 -0
- package/dist/mcpResult.js +19 -0
- package/dist/mcpResult.js.map +1 -0
- package/dist/mount.d.ts +33 -0
- package/dist/mount.d.ts.map +1 -0
- package/dist/mount.js +213 -0
- package/dist/mount.js.map +1 -0
- package/dist/paramTokens.d.ts +18 -0
- package/dist/paramTokens.d.ts.map +1 -0
- package/dist/paramTokens.js +50 -0
- package/dist/paramTokens.js.map +1 -0
- package/dist/projectStore.d.ts +5 -0
- package/dist/projectStore.d.ts.map +1 -0
- package/dist/projectStore.js +60 -0
- package/dist/projectStore.js.map +1 -0
- package/dist/requestConnection.d.ts +22 -0
- package/dist/requestConnection.d.ts.map +1 -0
- package/dist/requestConnection.js +50 -0
- package/dist/requestConnection.js.map +1 -0
- package/dist/serve.d.ts +10 -0
- package/dist/serve.d.ts.map +1 -0
- package/dist/serve.js +37 -0
- package/dist/serve.js.map +1 -0
- package/dist/server.d.ts +41 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +370 -0
- package/dist/server.js.map +1 -0
- package/dist/tools/actionCatalog.d.ts +24 -0
- package/dist/tools/actionCatalog.d.ts.map +1 -0
- package/dist/tools/actionCatalog.js +56 -0
- package/dist/tools/actionCatalog.js.map +1 -0
- package/dist/tools/attachment.tools.d.ts +15 -0
- package/dist/tools/attachment.tools.d.ts.map +1 -0
- package/dist/tools/attachment.tools.js +104 -0
- package/dist/tools/attachment.tools.js.map +1 -0
- package/dist/tools/backlog.tools.d.ts +13 -0
- package/dist/tools/backlog.tools.d.ts.map +1 -0
- package/dist/tools/backlog.tools.js +690 -0
- package/dist/tools/backlog.tools.js.map +1 -0
- package/dist/tools/connection.tools.d.ts +16 -0
- package/dist/tools/connection.tools.d.ts.map +1 -0
- package/dist/tools/connection.tools.js +120 -0
- package/dist/tools/connection.tools.js.map +1 -0
- package/dist/tools/defects.tools.d.ts +7 -0
- package/dist/tools/defects.tools.d.ts.map +1 -0
- package/dist/tools/defects.tools.js +108 -0
- package/dist/tools/defects.tools.js.map +1 -0
- package/dist/tools/discovery.tools.d.ts +23 -0
- package/dist/tools/discovery.tools.d.ts.map +1 -0
- package/dist/tools/discovery.tools.js +1746 -0
- package/dist/tools/discovery.tools.js.map +1 -0
- package/dist/tools/executionPlan.tools.d.ts +14 -0
- package/dist/tools/executionPlan.tools.d.ts.map +1 -0
- package/dist/tools/executionPlan.tools.js +184 -0
- package/dist/tools/executionPlan.tools.js.map +1 -0
- package/dist/tools/failure.tools.d.ts +14 -0
- package/dist/tools/failure.tools.d.ts.map +1 -0
- package/dist/tools/failure.tools.js +65 -0
- package/dist/tools/failure.tools.js.map +1 -0
- package/dist/tools/formulas.tools.d.ts +7 -0
- package/dist/tools/formulas.tools.d.ts.map +1 -0
- package/dist/tools/formulas.tools.js +84 -0
- package/dist/tools/formulas.tools.js.map +1 -0
- package/dist/tools/functionReuse.d.ts +77 -0
- package/dist/tools/functionReuse.d.ts.map +1 -0
- package/dist/tools/functionReuse.js +384 -0
- package/dist/tools/functionReuse.js.map +1 -0
- package/dist/tools/gapAnalysis.tools.d.ts +31 -0
- package/dist/tools/gapAnalysis.tools.d.ts.map +1 -0
- package/dist/tools/gapAnalysis.tools.js +287 -0
- package/dist/tools/gapAnalysis.tools.js.map +1 -0
- package/dist/tools/heal.tools.d.ts +20 -0
- package/dist/tools/heal.tools.d.ts.map +1 -0
- package/dist/tools/heal.tools.js +268 -0
- package/dist/tools/heal.tools.js.map +1 -0
- package/dist/tools/impactAnalysis.tools.d.ts +17 -0
- package/dist/tools/impactAnalysis.tools.d.ts.map +1 -0
- package/dist/tools/impactAnalysis.tools.js +352 -0
- package/dist/tools/impactAnalysis.tools.js.map +1 -0
- package/dist/tools/markdown.d.ts +13 -0
- package/dist/tools/markdown.d.ts.map +1 -0
- package/dist/tools/markdown.js +145 -0
- package/dist/tools/markdown.js.map +1 -0
- package/dist/tools/objects.tools.d.ts +7 -0
- package/dist/tools/objects.tools.d.ts.map +1 -0
- package/dist/tools/objects.tools.js +458 -0
- package/dist/tools/objects.tools.js.map +1 -0
- package/dist/tools/pipeline.tools.d.ts +11 -0
- package/dist/tools/pipeline.tools.d.ts.map +1 -0
- package/dist/tools/pipeline.tools.js +100 -0
- package/dist/tools/pipeline.tools.js.map +1 -0
- package/dist/tools/preference.tools.d.ts +15 -0
- package/dist/tools/preference.tools.d.ts.map +1 -0
- package/dist/tools/preference.tools.js +114 -0
- package/dist/tools/preference.tools.js.map +1 -0
- package/dist/tools/privileges.tools.d.ts +65 -0
- package/dist/tools/privileges.tools.d.ts.map +1 -0
- package/dist/tools/privileges.tools.js +186 -0
- package/dist/tools/privileges.tools.js.map +1 -0
- package/dist/tools/project.tools.d.ts +13 -0
- package/dist/tools/project.tools.d.ts.map +1 -0
- package/dist/tools/project.tools.js +199 -0
- package/dist/tools/project.tools.js.map +1 -0
- package/dist/tools/query.tools.d.ts +23 -0
- package/dist/tools/query.tools.d.ts.map +1 -0
- package/dist/tools/query.tools.js +368 -0
- package/dist/tools/query.tools.js.map +1 -0
- package/dist/tools/recording.tools.d.ts +58 -0
- package/dist/tools/recording.tools.d.ts.map +1 -0
- package/dist/tools/recording.tools.js +1050 -0
- package/dist/tools/recording.tools.js.map +1 -0
- package/dist/tools/recordingNames.d.ts +3 -0
- package/dist/tools/recordingNames.d.ts.map +1 -0
- package/dist/tools/recordingNames.js +16 -0
- package/dist/tools/recordingNames.js.map +1 -0
- package/dist/tools/report.tools.d.ts +12 -0
- package/dist/tools/report.tools.d.ts.map +1 -0
- package/dist/tools/report.tools.js +104 -0
- package/dist/tools/report.tools.js.map +1 -0
- package/dist/tools/run.tools.d.ts +25 -0
- package/dist/tools/run.tools.d.ts.map +1 -0
- package/dist/tools/run.tools.js +1295 -0
- package/dist/tools/run.tools.js.map +1 -0
- package/dist/tools/schemas.d.ts +860 -0
- package/dist/tools/schemas.d.ts.map +1 -0
- package/dist/tools/schemas.js +220 -0
- package/dist/tools/schemas.js.map +1 -0
- package/dist/tools/storySync.tools.d.ts +167 -0
- package/dist/tools/storySync.tools.d.ts.map +1 -0
- package/dist/tools/storySync.tools.js +678 -0
- package/dist/tools/storySync.tools.js.map +1 -0
- package/dist/tools/suiteManage.tools.d.ts +14 -0
- package/dist/tools/suiteManage.tools.d.ts.map +1 -0
- package/dist/tools/suiteManage.tools.js +112 -0
- package/dist/tools/suiteManage.tools.js.map +1 -0
- package/dist/tools/tasks.tools.d.ts +7 -0
- package/dist/tools/tasks.tools.d.ts.map +1 -0
- package/dist/tools/tasks.tools.js +101 -0
- package/dist/tools/tasks.tools.js.map +1 -0
- package/dist/tools/tcEditPublisher.d.ts +29 -0
- package/dist/tools/tcEditPublisher.d.ts.map +1 -0
- package/dist/tools/tcEditPublisher.js +61 -0
- package/dist/tools/tcEditPublisher.js.map +1 -0
- package/dist/tools/testCaseLint.d.ts +5 -0
- package/dist/tools/testCaseLint.d.ts.map +1 -0
- package/dist/tools/testCaseLint.js +112 -0
- package/dist/tools/testCaseLint.js.map +1 -0
- package/dist/tools/testPlan.tools.d.ts +12 -0
- package/dist/tools/testPlan.tools.d.ts.map +1 -0
- package/dist/tools/testPlan.tools.js +104 -0
- package/dist/tools/testPlan.tools.js.map +1 -0
- package/dist/tools/testcase.tools.d.ts +86 -0
- package/dist/tools/testcase.tools.d.ts.map +1 -0
- package/dist/tools/testcase.tools.js +1591 -0
- package/dist/tools/testcase.tools.js.map +1 -0
- package/dist/tools/testdata.tools.d.ts +7 -0
- package/dist/tools/testdata.tools.d.ts.map +1 -0
- package/dist/tools/testdata.tools.js +636 -0
- package/dist/tools/testdata.tools.js.map +1 -0
- package/dist/tools/xlsx.d.ts +8 -0
- package/dist/tools/xlsx.d.ts.map +1 -0
- package/dist/tools/xlsx.js +113 -0
- package/dist/tools/xlsx.js.map +1 -0
- package/dist/vendor/actionSignatures.d.ts +117 -0
- package/dist/vendor/actionSignatures.d.ts.map +1 -0
- package/dist/vendor/actionSignatures.js +420 -0
- package/dist/vendor/actionSignatures.js.map +1 -0
- package/dist/vendor/logger.d.ts +43 -0
- package/dist/vendor/logger.d.ts.map +1 -0
- package/dist/vendor/logger.js +184 -0
- package/dist/vendor/logger.js.map +1 -0
- package/dist/version.d.ts +10 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +10 -0
- package/dist/version.js.map +1 -0
- package/dist/versionName.d.ts +21 -0
- package/dist/versionName.d.ts.map +1 -0
- package/dist/versionName.js +48 -0
- package/dist/versionName.js.map +1 -0
- package/package.json +62 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Simplify3x
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,117 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
# Common QA MCP
|
|
2
|
+
|
|
3
|
+
One **product-neutral MCP** that any AI client (Claude Code, Cursor, Windsurf, VS Code, Codex,
|
|
4
|
+
Devin) connects to with a **URL + token** to drive the whole test-case lifecycle —
|
|
5
|
+
**discover · author · record · run · triage** — against **Walnut** or **SimplifyQA**. The client
|
|
6
|
+
sees one tool vocabulary regardless of the product behind it.
|
|
7
|
+
|
|
8
|
+
## Install
|
|
9
|
+
|
|
10
|
+
Nothing to clone or build — clients launch it over stdio with `npx`. Requires **Node ≥ 20**.
|
|
11
|
+
|
|
12
|
+
Add it to your client's MCP config (`.mcp.json` for Claude Code / Cursor / Windsurf):
|
|
13
|
+
|
|
14
|
+
```json
|
|
15
|
+
{
|
|
16
|
+
"mcpServers": {
|
|
17
|
+
"simplify3x-connect": {
|
|
18
|
+
"command": "npx",
|
|
19
|
+
"args": ["-y", "simplify3x-connect"],
|
|
20
|
+
"env": {
|
|
21
|
+
"QA_MCP_PROVIDER": "walnut",
|
|
22
|
+
"QA_BASE_URL": "https://<your-backend>",
|
|
23
|
+
"QA_MCP_URL": "http://127.0.0.1:4050/mcp",
|
|
24
|
+
"QA_MCP_TOKEN": "<your-token>",
|
|
25
|
+
"QA_MCP_PROJECT_ID": "<optional-project-id>"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
| Env var | Required | Purpose |
|
|
33
|
+
|---|:---:|---|
|
|
34
|
+
| `QA_MCP_PROVIDER` | — | `walnut` (default) or `simplifyqa`. |
|
|
35
|
+
| `QA_BASE_URL` | ✓\* | Product **backend REST** — drives discover / author / run / triage (no agent needed). |
|
|
36
|
+
| `QA_MCP_URL` | ✓\* | Your **local agent's `/mcp`** — adds **recording** + journal editing (browser / mainframe). |
|
|
37
|
+
| `QA_MCP_TOKEN` | ✓ | Raw auth token (JWT — **no** `Bearer` prefix). |
|
|
38
|
+
| `QA_MCP_PROJECT_ID` | — | Pin a default project; omit and you'll be asked (change anytime with `qa_switch_project`). |
|
|
39
|
+
|
|
40
|
+
\* Set **`QA_BASE_URL`** for the lifecycle over direct REST, and **`QA_MCP_URL`** to add recording.
|
|
41
|
+
Set **both** for the full experience, or only `QA_BASE_URL` for a zero-agent setup (no recording).
|
|
42
|
+
With **neither** set it starts **offline** — draft authoring only — and you connect later from chat
|
|
43
|
+
with `qa_connect`.
|
|
44
|
+
|
|
45
|
+
> **Recording** (`web` / `mainframe`/ `mobile`) runs on the local agent, so `QA_MCP_URL` must point at a
|
|
46
|
+
> **running** agent.
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
## Run it as a server (HTTP)
|
|
50
|
+
|
|
51
|
+
The stdio entry is for a single developer's client. To serve several clients from one machine or a
|
|
52
|
+
container, run the gateway:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
npm run build
|
|
56
|
+
HOST=0.0.0.0 PORT=4060 npm run start:http
|
|
57
|
+
# simplify3x-connect gateway ready on http://0.0.0.0:4060/mcp
|
|
58
|
+
# health: http://0.0.0.0:4060/health ready: http://0.0.0.0:4060/ready
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Point any Streamable-HTTP MCP client at `http://<host>:4060/mcp`.
|
|
62
|
+
|
|
63
|
+
### Authentication
|
|
64
|
+
|
|
65
|
+
Two independent controls, because they answer different questions:
|
|
66
|
+
|
|
67
|
+
| Variable | Answers | Effect |
|
|
68
|
+
|---|---|---|
|
|
69
|
+
| `QA_MCP_GATEWAY_TOKEN` | may this caller reach the MCP at all? | shared secret; `/mcp` rejects anything else with 401 + `WWW-Authenticate` |
|
|
70
|
+
| `QA_MCP_REQUIRE_CLIENT_TOKEN=true` | who is this caller in the product? | every request must carry its own product token (`Authorization` / `x-qa-token`), and the session connects with it |
|
|
71
|
+
|
|
72
|
+
With per-user mode on, put the gateway secret in `x-gateway-token` so it does not collide with the
|
|
73
|
+
product token in `Authorization`.
|
|
74
|
+
|
|
75
|
+
**Nothing secret is ever logged.** `mask()` reports only whether a token is set, every line written by
|
|
76
|
+
the shared `log()` sink is pattern-redacted (Bearer credentials, JWTs, provider API keys,
|
|
77
|
+
`token=`/`password=` forms), and the resolved token is registered with the file logger so even a raw
|
|
78
|
+
`WALNUT_LOG_FILE` line cannot contain it. `DEBUG=1` goes through the same redaction.
|
|
79
|
+
|
|
80
|
+
**Each MCP session gets its own connection and adapter.** One user's `qa_connect`, project switch or
|
|
81
|
+
token can never affect another session — the behaviour that made a shared gateway unsafe. The draft
|
|
82
|
+
store is still shared so a draft survives a reconnect.
|
|
83
|
+
|
|
84
|
+
### Restrict where the server may call
|
|
85
|
+
|
|
86
|
+
`QA_MCP_ALLOWED_HOSTS=sqa.corp.example,agent.corp.example` limits both the startup configuration and
|
|
87
|
+
every runtime `qa_connect` to those hosts (subdomains included). Without it, a client can point the
|
|
88
|
+
gateway at any address through `baseUrl` / `url`, which is a server-side request forgery risk on a
|
|
89
|
+
shared deployment.
|
|
90
|
+
|
|
91
|
+
### Running more than one replica
|
|
92
|
+
|
|
93
|
+
The HTTP transport is stateful: sessions and drafts live in memory, so run a single replica or use
|
|
94
|
+
sticky routing keyed on `mcp-session-id`. Idle sessions are evicted after
|
|
95
|
+
`QA_MCP_SESSION_TTL_MS` (default 30 minutes), and a hard cap of `QA_MCP_MAX_SESSIONS` (default 200)
|
|
96
|
+
drops the least recently used. Request bodies are capped by `QA_MCP_MAX_BODY_BYTES` (1 MB).
|
|
97
|
+
|
|
98
|
+
Behind a proxy, disable response buffering for the SSE stream (`proxy_buffering off`,
|
|
99
|
+
`X-Accel-Buffering: no`, a read timeout of at least five minutes). `GET /mcp` without a session
|
|
100
|
+
returns 404 by design so a client re-initializes; use `/health` and `/ready` for probes, never `/mcp`.
|
|
101
|
+
|
|
102
|
+
## Install the QA agent (optional)
|
|
103
|
+
|
|
104
|
+
Drops a QA persona + tool guidance into your project so the client knows how to drive these tools:
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
npx simplify3x-connect init-agents --loop=claude # claude | cursor | windsurf | vscode | codex | devin | all
|
|
108
|
+
# --server-name <name> # must match your MCP server name (default: simplify3x-connect)
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## Use it
|
|
112
|
+
|
|
113
|
+
Reload your client, then drive it in plain language:
|
|
114
|
+
|
|
115
|
+
- _"List my projects"_ → _"switch to project X"_
|
|
116
|
+
- _"Record a login test on web"_ → answer the setup questions → review the draft → _"save it"_
|
|
117
|
+
- _"Run TC_123 on cloud"_ · _"show me the login stories"_ · _"add a loop around steps 3–5 of TC_42"_
|
package/dist/acText.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Acceptance-criteria normalisation, shared by the SQA mapper (story read) and `story_sync_testcases`
|
|
3
|
+
* (drift detection) so both see the SAME criteria list.
|
|
4
|
+
*
|
|
5
|
+
* SQA stores `acceptanceCriteria` as ONE rich-text/HTML blob
|
|
6
|
+
* (`<p><strong>AC1 - ...</strong><br>Given ...</p><p><strong>AC2 - ...`) or as an array whose items can
|
|
7
|
+
* each be such a blob (often `<ul><li>...</li></ul>`). Treating the blob as a single criterion made
|
|
8
|
+
* story-sync report one giant `ac_added` plus every real step as `ac_removed` — a false "major" drift
|
|
9
|
+
* on every linked test case (US-897 / US-941). Strip the markup, break on block boundaries, split lines.
|
|
10
|
+
*/
|
|
11
|
+
export declare function splitAcceptanceCriteria(raw: unknown): string[];
|
|
12
|
+
//# sourceMappingURL=acText.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acText.d.ts","sourceRoot":"","sources":["../src/acText.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,EAAE,CA6B9D"}
|
package/dist/acText.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Acceptance-criteria normalisation, shared by the SQA mapper (story read) and `story_sync_testcases`
|
|
3
|
+
* (drift detection) so both see the SAME criteria list.
|
|
4
|
+
*
|
|
5
|
+
* SQA stores `acceptanceCriteria` as ONE rich-text/HTML blob
|
|
6
|
+
* (`<p><strong>AC1 - ...</strong><br>Given ...</p><p><strong>AC2 - ...`) or as an array whose items can
|
|
7
|
+
* each be such a blob (often `<ul><li>...</li></ul>`). Treating the blob as a single criterion made
|
|
8
|
+
* story-sync report one giant `ac_added` plus every real step as `ac_removed` — a false "major" drift
|
|
9
|
+
* on every linked test case (US-897 / US-941). Strip the markup, break on block boundaries, split lines.
|
|
10
|
+
*/
|
|
11
|
+
export function splitAcceptanceCriteria(raw) {
|
|
12
|
+
const one = (v) => {
|
|
13
|
+
const text0 = typeof v === 'string' ? v : String(v?.description ?? v ?? '');
|
|
14
|
+
if (!text0)
|
|
15
|
+
return [];
|
|
16
|
+
let text = text0;
|
|
17
|
+
if (/<[a-z][^>]*>/i.test(text)) {
|
|
18
|
+
text = text
|
|
19
|
+
// A <br> is a soft break INSIDE one criterion (Given…/When…/Then…) → keep it in the same
|
|
20
|
+
// criterion. Only BLOCK boundaries start a new AC.
|
|
21
|
+
.replace(/<br\s*\/?>/gi, ' ')
|
|
22
|
+
.replace(/<li\b[^>]*>/gi, '\n')
|
|
23
|
+
.replace(/<\/(p|li|div|h[1-6]|tr|ul|ol|section)>/gi, '\n')
|
|
24
|
+
.replace(/<[^>]+>/g, '');
|
|
25
|
+
}
|
|
26
|
+
text = text
|
|
27
|
+
.replace(/ /gi, ' ')
|
|
28
|
+
.replace(/&/gi, '&')
|
|
29
|
+
.replace(/</gi, '<')
|
|
30
|
+
.replace(/>/gi, '>')
|
|
31
|
+
.replace(/"/gi, '"')
|
|
32
|
+
.replace(/�*39;|'/gi, "'");
|
|
33
|
+
return text
|
|
34
|
+
.split(/\r?\n/)
|
|
35
|
+
.map((s) => s.replace(/[ \t]+/g, ' ').trim())
|
|
36
|
+
.filter((s) => s.length > 0);
|
|
37
|
+
};
|
|
38
|
+
if (Array.isArray(raw))
|
|
39
|
+
return raw.flatMap(one);
|
|
40
|
+
if (raw == null)
|
|
41
|
+
return [];
|
|
42
|
+
return one(raw);
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=acText.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acText.js","sourceRoot":"","sources":["../src/acText.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,UAAU,uBAAuB,CAAC,GAAY;IAClD,MAAM,GAAG,GAAG,CAAC,CAAU,EAAY,EAAE;QACnC,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAE,CAAS,EAAE,WAAW,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;QACrF,IAAI,CAAC,KAAK;YAAE,OAAO,EAAE,CAAC;QACtB,IAAI,IAAI,GAAG,KAAK,CAAC;QACjB,IAAI,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;YAC/B,IAAI,GAAG,IAAI;gBACT,yFAAyF;gBACzF,mDAAmD;iBAClD,OAAO,CAAC,cAAc,EAAE,GAAG,CAAC;iBAC5B,OAAO,CAAC,eAAe,EAAE,IAAI,CAAC;iBAC9B,OAAO,CAAC,0CAA0C,EAAE,IAAI,CAAC;iBACzD,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;QAC7B,CAAC;QACD,IAAI,GAAG,IAAI;aACR,OAAO,CAAC,UAAU,EAAE,GAAG,CAAC;aACxB,OAAO,CAAC,SAAS,EAAE,GAAG,CAAC;aACvB,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC;aACtB,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC;aACtB,OAAO,CAAC,UAAU,EAAE,GAAG,CAAC;aACxB,OAAO,CAAC,kBAAkB,EAAE,GAAG,CAAC,CAAC;QACpC,OAAO,IAAI;aACR,KAAK,CAAC,OAAO,CAAC;aACd,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;aAC5C,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACjC,CAAC,CAAC;IACF,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;QAAE,OAAO,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAChD,IAAI,GAAG,IAAI,IAAI;QAAE,OAAO,EAAE,CAAC;IAC3B,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ProviderAdapter } from './types.js';
|
|
2
|
+
import type { QaConfig } from '../config.js';
|
|
3
|
+
/**
|
|
4
|
+
* Builds the adapter for the current connection (design note §3).
|
|
5
|
+
*
|
|
6
|
+
* Routing (non-breaking, purely additive):
|
|
7
|
+
* - offline → null (draft authoring needs no backend).
|
|
8
|
+
* - simplifyqa WITH a resolvable REST base (explicit `baseUrl` OR a JWT `url` claim on the token)
|
|
9
|
+
* → SimplifyQaAdapter: DIRECT to the SimplifyQA backend REST, plus an OPTIONAL agent hop
|
|
10
|
+
* (`config.url` = the local agent /mcp) for the recording surface + writes not yet ported.
|
|
11
|
+
* - simplifyqa WITHOUT any REST base → RemoteMcpAdapter (LEGACY pure-forwarder; existing configs
|
|
12
|
+
* that use only QA_MCP_URL keep working exactly as before).
|
|
13
|
+
* - walnut WITH `baseUrl` (QA_BASE_URL) → WalnutAdapter: DIRECT to the Walnut backend REST, plus an
|
|
14
|
+
* OPTIONAL agent hop (`config.url` = the local agent /mcp) for recording + save-with-editor. This
|
|
15
|
+
* lets a cloud editor with no local agent drive the whole lifecycle except recording.
|
|
16
|
+
* - walnut WITHOUT `baseUrl` (only `config.url` set) → RemoteMcpAdapter: the LEGACY pure-forwarder,
|
|
17
|
+
* so existing configs (QA_MCP_URL = agent, no QA_BASE_URL) keep working exactly as before.
|
|
18
|
+
*
|
|
19
|
+
* `WalnutAdapter` and `SimplifyQaAdapter` implement only their direct-REST subsets of
|
|
20
|
+
* `ProviderAdapter` (writes / testdata / run dispatch / … are ported incrementally), so the cast
|
|
21
|
+
* bridges the gap — unported ops on those adapters delegate to their agent hop when configured, or
|
|
22
|
+
* throw a clear "not yet ported / configure the hop" error otherwise.
|
|
23
|
+
*/
|
|
24
|
+
export declare function createAdapter(config: QaConfig): ProviderAdapter | null;
|
|
25
|
+
//# sourceMappingURL=factory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../src/adapters/factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,KAAK,EAAqB,QAAQ,EAAE,MAAM,cAAc,CAAC;AAMhE;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,QAAQ,GAAG,eAAe,GAAG,IAAI,CAsBtE"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { jwtStringClaim } from '../config.js';
|
|
2
|
+
import { RemoteMcpAdapter } from './remoteMcp/adapter.js';
|
|
3
|
+
import { WalnutAdapter } from './walnut/adapter.js';
|
|
4
|
+
import { SimplifyQaAdapter } from './simplifyqa/adapter.js';
|
|
5
|
+
/**
|
|
6
|
+
* Builds the adapter for the current connection (design note §3).
|
|
7
|
+
*
|
|
8
|
+
* Routing (non-breaking, purely additive):
|
|
9
|
+
* - offline → null (draft authoring needs no backend).
|
|
10
|
+
* - simplifyqa WITH a resolvable REST base (explicit `baseUrl` OR a JWT `url` claim on the token)
|
|
11
|
+
* → SimplifyQaAdapter: DIRECT to the SimplifyQA backend REST, plus an OPTIONAL agent hop
|
|
12
|
+
* (`config.url` = the local agent /mcp) for the recording surface + writes not yet ported.
|
|
13
|
+
* - simplifyqa WITHOUT any REST base → RemoteMcpAdapter (LEGACY pure-forwarder; existing configs
|
|
14
|
+
* that use only QA_MCP_URL keep working exactly as before).
|
|
15
|
+
* - walnut WITH `baseUrl` (QA_BASE_URL) → WalnutAdapter: DIRECT to the Walnut backend REST, plus an
|
|
16
|
+
* OPTIONAL agent hop (`config.url` = the local agent /mcp) for recording + save-with-editor. This
|
|
17
|
+
* lets a cloud editor with no local agent drive the whole lifecycle except recording.
|
|
18
|
+
* - walnut WITHOUT `baseUrl` (only `config.url` set) → RemoteMcpAdapter: the LEGACY pure-forwarder,
|
|
19
|
+
* so existing configs (QA_MCP_URL = agent, no QA_BASE_URL) keep working exactly as before.
|
|
20
|
+
*
|
|
21
|
+
* `WalnutAdapter` and `SimplifyQaAdapter` implement only their direct-REST subsets of
|
|
22
|
+
* `ProviderAdapter` (writes / testdata / run dispatch / … are ported incrementally), so the cast
|
|
23
|
+
* bridges the gap — unported ops on those adapters delegate to their agent hop when configured, or
|
|
24
|
+
* throw a clear "not yet ported / configure the hop" error otherwise.
|
|
25
|
+
*/
|
|
26
|
+
export function createAdapter(config) {
|
|
27
|
+
if (config.mode !== 'connected')
|
|
28
|
+
return null;
|
|
29
|
+
if (config.provider === 'simplifyqa') {
|
|
30
|
+
// resolveConfig / QaConnection.connect() guarantee a REST base is resolvable for SQA — either
|
|
31
|
+
// explicit `baseUrl` or a JWT `url` claim. No RemoteMcpAdapter fallback here: read-only common
|
|
32
|
+
// tools (list_projects, tc_list, …) must always speak SQA REST directly so the local agent can
|
|
33
|
+
// be off; only recording + not-yet-ported writes hop, and they fail cleanly per-tool.
|
|
34
|
+
const restBase = resolveSqaBaseUrl(config);
|
|
35
|
+
if (!restBase) {
|
|
36
|
+
throw new Error('SimplifyQA adapter needs a base URL (baseUrl or JWT `url` claim). This should have been ' +
|
|
37
|
+
'caught by resolveConfig / connect — please re-check the connection.');
|
|
38
|
+
}
|
|
39
|
+
const cfgWithBase = restBase === config.baseUrl ? config : { ...config, baseUrl: restBase };
|
|
40
|
+
return new SimplifyQaAdapter(cfgWithBase);
|
|
41
|
+
}
|
|
42
|
+
// walnut (the default): direct REST when a backend base is set, else the legacy forwarder.
|
|
43
|
+
if (config.baseUrl)
|
|
44
|
+
return new WalnutAdapter(config);
|
|
45
|
+
return new RemoteMcpAdapter(config);
|
|
46
|
+
}
|
|
47
|
+
/** Resolve the REST base URL for SQA: explicit `cfg.baseUrl` wins; else the JWT's `url` claim
|
|
48
|
+
* (SQA tokens embed the base URL). Returns undefined if neither is available. */
|
|
49
|
+
function resolveSqaBaseUrl(cfg) {
|
|
50
|
+
const explicit = cfg.baseUrl?.trim();
|
|
51
|
+
if (explicit)
|
|
52
|
+
return explicit;
|
|
53
|
+
return jwtStringClaim(cfg.token, 'url');
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=factory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"factory.js","sourceRoot":"","sources":["../../src/adapters/factory.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,UAAU,aAAa,CAAC,MAAgB;IAC5C,IAAI,MAAM,CAAC,IAAI,KAAK,WAAW;QAAE,OAAO,IAAI,CAAC;IAE7C,IAAI,MAAM,CAAC,QAAQ,KAAK,YAAY,EAAE,CAAC;QACrC,8FAA8F;QAC9F,+FAA+F;QAC/F,+FAA+F;QAC/F,sFAAsF;QACtF,MAAM,QAAQ,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;QAC3C,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,MAAM,IAAI,KAAK,CACb,0FAA0F;gBACxF,qEAAqE,CACxE,CAAC;QACJ,CAAC;QACD,MAAM,WAAW,GAAsB,QAAQ,KAAK,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;QAC/G,OAAO,IAAI,iBAAiB,CAAC,WAAW,CAA+B,CAAC;IAC1E,CAAC;IAED,2FAA2F;IAC3F,IAAI,MAAM,CAAC,OAAO;QAAE,OAAO,IAAI,aAAa,CAAC,MAAM,CAA+B,CAAC;IACnF,OAAO,IAAI,gBAAgB,CAAC,MAAM,CAAC,CAAC;AACtC,CAAC;AAED;kFACkF;AAClF,SAAS,iBAAiB,CAAC,GAAsB;IAC/C,MAAM,QAAQ,GAAG,GAAG,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC;IACrC,IAAI,QAAQ;QAAE,OAAO,QAAQ,CAAC;IAC9B,OAAO,cAAc,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAC1C,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Thrown by every QaHttp method on any non-2xx response. Downstream adapters branch
|
|
3
|
+
* on `status` (e.g. the 409 optimistic-concurrency retry, the 503
|
|
4
|
+
* EXECUTIONS_RESERVE_FIRST guidance) so `status` must be the exact upstream HTTP
|
|
5
|
+
* status code. `body` is a return value on the error, not a log line -- safe to
|
|
6
|
+
* surface to the model/user; the HTTP layer itself never logs bodies or headers.
|
|
7
|
+
*/
|
|
8
|
+
export declare class ApiError extends Error {
|
|
9
|
+
readonly status: number;
|
|
10
|
+
readonly body: string;
|
|
11
|
+
readonly url: string;
|
|
12
|
+
constructor(status: number, body: string, url: string);
|
|
13
|
+
}
|
|
14
|
+
export type MakeClientOptions = {
|
|
15
|
+
baseUrl: string;
|
|
16
|
+
headers: () => Record<string, string>;
|
|
17
|
+
/**
|
|
18
|
+
* Injectable transport. Defaults to the ambient global `fetch` (Node >=20's native
|
|
19
|
+
* Fetch API) -- production code never overrides this. Tests inject a matching
|
|
20
|
+
* implementation (e.g. undici's own `fetch` export, paired with `FormDataImpl`
|
|
21
|
+
* below) instead of mutating `globalThis`, since Node's bundled internal undici
|
|
22
|
+
* and an installed `undici` devDependency are distinct module instances that do
|
|
23
|
+
* not share MockAgent's dispatcher registry.
|
|
24
|
+
*/
|
|
25
|
+
fetchImpl?: typeof fetch;
|
|
26
|
+
/**
|
|
27
|
+
* Paired with `fetchImpl`. Verified empirically: a `FormData` instance built from
|
|
28
|
+
* the *ambient* global `FormData` constructor, handed to a *different* fetch
|
|
29
|
+
* implementation's multipart encoder, fails that encoder's internal `instanceof`
|
|
30
|
+
* check and silently degrades the whole request body to the string
|
|
31
|
+
* "[object FormData]" instead of an actual multipart payload. Whenever
|
|
32
|
+
* `fetchImpl` is overridden, `FormDataImpl` must come from the same
|
|
33
|
+
* implementation family.
|
|
34
|
+
*/
|
|
35
|
+
FormDataImpl?: typeof FormData;
|
|
36
|
+
/** Paired with FormDataImpl for symmetry; defaults to the ambient global `Blob`. */
|
|
37
|
+
BlobImpl?: typeof Blob;
|
|
38
|
+
};
|
|
39
|
+
export type QaHttp = {
|
|
40
|
+
getJson<T = unknown>(path: string): Promise<T>;
|
|
41
|
+
postJson<T = unknown>(path: string, body: unknown): Promise<T>;
|
|
42
|
+
putJson<T = unknown>(path: string, body: unknown): Promise<T>;
|
|
43
|
+
patchJson<T = unknown>(path: string, body: unknown): Promise<T>;
|
|
44
|
+
del(path: string): Promise<void>;
|
|
45
|
+
postMultipart<T = unknown>(path: string, partName: string, json: unknown): Promise<T>;
|
|
46
|
+
putMultipart?<T = unknown>(path: string, partName: string, json: unknown): Promise<T>;
|
|
47
|
+
/** SimplifyQA entity-attachment upload: one JSON part + one or more binary file parts
|
|
48
|
+
* (`filename1..N`), e.g. the epic/feature/user-story PUT the UI uses to attach a file. */
|
|
49
|
+
putMultipartWithFiles?<T = unknown>(path: string, partName: string, json: unknown, files: Array<{
|
|
50
|
+
partName: string;
|
|
51
|
+
fileName: string;
|
|
52
|
+
contentType?: string;
|
|
53
|
+
data: Uint8Array;
|
|
54
|
+
}>): Promise<T>;
|
|
55
|
+
getBinary?(path: string, timeoutMs?: number): Promise<{
|
|
56
|
+
data: Uint8Array;
|
|
57
|
+
contentType: string;
|
|
58
|
+
}>;
|
|
59
|
+
};
|
|
60
|
+
/** Builds a QaHttp bound to one base URL + one headers-callback (one product connection). */
|
|
61
|
+
export declare function makeClient(opts: MakeClientOptions): QaHttp;
|
|
62
|
+
//# sourceMappingURL=http.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/adapters/http.ts"],"names":[],"mappings":"AAcA;;;;;;GAMG;AACH,qBAAa,QAAS,SAAQ,KAAK;IACjC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;gBAET,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM;CAOtD;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,OAAO,EAAE,MAAM,CAAC;IAGhB,OAAO,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC;;;;;;;OAOG;IACH,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;IACzB;;;;;;;;OAQG;IACH,YAAY,CAAC,EAAE,OAAO,QAAQ,CAAC;IAC/B,oFAAoF;IACpF,QAAQ,CAAC,EAAE,OAAO,IAAI,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG;IACnB,OAAO,CAAC,CAAC,GAAG,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IAC/C,QAAQ,CAAC,CAAC,GAAG,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,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GAAG,MAAM,CAwD1D"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { log } from '../log.js';
|
|
2
|
+
// First N characters of a non-2xx response body kept on the thrown error -- enough
|
|
3
|
+
// for a caller to show useful diagnostic text without risking logging/echoing an
|
|
4
|
+
// unbounded (or sensitive-data-laden) upstream error page.
|
|
5
|
+
const BODY_SNIPPET_LEN = 500;
|
|
6
|
+
// Default per-request timeout. Without one, a stalled upstream (backend or the
|
|
7
|
+
// external DATA_GENERATION_URL proxy behind /tm/customFormula) freezes the whole
|
|
8
|
+
// tool call forever and the MCP client just sits at "in progress". Override with
|
|
9
|
+
// QA_HTTP_TIMEOUT_MS. 30s is generous for slow proxies; individual callers can
|
|
10
|
+
// tighten it later if needed.
|
|
11
|
+
const DEFAULT_TIMEOUT_MS = Number.parseInt(process.env['QA_HTTP_TIMEOUT_MS'] ?? '30000', 10);
|
|
12
|
+
/**
|
|
13
|
+
* Thrown by every QaHttp method on any non-2xx response. Downstream adapters branch
|
|
14
|
+
* on `status` (e.g. the 409 optimistic-concurrency retry, the 503
|
|
15
|
+
* EXECUTIONS_RESERVE_FIRST guidance) so `status` must be the exact upstream HTTP
|
|
16
|
+
* status code. `body` is a return value on the error, not a log line -- safe to
|
|
17
|
+
* surface to the model/user; the HTTP layer itself never logs bodies or headers.
|
|
18
|
+
*/
|
|
19
|
+
export class ApiError extends Error {
|
|
20
|
+
constructor(status, body, url) {
|
|
21
|
+
super(`HTTP ${status} ${url}${body ? ` — ${body}` : ''}`);
|
|
22
|
+
this.name = 'ApiError';
|
|
23
|
+
this.status = status;
|
|
24
|
+
this.body = body;
|
|
25
|
+
this.url = url;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
function joinUrl(baseUrl, path) {
|
|
29
|
+
const base = baseUrl.endsWith('/') ? baseUrl.slice(0, -1) : baseUrl;
|
|
30
|
+
const suffix = path.startsWith('/') ? path : `/${path}`;
|
|
31
|
+
return `${base}${suffix}`;
|
|
32
|
+
}
|
|
33
|
+
// Every request funnels through here: resolves the url, merges fresh auth headers
|
|
34
|
+
// with any per-call headers, reads the body once as text, logs method+path+status
|
|
35
|
+
// only (never body/headers -- both carry tokens and test data), and shapes any
|
|
36
|
+
// non-2xx into ApiError. Callers parse the returned text as needed (or ignore it,
|
|
37
|
+
// for `del`).
|
|
38
|
+
async function send(opts, method, path, init = {}) {
|
|
39
|
+
const doFetch = opts.fetchImpl ?? fetch;
|
|
40
|
+
const url = joinUrl(opts.baseUrl, path);
|
|
41
|
+
// Built incrementally (not `{ method, body: init.body, headers: {...} }`) so the
|
|
42
|
+
// `body` key is omitted entirely when absent, rather than present-with-`undefined`
|
|
43
|
+
// -- required under exactOptionalPropertyTypes, since DOM's RequestInit.body is
|
|
44
|
+
// typed `BodyInit | null` (no `| undefined`) though the property itself is optional.
|
|
45
|
+
const requestInit = { method, headers: { ...opts.headers(), ...init.headers } };
|
|
46
|
+
if (init.body !== undefined)
|
|
47
|
+
requestInit.body = init.body;
|
|
48
|
+
// AbortSignal.timeout throws a DOMException("TimeoutError") after N ms. Wrap fetch so a hung
|
|
49
|
+
// upstream surfaces a readable error instead of leaving the tool call pending forever.
|
|
50
|
+
if (Number.isFinite(DEFAULT_TIMEOUT_MS) && DEFAULT_TIMEOUT_MS > 0) {
|
|
51
|
+
requestInit.signal = AbortSignal.timeout(DEFAULT_TIMEOUT_MS);
|
|
52
|
+
}
|
|
53
|
+
let res;
|
|
54
|
+
try {
|
|
55
|
+
res = await doFetch(url, requestInit);
|
|
56
|
+
}
|
|
57
|
+
catch (e) {
|
|
58
|
+
if (e instanceof Error && (e.name === 'TimeoutError' || e.name === 'AbortError')) {
|
|
59
|
+
throw new Error(`HTTP ${method} ${path} timed out after ${DEFAULT_TIMEOUT_MS}ms (upstream did not respond).`);
|
|
60
|
+
}
|
|
61
|
+
throw e;
|
|
62
|
+
}
|
|
63
|
+
const text = await res.text();
|
|
64
|
+
log(method, path, res.status);
|
|
65
|
+
if (res.status < 200 || res.status >= 300) {
|
|
66
|
+
throw new ApiError(res.status, text.slice(0, BODY_SNIPPET_LEN), url);
|
|
67
|
+
}
|
|
68
|
+
return text;
|
|
69
|
+
}
|
|
70
|
+
function parseJson(text) {
|
|
71
|
+
return (text.length ? JSON.parse(text) : undefined);
|
|
72
|
+
}
|
|
73
|
+
const JSON_HEADERS = { 'Content-Type': 'application/json' };
|
|
74
|
+
/** Builds a QaHttp bound to one base URL + one headers-callback (one product connection). */
|
|
75
|
+
export function makeClient(opts) {
|
|
76
|
+
return {
|
|
77
|
+
async getJson(path) {
|
|
78
|
+
return parseJson(await send(opts, 'GET', path));
|
|
79
|
+
},
|
|
80
|
+
async postJson(path, body) {
|
|
81
|
+
return parseJson(await send(opts, 'POST', path, { body: JSON.stringify(body), headers: JSON_HEADERS }));
|
|
82
|
+
},
|
|
83
|
+
async putJson(path, body) {
|
|
84
|
+
return parseJson(await send(opts, 'PUT', path, { body: JSON.stringify(body), headers: JSON_HEADERS }));
|
|
85
|
+
},
|
|
86
|
+
async patchJson(path, body) {
|
|
87
|
+
return parseJson(await send(opts, 'PATCH', path, { body: JSON.stringify(body), headers: JSON_HEADERS }));
|
|
88
|
+
},
|
|
89
|
+
async del(path) {
|
|
90
|
+
await send(opts, 'DELETE', path);
|
|
91
|
+
},
|
|
92
|
+
async postMultipart(path, partName, json) {
|
|
93
|
+
return parseJson(await send(opts, 'POST', path, { body: multipartBody(opts, partName, json) }));
|
|
94
|
+
},
|
|
95
|
+
async getBinary(path, timeoutMs = 600000) {
|
|
96
|
+
const doFetch = opts.fetchImpl ?? fetch;
|
|
97
|
+
const url = joinUrl(opts.baseUrl, path);
|
|
98
|
+
let res;
|
|
99
|
+
try {
|
|
100
|
+
res = await doFetch(url, { method: 'GET', headers: { ...opts.headers() }, signal: AbortSignal.timeout(timeoutMs) });
|
|
101
|
+
}
|
|
102
|
+
catch (e) {
|
|
103
|
+
if (e instanceof Error && (e.name === 'TimeoutError' || e.name === 'AbortError')) {
|
|
104
|
+
throw new Error(`HTTP GET ${path} timed out after ${timeoutMs}ms (report still generating or upstream not responding).`);
|
|
105
|
+
}
|
|
106
|
+
throw e;
|
|
107
|
+
}
|
|
108
|
+
log('GET', path, res.status);
|
|
109
|
+
if (res.status < 200 || res.status >= 300) {
|
|
110
|
+
throw new ApiError(res.status, (await res.text()).slice(0, BODY_SNIPPET_LEN), url);
|
|
111
|
+
}
|
|
112
|
+
return { data: new Uint8Array(await res.arrayBuffer()), contentType: res.headers.get('content-type') ?? '' };
|
|
113
|
+
},
|
|
114
|
+
async putMultipart(path, partName, json) {
|
|
115
|
+
return parseJson(await send(opts, 'PUT', path, { body: multipartBody(opts, partName, json) }));
|
|
116
|
+
},
|
|
117
|
+
async putMultipartWithFiles(path, partName, json, files) {
|
|
118
|
+
const FormDataCtor = opts.FormDataImpl ?? FormData;
|
|
119
|
+
const BlobCtor = opts.BlobImpl ?? Blob;
|
|
120
|
+
const form = new FormDataCtor();
|
|
121
|
+
form.append(partName, JSON.stringify(json));
|
|
122
|
+
for (const f of files) {
|
|
123
|
+
const blob = new BlobCtor([f.data], { type: f.contentType ?? 'application/octet-stream' });
|
|
124
|
+
form.append(f.partName, blob, f.fileName);
|
|
125
|
+
}
|
|
126
|
+
return parseJson(await send(opts, 'PUT', path, { body: form }));
|
|
127
|
+
},
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
// Shared multipart body builder — one JSON part, no explicit Content-Type header (fetch computes
|
|
131
|
+
// the boundary from FormData; setting Content-Type manually would break it).
|
|
132
|
+
function multipartBody(opts, partName, json) {
|
|
133
|
+
const FormDataCtor = opts.FormDataImpl ?? FormData;
|
|
134
|
+
const form = new FormDataCtor();
|
|
135
|
+
form.append(partName, JSON.stringify(json));
|
|
136
|
+
return form;
|
|
137
|
+
}
|
|
138
|
+
//# sourceMappingURL=http.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http.js","sourceRoot":"","sources":["../../src/adapters/http.ts"],"names":[],"mappings":"A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,EAAE,CAAC;gBACtB,MAAM,IAAI,GAAG,IAAI,QAAQ,CAAC,CAAC,CAAC,CAAC,IAA2B,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,WAAW,IAAI,0BAA0B,EAAE,CAAC,CAAC;gBAClH,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC;YAC5C,CAAC;YACD,OAAO,SAAS,CAAI,MAAM,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QACrE,CAAC;KACF,CAAC;AACJ,CAAC;AAED,iGAAiG;AACjG,6EAA6E;AAC7E,SAAS,aAAa,CAAC,IAAuB,EAAE,QAAgB,EAAE,IAAa;IAC7E,MAAM,YAAY,GAAG,IAAI,CAAC,YAAY,IAAI,QAAQ,CAAC;IACnD,MAAM,IAAI,GAAG,IAAI,YAAY,EAAE,CAAC;IAChC,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;IAC5C,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import type { Transport } from '@modelcontextprotocol/sdk/shared/transport.js';
|
|
2
|
+
import type { CallToolResult } from '@modelcontextprotocol/sdk/types.js';
|
|
3
|
+
import type { ConnectedQaConfig } from '../../config.js';
|
|
4
|
+
import type { ProjectInfo, ProviderAdapter } from '../types.js';
|
|
5
|
+
import type { ActionDef, CloudRunner, DatasetInfo, DefaultIteration, EntityRef, EnvInfo, JournalOp, JournalView, Locator, MemberOp, ModuleSummary, ObjectQuery, ProjectSummary, QaObject, ReleaseQuery, ReleaseSummary, RunOptions, RunRef, RunStatus, RunTarget, SaveGeneratedIterations, SaveGeneratedIterationsResult, SavedRef, SprintQuery, SprintSummary, Story, StoryQuery, StorySummary, Suite, SuiteSummary, TcQuery, TcSummary, TestCase } from '../../domain/types.js';
|
|
6
|
+
/**
|
|
7
|
+
* RemoteMcpAdapter -- the generic "forward to a product MCP" driver of the Common QA MCP.
|
|
8
|
+
*
|
|
9
|
+
* BOTH products are reached the same way: a thin MCP CLIENT holds a connection to the product's
|
|
10
|
+
* agent MCP (`cfg.url` = that product's `/mcp` endpoint) and fulfils each neutral ProviderAdapter
|
|
11
|
+
* method by calling the correspondingly-named PROVIDER-OP tool on it (info -> `info`, listTestCases
|
|
12
|
+
* -> `list_testcases`, ...), reading the neutral payload out of `structuredContent[<key>]`. This is
|
|
13
|
+
* the provider-op contract in docs/sqa-agent-mcp-integration-guide.md -- the SAME for the Walnut MCP
|
|
14
|
+
* and the product MCP, so the Common MCP forwards to both identically.
|
|
15
|
+
*
|
|
16
|
+
* The bearer token (+ x-project-id) is forwarded to the product MCP on every request. The client
|
|
17
|
+
* connects lazily on first use (and re-arms on failure), so constructing the adapter is cheap.
|
|
18
|
+
*/
|
|
19
|
+
export type RemoteTransportFactory = () => Transport;
|
|
20
|
+
export declare class RemoteMcpAdapter implements ProviderAdapter {
|
|
21
|
+
private readonly cfg;
|
|
22
|
+
/** Test seam: inject a pre-linked in-memory transport instead of a real HTTP one. */
|
|
23
|
+
private readonly transportFactory?;
|
|
24
|
+
private clientPromise;
|
|
25
|
+
constructor(cfg: ConnectedQaConfig,
|
|
26
|
+
/** Test seam: inject a pre-linked in-memory transport instead of a real HTTP one. */
|
|
27
|
+
transportFactory?: RemoteTransportFactory | undefined);
|
|
28
|
+
private headers;
|
|
29
|
+
private client;
|
|
30
|
+
/**
|
|
31
|
+
* callTool with transparent ONE-shot reconnect on a stale session. If the product MCP was
|
|
32
|
+
* restarted, our cached client holds a dead session id and the first call throws "Session not
|
|
33
|
+
* found"; we drop the client so `client()` re-connects fresh, then retry exactly once. Any other
|
|
34
|
+
* error (or a second failure) propagates. Without this, every call after a product restart failed
|
|
35
|
+
* until THIS process was restarted too.
|
|
36
|
+
*/
|
|
37
|
+
private callTool;
|
|
38
|
+
/** Project-scoped provider-ops need a selected project. `list_projects` is the ONE exception (it
|
|
39
|
+
* lists ACROSS projects, so it must work with none selected). Guarding here turns an opaque backend
|
|
40
|
+
* 400 ("Project ID and User ID are required") into a clear instruction so the AI client asks the
|
|
41
|
+
* user to pick a project first. */
|
|
42
|
+
private assertProject;
|
|
43
|
+
/** Call a remote provider-op tool and pull the neutral payload from structuredContent[key]. */
|
|
44
|
+
private call;
|
|
45
|
+
/** For void ops (delete/stop): only surface an error, ignore any payload. */
|
|
46
|
+
private callVoid;
|
|
47
|
+
info(): Promise<ProjectInfo>;
|
|
48
|
+
listProjects(): Promise<ProjectSummary[]>;
|
|
49
|
+
listTestCases(q: TcQuery): Promise<TcSummary[]>;
|
|
50
|
+
getTestCase(id: string, versionId?: string): Promise<TestCase>;
|
|
51
|
+
createTestCase(tc: TestCase): Promise<SavedRef>;
|
|
52
|
+
updateTestCase(id: string, tc: TestCase): Promise<SavedRef>;
|
|
53
|
+
deleteTestCase(id: string): Promise<void>;
|
|
54
|
+
cloneTestCase(id: string, title: string, opts: {
|
|
55
|
+
tdCopy: boolean;
|
|
56
|
+
sourceVersionId?: string;
|
|
57
|
+
}): Promise<SavedRef>;
|
|
58
|
+
searchObjects(q: ObjectQuery): Promise<QaObject[]>;
|
|
59
|
+
createObject(o: QaObject): Promise<QaObject>;
|
|
60
|
+
actionsCatalog(platform?: string): Promise<ActionDef[]>;
|
|
61
|
+
listSuites(): Promise<SuiteSummary[]>;
|
|
62
|
+
getSuite(id: string): Promise<Suite>;
|
|
63
|
+
listStories(q: StoryQuery): Promise<StorySummary[]>;
|
|
64
|
+
getStory(id: string): Promise<Story>;
|
|
65
|
+
listModules(): Promise<ModuleSummary[]>;
|
|
66
|
+
listReleases(q: ReleaseQuery): Promise<ReleaseSummary[]>;
|
|
67
|
+
listSprints(q: SprintQuery): Promise<SprintSummary[]>;
|
|
68
|
+
readJournal(tcId: string): Promise<JournalView>;
|
|
69
|
+
editJournal(tcId: string, ops: JournalOp[]): Promise<JournalView>;
|
|
70
|
+
createSuite(s: Suite): Promise<SavedRef>;
|
|
71
|
+
updateSuiteMembers(id: string, ops: MemberOp[]): Promise<Suite>;
|
|
72
|
+
deleteSuite(id: string): Promise<void>;
|
|
73
|
+
startRun(target: RunTarget, opts: RunOptions): Promise<RunRef>;
|
|
74
|
+
getRun(runId: string): Promise<RunStatus>;
|
|
75
|
+
stopRun(runId: string): Promise<void>;
|
|
76
|
+
listCloudRunners(): Promise<CloudRunner[]>;
|
|
77
|
+
/**
|
|
78
|
+
* Raw passthrough: forward a tool call to the product MCP verbatim and return its CallToolResult.
|
|
79
|
+
* For AGENT-BOUND tools (recording/browser) the Common MCP proxies rather than wraps -- it cannot
|
|
80
|
+
* implement them (they need the product's real browser), so it relays the call and the result.
|
|
81
|
+
* Stale-session resilient via `callTool`.
|
|
82
|
+
*/
|
|
83
|
+
callRaw(name: string, args: Record<string, unknown>): Promise<CallToolResult>;
|
|
84
|
+
/** The product MCP's advertised tools (name + description + inputSchema), for building passthrough
|
|
85
|
+
* proxies of its agent-bound surface. The inputSchema is mirrored so the client's model knows each
|
|
86
|
+
* tool's real parameters (ref/object_name/expected/value/…) instead of guessing against a
|
|
87
|
+
* permissive schema. */
|
|
88
|
+
listAgentTools(): Promise<Array<{
|
|
89
|
+
name: string;
|
|
90
|
+
description?: string;
|
|
91
|
+
inputSchema?: Record<string, unknown>;
|
|
92
|
+
}>>;
|
|
93
|
+
listEnvironments(): Promise<EnvInfo[]>;
|
|
94
|
+
listDatasets(tcId?: string): Promise<DatasetInfo[]>;
|
|
95
|
+
getDefaultIteration(q: {
|
|
96
|
+
tcId: string;
|
|
97
|
+
versionId?: string;
|
|
98
|
+
environmentType?: string;
|
|
99
|
+
}): Promise<DefaultIteration>;
|
|
100
|
+
saveGeneratedIterations(payload: SaveGeneratedIterations): Promise<SaveGeneratedIterationsResult>;
|
|
101
|
+
getObject(id: string): Promise<QaObject>;
|
|
102
|
+
deleteObject(id: string): Promise<void>;
|
|
103
|
+
updateObject(id: string, changes: {
|
|
104
|
+
name?: string;
|
|
105
|
+
locators?: Locator[];
|
|
106
|
+
description?: string;
|
|
107
|
+
parameterNames?: string[];
|
|
108
|
+
moduleName?: string;
|
|
109
|
+
}): Promise<QaObject>;
|
|
110
|
+
productUrlFor(entity: EntityRef): string;
|
|
111
|
+
}
|
|
112
|
+
//# sourceMappingURL=adapter.d.ts.map
|