@odatano/nightgate-mcp 0.15.0 → 0.17.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 +301 -272
- package/README.md +3 -3
- package/dist/builder.js +2 -2
- package/dist/builder.js.map +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/tools.js +84 -67
- package/dist/tools.js.map +1 -1
- package/docs/configuration.md +48 -46
- package/docs/tools.md +6 -4
- package/package.json +2 -2
package/dist/builder.js
CHANGED
|
@@ -47,7 +47,7 @@ export const BUILDABLE_CALLS = [
|
|
|
47
47
|
* ref must belong together.
|
|
48
48
|
*/
|
|
49
49
|
export const BUILDABLE_ARTIFACTS = ['attestation-vault', 'attestation-vault-32'];
|
|
50
|
-
export const DEFAULT_ARTIFACT = 'attestation-vault';
|
|
50
|
+
export const DEFAULT_ARTIFACT = 'attestation-vault-32';
|
|
51
51
|
const modules = new Map();
|
|
52
52
|
const builders = new Map();
|
|
53
53
|
async function loadModules(ref = DEFAULT_ARTIFACT) {
|
|
@@ -138,7 +138,7 @@ function hexParam(params, key) {
|
|
|
138
138
|
function prepareCall(mods, input, attestationSecret, ownAttesterId) {
|
|
139
139
|
const { calls } = mods;
|
|
140
140
|
const p = input.params;
|
|
141
|
-
const slotWidth = input.compiledArtifactRef === 'attestation-vault-32' ? 32 : 16;
|
|
141
|
+
const slotWidth = (input.compiledArtifactRef ?? DEFAULT_ARTIFACT) === 'attestation-vault-32' ? 32 : 16;
|
|
142
142
|
const recordKeyOf = (keyName, payloadName, attesterName) => {
|
|
143
143
|
if (typeof p[keyName] === 'string')
|
|
144
144
|
return hexParam(p, keyName);
|
package/dist/builder.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builder.js","sourceRoot":"","sources":["../src/builder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAA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AY,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,aAAa,CAAC,EAAE,mBAAmB,EAAE,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,mBAAmB,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACpJ,CAAC;AACJ,CAAC;AAED,yEAAyE;AACzE,MAAM,CAAC,KAAK,UAAU,YAAY;IAChC,MAAM,IAAI,GAAG,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;IACpC,QAAQ,CAAC,KAAK,EAAE,CAAC;IACjB,KAAK,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC;QACrB,IAAI,CAAC;YAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC;QAAC,CAAC;QAAC,MAAM,CAAC,CAAC,iBAAiB,CAAC,CAAC;IAChE,CAAC;AACH,CAAC"}
|
package/dist/config.d.ts
CHANGED
|
@@ -39,7 +39,7 @@ export interface NightgateMcpConfig {
|
|
|
39
39
|
indexerHttpUrl?: string;
|
|
40
40
|
indexerWsUrl?: string;
|
|
41
41
|
nodeUrl?: string;
|
|
42
|
-
/** Where the prover keys come from; default `<baseUrl>/zk-config/attestation-vault`. */
|
|
42
|
+
/** Where the prover keys of the default lineage come from; default `<baseUrl>/zk-config/attestation-vault-32`. */
|
|
43
43
|
zkConfigBaseUrl?: string;
|
|
44
44
|
/** Disk cache for prover keys; default `<tmp>/nightgate-mcp-zk`. */
|
|
45
45
|
zkCacheDir?: string;
|
package/dist/tools.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { int64, raw, NightgateApiError } from './client.js';
|
|
3
|
-
import { BUILDABLE_CALLS, BUILDABLE_ARTIFACTS, buildSponsorable, attesterIdentity, seedIdentity } from './builder.js';
|
|
3
|
+
import { BUILDABLE_CALLS, BUILDABLE_ARTIFACTS, DEFAULT_ARTIFACT, buildSponsorable, attesterIdentity, seedIdentity } from './builder.js';
|
|
4
4
|
import { buildOffer, postedOfferIds, readOffer, revertHalf, sameOffer, settleBoardRows, settleHalfJob, swapWalletInfo, takenHalves, takeOffer, trackHalfJob, trackPostedHalf, } from './swap.js';
|
|
5
5
|
import { txExport } from './tx-module.js';
|
|
6
6
|
import { buildMint } from './factory.js';
|
|
@@ -20,7 +20,11 @@ const setSiblings = z.array(hex64('setSibling')).length(6)
|
|
|
20
20
|
.describe('Depth-6 membership-set path: exactly 6 sibling digests (64 hex each)');
|
|
21
21
|
const setDirs = z.array(z.boolean()).length(6)
|
|
22
22
|
.describe('Exactly 6 booleans; true means the current node is the LEFT child');
|
|
23
|
-
const POLL_HINT = 'Async: returns { jobId, status } immediately;
|
|
23
|
+
const POLL_HINT = 'Async: returns { jobId, status } immediately; call get_job_status, which waits on the server until the job settles.';
|
|
24
|
+
/** How long one get_job_status call lets the server wait for the job to settle, in ms. */
|
|
25
|
+
const JOB_WAIT_MS = 20_000;
|
|
26
|
+
// Off for this process once a server below NIGHTGATE 0.37 refuses getJobStatus' waitMs.
|
|
27
|
+
let jobWait = true;
|
|
24
28
|
/** One side of a swap: a raw token type and an amount in atoms. */
|
|
25
29
|
const swapLeg = (what) => z.object({
|
|
26
30
|
tokenType: hex64(`${what}.tokenType`).describe('Raw token type (64 hex), what derive_token_type returns'),
|
|
@@ -194,7 +198,7 @@ export function registerTools(server, client, config) {
|
|
|
194
198
|
.describe('Optional anchored schema id to check; the result reports schemaOk, so an examiner can pin the canonical field list'),
|
|
195
199
|
network: z.enum(['preview', 'preprod', 'mainnet']).optional()
|
|
196
200
|
.describe('Read from another network public indexer instead of the configured one'),
|
|
197
|
-
compiledArtifactRef: z.string().optional().describe("Contract artifact ref, defaults to 'attestation-vault'"),
|
|
201
|
+
compiledArtifactRef: z.string().optional().describe("Contract artifact ref, defaults to 'attestation-vault-32'; 'attestation-vault' for a 16-slot vault"),
|
|
198
202
|
},
|
|
199
203
|
}, run(async (args) => {
|
|
200
204
|
if (!args.documentId && !(args.attesterId && args.payloadHash)) {
|
|
@@ -207,7 +211,7 @@ export function registerTools(server, client, config) {
|
|
|
207
211
|
documentId: args.documentId,
|
|
208
212
|
contentRoot: args.contentRoot,
|
|
209
213
|
schemaId: args.schemaId,
|
|
210
|
-
compiledArtifactRef: args.compiledArtifactRef,
|
|
214
|
+
compiledArtifactRef: args.compiledArtifactRef ?? DEFAULT_ARTIFACT,
|
|
211
215
|
network: args.network,
|
|
212
216
|
});
|
|
213
217
|
}));
|
|
@@ -243,7 +247,7 @@ export function registerTools(server, client, config) {
|
|
|
243
247
|
.describe('documentDiff only: the k that was proven'),
|
|
244
248
|
network: z.enum(['preview', 'preprod', 'mainnet']).optional()
|
|
245
249
|
.describe('Read from another network public indexer instead of the configured one'),
|
|
246
|
-
compiledArtifactRef: z.string().optional().describe("Contract artifact ref, defaults to 'attestation-vault'"),
|
|
250
|
+
compiledArtifactRef: z.string().optional().describe("Contract artifact ref, defaults to 'attestation-vault-32'; 'attestation-vault' for a 16-slot vault"),
|
|
247
251
|
},
|
|
248
252
|
}, run(async (args) => {
|
|
249
253
|
if ((args.predicate === 'lessOrEqual' || args.predicate === 'greaterOrEqual') && args.threshold === undefined) {
|
|
@@ -274,7 +278,7 @@ export function registerTools(server, client, config) {
|
|
|
274
278
|
payloadHashB: args.payloadHashB,
|
|
275
279
|
allowedMask: args.allowedMask,
|
|
276
280
|
k: args.k,
|
|
277
|
-
compiledArtifactRef: args.compiledArtifactRef,
|
|
281
|
+
compiledArtifactRef: args.compiledArtifactRef ?? DEFAULT_ARTIFACT,
|
|
278
282
|
network: args.network,
|
|
279
283
|
});
|
|
280
284
|
}));
|
|
@@ -296,13 +300,13 @@ export function registerTools(server, client, config) {
|
|
|
296
300
|
documentId: z.string().uuid().describe('Documents row id'),
|
|
297
301
|
providedSha256: hex64('providedSha256').describe('sha256 of the document to check (64 hex)'),
|
|
298
302
|
contractAddress: z.string().optional().describe('Optional vault address, enables the crawler-free fallback'),
|
|
299
|
-
compiledArtifactRef: z.string().optional().describe("Contract artifact ref, defaults to 'attestation-vault'"),
|
|
303
|
+
compiledArtifactRef: z.string().optional().describe("Contract artifact ref, defaults to 'attestation-vault-32'; 'attestation-vault' for a 16-slot vault"),
|
|
300
304
|
},
|
|
301
305
|
}, run(async (args) => client.callFunction('verifyDocument', {
|
|
302
306
|
documentId: args.documentId,
|
|
303
307
|
providedSha256: args.providedSha256,
|
|
304
308
|
contractAddress: args.contractAddress,
|
|
305
|
-
compiledArtifactRef: args.compiledArtifactRef,
|
|
309
|
+
compiledArtifactRef: args.compiledArtifactRef ?? DEFAULT_ARTIFACT,
|
|
306
310
|
})));
|
|
307
311
|
server.registerTool('prepare_document_proof', {
|
|
308
312
|
description: 'Turn a structured document into everything the proof tools need: canonical JSON and its ' +
|
|
@@ -333,13 +337,13 @@ export function registerTools(server, client, config) {
|
|
|
333
337
|
})).min(1).max(MAX_SLOT_WIDTH).describe('ORDERED list of fields to make provable (leaf index = position). Up to 16 on the default vault, up to 32 with compiledArtifactRef attestation-vault-32'),
|
|
334
338
|
saltSeed: hex64('saltSeed').optional()
|
|
335
339
|
.describe('Reuse a stored salt seed to reproduce an already-anchored root; omit for a fresh document (random seed)'),
|
|
336
|
-
compiledArtifactRef: z.string().optional().describe("Contract artifact ref, defaults to 'attestation-vault'"),
|
|
340
|
+
compiledArtifactRef: z.string().optional().describe("Contract artifact ref, defaults to 'attestation-vault-32'; 'attestation-vault' for a 16-slot vault"),
|
|
337
341
|
},
|
|
338
342
|
}, run(async (args) => client.callAction('prepareDocumentProof', {
|
|
339
|
-
|
|
340
|
-
|
|
343
|
+
document: args.document,
|
|
344
|
+
proofFields: args.proofFields,
|
|
341
345
|
saltSeed: args.saltSeed,
|
|
342
|
-
compiledArtifactRef: args.compiledArtifactRef,
|
|
346
|
+
compiledArtifactRef: args.compiledArtifactRef ?? DEFAULT_ARTIFACT,
|
|
343
347
|
})));
|
|
344
348
|
server.registerTool('attest_agent_output', {
|
|
345
349
|
description: 'Anchor agent-output provenance on the Midnight chain: "agent X produced output O from ' +
|
|
@@ -356,7 +360,7 @@ export function registerTools(server, client, config) {
|
|
|
356
360
|
policyHash: hex64('policyHash').optional().describe('Optional commitment to the governing policy (64 hex)'),
|
|
357
361
|
producedAt: z.string().datetime().optional().describe('Optional ISO-8601 production time, defaults to now'),
|
|
358
362
|
storageRef: z.string().optional().describe('Where output/envelope live, defaults to agent-output://<agentId>'),
|
|
359
|
-
compiledArtifactRef: z.string().optional().describe("Contract artifact ref, defaults to 'attestation-vault'"),
|
|
363
|
+
compiledArtifactRef: z.string().optional().describe("Contract artifact ref, defaults to 'attestation-vault-32'; 'attestation-vault' for a 16-slot vault"),
|
|
360
364
|
idempotencyKey: z.string().optional().describe('Dedupes retries'),
|
|
361
365
|
sponsorSessionId: z.string().uuid().optional().describe('Optional second session that pays the dust fee'),
|
|
362
366
|
},
|
|
@@ -370,7 +374,7 @@ export function registerTools(server, client, config) {
|
|
|
370
374
|
storageRef: args.storageRef,
|
|
371
375
|
sessionId: args.sessionId,
|
|
372
376
|
contractAddress: args.contractAddress,
|
|
373
|
-
compiledArtifactRef: args.compiledArtifactRef,
|
|
377
|
+
compiledArtifactRef: args.compiledArtifactRef ?? DEFAULT_ARTIFACT,
|
|
374
378
|
idempotencyKey: args.idempotencyKey,
|
|
375
379
|
sponsorSessionId: args.sponsorSessionId,
|
|
376
380
|
})));
|
|
@@ -389,7 +393,7 @@ export function registerTools(server, client, config) {
|
|
|
389
393
|
contentType: z.string().optional().describe('MIME type, informational'),
|
|
390
394
|
size: z.number().int().nonnegative().optional().describe('Content size in bytes, informational'),
|
|
391
395
|
metadata: z.record(z.unknown()).optional().describe('Public metadata object; its hash is anchored alongside'),
|
|
392
|
-
compiledArtifactRef: z.string().optional().describe("Contract artifact ref, defaults to 'attestation-vault'"),
|
|
396
|
+
compiledArtifactRef: z.string().optional().describe("Contract artifact ref, defaults to 'attestation-vault-32'; 'attestation-vault' for a 16-slot vault"),
|
|
393
397
|
idempotencyKey: z.string().optional().describe('Dedupes retries of the same anchor request'),
|
|
394
398
|
sponsorSessionId: z.string().uuid().optional().describe('Optional second session that pays the dust fee'),
|
|
395
399
|
},
|
|
@@ -401,7 +405,7 @@ export function registerTools(server, client, config) {
|
|
|
401
405
|
metadata: args.metadata === undefined ? undefined : JSON.stringify(args.metadata),
|
|
402
406
|
sessionId: args.sessionId,
|
|
403
407
|
contractAddress: args.contractAddress,
|
|
404
|
-
compiledArtifactRef: args.compiledArtifactRef,
|
|
408
|
+
compiledArtifactRef: args.compiledArtifactRef ?? DEFAULT_ARTIFACT,
|
|
405
409
|
idempotencyKey: args.idempotencyKey,
|
|
406
410
|
sponsorSessionId: args.sponsorSessionId,
|
|
407
411
|
})));
|
|
@@ -429,7 +433,7 @@ export function registerTools(server, client, config) {
|
|
|
429
433
|
contentRoot: hex64('contentRoot').optional().describe('Optional Merkle root (64 hex) to anchor first'),
|
|
430
434
|
schemaId: hex64('schemaId').optional().describe('Schema id of the field list, required whenever contentRoot is supplied'),
|
|
431
435
|
unit: z.string().optional().describe('Informational unit, e.g. kWh'),
|
|
432
|
-
compiledArtifactRef: z.string().optional().describe("Contract artifact ref, defaults to 'attestation-vault'"),
|
|
436
|
+
compiledArtifactRef: z.string().optional().describe("Contract artifact ref, defaults to 'attestation-vault-32'; 'attestation-vault' for a 16-slot vault"),
|
|
433
437
|
idempotencyKey: z.string().optional().describe('Dedupes retries'),
|
|
434
438
|
sponsorSessionId: z.string().uuid().optional().describe('Optional second session that pays the dust fee'),
|
|
435
439
|
},
|
|
@@ -441,14 +445,14 @@ export function registerTools(server, client, config) {
|
|
|
441
445
|
fieldSalt: args.fieldSalt,
|
|
442
446
|
contentRoot: args.contentRoot,
|
|
443
447
|
schemaId: args.schemaId,
|
|
444
|
-
|
|
445
|
-
|
|
448
|
+
siblings: args.siblings,
|
|
449
|
+
dirs: args.dirs,
|
|
446
450
|
predicate: args.predicate,
|
|
447
451
|
threshold: String(args.threshold),
|
|
448
452
|
unit: args.unit,
|
|
449
453
|
sessionId: args.sessionId,
|
|
450
454
|
contractAddress: args.contractAddress,
|
|
451
|
-
compiledArtifactRef: args.compiledArtifactRef,
|
|
455
|
+
compiledArtifactRef: args.compiledArtifactRef ?? DEFAULT_ARTIFACT,
|
|
452
456
|
idempotencyKey: args.idempotencyKey,
|
|
453
457
|
sponsorSessionId: args.sponsorSessionId,
|
|
454
458
|
})));
|
|
@@ -466,17 +470,17 @@ export function registerTools(server, client, config) {
|
|
|
466
470
|
.describe('Optional member string to get the inclusion path for (pass this OR valueDigest)'),
|
|
467
471
|
valueDigest: hex64('valueDigest').optional()
|
|
468
472
|
.describe('Optional member digest (64 hex) instead of the raw value'),
|
|
469
|
-
compiledArtifactRef: z.string().optional().describe("Contract artifact ref, defaults to 'attestation-vault'"),
|
|
473
|
+
compiledArtifactRef: z.string().optional().describe("Contract artifact ref, defaults to 'attestation-vault-32'; 'attestation-vault' for a 16-slot vault"),
|
|
470
474
|
},
|
|
471
475
|
}, run(async (args) => {
|
|
472
476
|
if (args.value !== undefined && args.valueDigest !== undefined) {
|
|
473
477
|
throw new Error('pass at most one of value / valueDigest');
|
|
474
478
|
}
|
|
475
479
|
return client.callAction('prepareMembershipSet', {
|
|
476
|
-
|
|
480
|
+
allowedValues: args.allowedValues,
|
|
477
481
|
value: args.value,
|
|
478
482
|
valueDigest: args.valueDigest,
|
|
479
|
-
compiledArtifactRef: args.compiledArtifactRef,
|
|
483
|
+
compiledArtifactRef: args.compiledArtifactRef ?? DEFAULT_ARTIFACT,
|
|
480
484
|
});
|
|
481
485
|
}));
|
|
482
486
|
server.registerTool('prove_field_equality', {
|
|
@@ -502,7 +506,7 @@ export function registerTools(server, client, config) {
|
|
|
502
506
|
contractAddress: z.string().min(1).describe('AttestationVault deployment'),
|
|
503
507
|
contentRoot: hex64('contentRoot').optional().describe('Optional Merkle root (64 hex) to anchor first'),
|
|
504
508
|
schemaId: hex64('schemaId').optional().describe('Schema id of the field list, required whenever contentRoot is supplied'),
|
|
505
|
-
compiledArtifactRef: z.string().optional().describe("Contract artifact ref, defaults to 'attestation-vault'"),
|
|
509
|
+
compiledArtifactRef: z.string().optional().describe("Contract artifact ref, defaults to 'attestation-vault-32'; 'attestation-vault' for a 16-slot vault"),
|
|
506
510
|
idempotencyKey: z.string().optional().describe('Dedupes retries'),
|
|
507
511
|
sponsorSessionId: z.string().uuid().optional().describe('Optional second session that pays the dust fee'),
|
|
508
512
|
},
|
|
@@ -519,11 +523,11 @@ export function registerTools(server, client, config) {
|
|
|
519
523
|
fieldSalt: args.fieldSalt,
|
|
520
524
|
contentRoot: args.contentRoot,
|
|
521
525
|
schemaId: args.schemaId,
|
|
522
|
-
|
|
523
|
-
|
|
526
|
+
siblings: args.siblings,
|
|
527
|
+
dirs: args.dirs,
|
|
524
528
|
sessionId: args.sessionId,
|
|
525
529
|
contractAddress: args.contractAddress,
|
|
526
|
-
compiledArtifactRef: args.compiledArtifactRef,
|
|
530
|
+
compiledArtifactRef: args.compiledArtifactRef ?? DEFAULT_ARTIFACT,
|
|
527
531
|
idempotencyKey: args.idempotencyKey,
|
|
528
532
|
sponsorSessionId: args.sponsorSessionId,
|
|
529
533
|
});
|
|
@@ -557,7 +561,7 @@ export function registerTools(server, client, config) {
|
|
|
557
561
|
contractAddress: z.string().min(1).describe('AttestationVault deployment'),
|
|
558
562
|
contentRoot: hex64('contentRoot').optional().describe('Optional Merkle root (64 hex) to anchor first'),
|
|
559
563
|
schemaId: hex64('schemaId').optional().describe('Schema id of the field list, required whenever contentRoot is supplied'),
|
|
560
|
-
compiledArtifactRef: z.string().optional().describe("Contract artifact ref, defaults to 'attestation-vault'"),
|
|
564
|
+
compiledArtifactRef: z.string().optional().describe("Contract artifact ref, defaults to 'attestation-vault-32'; 'attestation-vault' for a 16-slot vault"),
|
|
561
565
|
idempotencyKey: z.string().optional().describe('Dedupes retries'),
|
|
562
566
|
sponsorSessionId: z.string().uuid().optional().describe('Optional second session that pays the dust fee'),
|
|
563
567
|
},
|
|
@@ -578,18 +582,18 @@ export function registerTools(server, client, config) {
|
|
|
578
582
|
fieldKey: args.fieldKey,
|
|
579
583
|
value: args.value,
|
|
580
584
|
valueDigest: args.valueDigest,
|
|
581
|
-
|
|
585
|
+
allowedValues: args.allowedValues,
|
|
582
586
|
setRoot: args.setRoot,
|
|
583
|
-
|
|
584
|
-
|
|
587
|
+
setSiblings: args.setSiblings,
|
|
588
|
+
setDirs: args.setDirs,
|
|
585
589
|
fieldSalt: args.fieldSalt,
|
|
586
590
|
contentRoot: args.contentRoot,
|
|
587
591
|
schemaId: args.schemaId,
|
|
588
|
-
|
|
589
|
-
|
|
592
|
+
siblings: args.siblings,
|
|
593
|
+
dirs: args.dirs,
|
|
590
594
|
sessionId: args.sessionId,
|
|
591
595
|
contractAddress: args.contractAddress,
|
|
592
|
-
compiledArtifactRef: args.compiledArtifactRef,
|
|
596
|
+
compiledArtifactRef: args.compiledArtifactRef ?? DEFAULT_ARTIFACT,
|
|
593
597
|
idempotencyKey: args.idempotencyKey,
|
|
594
598
|
sponsorSessionId: args.sponsorSessionId,
|
|
595
599
|
});
|
|
@@ -614,7 +618,7 @@ export function registerTools(server, client, config) {
|
|
|
614
618
|
contractAddress: z.string().min(1).describe('AttestationVault deployment'),
|
|
615
619
|
contentRoot: hex64('contentRoot').optional().describe('Optional Merkle root anchored as first call of the same batch'),
|
|
616
620
|
schemaId: hex64('schemaId').optional().describe('Schema id of the field list, required whenever contentRoot is supplied'),
|
|
617
|
-
compiledArtifactRef: z.string().optional().describe("Contract artifact ref, defaults to 'attestation-vault'"),
|
|
621
|
+
compiledArtifactRef: z.string().optional().describe("Contract artifact ref, defaults to 'attestation-vault-32'; 'attestation-vault' for a 16-slot vault"),
|
|
618
622
|
idempotencyKey: z.string().optional().describe('Dedupes retries'),
|
|
619
623
|
sponsorSessionId: z.string().uuid().optional().describe('Optional second session that pays the dust fee'),
|
|
620
624
|
},
|
|
@@ -627,10 +631,10 @@ export function registerTools(server, client, config) {
|
|
|
627
631
|
attesterId: args.attesterId,
|
|
628
632
|
contentRoot: args.contentRoot,
|
|
629
633
|
schemaId: args.schemaId,
|
|
630
|
-
|
|
634
|
+
claims: args.claims.map((c) => 'threshold' in c ? { ...c, threshold: String(c.threshold) } : c),
|
|
631
635
|
sessionId: args.sessionId,
|
|
632
636
|
contractAddress: args.contractAddress,
|
|
633
|
-
compiledArtifactRef: args.compiledArtifactRef,
|
|
637
|
+
compiledArtifactRef: args.compiledArtifactRef ?? DEFAULT_ARTIFACT,
|
|
634
638
|
idempotencyKey: args.idempotencyKey,
|
|
635
639
|
sponsorSessionId: args.sponsorSessionId,
|
|
636
640
|
});
|
|
@@ -660,7 +664,7 @@ export function registerTools(server, client, config) {
|
|
|
660
664
|
contentRootA: hex64('contentRootA').optional().describe('Optional: anchor A\'s root in the same flow'),
|
|
661
665
|
contentRootB: hex64('contentRootB').optional().describe('Optional: anchor B\'s root in the same flow'),
|
|
662
666
|
schemaId: hex64('schemaId').optional().describe('Shared schema id, required whenever a contentRoot is supplied'),
|
|
663
|
-
compiledArtifactRef: z.string().optional().describe("Contract artifact ref, defaults to 'attestation-vault'"),
|
|
667
|
+
compiledArtifactRef: z.string().optional().describe("Contract artifact ref, defaults to 'attestation-vault-32'; 'attestation-vault' for a 16-slot vault"),
|
|
664
668
|
idempotencyKey: z.string().optional().describe('Dedupes retries'),
|
|
665
669
|
sponsorSessionId: z.string().uuid().optional().describe('Optional second session that pays the dust fee'),
|
|
666
670
|
},
|
|
@@ -673,15 +677,15 @@ export function registerTools(server, client, config) {
|
|
|
673
677
|
attesterIdA: args.attesterIdA,
|
|
674
678
|
attesterIdB: args.attesterIdB,
|
|
675
679
|
allowedMask: args.allowedMask,
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
680
|
+
schema: args.schema,
|
|
681
|
+
openingA: args.openingA,
|
|
682
|
+
openingB: args.openingB,
|
|
679
683
|
contentRootA: args.contentRootA,
|
|
680
684
|
contentRootB: args.contentRootB,
|
|
681
685
|
schemaId: args.schemaId,
|
|
682
686
|
sessionId: args.sessionId,
|
|
683
687
|
contractAddress: args.contractAddress,
|
|
684
|
-
compiledArtifactRef: args.compiledArtifactRef,
|
|
688
|
+
compiledArtifactRef: args.compiledArtifactRef ?? DEFAULT_ARTIFACT,
|
|
685
689
|
idempotencyKey: args.idempotencyKey,
|
|
686
690
|
sponsorSessionId: args.sponsorSessionId,
|
|
687
691
|
});
|
|
@@ -710,7 +714,7 @@ export function registerTools(server, client, config) {
|
|
|
710
714
|
contentRootA: hex64('contentRootA').optional().describe('Optional: anchor A\'s root in the same flow'),
|
|
711
715
|
contentRootB: hex64('contentRootB').optional().describe('Optional: anchor B\'s root in the same flow'),
|
|
712
716
|
schemaId: hex64('schemaId').optional().describe('Shared schema id, required whenever a contentRoot is supplied'),
|
|
713
|
-
compiledArtifactRef: z.string().optional().describe("Contract artifact ref, defaults to 'attestation-vault'"),
|
|
717
|
+
compiledArtifactRef: z.string().optional().describe("Contract artifact ref, defaults to 'attestation-vault-32'; 'attestation-vault' for a 16-slot vault"),
|
|
714
718
|
idempotencyKey: z.string().optional().describe('Dedupes retries'),
|
|
715
719
|
sponsorSessionId: z.string().uuid().optional().describe('Optional second session that pays the dust fee'),
|
|
716
720
|
},
|
|
@@ -720,15 +724,15 @@ export function registerTools(server, client, config) {
|
|
|
720
724
|
attesterIdA: args.attesterIdA,
|
|
721
725
|
attesterIdB: args.attesterIdB,
|
|
722
726
|
k: args.k,
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
727
|
+
schema: args.schema,
|
|
728
|
+
openingA: args.openingA,
|
|
729
|
+
openingB: args.openingB,
|
|
726
730
|
contentRootA: args.contentRootA,
|
|
727
731
|
contentRootB: args.contentRootB,
|
|
728
732
|
schemaId: args.schemaId,
|
|
729
733
|
sessionId: args.sessionId,
|
|
730
734
|
contractAddress: args.contractAddress,
|
|
731
|
-
compiledArtifactRef: args.compiledArtifactRef,
|
|
735
|
+
compiledArtifactRef: args.compiledArtifactRef ?? DEFAULT_ARTIFACT,
|
|
732
736
|
idempotencyKey: args.idempotencyKey,
|
|
733
737
|
sponsorSessionId: args.sponsorSessionId,
|
|
734
738
|
})));
|
|
@@ -744,7 +748,7 @@ export function registerTools(server, client, config) {
|
|
|
744
748
|
.describe('0=public, 1=legitimate-interest, 2=authority'),
|
|
745
749
|
sessionId: z.string().uuid().describe('Wallet session id (must be the attester)'),
|
|
746
750
|
contractAddress: z.string().min(1).describe('AttestationVault deployment'),
|
|
747
|
-
compiledArtifactRef: z.string().optional().describe("Contract artifact ref, defaults to 'attestation-vault'"),
|
|
751
|
+
compiledArtifactRef: z.string().optional().describe("Contract artifact ref, defaults to 'attestation-vault-32'; 'attestation-vault' for a 16-slot vault"),
|
|
748
752
|
idempotencyKey: z.string().optional().describe('Dedupes retries'),
|
|
749
753
|
sponsorSessionId: z.string().uuid().optional().describe('Optional second session that pays the dust fee'),
|
|
750
754
|
},
|
|
@@ -754,7 +758,7 @@ export function registerTools(server, client, config) {
|
|
|
754
758
|
level: args.level,
|
|
755
759
|
sessionId: args.sessionId,
|
|
756
760
|
contractAddress: args.contractAddress,
|
|
757
|
-
compiledArtifactRef: args.compiledArtifactRef,
|
|
761
|
+
compiledArtifactRef: args.compiledArtifactRef ?? DEFAULT_ARTIFACT,
|
|
758
762
|
idempotencyKey: args.idempotencyKey,
|
|
759
763
|
sponsorSessionId: args.sponsorSessionId,
|
|
760
764
|
})));
|
|
@@ -766,7 +770,7 @@ export function registerTools(server, client, config) {
|
|
|
766
770
|
grantee: hex64('grantee').describe('Grantee identity (64 hex Bytes<32>)'),
|
|
767
771
|
sessionId: z.string().uuid().describe('Wallet session id (must be the attester)'),
|
|
768
772
|
contractAddress: z.string().min(1).describe('AttestationVault deployment'),
|
|
769
|
-
compiledArtifactRef: z.string().optional().describe("Contract artifact ref, defaults to 'attestation-vault'"),
|
|
773
|
+
compiledArtifactRef: z.string().optional().describe("Contract artifact ref, defaults to 'attestation-vault-32'; 'attestation-vault' for a 16-slot vault"),
|
|
770
774
|
idempotencyKey: z.string().optional().describe('Dedupes retries'),
|
|
771
775
|
sponsorSessionId: z.string().uuid().optional().describe('Optional second session that pays the dust fee'),
|
|
772
776
|
},
|
|
@@ -775,7 +779,7 @@ export function registerTools(server, client, config) {
|
|
|
775
779
|
grantee: args.grantee,
|
|
776
780
|
sessionId: args.sessionId,
|
|
777
781
|
contractAddress: args.contractAddress,
|
|
778
|
-
compiledArtifactRef: args.compiledArtifactRef,
|
|
782
|
+
compiledArtifactRef: args.compiledArtifactRef ?? DEFAULT_ARTIFACT,
|
|
779
783
|
idempotencyKey: args.idempotencyKey,
|
|
780
784
|
sponsorSessionId: args.sponsorSessionId,
|
|
781
785
|
})));
|
|
@@ -821,7 +825,7 @@ export function registerTools(server, client, config) {
|
|
|
821
825
|
bind: z.boolean().optional()
|
|
822
826
|
.describe('false (default): unbound for sponsor_unbound_transaction; true: finalized for sponsor_finalized_transaction'),
|
|
823
827
|
compiledArtifactRef: z.enum(BUILDABLE_ARTIFACTS).optional()
|
|
824
|
-
.describe("Vault lineage to build against, defaults to 'attestation-vault'. Use 'attestation-vault
|
|
828
|
+
.describe("Vault lineage to build against, defaults to 'attestation-vault-32' (the hosted sandbox vaults). Use 'attestation-vault' for a 16-slot vault: it has its own circuits, so the builder loads that contract class and fetches ITS prover keys from the server's /zk-config. The address must belong to the lineage named here"),
|
|
825
829
|
outFile: z.string().min(1).optional()
|
|
826
830
|
.describe('Also write the built bytes as base64 to this path, for a sponsor tool on another server (its file argument)'),
|
|
827
831
|
},
|
|
@@ -830,7 +834,7 @@ export function registerTools(server, client, config) {
|
|
|
830
834
|
throw new Error('local building is not configured for this server instance');
|
|
831
835
|
return buildSponsorable(config, {
|
|
832
836
|
contractAddress: args.contractAddress, call: args.call, params: args.params, bind: args.bind === true,
|
|
833
|
-
compiledArtifactRef: args.compiledArtifactRef,
|
|
837
|
+
compiledArtifactRef: args.compiledArtifactRef ?? DEFAULT_ARTIFACT,
|
|
834
838
|
merkleProof: args.merkleProof, docPair: args.docPair, outFile: args.outFile,
|
|
835
839
|
});
|
|
836
840
|
}));
|
|
@@ -855,7 +859,7 @@ export function registerTools(server, client, config) {
|
|
|
855
859
|
'outside it. The transaction expires with its TTL (default 30 min), so hand it over ' +
|
|
856
860
|
'promptly. This is the SERIAL channel (one tx per sponsor wallet at a time); for ' +
|
|
857
861
|
'parallel submission build with bind:false and use sponsor_unbound_transaction. ' +
|
|
858
|
-
'The server picks the wallet that pays.
|
|
862
|
+
'The server picks the wallet that pays. Call get_job_status with the sessionId ' +
|
|
859
863
|
'RETURNED by this call. ' + POLL_HINT,
|
|
860
864
|
inputSchema: {
|
|
861
865
|
txId: TX_ID.describe('txId returned by build_sponsorable_transaction (bind:true) on this server; the bytes never pass through the conversation'),
|
|
@@ -885,7 +889,7 @@ export function registerTools(server, client, config) {
|
|
|
885
889
|
'calls against the SAME contract in one block conflict, the loser lands on-chain but its ' +
|
|
886
890
|
'call does not apply and the job ends failed with errorCode CHAIN_EXECUTION_FAILED (the ' +
|
|
887
891
|
'transaction hash is in the error); then REBUILD the transaction against the current ' +
|
|
888
|
-
'contract state and sponsor again (never resubmit the same bytes).
|
|
892
|
+
'contract state and sponsor again (never resubmit the same bytes). Call get_job_status ' +
|
|
889
893
|
'with the sessionId RETURNED by this call. ' + POLL_HINT,
|
|
890
894
|
inputSchema: {
|
|
891
895
|
txId: TX_ID.describe('txId returned by build_sponsorable_transaction on this server; the bytes never pass through the conversation'),
|
|
@@ -956,7 +960,7 @@ export function registerTools(server, client, config) {
|
|
|
956
960
|
'refuses when they differ from `expect`, builds and proves the mirror half from this ' +
|
|
957
961
|
'server\'s wallet (it spends what the offer wants and creates what the offer gives). ' +
|
|
958
962
|
'With submit: true the two halves go to the sponsor at once and the answer is the ' +
|
|
959
|
-
'job ({ jobId, status, sessionId, id, terms }):
|
|
963
|
+
'job ({ jobId, status, sessionId, id, terms }): call get_job_status with the returned ' +
|
|
960
964
|
'sessionId. Without it the answer carries both halves for sponsor_swap. ALWAYS pass ' +
|
|
961
965
|
'`expect` with the terms you agreed to: an offer is text from someone else. With offerId ' +
|
|
962
966
|
'the board entry is read first and the call refuses, before proving, when it is not open ' +
|
|
@@ -1028,11 +1032,11 @@ export function registerTools(server, client, config) {
|
|
|
1028
1032
|
'never NIGHT, at most 4 inputs and 2 outputs per half, and the halves mirror each other ' +
|
|
1029
1033
|
'in types and amounts. A half may be bound or unbound and is passed as offer file text ' +
|
|
1030
1034
|
'or base64. Off on a server by default (NIGHTGATE_SPONSOR_ALLOW_SWAPS); an agent grant ' +
|
|
1031
|
-
'needs sponsorSwap in its allowedActions. Job result { txHash, swap: { gives, wants } }. ' +
|
|
1035
|
+
'needs sponsorSwap in its allowedActions. Job result { txHash, transactionHash, swap: { gives, wants } }. ' +
|
|
1032
1036
|
'An offer fills once: if it was taken first by somebody else the job fails. Pass both ' +
|
|
1033
1037
|
'halves, or `halfId` alone for an offer this server took (take_swap_offer keeps both ' +
|
|
1034
1038
|
'halves); with `offerId` the maker half comes from the board, next to takerHalf or the ' +
|
|
1035
|
-
'halfId of the taken offer.
|
|
1039
|
+
'halfId of the taken offer. Call get_job_status with the sessionId RETURNED by this call. ' + POLL_HINT,
|
|
1036
1040
|
inputSchema: {
|
|
1037
1041
|
makerHalf: swapHalf("The maker's half (the offer)").optional(),
|
|
1038
1042
|
takerHalf: swapHalf("The taker's half").optional(),
|
|
@@ -1086,7 +1090,7 @@ export function registerTools(server, client, config) {
|
|
|
1086
1090
|
const posted = await client.callAction('postSwapOffer', {
|
|
1087
1091
|
offer: args.offer,
|
|
1088
1092
|
expiresAt: args.expiresAt,
|
|
1089
|
-
tags: args.tags
|
|
1093
|
+
tags: args.tags,
|
|
1090
1094
|
});
|
|
1091
1095
|
await trackPostedHalf(args.offer, posted?.offerId).catch(() => { });
|
|
1092
1096
|
return posted;
|
|
@@ -1226,7 +1230,7 @@ export function registerTools(server, client, config) {
|
|
|
1226
1230
|
'response names the token before the job runs ({ tokenType, domain, issuerKey }); a ' +
|
|
1227
1231
|
'landed mint makes the type known to the sponsor (swaps, offer board). The recipient ' +
|
|
1228
1232
|
'defaults to this wallet (get_attester_identity); another wallet takes both of its keys. ' +
|
|
1229
|
-
'Job result { txHash, ... }.
|
|
1233
|
+
'Job result { txHash, transactionHash, ... }. Call get_job_status with the sessionId RETURNED by this call. ' + POLL_HINT,
|
|
1230
1234
|
inputSchema: {
|
|
1231
1235
|
contractAddress: hex64('contractAddress').describe('A token-factory deployment'),
|
|
1232
1236
|
name: z.string().min(1).refine((s) => Buffer.byteLength(s, 'utf8') <= 32, 'name must be at most 32 UTF-8 bytes')
|
|
@@ -1288,10 +1292,13 @@ export function registerTools(server, client, config) {
|
|
|
1288
1292
|
},
|
|
1289
1293
|
}, run(async (args) => client.callFunction('getGrantUsage', { grantId: null, since: args.since ?? null, until: args.until ?? null })));
|
|
1290
1294
|
server.registerTool('get_job_status', {
|
|
1291
|
-
description: '
|
|
1295
|
+
description: 'Status of an async NIGHTGATE job (all submit actions return a jobId). ' +
|
|
1292
1296
|
'status: pending | running | external_execution | submitted | reconciliation_required | ' +
|
|
1293
|
-
'succeeded | failed.
|
|
1294
|
-
'the
|
|
1297
|
+
'succeeded | failed. The server holds the call up to waitMs (default 20 s) until the job ' +
|
|
1298
|
+
'settles, so call it again only if the status is still open; result carries the job outcome ' +
|
|
1299
|
+
'JSON, chainStatus tracks on-chain finalization independently. txHash and transactionId are ' +
|
|
1300
|
+
'the ledger identifier (stable, tracks the job); transactionHash is the hash explorers show, ' +
|
|
1301
|
+
'null until indexed. ' +
|
|
1295
1302
|
'Sponsor jobs: failed + errorCode CHAIN_EXECUTION_FAILED = the transaction IS on-chain but ' +
|
|
1296
1303
|
'the contract call did not apply (same-contract conflict) -> rebuild and sponsor again; ' +
|
|
1297
1304
|
'reconciliation_required = broadcast outcome unknown to the server yet, the transaction ' +
|
|
@@ -1303,12 +1310,22 @@ export function registerTools(server, client, config) {
|
|
|
1303
1310
|
jobId: z.string().uuid().describe('Job id returned by a submit action'),
|
|
1304
1311
|
sessionId: z.string().uuid()
|
|
1305
1312
|
.describe('Wallet session id the job belongs to; for sponsor jobs the sessionId RETURNED by the sponsor call'),
|
|
1313
|
+
waitMs: z.number().int().min(0).max(25_000).optional()
|
|
1314
|
+
.describe('ms the server waits for the job to settle before it answers; default 20000, 0 answers at once'),
|
|
1306
1315
|
},
|
|
1307
1316
|
}, run(async (args) => {
|
|
1308
|
-
const
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1317
|
+
const ask = { jobId: args.jobId, sessionId: args.sessionId };
|
|
1318
|
+
const waitMs = jobWait ? Math.min(args.waitMs ?? JOB_WAIT_MS, Math.max(0, (config?.timeoutMs ?? 30_000) - 5_000)) : 0;
|
|
1319
|
+
let job;
|
|
1320
|
+
try {
|
|
1321
|
+
job = await client.callAction('getJobStatus', waitMs > 0 ? { ...ask, waitMs } : ask);
|
|
1322
|
+
}
|
|
1323
|
+
catch (err) {
|
|
1324
|
+
if (!(waitMs > 0 && err instanceof NightgateApiError && err.status === 400 && /waitMs/.test(err.message)))
|
|
1325
|
+
throw err;
|
|
1326
|
+
jobWait = false;
|
|
1327
|
+
job = await client.callAction('getJobStatus', ask);
|
|
1328
|
+
}
|
|
1312
1329
|
settleHalfJob(args.jobId, job?.status);
|
|
1313
1330
|
return job;
|
|
1314
1331
|
}));
|