@dynamoi/mcp 0.7.1 → 1.0.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/CAPABILITY_PARITY.md +57 -59
- package/CHANGELOG.md +160 -0
- package/README.md +241 -132
- package/dist/auth/protected-resource.d.ts +5 -18
- package/dist/auth/protected-resource.d.ts.map +1 -1
- package/dist/auth/protected-resource.js +8 -12
- package/dist/auth/protected-resource.js.map +1 -1
- package/dist/{chunk-2jm8hjsz.js → chunk-3htwe57a.js} +19 -30
- package/dist/chunk-3htwe57a.js.map +10 -0
- package/dist/chunk-n5xmtwjj.js +9 -0
- package/dist/chunk-n5xmtwjj.js.map +10 -0
- package/dist/consent.d.ts +3 -3
- package/dist/consent.d.ts.map +1 -1
- package/dist/consent.js +8 -8
- package/dist/consent.js.map +1 -1
- package/dist/flow-types.d.ts +3 -3
- package/dist/flow-types.d.ts.map +1 -1
- package/dist/index.d.ts +6 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1192 -577
- package/dist/index.js.map +18 -17
- package/dist/server/about.d.ts +74 -0
- package/dist/server/about.d.ts.map +1 -0
- package/dist/server/create-server.d.ts +18 -12
- package/dist/server/create-server.d.ts.map +1 -1
- package/dist/server/distribution-tools.d.ts +53 -3
- package/dist/server/distribution-tools.d.ts.map +1 -1
- package/dist/server/instructions.d.ts.map +1 -1
- package/dist/server/onboarding-tool-definitions.d.ts +50 -0
- package/dist/server/onboarding-tool-definitions.d.ts.map +1 -1
- package/dist/server/openai-tools.d.ts +50 -0
- package/dist/server/openai-tools.d.ts.map +1 -1
- package/dist/server/output-schemas.d.ts +233 -0
- package/dist/server/output-schemas.d.ts.map +1 -1
- package/dist/server/playbook-resources.d.ts +1 -1
- package/dist/server/playbook-resources.d.ts.map +1 -1
- package/dist/server/prompts.d.ts +1 -1
- package/dist/server/prompts.d.ts.map +1 -1
- package/dist/server/resources.d.ts +1 -1
- package/dist/server/resources.d.ts.map +1 -1
- package/dist/server/shop-tools.d.ts +335 -0
- package/dist/server/shop-tools.d.ts.map +1 -0
- package/dist/server/smart-link-theme-preview.d.ts +26 -1
- package/dist/server/smart-link-theme-preview.d.ts.map +1 -1
- package/dist/server/smart-link-tools.d.ts +126 -2
- package/dist/server/smart-link-tools.d.ts.map +1 -1
- package/dist/server/tools.d.ts +402 -13
- package/dist/server/tools.d.ts.map +1 -1
- package/dist/server/workflow-tools.d.ts +62 -1
- package/dist/server/workflow-tools.d.ts.map +1 -1
- package/dist/transport/http.d.ts +7 -1
- package/dist/transport/http.d.ts.map +1 -1
- package/dist/types.d.ts +14 -2
- package/dist/types.d.ts.map +1 -1
- package/package.json +5 -5
- package/server.json +1 -12
- package/dist/auth/verify-token.d.ts +0 -21
- package/dist/auth/verify-token.d.ts.map +0 -1
- package/dist/chunk-2jm8hjsz.js.map +0 -10
- package/dist/chunk-kb3xpcrb.js +0 -9
- package/dist/chunk-kb3xpcrb.js.map +0 -10
package/README.md
CHANGED
|
@@ -1,94 +1,78 @@
|
|
|
1
|
-
# Dynamoi MCP
|
|
2
|
-
|
|
3
|
-
> Let any MCP-capable AI agent run music-promotion workflows for artists and labels.
|
|
1
|
+
# Dynamoi MCP
|
|
4
2
|
|
|
5
3
|
[](https://www.npmjs.com/package/@dynamoi/mcp)
|
|
6
4
|
[](./LICENSE)
|
|
7
|
-
[](https://dynamoi.com/mcp)
|
|
8
|
-
[](https://dynamoi.com)
|
|
9
|
-
|
|
10
|
-
Musicians, managers, and labels already have enough to chase down: Spotify
|
|
11
|
-
links, artist pages, campaign setup, ad account connections, billing checks,
|
|
12
|
-
analytics, and launch notes.
|
|
13
|
-
|
|
14
|
-
**Dynamoi MCP lets an AI agent help with that work directly.** A connected agent
|
|
15
|
-
can create music-promotion campaigns and free Smart Links, pull artist and
|
|
16
|
-
campaign context, review analytics, start platform connection flows, and handle
|
|
17
|
-
music-distribution applications.
|
|
18
5
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
6
|
+
Connect an AI agent to [Dynamoi](https://dynamoi.com) to create free Smart
|
|
7
|
+
Links, check campaign and platform status, read analytics, run managed ad
|
|
8
|
+
campaigns and apply for music distribution. You can use the hosted MCP server,
|
|
9
|
+
or use this package as a library.
|
|
22
10
|
|
|
23
11
|
```txt
|
|
24
12
|
https://dynamoi.com/mcp
|
|
25
13
|
```
|
|
26
14
|
|
|
27
|
-
|
|
15
|
+
The hosted server needs no install. Point any MCP client that supports remote
|
|
16
|
+
Streamable HTTP and OAuth at that URL, and the user signs in with their
|
|
17
|
+
Dynamoi account.
|
|
28
18
|
|
|
29
|
-
|
|
30
|
-
| --- | --- |
|
|
31
|
-
| 🎧 "Make a link for this release." | Create a free Smart Link from Spotify and return the public URL. |
|
|
32
|
-
| 🚦 "Why is this campaign not ready?" | Check the missing setup: billing, platform connections, countries, assets, and launch state. |
|
|
33
|
-
| 📈 "What do we have live right now?" | Search artists, Smart Links, campaigns, analytics, and account status. |
|
|
34
|
-
| 📺 "Connect our YouTube channel." | Start the correct connection flow from the conversation. |
|
|
35
|
-
| 🚀 "Can we promote this?" | Keep the free-link workflow separate from managed advertising, then point to the next safe step. |
|
|
36
|
-
| 💿 "Can we apply for distribution?" | Check the five eligibility requirements and submit a complete application for manual review. |
|
|
37
|
-
|
|
38
|
-
## 🎤 Who It Is For
|
|
19
|
+
## About Dynamoi
|
|
39
20
|
|
|
40
|
-
|
|
41
|
-
|
|
21
|
+
Dynamoi is a music marketing platform founded in 2021 by Trevor Loucks. It
|
|
22
|
+
runs managed Meta and YouTube ad campaigns, music distribution and royalty
|
|
23
|
+
analytics for independent artists, labels, managers and YouTube creators,
|
|
24
|
+
alongside free Smart Links and analytics.
|
|
42
25
|
|
|
43
|
-
**
|
|
44
|
-
|
|
26
|
+
- **Free Smart Links:** release pages and artist hubs built from Spotify
|
|
27
|
+
URLs, with link analytics, themes, validated pixel IDs and team seats.
|
|
28
|
+
- **Managed Smart Campaigns:** Meta ads that promote Spotify tracks, albums
|
|
29
|
+
and playlists.
|
|
30
|
+
- **YouTube campaigns:** managed Google Ads campaigns for YouTube channel
|
|
31
|
+
growth.
|
|
32
|
+
- **Music distribution:** opt-in delivery to 100+ stores. Applications are
|
|
33
|
+
scored against five requirements, and approval is not guaranteed.
|
|
34
|
+
- **YouTube promotion Shop:** one-off YouTube video promotion with no
|
|
35
|
+
subscription.
|
|
45
36
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
37
|
+
Campaigns run on Dynamoi's own managed Meta and Google ad infrastructure. They
|
|
38
|
+
reach real people through official ad networks, never bots, fake streams or
|
|
39
|
+
paid playlist placement. Results vary and are never guaranteed.
|
|
49
40
|
|
|
50
|
-
|
|
41
|
+
Dynamoi is based in Sioux Falls, South Dakota, and is operated by humans,
|
|
42
|
+
assisted by AI. People make the decisions and are accountable for every
|
|
43
|
+
campaign and support reply. AI helps with ad creative, campaign monitoring,
|
|
44
|
+
reporting and routine tasks. Smart Links are free. Starter is $25/month with a
|
|
45
|
+
$50 launch campaign credit, and campaign budgets start at $10/day. See
|
|
46
|
+
[pricing](https://dynamoi.com/pricing).
|
|
51
47
|
|
|
52
|
-
|
|
48
|
+
Agents can read the same overview before sign-in through the `dynamoi_about`
|
|
49
|
+
tool or the `dynamoi://about` resource.
|
|
53
50
|
|
|
54
|
-
|
|
55
|
-
- Import an artist catalog into an artist hub.
|
|
56
|
-
- Return the shareable URL immediately.
|
|
57
|
-
- Check link status, analytics, theme/settings, and publish state.
|
|
58
|
-
- Update or publish a link when the user clearly asks.
|
|
51
|
+
## Connect
|
|
59
52
|
|
|
60
|
-
|
|
61
|
-
clean next step when the release is ready to push.
|
|
53
|
+
### Claude Code
|
|
62
54
|
|
|
63
|
-
|
|
55
|
+
```bash
|
|
56
|
+
claude mcp add --transport http dynamoi https://dynamoi.com/mcp
|
|
57
|
+
```
|
|
64
58
|
|
|
65
|
-
|
|
66
|
-
helps agents answer the practical questions:
|
|
59
|
+
Then run `/mcp` in Claude Code to sign in.
|
|
67
60
|
|
|
68
|
-
|
|
69
|
-
| --- | --- |
|
|
70
|
-
| "Is this artist ready?" | Account access, artist records, platform status, and missing setup. |
|
|
71
|
-
| "Can this campaign launch?" | Readiness, billing state, supported countries, media assets, and deployment status. |
|
|
72
|
-
| "What needs attention?" | Active campaigns, Smart Links, analytics, and next actions. |
|
|
73
|
-
| "Are we connected?" | YouTube and Meta connection state, plus connection-start flows where available. |
|
|
61
|
+
### Claude (web and desktop)
|
|
74
62
|
|
|
75
|
-
|
|
63
|
+
Open **Settings → Connectors**, choose **Add custom connector**, and enter
|
|
64
|
+
`https://dynamoi.com/mcp`. Claude opens the Dynamoi sign-in page when you
|
|
65
|
+
connect.
|
|
76
66
|
|
|
77
|
-
|
|
78
|
-
connected, at least 1,000 Spotify followers, at least 10,000 verified
|
|
79
|
-
Soundcharts monthly listeners, connected Facebook Page plus Instagram
|
|
80
|
-
professional identity, and connected YouTube identity. Eligible users can
|
|
81
|
-
submit an application for manual review from an agent.
|
|
67
|
+
### ChatGPT
|
|
82
68
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
steps.
|
|
69
|
+
In developer mode, add a custom app with the MCP server URL
|
|
70
|
+
`https://dynamoi.com/mcp` and OAuth authentication. ChatGPT gets the
|
|
71
|
+
[directory catalog](#which-tools-a-client-sees).
|
|
87
72
|
|
|
88
|
-
|
|
73
|
+
### Cursor
|
|
89
74
|
|
|
90
|
-
|
|
91
|
-
hosted endpoint from any MCP-capable client that supports remote Streamable HTTP:
|
|
75
|
+
Add Dynamoi to `~/.cursor/mcp.json` (or `.cursor/mcp.json` in a project):
|
|
92
76
|
|
|
93
77
|
```json
|
|
94
78
|
{
|
|
@@ -100,91 +84,216 @@ hosted endpoint from any MCP-capable client that supports remote Streamable HTTP
|
|
|
100
84
|
}
|
|
101
85
|
```
|
|
102
86
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
87
|
+
### VS Code
|
|
88
|
+
|
|
89
|
+
Add Dynamoi to `.vscode/mcp.json`:
|
|
90
|
+
|
|
91
|
+
```json
|
|
92
|
+
{
|
|
93
|
+
"servers": {
|
|
94
|
+
"dynamoi": {
|
|
95
|
+
"type": "http",
|
|
96
|
+
"url": "https://dynamoi.com/mcp"
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
```
|
|
106
101
|
|
|
107
|
-
|
|
102
|
+
### Other MCP clients
|
|
103
|
+
|
|
104
|
+
Use `https://dynamoi.com/mcp` as a remote Streamable HTTP server. The client
|
|
105
|
+
must handle an OAuth 401 challenge (MCP authorization). Stdio-only clients
|
|
106
|
+
need a remote-to-stdio bridge.
|
|
107
|
+
|
|
108
|
+
## Which tools a client sees
|
|
109
|
+
|
|
110
|
+
The server has two tool catalogs. It picks one from the OAuth client that
|
|
111
|
+
signed in, not from anything the client claims about itself.
|
|
112
|
+
|
|
113
|
+
| Catalog | Who gets it | What it includes |
|
|
114
|
+
| --- | --- | --- |
|
|
115
|
+
| **Directory** | Every client on `https://dynamoi.com/mcp/directory` (used by agent-directory listings such as the Dynamoi Claude plugin), the published ChatGPT app on `/mcp`, and requests made before sign-in | 18 review-safe tools: reads, Smart Links, distribution and About. No billing, campaign launch or campaign changes, platform connection starters or Shop checkout. |
|
|
116
|
+
| **Full** | Every other signed-in client on `https://dynamoi.com/mcp`, such as Claude custom connectors, Claude Code, Cursor, VS Code and custom agents | All 28 tools, plus the Dynamoi prompts and reference resources |
|
|
117
|
+
|
|
118
|
+
Signing in does not skip permission checks. Every tool call still needs its
|
|
119
|
+
OAuth scopes, and the user's role must allow access to the artist, campaign
|
|
120
|
+
or Smart Link.
|
|
121
|
+
|
|
122
|
+
## Tools
|
|
123
|
+
|
|
124
|
+
"Reads" tools are marked read-only. "Changes data" tools write to Dynamoi or
|
|
125
|
+
start an action with an outside provider.
|
|
126
|
+
|
|
127
|
+
| Tool | What it does | Access | Catalog |
|
|
128
|
+
| --- | --- | --- | --- |
|
|
129
|
+
| `dynamoi_about` | What Dynamoi is and how to start. Works before sign-in. | Reads | Both |
|
|
130
|
+
| `dynamoi_get_account_overview` | Signed-in account, access counts and suggested next steps | Reads | Both |
|
|
131
|
+
| `dynamoi_list_artists` | Artist roster, or one artist's profile and readiness | Reads | Both |
|
|
132
|
+
| `dynamoi_search` | Find artists, campaigns and Smart Links by name | Reads | Both |
|
|
133
|
+
| `search` / `fetch` | ChatGPT deep research search and fetch | Reads | Both |
|
|
134
|
+
| `dynamoi_list_campaigns` | An artist's campaigns, with type and status filters | Reads | Both |
|
|
135
|
+
| `dynamoi_get_campaign` | One campaign, with optional analytics, delivery status and countries | Reads | Both |
|
|
136
|
+
| `dynamoi_get_artist_analytics` | Artist-level analytics across campaigns | Reads | Both |
|
|
137
|
+
| `dynamoi_get_platform_status` | Spotify, Meta and YouTube connection status and setup blockers | Reads | Both |
|
|
138
|
+
| `dynamoi_get_distribution_application` | The five distribution requirements and application status | Reads | Both |
|
|
139
|
+
| `dynamoi_apply_for_distribution` | Submit a distribution application for manual review | Changes data | Both |
|
|
140
|
+
| `dynamoi_preview_smart_link_themes` | Visual preview of the Smart Link themes | Reads | Both |
|
|
141
|
+
| `dynamoi_create_smart_link_from_spotify` | Create a free Smart Link from a Spotify album or track | Changes data | Both |
|
|
142
|
+
| `dynamoi_create_smart_links_from_spotify_artist` | Import an artist's catalog as free Smart Links and return the artist hub | Changes data | Both |
|
|
143
|
+
| `dynamoi_list_smart_links` | An artist's Smart Links and public URLs | Reads | Both |
|
|
144
|
+
| `dynamoi_get_smart_link` | One Smart Link, with optional analytics and artist settings | Reads | Both |
|
|
145
|
+
| `dynamoi_update_smart_link` | Update a link description or the artist's theme and pixel settings | Changes data | Both |
|
|
146
|
+
| `dynamoi_get_billing` | Billing status, credit balance and promo limits | Reads | Full |
|
|
147
|
+
| `dynamoi_list_available_countries` | Countries a Smart Campaign or YouTube campaign can target | Reads | Full |
|
|
148
|
+
| `dynamoi_get_campaign_readiness` | Check launch inputs before creating anything | Reads | Full |
|
|
149
|
+
| `dynamoi_list_media_assets` | Uploaded images and videos that a launch can reuse | Reads | Full |
|
|
150
|
+
| `dynamoi_launch_campaign` | Launch a Smart Campaign or YouTube campaign | Changes data | Full |
|
|
151
|
+
| `dynamoi_update_campaign` | Pause, resume, or change a campaign's budget or end date | Changes data | Full |
|
|
152
|
+
| `dynamoi_start_meta_connection` | Start the Facebook Page and Instagram connection in the browser | Changes data | Full |
|
|
153
|
+
| `dynamoi_start_youtube_channel_link` | Start the YouTube channel connection in the browser | Changes data | Full |
|
|
154
|
+
| `dynamoi_shop_get_quote` | Estimate a one-off YouTube promotion | Reads | Full |
|
|
155
|
+
| `dynamoi_shop_create_checkout` | Create an unpaid Stripe Checkout link for that promotion | Changes data | Full |
|
|
156
|
+
|
|
157
|
+
Full tool descriptions and input schemas come from `tools/list`, or from
|
|
158
|
+
`getDynamoiToolDefinitions()` in this package.
|
|
159
|
+
|
|
160
|
+
## Money and safety
|
|
161
|
+
|
|
162
|
+
- **Smart Links are free.** Creating or updating them never charges anyone.
|
|
163
|
+
- **Launches and budget changes are real.** `dynamoi_launch_campaign` and
|
|
164
|
+
`dynamoi_update_campaign` go through the same backend checks as the Dynamoi
|
|
165
|
+
web and mobile apps: permissions, promo limits and repeat-request
|
|
166
|
+
protection. Whether a person approves each call is up to the MCP client's
|
|
167
|
+
tool-approval settings, so keep approval on for tools that change data.
|
|
168
|
+
- **Daily budgets need the user's funding consent.** A `DAILY` budget is
|
|
169
|
+
funded one 24-hour window at a time. Available credits and campaign funds
|
|
170
|
+
are used first, then the card the user saved in Dynamoi is charged
|
|
171
|
+
automatically. The agent must show the user the exact consent text, then send
|
|
172
|
+
`authorizeAutomaticDailyFunding: true` with the matching
|
|
173
|
+
`acceptedConsentVersion` and `acceptedConsentCopyHash`. This applies to
|
|
174
|
+
launches, budget updates, and resumes that need card funding. Without
|
|
175
|
+
consent the request is refused. The consent values are exported from
|
|
176
|
+
`@dynamoi/mcp/consent`.
|
|
177
|
+
- **Total budgets use existing credit** and need no funding consent.
|
|
178
|
+
- **Agents never handle payment credentials.** Subscriptions, plans and
|
|
179
|
+
billing setup happen only in the [Dynamoi dashboard](https://dynamoi.com/dashboard),
|
|
180
|
+
where subscriptions start through hosted Stripe Checkout. No tool starts a
|
|
181
|
+
subscription.
|
|
182
|
+
- **Shop checkout is only a link.** `dynamoi_shop_create_checkout` creates an
|
|
183
|
+
unpaid Stripe Checkout Session. The user pays on Stripe, and no order exists
|
|
184
|
+
until the payment is verified.
|
|
185
|
+
- **Distribution applications start a manual review.** Submitting one does not
|
|
186
|
+
approve distribution, accept an agreement or deliver music to stores.
|
|
187
|
+
- **The directory catalog** exposes no tools that spend money, start a
|
|
188
|
+
subscription or create a checkout.
|
|
189
|
+
|
|
190
|
+
## Authentication
|
|
191
|
+
|
|
192
|
+
Dynamoi uses OAuth 2.1 through its authorization server at
|
|
193
|
+
`https://dynamoi.com/api/auth`. Clients find it through the server's metadata:
|
|
194
|
+
|
|
195
|
+
- Protected resource: `https://dynamoi.com/.well-known/oauth-protected-resource/mcp`
|
|
196
|
+
- Authorization server: `https://dynamoi.com/.well-known/oauth-authorization-server`
|
|
197
|
+
|
|
198
|
+
| Topic | Support |
|
|
199
|
+
| --- | --- |
|
|
200
|
+
| Client registration | Client ID Metadata Documents (preferred) and dynamic client registration |
|
|
201
|
+
| Grants | Authorization code with PKCE (`S256`), refresh token, and the device authorization grant for CLI and headless agents (`https://dynamoi.com/api/auth/device/code`) |
|
|
202
|
+
| Tokens | Bearer tokens in the `Authorization` header. DPoP signing algorithms are advertised. |
|
|
108
203
|
|
|
109
|
-
|
|
110
|
-
the
|
|
204
|
+
Without a token, a request gets a `401` with a `WWW-Authenticate` challenge.
|
|
205
|
+
That challenge asks for every scope the client's catalog uses, so one consent
|
|
206
|
+
covers the whole catalog. A full-catalog client that signed in with fewer
|
|
207
|
+
scopes is asked once for the rest.
|
|
111
208
|
|
|
112
|
-
|
|
113
|
-
|
|
209
|
+
| Scope | Allows |
|
|
210
|
+
| --- | --- |
|
|
211
|
+
| `dynamoi:read` | Reading the account, artists, campaigns, analytics and Smart Links. Every signed-in tool needs it. |
|
|
212
|
+
| `dynamoi:platform.read` | Checking Spotify, Meta and YouTube connection status |
|
|
213
|
+
| `dynamoi:platform.write` | Starting Meta and YouTube connection flows |
|
|
214
|
+
| `dynamoi:smart_links.write` | Creating and updating free Smart Links |
|
|
215
|
+
| `dynamoi:distribution.read` | Checking distribution requirements and application status |
|
|
216
|
+
| `dynamoi:distribution.apply` | Submitting a distribution application |
|
|
217
|
+
| `dynamoi:billing.read` | Reading billing status, credit balance and promo limits |
|
|
218
|
+
| `dynamoi:campaign.launch` | Launching new campaigns |
|
|
219
|
+
| `dynamoi:campaign.write` | Pausing, resuming and changing campaign budgets |
|
|
220
|
+
| `dynamoi:mcp.full` | Using the Shop quote and checkout tools |
|
|
221
|
+
|
|
222
|
+
## Protocol support
|
|
223
|
+
|
|
224
|
+
- MCP **2026-07-28**: stateless requests with per-request `_meta`, including
|
|
225
|
+
`server/discover`.
|
|
226
|
+
- MCP **2025-11-25** and earlier `initialize`-based revisions, for clients
|
|
227
|
+
that have not moved to 2026-07-28.
|
|
228
|
+
- Streamable HTTP, POST only. Responses are JSON, or SSE for 2025-era
|
|
229
|
+
clients that accept it. The server keeps no sessions and opens no
|
|
230
|
+
standalone stream, so `GET` and `DELETE` return `405`.
|
|
231
|
+
|
|
232
|
+
## Using the package
|
|
233
|
+
|
|
234
|
+
Most people should connect to the hosted server. Install the package if you
|
|
235
|
+
are building against the Dynamoi MCP contract: tool definitions, Zod schemas,
|
|
236
|
+
result types, OAuth scope maps or the stateless HTTP handler.
|
|
114
237
|
|
|
115
238
|
```bash
|
|
116
239
|
npm install @dynamoi/mcp
|
|
117
240
|
```
|
|
118
241
|
|
|
242
|
+
The package is ESM-only and built on MCP TypeScript SDK v2
|
|
243
|
+
(`@modelcontextprotocol/server`).
|
|
244
|
+
|
|
245
|
+
| Entry point | Main exports |
|
|
246
|
+
| --- | --- |
|
|
247
|
+
| `@dynamoi/mcp` | `createDynamoiMcpServer`, `handleMcpHttpRequest`, `getDynamoiToolDefinitions`, `DynamoiMcpToolProfile`, `Phase3Adapter`, tool definition arrays and input schemas, Shop schemas, About exports (`getDynamoiAbout`, `DYNAMOI_ABOUT_*`), result and data types, `DYNAMOI_MCP_VERSION` |
|
|
248
|
+
| `@dynamoi/mcp/auth` | `DYNAMOI_BETTER_AUTH_MCP_SCOPES`, `DYNAMOI_MCP_TOOL_SCOPES`, `buildWwwAuthenticateHeader` |
|
|
249
|
+
| `@dynamoi/mcp/consent` | `PROSPECTIVE_BUDGET_FUNDING_CONSENT_VERSION`, `PROSPECTIVE_BUDGET_FUNDING_CONSENT_COPY`, `PROSPECTIVE_BUDGET_FUNDING_CONSENT_COPY_HASH` |
|
|
250
|
+
|
|
251
|
+
A host provides a `Phase3Adapter`, which connects each tool to its own
|
|
252
|
+
services. It also verifies the caller before it serves a request:
|
|
253
|
+
|
|
119
254
|
```ts
|
|
120
255
|
import {
|
|
121
|
-
buildProtectedResourceMetadata,
|
|
122
256
|
createDynamoiMcpServer,
|
|
123
257
|
handleMcpHttpRequest,
|
|
258
|
+
type DynamoiMcpToolProfile,
|
|
259
|
+
type Phase3Adapter,
|
|
124
260
|
} from "@dynamoi/mcp";
|
|
125
|
-
```
|
|
126
261
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
262
|
+
export async function handleMcp(
|
|
263
|
+
request: Request,
|
|
264
|
+
adapter: Phase3Adapter,
|
|
265
|
+
toolProfile: DynamoiMcpToolProfile,
|
|
266
|
+
): Promise<Response> {
|
|
267
|
+
// Authenticate the request and check scopes first; this package does not
|
|
268
|
+
// verify tokens. The profile defaults to "directory" if you omit it.
|
|
269
|
+
const parsedBody = request.method === "POST" ? await request.json() : null;
|
|
270
|
+
return handleMcpHttpRequest({
|
|
271
|
+
request,
|
|
272
|
+
parsedBody,
|
|
273
|
+
createServer: () => createDynamoiMcpServer({ adapter, toolProfile }),
|
|
274
|
+
});
|
|
275
|
+
}
|
|
135
276
|
```
|
|
136
277
|
|
|
137
|
-
`
|
|
138
|
-
|
|
139
|
-
|
|
278
|
+
`createDynamoiMcpServer` also accepts `authorizeToolCall` (answer a call
|
|
279
|
+
before it runs, for example with a step-up challenge), `onToolCall` (a
|
|
280
|
+
telemetry hook) and `oauthScopes`.
|
|
140
281
|
|
|
141
|
-
|
|
282
|
+
Every request builds a new server. `handleMcpHttpRequest` sends 2026-07-28
|
|
283
|
+
requests to the SDK's stateless handler and 2025-era requests to a stateless
|
|
284
|
+
per-request transport.
|
|
142
285
|
|
|
143
|
-
|
|
144
|
-
| --- | --- |
|
|
145
|
-
| Tool schemas | The public MCP contract exposed by Dynamoi. |
|
|
146
|
-
| Prompts and resources | Guidance for Dynamoi-specific agent workflows. |
|
|
147
|
-
| Protected-resource metadata | OAuth discovery metadata for compatible clients. |
|
|
148
|
-
| HTTP transport helpers | Stateless Streamable HTTP handling for serverless hosts. |
|
|
149
|
-
| TypeScript types | Integration-safe contracts for hosted server code. |
|
|
150
|
-
|
|
151
|
-
## 🛡️ Safety Model
|
|
152
|
-
|
|
153
|
-
Dynamoi MCP is built for real artist and label workflows, so the server keeps
|
|
154
|
-
clear boundaries around what an agent can do.
|
|
155
|
-
|
|
156
|
-
| Safety layer | What it protects |
|
|
157
|
-
| --- | --- |
|
|
158
|
-
| 🔐 OAuth scopes | Agents only get the account access the user grants. |
|
|
159
|
-
| 👀 Read-only hints | Read tools are marked as read-only. |
|
|
160
|
-
| ✍️ Mutation descriptions | Write tools describe the external action they may take. |
|
|
161
|
-
| ✅ User intent gates | Launch and campaign-update workflows require clear user intent. |
|
|
162
|
-
| 💳 Paid-flow separation | Direct paid checkout is not exposed to connected agents. |
|
|
163
|
-
| 🔗 Smart Link boundary | Free Smart Link creation stays separate from managed advertising launch. |
|
|
164
|
-
|
|
165
|
-
## 💬 Good First Prompts
|
|
166
|
-
|
|
167
|
-
Try these from any connected MCP agent:
|
|
168
|
-
|
|
169
|
-
> 🎧 Create a Smart Link for this Spotify release.
|
|
170
|
-
|
|
171
|
-
> 🚦 What is blocking this campaign from launching?
|
|
172
|
-
|
|
173
|
-
> 📈 Show me the active campaigns that need attention.
|
|
174
|
-
|
|
175
|
-
> 📺 Help me connect my YouTube channel.
|
|
176
|
-
|
|
177
|
-
> 🚀 Get this release ready to promote.
|
|
178
|
-
|
|
179
|
-
> 💿 Check whether this artist can apply for music distribution.
|
|
180
|
-
|
|
181
|
-
## 🔗 Links
|
|
286
|
+
## Links
|
|
182
287
|
|
|
183
288
|
| Resource | URL |
|
|
184
289
|
| --- | --- |
|
|
185
|
-
|
|
|
186
|
-
|
|
|
187
|
-
|
|
|
188
|
-
|
|
|
290
|
+
| MCP server docs | <https://dynamoi.com/docs/mcp-server> |
|
|
291
|
+
| Agent overview (`llms.txt`) | <https://dynamoi.com/llms.txt> |
|
|
292
|
+
| Support | <https://dynamoi.com/support> or support@dynamoi.com (replies within 24 hours) |
|
|
293
|
+
| Pricing | <https://dynamoi.com/pricing> |
|
|
294
|
+
| npm | <https://www.npmjs.com/package/@dynamoi/mcp> |
|
|
295
|
+
| Source and issues | <https://github.com/getDynamoi/mcp> |
|
|
189
296
|
| Changelog | [CHANGELOG.md](./CHANGELOG.md) |
|
|
190
|
-
| Capability
|
|
297
|
+
| Capability map | [CAPABILITY_PARITY.md](./CAPABILITY_PARITY.md) |
|
|
298
|
+
|
|
299
|
+
MIT licensed. See [LICENSE](./LICENSE).
|
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
authorization_servers: string[];
|
|
3
|
-
bearer_methods_supported: ["header"];
|
|
4
|
-
resource: string;
|
|
5
|
-
resource_documentation?: string;
|
|
6
|
-
scopes_supported: string[];
|
|
7
|
-
};
|
|
8
|
-
export declare const DYNAMOI_BETTER_AUTH_MCP_SCOPES: readonly ["dynamoi:read", "dynamoi:billing.read", "dynamoi:campaign.launch", "dynamoi:campaign.write", "dynamoi:distribution.apply", "dynamoi:distribution.read", "dynamoi:platform.read", "dynamoi:platform.write", "dynamoi:smart_links.write"];
|
|
9
|
-
/** @deprecated Use DYNAMOI_BETTER_AUTH_MCP_SCOPES. */
|
|
10
|
-
export declare const DYNAMOI_MCP_SCOPES: readonly ["dynamoi:read", "dynamoi:billing.read", "dynamoi:campaign.launch", "dynamoi:campaign.write", "dynamoi:distribution.apply", "dynamoi:distribution.read", "dynamoi:platform.read", "dynamoi:platform.write", "dynamoi:smart_links.write"];
|
|
1
|
+
export declare const DYNAMOI_BETTER_AUTH_MCP_SCOPES: readonly ["dynamoi:read", "dynamoi:mcp.full", "dynamoi:billing.read", "dynamoi:campaign.launch", "dynamoi:campaign.write", "dynamoi:distribution.apply", "dynamoi:distribution.read", "dynamoi:platform.read", "dynamoi:platform.write", "dynamoi:smart_links.write"];
|
|
11
2
|
export declare const DYNAMOI_MCP_TOOL_SCOPES: {
|
|
3
|
+
readonly dynamoi_about: readonly [];
|
|
4
|
+
readonly dynamoi_apply_for_distribution: readonly ["dynamoi:read", "dynamoi:distribution.apply"];
|
|
12
5
|
readonly dynamoi_create_smart_link_from_spotify: readonly ["dynamoi:read", "dynamoi:smart_links.write"];
|
|
13
6
|
readonly dynamoi_create_smart_links_from_spotify_artist: readonly ["dynamoi:read", "dynamoi:smart_links.write"];
|
|
14
7
|
readonly dynamoi_get_account_overview: readonly ["dynamoi:read"];
|
|
@@ -20,7 +13,6 @@ export declare const DYNAMOI_MCP_TOOL_SCOPES: {
|
|
|
20
13
|
readonly dynamoi_get_platform_status: readonly ["dynamoi:read", "dynamoi:platform.read"];
|
|
21
14
|
readonly dynamoi_get_smart_link: readonly ["dynamoi:read"];
|
|
22
15
|
readonly dynamoi_launch_campaign: readonly ["dynamoi:read", "dynamoi:campaign.launch"];
|
|
23
|
-
readonly dynamoi_apply_for_distribution: readonly ["dynamoi:read", "dynamoi:distribution.apply"];
|
|
24
16
|
readonly dynamoi_list_artists: readonly ["dynamoi:read"];
|
|
25
17
|
readonly dynamoi_list_available_countries: readonly ["dynamoi:read"];
|
|
26
18
|
readonly dynamoi_list_campaigns: readonly ["dynamoi:read"];
|
|
@@ -28,6 +20,8 @@ export declare const DYNAMOI_MCP_TOOL_SCOPES: {
|
|
|
28
20
|
readonly dynamoi_list_smart_links: readonly ["dynamoi:read"];
|
|
29
21
|
readonly dynamoi_preview_smart_link_themes: readonly ["dynamoi:read"];
|
|
30
22
|
readonly dynamoi_search: readonly ["dynamoi:read"];
|
|
23
|
+
readonly dynamoi_shop_create_checkout: readonly ["dynamoi:read", "dynamoi:mcp.full"];
|
|
24
|
+
readonly dynamoi_shop_get_quote: readonly ["dynamoi:read", "dynamoi:mcp.full"];
|
|
31
25
|
readonly dynamoi_start_meta_connection: readonly ["dynamoi:read", "dynamoi:platform.write"];
|
|
32
26
|
readonly dynamoi_start_youtube_channel_link: readonly ["dynamoi:read", "dynamoi:platform.write"];
|
|
33
27
|
readonly dynamoi_update_campaign: readonly ["dynamoi:read", "dynamoi:campaign.write"];
|
|
@@ -35,17 +29,10 @@ export declare const DYNAMOI_MCP_TOOL_SCOPES: {
|
|
|
35
29
|
readonly fetch: readonly ["dynamoi:read"];
|
|
36
30
|
readonly search: readonly ["dynamoi:read"];
|
|
37
31
|
};
|
|
38
|
-
export declare function buildProtectedResourceMetadata(options: {
|
|
39
|
-
resource: string;
|
|
40
|
-
authorizationServers: string[];
|
|
41
|
-
resourceDocumentation?: string;
|
|
42
|
-
scopesSupported?: string[];
|
|
43
|
-
}): ProtectedResourceMetadata;
|
|
44
32
|
export declare function buildWwwAuthenticateHeader(options: {
|
|
45
33
|
resourceMetadataUrl: string;
|
|
46
34
|
errorDescription?: string;
|
|
47
35
|
error?: "insufficient_scope" | "invalid_token";
|
|
48
36
|
scope?: string;
|
|
49
37
|
}): string;
|
|
50
|
-
export {};
|
|
51
38
|
//# sourceMappingURL=protected-resource.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protected-resource.d.ts","sourceRoot":"","sources":["../../../src/auth/protected-resource.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"protected-resource.d.ts","sourceRoot":"","sources":["../../../src/auth/protected-resource.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,8BAA8B,YAC1C,cAAc,EACd,kBAAkB,EAClB,sBAAsB,EACtB,yBAAyB,EACzB,wBAAwB,EACxB,4BAA4B,EAC5B,2BAA2B,EAC3B,uBAAuB,EACvB,wBAAwB,EACxB,2BAA2B,CAClB,CAAC;AACX,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6CkB,CAAC;AAEvD,wBAAgB,0BAA0B,CAAC,OAAO,EAAE;IACnD,mBAAmB,EAAE,MAAM,CAAC;IAC5B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,KAAK,CAAC,EAAE,oBAAoB,GAAG,eAAe,CAAC;IAC/C,KAAK,CAAC,EAAE,MAAM,CAAC;CACf,GAAG,MAAM,CAoBT"}
|
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
buildWwwAuthenticateHeader
|
|
7
|
-
} from "../chunk-2jm8hjsz.js";
|
|
2
|
+
DYNAMOI_BETTER_AUTH_MCP_SCOPES2,
|
|
3
|
+
DYNAMOI_MCP_TOOL_SCOPES2,
|
|
4
|
+
buildWwwAuthenticateHeader2
|
|
5
|
+
} from "../chunk-3htwe57a.js";
|
|
8
6
|
export {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
DYNAMOI_MCP_SCOPES,
|
|
13
|
-
DYNAMOI_BETTER_AUTH_MCP_SCOPES
|
|
7
|
+
DYNAMOI_BETTER_AUTH_MCP_SCOPES2 as DYNAMOI_BETTER_AUTH_MCP_SCOPES,
|
|
8
|
+
DYNAMOI_MCP_TOOL_SCOPES2 as DYNAMOI_MCP_TOOL_SCOPES,
|
|
9
|
+
buildWwwAuthenticateHeader2 as buildWwwAuthenticateHeader
|
|
14
10
|
};
|
|
15
11
|
|
|
16
|
-
//# debugId=
|
|
12
|
+
//# debugId=3CEA7E243AFD6EFD64756E2164756E21
|
|
17
13
|
//# sourceMappingURL=protected-resource.js.map
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// src/auth/protected-resource.ts
|
|
2
|
-
var
|
|
2
|
+
var DYNAMOI_BETTER_AUTH_MCP_SCOPES2 = [
|
|
3
3
|
"dynamoi:read",
|
|
4
|
+
"dynamoi:mcp.full",
|
|
4
5
|
"dynamoi:billing.read",
|
|
5
6
|
"dynamoi:campaign.launch",
|
|
6
7
|
"dynamoi:campaign.write",
|
|
@@ -10,8 +11,12 @@ var DYNAMOI_BETTER_AUTH_MCP_SCOPES = [
|
|
|
10
11
|
"dynamoi:platform.write",
|
|
11
12
|
"dynamoi:smart_links.write"
|
|
12
13
|
];
|
|
13
|
-
var
|
|
14
|
-
|
|
14
|
+
var DYNAMOI_MCP_TOOL_SCOPES2 = {
|
|
15
|
+
dynamoi_about: [],
|
|
16
|
+
dynamoi_apply_for_distribution: [
|
|
17
|
+
"dynamoi:read",
|
|
18
|
+
"dynamoi:distribution.apply"
|
|
19
|
+
],
|
|
15
20
|
dynamoi_create_smart_link_from_spotify: [
|
|
16
21
|
"dynamoi:read",
|
|
17
22
|
"dynamoi:smart_links.write"
|
|
@@ -32,10 +37,6 @@ var DYNAMOI_MCP_TOOL_SCOPES = {
|
|
|
32
37
|
dynamoi_get_platform_status: ["dynamoi:read", "dynamoi:platform.read"],
|
|
33
38
|
dynamoi_get_smart_link: ["dynamoi:read"],
|
|
34
39
|
dynamoi_launch_campaign: ["dynamoi:read", "dynamoi:campaign.launch"],
|
|
35
|
-
dynamoi_apply_for_distribution: [
|
|
36
|
-
"dynamoi:read",
|
|
37
|
-
"dynamoi:distribution.apply"
|
|
38
|
-
],
|
|
39
40
|
dynamoi_list_artists: ["dynamoi:read"],
|
|
40
41
|
dynamoi_list_available_countries: ["dynamoi:read"],
|
|
41
42
|
dynamoi_list_campaigns: ["dynamoi:read"],
|
|
@@ -43,6 +44,8 @@ var DYNAMOI_MCP_TOOL_SCOPES = {
|
|
|
43
44
|
dynamoi_list_smart_links: ["dynamoi:read"],
|
|
44
45
|
dynamoi_preview_smart_link_themes: ["dynamoi:read"],
|
|
45
46
|
dynamoi_search: ["dynamoi:read"],
|
|
47
|
+
dynamoi_shop_create_checkout: ["dynamoi:read", "dynamoi:mcp.full"],
|
|
48
|
+
dynamoi_shop_get_quote: ["dynamoi:read", "dynamoi:mcp.full"],
|
|
46
49
|
dynamoi_start_meta_connection: ["dynamoi:read", "dynamoi:platform.write"],
|
|
47
50
|
dynamoi_start_youtube_channel_link: [
|
|
48
51
|
"dynamoi:read",
|
|
@@ -53,30 +56,16 @@ var DYNAMOI_MCP_TOOL_SCOPES = {
|
|
|
53
56
|
fetch: ["dynamoi:read"],
|
|
54
57
|
search: ["dynamoi:read"]
|
|
55
58
|
};
|
|
56
|
-
function
|
|
57
|
-
const metadata = {
|
|
58
|
-
authorization_servers: options.authorizationServers,
|
|
59
|
-
bearer_methods_supported: ["header"],
|
|
60
|
-
resource: options.resource,
|
|
61
|
-
scopes_supported: options.scopesSupported ?? [
|
|
62
|
-
...DYNAMOI_BETTER_AUTH_MCP_SCOPES
|
|
63
|
-
]
|
|
64
|
-
};
|
|
65
|
-
if (options.resourceDocumentation) {
|
|
66
|
-
metadata.resource_documentation = options.resourceDocumentation;
|
|
67
|
-
}
|
|
68
|
-
return metadata;
|
|
69
|
-
}
|
|
70
|
-
function buildWwwAuthenticateHeader(options) {
|
|
59
|
+
function buildWwwAuthenticateHeader2(options) {
|
|
71
60
|
const scope = options.scope ?? "dynamoi:read";
|
|
72
|
-
const error = options.error ?? "invalid_token";
|
|
73
|
-
const errorDescription = options.errorDescription ?? (error === "insufficient_scope" ? "Additional Dynamoi permissions are required." : "Sign in to Dynamoi to continue.");
|
|
74
61
|
const params = [
|
|
75
62
|
`resource_metadata="${escapeHeaderValue(options.resourceMetadataUrl)}"`,
|
|
76
|
-
`scope="${escapeHeaderValue(scope)}"
|
|
77
|
-
`error="${escapeHeaderValue(error)}"`,
|
|
78
|
-
`error_description="${escapeHeaderValue(errorDescription)}"`
|
|
63
|
+
`scope="${escapeHeaderValue(scope)}"`
|
|
79
64
|
];
|
|
65
|
+
if (options.error) {
|
|
66
|
+
const errorDescription = options.errorDescription ?? (options.error === "insufficient_scope" ? "Additional Dynamoi permissions are required." : "Sign in to Dynamoi to continue.");
|
|
67
|
+
params.push(`error="${escapeHeaderValue(options.error)}"`, `error_description="${escapeHeaderValue(errorDescription)}"`);
|
|
68
|
+
}
|
|
80
69
|
return `Bearer ${params.join(", ")}`;
|
|
81
70
|
}
|
|
82
71
|
function escapeHeaderValue(value) {
|
|
@@ -90,7 +79,7 @@ function escapeHeaderValue(value) {
|
|
|
90
79
|
return value.replaceAll("\\", "\\\\").replaceAll('"', "\\\"");
|
|
91
80
|
}
|
|
92
81
|
|
|
93
|
-
export {
|
|
82
|
+
export { DYNAMOI_BETTER_AUTH_MCP_SCOPES2, DYNAMOI_MCP_TOOL_SCOPES2, buildWwwAuthenticateHeader2 };
|
|
94
83
|
|
|
95
|
-
//# debugId=
|
|
96
|
-
//# sourceMappingURL=chunk-
|
|
84
|
+
//# debugId=0AEF4A9C57DA8F3964756E2164756E21
|
|
85
|
+
//# sourceMappingURL=chunk-3htwe57a.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/auth/protected-resource.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"export const DYNAMOI_BETTER_AUTH_MCP_SCOPES = [\n\t\"dynamoi:read\",\n\t\"dynamoi:mcp.full\",\n\t\"dynamoi:billing.read\",\n\t\"dynamoi:campaign.launch\",\n\t\"dynamoi:campaign.write\",\n\t\"dynamoi:distribution.apply\",\n\t\"dynamoi:distribution.read\",\n\t\"dynamoi:platform.read\",\n\t\"dynamoi:platform.write\",\n\t\"dynamoi:smart_links.write\",\n] as const;\nexport const DYNAMOI_MCP_TOOL_SCOPES = {\n\t// Public product information; callable before sign-in.\n\tdynamoi_about: [],\n\tdynamoi_apply_for_distribution: [\n\t\t\"dynamoi:read\",\n\t\t\"dynamoi:distribution.apply\",\n\t],\n\tdynamoi_create_smart_link_from_spotify: [\n\t\t\"dynamoi:read\",\n\t\t\"dynamoi:smart_links.write\",\n\t],\n\tdynamoi_create_smart_links_from_spotify_artist: [\n\t\t\"dynamoi:read\",\n\t\t\"dynamoi:smart_links.write\",\n\t],\n\tdynamoi_get_account_overview: [\"dynamoi:read\"],\n\tdynamoi_get_artist_analytics: [\"dynamoi:read\"],\n\tdynamoi_get_billing: [\"dynamoi:read\", \"dynamoi:billing.read\"],\n\tdynamoi_get_campaign: [\"dynamoi:read\"],\n\tdynamoi_get_campaign_readiness: [\"dynamoi:read\"],\n\tdynamoi_get_distribution_application: [\n\t\t\"dynamoi:read\",\n\t\t\"dynamoi:distribution.read\",\n\t],\n\tdynamoi_get_platform_status: [\"dynamoi:read\", \"dynamoi:platform.read\"],\n\tdynamoi_get_smart_link: [\"dynamoi:read\"],\n\tdynamoi_launch_campaign: [\"dynamoi:read\", \"dynamoi:campaign.launch\"],\n\tdynamoi_list_artists: [\"dynamoi:read\"],\n\tdynamoi_list_available_countries: [\"dynamoi:read\"],\n\tdynamoi_list_campaigns: [\"dynamoi:read\"],\n\tdynamoi_list_media_assets: [\"dynamoi:read\"],\n\tdynamoi_list_smart_links: [\"dynamoi:read\"],\n\tdynamoi_preview_smart_link_themes: [\"dynamoi:read\"],\n\tdynamoi_search: [\"dynamoi:read\"],\n\tdynamoi_shop_create_checkout: [\"dynamoi:read\", \"dynamoi:mcp.full\"],\n\tdynamoi_shop_get_quote: [\"dynamoi:read\", \"dynamoi:mcp.full\"],\n\tdynamoi_start_meta_connection: [\"dynamoi:read\", \"dynamoi:platform.write\"],\n\tdynamoi_start_youtube_channel_link: [\n\t\t\"dynamoi:read\",\n\t\t\"dynamoi:platform.write\",\n\t],\n\tdynamoi_update_campaign: [\"dynamoi:read\", \"dynamoi:campaign.write\"],\n\tdynamoi_update_smart_link: [\"dynamoi:read\", \"dynamoi:smart_links.write\"],\n\tfetch: [\"dynamoi:read\"],\n\tsearch: [\"dynamoi:read\"],\n} as const satisfies Record<string, readonly string[]>;\n\nexport function buildWwwAuthenticateHeader(options: {\n\tresourceMetadataUrl: string;\n\terrorDescription?: string;\n\terror?: \"insufficient_scope\" | \"invalid_token\";\n\tscope?: string;\n}): string {\n\tconst scope = options.scope ?? \"dynamoi:read\";\n\tconst params = [\n\t\t`resource_metadata=\"${escapeHeaderValue(options.resourceMetadataUrl)}\"`,\n\t\t`scope=\"${escapeHeaderValue(scope)}\"`,\n\t];\n\t// RFC 6750 section 3.1: an initial challenge is not a rejected token.\n\t// Callers must explicitly identify invalid tokens or insufficient scopes.\n\tif (options.error) {\n\t\tconst errorDescription =\n\t\t\toptions.errorDescription ??\n\t\t\t(options.error === \"insufficient_scope\"\n\t\t\t\t? \"Additional Dynamoi permissions are required.\"\n\t\t\t\t: \"Sign in to Dynamoi to continue.\");\n\t\tparams.push(\n\t\t\t`error=\"${escapeHeaderValue(options.error)}\"`,\n\t\t\t`error_description=\"${escapeHeaderValue(errorDescription)}\"`,\n\t\t);\n\t}\n\treturn `Bearer ${params.join(\", \")}`;\n}\n\nfunction escapeHeaderValue(value: string): string {\n\tconst containsControlCharacter = Array.from(value).some((character) => {\n\t\tconst codePoint = character.codePointAt(0) ?? 0;\n\t\treturn codePoint <= 31 || codePoint === 127;\n\t});\n\tif (containsControlCharacter) {\n\t\tthrow new Error(\n\t\t\t\"WWW-Authenticate values cannot contain control characters.\",\n\t\t);\n\t}\n\treturn value.replaceAll(\"\\\\\", \"\\\\\\\\\").replaceAll('\"', '\\\\\"');\n}\n"
|
|
6
|
+
],
|
|
7
|
+
"mappings": ";AAAO,IAAM,kCAAiC;AAAA,EAC7C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;AACO,IAAM,2BAA0B;AAAA,EAEtC,eAAe,CAAC;AAAA,EAChB,gCAAgC;AAAA,IAC/B;AAAA,IACA;AAAA,EACD;AAAA,EACA,wCAAwC;AAAA,IACvC;AAAA,IACA;AAAA,EACD;AAAA,EACA,gDAAgD;AAAA,IAC/C;AAAA,IACA;AAAA,EACD;AAAA,EACA,8BAA8B,CAAC,cAAc;AAAA,EAC7C,8BAA8B,CAAC,cAAc;AAAA,EAC7C,qBAAqB,CAAC,gBAAgB,sBAAsB;AAAA,EAC5D,sBAAsB,CAAC,cAAc;AAAA,EACrC,gCAAgC,CAAC,cAAc;AAAA,EAC/C,sCAAsC;AAAA,IACrC;AAAA,IACA;AAAA,EACD;AAAA,EACA,6BAA6B,CAAC,gBAAgB,uBAAuB;AAAA,EACrE,wBAAwB,CAAC,cAAc;AAAA,EACvC,yBAAyB,CAAC,gBAAgB,yBAAyB;AAAA,EACnE,sBAAsB,CAAC,cAAc;AAAA,EACrC,kCAAkC,CAAC,cAAc;AAAA,EACjD,wBAAwB,CAAC,cAAc;AAAA,EACvC,2BAA2B,CAAC,cAAc;AAAA,EAC1C,0BAA0B,CAAC,cAAc;AAAA,EACzC,mCAAmC,CAAC,cAAc;AAAA,EAClD,gBAAgB,CAAC,cAAc;AAAA,EAC/B,8BAA8B,CAAC,gBAAgB,kBAAkB;AAAA,EACjE,wBAAwB,CAAC,gBAAgB,kBAAkB;AAAA,EAC3D,+BAA+B,CAAC,gBAAgB,wBAAwB;AAAA,EACxE,oCAAoC;AAAA,IACnC;AAAA,IACA;AAAA,EACD;AAAA,EACA,yBAAyB,CAAC,gBAAgB,wBAAwB;AAAA,EAClE,2BAA2B,CAAC,gBAAgB,2BAA2B;AAAA,EACvE,OAAO,CAAC,cAAc;AAAA,EACtB,QAAQ,CAAC,cAAc;AACxB;AAEO,SAAS,2BAA0B,CAAC,SAKhC;AAAA,EACV,MAAM,QAAQ,QAAQ,SAAS;AAAA,EAC/B,MAAM,SAAS;AAAA,IACd,sBAAsB,kBAAkB,QAAQ,mBAAmB;AAAA,IACnE,UAAU,kBAAkB,KAAK;AAAA,EAClC;AAAA,EAGA,IAAI,QAAQ,OAAO;AAAA,IAClB,MAAM,mBACL,QAAQ,qBACP,QAAQ,UAAU,uBAChB,iDACA;AAAA,IACJ,OAAO,KACN,UAAU,kBAAkB,QAAQ,KAAK,MACzC,sBAAsB,kBAAkB,gBAAgB,IACzD;AAAA,EACD;AAAA,EACA,OAAO,UAAU,OAAO,KAAK,IAAI;AAAA;AAGlC,SAAS,iBAAiB,CAAC,OAAuB;AAAA,EACjD,MAAM,2BAA2B,MAAM,KAAK,KAAK,EAAE,KAAK,CAAC,cAAc;AAAA,IACtE,MAAM,YAAY,UAAU,YAAY,CAAC,KAAK;AAAA,IAC9C,OAAO,aAAa,MAAM,cAAc;AAAA,GACxC;AAAA,EACD,IAAI,0BAA0B;AAAA,IAC7B,MAAM,IAAI,MACT,4DACD;AAAA,EACD;AAAA,EACA,OAAO,MAAM,WAAW,MAAM,MAAM,EAAE,WAAW,KAAK,MAAK;AAAA;",
|
|
8
|
+
"debugId": "0AEF4A9C57DA8F3964756E2164756E21",
|
|
9
|
+
"names": []
|
|
10
|
+
}
|