tru-mcp 0.5.2 → 0.7.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/README.md +29 -40
- package/dist/api-client.d.ts +12 -1
- package/dist/api-client.js +16 -2
- package/dist/api-client.js.map +1 -1
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -1
- package/dist/init.js +110 -9
- package/dist/init.js.map +1 -1
- package/dist/server.js +171 -138
- package/dist/server.js.map +1 -1
- package/dist/tools/add_agent_signup.d.ts +23 -0
- package/dist/tools/add_agent_signup.js +60 -0
- package/dist/tools/add_agent_signup.js.map +1 -0
- package/dist/tools/authenticate.js +1 -1
- package/dist/tools/authenticate.js.map +1 -1
- package/dist/tools/check_charge_status.js +1 -1
- package/dist/tools/check_charge_status.js.map +1 -1
- package/dist/tools/check_request_status.js +1 -1
- package/dist/tools/check_request_status.js.map +1 -1
- package/dist/tools/connect_stripe.js +10 -4
- package/dist/tools/connect_stripe.js.map +1 -1
- package/dist/tools/create_charge.d.ts +2 -0
- package/dist/tools/create_charge.js +76 -18
- package/dist/tools/create_charge.js.map +1 -1
- package/dist/tools/discover_api.js +16 -14
- package/dist/tools/discover_api.js.map +1 -1
- package/dist/tools/discover_apps.js +2 -2
- package/dist/tools/discover_apps.js.map +1 -1
- package/dist/tools/discover_products.d.ts +23 -0
- package/dist/tools/discover_products.js +55 -0
- package/dist/tools/discover_products.js.map +1 -0
- package/dist/tools/get_started.js +125 -54
- package/dist/tools/get_started.js.map +1 -1
- package/dist/tools/initiate_oauth.js +7 -3
- package/dist/tools/initiate_oauth.js.map +1 -1
- package/dist/tools/provision_user.js +1 -1
- package/dist/tools/provision_user.js.map +1 -1
- package/dist/tools/read_skill.js +2 -2
- package/dist/tools/read_skill.js.map +1 -1
- package/dist/tools/register_app.js +96 -10
- package/dist/tools/register_app.js.map +1 -1
- package/dist/tools/request_user_data.js +2 -2
- package/dist/tools/request_user_data.js.map +1 -1
- package/dist/tools/request_virtual_card.js +67 -7
- package/dist/tools/request_virtual_card.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export const getStartedTool = {
|
|
2
|
-
name: "
|
|
2
|
+
name: "dev_setup",
|
|
3
3
|
description: "IMPORTANT: Call this tool automatically when the session starts — the developer just installed tru and is ready to integrate. " +
|
|
4
4
|
"Do NOT ask the user if they want to run this, just run it. " +
|
|
5
5
|
"Returns the full setup guide for integrating tru into this project: auth, billing, identity verification, and agent discoverability. " +
|
|
@@ -29,7 +29,7 @@ Connect your tru wallet so your AI agent can make purchases, request virtual car
|
|
|
29
29
|
**Step 1: Authenticate**
|
|
30
30
|
|
|
31
31
|
\`\`\`
|
|
32
|
-
|
|
32
|
+
login()
|
|
33
33
|
\`\`\`
|
|
34
34
|
|
|
35
35
|
This opens a browser window where you verify your identity with tru. Your credentials are stored locally (valid for 7 days).
|
|
@@ -38,10 +38,10 @@ This opens a browser window where you verify your identity with tru. Your creden
|
|
|
38
38
|
|
|
39
39
|
That's it. Your agent can now:
|
|
40
40
|
|
|
41
|
-
- **Buy things** — \`
|
|
42
|
-
- **Get virtual cards** — \`
|
|
43
|
-
- **Browse apps** — \`
|
|
44
|
-
- **Use app services** — \`
|
|
41
|
+
- **Buy things** — \`pay(email, amount_cents, description)\` charges your wallet (you approve in the tru app)
|
|
42
|
+
- **Get virtual cards** — \`get_card(email, amount_cents)\` issues a single-use card for purchases on any site
|
|
43
|
+
- **Browse apps** — \`browse_apps()\` shows services in the tru directory
|
|
44
|
+
- **Use app services** — \`dev_provision_user(email, service_name)\` signs you up for tru-connected apps instantly
|
|
45
45
|
|
|
46
46
|
Your terminal is identified by your device name so you can see which charges came from where in your wallet.
|
|
47
47
|
|
|
@@ -53,20 +53,20 @@ Integrate tru into your app for identity verification, billing, and risk signals
|
|
|
53
53
|
|
|
54
54
|
**CRITICAL — tru is invisible infrastructure.** The app's customers should NEVER see "tru" branding. When integrating:
|
|
55
55
|
- Buttons say "Login" or "Subscribe" — NOT "Login with tru" or "Subscribe with tru"
|
|
56
|
-
- tru's
|
|
57
|
-
- The only mention of tru visible to customers is a small "secured by tru" text in
|
|
56
|
+
- tru's login and billing screens automatically inherit the app's brand color — they look like the app, not like tru
|
|
57
|
+
- The only mention of tru visible to customers is a small "secured by tru" text in page footers
|
|
58
58
|
- All customer-facing UI should use the app's own name and branding
|
|
59
59
|
- tru is the invisible layer — like Stripe is to payments, tru is to identity and billing
|
|
60
60
|
|
|
61
|
-
**IMPORTANT: Drive through all
|
|
61
|
+
**IMPORTANT: Drive through all 6 steps in order. Do NOT skip steps or jump ahead. Each step depends on the previous one. Don't stop after each step to ask what the developer wants to do next — just move to the next step. The full setup takes about 10 minutes.**
|
|
62
62
|
|
|
63
63
|
**Step 1: Authenticate**
|
|
64
64
|
|
|
65
|
-
Run \`
|
|
65
|
+
Run \`login()\` immediately. This opens a browser window where the developer verifies their identity with tru. Credentials are stored locally for 7 days.
|
|
66
66
|
|
|
67
67
|
**Step 2: Register the app**
|
|
68
68
|
|
|
69
|
-
Before calling \`
|
|
69
|
+
Before calling \`dev_register_app\`, explore the project's codebase to auto-fill everything:
|
|
70
70
|
- \`package.json\` → name, description, homepage
|
|
71
71
|
- \`README.md\`, docs folders, marketing copy → app name, description
|
|
72
72
|
- Source code, route files, API handlers → understand what the app does
|
|
@@ -77,7 +77,7 @@ Before calling \`register_app\`, explore the project's codebase to auto-fill eve
|
|
|
77
77
|
Propose all values to the developer for quick confirmation. Don't ask them to fill in anything you can figure out from the code.
|
|
78
78
|
|
|
79
79
|
\`\`\`
|
|
80
|
-
|
|
80
|
+
dev_register_app(
|
|
81
81
|
service_name: "my-app",
|
|
82
82
|
display_name: "My App",
|
|
83
83
|
description: "What your app does",
|
|
@@ -85,7 +85,7 @@ register_app(
|
|
|
85
85
|
)
|
|
86
86
|
\`\`\`
|
|
87
87
|
|
|
88
|
-
The API key is automatically set for this session and saved to MCP config files. All subsequent tru tools (
|
|
88
|
+
The API key is automatically set for this session and saved to MCP config files. All subsequent tru tools (dev_connect_stripe, dev_generate_skill, etc.) use this key automatically — no need to pass it.
|
|
89
89
|
|
|
90
90
|
**After registration, set the brand color** so tru popups (login, billing approval) match the app's look:
|
|
91
91
|
\`\`\`
|
|
@@ -98,51 +98,102 @@ Extract the hex color from the app's CSS variables, primary button color, Tailwi
|
|
|
98
98
|
|
|
99
99
|
**Step 3: Connect Stripe**
|
|
100
100
|
|
|
101
|
-
Run \`
|
|
101
|
+
Run \`dev_connect_stripe(service_name)\` — this opens a browser window for the developer to authorize their Stripe account. Do NOT skip this step. Once connected, tru routes payments directly to their existing Stripe account. Their dashboard, payouts, refunds, Radar — all unchanged.
|
|
102
102
|
|
|
103
103
|
After the developer completes Stripe authorization in the browser, explain tru's pricing:
|
|
104
|
-
- **+0.
|
|
104
|
+
- **+0.5% per transaction** on top of standard Stripe processing fees
|
|
105
105
|
- No monthly fee, no setup cost, no per-user fees, no identity verification fees, no API call fees
|
|
106
106
|
- The developer's users pay nothing extra
|
|
107
107
|
|
|
108
|
-
**Step 4: Add
|
|
108
|
+
**Step 4: Add provisioning**
|
|
109
|
+
|
|
110
|
+
Add a **provision endpoint** so tru can auto-create accounts for verified users. Once the endpoint is built, register it: \`PUT /api/apps/:id\` with \`{ "provision_url": "https://myapp.com/api/tru/provision" }\`.
|
|
111
|
+
|
|
112
|
+
When a user is provisioned, tru sends their verified info plus any purchases they've made:
|
|
113
|
+
|
|
114
|
+
\`\`\`json
|
|
115
|
+
{
|
|
116
|
+
"email": "user@example.com",
|
|
117
|
+
"name": "Jane Doe",
|
|
118
|
+
"tru_user_id": "user@example.com",
|
|
119
|
+
"purchases": [
|
|
120
|
+
{
|
|
121
|
+
"charge_id": "uuid",
|
|
122
|
+
"amount_cents": 499,
|
|
123
|
+
"currency": "usd",
|
|
124
|
+
"type": "recurring",
|
|
125
|
+
"interval": "month",
|
|
126
|
+
"description": "Pro plan",
|
|
127
|
+
"status": "approved",
|
|
128
|
+
"product": {
|
|
129
|
+
"id": "uuid",
|
|
130
|
+
"name": "Pro Plan",
|
|
131
|
+
"stripe_product_id": "prod_xyz",
|
|
132
|
+
"stripe_price_id": "price_abc"
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
]
|
|
136
|
+
}
|
|
137
|
+
\`\`\`
|
|
109
138
|
|
|
110
|
-
|
|
139
|
+
The \`purchases\` array is only present when the user has approved charges — fully backwards compatible.
|
|
111
140
|
|
|
112
|
-
|
|
141
|
+
Example provision endpoint:
|
|
142
|
+
\`\`\`javascript
|
|
143
|
+
app.post('/api/tru/provision', (req, res) => {
|
|
144
|
+
const { email, name, purchases } = req.body;
|
|
145
|
+
const account = await createAccount(email, name);
|
|
146
|
+
const plan = purchases?.[0]?.product?.name;
|
|
147
|
+
if (plan) await activatePlan(account.id, plan);
|
|
148
|
+
res.json({ api_key: account.apiKey, account_id: account.id });
|
|
149
|
+
});
|
|
150
|
+
\`\`\`
|
|
113
151
|
|
|
114
|
-
|
|
152
|
+
**Step 5: Deploy**
|
|
115
153
|
|
|
116
|
-
|
|
154
|
+
Your backend is ready. Choose how to expose tru to your users:
|
|
117
155
|
|
|
118
|
-
**
|
|
156
|
+
**Option A: Agent channel** — Run \`dev_add_agent_signup(service_name)\` to get a one-line snippet for your login page. Agents browsing your site will see it and sign up through tru.
|
|
119
157
|
|
|
120
|
-
**
|
|
158
|
+
**Option B: Website login** — Run \`dev_configure_login(service_name)\` to add tru as a login provider. Your users get Stripe Link auth (100M+ accounts). Follow the \`/tru:dev-add-login\` skill for code examples.
|
|
121
159
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
160
|
+
**Option C: Both** — Do A and B. Most apps should do both.
|
|
161
|
+
|
|
162
|
+
### Adding billing (charges + subscriptions)
|
|
163
|
+
|
|
164
|
+
tru provides a client SDK (\`tru.js\`) that handles popup management, polling, and error handling.
|
|
165
|
+
|
|
166
|
+
**Simplest approach — amount on the button (no server code needed):**
|
|
167
|
+
|
|
168
|
+
\`\`\`html
|
|
169
|
+
<script src="{TRU_URL}/tru.js" data-app="my-app"></script>
|
|
170
|
+
<tru-login-button>Log in</tru-login-button>
|
|
171
|
+
<tru-pay-button amount="100" description="5 credits">Buy 5 credits ($1)</tru-pay-button>
|
|
172
|
+
|
|
173
|
+
<!-- Subscription -->
|
|
174
|
+
<tru-pay-button amount="499" description="Pro plan" type="recurring" interval="month">
|
|
175
|
+
Subscribe ($4.99/mo)
|
|
176
|
+
</tru-pay-button>
|
|
130
177
|
\`\`\`
|
|
131
178
|
|
|
132
|
-
|
|
179
|
+
The SDK opens a hosted pay page. The user logs in, approves, and the popup closes.
|
|
180
|
+
|
|
181
|
+
**Custom endpoints (full control):**
|
|
182
|
+
|
|
133
183
|
\`\`\`html
|
|
134
|
-
<
|
|
184
|
+
<tru-pay-button endpoint="/api/buy" fulfill="/api/fulfill">
|
|
185
|
+
Buy 5 credits ($1)
|
|
186
|
+
</tru-pay-button>
|
|
135
187
|
\`\`\`
|
|
136
|
-
This helps AI agents browsing the page discover the app's skill guide. It's unobtrusive for human users.
|
|
137
188
|
|
|
138
|
-
|
|
189
|
+
See the \`/tru:dev-add-billing\` skill for full server-side examples.
|
|
139
190
|
|
|
140
|
-
**Step
|
|
191
|
+
**Step 6: Make the app discoverable to AI agents**
|
|
141
192
|
|
|
142
193
|
This step runs LAST because it captures the full picture — OAuth, Stripe, provisioning, and all API endpoints. If you run it earlier, the generated files would be incomplete.
|
|
143
194
|
|
|
144
195
|
First, generate the content:
|
|
145
|
-
- If the app has a public URL, run \`
|
|
196
|
+
- If the app has a public URL, run \`dev_generate_skill(service_name)\` to crawl it, then \`lookup_skill(service_name)\` to get the generated content
|
|
146
197
|
- If the developer is running locally, read the codebase directly — docs, README, route files, OpenAPI specs, source code — and write the content yourself
|
|
147
198
|
|
|
148
199
|
Then write these files into the project's public/static directory:
|
|
@@ -161,29 +212,50 @@ These files live in the app's codebase — the app is the source of truth, not t
|
|
|
161
212
|
|
|
162
213
|
## What the developer gets after setup
|
|
163
214
|
|
|
164
|
-
Once all
|
|
215
|
+
Once all steps are complete, the app can:
|
|
165
216
|
|
|
166
217
|
- **Verify users** — \`check_identity(email)\` returns identity status + risk signals (risk level, score, card funding type, country, fingerprint reuse)
|
|
167
|
-
- **Request credentials** — \`
|
|
168
|
-
- **Charge users** — \`
|
|
169
|
-
- **Issue virtual cards** — \`
|
|
218
|
+
- **Request credentials** — \`request_identity(email, service, fields)\` asks users to share verified name, email, phone, address
|
|
219
|
+
- **Charge users** — \`pay(email, amount_cents, description)\` with user-controlled spending rules
|
|
220
|
+
- **Issue virtual cards** — \`get_card(email, amount_cents)\` for agent purchases
|
|
170
221
|
- **Auto-provision users** — add a \`provision_url\` and tru creates accounts on your app automatically for verified users
|
|
171
222
|
|
|
223
|
+
## Server SDK
|
|
224
|
+
|
|
225
|
+
For server-side integration, install the official Node.js SDK:
|
|
226
|
+
|
|
227
|
+
\`\`\`bash
|
|
228
|
+
npm install tru-sdk
|
|
229
|
+
\`\`\`
|
|
230
|
+
|
|
231
|
+
\`\`\`typescript
|
|
232
|
+
import Tru from 'tru-sdk';
|
|
233
|
+
const tru = new Tru(process.env.TRU_API_KEY, { secret: process.env.TRU_WEBHOOK_SECRET });
|
|
234
|
+
|
|
235
|
+
const user = tru.verifyToken(sessionToken); // verify JWT from tru.login()
|
|
236
|
+
const charge = await tru.charges.create({ email, amount_cents: 499, description: 'Pro' });
|
|
237
|
+
const identity = await tru.identity.check(email);
|
|
238
|
+
const event = tru.webhooks.verify(rawBody, signature);
|
|
239
|
+
\`\`\`
|
|
240
|
+
|
|
241
|
+
Zero dependencies, Node 18+, TypeScript-native. Replaces raw \`fetch()\` calls with typed methods for charges, identity, cards, and webhooks.
|
|
242
|
+
|
|
172
243
|
## Quick reference
|
|
173
244
|
|
|
174
245
|
| Tool | Purpose |
|
|
175
246
|
|------|---------|
|
|
176
|
-
| \`
|
|
177
|
-
| \`
|
|
178
|
-
| \`
|
|
179
|
-
| \`
|
|
247
|
+
| \`login\` | Verify your identity with tru |
|
|
248
|
+
| \`dev_register_app\` | Create your app, get API key |
|
|
249
|
+
| \`dev_connect_stripe\` | Link your Stripe account |
|
|
250
|
+
| \`dev_generate_skill\` | Generate agent skill from site or codebase |
|
|
180
251
|
| \`check_identity\` | Verify a user + get risk signals |
|
|
181
|
-
| \`
|
|
182
|
-
| \`
|
|
183
|
-
| \`
|
|
184
|
-
| \`
|
|
185
|
-
| \`
|
|
186
|
-
| \`
|
|
252
|
+
| \`request_identity\` | Ask user to share verified data |
|
|
253
|
+
| \`pay\` | Charge a user (one-time or subscription) |
|
|
254
|
+
| \`get_card\` | Issue single-use card for agent purchases |
|
|
255
|
+
| \`dev_provision_user\` | Auto-create account on a third-party app |
|
|
256
|
+
| \`browse_apps\` | Browse tru app directory |
|
|
257
|
+
| \`dev_add_agent_signup\` | Get agent signup snippet for your login page |
|
|
258
|
+
| \`dev_configure_login\` | Start OAuth login flow |
|
|
187
259
|
|
|
188
260
|
## Skills (slash commands)
|
|
189
261
|
|
|
@@ -191,10 +263,9 @@ After installing the tru MCP, these skills are available via \`/skills\`:
|
|
|
191
263
|
|
|
192
264
|
| Skill | Purpose |
|
|
193
265
|
|-------|---------|
|
|
194
|
-
| \`/tru:
|
|
195
|
-
| \`/tru:add-login\` | Add OAuth login (app-branded) |
|
|
196
|
-
| \`/tru:add-billing\` | Add tru billing |
|
|
197
|
-
| \`/tru:check-user\` | Add identity verification |
|
|
266
|
+
| \`/tru:dev-setup\` | Full integration walkthrough |
|
|
267
|
+
| \`/tru:dev-add-login\` | Add OAuth login (app-branded) |
|
|
268
|
+
| \`/tru:dev-add-billing\` | Add tru billing |
|
|
198
269
|
`;
|
|
199
270
|
return {
|
|
200
271
|
content: [{ type: "text", text: guide }],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get_started.js","sourceRoot":"","sources":["../../src/tools/get_started.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"get_started.js","sourceRoot":"","sources":["../../src/tools/get_started.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,IAAI,EAAE,WAAW;IACjB,WAAW,EACT,gIAAgI;QAChI,6DAA6D;QAC7D,uIAAuI;QACvI,2HAA2H;IAC7H,WAAW,EAAE,EAAE;IACf,OAAO,EAAE,KAAK,EAAE,KAA4B,EAAE,EAAE;QAC9C,MAAM,KAAK,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoQjB,CAAC;QAEE,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;SAClD,CAAC;IACJ,CAAC;CACF,CAAC"}
|
|
@@ -3,9 +3,13 @@ import crypto from "crypto";
|
|
|
3
3
|
import { lookupAppByServiceName } from "../api-client.js";
|
|
4
4
|
const BASE_URL = process.env.TRU_API_URL || "https://tru.so";
|
|
5
5
|
export const initiateOAuthTool = {
|
|
6
|
-
name: "
|
|
6
|
+
name: "dev_configure_login",
|
|
7
7
|
description: "Generate an OAuth authorization URL for a tru-integrated app. " +
|
|
8
|
-
"Given a service_name, looks up the app and returns the URL the user should open in their browser to authenticate via tru."
|
|
8
|
+
"Given a service_name, looks up the app and returns the URL the user should open in their browser to authenticate via tru. " +
|
|
9
|
+
"NOTE: For web apps using tru.js, the simpler approach is token mode login — " +
|
|
10
|
+
"tru.login({ app: 'my-app' }) opens a popup and returns a signed JWT directly via postMessage, " +
|
|
11
|
+
"no redirect URIs or callback routes needed. " +
|
|
12
|
+
"This tool generates URLs for the classic OAuth code flow (redirect-based).",
|
|
9
13
|
inputSchema: {
|
|
10
14
|
service_name: z
|
|
11
15
|
.string()
|
|
@@ -19,7 +23,7 @@ export const initiateOAuthTool = {
|
|
|
19
23
|
content: [
|
|
20
24
|
{
|
|
21
25
|
type: "text",
|
|
22
|
-
text: `No active app found with service_name "${args.service_name}". Use the
|
|
26
|
+
text: `No active app found with service_name "${args.service_name}". Use the browse_apps tool to see available apps.`,
|
|
23
27
|
},
|
|
24
28
|
],
|
|
25
29
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initiate_oauth.js","sourceRoot":"","sources":["../../src/tools/initiate_oauth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAE1D,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,WAAW,IAAI,gBAAgB,CAAC;AAE7D,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"initiate_oauth.js","sourceRoot":"","sources":["../../src/tools/initiate_oauth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAE1D,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,WAAW,IAAI,gBAAgB,CAAC;AAE7D,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EACT,gEAAg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uEAAuE;gBACvE,oBAAoB,KAAK,EAAE;aAC5B,CAAC;YAEF,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;aAC7D,CAAC;QACJ,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YACjE,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,2BAA2B,OAAO,EAAE;qBAC3C;iBACF;gBACD,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { checkIdentity, provisionUser } from "../api-client.js";
|
|
3
3
|
export const provisionUserTool = {
|
|
4
|
-
name: "
|
|
4
|
+
name: "dev_provision_user",
|
|
5
5
|
description: "Provision a tru user on a third-party app. The app must have a provision_url configured. " +
|
|
6
6
|
"tru sends the user's verified identity to the app's provision endpoint, the app creates an account " +
|
|
7
7
|
"and returns credentials (API key, account ID, etc.), and tru stores them. " +
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provision_user.js","sourceRoot":"","sources":["../../src/tools/provision_user.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEhE,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"provision_user.js","sourceRoot":"","sources":["../../src/tools/provision_user.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EA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E,IAAI,EAAE,CAAC,CAAC;gBAC3C,QAAQ;gBACR,EAAE;gBACF,8CAA8C,IAAI,CAAC,YAAY,yBAAyB;aACzF,CAAC;YAEF,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;aAC7D,CAAC;QACJ,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YAEjE,IAAI,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAC,EAAE,CAAC;gBACzC,OAAO;oBACL,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,MAAe;4BACrB,IAAI,EAAE;gCACJ,YAAY,IAAI,CAAC,YAAY,4CAA4C;gCACzE,EAAE;gCACF,6BAA6B;gCAC7B,yHAAyH;gCACzH,yEAAyE;gCACzE,EAAE;gCACF,4DAA4D;6BAC7D,CAAC,IAAI,CAAC,IAAI,CAAC;yBACb;qBACF;oBACD,OAAO,EAAE,IAAI;iBACd,CAAC;YACJ,CAAC;YAED,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,4BAA4B,OAAO,EAAE;qBAC5C;iBACF;gBACD,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAC"}
|
package/dist/tools/read_skill.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
const BASE_URL = process.env.TRU_API_URL || "https://tru.so";
|
|
3
3
|
export const readSkillTool = {
|
|
4
|
-
name: "
|
|
4
|
+
name: "lookup_skill",
|
|
5
5
|
description: "Fetch and return the SKILL.md for a specific app. " +
|
|
6
6
|
"The SKILL.md describes how an agent should interact with the app's API, " +
|
|
7
7
|
"including available endpoints, authentication, and usage examples.",
|
|
@@ -19,7 +19,7 @@ export const readSkillTool = {
|
|
|
19
19
|
content: [
|
|
20
20
|
{
|
|
21
21
|
type: "text",
|
|
22
|
-
text: `No app found with service_name "${args.service_name}". Use
|
|
22
|
+
text: `No app found with service_name "${args.service_name}". Use browse_apps to list available apps.`,
|
|
23
23
|
},
|
|
24
24
|
],
|
|
25
25
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read_skill.js","sourceRoot":"","sources":["../../src/tools/read_skill.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,WAAW,IAAI,gBAAgB,CAAC;AAE7D,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"read_skill.js","sourceRoot":"","sources":["../../src/tools/read_skill.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,WAAW,IAAI,gBAAgB,CAAC;AAE7D,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,IAAI,EAAE,cAAc;IACpB,WAAW,EACT,oDAAoD;QACpD,0EAA0E;QAC1E,oEAAoE;IACtE,WAAW,EAAE;QACX,YAAY,EAAE,CAAC;aACZ,MAAM,EAAE;aACR,QAAQ,CAAC,+CAA+C,CAAC;KAC7D;IACD,OAAO,EAAE,KAAK,EAAE,IAA8B,EAAE,EAAE;QAChD,IAAI,CAAC;YACH,MAAM,GAAG,GAAG,GAAG,QAAQ,SAAS,kBAAkB,CAAC,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC;YACjF,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,CAAC;YAE7B,IAAI,GAAG,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;gBACvB,OAAO;oBACL,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,MAAe;4BACrB,IAAI,EAAE,mCAAmC,IAAI,CAAC,YAAY,4CAA4C;yBACvG;qBACF;iBACF,CAAC;YACJ,CAAC;YAED,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;gBACZ,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;gBAC9B,MAAM,IAAI,KAAK,CAAC,aAAa,GAAG,CAAC,MAAM,KAAK,IAAI,EAAE,CAAC,CAAC;YACtD,CAAC;YAED,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;YAElC,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;aACrD,CAAC;QACJ,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YACjE,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,2BAA2B,OAAO,EAAE;qBAC3C;iBACF;gBACD,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAC"}
|
|
@@ -1,9 +1,79 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { readFile, writeFile, access } from "node:fs/promises";
|
|
3
|
-
import { join } from "node:path";
|
|
2
|
+
import { readFile, writeFile, access, readdir } from "node:fs/promises";
|
|
3
|
+
import { join, extname } from "node:path";
|
|
4
4
|
import { homedir } from "node:os";
|
|
5
5
|
import { registerAppAuthenticated } from "../api-client.js";
|
|
6
6
|
import { getStoredAuth, saveApp } from "../config.js";
|
|
7
|
+
const BASE_URL = process.env.TRU_API_URL || "https://tru.so";
|
|
8
|
+
/** Search the project for a logo/favicon and upload it */
|
|
9
|
+
async function tryUploadLogo(appId, apiKey) {
|
|
10
|
+
const cwd = process.cwd();
|
|
11
|
+
// Common logo file locations, in priority order
|
|
12
|
+
const candidates = [
|
|
13
|
+
"logo.png", "logo.svg", "logo.jpg", "logo.webp",
|
|
14
|
+
"icon.png", "icon.svg",
|
|
15
|
+
"public/logo.png", "public/logo.svg", "public/logo.jpg", "public/logo.webp",
|
|
16
|
+
"public/icon.png", "public/icon.svg",
|
|
17
|
+
"public/favicon.png", "public/favicon.svg", "public/favicon.ico",
|
|
18
|
+
"static/logo.png", "static/logo.svg",
|
|
19
|
+
"assets/logo.png", "assets/logo.svg",
|
|
20
|
+
"src/assets/logo.png", "src/assets/logo.svg",
|
|
21
|
+
"public/images/logo.png", "public/img/logo.png",
|
|
22
|
+
"favicon.png", "favicon.svg", "favicon.ico",
|
|
23
|
+
];
|
|
24
|
+
// Also scan public/ for any *logo* or *icon* files
|
|
25
|
+
const scanDirs = ["public", "static", "assets", "src/assets"];
|
|
26
|
+
for (const dir of scanDirs) {
|
|
27
|
+
try {
|
|
28
|
+
const files = await readdir(join(cwd, dir));
|
|
29
|
+
for (const f of files) {
|
|
30
|
+
const lower = f.toLowerCase();
|
|
31
|
+
if ((lower.includes("logo") || lower.includes("icon")) &&
|
|
32
|
+
[".png", ".svg", ".jpg", ".jpeg", ".webp"].includes(extname(lower))) {
|
|
33
|
+
const path = `${dir}/${f}`;
|
|
34
|
+
if (!candidates.includes(path))
|
|
35
|
+
candidates.push(path);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
catch { /* dir doesn't exist */ }
|
|
40
|
+
}
|
|
41
|
+
for (const candidate of candidates) {
|
|
42
|
+
const fullPath = join(cwd, candidate);
|
|
43
|
+
try {
|
|
44
|
+
await access(fullPath);
|
|
45
|
+
const fileData = await readFile(fullPath);
|
|
46
|
+
// Determine mime type
|
|
47
|
+
const ext = extname(candidate).toLowerCase();
|
|
48
|
+
const mimeMap = {
|
|
49
|
+
".png": "image/png", ".jpg": "image/jpeg", ".jpeg": "image/jpeg",
|
|
50
|
+
".svg": "image/svg+xml", ".webp": "image/webp", ".ico": "image/x-icon",
|
|
51
|
+
};
|
|
52
|
+
const mime = mimeMap[ext] || "application/octet-stream";
|
|
53
|
+
// Upload via multipart form
|
|
54
|
+
const boundary = "----TruLogoBoundary" + Date.now();
|
|
55
|
+
const filename = candidate.split("/").pop() || "logo.png";
|
|
56
|
+
const header = `--${boundary}\r\nContent-Disposition: form-data; name="logo"; filename="${filename}"\r\nContent-Type: ${mime}\r\n\r\n`;
|
|
57
|
+
const footer = `\r\n--${boundary}--\r\n`;
|
|
58
|
+
const headerBuf = Buffer.from(header);
|
|
59
|
+
const footerBuf = Buffer.from(footer);
|
|
60
|
+
const body = Buffer.concat([headerBuf, fileData, footerBuf]);
|
|
61
|
+
const res = await fetch(`${BASE_URL}/api/apps/${appId}/logo`, {
|
|
62
|
+
method: "POST",
|
|
63
|
+
headers: {
|
|
64
|
+
"Content-Type": `multipart/form-data; boundary=${boundary}`,
|
|
65
|
+
"X-API-Key": apiKey,
|
|
66
|
+
},
|
|
67
|
+
body,
|
|
68
|
+
});
|
|
69
|
+
if (res.ok) {
|
|
70
|
+
return candidate;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
catch { /* file doesn't exist or upload failed */ }
|
|
74
|
+
}
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
7
77
|
/** Find and update tru API key in MCP config files */
|
|
8
78
|
async function persistApiKey(apiKey) {
|
|
9
79
|
const cwd = process.cwd();
|
|
@@ -39,15 +109,18 @@ async function persistApiKey(apiKey) {
|
|
|
39
109
|
return updated;
|
|
40
110
|
}
|
|
41
111
|
export const registerAppTool = {
|
|
42
|
-
name: "
|
|
43
|
-
description: "[Developer tool] Register a new app on the tru platform. Requires authentication (run `
|
|
112
|
+
name: "dev_register_app",
|
|
113
|
+
description: "[Developer tool] Register a new app on the tru platform. Requires authentication (run `login` first). " +
|
|
44
114
|
"Before calling, explore the codebase — package.json, README, docs, marketing pages, source code, config files — to auto-fill service_name, display_name, description, website, and redirect_uris. " +
|
|
45
115
|
"Also extract the app's primary brand color from CSS, Tailwind config, theme files, or landing page styling — after registration, set it via PUT /api/apps/:service_name with { brand_color: '#hex' }. " +
|
|
46
116
|
"tru popups (login, billing) inherit this color so they look native to the app. " +
|
|
47
|
-
"Look for OAuth callback routes (e.g. /api/auth/callback/tru) to set redirect_uris —
|
|
117
|
+
"Look for OAuth callback routes (e.g. /api/auth/callback/tru) to set redirect_uris — these are only needed if using the classic OAuth code flow. " +
|
|
118
|
+
"For the simpler token mode login (recommended), redirect_uris are not required. " +
|
|
48
119
|
"Propose values to the developer for confirmation rather than asking them to fill things in. " +
|
|
49
|
-
"Returns an API key and automatically configures
|
|
50
|
-
"
|
|
120
|
+
"Returns an API key, an app secret, and automatically configures the API key for this session and saves it to .mcp.json. " +
|
|
121
|
+
"After registration, run dev_connect_stripe to link the developer's Stripe account. " +
|
|
122
|
+
"The app secret is used to verify session tokens (JWTs) issued by tru after login — the app's server uses it to verify tokens without calling tru. " +
|
|
123
|
+
"All subsequent tru tools use the API key automatically.",
|
|
51
124
|
inputSchema: {
|
|
52
125
|
service_name: z
|
|
53
126
|
.string()
|
|
@@ -62,7 +135,7 @@ export const registerAppTool = {
|
|
|
62
135
|
website: z
|
|
63
136
|
.string()
|
|
64
137
|
.optional()
|
|
65
|
-
.describe("The app's public URL. Required for API discovery (
|
|
138
|
+
.describe("The app's public URL. Required for API discovery (dev_generate_skill) and the agent widget. Always ask the developer for this."),
|
|
66
139
|
allowed_fields: z
|
|
67
140
|
.array(z.string())
|
|
68
141
|
.optional()
|
|
@@ -84,7 +157,7 @@ export const registerAppTool = {
|
|
|
84
157
|
content: [
|
|
85
158
|
{
|
|
86
159
|
type: "text",
|
|
87
|
-
text: "You need to authenticate before registering an app. Run the `
|
|
160
|
+
text: "You need to authenticate before registering an app. Run the `login` tool first — it will open a browser window where you can verify your identity with tru.",
|
|
88
161
|
},
|
|
89
162
|
],
|
|
90
163
|
isError: true,
|
|
@@ -112,6 +185,10 @@ export const registerAppTool = {
|
|
|
112
185
|
`Status: ${result.app.status}`,
|
|
113
186
|
``,
|
|
114
187
|
`API Key: ${result.api_key}`,
|
|
188
|
+
`App Secret: ${result.app_secret}`,
|
|
189
|
+
``,
|
|
190
|
+
`The API key authenticates server-to-server requests to tru.`,
|
|
191
|
+
`The app secret verifies session tokens — after a user logs in via tru.login(), the JWT is signed with this secret. Your server verifies it with jwt.verify(token, appSecret).`,
|
|
115
192
|
];
|
|
116
193
|
if (configsUpdated.length > 0) {
|
|
117
194
|
lines.push(``, `API key auto-saved to:`, ...configsUpdated.map((p) => ` ${p}`), ``, `This session is already configured. Future sessions will pick up the key automatically.`);
|
|
@@ -119,6 +196,15 @@ export const registerAppTool = {
|
|
|
119
196
|
else {
|
|
120
197
|
lines.push(``, `This session is configured. To persist the key for future sessions, add TRU_API_KEY to your MCP config.`);
|
|
121
198
|
}
|
|
199
|
+
// Try to upload a logo from the project
|
|
200
|
+
try {
|
|
201
|
+
const logoPath = await tryUploadLogo(result.app.id, result.api_key);
|
|
202
|
+
if (logoPath) {
|
|
203
|
+
lines.push(``, `Logo uploaded from: ${logoPath}`);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
catch { /* ignore logo upload failures */ }
|
|
207
|
+
lines.push(``, `## Next step: Connect Stripe`, `Run dev_connect_stripe() now to link the developer's Stripe account. Do NOT stop here.`);
|
|
122
208
|
return {
|
|
123
209
|
content: [
|
|
124
210
|
{
|
|
@@ -146,7 +232,7 @@ export const registerAppTool = {
|
|
|
146
232
|
content: [
|
|
147
233
|
{
|
|
148
234
|
type: "text",
|
|
149
|
-
text: `Authentication expired or invalid. Run \`
|
|
235
|
+
text: `Authentication expired or invalid. Run \`login\` again to re-verify your identity.`,
|
|
150
236
|
},
|
|
151
237
|
],
|
|
152
238
|
isError: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register_app.js","sourceRoot":"","sources":["../../src/tools/register_app.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"register_app.js","sourceRoot":"","sources":["../../src/tools/register_app.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEtD,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,WAAW,IAAI,gBAAgB,CAAC;AAE7D,0DAA0D;AAC1D,KAAK,UAAU,aAAa,CAAC,KAAa,EAAE,MAAc;IACxD,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAE1B,gDAAgD;IAChD,MAAM,UAAU,GAAG;QACjB,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW;QAC/C,UAAU,EAAE,UAAU;QACtB,iBAAiB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,kBAAkB;QAC3E,iBAAiB,EAAE,iBAAiB;QACpC,oBAAoB,EAAE,oBAAoB,EAAE,oBAAoB;QAChE,iBAAiB,EAAE,iBAAiB;QACpC,iBAAiB,EAAE,iBAAiB;QACpC,qBAAqB,EAAE,qBAAqB;QAC5C,wBAAwB,EAAE,qB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AAC,QAAQ,CAAC,KAAK,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;gBACvD,OAAO;oBACL,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,MAAe;4BACrB,IAAI,EAAE,oFAAoF;yBAC3F;qBACF;oBACD,OAAO,EAAE,IAAI;iBACd,CAAC;YACJ,CAAC;YAED,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,0BAA0B,OAAO,EAAE;qBAC1C;iBACF;gBACD,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { checkIdentity, requestCredentials } from "../api-client.js";
|
|
3
3
|
export const requestUserDataTool = {
|
|
4
|
-
name: "
|
|
4
|
+
name: "request_identity",
|
|
5
5
|
description: "Request verified data from a tru user (name, email, phone, address, banking). The user will be notified and must approve the request on their dashboard.",
|
|
6
6
|
inputSchema: {
|
|
7
7
|
email: z.string().describe("Email address of the tru user"),
|
|
@@ -43,7 +43,7 @@ export const requestUserDataTool = {
|
|
|
43
43
|
`Status: pending`,
|
|
44
44
|
``,
|
|
45
45
|
`The user has been notified and must approve this request on their tru dashboard.`,
|
|
46
|
-
`Use the
|
|
46
|
+
`Use the check_identity_status tool with request ID "${request.id}" to check if the user has responded.`,
|
|
47
47
|
];
|
|
48
48
|
return {
|
|
49
49
|
content: [{ type: "text", text: lines.join("\n") }],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request_user_data.js","sourceRoot":"","sources":["../../src/tools/request_user_data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAErE,MAAM,CAAC,MAAM,mBAAmB,GAAG;IAC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