@openmobilehub/attestomcp-gate 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +172 -0
- package/dist/ceremony/cartMandate.d.ts +61 -0
- package/dist/ceremony/cartMandate.js +76 -0
- package/dist/ceremony/challengeToken.d.ts +5 -0
- package/dist/ceremony/challengeToken.js +43 -0
- package/dist/ceremony/checkout-page.d.ts +85 -0
- package/dist/ceremony/checkout-page.js +269 -0
- package/dist/ceremony/completion.d.ts +41 -0
- package/dist/ceremony/completion.js +90 -0
- package/dist/ceremony/credential-gate/dcql.d.ts +10 -0
- package/dist/ceremony/credential-gate/dcql.js +12 -0
- package/dist/ceremony/credential-gate/doc-spec.d.ts +3 -0
- package/dist/ceremony/credential-gate/doc-spec.js +16 -0
- package/dist/ceremony/credential-gate/mdoc-verify.d.ts +15 -0
- package/dist/ceremony/credential-gate/mdoc-verify.js +29 -0
- package/dist/ceremony/credential-gate/page.d.ts +20 -0
- package/dist/ceremony/credential-gate/page.js +136 -0
- package/dist/ceremony/credential-gate/request.d.ts +15 -0
- package/dist/ceremony/credential-gate/request.js +43 -0
- package/dist/ceremony/credential-gate/routes.d.ts +2 -0
- package/dist/ceremony/credential-gate/routes.js +200 -0
- package/dist/ceremony/credential-gate/verify.d.ts +51 -0
- package/dist/ceremony/credential-gate/verify.js +146 -0
- package/dist/ceremony/dc-payment/dcql.d.ts +5 -0
- package/dist/ceremony/dc-payment/dcql.js +23 -0
- package/dist/ceremony/dc-payment/page.d.ts +18 -0
- package/dist/ceremony/dc-payment/page.js +195 -0
- package/dist/ceremony/dc-payment/request.d.ts +17 -0
- package/dist/ceremony/dc-payment/request.js +50 -0
- package/dist/ceremony/dc-payment/routes.d.ts +2 -0
- package/dist/ceremony/dc-payment/routes.js +147 -0
- package/dist/ceremony/dc-payment/txData.d.ts +19 -0
- package/dist/ceremony/dc-payment/txData.js +34 -0
- package/dist/ceremony/dc-payment/verify.d.ts +108 -0
- package/dist/ceremony/dc-payment/verify.js +208 -0
- package/dist/ceremony/mandate.d.ts +71 -0
- package/dist/ceremony/mandate.js +116 -0
- package/dist/ceremony/mdoc/mdoc-iso.d.ts +44 -0
- package/dist/ceremony/mdoc/mdoc-iso.js +260 -0
- package/dist/ceremony/mdoc/mdoc.d.ts +17 -0
- package/dist/ceremony/mdoc/mdoc.js +94 -0
- package/dist/ceremony/mdoc/reader.d.ts +10 -0
- package/dist/ceremony/mdoc/reader.js +43 -0
- package/dist/ceremony/mdoc/readerContext.d.ts +8 -0
- package/dist/ceremony/mdoc/readerContext.js +29 -0
- package/dist/ceremony/mount.d.ts +57 -0
- package/dist/ceremony/mount.js +96 -0
- package/dist/ceremony/origin.d.ts +10 -0
- package/dist/ceremony/origin.js +9 -0
- package/dist/ceremony/passkey/page.d.ts +6 -0
- package/dist/ceremony/passkey/page.js +136 -0
- package/dist/ceremony/passkey/routes.d.ts +2 -0
- package/dist/ceremony/passkey/routes.js +170 -0
- package/dist/ceremony/passkey/verify.d.ts +15 -0
- package/dist/ceremony/passkey/verify.js +56 -0
- package/dist/ceremony/reconciliation.d.ts +34 -0
- package/dist/ceremony/reconciliation.js +21 -0
- package/dist/ceremony/theme.d.ts +63 -0
- package/dist/ceremony/theme.js +285 -0
- package/dist/ceremony/types.d.ts +95 -0
- package/dist/ceremony/types.js +1 -0
- package/dist/client.d.ts +39 -0
- package/dist/client.js +84 -0
- package/dist/credentials.d.ts +48 -0
- package/dist/credentials.js +127 -0
- package/dist/envelope.d.ts +62 -0
- package/dist/envelope.js +72 -0
- package/dist/gated.d.ts +39 -0
- package/dist/gated.js +41 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.js +49 -0
- package/dist/manifest.d.ts +28 -0
- package/dist/manifest.js +76 -0
- package/dist/store.d.ts +7 -0
- package/dist/store.js +16 -0
- package/dist/types.d.ts +146 -0
- package/dist/types.js +7 -0
- package/package.json +62 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or Derivative
|
|
95
|
+
Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 Open Mobile Hub, a series of LF Projects, LLC
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
# @openmobilehub/attestomcp-gate
|
|
2
|
+
|
|
3
|
+
**The consent layer for AI agents.** An AI agent must prove a verifiable credential
|
|
4
|
+
from the user's phone wallet before a consequential MCP tool completes. **Identity
|
|
5
|
+
leads; payments is one application** — `age.over(21)`, a loyalty membership, a
|
|
6
|
+
prescription, and `payment.in("usd")` are all just credentials in the same policy.
|
|
7
|
+
|
|
8
|
+
> **Design preview / v0.1.** This package is real and tested, but the broader AttestoMcp
|
|
9
|
+
> SDK is still being extracted from the reference server
|
|
10
|
+
> ([mcp-apps-shopping-demo](https://github.com/openmobilehub/mcp-apps-shopping-demo)).
|
|
11
|
+
> See the repo's `ROADMAP.md` for what's shipping vs. next.
|
|
12
|
+
|
|
13
|
+
## Install
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install @openmobilehub/attestomcp-gate
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Apache-2.0, ESM, ships its own types. Pairs with
|
|
20
|
+
[`@openmobilehub/attestomcp-storefront`](../attestomcp-storefront), but stands alone on any
|
|
21
|
+
Express-shaped host.
|
|
22
|
+
|
|
23
|
+
## Quickstart
|
|
24
|
+
|
|
25
|
+
The whole flow in ≤ 10 lines — a credential-gated agentic storefront. `createStorefront()`
|
|
26
|
+
publishes the ceremony seams; `new AttestoMcp().mount(store.app)` wires the real `/attestomcp/*`
|
|
27
|
+
ceremony rails; `store.gate()` resolves your policy on every `checkout` call (copied from
|
|
28
|
+
[`examples/storefront.mjs`](https://github.com/openmobilehub/mcp-apps-shopping-demo/blob/main/examples/storefront.mjs) /
|
|
29
|
+
[`storefront-gate.test.ts`](https://github.com/openmobilehub/mcp-apps-shopping-demo/blob/main/storefront-gate.test.ts)):
|
|
30
|
+
|
|
31
|
+
```ts
|
|
32
|
+
import { createStorefront } from "@openmobilehub/attestomcp-storefront/server";
|
|
33
|
+
import { AttestoMcp, age, membership, payment, required, optional } from "@openmobilehub/attestomcp-gate";
|
|
34
|
+
|
|
35
|
+
const store = createStorefront(); // the storefront — one line
|
|
36
|
+
const attestomcp = new AttestoMcp(); // zero-config (defaults to http://localhost:3000)
|
|
37
|
+
attestomcp.mount(store.app); // wires the real /attestomcp/* ceremony rails
|
|
38
|
+
|
|
39
|
+
store.gate((order) => // resolved on every checkout (payment settles LAST)
|
|
40
|
+
attestomcp.requirements(order, [
|
|
41
|
+
required(age.over(21).when((order) => order.lines.some((l) => l.minimumAge != null))),
|
|
42
|
+
optional(membership.discount(10)), // 10% off if a loyalty credential is presented
|
|
43
|
+
required(payment.in("usd")), // amount derived from the order; settles last
|
|
44
|
+
]),
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
const { url } = await store.listen(3005); // → add http://localhost:3005/mcp to Claude / ChatGPT / Goose
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Add the whiskey (21+) to the cart and check out → the tool returns the checkout link **plus**
|
|
51
|
+
a `requires` manifest → the buyer proves age (and optionally membership) → authorizes payment →
|
|
52
|
+
the widget shows the confirmation. Add the headphones instead and the age gate drops — the
|
|
53
|
+
`.when()` predicate receives the **order** and is false.
|
|
54
|
+
|
|
55
|
+
> `.when((order) => …)` takes the **whole `GateOrder`** (id, total, currency, lines), so a
|
|
56
|
+
> predicate keys off the cart's lines — e.g. `order.lines.some((l) => l.minimumAge != null)`.
|
|
57
|
+
> For a deployment pass your public origin: `new AttestoMcp({ walletOrigin: "https://shop.example" })`.
|
|
58
|
+
|
|
59
|
+
## The three execution contexts
|
|
60
|
+
|
|
61
|
+
The split is load-bearing — conflating them is the documented root cause of confusion
|
|
62
|
+
([spec §0](https://github.com/openmobilehub/mcp-apps-shopping-demo/blob/main/specs/001-attesto-sdk/spec.md)). v0.1 is consolidated **Mode A**:
|
|
63
|
+
|
|
64
|
+
1. **Tool — mints the link + reports requirements.** Your `checkout` handler runs once when
|
|
65
|
+
checkout is requested. There is no phone in the loop, so it does **not** run a ceremony — it
|
|
66
|
+
calls `attestomcp.requirements(order, policy)` and surfaces the resulting `requires` manifest.
|
|
67
|
+
2. **Page — runs the gates.** The buyer opens the link once and completes every verification and
|
|
68
|
+
payment in a single browser session, on the `/attestomcp/*` routes `mount()` serves.
|
|
69
|
+
3. **Poll — reports completion.** The agent polls (MCP has no server→client push) and reports the
|
|
70
|
+
result. It never performs the ceremony.
|
|
71
|
+
|
|
72
|
+
`requirements()` is the **code→data boundary** (Principle VI): it runs your `.when()` / `appliesTo`
|
|
73
|
+
predicates server-side, sorts `payment` last, and emits a flat, JSON-safe manifest — **no functions
|
|
74
|
+
cross the wire**. The manifest's `requires[]` is exactly what the agent and the widget receive.
|
|
75
|
+
|
|
76
|
+
## The credential model
|
|
77
|
+
|
|
78
|
+
Built-ins, custom credentials, and effects are one shape (`Credential` + `Effect`):
|
|
79
|
+
|
|
80
|
+
| Builder | Effect | Verifies |
|
|
81
|
+
| :-- | :-- | :-- |
|
|
82
|
+
| `age.over(n)` | `gate()` | the explicit positive `age_over_${n} === true` (an 18+ proof never satisfies a 21+ gate) |
|
|
83
|
+
| `membership.discount(n)` | `discount({ percent: n })` | a non-empty `membership_number`; applies the discount once |
|
|
84
|
+
| `payment.in(cur)` | `authorize()` | `authorized === true`; settles last, amount derived from the order |
|
|
85
|
+
|
|
86
|
+
Wrap each in `required(c)` or `optional(c)` to build the ordered policy array. Attach a call-site
|
|
87
|
+
conditional with `.when((order) => boolean)` — it returns a fresh `Credential` (non-mutating) whose
|
|
88
|
+
predicate is AND-ed onto any existing `appliesTo`.
|
|
89
|
+
|
|
90
|
+
**Gate any credential** with `defineCredential` — no registration step, usable by object
|
|
91
|
+
(from [`specs/001-attesto-sdk/quickstart.md`](https://github.com/openmobilehub/mcp-apps-shopping-demo/blob/main/specs/001-attesto-sdk/quickstart.md)):
|
|
92
|
+
|
|
93
|
+
```ts
|
|
94
|
+
import { defineCredential, dcql, gate } from "@openmobilehub/attestomcp-gate";
|
|
95
|
+
|
|
96
|
+
const prescription = defineCredential({
|
|
97
|
+
id: "prescription",
|
|
98
|
+
request: dcql({ docType: "org.hl7.prescription.1", claims: ["rx_valid"] }),
|
|
99
|
+
verify: (c) => c.rx_valid === true,
|
|
100
|
+
effect: gate(), // or discount({ percent }) / authorize()
|
|
101
|
+
appliesTo: (order) => order.lines.some((l) => l.requiresRx), // definition-time conditional
|
|
102
|
+
ui: { label: "Prescription", action: "Verify prescription" },
|
|
103
|
+
});
|
|
104
|
+
// …then drop required(prescription) into the same policy array.
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
`dcql({ docType, claims })` is concise sugar for a single-mdoc DCQL query (selective disclosure,
|
|
108
|
+
never-retain by default). The three effect builders — `gate()`, `discount({ percent })`,
|
|
109
|
+
`authorize()` — are the only effects the resolver interprets.
|
|
110
|
+
|
|
111
|
+
## Honest status
|
|
112
|
+
|
|
113
|
+
Honesty is carried in the **types**, not prose (Principle VII):
|
|
114
|
+
|
|
115
|
+
- **`enforcedAt: "checkout"`** — v0.1 is consolidated Mode A: every gate runs on the checkout page
|
|
116
|
+
(Context 2) and is enforced server-side on the completion path. (`"tool"` is the Mode-B blocking
|
|
117
|
+
shape — roadmap.)
|
|
118
|
+
- **`trust_level: "presence-only-demo"`** — the gate enforces *disclosure* (an explicit positive
|
|
119
|
+
claim, not token-presence) and *binding* (nonce / ephemeral key), but **not trust** (mdoc
|
|
120
|
+
issuer / device signatures). A self-crafted mdoc would pass. **This is a flow demo, not a real
|
|
121
|
+
safety control** — never present it as one. Issuer-trust verification (Multipaz / `@auth0/mdl`,
|
|
122
|
+
`trust_level: "issuer-verified"`) is roadmap.
|
|
123
|
+
|
|
124
|
+
The three rails `mount()` serves differ in how much crypto is real today:
|
|
125
|
+
|
|
126
|
+
| Rail (`/attestomcp/*`) | What it proves | Trust today |
|
|
127
|
+
| :-- | :-- | :-- |
|
|
128
|
+
| `passkey` (same-device + cross-device caBLE) | WebAuthn assertion verified against this server's origin / RP-ID, user-verification required, nonce/replay-bound — **real cryptography** (`@simplewebauthn`) | real WebAuthn crypto |
|
|
129
|
+
| `credential` (age / membership) | OpenID4VP presentation; the explicit positive claim is checked, but the mdoc's issuer/device signatures are **not** verified | `presence-only-demo` |
|
|
130
|
+
| `dc-payment` (Digital Credentials API) | amount-bound mdoc presentation; the JWE vp_token + device signature are taken at face value, **not** cryptographically verified | `presence-only-demo` |
|
|
131
|
+
|
|
132
|
+
The OpenID4VP plumbing is scaffolded; cryptographic mdoc trust is the integration step, not new
|
|
133
|
+
cryptography. The mandate is AP2-shaped and dev-signed (integrity hash), not key-signed.
|
|
134
|
+
|
|
135
|
+
> **A refused tool call is a protocol, not a wall.** For a page-less tool, `gated()` returns a typed
|
|
136
|
+
> **`verification_required`** envelope the agent *drives* (which credential, a per-order approve link,
|
|
137
|
+
> the tool to poll) instead of completing — the retained blocking **Mode B** primitive.
|
|
138
|
+
|
|
139
|
+
## API surface (v0.1)
|
|
140
|
+
|
|
141
|
+
```ts
|
|
142
|
+
// Client (configure once, then declarative calls)
|
|
143
|
+
class AttestoMcp {
|
|
144
|
+
constructor(opts?: { walletOrigin?: string; store?: VerificationStore });
|
|
145
|
+
requirements(order: GateOrder, policy: Step[]): VerificationManifestEntry[]; // Context 1
|
|
146
|
+
mount(app: ExpressApp, ceremony?: MountCeremony): void; // Context 2
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// Policy builders + extensibility
|
|
150
|
+
age.over(n) · membership.discount(n) · payment.in(currency)
|
|
151
|
+
required(c) · optional(c) · .when((order) => boolean)
|
|
152
|
+
defineCredential({ id, request, verify, effect, appliesTo?, ui })
|
|
153
|
+
dcql({ docType, claims }) · gate() · discount({ percent?, amount? }) · authorize()
|
|
154
|
+
|
|
155
|
+
// Stores + host-side composition seam
|
|
156
|
+
MemoryVerificationStore · completeOrder(input, ctx)
|
|
157
|
+
|
|
158
|
+
// Retained Mode-B / roadmap blocking primitive
|
|
159
|
+
gated() · buildVerificationRequired() · isVerificationRequired() · envelopeInstruction()
|
|
160
|
+
ageDcql() · ENVELOPE_VERSION · ENVELOPE_SENTINEL
|
|
161
|
+
|
|
162
|
+
// Types: AttestoMcpOptions, GateOrder, OrderLine, Credential, Step, Effect,
|
|
163
|
+
// VerificationManifestEntry, VerificationStore, VerificationRecord,
|
|
164
|
+
// TrustLevel, DcqlQuery, DcqlClaim, DcqlCredentialOption, ExpressApp,
|
|
165
|
+
// CompletionSeam / SettlementSeam / CeremonyOrder (host composition)
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
Full, compiler-checked contract: [`specs/001-attesto-sdk/`](https://github.com/openmobilehub/mcp-apps-shopping-demo/tree/main/specs/001-attesto-sdk/) (the
|
|
169
|
+
[quickstart](https://github.com/openmobilehub/mcp-apps-shopping-demo/blob/main/specs/001-attesto-sdk/quickstart.md), [`spec.md`](https://github.com/openmobilehub/mcp-apps-shopping-demo/blob/main/specs/001-attesto-sdk/spec.md),
|
|
170
|
+
and the [mount contract](https://github.com/openmobilehub/mcp-apps-shopping-demo/blob/main/specs/003-gate-ceremony-extraction/contracts/attesto-mount.api.md)).
|
|
171
|
+
|
|
172
|
+
Apache-2.0 · part of [Open Mobile Hub](https://openmobilehub.org) (Linux Foundation).
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/** A priced cart line the mandate seals (the fields the gates re-derive from). */
|
|
2
|
+
export interface CartMandateLine {
|
|
3
|
+
id: string;
|
|
4
|
+
quantity: number;
|
|
5
|
+
unitPrice: number;
|
|
6
|
+
lineTotal: number;
|
|
7
|
+
minimumAge?: number;
|
|
8
|
+
}
|
|
9
|
+
export interface CartMandate {
|
|
10
|
+
type: "ap2.CartMandate";
|
|
11
|
+
/** Stable id (defaults to `cart_<orderId>`); a PaymentMandate can reference it. */
|
|
12
|
+
id: string;
|
|
13
|
+
/** The order this cart is bound to — a mandate replayed against another order is refused. */
|
|
14
|
+
orderId: string;
|
|
15
|
+
lines: CartMandateLine[];
|
|
16
|
+
currency: string;
|
|
17
|
+
/** Cart total in major units — re-derived server-side, sealed here for integrity. */
|
|
18
|
+
total: number;
|
|
19
|
+
/** Epoch ms. */
|
|
20
|
+
issuedAt: number;
|
|
21
|
+
expiresAt: number;
|
|
22
|
+
/** Signature suite. v0.1 = server HMAC-SHA256; reserved for a future key-bound variant. */
|
|
23
|
+
alg: "HS256";
|
|
24
|
+
trust_level: "presence-only-demo";
|
|
25
|
+
/** base64url HMAC over the canonical payload. */
|
|
26
|
+
signature: string;
|
|
27
|
+
}
|
|
28
|
+
/** Default validity window — mirrors the challenge-token TTL policy. */
|
|
29
|
+
export declare const DEFAULT_CART_MANDATE_TTL_MS: number;
|
|
30
|
+
export interface IssueCartMandateArgs {
|
|
31
|
+
orderId: string;
|
|
32
|
+
lines: CartMandateLine[];
|
|
33
|
+
currency: string;
|
|
34
|
+
total: number;
|
|
35
|
+
/** Defaults to `cart_<orderId>`. */
|
|
36
|
+
id?: string;
|
|
37
|
+
/** Injectable clock (tests); defaults to `Date.now()`. */
|
|
38
|
+
now?: number;
|
|
39
|
+
ttlMs?: number;
|
|
40
|
+
}
|
|
41
|
+
/** Issue (sign) a Cart Mandate for a server-priced cart. */
|
|
42
|
+
export declare function issueCartMandate(args: IssueCartMandateArgs, secret: string): CartMandate;
|
|
43
|
+
export type CartMandateRefusal = "malformed" | "signature" | "order-id" | "expired";
|
|
44
|
+
export type CartMandateVerdict = {
|
|
45
|
+
ok: true;
|
|
46
|
+
mandate: CartMandate;
|
|
47
|
+
} | {
|
|
48
|
+
ok: false;
|
|
49
|
+
reason: CartMandateRefusal;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Verify a Cart Mandate against the order it should be bound to. Checks, in order:
|
|
53
|
+
* 1. shape (a malformed/non-mandate object is refused);
|
|
54
|
+
* 2. SIGNATURE — recompute the HMAC over the canonical payload + constant-time compare,
|
|
55
|
+
* so a forged or edited cart fails here first (`signature`);
|
|
56
|
+
* 3. order-id binding — a valid mandate replayed against a different order (`order-id`);
|
|
57
|
+
* 4. expiry — a stale mandate, with a DISTINCT reason so a slow buyer sees "expired",
|
|
58
|
+
* not "tampered" (`expired`).
|
|
59
|
+
* Returns the typed verdict; it never throws.
|
|
60
|
+
*/
|
|
61
|
+
export declare function verifyCartMandate(mandate: unknown, expectedOrderId: string, secret: string, now?: number): CartMandateVerdict;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
// ap2.CartMandate — a signed integrity envelope over the cart the agent/buyer is acting
|
|
2
|
+
// on. The signed sibling of the ap2.PaymentMandate (mandate.ts): it makes the cart
|
|
3
|
+
// TAMPER-EVIDENT so the cart that travels with a request can be checked before it's
|
|
4
|
+
// trusted.
|
|
5
|
+
//
|
|
6
|
+
// ADDITIVE + FAIL-CLOSED, and it does NOT change the price authority: the catalog stays
|
|
7
|
+
// the source of truth (Security invariant 2). A cart mandate proves "THIS SERVER issued
|
|
8
|
+
// this cart"; re-pricing still decides the price. So verification is a fast, explicit
|
|
9
|
+
// pre-check (a tampered/replayed/expired cart is refused with a clear reason BEFORE the
|
|
10
|
+
// re-price step) and defense-in-depth — never a substitute for re-derivation.
|
|
11
|
+
//
|
|
12
|
+
// HONESTY (trust_level "presence-only-demo"): v0.1 signs with the SERVER's HMAC key
|
|
13
|
+
// (the same sealed-HMAC primitive challengeToken.ts uses). That proves the server issued
|
|
14
|
+
// the cart, NOT that the user authorized it. A user/agent-signed Cart Mandate (the true
|
|
15
|
+
// AP2 user-authorization semantic) + issuer trust is the v0.2 line — the `alg` field
|
|
16
|
+
// reserves room for an ES256 / key-bound variant without changing this contract.
|
|
17
|
+
import { createHmac, timingSafeEqual } from "node:crypto";
|
|
18
|
+
/** Default validity window — mirrors the challenge-token TTL policy. */
|
|
19
|
+
export const DEFAULT_CART_MANDATE_TTL_MS = 15 * 60 * 1000;
|
|
20
|
+
// Deterministic canonical payload the signature covers. Fixed field + line order so the
|
|
21
|
+
// same cart re-signs stably and ANY edit (a line qty, a unit price, the total, the
|
|
22
|
+
// currency, the order id, the expiry) changes the bytes and so the signature.
|
|
23
|
+
function canonical(m) {
|
|
24
|
+
const lines = m.lines
|
|
25
|
+
.map((l) => `${l.id}:${l.quantity}:${l.unitPrice}:${l.lineTotal}:${l.minimumAge ?? ""}`)
|
|
26
|
+
.join(",");
|
|
27
|
+
return [m.type, m.id, m.orderId, m.currency, m.total, m.issuedAt, m.expiresAt, m.alg, m.trust_level, lines].join("|");
|
|
28
|
+
}
|
|
29
|
+
function sign(payload, secret) {
|
|
30
|
+
return createHmac("sha256", secret).update(payload).digest("base64url");
|
|
31
|
+
}
|
|
32
|
+
/** Issue (sign) a Cart Mandate for a server-priced cart. */
|
|
33
|
+
export function issueCartMandate(args, secret) {
|
|
34
|
+
const now = args.now ?? Date.now();
|
|
35
|
+
const base = {
|
|
36
|
+
type: "ap2.CartMandate",
|
|
37
|
+
id: args.id ?? `cart_${args.orderId}`,
|
|
38
|
+
orderId: args.orderId,
|
|
39
|
+
lines: args.lines,
|
|
40
|
+
currency: args.currency,
|
|
41
|
+
total: args.total,
|
|
42
|
+
issuedAt: now,
|
|
43
|
+
expiresAt: now + (args.ttlMs ?? DEFAULT_CART_MANDATE_TTL_MS),
|
|
44
|
+
alg: "HS256",
|
|
45
|
+
trust_level: "presence-only-demo",
|
|
46
|
+
};
|
|
47
|
+
return { ...base, signature: sign(canonical(base), secret) };
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Verify a Cart Mandate against the order it should be bound to. Checks, in order:
|
|
51
|
+
* 1. shape (a malformed/non-mandate object is refused);
|
|
52
|
+
* 2. SIGNATURE — recompute the HMAC over the canonical payload + constant-time compare,
|
|
53
|
+
* so a forged or edited cart fails here first (`signature`);
|
|
54
|
+
* 3. order-id binding — a valid mandate replayed against a different order (`order-id`);
|
|
55
|
+
* 4. expiry — a stale mandate, with a DISTINCT reason so a slow buyer sees "expired",
|
|
56
|
+
* not "tampered" (`expired`).
|
|
57
|
+
* Returns the typed verdict; it never throws.
|
|
58
|
+
*/
|
|
59
|
+
export function verifyCartMandate(mandate, expectedOrderId, secret, now = Date.now()) {
|
|
60
|
+
if (!mandate || typeof mandate !== "object")
|
|
61
|
+
return { ok: false, reason: "malformed" };
|
|
62
|
+
const m = mandate;
|
|
63
|
+
if (m.type !== "ap2.CartMandate" || typeof m.signature !== "string" || !Array.isArray(m.lines)) {
|
|
64
|
+
return { ok: false, reason: "malformed" };
|
|
65
|
+
}
|
|
66
|
+
const expected = sign(canonical(m), secret);
|
|
67
|
+
const a = Buffer.from(expected);
|
|
68
|
+
const b = Buffer.from(m.signature);
|
|
69
|
+
if (a.length !== b.length || !timingSafeEqual(a, b))
|
|
70
|
+
return { ok: false, reason: "signature" };
|
|
71
|
+
if (m.orderId !== expectedOrderId)
|
|
72
|
+
return { ok: false, reason: "order-id" };
|
|
73
|
+
if (now > m.expiresAt)
|
|
74
|
+
return { ok: false, reason: "expired" };
|
|
75
|
+
return { ok: true, mandate: m };
|
|
76
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// Stateless WebAuthn challenge. The challenge rides in a signed token:
|
|
2
|
+
// base64url(challenge) "." expiryMs "." base64url(HMAC-SHA256(challenge|expiry))
|
|
3
|
+
// so issue and verify need no shared server memory (serverless-correct on a
|
|
4
|
+
// multi-instance deployment where options→verify may hit different instances).
|
|
5
|
+
//
|
|
6
|
+
// The HMAC is keyed by the INJECTED `signingKey` seam (mount() requires a stable
|
|
7
|
+
// one — D6); a forged or tampered token fails the signature check, and a token
|
|
8
|
+
// replayed after its window fails the expiry check. Single-use WITHIN the window
|
|
9
|
+
// is provided by the rail: the challenge is bound into the WebAuthn assertion and
|
|
10
|
+
// the order's completion is idempotent, so a replayed assertion records nothing
|
|
11
|
+
// twice. The token itself is deliberately stateless (no server-side nonce store).
|
|
12
|
+
import { createHmac, randomBytes, timingSafeEqual } from "node:crypto";
|
|
13
|
+
const DEFAULT_TTL_MS = 120_000;
|
|
14
|
+
function b64url(buf) {
|
|
15
|
+
return buf.toString("base64url");
|
|
16
|
+
}
|
|
17
|
+
function sign(challenge, expiry, secret) {
|
|
18
|
+
return createHmac("sha256", secret).update(`${challenge}|${expiry}`).digest("base64url");
|
|
19
|
+
}
|
|
20
|
+
export function issueChallenge(secret, ttlMs = DEFAULT_TTL_MS) {
|
|
21
|
+
const challenge = b64url(randomBytes(32));
|
|
22
|
+
const expiry = Date.now() + ttlMs;
|
|
23
|
+
const sig = sign(challenge, expiry, secret);
|
|
24
|
+
return { challenge, token: `${challenge}.${expiry}.${sig}` };
|
|
25
|
+
}
|
|
26
|
+
export function verifyChallenge(token, secret) {
|
|
27
|
+
const parts = token.split(".");
|
|
28
|
+
if (parts.length !== 3)
|
|
29
|
+
throw new Error("malformed challenge token");
|
|
30
|
+
const [challenge, expiryStr, sig] = parts;
|
|
31
|
+
const expiry = Number(expiryStr);
|
|
32
|
+
if (!Number.isFinite(expiry))
|
|
33
|
+
throw new Error("malformed challenge token");
|
|
34
|
+
const expected = sign(challenge, expiry, secret);
|
|
35
|
+
const a = Buffer.from(sig);
|
|
36
|
+
const b = Buffer.from(expected);
|
|
37
|
+
// Constant-time compare — a length mismatch is also a rejection.
|
|
38
|
+
if (a.length !== b.length || !timingSafeEqual(a, b))
|
|
39
|
+
throw new Error("bad challenge signature");
|
|
40
|
+
if (Date.now() > expiry)
|
|
41
|
+
throw new Error("challenge expired");
|
|
42
|
+
return challenge;
|
|
43
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import type { VerificationManifestEntry } from "../types.js";
|
|
2
|
+
/** A priced order line — structurally a demo / storefront `PricedCartLine` (and a
|
|
3
|
+
* `CeremonyOrderLine`, whose name/currency are optional). */
|
|
4
|
+
export interface RenderOrderLine {
|
|
5
|
+
/** Display name; falls back to the product id (or "Item") when absent. */
|
|
6
|
+
name?: string;
|
|
7
|
+
/** Product id — the name fallback when a re-priced line carries no name. */
|
|
8
|
+
id?: string;
|
|
9
|
+
quantity: number;
|
|
10
|
+
lineTotal: number;
|
|
11
|
+
/** ISO 4217; falls back to the order currency when the line omits it. */
|
|
12
|
+
currency?: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The priced order the page summarizes. Structural superset of both the demo's and
|
|
16
|
+
* the storefront's `Order`, so either feeds the renderer with no mapping. Totals are
|
|
17
|
+
* the catalog-re-derived ones (Security invariant 2 — never the token's).
|
|
18
|
+
*/
|
|
19
|
+
export interface RenderOrder {
|
|
20
|
+
id: string;
|
|
21
|
+
lines: RenderOrderLine[];
|
|
22
|
+
/** Total item count; defaults to the summed line quantities when absent. */
|
|
23
|
+
itemCount?: number;
|
|
24
|
+
/** Discount in major units; the loyalty row renders only when > 0. */
|
|
25
|
+
discount: number;
|
|
26
|
+
total: number;
|
|
27
|
+
currency: string;
|
|
28
|
+
}
|
|
29
|
+
/** Per-order verification state that drives the live gate status (never global). */
|
|
30
|
+
export interface RenderVerification {
|
|
31
|
+
ageVerified?: boolean;
|
|
32
|
+
loyaltyApplied?: boolean;
|
|
33
|
+
}
|
|
34
|
+
/** A recorded completion for THIS order — a revisit shows the paid state. */
|
|
35
|
+
export interface RenderPaid {
|
|
36
|
+
amount: number;
|
|
37
|
+
currency: string;
|
|
38
|
+
method?: string;
|
|
39
|
+
settlement?: {
|
|
40
|
+
network: string;
|
|
41
|
+
payer: {
|
|
42
|
+
accountId: string;
|
|
43
|
+
};
|
|
44
|
+
hashscanUrl: string;
|
|
45
|
+
} | null;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* One selectable payment method in the locked-until-ready payment group. The host
|
|
49
|
+
* supplies these so the renderer never hardcodes a route:
|
|
50
|
+
* • `href` — selecting + paying navigates here (a gate page); OR
|
|
51
|
+
* • `placeOrder: true` — POSTs the order token to `placeOrderPath` (instant demo).
|
|
52
|
+
*/
|
|
53
|
+
export interface PaymentMethod {
|
|
54
|
+
value: string;
|
|
55
|
+
name: string;
|
|
56
|
+
desc: string;
|
|
57
|
+
/** Gate-page URL the Pay CTA navigates to when this method is chosen. */
|
|
58
|
+
href?: string;
|
|
59
|
+
/** This method completes by POSTing the order token to `placeOrderPath`. */
|
|
60
|
+
placeOrder?: boolean;
|
|
61
|
+
/** Selected by default (first method if none flagged). */
|
|
62
|
+
checked?: boolean;
|
|
63
|
+
}
|
|
64
|
+
export interface PaymentOptions {
|
|
65
|
+
/** The selectable methods (rendered as a radio group + one Pay CTA). */
|
|
66
|
+
methods: PaymentMethod[];
|
|
67
|
+
/** Where a `placeOrder` method POSTs `{ order }`. Default `/checkout/place-order`. */
|
|
68
|
+
placeOrderPath?: string;
|
|
69
|
+
/** The encoded order token the instant-demo method binds + POSTs. */
|
|
70
|
+
orderToken?: string;
|
|
71
|
+
}
|
|
72
|
+
export interface RenderRequirementsOptions {
|
|
73
|
+
/** Host-supplied payment affordances. Omitted ⇒ derive a single Pay CTA from the
|
|
74
|
+
* manifest's `authorize` entry (its `approveUrl`), if any. */
|
|
75
|
+
payment?: PaymentOptions;
|
|
76
|
+
/** A recorded completion for THIS order ⇒ render the paid state, not the methods. */
|
|
77
|
+
paid?: RenderPaid | null;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Render the unified checkout page: the order summary, the numbered gates (in policy
|
|
81
|
+
* order, payment LAST) with live status, and the payment section — locked until every
|
|
82
|
+
* blocking gate passes. The membership discount is reflected in the displayed total
|
|
83
|
+
* via `order.discount` (the host re-prices server-side and passes the priced order).
|
|
84
|
+
*/
|
|
85
|
+
export declare function renderRequirements(order: RenderOrder, manifest: VerificationManifestEntry[], verification?: RenderVerification, opts?: RenderRequirementsOptions): string;
|