@nulladrift/core 0.1.0-rc.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.
Files changed (50) hide show
  1. package/LICENSE +21 -0
  2. package/dist/changes.d.ts +53 -0
  3. package/dist/changes.js +17 -0
  4. package/dist/changes.js.map +1 -0
  5. package/dist/chunk-3LIIW7B5.js +9 -0
  6. package/dist/chunk-3LIIW7B5.js.map +1 -0
  7. package/dist/chunk-42ZE5O5I.js +125 -0
  8. package/dist/chunk-42ZE5O5I.js.map +1 -0
  9. package/dist/chunk-ALHOTOM6.js +1 -0
  10. package/dist/chunk-ALHOTOM6.js.map +1 -0
  11. package/dist/chunk-DGEHI25T.js +46 -0
  12. package/dist/chunk-DGEHI25T.js.map +1 -0
  13. package/dist/chunk-DL6LTPYY.js +83 -0
  14. package/dist/chunk-DL6LTPYY.js.map +1 -0
  15. package/dist/chunk-DZHB25AC.js +237 -0
  16. package/dist/chunk-DZHB25AC.js.map +1 -0
  17. package/dist/chunk-GG2RYE4R.js +91 -0
  18. package/dist/chunk-GG2RYE4R.js.map +1 -0
  19. package/dist/chunk-HLTEHLNF.js +66 -0
  20. package/dist/chunk-HLTEHLNF.js.map +1 -0
  21. package/dist/chunk-SUY3NGZP.js +87 -0
  22. package/dist/chunk-SUY3NGZP.js.map +1 -0
  23. package/dist/diff/index.d.ts +6 -0
  24. package/dist/diff/index.js +13 -0
  25. package/dist/diff/index.js.map +1 -0
  26. package/dist/diff/schema.d.ts +6 -0
  27. package/dist/diff/schema.js +9 -0
  28. package/dist/diff/schema.js.map +1 -0
  29. package/dist/diff/types.d.ts +1 -0
  30. package/dist/diff/types.js +18 -0
  31. package/dist/diff/types.js.map +1 -0
  32. package/dist/index.d.ts +7 -0
  33. package/dist/index.js +65 -0
  34. package/dist/index.js.map +1 -0
  35. package/dist/lock/canonical.d.ts +52 -0
  36. package/dist/lock/canonical.js +17 -0
  37. package/dist/lock/canonical.js.map +1 -0
  38. package/dist/lock/jsonschema.d.ts +39 -0
  39. package/dist/lock/jsonschema.js +19 -0
  40. package/dist/lock/jsonschema.js.map +1 -0
  41. package/dist/lock/normalize.d.ts +44 -0
  42. package/dist/lock/normalize.js +18 -0
  43. package/dist/lock/normalize.js.map +1 -0
  44. package/dist/lock/reseal.d.ts +10 -0
  45. package/dist/lock/reseal.js +8 -0
  46. package/dist/lock/reseal.js.map +1 -0
  47. package/dist/lock/types.d.ts +178 -0
  48. package/dist/lock/types.js +9 -0
  49. package/dist/lock/types.js.map +1 -0
  50. package/package.json +60 -0
@@ -0,0 +1,18 @@
1
+ import "../chunk-ALHOTOM6.js";
2
+ import {
3
+ CHANGE_KINDS,
4
+ SEVERITIES,
5
+ SEVERITY,
6
+ SEVERITY_RANK,
7
+ serversThatShippedNothing,
8
+ sortChanges
9
+ } from "../chunk-GG2RYE4R.js";
10
+ export {
11
+ CHANGE_KINDS,
12
+ SEVERITIES,
13
+ SEVERITY,
14
+ SEVERITY_RANK,
15
+ serversThatShippedNothing,
16
+ sortChanges
17
+ };
18
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,7 @@
1
+ export { CHANGE_KINDS, Change, ChangeKind, SEVERITIES, SEVERITY, SEVERITY_RANK, Severity, serversThatShippedNothing, sortChanges } from './changes.js';
2
+ export { ClientKind, JsonObject, JsonValue, LOCKFILE_VERSION, LockPolicy, LockedAnnotations, LockedBehavior, LockedHttpTransport, LockedIcon, LockedMcpServer, LockedMember, LockedPrompt, LockedPromptArgument, LockedProtocol, LockedResource, LockedResourceTemplate, LockedServerInfo, LockedSource, LockedStdioTransport, LockedSubject, LockedSubjectBase, LockedTool, LockedTransport, Lockfile, SUBJECT_KINDS, SubjectKind } from './lock/types.js';
3
+ export { MAX_DEPTH, canonicalize, digest, exceedsMaxDepth, stableKey, toJson } from './lock/canonical.js';
4
+ export { reseal } from './lock/reseal.js';
5
+ export { extractHeaderParams, isEscalation, normalizeSchema, resolveBehavior, sanitizeUrl, stripIgnoredMeta } from './lock/normalize.js';
6
+ export { diffLockfiles } from './diff/index.js';
7
+ export { classifySchemaChange } from './diff/schema.js';
package/dist/index.js ADDED
@@ -0,0 +1,65 @@
1
+ import {
2
+ reseal
3
+ } from "./chunk-DGEHI25T.js";
4
+ import {
5
+ LOCKFILE_VERSION,
6
+ SUBJECT_KINDS
7
+ } from "./chunk-3LIIW7B5.js";
8
+ import {
9
+ diffLockfiles
10
+ } from "./chunk-DZHB25AC.js";
11
+ import {
12
+ classifySchemaChange
13
+ } from "./chunk-42ZE5O5I.js";
14
+ import "./chunk-ALHOTOM6.js";
15
+ import {
16
+ CHANGE_KINDS,
17
+ SEVERITIES,
18
+ SEVERITY,
19
+ SEVERITY_RANK,
20
+ serversThatShippedNothing,
21
+ sortChanges
22
+ } from "./chunk-GG2RYE4R.js";
23
+ import {
24
+ MAX_DEPTH,
25
+ canonicalize,
26
+ digest,
27
+ exceedsMaxDepth,
28
+ stableKey,
29
+ toJson
30
+ } from "./chunk-HLTEHLNF.js";
31
+ import {
32
+ extractHeaderParams,
33
+ isEscalation,
34
+ normalizeSchema,
35
+ resolveBehavior,
36
+ sanitizeUrl,
37
+ stripIgnoredMeta
38
+ } from "./chunk-DL6LTPYY.js";
39
+ import "./chunk-SUY3NGZP.js";
40
+ export {
41
+ CHANGE_KINDS,
42
+ LOCKFILE_VERSION,
43
+ MAX_DEPTH,
44
+ SEVERITIES,
45
+ SEVERITY,
46
+ SEVERITY_RANK,
47
+ SUBJECT_KINDS,
48
+ canonicalize,
49
+ classifySchemaChange,
50
+ diffLockfiles,
51
+ digest,
52
+ exceedsMaxDepth,
53
+ extractHeaderParams,
54
+ isEscalation,
55
+ normalizeSchema,
56
+ reseal,
57
+ resolveBehavior,
58
+ sanitizeUrl,
59
+ serversThatShippedNothing,
60
+ sortChanges,
61
+ stableKey,
62
+ stripIgnoredMeta,
63
+ toJson
64
+ };
65
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,52 @@
1
+ import { JsonValue } from './types.js';
2
+
3
+ /**
4
+ * How deep a surface is allowed to be before we refuse to hash it.
5
+ *
6
+ * Both functions below walk their argument with ordinary recursion, and both are handed JSON
7
+ * that came from somewhere we do not control: a third-party MCP server answering the collector,
8
+ * or a reading posted to the control plane. V8 parses deeply nested JSON iteratively, so a body
9
+ * that nests further than the call stack reaches arrives intact and the overflow happens here.
10
+ * At 16 MB, the ingest allowance, that costs an attacker about a hundred kilobytes.
11
+ *
12
+ * Neither caller breaks when it happens -- the collector reports the server unreachable and the
13
+ * control plane answers 500 -- but both report a stack overflow, which describes our
14
+ * implementation rather than their input. A bound makes it a fact about the input, and a limit
15
+ * the caller can act on.
16
+ *
17
+ * A hundred is far above any real surface. A tool's input schema is JSON Schema, and the
18
+ * elaborate ones nest tens of levels, not hundreds.
19
+ */
20
+ declare const MAX_DEPTH = 100;
21
+ /**
22
+ * JCS sorts object members by the UTF-16 code units of their keys, which is exactly what
23
+ * `Array.prototype.sort` does by default. Numbers go through `JSON.stringify`, whose output
24
+ * for finite numbers is the ES6 Number-to-String the RFC requires.
25
+ */
26
+ declare function canonicalize(value: JsonValue, depth?: number): string;
27
+ /**
28
+ * Whether a value is too deep to hash, answered without recursing.
29
+ *
30
+ * Deliberately iterative: a guard against stack exhaustion that walks the value recursively
31
+ * exhausts the stack on exactly the input it exists to catch. An explicit stack moves the
32
+ * problem to the heap, where the body-size limit already bounds it.
33
+ *
34
+ * This is for request validation, so that a reading too deep to hash is refused at the edge
35
+ * with a message naming the field, rather than hashed and refused as an internal error.
36
+ */
37
+ declare function exceedsMaxDepth(value: unknown): boolean;
38
+ declare function digest(value: JsonValue): string;
39
+ /**
40
+ * Drops `undefined` members so that an absent optional field and a field explicitly set to
41
+ * `undefined` hash identically. Without this, building the same tool through two code paths could
42
+ * produce two digests for one capability.
43
+ */
44
+ declare function toJson(value: unknown, depth?: number): JsonValue;
45
+ /**
46
+ * Canonical form of a value that may carry `undefined` members -- an in-memory lock entry, say,
47
+ * where optional fields are present but unset. Comparing two of those directly is the common
48
+ * case in the diff engine, and it must agree with the digest of the same value.
49
+ */
50
+ declare function stableKey(value: unknown): string;
51
+
52
+ export { MAX_DEPTH, canonicalize, digest, exceedsMaxDepth, stableKey, toJson };
@@ -0,0 +1,17 @@
1
+ import {
2
+ MAX_DEPTH,
3
+ canonicalize,
4
+ digest,
5
+ exceedsMaxDepth,
6
+ stableKey,
7
+ toJson
8
+ } from "../chunk-HLTEHLNF.js";
9
+ export {
10
+ MAX_DEPTH,
11
+ canonicalize,
12
+ digest,
13
+ exceedsMaxDepth,
14
+ stableKey,
15
+ toJson
16
+ };
17
+ //# sourceMappingURL=canonical.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,39 @@
1
+ import { JsonObject, JsonValue } from './types.js';
2
+
3
+ /**
4
+ * Just enough JSON Schema to see through the indirection servers actually use.
5
+ *
6
+ * Two parts of this tool have to look inside a tool's `inputSchema`: the widening heuristic and
7
+ * the `x-mcp-header` scan. Both used to read only the literal node in front of them, so a schema
8
+ * that put its properties behind `$ref` or `allOf` -- which the generators for Pydantic, Zod and
9
+ * most OpenAPI toolchains do by default -- looked empty to both. A widened parameter went out as
10
+ * a bare `.changed`, and a parameter newly mirrored into an HTTP header was missed entirely.
11
+ *
12
+ * This is not a validator. It resolves local `$ref`, flattens `allOf`, and leaves the
13
+ * alternation keywords for the caller to branch on. Remote `$ref` is never fetched: an audit
14
+ * that reaches out to a URL named by the thing it is auditing is not an audit.
15
+ */
16
+
17
+ /** Depth caps. A hostile or merely recursive schema must not be able to hang the run. */
18
+ declare const MAX_REF_DEPTH = 32;
19
+ declare const MAX_VISIT_DEPTH = 12;
20
+ declare const MAX_FACTS = 5000;
21
+ declare function asObject(value: JsonValue | undefined): JsonObject | undefined;
22
+ /** Resolves a local JSON pointer. Anything with a non-empty URI part is left unresolved. */
23
+ declare function resolvePointer(root: JsonValue, ref: string): JsonValue | undefined;
24
+ /**
25
+ * The keywords in effect at a node, with `$ref` followed and `allOf` folded in.
26
+ *
27
+ * The node's own keywords win over anything it inherits, `properties` are unioned, and
28
+ * `required` is the union of every contributor -- which is what `allOf` means. Alternation
29
+ * (`anyOf` / `oneOf` / `then` / `else`) is deliberately left in place: a caller that wants to
30
+ * treat branches as separate possibilities can, and one that does not is no worse off.
31
+ */
32
+ declare function effectiveSchema(node: JsonValue | undefined, root: JsonValue, seenRefs?: ReadonlySet<string>, depth?: number): JsonObject | undefined;
33
+ /** The alternation branches at a node, labelled so a caller can key facts by them. */
34
+ declare function alternatives(object: JsonObject): Array<{
35
+ label: string;
36
+ schema: JsonValue;
37
+ }>;
38
+
39
+ export { MAX_FACTS, MAX_REF_DEPTH, MAX_VISIT_DEPTH, alternatives, asObject, effectiveSchema, resolvePointer };
@@ -0,0 +1,19 @@
1
+ import {
2
+ MAX_FACTS,
3
+ MAX_REF_DEPTH,
4
+ MAX_VISIT_DEPTH,
5
+ alternatives,
6
+ asObject,
7
+ effectiveSchema,
8
+ resolvePointer
9
+ } from "../chunk-SUY3NGZP.js";
10
+ export {
11
+ MAX_FACTS,
12
+ MAX_REF_DEPTH,
13
+ MAX_VISIT_DEPTH,
14
+ alternatives,
15
+ asObject,
16
+ effectiveSchema,
17
+ resolvePointer
18
+ };
19
+ //# sourceMappingURL=jsonschema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,44 @@
1
+ import { JsonValue, LockedBehavior, LockedAnnotations, JsonObject } from './types.js';
2
+
3
+ /**
4
+ * Resolves the four behavioural annotations against the spec's defaults, which are not neutral:
5
+ * an absent `readOnlyHint` means "may modify" and an absent `destructiveHint` means "may
6
+ * destroy". A server deleting an annotation is therefore an escalation, and the lock has to be
7
+ * able to show it as a changed value rather than a removed line. See docs/lockfile.md §4.
8
+ *
9
+ * `destructiveHint` and `idempotentHint` are defined to be meaningful only when `readOnlyHint`
10
+ * is false, so a read-only tool resolves to non-destructive and idempotent regardless of what
11
+ * it claims: a tool that changes nothing cannot destroy anything, and repeating it has no
12
+ * additional effect.
13
+ */
14
+ declare function resolveBehavior(annotations: LockedAnnotations | undefined): LockedBehavior;
15
+ /** True when `next` claims any power `previous` did not. */
16
+ declare function isEscalation(previous: LockedBehavior, next: LockedBehavior): boolean;
17
+ /**
18
+ * Sorts `required` arrays wherever they appear. Member order there is semantically
19
+ * insignificant and is the most common source of diffs that mean nothing. Every other array
20
+ * keeps server order, because order *is* significant in `prefixItems`, `allOf` and `icons`, and
21
+ * we only reorder where we can show it is safe.
22
+ *
23
+ * The rule is positional rather than schema-aware: a non-schema object with a string-array
24
+ * member literally named `required` would also be sorted. That costs nothing we can observe and
25
+ * avoids carrying a JSON Schema interpreter around.
26
+ */
27
+ declare function normalizeSchema(value: JsonValue): JsonValue;
28
+ /**
29
+ * Finds input properties carrying an `x-mcp-header` annotation, which mirrors the argument's
30
+ * value into an `Mcp-Param-*` HTTP header on Streamable HTTP, where proxies and WAFs can read
31
+ * it. A server adding this to an existing parameter redirects that argument's data with no
32
+ * visible change to the tool's signature, so it gets its own line in the lock.
33
+ *
34
+ * `$ref` and `allOf` are resolved first. Schema generators put properties behind `$defs` as a
35
+ * matter of course, and a scan that only read literal nodes found nothing in those -- which is
36
+ * the worst outcome for a field whose entire purpose is to move data somewhere new.
37
+ */
38
+ declare function extractHeaderParams(schema: JsonValue): string[];
39
+ /** Drops `_meta` keys under any ignored prefix. Returns undefined when nothing is left to pin. */
40
+ declare function stripIgnoredMeta(meta: JsonValue | undefined, ignoredPrefixes: readonly string[]): JsonObject | undefined;
41
+ /** Strips the query string: query strings routinely carry tokens, and the lock is committed. */
42
+ declare function sanitizeUrl(raw: string): string;
43
+
44
+ export { extractHeaderParams, isEscalation, normalizeSchema, resolveBehavior, sanitizeUrl, stripIgnoredMeta };
@@ -0,0 +1,18 @@
1
+ import {
2
+ extractHeaderParams,
3
+ isEscalation,
4
+ normalizeSchema,
5
+ resolveBehavior,
6
+ sanitizeUrl,
7
+ stripIgnoredMeta
8
+ } from "../chunk-DL6LTPYY.js";
9
+ import "../chunk-SUY3NGZP.js";
10
+ export {
11
+ extractHeaderParams,
12
+ isEscalation,
13
+ normalizeSchema,
14
+ resolveBehavior,
15
+ sanitizeUrl,
16
+ stripIgnoredMeta
17
+ };
18
+ //# sourceMappingURL=normalize.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,10 @@
1
+ import { LockedSubject } from './types.js';
2
+
3
+ /**
4
+ * Resealing dispatches on what the subject is. One branch today; a kind added without a branch
5
+ * here is a compile error rather than a surface that silently passes through unsealed, which
6
+ * is the failure that would matter most.
7
+ */
8
+ declare function reseal(entry: LockedSubject): LockedSubject;
9
+
10
+ export { reseal };
@@ -0,0 +1,8 @@
1
+ import {
2
+ reseal
3
+ } from "../chunk-DGEHI25T.js";
4
+ import "../chunk-HLTEHLNF.js";
5
+ export {
6
+ reseal
7
+ };
8
+ //# sourceMappingURL=reseal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,178 @@
1
+ /** The shape of `mcp.lock`. Mirrors schema/mcp.lock.schema.json, which is the published contract. */
2
+ /**
3
+ * Bumped to 2 when the root stopped naming a protocol.
4
+ *
5
+ * Version 1 keyed everything under `servers`, which made the format MCP's rather than the
6
+ * product's: an agent's grants, an OpenAPI surface or a token's scopes had nowhere to live
7
+ * without a second root key and a second diff path. Version 2 keys them all under `subjects`,
8
+ * each tagged with what it is.
9
+ *
10
+ * A version 1 file is upgraded on read rather than refused, and the upgrade is lossless:
11
+ * `kind` is not part of any digest (see `reseal.ts`, which covers an explicit field list), so
12
+ * an upgraded lock reseals to exactly the digests it arrived with and nobody sees drift that
13
+ * is really a format change.
14
+ */
15
+ declare const LOCKFILE_VERSION = 2;
16
+ type JsonValue = string | number | boolean | null | JsonValue[] | {
17
+ [key: string]: JsonValue;
18
+ };
19
+ type JsonObject = {
20
+ [key: string]: JsonValue;
21
+ };
22
+ interface Lockfile {
23
+ lockfileVersion: number;
24
+ generatedBy?: string;
25
+ policy?: LockPolicy;
26
+ /**
27
+ * Everything this project has pinned, keyed by identity. One map rather than a key per kind,
28
+ * so adding a kind is a new member of `LockedSubject` and not a new branch in every consumer.
29
+ */
30
+ subjects: Record<string, LockedSubject>;
31
+ }
32
+ /**
33
+ * What a pinned thing is.
34
+ *
35
+ * The list is short because only one reader exists. The point of naming it at all is that the
36
+ * diff engine, the policy evaluator and the audit log already do not care which one they are
37
+ * looking at, so the cost of the second is a reader and a vocabulary rather than a redesign.
38
+ */
39
+ declare const SUBJECT_KINDS: readonly ["mcp-server"];
40
+ type SubjectKind = (typeof SUBJECT_KINDS)[number];
41
+ interface LockPolicy {
42
+ /** Reverse-DNS `_meta` key prefixes to leave out, for servers that put build ids there. */
43
+ ignoreMetaPrefixes?: string[];
44
+ allowUnreachable?: boolean;
45
+ }
46
+ type ClientKind = "claude-code" | "claude-desktop" | "vscode" | "cursor" | "copilot" | "windsurf" | "generic" | "manual";
47
+ interface LockedSource {
48
+ client: ClientKind;
49
+ /** Repo-relative where possible, else with the home directory written as `~`. Never an absolute machine path. */
50
+ file: string;
51
+ scope?: "project" | "user" | "local";
52
+ }
53
+ interface LockedStdioTransport {
54
+ type: "stdio";
55
+ command: string;
56
+ args?: string[];
57
+ /** Names only. The lock is committed; the values are credentials. */
58
+ envKeys?: string[];
59
+ cwd?: string;
60
+ }
61
+ interface LockedHttpTransport {
62
+ type: "http" | "sse";
63
+ /** Query string removed: query strings routinely carry tokens. */
64
+ url: string;
65
+ headerKeys?: string[];
66
+ }
67
+ type LockedTransport = LockedStdioTransport | LockedHttpTransport;
68
+ interface LockedProtocol {
69
+ era: "modern" | "legacy";
70
+ version: string;
71
+ supportedVersions?: string[];
72
+ }
73
+ interface LockedServerInfo {
74
+ name?: string;
75
+ title?: string;
76
+ version?: string;
77
+ description?: string;
78
+ websiteUrl?: string;
79
+ }
80
+ interface LockedAnnotations {
81
+ title?: string;
82
+ readOnlyHint?: boolean;
83
+ destructiveHint?: boolean;
84
+ idempotentHint?: boolean;
85
+ openWorldHint?: boolean;
86
+ }
87
+ /** Annotations resolved against the spec's defaults. See docs/lockfile.md §4. */
88
+ interface LockedBehavior {
89
+ readOnly: boolean;
90
+ destructive: boolean;
91
+ idempotent: boolean;
92
+ openWorld: boolean;
93
+ }
94
+ interface LockedIcon {
95
+ src: string;
96
+ mimeType?: string;
97
+ sizes?: string[];
98
+ theme?: "light" | "dark";
99
+ }
100
+ interface LockedTool {
101
+ name: string;
102
+ title?: string;
103
+ description?: string;
104
+ inputSchema: JsonObject;
105
+ outputSchema?: JsonObject;
106
+ annotations?: LockedAnnotations;
107
+ behavior: LockedBehavior;
108
+ /** `propertyPath -> HeaderName`, sorted. Derived from `x-mcp-header`. */
109
+ headerParams?: string[];
110
+ icons?: LockedIcon[];
111
+ meta?: JsonObject;
112
+ digest: string;
113
+ }
114
+ interface LockedResource {
115
+ uri: string;
116
+ name: string;
117
+ title?: string;
118
+ description?: string;
119
+ mimeType?: string;
120
+ annotations?: JsonObject;
121
+ icons?: LockedIcon[];
122
+ meta?: JsonObject;
123
+ digest: string;
124
+ }
125
+ interface LockedResourceTemplate {
126
+ uriTemplate: string;
127
+ name: string;
128
+ title?: string;
129
+ description?: string;
130
+ mimeType?: string;
131
+ annotations?: JsonObject;
132
+ icons?: LockedIcon[];
133
+ meta?: JsonObject;
134
+ digest: string;
135
+ }
136
+ interface LockedPromptArgument {
137
+ name: string;
138
+ title?: string;
139
+ description?: string;
140
+ required?: boolean;
141
+ }
142
+ interface LockedPrompt {
143
+ name: string;
144
+ title?: string;
145
+ description?: string;
146
+ arguments?: LockedPromptArgument[];
147
+ icons?: LockedIcon[];
148
+ meta?: JsonObject;
149
+ digest: string;
150
+ }
151
+ /** What every pinned thing carries, whatever it is. */
152
+ interface LockedSubjectBase {
153
+ kind: SubjectKind;
154
+ source: LockedSource;
155
+ digest: string;
156
+ }
157
+ /** An MCP server's declared capability surface. The first subject kind, and so far the only one. */
158
+ interface LockedMcpServer extends LockedSubjectBase {
159
+ kind: "mcp-server";
160
+ transport: LockedTransport;
161
+ protocol: LockedProtocol;
162
+ serverInfo?: LockedServerInfo;
163
+ capabilities?: JsonObject;
164
+ instructions?: string;
165
+ tools?: LockedTool[];
166
+ resources?: LockedResource[];
167
+ resourceTemplates?: LockedResourceTemplate[];
168
+ prompts?: LockedPrompt[];
169
+ }
170
+ /**
171
+ * A union of one, deliberately. An agent's grants or an OpenAPI surface joins here, and every
172
+ * consumer that switches on `kind` gets a compiler error pointing at the branch it is missing.
173
+ */
174
+ type LockedSubject = LockedMcpServer;
175
+ /** Anything in the lock that carries its own digest and is matched by a stable key. */
176
+ type LockedMember = LockedTool | LockedResource | LockedResourceTemplate | LockedPrompt;
177
+
178
+ export { type ClientKind, type JsonObject, type JsonValue, LOCKFILE_VERSION, type LockPolicy, type LockedAnnotations, type LockedBehavior, type LockedHttpTransport, type LockedIcon, type LockedMcpServer, type LockedMember, type LockedPrompt, type LockedPromptArgument, type LockedProtocol, type LockedResource, type LockedResourceTemplate, type LockedServerInfo, type LockedSource, type LockedStdioTransport, type LockedSubject, type LockedSubjectBase, type LockedTool, type LockedTransport, type Lockfile, SUBJECT_KINDS, type SubjectKind };
@@ -0,0 +1,9 @@
1
+ import {
2
+ LOCKFILE_VERSION,
3
+ SUBJECT_KINDS
4
+ } from "../chunk-3LIIW7B5.js";
5
+ export {
6
+ LOCKFILE_VERSION,
7
+ SUBJECT_KINDS
8
+ };
9
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
package/package.json ADDED
@@ -0,0 +1,60 @@
1
+ {
2
+ "name": "@nulladrift/core",
3
+ "version": "0.1.0-rc.0",
4
+ "type": "module",
5
+ "description": "The lockfile model and the drift engine, shared by the collector and the control plane.",
6
+ "exports": {
7
+ ".": {
8
+ "types": "./dist/index.d.ts",
9
+ "import": "./dist/index.js"
10
+ },
11
+ "./*": {
12
+ "types": "./dist/*.d.ts",
13
+ "import": "./dist/*.js"
14
+ }
15
+ },
16
+ "devDependencies": {
17
+ "@eslint/js": "^9.32.0",
18
+ "@types/node": "^24.19.2",
19
+ "eslint": "^9.32.0",
20
+ "globals": "^15.15.0",
21
+ "typescript": "^5.9.3",
22
+ "typescript-eslint": "^8.72.0",
23
+ "vitest": "^4.1.12",
24
+ "tsup": "^8.5.1"
25
+ },
26
+ "license": "MIT",
27
+ "files": [
28
+ "dist",
29
+ "README.md",
30
+ "LICENSE"
31
+ ],
32
+ "publishConfig": {
33
+ "access": "public"
34
+ },
35
+ "engines": {
36
+ "node": ">=22"
37
+ },
38
+ "repository": {
39
+ "type": "git",
40
+ "url": "git+https://github.com/Nulladrift/nulladrift.git",
41
+ "directory": "packages/core"
42
+ },
43
+ "homepage": "https://github.com/Nulladrift/nulladrift#readme",
44
+ "bugs": {
45
+ "url": "https://github.com/Nulladrift/nulladrift/issues"
46
+ },
47
+ "keywords": [
48
+ "mcp",
49
+ "model-context-protocol",
50
+ "lockfile",
51
+ "drift",
52
+ "security"
53
+ ],
54
+ "scripts": {
55
+ "typecheck": "tsc -p tsconfig.json",
56
+ "test": "vitest run",
57
+ "lint": "eslint .",
58
+ "build": "tsup"
59
+ }
60
+ }