qyl-mcp-server 2.0.0 → 3.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/README.md +36 -4
- package/dist/ci.js +2 -2
- package/dist/ci.js.map +1 -1
- package/dist/collector.d.ts +15 -2
- package/dist/collector.js +74 -6
- package/dist/collector.js.map +1 -1
- package/dist/contract-operations.d.ts +37 -0
- package/dist/contract-operations.js +124 -0
- package/dist/contract-operations.js.map +1 -0
- package/dist/contract-validation.d.ts +30 -14
- package/dist/contract-validation.js +70 -188
- package/dist/contract-validation.js.map +1 -1
- package/dist/demo.d.ts +18 -0
- package/dist/demo.js +99 -0
- package/dist/demo.js.map +1 -1
- package/dist/main.d.ts +33 -0
- package/dist/main.js +39 -1
- package/dist/main.js.map +1 -1
- package/dist/mcp-app.html +1 -1
- package/dist/mcp-dashboard.html +1 -1
- package/dist/mcp-home.html +1 -1
- package/dist/metrics-tools.d.ts +23 -0
- package/dist/metrics-tools.js +96 -0
- package/dist/metrics-tools.js.map +1 -0
- package/dist/metrics.d.ts +45 -0
- package/dist/metrics.js +274 -0
- package/dist/metrics.js.map +1 -0
- package/dist/native-execution.d.ts +4 -4
- package/dist/native-execution.js +1 -1
- package/dist/native-execution.js.map +1 -1
- package/dist/observe-graph.html +1 -1
- package/dist/server.js +13 -4
- package/dist/server.js.map +1 -1
- package/dist/summaries.d.ts +13 -0
- package/dist/summaries.js +67 -0
- package/dist/summaries.js.map +1 -1
- package/dist/tools.js +5 -5
- package/dist/tools.js.map +1 -1
- package/dist/workflow-tools.js +14 -7
- package/dist/workflow-tools.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -34,6 +34,15 @@ endpoint.
|
|
|
34
34
|
**Telemetry** — `list_traces`, `get_trace`, `list_sessions`, `search_logs`,
|
|
35
35
|
`ci_log`, `display_traces`, `display_mcp_dashboard`.
|
|
36
36
|
|
|
37
|
+
**Metrics** — `list_metrics`, `get_metric_series`, `query_metric`. Read in that
|
|
38
|
+
order: the catalog gives you an exact instrument name and how many attribute
|
|
39
|
+
streams it has, series discovery tells you which attribute keys are worth
|
|
40
|
+
grouping or filtering on, and the range query answers the actual question —
|
|
41
|
+
a window, a bucket width (`step_ms`), a reducer (`avg`, `min`, `max`, `sum`,
|
|
42
|
+
`count`, `last`, `p50`, `p90`, `p95`, `p99`), optional `group_by` keys, and
|
|
43
|
+
optional `attr` / `attr_prefix` matchers written `key=value`. One bucket
|
|
44
|
+
spanning the whole window collapses the answer to a single number.
|
|
45
|
+
|
|
37
46
|
**Workflow graph** — `list_workflow_runs`, `get_workflow_graph`,
|
|
38
47
|
`display_workflow_graph`, `inspect_workflow_events`, `control_workflow_run`.
|
|
39
48
|
|
|
@@ -60,9 +69,12 @@ resumes a run. It is approval-gated and, on the hosted server, requires the
|
|
|
60
69
|
|
|
61
70
|
The `display_*` tools return MCP Apps UI resources as single-file viewers.
|
|
62
71
|
|
|
63
|
-
Every inbound `tools/call`
|
|
64
|
-
|
|
65
|
-
atomically to
|
|
72
|
+
Every inbound `tools/call` on a local server — `--stdio`, or HTTP without
|
|
73
|
+
`MCP_PUBLIC_URL` — is recorded natively: validated result, lifecycle, duration,
|
|
74
|
+
redacted JSON-RPC timeline, and trace/span correlation, persisted atomically to
|
|
75
|
+
`~/.qyl/mcp-native-executions.json`. A public deployment (`MCP_PUBLIC_URL` set)
|
|
76
|
+
records nothing to disk; that evidence file is a local developer artifact, not a
|
|
77
|
+
multi-tenant audit log.
|
|
66
78
|
|
|
67
79
|
## Configuration
|
|
68
80
|
|
|
@@ -81,7 +93,27 @@ atomically to `~/.qyl/mcp-native-executions.json`.
|
|
|
81
93
|
Secrets are redacted before results reach the model, structured content, or
|
|
82
94
|
durable evidence.
|
|
83
95
|
|
|
84
|
-
|
|
96
|
+
`--stdio` runs under Node.js 24 or Bun 1.3, which is what `npx` gives you.
|
|
97
|
+
The HTTP entry is a web-standard fetch handler served by its default export,
|
|
98
|
+
so serving it requires Bun.
|
|
99
|
+
|
|
100
|
+
## Release notes
|
|
101
|
+
|
|
102
|
+
### 3.0.0
|
|
103
|
+
|
|
104
|
+
- Metrics reading: `list_metrics`, `get_metric_series`, and `query_metric` over
|
|
105
|
+
the collector's metrics API. Each carries the read-only safety annotations.
|
|
106
|
+
- Contract major: `@ancplua/qyl-api-schema` 8.0.0, revision
|
|
107
|
+
`sha256:64c464569005a485`. The startup handshake refuses a collector that
|
|
108
|
+
advertises anything else, so this server and the collector move together.
|
|
109
|
+
|
|
110
|
+
### 2.1.0
|
|
111
|
+
|
|
112
|
+
- `tools/list` shrank 44.6%: shared models in the output schemas are emitted as
|
|
113
|
+
`$defs`/`$ref` where that is smaller, and the two app-only tools
|
|
114
|
+
(`fetch_telemetry`, `fetch_workflow_graph_updates`) no longer publish an
|
|
115
|
+
output schema at all.
|
|
116
|
+
- Native execution evidence is written only by a local server; see above.
|
|
85
117
|
|
|
86
118
|
Full documentation, the workbench, and self-hosting:
|
|
87
119
|
[github.com/ANcpLua/qyl.mcp](https://github.com/ANcpLua/qyl.mcp)
|
package/dist/ci.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CiLogInputSchema, CiLogOutputSchema, } from "./contract-validation.js";
|
|
1
|
+
import { CiLogInputSchema, CiLogOutputSchema, compactOutputSchema, } from "./contract-validation.js";
|
|
2
2
|
import { fetchSessions, fetchSessionTraces } from "./data.js";
|
|
3
3
|
import { telemetryToolResult } from "./telemetry-redaction.js";
|
|
4
4
|
import { READ_ONLY_TELEMETRY_TOOL_ANNOTATIONS, toolError } from "./tools.js";
|
|
@@ -75,7 +75,7 @@ export function registerCiTools(server) {
|
|
|
75
75
|
`'${CI_SERVICE_PREFIX}'). With run_id: per-leg phase breakdown, failures first, ` +
|
|
76
76
|
"so 'which leg hung on what' is answerable even when GitHub's log API is down.",
|
|
77
77
|
inputSchema: CiLogInputSchema,
|
|
78
|
-
outputSchema: CiLogOutputSchema,
|
|
78
|
+
outputSchema: compactOutputSchema(CiLogOutputSchema),
|
|
79
79
|
annotations: READ_ONLY_TELEMETRY_TOOL_ANNOTATIONS,
|
|
80
80
|
}, async (args) => {
|
|
81
81
|
try {
|
package/dist/ci.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ci.js","sourceRoot":"","sources":["../src/ci.ts"],"names":[],"mappings":"AAmBA,OAAO,EACL,gBAAgB,EAChB,iBAAiB,
|
|
1
|
+
{"version":3,"file":"ci.js","sourceRoot":"","sources":["../src/ci.ts"],"names":[],"mappings":"AAmBA,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,oCAAoC,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAG7E,uEAAuE;AACvE,MAAM,CAAC,MAAM,iBAAiB,GAAG,QAAQ,CAAC;AAE1C,uEAAuE;AACvE,MAAM,UAAU,gBAAgB,CAAC,QAAsB;IACrD,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CACjC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAC1E,CAAC;AACJ,CAAC;AAED,SAAS,OAAO,CAAC,IAAa;IAC5B,MAAM,SAAS,GAAG,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,KAAK,QAAQ,CAAC,CAAC;IAC3E,OAAO,OAAO,SAAS,EAAE,KAAK,KAAK,QAAQ;QACzC,CAAC,CAAC,SAAS,CAAC,KAAK;QACjB,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,YAAY,CA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AC,WAAW,EAAE,CAAC;gBAClF,WAAW,EAAE,OAAO,CAAC,WAAW;gBAChC,QAAQ,EAAE,OAAO,CAAC,QAAQ;aAC3B,CAAC,CAAC,CAAC;YACN,MAAM,MAAM,GAAgB,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;YAC3C,OAAO,mBAAmB,CAAC,eAAe,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC;QAClE,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC;QACxB,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
package/dist/collector.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* connection, HTTP, JSON, and contract failures surface to the caller rather
|
|
6
6
|
* than silently substituting generated telemetry or invented defaults.
|
|
7
7
|
*/
|
|
8
|
-
import type { LogRecord, SessionEntity, Trace } from "@ancplua/qyl-api-schema/types";
|
|
8
|
+
import type { LogRecord, MetricDescriptor, MetricQueryResult, MetricSeries, SessionEntity, Trace } from "@ancplua/qyl-api-schema/types";
|
|
9
9
|
import { z } from "zod";
|
|
10
10
|
import type { Mode } from "./wire.js";
|
|
11
11
|
/** Error with a message already suitable for showing to the model/user. */
|
|
@@ -18,6 +18,17 @@ export declare class CollectorError extends Error {
|
|
|
18
18
|
export declare function parseCollectorTrace(value: unknown, context?: string): Trace;
|
|
19
19
|
/** Normalize RFC 3339 spelling, then enforce the public Session schema exactly. */
|
|
20
20
|
export declare function parseCollectorSession(value: unknown, context?: string): SessionEntity;
|
|
21
|
+
/** Normalize RFC 3339 spelling, then enforce the public MetricDescriptor schema. */
|
|
22
|
+
export declare function parseCollectorMetricDescriptor(value: unknown, context?: string): MetricDescriptor;
|
|
23
|
+
/** Normalize RFC 3339 spelling, then enforce the public MetricSeries schema. */
|
|
24
|
+
export declare function parseCollectorMetricSeries(value: unknown, context?: string): MetricSeries;
|
|
25
|
+
/**
|
|
26
|
+
* Normalize every timestamp a range query answers with, then enforce the
|
|
27
|
+
* operation's own 200 body. Bucket starts are normalized too: a chart axis
|
|
28
|
+
* built from `+02:00` labels next to `Z` labels is a rendering bug the reader
|
|
29
|
+
* would have to diagnose.
|
|
30
|
+
*/
|
|
31
|
+
export declare function parseCollectorMetricQueryResult(value: unknown, context?: string): MetricQueryResult;
|
|
21
32
|
/** Enforce the public LogRecord schema without alternate wire encodings. */
|
|
22
33
|
export declare function parseCollectorLog(value: unknown, context?: string): LogRecord;
|
|
23
34
|
interface ParsedCollectorPage<T> {
|
|
@@ -37,7 +48,9 @@ export declare function parseCollectorPage<T, TPage extends {
|
|
|
37
48
|
items: T[];
|
|
38
49
|
has_more: boolean;
|
|
39
50
|
}>(value: unknown, context: string, pageSchema: z.ZodType<TPage>, parseItem: (item: unknown, context: string) => T): ParsedCollectorPage<T>;
|
|
40
|
-
|
|
51
|
+
/** Query values a published operation parameter can carry, repeatable included. */
|
|
52
|
+
export type CollectorQueryParams = Record<string, string | number | boolean | readonly string[] | undefined>;
|
|
53
|
+
export declare function collectorGet(pathname: string, params?: CollectorQueryParams, options?: CollectorRequestOptions): Promise<unknown>;
|
|
41
54
|
export declare function collectorPost(pathname: string, body: unknown, options?: CollectorRequestOptions): Promise<unknown>;
|
|
42
55
|
export declare function resolveMode(): Promise<Mode>;
|
|
43
56
|
export {};
|
package/dist/collector.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { z } from "zod";
|
|
9
9
|
import { collectorHeaders, collectorUrl } from "./config.js";
|
|
10
|
-
import { LogRecordSchema, ProblemDetailsSchema, SessionSchema, TraceSchema, } from "./contract-validation.js";
|
|
10
|
+
import { LogRecordSchema, MetricDescriptorSchema, MetricQueryResultSchema, MetricSeriesSchema, ProblemDetailsSchema, SessionSchema, TraceSchema, } from "./contract-validation.js";
|
|
11
11
|
/** Error with a message already suitable for showing to the model/user. */
|
|
12
12
|
export class CollectorError extends Error {
|
|
13
13
|
connectionError;
|
|
@@ -29,9 +29,13 @@ function contractMismatch(context, error) {
|
|
|
29
29
|
return new CollectorError(`collector contract mismatch for ${context}: ${z.prettifyError(error)}`);
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
32
|
+
* Not a validation workaround: the generated contract validator accepts every
|
|
33
|
+
* RFC 3339 spelling, offsets included. This normalizes so that live timestamps
|
|
34
|
+
* read exactly like demo ones, which demo.ts builds with `Date#toISOString`,
|
|
35
|
+
* because consumers use the string as the value -- summaries.ts renders it and
|
|
36
|
+
* ci.ts reports it, where a `+02:00` trace must not print unlike a `Z` trace.
|
|
37
|
+
* Validating before converting keeps a malformed timestamp a contract mismatch
|
|
38
|
+
* instead of a `RangeError`; the canonical form costs sub-millisecond digits.
|
|
35
39
|
*/
|
|
36
40
|
const rfc3339 = z.iso.datetime({ offset: true });
|
|
37
41
|
function canonicalDateTime(value, context) {
|
|
@@ -68,6 +72,61 @@ export function parseCollectorSession(value, context = "session") {
|
|
|
68
72
|
throw contractMismatch(context, parsed.error);
|
|
69
73
|
return parsed.data;
|
|
70
74
|
}
|
|
75
|
+
/** Normalize RFC 3339 spelling, then enforce the public MetricDescriptor schema. */
|
|
76
|
+
export function parseCollectorMetricDescriptor(value, context = "metric") {
|
|
77
|
+
const descriptor = asRecord(value, context);
|
|
78
|
+
const parsed = MetricDescriptorSchema.safeParse({
|
|
79
|
+
...descriptor,
|
|
80
|
+
last_seen: canonicalDateTime(descriptor.last_seen, `${context}.last_seen`),
|
|
81
|
+
});
|
|
82
|
+
if (!parsed.success)
|
|
83
|
+
throw contractMismatch(context, parsed.error);
|
|
84
|
+
return parsed.data;
|
|
85
|
+
}
|
|
86
|
+
/** Normalize RFC 3339 spelling, then enforce the public MetricSeries schema. */
|
|
87
|
+
export function parseCollectorMetricSeries(value, context = "series") {
|
|
88
|
+
const series = asRecord(value, context);
|
|
89
|
+
const parsed = MetricSeriesSchema.safeParse({
|
|
90
|
+
...series,
|
|
91
|
+
first_seen: canonicalDateTime(series.first_seen, `${context}.first_seen`),
|
|
92
|
+
last_seen: canonicalDateTime(series.last_seen, `${context}.last_seen`),
|
|
93
|
+
});
|
|
94
|
+
if (!parsed.success)
|
|
95
|
+
throw contractMismatch(context, parsed.error);
|
|
96
|
+
return parsed.data;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Normalize every timestamp a range query answers with, then enforce the
|
|
100
|
+
* operation's own 200 body. Bucket starts are normalized too: a chart axis
|
|
101
|
+
* built from `+02:00` labels next to `Z` labels is a rendering bug the reader
|
|
102
|
+
* would have to diagnose.
|
|
103
|
+
*/
|
|
104
|
+
export function parseCollectorMetricQueryResult(value, context = "metric query") {
|
|
105
|
+
const result = asRecord(value, context);
|
|
106
|
+
const series = Array.isArray(result.series) ? result.series : [];
|
|
107
|
+
const parsed = MetricQueryResultSchema.safeParse({
|
|
108
|
+
...result,
|
|
109
|
+
start_time: canonicalDateTime(result.start_time, `${context}.start_time`),
|
|
110
|
+
end_time: canonicalDateTime(result.end_time, `${context}.end_time`),
|
|
111
|
+
series: series.map((stream, streamIndex) => {
|
|
112
|
+
const entry = asRecord(stream, `${context}.series[${streamIndex}]`);
|
|
113
|
+
const buckets = Array.isArray(entry.buckets) ? entry.buckets : [];
|
|
114
|
+
return {
|
|
115
|
+
...entry,
|
|
116
|
+
buckets: buckets.map((bucket, bucketIndex) => {
|
|
117
|
+
const point = asRecord(bucket, `${context}.series[${streamIndex}].buckets[${bucketIndex}]`);
|
|
118
|
+
return {
|
|
119
|
+
...point,
|
|
120
|
+
bucket_start: canonicalDateTime(point.bucket_start, `${context}.series[${streamIndex}].buckets[${bucketIndex}].bucket_start`),
|
|
121
|
+
};
|
|
122
|
+
}),
|
|
123
|
+
};
|
|
124
|
+
}),
|
|
125
|
+
});
|
|
126
|
+
if (!parsed.success)
|
|
127
|
+
throw contractMismatch(context, parsed.error);
|
|
128
|
+
return parsed.data;
|
|
129
|
+
}
|
|
71
130
|
/** Enforce the public LogRecord schema without alternate wire encodings. */
|
|
72
131
|
export function parseCollectorLog(value, context = "log") {
|
|
73
132
|
const parsed = LogRecordSchema.safeParse(asRecord(value, context));
|
|
@@ -126,8 +185,17 @@ function parseProblemDetails(value) {
|
|
|
126
185
|
async function collectorRequest(pathname, method, params, body, options) {
|
|
127
186
|
const url = new URL(pathname, collectorUrl());
|
|
128
187
|
for (const [key, value] of Object.entries(params)) {
|
|
129
|
-
if (value
|
|
130
|
-
|
|
188
|
+
if (value === undefined)
|
|
189
|
+
continue;
|
|
190
|
+
// A repeatable parameter is repeated, not joined: the metrics operations
|
|
191
|
+
// publish `group_by`, `attr`, and `attr_prefix` as arrays with no
|
|
192
|
+
// collection format, which is one `key=` pair per value.
|
|
193
|
+
if (Array.isArray(value)) {
|
|
194
|
+
for (const item of value)
|
|
195
|
+
url.searchParams.append(key, String(item));
|
|
196
|
+
continue;
|
|
197
|
+
}
|
|
198
|
+
url.searchParams.set(key, String(value));
|
|
131
199
|
}
|
|
132
200
|
const timeout = AbortSignal.timeout(options.timeoutMs ?? 10_000);
|
|
133
201
|
const signal = options.signal
|
package/dist/collector.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collector.js","sourceRoot":"","sources":["../src/collector.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"collector.js","sourceRoot":"","sources":["../src/collector.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAWH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EACL,eAAe,EACf,sBAAsB,EACtB,uBAAuB,EACvB,kBAAkB,EAClB,oBAAoB,EACpB,aAAa,EACb,WAAW,GACZ,MAAM,0BAA0B,CAAC;AAGlC,2EAA2E;AAC3E,MAAM,OAAO,cAAe,SAAQ,KA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AAa,EACb,OAAO,GAA4B,EAAE;IAErC,OAAO,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;AAC/D,CAAC;AAED,MAAM,UAAU,WAAW;IACzB,OAAO,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;AACzE,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool INPUT shapes derived from the published operation parameters.
|
|
3
|
+
*
|
|
4
|
+
* contract-validation.ts binds every response body and every `Mcp.Tools.*`
|
|
5
|
+
* shape the contract publishes. The metrics read API arrived in
|
|
6
|
+
* @ancplua/qyl-api-schema 8.0.0 with its response bodies but without
|
|
7
|
+
* `Mcp.Tools.*Metric*` input shapes, so there is nothing there to bind for the
|
|
8
|
+
* arguments of `list_metrics`, `get_metric_series`, and `query_metric`.
|
|
9
|
+
*
|
|
10
|
+
* Hand-writing those three objects is exactly what architecture gate G10a
|
|
11
|
+
* exists to prevent, and an exemption would carve the hole in the one place the
|
|
12
|
+
* gate names first ("request, response, or tool-input shapes"). So the inputs
|
|
13
|
+
* are generated too — from the other artifact the contract package publishes,
|
|
14
|
+
* its OpenAPI document. Every name, type, bound, default, enum, and description
|
|
15
|
+
* a metrics tool advertises is read out of `@ancplua/qyl-api-schema/openapi` at
|
|
16
|
+
* startup; nothing here is typed by hand except which operation a tool wraps,
|
|
17
|
+
* which is the same standing as `Operations.TracesApi_list.Response.200` being
|
|
18
|
+
* named in contract-validation.ts. A parameter added, retyped, or re-bounded on
|
|
19
|
+
* the collector side therefore moves the tool's advertised input and fails the
|
|
20
|
+
* G10b manifest snapshot, instead of drifting silently.
|
|
21
|
+
*
|
|
22
|
+
* This module is deliberately NOT re-exported through contract-validation.ts:
|
|
23
|
+
* the OpenAPI document is ~730 KB and that module is also imported by the
|
|
24
|
+
* dashboard and workbench browser bundles.
|
|
25
|
+
*
|
|
26
|
+
* When the contract publishes `Mcp.Tools.ListMetricsInput` and friends, delete
|
|
27
|
+
* this file and bind them in contract-validation.ts like every other tool.
|
|
28
|
+
*/
|
|
29
|
+
import { z } from "zod";
|
|
30
|
+
/**
|
|
31
|
+
* The tool-input schema for one published GET operation.
|
|
32
|
+
*
|
|
33
|
+
* Header parameters are excluded: `ProjectScopeHeader` is the server-owned
|
|
34
|
+
* collector project scope, which QYL_PROJECT sets and a model never supplies —
|
|
35
|
+
* the same boundary the root README states for every other tool.
|
|
36
|
+
*/
|
|
37
|
+
export declare function operationInputSchema<TInput>(pathname: string): z.ZodType<TInput>;
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool INPUT shapes derived from the published operation parameters.
|
|
3
|
+
*
|
|
4
|
+
* contract-validation.ts binds every response body and every `Mcp.Tools.*`
|
|
5
|
+
* shape the contract publishes. The metrics read API arrived in
|
|
6
|
+
* @ancplua/qyl-api-schema 8.0.0 with its response bodies but without
|
|
7
|
+
* `Mcp.Tools.*Metric*` input shapes, so there is nothing there to bind for the
|
|
8
|
+
* arguments of `list_metrics`, `get_metric_series`, and `query_metric`.
|
|
9
|
+
*
|
|
10
|
+
* Hand-writing those three objects is exactly what architecture gate G10a
|
|
11
|
+
* exists to prevent, and an exemption would carve the hole in the one place the
|
|
12
|
+
* gate names first ("request, response, or tool-input shapes"). So the inputs
|
|
13
|
+
* are generated too — from the other artifact the contract package publishes,
|
|
14
|
+
* its OpenAPI document. Every name, type, bound, default, enum, and description
|
|
15
|
+
* a metrics tool advertises is read out of `@ancplua/qyl-api-schema/openapi` at
|
|
16
|
+
* startup; nothing here is typed by hand except which operation a tool wraps,
|
|
17
|
+
* which is the same standing as `Operations.TracesApi_list.Response.200` being
|
|
18
|
+
* named in contract-validation.ts. A parameter added, retyped, or re-bounded on
|
|
19
|
+
* the collector side therefore moves the tool's advertised input and fails the
|
|
20
|
+
* G10b manifest snapshot, instead of drifting silently.
|
|
21
|
+
*
|
|
22
|
+
* This module is deliberately NOT re-exported through contract-validation.ts:
|
|
23
|
+
* the OpenAPI document is ~730 KB and that module is also imported by the
|
|
24
|
+
* dashboard and workbench browser bundles.
|
|
25
|
+
*
|
|
26
|
+
* When the contract publishes `Mcp.Tools.ListMetricsInput` and friends, delete
|
|
27
|
+
* this file and bind them in contract-validation.ts like every other tool.
|
|
28
|
+
*/
|
|
29
|
+
import { createRequire } from "node:module";
|
|
30
|
+
import { z } from "zod";
|
|
31
|
+
const COMPONENT_SCHEMA_PREFIX = "#/components/schemas/";
|
|
32
|
+
// require() rather than an import attribute: the package's "./openapi" export
|
|
33
|
+
// declares no "types" condition, so a static JSON import has no type to resolve
|
|
34
|
+
// and `verbatimModuleSyntax` would have to be worked around at every call site.
|
|
35
|
+
const publishedOpenApi = createRequire(import.meta.url)("@ancplua/qyl-api-schema/openapi");
|
|
36
|
+
/**
|
|
37
|
+
* Rewrite a published parameter schema into the subset `z.fromJSONSchema`
|
|
38
|
+
* accepts, resolving component references as it goes.
|
|
39
|
+
*
|
|
40
|
+
* Two published constructs need it, for the same reasons the contract package's
|
|
41
|
+
* own zod adapter documents: `unevaluatedProperties` is rejected outright by
|
|
42
|
+
* `z.fromJSONSchema` and is only ever used to seal an object, and a
|
|
43
|
+
* `#/components/schemas/...` reference has no meaning once the parameter is
|
|
44
|
+
* lifted out of the OpenAPI document. Resolution is by inlining, which is exact
|
|
45
|
+
* for the enums and scalars parameters actually use and would need a `$defs`
|
|
46
|
+
* carrier if a parameter ever referenced a recursive model.
|
|
47
|
+
*/
|
|
48
|
+
function resolvePublishedSchema(node, seen = []) {
|
|
49
|
+
if (Array.isArray(node))
|
|
50
|
+
return node.map((item) => resolvePublishedSchema(item, seen));
|
|
51
|
+
if (typeof node !== "object" || node === null)
|
|
52
|
+
return node;
|
|
53
|
+
const source = node;
|
|
54
|
+
const resolved = {};
|
|
55
|
+
for (const [key, value] of Object.entries(source)) {
|
|
56
|
+
if (key === "unevaluatedProperties" || key === "$ref")
|
|
57
|
+
continue;
|
|
58
|
+
resolved[key] = resolvePublishedSchema(value, seen);
|
|
59
|
+
}
|
|
60
|
+
const reference = source.$ref;
|
|
61
|
+
if (typeof reference !== "string")
|
|
62
|
+
return resolved;
|
|
63
|
+
if (!reference.startsWith(COMPONENT_SCHEMA_PREFIX)) {
|
|
64
|
+
throw new Error(`contract-operations: unsupported parameter reference ${reference}`);
|
|
65
|
+
}
|
|
66
|
+
const name = reference.slice(COMPONENT_SCHEMA_PREFIX.length);
|
|
67
|
+
if (seen.includes(name)) {
|
|
68
|
+
throw new Error(`contract-operations: ${name} is recursive; a parameter referencing it needs a ` +
|
|
69
|
+
"$defs carrier rather than inlining");
|
|
70
|
+
}
|
|
71
|
+
const target = publishedOpenApi.components.schemas[name];
|
|
72
|
+
if (target === undefined) {
|
|
73
|
+
throw new Error(`contract-operations: ${reference} is not a published component schema`);
|
|
74
|
+
}
|
|
75
|
+
// A `$ref` with siblings is how the contract spells "this published model,
|
|
76
|
+
// with this default" — `aggregation` is `MetricAggregation` plus
|
|
77
|
+
// `default: "avg"`. Dropping the siblings would silently drop the default and
|
|
78
|
+
// leave the tool advertising a required-looking enum with no fallback, so the
|
|
79
|
+
// resolved target is merged UNDER them: the local keywords win.
|
|
80
|
+
return { ...resolvePublishedSchema(target, [...seen, name]), ...resolved };
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* The tool-input schema for one published GET operation.
|
|
84
|
+
*
|
|
85
|
+
* Header parameters are excluded: `ProjectScopeHeader` is the server-owned
|
|
86
|
+
* collector project scope, which QYL_PROJECT sets and a model never supplies —
|
|
87
|
+
* the same boundary the root README states for every other tool.
|
|
88
|
+
*/
|
|
89
|
+
export function operationInputSchema(pathname) {
|
|
90
|
+
const operation = publishedOpenApi.paths[pathname]?.get;
|
|
91
|
+
if (operation === undefined) {
|
|
92
|
+
throw new Error(`contract-operations: the contract publishes no GET ${pathname}`);
|
|
93
|
+
}
|
|
94
|
+
const properties = {};
|
|
95
|
+
const required = [];
|
|
96
|
+
for (const parameter of operation.parameters ?? []) {
|
|
97
|
+
// A $ref parameter is a shared component; the only one the metrics
|
|
98
|
+
// operations use is the project-scope header.
|
|
99
|
+
if (parameter.$ref !== undefined || parameter.name === undefined)
|
|
100
|
+
continue;
|
|
101
|
+
if (parameter.in === "header")
|
|
102
|
+
continue;
|
|
103
|
+
const schema = resolvePublishedSchema(parameter.schema);
|
|
104
|
+
properties[parameter.name] = parameter.description === undefined
|
|
105
|
+
? schema
|
|
106
|
+
: { ...schema, description: parameter.description };
|
|
107
|
+
if (parameter.required === true)
|
|
108
|
+
required.push(parameter.name);
|
|
109
|
+
}
|
|
110
|
+
if (Object.keys(properties).length === 0) {
|
|
111
|
+
throw new Error(`contract-operations: GET ${pathname} publishes no model-supplied parameters`);
|
|
112
|
+
}
|
|
113
|
+
// The assembled document is JSON Schema by construction — every property came
|
|
114
|
+
// out of the published parameter list — but it is built as plain data, so the
|
|
115
|
+
// cast is what tells the compiler that.
|
|
116
|
+
const assembled = {
|
|
117
|
+
type: "object",
|
|
118
|
+
properties,
|
|
119
|
+
...(required.length === 0 ? {} : { required }),
|
|
120
|
+
additionalProperties: false,
|
|
121
|
+
};
|
|
122
|
+
return z.fromJSONSchema(assembled);
|
|
123
|
+
}
|
|
124
|
+
//# sourceMappingURL=contract-operations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contract-operations.js","sourceRoot":"","sources":["../src/contract-operations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,uBAAuB,GAAG,uBAAuB,CAAC;AAgBxD,8EAA8E;AAC9E,gFAAgF;AAChF,gFAAgF;AAChF,MAAM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,SAAS,CAAC,WAAW,EAAE,CAAC;QACnF,IAAI,SAAS,CAAC,QAAQ,KAAK,IAAI;YAAE,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IACjE,CAAC;IAED,IAAI,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzC,MAAM,IAAI,KAAK,CAAC,4BAA4B,QAAQ,yCAAyC,CAAC,CAAC;IACjG,CAAC;IAED,8EAA8E;IAC9E,8EAA8E;IAC9E,wCAAwC;IACxC,MAAM,SAAS,GAAG;QAChB,IAAI,EAAE,QAAQ;QACd,UAAU;QACV,GAAG,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC;QAC9C,oBAAoB,EAAE,KAAK;KACc,CAAC;IAE5C,OAAO,CAAC,CAAC,cAAc,CAAC,SAAS,CAAsB,CAAC;AAC1D,CAAC"}
|
|
@@ -1,22 +1,33 @@
|
|
|
1
1
|
import type * as QylContracts from "@ancplua/qyl-api-schema/types";
|
|
2
|
+
import { publishedContractSchema, type ContractInput } from "@ancplua/qyl-api-schema/zod";
|
|
3
|
+
import type { StandardSchemaWithJSON } from "@modelcontextprotocol/server";
|
|
2
4
|
import { z } from "zod";
|
|
5
|
+
export { publishedContractSchema, type ContractInput };
|
|
3
6
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* is what `parse` produces rather than what a caller can construct.
|
|
7
|
+
* Emits a tool's output JSON Schema with repeated subschemas hoisted into
|
|
8
|
+
* `$defs`, when that spelling is actually smaller than the inlined one.
|
|
7
9
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
10
|
+
* The contract's telemetry models nest: a Trace carries Spans, a Span carries
|
|
11
|
+
* attribute values, and the same leaf shapes recur dozens of times inside one
|
|
12
|
+
* response body. The SDK asks a schema for its JSON Schema through
|
|
13
|
+
* `~standard.jsonSchema`, and zod's default there inlines every occurrence, so
|
|
14
|
+
* `tools/list` shipped the Span tree once per mention — 232 KB for the fourteen
|
|
15
|
+
* tools that existed when this was written, most of it the same object repeated. Every byte of that is context an
|
|
16
|
+
* agent pays for on connect.
|
|
17
|
+
*
|
|
18
|
+
* The choice is per schema and measured, not assumed: `reused: "ref"` hoists
|
|
19
|
+
* anything seen twice, which is a loss on a flat shape whose repeats are single
|
|
20
|
+
* keywords ("#/$defs/__schema12" costs more than {"type":"string"}). Taking the
|
|
21
|
+
* smaller of the two keeps the win where the nesting is real and changes
|
|
22
|
+
* nothing where it is not, so no tool pays for the mechanism.
|
|
23
|
+
*
|
|
24
|
+
* Validation is unchanged — `validate` still runs the generated zod schema, so
|
|
25
|
+
* structured content is checked against the contract exactly as before. Only
|
|
26
|
+
* the advertised spelling of the same schema differs, and the conversion is
|
|
27
|
+
* deferred and memoised so importing this module in a browser bundle
|
|
28
|
+
* (dashboard, workbench) costs nothing.
|
|
12
29
|
*/
|
|
13
|
-
export
|
|
14
|
-
readonly __brand: string;
|
|
15
|
-
} ? string : TContract extends readonly (infer TElement)[] ? readonly ContractInput<TElement>[] : TContract extends (...args: never[]) => unknown ? TContract : TContract extends object ? {
|
|
16
|
-
readonly [K in keyof TContract]: ContractInput<TContract[K]>;
|
|
17
|
-
} : TContract;
|
|
18
|
-
/** Build a strict runtime validator from the published TypeSpec-owned JSON Schema. */
|
|
19
|
-
export declare function publishedContractSchema<TContract>(definitionName: string): z.ZodType<TContract>;
|
|
30
|
+
export declare function compactOutputSchema<T>(schema: z.ZodType<T>): StandardSchemaWithJSON<T, T>;
|
|
20
31
|
export declare const SpanSchema: z.ZodType<QylContracts.Span, unknown, z.core.$ZodTypeInternals<QylContracts.Span, unknown>>;
|
|
21
32
|
export declare const TraceSummarySchema: z.ZodType<QylContracts.TraceSummary, unknown, z.core.$ZodTypeInternals<QylContracts.TraceSummary, unknown>>;
|
|
22
33
|
export declare const TraceSchema: z.ZodType<QylContracts.Trace, unknown, z.core.$ZodTypeInternals<QylContracts.Trace, unknown>>;
|
|
@@ -27,6 +38,11 @@ export declare const TraceSpansListResponseSchema: z.ZodType<QylContracts.Cursor
|
|
|
27
38
|
export declare const SessionTracesListResponseSchema: z.ZodType<QylContracts.CursorPageTrace, unknown, z.core.$ZodTypeInternals<QylContracts.CursorPageTrace, unknown>>;
|
|
28
39
|
export declare const LogsListResponseSchema: z.ZodType<QylContracts.CursorPageLogRecord, unknown, z.core.$ZodTypeInternals<QylContracts.CursorPageLogRecord, unknown>>;
|
|
29
40
|
export declare const SessionsListResponseSchema: z.ZodType<QylContracts.CursorPageSessionEntity, unknown, z.core.$ZodTypeInternals<QylContracts.CursorPageSessionEntity, unknown>>;
|
|
41
|
+
export declare const MetricDescriptorSchema: z.ZodType<QylContracts.MetricDescriptor, unknown, z.core.$ZodTypeInternals<QylContracts.MetricDescriptor, unknown>>;
|
|
42
|
+
export declare const MetricSeriesSchema: z.ZodType<QylContracts.MetricSeries, unknown, z.core.$ZodTypeInternals<QylContracts.MetricSeries, unknown>>;
|
|
43
|
+
export declare const MetricQueryResultSchema: z.ZodType<QylContracts.MetricQueryResult, unknown, z.core.$ZodTypeInternals<QylContracts.MetricQueryResult, unknown>>;
|
|
44
|
+
export declare const MetricsListResponseSchema: z.ZodType<QylContracts.CursorPageMetricDescriptor, unknown, z.core.$ZodTypeInternals<QylContracts.CursorPageMetricDescriptor, unknown>>;
|
|
45
|
+
export declare const MetricSeriesListResponseSchema: z.ZodType<QylContracts.CursorPageMetricSeries, unknown, z.core.$ZodTypeInternals<QylContracts.CursorPageMetricSeries, unknown>>;
|
|
30
46
|
export declare const ProblemDetailsSchema: z.ZodType<QylContracts.ProblemDetails, unknown, z.core.$ZodTypeInternals<QylContracts.ProblemDetails, unknown>>;
|
|
31
47
|
export declare const ModeSchema: z.ZodType<QylContracts.McpDataMode, unknown, z.core.$ZodTypeInternals<QylContracts.McpDataMode, unknown>>;
|
|
32
48
|
export declare const McpDashboardStatsSchema: z.ZodType<QylContracts.McpDashboardStats, unknown, z.core.$ZodTypeInternals<QylContracts.McpDashboardStats, unknown>>;
|