@dynamoi/mcp 0.6.3 → 0.6.5

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.
Files changed (60) hide show
  1. package/CHANGELOG.md +30 -1
  2. package/README.md +119 -71
  3. package/dist/auth/protected-resource.d.ts +32 -5
  4. package/dist/auth/protected-resource.d.ts.map +1 -0
  5. package/dist/auth/protected-resource.js +10 -4
  6. package/dist/auth/protected-resource.js.map +9 -1
  7. package/dist/auth/verify-token.d.ts +21 -0
  8. package/dist/auth/verify-token.d.ts.map +1 -0
  9. package/dist/chunk-4jfaxshz.js +83 -0
  10. package/dist/chunk-4jfaxshz.js.map +10 -0
  11. package/dist/chunk-kb3xpcrb.js +9 -0
  12. package/dist/chunk-kb3xpcrb.js.map +10 -0
  13. package/dist/consent.d.ts +4 -0
  14. package/dist/consent.d.ts.map +1 -0
  15. package/dist/consent.js +13 -0
  16. package/dist/consent.js.map +9 -0
  17. package/dist/flow-types.d.ts +150 -0
  18. package/dist/flow-types.d.ts.map +1 -0
  19. package/dist/index.d.ts +13 -2464
  20. package/dist/index.d.ts.map +1 -0
  21. package/dist/index.js +1364 -1242
  22. package/dist/index.js.map +25 -1
  23. package/dist/readiness-types.d.ts +88 -0
  24. package/dist/readiness-types.d.ts.map +1 -0
  25. package/dist/server/create-server.d.ts +81 -0
  26. package/dist/server/create-server.d.ts.map +1 -0
  27. package/dist/server/instructions.d.ts +3 -0
  28. package/dist/server/instructions.d.ts.map +1 -0
  29. package/dist/server/onboarding-tool-definitions.d.ts +56 -0
  30. package/dist/server/onboarding-tool-definitions.d.ts.map +1 -0
  31. package/dist/server/openai-tools.d.ts +88 -0
  32. package/dist/server/openai-tools.d.ts.map +1 -0
  33. package/dist/server/output-schemas.d.ts +122 -0
  34. package/dist/server/output-schemas.d.ts.map +1 -0
  35. package/dist/server/playbook-resources.d.ts +3 -0
  36. package/dist/server/playbook-resources.d.ts.map +1 -0
  37. package/dist/server/prompts.d.ts +3 -0
  38. package/dist/server/prompts.d.ts.map +1 -0
  39. package/dist/server/resources.d.ts +4 -0
  40. package/dist/server/resources.d.ts.map +1 -0
  41. package/dist/server/shared-schemas.d.ts +14 -0
  42. package/dist/server/shared-schemas.d.ts.map +1 -0
  43. package/dist/server/smart-link-theme-preview.d.ts +48 -0
  44. package/dist/server/smart-link-theme-preview.d.ts.map +1 -0
  45. package/dist/server/smart-link-tools.d.ts +346 -0
  46. package/dist/server/smart-link-tools.d.ts.map +1 -0
  47. package/dist/server/tools.d.ts +870 -0
  48. package/dist/server/tools.d.ts.map +1 -0
  49. package/dist/server/workflow-tools.d.ts +93 -0
  50. package/dist/server/workflow-tools.d.ts.map +1 -0
  51. package/dist/transport/http.d.ts +9 -0
  52. package/dist/transport/http.d.ts.map +1 -0
  53. package/dist/types.d.ts +429 -0
  54. package/dist/types.d.ts.map +1 -0
  55. package/dist/version.d.ts +2 -0
  56. package/dist/version.d.ts.map +1 -0
  57. package/package.json +17 -9
  58. package/server.json +3 -3
  59. package/dist/chunk-CHQUK72A.js +0 -35
  60. package/dist/chunk-CHQUK72A.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -5,7 +5,36 @@ All notable changes to `@dynamoi/mcp` will be documented in this file.
5
5
  This project follows the principles of [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)
6
6
  and [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
- ## [Unreleased]
8
+ ## [0.6.5] - 2026-08-12
9
+
10
+ ### Added
11
+
12
+ - Added `dynamoi_preview_smart_link_themes` with a ChatGPT Apps SDK UI resource
13
+ so reviewers can see the four Smart Link themes without creating or updating
14
+ a Smart Link.
15
+
16
+ ### Changed
17
+
18
+ - Automated official MCP Registry publication after npm releases with GitHub
19
+ OIDC authentication, pinned tooling, propagation retries, and exact metadata
20
+ readback.
21
+ - Pinned public release and validation workflow actions to immutable commits.
22
+
23
+ ### Fixed
24
+
25
+ - Replaced dynamic HTML construction in the Smart Link theme preview with safe
26
+ DOM and text APIs.
27
+ - Rejected control characters in generated OAuth challenge headers and blocked
28
+ redirects during registry metadata verification.
29
+
30
+ ## [0.6.4] - 2026-05-30
31
+
32
+ ### Changed
33
+
34
+ - Rewrote the public README and package description for musicians, labels, and
35
+ MCP-capable AI agent builders, with clearer release-promotion language,
36
+ richer Markdown structure, badges, emoji section cues, example prompts,
37
+ package usage, and safety model.
9
38
 
10
39
  ## [0.6.3] - 2026-05-30
11
40
 
package/README.md CHANGED
@@ -1,35 +1,80 @@
1
- # Dynamoi MCP
1
+ # Dynamoi MCP 🎧
2
2
 
3
- Music promotion tools for AI assistants.
3
+ > Let any MCP-capable AI agent help artists and labels get releases ready to promote.
4
4
 
5
- Dynamoi lets ChatGPT, Claude, Gemini, and other MCP clients work with an artist's
6
- real promotion workspace: Smart Links, artist hubs, campaign readiness, platform
7
- connections, YouTube growth, Meta campaigns, billing status, and launch workflows.
5
+ [![npm version](https://img.shields.io/npm/v/@dynamoi/mcp?label=npm)](https://www.npmjs.com/package/@dynamoi/mcp)
6
+ [![license](https://img.shields.io/npm/l/@dynamoi/mcp)](./LICENSE)
7
+ [![hosted MCP](https://img.shields.io/badge/hosted%20MCP-dynamoi.com%2Fmcp-7c3aed)](https://dynamoi.com/mcp)
8
+ [![artists](https://img.shields.io/badge/built%20for-artists%20%2B%20labels-10b981)](https://dynamoi.com)
8
9
 
9
- The normal way to use it is the hosted remote MCP server:
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 a free Smart Link, pull artist and campaign context, check what is
16
+ blocking a launch, start YouTube or Meta connection flows, and keep the next
17
+ promotion step clear.
18
+
19
+ It works with any MCP host that supports remote Streamable HTTP and OAuth:
20
+ ChatGPT, Claude, Gemini, local agent runtimes, internal label tools, or custom
21
+ automation.
10
22
 
11
23
  ```txt
12
24
  https://dynamoi.com/mcp
13
25
  ```
14
26
 
15
- This npm package is the public contract behind that server: tool schemas, resource
16
- metadata, transport helpers, and TypeScript types for the hosted implementation.
27
+ ## ✨ The Short Version
28
+
29
+ | When someone asks... | The agent can help with... |
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
+
37
+ ## 🎤 Who It Is For
38
+
39
+ **Artists and managers** use Dynamoi MCP to make links, check campaign setup,
40
+ and see what needs attention before a release gets promoted.
41
+
42
+ **Record labels and teams** can wire Dynamoi into internal agent workflows for
43
+ campaign checks, artist lookup, reporting, and release operations.
44
+
45
+ **Developers** can install this package when they need the public MCP contract,
46
+ schemas, OAuth metadata, transport helpers, or TypeScript types behind the hosted
47
+ Dynamoi server.
48
+
49
+ ## 🔗 Smart Links First
17
50
 
18
- ## What It Does
51
+ Free Smart Links are the easiest place for an agent to help:
19
52
 
20
- | Area | Assistant can help with |
53
+ - Turn a Spotify release into a public landing page.
54
+ - Import an artist catalog into an artist hub.
55
+ - Return the shareable URL immediately.
56
+ - Check link status, analytics, theme/settings, and publish state.
57
+ - Update or publish a link when the user clearly asks.
58
+
59
+ That gives artists something useful right away, and it gives promotion teams a
60
+ clean next step when the release is ready to push.
61
+
62
+ ## 🚦 Promotion Readiness
63
+
64
+ Before a campaign can move, a lot of small things have to be true. Dynamoi MCP
65
+ helps agents answer the practical questions:
66
+
67
+ | Question | What Dynamoi can check |
21
68
  | --- | --- |
22
- | Free Smart Links | Create Spotify release links, import artist catalogs, return public URLs, inspect analytics, update themes, and publish or unpublish links. |
23
- | Artist workspace | List artists, search records, summarize account state, and explain the best next action for a brand-new or returning user. |
24
- | Campaign planning | Check launch readiness, country availability, billing state, platform connections, and media assets before anything is created. |
25
- | Managed campaigns | Launch, pause, resume, and update Dynamoi campaign workflows after clear user confirmation. |
26
- | YouTube growth | Start YouTube channel linking and inspect campaign/account readiness for creator growth workflows. |
27
- | OpenAI connectors | Expose `search` and `fetch` for ChatGPT Deep Research style retrieval. |
69
+ | "Is this artist ready?" | Account access, artist records, platform status, and missing setup. |
70
+ | "Can this campaign launch?" | Readiness, billing state, supported countries, media assets, and deployment status. |
71
+ | "What needs attention?" | Active campaigns, Smart Links, analytics, and next actions. |
72
+ | "Are we connected?" | YouTube and Meta connection state, plus connection-start flows where available. |
28
73
 
29
- ## Connect
74
+ ## 🧠 Built For Any MCP Agent
30
75
 
31
- Use Dynamoi from the ChatGPT app directory, or add the remote server URL to any MCP
32
- client that supports Streamable HTTP remote servers.
76
+ This is a general MCP server, not a single-chat-product integration. Use the
77
+ hosted endpoint from any MCP-capable client that supports remote Streamable HTTP:
33
78
 
34
79
  ```json
35
80
  {
@@ -41,47 +86,17 @@ client that supports Streamable HTTP remote servers.
41
86
  }
42
87
  ```
43
88
 
44
- Authentication is handled through Dynamoi OAuth. Users sign in with their Dynamoi
45
- account, and the assistant only receives the scopes needed for the tools it calls.
46
-
47
- ## Why Artists Use It
48
-
49
- Most music tools stop at a dashboard. Dynamoi is built for the moment after the
50
- dashboard exists, when an artist asks:
51
-
52
- - "Make me a link for this release."
53
- - "What is blocking my campaign?"
54
- - "Which countries can I launch in?"
55
- - "Connect my YouTube channel."
56
- - "Get my Smart Link ready, then help me promote it."
57
-
58
- The assistant can move through those steps with the user instead of sending them
59
- back and forth between tabs.
89
+ Authentication runs through Dynamoi OAuth. Users sign in with their Dynamoi
90
+ account, and the connected agent receives only the scopes needed for the tools it
91
+ calls.
60
92
 
61
- ## Tool Surface
93
+ ## 🧰 Package Usage
62
94
 
63
- The public server includes tools for:
95
+ Most artists and labels do **not** need to install anything. They should connect
96
+ the hosted MCP server.
64
97
 
65
- - account overview and routing
66
- - artist and campaign search
67
- - artist analytics
68
- - campaign lists, details, readiness, deployment status, and updates
69
- - billing and platform status checks
70
- - Meta and YouTube connection starts
71
- - media asset selection
72
- - managed campaign launch workflows
73
- - Smart Link creation, listing, details, analytics, settings, and publishing
74
- - OpenAI `search` and `fetch`
75
-
76
- The server also publishes prompts and resources that teach assistants how to answer
77
- Dynamoi-specific questions without over-calling tools or creating paid workflows
78
- when the user only asked for a free Smart Link.
79
-
80
- ## Package Usage
81
-
82
- Most users do not need to install this package. Install it when you are working on
83
- the Dynamoi MCP server implementation, testing the public contract, or consuming
84
- the exported schemas and types.
98
+ Install `@dynamoi/mcp` when you are building against the public Dynamoi MCP
99
+ contract:
85
100
 
86
101
  ```bash
87
102
  npm install @dynamoi/mcp
@@ -105,21 +120,54 @@ const server = createDynamoiMcpServer({
105
120
  });
106
121
  ```
107
122
 
108
- `handleMcpHttpRequest` provides Streamable HTTP request handling with session
109
- binding so an MCP session cannot drift across authenticated users.
123
+ `handleMcpHttpRequest` provides stateless Streamable HTTP request handling for
124
+ serverless deployments. Authentication and authorization remain the host
125
+ application's responsibility on every request.
126
+
127
+ ### What Ships In This Package
128
+
129
+ | Included | Purpose |
130
+ | --- | --- |
131
+ | Tool schemas | The public MCP contract exposed by Dynamoi. |
132
+ | Prompts and resources | Guidance for Dynamoi-specific agent workflows. |
133
+ | Protected-resource metadata | OAuth discovery metadata for compatible clients. |
134
+ | HTTP transport helpers | Stateless Streamable HTTP handling for serverless hosts. |
135
+ | TypeScript types | Integration-safe contracts for hosted server code. |
136
+
137
+ ## 🛡️ Safety Model
138
+
139
+ Dynamoi MCP is built for real artist and label workflows, so the server keeps
140
+ clear boundaries around what an agent can do.
110
141
 
111
- ## Safety Model
142
+ | Safety layer | What it protects |
143
+ | --- | --- |
144
+ | 🔐 OAuth scopes | Agents only get the account access the user grants. |
145
+ | 👀 Read-only hints | Read tools are marked as read-only. |
146
+ | ✍️ Mutation descriptions | Write tools describe the external action they may take. |
147
+ | ✅ User intent gates | Launch and campaign-update workflows require clear user intent. |
148
+ | 💳 Paid-flow separation | Direct paid checkout is not exposed to connected agents. |
149
+ | 🔗 Smart Link boundary | Free Smart Link creation stays separate from managed advertising launch. |
150
+
151
+ ## 💬 Good First Prompts
152
+
153
+ Try these from any connected MCP agent:
154
+
155
+ > 🎧 Create a Smart Link for this Spotify release.
112
156
 
113
- - Read tools are annotated as read-only.
114
- - Mutating tools describe the external action they may take.
115
- - Launch and campaign-update workflows require explicit user intent.
116
- - Direct paid checkout is not exposed through the ChatGPT-visible tool surface.
117
- - Smart Link creation is separate from managed advertising launch.
157
+ > 🚦 What is blocking this campaign from launching?
118
158
 
119
- ## Links
159
+ > 📈 Show me the active campaigns that need attention.
120
160
 
121
- - Website: <https://dynamoi.com>
122
- - Hosted MCP endpoint: <https://dynamoi.com/mcp>
123
- - Package: <https://www.npmjs.com/package/@dynamoi/mcp>
124
- - Repository: <https://github.com/getDynamoi/mcp>
125
- - Changelog: [CHANGELOG.md](./CHANGELOG.md)
161
+ > 📺 Help me connect my YouTube channel.
162
+
163
+ > 🚀 Get this release ready to promote.
164
+
165
+ ## 🔗 Links
166
+
167
+ | Resource | URL |
168
+ | --- | --- |
169
+ | Website | <https://dynamoi.com> |
170
+ | Hosted MCP endpoint | <https://dynamoi.com/mcp> |
171
+ | npm package | <https://www.npmjs.com/package/@dynamoi/mcp> |
172
+ | Repository | <https://github.com/getDynamoi/mcp> |
173
+ | Changelog | [CHANGELOG.md](./CHANGELOG.md) |
@@ -5,18 +5,45 @@ type ProtectedResourceMetadata = {
5
5
  resource_documentation?: string;
6
6
  scopes_supported: string[];
7
7
  };
8
- declare const DYNAMOI_MCP_SCOPES: readonly ["email", "profile"];
9
- declare function buildProtectedResourceMetadata(options: {
8
+ export declare const DYNAMOI_BETTER_AUTH_MCP_SCOPES: readonly ["dynamoi:read", "dynamoi:billing.read", "dynamoi:campaign.launch", "dynamoi:campaign.write", "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:platform.read", "dynamoi:platform.write", "dynamoi:smart_links.write"];
11
+ export declare const DYNAMOI_MCP_TOOL_SCOPES: {
12
+ readonly dynamoi_create_smart_link_from_spotify: readonly ["dynamoi:read", "dynamoi:smart_links.write"];
13
+ readonly dynamoi_create_smart_links_from_spotify_artist: readonly ["dynamoi:read", "dynamoi:smart_links.write"];
14
+ readonly dynamoi_get_account_overview: readonly ["dynamoi:read"];
15
+ readonly dynamoi_get_artist_analytics: readonly ["dynamoi:read"];
16
+ readonly dynamoi_get_billing: readonly ["dynamoi:read", "dynamoi:billing.read"];
17
+ readonly dynamoi_get_campaign: readonly ["dynamoi:read"];
18
+ readonly dynamoi_get_campaign_readiness: readonly ["dynamoi:read"];
19
+ readonly dynamoi_get_platform_status: readonly ["dynamoi:read", "dynamoi:platform.read"];
20
+ readonly dynamoi_get_smart_link: readonly ["dynamoi:read"];
21
+ readonly dynamoi_launch_campaign: readonly ["dynamoi:read", "dynamoi:campaign.launch"];
22
+ readonly dynamoi_list_artists: readonly ["dynamoi:read"];
23
+ readonly dynamoi_list_available_countries: readonly ["dynamoi:read"];
24
+ readonly dynamoi_list_campaigns: readonly ["dynamoi:read"];
25
+ readonly dynamoi_list_media_assets: readonly ["dynamoi:read"];
26
+ readonly dynamoi_list_smart_links: readonly ["dynamoi:read"];
27
+ readonly dynamoi_preview_smart_link_themes: readonly ["dynamoi:read"];
28
+ readonly dynamoi_search: readonly ["dynamoi:read"];
29
+ readonly dynamoi_start_meta_connection: readonly ["dynamoi:read", "dynamoi:platform.write"];
30
+ readonly dynamoi_start_youtube_channel_link: readonly ["dynamoi:read", "dynamoi:platform.write"];
31
+ readonly dynamoi_update_campaign: readonly ["dynamoi:read", "dynamoi:campaign.write"];
32
+ readonly dynamoi_update_smart_link: readonly ["dynamoi:read", "dynamoi:smart_links.write"];
33
+ readonly fetch: readonly ["dynamoi:read"];
34
+ readonly search: readonly ["dynamoi:read"];
35
+ };
36
+ export declare function buildProtectedResourceMetadata(options: {
10
37
  resource: string;
11
38
  authorizationServers: string[];
12
39
  resourceDocumentation?: string;
13
40
  scopesSupported?: string[];
14
41
  }): ProtectedResourceMetadata;
15
- declare function buildWwwAuthenticateHeader(options: {
42
+ export declare function buildWwwAuthenticateHeader(options: {
16
43
  resourceMetadataUrl: string;
17
44
  errorDescription?: string;
18
45
  error?: "insufficient_scope" | "invalid_token";
19
46
  scope?: string;
20
47
  }): string;
21
-
22
- export { DYNAMOI_MCP_SCOPES, buildProtectedResourceMetadata, buildWwwAuthenticateHeader };
48
+ export {};
49
+ //# sourceMappingURL=protected-resource.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"protected-resource.d.ts","sourceRoot":"","sources":["../../../src/auth/protected-resource.ts"],"names":[],"mappings":"AAAA,KAAK,yBAAyB,GAAG;IAChC,qBAAqB,EAAE,MAAM,EAAE,CAAC;IAChC,wBAAwB,EAAE,CAAC,QAAQ,CAAC,CAAC;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,gBAAgB,EAAE,MAAM,EAAE,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAM,8BAA8B,YAC1C,cAAc,EACd,sBAAsB,EACtB,yBAAyB,EACzB,wBAAwB,EACxB,uBAAuB,EACvB,wBAAwB,EACxB,2BAA2B,CAClB,CAAC;AACX,sDAAsD;AACtD,eAAO,MAAM,kBAAkB,wLAAiC,CAAC;AACjE,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;CAiCkB,CAAC;AAEvD,wBAAgB,8BAA8B,CAAC,OAAO,EAAE;IACvD,QAAQ,EAAE,MAAM,CAAC;IACjB,oBAAoB,EAAE,MAAM,EAAE,CAAC;IAC/B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B,GAAG,yBAAyB,CAY5B;AAED,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,CAgBT"}
@@ -1,11 +1,17 @@
1
1
  import {
2
+ DYNAMOI_BETTER_AUTH_MCP_SCOPES,
2
3
  DYNAMOI_MCP_SCOPES,
4
+ DYNAMOI_MCP_TOOL_SCOPES,
3
5
  buildProtectedResourceMetadata,
4
6
  buildWwwAuthenticateHeader
5
- } from "../chunk-CHQUK72A.js";
7
+ } from "../chunk-4jfaxshz.js";
6
8
  export {
7
- DYNAMOI_MCP_SCOPES,
9
+ buildWwwAuthenticateHeader,
8
10
  buildProtectedResourceMetadata,
9
- buildWwwAuthenticateHeader
11
+ DYNAMOI_MCP_TOOL_SCOPES,
12
+ DYNAMOI_MCP_SCOPES,
13
+ DYNAMOI_BETTER_AUTH_MCP_SCOPES
10
14
  };
11
- //# sourceMappingURL=protected-resource.js.map
15
+
16
+ //# debugId=9BBF6C6C05D5C09964756E2164756E21
17
+ //# sourceMappingURL=protected-resource.js.map
@@ -1 +1,9 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [
5
+ ],
6
+ "mappings": "",
7
+ "debugId": "9BBF6C6C05D5C09964756E2164756E21",
8
+ "names": []
9
+ }
@@ -0,0 +1,21 @@
1
+ type VerifiedAccessToken = {
2
+ sub: string;
3
+ iss: string;
4
+ aud: string | string[] | undefined;
5
+ exp: number;
6
+ grantId: string | null;
7
+ clientId: string | null;
8
+ jti: string | null;
9
+ scopes: string[];
10
+ sessionId: string | null;
11
+ };
12
+ type VerifyAccessTokenOptions = {
13
+ algorithms?: Array<"ES256" | "RS256">;
14
+ token: string;
15
+ jwksUrl: string;
16
+ issuer: string;
17
+ audienceAllowlist: string[];
18
+ };
19
+ export declare function verifyAccessToken(options: VerifyAccessTokenOptions): Promise<VerifiedAccessToken>;
20
+ export {};
21
+ //# sourceMappingURL=verify-token.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verify-token.d.ts","sourceRoot":"","sources":["../../../src/auth/verify-token.ts"],"names":[],"mappings":"AAEA,KAAK,mBAAmB,GAAG;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB,CAAC;AAEF,KAAK,wBAAwB,GAAG;IAC/B,UAAU,CAAC,EAAE,KAAK,CAAC,OAAO,GAAG,OAAO,CAAC,CAAC;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,iBAAiB,EAAE,MAAM,EAAE,CAAC;CAC5B,CAAC;AA4CF,wBAAsB,iBAAiB,CACtC,OAAO,EAAE,wBAAwB,GAC/B,OAAO,CAAC,mBAAmB,CAAC,CAmC9B"}
@@ -0,0 +1,83 @@
1
+ // src/auth/protected-resource.ts
2
+ var DYNAMOI_BETTER_AUTH_MCP_SCOPES = [
3
+ "dynamoi:read",
4
+ "dynamoi:billing.read",
5
+ "dynamoi:campaign.launch",
6
+ "dynamoi:campaign.write",
7
+ "dynamoi:platform.read",
8
+ "dynamoi:platform.write",
9
+ "dynamoi:smart_links.write"
10
+ ];
11
+ var DYNAMOI_MCP_SCOPES = DYNAMOI_BETTER_AUTH_MCP_SCOPES;
12
+ var DYNAMOI_MCP_TOOL_SCOPES = {
13
+ dynamoi_create_smart_link_from_spotify: [
14
+ "dynamoi:read",
15
+ "dynamoi:smart_links.write"
16
+ ],
17
+ dynamoi_create_smart_links_from_spotify_artist: [
18
+ "dynamoi:read",
19
+ "dynamoi:smart_links.write"
20
+ ],
21
+ dynamoi_get_account_overview: ["dynamoi:read"],
22
+ dynamoi_get_artist_analytics: ["dynamoi:read"],
23
+ dynamoi_get_billing: ["dynamoi:read", "dynamoi:billing.read"],
24
+ dynamoi_get_campaign: ["dynamoi:read"],
25
+ dynamoi_get_campaign_readiness: ["dynamoi:read"],
26
+ dynamoi_get_platform_status: ["dynamoi:read", "dynamoi:platform.read"],
27
+ dynamoi_get_smart_link: ["dynamoi:read"],
28
+ dynamoi_launch_campaign: ["dynamoi:read", "dynamoi:campaign.launch"],
29
+ dynamoi_list_artists: ["dynamoi:read"],
30
+ dynamoi_list_available_countries: ["dynamoi:read"],
31
+ dynamoi_list_campaigns: ["dynamoi:read"],
32
+ dynamoi_list_media_assets: ["dynamoi:read"],
33
+ dynamoi_list_smart_links: ["dynamoi:read"],
34
+ dynamoi_preview_smart_link_themes: ["dynamoi:read"],
35
+ dynamoi_search: ["dynamoi:read"],
36
+ dynamoi_start_meta_connection: ["dynamoi:read", "dynamoi:platform.write"],
37
+ dynamoi_start_youtube_channel_link: [
38
+ "dynamoi:read",
39
+ "dynamoi:platform.write"
40
+ ],
41
+ dynamoi_update_campaign: ["dynamoi:read", "dynamoi:campaign.write"],
42
+ dynamoi_update_smart_link: ["dynamoi:read", "dynamoi:smart_links.write"],
43
+ fetch: ["dynamoi:read"],
44
+ search: ["dynamoi:read"]
45
+ };
46
+ function buildProtectedResourceMetadata(options) {
47
+ return {
48
+ authorization_servers: options.authorizationServers,
49
+ bearer_methods_supported: ["header"],
50
+ resource: options.resource,
51
+ ...options.resourceDocumentation ? { resource_documentation: options.resourceDocumentation } : {},
52
+ scopes_supported: options.scopesSupported ?? [
53
+ ...DYNAMOI_BETTER_AUTH_MCP_SCOPES
54
+ ]
55
+ };
56
+ }
57
+ function buildWwwAuthenticateHeader(options) {
58
+ const scope = options.scope ?? "dynamoi:read";
59
+ const error = options.error ?? "invalid_token";
60
+ const errorDescription = options.errorDescription ?? (error === "insufficient_scope" ? "Additional Dynamoi permissions are required." : "Sign in to Dynamoi to continue.");
61
+ const params = [
62
+ `resource_metadata="${escapeHeaderValue(options.resourceMetadataUrl)}"`,
63
+ `scope="${escapeHeaderValue(scope)}"`,
64
+ `error="${escapeHeaderValue(error)}"`,
65
+ `error_description="${escapeHeaderValue(errorDescription)}"`
66
+ ];
67
+ return `Bearer ${params.join(", ")}`;
68
+ }
69
+ function escapeHeaderValue(value) {
70
+ const containsControlCharacter = Array.from(value).some((character) => {
71
+ const codePoint = character.codePointAt(0) ?? 0;
72
+ return codePoint <= 31 || codePoint === 127;
73
+ });
74
+ if (containsControlCharacter) {
75
+ throw new Error("WWW-Authenticate values cannot contain control characters.");
76
+ }
77
+ return value.replaceAll("\\", "\\\\").replaceAll('"', "\\\"");
78
+ }
79
+
80
+ export { DYNAMOI_BETTER_AUTH_MCP_SCOPES, DYNAMOI_MCP_SCOPES, DYNAMOI_MCP_TOOL_SCOPES, buildProtectedResourceMetadata, buildWwwAuthenticateHeader };
81
+
82
+ //# debugId=A69DFFF79D197B4A64756E2164756E21
83
+ //# sourceMappingURL=chunk-4jfaxshz.js.map
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/auth/protected-resource.ts"],
4
+ "sourcesContent": [
5
+ "type ProtectedResourceMetadata = {\n\tauthorization_servers: string[];\n\tbearer_methods_supported: [\"header\"];\n\tresource: string;\n\tresource_documentation?: string;\n\tscopes_supported: string[];\n};\n\nexport const DYNAMOI_BETTER_AUTH_MCP_SCOPES = [\n\t\"dynamoi:read\",\n\t\"dynamoi:billing.read\",\n\t\"dynamoi:campaign.launch\",\n\t\"dynamoi:campaign.write\",\n\t\"dynamoi:platform.read\",\n\t\"dynamoi:platform.write\",\n\t\"dynamoi:smart_links.write\",\n] as const;\n/** @deprecated Use DYNAMOI_BETTER_AUTH_MCP_SCOPES. */\nexport const DYNAMOI_MCP_SCOPES = DYNAMOI_BETTER_AUTH_MCP_SCOPES;\nexport const DYNAMOI_MCP_TOOL_SCOPES = {\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_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_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 buildProtectedResourceMetadata(options: {\n\tresource: string;\n\tauthorizationServers: string[];\n\tresourceDocumentation?: string;\n\tscopesSupported?: string[];\n}): ProtectedResourceMetadata {\n\treturn {\n\t\tauthorization_servers: options.authorizationServers,\n\t\tbearer_methods_supported: [\"header\"],\n\t\tresource: options.resource,\n\t\t...(options.resourceDocumentation\n\t\t\t? { resource_documentation: options.resourceDocumentation }\n\t\t\t: {}),\n\t\tscopes_supported: options.scopesSupported ?? [\n\t\t\t...DYNAMOI_BETTER_AUTH_MCP_SCOPES,\n\t\t],\n\t};\n}\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 error = options.error ?? \"invalid_token\";\n\tconst errorDescription =\n\t\toptions.errorDescription ??\n\t\t(error === \"insufficient_scope\"\n\t\t\t? \"Additional Dynamoi permissions are required.\"\n\t\t\t: \"Sign in to Dynamoi to continue.\");\n\tconst params = [\n\t\t`resource_metadata=\"${escapeHeaderValue(options.resourceMetadataUrl)}\"`,\n\t\t`scope=\"${escapeHeaderValue(scope)}\"`,\n\t\t`error=\"${escapeHeaderValue(error)}\"`,\n\t\t`error_description=\"${escapeHeaderValue(errorDescription)}\"`,\n\t];\n\t// RFC 6750 style with resource metadata extension.\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": ";AAQO,IAAM,iCAAiC;AAAA,EAC7C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;AAEO,IAAM,qBAAqB;AAC3B,IAAM,0BAA0B;AAAA,EACtC,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,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,+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,8BAA8B,CAAC,SAKjB;AAAA,EAC7B,OAAO;AAAA,IACN,uBAAuB,QAAQ;AAAA,IAC/B,0BAA0B,CAAC,QAAQ;AAAA,IACnC,UAAU,QAAQ;AAAA,OACd,QAAQ,wBACT,EAAE,wBAAwB,QAAQ,sBAAsB,IACxD,CAAC;AAAA,IACJ,kBAAkB,QAAQ,mBAAmB;AAAA,MAC5C,GAAG;AAAA,IACJ;AAAA,EACD;AAAA;AAGM,SAAS,0BAA0B,CAAC,SAKhC;AAAA,EACV,MAAM,QAAQ,QAAQ,SAAS;AAAA,EAC/B,MAAM,QAAQ,QAAQ,SAAS;AAAA,EAC/B,MAAM,mBACL,QAAQ,qBACP,UAAU,uBACR,iDACA;AAAA,EACJ,MAAM,SAAS;AAAA,IACd,sBAAsB,kBAAkB,QAAQ,mBAAmB;AAAA,IACnE,UAAU,kBAAkB,KAAK;AAAA,IACjC,UAAU,kBAAkB,KAAK;AAAA,IACjC,sBAAsB,kBAAkB,gBAAgB;AAAA,EACzD;AAAA,EAEA,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": "A69DFFF79D197B4A64756E2164756E21",
9
+ "names": []
10
+ }
@@ -0,0 +1,9 @@
1
+ // src/consent.ts
2
+ var PROSPECTIVE_BUDGET_FUNDING_CONSENT_VERSION = "managed-ads-prospective-daily-v1";
3
+ var PROSPECTIVE_BUDGET_FUNDING_CONSENT_COPY = "Authorize automatic card funding for this campaign's requested approximately 24-hour daily budget.";
4
+ var PROSPECTIVE_BUDGET_FUNDING_CONSENT_COPY_HASH = "36efa2138175fe14ec7b104d6f240bdce89d21b86ffccbd9f968100c50123e15";
5
+
6
+ export { PROSPECTIVE_BUDGET_FUNDING_CONSENT_VERSION, PROSPECTIVE_BUDGET_FUNDING_CONSENT_COPY, PROSPECTIVE_BUDGET_FUNDING_CONSENT_COPY_HASH };
7
+
8
+ //# debugId=7CFA96341B1D2ABC64756E2164756E21
9
+ //# sourceMappingURL=chunk-kb3xpcrb.js.map
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/consent.ts"],
4
+ "sourcesContent": [
5
+ "export const PROSPECTIVE_BUDGET_FUNDING_CONSENT_VERSION =\n\t\"managed-ads-prospective-daily-v1\";\nexport const PROSPECTIVE_BUDGET_FUNDING_CONSENT_COPY =\n\t\"Authorize automatic card funding for this campaign's requested approximately 24-hour daily budget.\";\nexport const PROSPECTIVE_BUDGET_FUNDING_CONSENT_COPY_HASH =\n\t\"36efa2138175fe14ec7b104d6f240bdce89d21b86ffccbd9f968100c50123e15\";\n"
6
+ ],
7
+ "mappings": ";AAAO,IAAM,6CACZ;AACM,IAAM,0CACZ;AACM,IAAM,+CACZ;",
8
+ "debugId": "7CFA96341B1D2ABC64756E2164756E21",
9
+ "names": []
10
+ }
@@ -0,0 +1,4 @@
1
+ export declare const PROSPECTIVE_BUDGET_FUNDING_CONSENT_VERSION = "managed-ads-prospective-daily-v1";
2
+ export declare const PROSPECTIVE_BUDGET_FUNDING_CONSENT_COPY = "Authorize automatic card funding for this campaign's requested approximately 24-hour daily budget.";
3
+ export declare const PROSPECTIVE_BUDGET_FUNDING_CONSENT_COPY_HASH = "36efa2138175fe14ec7b104d6f240bdce89d21b86ffccbd9f968100c50123e15";
4
+ //# sourceMappingURL=consent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consent.d.ts","sourceRoot":"","sources":["../../src/consent.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,0CAA0C,qCACpB,CAAC;AACpC,eAAO,MAAM,uCAAuC,uGACiD,CAAC;AACtG,eAAO,MAAM,4CAA4C,qEACU,CAAC"}
@@ -0,0 +1,13 @@
1
+ import {
2
+ PROSPECTIVE_BUDGET_FUNDING_CONSENT_COPY,
3
+ PROSPECTIVE_BUDGET_FUNDING_CONSENT_COPY_HASH,
4
+ PROSPECTIVE_BUDGET_FUNDING_CONSENT_VERSION
5
+ } from "./chunk-kb3xpcrb.js";
6
+ export {
7
+ PROSPECTIVE_BUDGET_FUNDING_CONSENT_VERSION,
8
+ PROSPECTIVE_BUDGET_FUNDING_CONSENT_COPY_HASH,
9
+ PROSPECTIVE_BUDGET_FUNDING_CONSENT_COPY
10
+ };
11
+
12
+ //# debugId=FD7B0090CB8A7ACF64756E2164756E21
13
+ //# sourceMappingURL=consent.js.map
@@ -0,0 +1,9 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [
5
+ ],
6
+ "mappings": "",
7
+ "debugId": "FD7B0090CB8A7ACF64756E2164756E21",
8
+ "names": []
9
+ }