@reclaimprotocol/agent 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/lib/cdp/launcher.js +4 -3
  2. package/lib/consts.d.ts +68 -0
  3. package/lib/consts.js +134 -0
  4. package/lib/logger.js +2 -1
  5. package/lib/mcp/api/operations.gen.d.ts +3 -7
  6. package/lib/mcp/api/operations.gen.js +264 -199
  7. package/lib/mcp/server.d.ts +0 -6
  8. package/lib/mcp/server.js +0 -30
  9. package/lib/mcp/start.js +7 -7
  10. package/lib/mcp/tools/agent/build.d.ts +5 -9
  11. package/lib/mcp/tools/agent/build.js +5 -9
  12. package/lib/mcp/tools/agent/proof.js +2 -1
  13. package/lib/mcp/tools/agent/publish.js +166 -77
  14. package/lib/mcp/tools/authenticate/decrypt-key.d.ts +10 -23
  15. package/lib/mcp/tools/authenticate/decrypt-key.js +23 -26
  16. package/lib/mcp/tools/authenticate/eth-key.d.ts +0 -7
  17. package/lib/mcp/tools/authenticate/eth-key.js +5 -19
  18. package/lib/mcp/tools/authenticate/issue.js +1 -1
  19. package/lib/mcp/tools/verification/build.d.ts +1 -1
  20. package/lib/mcp/tools/verification/build.js +1 -1
  21. package/lib/mcp/tools/verification/result.d.ts +4 -5
  22. package/lib/mcp/tools/verification/result.js +17 -17
  23. package/lib/old/flag.d.ts +4 -1
  24. package/lib/old/flag.js +4 -3
  25. package/lib/old/identity.d.ts +0 -10
  26. package/lib/old/identity.js +8 -7
  27. package/lib/old/login-cdp.d.ts +0 -3
  28. package/lib/old/login-cdp.js +2 -4
  29. package/lib/old/to-register.js +6 -9
  30. package/lib/old/tools/authenticate.js +2 -1
  31. package/lib/old/tools/publish.js +58 -9
  32. package/lib/paths.js +2 -2
  33. package/lib/proof/attestor.js +2 -1
  34. package/lib/proof/proof-core.js +13 -2
  35. package/lib/provider/injection-doc.d.ts +1 -0
  36. package/lib/provider/injection-doc.js +17 -0
  37. package/lib/provider/match-redaction-warning.d.ts +25 -0
  38. package/lib/provider/match-redaction-warning.js +35 -0
  39. package/lib/provider/schema.d.ts +16 -0
  40. package/lib/provider/schema.js +11 -1
  41. package/lib/provider/to-version.d.ts +59 -7
  42. package/lib/provider/to-version.js +79 -28
  43. package/package.json +1 -1
  44. package/skill/builder-mode.md +6 -2
  45. package/skill/injection-api.md +42 -0
  46. package/skill/old-mode.md +2 -0
  47. package/src/cdp/launcher.ts +5 -4
  48. package/src/consts.ts +164 -0
  49. package/src/logger.ts +2 -1
  50. package/src/mcp/api/operations.gen.ts +262 -203
  51. package/src/mcp/server.ts +0 -46
  52. package/src/mcp/start.ts +13 -7
  53. package/src/mcp/tools/agent/build.ts +5 -9
  54. package/src/mcp/tools/agent/proof.ts +2 -1
  55. package/src/mcp/tools/agent/publish.ts +212 -94
  56. package/src/mcp/tools/authenticate/decrypt-key.ts +24 -29
  57. package/src/mcp/tools/authenticate/eth-key.ts +5 -25
  58. package/src/mcp/tools/authenticate/issue.ts +1 -1
  59. package/src/mcp/tools/verification/build.ts +1 -1
  60. package/src/mcp/tools/verification/result.ts +16 -17
  61. package/src/old/flag.ts +4 -3
  62. package/src/old/identity.ts +8 -7
  63. package/src/old/login-cdp.ts +2 -5
  64. package/src/old/to-register.ts +7 -10
  65. package/src/old/tools/authenticate.ts +2 -1
  66. package/src/old/tools/publish.ts +75 -15
  67. package/src/paths.ts +2 -2
  68. package/src/proof/attestor.ts +2 -1
  69. package/src/proof/proof-core.ts +13 -3
  70. package/src/provider/injection-doc.ts +21 -0
  71. package/src/provider/match-redaction-warning.ts +53 -0
  72. package/src/provider/schema.ts +23 -0
  73. package/src/provider/to-version.ts +137 -31
@@ -274,7 +274,7 @@ export const MCP_TOOLS = {
274
274
  }),
275
275
  },
276
276
  "CreateCallbackSubscription": {
277
- description: "Register a callback subscription\n\nRegisters a destination for verification results on the organization\nthe presented `OrgToken` resolves to. The body is just `callbackUrl`\nand `events`. At least one subscription must exist for the org before a\nverification session can be created. Delivery is scoped by org: terminal\nresults are encrypted as a compact JWE to the org's encryption\ncredential when set (see `PUT /orgs/{orgId}/credential`), else delivered\nas plaintext.\n",
277
+ description: "Register a callback subscription\n\nRegisters a destination for verification results on the organization\nthe presented `OrgToken` resolves to. The body is just `callbackUrl`\nand `events`. At least one subscription must exist for the org before a\nverification session can be created. Delivery is scoped by org: terminal\nresults are ECIES-encrypted to the org's eth public key when its\n`canEncryptResult` is enabled (see `PUT /orgs/{orgId}/keypair`), else\ndelivered as plaintext.\n",
278
278
  inputSchema: toZod({
279
279
  "type": "object",
280
280
  "properties": {
@@ -306,11 +306,12 @@ export const MCP_TOOLS = {
306
306
  "maxItems": 12,
307
307
  "items": {
308
308
  "type": "string",
309
- "description": "Lifecycle event reported for a verification session. A healthy run\nproceeds through these in order; reading the gaps locates where a\nsession stalled. Session-level terminal events trigger callback\ndelivery; request-level events are progress pings carrying a\n`request_id` in their event data. New values may be added over time;\nclients MUST tolerate unknown values in responses.\n\n- `session_pending`: Session created; awaiting the end-user.\n\n- `verification_client_opened`: The end-user opened the link. Absent ⇒\n the link was never opened.\n\n- `verification_client_ready`: The client initialized.\n\n- `request_matched`: The target request was captured on the provider\n site. Absent (after opened) ⇒ the user didn't complete the journey.\n\n- `request_claim_created`: A proof claim was started.\n\n- `request_claim_completed`: A proof claim finished.\n\n- `request_claim_rejected`: A claim was rejected (detail in `eventData`).\n\n- `request_claim_failed`: A claim errored (detail in `eventData`).\n\n- `verification_success`: Terminal — verified. Triggers callback delivery.\n\n- `verification_rejected`: Terminal — rejected (detail in `eventData`).\n\n- `verification_error`: Terminal — errored (detail in `eventData`).\n\n- `session_expired`: `expiresAt` passed before a terminal event.",
309
+ "description": "Lifecycle event reported for a verification session. A healthy run\nproceeds through these in order; reading the gaps locates where a\nsession stalled. Session-level terminal events trigger callback\ndelivery; provider-/request-level events are progress pings carrying a\n`provider_id` (and `request_id` for request-level ones) in their event\ndata. New values may be added over time; clients MUST tolerate unknown\nvalues in responses.\n\n- `session_pending`: Session created; awaiting the end-user.\n\n- `verification_client_opened`: The end-user opened the link. Absent ⇒\n the link was never opened.\n\n- `verification_client_ready`: The client initialized.\n\n- `verification_provider_started`: The client began verifying a provider\n (`provider_id`/`resolved_version`/`ordinal` in `eventData`). One per\n provider, in run order, for multi-provider sessions.\n\n- `request_matched`: The target request was captured on the provider\n site. Absent (after opened) ⇒ the user didn't complete the journey.\n\n- `request_claim_created`: A proof claim was started.\n\n- `request_claim_completed`: A proof claim finished.\n\n- `request_claim_rejected`: A claim was rejected (detail in `eventData`).\n\n- `request_claim_failed`: A claim errored (detail in `eventData`).\n\n- `verification_success`: Terminal — verified. Triggers callback delivery.\n\n- `verification_rejected`: Terminal — rejected (detail in `eventData`).\n\n- `verification_error`: Terminal — errored (detail in `eventData`).\n\n- `session_expired`: `expiresAt` passed before a terminal event.",
310
310
  "enum": [
311
311
  "session_pending",
312
312
  "verification_client_opened",
313
313
  "verification_client_ready",
314
+ "verification_provider_started",
314
315
  "request_matched",
315
316
  "request_claim_created",
316
317
  "request_claim_completed",
@@ -350,14 +351,26 @@ export const MCP_TOOLS = {
350
351
  "body": {
351
352
  "type": "object",
352
353
  "additionalProperties": false,
354
+ "description": "Body for `POST /orgs`. Explicitly-created orgs must declare their Ethereum (secp256k1) encryption public key — it identifies the org and, when `canEncryptResult` is enabled, encrypts delivered results.",
353
355
  "required": [
354
- "name"
356
+ "name",
357
+ "publicKey"
355
358
  ],
356
359
  "properties": {
357
360
  "name": {
358
361
  "type": "string",
359
362
  "minLength": 1,
360
363
  "maxLength": 200
364
+ },
365
+ "publicKey": {
366
+ "type": "string",
367
+ "description": "The org's eth public key, uncompressed hex (`0x04` + 128 hex) — the eth-native form wallets/ethers emit. The matching private key never leaves the consumer.",
368
+ "pattern": "^0x04[0-9a-fA-F]{128}$"
369
+ },
370
+ "canEncryptResult": {
371
+ "type": "boolean",
372
+ "description": "When true, terminal results are ECIES-encrypted to this key; when false (the default), they are delivered as plaintext.",
373
+ "default": false
361
374
  }
362
375
  }
363
376
  }
@@ -412,11 +425,12 @@ export const MCP_TOOLS = {
412
425
  "maxItems": 12,
413
426
  "items": {
414
427
  "type": "string",
415
- "description": "Lifecycle event reported for a verification session. A healthy run\nproceeds through these in order; reading the gaps locates where a\nsession stalled. Session-level terminal events trigger callback\ndelivery; request-level events are progress pings carrying a\n`request_id` in their event data. New values may be added over time;\nclients MUST tolerate unknown values in responses.\n\n- `session_pending`: Session created; awaiting the end-user.\n\n- `verification_client_opened`: The end-user opened the link. Absent ⇒\n the link was never opened.\n\n- `verification_client_ready`: The client initialized.\n\n- `request_matched`: The target request was captured on the provider\n site. Absent (after opened) ⇒ the user didn't complete the journey.\n\n- `request_claim_created`: A proof claim was started.\n\n- `request_claim_completed`: A proof claim finished.\n\n- `request_claim_rejected`: A claim was rejected (detail in `eventData`).\n\n- `request_claim_failed`: A claim errored (detail in `eventData`).\n\n- `verification_success`: Terminal — verified. Triggers callback delivery.\n\n- `verification_rejected`: Terminal — rejected (detail in `eventData`).\n\n- `verification_error`: Terminal — errored (detail in `eventData`).\n\n- `session_expired`: `expiresAt` passed before a terminal event.",
428
+ "description": "Lifecycle event reported for a verification session. A healthy run\nproceeds through these in order; reading the gaps locates where a\nsession stalled. Session-level terminal events trigger callback\ndelivery; provider-/request-level events are progress pings carrying a\n`provider_id` (and `request_id` for request-level ones) in their event\ndata. New values may be added over time; clients MUST tolerate unknown\nvalues in responses.\n\n- `session_pending`: Session created; awaiting the end-user.\n\n- `verification_client_opened`: The end-user opened the link. Absent ⇒\n the link was never opened.\n\n- `verification_client_ready`: The client initialized.\n\n- `verification_provider_started`: The client began verifying a provider\n (`provider_id`/`resolved_version`/`ordinal` in `eventData`). One per\n provider, in run order, for multi-provider sessions.\n\n- `request_matched`: The target request was captured on the provider\n site. Absent (after opened) ⇒ the user didn't complete the journey.\n\n- `request_claim_created`: A proof claim was started.\n\n- `request_claim_completed`: A proof claim finished.\n\n- `request_claim_rejected`: A claim was rejected (detail in `eventData`).\n\n- `request_claim_failed`: A claim errored (detail in `eventData`).\n\n- `verification_success`: Terminal — verified. Triggers callback delivery.\n\n- `verification_rejected`: Terminal — rejected (detail in `eventData`).\n\n- `verification_error`: Terminal — errored (detail in `eventData`).\n\n- `session_expired`: `expiresAt` passed before a terminal event.",
416
429
  "enum": [
417
430
  "session_pending",
418
431
  "verification_client_opened",
419
432
  "verification_client_ready",
433
+ "verification_provider_started",
420
434
  "request_matched",
421
435
  "request_claim_created",
422
436
  "request_claim_completed",
@@ -713,9 +727,9 @@ export const MCP_TOOLS = {
713
727
  }
714
728
  }
715
729
  },
716
- "matches": {
730
+ "responseMatches": {
717
731
  "type": "array",
718
- "description": "A list of match conditions for the response.",
732
+ "description": "Conditions the (redacted) response must satisfy for the proof to be valid. Each runs against the union of the portions revealed by `responseRedactions` (or the whole response when there are none). Mirrors attestor-core `responseMatches`.",
719
733
  "minItems": 1,
720
734
  "items": {
721
735
  "type": "object",
@@ -753,33 +767,38 @@ export const MCP_TOOLS = {
753
767
  "value": {
754
768
  "type": "string",
755
769
  "description": "The pattern or value to look for in the response. When `type` is 'contains', supports template variable declaration using `{{variable}}` syntax. When `type` is 'regex', can be used to extract variables using regex named groups."
770
+ }
771
+ }
772
+ }
773
+ },
774
+ "responseRedactions": {
775
+ "type": "array",
776
+ "description": "Portions to select/reveal from the response, applied in order (xPath => jsonPath => regex). Done client-side; only the selected portions (plus the first response line) are sent to the attestor. An independent ordered list — NOT paired 1:1 with `responseMatches`. Mirrors attestor-core `responseRedactions`.",
777
+ "items": {
778
+ "type": "object",
779
+ "additionalProperties": false,
780
+ "description": "Which portions to select from a response. These are selected in order, xpath => jsonPath => regex * These redactions are done client side and only the selected portions are sent to the attestor. The attestor will only be able to see the selected portions alongside the first line of the HTTP response (i.e. \"HTTP/1.1 200 OK\")",
781
+ "properties": {
782
+ "xPath": {
783
+ "type": "string",
784
+ "description": "expect an HTML response, and to contain a certain xpath for eg. \"/html/body/div.a1/div.a2/span.a5\""
756
785
  },
757
- "extract": {
758
- "type": "object",
759
- "description": "Which portions to select from a response. These are selected in order, xpath => jsonPath => regex * These redactions are done client side and only the selected portions are sent to the attestor. The attestor will only be able to see the selected portions alongside the first line of the HTTP response (i.e. \"HTTP/1.1 200 OK\")",
760
- "properties": {
761
- "xPath": {
762
- "type": "string",
763
- "description": "expect an HTML response, and to contain a certain xpath for eg. \"/html/body/div.a1/div.a2/span.a5\""
764
- },
765
- "jsonPath": {
766
- "type": "string",
767
- "description": "expect a JSON response, retrieve the item at this path using dot notation for e.g. 'email.addresses.0'"
768
- },
769
- "regex": {
770
- "type": "string",
771
- "description": "select a regex match from the response"
772
- },
773
- "hash": {
774
- "type": "string",
775
- "description": "If provided, the value inside will be hashed instead of being redacted. Useful for cases where the data inside is an identifiying piece of information that you don't want to reveal to the attestor, eg. an email address.\nIf the hash function produces more bytes than the original value, the hash will be truncated.\nEg. if hash is enabled, the original value is \"hello\", and hashed is \"a1b2c\", then the attestor will only see \"a1b2c\".\nNote: if a regex with named groups is provided, only the named groups will be hashed.",
776
- "enum": [
777
- "oprf",
778
- "oprf-mpc",
779
- "oprf-raw"
780
- ]
781
- }
782
- }
786
+ "jsonPath": {
787
+ "type": "string",
788
+ "description": "expect a JSON response, retrieve the item at this path using dot notation for e.g. 'email.addresses.0'"
789
+ },
790
+ "regex": {
791
+ "type": "string",
792
+ "description": "select a regex match from the response"
793
+ },
794
+ "hash": {
795
+ "type": "string",
796
+ "description": "If provided, the value inside will be hashed instead of being redacted. Useful for cases where the data inside is an identifiying piece of information that you don't want to reveal to the attestor, eg. an email address.\nIf the hash function produces more bytes than the original value, the hash will be truncated.\nEg. if hash is enabled, the original value is \"hello\", and hashed is \"a1b2c\", then the attestor will only see \"a1b2c\".\nNote: if a regex with named groups is provided, only the named groups will be hashed.",
797
+ "enum": [
798
+ "oprf",
799
+ "oprf-mpc",
800
+ "oprf-raw"
801
+ ]
783
802
  }
784
803
  }
785
804
  }
@@ -862,9 +881,9 @@ export const MCP_TOOLS = {
862
881
  }
863
882
  }
864
883
  },
865
- "matches": {
884
+ "responseMatches": {
866
885
  "type": "array",
867
- "description": "A list of match conditions for the response.",
886
+ "description": "Conditions the (redacted) response must satisfy for the proof to be valid. Each runs against the union of the portions revealed by `responseRedactions` (or the whole response when there are none). Mirrors attestor-core `responseMatches`.",
868
887
  "minItems": 1,
869
888
  "items": {
870
889
  "type": "object",
@@ -902,33 +921,38 @@ export const MCP_TOOLS = {
902
921
  "value": {
903
922
  "type": "string",
904
923
  "description": "The pattern or value to look for in the response. When `type` is 'contains', supports template variable declaration using `{{variable}}` syntax. When `type` is 'regex', can be used to extract variables using regex named groups."
924
+ }
925
+ }
926
+ }
927
+ },
928
+ "responseRedactions": {
929
+ "type": "array",
930
+ "description": "Portions to select/reveal from the response, applied in order (xPath => jsonPath => regex). Done client-side; only the selected portions (plus the first response line) are sent to the attestor. An independent ordered list — NOT paired 1:1 with `responseMatches`. Mirrors attestor-core `responseRedactions`.",
931
+ "items": {
932
+ "type": "object",
933
+ "additionalProperties": false,
934
+ "description": "Which portions to select from a response. These are selected in order, xpath => jsonPath => regex * These redactions are done client side and only the selected portions are sent to the attestor. The attestor will only be able to see the selected portions alongside the first line of the HTTP response (i.e. \"HTTP/1.1 200 OK\")",
935
+ "properties": {
936
+ "xPath": {
937
+ "type": "string",
938
+ "description": "expect an HTML response, and to contain a certain xpath for eg. \"/html/body/div.a1/div.a2/span.a5\""
939
+ },
940
+ "jsonPath": {
941
+ "type": "string",
942
+ "description": "expect a JSON response, retrieve the item at this path using dot notation for e.g. 'email.addresses.0'"
943
+ },
944
+ "regex": {
945
+ "type": "string",
946
+ "description": "select a regex match from the response"
905
947
  },
906
- "extract": {
907
- "type": "object",
908
- "description": "Which portions to select from a response. These are selected in order, xpath => jsonPath => regex * These redactions are done client side and only the selected portions are sent to the attestor. The attestor will only be able to see the selected portions alongside the first line of the HTTP response (i.e. \"HTTP/1.1 200 OK\")",
909
- "properties": {
910
- "xPath": {
911
- "type": "string",
912
- "description": "expect an HTML response, and to contain a certain xpath for eg. \"/html/body/div.a1/div.a2/span.a5\""
913
- },
914
- "jsonPath": {
915
- "type": "string",
916
- "description": "expect a JSON response, retrieve the item at this path using dot notation for e.g. 'email.addresses.0'"
917
- },
918
- "regex": {
919
- "type": "string",
920
- "description": "select a regex match from the response"
921
- },
922
- "hash": {
923
- "type": "string",
924
- "description": "If provided, the value inside will be hashed instead of being redacted. Useful for cases where the data inside is an identifiying piece of information that you don't want to reveal to the attestor, eg. an email address.\nIf the hash function produces more bytes than the original value, the hash will be truncated.\nEg. if hash is enabled, the original value is \"hello\", and hashed is \"a1b2c\", then the attestor will only see \"a1b2c\".\nNote: if a regex with named groups is provided, only the named groups will be hashed.",
925
- "enum": [
926
- "oprf",
927
- "oprf-mpc",
928
- "oprf-raw"
929
- ]
930
- }
931
- }
948
+ "hash": {
949
+ "type": "string",
950
+ "description": "If provided, the value inside will be hashed instead of being redacted. Useful for cases where the data inside is an identifiying piece of information that you don't want to reveal to the attestor, eg. an email address.\nIf the hash function produces more bytes than the original value, the hash will be truncated.\nEg. if hash is enabled, the original value is \"hello\", and hashed is \"a1b2c\", then the attestor will only see \"a1b2c\".\nNote: if a regex with named groups is provided, only the named groups will be hashed.",
951
+ "enum": [
952
+ "oprf",
953
+ "oprf-mpc",
954
+ "oprf-raw"
955
+ ]
932
956
  }
933
957
  }
934
958
  }
@@ -1088,30 +1112,45 @@ export const MCP_TOOLS = {
1088
1112
  "body": {
1089
1113
  "type": "object",
1090
1114
  "additionalProperties": false,
1091
- "description": "Body for `POST /verifications/sessions`. Authenticated by the consumer's `OrgToken`. Carries no callback URLs — they come from the org's callback subscriptions.",
1115
+ "description": "Body for `POST /verifications/sessions`. Authenticated by the consumer's `OrgToken`. Carries no callback URLs — they come from the org's callback subscriptions. The one shared `context` is validated against every provider's `requiredContext`.",
1092
1116
  "required": [
1093
- "providerId",
1117
+ "providers",
1094
1118
  "context",
1095
1119
  "verificationClientUrl"
1096
1120
  ],
1097
1121
  "properties": {
1098
- "providerId": {
1099
- "type": "string",
1100
- "format": "uuid"
1101
- },
1102
- "version": {
1103
- "type": "string",
1104
- "description": "Semver constraint; empty resolves to the latest trunk version.",
1105
- "maxLength": 64
1122
+ "providers": {
1123
+ "type": "array",
1124
+ "minItems": 1,
1125
+ "description": "Providers to verify, in run order. The Verification Client runs each sequentially in one browser session and submits one combined result; all are required.",
1126
+ "items": {
1127
+ "type": "object",
1128
+ "additionalProperties": false,
1129
+ "description": "A provider (+ optional version) to verify in a session.",
1130
+ "required": [
1131
+ "providerId"
1132
+ ],
1133
+ "properties": {
1134
+ "providerId": {
1135
+ "type": "string",
1136
+ "format": "uuid"
1137
+ },
1138
+ "version": {
1139
+ "type": "string",
1140
+ "description": "Semver constraint; empty resolves to the latest trunk version.",
1141
+ "maxLength": 64
1142
+ }
1143
+ }
1144
+ }
1106
1145
  },
1107
1146
  "context": {
1108
1147
  "type": "object",
1109
1148
  "additionalProperties": true,
1110
- "description": "Consumer context. Validated against the resolved provider version's `requiredContext` JSON Schema (a 400 is returned on mismatch); extra fields are always allowed. Recipe requests reference these values as `{{context.<key>}}`. Echoed back (plus `reclaimSessionId`) in the result."
1149
+ "description": "Consumer context, shared by all providers. Validated against EACH resolved provider version's `requiredContext` JSON Schema (a 400 is returned on mismatch); extra fields are always allowed. Recipe requests reference these values as `{{context.<key>}}`. Echoed back (plus `reclaimSessionId`) in the result."
1111
1150
  },
1112
1151
  "verificationClientUrl": {
1113
1152
  "type": "string",
1114
- "description": "Must contain a `{sessionId}` placeholder.",
1153
+ "description": "Must contain a `{sessionId}` placeholder. Must be an http(s) URL.",
1115
1154
  "maxLength": 2000
1116
1155
  }
1117
1156
  }
@@ -1257,8 +1296,8 @@ export const MCP_TOOLS = {
1257
1296
  "additionalProperties": false
1258
1297
  }),
1259
1298
  },
1260
- "DeleteOrgCredential": {
1261
- description: "Clear the organization's encryption credential\n\nRemoves the organization's encryption credential. After this, terminal results are delivered as plaintext until a new credential is set. Authenticated by the org's `OrgToken` or a human `BearerAuth` session for an active member of the org.",
1299
+ "DeleteOrgKeypair": {
1300
+ description: "Clear the organization's encryption keypair\n\nRemoves the organization's encryption keypair (the org reverts to keyless ⇒ plaintext delivery, and loses its eth identity address) until a new keypair is set. Authenticated by the org's `OrgToken` or a human `BearerAuth` session for an active member of the org.",
1262
1301
  inputSchema: toZod({
1263
1302
  "type": "object",
1264
1303
  "properties": {
@@ -1462,7 +1501,19 @@ export const MCP_TOOLS = {
1462
1501
  },
1463
1502
  "query": {
1464
1503
  "type": "object",
1465
- "properties": {}
1504
+ "properties": {
1505
+ "tab": {
1506
+ "type": "string",
1507
+ "enum": [
1508
+ "connect",
1509
+ "providers",
1510
+ "members",
1511
+ "themes",
1512
+ "sessions",
1513
+ "billing"
1514
+ ]
1515
+ }
1516
+ }
1466
1517
  },
1467
1518
  "body": {
1468
1519
  "type": "object"
@@ -1508,8 +1559,8 @@ export const MCP_TOOLS = {
1508
1559
  "additionalProperties": false
1509
1560
  }),
1510
1561
  },
1511
- "GetOrgCredential": {
1512
- description: "Get the organization's encryption credential\n\nReturns the organization's single X25519 encryption credential — the public JWK the Builder uses to JWE-encrypt delivered results — or `404` when none is set (delivery is plaintext in that case). Authenticated by the org's `OrgToken` or a human `BearerAuth` session for an active member of the org.",
1562
+ "GetOrgKeypair": {
1563
+ description: "Get the organization's encryption keypair\n\nReturns the organization's single Ethereum (secp256k1) encryption keypair — its public JWK, derived eth address, and `canEncryptResult` flag — or `404` when none is set (the org is keyless ⇒ plaintext delivery). Authenticated by the org's `OrgToken` or a human `BearerAuth` session for an active member of the org.",
1513
1564
  inputSchema: toZod({
1514
1565
  "type": "object",
1515
1566
  "properties": {
@@ -2088,7 +2139,6 @@ export const MCP_TOOLS = {
2088
2139
  "properties": {
2089
2140
  "q": {
2090
2141
  "type": "string",
2091
- "minLength": 1,
2092
2142
  "maxLength": 200
2093
2143
  },
2094
2144
  "tag": {
@@ -2245,8 +2295,8 @@ export const MCP_TOOLS = {
2245
2295
  "additionalProperties": false
2246
2296
  }),
2247
2297
  },
2248
- "SetOrgCredential": {
2249
- description: "Set (or replace) the organization's encryption credential\n\nUpserts the organization's single X25519 encryption credential. The body carries the org's **encryption public JWK** (`{kty:'OKP', crv:'X25519', x}`); the matching private key never leaves the consumer. Replacing overwrites the single row. Once set, terminal results are delivered as a compact JWE encrypted to this key; clear it to revert to plaintext delivery. Authenticated by the org's `OrgToken` or a human `BearerAuth` session for an active member of the org.",
2298
+ "SetOrgKeypair": {
2299
+ description: "Set (or rotate) the organization's encryption keypair\n\nUpserts the organization's single Ethereum (secp256k1) encryption keypair. The body carries the org's **eth public key** — as an uncompressed hex string (`0x04`+128 hex) or a secp256k1 public JWK (`{kty:'EC', crv:'secp256k1', x, y}`) — and `canEncryptResult`. The matching private key never leaves the consumer. Setting overwrites the single row (and creates it for a keyless org). When `canEncryptResult` is true, terminal results are delivered as an ECIES ciphertext encrypted to this key; otherwise plaintext. Authenticated by the org's `OrgToken` or a human `BearerAuth` session for an active member of the org.",
2250
2300
  inputSchema: toZod({
2251
2301
  "type": "object",
2252
2302
  "properties": {
@@ -2268,49 +2318,88 @@ export const MCP_TOOLS = {
2268
2318
  "properties": {}
2269
2319
  },
2270
2320
  "body": {
2271
- "type": "object",
2272
- "additionalProperties": false,
2273
- "description": "Body for `PUT /orgs/{orgId}/credential`.",
2274
- "required": [
2275
- "publicKeyJwk"
2276
- ],
2277
- "properties": {
2278
- "publicKeyJwk": {
2321
+ "oneOf": [
2322
+ {
2279
2323
  "type": "object",
2280
2324
  "additionalProperties": false,
2281
- "description": "An X25519 public key in JWK form (RFC 8037 OKP), used to JWE-encrypt delivered verification results. The matching private key never leaves the consumer.",
2325
+ "description": "Body for `PUT /orgs/{orgId}/keypair`. Carries the org's eth public key as an uncompressed hex string (`0x04` + 128 hex) — the eth-native form wallets/ethers emit. The matching private key never leaves the consumer.",
2282
2326
  "required": [
2283
- "kty",
2284
- "crv",
2285
- "x"
2327
+ "publicKey"
2286
2328
  ],
2287
2329
  "properties": {
2288
- "kty": {
2330
+ "publicKey": {
2289
2331
  "type": "string",
2290
- "enum": [
2291
- "OKP"
2292
- ]
2332
+ "description": "Uncompressed secp256k1 public key, `0x04` + 128 hex.",
2333
+ "pattern": "^0x04[0-9a-fA-F]{128}$"
2293
2334
  },
2294
- "crv": {
2295
- "type": "string",
2296
- "enum": [
2297
- "X25519"
2298
- ]
2335
+ "canEncryptResult": {
2336
+ "type": "boolean",
2337
+ "default": false
2299
2338
  },
2300
- "x": {
2339
+ "label": {
2301
2340
  "type": "string",
2302
- "description": "base64url-encoded public key bytes.",
2303
2341
  "minLength": 1,
2304
- "maxLength": 128
2342
+ "maxLength": 100
2305
2343
  }
2306
2344
  }
2307
2345
  },
2308
- "label": {
2309
- "type": "string",
2310
- "minLength": 1,
2311
- "maxLength": 100
2346
+ {
2347
+ "type": "object",
2348
+ "additionalProperties": false,
2349
+ "description": "Body for `PUT /orgs/{orgId}/keypair`. Carries the org's eth public key as a secp256k1 public JWK.",
2350
+ "required": [
2351
+ "publicKeyJwk"
2352
+ ],
2353
+ "properties": {
2354
+ "publicKeyJwk": {
2355
+ "type": "object",
2356
+ "additionalProperties": false,
2357
+ "description": "A secp256k1 (Ethereum) public key in JWK form (`{kty:'EC', crv:'secp256k1', x, y}`), used to ECIES-encrypt delivered verification results and to identify the org. The matching private key never leaves the consumer. Same shape published by the signing JWKS.",
2358
+ "required": [
2359
+ "kty",
2360
+ "crv",
2361
+ "x",
2362
+ "y"
2363
+ ],
2364
+ "properties": {
2365
+ "kty": {
2366
+ "type": "string",
2367
+ "enum": [
2368
+ "EC"
2369
+ ]
2370
+ },
2371
+ "crv": {
2372
+ "type": "string",
2373
+ "enum": [
2374
+ "secp256k1"
2375
+ ]
2376
+ },
2377
+ "x": {
2378
+ "type": "string",
2379
+ "description": "base64url-encoded X coordinate (32 bytes).",
2380
+ "minLength": 1,
2381
+ "maxLength": 64
2382
+ },
2383
+ "y": {
2384
+ "type": "string",
2385
+ "description": "base64url-encoded Y coordinate (32 bytes).",
2386
+ "minLength": 1,
2387
+ "maxLength": 64
2388
+ }
2389
+ }
2390
+ },
2391
+ "canEncryptResult": {
2392
+ "type": "boolean",
2393
+ "default": false
2394
+ },
2395
+ "label": {
2396
+ "type": "string",
2397
+ "minLength": 1,
2398
+ "maxLength": 100
2399
+ }
2400
+ }
2312
2401
  }
2313
- }
2402
+ ]
2314
2403
  }
2315
2404
  },
2316
2405
  "required": [
@@ -2414,40 +2503,6 @@ export const MCP_TOOLS = {
2414
2503
  "additionalProperties": false
2415
2504
  }),
2416
2505
  },
2417
- "UpdateMe": {
2418
- description: "Update the authenticated user's profile",
2419
- inputSchema: toZod({
2420
- "type": "object",
2421
- "properties": {
2422
- "params": {
2423
- "type": "object",
2424
- "properties": {}
2425
- },
2426
- "query": {
2427
- "type": "object",
2428
- "properties": {}
2429
- },
2430
- "body": {
2431
- "type": "object",
2432
- "additionalProperties": false,
2433
- "description": "Caller-editable fields on the authenticated user.",
2434
- "properties": {
2435
- "name": {
2436
- "type": "string",
2437
- "minLength": 1,
2438
- "maxLength": 200
2439
- }
2440
- }
2441
- }
2442
- },
2443
- "required": [
2444
- "params",
2445
- "query",
2446
- "body"
2447
- ],
2448
- "additionalProperties": false
2449
- }),
2450
- },
2451
2506
  "UpdateOrg": {
2452
2507
  description: "Update an organization\n\nOwner only.",
2453
2508
  inputSchema: toZod({
@@ -2809,9 +2864,9 @@ export const MCP_TOOLS = {
2809
2864
  }
2810
2865
  }
2811
2866
  },
2812
- "matches": {
2867
+ "responseMatches": {
2813
2868
  "type": "array",
2814
- "description": "A list of match conditions for the response.",
2869
+ "description": "Conditions the (redacted) response must satisfy for the proof to be valid. Each runs against the union of the portions revealed by `responseRedactions` (or the whole response when there are none). Mirrors attestor-core `responseMatches`.",
2815
2870
  "minItems": 1,
2816
2871
  "items": {
2817
2872
  "type": "object",
@@ -2849,33 +2904,38 @@ export const MCP_TOOLS = {
2849
2904
  "value": {
2850
2905
  "type": "string",
2851
2906
  "description": "The pattern or value to look for in the response. When `type` is 'contains', supports template variable declaration using `{{variable}}` syntax. When `type` is 'regex', can be used to extract variables using regex named groups."
2907
+ }
2908
+ }
2909
+ }
2910
+ },
2911
+ "responseRedactions": {
2912
+ "type": "array",
2913
+ "description": "Portions to select/reveal from the response, applied in order (xPath => jsonPath => regex). Done client-side; only the selected portions (plus the first response line) are sent to the attestor. An independent ordered list — NOT paired 1:1 with `responseMatches`. Mirrors attestor-core `responseRedactions`.",
2914
+ "items": {
2915
+ "type": "object",
2916
+ "additionalProperties": false,
2917
+ "description": "Which portions to select from a response. These are selected in order, xpath => jsonPath => regex * These redactions are done client side and only the selected portions are sent to the attestor. The attestor will only be able to see the selected portions alongside the first line of the HTTP response (i.e. \"HTTP/1.1 200 OK\")",
2918
+ "properties": {
2919
+ "xPath": {
2920
+ "type": "string",
2921
+ "description": "expect an HTML response, and to contain a certain xpath for eg. \"/html/body/div.a1/div.a2/span.a5\""
2852
2922
  },
2853
- "extract": {
2854
- "type": "object",
2855
- "description": "Which portions to select from a response. These are selected in order, xpath => jsonPath => regex * These redactions are done client side and only the selected portions are sent to the attestor. The attestor will only be able to see the selected portions alongside the first line of the HTTP response (i.e. \"HTTP/1.1 200 OK\")",
2856
- "properties": {
2857
- "xPath": {
2858
- "type": "string",
2859
- "description": "expect an HTML response, and to contain a certain xpath for eg. \"/html/body/div.a1/div.a2/span.a5\""
2860
- },
2861
- "jsonPath": {
2862
- "type": "string",
2863
- "description": "expect a JSON response, retrieve the item at this path using dot notation for e.g. 'email.addresses.0'"
2864
- },
2865
- "regex": {
2866
- "type": "string",
2867
- "description": "select a regex match from the response"
2868
- },
2869
- "hash": {
2870
- "type": "string",
2871
- "description": "If provided, the value inside will be hashed instead of being redacted. Useful for cases where the data inside is an identifiying piece of information that you don't want to reveal to the attestor, eg. an email address.\nIf the hash function produces more bytes than the original value, the hash will be truncated.\nEg. if hash is enabled, the original value is \"hello\", and hashed is \"a1b2c\", then the attestor will only see \"a1b2c\".\nNote: if a regex with named groups is provided, only the named groups will be hashed.",
2872
- "enum": [
2873
- "oprf",
2874
- "oprf-mpc",
2875
- "oprf-raw"
2876
- ]
2877
- }
2878
- }
2923
+ "jsonPath": {
2924
+ "type": "string",
2925
+ "description": "expect a JSON response, retrieve the item at this path using dot notation for e.g. 'email.addresses.0'"
2926
+ },
2927
+ "regex": {
2928
+ "type": "string",
2929
+ "description": "select a regex match from the response"
2930
+ },
2931
+ "hash": {
2932
+ "type": "string",
2933
+ "description": "If provided, the value inside will be hashed instead of being redacted. Useful for cases where the data inside is an identifiying piece of information that you don't want to reveal to the attestor, eg. an email address.\nIf the hash function produces more bytes than the original value, the hash will be truncated.\nEg. if hash is enabled, the original value is \"hello\", and hashed is \"a1b2c\", then the attestor will only see \"a1b2c\".\nNote: if a regex with named groups is provided, only the named groups will be hashed.",
2934
+ "enum": [
2935
+ "oprf",
2936
+ "oprf-mpc",
2937
+ "oprf-raw"
2938
+ ]
2879
2939
  }
2880
2940
  }
2881
2941
  }
@@ -2957,9 +3017,9 @@ export const MCP_TOOLS = {
2957
3017
  }
2958
3018
  }
2959
3019
  },
2960
- "matches": {
3020
+ "responseMatches": {
2961
3021
  "type": "array",
2962
- "description": "A list of match conditions for the response.",
3022
+ "description": "Conditions the (redacted) response must satisfy for the proof to be valid. Each runs against the union of the portions revealed by `responseRedactions` (or the whole response when there are none). Mirrors attestor-core `responseMatches`.",
2963
3023
  "minItems": 1,
2964
3024
  "items": {
2965
3025
  "type": "object",
@@ -2997,33 +3057,38 @@ export const MCP_TOOLS = {
2997
3057
  "value": {
2998
3058
  "type": "string",
2999
3059
  "description": "The pattern or value to look for in the response. When `type` is 'contains', supports template variable declaration using `{{variable}}` syntax. When `type` is 'regex', can be used to extract variables using regex named groups."
3060
+ }
3061
+ }
3062
+ }
3063
+ },
3064
+ "responseRedactions": {
3065
+ "type": "array",
3066
+ "description": "Portions to select/reveal from the response, applied in order (xPath => jsonPath => regex). Done client-side; only the selected portions (plus the first response line) are sent to the attestor. An independent ordered list — NOT paired 1:1 with `responseMatches`. Mirrors attestor-core `responseRedactions`.",
3067
+ "items": {
3068
+ "type": "object",
3069
+ "additionalProperties": false,
3070
+ "description": "Which portions to select from a response. These are selected in order, xpath => jsonPath => regex * These redactions are done client side and only the selected portions are sent to the attestor. The attestor will only be able to see the selected portions alongside the first line of the HTTP response (i.e. \"HTTP/1.1 200 OK\")",
3071
+ "properties": {
3072
+ "xPath": {
3073
+ "type": "string",
3074
+ "description": "expect an HTML response, and to contain a certain xpath for eg. \"/html/body/div.a1/div.a2/span.a5\""
3000
3075
  },
3001
- "extract": {
3002
- "type": "object",
3003
- "description": "Which portions to select from a response. These are selected in order, xpath => jsonPath => regex * These redactions are done client side and only the selected portions are sent to the attestor. The attestor will only be able to see the selected portions alongside the first line of the HTTP response (i.e. \"HTTP/1.1 200 OK\")",
3004
- "properties": {
3005
- "xPath": {
3006
- "type": "string",
3007
- "description": "expect an HTML response, and to contain a certain xpath for eg. \"/html/body/div.a1/div.a2/span.a5\""
3008
- },
3009
- "jsonPath": {
3010
- "type": "string",
3011
- "description": "expect a JSON response, retrieve the item at this path using dot notation for e.g. 'email.addresses.0'"
3012
- },
3013
- "regex": {
3014
- "type": "string",
3015
- "description": "select a regex match from the response"
3016
- },
3017
- "hash": {
3018
- "type": "string",
3019
- "description": "If provided, the value inside will be hashed instead of being redacted. Useful for cases where the data inside is an identifiying piece of information that you don't want to reveal to the attestor, eg. an email address.\nIf the hash function produces more bytes than the original value, the hash will be truncated.\nEg. if hash is enabled, the original value is \"hello\", and hashed is \"a1b2c\", then the attestor will only see \"a1b2c\".\nNote: if a regex with named groups is provided, only the named groups will be hashed.",
3020
- "enum": [
3021
- "oprf",
3022
- "oprf-mpc",
3023
- "oprf-raw"
3024
- ]
3025
- }
3026
- }
3076
+ "jsonPath": {
3077
+ "type": "string",
3078
+ "description": "expect a JSON response, retrieve the item at this path using dot notation for e.g. 'email.addresses.0'"
3079
+ },
3080
+ "regex": {
3081
+ "type": "string",
3082
+ "description": "select a regex match from the response"
3083
+ },
3084
+ "hash": {
3085
+ "type": "string",
3086
+ "description": "If provided, the value inside will be hashed instead of being redacted. Useful for cases where the data inside is an identifiying piece of information that you don't want to reveal to the attestor, eg. an email address.\nIf the hash function produces more bytes than the original value, the hash will be truncated.\nEg. if hash is enabled, the original value is \"hello\", and hashed is \"a1b2c\", then the attestor will only see \"a1b2c\".\nNote: if a regex with named groups is provided, only the named groups will be hashed.",
3087
+ "enum": [
3088
+ "oprf",
3089
+ "oprf-mpc",
3090
+ "oprf-raw"
3091
+ ]
3027
3092
  }
3028
3093
  }
3029
3094
  }