@lemmaoracle/spec 0.0.31 → 0.0.33
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/dist/index.d.ts +72 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +19 -1
- package/dist/index.js.map +1 -1
- package/openapi.lemma.v2.bundled.json +2662 -0
- package/openapi.lemma.v2.json +243 -4
- package/package.json +13 -4
- package/schemas/_headers +12 -0
- package/schemas/bazaar/canonical-error.json +41 -0
- package/schemas/suites/bazaar-extension-metadata.json +61 -0
- package/schemas/suites/product-a-input.json +127 -0
- package/schemas/suites/product-a-output.json +113 -0
- package/schemas/suites/product-b-input.json +61 -0
- package/schemas/suites/product-b-output.json +66 -0
- package/schemas/suites/product-c-input.json +78 -0
- package/schemas/suites/product-c-output.json +74 -0
- package/schemas/suites/product-d-input.json +52 -0
- package/schemas/suites/product-d-output.json +50 -0
package/openapi.lemma.v2.json
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
{
|
|
2
|
-
"openapi": "3.0
|
|
2
|
+
"openapi": "3.1.0",
|
|
3
3
|
"info": {
|
|
4
4
|
"title": "Lemma v2 API",
|
|
5
|
-
"version": "0.
|
|
6
|
-
"description": "REST surface derived from the Lemma v2 whitepaper SDK interface (§3, §4)."
|
|
5
|
+
"version": "0.2.0",
|
|
6
|
+
"description": "REST surface derived from the Lemma v2 whitepaper SDK interface (§3, §4). v0.2 adds the 4 Bazaar Discovery Layer products under /v1/suites/* (see x-bazaar extension)."
|
|
7
7
|
},
|
|
8
|
-
"servers": [
|
|
8
|
+
"servers": [
|
|
9
|
+
{ "url": "https://api.lemma.frame00.com", "description": "Production (Base mainnet)" },
|
|
10
|
+
{ "url": "http://localhost:8787", "description": "Local development" }
|
|
11
|
+
],
|
|
9
12
|
"components": {
|
|
10
13
|
"securitySchemes": {
|
|
11
14
|
"ApiKeyAuth": { "type": "apiKey", "in": "header", "name": "x-api-key" }
|
|
@@ -527,6 +530,242 @@
|
|
|
527
530
|
}
|
|
528
531
|
}
|
|
529
532
|
}
|
|
533
|
+
},
|
|
534
|
+
|
|
535
|
+
"/v1/suites/identity/issue": {
|
|
536
|
+
"post": {
|
|
537
|
+
"operationId": "issueAgentIdentity",
|
|
538
|
+
"summary": "Agent Identity Issuance — issue a W3C VC v2 credential with Poseidon Merkle inclusion proof",
|
|
539
|
+
"description": "For AI agents that need to issue verifiable identity credentials to other agents or services, this endpoint mints a W3C VC v2 credential with Poseidon Merkle inclusion proof and Groth16 zero-knowledge verification.",
|
|
540
|
+
"tags": ["bazaar", "infrastructure", "agent-identity"],
|
|
541
|
+
"x-bazaar": {
|
|
542
|
+
"discoverable": true,
|
|
543
|
+
"schema": "agent-identity-authority-v1",
|
|
544
|
+
"category": "Infrastructure",
|
|
545
|
+
"subTags": ["agent-identity", "zk-proof", "did", "kya", "verifiable-credentials"],
|
|
546
|
+
"price": { "amount": "0.05", "currency": "USDC", "network": "base" }
|
|
547
|
+
},
|
|
548
|
+
"x-lemma-circuit": {
|
|
549
|
+
"id": "agent-identity-v1",
|
|
550
|
+
"location": "packages/agent/circuits/agent-identity-valid.circom",
|
|
551
|
+
"proofSystem": "Groth16"
|
|
552
|
+
},
|
|
553
|
+
"x-lemma-facilitator-requirement": "CDP",
|
|
554
|
+
"requestBody": {
|
|
555
|
+
"required": true,
|
|
556
|
+
"content": {
|
|
557
|
+
"application/json": { "schema": { "$ref": "./schemas/suites/product-a-input.json" } }
|
|
558
|
+
}
|
|
559
|
+
},
|
|
560
|
+
"responses": {
|
|
561
|
+
"200": {
|
|
562
|
+
"description": "Credential issued, anchored, and ready for downstream verification",
|
|
563
|
+
"headers": {
|
|
564
|
+
"X-Lemma-Bazaar-Schema": { "schema": { "type": "string", "const": "agent-identity-authority-v1" } },
|
|
565
|
+
"X-Lemma-Bazaar-Category": { "schema": { "type": "string", "const": "Infrastructure" } },
|
|
566
|
+
"EXTENSION-RESPONSES": {
|
|
567
|
+
"schema": { "type": "string" },
|
|
568
|
+
"description": "CDP facilitator processing status (status=accepted|processing|rejected). Returned only when settled via the CDP facilitator with discoverable: true."
|
|
569
|
+
}
|
|
570
|
+
},
|
|
571
|
+
"content": {
|
|
572
|
+
"application/json": { "schema": { "$ref": "./schemas/suites/product-a-output.json" } }
|
|
573
|
+
}
|
|
574
|
+
},
|
|
575
|
+
"400": { "description": "Validation error", "content": { "application/json": { "schema": { "$ref": "./schemas/bazaar/canonical-error.json" } } } },
|
|
576
|
+
"401": { "description": "Authentication failure", "content": { "application/json": { "schema": { "$ref": "./schemas/bazaar/canonical-error.json" } } } },
|
|
577
|
+
"402": {
|
|
578
|
+
"description": "Payment required (x402 challenge)",
|
|
579
|
+
"headers": {
|
|
580
|
+
"X-PAYMENT-RESPONSE": { "schema": { "type": "string" }, "description": "x402 payment challenge envelope." }
|
|
581
|
+
},
|
|
582
|
+
"content": { "application/json": { "schema": { "type": "object", "additionalProperties": true, "description": "x402 challenge body. See @x402/core spec for shape." } } }
|
|
583
|
+
},
|
|
584
|
+
"404": { "description": "Subject prerequisite missing", "content": { "application/json": { "schema": { "$ref": "./schemas/bazaar/canonical-error.json" } } } },
|
|
585
|
+
"500": { "description": "Internal error", "content": { "application/json": { "schema": { "$ref": "./schemas/bazaar/canonical-error.json" } } } }
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
},
|
|
589
|
+
|
|
590
|
+
"/v1/suites/inference/attest": {
|
|
591
|
+
"post": {
|
|
592
|
+
"operationId": "attestInference",
|
|
593
|
+
"summary": "Inference Attestation API — Groth16 attestation that a given model produced a given output",
|
|
594
|
+
"description": "For AI agents and companies running their own inference (Bedrock, OpenAI, Anthropic, Ollama), this endpoint generates a Groth16 zero-knowledge attestation that proves which model produced which output, anchored on Base mainnet. Lemma never sees raw data.",
|
|
595
|
+
"tags": ["bazaar", "inference"],
|
|
596
|
+
"x-bazaar": {
|
|
597
|
+
"discoverable": true,
|
|
598
|
+
"schema": "inference-attestation-v1",
|
|
599
|
+
"category": "Inference",
|
|
600
|
+
"subTags": ["verifiable-ai", "audit-trail", "zk-proof", "provenance", "inference-attestation", "claim-check", "model-tampering-detection"],
|
|
601
|
+
"price": { "amount": "0.07", "currency": "USDC", "network": "base" }
|
|
602
|
+
},
|
|
603
|
+
"x-lemma-circuit": {
|
|
604
|
+
"id": "attestation-commitment-v1",
|
|
605
|
+
"location": "packages/attestation/circuits/",
|
|
606
|
+
"proofSystem": "Groth16"
|
|
607
|
+
},
|
|
608
|
+
"x-lemma-facilitator-requirement": "CDP",
|
|
609
|
+
"requestBody": {
|
|
610
|
+
"required": true,
|
|
611
|
+
"content": {
|
|
612
|
+
"application/json": { "schema": { "$ref": "./schemas/suites/product-b-input.json" } }
|
|
613
|
+
}
|
|
614
|
+
},
|
|
615
|
+
"responses": {
|
|
616
|
+
"200": {
|
|
617
|
+
"description": "Attestation generated, anchored, and ready for downstream verification",
|
|
618
|
+
"headers": {
|
|
619
|
+
"X-Lemma-Bazaar-Schema": { "schema": { "type": "string", "const": "inference-attestation-v1" } },
|
|
620
|
+
"X-Lemma-Bazaar-Category": { "schema": { "type": "string", "const": "Inference" } },
|
|
621
|
+
"X-Lemma-Attestation": { "schema": { "type": "string" }, "description": "Compact attestation reference (id;verify=URL;circuit=name)." },
|
|
622
|
+
"X-Lemma-Attestation-Status": { "schema": { "type": "string", "enum": ["anchored", "deferred"] } },
|
|
623
|
+
"EXTENSION-RESPONSES": { "schema": { "type": "string" }, "description": "CDP facilitator processing status." }
|
|
624
|
+
},
|
|
625
|
+
"content": {
|
|
626
|
+
"application/json": { "schema": { "$ref": "./schemas/suites/product-b-output.json" } }
|
|
627
|
+
}
|
|
628
|
+
},
|
|
629
|
+
"400": { "description": "Validation error / timestamp skew", "content": { "application/json": { "schema": { "$ref": "./schemas/bazaar/canonical-error.json" } } } },
|
|
630
|
+
"401": { "description": "Authentication failure", "content": { "application/json": { "schema": { "$ref": "./schemas/bazaar/canonical-error.json" } } } },
|
|
631
|
+
"402": {
|
|
632
|
+
"description": "Payment required (x402 challenge)",
|
|
633
|
+
"headers": { "X-PAYMENT-RESPONSE": { "schema": { "type": "string" } } },
|
|
634
|
+
"content": { "application/json": { "schema": { "type": "object", "additionalProperties": true } } }
|
|
635
|
+
},
|
|
636
|
+
"500": { "description": "Internal error", "content": { "application/json": { "schema": { "$ref": "./schemas/bazaar/canonical-error.json" } } } }
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
},
|
|
640
|
+
|
|
641
|
+
"/v1/suites/compliance/bundle": {
|
|
642
|
+
"post": {
|
|
643
|
+
"operationId": "issueComplianceBundle",
|
|
644
|
+
"summary": "Compliance Attestation Bundle (Basic) — BBS+ selective-disclosure proof for 2-3 standard attributes",
|
|
645
|
+
"description": "For AI agents that need to present compliance claims (KYC status, jurisdiction, sanctions clearance) to gated endpoints without revealing underlying data, this Basic bundle returns a BBS+ selective-disclosure proof for 2-3 standard attributes per call.",
|
|
646
|
+
"tags": ["bazaar", "infrastructure", "compliance"],
|
|
647
|
+
"x-bazaar": {
|
|
648
|
+
"discoverable": true,
|
|
649
|
+
"schema": "compliance-bundle-v1",
|
|
650
|
+
"category": "Infrastructure",
|
|
651
|
+
"subTags": ["compliance", "mica", "kyc", "bbs", "selective-disclosure", "regulatory"],
|
|
652
|
+
"price": { "amount": "0.08", "currency": "USDC", "network": "base" }
|
|
653
|
+
},
|
|
654
|
+
"x-lemma-circuit": {
|
|
655
|
+
"id": "bbs-bls12-381",
|
|
656
|
+
"proofSystem": "BBS+",
|
|
657
|
+
"library": "@lemmaoracle/sdk (noble-curves backend)"
|
|
658
|
+
},
|
|
659
|
+
"x-lemma-facilitator-requirement": "CDP",
|
|
660
|
+
"requestBody": {
|
|
661
|
+
"required": true,
|
|
662
|
+
"content": {
|
|
663
|
+
"application/json": { "schema": { "$ref": "./schemas/suites/product-c-input.json" } }
|
|
664
|
+
}
|
|
665
|
+
},
|
|
666
|
+
"responses": {
|
|
667
|
+
"200": {
|
|
668
|
+
"description": "Bundle generated with the requested disclosure mode",
|
|
669
|
+
"headers": {
|
|
670
|
+
"X-Lemma-Bazaar-Schema": { "schema": { "type": "string", "const": "compliance-bundle-v1" } },
|
|
671
|
+
"X-Lemma-Bazaar-Category": { "schema": { "type": "string", "const": "Infrastructure" } },
|
|
672
|
+
"EXTENSION-RESPONSES": { "schema": { "type": "string" }, "description": "CDP facilitator processing status." }
|
|
673
|
+
},
|
|
674
|
+
"content": {
|
|
675
|
+
"application/json": { "schema": { "$ref": "./schemas/suites/product-c-output.json" } }
|
|
676
|
+
}
|
|
677
|
+
},
|
|
678
|
+
"400": { "description": "Validation / unsupported attribute (Basic plan)", "content": { "application/json": { "schema": { "$ref": "./schemas/bazaar/canonical-error.json" } } } },
|
|
679
|
+
"401": { "description": "Authentication failure", "content": { "application/json": { "schema": { "$ref": "./schemas/bazaar/canonical-error.json" } } } },
|
|
680
|
+
"402": {
|
|
681
|
+
"description": "Payment required (x402 challenge)",
|
|
682
|
+
"headers": { "X-PAYMENT-RESPONSE": { "schema": { "type": "string" } } },
|
|
683
|
+
"content": { "application/json": { "schema": { "type": "object", "additionalProperties": true } } }
|
|
684
|
+
},
|
|
685
|
+
"404": { "description": "Subject onboarding missing", "content": { "application/json": { "schema": { "$ref": "./schemas/bazaar/canonical-error.json" } } } },
|
|
686
|
+
"500": { "description": "Internal error", "content": { "application/json": { "schema": { "$ref": "./schemas/bazaar/canonical-error.json" } } } }
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
},
|
|
690
|
+
|
|
691
|
+
"/v1/suites/auth/challenge": {
|
|
692
|
+
"get": {
|
|
693
|
+
"operationId": "issueAuthChallenge",
|
|
694
|
+
"summary": "ZK Proof Sign-in challenge — issue a single-use nonce (free, no x402)",
|
|
695
|
+
"description": "Companion to /v1/suites/auth/proof. Returns a fresh 60-second single-use nonce that the client uses when generating the Groth16 sign-in proof. Free — payment is only required for the proof submission itself.",
|
|
696
|
+
"tags": ["bazaar", "infrastructure", "auth"],
|
|
697
|
+
"responses": {
|
|
698
|
+
"200": {
|
|
699
|
+
"description": "Nonce issued",
|
|
700
|
+
"headers": {
|
|
701
|
+
"Cache-Control": { "schema": { "type": "string", "const": "no-store" } }
|
|
702
|
+
},
|
|
703
|
+
"content": {
|
|
704
|
+
"application/json": {
|
|
705
|
+
"schema": {
|
|
706
|
+
"type": "object",
|
|
707
|
+
"additionalProperties": false,
|
|
708
|
+
"required": ["nonce", "expires_at"],
|
|
709
|
+
"properties": {
|
|
710
|
+
"nonce": { "type": "string", "pattern": "^[0-9a-f]{32}$" },
|
|
711
|
+
"expires_at": { "type": "string", "format": "date-time" }
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
},
|
|
717
|
+
"500": { "description": "Internal error", "content": { "application/json": { "schema": { "$ref": "./schemas/bazaar/canonical-error.json" } } } }
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
},
|
|
721
|
+
|
|
722
|
+
"/v1/suites/auth/proof": {
|
|
723
|
+
"post": {
|
|
724
|
+
"operationId": "verifyAuthProof",
|
|
725
|
+
"summary": "ZK Proof-as-Auth (Sign-in) — verify Groth16 proof of API key possession, mint short-lived JWT",
|
|
726
|
+
"description": "For AI agents that need to call authenticated APIs without ever holding the API key — beyond the reach of prompt injection or context leaks — this endpoint accepts a Groth16 zero-knowledge proof of API key possession and returns a short-lived JWT.",
|
|
727
|
+
"tags": ["bazaar", "infrastructure", "auth"],
|
|
728
|
+
"x-bazaar": {
|
|
729
|
+
"discoverable": true,
|
|
730
|
+
"schema": "seal-identity-v1",
|
|
731
|
+
"category": "Infrastructure",
|
|
732
|
+
"subTags": ["auth", "zk-proof", "sign-in", "proof-as-auth", "credential-free", "passwordless", "api-key", "prompt-injection-defense"],
|
|
733
|
+
"price": { "amount": "0.02", "currency": "USDC", "network": "base" }
|
|
734
|
+
},
|
|
735
|
+
"x-lemma-circuit": {
|
|
736
|
+
"id": "seal-identity-v1",
|
|
737
|
+
"location": "packages/seal/circuits/",
|
|
738
|
+
"proofSystem": "Groth16"
|
|
739
|
+
},
|
|
740
|
+
"x-lemma-facilitator-requirement": "CDP",
|
|
741
|
+
"requestBody": {
|
|
742
|
+
"required": true,
|
|
743
|
+
"content": {
|
|
744
|
+
"application/json": { "schema": { "$ref": "./schemas/suites/product-d-input.json" } }
|
|
745
|
+
}
|
|
746
|
+
},
|
|
747
|
+
"responses": {
|
|
748
|
+
"200": {
|
|
749
|
+
"description": "Proof verified, JWT minted",
|
|
750
|
+
"headers": {
|
|
751
|
+
"X-Lemma-Bazaar-Schema": { "schema": { "type": "string", "const": "seal-identity-v1" } },
|
|
752
|
+
"X-Lemma-Bazaar-Category": { "schema": { "type": "string", "const": "Infrastructure" } },
|
|
753
|
+
"EXTENSION-RESPONSES": { "schema": { "type": "string" }, "description": "CDP facilitator processing status." }
|
|
754
|
+
},
|
|
755
|
+
"content": {
|
|
756
|
+
"application/json": { "schema": { "$ref": "./schemas/suites/product-d-output.json" } }
|
|
757
|
+
}
|
|
758
|
+
},
|
|
759
|
+
"400": { "description": "Validation error", "content": { "application/json": { "schema": { "$ref": "./schemas/bazaar/canonical-error.json" } } } },
|
|
760
|
+
"401": { "description": "Nonce expired / proof verification failed", "content": { "application/json": { "schema": { "$ref": "./schemas/bazaar/canonical-error.json" } } } },
|
|
761
|
+
"402": {
|
|
762
|
+
"description": "Payment required (x402 challenge)",
|
|
763
|
+
"headers": { "X-PAYMENT-RESPONSE": { "schema": { "type": "string" } } },
|
|
764
|
+
"content": { "application/json": { "schema": { "type": "object", "additionalProperties": true } } }
|
|
765
|
+
},
|
|
766
|
+
"500": { "description": "Internal error", "content": { "application/json": { "schema": { "$ref": "./schemas/bazaar/canonical-error.json" } } } }
|
|
767
|
+
}
|
|
768
|
+
}
|
|
530
769
|
}
|
|
531
770
|
}
|
|
532
771
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lemmaoracle/spec",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.33",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -16,21 +16,30 @@
|
|
|
16
16
|
"types": "./dist/index.d.ts",
|
|
17
17
|
"import": "./dist/index.js",
|
|
18
18
|
"default": "./dist/index.js"
|
|
19
|
-
}
|
|
19
|
+
},
|
|
20
|
+
"./schemas/*": "./schemas/*"
|
|
20
21
|
},
|
|
21
22
|
"files": [
|
|
22
23
|
"dist",
|
|
23
|
-
"
|
|
24
|
+
"schemas",
|
|
25
|
+
"openapi.lemma.v2.json",
|
|
26
|
+
"openapi.lemma.v2.bundled.json"
|
|
24
27
|
],
|
|
25
28
|
"scripts": {
|
|
26
29
|
"build": "tsc -p tsconfig.json",
|
|
27
30
|
"type-check": "tsc -p tsconfig.json --noEmit",
|
|
28
31
|
"lint": "eslint 'src/**/*.ts'",
|
|
29
|
-
"test": "vitest run"
|
|
32
|
+
"test": "vitest run",
|
|
33
|
+
"validate:schemas": "node scripts/validate-schemas.mjs",
|
|
34
|
+
"validate:openapi": "node scripts/validate-openapi.mjs",
|
|
35
|
+
"bundle:openapi": "node scripts/bundle-openapi.mjs"
|
|
30
36
|
},
|
|
31
37
|
"devDependencies": {
|
|
38
|
+
"@redocly/cli": "^1.20.0",
|
|
32
39
|
"@typescript-eslint/eslint-plugin": "^8.56.1",
|
|
33
40
|
"@typescript-eslint/parser": "^8.56.1",
|
|
41
|
+
"ajv": "^8.20.0",
|
|
42
|
+
"ajv-formats": "^3.0.1",
|
|
34
43
|
"eslint": "^9.39.3",
|
|
35
44
|
"eslint-config-prettier": "^9.1.0",
|
|
36
45
|
"eslint-plugin-functional": "^9.0.4",
|
package/schemas/_headers
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Access-Control-Allow-Origin: *
|
|
3
|
+
Access-Control-Allow-Methods: GET, OPTIONS
|
|
4
|
+
Content-Type: application/json
|
|
5
|
+
/suites/*
|
|
6
|
+
Access-Control-Allow-Origin: *
|
|
7
|
+
Access-Control-Allow-Methods: GET, OPTIONS
|
|
8
|
+
Content-Type: application/json
|
|
9
|
+
/bazaar/*
|
|
10
|
+
Access-Control-Allow-Origin: *
|
|
11
|
+
Access-Control-Allow-Methods: GET, OPTIONS
|
|
12
|
+
Content-Type: application/json
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://schemas.lemma.frame00.com/bazaar/canonical-error.json",
|
|
4
|
+
"title": "Lemma canonical error envelope",
|
|
5
|
+
"description": "Shared error envelope returned by all Bazaar product endpoints (A/B/C/D) and all internal Lemma APIs.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": ["error", "requestId"],
|
|
9
|
+
"properties": {
|
|
10
|
+
"error": {
|
|
11
|
+
"type": "object",
|
|
12
|
+
"additionalProperties": false,
|
|
13
|
+
"required": ["code", "message"],
|
|
14
|
+
"properties": {
|
|
15
|
+
"code": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"pattern": "^[A-Z][A-Z0-9_]+$",
|
|
18
|
+
"description": "Machine-readable upper-snake-case error code, e.g. VALIDATION_ERROR, NONCE_EXPIRED_OR_REUSED."
|
|
19
|
+
},
|
|
20
|
+
"message": {
|
|
21
|
+
"type": "string",
|
|
22
|
+
"description": "Human-readable, action-oriented message. Should suggest the next step the caller can take."
|
|
23
|
+
},
|
|
24
|
+
"field": {
|
|
25
|
+
"type": "string",
|
|
26
|
+
"description": "Optional JSON Pointer (e.g. '/disclosure_policy/range_predicates/0/predicate') or field name pointing at the offending input."
|
|
27
|
+
},
|
|
28
|
+
"docs": {
|
|
29
|
+
"type": "string",
|
|
30
|
+
"format": "uri",
|
|
31
|
+
"description": "Optional deep link to the Lemma docs section for this error."
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"requestId": {
|
|
36
|
+
"type": "string",
|
|
37
|
+
"pattern": "^req_[0-9a-z]+$",
|
|
38
|
+
"description": "Server-assigned request identifier for log correlation."
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://schemas.lemma.frame00.com/suites/bazaar-extension-metadata.json",
|
|
4
|
+
"title": "Lemma x-bazaar extension metadata",
|
|
5
|
+
"description": "Schema for the `x-bazaar` extension attached to OpenAPI operations exposed via x402 Bazaar. Used by the openapi sync CI step to validate that paths.[].post.x-bazaar entries are well-formed.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": ["discoverable", "schema", "category"],
|
|
9
|
+
"properties": {
|
|
10
|
+
"discoverable": {
|
|
11
|
+
"type": "boolean",
|
|
12
|
+
"description": "Whether the route is registered in the CDP Bazaar Discovery Layer on first settle."
|
|
13
|
+
},
|
|
14
|
+
"schema": {
|
|
15
|
+
"type": "string",
|
|
16
|
+
"pattern": "^[a-z0-9-]+v[0-9]+$",
|
|
17
|
+
"description": "Schema identifier (kebab-case + version suffix), e.g. 'agent-identity-authority-v1'."
|
|
18
|
+
},
|
|
19
|
+
"category": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"enum": [
|
|
22
|
+
"Inference",
|
|
23
|
+
"Data",
|
|
24
|
+
"Media",
|
|
25
|
+
"Search",
|
|
26
|
+
"Social",
|
|
27
|
+
"Infrastructure",
|
|
28
|
+
"Trading"
|
|
29
|
+
],
|
|
30
|
+
"description": "One of the 7 official Bazaar categories."
|
|
31
|
+
},
|
|
32
|
+
"subTags": {
|
|
33
|
+
"type": "array",
|
|
34
|
+
"items": { "type": "string", "pattern": "^[a-z0-9-]+$" },
|
|
35
|
+
"maxItems": 16,
|
|
36
|
+
"description": "Free-form sub-tags surfaced as semantic-search hints."
|
|
37
|
+
},
|
|
38
|
+
"price": {
|
|
39
|
+
"type": "object",
|
|
40
|
+
"additionalProperties": false,
|
|
41
|
+
"required": ["amount", "currency", "network"],
|
|
42
|
+
"properties": {
|
|
43
|
+
"amount": {
|
|
44
|
+
"type": "string",
|
|
45
|
+
"pattern": "^[0-9]+(\\.[0-9]+)?$",
|
|
46
|
+
"description": "Decimal string to preserve precision."
|
|
47
|
+
},
|
|
48
|
+
"currency": {
|
|
49
|
+
"type": "string",
|
|
50
|
+
"enum": ["USDC"],
|
|
51
|
+
"description": "MVP supports USDC only."
|
|
52
|
+
},
|
|
53
|
+
"network": {
|
|
54
|
+
"type": "string",
|
|
55
|
+
"enum": ["base", "base-sepolia"],
|
|
56
|
+
"description": "Settlement network."
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://schemas.lemma.frame00.com/suites/product-a-input.json",
|
|
4
|
+
"title": "Agent Identity Issuance Request",
|
|
5
|
+
"description": "⚠️ OUTDATED: This spec's proof model (Merkle tree) diverges from the current agent-identity.circom circuit (flat Poseidon6 commitment + issuer MAC). The circuit is the source of truth.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": ["agentId", "controllerId", "roles", "spendLimit", "expiresAt"],
|
|
9
|
+
"properties": {
|
|
10
|
+
"agentId": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"format": "uri",
|
|
13
|
+
"pattern": "^did:[a-z0-9]+:.+$",
|
|
14
|
+
"description": "DID of the agent being credentialed (subject). Example: did:key:z6Mk...",
|
|
15
|
+
"examples": ["did:key:z6MkpTHR8VNsBxYAAWHut2Geadd9jSrUaYS9XVjqJzgRfBjK"]
|
|
16
|
+
},
|
|
17
|
+
"subjectId": {
|
|
18
|
+
"type": "string",
|
|
19
|
+
"format": "uri",
|
|
20
|
+
"description": "DID of the underlying real-world subject (organization, user) the agent acts on behalf of. Optional but recommended for KYA traceability."
|
|
21
|
+
},
|
|
22
|
+
"controllerId": {
|
|
23
|
+
"type": "string",
|
|
24
|
+
"format": "uri",
|
|
25
|
+
"pattern": "^did:[a-z0-9]+:.+$",
|
|
26
|
+
"description": "DID of the controller who can revoke this credential. Typically the issuer's operations key."
|
|
27
|
+
},
|
|
28
|
+
"orgId": {
|
|
29
|
+
"type": "string",
|
|
30
|
+
"description": "Organization identifier (free-form, e.g. company registration number, LEI). Used in cross-credential reconciliation."
|
|
31
|
+
},
|
|
32
|
+
"roles": {
|
|
33
|
+
"type": "array",
|
|
34
|
+
"minItems": 1,
|
|
35
|
+
"maxItems": 16,
|
|
36
|
+
"items": {
|
|
37
|
+
"type": "string",
|
|
38
|
+
"enum": [
|
|
39
|
+
"trader",
|
|
40
|
+
"buyer",
|
|
41
|
+
"publisher",
|
|
42
|
+
"auditor",
|
|
43
|
+
"reader",
|
|
44
|
+
"writer",
|
|
45
|
+
"custodian",
|
|
46
|
+
"validator",
|
|
47
|
+
"compliance-officer",
|
|
48
|
+
"developer",
|
|
49
|
+
"operator",
|
|
50
|
+
"support"
|
|
51
|
+
]
|
|
52
|
+
},
|
|
53
|
+
"description": "Roles assigned to this agent. Each role implies a baseline scope set; explicit scopes below override."
|
|
54
|
+
},
|
|
55
|
+
"scopes": {
|
|
56
|
+
"type": "array",
|
|
57
|
+
"items": {
|
|
58
|
+
"type": "string",
|
|
59
|
+
"pattern": "^[a-z0-9_:.-]+$"
|
|
60
|
+
},
|
|
61
|
+
"description": "Fine-grained capability scopes (e.g. 'payments:send', 'data:read:financial'). Optional override over roles."
|
|
62
|
+
},
|
|
63
|
+
"permissions": {
|
|
64
|
+
"type": "object",
|
|
65
|
+
"additionalProperties": false,
|
|
66
|
+
"description": "Boolean permission map for binary capabilities. MVP supports a fixed set; custom permissions are V2.",
|
|
67
|
+
"properties": {
|
|
68
|
+
"can_settle_x402": { "type": "boolean", "description": "Authorize the agent to settle x402 micropayments." },
|
|
69
|
+
"can_request_attestation": { "type": "boolean", "description": "Authorize the agent to request a Lemma attestation bundle (product C)." },
|
|
70
|
+
"can_issue_subordinate": { "type": "boolean", "description": "Authorize the agent to issue subordinate agent credentials." },
|
|
71
|
+
"can_sign_in": { "type": "boolean", "description": "Authorize the agent to perform ZK Proof Sign-in (product D)." },
|
|
72
|
+
"can_invoke_inference": { "type": "boolean", "description": "Authorize the agent to invoke proof-anchored inference (product B)." }
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
"spendLimit": {
|
|
76
|
+
"type": "object",
|
|
77
|
+
"required": ["amount", "currency", "window"],
|
|
78
|
+
"additionalProperties": false,
|
|
79
|
+
"properties": {
|
|
80
|
+
"amount": {
|
|
81
|
+
"type": "string",
|
|
82
|
+
"pattern": "^[0-9]+(\\.[0-9]+)?$",
|
|
83
|
+
"description": "Maximum spend within window. String to preserve precision (USDC has 6 decimals)."
|
|
84
|
+
},
|
|
85
|
+
"currency": {
|
|
86
|
+
"type": "string",
|
|
87
|
+
"enum": ["USDC"],
|
|
88
|
+
"description": "Settlement currency. MVP supports USDC only on Base mainnet. USDT/EURC are planned for V2 — passing them returns INVALID_CURRENCY in MVP."
|
|
89
|
+
},
|
|
90
|
+
"window": {
|
|
91
|
+
"type": "string",
|
|
92
|
+
"enum": ["per-call", "daily", "weekly", "monthly"],
|
|
93
|
+
"description": "Spend limit window."
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
"description": "Financial guard rail enforced at attestation-verification time by consuming services."
|
|
97
|
+
},
|
|
98
|
+
"paymentPolicy": {
|
|
99
|
+
"type": "string",
|
|
100
|
+
"enum": ["prepaid"],
|
|
101
|
+
"default": "prepaid",
|
|
102
|
+
"description": "How the agent's payments are funded. MVP supports prepaid only. 'postpaid' and 'subscription' are V2 — passing them returns POLICY_NOT_SUPPORTED in MVP."
|
|
103
|
+
},
|
|
104
|
+
"issuedAt": {
|
|
105
|
+
"type": "string",
|
|
106
|
+
"format": "date-time",
|
|
107
|
+
"description": "Issuance timestamp. If omitted, Lemma uses server time."
|
|
108
|
+
},
|
|
109
|
+
"expiresAt": {
|
|
110
|
+
"type": "string",
|
|
111
|
+
"format": "date-time",
|
|
112
|
+
"description": "Expiration timestamp. Maximum 1 year from issuance per MVP policy."
|
|
113
|
+
},
|
|
114
|
+
"sourceSystem": {
|
|
115
|
+
"type": "string",
|
|
116
|
+
"description": "Free-form identifier of the system that originated the issuance (e.g. 'aws-bedrock-agentcore', 'custom-pipeline-v2'). Stored for provenance only."
|
|
117
|
+
},
|
|
118
|
+
"chainContext": {
|
|
119
|
+
"type": "object",
|
|
120
|
+
"additionalProperties": false,
|
|
121
|
+
"properties": {
|
|
122
|
+
"chainId": { "type": "integer", "enum": [8453], "description": "Base mainnet only in MVP." },
|
|
123
|
+
"rpcUrl": { "type": "string", "format": "uri", "description": "Optional RPC endpoint reference for verifier reconciliation." }
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|