qyl-mcp-server 7.4.0 → 7.6.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 +61 -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 +55 -15
- 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 +2 -2
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,49 @@ 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.6.0
|
|
215
|
+
|
|
216
|
+
- Contract 12.0.0 (`@ancplua/qyl-api-schema` 12.0.0, revision
|
|
217
|
+
`sha256:b29439eba28e752b`): the server is generated from it and refuses a
|
|
218
|
+
Collector on another revision, so it deploys only after the Collector serves
|
|
219
|
+
12.0.0.
|
|
220
|
+
- Every problem the Collector or the workbench reports is RFC 9457 with a
|
|
221
|
+
`type` URI (`https://qyl.at/problems/<name>`) and a stable `code`. A tool
|
|
222
|
+
error's code now follows the problem's `code` (`not_found`, `conflict`,
|
|
223
|
+
`precondition_failed`, `precondition_required`, `collector_unauthorized`,
|
|
224
|
+
`collector_error`) and falls back to the HTTP status only for a body
|
|
225
|
+
without one.
|
|
226
|
+
- One page limit on every list: 1 to 1000, 100 when omitted. The workbench
|
|
227
|
+
reads Collector logs in pages of 1000 following `next_cursor` (up to ten
|
|
228
|
+
pages, the same bound as before), and its protocol-event page defaults to
|
|
229
|
+
100. `next_cursor` is absent on the last page.
|
|
230
|
+
- The workbench's HTTP errors no longer carry `X-Request-Id`; no server sent
|
|
231
|
+
it.
|
|
232
|
+
|
|
233
|
+
### 7.5.0
|
|
234
|
+
|
|
235
|
+
- Write tools, each a separate tool so a host can approve it on its own:
|
|
236
|
+
`create_annotation` and `update_annotation` (notes on a trace, span or
|
|
237
|
+
session), `create_saved_query` and `update_saved_query` (named filters), and
|
|
238
|
+
one `delete` for either kind. They change only those objects, in the
|
|
239
|
+
caller's Collector project; no tool deletes or edits telemetry.
|
|
240
|
+
`list_saved_queries` and `run_saved_query` read saved queries, and
|
|
241
|
+
`get_trace` and `list_sessions` return annotations.
|
|
242
|
+
- Scopes: `qyl:write` for create and update, `qyl:delete` for `delete`;
|
|
243
|
+
`qyl:read` alone keeps the read tools. The protected-resource metadata lists
|
|
244
|
+
all three, and a call without the scope it needs gets a `403`
|
|
245
|
+
`insufficient_scope` challenge. The Collector key needs the `write` and
|
|
246
|
+
`delete` roles.
|
|
247
|
+
|
|
194
248
|
### 7.4.0
|
|
195
249
|
|
|
196
250
|
- 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,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,CAAC,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;YACjE,IAAI,CAAC,SAAS,IAAI,SAAS,CAAC,MAAM,GAAG,MAAM;gBAAE,OAAO,YAAY,EAAE,CAAC;YACnE,IAAI,CAAC;gBACH,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,SAAS,CAAC,SAAS,EAAE,GAAG,EAAE;oBAClD,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC,OAAO,CAAC,EAAE,cAAc,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC;iBACpF,CAAC,CAAC;gBACH,IAAI,OAAO,OAAO,CAAC,GAAG,KAAK,QAAQ,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,OAAO,OAAO,CAAC,GAAG,KAAK,QAAQ;oBAAE,OAAO,YAAY,EAAE,CAAC;gBAC9G,OAAO;oBACL,KAAK,EAAE,SAAS;oBAChB,QAAQ,EAAE,mBAAmB;oBAC7B,MAAM,EAAE,CAAC,aAAa,CAAC;oBACvB,SAAS,EAAE,OAAO,CAAC,GAAG;oBACtB,QAAQ,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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AAK,CAAC;YAAE,MAAM,YAAY,CAAC;QAC3C,MAAM,WAAW,GAAG,KAAK;aACtB,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC;aACnC,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;QACrF,MAAM,KAAK,CAAC,IAAI,CAAC,QAAQ,WAAW,CAAC,MAAM,sBAAsB,UAAU,CAAC,MAAM,aAAa,CAAC,CAAC;QACjG,MAAM,IAAI,GAAG,eAAe,CAAC,WAAW,CAAC,CAAC;QAC1C,MAAM,OAAO,GAAG,MAAM,KAAK,CAAC;YAC1B,CAAC,CAAC,EAAE;YACJ,CAAC,CAAC,oBAAoB,MAAM,kCAAkC,iBAAiB,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE,CAAC;QAC1G,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,IAAI,EAAE,oBAAoB,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>;
|