@capaxle/adapter-mcp 0.1.0-alpha.1
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/LICENSE +202 -0
- package/README.md +5 -0
- package/dist/host.d.ts +20 -0
- package/dist/host.d.ts.map +1 -0
- package/dist/host.js +173 -0
- package/dist/host.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/manifest.d.ts +117 -0
- package/dist/manifest.d.ts.map +1 -0
- package/dist/manifest.js +349 -0
- package/dist/manifest.js.map +1 -0
- package/dist/mcp.d.ts +167 -0
- package/dist/mcp.d.ts.map +1 -0
- package/dist/mcp.js +445 -0
- package/dist/mcp.js.map +1 -0
- package/dist/schema.d.ts +7 -0
- package/dist/schema.d.ts.map +1 -0
- package/dist/schema.js +212 -0
- package/dist/schema.js.map +1 -0
- package/dist/shared.d.ts +42 -0
- package/dist/shared.d.ts.map +1 -0
- package/dist/shared.js +209 -0
- package/dist/shared.js.map +1 -0
- package/package.json +33 -0
package/dist/schema.js
ADDED
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import { Buffer } from "node:buffer";
|
|
2
|
+
import { jcs } from "@capaxle/ir";
|
|
3
|
+
import { cloneJson, compareText, ProjectionError } from "./shared.js";
|
|
4
|
+
const objectSchema = (value) => value !== null && typeof value === "object" && !Array.isArray(value)
|
|
5
|
+
? value
|
|
6
|
+
: null;
|
|
7
|
+
const unpointer = (value) => value.replaceAll("~1", "/").replaceAll("~0", "~");
|
|
8
|
+
const pointerToken = (ref, prefix) => {
|
|
9
|
+
if (typeof ref !== "string" || !ref.startsWith(prefix))
|
|
10
|
+
return null;
|
|
11
|
+
const token = ref.slice(prefix.length);
|
|
12
|
+
return token.length > 0 && !token.includes("/") ? unpointer(token) : null;
|
|
13
|
+
};
|
|
14
|
+
const encoded = (value) => Buffer.from(value).toString("base64url");
|
|
15
|
+
const sharedKey = (name) => `CapabilitySharedEncoded.${encoded(name)}`;
|
|
16
|
+
const localKey = (owner, name) => `CapabilityLocal.${encoded(owner)}.${encoded(name)}`;
|
|
17
|
+
const defineData = (object, key, value) => {
|
|
18
|
+
Object.defineProperty(object, key, {
|
|
19
|
+
value,
|
|
20
|
+
enumerable: true,
|
|
21
|
+
configurable: true,
|
|
22
|
+
writable: true,
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
function schemaValue(value) {
|
|
26
|
+
const record = objectSchema(value);
|
|
27
|
+
const inline = objectSchema(record?.schema);
|
|
28
|
+
return inline ?? record ?? {};
|
|
29
|
+
}
|
|
30
|
+
function createProjector(sharedSchemas) {
|
|
31
|
+
const definitions = new Map();
|
|
32
|
+
const signatures = new Map();
|
|
33
|
+
const states = new Set();
|
|
34
|
+
const ensure = (key, source, owner) => {
|
|
35
|
+
const signature = jcs(source);
|
|
36
|
+
if (signatures.has(key) && signatures.get(key) !== signature)
|
|
37
|
+
throw new ProjectionError("CAP_MCP_SCHEMA_UNREPRESENTABLE", {
|
|
38
|
+
reason: "generated_key_collision",
|
|
39
|
+
});
|
|
40
|
+
if (states.has(key))
|
|
41
|
+
return;
|
|
42
|
+
signatures.set(key, signature);
|
|
43
|
+
states.add(key);
|
|
44
|
+
definitions.set(key, rewrite(source, owner, source === owner.root));
|
|
45
|
+
};
|
|
46
|
+
const reference = (ref, owner) => {
|
|
47
|
+
const sharedName = pointerToken(ref, "#/schemas/");
|
|
48
|
+
if (sharedName !== null) {
|
|
49
|
+
const root = objectSchema(sharedSchemas[sharedName]);
|
|
50
|
+
if (!root)
|
|
51
|
+
throw new ProjectionError("CAP_MCP_SCHEMA_UNREPRESENTABLE", {
|
|
52
|
+
reason: "unresolved_shared_reference",
|
|
53
|
+
reference: String(ref),
|
|
54
|
+
});
|
|
55
|
+
const key = sharedKey(sharedName);
|
|
56
|
+
ensure(key, root, { key: `shared\0${sharedName}`, root });
|
|
57
|
+
return `#/$defs/${key}`;
|
|
58
|
+
}
|
|
59
|
+
const localName = pointerToken(ref, "#/$defs/");
|
|
60
|
+
const localDefinitions = objectSchema(owner.root.$defs);
|
|
61
|
+
const source = localName === null ? null : objectSchema(localDefinitions?.[localName]);
|
|
62
|
+
if (localName === null || !source)
|
|
63
|
+
throw new ProjectionError("CAP_MCP_SCHEMA_UNREPRESENTABLE", {
|
|
64
|
+
reason: "unsupported_or_unresolved_reference",
|
|
65
|
+
reference: String(ref),
|
|
66
|
+
});
|
|
67
|
+
const key = localKey(owner.key, localName);
|
|
68
|
+
ensure(key, source, owner);
|
|
69
|
+
return `#/$defs/${key}`;
|
|
70
|
+
};
|
|
71
|
+
const rewrite = (value, owner, omitOwnerDefinitions = false) => {
|
|
72
|
+
const output = {};
|
|
73
|
+
for (const key of Object.keys(value).sort(compareText)) {
|
|
74
|
+
const child = value[key];
|
|
75
|
+
if (omitOwnerDefinitions && key === "$defs")
|
|
76
|
+
continue;
|
|
77
|
+
if (key === "$ref")
|
|
78
|
+
output[key] = reference(child, owner);
|
|
79
|
+
else if (key === "$defs" || key === "properties") {
|
|
80
|
+
const source = objectSchema(child);
|
|
81
|
+
if (!source)
|
|
82
|
+
throw new ProjectionError("CAP_MCP_SCHEMA_UNREPRESENTABLE");
|
|
83
|
+
const mapped = {};
|
|
84
|
+
for (const name of Object.keys(source).sort(compareText)) {
|
|
85
|
+
const schema = objectSchema(source[name]);
|
|
86
|
+
if (!schema)
|
|
87
|
+
throw new ProjectionError("CAP_MCP_SCHEMA_UNREPRESENTABLE");
|
|
88
|
+
defineData(mapped, name, rewrite(schema, owner));
|
|
89
|
+
}
|
|
90
|
+
defineData(output, key, mapped);
|
|
91
|
+
}
|
|
92
|
+
else if (key === "items") {
|
|
93
|
+
const schema = objectSchema(child);
|
|
94
|
+
if (!schema)
|
|
95
|
+
throw new ProjectionError("CAP_MCP_SCHEMA_UNREPRESENTABLE");
|
|
96
|
+
output[key] = rewrite(schema, owner);
|
|
97
|
+
}
|
|
98
|
+
else if (key === "oneOf") {
|
|
99
|
+
if (!Array.isArray(child))
|
|
100
|
+
throw new ProjectionError("CAP_MCP_SCHEMA_UNREPRESENTABLE");
|
|
101
|
+
output[key] = child.map((branch) => {
|
|
102
|
+
const schema = objectSchema(branch);
|
|
103
|
+
if (!schema)
|
|
104
|
+
throw new ProjectionError("CAP_MCP_SCHEMA_UNREPRESENTABLE");
|
|
105
|
+
return rewrite(schema, owner);
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
else
|
|
109
|
+
output[key] = cloneJson(child);
|
|
110
|
+
}
|
|
111
|
+
return output;
|
|
112
|
+
};
|
|
113
|
+
return {
|
|
114
|
+
project(schema, ownerKey) {
|
|
115
|
+
return rewrite(schema, { key: ownerKey, root: schema }, true);
|
|
116
|
+
},
|
|
117
|
+
finish(root, requireObject = false) {
|
|
118
|
+
const output = {
|
|
119
|
+
...root,
|
|
120
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
121
|
+
};
|
|
122
|
+
if (requireObject)
|
|
123
|
+
output.type = "object";
|
|
124
|
+
if (definitions.size > 0) {
|
|
125
|
+
const defs = {};
|
|
126
|
+
for (const key of [...definitions.keys()].sort(compareText))
|
|
127
|
+
defineData(defs, key, definitions.get(key));
|
|
128
|
+
output.$defs = defs;
|
|
129
|
+
}
|
|
130
|
+
return output;
|
|
131
|
+
},
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
export function projectInputSchema(document, capability) {
|
|
135
|
+
const projector = createProjector(document.schemas);
|
|
136
|
+
const schema = schemaValue(capability.input);
|
|
137
|
+
return projector.finish(projector.project(schema, `inline\0${capability.id}\0${capability.version}\0input`), true);
|
|
138
|
+
}
|
|
139
|
+
const STATUSES = [
|
|
140
|
+
"invalid_argument",
|
|
141
|
+
"unauthenticated",
|
|
142
|
+
"permission_denied",
|
|
143
|
+
"not_found",
|
|
144
|
+
"already_exists",
|
|
145
|
+
"failed_precondition",
|
|
146
|
+
"conflict",
|
|
147
|
+
"resource_exhausted",
|
|
148
|
+
"cancelled",
|
|
149
|
+
"deadline_exceeded",
|
|
150
|
+
"unavailable",
|
|
151
|
+
"internal",
|
|
152
|
+
];
|
|
153
|
+
export function projectOutputSchema(document, capability) {
|
|
154
|
+
const projector = createProjector(document.schemas);
|
|
155
|
+
const output = projector.project(schemaValue(capability.output), `inline\0${capability.id}\0${capability.version}\0output`);
|
|
156
|
+
const declared = [];
|
|
157
|
+
for (const code of Object.keys(capability.errors).sort(compareText)) {
|
|
158
|
+
const definition = capability.errors[code];
|
|
159
|
+
const properties = {
|
|
160
|
+
code: { const: code },
|
|
161
|
+
correlationId: { type: "string" },
|
|
162
|
+
message: { type: "string" },
|
|
163
|
+
retryable: { const: definition.retryable },
|
|
164
|
+
status: { const: definition.status },
|
|
165
|
+
};
|
|
166
|
+
if (definition.details)
|
|
167
|
+
properties.details = projector.project(schemaValue(definition.details), `inline\0${capability.id}\0${capability.version}\0error:${code}`);
|
|
168
|
+
declared.push({
|
|
169
|
+
type: "object",
|
|
170
|
+
additionalProperties: false,
|
|
171
|
+
required: ["code", "correlationId", "message", "retryable", "status"],
|
|
172
|
+
properties,
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
const framework = {
|
|
176
|
+
type: "object",
|
|
177
|
+
additionalProperties: false,
|
|
178
|
+
required: ["code", "correlationId", "message", "retryable", "status"],
|
|
179
|
+
properties: {
|
|
180
|
+
code: { type: "string", pattern: "^CAP_" },
|
|
181
|
+
correlationId: { type: "string" },
|
|
182
|
+
details: {},
|
|
183
|
+
message: { type: "string" },
|
|
184
|
+
retryable: { type: "boolean" },
|
|
185
|
+
status: { enum: STATUSES },
|
|
186
|
+
},
|
|
187
|
+
};
|
|
188
|
+
return projector.finish({
|
|
189
|
+
oneOf: [
|
|
190
|
+
{
|
|
191
|
+
type: "object",
|
|
192
|
+
additionalProperties: false,
|
|
193
|
+
required: ["correlationId", "ok", "value"],
|
|
194
|
+
properties: {
|
|
195
|
+
correlationId: { type: "string" },
|
|
196
|
+
ok: { const: true },
|
|
197
|
+
value: output,
|
|
198
|
+
},
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
type: "object",
|
|
202
|
+
additionalProperties: false,
|
|
203
|
+
required: ["error", "ok"],
|
|
204
|
+
properties: {
|
|
205
|
+
error: { oneOf: [...declared, framework] },
|
|
206
|
+
ok: { const: false },
|
|
207
|
+
},
|
|
208
|
+
},
|
|
209
|
+
],
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAGlC,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAMtE,MAAM,YAAY,GAAG,CAAC,KAAc,EAAuB,EAAE,CAC3D,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;IAClE,CAAC,CAAE,KAAsB;IACzB,CAAC,CAAC,IAAI,CAAC;AAEX,MAAM,SAAS,GAAG,CAAC,KAAa,EAAE,EAAE,CAClC,KAAK,CAAC,UAAU,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,UAAU,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;AACpD,MAAM,YAAY,GAAG,CAAC,GAAY,EAAE,MAAc,EAAiB,EAAE;IACnE,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC;QAAE,OAAO,IAAI,CAAC;IACpE,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACvC,OAAO,KAAK,CAAC,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AE,SAAS,CAAC,EAAE;oBAC1C,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE;iBACrB;aACF;SACF;KACF,CAAC,CAAC;AACL,CAAC"}
|
package/dist/shared.d.ts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { JsonValue } from "@capaxle/ir";
|
|
2
|
+
import type { RuntimeDocument } from "@capaxle/runtime";
|
|
3
|
+
export declare const MCP_TARGET: "mcp@2026-07-28/streamable-http/tools-unary-v2";
|
|
4
|
+
export declare const MCP_PROTOCOL_VERSION: "2026-07-28";
|
|
5
|
+
export declare const MCP_PROFILE_VERSION: "0.2";
|
|
6
|
+
export declare const MCP_INVOCATION_META: "com.capaxle/invocation";
|
|
7
|
+
export declare const MCP_TOOL_META: "com.capaxle/tool";
|
|
8
|
+
export declare const LEGACY_MCP_INVOCATION_META: "io.github.trevor-gibby.capabuild/invocation";
|
|
9
|
+
export declare const GENERATOR_NAME: "@capaxle/adapter-mcp";
|
|
10
|
+
export declare const GENERATOR_VERSION: "0.1.0-alpha.1";
|
|
11
|
+
export type JsonObject = {
|
|
12
|
+
[key: string]: JsonValue;
|
|
13
|
+
};
|
|
14
|
+
export declare const dataObject: (value: unknown) => value is Record<string, unknown>;
|
|
15
|
+
export declare function compareText(left: string, right: string): number;
|
|
16
|
+
export declare function cloneJson<T extends JsonValue>(value: T): T;
|
|
17
|
+
/** Copy only inert JSON own-data; never execute accessors or inherited hooks. */
|
|
18
|
+
export declare function copyJsonData(value: unknown, seen?: Set<object>): JsonValue;
|
|
19
|
+
export declare function canonicalBytes(value: JsonValue): Uint8Array;
|
|
20
|
+
export declare function verifyDocumentHash(document: RuntimeDocument, irHash: unknown): asserts irHash is `sha256:${string}`;
|
|
21
|
+
export declare function verifyCliBinary(value: unknown): asserts value is string;
|
|
22
|
+
export declare class ProjectionError extends Error {
|
|
23
|
+
readonly code: `CAP_${string}`;
|
|
24
|
+
readonly details: JsonValue;
|
|
25
|
+
constructor(code: `CAP_${string}`, details?: JsonValue);
|
|
26
|
+
}
|
|
27
|
+
export declare function deepFreeze<T>(value: T): T;
|
|
28
|
+
export interface DiscoveryContext {
|
|
29
|
+
readonly http: {
|
|
30
|
+
readonly collection: string;
|
|
31
|
+
readonly detailTemplate: string;
|
|
32
|
+
readonly schemaTemplate: string;
|
|
33
|
+
};
|
|
34
|
+
readonly mcp: {
|
|
35
|
+
readonly endpoint: string;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
export declare const DEFAULT_DISCOVERY_CONTEXT: DiscoveryContext;
|
|
39
|
+
export declare function validateDiscoveryContext(value: unknown): DiscoveryContext;
|
|
40
|
+
export declare function equalDiscoveryContext(left: DiscoveryContext, right: DiscoveryContext): boolean;
|
|
41
|
+
export declare function resolvedDiscoveryContext(resolved: unknown, assertion?: unknown): DiscoveryContext;
|
|
42
|
+
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../src/shared.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAExD,eAAO,MAAM,UAAU,EACrB,+CAAwD,CAAC;AAC3D,eAAO,MAAM,oBAAoB,EAAG,YAAqB,CAAC;AAC1D,eAAO,MAAM,mBAAmB,EAAG,KAAc,CAAC;AAClD,eAAO,MAAM,mBAAmB,EAAG,wBAAiC,CAAC;AACrE,eAAO,MAAM,aAAa,EAAG,kBAA2B,CAAC;AACzD,eAAO,MAAM,0BAA0B,EACrC,6CAAsD,CAAC;AACzD,eAAO,MAAM,cAAc,EAAG,sBAA+B,CAAC;AAC9D,eAAO,MAAM,iBAAiB,EAAG,eAAwB,CAAC;AAK1D,MAAM,MAAM,UAAU,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAC;AAEtD,e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AyB,EAAE,gBAOtC,CAAC;AAqCH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,OAAO,GAAG,gBAAgB,CAoCzE;AAED,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,gBAAgB,EACtB,KAAK,EAAE,gBAAgB,GACtB,OAAO,CAOT;AAED,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,OAAO,EACjB,SAAS,CAAC,EAAE,OAAO,GAClB,gBAAgB,CAQlB"}
|
package/dist/shared.js
ADDED
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import { capabilitySemanticHash, jcs } from "@capaxle/ir";
|
|
2
|
+
export const MCP_TARGET = "mcp@2026-07-28/streamable-http/tools-unary-v2";
|
|
3
|
+
export const MCP_PROTOCOL_VERSION = "2026-07-28";
|
|
4
|
+
export const MCP_PROFILE_VERSION = "0.2";
|
|
5
|
+
export const MCP_INVOCATION_META = "com.capaxle/invocation";
|
|
6
|
+
export const MCP_TOOL_META = "com.capaxle/tool";
|
|
7
|
+
export const LEGACY_MCP_INVOCATION_META = "io.github.trevor-gibby.capabuild/invocation";
|
|
8
|
+
export const GENERATOR_NAME = "@capaxle/adapter-mcp";
|
|
9
|
+
export const GENERATOR_VERSION = "0.1.0-alpha.1";
|
|
10
|
+
const IR_HASH = /^sha256:[0-9a-f]{64}$/;
|
|
11
|
+
const CLI_BINARY = /^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/;
|
|
12
|
+
export const dataObject = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
|
|
13
|
+
export function compareText(left, right) {
|
|
14
|
+
const a = Array.from(left);
|
|
15
|
+
const b = Array.from(right);
|
|
16
|
+
const length = Math.min(a.length, b.length);
|
|
17
|
+
for (let index = 0; index < length; index += 1) {
|
|
18
|
+
const difference = a[index].codePointAt(0) - b[index].codePointAt(0);
|
|
19
|
+
if (difference !== 0)
|
|
20
|
+
return difference;
|
|
21
|
+
}
|
|
22
|
+
return a.length - b.length;
|
|
23
|
+
}
|
|
24
|
+
export function cloneJson(value) {
|
|
25
|
+
return JSON.parse(JSON.stringify(value));
|
|
26
|
+
}
|
|
27
|
+
/** Copy only inert JSON own-data; never execute accessors or inherited hooks. */
|
|
28
|
+
export function copyJsonData(value, seen = new Set()) {
|
|
29
|
+
if (value === null || typeof value === "string" || typeof value === "boolean")
|
|
30
|
+
return value;
|
|
31
|
+
if (typeof value === "number" && Number.isFinite(value))
|
|
32
|
+
return value;
|
|
33
|
+
if (typeof value !== "object" || seen.has(value))
|
|
34
|
+
throw new ProjectionError("CAP_INPUT_INVALID", {
|
|
35
|
+
reason: "non_json_input",
|
|
36
|
+
});
|
|
37
|
+
seen.add(value);
|
|
38
|
+
let descriptors;
|
|
39
|
+
try {
|
|
40
|
+
descriptors = Object.getOwnPropertyDescriptors(value);
|
|
41
|
+
}
|
|
42
|
+
catch {
|
|
43
|
+
throw new ProjectionError("CAP_INPUT_INVALID", {
|
|
44
|
+
reason: "non_json_input",
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
if (Object.getOwnPropertySymbols(value).length > 0)
|
|
48
|
+
throw new ProjectionError("CAP_INPUT_INVALID", {
|
|
49
|
+
reason: "non_json_input",
|
|
50
|
+
});
|
|
51
|
+
if (Array.isArray(value)) {
|
|
52
|
+
const output = [];
|
|
53
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
54
|
+
const descriptor = descriptors[String(index)];
|
|
55
|
+
if (!descriptor || !("value" in descriptor))
|
|
56
|
+
throw new ProjectionError("CAP_INPUT_INVALID", {
|
|
57
|
+
reason: "non_json_input",
|
|
58
|
+
});
|
|
59
|
+
output.push(copyJsonData(descriptor.value, seen));
|
|
60
|
+
}
|
|
61
|
+
seen.delete(value);
|
|
62
|
+
return output;
|
|
63
|
+
}
|
|
64
|
+
const prototype = Object.getPrototypeOf(value);
|
|
65
|
+
if (prototype !== Object.prototype && prototype !== null)
|
|
66
|
+
throw new ProjectionError("CAP_INPUT_INVALID", {
|
|
67
|
+
reason: "non_json_input",
|
|
68
|
+
});
|
|
69
|
+
const output = {};
|
|
70
|
+
for (const key of Object.keys(descriptors).sort(compareText)) {
|
|
71
|
+
const descriptor = descriptors[key];
|
|
72
|
+
if (!("value" in descriptor) || !descriptor.enumerable)
|
|
73
|
+
throw new ProjectionError("CAP_INPUT_INVALID", {
|
|
74
|
+
reason: "non_json_input",
|
|
75
|
+
});
|
|
76
|
+
Object.defineProperty(output, key, {
|
|
77
|
+
value: copyJsonData(descriptor.value, seen),
|
|
78
|
+
enumerable: true,
|
|
79
|
+
configurable: true,
|
|
80
|
+
writable: true,
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
seen.delete(value);
|
|
84
|
+
return output;
|
|
85
|
+
}
|
|
86
|
+
export function canonicalBytes(value) {
|
|
87
|
+
return new TextEncoder().encode(jcs(value));
|
|
88
|
+
}
|
|
89
|
+
export function verifyDocumentHash(document, irHash) {
|
|
90
|
+
if (typeof irHash !== "string" || !IR_HASH.test(irHash))
|
|
91
|
+
throw new ProjectionError("CAP_BUILD_CONTEXT_INVALID", {
|
|
92
|
+
path: "/buildContext/irHash",
|
|
93
|
+
reason: irHash === undefined ? "missing" : "format",
|
|
94
|
+
});
|
|
95
|
+
let computed = null;
|
|
96
|
+
try {
|
|
97
|
+
computed = capabilitySemanticHash(document);
|
|
98
|
+
}
|
|
99
|
+
catch {
|
|
100
|
+
// A non-canonical or invalid document cannot establish build authority.
|
|
101
|
+
}
|
|
102
|
+
if (computed !== irHash)
|
|
103
|
+
throw new ProjectionError("CAP_BUILD_CONTEXT_INVALID", {
|
|
104
|
+
path: "/buildContext/irHash",
|
|
105
|
+
reason: "mismatch",
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
export function verifyCliBinary(value) {
|
|
109
|
+
if (typeof value !== "string" || !CLI_BINARY.test(value))
|
|
110
|
+
throw new ProjectionError("CAP_BUILD_CONTEXT_INVALID", {
|
|
111
|
+
path: "/buildContext/cliBinary",
|
|
112
|
+
reason: value === undefined ? "missing" : "format",
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
export class ProjectionError extends Error {
|
|
116
|
+
code;
|
|
117
|
+
details;
|
|
118
|
+
constructor(code, details = {}) {
|
|
119
|
+
super(code);
|
|
120
|
+
this.name = "ProjectionError";
|
|
121
|
+
this.code = code;
|
|
122
|
+
this.details = details;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
export function deepFreeze(value) {
|
|
126
|
+
if (value !== null && typeof value === "object") {
|
|
127
|
+
for (const child of Object.values(value))
|
|
128
|
+
deepFreeze(child);
|
|
129
|
+
Object.freeze(value);
|
|
130
|
+
}
|
|
131
|
+
return value;
|
|
132
|
+
}
|
|
133
|
+
export const DEFAULT_DISCOVERY_CONTEXT = deepFreeze({
|
|
134
|
+
http: {
|
|
135
|
+
collection: "/.well-known/capabilities",
|
|
136
|
+
detailTemplate: "/.well-known/capabilities/{id}",
|
|
137
|
+
schemaTemplate: "/.well-known/capabilities/{id}/schema",
|
|
138
|
+
},
|
|
139
|
+
mcp: { endpoint: "/mcp" },
|
|
140
|
+
});
|
|
141
|
+
function validPath(value, template) {
|
|
142
|
+
if (!value.startsWith("/") ||
|
|
143
|
+
value.startsWith("//") ||
|
|
144
|
+
/[\u0000-\u0020\u007f-\u009f]/.test(value) ||
|
|
145
|
+
/[?#\\\0]/.test(value) ||
|
|
146
|
+
value
|
|
147
|
+
.split("/")
|
|
148
|
+
.slice(1)
|
|
149
|
+
.some((part) => part === "" || part === "." || part === "..") ||
|
|
150
|
+
/%(?![0-9A-F]{2})/.test(value) ||
|
|
151
|
+
/%(?:2D|2E|30|31|32|33|34|35|36|37|38|39|41|42|43|44|45|46|47|48|49|4A|4B|4C|4D|4E|4F|50|51|52|53|54|55|56|57|58|59|5A|5F|61|62|63|64|65|66|67|68|69|6A|6B|6C|6D|6E|6F|70|71|72|73|74|75|76|77|78|79|7A|7E)/.test(value))
|
|
152
|
+
return false;
|
|
153
|
+
const tokens = value.split("/").filter((part) => part === "{id}").length;
|
|
154
|
+
const remaining = value.replaceAll("{id}", "");
|
|
155
|
+
return template
|
|
156
|
+
? tokens === 1 && !/[{}]/.test(remaining)
|
|
157
|
+
: tokens === 0 && !/[{}]/.test(value);
|
|
158
|
+
}
|
|
159
|
+
function pathsOverlap(left, right) {
|
|
160
|
+
const a = left.split("/");
|
|
161
|
+
const b = right.split("/");
|
|
162
|
+
return (a.length === b.length &&
|
|
163
|
+
a.every((segment, index) => segment === b[index] || segment === "{id}" || b[index] === "{id}"));
|
|
164
|
+
}
|
|
165
|
+
export function validateDiscoveryContext(value) {
|
|
166
|
+
if (!dataObject(value) ||
|
|
167
|
+
Object.keys(value).some((key) => key !== "http" && key !== "mcp"))
|
|
168
|
+
throw new ProjectionError("CAP_DISCOVERY_CONTEXT_MISMATCH");
|
|
169
|
+
const http = value.http;
|
|
170
|
+
const mcp = value.mcp;
|
|
171
|
+
if (!dataObject(http) || !dataObject(mcp))
|
|
172
|
+
throw new ProjectionError("CAP_DISCOVERY_CONTEXT_MISMATCH");
|
|
173
|
+
if (Object.keys(http).sort().join("\0") !==
|
|
174
|
+
["collection", "detailTemplate", "schemaTemplate"].sort().join("\0") ||
|
|
175
|
+
Object.keys(mcp).join("\0") !== "endpoint")
|
|
176
|
+
throw new ProjectionError("CAP_DISCOVERY_CONTEXT_MISMATCH");
|
|
177
|
+
const { collection, detailTemplate, schemaTemplate } = http;
|
|
178
|
+
const { endpoint } = mcp;
|
|
179
|
+
if (typeof collection !== "string" ||
|
|
180
|
+
typeof detailTemplate !== "string" ||
|
|
181
|
+
typeof schemaTemplate !== "string" ||
|
|
182
|
+
typeof endpoint !== "string" ||
|
|
183
|
+
!validPath(collection, false) ||
|
|
184
|
+
!validPath(detailTemplate, true) ||
|
|
185
|
+
!validPath(schemaTemplate, true) ||
|
|
186
|
+
!validPath(endpoint, false) ||
|
|
187
|
+
pathsOverlap(collection, detailTemplate) ||
|
|
188
|
+
pathsOverlap(collection, schemaTemplate) ||
|
|
189
|
+
pathsOverlap(detailTemplate, schemaTemplate))
|
|
190
|
+
throw new ProjectionError("CAP_DISCOVERY_CONTEXT_MISMATCH");
|
|
191
|
+
return deepFreeze({
|
|
192
|
+
http: { collection, detailTemplate, schemaTemplate },
|
|
193
|
+
mcp: { endpoint },
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
export function equalDiscoveryContext(left, right) {
|
|
197
|
+
return (left.http.collection === right.http.collection &&
|
|
198
|
+
left.http.detailTemplate === right.http.detailTemplate &&
|
|
199
|
+
left.http.schemaTemplate === right.http.schemaTemplate &&
|
|
200
|
+
left.mcp.endpoint === right.mcp.endpoint);
|
|
201
|
+
}
|
|
202
|
+
export function resolvedDiscoveryContext(resolved, assertion) {
|
|
203
|
+
const context = validateDiscoveryContext(resolved);
|
|
204
|
+
if (assertion !== undefined &&
|
|
205
|
+
!equalDiscoveryContext(context, validateDiscoveryContext(assertion)))
|
|
206
|
+
throw new ProjectionError("CAP_DISCOVERY_CONTEXT_MISMATCH");
|
|
207
|
+
return context;
|
|
208
|
+
}
|
|
209
|
+
//# sourceMappingURL=shared.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../src/shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAI1D,MAAM,CAAC,MAAM,UAAU,GACrB,+CAAwD,CAAC;AAC3D,MAAM,CAAC,MAAM,oBAAoB,GAAG,YAAqB,CAAC;AAC1D,MAAM,CAAC,MAAM,mBAAmB,GAAG,KAAc,CAAC;AAClD,MAAM,CAAC,MAAM,mBAAmB,GAAG,wBAAiC,CAAC;AACrE,MAAM,CAAC,MAAM,aAAa,GAAG,kBAA2B,CAAC;AACzD,MAAM,CAAC,MAAM,0BAA0B,GACrC,6CAAsD,CAAC;AACzD,MAAM,CAAC,MAAM,cAAc,GAAG,sBAA+B,CAAC;AAC9D,MAAM,CAAC,MAAM,iBAAi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CAAC,cAAc;QACtD,IAAI,CAAC,IAAI,CAAC,cAAc,KAAK,KAAK,CAAC,IAAI,CAAC,cAAc;QACtD,IAAI,CAAC,GAAG,CAAC,QAAQ,KAAK,KAAK,CAAC,GAAG,CAAC,QAAQ,CACzC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,wBAAwB,CACtC,QAAiB,EACjB,SAAmB;IAEnB,MAAM,OAAO,GAAG,wBAAwB,CAAC,QAAQ,CAAC,CAAC;IACnD,IACE,SAAS,KAAK,SAAS;QACvB,CAAC,qBAAqB,CAAC,OAAO,EAAE,wBAAwB,CAAC,SAAS,CAAC,CAAC;QAEpE,MAAM,IAAI,eAAe,CAAC,gCAAgC,CAAC,CAAC;IAC9D,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@capaxle/adapter-mcp",
|
|
3
|
+
"version": "0.1.0-alpha.1",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"engines": {
|
|
6
|
+
"node": "^22.15.0 || ^24.0.0"
|
|
7
|
+
},
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist/**/*.{js,mjs,cjs,ts,mts,cts,map,json}",
|
|
16
|
+
"README.md",
|
|
17
|
+
"LICENSE"
|
|
18
|
+
],
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"@capaxle/runtime": "0.1.0-alpha.1",
|
|
21
|
+
"@capaxle/ir": "0.1.0-alpha.1"
|
|
22
|
+
},
|
|
23
|
+
"license": "Apache-2.0",
|
|
24
|
+
"repository": {
|
|
25
|
+
"type": "git",
|
|
26
|
+
"url": "https://github.com/trevor-gibby/capaxle.git",
|
|
27
|
+
"directory": "packages/adapter-mcp"
|
|
28
|
+
},
|
|
29
|
+
"publishConfig": {
|
|
30
|
+
"access": "public",
|
|
31
|
+
"tag": "alpha"
|
|
32
|
+
}
|
|
33
|
+
}
|