qyl-mcp-server 7.4.0 → 7.5.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 +42 -7
- package/dist/cloudflare-access.d.ts +3 -2
- package/dist/cloudflare-access.js +3 -2
- package/dist/cloudflare-access.js.map +1 -1
- package/dist/collector-resources.d.ts +45 -0
- package/dist/collector-resources.js +295 -0
- package/dist/collector-resources.js.map +1 -0
- package/dist/collector.d.ts +12 -0
- package/dist/collector.js +29 -0
- package/dist/collector.js.map +1 -1
- package/dist/contract-headers.d.ts +10 -0
- package/dist/contract-headers.js +10 -0
- package/dist/contract-headers.js.map +1 -1
- package/dist/mcp-app.html +1 -1
- package/dist/mcp-dashboard.html +1 -1
- package/dist/mcp-home.html +10 -3
- package/dist/oauth.d.ts +8 -1
- package/dist/oauth.js +16 -2
- package/dist/oauth.js.map +1 -1
- package/dist/request-scope.js +8 -0
- package/dist/request-scope.js.map +1 -1
- package/dist/server.d.ts +4 -0
- package/dist/server.js +13 -4
- package/dist/server.js.map +1 -1
- package/dist/tool-scopes.d.ts +42 -0
- package/dist/tool-scopes.js +97 -0
- package/dist/tool-scopes.js.map +1 -0
- package/dist/tools.js +18 -6
- package/dist/tools.js.map +1 -1
- package/dist/write-tools.d.ts +41 -0
- package/dist/write-tools.js +214 -0
- package/dist/write-tools.js.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -38,7 +38,10 @@ with PKCE S256, both `private_key_jwt` and `none` for ChatGPT CIMD compatibility
|
|
|
38
38
|
`none` for Claude CIMD, and issuer identification. Auth0 owns registration and token
|
|
39
39
|
issuance; this server validates resource-bound RFC 9068 access tokens on every
|
|
40
40
|
MCP request. It rejects malformed/query credentials, invalid tokens and
|
|
41
|
-
insufficient scopes with distinct 400/401/403 responses.
|
|
41
|
+
insufficient scopes with distinct 400/401/403 responses. Every request needs
|
|
42
|
+
`qyl:read`; a write tool called without `qyl:write` or `qyl:delete` gets a
|
|
43
|
+
`403` with `error="insufficient_scope"` naming the scopes to request, in both
|
|
44
|
+
protocol eras, before the handler runs.
|
|
42
45
|
|
|
43
46
|
Optional resource-server integrations are selected explicitly:
|
|
44
47
|
|
|
@@ -97,12 +100,29 @@ with `cursor` like the telemetry lists.
|
|
|
97
100
|
model. Its input is one of four shapes selected by `view` (`traces`, `trace`,
|
|
98
101
|
`logs`, `mcp_stats`); the `trace` view requires `trace_id` at the schema layer.
|
|
99
102
|
|
|
103
|
+
**Writes** — `create_annotation`, `update_annotation`, `create_saved_query`,
|
|
104
|
+
`update_saved_query` and `delete` change only objects users create in qyl, in
|
|
105
|
+
the caller's Collector project: annotations (plain-text notes of at most 2000
|
|
106
|
+
characters on a trace, span or session) and saved queries (named filters for
|
|
107
|
+
traces, logs or metrics). `delete` takes `kind` (`annotation` or
|
|
108
|
+
`saved_query`; alert rules follow with Contract 11.7.0), `id` and `etag`. No
|
|
109
|
+
tool deletes or edits traces, logs or metrics; retention removes telemetry.
|
|
110
|
+
Updates and deletes send the `etag` as `If-Match`: a stale one fails with
|
|
111
|
+
`precondition_failed`, a duplicate saved-query name with `conflict`.
|
|
112
|
+
`list_saved_queries` and `run_saved_query` read saved queries; `get_trace` and
|
|
113
|
+
`list_sessions` return the annotations on what they read. Demo mode keeps none
|
|
114
|
+
of these objects and refuses these tools.
|
|
115
|
+
|
|
100
116
|
**Failures** — every failed call returns `isError: true`, the message as text,
|
|
101
117
|
and `structuredContent.error = { code, message, retryable }` with the
|
|
102
118
|
contract's `ToolErrorCode`.
|
|
103
119
|
|
|
104
|
-
|
|
105
|
-
|
|
120
|
+
The thirteen read tools carry `readOnlyHint: true` and only query the
|
|
121
|
+
configured collector. The create tools carry `destructiveHint: false` and
|
|
122
|
+
`idempotentHint: false`; the update tools and `delete` carry
|
|
123
|
+
`destructiveHint: true` and `idempotentHint: true`. On the hosted server
|
|
124
|
+
`qyl:read` covers the read tools, `qyl:write` adds the create and update tools,
|
|
125
|
+
and `qyl:delete` adds `delete`.
|
|
106
126
|
|
|
107
127
|
The `display_*` tools return MCP Apps UI resources as single-file viewers.
|
|
108
128
|
|
|
@@ -134,7 +154,7 @@ multi-tenant audit log.
|
|
|
134
154
|
| Variable | Meaning |
|
|
135
155
|
| --- | --- |
|
|
136
156
|
| `QYL_COLLECTOR_URL` | Collector read API base; default `http://127.0.0.1:5100`. Also the OTLP base when set. |
|
|
137
|
-
| `QYL_API_KEY` | Collector
|
|
157
|
+
| `QYL_API_KEY` | Collector credential for reads and OTLP; the write tools need the Collector's `write` and `delete` roles on it. Outgoing only. |
|
|
138
158
|
| `QYL_PROJECT` | Server-owned collector project scope. Unset, the server sends no project-scope header, so the Collector's default project applies; the Events subscription source key records that as `default`. Never accepted as tool input. This is the only place that states the default; other documents link here. |
|
|
139
159
|
| `MCP_COLLECTOR_PROJECTS` | Optional secret JSON mapping validated Auth0 subjects to project-bound Collector keys; see account isolation below. |
|
|
140
160
|
| `QYL_OTLP_ENDPOINT` | Optional OTLP base for self-telemetry. |
|
|
@@ -182,15 +202,30 @@ assignment revokes its Events subscription on the next access check. Project
|
|
|
182
202
|
keys are redacted from text and structured results, including keys nested in
|
|
183
203
|
this JSON configuration. Keep the map in host secrets and out of the plugin ZIP.
|
|
184
204
|
|
|
185
|
-
`bun run smoke:projects` from the repository root checks
|
|
186
|
-
viewer query paths, both protocol eras and Events against a
|
|
187
|
-
Collector with two temporary projects. Set `QYL_COLLECTOR_PROJECT` to its
|
|
205
|
+
`bun run smoke:projects` from the repository root checks every tool, the
|
|
206
|
+
writes included, viewer query paths, both protocol eras and Events against a
|
|
207
|
+
real local Collector with two temporary projects. Set `QYL_COLLECTOR_PROJECT` to its
|
|
188
208
|
`.csproj` when using a different checkout. The script uses local test identities
|
|
189
209
|
and an in-process signed webhook receiver; the hosted reviewer OAuth login and
|
|
190
210
|
real ChatGPT demonstration are separate checks before upload.
|
|
191
211
|
|
|
192
212
|
## Release notes
|
|
193
213
|
|
|
214
|
+
### 7.5.0
|
|
215
|
+
|
|
216
|
+
- Write tools, each a separate tool so a host can approve it on its own:
|
|
217
|
+
`create_annotation` and `update_annotation` (notes on a trace, span or
|
|
218
|
+
session), `create_saved_query` and `update_saved_query` (named filters), and
|
|
219
|
+
one `delete` for either kind. They change only those objects, in the
|
|
220
|
+
caller's Collector project; no tool deletes or edits telemetry.
|
|
221
|
+
`list_saved_queries` and `run_saved_query` read saved queries, and
|
|
222
|
+
`get_trace` and `list_sessions` return annotations.
|
|
223
|
+
- Scopes: `qyl:write` for create and update, `qyl:delete` for `delete`;
|
|
224
|
+
`qyl:read` alone keeps the read tools. The protected-resource metadata lists
|
|
225
|
+
all three, and a call without the scope it needs gets a `403`
|
|
226
|
+
`insufficient_scope` challenge. The Collector key needs the `write` and
|
|
227
|
+
`delete` roles.
|
|
228
|
+
|
|
194
229
|
### 7.4.0
|
|
195
230
|
|
|
196
231
|
- Contract package `@ancplua/qyl-api-schema` 11.6.0 (revision
|
|
@@ -7,8 +7,9 @@ export interface AccessConfig {
|
|
|
7
7
|
export declare function readAccessConfig(environment: Readonly<Record<string, string | undefined>>): AccessConfig | undefined;
|
|
8
8
|
/** Access validates the client's opaque OAuth token at the edge. The origin
|
|
9
9
|
* accepts only its signed assertion, including on the direct Railway hostname.
|
|
10
|
-
* Membership of this Access app authorizes the
|
|
11
|
-
*
|
|
10
|
+
* Membership of this Access app authorizes the read tools (`qyl:read`); the
|
|
11
|
+
* assertion carries no OAuth client ID or qyl scopes, so the write tools,
|
|
12
|
+
* which need `qyl:write` or `qyl:delete`, answer `insufficient_scope` here.
|
|
12
13
|
*/
|
|
13
14
|
export declare function createCloudflareAccessAuth(params: AccessConfig & {
|
|
14
15
|
resource: URL;
|
|
@@ -28,8 +28,9 @@ export function readAccessConfig(environment) {
|
|
|
28
28
|
}
|
|
29
29
|
/** Access validates the client's opaque OAuth token at the edge. The origin
|
|
30
30
|
* accepts only its signed assertion, including on the direct Railway hostname.
|
|
31
|
-
* Membership of this Access app authorizes the
|
|
32
|
-
*
|
|
31
|
+
* Membership of this Access app authorizes the read tools (`qyl:read`); the
|
|
32
|
+
* assertion carries no OAuth client ID or qyl scopes, so the write tools,
|
|
33
|
+
* which need `qyl:write` or `qyl:delete`, answer `insufficient_scope` here.
|
|
33
34
|
*/
|
|
34
35
|
export function createCloudflareAccessAuth(params) {
|
|
35
36
|
const { teamDomain, audience } = validateConfig(params);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cloudflare-access.js","sourceRoot":"","sources":["../src/cloudflare-access.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAwB,MAAM,MAAM,CAAC;AAE3E,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAK3C,SAAS,cAAc,CAAC,MAAoB;IAC1C,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IACxC,IAAI,IAAI,CAAC,QAAQ,KAAK,QAAQ,IAAI,CAAC,sCAAsC,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC;WACtF,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,KAAK,GAAG,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;QACxG,MAAM,IAAI,KAAK,CAAC,uEAAuE,CAAC,CAAC;IAC3F,CAAC;IACD,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,MAAM,CAAC,QAAQ,KAAK,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC;QAC1E,MAAM,IAAI,KAAK,CAAC,8DAA8D,CAAC,CAAC;IAClF,CAAC;IACD,OAAO,EAAE,UAAU,EAAE,IAAI,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,CAAC;AAChE,CAAC;AAED,MAAM,UAAU,gBA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,EAAE,MAAM,CAAC,QAAQ;oBACzB,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,GAAG,EAAE,QAAQ,EAAE,mBAAmB,EAAE;iBAC/D,CAAC;YACJ,CAAC;YAAC,MAAM,CAAC;gBACP,OAAO,YAAY,EAAE,CAAC;YACxB,CAAC;QACH,CAAC;QACD,2EAA2E;QAC3E,2EAA2E;KAC5E,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Collector calls for the objects users create in qyl: annotations (notes on
|
|
3
|
+
* a trace, span or session) and saved queries (named filters).
|
|
4
|
+
*
|
|
5
|
+
* They live in the caller's Collector project like telemetry does, and every
|
|
6
|
+
* call reaches it with the options `runTool` resolved from the verified
|
|
7
|
+
* subject; no argument names a project or a credential. Nothing here changes
|
|
8
|
+
* telemetry: an annotation points at a trace, span or session and leaves it
|
|
9
|
+
* as recorded, and the one delete operation removes only these objects.
|
|
10
|
+
*
|
|
11
|
+
* Demo mode has no Collector and therefore no such objects. A call there is
|
|
12
|
+
* refused rather than answered from an invented store.
|
|
13
|
+
*/
|
|
14
|
+
import type { Annotation, CreateAnnotationInput, CreateSavedQueryInput, DeletableKind, ListSavedQueriesInput, RunSavedQueryInput, SavedQuery, SavedQueryRunResult, SessionId, TraceId, UpdateAnnotationInput, UpdateSavedQueryInput } from "@ancplua/qyl-api-schema/types";
|
|
15
|
+
import { type CollectorRequestOptions } from "./collector.js";
|
|
16
|
+
import { type ToolScope } from "./request-scope.js";
|
|
17
|
+
export declare function createAnnotation(input: CreateAnnotationInput, options: CollectorRequestOptions): Promise<Annotation>;
|
|
18
|
+
export declare function updateAnnotation(input: UpdateAnnotationInput, options: CollectorRequestOptions): Promise<Annotation>;
|
|
19
|
+
export declare function createSavedQuery(input: CreateSavedQueryInput, options: CollectorRequestOptions): Promise<SavedQuery>;
|
|
20
|
+
export declare function updateSavedQuery(input: UpdateSavedQueryInput, options: CollectorRequestOptions): Promise<SavedQuery>;
|
|
21
|
+
export interface SavedQueryPage {
|
|
22
|
+
savedQueries: SavedQuery[];
|
|
23
|
+
hasMore: boolean;
|
|
24
|
+
nextCursor?: string;
|
|
25
|
+
}
|
|
26
|
+
export declare function listSavedQueries(input: ListSavedQueriesInput, options: CollectorRequestOptions): Promise<SavedQueryPage>;
|
|
27
|
+
export declare function runSavedQuery(input: RunSavedQueryInput, options: CollectorRequestOptions): Promise<SavedQueryRunResult>;
|
|
28
|
+
export declare function deleteResource(kind: DeletableKind, id: string, etag: string, options: CollectorRequestOptions): Promise<void>;
|
|
29
|
+
/** What a read tool adds to its result: the annotations and one text line. */
|
|
30
|
+
export interface AnnotationReadBack {
|
|
31
|
+
/** Present when the read succeeded; absent in demo mode and when it failed. */
|
|
32
|
+
annotations?: Annotation[];
|
|
33
|
+
/** Appended to the tool's text summary; empty when there is nothing to say. */
|
|
34
|
+
text: string;
|
|
35
|
+
}
|
|
36
|
+
/** The telemetry object an annotation names, in full. */
|
|
37
|
+
export declare function describeTarget(target: Annotation["target"]): string;
|
|
38
|
+
/** One text line per annotation: what it is on, how to change it, and the note. */
|
|
39
|
+
export declare function annotationLine(annotation: Annotation): string;
|
|
40
|
+
/** The text block for a list of annotations, newest first. */
|
|
41
|
+
export declare function summarizeAnnotations(annotations: readonly Annotation[], truncated: boolean): string;
|
|
42
|
+
/** The annotations on one trace and its spans, for get_trace. */
|
|
43
|
+
export declare function readTraceAnnotations(traceId: TraceId, scope: ToolScope): Promise<AnnotationReadBack>;
|
|
44
|
+
/** The annotations on the listed sessions, newest first, for list_sessions. */
|
|
45
|
+
export declare function readSessionAnnotations(sessionIds: readonly SessionId[], scope: ToolScope): Promise<AnnotationReadBack>;
|
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Collector calls for the objects users create in qyl: annotations (notes on
|
|
3
|
+
* a trace, span or session) and saved queries (named filters).
|
|
4
|
+
*
|
|
5
|
+
* They live in the caller's Collector project like telemetry does, and every
|
|
6
|
+
* call reaches it with the options `runTool` resolved from the verified
|
|
7
|
+
* subject; no argument names a project or a credential. Nothing here changes
|
|
8
|
+
* telemetry: an annotation points at a trace, span or session and leaves it
|
|
9
|
+
* as recorded, and the one delete operation removes only these objects.
|
|
10
|
+
*
|
|
11
|
+
* Demo mode has no Collector and therefore no such objects. A call there is
|
|
12
|
+
* refused rather than answered from an invented store.
|
|
13
|
+
*/
|
|
14
|
+
import { CollectorError, collectorDelete, collectorGet, collectorPatch, collectorPost, parseCollectorBody, parseCollectorPage, resolveMode, } from "./collector.js";
|
|
15
|
+
import { createHash } from "node:crypto";
|
|
16
|
+
import { IDEMPOTENCY_KEY_HEADER, IF_MATCH_HEADER } from "./contract-headers.js";
|
|
17
|
+
import { contractSchema } from "./contract-validation.js";
|
|
18
|
+
import { describeToolError } from "./request-scope.js";
|
|
19
|
+
import { shortId } from "./summaries.js";
|
|
20
|
+
import { redactTelemetry } from "./telemetry-redaction.js";
|
|
21
|
+
const ANNOTATIONS_PATH = "/api/v1/annotations";
|
|
22
|
+
const SAVED_QUERIES_PATH = "/api/v1/saved-queries";
|
|
23
|
+
// The operations' own bodies. They are bound here rather than in
|
|
24
|
+
// contract-validation.ts, which the dashboard and workbench bundles import.
|
|
25
|
+
const AnnotationCreatedSchema = contractSchema("Operations.AnnotationsApi_create.Response.201");
|
|
26
|
+
const AnnotationUpdatedSchema = contractSchema("Operations.AnnotationsApi_update.Response.200");
|
|
27
|
+
const AnnotationsPageSchema = contractSchema("Operations.AnnotationsApi_list.Response.200");
|
|
28
|
+
const SavedQueryCreatedSchema = contractSchema("Operations.SavedQueriesApi_create.Response.201");
|
|
29
|
+
const SavedQueryUpdatedSchema = contractSchema("Operations.SavedQueriesApi_update.Response.200");
|
|
30
|
+
const SavedQueriesPageSchema = contractSchema("Operations.SavedQueriesApi_list.Response.200");
|
|
31
|
+
const SavedQueryRunSchema = contractSchema("Operations.SavedQueriesApi_run.Response.200");
|
|
32
|
+
/** One page of the Collector's annotation listing per read-back. */
|
|
33
|
+
const ANNOTATIONS_PER_READ = 100;
|
|
34
|
+
/** Parallel annotation reads for one list_sessions page. */
|
|
35
|
+
const SESSION_READ_CONCURRENCY = 8;
|
|
36
|
+
/** Where each deletable kind lives on the Collector API. */
|
|
37
|
+
const DELETE_PATHS = {
|
|
38
|
+
annotation: ANNOTATIONS_PATH,
|
|
39
|
+
saved_query: SAVED_QUERIES_PATH,
|
|
40
|
+
};
|
|
41
|
+
/** Refuses demo mode: its generated dataset has no project to keep these objects in. */
|
|
42
|
+
async function requireLiveCollector(tool) {
|
|
43
|
+
if (await resolveMode() === "live")
|
|
44
|
+
return;
|
|
45
|
+
throw new CollectorError(`${tool} needs a live qyl Collector: annotations and saved queries are kept in a Collector ` +
|
|
46
|
+
"project, and demo mode (QYL_DEMO=1) has none. Set QYL_COLLECTOR_URL and unset QYL_DEMO.", false, undefined, "invalid_argument");
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* The If-Match value for a change. An etag is opaque, but it travels as an
|
|
50
|
+
* HTTP field value, so one that could not be sent is refused here instead of
|
|
51
|
+
* failing inside fetch as if the Collector were unreachable.
|
|
52
|
+
*/
|
|
53
|
+
function ifMatch(etag) {
|
|
54
|
+
if (!/^[\x21-\x7e](?:[\x20-\x7e]*[\x21-\x7e])?$/u.test(etag)) {
|
|
55
|
+
throw new CollectorError("etag is not a valid HTTP field value; pass the etag a qyl tool returned");
|
|
56
|
+
}
|
|
57
|
+
return { [IF_MATCH_HEADER]: etag };
|
|
58
|
+
}
|
|
59
|
+
/** JSON with object keys in one order at every depth, so equal bodies hash equal. */
|
|
60
|
+
function canonicalJson(value) {
|
|
61
|
+
return JSON.stringify(value, (_key, item) => item !== null && typeof item === "object" && !Array.isArray(item)
|
|
62
|
+
? Object.fromEntries(Object.entries(item).sort(([left], [right]) => left < right ? -1 : left > right ? 1 : 0))
|
|
63
|
+
: item);
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* The retry key of a creating POST. A create's result can be lost after the
|
|
67
|
+
* Collector committed it (a timeout, a dropped connection), and the failure is
|
|
68
|
+
* reported retryable; the same intended create must then repeat the same key,
|
|
69
|
+
* so the Collector returns the first object instead of making a second one.
|
|
70
|
+
* The key is derived from the canonical body and the resolved project, never
|
|
71
|
+
* chosen by the model: an identical note on the same target within the
|
|
72
|
+
* Collector's 24-hour window is the same note.
|
|
73
|
+
*/
|
|
74
|
+
function idempotencyKey(body, options) {
|
|
75
|
+
const digest = createHash("sha256")
|
|
76
|
+
.update(`${options.access?.project ?? ""}\0${canonicalJson(body)}`)
|
|
77
|
+
.digest("hex");
|
|
78
|
+
return { [IDEMPOTENCY_KEY_HEADER]: digest };
|
|
79
|
+
}
|
|
80
|
+
function resourcePath(base, id, suffix = "") {
|
|
81
|
+
return `${base}/${encodeURIComponent(id)}${suffix}`;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Runs one Collector call and names its refusals for what the caller tried:
|
|
85
|
+
* a status listed in `messages` becomes that message, keeping the code the
|
|
86
|
+
* status decides (`not_found`, `conflict`, `precondition_failed`,
|
|
87
|
+
* `collector_unauthorized`). A body that breaks the contract stays a
|
|
88
|
+
* contract mismatch, and every other failure passes through unchanged.
|
|
89
|
+
*/
|
|
90
|
+
async function refusals(messages, request) {
|
|
91
|
+
try {
|
|
92
|
+
return await request();
|
|
93
|
+
}
|
|
94
|
+
catch (error) {
|
|
95
|
+
if (!(error instanceof CollectorError) || error.status === undefined || error.code === "contract_mismatch") {
|
|
96
|
+
throw error;
|
|
97
|
+
}
|
|
98
|
+
const message = messages[error.status];
|
|
99
|
+
if (message === undefined)
|
|
100
|
+
throw error;
|
|
101
|
+
throw new CollectorError(message, false, error.status);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
/** The refusals every change to an existing object shares. */
|
|
105
|
+
function changeRefusals(kind, id, role) {
|
|
106
|
+
return {
|
|
107
|
+
403: `the Collector refused the change: the server's Collector key needs the ${role} role`,
|
|
108
|
+
404: `${kind} not found: ${id}`,
|
|
109
|
+
412: `${kind} ${id} changed since that etag was read; read it again for its current etag`,
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
export async function createAnnotation(input, options) {
|
|
113
|
+
await requireLiveCollector("create_annotation");
|
|
114
|
+
// The create's 404 is its target: nothing by that id is recorded in this
|
|
115
|
+
// project, so there is nothing to attach the note to.
|
|
116
|
+
const create = { target: input.target, text: input.text };
|
|
117
|
+
const body = await refusals({
|
|
118
|
+
403: "the Collector refused the change: the server's Collector key needs the write role",
|
|
119
|
+
404: `${describeTarget(input.target)} is not recorded in this project`,
|
|
120
|
+
}, () => collectorPost(ANNOTATIONS_PATH, create, {
|
|
121
|
+
...options,
|
|
122
|
+
headers: { ...options.headers, ...idempotencyKey(create, options) },
|
|
123
|
+
}));
|
|
124
|
+
return redactTelemetry(parseCollectorBody(body, `POST ${ANNOTATIONS_PATH}`, AnnotationCreatedSchema));
|
|
125
|
+
}
|
|
126
|
+
export async function updateAnnotation(input, options) {
|
|
127
|
+
await requireLiveCollector("update_annotation");
|
|
128
|
+
const path = resourcePath(ANNOTATIONS_PATH, input.id);
|
|
129
|
+
const body = await refusals(changeRefusals("annotation", input.id, "write"), () => collectorPatch(path, { text: input.text }, { ...options, headers: ifMatch(input.etag) }));
|
|
130
|
+
return redactTelemetry(parseCollectorBody(body, `PATCH ${path}`, AnnotationUpdatedSchema));
|
|
131
|
+
}
|
|
132
|
+
export async function createSavedQuery(input, options) {
|
|
133
|
+
await requireLiveCollector("create_saved_query");
|
|
134
|
+
const create = {
|
|
135
|
+
name: input.name,
|
|
136
|
+
...(input.description === undefined ? {} : { description: input.description }),
|
|
137
|
+
filter: input.filter,
|
|
138
|
+
};
|
|
139
|
+
const body = await refusals({
|
|
140
|
+
403: "the Collector refused the change: the server's Collector key needs the write role",
|
|
141
|
+
409: `a saved query named "${input.name}" already exists in this project`,
|
|
142
|
+
}, () => collectorPost(SAVED_QUERIES_PATH, create, {
|
|
143
|
+
...options,
|
|
144
|
+
headers: { ...options.headers, ...idempotencyKey(create, options) },
|
|
145
|
+
}));
|
|
146
|
+
return redactTelemetry(parseCollectorBody(body, `POST ${SAVED_QUERIES_PATH}`, SavedQueryCreatedSchema));
|
|
147
|
+
}
|
|
148
|
+
export async function updateSavedQuery(input, options) {
|
|
149
|
+
const { id, etag, ...changes } = input;
|
|
150
|
+
if (changes.name === undefined && changes.description === undefined && changes.filter === undefined) {
|
|
151
|
+
throw new CollectorError("update_saved_query changes nothing: pass a name, description or filter");
|
|
152
|
+
}
|
|
153
|
+
await requireLiveCollector("update_saved_query");
|
|
154
|
+
const path = resourcePath(SAVED_QUERIES_PATH, id);
|
|
155
|
+
const body = await refusals({
|
|
156
|
+
...changeRefusals("saved query", id, "write"),
|
|
157
|
+
409: `a saved query named "${changes.name ?? ""}" already exists in this project`,
|
|
158
|
+
}, () => collectorPatch(path, changes, { ...options, headers: ifMatch(etag) }));
|
|
159
|
+
return redactTelemetry(parseCollectorBody(body, `PATCH ${path}`, SavedQueryUpdatedSchema));
|
|
160
|
+
}
|
|
161
|
+
export async function listSavedQueries(input, options) {
|
|
162
|
+
await requireLiveCollector("list_saved_queries");
|
|
163
|
+
const body = await collectorGet(SAVED_QUERIES_PATH, { signal: input.signal, limit: input.limit ?? 20, cursor: input.cursor }, options);
|
|
164
|
+
const page = parseCollectorPage(body, SAVED_QUERIES_PATH, SavedQueriesPageSchema, (item) => item);
|
|
165
|
+
return redactTelemetry({
|
|
166
|
+
savedQueries: page.items,
|
|
167
|
+
hasMore: page.hasMore,
|
|
168
|
+
...(page.nextCursor === undefined ? {} : { nextCursor: page.nextCursor }),
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
export async function runSavedQuery(input, options) {
|
|
172
|
+
const { id, ...run } = input;
|
|
173
|
+
await requireLiveCollector("run_saved_query");
|
|
174
|
+
const path = resourcePath(SAVED_QUERIES_PATH, id, ":run");
|
|
175
|
+
const body = await refusals({ 404: `saved query not found: ${id}` }, () => collectorPost(path, run, options));
|
|
176
|
+
return redactTelemetry(parseCollectorBody(body, `POST ${path}`, SavedQueryRunSchema));
|
|
177
|
+
}
|
|
178
|
+
export async function deleteResource(kind, id, etag, options) {
|
|
179
|
+
await requireLiveCollector("delete");
|
|
180
|
+
const path = resourcePath(DELETE_PATHS[kind], id);
|
|
181
|
+
const body = await refusals(changeRefusals(kind === "annotation" ? "annotation" : "saved query", id, "delete"), () => collectorDelete(path, { ...options, headers: ifMatch(etag) }));
|
|
182
|
+
if (body !== undefined) {
|
|
183
|
+
throw new CollectorError(`collector contract mismatch for DELETE ${path}: expected 204 No Content`, false, undefined, "contract_mismatch");
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
/** The telemetry object an annotation names, in full. */
|
|
187
|
+
export function describeTarget(target) {
|
|
188
|
+
switch (target.kind) {
|
|
189
|
+
case "trace":
|
|
190
|
+
return `trace ${target.trace_id}`;
|
|
191
|
+
case "span":
|
|
192
|
+
return `span ${target.span_id} of trace ${target.trace_id}`;
|
|
193
|
+
case "session":
|
|
194
|
+
return `session ${target.session_id}`;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
function targetLabel(target) {
|
|
198
|
+
switch (target.kind) {
|
|
199
|
+
case "trace":
|
|
200
|
+
return `trace ${shortId(target.trace_id)}`;
|
|
201
|
+
case "span":
|
|
202
|
+
return `span ${target.span_id}`;
|
|
203
|
+
case "session":
|
|
204
|
+
return `session ${target.session_id}`;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
/** One text line per annotation: what it is on, how to change it, and the note. */
|
|
208
|
+
export function annotationLine(annotation) {
|
|
209
|
+
const note = annotation.text.replace(/\s+/gu, " ");
|
|
210
|
+
const text = note.length > 200 ? `${note.slice(0, 200)}…` : note;
|
|
211
|
+
return `- ${targetLabel(annotation.target)} · id ${annotation.id} · etag ${annotation.etag}: ${text}`;
|
|
212
|
+
}
|
|
213
|
+
/** The text block for a list of annotations, newest first. */
|
|
214
|
+
export function summarizeAnnotations(annotations, truncated) {
|
|
215
|
+
if (annotations.length === 0)
|
|
216
|
+
return "\nAnnotations: none.";
|
|
217
|
+
return (`\nAnnotations (${annotations.length}, newest first${truncated ? `; the newest ${ANNOTATIONS_PER_READ} per object` : ""}):\n` +
|
|
218
|
+
annotations.map(annotationLine).join("\n"));
|
|
219
|
+
}
|
|
220
|
+
async function readAnnotationPage(params, options) {
|
|
221
|
+
const body = await collectorGet(ANNOTATIONS_PATH, { ...params, limit: ANNOTATIONS_PER_READ }, options);
|
|
222
|
+
const page = parseCollectorPage(body, ANNOTATIONS_PATH, AnnotationsPageSchema, (item) => item);
|
|
223
|
+
return { annotations: page.items, hasMore: page.hasMore };
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* An annotation read that fails leaves the telemetry result standing: the
|
|
227
|
+
* field is omitted and the text says why, instead of failing a trace read
|
|
228
|
+
* that succeeded or reporting "no annotations" that were never read.
|
|
229
|
+
*/
|
|
230
|
+
function unavailable(error) {
|
|
231
|
+
return { text: `\nAnnotations could not be read: ${describeToolError(error).message}` };
|
|
232
|
+
}
|
|
233
|
+
/** The annotations on one trace and its spans, for get_trace. */
|
|
234
|
+
export async function readTraceAnnotations(traceId, scope) {
|
|
235
|
+
if (await resolveMode() === "demo") {
|
|
236
|
+
await scope.step("Demo data carries no annotations");
|
|
237
|
+
return { text: "" };
|
|
238
|
+
}
|
|
239
|
+
try {
|
|
240
|
+
const { annotations, hasMore } = await readAnnotationPage({ trace_id: traceId }, scope.collector);
|
|
241
|
+
await scope.step(`Read ${annotations.length} annotation(s) for trace ${traceId}`);
|
|
242
|
+
const safe = redactTelemetry(annotations);
|
|
243
|
+
return { annotations: safe, text: summarizeAnnotations(safe, hasMore) };
|
|
244
|
+
}
|
|
245
|
+
catch (error) {
|
|
246
|
+
await scope.step("Annotations unavailable");
|
|
247
|
+
return unavailable(error);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
/** The annotations on the listed sessions, newest first, for list_sessions. */
|
|
251
|
+
export async function readSessionAnnotations(sessionIds, scope) {
|
|
252
|
+
if (await resolveMode() === "demo") {
|
|
253
|
+
await scope.step("Demo data carries no annotations");
|
|
254
|
+
return { text: "" };
|
|
255
|
+
}
|
|
256
|
+
if (sessionIds.length === 0) {
|
|
257
|
+
await scope.step("No sessions to read annotations for");
|
|
258
|
+
return { annotations: [], text: "" };
|
|
259
|
+
}
|
|
260
|
+
try {
|
|
261
|
+
// One session's failed page costs that session's notes, not every session's.
|
|
262
|
+
const pages = [];
|
|
263
|
+
let failed = 0;
|
|
264
|
+
let firstFailure;
|
|
265
|
+
for (let start = 0; start < sessionIds.length; start += SESSION_READ_CONCURRENCY) {
|
|
266
|
+
const settled = await Promise.allSettled(sessionIds
|
|
267
|
+
.slice(start, start + SESSION_READ_CONCURRENCY)
|
|
268
|
+
.map((sessionId) => readAnnotationPage({ session_id: sessionId }, scope.collector)));
|
|
269
|
+
for (const outcome of settled) {
|
|
270
|
+
if (outcome.status === "fulfilled")
|
|
271
|
+
pages.push(outcome.value);
|
|
272
|
+
else {
|
|
273
|
+
failed += 1;
|
|
274
|
+
firstFailure ??= outcome.reason;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
if (pages.length === 0)
|
|
279
|
+
throw firstFailure;
|
|
280
|
+
const annotations = pages
|
|
281
|
+
.flatMap((page) => page.annotations)
|
|
282
|
+
.sort((left, right) => Date.parse(right.created_at) - Date.parse(left.created_at));
|
|
283
|
+
await scope.step(`Read ${annotations.length} annotation(s) for ${sessionIds.length} session(s)`);
|
|
284
|
+
const safe = redactTelemetry(annotations);
|
|
285
|
+
const partial = failed === 0
|
|
286
|
+
? ""
|
|
287
|
+
: `\nAnnotations of ${failed} session(s) could not be read: ${describeToolError(firstFailure).message}`;
|
|
288
|
+
return { annotations: safe, text: summarizeAnnotations(safe, pages.some((page) => page.hasMore)) + partial };
|
|
289
|
+
}
|
|
290
|
+
catch (error) {
|
|
291
|
+
await scope.step("Annotations unavailable");
|
|
292
|
+
return unavailable(error);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
//# sourceMappingURL=collector-resources.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collector-resources.js","sourceRoot":"","sources":["../src/collector-resources.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAgBH,OAAO,EACL,cAAc,EAEd,eAAe,EACf,YAAY,EACZ,cAAc,EACd,aAAa,EACb,kBAAkB,EAClB,kBAAkB,EAClB,WAAW,GACZ,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAChF,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAkB,MAAM,oBAAoB,CAAC;AACvE,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D,MAAM,gBAAgB,GAAG,qBAAqB,CAAC;AAC/C,MAAM,kBAAkB,GAAG,uBAAuB,CAAC;AAEnD,iEAAiE;AACjE,4EAA4E;AAC5E,MAAM,uBAAuB,GAAG,cAAc,CAAC,+CAA+C,CAAC,CAAC;AAChG,MAAM,uBAAuB,GAAG,cAAc,CAAC,+CAA+C,CAAC,CAAC;AAChG,MAAM,qBAAqB,GAAG,cAAc,CAAC,6CAA6C,CAAC,CAAC;AAC5F,MAAM,uBAAuB,GAAG,cAAc,CAAC,gDAAgD,CAAC,CAAC;AACjG,MAAM,uBAAuB,GAAG,cAAc,CAAC,gDAAgD,CAAC,CAAC;AACjG,MAAM,sBAAsB,GAAG,cAAc,CAAC,8CAA8C,CAAC,CAAC;AAC9F,MAAM,mBAAmB,GAAG,cAAc,CAAC,6CAA6C,CAAC,CAAC;AAE1F,oE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AAoB,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,OAAO,EAAE,CAAC;IAC/G,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,KAAK,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAC;QAC5C,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC;IAC5B,CAAC;AACH,CAAC"}
|
package/dist/collector.d.ts
CHANGED
|
@@ -58,6 +58,11 @@ export interface CollectorRequestOptions {
|
|
|
58
58
|
signal?: AbortSignal;
|
|
59
59
|
/** Host-selected access for the verified caller; never a tool input. */
|
|
60
60
|
access?: CollectorAccess;
|
|
61
|
+
/**
|
|
62
|
+
* Contract-named request headers one operation takes, such as `If-Match`.
|
|
63
|
+
* They never replace the credential or project headers.
|
|
64
|
+
*/
|
|
65
|
+
headers?: Readonly<Record<string, string>>;
|
|
61
66
|
}
|
|
62
67
|
/**
|
|
63
68
|
* Normalize endpoint items, then validate the complete operation-specific
|
|
@@ -69,8 +74,15 @@ export declare function parseCollectorPage<T, TPage extends {
|
|
|
69
74
|
has_more: boolean;
|
|
70
75
|
next_cursor?: string | null;
|
|
71
76
|
}>(value: unknown, context: string, pageSchema: z.ZodType<TPage>, parseItem: (item: unknown, context: string) => T): ParsedCollectorPage<T>;
|
|
77
|
+
/**
|
|
78
|
+
* Validate one whole response body against its generated operation schema,
|
|
79
|
+
* for the operations that answer with a single resource rather than a page.
|
|
80
|
+
*/
|
|
81
|
+
export declare function parseCollectorBody<T>(value: unknown, context: string, schema: z.ZodType<T>): T;
|
|
72
82
|
/** Query values a published operation parameter can carry, repeatable included. */
|
|
73
83
|
export type CollectorQueryParams = Record<string, string | number | boolean | readonly string[] | undefined>;
|
|
74
84
|
export declare function collectorGet(pathname: string, params?: CollectorQueryParams, options?: CollectorRequestOptions): Promise<unknown>;
|
|
75
85
|
export declare function collectorPost(pathname: string, body: unknown, options?: CollectorRequestOptions): Promise<unknown>;
|
|
86
|
+
export declare function collectorPatch(pathname: string, body: unknown, options?: CollectorRequestOptions): Promise<unknown>;
|
|
87
|
+
export declare function collectorDelete(pathname: string, options?: CollectorRequestOptions): Promise<unknown>;
|
|
76
88
|
export declare function resolveMode(): Promise<Mode>;
|
package/dist/collector.js
CHANGED
|
@@ -21,6 +21,14 @@ function codeForStatus(status) {
|
|
|
21
21
|
return "not_found";
|
|
22
22
|
if (status === 401 || status === 403)
|
|
23
23
|
return "collector_unauthorized";
|
|
24
|
+
// The write routes' answers: a duplicate name or reused retry key, a stale
|
|
25
|
+
// If-Match etag, and a missing If-Match.
|
|
26
|
+
if (status === 409)
|
|
27
|
+
return "conflict";
|
|
28
|
+
if (status === 412)
|
|
29
|
+
return "precondition_failed";
|
|
30
|
+
if (status === 428)
|
|
31
|
+
return "precondition_required";
|
|
24
32
|
if (status === 429)
|
|
25
33
|
return "collector_rate_limited";
|
|
26
34
|
if (status >= 500)
|
|
@@ -206,6 +214,16 @@ export function parseCollectorPage(value, context, pageSchema, parseItem) {
|
|
|
206
214
|
throw error;
|
|
207
215
|
}
|
|
208
216
|
}
|
|
217
|
+
/**
|
|
218
|
+
* Validate one whole response body against its generated operation schema,
|
|
219
|
+
* for the operations that answer with a single resource rather than a page.
|
|
220
|
+
*/
|
|
221
|
+
export function parseCollectorBody(value, context, schema) {
|
|
222
|
+
const parsed = schema.safeParse(value);
|
|
223
|
+
if (!parsed.success)
|
|
224
|
+
throw contractMismatch(context, parsed.error);
|
|
225
|
+
return parsed.data;
|
|
226
|
+
}
|
|
209
227
|
function normalizeProblemDetails(value) {
|
|
210
228
|
const problem = asRecord(value, "error response");
|
|
211
229
|
if (problem.timestamp === undefined)
|
|
@@ -253,6 +271,7 @@ async function collectorRequest(pathname, method, params, body, options) {
|
|
|
253
271
|
: timeout;
|
|
254
272
|
const headers = {
|
|
255
273
|
accept: "application/json",
|
|
274
|
+
...options.headers,
|
|
256
275
|
...collectorHeaders(options.access),
|
|
257
276
|
...(body === undefined ? {} : { "content-type": "application/json" }),
|
|
258
277
|
};
|
|
@@ -275,6 +294,10 @@ async function collectorRequest(pathname, method, params, body, options) {
|
|
|
275
294
|
throw new CollectorError(`collector unreachable at ${collectorUrl()} — start it with ` +
|
|
276
295
|
"`dotnet run --project services/qyl.collector` or set QYL_DEMO=1", true);
|
|
277
296
|
}
|
|
297
|
+
// A DELETE answers 204 with no body; the caller's operation decides
|
|
298
|
+
// whether an empty answer is one its contract allows.
|
|
299
|
+
if (response.status === 204)
|
|
300
|
+
return undefined;
|
|
278
301
|
let responseBody;
|
|
279
302
|
try {
|
|
280
303
|
responseBody = await response.json();
|
|
@@ -301,6 +324,12 @@ export function collectorGet(pathname, params = {}, options = {}) {
|
|
|
301
324
|
export function collectorPost(pathname, body, options = {}) {
|
|
302
325
|
return collectorRequest(pathname, "POST", {}, body, options);
|
|
303
326
|
}
|
|
327
|
+
export function collectorPatch(pathname, body, options = {}) {
|
|
328
|
+
return collectorRequest(pathname, "PATCH", {}, body, options);
|
|
329
|
+
}
|
|
330
|
+
export function collectorDelete(pathname, options = {}) {
|
|
331
|
+
return collectorRequest(pathname, "DELETE", {}, undefined, options);
|
|
332
|
+
}
|
|
304
333
|
export function resolveMode() {
|
|
305
334
|
return Promise.resolve(process.env.QYL_DEMO === "1" ? "demo" : "live");
|
|
306
335
|
}
|
package/dist/collector.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collector.js","sourceRoot":"","sources":["../src/collector.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAYH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAwB,MAAM,uBAAuB,CAAC;AAC1G,OAAO,EACL,eAAe,EACf,sBAAsB,EACtB,uBAAuB,EACvB,kBAA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