@qase/mcp-server 2.2.2 → 2.3.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 +27 -0
- package/build/client/index.d.ts.map +1 -1
- package/build/client/index.js +9 -7
- package/build/client/index.js.map +1 -1
- package/build/client/producer-headers.d.ts +13 -0
- package/build/client/producer-headers.d.ts.map +1 -0
- package/build/client/producer-headers.js +26 -0
- package/build/client/producer-headers.js.map +1 -0
- package/build/index.d.ts.map +1 -1
- package/build/index.js +74 -57
- package/build/index.js.map +1 -1
- package/build/operations-v2/qql/index.js +27 -7
- package/build/operations-v2/qql/index.js.map +1 -1
- package/build/utils/call-markers.d.ts +23 -0
- package/build/utils/call-markers.d.ts.map +1 -0
- package/build/utils/call-markers.js +27 -0
- package/build/utils/call-markers.js.map +1 -0
- package/build/utils/integration-context.d.ts +10 -4
- package/build/utils/integration-context.d.ts.map +1 -1
- package/build/utils/integration-context.js +13 -4
- package/build/utils/integration-context.js.map +1 -1
- package/build/utils/producer-context.d.ts +12 -0
- package/build/utils/producer-context.d.ts.map +1 -0
- package/build/utils/producer-context.js +13 -0
- package/build/utils/producer-context.js.map +1 -0
- package/build/utils/producer-marker.d.ts +35 -0
- package/build/utils/producer-marker.d.ts.map +1 -0
- package/build/utils/producer-marker.js +49 -0
- package/build/utils/producer-marker.js.map +1 -0
- package/build/version.d.ts +1 -1
- package/build/version.js +1 -1
- package/package.json +1 -1
- package/server.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,33 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [2.3.0]
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **Per-producer attribution.** An integration built on top of this server can now say not only *who* it is but *which of its parts* made the call — a skill, a slash command, an agent — and where that call sits in the run. Two hidden arguments carry it: `_qase_integration` (`<name>/<version>`, the same marker the session header takes) and `_qase_producer` (`<producer>/<seq>/<entrypoint>`, entrypoint being one of `skill`, `command`, `agent`). They become three headers on the outbound Qase API request, beside the existing pair: `X-MCP-Integration-Producer`, `X-MCP-Integration-Seq`, `X-MCP-Integration-Entrypoint`.
|
|
13
|
+
|
|
14
|
+
The arguments travel in the call rather than in a header because a header cannot vary per call — the HTTP transport captures the integration marker once, when the session opens, and one session runs many producers in sequence. They are deliberately absent from every tool's input schema: they are not parameters, and no model should be asked to supply them. Both are stripped before the tool handler runs.
|
|
15
|
+
|
|
16
|
+
Call arguments now outrank the session header as a source of the integration marker, which in turn outranks `QASE_MCP_INTEGRATION` — a per-call claim is the more specific one. The session and env paths are untouched, only outranked.
|
|
17
|
+
|
|
18
|
+
A producer is never sent without an integration: alone it would say "some skill did this" without saying whose, and since the integration name is allowlisted (`ALLOWED_INTEGRATIONS`) while the producer is only shape-checked (`^[a-z0-9][a-z0-9-]{1,47}$`), the integration is what keeps an arbitrary client out of the analytics dimension. Producers are validated by shape rather than by list on purpose, so a new plugin skill does not need a server release to be counted; cardinality is bounded by that pattern, by the `seq` cap of 500, and by the integration allowlist. Anything malformed, oversized or unknown is dropped silently and the API call still succeeds.
|
|
19
|
+
|
|
20
|
+
Nothing is sent when neither argument is supplied, so clients that send neither are unaffected, and a client that sends them to an older server simply has them ignored.
|
|
21
|
+
|
|
22
|
+
## [2.2.3]
|
|
23
|
+
|
|
24
|
+
### Fixed
|
|
25
|
+
|
|
26
|
+
- **`qql_help` claimed `result.status` has no `"untested"` value — it does.** `entities.result` and `enumValues.resultStatus` said flatly that no `"Untested"` status exists on the result entity, which was true when written but was made false by the untested-results feature that shipped weeks later. `untested` is a built-in status (ID 0) present in every workspace, matched case-insensitively like every other value here. It is excluded by default to preserve old query behavior.
|
|
27
|
+
- **The exclusion rule is now stated precisely.** Any condition on `status` lifts the default exclusion, but untested results only appear if the condition actually matches them: `status != "passed"` and `status is not empty` return them, while `status = "failed"` and `status in ["passed", "failed"]` do not, even though both are conditions on `status`. Saying "any condition brings them back" would have been the same class of falsehood as the claim it replaced — a model would add pointless `status != "untested"` guards to the ordinary `status = "failed"` queries this file recommends elsewhere.
|
|
28
|
+
- **`enumValues.resultStatus` listed four of the nine built-in statuses.** `blocked`, `retest`, `deleted` and `in_progress` were missing, so a model had no way to reach them — the same gap that hid `untested`. A workspace can also define statuses of its own, which no static list can cover, so both this section and the ID map now point at `GET /v1/system_field` (`result_status`, whose options carry `read_only: true` for the built-ins) for the authoritative set.
|
|
29
|
+
- **The aggregate status ID map stopped at four entries and had no way to signal its own limits.** It now covers all nine built-in IDs (0 = Untested through 8 = Invalid) and states that any higher ID is a workspace-defined status whose meaning must be read from `system_field` rather than guessed from a table.
|
|
30
|
+
- **`GROUP BY status` returned rows nothing could tell apart.** The documented example `SELECT (COUNT(id)) ... GROUP BY status` comes back as bare `{count_id}` rows with no status key, because a grouped field is only returned when it is also in `SELECT`. The example now reads `SELECT (status, COUNT(id))`, and the pitfall is spelled out.
|
|
31
|
+
- **Untested results carry no execution data**, which `entities.result` did not mention: `comment`, `stacktrace`, `steps` and `end_time` come back empty and `timeSpent` is 0. `timeSpent` aggregates skip them, but `COUNT` does not — so the same query can report more rows without moving its averages.
|
|
32
|
+
|
|
33
|
+
- **The attachment tests could fail the release build on an unrelated suite.** A path input becomes `createReadStream(path)`, which opens the file on a later tick; tests that only assert on `.path` never read the stream, so the open landed after `afterAll` had removed the scratch directory. With no `error` listener on the stream, that `ENOENT` surfaced as an unhandled failure attributed to whichever suite the worker was running by then — `integration-headers.test.ts`, which touches no files — and the open handle kept the worker alive past the end of the run. It only reproduced when Jest had few workers, which is exactly the CI runner, and it blocked the 2.2.3 publish job three runs in a row.
|
|
34
|
+
|
|
8
35
|
## [2.2.2]
|
|
9
36
|
|
|
10
37
|
### Added
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAEL,WAAW,EACX,QAAQ,EACR,SAAS,EACT,OAAO,EACP,UAAU,EACV,QAAQ,EACR,aAAa,EACb,UAAU,EACV,eAAe,EACf,cAAc,EACd,cAAc,EACd,UAAU,EACV,eAAe,EACf,SAAS,EACT,iBAAiB,EACjB,eAAe,EACf,QAAQ,EACR,mBAAmB,EACnB,UAAU,EACX,MAAM,iBAAiB,CAAC;AACzB,OAAc,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAEL,WAAW,EACX,QAAQ,EACR,SAAS,EACT,OAAO,EACP,UAAU,EACV,QAAQ,EACR,aAAa,EACb,UAAU,EACV,eAAe,EACf,cAAc,EACd,cAAc,EACd,UAAU,EACV,eAAe,EACf,SAAS,EACT,iBAAiB,EACjB,eAAe,EACf,QAAQ,EACR,mBAAmB,EACnB,UAAU,EACX,MAAM,iBAAiB,CAAC;AACzB,OAAc,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAC;AAYjE;;;;GAIG;AACH,wBAAgB,YAAY,IAAI,MAAM,CAGrC;AAED;;GAEG;AACH,UAAU,eAAe;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,cAAM,aAAa;IACjB,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC;IAC/B,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC;IAC7B,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC;IACzB,QAAQ,CAAC,UAAU,EAAE,aAAa,CAAC;IACnC,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC;IAC7B,QAAQ,CAAC,WAAW,EAAE,eAAe,CAAC;IACtC,QAAQ,CAAC,WAAW,EAAE,cAAc,CAAC;IACrC,QAAQ,CAAC,WAAW,EAAE,cAAc,CAAC;IACrC,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC;IAC7B,QAAQ,CAAC,YAAY,EAAE,eAAe,CAAC;IACvC,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC;IAC3B,QAAQ,CAAC,cAAc,EAAE,iBAAiB,CAAC;IAC3C,QAAQ,CAAC,YAAY,EAAE,eAAe,CAAC;IACvC,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC;IACzB,QAAQ,CAAC,gBAAgB,EAAE,mBAAmB,CAAC;IAC/C,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC;IAE7B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAS;IAC/B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAS;IAC9B,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAgB;gBAElC,MAAM,EAAE,eAAe,EAAE,aAAa,CAAC,EAAE,aAAa;IAmGlE;;OAEG;IACG,OAAO,CAAC,CAAC,GAAG,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,kBAAuB,GAAG,OAAO,CAAC,CAAC,CAAC;CAoBnF;AA8CD;;;;;;;;;;GAUG;AACH,wBAAgB,YAAY,IAAI,aAAa,CAY5C;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,CAE1C;AAED,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
package/build/client/index.js
CHANGED
|
@@ -15,6 +15,8 @@ import FormData from 'form-data';
|
|
|
15
15
|
import { requestTokenStorage, getEffectiveToken } from '../utils/auth-context.js';
|
|
16
16
|
import { getServer } from '../utils/server-context.js';
|
|
17
17
|
import { getIntegration } from '../utils/integration-context.js';
|
|
18
|
+
import { getProducer } from '../utils/producer-context.js';
|
|
19
|
+
import { buildIntegrationHeaders } from './producer-headers.js';
|
|
18
20
|
import { parseIntegrationMarker } from '../utils/integration-marker.js';
|
|
19
21
|
import { VERSION } from '../version.js';
|
|
20
22
|
/**
|
|
@@ -98,15 +100,15 @@ class QaseApiClient {
|
|
|
98
100
|
// X-MCP-Client-*: the same integration can run on any host, on either
|
|
99
101
|
// deployment. Sourced per-request from integrationStorage, falling back to
|
|
100
102
|
// QASE_MCP_INTEGRATION. Nothing is sent unless the marker is well-formed and
|
|
101
|
-
// allowlisted — see integration-marker.ts.
|
|
103
|
+
// allowlisted — see integration-marker.ts. The producer is a fourth axis
|
|
104
|
+
// under the integration, naming which part of it ran — a skill, a slash
|
|
105
|
+
// command, an agent — and it is never sent alone, since a producer without
|
|
106
|
+
// an integration attributes the call to nobody.
|
|
102
107
|
this.axiosInstance.interceptors.request.use((req) => {
|
|
103
|
-
const
|
|
104
|
-
if (
|
|
108
|
+
const headers = buildIntegrationHeaders(parseIntegrationMarker(getIntegration()), getProducer());
|
|
109
|
+
if (Object.keys(headers).length > 0) {
|
|
105
110
|
req.headers = req.headers ?? {};
|
|
106
|
-
req.headers
|
|
107
|
-
if (integration.version) {
|
|
108
|
-
req.headers['X-MCP-Integration-Version'] = integration.version;
|
|
109
|
-
}
|
|
111
|
+
Object.assign(req.headers, headers);
|
|
110
112
|
}
|
|
111
113
|
return req;
|
|
112
114
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EACL,aAAa,EACb,WAAW,EACX,QAAQ,EACR,SAAS,EACT,OAAO,EACP,UAAU,EACV,QAAQ,EACR,aAAa,EACb,UAAU,EACV,eAAe,EACf,cAAc,EACd,cAAc,EACd,UAAU,EACV,eAAe,EACf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,GAAG,SAAS,EAAE,CAAC;QAC3B,cAAc,GAAG,IAAI,aAAa,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;IACjF,CAAC;IAED,OAAO,cAAc,CAAC;AACxB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,mBAAmB;IACjC,cAAc,GAAG,IAAI,CAAC;AACxB,CAAC;AAED,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { IntegrationMarker } from '../utils/integration-marker.js';
|
|
2
|
+
import type { ProducerMarker } from '../utils/producer-marker.js';
|
|
3
|
+
/**
|
|
4
|
+
* The attribution headers for one outbound Qase API request.
|
|
5
|
+
*
|
|
6
|
+
* A producer is never sent without an integration. A producer alone says "some
|
|
7
|
+
* skill did this" without saying whose skill, which is not an attribution; and
|
|
8
|
+
* because the integration name is allowlisted while the producer is only
|
|
9
|
+
* shape-checked, the integration is what keeps an arbitrary client out of the
|
|
10
|
+
* analytics dimension.
|
|
11
|
+
*/
|
|
12
|
+
export declare function buildIntegrationHeaders(integration: IntegrationMarker | undefined, producer: ProducerMarker | undefined): Record<string, string>;
|
|
13
|
+
//# sourceMappingURL=producer-headers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"producer-headers.d.ts","sourceRoot":"","sources":["../../src/client/producer-headers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAElE;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CACrC,WAAW,EAAE,iBAAiB,GAAG,SAAS,EAC1C,QAAQ,EAAE,cAAc,GAAG,SAAS,GACnC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAexB"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The attribution headers for one outbound Qase API request.
|
|
3
|
+
*
|
|
4
|
+
* A producer is never sent without an integration. A producer alone says "some
|
|
5
|
+
* skill did this" without saying whose skill, which is not an attribution; and
|
|
6
|
+
* because the integration name is allowlisted while the producer is only
|
|
7
|
+
* shape-checked, the integration is what keeps an arbitrary client out of the
|
|
8
|
+
* analytics dimension.
|
|
9
|
+
*/
|
|
10
|
+
export function buildIntegrationHeaders(integration, producer) {
|
|
11
|
+
if (!integration)
|
|
12
|
+
return {};
|
|
13
|
+
const headers = {
|
|
14
|
+
'X-MCP-Integration-Name': integration.name,
|
|
15
|
+
};
|
|
16
|
+
if (integration.version) {
|
|
17
|
+
headers['X-MCP-Integration-Version'] = integration.version;
|
|
18
|
+
}
|
|
19
|
+
if (producer) {
|
|
20
|
+
headers['X-MCP-Integration-Producer'] = producer.producer;
|
|
21
|
+
headers['X-MCP-Integration-Seq'] = String(producer.seq);
|
|
22
|
+
headers['X-MCP-Integration-Entrypoint'] = producer.entrypoint;
|
|
23
|
+
}
|
|
24
|
+
return headers;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=producer-headers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"producer-headers.js","sourceRoot":"","sources":["../../src/client/producer-headers.ts"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AACH,MAAM,UAAU,uBAAuB,CACrC,WAA0C,EAC1C,QAAoC;IAEpC,IAAI,CAAC,WAAW;QAAE,OAAO,EAAE,CAAC;IAE5B,MAAM,OAAO,GAA2B;QACtC,wBAAwB,EAAE,WAAW,CAAC,IAAI;KAC3C,CAAC;IACF,IAAI,WAAW,CAAC,OAAO,EAAE,CAAC;QACxB,OAAO,CAAC,2BAA2B,CAAC,GAAG,WAAW,CAAC,OAAO,CAAC;IAC7D,CAAC;IACD,IAAI,QAAQ,EAAE,CAAC;QACb,OAAO,CAAC,4BAA4B,CAAC,GAAG,QAAQ,CAAC,QAAQ,CAAC;QAC1D,OAAO,CAAC,uBAAuB,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;QACxD,OAAO,CAAC,8BAA8B,CAAC,GAAG,QAAQ,CAAC,UAAU,CAAC;IAChE,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;GAWG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;GAWG;AAyBH,OAAO,0BAA0B,CAAC"}
|
package/build/index.js
CHANGED
|
@@ -19,6 +19,10 @@ import { formatApiError, ToolExecutionError } from './utils/errors.js';
|
|
|
19
19
|
import { compactResponse } from './utils/response-shape.js';
|
|
20
20
|
import { isRichResult } from './utils/rich-response.js';
|
|
21
21
|
import { serverStorage, confirmDestructiveAction } from './utils/server-context.js';
|
|
22
|
+
import { extractCallMarkers } from './utils/call-markers.js';
|
|
23
|
+
import { parseProducerMarker } from './utils/producer-marker.js';
|
|
24
|
+
import { producerStorage } from './utils/producer-context.js';
|
|
25
|
+
import { callIntegrationStorage } from './utils/integration-context.js';
|
|
22
26
|
import { setupSSETransport } from './transports/sse.js';
|
|
23
27
|
import { setupStreamableHttpTransport } from './transports/streamableHttp.js';
|
|
24
28
|
import { VERSION } from './version.js';
|
|
@@ -77,77 +81,90 @@ function createServer() {
|
|
|
77
81
|
*/
|
|
78
82
|
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
79
83
|
return serverStorage.run(server, async () => {
|
|
80
|
-
const { name, arguments:
|
|
84
|
+
const { name, arguments: rawArgs } = request.params;
|
|
85
|
+
// The two hidden attribution arguments never reach a tool handler — see
|
|
86
|
+
// call-markers.ts for why they travel as arguments rather than a header.
|
|
87
|
+
const markers = extractCallMarkers(rawArgs);
|
|
88
|
+
const args = markers.rest;
|
|
81
89
|
console.error(`[Server] Executing tool: ${name}`);
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
// Elicitation: confirm destructive actions before execution
|
|
88
|
-
const toolDef = toolRegistry.getTool(name);
|
|
89
|
-
if (toolDef?.annotations?.destructiveHint === true) {
|
|
90
|
-
const confirmed = await confirmDestructiveAction(name, args || {});
|
|
91
|
-
if (!confirmed) {
|
|
92
|
-
return {
|
|
93
|
-
content: [{ type: 'text', text: `Action "${name}" cancelled by user.` }],
|
|
94
|
-
};
|
|
90
|
+
const runCall = async () => {
|
|
91
|
+
// Get tool handler from registry
|
|
92
|
+
const handler = toolRegistry.getHandler(name);
|
|
93
|
+
if (!handler) {
|
|
94
|
+
throw new Error(`Unknown tool: ${name}. Use list_tools to see available tools.`);
|
|
95
95
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
96
|
+
// Elicitation: confirm destructive actions before execution
|
|
97
|
+
const toolDef = toolRegistry.getTool(name);
|
|
98
|
+
if (toolDef?.annotations?.destructiveHint === true) {
|
|
99
|
+
const confirmed = await confirmDestructiveAction(name, args || {});
|
|
100
|
+
if (!confirmed) {
|
|
101
|
+
return {
|
|
102
|
+
content: [{ type: 'text', text: `Action "${name}" cancelled by user.` }],
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
try {
|
|
107
|
+
// Execute the tool handler with provided arguments
|
|
108
|
+
const result = await handler(args || {});
|
|
109
|
+
// Rich results: pass through pre-formatted content blocks directly
|
|
110
|
+
if (isRichResult(result)) {
|
|
111
|
+
return {
|
|
112
|
+
content: result.content,
|
|
113
|
+
...(result.structuredContent && { structuredContent: result.structuredContent }),
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
// Default: wrap in compact JSON text block
|
|
117
|
+
const compacted = compactResponse(result);
|
|
118
|
+
const hasOutputSchema = toolDef?.outputSchema !== undefined;
|
|
102
119
|
return {
|
|
103
|
-
content:
|
|
104
|
-
|
|
120
|
+
content: [
|
|
121
|
+
{
|
|
122
|
+
type: 'text',
|
|
123
|
+
text: JSON.stringify(compacted),
|
|
124
|
+
},
|
|
125
|
+
],
|
|
126
|
+
// SDK requires structuredContent when outputSchema is defined
|
|
127
|
+
...(hasOutputSchema && { structuredContent: compacted }),
|
|
105
128
|
};
|
|
106
129
|
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
{
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
console.error(`[Server] Tool '${name}'
|
|
130
|
+
catch (error) {
|
|
131
|
+
// Handle tool execution errors (expected failures like validation, API errors)
|
|
132
|
+
// These are returned with isError: true so the LLM can understand and recover
|
|
133
|
+
if (error instanceof ToolExecutionError) {
|
|
134
|
+
console.error(`[Server] Tool '${name}' execution error:`, error.message);
|
|
135
|
+
return {
|
|
136
|
+
content: [
|
|
137
|
+
{
|
|
138
|
+
type: 'text',
|
|
139
|
+
text: error.toUserMessage(),
|
|
140
|
+
},
|
|
141
|
+
],
|
|
142
|
+
isError: true,
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
// Handle unexpected errors (protocol-level failures)
|
|
146
|
+
// Format error message using our error utilities
|
|
147
|
+
const errorMessage = formatApiError(error);
|
|
148
|
+
console.error(`[Server] Tool '${name}' unexpected error:`, errorMessage);
|
|
149
|
+
// Return as tool execution error with isError: true for better LLM recovery
|
|
126
150
|
return {
|
|
127
151
|
content: [
|
|
128
152
|
{
|
|
129
153
|
type: 'text',
|
|
130
|
-
text:
|
|
154
|
+
text: errorMessage,
|
|
131
155
|
},
|
|
132
156
|
],
|
|
133
157
|
isError: true,
|
|
134
158
|
};
|
|
135
159
|
}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
type: 'text',
|
|
145
|
-
text: errorMessage,
|
|
146
|
-
},
|
|
147
|
-
],
|
|
148
|
-
isError: true,
|
|
149
|
-
};
|
|
150
|
-
}
|
|
160
|
+
};
|
|
161
|
+
// Both scopes stay open for the whole call, so the outbound interceptor
|
|
162
|
+
// sees them however deep in the handler the API request is made.
|
|
163
|
+
const producer = parseProducerMarker(markers.producer);
|
|
164
|
+
const withProducer = producer ? () => producerStorage.run(producer, runCall) : runCall;
|
|
165
|
+
return markers.integration
|
|
166
|
+
? callIntegrationStorage.run(markers.integration, withProducer)
|
|
167
|
+
: withProducer();
|
|
151
168
|
});
|
|
152
169
|
});
|
|
153
170
|
// Wire tool discovery notifications: when tools are activated via qase_discover_tools,
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,wBAAwB,EACxB,sBAAsB,GACvB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvE,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,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OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -132,7 +132,7 @@ async function getQqlHelp(args) {
|
|
|
132
132
|
'Aggregating: SELECT (AGGREGATE[, ...]) entity = "TYPE" and CONDITION... ' +
|
|
133
133
|
'[GROUP BY field] [HAVING condition] — SELECT comes FIRST, before the conditions.',
|
|
134
134
|
entities: ['case', 'defect', 'run', 'result', 'plan', 'requirement'],
|
|
135
|
-
note: 'QQL is only available in
|
|
135
|
+
note: 'QQL is only available in Teams and Enterprise Qase subscriptions',
|
|
136
136
|
fieldNamesVary: 'Field names are NOT uniform across entities — see the `entities` topic before writing ' +
|
|
137
137
|
'a query. Most common failure: `created` exists on case/defect/plan/requirement but ' +
|
|
138
138
|
'NOT on run (started/ended) or result (ended only).',
|
|
@@ -173,8 +173,11 @@ async function getQqlHelp(args) {
|
|
|
173
173
|
'(only `ended`), no title/description, no custom fields, and no environment. Unlike ' +
|
|
174
174
|
'case.suite, result.suite is a numeric suite ID. There is no run-ID field — `run` ' +
|
|
175
175
|
'matches the run TITLE, so results cannot be tied to a specific run ID in QQL; use ' +
|
|
176
|
-
'GET /v1/result/{code}?filters[run]=ID via qase_api for that. status
|
|
177
|
-
'"
|
|
176
|
+
'GET /v1/result/{code}?filters[run]=ID via qase_api for that. status DOES have an ' +
|
|
177
|
+
'"untested" value, but it is excluded by default — see enumValues. An untested result ' +
|
|
178
|
+
'is a case nobody has run yet, so its execution fields come back empty (comment, ' +
|
|
179
|
+
'stacktrace, steps, end_time null/[], timeSpent 0) — aggregates over timeSpent skip ' +
|
|
180
|
+
'them, but COUNT does not.',
|
|
178
181
|
plan: 'Test plans — entity = "plan". Fields: id, title, description, project, created, updated, deleted, isDeleted.',
|
|
179
182
|
requirement: 'Requirements — entity = "requirement". Fields: id, title, description, parent, status, ' +
|
|
180
183
|
'type, project, author, createdBy, created, updated, deleted, isDeleted. Note: no link ' +
|
|
@@ -190,13 +193,20 @@ async function getQqlHelp(args) {
|
|
|
190
193
|
'Violating either fails with "Query is invalid", which does not say which one.',
|
|
191
194
|
examples: [
|
|
192
195
|
'SELECT (COUNT(id)) entity = "result" and project = "DEMO" and status = "failed"',
|
|
193
|
-
'SELECT (COUNT(id)) entity = "result" and project = "DEMO" GROUP BY status',
|
|
196
|
+
'SELECT (status, COUNT(id)) entity = "result" and project = "DEMO" GROUP BY status',
|
|
194
197
|
'SELECT (COUNT(id)) entity = "case" and project = "DEMO" GROUP BY suite HAVING COUNT(id) > 10',
|
|
195
198
|
'SELECT (AVG(timeSpent), MAX(timeSpent)) entity = "result" and project = "DEMO"',
|
|
196
199
|
],
|
|
200
|
+
groupedFieldMustBeInSelect: 'GROUP BY alone does not return the field it groups by — SELECT (COUNT(id)) ... ' +
|
|
201
|
+
'GROUP BY status comes back as bare {count_id} rows with nothing to tell them apart. ' +
|
|
202
|
+
'Put the field in SELECT too: SELECT (status, COUNT(id)) ... GROUP BY status.',
|
|
197
203
|
enumsComeBackAsNumbers: 'In aggregate results, enum fields are returned as their numeric IDs, not labels: ' +
|
|
198
|
-
'result.status 1 = Passed, 2 = Failed,
|
|
199
|
-
'
|
|
204
|
+
'result.status 0 = Untested, 1 = Passed, 2 = Failed, 3 = Blocked, 4 = Retest, ' +
|
|
205
|
+
'5 = Skipped, 6 = Deleted, 7 = In progress, 8 = Invalid — those nine are built in and ' +
|
|
206
|
+
'fixed, but any ID above them is a workspace-defined status whose meaning differs per ' +
|
|
207
|
+
'workspace, so do not map those from a table: read GET /v1/system_field via qase_api ' +
|
|
208
|
+
'and use the `result_status` options. automation 0 = Manual, 1 = To be automated, ' +
|
|
209
|
+
'2 = Automated. Map them before reporting.',
|
|
200
210
|
groupByAddsTitleSuffix: 'Grouping by a string field returns it with a _title suffix — GROUP BY suite yields ' +
|
|
201
211
|
'a `suite_title` key in the response, not `suite`.',
|
|
202
212
|
},
|
|
@@ -215,7 +225,17 @@ async function getQqlHelp(args) {
|
|
|
215
225
|
caseAutomation: '"Manual" (a.k.a. "Not automated"), "To be automated", "Automated"',
|
|
216
226
|
defectStatus: '"Open", "In progress", "Resolved", "Invalid"',
|
|
217
227
|
runStatus: '"In Progress", "Passed", "Failed", "Aborted"',
|
|
218
|
-
resultStatus: '"passed", "failed", "
|
|
228
|
+
resultStatus: 'Built-in: "untested", "passed", "failed", "blocked", "retest", "skipped", "deleted", ' +
|
|
229
|
+
'"in_progress", "invalid". A workspace can add its own statuses on top, so this list is ' +
|
|
230
|
+
'not the whole set for a given workspace — read GET /v1/system_field via qase_api and ' +
|
|
231
|
+
'take the `result_status` field for that (its options carry read_only: true for the ' +
|
|
232
|
+
'built-ins above, false for the workspace\'s own). Either the title or the slug works, ' +
|
|
233
|
+
'case-insensitively: "not ready" and "not_ready" are the same value. ' +
|
|
234
|
+
'"untested" results are EXCLUDED BY DEFAULT (to preserve old query behavior). ANY ' +
|
|
235
|
+
'condition on status lifts that exclusion, but they only show up if the condition ' +
|
|
236
|
+
'actually matches them: status != "passed" and status is not empty include them, ' +
|
|
237
|
+
'status = "failed" and status in ["passed", "failed"] do not. To filter on status and ' +
|
|
238
|
+
'still keep them out, exclude them: status != "passed" and status != "untested".',
|
|
219
239
|
},
|
|
220
240
|
functions: {
|
|
221
241
|
currentUser: 'currentUser() - Returns current user ID',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/operations-v2/qql/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3F,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,eAA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AAE,YAAY;IAClB,WAAW,EACT,mGAAmG;IACrG,MAAM,EAAE,eAAe;IACvB,OAAO,EAAE,SAAS;IAClB,WAAW,EAAE,cAAc;IAC3B,YAAY,EAAE,eAAe;CAC9B,CAAC,CAAC;AAEH,YAAY,CAAC,QAAQ,CAAC;IACpB,IAAI,EAAE,UAAU;IAChB,WAAW,EACT,4FAA4F;QAC5F,2FAA2F;QAC3F,wFAAwF;QACxF,oEAAoE;IACtE,MAAM,EAAE,gBAAgB;IACxB,OAAO,EAAE,UAAU;IACnB,WAAW,EAAE,cAAc;CAC5B,CAAC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hidden attribution arguments on a tools/call.
|
|
3
|
+
*
|
|
4
|
+
* A client cannot vary an HTTP header per call — the transport captures the
|
|
5
|
+
* integration marker once per MCP session — so an integration that wants to
|
|
6
|
+
* attribute individual calls has to put the marker in the arguments. These two
|
|
7
|
+
* fields are that channel. They are deliberately not declared in any tool's
|
|
8
|
+
* input schema: they are not parameters, and no model should be asked to supply
|
|
9
|
+
* them.
|
|
10
|
+
*
|
|
11
|
+
* They are stripped here, before the handler sees the arguments. qase_api was
|
|
12
|
+
* verified not to pass arguments through into a request body, but relying on no
|
|
13
|
+
* handler ever doing so is an assumption with no expiry date.
|
|
14
|
+
*/
|
|
15
|
+
export declare const INTEGRATION_ARG = "_qase_integration";
|
|
16
|
+
export declare const PRODUCER_ARG = "_qase_producer";
|
|
17
|
+
export interface CallMarkers {
|
|
18
|
+
integration?: string;
|
|
19
|
+
producer?: string;
|
|
20
|
+
rest: Record<string, unknown>;
|
|
21
|
+
}
|
|
22
|
+
export declare function extractCallMarkers(args: unknown): CallMarkers;
|
|
23
|
+
//# sourceMappingURL=call-markers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"call-markers.d.ts","sourceRoot":"","sources":["../../src/utils/call-markers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,eAAO,MAAM,eAAe,sBAAsB,CAAC;AACnD,eAAO,MAAM,YAAY,mBAAmB,CAAC;AAE7C,MAAM,WAAW,WAAW;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC/B;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,OAAO,GAAG,WAAW,CAc7D"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hidden attribution arguments on a tools/call.
|
|
3
|
+
*
|
|
4
|
+
* A client cannot vary an HTTP header per call — the transport captures the
|
|
5
|
+
* integration marker once per MCP session — so an integration that wants to
|
|
6
|
+
* attribute individual calls has to put the marker in the arguments. These two
|
|
7
|
+
* fields are that channel. They are deliberately not declared in any tool's
|
|
8
|
+
* input schema: they are not parameters, and no model should be asked to supply
|
|
9
|
+
* them.
|
|
10
|
+
*
|
|
11
|
+
* They are stripped here, before the handler sees the arguments. qase_api was
|
|
12
|
+
* verified not to pass arguments through into a request body, but relying on no
|
|
13
|
+
* handler ever doing so is an assumption with no expiry date.
|
|
14
|
+
*/
|
|
15
|
+
export const INTEGRATION_ARG = '_qase_integration';
|
|
16
|
+
export const PRODUCER_ARG = '_qase_producer';
|
|
17
|
+
export function extractCallMarkers(args) {
|
|
18
|
+
if (!args || typeof args !== 'object')
|
|
19
|
+
return { rest: {} };
|
|
20
|
+
const { [INTEGRATION_ARG]: integration, [PRODUCER_ARG]: producer, ...rest } = args;
|
|
21
|
+
return {
|
|
22
|
+
integration: typeof integration === 'string' ? integration : undefined,
|
|
23
|
+
producer: typeof producer === 'string' ? producer : undefined,
|
|
24
|
+
rest,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=call-markers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"call-markers.js","sourceRoot":"","sources":["../../src/utils/call-markers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,MAAM,CAAC,MAAM,eAAe,GAAG,mBAAmB,CAAC;AACnD,MAAM,CAAC,MAAM,YAAY,GAAG,gBAAgB,CAAC;AAQ7C,MAAM,UAAU,kBAAkB,CAAC,IAAa;IAC9C,IAAI,CAAC,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ;QAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;IAE3D,MAAM,EACJ,CAAC,eAAe,CAAC,EAAE,WAAW,EAC9B,CAAC,YAAY,CAAC,EAAE,QAAQ,EACxB,GAAG,IAAI,EACR,GAAG,IAA+B,CAAC;IAEpC,OAAO;QACL,WAAW,EAAE,OAAO,WAAW,KAAK,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS;QACtE,QAAQ,EAAE,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS;QAC7D,IAAI;KACL,CAAC;AACJ,CAAC"}
|
|
@@ -12,11 +12,17 @@ import { AsyncLocalStorage } from 'async_hooks';
|
|
|
12
12
|
*/
|
|
13
13
|
export declare const integrationStorage: AsyncLocalStorage<string>;
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
15
|
+
* Per-call integration marker, supplied in the call arguments rather than a
|
|
16
|
+
* header. Takes priority over the session-scoped value: a per-call claim is more
|
|
17
|
+
* specific than one captured when the session opened.
|
|
18
|
+
*/
|
|
19
|
+
export declare const callIntegrationStorage: AsyncLocalStorage<string>;
|
|
20
|
+
/**
|
|
21
|
+
* Read the marker for the current async context: the per-call value first, then
|
|
22
|
+
* the request-scoped one, then the QASE_MCP_INTEGRATION env var (the stdio path,
|
|
23
|
+
* where there is no request to carry a header).
|
|
18
24
|
*
|
|
19
|
-
* Returns undefined when
|
|
25
|
+
* Returns undefined when none is set — the common case, and the one that must
|
|
20
26
|
* leave the outbound request untouched. The value is unvalidated; callers pass it
|
|
21
27
|
* through parseIntegrationMarker().
|
|
22
28
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integration-context.d.ts","sourceRoot":"","sources":["../../src/utils/integration-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,kBAAkB,2BAAkC,CAAC;AAElE;;;;;;;;GAQG;AACH,wBAAgB,cAAc,IAAI,MAAM,GAAG,SAAS,
|
|
1
|
+
{"version":3,"file":"integration-context.d.ts","sourceRoot":"","sources":["../../src/utils/integration-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,kBAAkB,2BAAkC,CAAC;AAElE;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,2BAAkC,CAAC;AAEtE;;;;;;;;GAQG;AACH,wBAAgB,cAAc,IAAI,MAAM,GAAG,SAAS,CAOnD"}
|
|
@@ -12,15 +12,24 @@ import { AsyncLocalStorage } from 'async_hooks';
|
|
|
12
12
|
*/
|
|
13
13
|
export const integrationStorage = new AsyncLocalStorage();
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
15
|
+
* Per-call integration marker, supplied in the call arguments rather than a
|
|
16
|
+
* header. Takes priority over the session-scoped value: a per-call claim is more
|
|
17
|
+
* specific than one captured when the session opened.
|
|
18
|
+
*/
|
|
19
|
+
export const callIntegrationStorage = new AsyncLocalStorage();
|
|
20
|
+
/**
|
|
21
|
+
* Read the marker for the current async context: the per-call value first, then
|
|
22
|
+
* the request-scoped one, then the QASE_MCP_INTEGRATION env var (the stdio path,
|
|
23
|
+
* where there is no request to carry a header).
|
|
18
24
|
*
|
|
19
|
-
* Returns undefined when
|
|
25
|
+
* Returns undefined when none is set — the common case, and the one that must
|
|
20
26
|
* leave the outbound request untouched. The value is unvalidated; callers pass it
|
|
21
27
|
* through parseIntegrationMarker().
|
|
22
28
|
*/
|
|
23
29
|
export function getIntegration() {
|
|
30
|
+
const callIntegration = callIntegrationStorage.getStore();
|
|
31
|
+
if (callIntegration)
|
|
32
|
+
return callIntegration;
|
|
24
33
|
const requestIntegration = integrationStorage.getStore();
|
|
25
34
|
if (requestIntegration)
|
|
26
35
|
return requestIntegration;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integration-context.js","sourceRoot":"","sources":["../../src/utils/integration-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,iBAAiB,EAAU,CAAC;AAElE;;;;;;;;GAQG;AACH,MAAM,UAAU,cAAc;IAC5B,MAAM,kBAAkB,GAAG,kBAAkB,CAAC,QAAQ,EAAE,CAAC;IACzD,IAAI,kBAAkB;QAAE,OAAO,kBAAkB,CAAC;IAClD,OAAO,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE,IAAI,EAAE,IAAI,SAAS,CAAC;AAC/D,CAAC"}
|
|
1
|
+
{"version":3,"file":"integration-context.js","sourceRoot":"","sources":["../../src/utils/integration-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,iBAAiB,EAAU,CAAC;AAElE;;;;GAIG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,iBAAiB,EAAU,CAAC;AAEtE;;;;;;;;GAQG;AACH,MAAM,UAAU,cAAc;IAC5B,MAAM,eAAe,GAAG,sBAAsB,CAAC,QAAQ,EAAE,CAAC;IAC1D,IAAI,eAAe;QAAE,OAAO,eAAe,CAAC;IAE5C,MAAM,kBAAkB,GAAG,kBAAkB,CAAC,QAAQ,EAAE,CAAC;IACzD,IAAI,kBAAkB;QAAE,OAAO,kBAAkB,CAAC;IAClD,OAAO,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE,IAAI,EAAE,IAAI,SAAS,CAAC;AAC/D,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AsyncLocalStorage } from 'async_hooks';
|
|
2
|
+
import type { ProducerMarker } from './producer-marker.js';
|
|
3
|
+
/**
|
|
4
|
+
* Per-call producer storage.
|
|
5
|
+
*
|
|
6
|
+
* Per *call*, not per request or per session: one MCP session runs many
|
|
7
|
+
* producers in sequence, which is the whole point of the axis. Opened by the
|
|
8
|
+
* CallTool handler and read by the outbound interceptor.
|
|
9
|
+
*/
|
|
10
|
+
export declare const producerStorage: AsyncLocalStorage<ProducerMarker>;
|
|
11
|
+
export declare function getProducer(): ProducerMarker | undefined;
|
|
12
|
+
//# sourceMappingURL=producer-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"producer-context.d.ts","sourceRoot":"","sources":["../../src/utils/producer-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,mCAA0C,CAAC;AAEvE,wBAAgB,WAAW,IAAI,cAAc,GAAG,SAAS,CAExD"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AsyncLocalStorage } from 'async_hooks';
|
|
2
|
+
/**
|
|
3
|
+
* Per-call producer storage.
|
|
4
|
+
*
|
|
5
|
+
* Per *call*, not per request or per session: one MCP session runs many
|
|
6
|
+
* producers in sequence, which is the whole point of the axis. Opened by the
|
|
7
|
+
* CallTool handler and read by the outbound interceptor.
|
|
8
|
+
*/
|
|
9
|
+
export const producerStorage = new AsyncLocalStorage();
|
|
10
|
+
export function getProducer() {
|
|
11
|
+
return producerStorage.getStore();
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=producer-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"producer-context.js","sourceRoot":"","sources":["../../src/utils/producer-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGhD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,iBAAiB,EAAkB,CAAC;AAEvE,MAAM,UAAU,WAAW;IACzB,OAAO,eAAe,CAAC,QAAQ,EAAE,CAAC;AACpC,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Producer Marker
|
|
3
|
+
*
|
|
4
|
+
* Which *part* of an integration produced this call — a skill, a slash command,
|
|
5
|
+
* or an agent. A fourth axis under the integration marker (see
|
|
6
|
+
* integration-marker.ts), answering "what did they run" where that one answers
|
|
7
|
+
* "what is driving the server".
|
|
8
|
+
*
|
|
9
|
+
* Unlike integrations, producers are NOT allowlisted. An integration is a
|
|
10
|
+
* product and its name is a deliberate, reviewed addition; a producer is a part
|
|
11
|
+
* of one, and new parts appear whenever that product ships a feature. Requiring
|
|
12
|
+
* a server release before a new skill could be counted would guarantee the
|
|
13
|
+
* metric lags the thing it measures. Cardinality is instead bounded by the
|
|
14
|
+
* pattern below, by the seq cap, and by the fact that nothing is forwarded
|
|
15
|
+
* unless the integration name itself passed the allowlist.
|
|
16
|
+
*/
|
|
17
|
+
/** How the user reached the producer. */
|
|
18
|
+
export type Entrypoint = 'skill' | 'command' | 'agent';
|
|
19
|
+
/** Calls beyond this in one run all report the cap, bounding cardinality. */
|
|
20
|
+
export declare const MAX_SEQ = 500;
|
|
21
|
+
export interface ProducerMarker {
|
|
22
|
+
producer: string;
|
|
23
|
+
/** 1-based index of this call within its run; MAX_SEQ for anything beyond. */
|
|
24
|
+
seq: number;
|
|
25
|
+
entrypoint: Entrypoint;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Parse a `<producer>/<seq>/<entrypoint>` marker.
|
|
29
|
+
*
|
|
30
|
+
* Best-effort and silent, exactly like parseIntegrationMarker: anything
|
|
31
|
+
* malformed yields undefined rather than an error, so a bad marker can never
|
|
32
|
+
* fail the API call it was attached to.
|
|
33
|
+
*/
|
|
34
|
+
export declare function parseProducerMarker(raw: string | undefined | null): ProducerMarker | undefined;
|
|
35
|
+
//# sourceMappingURL=producer-marker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"producer-marker.d.ts","sourceRoot":"","sources":["../../src/utils/producer-marker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,yCAAyC;AACzC,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,CAAC;AAUvD,6EAA6E;AAC7E,eAAO,MAAM,OAAO,MAAM,CAAC;AAE3B,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,8EAA8E;IAC9E,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,UAAU,CAAC;CACxB;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,cAAc,GAAG,SAAS,CAiB9F"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Producer Marker
|
|
3
|
+
*
|
|
4
|
+
* Which *part* of an integration produced this call — a skill, a slash command,
|
|
5
|
+
* or an agent. A fourth axis under the integration marker (see
|
|
6
|
+
* integration-marker.ts), answering "what did they run" where that one answers
|
|
7
|
+
* "what is driving the server".
|
|
8
|
+
*
|
|
9
|
+
* Unlike integrations, producers are NOT allowlisted. An integration is a
|
|
10
|
+
* product and its name is a deliberate, reviewed addition; a producer is a part
|
|
11
|
+
* of one, and new parts appear whenever that product ships a feature. Requiring
|
|
12
|
+
* a server release before a new skill could be counted would guarantee the
|
|
13
|
+
* metric lags the thing it measures. Cardinality is instead bounded by the
|
|
14
|
+
* pattern below, by the seq cap, and by the fact that nothing is forwarded
|
|
15
|
+
* unless the integration name itself passed the allowlist.
|
|
16
|
+
*/
|
|
17
|
+
const ENTRYPOINTS = ['skill', 'command', 'agent'];
|
|
18
|
+
/** Lowercase, dash-separated, 2-48 characters. Deliberately narrow. */
|
|
19
|
+
const PRODUCER_PATTERN = /^[a-z0-9][a-z0-9-]{1,47}$/;
|
|
20
|
+
/** Longest input we will look at; longer is truncated, then validated. */
|
|
21
|
+
const MAX_FIELD_LENGTH = 128;
|
|
22
|
+
/** Calls beyond this in one run all report the cap, bounding cardinality. */
|
|
23
|
+
export const MAX_SEQ = 500;
|
|
24
|
+
/**
|
|
25
|
+
* Parse a `<producer>/<seq>/<entrypoint>` marker.
|
|
26
|
+
*
|
|
27
|
+
* Best-effort and silent, exactly like parseIntegrationMarker: anything
|
|
28
|
+
* malformed yields undefined rather than an error, so a bad marker can never
|
|
29
|
+
* fail the API call it was attached to.
|
|
30
|
+
*/
|
|
31
|
+
export function parseProducerMarker(raw) {
|
|
32
|
+
const trimmed = raw?.trim().slice(0, MAX_FIELD_LENGTH);
|
|
33
|
+
if (!trimmed)
|
|
34
|
+
return undefined;
|
|
35
|
+
const parts = trimmed.split('/');
|
|
36
|
+
if (parts.length !== 3)
|
|
37
|
+
return undefined;
|
|
38
|
+
const producer = parts[0].trim().toLowerCase();
|
|
39
|
+
if (!PRODUCER_PATTERN.test(producer))
|
|
40
|
+
return undefined;
|
|
41
|
+
const entrypoint = parts[2].trim().toLowerCase();
|
|
42
|
+
if (!ENTRYPOINTS.includes(entrypoint))
|
|
43
|
+
return undefined;
|
|
44
|
+
const seq = Number(parts[1].trim());
|
|
45
|
+
if (!Number.isInteger(seq) || seq < 1)
|
|
46
|
+
return undefined;
|
|
47
|
+
return { producer, seq: Math.min(seq, MAX_SEQ), entrypoint: entrypoint };
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=producer-marker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"producer-marker.js","sourceRoot":"","sources":["../../src/utils/producer-marker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAKH,MAAM,WAAW,GAAsB,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;AAErE,uEAAuE;AACvE,MAAM,gBAAgB,GAAG,2BAA2B,CAAC;AAErD,0EAA0E;AAC1E,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAE7B,6EAA6E;AAC7E,MAAM,CAAC,MAAM,OAAO,GAAG,GAAG,CAAC;AAS3B;;;;;;GAMG;AACH,MAAM,UAAU,mBAAmB,CAAC,GAA8B;IAChE,MAAM,OAAO,GAAG,GAAG,EAAE,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,gBAAgB,CAAC,CAAC;IACvD,IAAI,CAAC,OAAO;QAAE,OAAO,SAAS,CAAC;IAE/B,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACjC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,SAAS,CAAC;IAEzC,MAAM,QAAQ,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAC/C,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC;QAAE,OAAO,SAAS,CAAC;IAEvD,MAAM,UAAU,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IACjD,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,UAAU,CAAC;QAAE,OAAO,SAAS,CAAC;IAExD,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IACpC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC;QAAE,OAAO,SAAS,CAAC;IAExD,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,EAAE,UAAU,EAAE,UAAwB,EAAE,CAAC;AACzF,CAAC"}
|
package/build/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "2.
|
|
1
|
+
export declare const VERSION = "2.3.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/build/version.js
CHANGED
package/package.json
CHANGED
package/server.json
CHANGED
|
@@ -8,12 +8,12 @@
|
|
|
8
8
|
"url": "https://github.com/qase-tms/qase-mcp-server",
|
|
9
9
|
"source": "github"
|
|
10
10
|
},
|
|
11
|
-
"version": "2.
|
|
11
|
+
"version": "2.3.0",
|
|
12
12
|
"packages": [
|
|
13
13
|
{
|
|
14
14
|
"registryType": "npm",
|
|
15
15
|
"identifier": "@qase/mcp-server",
|
|
16
|
-
"version": "2.
|
|
16
|
+
"version": "2.3.0",
|
|
17
17
|
"transport": {
|
|
18
18
|
"type": "stdio"
|
|
19
19
|
},
|