0nmcp 3.2.2 → 4.5.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 CHANGED
@@ -1,21 +1,94 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 RocketOpp
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ Business Source License 1.1
2
+
3
+ License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved.
4
+ "Business Source License" is a trademark of MariaDB Corporation Ab.
5
+
6
+ Parameters
7
+
8
+ Licensor: RocketOpp LLC
9
+ Licensed Work: 0nMCP v4.5.0 and all subsequent versions
10
+ The Licensed Work is (c) 2025-2026 RocketOpp LLC.
11
+ Additional Use Grant: You may use the Licensed Work for non-commercial,
12
+ personal, educational, and evaluation purposes only.
13
+ Commercial use including but not limited to offering
14
+ the Licensed Work as a hosted service, embedding it in
15
+ a commercial product, or using it to process data for
16
+ paying customers requires a separate commercial
17
+ license from RocketOpp LLC.
18
+ Change Date: May 1, 2030
19
+ Change License: Apache License, Version 2.0
20
+
21
+ For information about obtaining a commercial license, please contact:
22
+ mike@rocketopp.com
23
+
24
+ Notice
25
+
26
+ The Business Source License (this document, or the "License") is not an Open
27
+ Source license. However, the Licensed Work will eventually be made available
28
+ under an Open Source License, as stated in this License.
29
+
30
+ Terms
31
+
32
+ The Licensor hereby grants you the right to copy, modify, create derivative
33
+ works, redistribute, and make non-production use of the Licensed Work. The
34
+ Licensor may make an Additional Use Grant, above, permitting limited
35
+ production use.
36
+
37
+ Effective on the Change Date, or the fourth anniversary of the first publicly
38
+ available distribution of a specific version of the Licensed Work under this
39
+ License, whichever comes first, the Licensor hereby grants you rights under
40
+ the terms of the Change License, and the rights granted in the paragraph
41
+ above terminate.
42
+
43
+ If your use of the Licensed Work does not comply with the requirements
44
+ currently in effect as described in this License, you must purchase a
45
+ commercial license from the Licensor, its affiliated entities, or authorized
46
+ resellers, or you must refrain from using the Licensed Work.
47
+
48
+ All copies of the original and modified Licensed Work, and derivative works
49
+ of the Licensed Work, are subject to this License. This License applies
50
+ separately for each version of the Licensed Work and the Change Date may vary
51
+ for each version of the Licensed Work released by Licensor.
52
+
53
+ You must conspicuously display this License on each original or modified copy
54
+ of the Licensed Work. If you receive the Licensed Work in original or
55
+ modified form from a third party, the terms and conditions set forth in this
56
+ License apply to your use of that work.
57
+
58
+ Any use of the Licensed Work in violation of this License will automatically
59
+ terminate your rights under this License for the current and all other
60
+ versions of the Licensed Work.
61
+
62
+ This License does not grant you any right in any trademark or logo of
63
+ Licensor or its affiliates (provided that you may use a trademark or logo of
64
+ Licensor as expressly required by this License).
65
+
66
+ TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
67
+ AN "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
68
+ EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
69
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
70
+ TITLE.
71
+
72
+ Patents
73
+
74
+ The following patents are filed and pending on technology contained within
75
+ the Licensed Work. Use of the Licensed Work does not grant any patent license
76
+ except as expressly provided by a separate commercial agreement:
77
+
78
+ US Provisional #63/990,046 — 0nVault Container System (filed 02/24/2026)
79
+ US Provisional #63/968,814 — Seal of Truth (filed 12/2025)
80
+ Three-Level Execution: Pipeline > Assembly Line > Radial Burst (pending)
81
+ Universal Capability Routing & Field Resolution (pending)
82
+
83
+ Inventor: Michael A Mento Jr.
84
+ Assignee: RocketOpp LLC
85
+
86
+ Commercial Licensing
87
+
88
+ For commercial use, enterprise licensing, OEM partnerships, or white-label
89
+ agreements, contact:
90
+
91
+ RocketOpp LLC
92
+ mike@rocketopp.com
93
+ https://0ncore.com
94
+ https://rocketopp.com
package/README.md CHANGED
@@ -2,19 +2,20 @@
2
2
 
3
3
  # 0nMCP
4
4
 
5
- ### 1,554 Tools. 96 Services. One MCP Server.
5
+ ### 14,500+ Tools. 867 Services. 96 Categories. One MCP Server.
6
6
 
7
- **The most comprehensive MCP server available.**<br>
8
- Connect any AI to any API. Natural language. Zero configuration. $0.01/run.<br>
9
- 5 patents filed. LinkedIn certifications. Daily patent monitoring via 0nDefender.
7
+ **The most comprehensive MCP server ever built.**<br>
8
+ Connect any AI to any API. Natural language. Zero configuration.<br>
9
+ 0nAI Engine, Agent Bridge, Blog-to-Social Workflows, Security Trust Engine, Voice AI, Snapshot Deployment.<br>
10
+ 5 patents pending. BSL licensed. Requires [0nCore account](https://0ncore.com). Commercial use requires license from [RocketOpp LLC](https://rocketopp.com).
10
11
 
11
12
  [![npm version](https://img.shields.io/npm/v/0nmcp.svg?style=flat-square)](https://www.npmjs.com/package/0nmcp)
12
13
  [![npm downloads](https://img.shields.io/npm/dm/0nmcp.svg?style=flat-square)](https://www.npmjs.com/package/0nmcp)
13
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square)](https://opensource.org/licenses/MIT)
14
+ [![License: BSL 1.1](https://img.shields.io/badge/License-BSL%201.1-blue.svg?style=flat-square)](./LICENSE)
14
15
  [![Node.js](https://img.shields.io/badge/node-%3E%3D18.0.0-brightgreen?style=flat-square)](https://nodejs.org)
15
16
  [![MCP](https://img.shields.io/badge/MCP-Compatible-blueviolet?style=flat-square)](https://modelcontextprotocol.io)
16
- [![Tools](https://img.shields.io/badge/tools-1554-orange?style=flat-square)](#tool-count-breakdown)
17
- [![Services](https://img.shields.io/badge/services-96-blue?style=flat-square)](#all-96-services)
17
+ [![Tools](https://img.shields.io/badge/tools-14500%2B-orange?style=flat-square)](#tool-count-breakdown)
18
+ [![Services](https://img.shields.io/badge/services-867-blue?style=flat-square)](#all-96-services)
18
19
  [![Patents](https://img.shields.io/badge/patents-5%20filed-blueviolet?style=flat-square)](#patents)
19
20
 
20
21
  [Website](https://0nmcp.com) &middot; [Quick Start](#quick-start) &middot; [All 96 Services](#all-96-services) &middot; [MCP Config](#mcp-configuration) &middot; [Certifications](https://0nmcp.com/learn) &middot; [Community](https://0nmcp.com/community)
@@ -520,6 +521,6 @@ Automated daily scans via Claude AI with web search.
520
521
 
521
522
  ## License
522
523
 
523
- MIT -- free for personal and commercial use.
524
+ BSL 1.1 -- free for non-commercial use. Commercial use requires a license from RocketOpp LLC. See LICENSE file for full terms.
524
525
 
525
526
  Built by [0nORK](https://0nork.com). Stop building workflows. Start describing outcomes.
package/crm/addons.js ADDED
@@ -0,0 +1,319 @@
1
+ // ============================================================
2
+ // 0nMCP — Add-on Product Definitions
3
+ // ============================================================
4
+ // Each add-on maps to specific SDK modules + CRM capabilities.
5
+ // User buys key → capabilities unlock → 0nMCP can execute.
6
+ // ============================================================
7
+
8
+ export const ADDONS = [
9
+ {
10
+ slug: "ai-course-builder",
11
+ name: "AI Course Builder",
12
+ description: "Generate full courses with AI — lessons, categories, materials. Auto-imported into CRM.",
13
+ priceCents: 4900,
14
+ sdkModules: ["courses"],
15
+ scopes: ["courses.readonly", "courses.write"],
16
+ capabilities: ["course_create", "course_import", "course_list", "lesson_generate"],
17
+ },
18
+ {
19
+ slug: "voice-ai-agent",
20
+ name: "Voice AI Agent",
21
+ description: "Deploy AI phone agents with knowledge bases, actions, and call routing.",
22
+ priceCents: 9900,
23
+ sdkModules: ["voiceAi"],
24
+ scopes: ["voice-ai-agents.readonly", "voice-ai-agents.write", "voice-ai-agent-goals.readonly", "voice-ai-agent-goals.write"],
25
+ capabilities: ["voice_agent_create", "voice_agent_configure", "voice_action_create", "voice_call_logs"],
26
+ },
27
+ {
28
+ slug: "conversation-ai",
29
+ name: "Conversation AI",
30
+ description: "Configure AI chatbots for messaging channels with custom personas and knowledge.",
31
+ priceCents: 4900,
32
+ sdkModules: ["conversations"],
33
+ scopes: ["conversation-ai.readonly", "conversation-ai.write", "conversations.readonly", "conversations.write"],
34
+ capabilities: ["convo_ai_configure", "convo_ai_manage", "convo_message_send"],
35
+ },
36
+ {
37
+ slug: "social-planner",
38
+ name: "Social Media Planner",
39
+ description: "Schedule and publish to all social channels. AI-generated content with approval flow.",
40
+ priceCents: 2900,
41
+ sdkModules: ["socialMediaPosting"],
42
+ scopes: ["socialplanner/post.readonly", "socialplanner/post.write", "socialplanner/account.readonly"],
43
+ capabilities: ["social_post_create", "social_post_schedule", "social_account_list"],
44
+ },
45
+ {
46
+ slug: "blog-engine",
47
+ name: "Blog Engine",
48
+ description: "AI-generated blog posts published directly to CRM blog. SEO-optimized with categories.",
49
+ priceCents: 1900,
50
+ sdkModules: ["blogs"],
51
+ scopes: ["blogs/post.write", "blogs/post-update.write", "blogs/posts.readonly", "blogs/category.readonly"],
52
+ capabilities: ["blog_post_create", "blog_post_update", "blog_list"],
53
+ },
54
+ {
55
+ slug: "snapshot-manager",
56
+ name: "Snapshot Manager",
57
+ description: "Generate, deploy, and clone CRM snapshots between locations. Full configuration backup.",
58
+ priceCents: 9900,
59
+ sdkModules: ["snapshots"],
60
+ scopes: ["snapshots.readonly", "snapshots.write"],
61
+ capabilities: ["snapshot_create", "snapshot_deploy", "snapshot_list"],
62
+ },
63
+ {
64
+ slug: "affiliate-manager",
65
+ name: "Affiliate Manager",
66
+ description: "Create and manage affiliate programs with tracking, campaigns, and commission management.",
67
+ priceCents: 4900,
68
+ sdkModules: ["affiliates"],
69
+ scopes: [],
70
+ capabilities: ["affiliate_create", "affiliate_campaign", "affiliate_commission"],
71
+ },
72
+ {
73
+ slug: "invoice-automation",
74
+ name: "Invoice Automation",
75
+ description: "AI-generated invoices, estimates, and recurring billing. Auto-send on triggers.",
76
+ priceCents: 2900,
77
+ sdkModules: ["invoices"],
78
+ scopes: ["invoices.readonly", "invoices.write", "invoices/schedule.readonly", "invoices/schedule.write"],
79
+ capabilities: ["invoice_create", "invoice_send", "invoice_schedule", "estimate_create"],
80
+ },
81
+ {
82
+ slug: "email-builder",
83
+ name: "Email Builder",
84
+ description: "AI-generated email campaigns and templates. Schedule and send from CRM.",
85
+ priceCents: 1900,
86
+ sdkModules: ["emails"],
87
+ scopes: ["emails/builder.write", "emails/builder.readonly", "emails/schedule.readonly", "emails/schedule.write"],
88
+ capabilities: ["email_template_create", "email_schedule", "email_send"],
89
+ },
90
+ {
91
+ slug: "knowledge-base",
92
+ name: "Knowledge Base Manager",
93
+ description: "Create and manage AI knowledge bases. Feed data to agents, bots, and voice AI.",
94
+ priceCents: 2900,
95
+ sdkModules: ["knowledgeBases"],
96
+ scopes: ["knowledge-bases.write", "knowledge-bases.readonly"],
97
+ capabilities: ["kb_create", "kb_update", "kb_source_add", "kb_list"],
98
+ },
99
+ {
100
+ slug: "workflow-reader",
101
+ name: "Workflow Intelligence",
102
+ description: "Read and analyze workflow definitions. Generate .0n SWITCH files from existing automations.",
103
+ priceCents: 1900,
104
+ sdkModules: ["workflows"],
105
+ scopes: ["workflows.readonly"],
106
+ capabilities: ["workflow_list", "workflow_read", "workflow_export_0n"],
107
+ },
108
+ {
109
+ slug: "agent-studio",
110
+ name: "Agent Studio Pro",
111
+ description: "Build, deploy, and manage AI agents with MCP tool access and knowledge base connections.",
112
+ priceCents: 9900,
113
+ sdkModules: ["agentStudio"],
114
+ scopes: ["agent-studio.readonly", "agent-studio.write"],
115
+ capabilities: ["agent_create", "agent_execute", "agent_promote", "agent_configure_kb", "agent_configure_mcp"],
116
+ },
117
+ {
118
+ slug: "phone-system",
119
+ name: "Phone System",
120
+ description: "Purchase phone numbers, manage active lines, configure forwarding, call recording, and number pools.",
121
+ priceCents: 4900,
122
+ sdkModules: ["phoneSystem"],
123
+ scopes: ["phonenumbers.read", "phonenumbers.write", "numberpools.read"],
124
+ capabilities: ["phone_purchase", "phone_search", "phone_list", "phone_release", "phone_update", "phone_pools"],
125
+ },
126
+ {
127
+ slug: "calendar-booking",
128
+ name: "Calendar & Booking",
129
+ description: "Create calendars, manage events, booking links, appointment types, and resource scheduling.",
130
+ priceCents: 2900,
131
+ sdkModules: ["calendars"],
132
+ scopes: ["calendars.readonly", "calendars.write", "calendars/events.readonly", "calendars/events.write", "calendars/groups.readonly", "calendars/groups.write", "calendars/resources.readonly", "calendars/resources.write"],
133
+ capabilities: ["calendar_create", "calendar_events", "booking_link", "resource_schedule", "appointment_types"],
134
+ },
135
+ {
136
+ slug: "contact-manager",
137
+ name: "Contact Manager",
138
+ description: "Full contact CRUD, tagging, notes, tasks, bulk operations, and workflow enrollment.",
139
+ priceCents: 1900,
140
+ sdkModules: ["contacts"],
141
+ scopes: ["contacts.readonly", "contacts.write"],
142
+ capabilities: ["contact_create", "contact_update", "contact_search", "contact_tag", "contact_note", "contact_task", "contact_bulk"],
143
+ },
144
+ {
145
+ slug: "opportunity-pipeline",
146
+ name: "Opportunity Pipeline",
147
+ description: "Manage sales pipelines, stages, deals, and opportunity tracking with custom fields.",
148
+ priceCents: 2900,
149
+ sdkModules: ["opportunities"],
150
+ scopes: ["opportunities.readonly", "opportunities.write"],
151
+ capabilities: ["pipeline_create", "pipeline_stages", "opportunity_create", "opportunity_update", "opportunity_search"],
152
+ },
153
+ {
154
+ slug: "payment-processing",
155
+ name: "Payment Processing",
156
+ description: "Process payments, manage orders, subscriptions, coupons, and transaction history.",
157
+ priceCents: 4900,
158
+ sdkModules: ["payments"],
159
+ scopes: ["payments/orders.readonly", "payments/orders.write", "payments/orders.collectPayment", "payments/transactions.readonly", "payments/subscriptions.readonly", "payments/coupons.readonly", "payments/coupons.write"],
160
+ capabilities: ["payment_collect", "order_create", "subscription_manage", "coupon_create", "transaction_list"],
161
+ },
162
+ {
163
+ slug: "product-catalog",
164
+ name: "Product Catalog",
165
+ description: "Manage products, pricing, collections, and inventory for your store.",
166
+ priceCents: 1900,
167
+ sdkModules: ["products"],
168
+ scopes: ["products.readonly", "products.write", "products/prices.readonly", "products/prices.write", "products/collection.readonly", "products/collection.write"],
169
+ capabilities: ["product_create", "product_price", "collection_manage", "inventory_update"],
170
+ },
171
+ {
172
+ slug: "form-builder",
173
+ name: "Form Builder",
174
+ description: "Create and manage forms, surveys, and data collection with submission tracking.",
175
+ priceCents: 1900,
176
+ sdkModules: ["forms", "surveys"],
177
+ scopes: ["forms.readonly", "forms.write", "surveys.readonly"],
178
+ capabilities: ["form_create", "form_submissions", "survey_list", "survey_results"],
179
+ },
180
+ {
181
+ slug: "funnel-builder",
182
+ name: "Funnel & Website Builder",
183
+ description: "Manage funnels, pages, redirects, and website content programmatically.",
184
+ priceCents: 2900,
185
+ sdkModules: ["funnels"],
186
+ scopes: ["funnels/funnel.readonly", "funnels/page.readonly", "funnels/redirect.readonly", "funnels/redirect.write"],
187
+ capabilities: ["funnel_list", "funnel_pages", "redirect_manage", "page_content"],
188
+ },
189
+ {
190
+ slug: "media-manager",
191
+ name: "Media Manager",
192
+ description: "Upload, organize, and manage files and media assets in the CRM.",
193
+ priceCents: 900,
194
+ sdkModules: ["medias"],
195
+ scopes: ["medias.readonly", "medias.write"],
196
+ capabilities: ["media_upload", "media_list", "media_delete", "media_organize"],
197
+ },
198
+ {
199
+ slug: "custom-objects",
200
+ name: "Custom Objects",
201
+ description: "Create custom object schemas, records, and associations for any data model.",
202
+ priceCents: 4900,
203
+ sdkModules: ["objects", "associations"],
204
+ scopes: ["objects/schema.readonly", "objects/schema.write", "objects/record.readonly", "objects/record.write", "associations.readonly", "associations.write"],
205
+ capabilities: ["object_schema_create", "object_record_crud", "association_create", "association_query"],
206
+ },
207
+ {
208
+ slug: "campaign-manager",
209
+ name: "Campaign Manager",
210
+ description: "View and manage email and SMS campaigns with audience targeting.",
211
+ priceCents: 2900,
212
+ sdkModules: ["campaigns"],
213
+ scopes: ["campaigns.readonly"],
214
+ capabilities: ["campaign_list", "campaign_stats", "campaign_audience"],
215
+ },
216
+ {
217
+ slug: "document-contracts",
218
+ name: "Documents & Contracts",
219
+ description: "Send contracts, proposals, and documents for e-signature.",
220
+ priceCents: 2900,
221
+ sdkModules: ["proposals"],
222
+ scopes: ["documents_contracts/list.readonly", "documents_contracts/sendLink.write", "documents_contracts_template/sendLink.write", "documents_contracts_template/list.readonly"],
223
+ capabilities: ["contract_send", "contract_list", "template_send", "proposal_create"],
224
+ },
225
+ {
226
+ slug: "ecommerce-store",
227
+ name: "E-Commerce Store",
228
+ description: "Manage online store settings, shipping, and order fulfillment.",
229
+ priceCents: 4900,
230
+ sdkModules: ["store"],
231
+ scopes: ["store/shipping.readonly", "store/shipping.write", "store/setting.readonly", "store/setting.write"],
232
+ capabilities: ["store_settings", "shipping_config", "order_fulfill", "store_manage"],
233
+ },
234
+ {
235
+ slug: "link-triggers",
236
+ name: "Link Triggers",
237
+ description: "Create and manage trigger links for workflow automation.",
238
+ priceCents: 900,
239
+ sdkModules: ["links"],
240
+ scopes: ["links.readonly", "links.write"],
241
+ capabilities: ["link_create", "link_list", "link_trigger"],
242
+ },
243
+ {
244
+ slug: "user-management",
245
+ name: "User Management",
246
+ description: "Manage team members, roles, permissions, and user accounts.",
247
+ priceCents: 1900,
248
+ sdkModules: ["users"],
249
+ scopes: ["users.readonly", "users.write"],
250
+ capabilities: ["user_list", "user_create", "user_update", "user_permissions"],
251
+ },
252
+ {
253
+ slug: "wordpress-manager",
254
+ name: "WordPress Manager",
255
+ description: "Manage WordPress sites connected to your CRM location.",
256
+ priceCents: 1900,
257
+ sdkModules: ["wordpress"],
258
+ scopes: ["wordpress.site.readonly"],
259
+ capabilities: ["wp_site_list", "wp_site_status"],
260
+ },
261
+ {
262
+ slug: "saas-manager",
263
+ name: "SaaS & White-Label",
264
+ description: "Manage SaaS locations, company settings, and white-label configuration.",
265
+ priceCents: 9900,
266
+ sdkModules: ["saasApi", "companies"],
267
+ scopes: ["saas/company.read", "saas/company.write", "saas/location.read", "saas/location.write", "companies.readonly"],
268
+ capabilities: ["saas_location_manage", "company_settings", "whitelabel_config", "location_provision"],
269
+ },
270
+ {
271
+ slug: "location-settings",
272
+ name: "Location Settings",
273
+ description: "Manage location configuration, custom fields, custom values, tags, and templates.",
274
+ priceCents: 1900,
275
+ sdkModules: ["locations", "customFields", "customMenus"],
276
+ scopes: ["locations.readonly", "locations.write", "locations/customFields.readonly", "locations/customFields.write", "locations/customValues.readonly", "locations/customValues.write", "locations/tags.readonly", "locations/tags.write", "locations/templates.readonly"],
277
+ capabilities: ["location_settings", "custom_field_crud", "custom_value_crud", "tag_manage", "template_list"],
278
+ },
279
+ {
280
+ slug: "brand-board",
281
+ name: "Brand Board",
282
+ description: "Manage brand design kits — colors, fonts, logos, and brand assets.",
283
+ priceCents: 900,
284
+ sdkModules: ["brandBoards"],
285
+ scopes: ["brand-boards/design-kit.readonly", "brand-boards/design-kit.write"],
286
+ capabilities: ["brand_kit_read", "brand_kit_update"],
287
+ },
288
+ ];
289
+
290
+ /**
291
+ * Get an add-on by slug.
292
+ */
293
+ export function getAddon(slug) {
294
+ return ADDONS.find((a) => a.slug === slug) || null;
295
+ }
296
+
297
+ /**
298
+ * Check if a user has a specific capability unlocked.
299
+ * @param {Array} userKeys - Array of product_keys rows for this user
300
+ * @param {string} capability - e.g. "course_create"
301
+ */
302
+ export function hasCapability(userKeys, capability) {
303
+ return userKeys.some(
304
+ (k) => k.status === "active" && k.capabilities?.includes(capability)
305
+ );
306
+ }
307
+
308
+ /**
309
+ * Get all capabilities for a user based on their purchased keys.
310
+ */
311
+ export function getUserCapabilities(userKeys) {
312
+ const caps = new Set();
313
+ for (const k of userKeys) {
314
+ if (k.status === "active" && k.capabilities) {
315
+ for (const c of k.capabilities) caps.add(c);
316
+ }
317
+ }
318
+ return [...caps];
319
+ }