@nexart/mcp-server 0.0.0-stage → 0.1.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/CHANGELOG.md +53 -0
- package/CONTRIBUTING.md +56 -0
- package/LICENSE +202 -0
- package/NOTICE +14 -0
- package/README.md +340 -2
- package/SECURITY.md +76 -0
- package/THIRD_PARTY_NOTICES.md +111 -0
- package/dist/adapters.d.ts +16 -0
- package/dist/adapters.js +48 -0
- package/dist/approve-public.d.ts +2 -0
- package/dist/approve-public.js +65 -0
- package/dist/contracts.d.ts +48 -0
- package/dist/contracts.js +34 -0
- package/dist/create-confidential.d.ts +2 -0
- package/dist/create-confidential.js +34 -0
- package/dist/instrumentation/openai-worker.d.ts +1 -0
- package/dist/instrumentation/openai-worker.js +26 -0
- package/dist/instrumentation/openai.d.ts +51 -0
- package/dist/instrumentation/openai.js +197 -0
- package/dist/limits.d.ts +15 -0
- package/dist/limits.js +62 -0
- package/dist/lookup/contracts.d.ts +38 -0
- package/dist/lookup/contracts.js +22 -0
- package/dist/lookup/verify.d.ts +54 -0
- package/dist/lookup/verify.js +110 -0
- package/dist/network/client.d.ts +26 -0
- package/dist/network/client.js +188 -0
- package/dist/network/contracts.d.ts +104 -0
- package/dist/network/contracts.js +54 -0
- package/dist/network-tools.d.ts +5 -0
- package/dist/network-tools.js +32 -0
- package/dist/owner/create.d.ts +52 -0
- package/dist/owner/create.js +117 -0
- package/dist/owner/custody.d.ts +33 -0
- package/dist/owner/custody.js +200 -0
- package/dist/owner/host.d.ts +10 -0
- package/dist/owner/host.js +70 -0
- package/dist/owner/publisher.d.ts +21 -0
- package/dist/owner/publisher.js +27 -0
- package/dist/owner/reconcile.d.ts +16 -0
- package/dist/owner/reconcile.js +109 -0
- package/dist/receipts/contracts.d.ts +72 -0
- package/dist/receipts/contracts.js +33 -0
- package/dist/receipts/verify.d.ts +4 -0
- package/dist/receipts/verify.js +104 -0
- package/dist/record/contracts.d.ts +281 -0
- package/dist/record/contracts.js +70 -0
- package/dist/record/customer.d.ts +40 -0
- package/dist/record/customer.js +99 -0
- package/dist/record/policy.d.ts +46 -0
- package/dist/record/policy.js +67 -0
- package/dist/record/publication.d.ts +23 -0
- package/dist/record/publication.js +148 -0
- package/dist/record/record.d.ts +12 -0
- package/dist/record/record.js +93 -0
- package/dist/record/state.d.ts +44 -0
- package/dist/record/state.js +84 -0
- package/dist/record-tools.d.ts +10 -0
- package/dist/record-tools.js +85 -0
- package/dist/recover-confidential.d.ts +2 -0
- package/dist/recover-confidential.js +13 -0
- package/dist/results.d.ts +8 -0
- package/dist/results.js +83 -0
- package/dist/server.d.ts +2 -0
- package/dist/server.js +39 -0
- package/dist/stdio.d.ts +2 -0
- package/dist/stdio.js +104 -0
- package/dist/trust/lifecycle.d.ts +13 -0
- package/dist/trust/lifecycle.js +42 -0
- package/dist/trust/policy.d.ts +14 -0
- package/dist/trust/policy.js +6 -0
- package/dist/verify.d.ts +3 -0
- package/dist/verify.js +56 -0
- package/dist/write/approval.d.ts +5 -0
- package/dist/write/approval.js +95 -0
- package/dist/write/attest.d.ts +14 -0
- package/dist/write/attest.js +140 -0
- package/dist/write/config.d.ts +11 -0
- package/dist/write/config.js +12 -0
- package/dist/write/contracts.d.ts +229 -0
- package/dist/write/contracts.js +61 -0
- package/dist/write/post.d.ts +11 -0
- package/dist/write/post.js +105 -0
- package/dist/write/profile.d.ts +19 -0
- package/dist/write/profile.js +114 -0
- package/dist/write/seal.d.ts +3 -0
- package/dist/write/seal.js +49 -0
- package/dist/write-tools.d.ts +4 -0
- package/dist/write-tools.js +36 -0
- package/docs/age-version-compatibility.md +46 -0
- package/docs/architecture.md +72 -0
- package/docs/compatibility.md +163 -0
- package/docs/contracts.md +127 -0
- package/docs/examples/customer-claude-desktop.json +14 -0
- package/docs/examples/customer-consent.json +15 -0
- package/docs/examples/customer-custody.json +8 -0
- package/docs/examples/customer-policy.json +43 -0
- package/docs/licensing-review.md +109 -0
- package/docs/milestone-1-validation.md +110 -0
- package/docs/milestone-2.md +291 -0
- package/docs/milestone-3.2.md +291 -0
- package/docs/milestone-3.md +274 -0
- package/docs/milestone-4a.md +221 -0
- package/docs/milestone-4b1.md +220 -0
- package/docs/milestone-4b2.md +260 -0
- package/docs/public-default.md +263 -0
- package/docs/recording-schema-compatibility.md +46 -0
- package/docs/release.md +311 -0
- package/docs/security-fixes.md +47 -0
- package/docs/security.md +195 -0
- package/docs/standalone-acceptance.md +81 -0
- package/docs/validation.md +85 -0
- package/package.json +51 -4
- package/server.json +20 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export function writeConfig(env = process.env) {
|
|
2
|
+
return Object.freeze({
|
|
3
|
+
sealEnabled: env.NEXART_ENABLE_SEAL === 'true',
|
|
4
|
+
attestEnabled: env.NEXART_ENABLE_ATTEST === 'true',
|
|
5
|
+
discloseCer: env.NEXART_DISCLOSE_CER === 'true',
|
|
6
|
+
publicEnabled: env.NEXART_ENABLE_PUBLIC_ATTEST === 'true',
|
|
7
|
+
approvalDirectory: env.NEXART_PUBLIC_APPROVAL_DIRECTORY,
|
|
8
|
+
accountContext: env.NEXART_NODE_ACCOUNT_CONTEXT,
|
|
9
|
+
apiKey: () => env.NEXART_NODE_API_KEY,
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
import * as z from 'zod/v4';
|
|
2
|
+
export declare const WRITE_TOOL_NAMES: readonly ["nexart_seal_ai_v2", "nexart_attest_cer"];
|
|
3
|
+
export declare const identitySchema: z.ZodObject<{
|
|
4
|
+
provider: z.ZodString;
|
|
5
|
+
sub: z.ZodString;
|
|
6
|
+
assertionHash: z.ZodString;
|
|
7
|
+
emailHash: z.ZodOptional<z.ZodString>;
|
|
8
|
+
verified: z.ZodBoolean;
|
|
9
|
+
}, z.core.$strict>;
|
|
10
|
+
export declare const executionSchema: z.ZodObject<{
|
|
11
|
+
executionId: z.ZodString;
|
|
12
|
+
timestamp: z.ZodString;
|
|
13
|
+
provider: z.ZodString;
|
|
14
|
+
model: z.ZodString;
|
|
15
|
+
input: z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>]>;
|
|
16
|
+
output: z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>]>;
|
|
17
|
+
parameters: z.ZodObject<{
|
|
18
|
+
temperature: z.ZodNumber;
|
|
19
|
+
maxTokens: z.ZodNumber;
|
|
20
|
+
topP: z.ZodNullable<z.ZodNumber>;
|
|
21
|
+
seed: z.ZodNullable<z.ZodNumber>;
|
|
22
|
+
}, z.core.$strict>;
|
|
23
|
+
executionRole: z.ZodEnum<{
|
|
24
|
+
advisory: "advisory";
|
|
25
|
+
operative: "operative";
|
|
26
|
+
unspecified: "unspecified";
|
|
27
|
+
}>;
|
|
28
|
+
instruction: z.ZodOptional<z.ZodString>;
|
|
29
|
+
instructionKind: z.ZodOptional<z.ZodEnum<{
|
|
30
|
+
system: "system";
|
|
31
|
+
derived: "derived";
|
|
32
|
+
label: "label";
|
|
33
|
+
}>>;
|
|
34
|
+
decisionRefs: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
35
|
+
modelEvidence: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
36
|
+
identity: z.ZodOptional<z.ZodObject<{
|
|
37
|
+
provider: z.ZodString;
|
|
38
|
+
sub: z.ZodString;
|
|
39
|
+
assertionHash: z.ZodString;
|
|
40
|
+
emailHash: z.ZodOptional<z.ZodString>;
|
|
41
|
+
verified: z.ZodBoolean;
|
|
42
|
+
}, z.core.$strict>>;
|
|
43
|
+
toolCalls: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
44
|
+
runId: z.ZodOptional<z.ZodString>;
|
|
45
|
+
stepId: z.ZodOptional<z.ZodString>;
|
|
46
|
+
stepIndex: z.ZodOptional<z.ZodNumber>;
|
|
47
|
+
workflowId: z.ZodOptional<z.ZodString>;
|
|
48
|
+
conversationId: z.ZodOptional<z.ZodString>;
|
|
49
|
+
prevStepHash: z.ZodOptional<z.ZodString>;
|
|
50
|
+
sdkVersion: z.ZodOptional<z.ZodString>;
|
|
51
|
+
appId: z.ZodOptional<z.ZodString>;
|
|
52
|
+
ext: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
53
|
+
}, z.core.$strict>;
|
|
54
|
+
export declare const sealInput: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
55
|
+
mode: z.ZodLiteral<"from_execution">;
|
|
56
|
+
execution: z.ZodObject<{
|
|
57
|
+
executionId: z.ZodString;
|
|
58
|
+
timestamp: z.ZodString;
|
|
59
|
+
provider: z.ZodString;
|
|
60
|
+
model: z.ZodString;
|
|
61
|
+
input: z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>]>;
|
|
62
|
+
output: z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>]>;
|
|
63
|
+
parameters: z.ZodObject<{
|
|
64
|
+
temperature: z.ZodNumber;
|
|
65
|
+
maxTokens: z.ZodNumber;
|
|
66
|
+
topP: z.ZodNullable<z.ZodNumber>;
|
|
67
|
+
seed: z.ZodNullable<z.ZodNumber>;
|
|
68
|
+
}, z.core.$strict>;
|
|
69
|
+
executionRole: z.ZodEnum<{
|
|
70
|
+
advisory: "advisory";
|
|
71
|
+
operative: "operative";
|
|
72
|
+
unspecified: "unspecified";
|
|
73
|
+
}>;
|
|
74
|
+
instruction: z.ZodOptional<z.ZodString>;
|
|
75
|
+
instructionKind: z.ZodOptional<z.ZodEnum<{
|
|
76
|
+
system: "system";
|
|
77
|
+
derived: "derived";
|
|
78
|
+
label: "label";
|
|
79
|
+
}>>;
|
|
80
|
+
decisionRefs: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
81
|
+
modelEvidence: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
82
|
+
identity: z.ZodOptional<z.ZodObject<{
|
|
83
|
+
provider: z.ZodString;
|
|
84
|
+
sub: z.ZodString;
|
|
85
|
+
assertionHash: z.ZodString;
|
|
86
|
+
emailHash: z.ZodOptional<z.ZodString>;
|
|
87
|
+
verified: z.ZodBoolean;
|
|
88
|
+
}, z.core.$strict>>;
|
|
89
|
+
toolCalls: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
90
|
+
runId: z.ZodOptional<z.ZodString>;
|
|
91
|
+
stepId: z.ZodOptional<z.ZodString>;
|
|
92
|
+
stepIndex: z.ZodOptional<z.ZodNumber>;
|
|
93
|
+
workflowId: z.ZodOptional<z.ZodString>;
|
|
94
|
+
conversationId: z.ZodOptional<z.ZodString>;
|
|
95
|
+
prevStepHash: z.ZodOptional<z.ZodString>;
|
|
96
|
+
sdkVersion: z.ZodOptional<z.ZodString>;
|
|
97
|
+
appId: z.ZodOptional<z.ZodString>;
|
|
98
|
+
ext: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
99
|
+
}, z.core.$strict>;
|
|
100
|
+
createdAt: z.ZodString;
|
|
101
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
102
|
+
mode: z.ZodLiteral<"from_snapshot">;
|
|
103
|
+
snapshot: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
104
|
+
createdAt: z.ZodString;
|
|
105
|
+
}, z.core.$strict>], "mode">;
|
|
106
|
+
export declare const attestInput: z.ZodObject<{
|
|
107
|
+
certificateHash: z.ZodString;
|
|
108
|
+
bundle: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
109
|
+
visibility: z.ZodDefault<z.ZodEnum<{
|
|
110
|
+
private: "private";
|
|
111
|
+
public: "public";
|
|
112
|
+
}>>;
|
|
113
|
+
}, z.core.$strict>;
|
|
114
|
+
export declare const sealOutput: z.ZodObject<{
|
|
115
|
+
contractVersion: z.ZodLiteral<"1">;
|
|
116
|
+
reasonCode: z.ZodString;
|
|
117
|
+
artifactIntegrity: z.ZodEnum<{
|
|
118
|
+
valid: "valid";
|
|
119
|
+
invalid: "invalid";
|
|
120
|
+
not_performed: "not_performed";
|
|
121
|
+
}>;
|
|
122
|
+
certificateHash: z.ZodNullable<z.ZodString>;
|
|
123
|
+
confidential: z.ZodBoolean;
|
|
124
|
+
identity: z.ZodEnum<{
|
|
125
|
+
absent: "absent";
|
|
126
|
+
producer_declared_not_authenticated: "producer_declared_not_authenticated";
|
|
127
|
+
}>;
|
|
128
|
+
disclosure: z.ZodEnum<{
|
|
129
|
+
not_performed: "not_performed";
|
|
130
|
+
summary_only: "summary_only";
|
|
131
|
+
full_cer: "full_cer";
|
|
132
|
+
}>;
|
|
133
|
+
bundle: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
134
|
+
limitations: z.ZodArray<z.ZodString>;
|
|
135
|
+
}, z.core.$strict>;
|
|
136
|
+
export declare const attestOutput: z.ZodObject<{
|
|
137
|
+
contractVersion: z.ZodLiteral<"1">;
|
|
138
|
+
reasonCode: z.ZodString;
|
|
139
|
+
submission: z.ZodEnum<{
|
|
140
|
+
rejected: "rejected";
|
|
141
|
+
not_sent: "not_sent";
|
|
142
|
+
node_reported_accepted: "node_reported_accepted";
|
|
143
|
+
outcome_unknown: "outcome_unknown";
|
|
144
|
+
}>;
|
|
145
|
+
artifactIntegrity: z.ZodEnum<{
|
|
146
|
+
valid: "valid";
|
|
147
|
+
invalid: "invalid";
|
|
148
|
+
not_performed: "not_performed";
|
|
149
|
+
}>;
|
|
150
|
+
confidentialProfile: z.ZodEnum<{
|
|
151
|
+
not_performed: "not_performed";
|
|
152
|
+
eligible: "eligible";
|
|
153
|
+
ineligible: "ineligible";
|
|
154
|
+
}>;
|
|
155
|
+
commitments: z.ZodEnum<{
|
|
156
|
+
invalid: "invalid";
|
|
157
|
+
not_performed: "not_performed";
|
|
158
|
+
authentic_without_openings: "authentic_without_openings";
|
|
159
|
+
}>;
|
|
160
|
+
requestedVisibility: z.ZodNullable<z.ZodEnum<{
|
|
161
|
+
private: "private";
|
|
162
|
+
public: "public";
|
|
163
|
+
}>>;
|
|
164
|
+
nodeConfirmedVisibility: z.ZodNullable<z.ZodEnum<{
|
|
165
|
+
private: "private";
|
|
166
|
+
public: "public";
|
|
167
|
+
}>>;
|
|
168
|
+
publicationAuthorization: z.ZodEnum<{
|
|
169
|
+
not_required: "not_required";
|
|
170
|
+
approved: "approved";
|
|
171
|
+
denied: "denied";
|
|
172
|
+
}>;
|
|
173
|
+
independentVerification: z.ZodEnum<{
|
|
174
|
+
not_checked: "not_checked";
|
|
175
|
+
not_public_under_reported_visibility: "not_public_under_reported_visibility";
|
|
176
|
+
}>;
|
|
177
|
+
identity: z.ZodEnum<{
|
|
178
|
+
absent: "absent";
|
|
179
|
+
producer_declared_not_authenticated: "producer_declared_not_authenticated";
|
|
180
|
+
}>;
|
|
181
|
+
certificateHash: z.ZodNullable<z.ZodString>;
|
|
182
|
+
receipt: z.ZodNullable<z.ZodObject<{
|
|
183
|
+
contractVersion: z.ZodLiteral<"1">;
|
|
184
|
+
reasonCode: z.ZodString;
|
|
185
|
+
signature: z.ZodEnum<{
|
|
186
|
+
valid: "valid";
|
|
187
|
+
invalid: "invalid";
|
|
188
|
+
not_performed: "not_performed";
|
|
189
|
+
}>;
|
|
190
|
+
hashBinding: z.ZodEnum<{
|
|
191
|
+
not_performed: "not_performed";
|
|
192
|
+
match: "match";
|
|
193
|
+
mismatch: "mismatch";
|
|
194
|
+
}>;
|
|
195
|
+
nodeIdentity: z.ZodEnum<{
|
|
196
|
+
not_established: "not_established";
|
|
197
|
+
match: "match";
|
|
198
|
+
mismatch: "mismatch";
|
|
199
|
+
}>;
|
|
200
|
+
keyStatus: z.ZodEnum<{
|
|
201
|
+
unknown: "unknown";
|
|
202
|
+
active: "active";
|
|
203
|
+
deprecated: "deprecated";
|
|
204
|
+
revoked: "revoked";
|
|
205
|
+
unavailable: "unavailable";
|
|
206
|
+
}>;
|
|
207
|
+
keyLifecycle: z.ZodEnum<{
|
|
208
|
+
valid: "valid";
|
|
209
|
+
invalid: "invalid";
|
|
210
|
+
unknown: "unknown";
|
|
211
|
+
}>;
|
|
212
|
+
lifecycleCode: z.ZodString;
|
|
213
|
+
signerTrust: z.ZodEnum<{
|
|
214
|
+
not_established: "not_established";
|
|
215
|
+
trusted_under_policy: "trusted_under_policy";
|
|
216
|
+
rejected: "rejected";
|
|
217
|
+
}>;
|
|
218
|
+
artifactIntegrity: z.ZodLiteral<"not_performed">;
|
|
219
|
+
sdk: z.ZodNullable<z.ZodObject<{
|
|
220
|
+
ok: z.ZodBoolean;
|
|
221
|
+
code: z.ZodString;
|
|
222
|
+
}, z.core.$strict>>;
|
|
223
|
+
limitations: z.ZodArray<z.ZodString>;
|
|
224
|
+
}, z.core.$strict>>;
|
|
225
|
+
verificationEnvelopeSignature: z.ZodLiteral<"not_performed">;
|
|
226
|
+
limitations: z.ZodArray<z.ZodString>;
|
|
227
|
+
}, z.core.$strict>;
|
|
228
|
+
export type SealOutput = z.infer<typeof sealOutput>;
|
|
229
|
+
export type AttestOutput = z.infer<typeof attestOutput>;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import * as z from 'zod/v4';
|
|
2
|
+
import { hashSchema } from '../network/contracts.js';
|
|
3
|
+
import { receiptOutput } from '../receipts/contracts.js';
|
|
4
|
+
export const WRITE_TOOL_NAMES = ['nexart_seal_ai_v2', 'nexart_attest_cer'];
|
|
5
|
+
const jsonObject = z.record(z.string(), z.unknown());
|
|
6
|
+
const text = z.string().min(1);
|
|
7
|
+
// Mirror the published SDK schema, including boolean false and its prefix-only
|
|
8
|
+
// assertion hash check. An SDK-declared "verified" flag is NOT MCP authentication.
|
|
9
|
+
export const identitySchema = z.strictObject({
|
|
10
|
+
provider: text, sub: text, assertionHash: z.string().startsWith('sha256:'),
|
|
11
|
+
emailHash: z.string().startsWith('sha256:').optional(), verified: z.boolean(),
|
|
12
|
+
});
|
|
13
|
+
export const executionSchema = z.strictObject({
|
|
14
|
+
executionId: text, timestamp: text, provider: text, model: text,
|
|
15
|
+
input: z.union([z.string(), jsonObject]), output: z.union([z.string(), jsonObject]),
|
|
16
|
+
parameters: z.strictObject({
|
|
17
|
+
temperature: z.number(), maxTokens: z.number(),
|
|
18
|
+
topP: z.number().nullable(), seed: z.number().nullable(),
|
|
19
|
+
}),
|
|
20
|
+
executionRole: z.enum(['advisory', 'operative', 'unspecified']),
|
|
21
|
+
instruction: z.string().optional(),
|
|
22
|
+
instructionKind: z.enum(['system', 'derived', 'label']).optional(),
|
|
23
|
+
decisionRefs: z.array(z.unknown()).optional(), modelEvidence: jsonObject.optional(),
|
|
24
|
+
identity: identitySchema.optional(), toolCalls: z.array(z.unknown()).min(1).optional(),
|
|
25
|
+
runId: text.optional(), stepId: text.optional(), stepIndex: z.number().optional(),
|
|
26
|
+
workflowId: text.optional(), conversationId: text.optional(), prevStepHash: text.optional(),
|
|
27
|
+
sdkVersion: text.optional(), appId: text.optional(), ext: jsonObject.optional(),
|
|
28
|
+
});
|
|
29
|
+
export const sealInput = z.discriminatedUnion('mode', [
|
|
30
|
+
z.strictObject({ mode: z.literal('from_execution'), execution: executionSchema, createdAt: text }),
|
|
31
|
+
z.strictObject({ mode: z.literal('from_snapshot'), snapshot: jsonObject, createdAt: text }),
|
|
32
|
+
]);
|
|
33
|
+
export const attestInput = z.strictObject({
|
|
34
|
+
certificateHash: hashSchema, bundle: jsonObject,
|
|
35
|
+
visibility: z.enum(['private', 'public']).default('public'),
|
|
36
|
+
});
|
|
37
|
+
export const sealOutput = z.strictObject({
|
|
38
|
+
contractVersion: z.literal('1'), reasonCode: z.string().max(96),
|
|
39
|
+
artifactIntegrity: z.enum(['valid', 'invalid', 'not_performed']),
|
|
40
|
+
certificateHash: hashSchema.nullable(), confidential: z.boolean(),
|
|
41
|
+
identity: z.enum(['absent', 'producer_declared_not_authenticated']),
|
|
42
|
+
disclosure: z.enum(['summary_only', 'full_cer', 'not_performed']),
|
|
43
|
+
bundle: jsonObject.nullable(), limitations: z.array(z.string().max(256)).max(12),
|
|
44
|
+
});
|
|
45
|
+
export const attestOutput = z.strictObject({
|
|
46
|
+
contractVersion: z.literal('1'), reasonCode: z.string().max(96),
|
|
47
|
+
submission: z.enum(['not_sent', 'rejected', 'node_reported_accepted', 'outcome_unknown']),
|
|
48
|
+
artifactIntegrity: z.enum(['valid', 'invalid', 'not_performed']),
|
|
49
|
+
confidentialProfile: z.enum(['eligible', 'ineligible', 'not_performed']),
|
|
50
|
+
commitments: z.enum(['authentic_without_openings', 'invalid', 'not_performed']),
|
|
51
|
+
requestedVisibility: z.enum(['private', 'public']).nullable(),
|
|
52
|
+
nodeConfirmedVisibility: z.enum(['private', 'public']).nullable(),
|
|
53
|
+
publicationAuthorization: z.enum(['not_required', 'approved', 'denied']),
|
|
54
|
+
independentVerification: z.enum(['not_checked', 'not_public_under_reported_visibility']),
|
|
55
|
+
identity: z.enum(['absent', 'producer_declared_not_authenticated']),
|
|
56
|
+
certificateHash: hashSchema.nullable(),
|
|
57
|
+
receipt: receiptOutput.nullable(),
|
|
58
|
+
verificationEnvelopeSignature: z.literal('not_performed'),
|
|
59
|
+
limitations: z.array(z.string().max(256)).max(12),
|
|
60
|
+
});
|
|
61
|
+
//# sourceMappingURL=contracts.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { NetworkFailure } from '../network/client.js';
|
|
2
|
+
export declare class SubmissionFailure extends NetworkFailure {
|
|
3
|
+
readonly outcome: 'rejected' | 'outcome_unknown';
|
|
4
|
+
constructor(code: string, outcome: 'rejected' | 'outcome_unknown');
|
|
5
|
+
}
|
|
6
|
+
/** Dedicated write adapter. Does not expand the existing GET-only network client. */
|
|
7
|
+
export declare class AttestPoster {
|
|
8
|
+
private readonly request;
|
|
9
|
+
constructor(request?: typeof fetch);
|
|
10
|
+
submit(body: string, visibility: 'private' | 'public', key: string, signal: AbortSignal): Promise<unknown>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { checkInput, LIMITS } from '../limits.js';
|
|
2
|
+
import { NODE_ORIGIN, NetworkFailure } from '../network/client.js';
|
|
3
|
+
import { WRITE_LIMITS } from './profile.js';
|
|
4
|
+
export class SubmissionFailure extends NetworkFailure {
|
|
5
|
+
outcome;
|
|
6
|
+
constructor(code, outcome) {
|
|
7
|
+
super(code);
|
|
8
|
+
this.outcome = outcome;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
/** Dedicated write adapter. Does not expand the existing GET-only network client. */
|
|
12
|
+
export class AttestPoster {
|
|
13
|
+
request;
|
|
14
|
+
constructor(request = globalThis.fetch) {
|
|
15
|
+
this.request = request;
|
|
16
|
+
}
|
|
17
|
+
async submit(body, visibility, key, signal) {
|
|
18
|
+
try {
|
|
19
|
+
const response = await this.request(`${NODE_ORIGIN}/api/attest`, {
|
|
20
|
+
method: 'POST', redirect: 'manual', credentials: 'omit', cache: 'no-store', signal,
|
|
21
|
+
headers: { Accept: 'application/json', 'Content-Type': 'application/json',
|
|
22
|
+
Authorization: `Bearer ${key}`, 'X-NexArt-Visibility': visibility },
|
|
23
|
+
body,
|
|
24
|
+
});
|
|
25
|
+
const cancel = async () => { try {
|
|
26
|
+
await response.body?.cancel();
|
|
27
|
+
}
|
|
28
|
+
catch { /* no diagnostics */ } };
|
|
29
|
+
if (response.status !== 200) {
|
|
30
|
+
await cancel();
|
|
31
|
+
const rejected = {
|
|
32
|
+
400: 'NODE_REQUEST_REJECTED', 401: 'NODE_AUTH_REJECTED', 403: 'NODE_AUTH_REJECTED',
|
|
33
|
+
404: 'NODE_RECORD_NOT_ACCESSIBLE', 409: 'NODE_PROOF_OR_VISIBILITY_CONFLICT',
|
|
34
|
+
413: 'NODE_REQUEST_TOO_LARGE', 422: 'NODE_CONFIDENTIAL_PROFILE_REJECTED', 429: 'NODE_QUOTA_OR_RATE_LIMITED',
|
|
35
|
+
};
|
|
36
|
+
// No error body is consumed, forwarded, or logged. 5xx/redirect outcomes
|
|
37
|
+
// cannot establish that a write did not occur.
|
|
38
|
+
throw new SubmissionFailure(rejected[response.status] ?? 'NODE_SUBMISSION_OUTCOME_UNKNOWN', rejected[response.status] ? 'rejected' : 'outcome_unknown');
|
|
39
|
+
}
|
|
40
|
+
if (!/^application\/json(?:\s*;|$)/i.test(response.headers.get('content-type') ?? '') ||
|
|
41
|
+
Number(response.headers.get('content-length') ?? 0) > WRITE_LIMITS.responseBytes) {
|
|
42
|
+
await cancel();
|
|
43
|
+
throw new SubmissionFailure('INVALID_ATTEST_RESPONSE', 'outcome_unknown');
|
|
44
|
+
}
|
|
45
|
+
const reader = response.body?.getReader();
|
|
46
|
+
if (!reader)
|
|
47
|
+
throw new SubmissionFailure('INVALID_ATTEST_RESPONSE', 'outcome_unknown');
|
|
48
|
+
const chunks = [];
|
|
49
|
+
let size = 0;
|
|
50
|
+
const abort = () => { void reader.cancel().catch(() => { }); };
|
|
51
|
+
signal.addEventListener('abort', abort, { once: true });
|
|
52
|
+
try {
|
|
53
|
+
while (true) {
|
|
54
|
+
signal.throwIfAborted();
|
|
55
|
+
const item = await reader.read();
|
|
56
|
+
if (item.done)
|
|
57
|
+
break;
|
|
58
|
+
size += item.value.byteLength;
|
|
59
|
+
if (size > WRITE_LIMITS.responseBytes)
|
|
60
|
+
throw Error('LIMIT');
|
|
61
|
+
chunks.push(item.value);
|
|
62
|
+
}
|
|
63
|
+
signal.throwIfAborted();
|
|
64
|
+
const text = new TextDecoder('utf-8', { fatal: true }).decode(Buffer.concat(chunks));
|
|
65
|
+
let depth = 0, quoted = false, escaped = false;
|
|
66
|
+
for (const c of text) {
|
|
67
|
+
if (quoted) {
|
|
68
|
+
if (escaped)
|
|
69
|
+
escaped = false;
|
|
70
|
+
else if (c === '\\')
|
|
71
|
+
escaped = true;
|
|
72
|
+
else if (c === '"')
|
|
73
|
+
quoted = false;
|
|
74
|
+
}
|
|
75
|
+
else if (c === '"')
|
|
76
|
+
quoted = true;
|
|
77
|
+
else if (c === '[' || c === '{') {
|
|
78
|
+
if (++depth > LIMITS.depth)
|
|
79
|
+
throw Error('LIMIT');
|
|
80
|
+
}
|
|
81
|
+
else if (c === ']' || c === '}')
|
|
82
|
+
depth--;
|
|
83
|
+
}
|
|
84
|
+
const data = JSON.parse(text);
|
|
85
|
+
if (checkInput(data))
|
|
86
|
+
throw Error('LIMIT');
|
|
87
|
+
return data;
|
|
88
|
+
}
|
|
89
|
+
finally {
|
|
90
|
+
signal.removeEventListener('abort', abort);
|
|
91
|
+
try {
|
|
92
|
+
await reader.cancel();
|
|
93
|
+
}
|
|
94
|
+
catch { /* no diagnostics */ }
|
|
95
|
+
reader.releaseLock();
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
catch (error) {
|
|
99
|
+
if (error instanceof SubmissionFailure)
|
|
100
|
+
throw error;
|
|
101
|
+
throw new SubmissionFailure(signal.aborted ? 'SUBMISSION_INTERRUPTED' : 'INVALID_OR_UNAVAILABLE_ATTEST_RESPONSE', 'outcome_unknown');
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
//# sourceMappingURL=post.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type CerAiExecutionBundleV2 } from '@nexart/ai-execution';
|
|
2
|
+
export declare const WRITE_LIMITS: Readonly<{
|
|
3
|
+
inputBytes: 65536;
|
|
4
|
+
responseBytes: 65536;
|
|
5
|
+
timeoutMs: 10000;
|
|
6
|
+
}>;
|
|
7
|
+
export declare const PUBLIC_PROFILE = "nexart.mcp.ai-v2.public-disclosure.v1";
|
|
8
|
+
export declare const LEGACY_DISCLOSURE = "ai-v2-resolver-reviewed-2026-11";
|
|
9
|
+
export declare const OPENAI_DISCLOSURE = "ai-v2-openai-disclosure-v1";
|
|
10
|
+
export type DisclosureProfile = typeof LEGACY_DISCLOSURE | typeof OPENAI_DISCLOSURE;
|
|
11
|
+
export declare function boundedInput(value: unknown): string | undefined;
|
|
12
|
+
export declare function validV2(value: unknown): value is CerAiExecutionBundleV2;
|
|
13
|
+
export declare function confidentialProfile(bundle: CerAiExecutionBundleV2): boolean;
|
|
14
|
+
/** Every accepted readable value is disclosed, including identity and IO hashes.
|
|
15
|
+
* No arbitrary metadata/extension/tool/context bags. Owner approval remains mandatory.
|
|
16
|
+
*/
|
|
17
|
+
export declare function publicProfile(bundle: CerAiExecutionBundleV2): boolean;
|
|
18
|
+
/** Additive profile. No rewriting/deleting fields and no wildcard metadata. */
|
|
19
|
+
export declare function disclosureEligible(bundle: CerAiExecutionBundleV2, visibility: 'public' | 'private', profile?: DisclosureProfile): boolean;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { verifyCerV2, verifyConfidentialV2 } from '@nexart/ai-execution';
|
|
2
|
+
import { checkInput, isObject } from '../limits.js';
|
|
3
|
+
import { hashSchema } from '../network/contracts.js';
|
|
4
|
+
export const WRITE_LIMITS = Object.freeze({ inputBytes: 65_536, responseBytes: 65_536, timeoutMs: 10_000 });
|
|
5
|
+
export const PUBLIC_PROFILE = 'nexart.mcp.ai-v2.public-disclosure.v1';
|
|
6
|
+
export const LEGACY_DISCLOSURE = 'ai-v2-resolver-reviewed-2026-11';
|
|
7
|
+
export const OPENAI_DISCLOSURE = 'ai-v2-openai-disclosure-v1';
|
|
8
|
+
export function boundedInput(value) {
|
|
9
|
+
const invalid = checkInput(value);
|
|
10
|
+
if (invalid)
|
|
11
|
+
return invalid;
|
|
12
|
+
return Buffer.byteLength(JSON.stringify(value)) > WRITE_LIMITS.inputBytes ? 'INPUT_TOO_LARGE' : undefined;
|
|
13
|
+
}
|
|
14
|
+
export function validV2(value) {
|
|
15
|
+
if (!isObject(value) || value.bundleType !== 'cer.ai.execution.v2')
|
|
16
|
+
return false;
|
|
17
|
+
try {
|
|
18
|
+
return verifyCerV2(value).ok;
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
function exactKeys(value, allowed) {
|
|
25
|
+
return Object.keys(value).every(key => allowed.includes(key));
|
|
26
|
+
}
|
|
27
|
+
const requiredSnapshot = [
|
|
28
|
+
'type', 'protocolVersion', 'executionSurface', 'executionId', 'timestamp', 'provider',
|
|
29
|
+
'model', 'input', 'inputHash', 'parameters', 'output', 'outputHash', 'executionRole', 'confidential',
|
|
30
|
+
];
|
|
31
|
+
function envelope(value) {
|
|
32
|
+
return isObject(value) && exactKeys(value, ['_redacted', 'mode', 'commitmentScheme', 'commitment'])
|
|
33
|
+
&& value._redacted === true && value.mode === 'confidential'
|
|
34
|
+
&& value.commitmentScheme === 'hmac-sha256-v1'
|
|
35
|
+
&& typeof value.commitment === 'string';
|
|
36
|
+
}
|
|
37
|
+
/** SDK integrity first. This is a disclosure policy, NOT commitment cryptography. */
|
|
38
|
+
function confidentialCore(bundle, extras = []) {
|
|
39
|
+
if (!exactKeys(bundle, ['bundleType', 'version', 'createdAt', 'snapshot', 'certificateHash', 'protectedSet']))
|
|
40
|
+
return false;
|
|
41
|
+
if (!isObject(bundle.protectedSet) || !exactKeys(bundle.protectedSet, ['stabilitySchemeId', 'protectedSetId', 'protectedFields']))
|
|
42
|
+
return false;
|
|
43
|
+
const snapshot = bundle.snapshot;
|
|
44
|
+
if (!exactKeys(snapshot, [...requiredSnapshot, 'sdkVersion', 'identity', 'instruction', 'instructionKind', 'decisionRefs', ...extras]))
|
|
45
|
+
return false;
|
|
46
|
+
if (!envelope(snapshot.input) || !envelope(snapshot.output))
|
|
47
|
+
return false;
|
|
48
|
+
if (snapshot.instruction !== undefined && !envelope(snapshot.instruction))
|
|
49
|
+
return false;
|
|
50
|
+
if (snapshot.decisionRefs !== undefined &&
|
|
51
|
+
(!Array.isArray(snapshot.decisionRefs) || !snapshot.decisionRefs.every(ref => isObject(ref) && exactKeys(ref, ['ref', 'refForm']) && ref.refForm === 'commitment' && envelope(ref.ref))))
|
|
52
|
+
return false;
|
|
53
|
+
try {
|
|
54
|
+
return verifyConfidentialV2(bundle).state === 'AUTHENTIC';
|
|
55
|
+
}
|
|
56
|
+
catch {
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
export function confidentialProfile(bundle) {
|
|
61
|
+
return confidentialCore(bundle);
|
|
62
|
+
}
|
|
63
|
+
/** Every accepted readable value is disclosed, including identity and IO hashes.
|
|
64
|
+
* No arbitrary metadata/extension/tool/context bags. Owner approval remains mandatory.
|
|
65
|
+
*/
|
|
66
|
+
export function publicProfile(bundle) {
|
|
67
|
+
if (!confidentialProfile(bundle))
|
|
68
|
+
return false;
|
|
69
|
+
return publicDescriptors(bundle);
|
|
70
|
+
}
|
|
71
|
+
function publicDescriptors(bundle) {
|
|
72
|
+
const s = bundle.snapshot;
|
|
73
|
+
if ([s.executionId, s.provider, s.model, s.sdkVersion].some(value => value !== undefined && (value.length > 128 || /[\u0000-\u001f\u007f]/.test(value))))
|
|
74
|
+
return false;
|
|
75
|
+
if (![s.timestamp, bundle.createdAt].every(value => value.length <= 64 && Number.isFinite(Date.parse(value))))
|
|
76
|
+
return false;
|
|
77
|
+
if (![s.inputHash, s.outputHash].every(value => hashSchema.safeParse(value).success))
|
|
78
|
+
return false;
|
|
79
|
+
if (s.identity) {
|
|
80
|
+
if ([s.identity.provider, s.identity.sub].some(value => value.length > 256 || /[\u0000-\u001f\u007f]/.test(value)))
|
|
81
|
+
return false;
|
|
82
|
+
if (!hashSchema.safeParse(s.identity.assertionHash).success ||
|
|
83
|
+
(s.identity.emailHash !== undefined && !hashSchema.safeParse(s.identity.emailHash).success))
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
return s.decisionRefs === undefined || s.decisionRefs.length <= 16;
|
|
87
|
+
}
|
|
88
|
+
/** Additive profile. No rewriting/deleting fields and no wildcard metadata. */
|
|
89
|
+
export function disclosureEligible(bundle, visibility, profile = LEGACY_DISCLOSURE) {
|
|
90
|
+
if (profile === LEGACY_DISCLOSURE)
|
|
91
|
+
return visibility === 'public' ? publicProfile(bundle) : confidentialProfile(bundle);
|
|
92
|
+
if (profile !== OPENAI_DISCLOSURE || !confidentialCore(bundle, ['modelEvidence']) ||
|
|
93
|
+
bundle.snapshot.provider !== 'openai')
|
|
94
|
+
return false;
|
|
95
|
+
const evidence = bundle.snapshot.modelEvidence;
|
|
96
|
+
const bounded = (v, max) => typeof v === 'string' && v.length > 0 &&
|
|
97
|
+
v.length <= max && !/[\u0000-\u001f\u007f]/.test(v);
|
|
98
|
+
if (evidence !== undefined) {
|
|
99
|
+
if (!isObject(evidence) || !Object.keys(evidence).length ||
|
|
100
|
+
!exactKeys(evidence, ['responseDeclaredModel', 'transactionRef', 'providerEvidence']))
|
|
101
|
+
return false;
|
|
102
|
+
if (evidence.responseDeclaredModel !== undefined && !bounded(evidence.responseDeclaredModel, 128))
|
|
103
|
+
return false;
|
|
104
|
+
if (evidence.transactionRef !== undefined && !bounded(evidence.transactionRef, 256))
|
|
105
|
+
return false;
|
|
106
|
+
if (evidence.providerEvidence !== undefined && (!isObject(evidence.providerEvidence) ||
|
|
107
|
+
!exactKeys(evidence.providerEvidence, ['system_fingerprint']) ||
|
|
108
|
+
!bounded(evidence.providerEvidence.system_fingerprint, 128)))
|
|
109
|
+
return false;
|
|
110
|
+
}
|
|
111
|
+
// Use the same metadata bounds even for private provider-profile submissions.
|
|
112
|
+
return publicDescriptors(bundle);
|
|
113
|
+
}
|
|
114
|
+
//# sourceMappingURL=profile.js.map
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { createSnapshotV2, sealCerV2, } from '@nexart/ai-execution';
|
|
2
|
+
import { LIMITS } from '../limits.js';
|
|
3
|
+
import { sealInput } from './contracts.js';
|
|
4
|
+
import { boundedInput, validV2 } from './profile.js';
|
|
5
|
+
export function seal(args, config, signal) {
|
|
6
|
+
const output = {
|
|
7
|
+
contractVersion: '1', reasonCode: 'INVALID_ARGUMENTS', artifactIntegrity: 'not_performed',
|
|
8
|
+
certificateHash: null, confidential: false, identity: 'absent', bundle: null,
|
|
9
|
+
disclosure: 'not_performed',
|
|
10
|
+
limitations: [
|
|
11
|
+
'Producer-supplied execution claims are not observed or authenticated by this server.',
|
|
12
|
+
'Identity, including verified:true, is a producer declaration; no identity provider was checked.',
|
|
13
|
+
'No confidential openings or salts are generated or returned.',
|
|
14
|
+
],
|
|
15
|
+
};
|
|
16
|
+
if (!config.sealEnabled)
|
|
17
|
+
return { ...output, reasonCode: 'WRITE_DISABLED' };
|
|
18
|
+
const limit = boundedInput(args);
|
|
19
|
+
if (limit)
|
|
20
|
+
return { ...output, reasonCode: limit };
|
|
21
|
+
const parsed = sealInput.safeParse(args);
|
|
22
|
+
if (!parsed.success)
|
|
23
|
+
return output;
|
|
24
|
+
if (signal?.aborted)
|
|
25
|
+
return { ...output, reasonCode: 'CANCELLED' };
|
|
26
|
+
try {
|
|
27
|
+
const input = parsed.data;
|
|
28
|
+
const snapshot = input.mode === 'from_execution'
|
|
29
|
+
? createSnapshotV2(input.execution)
|
|
30
|
+
: input.snapshot;
|
|
31
|
+
// No meta/signals/policy input surface in this initial sealing contract.
|
|
32
|
+
const bundle = sealCerV2(snapshot, { createdAt: input.createdAt });
|
|
33
|
+
if (!validV2(bundle))
|
|
34
|
+
return { ...output, artifactIntegrity: 'invalid', reasonCode: 'SDK_VERIFICATION_FAILED' };
|
|
35
|
+
const result = {
|
|
36
|
+
...output, reasonCode: 'OK', artifactIntegrity: 'valid', certificateHash: bundle.certificateHash,
|
|
37
|
+
confidential: snapshot.confidential !== undefined,
|
|
38
|
+
identity: snapshot.identity ? 'producer_declared_not_authenticated' : 'absent',
|
|
39
|
+
disclosure: config.discloseCer ? 'full_cer' : 'summary_only',
|
|
40
|
+
bundle: config.discloseCer ? bundle : null,
|
|
41
|
+
};
|
|
42
|
+
return Buffer.byteLength(JSON.stringify(result)) > LIMITS.outputBytes
|
|
43
|
+
? { ...output, reasonCode: 'OUTPUT_TOO_LARGE' } : result;
|
|
44
|
+
}
|
|
45
|
+
catch {
|
|
46
|
+
return { ...output, artifactIntegrity: 'invalid', reasonCode: 'SDK_SEAL_REJECTED' };
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=seal.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { McpServer } from '@modelcontextprotocol/server';
|
|
2
|
+
import { type WriteConfig } from './write/config.js';
|
|
3
|
+
import { type AttestDependencies } from './write/attest.js';
|
|
4
|
+
export declare function registerWriteTools(server: McpServer, config?: WriteConfig, dependencies?: AttestDependencies): void;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { WRITE_TOOL_NAMES, sealInput, sealOutput, attestInput, attestOutput } from './write/contracts.js';
|
|
2
|
+
import { writeConfig } from './write/config.js';
|
|
3
|
+
import { seal } from './write/seal.js';
|
|
4
|
+
import { attest } from './write/attest.js';
|
|
5
|
+
import { NodeNetwork } from './network/client.js';
|
|
6
|
+
import { AttestPoster } from './write/post.js';
|
|
7
|
+
import { WRITE_LIMITS } from './write/profile.js';
|
|
8
|
+
export function registerWriteTools(server, config = writeConfig(), dependencies = {}) {
|
|
9
|
+
if (config.sealEnabled) {
|
|
10
|
+
server.registerTool(WRITE_TOOL_NAMES[0], {
|
|
11
|
+
description: 'Create ordinary AI V2 evidence from_execution, or seal an SDK-ready ordinary or already-committed from_snapshot. This tool does not create confidential commitments or openings. Use the separate owner-operated confidential creation workflow for confidential-by-default evidence. Optional identity is producer-declared, not authenticated. Full CER output requires host configuration.',
|
|
12
|
+
inputSchema: sealInput, outputSchema: sealOutput,
|
|
13
|
+
annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
14
|
+
}, (args, context) => {
|
|
15
|
+
const result = seal(args, config, context.mcpReq.signal);
|
|
16
|
+
return { content: [{ type: 'text', text: JSON.stringify(result) }], structuredContent: result };
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
if (config.attestEnabled) {
|
|
20
|
+
// Share one semaphore/queue across every write call on this server.
|
|
21
|
+
const writeDependencies = {
|
|
22
|
+
...dependencies,
|
|
23
|
+
network: dependencies.network ?? new NodeNetwork(undefined, WRITE_LIMITS.timeoutMs),
|
|
24
|
+
poster: dependencies.poster ?? new AttestPoster(),
|
|
25
|
+
};
|
|
26
|
+
server.registerTool(WRITE_TOOL_NAMES[1], {
|
|
27
|
+
description: 'Submit an already-sealed eligible confidential AI V2 CER to the fixed Canonical Node. Omitted visibility defaults public; explicit private remains private. Public selection is NOT permission: host enablement AND exact-payload single-use independent owner approval are required outside MCP. No fallback to private. May consume quota; no automatic retries. Signature, trust, identity declarations and visibility are separate.',
|
|
28
|
+
inputSchema: attestInput, outputSchema: attestOutput,
|
|
29
|
+
annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: true },
|
|
30
|
+
}, async (args, context) => {
|
|
31
|
+
const result = await attest(args, config, writeDependencies, context.mcpReq.signal);
|
|
32
|
+
return { content: [{ type: 'text', text: JSON.stringify(result) }], structuredContent: result };
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=write-tools.js.map
|