@nanolink/mirrors 1.1.50 → 1.1.51
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/dist/definitions/annotations.d.ts +84 -0
- package/dist/definitions/annotations.js +606 -0
- package/dist/definitions/annotations.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/dist-compat/index.js +345 -1
- package/dist-compat/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { Subscriptions } from './mirrors';
|
|
2
|
+
/**
|
|
3
|
+
* Semantic annotations for the predefined mirrors.
|
|
4
|
+
*
|
|
5
|
+
* WHY THESE LIVE HERE, next to the documents they describe:
|
|
6
|
+
*
|
|
7
|
+
* Everything mechanical about a mirror can be derived — field names, types,
|
|
8
|
+
* aliases and variables all fall out of the GraphQL document validated against
|
|
9
|
+
* the server SDL. What cannot be derived is *meaning*: what a collection is,
|
|
10
|
+
* when someone should reach for it, and whether it belongs in a surface exposed
|
|
11
|
+
* to an AI assistant at all. That has to be authored by whoever knows the data,
|
|
12
|
+
* and the closest place to the data is here.
|
|
13
|
+
*
|
|
14
|
+
* THE BUILD GATE IS THE TYPE ITSELF.
|
|
15
|
+
*
|
|
16
|
+
* `Record<keyof typeof Subscriptions, MirrorAnnotation>` means adding a mirror
|
|
17
|
+
* without annotating it is a compile error in this package. No lint rule to
|
|
18
|
+
* remember, no script to run — it simply will not build. Consumers (the MCP
|
|
19
|
+
* server) do a second pass: they refuse to expose anything whose annotation is
|
|
20
|
+
* still unreviewed, and they re-derive schemas from the live SDL so a document
|
|
21
|
+
* that drifts away from the server fails their build too.
|
|
22
|
+
*/
|
|
23
|
+
/** Who a mirror is meant for. */
|
|
24
|
+
export type MirrorAudience =
|
|
25
|
+
/** Safe and useful to expose as an AI tool. */
|
|
26
|
+
'ai'
|
|
27
|
+
/** Internal plumbing, diagnostics, or too specialised to be worth a tool. */
|
|
28
|
+
| 'internal';
|
|
29
|
+
/** Rough size, so consumers can pick sensible default page limits. */
|
|
30
|
+
export type MirrorCardinality =
|
|
31
|
+
/** Tens of rows. Safe to read whole. */
|
|
32
|
+
'small'
|
|
33
|
+
/** Hundreds. Usually wants a limit. */
|
|
34
|
+
| 'medium'
|
|
35
|
+
/** Thousands or unbounded. Always wants a limit and a filter. */
|
|
36
|
+
| 'large';
|
|
37
|
+
export interface MirrorAnnotation {
|
|
38
|
+
/** Short noun phrase, e.g. "Trackers". Becomes the tool title. */
|
|
39
|
+
title: string;
|
|
40
|
+
/**
|
|
41
|
+
* What this collection *is*, in the words a reader needs — not a restatement
|
|
42
|
+
* of the field list, which is generated anyway.
|
|
43
|
+
*/
|
|
44
|
+
description: string;
|
|
45
|
+
/**
|
|
46
|
+
* When to reach for this one, and when not. This is what stops an assistant
|
|
47
|
+
* from picking a plausible-sounding neighbour.
|
|
48
|
+
*/
|
|
49
|
+
useWhen?: string;
|
|
50
|
+
/** Whether this belongs in an AI-facing surface. */
|
|
51
|
+
audience: MirrorAudience;
|
|
52
|
+
/**
|
|
53
|
+
* Fields worth returning by default.
|
|
54
|
+
*
|
|
55
|
+
* Some documents select a great deal — `references` selects 100 fields — and
|
|
56
|
+
* sending all of it into a model's context is wasteful. Consumers return
|
|
57
|
+
* these by default and keep the rest available on request. Names are the
|
|
58
|
+
* *aliased* output names, as they appear in results.
|
|
59
|
+
*/
|
|
60
|
+
summaryFields?: readonly string[];
|
|
61
|
+
cardinality?: MirrorCardinality;
|
|
62
|
+
/**
|
|
63
|
+
* Has a human confirmed this description is accurate?
|
|
64
|
+
*
|
|
65
|
+
* Defaults to absent, which consumers must treat as "not reviewed" and
|
|
66
|
+
* refuse to expose. This exists so a mirror can be added and compile without
|
|
67
|
+
* anyone inventing a plausible-sounding description that turns out to be
|
|
68
|
+
* wrong — an incorrect tool description is worse than a missing tool,
|
|
69
|
+
* because it produces confidently wrong answers rather than no answer.
|
|
70
|
+
*/
|
|
71
|
+
reviewed?: true;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Annotation for every predefined mirror.
|
|
75
|
+
*
|
|
76
|
+
* Entries below are seeded from the GraphQL documents and the server schema.
|
|
77
|
+
* Anything not marked `reviewed: true` is a DRAFT and will not be exposed by
|
|
78
|
+
* consumers, regardless of `audience`.
|
|
79
|
+
*/
|
|
80
|
+
export declare const MirrorAnnotations: Record<keyof typeof Subscriptions, MirrorAnnotation>;
|
|
81
|
+
/** Mirrors an AI-facing consumer may expose: annotated, reviewed, and marked `ai`. */
|
|
82
|
+
export declare function exposedMirrors(): Array<keyof typeof Subscriptions>;
|
|
83
|
+
/** Names still carrying a draft description, for a build-time report. */
|
|
84
|
+
export declare function draftMirrors(): Array<keyof typeof Subscriptions>;
|