@qase/mcp-server 1.1.7 → 2.0.0
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/CHANGELOG.md +25 -0
- package/README.md +75 -551
- package/build/auth/client-context.d.ts +12 -0
- package/build/auth/client-context.d.ts.map +1 -0
- package/build/auth/client-context.js +12 -0
- package/build/auth/client-context.js.map +1 -0
- package/build/auth/jwks-verifier.d.ts +15 -0
- package/build/auth/jwks-verifier.d.ts.map +1 -0
- package/build/auth/jwks-verifier.js +31 -0
- package/build/auth/jwks-verifier.js.map +1 -0
- package/build/auth/mcp-guard.d.ts +15 -0
- package/build/auth/mcp-guard.d.ts.map +1 -0
- package/build/auth/mcp-guard.js +44 -0
- package/build/auth/mcp-guard.js.map +1 -0
- package/build/auth/oauth-config.d.ts +40 -0
- package/build/auth/oauth-config.d.ts.map +1 -0
- package/build/auth/oauth-config.js +34 -0
- package/build/auth/oauth-config.js.map +1 -0
- package/build/auth/proxy-provider.d.ts +31 -0
- package/build/auth/proxy-provider.d.ts.map +1 -0
- package/build/auth/proxy-provider.js +87 -0
- package/build/auth/proxy-provider.js.map +1 -0
- package/build/auth/token-type.d.ts +7 -0
- package/build/auth/token-type.d.ts.map +1 -0
- package/build/auth/token-type.js +10 -0
- package/build/auth/token-type.js.map +1 -0
- package/build/cache/circuit-breaker.d.ts +33 -0
- package/build/cache/circuit-breaker.d.ts.map +1 -0
- package/build/cache/circuit-breaker.js +68 -0
- package/build/cache/circuit-breaker.js.map +1 -0
- package/build/cache/index.d.ts +24 -0
- package/build/cache/index.d.ts.map +1 -0
- package/build/cache/index.js +86 -0
- package/build/cache/index.js.map +1 -0
- package/build/cache/keys.d.ts +25 -0
- package/build/cache/keys.d.ts.map +1 -0
- package/build/cache/keys.js +36 -0
- package/build/cache/keys.js.map +1 -0
- package/build/cache/layered.d.ts +31 -0
- package/build/cache/layered.d.ts.map +1 -0
- package/build/cache/layered.js +88 -0
- package/build/cache/layered.js.map +1 -0
- package/build/cache/memory.d.ts +32 -0
- package/build/cache/memory.d.ts.map +1 -0
- package/build/cache/memory.js +108 -0
- package/build/cache/memory.js.map +1 -0
- package/build/cache/metrics.d.ts +31 -0
- package/build/cache/metrics.d.ts.map +1 -0
- package/build/cache/metrics.js +95 -0
- package/build/cache/metrics.js.map +1 -0
- package/build/cache/prom-format.d.ts +7 -0
- package/build/cache/prom-format.d.ts.map +1 -0
- package/build/cache/prom-format.js +16 -0
- package/build/cache/prom-format.js.map +1 -0
- package/build/cache/redis-bus.d.ts +29 -0
- package/build/cache/redis-bus.d.ts.map +1 -0
- package/build/cache/redis-bus.js +50 -0
- package/build/cache/redis-bus.js.map +1 -0
- package/build/cache/redis.d.ts +32 -0
- package/build/cache/redis.d.ts.map +1 -0
- package/build/cache/redis.js +89 -0
- package/build/cache/redis.js.map +1 -0
- package/build/cache/types.d.ts +38 -0
- package/build/cache/types.d.ts.map +1 -0
- package/build/cache/types.js +2 -0
- package/build/cache/types.js.map +1 -0
- package/build/client/index.d.ts +10 -3
- package/build/client/index.d.ts.map +1 -1
- package/build/client/index.js +75 -50
- package/build/client/index.js.map +1 -1
- package/build/http/agent.d.ts +16 -0
- package/build/http/agent.d.ts.map +1 -0
- package/build/http/agent.js +16 -0
- package/build/http/agent.js.map +1 -0
- package/build/http/dedupe.d.ts +14 -0
- package/build/http/dedupe.d.ts.map +1 -0
- package/build/http/dedupe.js +69 -0
- package/build/http/dedupe.js.map +1 -0
- package/build/http/index.d.ts +6 -0
- package/build/http/index.d.ts.map +1 -0
- package/build/http/index.js +4 -0
- package/build/http/index.js.map +1 -0
- package/build/http/retry.d.ts +18 -0
- package/build/http/retry.d.ts.map +1 -0
- package/build/http/retry.js +52 -0
- package/build/http/retry.js.map +1 -0
- package/build/index.d.ts +1 -18
- package/build/index.d.ts.map +1 -1
- package/build/index.js +95 -61
- package/build/index.js.map +1 -1
- package/build/operations-v2/composites/ci-report.d.ts +2 -0
- package/build/operations-v2/composites/ci-report.d.ts.map +1 -0
- package/build/operations-v2/composites/ci-report.js +99 -0
- package/build/operations-v2/composites/ci-report.js.map +1 -0
- package/build/operations-v2/composites/regression-run.d.ts +2 -0
- package/build/operations-v2/composites/regression-run.d.ts.map +1 -0
- package/build/operations-v2/composites/regression-run.js +81 -0
- package/build/operations-v2/composites/regression-run.js.map +1 -0
- package/build/operations-v2/composites/triage-defect.d.ts +2 -0
- package/build/operations-v2/composites/triage-defect.d.ts.map +1 -0
- package/build/operations-v2/composites/triage-defect.js +67 -0
- package/build/operations-v2/composites/triage-defect.js.map +1 -0
- package/build/operations-v2/escape/api.d.ts +2 -0
- package/build/operations-v2/escape/api.d.ts.map +1 -0
- package/build/operations-v2/escape/api.js +34 -0
- package/build/operations-v2/escape/api.js.map +1 -0
- package/build/operations-v2/index.d.ts +19 -0
- package/build/operations-v2/index.d.ts.map +1 -0
- package/build/operations-v2/index.js +25 -0
- package/build/operations-v2/index.js.map +1 -0
- package/build/operations-v2/meta/discover.d.ts +9 -0
- package/build/operations-v2/meta/discover.d.ts.map +1 -0
- package/build/operations-v2/meta/discover.js +76 -0
- package/build/operations-v2/meta/discover.js.map +1 -0
- package/build/{operations/search.d.ts → operations-v2/qql/index.d.ts} +1 -1
- package/build/operations-v2/qql/index.d.ts.map +1 -0
- package/build/{operations/search.js → operations-v2/qql/index.js} +34 -9
- package/build/operations-v2/qql/index.js.map +1 -0
- package/build/operations-v2/read/get.d.ts +2 -0
- package/build/operations-v2/read/get.d.ts.map +1 -0
- package/build/operations-v2/read/get.js +91 -0
- package/build/operations-v2/read/get.js.map +1 -0
- package/build/operations-v2/read/project-context.d.ts +2 -0
- package/build/operations-v2/read/project-context.d.ts.map +1 -0
- package/build/operations-v2/read/project-context.js +102 -0
- package/build/operations-v2/read/project-context.js.map +1 -0
- package/build/operations-v2/write/attachments.d.ts +2 -0
- package/build/operations-v2/write/attachments.d.ts.map +1 -0
- package/build/operations-v2/write/attachments.js +58 -0
- package/build/operations-v2/write/attachments.js.map +1 -0
- package/build/operations-v2/write/cases.d.ts +2 -0
- package/build/operations-v2/write/cases.d.ts.map +1 -0
- package/build/operations-v2/write/cases.js +121 -0
- package/build/operations-v2/write/cases.js.map +1 -0
- package/build/operations-v2/write/defects.d.ts +2 -0
- package/build/operations-v2/write/defects.d.ts.map +1 -0
- package/build/operations-v2/write/defects.js +81 -0
- package/build/operations-v2/write/defects.js.map +1 -0
- package/build/operations-v2/write/environments.d.ts +2 -0
- package/build/operations-v2/write/environments.d.ts.map +1 -0
- package/build/operations-v2/write/environments.js +56 -0
- package/build/operations-v2/write/environments.js.map +1 -0
- package/build/operations-v2/write/milestones.d.ts +2 -0
- package/build/operations-v2/write/milestones.d.ts.map +1 -0
- package/build/operations-v2/write/milestones.js +56 -0
- package/build/operations-v2/write/milestones.js.map +1 -0
- package/build/operations-v2/write/plans.d.ts +2 -0
- package/build/operations-v2/write/plans.d.ts.map +1 -0
- package/build/operations-v2/write/plans.js +55 -0
- package/build/operations-v2/write/plans.js.map +1 -0
- package/build/operations-v2/write/results.d.ts +2 -0
- package/build/operations-v2/write/results.d.ts.map +1 -0
- package/build/operations-v2/write/results.js +72 -0
- package/build/operations-v2/write/results.js.map +1 -0
- package/build/operations-v2/write/runs.d.ts +2 -0
- package/build/operations-v2/write/runs.d.ts.map +1 -0
- package/build/operations-v2/write/runs.js +84 -0
- package/build/operations-v2/write/runs.js.map +1 -0
- package/build/operations-v2/write/shared-steps.d.ts +2 -0
- package/build/operations-v2/write/shared-steps.d.ts.map +1 -0
- package/build/operations-v2/write/shared-steps.js +60 -0
- package/build/operations-v2/write/shared-steps.js.map +1 -0
- package/build/operations-v2/write/suites.d.ts +2 -0
- package/build/operations-v2/write/suites.d.ts.map +1 -0
- package/build/operations-v2/write/suites.js +63 -0
- package/build/operations-v2/write/suites.js.map +1 -0
- package/build/prompts/index.d.ts +31 -0
- package/build/prompts/index.d.ts.map +1 -0
- package/build/prompts/index.js +229 -0
- package/build/prompts/index.js.map +1 -0
- package/build/transports/sse.d.ts.map +1 -1
- package/build/transports/sse.js +6 -0
- package/build/transports/sse.js.map +1 -1
- package/build/transports/streamableHttp.d.ts +6 -1
- package/build/transports/streamableHttp.d.ts.map +1 -1
- package/build/transports/streamableHttp.js +128 -16
- package/build/transports/streamableHttp.js.map +1 -1
- package/build/utils/auth-context.d.ts +8 -0
- package/build/utils/auth-context.d.ts.map +1 -1
- package/build/utils/auth-context.js +18 -0
- package/build/utils/auth-context.js.map +1 -1
- package/build/utils/case-enums.d.ts +5 -3
- package/build/utils/case-enums.d.ts.map +1 -1
- package/build/utils/case-enums.js +78 -59
- package/build/utils/case-enums.js.map +1 -1
- package/build/utils/output-schemas.d.ts +16 -0
- package/build/utils/output-schemas.d.ts.map +1 -0
- package/build/utils/output-schemas.js +82 -0
- package/build/utils/output-schemas.js.map +1 -0
- package/build/utils/registry.d.ts +42 -9
- package/build/utils/registry.d.ts.map +1 -1
- package/build/utils/registry.js +64 -11
- package/build/utils/registry.js.map +1 -1
- package/build/utils/response-shape.d.ts +23 -0
- package/build/utils/response-shape.d.ts.map +1 -0
- package/build/utils/response-shape.js +73 -0
- package/build/utils/response-shape.js.map +1 -0
- package/build/utils/rich-response.d.ts +58 -0
- package/build/utils/rich-response.d.ts.map +1 -0
- package/build/utils/rich-response.js +93 -0
- package/build/utils/rich-response.js.map +1 -0
- package/build/utils/server-context.d.ts +65 -0
- package/build/utils/server-context.d.ts.map +1 -0
- package/build/utils/server-context.js +67 -0
- package/build/utils/server-context.js.map +1 -0
- package/build/version.d.ts +1 -1
- package/build/version.js +1 -1
- package/docs/connect.md +81 -0
- package/docs/migration.md +351 -0
- package/docs/self-run.md +270 -0
- package/docs/tools.md +109 -0
- package/docs/troubleshooting.md +144 -0
- package/package.json +12 -3
- package/server.json +8 -2
- package/build/operations/attachments.d.ts +0 -8
- package/build/operations/attachments.d.ts.map +0 -1
- package/build/operations/attachments.js +0 -146
- package/build/operations/attachments.js.map +0 -1
- package/build/operations/authors.d.ts +0 -8
- package/build/operations/authors.d.ts.map +0 -1
- package/build/operations/authors.js +0 -70
- package/build/operations/authors.js.map +0 -1
- package/build/operations/cases.d.ts +0 -8
- package/build/operations/cases.d.ts.map +0 -1
- package/build/operations/cases.js +0 -338
- package/build/operations/cases.js.map +0 -1
- package/build/operations/configurations.d.ts +0 -10
- package/build/operations/configurations.d.ts.map +0 -1
- package/build/operations/configurations.js +0 -125
- package/build/operations/configurations.js.map +0 -1
- package/build/operations/custom-fields.d.ts +0 -8
- package/build/operations/custom-fields.d.ts.map +0 -1
- package/build/operations/custom-fields.js +0 -172
- package/build/operations/custom-fields.js.map +0 -1
- package/build/operations/defects.d.ts +0 -8
- package/build/operations/defects.d.ts.map +0 -1
- package/build/operations/defects.js +0 -256
- package/build/operations/defects.js.map +0 -1
- package/build/operations/environments.d.ts +0 -8
- package/build/operations/environments.d.ts.map +0 -1
- package/build/operations/environments.js +0 -154
- package/build/operations/environments.js.map +0 -1
- package/build/operations/milestones.d.ts +0 -8
- package/build/operations/milestones.d.ts.map +0 -1
- package/build/operations/milestones.js +0 -155
- package/build/operations/milestones.js.map +0 -1
- package/build/operations/plans.d.ts +0 -8
- package/build/operations/plans.d.ts.map +0 -1
- package/build/operations/plans.js +0 -158
- package/build/operations/plans.js.map +0 -1
- package/build/operations/projects.d.ts +0 -8
- package/build/operations/projects.d.ts.map +0 -1
- package/build/operations/projects.js +0 -192
- package/build/operations/projects.js.map +0 -1
- package/build/operations/results.d.ts +0 -8
- package/build/operations/results.d.ts.map +0 -1
- package/build/operations/results.js +0 -214
- package/build/operations/results.js.map +0 -1
- package/build/operations/runs.d.ts +0 -8
- package/build/operations/runs.d.ts.map +0 -1
- package/build/operations/runs.js +0 -224
- package/build/operations/runs.js.map +0 -1
- package/build/operations/search.d.ts.map +0 -1
- package/build/operations/search.js.map +0 -1
- package/build/operations/shared-parameters.d.ts +0 -10
- package/build/operations/shared-parameters.d.ts.map +0 -1
- package/build/operations/shared-parameters.js +0 -93
- package/build/operations/shared-parameters.js.map +0 -1
- package/build/operations/shared-steps.d.ts +0 -8
- package/build/operations/shared-steps.d.ts.map +0 -1
- package/build/operations/shared-steps.js +0 -160
- package/build/operations/shared-steps.js.map +0 -1
- package/build/operations/suites.d.ts +0 -8
- package/build/operations/suites.d.ts.map +0 -1
- package/build/operations/suites.js +0 -169
- package/build/operations/suites.js.map +0 -1
- package/build/operations/system-fields.d.ts +0 -10
- package/build/operations/system-fields.d.ts.map +0 -1
- package/build/operations/system-fields.js +0 -47
- package/build/operations/system-fields.js.map +0 -1
- package/build/operations/users.d.ts +0 -10
- package/build/operations/users.d.ts.map +0 -1
- package/build/operations/users.js +0 -78
- package/build/operations/users.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared-steps.d.ts","sourceRoot":"","sources":["../../../src/operations-v2/write/shared-steps.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { getApiClient } from '../../client/index.js';
|
|
3
|
+
import { toolRegistry, CreateAnnotation, DeleteAnnotation } from '../../utils/registry.js';
|
|
4
|
+
import { toResultAsync, createToolError } from '../../utils/errors.js';
|
|
5
|
+
import { ProjectCodeSchema, HashSchema } from '../../utils/validation.js';
|
|
6
|
+
const StepContentSchema = z.object({
|
|
7
|
+
action: z.string().describe('Step action description'),
|
|
8
|
+
expected_result: z.string().optional().describe('Expected result'),
|
|
9
|
+
data: z.string().optional().describe('Test data'),
|
|
10
|
+
attachments: z.array(z.string()).optional().describe('Array of attachment hashes'),
|
|
11
|
+
});
|
|
12
|
+
const UpsertSchema = z.object({
|
|
13
|
+
code: ProjectCodeSchema,
|
|
14
|
+
hash: HashSchema.optional().describe('Shared step hash — if provided, updates; if omitted, creates'),
|
|
15
|
+
title: z.string().min(1).max(255).describe('Shared step title'),
|
|
16
|
+
steps: z.array(StepContentSchema).optional().describe('Array of step definitions'),
|
|
17
|
+
});
|
|
18
|
+
const DeleteSchema = z.object({
|
|
19
|
+
code: ProjectCodeSchema,
|
|
20
|
+
hash: HashSchema.describe('Shared step hash identifier'),
|
|
21
|
+
});
|
|
22
|
+
async function upsert(args) {
|
|
23
|
+
const client = getApiClient();
|
|
24
|
+
const { code, hash, ...data } = args;
|
|
25
|
+
if (hash) {
|
|
26
|
+
const result = await toResultAsync(client.sharedSteps.updateSharedStep(code, hash, data));
|
|
27
|
+
return result.match(() => ({ success: true, hash }), (e) => {
|
|
28
|
+
throw createToolError(e, 'shared step operation');
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
const result = await toResultAsync(client.sharedSteps.createSharedStep(code, data));
|
|
32
|
+
return result.match((r) => r.data.result, (e) => {
|
|
33
|
+
throw createToolError(e, 'shared step operation');
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
async function del(args) {
|
|
37
|
+
const client = getApiClient();
|
|
38
|
+
const result = await toResultAsync(client.sharedSteps.deleteSharedStep(args.code, args.hash));
|
|
39
|
+
return result.match(() => ({ success: true, hash: args.hash }), (e) => {
|
|
40
|
+
throw createToolError(e, 'shared step operation');
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
toolRegistry.register({
|
|
44
|
+
name: 'qase_shared_step_upsert',
|
|
45
|
+
description: 'Create or update a shared step. If `hash` is provided, updates the existing shared step; ' +
|
|
46
|
+
'if omitted, creates a new one. Shared steps are reusable steps included in multiple test cases.',
|
|
47
|
+
schema: UpsertSchema,
|
|
48
|
+
handler: upsert,
|
|
49
|
+
annotations: CreateAnnotation,
|
|
50
|
+
visibility: 'discoverable',
|
|
51
|
+
});
|
|
52
|
+
toolRegistry.register({
|
|
53
|
+
name: 'qase_shared_step_delete',
|
|
54
|
+
description: 'Delete a shared step by project code and hash.',
|
|
55
|
+
schema: DeleteSchema,
|
|
56
|
+
handler: del,
|
|
57
|
+
annotations: DeleteAnnotation,
|
|
58
|
+
visibility: 'discoverable',
|
|
59
|
+
});
|
|
60
|
+
//# sourceMappingURL=shared-steps.js.map
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WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAC9F,OAAO,MAAM,CAAC,KAAK,CACjB,GAAG,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,EAC1C,CAAC,CAAC,EAAE,EAAE;QACJ,MAAM,eAAe,CAAC,CAAC,EAAE,uBAAuB,CAAC,CAAC;IACpD,CAAC,CACF,CAAC;AACJ,CAAC;AAED,YAAY,CAAC,QAAQ,CAAC;IACpB,IAAI,EAAE,yBAAyB;IAC/B,WAAW,EACT,2FAA2F;QAC3F,iGAAiG;IACnG,MAAM,EAAE,YAAY;IACpB,OAAO,EAAE,MAAM;IACf,WAAW,EAAE,gBAAgB;IAC7B,UAAU,EAAE,cAAc;CAC3B,CAAC,CAAC;AAEH,YAAY,CAAC,QAAQ,CAAC;IACpB,IAAI,EAAE,yBAAyB;IAC/B,WAAW,EAAE,gDAAgD;IAC7D,MAAM,EAAE,YAAY;IACpB,OAAO,EAAE,GAAG;IACZ,WAAW,EAAE,gBAAgB;IAC7B,UAAU,EAAE,cAAc;CAC3B,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"suites.d.ts","sourceRoot":"","sources":["../../../src/operations-v2/write/suites.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { getApiClient } from '../../client/index.js';
|
|
3
|
+
import { toolRegistry, CreateAnnotation, DeleteAnnotation } from '../../utils/registry.js';
|
|
4
|
+
import { toResultAsync, createToolError } from '../../utils/errors.js';
|
|
5
|
+
import { ProjectCodeSchema, IdSchema } from '../../utils/validation.js';
|
|
6
|
+
const UpsertSchema = z.object({
|
|
7
|
+
code: ProjectCodeSchema,
|
|
8
|
+
id: IdSchema.optional().describe('Suite ID — if provided, updates; if omitted, creates'),
|
|
9
|
+
title: z.string().min(1).max(255).describe('Suite title'),
|
|
10
|
+
description: z.string().optional(),
|
|
11
|
+
preconditions: z.string().optional(),
|
|
12
|
+
parent_id: z.number().int().positive().optional().describe('Parent suite ID for nesting'),
|
|
13
|
+
});
|
|
14
|
+
const DeleteSchema = z.object({
|
|
15
|
+
code: ProjectCodeSchema,
|
|
16
|
+
id: IdSchema,
|
|
17
|
+
delete_cases: z
|
|
18
|
+
.boolean()
|
|
19
|
+
.optional()
|
|
20
|
+
.describe('If true, delete all cases in suite; if false, move to parent'),
|
|
21
|
+
});
|
|
22
|
+
async function upsert(args) {
|
|
23
|
+
const client = getApiClient();
|
|
24
|
+
const { code, id, ...data } = args;
|
|
25
|
+
if (id) {
|
|
26
|
+
const result = await toResultAsync(client.suites.updateSuite(code, id, data));
|
|
27
|
+
return result.match(() => ({ success: true, id }), (e) => {
|
|
28
|
+
throw createToolError(e, 'suite operation');
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
const result = await toResultAsync(client.suites.createSuite(code, data));
|
|
32
|
+
return result.match((r) => r.data.result, (e) => {
|
|
33
|
+
throw createToolError(e, 'suite operation');
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
async function del(args) {
|
|
37
|
+
const client = getApiClient();
|
|
38
|
+
const { code, id, delete_cases } = args;
|
|
39
|
+
const suiteDelete = delete_cases !== undefined ? { after_delete_case: delete_cases } : undefined;
|
|
40
|
+
const result = await toResultAsync(client.suites.deleteSuite(code, id, suiteDelete));
|
|
41
|
+
return result.match(() => ({ success: true, id }), (e) => {
|
|
42
|
+
throw createToolError(e, 'suite operation');
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
toolRegistry.register({
|
|
46
|
+
name: 'qase_suite_upsert',
|
|
47
|
+
description: 'Create or update a test suite. If `id` is provided, updates the existing suite; ' +
|
|
48
|
+
'if omitted, creates a new one.',
|
|
49
|
+
schema: UpsertSchema,
|
|
50
|
+
handler: upsert,
|
|
51
|
+
annotations: CreateAnnotation,
|
|
52
|
+
visibility: 'discoverable',
|
|
53
|
+
});
|
|
54
|
+
toolRegistry.register({
|
|
55
|
+
name: 'qase_suite_delete',
|
|
56
|
+
description: 'Delete a test suite. If `delete_cases` is true, removes all cases in the suite; ' +
|
|
57
|
+
'if false or omitted, cases are moved to the parent suite.',
|
|
58
|
+
schema: DeleteSchema,
|
|
59
|
+
handler: del,
|
|
60
|
+
annotations: DeleteAnnotation,
|
|
61
|
+
visibility: 'discoverable',
|
|
62
|
+
});
|
|
63
|
+
//# sourceMappingURL=suites.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"suites.js","sourceRoot":"","sources":["../../../src/operations-v2/write/suites.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3F,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAExE,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5B,IAAI,EAAE,iBAAiB;IACvB,EAAE,EAAE,QAAQ,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,sDAAsD,CAAC;IACxF,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC;IACzD,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACpC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CA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kC;IACnD,MAAM,MAAM,GAAG,YAAY,EAAE,CAAC;IAC9B,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC;IACxC,MAAM,WAAW,GAAG,YAAY,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,iBAAiB,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;IACjG,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,EAAE,EAAE,EAAE,WAAkB,CAAC,CAAC,CAAC;IAC5F,OAAO,MAAM,CAAC,KAAK,CACjB,GAAG,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,EAC7B,CAAC,CAAC,EAAE,EAAE;QACJ,MAAM,eAAe,CAAC,CAAC,EAAE,iBAAiB,CAAC,CAAC;IAC9C,CAAC,CACF,CAAC;AACJ,CAAC;AAED,YAAY,CAAC,QAAQ,CAAC;IACpB,IAAI,EAAE,mBAAmB;IACzB,WAAW,EACT,kFAAkF;QAClF,gCAAgC;IAClC,MAAM,EAAE,YAAY;IACpB,OAAO,EAAE,MAAM;IACf,WAAW,EAAE,gBAAgB;IAC7B,UAAU,EAAE,cAAc;CAC3B,CAAC,CAAC;AAEH,YAAY,CAAC,QAAQ,CAAC;IACpB,IAAI,EAAE,mBAAmB;IACzB,WAAW,EACT,kFAAkF;QAClF,2DAA2D;IAC7D,MAAM,EAAE,YAAY;IACpB,OAAO,EAAE,GAAG;IACZ,WAAW,EAAE,gBAAgB;IAC7B,UAAU,EAAE,cAAc;CAC3B,CAAC,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP Prompt Templates (Skills)
|
|
3
|
+
*
|
|
4
|
+
* Workflow recipes that MCP clients can invoke to guide agents through
|
|
5
|
+
* multi-step testing workflows using Qase tools.
|
|
6
|
+
*
|
|
7
|
+
* Each prompt returns a sequence of messages that instruct the agent
|
|
8
|
+
* how to accomplish a specific testing goal.
|
|
9
|
+
*/
|
|
10
|
+
/** Get all prompt definitions for ListPrompts */
|
|
11
|
+
export declare function listPrompts(): {
|
|
12
|
+
name: string;
|
|
13
|
+
description: string;
|
|
14
|
+
arguments: {
|
|
15
|
+
name: string;
|
|
16
|
+
description: string;
|
|
17
|
+
required: boolean;
|
|
18
|
+
}[];
|
|
19
|
+
}[];
|
|
20
|
+
/** Build prompt messages for GetPrompt */
|
|
21
|
+
export declare function getPrompt(name: string, args?: Record<string, string>): {
|
|
22
|
+
description: string;
|
|
23
|
+
messages: {
|
|
24
|
+
role: "user";
|
|
25
|
+
content: {
|
|
26
|
+
type: "text";
|
|
27
|
+
text: string;
|
|
28
|
+
};
|
|
29
|
+
}[];
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/prompts/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAuNH,iDAAiD;AACjD,wBAAgB,WAAW;;;;cAnNA,MAAM;qBAAe,MAAM;kBAAY,OAAO;;IAyNxE;AAED,0CAA0C;AAC1C,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM;;;cAzNpD,MAAM;iBAAW;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE;;EA4OnE"}
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP Prompt Templates (Skills)
|
|
3
|
+
*
|
|
4
|
+
* Workflow recipes that MCP clients can invoke to guide agents through
|
|
5
|
+
* multi-step testing workflows using Qase tools.
|
|
6
|
+
*
|
|
7
|
+
* Each prompt returns a sequence of messages that instruct the agent
|
|
8
|
+
* how to accomplish a specific testing goal.
|
|
9
|
+
*/
|
|
10
|
+
const prompts = [
|
|
11
|
+
{
|
|
12
|
+
name: 'triage_failed_run',
|
|
13
|
+
description: 'Analyze a failed test run: show all failed results grouped by error pattern, ' +
|
|
14
|
+
'suggest defects to create for unique failures.',
|
|
15
|
+
arguments: [
|
|
16
|
+
{ name: 'project', description: 'Project code (e.g. DEMO)', required: true },
|
|
17
|
+
{ name: 'run_id', description: 'Test run ID to triage', required: true },
|
|
18
|
+
],
|
|
19
|
+
build: (args) => [
|
|
20
|
+
{
|
|
21
|
+
role: 'user',
|
|
22
|
+
content: {
|
|
23
|
+
type: 'text',
|
|
24
|
+
text: [
|
|
25
|
+
`Triage the failed test run #${args.run_id} in project ${args.project}.`,
|
|
26
|
+
'',
|
|
27
|
+
'Steps:',
|
|
28
|
+
`1. Use qase_get to fetch run details: { entity: "run", code: "${args.project}", id: ${args.run_id} }`,
|
|
29
|
+
`2. Use qase_api to get all results: GET /v1/result/${args.project} with filters[run]=${args.run_id}`,
|
|
30
|
+
'3. Group the failed results by stacktrace similarity or error message pattern',
|
|
31
|
+
'4. For each unique failure pattern:',
|
|
32
|
+
' - Show the error message and affected test cases',
|
|
33
|
+
' - Suggest creating a defect with qase_triage_defect',
|
|
34
|
+
'5. Summarize: total passed/failed, unique failure patterns found, suggested defects',
|
|
35
|
+
].join('\n'),
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: 'release_readiness',
|
|
42
|
+
description: 'Check release readiness for a milestone: test coverage, pass rate, open defects, blocking issues.',
|
|
43
|
+
arguments: [
|
|
44
|
+
{ name: 'project', description: 'Project code (e.g. DEMO)', required: true },
|
|
45
|
+
{ name: 'milestone', description: 'Milestone name or ID', required: true },
|
|
46
|
+
],
|
|
47
|
+
build: (args) => [
|
|
48
|
+
{
|
|
49
|
+
role: 'user',
|
|
50
|
+
content: {
|
|
51
|
+
type: 'text',
|
|
52
|
+
text: [
|
|
53
|
+
`Check release readiness for milestone "${args.milestone}" in project ${args.project}.`,
|
|
54
|
+
'',
|
|
55
|
+
'Steps:',
|
|
56
|
+
`1. Use qase_project_context to get project overview: { code: "${args.project}" }`,
|
|
57
|
+
`2. Search for test runs linked to this milestone:`,
|
|
58
|
+
` qql_search: entity = "run" and project = "${args.project}" and milestone ~ "${args.milestone}"`,
|
|
59
|
+
`3. Search for open defects:`,
|
|
60
|
+
` qql_search: entity = "defect" and project = "${args.project}" and status != "resolved"`,
|
|
61
|
+
`4. For the latest run, get detailed results via qase_api`,
|
|
62
|
+
'5. Produce a release readiness report:',
|
|
63
|
+
' - Milestone status and due date',
|
|
64
|
+
' - Test execution summary (total/passed/failed/untested)',
|
|
65
|
+
' - Pass rate percentage',
|
|
66
|
+
' - Open defects count by severity (blocker/critical/major)',
|
|
67
|
+
' - GO / NO-GO recommendation based on:',
|
|
68
|
+
' * No blocker/critical defects open',
|
|
69
|
+
' * Pass rate > 95%',
|
|
70
|
+
' * No untested high-priority cases',
|
|
71
|
+
].join('\n'),
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
],
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
name: 'regression_workflow',
|
|
78
|
+
description: 'Create and manage a full regression test cycle: set up a run from a plan or suites, ' +
|
|
79
|
+
'track progress, report results.',
|
|
80
|
+
arguments: [
|
|
81
|
+
{ name: 'project', description: 'Project code (e.g. DEMO)', required: true },
|
|
82
|
+
{
|
|
83
|
+
name: 'title',
|
|
84
|
+
description: 'Regression run title (e.g. "v2.1 Release Regression")',
|
|
85
|
+
required: true,
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
name: 'source',
|
|
89
|
+
description: 'Source of test cases: plan ID, suite IDs (comma-separated), or "all"',
|
|
90
|
+
required: true,
|
|
91
|
+
},
|
|
92
|
+
],
|
|
93
|
+
build: (args) => {
|
|
94
|
+
const source = args.source || 'all';
|
|
95
|
+
let sourceInstructions;
|
|
96
|
+
if (source.match(/^\d+$/)) {
|
|
97
|
+
sourceInstructions = ` Use plan_id: ${source}`;
|
|
98
|
+
}
|
|
99
|
+
else if (source.includes(',')) {
|
|
100
|
+
const ids = source.split(',').map((s) => s.trim());
|
|
101
|
+
sourceInstructions = ` Use suite_ids: [${ids.join(', ')}]`;
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
sourceInstructions = ` Use qql_search to find all actual cases, then pass their IDs`;
|
|
105
|
+
}
|
|
106
|
+
return [
|
|
107
|
+
{
|
|
108
|
+
role: 'user',
|
|
109
|
+
content: {
|
|
110
|
+
type: 'text',
|
|
111
|
+
text: [
|
|
112
|
+
`Set up a regression test run "${args.title}" in project ${args.project}.`,
|
|
113
|
+
'',
|
|
114
|
+
'Steps:',
|
|
115
|
+
`1. Use qase_project_context to understand the project: { code: "${args.project}" }`,
|
|
116
|
+
`2. Create the regression run with qase_regression_run:`,
|
|
117
|
+
` - code: "${args.project}"`,
|
|
118
|
+
` - title: "${args.title}"`,
|
|
119
|
+
sourceInstructions,
|
|
120
|
+
'3. Report back:',
|
|
121
|
+
' - Run ID and URL',
|
|
122
|
+
' - Number of test cases included',
|
|
123
|
+
' - Which suites/plans were used as source',
|
|
124
|
+
'4. Ask if I want to record any results or complete the run',
|
|
125
|
+
].join('\n'),
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
];
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
name: 'onboard_project',
|
|
133
|
+
description: 'Get a comprehensive overview of a Qase project for a new team member: ' +
|
|
134
|
+
'structure, recent activity, key metrics.',
|
|
135
|
+
arguments: [{ name: 'project', description: 'Project code (e.g. DEMO)', required: true }],
|
|
136
|
+
build: (args) => [
|
|
137
|
+
{
|
|
138
|
+
role: 'user',
|
|
139
|
+
content: {
|
|
140
|
+
type: 'text',
|
|
141
|
+
text: [
|
|
142
|
+
`Give me a comprehensive overview of project ${args.project} as if I'm a new team member.`,
|
|
143
|
+
'',
|
|
144
|
+
'Steps:',
|
|
145
|
+
`1. Use qase_project_context: { code: "${args.project}" }`,
|
|
146
|
+
`2. Search for recent test runs (last 10):`,
|
|
147
|
+
` qql_search: entity = "run" and project = "${args.project}"`,
|
|
148
|
+
`3. Search for open defects:`,
|
|
149
|
+
` qql_search: entity = "defect" and project = "${args.project}"`,
|
|
150
|
+
`4. Search for test cases to understand coverage:`,
|
|
151
|
+
` qql_search: entity = "case" and project = "${args.project}"`,
|
|
152
|
+
'5. Present a structured overview:',
|
|
153
|
+
' - Project name, description, team size',
|
|
154
|
+
' - Test suite structure (top-level suites and their purpose)',
|
|
155
|
+
' - Test coverage: total cases, automation status if available',
|
|
156
|
+
' - Recent activity: last 5 runs with pass/fail stats',
|
|
157
|
+
' - Open defects by severity',
|
|
158
|
+
' - Environments and milestones in use',
|
|
159
|
+
' - Suggestions for where to start exploring',
|
|
160
|
+
].join('\n'),
|
|
161
|
+
},
|
|
162
|
+
},
|
|
163
|
+
],
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
name: 'ci_integration',
|
|
167
|
+
description: 'Report CI/CD test results to Qase: create a run, record results, and get a summary.',
|
|
168
|
+
arguments: [
|
|
169
|
+
{ name: 'project', description: 'Project code (e.g. DEMO)', required: true },
|
|
170
|
+
{
|
|
171
|
+
name: 'title',
|
|
172
|
+
description: 'CI run title (e.g. "Build #1234 - main branch")',
|
|
173
|
+
required: true,
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
name: 'results_json',
|
|
177
|
+
description: 'JSON array of results: [{"case_id": 1, "status": "passed"}, ...]',
|
|
178
|
+
required: true,
|
|
179
|
+
},
|
|
180
|
+
],
|
|
181
|
+
build: (args) => [
|
|
182
|
+
{
|
|
183
|
+
role: 'user',
|
|
184
|
+
content: {
|
|
185
|
+
type: 'text',
|
|
186
|
+
text: [
|
|
187
|
+
`Report CI test results to Qase project ${args.project}.`,
|
|
188
|
+
'',
|
|
189
|
+
'Steps:',
|
|
190
|
+
`1. Use qase_ci_report to record results in one call:`,
|
|
191
|
+
` - code: "${args.project}"`,
|
|
192
|
+
` - title: "${args.title}"`,
|
|
193
|
+
` - results: ${args.results_json}`,
|
|
194
|
+
` - complete: true`,
|
|
195
|
+
` - is_autotest: true`,
|
|
196
|
+
'2. Show the summary: run ID, pass/fail counts, any failures',
|
|
197
|
+
'3. If there are failures, suggest next steps (triage, create defects)',
|
|
198
|
+
].join('\n'),
|
|
199
|
+
},
|
|
200
|
+
},
|
|
201
|
+
],
|
|
202
|
+
},
|
|
203
|
+
];
|
|
204
|
+
/** Get all prompt definitions for ListPrompts */
|
|
205
|
+
export function listPrompts() {
|
|
206
|
+
return prompts.map((p) => ({
|
|
207
|
+
name: p.name,
|
|
208
|
+
description: p.description,
|
|
209
|
+
arguments: p.arguments,
|
|
210
|
+
}));
|
|
211
|
+
}
|
|
212
|
+
/** Build prompt messages for GetPrompt */
|
|
213
|
+
export function getPrompt(name, args = {}) {
|
|
214
|
+
const prompt = prompts.find((p) => p.name === name);
|
|
215
|
+
if (!prompt) {
|
|
216
|
+
throw new Error(`Unknown prompt: "${name}". Available: ${prompts.map((p) => p.name).join(', ')}`);
|
|
217
|
+
}
|
|
218
|
+
// Validate required arguments
|
|
219
|
+
for (const arg of prompt.arguments) {
|
|
220
|
+
if (arg.required && !args[arg.name]) {
|
|
221
|
+
throw new Error(`Missing required argument "${arg.name}" for prompt "${name}"`);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
return {
|
|
225
|
+
description: prompt.description,
|
|
226
|
+
messages: prompt.build(args),
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/prompts/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAWH,MAAM,OAAO,GAAgB;IAC3B;QACE,IAAI,EAAE,mBAAmB;QACzB,WAAW,EACT,+EAA+E;YAC/E,gDAAgD;QAClD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AM,UAAU,SAAS,CAAC,IAAY,EAAE,OAA+B,EAAE;IACvE,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;IACpD,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CACb,oBAAoB,IAAI,iBAAiB,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CACjF,CAAC;IACJ,CAAC;IAED,8BAA8B;IAC9B,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,SAAS,EAAE,CAAC;QACnC,IAAI,GAAG,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YACpC,MAAM,IAAI,KAAK,CAAC,8BAA8B,GAAG,CAAC,IAAI,iBAAiB,IAAI,GAAG,CAAC,CAAC;QAClF,CAAC;IACH,CAAC;IAED,OAAO;QACL,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,QAAQ,EAAE,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC;KAC7B,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sse.d.ts","sourceRoot":"","sources":["../../src/transports/sse.ts"],"names":[],"mappings":"AAAA,OAAgB,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;
|
|
1
|
+
{"version":3,"file":"sse.d.ts","sourceRoot":"","sources":["../../src/transports/sse.ts"],"names":[],"mappings":"AAAA,OAAgB,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAKnE,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,kBAAkB,GAAG,OAAO,CA8CrF"}
|
package/build/transports/sse.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import express from 'express';
|
|
2
2
|
import { SSEServerTransport } from '@modelcontextprotocol/sdk/server/sse.js';
|
|
3
3
|
import { requestTokenStorage } from '../utils/auth-context.js';
|
|
4
|
+
import { getMetrics } from '../cache/index.js';
|
|
4
5
|
export function setupSSETransport(server, config) {
|
|
5
6
|
const app = express();
|
|
6
7
|
app.use(express.json());
|
|
@@ -12,6 +13,11 @@ export function setupSSETransport(server, config) {
|
|
|
12
13
|
app.get('/health', (_req, res) => {
|
|
13
14
|
res.json({ status: 'ok', transport: 'sse' });
|
|
14
15
|
});
|
|
16
|
+
// Prometheus metrics endpoint
|
|
17
|
+
app.get('/metrics', (_req, res) => {
|
|
18
|
+
res.set('Content-Type', 'text/plain; version=0.0.4');
|
|
19
|
+
res.send(getMetrics().renderPrometheus());
|
|
20
|
+
});
|
|
15
21
|
// SSE endpoint for establishing connection
|
|
16
22
|
app.get(sseEndpoint, (_req, res) => {
|
|
17
23
|
console.error('[SSE] Client connected');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sse.js","sourceRoot":"","sources":["../../src/transports/sse.ts"],"names":[],"mappings":"AAAA,OAAO,OAAoB,MAAM,SAAS,CAAC;AAE3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"sse.js","sourceRoot":"","sources":["../../src/transports/sse.ts"],"names":[],"mappings":"AAAA,OAAO,OAAoB,MAAM,SAAS,C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,CAAC;QAC1D,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAC5B,CAAC,CAAC,CAAC;IAEH,kDAAkD;IAClD,GAAG,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;QACtC,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,+BAA+B,EAAE,CAAC,CAAC;YACjE,OAAO;QACT,CAAC;QACD,MAAM,UAAU,GAAI,GAAG,CAAC,OAAO,CAAC,eAAe,CAAY,IAAI,EAAE,CAAC;QAClE,MAAM,YAAY,GAAG,UAAU,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACxF,mBAAmB,CAAC,GAAG,CAAC,YAAY,EAAE,GAAG,EAAE,CAAC,SAAU,CAAC,iBAAiB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;IACtF,CAAC,CAAC,CAAC;IAEH,eAAe;IACf,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE;QACjC,OAAO,CAAC,KAAK,CAAC,oCAAoC,IAAI,IAAI,MAAM,CAAC,IAAI,GAAG,WAAW,EAAE,CAAC,CAAC;QACvF,OAAO,CAAC,KAAK,CAAC,8BAA8B,IAAI,IAAI,MAAM,CAAC,IAAI,SAAS,CAAC,CAAC;IAC5E,CAAC,CAAC,CAAC;IAEH,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { Express } from 'express';
|
|
2
2
|
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
3
|
+
import { type OAuthConfig } from '../auth/oauth-config.js';
|
|
4
|
+
import { type JwksVerifier } from '../auth/jwks-verifier.js';
|
|
3
5
|
export interface StreamableHttpConfig {
|
|
4
6
|
port: number;
|
|
5
7
|
host?: string;
|
|
6
8
|
endpoint?: string;
|
|
7
9
|
}
|
|
8
|
-
export declare function setupStreamableHttpTransport(createServer: () => Server, config: StreamableHttpConfig
|
|
10
|
+
export declare function setupStreamableHttpTransport(createServer: () => Server, config: StreamableHttpConfig, oauthDeps?: {
|
|
11
|
+
config: OAuthConfig;
|
|
12
|
+
verifier: JwksVerifier;
|
|
13
|
+
}): Express;
|
|
9
14
|
//# sourceMappingURL=streamableHttp.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"streamableHttp.d.ts","sourceRoot":"","sources":["../../src/transports/streamableHttp.ts"],"names":[],"mappings":"AAAA,OAAgB,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;
|
|
1
|
+
{"version":3,"file":"streamableHttp.d.ts","sourceRoot":"","sources":["../../src/transports/streamableHttp.ts"],"names":[],"mappings":"AAAA,OAAgB,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAMnE,OAAO,EAAkB,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAMjF,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AASD,wBAAgB,4BAA4B,CAC1C,YAAY,EAAE,MAAM,MAAM,EAC1B,MAAM,EAAE,oBAAoB,EAC5B,SAAS,CAAC,EAAE;IAAE,MAAM,EAAE,WAAW,CAAC;IAAC,QAAQ,EAAE,YAAY,CAAA;CAAE,GAC1D,OAAO,CAsTT"}
|