@dynamoi/mcp 0.6.4 → 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 +21 -1
  2. package/README.md +4 -3
  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 +16 -8
  58. package/server.json +3 -3
  59. package/dist/chunk-CHQUK72A.js +0 -35
  60. package/dist/chunk-CHQUK72A.js.map +0 -1
package/dist/index.js CHANGED
@@ -1,12 +1,18 @@
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";
6
-
7
+ } from "./chunk-4jfaxshz.js";
8
+ import {
9
+ PROSPECTIVE_BUDGET_FUNDING_CONSENT_COPY,
10
+ PROSPECTIVE_BUDGET_FUNDING_CONSENT_COPY_HASH,
11
+ PROSPECTIVE_BUDGET_FUNDING_CONSENT_VERSION
12
+ } from "./chunk-kb3xpcrb.js";
7
13
  // src/auth/verify-token.ts
8
14
  import { createRemoteJWKSet, jwtVerify } from "jose";
9
- var jwksByUrl = /* @__PURE__ */ new Map();
15
+ var jwksByUrl = new Map;
10
16
  function getRemoteJwks(jwksUrl) {
11
17
  const existing = jwksByUrl.get(jwksUrl);
12
18
  if (existing) {
@@ -34,16 +40,14 @@ function extractScopes(payload) {
34
40
  }
35
41
  const scopes = payload["scopes"];
36
42
  if (Array.isArray(scopes)) {
37
- return scopes.filter(
38
- (scopeValue) => typeof scopeValue === "string" && scopeValue.trim().length > 0
39
- );
43
+ return scopes.filter((scopeValue) => typeof scopeValue === "string" && scopeValue.trim().length > 0);
40
44
  }
41
45
  return [];
42
46
  }
43
47
  async function verifyAccessToken(options) {
44
48
  const jwks = getRemoteJwks(options.jwksUrl);
45
49
  const verifyOptions = {
46
- algorithms: ["ES256", "RS256"],
50
+ algorithms: options.algorithms ?? ["ES256", "RS256"],
47
51
  audience: options.audienceAllowlist,
48
52
  issuer: options.issuer
49
53
  };
@@ -65,19 +69,21 @@ async function verifyAccessToken(options) {
65
69
  aud,
66
70
  clientId: extractClientId(payload),
67
71
  exp,
72
+ grantId: typeof payload["gid"] === "string" ? payload["gid"] : null,
68
73
  iss,
74
+ jti: typeof payload.jti === "string" ? payload.jti : null,
69
75
  scopes: extractScopes(payload),
76
+ sessionId: typeof payload.sid === "string" ? payload.sid : null,
70
77
  sub
71
78
  };
72
79
  }
73
-
74
80
  // src/server/create-server.ts
75
81
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
76
- import * as z8 from "zod/v4";
82
+ import * as z9 from "zod/v4";
77
83
 
78
84
  // src/version.ts
79
- var BUNDLED_DYNAMOI_MCP_VERSION = true ? "0.6.4" : "";
80
- var DYNAMOI_MCP_VERSION = BUNDLED_DYNAMOI_MCP_VERSION.length > 0 && !BUNDLED_DYNAMOI_MCP_VERSION.includes("__") ? BUNDLED_DYNAMOI_MCP_VERSION : "0.6.4";
85
+ var BUNDLED_DYNAMOI_MCP_VERSION = "0.6.5";
86
+ var DYNAMOI_MCP_VERSION = BUNDLED_DYNAMOI_MCP_VERSION.length > 0 && !BUNDLED_DYNAMOI_MCP_VERSION.includes("__") ? BUNDLED_DYNAMOI_MCP_VERSION : "0.6.5";
81
87
 
82
88
  // src/server/instructions.ts
83
89
  var DYNAMOI_MCP_INSTRUCTIONS = `
@@ -90,14 +96,14 @@ paid campaign services.
90
96
 
91
97
  === Session Start Routine ===
92
98
 
93
- When the user's first message in a Dynamoi session is account-relevant (artists, campaigns, smart links, billing, connections, launches, or "what should I do here"), call dynamoi_get_account_overview first to learn the user's state. The response includes a recommendedNextActions array and a state object \u2014 treat that array as authoritative guidance for what to ask or do next.
99
+ When the user's first message in a Dynamoi session is account-relevant (artists, campaigns, smart links, billing, connections, launches, or "what should I do here"), call dynamoi_get_account_overview first to learn the user's state. The response includes a recommendedNextActions array and a state object — treat that array as authoritative guidance for what to ask or do next.
94
100
 
95
101
  Route by state from dynamoi_get_account_overview:
96
102
 
97
103
  - state.hasAnyArtist === false: This is a brand-new user. Ask whether they are a Spotify artist, a YouTube creator, or a label/manager.
98
- - Spotify artist with a URL \u2192 call dynamoi_create_smart_links_from_spotify_artist immediately to create their free hub. Read dynamoi://playbooks/spotify-artist for scripted phrasing.
99
- - YouTube creator \u2192 read dynamoi://playbooks/youtube-creator and explain Dynamoi's revenue-per-view optimization advantage before asking whether they want to link the channel. If yes, call dynamoi_start_youtube_channel_link.
100
- - Label or manager with a roster \u2192 read dynamoi://playbooks/label-or-manager for the multi-artist setup walkthrough.
104
+ - Spotify artist with a URL → call dynamoi_create_smart_links_from_spotify_artist immediately to create their free hub. Read dynamoi://playbooks/spotify-artist for scripted phrasing.
105
+ - YouTube creator → read dynamoi://playbooks/youtube-creator and explain Dynamoi's revenue-per-view optimization advantage before asking whether they want to link the channel. If yes, call dynamoi_start_youtube_channel_link.
106
+ - Label or manager with a roster → read dynamoi://playbooks/label-or-manager for the multi-artist setup walkthrough.
101
107
 
102
108
  - state.hasAnyArtist === true && state.hasAnySmartLink === false: The fastest visible win is a free Smart Link. Offer dynamoi_create_smart_link_from_spotify (single release) or dynamoi_create_smart_links_from_spotify_artist (full catalog) before campaign tools.
103
109
 
@@ -109,7 +115,7 @@ Route by state from dynamoi_get_account_overview:
109
115
 
110
116
  - state.hasAnyArtist === true && state.hasAnyConnectedYoutube === false and the user wants YouTube growth: offer dynamoi_start_youtube_channel_link, then poll dynamoi_get_platform_status for the target artist with the returned onboardingAttemptId and onboardingFlow=youtube after the browser return page sends them back to chat. Treat the connection as complete when platforms.youtube.connected is true.
111
117
 
112
- Do NOT call dynamoi_list_artists or dynamoi_search as a first step for brand-new users \u2014 both will return empty for them and the conversation stalls. Always go through dynamoi_get_account_overview first.
118
+ Do NOT call dynamoi_list_artists or dynamoi_search as a first step for brand-new users — both will return empty for them and the conversation stalls. Always go through dynamoi_get_account_overview first.
113
119
 
114
120
  === End Session Start Routine ===
115
121
 
@@ -132,22 +138,22 @@ Principles:
132
138
  - When answering from Smart Link tools, lead with the artist hub URL when present, then public release URLs, release title, artist name, status, and next action. Do not include internal UUIDs unless the user explicitly asks for IDs or you need an ID for a follow-up tool call.
133
139
  - Smart Link pixel tools accept validated pixel IDs only. Do not ask for arbitrary JavaScript, tag-manager snippets, or script code.
134
140
  - Money values are shown in USD as presented in Dynamoi.
135
- - Budget minimums: $10/day (daily), $100 total (Smart Campaign), $50 total (YouTube).
141
+ - Budget minimums: $10/day (daily), $50 total (Smart Campaign), $50 total (YouTube).
136
142
  - Product and pricing details are available as MCP resources. Keep runtime answers
137
143
  focused on the user's account data and requested action.
138
144
 
139
145
  Common workflows:
140
- - Discovery: dynamoi_list_artists \u2192 dynamoi_list_campaigns \u2192 dynamoi_get_campaign \u2192
146
+ - Discovery: dynamoi_list_artists → dynamoi_list_campaigns → dynamoi_get_campaign →
141
147
  dynamoi_get_campaign with includeAnalytics=true when needed
142
148
  - Artist performance summary: dynamoi_get_artist_analytics with granularity=DAILY when requested. If that response already includes the strongest campaign, do not call more analytics tools.
143
- - Diagnose stuck campaign: dynamoi_get_campaign \u2192 dynamoi_get_platform_status \u2192
149
+ - Diagnose stuck campaign: dynamoi_get_campaign → dynamoi_get_platform_status →
144
150
  propose next steps
145
- - Pause/resume: dynamoi_get_campaign (confirm) \u2192 dynamoi_update_campaign with action=pause or action=resume
146
- - Budget update: dynamoi_get_campaign (confirm) \u2192 dynamoi_update_campaign with action=update_budget
147
- - Launch: dynamoi_list_media_assets \u2192 dynamoi_launch_campaign
151
+ - Pause/resume: dynamoi_get_campaign (confirm) → dynamoi_update_campaign with action=pause or action=resume
152
+ - Budget update: dynamoi_get_campaign (confirm) → dynamoi_update_campaign with action=update_budget
153
+ - Launch: dynamoi_list_media_assets → dynamoi_launch_campaign
148
154
  - Free Smart Link artist catalog creation: dynamoi_create_smart_links_from_spotify_artist; omit artistId for a brand-new user with no Dynamoi artist yet
149
- - Free Smart Link single-release creation: dynamoi_list_artists \u2192 dynamoi_create_smart_link_from_spotify
150
- - Smart Link analytics/settings: dynamoi_list_smart_links \u2192 dynamoi_get_smart_link with includeAnalytics=true or includeArtistSettings=true
155
+ - Free Smart Link single-release creation: dynamoi_list_artists → dynamoi_create_smart_link_from_spotify
156
+ - Smart Link analytics/settings: dynamoi_list_smart_links → dynamoi_get_smart_link with includeAnalytics=true or includeArtistSettings=true
151
157
  - Post-launch answer: if dynamoi_launch_campaign succeeds, answer from that result directly. Only call dynamoi_get_campaign when the user explicitly needs more detail than the launch result already returned, and prefer format=summary for that follow-up.
152
158
  - Review/demo Smart Campaign launch: if the user already gave artist, content title, budget, countries, and reusable media assets, you may call dynamoi_launch_campaign without spotifyUrl/endDate because Dynamoi can infer reviewer-safe defaults. Do not invent placeholder values for omitted fields; omit those keys entirely.
153
159
  `.trim();
@@ -203,137 +209,107 @@ function asTextPrompt(text) {
203
209
  };
204
210
  }
205
211
  function registerDynamoiPrompts(server) {
206
- server.registerPrompt(
207
- "dynamoi_find_smart_link_url",
208
- {
209
- argsSchema: {
210
- artistId: z.string().uuid().optional(),
211
- query: z.string().trim().optional()
212
- },
213
- description: "Find a user's free Smart Link URL and answer with public URLs, titles, and statuses.",
214
- title: "Find Smart Link URL"
215
- },
216
- (args) => asTextPrompt(
217
- [
218
- "Find my Dynamoi Smart Link URL.",
219
- args.artistId ? `Artist ID: ${args.artistId}` : "If no artistId is provided, use dynamoi_search or dynamoi_list_artists to identify the artist first.",
220
- args.query ? `Search query: ${args.query}` : "",
221
- "",
222
- "Use dynamoi_list_smart_links or dynamoi_search with type=smartlink.",
223
- "In the final answer, show the release title, artist, public URL, and status. Do not show internal IDs unless I ask for them."
224
- ].filter(Boolean).join("\n")
225
- )
226
- );
227
- server.registerPrompt(
228
- "dynamoi_explain_free_smart_links",
229
- {
230
- argsSchema: {},
231
- description: "Explain Dynamoi free Smart Links and how they differ from paid managed advertising.",
232
- title: "Explain Free Smart Links"
212
+ server.registerPrompt("dynamoi_find_smart_link_url", {
213
+ argsSchema: {
214
+ artistId: z.string().uuid().optional(),
215
+ query: z.string().trim().optional()
233
216
  },
234
- () => asTextPrompt(
235
- [
236
- "Explain Dynamoi free Smart Links.",
237
- "Use MCP resources if needed, especially dynamoi://smart-links/free-plan and dynamoi://business/free-vs-paid.",
238
- "Be clear: Smart Links are free to create and manage. High-popularity or unverifiable artist links may require verification before public publishing. Managed advertising and ad budgets are separate paid services.",
239
- "Do not inspect my account data unless I ask about my artists, links, campaigns, billing, or settings."
240
- ].join("\n")
241
- )
242
- );
243
- server.registerPrompt(
244
- "dynamoi_create_free_smart_link",
245
- {
246
- argsSchema: {
247
- artistId: z.string().uuid().optional(),
248
- spotifyUrl: z.string().trim().optional()
249
- },
250
- description: "Create free Smart Links from a Spotify artist, album, or track URL.",
251
- title: "Create Free Smart Link"
217
+ description: "Find a user's free Smart Link URL and answer with public URLs, titles, and statuses.",
218
+ title: "Find Smart Link URL"
219
+ }, (args) => asTextPrompt([
220
+ "Find my Dynamoi Smart Link URL.",
221
+ args.artistId ? `Artist ID: ${args.artistId}` : "If no artistId is provided, use dynamoi_search or dynamoi_list_artists to identify the artist first.",
222
+ args.query ? `Search query: ${args.query}` : "",
223
+ "",
224
+ "Use dynamoi_list_smart_links or dynamoi_search with type=smartlink.",
225
+ "In the final answer, show the release title, artist, public URL, and status. Do not show internal IDs unless I ask for them."
226
+ ].filter(Boolean).join(`
227
+ `)));
228
+ server.registerPrompt("dynamoi_explain_free_smart_links", {
229
+ argsSchema: {},
230
+ description: "Explain Dynamoi free Smart Links and how they differ from paid managed advertising.",
231
+ title: "Explain Free Smart Links"
232
+ }, () => asTextPrompt([
233
+ "Explain Dynamoi free Smart Links.",
234
+ "Use MCP resources if needed, especially dynamoi://smart-links/free-plan and dynamoi://business/free-vs-paid.",
235
+ "Be clear: Smart Links are free to create and manage. High-popularity or unverifiable artist links may require verification before public publishing. Managed advertising and ad budgets are separate paid services.",
236
+ "Do not inspect my account data unless I ask about my artists, links, campaigns, billing, or settings."
237
+ ].join(`
238
+ `)));
239
+ server.registerPrompt("dynamoi_create_free_smart_link", {
240
+ argsSchema: {
241
+ artistId: z.string().uuid().optional(),
242
+ spotifyUrl: z.string().trim().optional()
252
243
  },
253
- (args) => asTextPrompt(
254
- [
255
- "Create a free Dynamoi Smart Link.",
256
- args.artistId ? `Artist ID: ${args.artistId}` : "If no artistId is provided, list artists first and ask me which artist owns the link.",
257
- args.spotifyUrl ? `Spotify URL: ${args.spotifyUrl}` : "Ask me for a Spotify artist, album, or track URL. Playlist URLs are not supported today.",
258
- "",
259
- "Smart Links are free to create and manage. High-popularity or unverifiable artist links may require verification before public publishing. This does not create a paid campaign.",
260
- "If the Spotify URL is an artist URL and I want my hub/catalog, use dynamoi_create_smart_links_from_spotify_artist. If it is an album or track URL, use dynamoi_create_smart_link_from_spotify."
261
- ].join("\n")
262
- )
263
- );
264
- server.registerPrompt(
265
- "dynamoi_audit_campaigns",
266
- {
267
- argsSchema: {
268
- artistId: z.string().uuid().optional()
269
- },
270
- description: "Audit an artist's campaigns and summarize what is working and what to fix next.",
271
- title: "Audit Campaigns"
244
+ description: "Create free Smart Links from a Spotify artist, album, or track URL.",
245
+ title: "Create Free Smart Link"
246
+ }, (args) => asTextPrompt([
247
+ "Create a free Dynamoi Smart Link.",
248
+ args.artistId ? `Artist ID: ${args.artistId}` : "If no artistId is provided, list artists first and ask me which artist owns the link.",
249
+ args.spotifyUrl ? `Spotify URL: ${args.spotifyUrl}` : "Ask me for a Spotify artist, album, or track URL. Playlist URLs are not supported today.",
250
+ "",
251
+ "Smart Links are free to create and manage. High-popularity or unverifiable artist links may require verification before public publishing. This does not create a paid campaign.",
252
+ "If the Spotify URL is an artist URL and I want my hub/catalog, use dynamoi_create_smart_links_from_spotify_artist. If it is an album or track URL, use dynamoi_create_smart_link_from_spotify."
253
+ ].join(`
254
+ `)));
255
+ server.registerPrompt("dynamoi_audit_campaigns", {
256
+ argsSchema: {
257
+ artistId: z.string().uuid().optional()
272
258
  },
273
- (args) => asTextPrompt(
274
- [
275
- "Audit my campaigns in Dynamoi.",
276
- args.artistId ? `Artist ID: ${args.artistId}` : "If no artistId is provided, start by listing artists and ask me which one to audit.",
277
- "",
278
- "Steps:",
279
- "1. Use dynamoi_list_campaigns and dynamoi_get_campaign with includeAnalytics=true for the last 7-14 days when one campaign needs a deeper read.",
280
- "2. Identify any campaigns that are paused, failed, or stuck in a pre-active state and explain why using dynamoi_get_campaign and dynamoi_get_platform_status.",
281
- "3. Recommend 3-5 next actions with clear priorities."
282
- ].join("\n")
283
- )
284
- );
285
- server.registerPrompt(
286
- "dynamoi_release_launch_plan",
287
- {
288
- argsSchema: {
289
- artistId: z.string().uuid().optional(),
290
- contentTitle: z.string().trim().optional(),
291
- contentType: z.enum(["TRACK", "ALBUM", "PLAYLIST", "VIDEO"]).optional()
292
- },
293
- description: "Create a pragmatic release launch plan and propose a Dynamoi campaign setup.",
294
- title: "Release Launch Plan"
259
+ description: "Audit an artist's campaigns and summarize what is working and what to fix next.",
260
+ title: "Audit Campaigns"
261
+ }, (args) => asTextPrompt([
262
+ "Audit my campaigns in Dynamoi.",
263
+ args.artistId ? `Artist ID: ${args.artistId}` : "If no artistId is provided, start by listing artists and ask me which one to audit.",
264
+ "",
265
+ "Steps:",
266
+ "1. Use dynamoi_list_campaigns and dynamoi_get_campaign with includeAnalytics=true for the last 7-14 days when one campaign needs a deeper read.",
267
+ "2. Identify any campaigns that are paused, failed, or stuck in a pre-active state and explain why using dynamoi_get_campaign and dynamoi_get_platform_status.",
268
+ "3. Recommend 3-5 next actions with clear priorities."
269
+ ].join(`
270
+ `)));
271
+ server.registerPrompt("dynamoi_release_launch_plan", {
272
+ argsSchema: {
273
+ artistId: z.string().uuid().optional(),
274
+ contentTitle: z.string().trim().optional(),
275
+ contentType: z.enum(["TRACK", "ALBUM", "PLAYLIST", "VIDEO"]).optional()
295
276
  },
296
- (args) => asTextPrompt(
297
- [
298
- "Help me plan a release launch using Dynamoi.",
299
- args.artistId ? `Artist ID: ${args.artistId}` : "If no artistId is provided, list artists first.",
300
- args.contentType ? `Content type: ${args.contentType}` : "",
301
- args.contentTitle ? `Title: ${args.contentTitle}` : "",
302
- "",
303
- "Ask any missing questions first (links, creative, budget, countries, dates).",
304
- "For review/demo Smart Campaign launches that already specify the artist, content title, budget, countries, and reusable media assets, you may proceed without asking for spotifyUrl or endDate.",
305
- "When those review/demo fields are omitted, do not invent placeholder spotifyUrl or endDate values; omit them and let Dynamoi infer them.",
306
- "Then propose the simplest campaign plan that fits today\u2019s supported platforms:",
307
- "- Smart Campaign (Meta) for Spotify/Apple Music releases",
308
- "- YouTube campaign for videos",
309
- "",
310
- "If we proceed to launch:",
311
- "- For Smart Campaign: use dynamoi_list_media_assets and then dynamoi_launch_campaign.",
312
- "- For YouTube: use dynamoi_launch_campaign with youtubeVideoId."
313
- ].filter(Boolean).join("\n")
314
- )
315
- );
316
- server.registerPrompt(
317
- "dynamoi_why_campaign_blocked",
318
- {
319
- argsSchema: {
320
- campaignId: z.string().uuid()
321
- },
322
- description: "Diagnose why a campaign is blocked/stuck and recommend the next fix.",
323
- title: "Why Is My Campaign Blocked?"
277
+ description: "Create a pragmatic release launch plan and propose a Dynamoi campaign setup.",
278
+ title: "Release Launch Plan"
279
+ }, (args) => asTextPrompt([
280
+ "Help me plan a release launch using Dynamoi.",
281
+ args.artistId ? `Artist ID: ${args.artistId}` : "If no artistId is provided, list artists first.",
282
+ args.contentType ? `Content type: ${args.contentType}` : "",
283
+ args.contentTitle ? `Title: ${args.contentTitle}` : "",
284
+ "",
285
+ "Ask any missing questions first (links, creative, budget, countries, dates).",
286
+ "For review/demo Smart Campaign launches that already specify the artist, content title, budget, countries, and reusable media assets, you may proceed without asking for spotifyUrl or endDate.",
287
+ "When those review/demo fields are omitted, do not invent placeholder spotifyUrl or endDate values; omit them and let Dynamoi infer them.",
288
+ "Then propose the simplest campaign plan that fits today’s supported platforms:",
289
+ "- Smart Campaign (Meta) for Spotify/Apple Music releases",
290
+ "- YouTube campaign for videos",
291
+ "",
292
+ "If we proceed to launch:",
293
+ "- For Smart Campaign: use dynamoi_list_media_assets and then dynamoi_launch_campaign.",
294
+ "- For YouTube: use dynamoi_launch_campaign with youtubeVideoId."
295
+ ].filter(Boolean).join(`
296
+ `)));
297
+ server.registerPrompt("dynamoi_why_campaign_blocked", {
298
+ argsSchema: {
299
+ campaignId: z.string().uuid()
324
300
  },
325
- (args) => asTextPrompt(
326
- [
327
- "My campaign seems blocked or stuck. Diagnose it and tell me what to do next.",
328
- `Campaign ID: ${args.campaignId}`,
329
- "",
330
- "Steps:",
331
- "1. Use dynamoi_get_campaign with includeDeploymentStatus=true to inspect current status and blockers.",
332
- "2. Use dynamoi_get_platform_status for the artist to check Meta/Google connection state.",
333
- "3. If appropriate, suggest safe next actions and confirm before calling dynamoi_update_campaign."
334
- ].join("\n")
335
- )
336
- );
301
+ description: "Diagnose why a campaign is blocked/stuck and recommend the next fix.",
302
+ title: "Why Is My Campaign Blocked?"
303
+ }, (args) => asTextPrompt([
304
+ "My campaign seems blocked or stuck. Diagnose it and tell me what to do next.",
305
+ `Campaign ID: ${args.campaignId}`,
306
+ "",
307
+ "Steps:",
308
+ "1. Use dynamoi_get_campaign with includeDeploymentStatus=true to inspect current status and blockers.",
309
+ "2. Use dynamoi_get_platform_status for the artist to check Meta/Google connection state.",
310
+ "3. If appropriate, suggest safe next actions and confirm before calling dynamoi_update_campaign."
311
+ ].join(`
312
+ `)));
337
313
  }
338
314
 
339
315
  // src/server/resources.ts
@@ -344,276 +320,246 @@ import * as z2 from "zod/v4";
344
320
 
345
321
  // src/server/playbook-resources.ts
346
322
  function registerPlaybookResources(server) {
347
- server.registerResource(
348
- "playbook-spotify-artist",
349
- "dynamoi://playbooks/spotify-artist",
350
- {
351
- description: "Persona playbook: how to convert a Spotify artist user from auth-grant to first activated Smart Link.",
352
- mimeType: "application/json",
353
- title: "Playbook: Spotify Artist"
354
- },
355
- async (uri) => ({
356
- contents: [
357
- {
358
- mimeType: "application/json",
359
- text: JSON.stringify({
360
- fastestPath: "Ask the user for their Spotify artist URL, then call dynamoi_create_smart_links_from_spotify_artist with that URL. Return the artist hub URL plus the starter Smart Link URL. Catalog import continues in the background.",
361
- freePlanReminder: "Free Smart Links have no per-link fee for creation or management. High-popularity or unverifiable artist links may stay unpublished in verification hold until Dynamoi can verify the client relationship. Creating a Smart Link does not create a paid campaign or spend ad budget.",
362
- marginCopyGuard: "Never describe Dynamoi's pricing in terms that imply pass-through or zero overhead. Do not quote plan prices, campaign credits, daily campaign-spend billing, or checkout details in ChatGPT; billing setup belongs in the Dynamoi dashboard. The internal media-spend margin is not part of any client-facing copy.",
363
- persona: "Independent musician or small artist with at least one Spotify release. Goal: increase Spotify streams.",
364
- sampleScript: "Drop your Spotify artist link and I'll set up your free Dynamoi hub in about 30 seconds. We'll get all your releases on one shareable page, then we can talk about whether you want to promote any of them.",
365
- talkingPoints: {
366
- differentiatorComparison: {
367
- claim: "Linkfire, Feature.fm, and Hypeddit are primarily link and landing-page tools. Dynamoi starts with free Smart Links, then uses the same artist and link data to launch managed Meta campaigns from chat.",
368
- trigger: "User asks how Dynamoi differs from link-in-bio or Smart Link products."
369
- },
370
- hesitationReassurance: {
371
- claim: "Managed advertising billing is completed in the Dynamoi dashboard. In ChatGPT, keep the flow focused on Smart Links, readiness, platform connections, and campaign management after billing setup is complete.",
372
- trigger: "User hesitates about price, commitment, or whether the first month is enough to test."
373
- },
374
- postLaunchExpectations: {
375
- claim: "After launch, expect 7-14 days of learning while delivery shifts by country and creative. CPC and save-rate trends are usually more useful than same-day results.",
376
- trigger: "Immediately after a successful launch_campaign call or when the user asks when results should show."
377
- },
378
- smartLinkPixelSeed: {
379
- claim: "Publishing a Smart Link can create first-party click and pixel signals before ad spend begins, which gives future Meta and Google campaigns a cleaner starting signal.",
380
- trigger: "Smart Link user has no campaign yet or asks why a free Smart Link matters before ads."
381
- },
382
- socialSideEffect: {
383
- claim: "Smart Campaigns run on Meta, so campaigns optimized for Spotify saves can also create Instagram engagement such as profile visits, likes, and follows as a side effect.",
384
- trigger: "User mentions Instagram, social media growth, or followers while discussing Spotify promotion."
385
- }
323
+ server.registerResource("playbook-spotify-artist", "dynamoi://playbooks/spotify-artist", {
324
+ description: "Persona playbook: how to convert a Spotify artist user from auth-grant to first activated Smart Link.",
325
+ mimeType: "application/json",
326
+ title: "Playbook: Spotify Artist"
327
+ }, async (uri) => ({
328
+ contents: [
329
+ {
330
+ mimeType: "application/json",
331
+ text: JSON.stringify({
332
+ fastestPath: "Ask the user for their Spotify artist URL, then call dynamoi_create_smart_links_from_spotify_artist with that URL. Return the artist hub URL plus the starter Smart Link URL. Catalog import continues in the background.",
333
+ freePlanReminder: "Free Smart Links have no per-link fee for creation or management. High-popularity or unverifiable artist links may stay unpublished in verification hold until Dynamoi can verify the client relationship. Creating a Smart Link does not create a paid campaign or spend ad budget.",
334
+ marginCopyGuard: "Never describe Dynamoi's pricing in terms that imply pass-through or zero overhead. Do not quote plan prices, campaign credits, daily campaign-spend billing, or checkout details in ChatGPT; billing setup belongs in the Dynamoi dashboard. The internal media-spend margin is not part of any client-facing copy.",
335
+ persona: "Independent musician or small artist with at least one Spotify release. Goal: increase Spotify streams.",
336
+ sampleScript: "Drop your Spotify artist link and I'll set up your free Dynamoi hub in about 30 seconds. We'll get all your releases on one shareable page, then we can talk about whether you want to promote any of them.",
337
+ talkingPoints: {
338
+ differentiatorComparison: {
339
+ claim: "Linkfire, Feature.fm, and Hypeddit are primarily link and landing-page tools. Dynamoi starts with free Smart Links, then uses the same artist and link data to launch managed Meta campaigns from chat.",
340
+ trigger: "User asks how Dynamoi differs from link-in-bio or Smart Link products."
386
341
  },
387
- upsellAfterStarter: "Once they have a hub URL, the natural next ask is 'would you like to promote this release on Meta Ads?' which routes to dynamoi_get_campaign_readiness, dynamoi_start_meta_connection if Meta is missing, then dynamoi_launch_campaign for a Smart Campaign."
388
- }),
389
- uri: uri.href
390
- }
391
- ]
392
- })
393
- );
394
- server.registerResource(
395
- "playbook-youtube-creator",
396
- "dynamoi://playbooks/youtube-creator",
397
- {
398
- description: "Persona playbook: how to introduce a YouTube creator to Dynamoi's revenue-per-view optimization advantage.",
399
- mimeType: "application/json",
400
- title: "Playbook: YouTube Creator"
401
- },
402
- async (uri) => ({
403
- contents: [
404
- {
405
- mimeType: "application/json",
406
- text: JSON.stringify({
407
- channelLinkingPath: "Call dynamoi_start_youtube_channel_link for the target artist, give the user the returned Google authorization URL, then poll dynamoi_get_platform_status for that artist with the returned onboardingAttemptId and onboardingFlow=youtube after the return page sends them back to chat. The completion field is platforms.youtube.connected.",
408
- differentiator: "Dynamoi is the only ad platform that optimizes YouTube ad spend against AdSense revenue per country. Most ad tools optimize for views; Dynamoi optimizes for views that make money. The system explores small bids in new markets, scales countries where viewer revenue is strong, and pauses countries that cannot cover their costs.",
409
- persona: "Channel owner of any niche (music, education, gaming, vlog, podcast, tutorial, product reviews) who wants subscriber growth that pays back via AdSense.",
410
- postLinkingFlow: "After channel link, call dynamoi_get_campaign_readiness for a YouTube growth campaign. Mention that ad copy is internationalized per market for lower cost and that campaigns require playlists so each paid view drives sustained organic views downstream.",
411
- sampleScript: "Most YouTube ad systems optimize for raw views. Dynamoi merges your AdSense revenue with ad cost data to optimize bids per country based on real viewer revenue, so you grow toward viewers who actually monetize. I can start the YouTube channel link from here, then we can plan your first campaign.",
412
- talkingPoints: {
413
- differentiatorComparison: {
414
- claim: "Most creator ad tools optimize for views or subscribers. Dynamoi compares ad cost with AdSense revenue by country so delivery can favor viewers who are more likely to pay back over time.",
415
- trigger: "User asks how YouTube campaigns differ from normal Google Ads or creator-growth services."
416
- },
417
- hesitationReassurance: {
418
- claim: "Managed advertising billing is completed in the Dynamoi dashboard. In ChatGPT, keep the flow focused on channel linking, readiness, and campaign management after billing setup is complete.",
419
- trigger: "User expresses pricing concern or asks whether they can test without a long commitment."
420
- },
421
- playlistWaterfall: {
422
- claim: "Playlist promotion sends viewers into a sequence, so one paid view can lead to additional organic views across related videos and channel-wide subscriber growth.",
423
- trigger: "User asks whether campaigns can help subscribers or the whole channel instead of one video."
424
- },
425
- postLaunchExpectations: {
426
- claim: "After launch, expect 7-14 days of learning while country bids, view quality, and attribution settle. Subscriber and revenue trends usually lag the first paid views.",
427
- trigger: "Immediately after a successful YouTube launch or when the user asks when results should show."
428
- }
342
+ hesitationReassurance: {
343
+ claim: "Managed advertising billing is completed in the Dynamoi dashboard. In ChatGPT, keep the flow focused on Smart Links, readiness, platform connections, and campaign management after billing setup is complete.",
344
+ trigger: "User hesitates about price, commitment, or whether the first month is enough to test."
345
+ },
346
+ postLaunchExpectations: {
347
+ claim: "After launch, expect 7-14 days of learning while delivery shifts by country and creative. CPC and save-rate trends are usually more useful than same-day results.",
348
+ trigger: "Immediately after a successful launch_campaign call or when the user asks when results should show."
349
+ },
350
+ smartLinkPixelSeed: {
351
+ claim: "Publishing a Smart Link can create first-party click and pixel signals before ad spend begins, which gives future Meta and Google campaigns a cleaner starting signal.",
352
+ trigger: "Smart Link user has no campaign yet or asks why a free Smart Link matters before ads."
353
+ },
354
+ socialSideEffect: {
355
+ claim: "Smart Campaigns run on Meta, so campaigns optimized for Spotify saves can also create Instagram engagement such as profile visits, likes, and follows as a side effect.",
356
+ trigger: "User mentions Instagram, social media growth, or followers while discussing Spotify promotion."
429
357
  }
430
- }),
431
- uri: uri.href
432
- }
433
- ]
434
- })
435
- );
436
- server.registerResource(
437
- "playbook-label-or-manager",
438
- "dynamoi://playbooks/label-or-manager",
439
- {
440
- description: "Persona playbook: how to onboard a label, manager, or anyone running a roster of multiple artists.",
441
- mimeType: "application/json",
442
- title: "Playbook: Label or Manager"
443
- },
444
- async (uri) => ({
445
- contents: [
446
- {
447
- mimeType: "application/json",
448
- text: JSON.stringify({
449
- billingNote: "Consolidated billing across all artists in the organization. No per-seat charge, no per-artist fee.",
450
- persona: "Label owner, manager, or distributor handling more than one artist. Goal: oversee promotion across a roster from one account.",
451
- rolesNote: "Dynamoi supports admin, editor, and viewer roles at organization and artist level. Editors can mutate everything except admin management; viewers are read-only.",
452
- sampleScript: "Dynamoi handles rosters: organizations with admin/editor/viewer roles, consolidated billing, and per-artist permissions. To start, create your first artist with a Spotify URL, then invite your team. We can layer in more artists from the same organization once you have one running.",
453
- setupSequence: [
454
- "If they have one artist ready: route to dynamoi://playbooks/spotify-artist for that first artist.",
455
- "After the first artist is set up, mention team invites are managed in the dashboard at /dashboard/settings/organization (no MCP tool yet).",
456
- "Cross-artist analytics are available via dynamoi_get_artist_analytics per artist; a roster-wide rollup is dashboard-only."
457
- ],
458
- talkingPoints: {
459
- consolidatedRoster: {
460
- claim: "One organization can hold multiple artists with admin, editor, and viewer roles, while campaign launch and billing state stay visible per artist.",
461
- trigger: "User says they manage more than one artist or asks whether a label/manager workflow is supported."
462
- },
463
- differentiatorComparison: {
464
- claim: "Traditional Smart Link tools stop at links and analytics. Dynamoi keeps those free, then lets a roster operator move from link to managed campaign launch in the same assistant thread.",
465
- trigger: "User compares Dynamoi to Linkfire, Feature.fm, Hypeddit, or a label marketing stack."
466
- },
467
- hesitationReassurance: {
468
- claim: "Managed advertising billing is completed in the Dynamoi dashboard. In ChatGPT, keep the flow focused on roster setup, readiness checks, and campaign management after billing setup is complete.",
469
- trigger: "User asks whether billing scales per seat or wants to test with one artist first."
470
- }
358
+ },
359
+ upsellAfterStarter: "Once they have a hub URL, the natural next ask is 'would you like to promote this release on Meta Ads?' which routes to dynamoi_get_campaign_readiness, dynamoi_start_meta_connection if Meta is missing, then dynamoi_launch_campaign for a Smart Campaign."
360
+ }),
361
+ uri: uri.href
362
+ }
363
+ ]
364
+ }));
365
+ server.registerResource("playbook-youtube-creator", "dynamoi://playbooks/youtube-creator", {
366
+ description: "Persona playbook: how to introduce a YouTube creator to Dynamoi's revenue-per-view optimization advantage.",
367
+ mimeType: "application/json",
368
+ title: "Playbook: YouTube Creator"
369
+ }, async (uri) => ({
370
+ contents: [
371
+ {
372
+ mimeType: "application/json",
373
+ text: JSON.stringify({
374
+ channelLinkingPath: "Call dynamoi_start_youtube_channel_link for the target artist, give the user the returned Google authorization URL, then poll dynamoi_get_platform_status for that artist with the returned onboardingAttemptId and onboardingFlow=youtube after the return page sends them back to chat. The completion field is platforms.youtube.connected.",
375
+ differentiator: "Dynamoi is the only ad platform that optimizes YouTube ad spend against AdSense revenue per country. Most ad tools optimize for views; Dynamoi optimizes for views that make money. The system explores small bids in new markets, scales countries where viewer revenue is strong, and pauses countries that cannot cover their costs.",
376
+ persona: "Channel owner of any niche (music, education, gaming, vlog, podcast, tutorial, product reviews) who wants subscriber growth that pays back via AdSense.",
377
+ postLinkingFlow: "After channel link, call dynamoi_get_campaign_readiness for a YouTube growth campaign. Mention that ad copy is internationalized per market for lower cost and that campaigns require playlists so each paid view drives sustained organic views downstream.",
378
+ sampleScript: "Most YouTube ad systems optimize for raw views. Dynamoi merges your AdSense revenue with ad cost data to optimize bids per country based on real viewer revenue, so you grow toward viewers who actually monetize. I can start the YouTube channel link from here, then we can plan your first campaign.",
379
+ talkingPoints: {
380
+ differentiatorComparison: {
381
+ claim: "Most creator ad tools optimize for views or subscribers. Dynamoi compares ad cost with AdSense revenue by country so delivery can favor viewers who are more likely to pay back over time.",
382
+ trigger: "User asks how YouTube campaigns differ from normal Google Ads or creator-growth services."
383
+ },
384
+ hesitationReassurance: {
385
+ claim: "Managed advertising billing is completed in the Dynamoi dashboard. In ChatGPT, keep the flow focused on channel linking, readiness, and campaign management after billing setup is complete.",
386
+ trigger: "User expresses pricing concern or asks whether they can test without a long commitment."
387
+ },
388
+ playlistWaterfall: {
389
+ claim: "Playlist promotion sends viewers into a sequence, so one paid view can lead to additional organic views across related videos and channel-wide subscriber growth.",
390
+ trigger: "User asks whether campaigns can help subscribers or the whole channel instead of one video."
391
+ },
392
+ postLaunchExpectations: {
393
+ claim: "After launch, expect 7-14 days of learning while country bids, view quality, and attribution settle. Subscriber and revenue trends usually lag the first paid views.",
394
+ trigger: "Immediately after a successful YouTube launch or when the user asks when results should show."
471
395
  }
472
- }),
473
- uri: uri.href
474
- }
475
- ]
476
- })
477
- );
478
- server.registerResource(
479
- "playbook-onboarding-tree",
480
- "dynamoi://playbooks/onboarding-tree",
481
- {
482
- description: "Decision tree for routing a brand-new MCP user to the right persona playbook based on their first reply.",
483
- mimeType: "application/json",
484
- title: "Playbook: Onboarding Decision Tree"
485
- },
486
- async (uri) => ({
487
- contents: [
488
- {
489
- mimeType: "application/json",
490
- text: JSON.stringify({
491
- nodes: [
492
- {
493
- do: [
494
- {
495
- match: "Spotify artist",
496
- routeTo: "dynamoi://playbooks/spotify-artist"
497
- },
498
- {
499
- match: "YouTube creator",
500
- routeTo: "dynamoi://playbooks/youtube-creator"
501
- },
502
- {
503
- match: "Label / manager / multiple artists",
504
- routeTo: "dynamoi://playbooks/label-or-manager"
505
- }
506
- ],
507
- if: "state.hasAnyArtist === false",
508
- question: "Are you a Spotify artist, a YouTube creator, or running a label/managing a roster?"
509
- },
510
- {
511
- do: "Offer dynamoi_create_smart_link_from_spotify or dynamoi_create_smart_links_from_spotify_artist for the fastest visible win.",
512
- if: "state.hasAnyArtist === true && state.hasAnySmartLink === false"
513
- },
514
- {
515
- do: "Offer dynamoi_get_campaign_readiness to validate launch inputs before creating anything.",
516
- if: "state.hasAnyArtist === true && state.hasAnyActiveCampaign === false"
517
- },
518
- {
519
- do: "Tell the user managed-advertising billing setup must happen in the Dynamoi dashboard, not through a ChatGPT checkout link. After they start or restore billing there, poll dynamoi_get_billing for that artist to confirm billing is active.",
520
- if: "state.hasAnyArtist === true && billing is the launch blocker"
521
- },
522
- {
523
- do: "Offer dynamoi_start_meta_connection for the target artist, then poll dynamoi_get_platform_status for that artist with the returned onboardingAttemptId and onboardingFlow=meta after Meta returns them to chat. The completion field is platforms.meta.status.",
524
- if: "state.hasAnyArtist === true && user wants Spotify Smart Campaigns && state.hasAnyConnectedMeta === false"
525
- },
526
- {
527
- do: "Offer dynamoi_start_youtube_channel_link for the target artist, then poll dynamoi_get_platform_status for that artist with the returned onboardingAttemptId and onboardingFlow=youtube after Google returns them to chat. The completion field is platforms.youtube.connected.",
528
- if: "state.hasAnyArtist === true && user wants YouTube growth && state.hasAnyConnectedYoutube === false"
529
- },
530
- {
531
- do: "Ask whether they want a performance summary, a new campaign, or to update an existing campaign.",
532
- if: "state.hasAnyActiveCampaign === true"
533
- }
534
- ],
535
- source: "This tree mirrors dynamoi_get_account_overview.recommendedNextActions. Use either; the tree is for explaining the plan to the user, the array is for deciding the next tool call.",
536
- talkingPoints: {
537
- creatorFirstChoice: {
538
- claim: "Spotify artists should start from a Spotify artist URL; YouTube creators should start by linking a channel; labels and managers should pick one artist as the first setup path.",
539
- trigger: "Brand-new user has no artists and asks what to do first."
540
- },
541
- postLaunchExpectations: {
542
- claim: "Campaigns need 7-14 days of learning before judging performance. Early reads should focus on blockers, delivery status, spend, CPC, and whether attribution is flowing.",
543
- trigger: "User asks what happens after launch or whether a first-day result is good or bad."
544
- },
545
- smartLinkBeforeAds: {
546
- claim: "A free Smart Link is the fastest visible setup step because it produces a public asset, starts catalog context, and creates a natural handoff into campaign readiness.",
547
- trigger: "User has an artist but no Smart Link or asks why the assistant recommends links before ads."
548
- }
396
+ }
397
+ }),
398
+ uri: uri.href
399
+ }
400
+ ]
401
+ }));
402
+ server.registerResource("playbook-label-or-manager", "dynamoi://playbooks/label-or-manager", {
403
+ description: "Persona playbook: how to onboard a label, manager, or anyone running a roster of multiple artists.",
404
+ mimeType: "application/json",
405
+ title: "Playbook: Label or Manager"
406
+ }, async (uri) => ({
407
+ contents: [
408
+ {
409
+ mimeType: "application/json",
410
+ text: JSON.stringify({
411
+ billingNote: "Consolidated billing across all artists in the organization. No per-seat charge, no per-artist fee.",
412
+ persona: "Label owner, manager, or distributor handling more than one artist. Goal: oversee promotion across a roster from one account.",
413
+ rolesNote: "Dynamoi supports admin, editor, and viewer roles at organization and artist level. Editors can mutate everything except admin management; viewers are read-only.",
414
+ sampleScript: "Dynamoi handles rosters: organizations with admin/editor/viewer roles, consolidated billing, and per-artist permissions. To start, create your first artist with a Spotify URL, then invite your team. We can layer in more artists from the same organization once you have one running.",
415
+ setupSequence: [
416
+ "If they have one artist ready: route to dynamoi://playbooks/spotify-artist for that first artist.",
417
+ "After the first artist is set up, mention team invites are managed in the dashboard at /dashboard/settings/organization (no MCP tool yet).",
418
+ "Cross-artist analytics are available via dynamoi_get_artist_analytics per artist; a roster-wide rollup is dashboard-only."
419
+ ],
420
+ talkingPoints: {
421
+ consolidatedRoster: {
422
+ claim: "One organization can hold multiple artists with admin, editor, and viewer roles, while campaign launch and billing state stay visible per artist.",
423
+ trigger: "User says they manage more than one artist or asks whether a label/manager workflow is supported."
424
+ },
425
+ differentiatorComparison: {
426
+ claim: "Traditional Smart Link tools stop at links and analytics. Dynamoi keeps those free, then lets a roster operator move from link to managed campaign launch in the same assistant thread.",
427
+ trigger: "User compares Dynamoi to Linkfire, Feature.fm, Hypeddit, or a label marketing stack."
428
+ },
429
+ hesitationReassurance: {
430
+ claim: "Managed advertising billing is completed in the Dynamoi dashboard. In ChatGPT, keep the flow focused on roster setup, readiness checks, and campaign management after billing setup is complete.",
431
+ trigger: "User asks whether billing scales per seat or wants to test with one artist first."
549
432
  }
550
- }),
551
- uri: uri.href
552
- }
553
- ]
554
- })
555
- );
433
+ }
434
+ }),
435
+ uri: uri.href
436
+ }
437
+ ]
438
+ }));
439
+ server.registerResource("playbook-onboarding-tree", "dynamoi://playbooks/onboarding-tree", {
440
+ description: "Decision tree for routing a brand-new MCP user to the right persona playbook based on their first reply.",
441
+ mimeType: "application/json",
442
+ title: "Playbook: Onboarding Decision Tree"
443
+ }, async (uri) => ({
444
+ contents: [
445
+ {
446
+ mimeType: "application/json",
447
+ text: JSON.stringify({
448
+ nodes: [
449
+ {
450
+ do: [
451
+ {
452
+ match: "Spotify artist",
453
+ routeTo: "dynamoi://playbooks/spotify-artist"
454
+ },
455
+ {
456
+ match: "YouTube creator",
457
+ routeTo: "dynamoi://playbooks/youtube-creator"
458
+ },
459
+ {
460
+ match: "Label / manager / multiple artists",
461
+ routeTo: "dynamoi://playbooks/label-or-manager"
462
+ }
463
+ ],
464
+ if: "state.hasAnyArtist === false",
465
+ question: "Are you a Spotify artist, a YouTube creator, or running a label/managing a roster?"
466
+ },
467
+ {
468
+ do: "Offer dynamoi_create_smart_link_from_spotify or dynamoi_create_smart_links_from_spotify_artist for the fastest visible win.",
469
+ if: "state.hasAnyArtist === true && state.hasAnySmartLink === false"
470
+ },
471
+ {
472
+ do: "Offer dynamoi_get_campaign_readiness to validate launch inputs before creating anything.",
473
+ if: "state.hasAnyArtist === true && state.hasAnyActiveCampaign === false"
474
+ },
475
+ {
476
+ do: "Tell the user managed-advertising billing setup must happen in the Dynamoi dashboard, not through a ChatGPT checkout link. After they start or restore billing there, poll dynamoi_get_billing for that artist to confirm billing is active.",
477
+ if: "state.hasAnyArtist === true && billing is the launch blocker"
478
+ },
479
+ {
480
+ do: "Offer dynamoi_start_meta_connection for the target artist, then poll dynamoi_get_platform_status for that artist with the returned onboardingAttemptId and onboardingFlow=meta after Meta returns them to chat. The completion field is platforms.meta.status.",
481
+ if: "state.hasAnyArtist === true && user wants Spotify Smart Campaigns && state.hasAnyConnectedMeta === false"
482
+ },
483
+ {
484
+ do: "Offer dynamoi_start_youtube_channel_link for the target artist, then poll dynamoi_get_platform_status for that artist with the returned onboardingAttemptId and onboardingFlow=youtube after Google returns them to chat. The completion field is platforms.youtube.connected.",
485
+ if: "state.hasAnyArtist === true && user wants YouTube growth && state.hasAnyConnectedYoutube === false"
486
+ },
487
+ {
488
+ do: "Ask whether they want a performance summary, a new campaign, or to update an existing campaign.",
489
+ if: "state.hasAnyActiveCampaign === true"
490
+ }
491
+ ],
492
+ source: "This tree mirrors dynamoi_get_account_overview.recommendedNextActions. Use either; the tree is for explaining the plan to the user, the array is for deciding the next tool call.",
493
+ talkingPoints: {
494
+ creatorFirstChoice: {
495
+ claim: "Spotify artists should start from a Spotify artist URL; YouTube creators should start by linking a channel; labels and managers should pick one artist as the first setup path.",
496
+ trigger: "Brand-new user has no artists and asks what to do first."
497
+ },
498
+ postLaunchExpectations: {
499
+ claim: "Campaigns need 7-14 days of learning before judging performance. Early reads should focus on blockers, delivery status, spend, CPC, and whether attribution is flowing.",
500
+ trigger: "User asks what happens after launch or whether a first-day result is good or bad."
501
+ },
502
+ smartLinkBeforeAds: {
503
+ claim: "A free Smart Link is the fastest visible setup step because it produces a public asset, starts catalog context, and creates a natural handoff into campaign readiness.",
504
+ trigger: "User has an artist but no Smart Link or asks why the assistant recommends links before ads."
505
+ }
506
+ }
507
+ }),
508
+ uri: uri.href
509
+ }
510
+ ]
511
+ }));
556
512
  }
557
513
 
558
514
  // src/server/resources.ts
559
515
  function registerDynamoiResources(server, adapter) {
560
- server.registerResource(
561
- "platform-pricing",
562
- "dynamoi://platform/pricing",
563
- {
564
- description: "Dynamoi campaign setup guidance and campaign budget minimums.",
565
- mimeType: "application/json",
566
- title: "Pricing"
567
- },
568
- async (uri) => ({
569
- contents: [
570
- {
571
- mimeType: "application/json",
572
- text: JSON.stringify({
573
- budgetMinimums: {
574
- smartCampaign: {
575
- dailyUsd: 10,
576
- note: "Meta Ads for Spotify promotion",
577
- totalUsd: 100
578
- },
579
- youtube: {
580
- dailyUsd: 10,
581
- note: "Google Ads for YouTube channel growth",
582
- totalUsd: 50
583
- }
584
- },
585
- includes: "Free Smart Links, unlimited team seats, unlimited artists, white-glove support, and campaign landing-page support where available",
586
- managedAdvertising: {
587
- description: "Managed advertising subscription and payment setup happen in the Dynamoi dashboard, outside ChatGPT. This MCP server can check billing readiness after setup, but does not create checkout links or collect payment.",
588
- paymentSetupLocation: "Dynamoi dashboard"
589
- },
590
- noContracts: true
591
- }),
592
- uri: uri.href
593
- }
594
- ]
595
- })
596
- );
597
- server.registerResource(
598
- "platform-content-types",
599
- "dynamoi://platform/content-types",
600
- { mimeType: "application/json", title: "Content Types" },
601
- async (uri) => ({
602
- contents: [
603
- {
604
- mimeType: "application/json",
605
- text: JSON.stringify({
606
- campaignTypes: {
607
- SMART_CAMPAIGN: ["TRACK", "ALBUM", "PLAYLIST"],
608
- YOUTUBE: ["VIDEO"]
516
+ server.registerResource("platform-pricing", "dynamoi://platform/pricing", {
517
+ description: "Dynamoi campaign setup guidance and campaign budget minimums.",
518
+ mimeType: "application/json",
519
+ title: "Pricing"
520
+ }, async (uri) => ({
521
+ contents: [
522
+ {
523
+ mimeType: "application/json",
524
+ text: JSON.stringify({
525
+ budgetMinimums: {
526
+ smartCampaign: {
527
+ dailyUsd: 10,
528
+ note: "Meta Ads for Spotify promotion",
529
+ totalUsd: 50
609
530
  },
610
- contentTypes: ["TRACK", "ALBUM", "PLAYLIST", "VIDEO"]
611
- }),
612
- uri: uri.href
613
- }
614
- ]
615
- })
616
- );
531
+ youtube: {
532
+ dailyUsd: 10,
533
+ note: "Google Ads for YouTube channel growth",
534
+ totalUsd: 50
535
+ }
536
+ },
537
+ includes: "Free Smart Links, unlimited team seats, unlimited artists, white-glove support, and campaign landing-page support where available",
538
+ managedAdvertising: {
539
+ description: "Managed advertising subscription and payment setup happen in the Dynamoi dashboard, outside ChatGPT. This MCP server can check billing readiness after setup, but does not create checkout links or collect payment.",
540
+ paymentSetupLocation: "Dynamoi dashboard"
541
+ },
542
+ noContracts: true
543
+ }),
544
+ uri: uri.href
545
+ }
546
+ ]
547
+ }));
548
+ server.registerResource("platform-content-types", "dynamoi://platform/content-types", { mimeType: "application/json", title: "Content Types" }, async (uri) => ({
549
+ contents: [
550
+ {
551
+ mimeType: "application/json",
552
+ text: JSON.stringify({
553
+ campaignTypes: {
554
+ SMART_CAMPAIGN: ["TRACK", "ALBUM", "PLAYLIST"],
555
+ YOUTUBE: ["VIDEO"]
556
+ },
557
+ contentTypes: ["TRACK", "ALBUM", "PLAYLIST", "VIDEO"]
558
+ }),
559
+ uri: uri.href
560
+ }
561
+ ]
562
+ }));
617
563
  const countryTargetingResource = async (uri) => ({
618
564
  contents: [
619
565
  {
@@ -637,383 +583,318 @@ function registerDynamoiResources(server, adapter) {
637
583
  }
638
584
  ]
639
585
  });
640
- server.registerResource(
641
- "platform-country-targeting",
642
- "dynamoi://platform/country-targeting",
643
- {
644
- description: "Explains Smart Campaign vs YouTube country-targeting catalogs.",
645
- mimeType: "application/json",
646
- title: "Country Targeting"
647
- },
648
- countryTargetingResource
649
- );
650
- server.registerResource(
651
- "platform-supported-countries",
652
- "dynamoi://platform/supported-countries",
653
- {
654
- description: "Legacy alias for country-targeting guidance. Use dynamoi://platform/country-targeting for the canonical resource.",
655
- mimeType: "application/json",
656
- title: "Supported Countries"
657
- },
658
- countryTargetingResource
659
- );
660
- server.registerResource(
661
- "smart-links-free-plan",
662
- "dynamoi://smart-links/free-plan",
663
- {
664
- description: "Canonical explanation of Dynamoi's free Smart Links plan and how it differs from paid managed advertising.",
665
- mimeType: "application/json",
666
- title: "Free Smart Links"
667
- },
668
- async (uri) => ({
669
- contents: [
670
- {
671
- mimeType: "application/json",
672
- text: JSON.stringify({
673
- free: true,
674
- included: [
675
- "Unlimited free Smart Links for supported Spotify artist, album, and track URLs",
676
- "Artist hub pages for catalog-level Smart Links",
677
- "Smart Link analytics",
678
- "Artist-level themes",
679
- "Validated Meta, TikTok, and Google Ads pixel IDs",
680
- "Publish and unpublish controls"
681
- ],
682
- noCatch: "No per-link fee for Smart Link creation or management. High-popularity or unverifiable artist links may stay unpublished in verification hold until Dynamoi can verify the client relationship.",
683
- paidSeparately: "Managed advertising campaigns and ad budgets are separate paid products."
684
- }),
685
- uri: uri.href
686
- }
687
- ]
688
- })
689
- );
690
- server.registerResource(
691
- "smart-links-capabilities",
692
- "dynamoi://smart-links/capabilities",
693
- { mimeType: "application/json", title: "Smart Link Capabilities" },
694
- async (uri) => ({
695
- contents: [
696
- {
697
- mimeType: "application/json",
698
- text: JSON.stringify({
699
- artistCatalogWorkflow: "Use dynamoi_create_smart_links_from_spotify_artist for Spotify artist URLs when the user wants the artist hub, catalog import, or all links. The tool creates/returns a starter link immediately and starts the background catalog import so the user does not need the dashboard.",
700
- creationInputs: {
701
- supportedSpotifyKinds: ["artist", "album", "track"],
702
- unsupportedToday: ["playlist"]
703
- },
704
- mutableFields: {
705
- artistLevel: [
706
- "defaultTheme",
707
- "metaPixelId",
708
- "tiktokPixelId",
709
- "googleAdsConversionId"
710
- ],
711
- perLink: ["customDescription", "publishState"]
712
- },
713
- pixelPolicy: "Only validated pixel IDs are accepted. Arbitrary JavaScript, tag snippets, and script URLs are not supported.",
714
- themes: ["classic", "brutalist", "aurora", "cinematic"]
715
- }),
716
- uri: uri.href
717
- }
718
- ]
719
- })
720
- );
721
- server.registerResource(
722
- "business-free-vs-paid",
723
- "dynamoi://business/free-vs-paid",
724
- {
725
- description: "Clear boundary between free Dynamoi Smart Links and paid managed advertising.",
726
- mimeType: "application/json",
727
- title: "Free Smart Links vs Paid Campaigns"
728
- },
729
- async (uri) => ({
730
- contents: [
731
- {
732
- mimeType: "application/json",
733
- text: JSON.stringify({
734
- agentGuidance: "Do not imply that a Smart Link creates an ad campaign. Do not imply that campaign budgets are free.",
735
- freeSmartLinks: {
736
- claim: "Smart Links are free to create and manage. High-popularity or unverifiable artist links may require verification before public publishing.",
737
- useFor: "Spotify landing pages, public release links, link sharing, basic link analytics, artist-level themes, and validated pixel IDs."
738
- },
739
- managedAdvertising: {
740
- paid: true,
741
- pricing: "Billing and payment setup happen in the Dynamoi dashboard, outside ChatGPT.",
742
- useFor: "Managed Meta and Google ad campaigns for Spotify promotion and YouTube channel growth."
743
- }
744
- }),
745
- uri: uri.href
746
- }
747
- ]
748
- })
749
- );
750
- server.registerResource(
751
- "smart-links-agent-guide",
752
- "dynamoi://smart-links/agent-guide",
753
- {
754
- description: "How agents should answer Smart Link questions using Dynamoi MCP tools.",
755
- mimeType: "application/json",
756
- title: "Smart Link Agent Guide"
757
- },
758
- async (uri) => ({
759
- contents: [
760
- {
761
- mimeType: "application/json",
762
- text: JSON.stringify({
763
- answerWith: [
764
- "artist hub URL when present",
765
- "release title",
766
- "artist name",
767
- "public URL",
768
- "publish/live status",
769
- "one next action when relevant"
770
- ],
771
- avoidByDefault: [
772
- "internal UUIDs",
773
- "database model names",
774
- "workflow IDs",
775
- "provider implementation details"
586
+ server.registerResource("platform-country-targeting", "dynamoi://platform/country-targeting", {
587
+ description: "Explains Smart Campaign vs YouTube country-targeting catalogs.",
588
+ mimeType: "application/json",
589
+ title: "Country Targeting"
590
+ }, countryTargetingResource);
591
+ server.registerResource("platform-supported-countries", "dynamoi://platform/supported-countries", {
592
+ description: "Legacy alias for country-targeting guidance. Use dynamoi://platform/country-targeting for the canonical resource.",
593
+ mimeType: "application/json",
594
+ title: "Supported Countries"
595
+ }, countryTargetingResource);
596
+ server.registerResource("smart-links-free-plan", "dynamoi://smart-links/free-plan", {
597
+ description: "Canonical explanation of Dynamoi's free Smart Links plan and how it differs from paid managed advertising.",
598
+ mimeType: "application/json",
599
+ title: "Free Smart Links"
600
+ }, async (uri) => ({
601
+ contents: [
602
+ {
603
+ mimeType: "application/json",
604
+ text: JSON.stringify({
605
+ free: true,
606
+ included: [
607
+ "Unlimited free Smart Links for supported Spotify artist, album, and track URLs",
608
+ "Artist hub pages for catalog-level Smart Links",
609
+ "Smart Link analytics",
610
+ "Artist-level themes",
611
+ "Validated Meta, TikTok, and Google Ads pixel IDs",
612
+ "Artist-level public availability controls"
613
+ ],
614
+ noCatch: "No per-link fee for Smart Link creation or management. High-popularity or unverifiable artist links may stay unpublished in verification hold until Dynamoi can verify the client relationship.",
615
+ paidSeparately: "Managed advertising campaigns and ad budgets are separate paid products."
616
+ }),
617
+ uri: uri.href
618
+ }
619
+ ]
620
+ }));
621
+ server.registerResource("smart-links-capabilities", "dynamoi://smart-links/capabilities", { mimeType: "application/json", title: "Smart Link Capabilities" }, async (uri) => ({
622
+ contents: [
623
+ {
624
+ mimeType: "application/json",
625
+ text: JSON.stringify({
626
+ artistCatalogWorkflow: "Use dynamoi_create_smart_links_from_spotify_artist for Spotify artist URLs when the user wants the artist hub, catalog import, or all links. The tool creates/returns a starter link immediately and starts the background catalog import so the user does not need the dashboard.",
627
+ creationInputs: {
628
+ supportedSpotifyKinds: ["artist", "album", "track"],
629
+ unsupportedToday: ["playlist"]
630
+ },
631
+ mutableFields: {
632
+ artistLevel: [
633
+ "defaultTheme",
634
+ "metaPixelId",
635
+ "tiktokPixelId",
636
+ "googleAdsConversionId"
776
637
  ],
777
- whenToUse: "Use Smart Link tools when the user asks for free release links, artist hubs, full-catalog Spotify landing pages, streaming landing pages, Spotify link pages, Smart Link analytics, themes, pixels, publish state, or public URLs."
778
- }),
779
- uri: uri.href
780
- }
781
- ]
782
- })
783
- );
784
- server.registerResource(
785
- "mcp-tool-answering-rules",
786
- "dynamoi://mcp/tool-answering-rules",
787
- {
788
- description: "General answer rules for Dynamoi MCP tools so agents stop after useful results.",
789
- mimeType: "application/json",
790
- title: "MCP Tool Answering Rules"
791
- },
792
- async (uri) => ({
793
- contents: [
794
- {
795
- mimeType: "application/json",
796
- text: JSON.stringify({
797
- emptyStateRule: "Always call dynamoi_get_account_overview first for routing. If list_artists, list_campaigns, list_smart_links, or search return empty for a brand-new user, do not respond 'no records found' as a terminal answer; consult dynamoi_get_account_overview.recommendedNextActions or dynamoi://playbooks/onboarding-tree.",
798
- genericAdvice: "Answer generic music marketing questions directly unless the user asks about their Dynamoi account or asks Dynamoi to take an action.",
799
- stopRule: "If a read tool already returns the requested fact in summary form, answer the user instead of chaining more read tools.",
800
- userFacingFields: "Prefer names, public URLs, statuses, money display values, and next actions over internal IDs.",
801
- writeRule: "Before write tools, confirm what will change. After success, answer from the returned record."
802
- }),
803
- uri: uri.href
804
- }
805
- ]
806
- })
807
- );
638
+ perLink: ["customDescription"]
639
+ },
640
+ pixelPolicy: "Only validated pixel IDs are accepted. Arbitrary JavaScript, tag snippets, and script URLs are not supported.",
641
+ themes: ["classic", "brutalist", "aurora", "cinematic"]
642
+ }),
643
+ uri: uri.href
644
+ }
645
+ ]
646
+ }));
647
+ server.registerResource("business-free-vs-paid", "dynamoi://business/free-vs-paid", {
648
+ description: "Clear boundary between free Dynamoi Smart Links and paid managed advertising.",
649
+ mimeType: "application/json",
650
+ title: "Free Smart Links vs Paid Campaigns"
651
+ }, async (uri) => ({
652
+ contents: [
653
+ {
654
+ mimeType: "application/json",
655
+ text: JSON.stringify({
656
+ agentGuidance: "Do not imply that a Smart Link creates an ad campaign. Do not imply that campaign budgets are free.",
657
+ freeSmartLinks: {
658
+ claim: "Smart Links are free to create and manage. High-popularity or unverifiable artist links may require verification before public publishing.",
659
+ useFor: "Spotify landing pages, public release links, link sharing, basic link analytics, artist-level themes, and validated pixel IDs."
660
+ },
661
+ managedAdvertising: {
662
+ paid: true,
663
+ pricing: "Billing and payment setup happen in the Dynamoi dashboard, outside ChatGPT.",
664
+ useFor: "Managed Meta and Google ad campaigns for Spotify promotion and YouTube channel growth."
665
+ }
666
+ }),
667
+ uri: uri.href
668
+ }
669
+ ]
670
+ }));
671
+ server.registerResource("smart-links-agent-guide", "dynamoi://smart-links/agent-guide", {
672
+ description: "How agents should answer Smart Link questions using Dynamoi MCP tools.",
673
+ mimeType: "application/json",
674
+ title: "Smart Link Agent Guide"
675
+ }, async (uri) => ({
676
+ contents: [
677
+ {
678
+ mimeType: "application/json",
679
+ text: JSON.stringify({
680
+ answerWith: [
681
+ "artist hub URL when present",
682
+ "release title",
683
+ "artist name",
684
+ "public URL",
685
+ "public status",
686
+ "one next action when relevant"
687
+ ],
688
+ avoidByDefault: [
689
+ "internal UUIDs",
690
+ "database model names",
691
+ "workflow IDs",
692
+ "provider implementation details"
693
+ ],
694
+ whenToUse: "Use Smart Link tools when the user asks for free release links, artist hubs, full-catalog Spotify landing pages, streaming landing pages, Spotify link pages, Smart Link analytics, themes, pixels, public status, or public URLs."
695
+ }),
696
+ uri: uri.href
697
+ }
698
+ ]
699
+ }));
700
+ server.registerResource("mcp-tool-answering-rules", "dynamoi://mcp/tool-answering-rules", {
701
+ description: "General answer rules for Dynamoi MCP tools so agents stop after useful results.",
702
+ mimeType: "application/json",
703
+ title: "MCP Tool Answering Rules"
704
+ }, async (uri) => ({
705
+ contents: [
706
+ {
707
+ mimeType: "application/json",
708
+ text: JSON.stringify({
709
+ emptyStateRule: "Always call dynamoi_get_account_overview first for routing. If list_artists, list_campaigns, list_smart_links, or search return empty for a brand-new user, do not respond 'no records found' as a terminal answer; consult dynamoi_get_account_overview.recommendedNextActions or dynamoi://playbooks/onboarding-tree.",
710
+ genericAdvice: "Answer generic music marketing questions directly unless the user asks about their Dynamoi account or asks Dynamoi to take an action.",
711
+ stopRule: "If a read tool already returns the requested fact in summary form, answer the user instead of chaining more read tools.",
712
+ userFacingFields: "Prefer names, public URLs, statuses, money display values, and next actions over internal IDs.",
713
+ writeRule: "Before write tools, confirm what will change. After success, answer from the returned record."
714
+ }),
715
+ uri: uri.href
716
+ }
717
+ ]
718
+ }));
808
719
  registerPlaybookResources(server);
809
- server.registerResource(
810
- "music-marketing-when-to-use-dynamoi",
811
- "dynamoi://music-marketing/when-to-use-dynamoi",
812
- {
813
- description: "When an assistant should use Dynamoi account tools versus answering music marketing questions natively.",
814
- mimeType: "application/json",
815
- title: "When To Use Dynamoi"
816
- },
817
- async (uri) => ({
818
- contents: [
819
- {
820
- mimeType: "application/json",
821
- text: JSON.stringify({
822
- answerNativelyFor: [
823
- "general promotion strategy",
824
- "songwriting, branding, release-planning, or content ideas",
825
- "music marketing education that does not require the user's Dynamoi data"
826
- ],
827
- useToolsFor: [
828
- "finding the user's artists, campaigns, Smart Links, billing, platform connections, or analytics",
829
- "creating or editing free Smart Links",
830
- "confirmed campaign mutations such as pause, resume, budget update, or launch workflow"
831
- ]
832
- }),
833
- uri: uri.href
834
- }
835
- ]
836
- })
837
- );
838
- server.registerResource(
839
- "platform-campaign-statuses",
840
- "dynamoi://platform/campaign-statuses",
841
- { mimeType: "application/json", title: "Campaign Statuses" },
842
- async (uri) => ({
843
- contents: [
844
- {
845
- mimeType: "application/json",
846
- text: JSON.stringify({
847
- statuses: [
848
- "AWAITING_SMART_LINK",
849
- "CONTENT_VALIDATION",
850
- "DEPLOYING",
851
- "READY_FOR_REVIEW",
852
- "ACTIVE",
853
- "PAUSED",
854
- "SUBSCRIPTION_PAUSED",
855
- "FAILED",
856
- "ARCHIVED",
857
- "ENDED"
858
- ]
859
- }),
860
- uri: uri.href
861
- }
862
- ]
863
- })
864
- );
865
- server.registerResource(
866
- "artist-resource",
867
- new ResourceTemplate("dynamoi://artist/{artistId}", {
868
- list: async () => ({ resources: [] })
869
- }),
870
- { mimeType: "application/json", title: "Artist" },
871
- async (uri, variables) => {
872
- const artistId = variables["artistId"];
873
- const parsed = z2.string().uuid().safeParse(artistId);
874
- if (!parsed.success) {
875
- return {
876
- contents: [
877
- {
878
- mimeType: "application/json",
879
- text: JSON.stringify({
880
- message: "Invalid artistId",
881
- status: "error"
882
- }),
883
- uri: uri.href
884
- }
720
+ server.registerResource("music-marketing-when-to-use-dynamoi", "dynamoi://music-marketing/when-to-use-dynamoi", {
721
+ description: "When an assistant should use Dynamoi account tools versus answering music marketing questions natively.",
722
+ mimeType: "application/json",
723
+ title: "When To Use Dynamoi"
724
+ }, async (uri) => ({
725
+ contents: [
726
+ {
727
+ mimeType: "application/json",
728
+ text: JSON.stringify({
729
+ answerNativelyFor: [
730
+ "general promotion strategy",
731
+ "songwriting, branding, release-planning, or content ideas",
732
+ "music marketing education that does not require the user's Dynamoi data"
733
+ ],
734
+ useToolsFor: [
735
+ "finding the user's artists, campaigns, Smart Links, billing, platform connections, or analytics",
736
+ "creating or editing free Smart Links",
737
+ "confirmed campaign mutations such as pause, resume, budget update, or launch workflow"
885
738
  ]
886
- };
739
+ }),
740
+ uri: uri.href
887
741
  }
888
- const envelope = await adapter.getArtist({
889
- artistId: parsed.data
890
- });
742
+ ]
743
+ }));
744
+ server.registerResource("platform-campaign-statuses", "dynamoi://platform/campaign-statuses", { mimeType: "application/json", title: "Campaign Statuses" }, async (uri) => ({
745
+ contents: [
746
+ {
747
+ mimeType: "application/json",
748
+ text: JSON.stringify({
749
+ statuses: [
750
+ "AWAITING_SMART_LINK",
751
+ "CONTENT_VALIDATION",
752
+ "DEPLOYING",
753
+ "READY_FOR_REVIEW",
754
+ "ACTIVE",
755
+ "PAUSED",
756
+ "SUBSCRIPTION_PAUSED",
757
+ "FAILED",
758
+ "ARCHIVED",
759
+ "ENDED"
760
+ ]
761
+ }),
762
+ uri: uri.href
763
+ }
764
+ ]
765
+ }));
766
+ server.registerResource("artist-resource", new ResourceTemplate("dynamoi://artist/{artistId}", {
767
+ list: async () => ({ resources: [] })
768
+ }), { mimeType: "application/json", title: "Artist" }, async (uri, variables) => {
769
+ const artistId = variables["artistId"];
770
+ const parsed = z2.string().uuid().safeParse(artistId);
771
+ if (!parsed.success) {
891
772
  return {
892
773
  contents: [
893
774
  {
894
775
  mimeType: "application/json",
895
- text: JSON.stringify(envelope),
776
+ text: JSON.stringify({
777
+ message: "Invalid artistId",
778
+ status: "error"
779
+ }),
896
780
  uri: uri.href
897
781
  }
898
782
  ]
899
783
  };
900
784
  }
901
- );
902
- server.registerResource(
903
- "campaign-resource",
904
- new ResourceTemplate("dynamoi://campaign/{campaignId}", {
905
- list: async () => ({ resources: [] })
906
- }),
907
- { mimeType: "application/json", title: "Campaign" },
908
- async (uri, variables) => {
909
- const campaignId = variables["campaignId"];
910
- const parsed = z2.string().uuid().safeParse(campaignId);
911
- if (!parsed.success) {
912
- return {
913
- contents: [
914
- {
915
- mimeType: "application/json",
916
- text: JSON.stringify({
917
- message: "Invalid campaignId",
918
- status: "error"
919
- }),
920
- uri: uri.href
921
- }
922
- ]
923
- };
924
- }
925
- const envelope = await adapter.getCampaign({
926
- campaignId: parsed.data
927
- });
785
+ const envelope = await adapter.getArtist({
786
+ artistId: parsed.data
787
+ });
788
+ return {
789
+ contents: [
790
+ {
791
+ mimeType: "application/json",
792
+ text: JSON.stringify(envelope),
793
+ uri: uri.href
794
+ }
795
+ ]
796
+ };
797
+ });
798
+ server.registerResource("campaign-resource", new ResourceTemplate("dynamoi://campaign/{campaignId}", {
799
+ list: async () => ({ resources: [] })
800
+ }), { mimeType: "application/json", title: "Campaign" }, async (uri, variables) => {
801
+ const campaignId = variables["campaignId"];
802
+ const parsed = z2.string().uuid().safeParse(campaignId);
803
+ if (!parsed.success) {
928
804
  return {
929
805
  contents: [
930
806
  {
931
807
  mimeType: "application/json",
932
- text: JSON.stringify(envelope),
808
+ text: JSON.stringify({
809
+ message: "Invalid campaignId",
810
+ status: "error"
811
+ }),
933
812
  uri: uri.href
934
813
  }
935
814
  ]
936
815
  };
937
816
  }
938
- );
939
- server.registerResource(
940
- "smart-link-resource",
941
- new ResourceTemplate("dynamoi://smart-link/{playLinkId}", {
942
- list: async () => ({ resources: [] })
943
- }),
944
- { mimeType: "application/json", title: "Smart Link" },
945
- async (uri, variables) => {
946
- const playLinkId = variables["playLinkId"];
947
- const parsed = z2.string().uuid().safeParse(playLinkId);
948
- if (!parsed.success) {
949
- return {
950
- contents: [
951
- {
952
- mimeType: "application/json",
953
- text: JSON.stringify({
954
- message: "Invalid playLinkId",
955
- status: "error"
956
- }),
957
- uri: uri.href
958
- }
959
- ]
960
- };
961
- }
962
- const envelope = await adapter.getSmartLink({
963
- playLinkId: parsed.data
964
- });
817
+ const envelope = await adapter.getCampaign({
818
+ campaignId: parsed.data
819
+ });
820
+ return {
821
+ contents: [
822
+ {
823
+ mimeType: "application/json",
824
+ text: JSON.stringify(envelope),
825
+ uri: uri.href
826
+ }
827
+ ]
828
+ };
829
+ });
830
+ server.registerResource("smart-link-resource", new ResourceTemplate("dynamoi://smart-link/{playLinkId}", {
831
+ list: async () => ({ resources: [] })
832
+ }), { mimeType: "application/json", title: "Smart Link" }, async (uri, variables) => {
833
+ const playLinkId = variables["playLinkId"];
834
+ const parsed = z2.string().uuid().safeParse(playLinkId);
835
+ if (!parsed.success) {
965
836
  return {
966
837
  contents: [
967
838
  {
968
839
  mimeType: "application/json",
969
- text: JSON.stringify(envelope),
840
+ text: JSON.stringify({
841
+ message: "Invalid playLinkId",
842
+ status: "error"
843
+ }),
970
844
  uri: uri.href
971
845
  }
972
846
  ]
973
847
  };
974
848
  }
975
- );
976
- server.registerResource(
977
- "smart-link-artist-settings-resource",
978
- new ResourceTemplate("dynamoi://artist/{artistId}/smart-link-settings", {
979
- list: async () => ({ resources: [] })
980
- }),
981
- { mimeType: "application/json", title: "Smart Link Artist Settings" },
982
- async (uri, variables) => {
983
- const artistId = variables["artistId"];
984
- const parsed = z2.string().uuid().safeParse(artistId);
985
- if (!parsed.success) {
986
- return {
987
- contents: [
988
- {
989
- mimeType: "application/json",
990
- text: JSON.stringify({
991
- message: "Invalid artistId",
992
- status: "error"
993
- }),
994
- uri: uri.href
995
- }
996
- ]
997
- };
998
- }
999
- const envelope = await adapter.getSmartLinkArtistSettings({
1000
- artistId: parsed.data
1001
- });
849
+ const envelope = await adapter.getSmartLink({
850
+ playLinkId: parsed.data
851
+ });
852
+ return {
853
+ contents: [
854
+ {
855
+ mimeType: "application/json",
856
+ text: JSON.stringify(envelope),
857
+ uri: uri.href
858
+ }
859
+ ]
860
+ };
861
+ });
862
+ server.registerResource("smart-link-artist-settings-resource", new ResourceTemplate("dynamoi://artist/{artistId}/smart-link-settings", {
863
+ list: async () => ({ resources: [] })
864
+ }), { mimeType: "application/json", title: "Smart Link Artist Settings" }, async (uri, variables) => {
865
+ const artistId = variables["artistId"];
866
+ const parsed = z2.string().uuid().safeParse(artistId);
867
+ if (!parsed.success) {
1002
868
  return {
1003
869
  contents: [
1004
870
  {
1005
871
  mimeType: "application/json",
1006
- text: JSON.stringify(envelope),
872
+ text: JSON.stringify({
873
+ message: "Invalid artistId",
874
+ status: "error"
875
+ }),
1007
876
  uri: uri.href
1008
877
  }
1009
878
  ]
1010
879
  };
1011
880
  }
1012
- );
881
+ const envelope = await adapter.getSmartLinkArtistSettings({
882
+ artistId: parsed.data
883
+ });
884
+ return {
885
+ contents: [
886
+ {
887
+ mimeType: "application/json",
888
+ text: JSON.stringify(envelope),
889
+ uri: uri.href
890
+ }
891
+ ]
892
+ };
893
+ });
1013
894
  }
1014
895
 
1015
- // src/server/smart-link-tools.ts
1016
- import * as z5 from "zod/v4";
896
+ // src/server/smart-link-theme-preview.ts
897
+ import * as z4 from "zod/v4";
1017
898
 
1018
899
  // src/server/output-schemas.ts
1019
900
  import * as z3 from "zod/v4";
@@ -1021,11 +902,30 @@ var MoneyDisplayOutputSchema = z3.object({
1021
902
  amountUsd: z3.number(),
1022
903
  formatted: z3.string()
1023
904
  }).strict();
1024
- var ErrorEnvelopeOutputSchema = z3.object({
1025
- kind: z3.enum(["validation", "business", "platform", "unknown"]).optional(),
1026
- message: z3.string(),
1027
- status: z3.literal("error")
1028
- }).strict();
905
+ function createOutputEnvelopeSchema(dataSchema, options) {
906
+ const statuses = options?.allowPartial ? ["success", "partial_success", "error"] : ["success", "error"];
907
+ return z3.object({
908
+ data: dataSchema.optional(),
909
+ kind: z3.enum(["validation", "business", "platform", "unknown"]).optional(),
910
+ message: z3.string().optional(),
911
+ status: z3.enum(statuses)
912
+ }).strict().superRefine((value, context) => {
913
+ if (value.status === "error" && !value.message) {
914
+ context.addIssue({
915
+ code: "custom",
916
+ message: "Error tool results require a message.",
917
+ path: ["message"]
918
+ });
919
+ }
920
+ if (value.status !== "error" && value.data === undefined) {
921
+ context.addIssue({
922
+ code: "custom",
923
+ message: "Successful tool results require data.",
924
+ path: ["data"]
925
+ });
926
+ }
927
+ });
928
+ }
1029
929
  var AnyToolDataOutputSchema = z3.object({}).passthrough();
1030
930
  var MediaAssetSummaryOutputSchema = z3.object({
1031
931
  aspectRatio: z3.string().optional(),
@@ -1087,9 +987,6 @@ var SmartLinkDetailsOutputSchema = SmartLinkSummaryOutputSchema.extend({
1087
987
  customDescription: z3.string().nullable(),
1088
988
  nextActions: z3.array(z3.string()),
1089
989
  originalSpotifyUrl: z3.string().nullable(),
1090
- resourceUri: z3.string(),
1091
- settingsResourceUri: z3.string(),
1092
- spotifyDiscographyId: z3.string(),
1093
990
  summary: z3.string(),
1094
991
  warnings: z3.array(z3.string()).optional()
1095
992
  }).strict();
@@ -1129,9 +1026,7 @@ var SummaryWarningsActionsOutputSchema = z3.object({
1129
1026
  var NormalizedTargetingOutputSchema = z3.union([
1130
1027
  z3.object({ mode: z3.literal("GLOBAL") }).strict(),
1131
1028
  z3.object({
1132
- countries: z3.array(
1133
- z3.object({ code: z3.string(), name: z3.string() }).strict()
1134
- ),
1029
+ countries: z3.array(z3.object({ code: z3.string(), name: z3.string() }).strict()),
1135
1030
  mode: z3.literal("COUNTRIES")
1136
1031
  }).strict()
1137
1032
  ]);
@@ -1148,7 +1043,6 @@ var GetCampaignReadinessDataOutputSchema = z3.object({
1148
1043
  }).strict();
1149
1044
  var CreateSmartLinkFromSpotifyDataOutputSchema = SmartLinkDetailsOutputSchema.extend({
1150
1045
  outcome: z3.enum(["created", "existing"]),
1151
- workflowRunId: z3.string().nullable(),
1152
1046
  workflowWarning: z3.string().nullable()
1153
1047
  }).strict();
1154
1048
  var CreateSmartLinksFromSpotifyArtistDataOutputSchema = z3.object({
@@ -1157,10 +1051,8 @@ var CreateSmartLinksFromSpotifyArtistDataOutputSchema = z3.object({
1157
1051
  artistId: z3.string(),
1158
1052
  artistName: z3.string(),
1159
1053
  catalogImportStatus: z3.enum(["started", "start_failed"]),
1160
- catalogWorkflowRunId: z3.string().nullable(),
1161
1054
  currentSmartLinkCount: z3.number(),
1162
1055
  existingCount: z3.number(),
1163
- initialRenderRunId: z3.string().nullable(),
1164
1056
  initialSmartLink: SmartLinkSummaryOutputSchema.nullable(),
1165
1057
  newlyAvailableCount: z3.number(),
1166
1058
  nextActions: z3.array(z3.string()),
@@ -1183,92 +1075,300 @@ var LaunchCampaignDataOutputSchema = z3.object({
1183
1075
  summary: z3.string(),
1184
1076
  warnings: z3.array(z3.string()).optional()
1185
1077
  }).strict();
1186
- var AnyOutputEnvelopeSchema = z3.union([
1187
- z3.object({ data: AnyToolDataOutputSchema, status: z3.literal("success") }),
1188
- z3.object({
1189
- data: AnyToolDataOutputSchema,
1190
- message: z3.string(),
1191
- status: z3.literal("partial_success")
1192
- }),
1193
- ErrorEnvelopeOutputSchema
1194
- ]);
1195
- var ListMediaAssetsOutputEnvelopeSchema = z3.union([
1196
- z3.object({
1197
- data: z3.union([
1198
- ListMediaAssetsDataOutputSchema,
1199
- ListMediaAssetsSummaryOutputSchema
1200
- ]),
1201
- status: z3.literal("success")
1202
- }),
1203
- ErrorEnvelopeOutputSchema
1204
- ]);
1205
- var LaunchCampaignOutputEnvelopeSchema = z3.union([
1206
- z3.object({
1207
- data: LaunchCampaignDataOutputSchema,
1208
- status: z3.literal("success")
1209
- }),
1210
- ErrorEnvelopeOutputSchema
1211
- ]);
1212
- var ListAvailableCountriesOutputEnvelopeSchema = z3.union([
1213
- z3.object({
1214
- data: z3.union([
1215
- ListAvailableCountriesDataOutputSchema,
1216
- SummaryCountOutputSchema
1217
- ]),
1218
- status: z3.literal("success")
1219
- }),
1220
- ErrorEnvelopeOutputSchema
1221
- ]);
1222
- var GetCampaignReadinessOutputEnvelopeSchema = z3.union([
1223
- z3.object({
1224
- data: z3.union([
1225
- GetCampaignReadinessDataOutputSchema,
1226
- SummaryWarningsActionsOutputSchema
1227
- ]),
1228
- status: z3.literal("success")
1229
- }),
1230
- ErrorEnvelopeOutputSchema
1231
- ]);
1232
- var CreateSmartLinkFromSpotifyOutputEnvelopeSchema = z3.union([
1233
- z3.object({
1234
- data: CreateSmartLinkFromSpotifyDataOutputSchema,
1235
- status: z3.literal("success")
1236
- }),
1237
- ErrorEnvelopeOutputSchema
1238
- ]);
1239
- var CreateSmartLinksFromSpotifyArtistOutputEnvelopeSchema = z3.union([
1240
- z3.object({
1241
- data: CreateSmartLinksFromSpotifyArtistDataOutputSchema,
1242
- status: z3.literal("success")
1243
- }),
1244
- ErrorEnvelopeOutputSchema
1245
- ]);
1246
- var ListSmartLinksOutputEnvelopeSchema = z3.union([
1247
- z3.object({
1248
- data: z3.union([
1249
- ListSmartLinksDataOutputSchema,
1250
- ListSmartLinksSummaryOutputSchema
1251
- ]),
1252
- status: z3.literal("success")
1253
- }),
1254
- ErrorEnvelopeOutputSchema
1255
- ]);
1078
+ var AnyOutputEnvelopeSchema = createOutputEnvelopeSchema(AnyToolDataOutputSchema, { allowPartial: true });
1079
+ var ListMediaAssetsOutputEnvelopeSchema = createOutputEnvelopeSchema(z3.union([
1080
+ ListMediaAssetsDataOutputSchema,
1081
+ ListMediaAssetsSummaryOutputSchema
1082
+ ]));
1083
+ var LaunchCampaignOutputEnvelopeSchema = createOutputEnvelopeSchema(LaunchCampaignDataOutputSchema);
1084
+ var ListAvailableCountriesOutputEnvelopeSchema = createOutputEnvelopeSchema(z3.union([ListAvailableCountriesDataOutputSchema, SummaryCountOutputSchema]));
1085
+ var GetCampaignReadinessOutputEnvelopeSchema = createOutputEnvelopeSchema(z3.union([
1086
+ GetCampaignReadinessDataOutputSchema,
1087
+ SummaryWarningsActionsOutputSchema
1088
+ ]));
1089
+ var CreateSmartLinkFromSpotifyOutputEnvelopeSchema = createOutputEnvelopeSchema(CreateSmartLinkFromSpotifyDataOutputSchema);
1090
+ var CreateSmartLinksFromSpotifyArtistOutputEnvelopeSchema = createOutputEnvelopeSchema(CreateSmartLinksFromSpotifyArtistDataOutputSchema);
1091
+ var ListSmartLinksOutputEnvelopeSchema = createOutputEnvelopeSchema(z3.union([ListSmartLinksDataOutputSchema, ListSmartLinksSummaryOutputSchema]));
1092
+
1093
+ // src/server/smart-link-theme-preview.ts
1094
+ var SMART_LINK_THEME_PREVIEW_RESOURCE_URI = "ui://dynamoi/smart-link-theme-preview-v1.html";
1095
+ var SampleTextSchema = z4.string().trim().min(1).max(80);
1096
+ var DynamoiPreviewSmartLinkThemesInputSchema = z4.object({
1097
+ artistName: SampleTextSchema.optional(),
1098
+ releaseTitle: SampleTextSchema.optional()
1099
+ }).strict();
1100
+ var SMART_LINK_THEME_PREVIEW_TOOL_DEFINITION = {
1101
+ description: "Use this when the user asks what Dynamoi Smart Link pages can look like, wants to compare Smart Link themes, or asks to preview the available themes before creating or updating a free Smart Link. This is a read-only visual preview and does not create, publish, update, or promote a Smart Link.",
1102
+ destructiveHint: false,
1103
+ name: "dynamoi_preview_smart_link_themes",
1104
+ openWorldHint: false,
1105
+ outputSchema: AnyOutputEnvelopeSchema,
1106
+ readOnlyHint: true,
1107
+ schema: DynamoiPreviewSmartLinkThemesInputSchema,
1108
+ title: "Preview Smart Link Themes"
1109
+ };
1110
+ function previewSmartLinkThemes(rawInput) {
1111
+ const input = DynamoiPreviewSmartLinkThemesInputSchema.parse(rawInput ?? {});
1112
+ const artistName = input.artistName ?? "Dynamoi Artist";
1113
+ const releaseTitle = input.releaseTitle ?? "New Single";
1114
+ const themes = [
1115
+ {
1116
+ accentColor: "#2ef2a2",
1117
+ backgroundColor: "#f8f6ef",
1118
+ description: "Clean editorial layout for release pages that should feel calm and polished.",
1119
+ id: "classic",
1120
+ name: "Classic",
1121
+ textColor: "#171717"
1122
+ },
1123
+ {
1124
+ accentColor: "#ffe45c",
1125
+ backgroundColor: "#111111",
1126
+ description: "Bold, poster-like treatment for artists who want sharp contrast and direct calls to action.",
1127
+ id: "brutalist",
1128
+ name: "Brutalist",
1129
+ textColor: "#f5f5f5"
1130
+ },
1131
+ {
1132
+ accentColor: "#73f7ff",
1133
+ backgroundColor: "#12172f",
1134
+ description: "Color-rich gradient atmosphere for pop, electronic, and high-energy releases.",
1135
+ id: "aurora",
1136
+ name: "Aurora",
1137
+ textColor: "#f8fbff"
1138
+ },
1139
+ {
1140
+ accentColor: "#ffb36b",
1141
+ backgroundColor: "#191512",
1142
+ description: "Moody cover-forward layout for cinematic, intimate, or premium release moments.",
1143
+ id: "cinematic",
1144
+ name: "Cinematic",
1145
+ textColor: "#fff6eb"
1146
+ }
1147
+ ];
1148
+ return {
1149
+ data: {
1150
+ artistName,
1151
+ releaseTitle,
1152
+ summary: "Dynamoi Smart Links support four visual themes: Classic, Brutalist, Aurora, and Cinematic.",
1153
+ themes,
1154
+ widgetResourceUri: SMART_LINK_THEME_PREVIEW_RESOURCE_URI
1155
+ },
1156
+ status: "success"
1157
+ };
1158
+ }
1159
+ var SMART_LINK_THEME_PREVIEW_HTML = `
1160
+ <div class="shell">
1161
+ <header>
1162
+ <p class="eyebrow">Smart Link themes</p>
1163
+ <h1 id="title">New Single</h1>
1164
+ <p id="artist">Dynamoi Artist</p>
1165
+ </header>
1166
+ <section id="themes" class="themes" aria-label="Smart Link theme previews"></section>
1167
+ </div>
1168
+ <script>
1169
+ const fallback = {
1170
+ artistName: "Dynamoi Artist",
1171
+ releaseTitle: "New Single",
1172
+ themes: [
1173
+ { id: "classic", name: "Classic", description: "Clean editorial layout for release pages that should feel calm and polished.", backgroundColor: "#f8f6ef", textColor: "#171717", accentColor: "#2ef2a2" },
1174
+ { id: "brutalist", name: "Brutalist", description: "Bold, poster-like treatment for artists who want sharp contrast and direct calls to action.", backgroundColor: "#111111", textColor: "#f5f5f5", accentColor: "#ffe45c" },
1175
+ { id: "aurora", name: "Aurora", description: "Color-rich gradient atmosphere for pop, electronic, and high-energy releases.", backgroundColor: "#12172f", textColor: "#f8fbff", accentColor: "#73f7ff" },
1176
+ { id: "cinematic", name: "Cinematic", description: "Moody cover-forward layout for cinematic, intimate, or premium release moments.", backgroundColor: "#191512", textColor: "#fff6eb", accentColor: "#ffb36b" }
1177
+ ]
1178
+ };
1179
+ function normalize(output) {
1180
+ const candidate = output?.data ?? output?.structuredContent?.data ?? output?.structuredContent ?? output;
1181
+ return candidate?.themes ? candidate : fallback;
1182
+ }
1183
+ function render(output) {
1184
+ const data = normalize(output);
1185
+ document.getElementById("title").textContent = data.releaseTitle ?? fallback.releaseTitle;
1186
+ document.getElementById("artist").textContent = data.artistName ?? fallback.artistName;
1187
+ const themes = Array.isArray(data.themes) ? data.themes : fallback.themes;
1188
+ const allowedThemeIds = new Set(["classic", "brutalist", "aurora", "cinematic"]);
1189
+ document.getElementById("themes").replaceChildren(...themes.map((theme) => {
1190
+ const article = document.createElement("article");
1191
+ article.className = "theme";
1192
+ if (allowedThemeIds.has(theme.id)) article.classList.add("theme-" + theme.id);
1193
+ article.style.backgroundColor = theme.backgroundColor;
1194
+ article.style.color = theme.textColor;
1195
+
1196
+ const cover = document.createElement("div");
1197
+ cover.className = "cover";
1198
+ cover.style.backgroundColor = theme.accentColor;
1199
+ cover.append(document.createElement("span"));
1200
+
1201
+ const copy = document.createElement("div");
1202
+ copy.className = "theme-copy";
1203
+ const name = document.createElement("h2");
1204
+ name.textContent = theme.name;
1205
+ const description = document.createElement("p");
1206
+ description.textContent = theme.description;
1207
+ copy.append(name, description);
1208
+
1209
+ const cta = document.createElement("span");
1210
+ cta.className = "preview-cta";
1211
+ cta.style.borderColor = theme.accentColor;
1212
+ cta.style.color = theme.textColor;
1213
+ cta.textContent = "Listen on Spotify";
1214
+ article.append(cover, copy, cta);
1215
+ return article;
1216
+ }));
1217
+ }
1218
+ render(window.openai?.toolOutput);
1219
+ window.addEventListener("openai:set_globals", (event) => {
1220
+ render(event.detail?.globals?.toolOutput ?? window.openai?.toolOutput);
1221
+ }, { passive: true });
1222
+ </script>
1223
+ <style>
1224
+ :root {
1225
+ color-scheme: light dark;
1226
+ font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
1227
+ }
1228
+ * { box-sizing: border-box; }
1229
+ body { margin: 0; }
1230
+ .shell {
1231
+ background: #f4f1e8;
1232
+ color: #151515;
1233
+ min-height: 100vh;
1234
+ padding: 18px;
1235
+ }
1236
+ header {
1237
+ display: grid;
1238
+ gap: 3px;
1239
+ margin: 0 0 14px;
1240
+ }
1241
+ .eyebrow {
1242
+ color: #5f675f;
1243
+ font-size: 12px;
1244
+ font-weight: 700;
1245
+ letter-spacing: 0;
1246
+ margin: 0;
1247
+ text-transform: uppercase;
1248
+ }
1249
+ h1 {
1250
+ font-size: 28px;
1251
+ line-height: 1;
1252
+ margin: 0;
1253
+ }
1254
+ header p:last-child {
1255
+ color: #59605a;
1256
+ font-size: 14px;
1257
+ margin: 0;
1258
+ }
1259
+ .themes {
1260
+ display: grid;
1261
+ gap: 12px;
1262
+ grid-template-columns: repeat(2, minmax(0, 1fr));
1263
+ }
1264
+ .theme {
1265
+ border-radius: 8px;
1266
+ display: grid;
1267
+ gap: 10px;
1268
+ min-height: 232px;
1269
+ overflow: hidden;
1270
+ padding: 12px;
1271
+ }
1272
+ .cover {
1273
+ aspect-ratio: 1;
1274
+ border-radius: 6px;
1275
+ display: grid;
1276
+ overflow: hidden;
1277
+ place-items: center;
1278
+ }
1279
+ .cover span {
1280
+ background: rgba(255, 255, 255, 0.62);
1281
+ border: 1px solid rgba(0, 0, 0, 0.08);
1282
+ border-radius: 999px;
1283
+ display: block;
1284
+ height: 54%;
1285
+ width: 54%;
1286
+ }
1287
+ .theme-aurora .cover {
1288
+ background: linear-gradient(135deg, #73f7ff, #ff6bd6 58%, #f6ff87) !important;
1289
+ }
1290
+ .theme-cinematic .cover {
1291
+ background: radial-gradient(circle at 48% 32%, #ffb36b, #7b3f2b 52%, #191512 76%) !important;
1292
+ }
1293
+ .theme h2 {
1294
+ font-size: 18px;
1295
+ line-height: 1.1;
1296
+ margin: 0 0 4px;
1297
+ }
1298
+ .theme p {
1299
+ font-size: 12px;
1300
+ line-height: 1.35;
1301
+ margin: 0;
1302
+ opacity: 0.78;
1303
+ }
1304
+ .preview-cta {
1305
+ background: transparent;
1306
+ border: 1px solid currentColor;
1307
+ border-radius: 999px;
1308
+ font: inherit;
1309
+ font-size: 12px;
1310
+ font-weight: 700;
1311
+ min-height: 34px;
1312
+ padding: 6px 10px;
1313
+ width: 100%;
1314
+ }
1315
+ @media (max-width: 520px) {
1316
+ .shell { padding: 14px; }
1317
+ .themes { grid-template-columns: 1fr; }
1318
+ h1 { font-size: 24px; }
1319
+ .theme {
1320
+ grid-template-columns: 82px minmax(0, 1fr);
1321
+ min-height: 0;
1322
+ }
1323
+ .cover { grid-row: span 2; }
1324
+ .preview-cta { grid-column: 2; }
1325
+ }
1326
+ </style>
1327
+ `.trim();
1328
+ function registerSmartLinkThemePreviewResource(server) {
1329
+ server.registerResource("smart-link-theme-preview", SMART_LINK_THEME_PREVIEW_RESOURCE_URI, {
1330
+ description: "Visual preview for the four Dynamoi Smart Link page themes.",
1331
+ mimeType: "text/html;profile=mcp-app",
1332
+ title: "Smart Link Theme Preview"
1333
+ }, async () => ({
1334
+ contents: [
1335
+ {
1336
+ _meta: {
1337
+ ui: {
1338
+ csp: {
1339
+ connectDomains: [],
1340
+ resourceDomains: []
1341
+ },
1342
+ domain: "https://dynamoi.com",
1343
+ prefersBorder: true
1344
+ }
1345
+ },
1346
+ mimeType: "text/html;profile=mcp-app",
1347
+ text: SMART_LINK_THEME_PREVIEW_HTML,
1348
+ uri: SMART_LINK_THEME_PREVIEW_RESOURCE_URI
1349
+ }
1350
+ ]
1351
+ }));
1352
+ }
1353
+
1354
+ // src/server/smart-link-tools.ts
1355
+ import * as z6 from "zod/v4";
1256
1356
 
1257
1357
  // src/server/shared-schemas.ts
1258
- import * as z4 from "zod/v4";
1259
- var ToolFormatSchema = z4.enum(["json", "summary"]);
1260
- var IsoDateSchema = z4.string().regex(/^\d{4}-\d{2}-\d{2}$/);
1261
- var UserIntentSummarySchema = z4.string().trim().max(500).optional();
1262
- var ClientRequestIdSchema = z4.string().uuid().optional();
1263
- var RequiredClientRequestIdSchema = z4.string().uuid();
1358
+ import * as z5 from "zod/v4";
1359
+ var ToolFormatSchema = z5.enum(["json", "summary"]);
1360
+ var IsoDateSchema = z5.string().regex(/^\d{4}-\d{2}-\d{2}$/);
1361
+ var UserIntentSummarySchema = z5.string().trim().max(500).optional();
1362
+ var ClientRequestIdSchema = z5.string().uuid().optional();
1363
+ var RequiredClientRequestIdSchema = z5.string().uuid();
1264
1364
  function isValidCalendarDate(value) {
1265
- const date = /* @__PURE__ */ new Date(`${value}T00:00:00.000Z`);
1365
+ const date = new Date(`${value}T00:00:00.000Z`);
1266
1366
  return Number.isFinite(date.getTime()) && date.toISOString().slice(0, 10) === value;
1267
1367
  }
1268
1368
  var IsoCalendarDateSchema = IsoDateSchema.refine(isValidCalendarDate, {
1269
1369
  message: "must be a valid calendar date"
1270
1370
  });
1271
- var DateRangeSchema = z4.object({
1371
+ var DateRangeSchema = z5.object({
1272
1372
  end: IsoDateSchema,
1273
1373
  start: IsoDateSchema
1274
1374
  }).strict().superRefine((data, ctx) => {
@@ -1297,25 +1397,23 @@ var DateRangeSchema = z4.object({
1297
1397
 
1298
1398
  // src/server/smart-link-tools.ts
1299
1399
  var SmartLinkStatusFiltersSchema = {
1300
- claimStatus: z5.enum([
1400
+ claimStatus: z6.enum([
1301
1401
  "auto_approved",
1302
1402
  "pending_ops_review",
1303
1403
  "verification_deferred",
1304
1404
  "approved_by_ops",
1305
1405
  "rejected"
1306
1406
  ]).optional(),
1307
- publishState: z5.enum(["published", "unpublished"]).optional(),
1308
- renderState: z5.enum(["queued", "rendering", "rendered", "failed"]).optional()
1407
+ publishState: z6.enum(["published", "unpublished"]).optional(),
1408
+ renderState: z6.enum(["queued", "rendering", "rendered", "failed"]).optional()
1309
1409
  };
1310
- var SmartLinkThemeSchema = z5.enum([
1410
+ var SmartLinkThemeSchema = z6.enum([
1311
1411
  "classic",
1312
1412
  "brutalist",
1313
1413
  "aurora",
1314
1414
  "cinematic"
1315
1415
  ]);
1316
- var LegacySmartLinkIncludeSchema = z5.array(
1317
- z5.enum(["analytics", "artist_settings"])
1318
- );
1416
+ var LegacySmartLinkIncludeSchema = z6.array(z6.enum(["analytics", "artist_settings"]));
1319
1417
  function normalizeLegacySmartLinkInclude(rawInput) {
1320
1418
  if (!rawInput || typeof rawInput !== "object" || Array.isArray(rawInput)) {
1321
1419
  return rawInput;
@@ -1324,54 +1422,52 @@ function normalizeLegacySmartLinkInclude(rawInput) {
1324
1422
  if (!Object.hasOwn(input, "include")) {
1325
1423
  return rawInput;
1326
1424
  }
1327
- const legacyInclude = LegacySmartLinkIncludeSchema.safeParse(
1328
- input["include"]
1329
- );
1425
+ const legacyInclude = LegacySmartLinkIncludeSchema.safeParse(input["include"]);
1330
1426
  if (!legacyInclude.success) {
1331
1427
  return rawInput;
1332
1428
  }
1333
1429
  const { include: _include, ...normalized } = input;
1334
- if (normalized["includeAnalytics"] === void 0 && legacyInclude.data.includes("analytics")) {
1430
+ if (normalized["includeAnalytics"] === undefined && legacyInclude.data.includes("analytics")) {
1335
1431
  normalized["includeAnalytics"] = true;
1336
1432
  }
1337
- if (normalized["includeArtistSettings"] === void 0 && legacyInclude.data.includes("artist_settings")) {
1433
+ if (normalized["includeArtistSettings"] === undefined && legacyInclude.data.includes("artist_settings")) {
1338
1434
  normalized["includeArtistSettings"] = true;
1339
1435
  }
1340
1436
  return normalized;
1341
1437
  }
1342
- var DynamoiCreateSmartLinkFromSpotifyInputSchema = z5.object({
1343
- artistId: z5.string().uuid(),
1438
+ var DynamoiCreateSmartLinkFromSpotifyInputSchema = z6.object({
1439
+ artistId: z6.string().uuid(),
1344
1440
  clientRequestId: RequiredClientRequestIdSchema.optional(),
1345
- customDescription: z5.string().trim().max(500).optional(),
1441
+ customDescription: z6.string().trim().max(500).optional(),
1346
1442
  format: ToolFormatSchema.optional(),
1347
- spotifyUrl: z5.string().trim().min(1).max(500),
1443
+ spotifyUrl: z6.string().trim().min(1).max(500),
1348
1444
  userIntentSummary: UserIntentSummarySchema
1349
1445
  }).strict();
1350
- var DynamoiCreateSmartLinksFromSpotifyArtistInputSchema = z5.object({
1351
- artistId: z5.string().uuid().optional(),
1446
+ var DynamoiCreateSmartLinksFromSpotifyArtistInputSchema = z6.object({
1447
+ artistId: z6.string().uuid().optional(),
1352
1448
  clientRequestId: RequiredClientRequestIdSchema.optional(),
1353
1449
  format: ToolFormatSchema.optional(),
1354
- spotifyArtistUrl: z5.string().trim().min(1).max(500),
1450
+ spotifyArtistUrl: z6.string().trim().min(1).max(500),
1355
1451
  userIntentSummary: UserIntentSummarySchema
1356
1452
  }).strict();
1357
- var DynamoiListSmartLinksInputSchema = z5.object({
1358
- artistId: z5.string().uuid(),
1359
- cursor: z5.string().optional(),
1453
+ var DynamoiListSmartLinksInputSchema = z6.object({
1454
+ artistId: z6.string().uuid(),
1455
+ cursor: z6.string().optional(),
1360
1456
  format: ToolFormatSchema.optional(),
1361
- limit: z5.number().int().min(1).max(50).optional(),
1362
- query: z5.string().trim().max(120).optional(),
1457
+ limit: z6.number().int().min(1).max(50).optional(),
1458
+ query: z6.string().trim().max(120).optional(),
1363
1459
  ...SmartLinkStatusFiltersSchema
1364
1460
  }).strict();
1365
1461
  var DynamoiGetSmartLinkInputShape = {
1366
- artistId: z5.string().uuid().optional(),
1462
+ artistId: z6.string().uuid().optional(),
1367
1463
  dateRange: DateRangeSchema.optional(),
1368
1464
  format: ToolFormatSchema.optional(),
1369
- granularity: z5.enum(["TOTAL", "DAILY"]).optional(),
1370
- includeAnalytics: z5.boolean().optional(),
1371
- includeArtistSettings: z5.boolean().optional(),
1372
- includeBreakdowns: z5.boolean().optional(),
1373
- playLinkId: z5.string().uuid().optional(),
1374
- spotifyUrl: z5.string().trim().min(1).max(500).optional()
1465
+ granularity: z6.enum(["TOTAL", "DAILY"]).optional(),
1466
+ includeAnalytics: z6.boolean().optional(),
1467
+ includeArtistSettings: z6.boolean().optional(),
1468
+ includeBreakdowns: z6.boolean().optional(),
1469
+ playLinkId: z6.string().uuid().optional(),
1470
+ spotifyUrl: z6.string().trim().min(1).max(500).optional()
1375
1471
  };
1376
1472
  function validateDynamoiGetSmartLinkInput(data, ctx) {
1377
1473
  const settingsOnly = data.includeArtistSettings === true && !data.playLinkId && !data.spotifyUrl && Boolean(data.artistId);
@@ -1390,44 +1486,36 @@ function validateDynamoiGetSmartLinkInput(data, ctx) {
1390
1486
  });
1391
1487
  }
1392
1488
  }
1393
- var StrictDynamoiGetSmartLinkInputSchema = z5.object(DynamoiGetSmartLinkInputShape).strict().superRefine(validateDynamoiGetSmartLinkInput);
1489
+ var StrictDynamoiGetSmartLinkInputSchema = z6.object(DynamoiGetSmartLinkInputShape).strict().superRefine(validateDynamoiGetSmartLinkInput);
1394
1490
  var DynamoiGetSmartLinkInputSchema = StrictDynamoiGetSmartLinkInputSchema;
1395
1491
  function parseDynamoiGetSmartLinkInput(rawInput) {
1396
- return StrictDynamoiGetSmartLinkInputSchema.parse(
1397
- normalizeLegacySmartLinkInclude(rawInput)
1398
- );
1492
+ return StrictDynamoiGetSmartLinkInputSchema.parse(normalizeLegacySmartLinkInclude(rawInput));
1399
1493
  }
1400
- var DynamoiGetSmartLinkAnalyticsInputSchema = z5.object({
1494
+ var DynamoiGetSmartLinkAnalyticsInputSchema = z6.object({
1401
1495
  dateRange: DateRangeSchema.optional(),
1402
1496
  format: ToolFormatSchema.optional(),
1403
- granularity: z5.enum(["TOTAL", "DAILY"]).optional(),
1404
- includeBreakdowns: z5.boolean().optional(),
1405
- playLinkId: z5.string().uuid()
1497
+ granularity: z6.enum(["TOTAL", "DAILY"]).optional(),
1498
+ includeBreakdowns: z6.boolean().optional(),
1499
+ playLinkId: z6.string().uuid()
1406
1500
  }).strict();
1407
- var DynamoiGetSmartLinkArtistSettingsInputSchema = z5.object({
1408
- artistId: z5.string().uuid(),
1501
+ var DynamoiGetSmartLinkArtistSettingsInputSchema = z6.object({
1502
+ artistId: z6.string().uuid(),
1409
1503
  format: ToolFormatSchema.optional()
1410
1504
  }).strict();
1411
- var DynamoiUpdateSmartLinkInputSchema = z5.object({
1412
- action: z5.enum([
1413
- "update_description",
1414
- "update_artist_settings",
1415
- "publish",
1416
- "unpublish"
1417
- ]),
1418
- artistId: z5.string().uuid().optional(),
1505
+ var DynamoiUpdateSmartLinkInputSchema = z6.object({
1506
+ action: z6.enum(["update_description", "update_artist_settings"]),
1507
+ artistId: z6.string().uuid().optional(),
1419
1508
  clientRequestId: ClientRequestIdSchema,
1420
- customDescription: z5.string().max(500).nullable().optional(),
1421
- expectedPublishState: z5.enum(["published", "unpublished"]).optional(),
1422
- expectedUpdatedAt: z5.string().datetime().optional(),
1423
- googleAdsConversionId: z5.string().trim().max(32).nullable().optional(),
1424
- metaPixelId: z5.string().trim().max(32).nullable().optional(),
1425
- playLinkId: z5.string().uuid().optional(),
1509
+ customDescription: z6.string().max(500).nullable().optional(),
1510
+ expectedUpdatedAt: z6.string().datetime().optional(),
1511
+ googleAdsConversionId: z6.string().trim().max(32).nullable().optional(),
1512
+ metaPixelId: z6.string().trim().max(32).nullable().optional(),
1513
+ playLinkId: z6.string().uuid().optional(),
1426
1514
  theme: SmartLinkThemeSchema.optional(),
1427
- tiktokPixelId: z5.string().trim().max(32).nullable().optional(),
1515
+ tiktokPixelId: z6.string().trim().max(32).nullable().optional(),
1428
1516
  userIntentSummary: UserIntentSummarySchema
1429
1517
  }).strict().superRefine((data, ctx) => {
1430
- if (data.action === "update_description" && data.customDescription === void 0) {
1518
+ if (data.action === "update_description" && data.customDescription === undefined) {
1431
1519
  ctx.addIssue({
1432
1520
  code: "custom",
1433
1521
  message: "customDescription is required when action is update_description",
@@ -1437,7 +1525,7 @@ var DynamoiUpdateSmartLinkInputSchema = z5.object({
1437
1525
  if (data.action !== "update_artist_settings" && !data.playLinkId) {
1438
1526
  ctx.addIssue({
1439
1527
  code: "custom",
1440
- message: "playLinkId is required when action is update_description, publish, or unpublish",
1528
+ message: "playLinkId is required when action is update_description",
1441
1529
  path: ["playLinkId"]
1442
1530
  });
1443
1531
  }
@@ -1449,7 +1537,7 @@ var DynamoiUpdateSmartLinkInputSchema = z5.object({
1449
1537
  path: ["artistId"]
1450
1538
  });
1451
1539
  }
1452
- if (data.theme === void 0 && data.metaPixelId === void 0 && data.tiktokPixelId === void 0 && data.googleAdsConversionId === void 0) {
1540
+ if (data.theme === undefined && data.metaPixelId === undefined && data.tiktokPixelId === undefined && data.googleAdsConversionId === undefined) {
1453
1541
  ctx.addIssue({
1454
1542
  code: "custom",
1455
1543
  message: "Provide at least one setting to update",
@@ -1457,13 +1545,6 @@ var DynamoiUpdateSmartLinkInputSchema = z5.object({
1457
1545
  });
1458
1546
  }
1459
1547
  }
1460
- if ((data.action === "publish" || data.action === "unpublish") && data.customDescription !== void 0) {
1461
- ctx.addIssue({
1462
- code: "custom",
1463
- message: "customDescription is only valid for update_description",
1464
- path: ["customDescription"]
1465
- });
1466
- }
1467
1548
  if (data.action !== "update_artist_settings") {
1468
1549
  for (const field of [
1469
1550
  "artistId",
@@ -1472,7 +1553,7 @@ var DynamoiUpdateSmartLinkInputSchema = z5.object({
1472
1553
  "theme",
1473
1554
  "tiktokPixelId"
1474
1555
  ]) {
1475
- if (data[field] !== void 0) {
1556
+ if (data[field] !== undefined) {
1476
1557
  ctx.addIssue({
1477
1558
  code: "custom",
1478
1559
  message: `${field} is only valid for update_artist_settings`,
@@ -1481,24 +1562,17 @@ var DynamoiUpdateSmartLinkInputSchema = z5.object({
1481
1562
  }
1482
1563
  }
1483
1564
  }
1484
- if (data.action !== "publish" && data.action !== "unpublish" && data.expectedPublishState !== void 0) {
1485
- ctx.addIssue({
1486
- code: "custom",
1487
- message: "expectedPublishState is only valid for publish or unpublish",
1488
- path: ["expectedPublishState"]
1489
- });
1490
- }
1491
1565
  });
1492
- var DynamoiUpdateSmartLinkArtistSettingsInputSchema = z5.object({
1493
- artistId: z5.string().uuid(),
1566
+ var DynamoiUpdateSmartLinkArtistSettingsInputSchema = z6.object({
1567
+ artistId: z6.string().uuid(),
1494
1568
  clientRequestId: ClientRequestIdSchema,
1495
- googleAdsConversionId: z5.string().trim().max(32).nullable().optional(),
1496
- metaPixelId: z5.string().trim().max(32).nullable().optional(),
1569
+ googleAdsConversionId: z6.string().trim().max(32).nullable().optional(),
1570
+ metaPixelId: z6.string().trim().max(32).nullable().optional(),
1497
1571
  theme: SmartLinkThemeSchema.optional(),
1498
- tiktokPixelId: z5.string().trim().max(32).nullable().optional(),
1572
+ tiktokPixelId: z6.string().trim().max(32).nullable().optional(),
1499
1573
  userIntentSummary: UserIntentSummarySchema
1500
1574
  }).strict().superRefine((data, ctx) => {
1501
- if (data.theme === void 0 && data.metaPixelId === void 0 && data.tiktokPixelId === void 0 && data.googleAdsConversionId === void 0) {
1575
+ if (data.theme === undefined && data.metaPixelId === undefined && data.tiktokPixelId === undefined && data.googleAdsConversionId === undefined) {
1502
1576
  ctx.addIssue({
1503
1577
  code: "custom",
1504
1578
  message: "Provide at least one setting to update",
@@ -1506,12 +1580,6 @@ var DynamoiUpdateSmartLinkArtistSettingsInputSchema = z5.object({
1506
1580
  });
1507
1581
  }
1508
1582
  });
1509
- var DynamoiPublishSmartLinkInputSchema = z5.object({
1510
- clientRequestId: ClientRequestIdSchema,
1511
- expectedPublishState: z5.enum(["published", "unpublished"]).optional(),
1512
- playLinkId: z5.string().uuid(),
1513
- userIntentSummary: UserIntentSummarySchema
1514
- }).strict();
1515
1583
  var PHASE_4_TOOL_DEFINITIONS = [
1516
1584
  {
1517
1585
  description: "Use this when the user wants to create one free Dynamoi Smart Link from a Spotify album or track URL/URI, or a single starter release from a Spotify artist URL. For full-catalog artist imports or artist hub requests, prefer dynamoi_create_smart_links_from_spotify_artist. Smart Links are free to create and manage. High-popularity or unverifiable artist links may stay unpublished in verification hold until Dynamoi can verify the client relationship. This does not create a paid ad campaign. Spotify playlist URLs are not supported today. If the Smart Link already exists, return the existing link instead of creating a duplicate; if customDescription is provided, update that Smart Link's public description. In the final answer, lead with the public URL and do not expose internal IDs unless asked.",
@@ -1556,7 +1624,7 @@ var PHASE_4_TOOL_DEFINITIONS = [
1556
1624
  title: "Get Smart Link"
1557
1625
  },
1558
1626
  {
1559
- description: "Use this when the user wants to change one Smart Link's public description, publish/unpublish the public landing page, or update artist-level Smart Link theme/pixel settings. Set action to update_description, publish, unpublish, or update_artist_settings. This updates public landing-page behavior and may queue background rendering.",
1627
+ description: "Use this when the user wants to change one Smart Link's public description or update artist-level Smart Link theme/pixel settings. Set action to update_description or update_artist_settings. Public availability is artist-wide in the dashboard; this tool does not publish or unpublish individual links. Theme-only updates switch instantly; description or pixel changes may queue background rendering.",
1560
1628
  destructiveHint: true,
1561
1629
  idempotentHint: true,
1562
1630
  name: "dynamoi_update_smart_link",
@@ -1569,7 +1637,7 @@ var PHASE_4_TOOL_DEFINITIONS = [
1569
1637
  ];
1570
1638
 
1571
1639
  // src/server/tools.ts
1572
- import * as z7 from "zod/v4";
1640
+ import * as z8 from "zod/v4";
1573
1641
 
1574
1642
  // src/server/onboarding-tool-definitions.ts
1575
1643
  function createPhaseOnboardingToolDefinitions(schemas) {
@@ -1600,20 +1668,15 @@ function createPhaseOnboardingToolDefinitions(schemas) {
1600
1668
  }
1601
1669
 
1602
1670
  // src/server/openai-tools.ts
1603
- import * as z6 from "zod/v4";
1604
- var DynamoiOpenAiSearchInputSchema = z6.object({
1605
- query: z6.string().trim().min(1).max(500)
1671
+ import * as z7 from "zod/v4";
1672
+ var DynamoiOpenAiSearchInputSchema = z7.object({
1673
+ query: z7.string().trim().min(1).max(500)
1606
1674
  }).strict();
1607
- var DynamoiOpenAiFetchInputSchema = z6.object({
1608
- id: z6.string().trim().min(1).max(200)
1675
+ var DynamoiOpenAiFetchInputSchema = z7.object({
1676
+ id: z7.string().trim().min(1).max(200)
1609
1677
  }).strict();
1610
1678
  var OPENAI_TOOL_DEFINITIONS = [
1611
1679
  {
1612
- // OpenAI ChatGPT Connectors / Deep Research expects a tool literally
1613
- // named `search` returning {results: [{id, title, text?, url?}]}. This
1614
- // is the same data dynamoi_search returns, reshaped for OpenAI Deep
1615
- // Research citation flows. ChatGPT will not call this tool directly in
1616
- // regular chat — it picks dynamoi_search by description.
1617
1680
  description: "OpenAI ChatGPT Deep Research / Connectors search contract. Returns matching Dynamoi artists, campaigns, and Smart Links so they can be cited in a deep-research session. For regular ChatGPT chat use dynamoi_search instead.",
1618
1681
  destructiveHint: false,
1619
1682
  name: "search",
@@ -1624,8 +1687,6 @@ var OPENAI_TOOL_DEFINITIONS = [
1624
1687
  title: "Search (OpenAI Connectors)"
1625
1688
  },
1626
1689
  {
1627
- // OpenAI Deep Research follow-up tool: given an id returned by `search`,
1628
- // returns the full record so it can be cited.
1629
1690
  description: "OpenAI ChatGPT Deep Research / Connectors fetch contract. Given an id returned by `search` (formatted as 'artist:<uuid>', 'campaign:<uuid>', or 'smartlink:<uuid>'), returns the full record for citation.",
1630
1691
  destructiveHint: false,
1631
1692
  name: "fetch",
@@ -1640,8 +1701,8 @@ var OPENAI_TOOL_DEFINITIONS = [
1640
1701
  // src/server/tools.ts
1641
1702
  var DateRangeSchema2 = DateRangeSchema;
1642
1703
  var ToolFormatSchema2 = ToolFormatSchema;
1643
- var OnboardingAttemptIdSchema = z7.string().trim().min(1).max(120).optional();
1644
- var ExpectedCampaignStatusEnum = z7.enum([
1704
+ var OnboardingAttemptIdSchema = z8.string().trim().min(1).max(120).optional();
1705
+ var ExpectedCampaignStatusEnum = z8.enum([
1645
1706
  "AWAITING_SMART_LINK",
1646
1707
  "ACTIVE",
1647
1708
  "ARCHIVED",
@@ -1657,20 +1718,20 @@ var ExpectedCampaignStatusSchema = ExpectedCampaignStatusEnum.optional();
1657
1718
  var CampaignStatusFilterSchema = ExpectedCampaignStatusEnum.exclude([
1658
1719
  "ENDED"
1659
1720
  ]).optional();
1660
- var DynamoiListArtistsInputSchema = z7.object({
1661
- artistId: z7.string().uuid().optional(),
1662
- cursor: z7.string().optional(),
1721
+ var DynamoiListArtistsInputSchema = z8.object({
1722
+ artistId: z8.string().uuid().optional(),
1723
+ cursor: z8.string().optional(),
1663
1724
  format: ToolFormatSchema2.optional(),
1664
- limit: z7.number().int().min(1).max(50).optional()
1725
+ limit: z8.number().int().min(1).max(50).optional()
1665
1726
  }).strict();
1666
- var DynamoiSearchInputSchema = z7.object({
1667
- artistId: z7.string().uuid().optional(),
1668
- cursor: z7.string().optional(),
1727
+ var DynamoiSearchInputSchema = z8.object({
1728
+ artistId: z8.string().uuid().optional(),
1729
+ cursor: z8.string().optional(),
1669
1730
  format: ToolFormatSchema2.optional(),
1670
- includeArchived: z7.boolean().optional(),
1671
- limit: z7.number().int().min(1).max(50).optional(),
1672
- query: z7.string().trim().max(120).optional(),
1673
- type: z7.enum(["artist", "campaign", "smartlink"]).optional()
1731
+ includeArchived: z8.boolean().optional(),
1732
+ limit: z8.number().int().min(1).max(50).optional(),
1733
+ query: z8.string().trim().max(120).optional(),
1734
+ type: z8.enum(["artist", "campaign", "smartlink"]).optional()
1674
1735
  }).strict().superRefine((data, ctx) => {
1675
1736
  if (!(data.type || data.query)) {
1676
1737
  ctx.addIssue({
@@ -1680,135 +1741,149 @@ var DynamoiSearchInputSchema = z7.object({
1680
1741
  });
1681
1742
  }
1682
1743
  });
1683
- var DynamoiGetCurrentUserIntentSchema = z7.enum([
1744
+ var DynamoiGetCurrentUserIntentSchema = z8.enum([
1684
1745
  "account_overview",
1685
1746
  "artist_access_check",
1686
1747
  "organization_access_check",
1687
1748
  "platform_connection_check"
1688
1749
  ]);
1689
- var DynamoiGetCurrentUserInputSchema = z7.object({
1750
+ var DynamoiGetCurrentUserInputSchema = z8.object({
1690
1751
  format: ToolFormatSchema2.optional(),
1691
1752
  intent: DynamoiGetCurrentUserIntentSchema
1692
1753
  }).strict();
1693
- var DynamoiGetArtistInputSchema = z7.object({
1694
- artistId: z7.string().uuid(),
1754
+ var DynamoiGetArtistInputSchema = z8.object({
1755
+ artistId: z8.string().uuid(),
1695
1756
  format: ToolFormatSchema2.optional()
1696
1757
  }).strict();
1697
- var DynamoiListCampaignsInputSchema = z7.object({
1698
- artistId: z7.string().uuid(),
1699
- campaignType: z7.enum(["SMART_CAMPAIGN", "YOUTUBE"]).optional(),
1700
- cursor: z7.string().optional(),
1758
+ var DynamoiListCampaignsInputSchema = z8.object({
1759
+ artistId: z8.string().uuid(),
1760
+ campaignType: z8.enum(["SMART_CAMPAIGN", "YOUTUBE"]).optional(),
1761
+ cursor: z8.string().optional(),
1701
1762
  format: ToolFormatSchema2.optional(),
1702
- limit: z7.number().int().min(1).max(50).optional(),
1763
+ limit: z8.number().int().min(1).max(50).optional(),
1703
1764
  status: CampaignStatusFilterSchema
1704
1765
  }).strict();
1705
- var DynamoiGetCampaignInputSchema = z7.object({
1766
+ var DynamoiGetCampaignInputSchema = z8.object({
1706
1767
  analyticsDateRange: DateRangeSchema2.optional(),
1707
- analyticsGranularity: z7.enum(["TOTAL", "DAILY"]).optional(),
1708
- campaignId: z7.string().uuid(),
1768
+ analyticsGranularity: z8.enum(["TOTAL", "DAILY"]).optional(),
1769
+ campaignId: z8.string().uuid(),
1709
1770
  format: ToolFormatSchema2.optional(),
1710
- includeAnalytics: z7.boolean().optional(),
1711
- includeCountries: z7.boolean().optional(),
1712
- includeDeploymentStatus: z7.boolean().optional()
1771
+ includeAnalytics: z8.boolean().optional(),
1772
+ includeCountries: z8.boolean().optional(),
1773
+ includeDeploymentStatus: z8.boolean().optional()
1713
1774
  }).strict();
1714
- var DynamoiGetCampaignAnalyticsInputSchema = z7.object({
1715
- campaignId: z7.string().uuid(),
1775
+ var DynamoiGetCampaignAnalyticsInputSchema = z8.object({
1776
+ campaignId: z8.string().uuid(),
1716
1777
  dateRange: DateRangeSchema2.optional(),
1717
1778
  format: ToolFormatSchema2.optional(),
1718
- granularity: z7.enum(["TOTAL", "DAILY"]).optional()
1779
+ granularity: z8.enum(["TOTAL", "DAILY"]).optional()
1719
1780
  }).strict();
1720
- var DynamoiGetArtistAnalyticsInputSchema = z7.object({
1721
- artistId: z7.string().uuid(),
1781
+ var DynamoiGetArtistAnalyticsInputSchema = z8.object({
1782
+ artistId: z8.string().uuid(),
1722
1783
  dateRange: DateRangeSchema2.optional(),
1723
1784
  format: ToolFormatSchema2.optional(),
1724
- granularity: z7.enum(["TOTAL", "DAILY"]).optional()
1785
+ granularity: z8.enum(["TOTAL", "DAILY"]).optional()
1725
1786
  }).strict();
1726
- var DynamoiGetBillingInputSchema = z7.object({
1727
- artistId: z7.string().uuid(),
1787
+ var DynamoiGetBillingInputSchema = z8.object({
1788
+ artistId: z8.string().uuid(),
1728
1789
  format: ToolFormatSchema2.optional(),
1729
1790
  onboardingAttemptId: OnboardingAttemptIdSchema
1730
1791
  }).strict();
1731
- var LocationTargetSchema = z7.object({
1732
- code: z7.string().trim().min(1).max(8),
1733
- name: z7.string().trim().min(1).max(120)
1792
+ var LocationTargetSchema = z8.object({
1793
+ code: z8.string().trim().min(1).max(8),
1794
+ name: z8.string().trim().min(1).max(120)
1734
1795
  }).strict();
1735
- var DynamoiGetPlatformStatusInputSchema = z7.object({
1736
- artistId: z7.string().uuid(),
1796
+ var DynamoiGetPlatformStatusInputSchema = z8.object({
1797
+ artistId: z8.string().uuid(),
1737
1798
  format: ToolFormatSchema2.optional(),
1738
1799
  onboardingAttemptId: OnboardingAttemptIdSchema,
1739
- onboardingFlow: z7.enum(["meta", "youtube"]).optional()
1800
+ onboardingFlow: z8.enum(["meta", "youtube"]).optional()
1740
1801
  }).strict();
1741
- var DynamoiStartYoutubeChannelLinkInputSchema = z7.object({
1742
- artistId: z7.string().uuid(),
1802
+ var DynamoiStartYoutubeChannelLinkInputSchema = z8.object({
1803
+ artistId: z8.string().uuid(),
1743
1804
  format: ToolFormatSchema2.optional(),
1744
1805
  userIntentSummary: UserIntentSummarySchema
1745
1806
  }).strict();
1746
- var DynamoiStartMetaConnectionInputSchema = z7.object({
1747
- artistId: z7.string().uuid(),
1807
+ var DynamoiStartMetaConnectionInputSchema = z8.object({
1808
+ artistId: z8.string().uuid(),
1748
1809
  format: ToolFormatSchema2.optional(),
1749
1810
  userIntentSummary: UserIntentSummarySchema
1750
1811
  }).strict();
1751
- var DynamoiListAvailableCountriesInputSchema = z7.object({
1752
- campaignType: z7.enum(["SMART_CAMPAIGN", "YOUTUBE"]),
1753
- cursor: z7.string().optional(),
1812
+ var DynamoiListAvailableCountriesInputSchema = z8.object({
1813
+ campaignType: z8.enum(["SMART_CAMPAIGN", "YOUTUBE"]),
1814
+ cursor: z8.string().optional(),
1754
1815
  format: ToolFormatSchema2.optional(),
1755
- limit: z7.number().int().min(1).max(100).optional(),
1756
- query: z7.string().trim().max(120).optional()
1816
+ limit: z8.number().int().min(1).max(100).optional(),
1817
+ query: z8.string().trim().max(120).optional()
1757
1818
  }).strict();
1758
- var DynamoiGetOnboardingStatusInputSchema = z7.object({
1759
- artistId: z7.string().uuid(),
1819
+ var DynamoiGetOnboardingStatusInputSchema = z8.object({
1820
+ artistId: z8.string().uuid(),
1760
1821
  format: ToolFormatSchema2.optional()
1761
1822
  }).strict();
1762
- var DynamoiGetCampaignReadinessInputSchema = z7.object({
1763
- artistId: z7.string().uuid(),
1764
- budgetAmount: z7.number().finite().positive().optional(),
1765
- budgetType: z7.enum(["DAILY", "TOTAL"]).optional(),
1766
- campaignType: z7.enum(["SMART_CAMPAIGN", "YOUTUBE"]),
1767
- contentType: z7.enum(["TRACK", "ALBUM", "PLAYLIST", "VIDEO"]).optional(),
1823
+ var DynamoiGetCampaignReadinessInputSchema = z8.object({
1824
+ artistId: z8.string().uuid(),
1825
+ budgetAmount: z8.number().finite().positive().optional(),
1826
+ budgetType: z8.enum(["DAILY", "TOTAL"]).optional(),
1827
+ campaignType: z8.enum(["SMART_CAMPAIGN", "YOUTUBE"]),
1828
+ contentType: z8.enum(["TRACK", "ALBUM", "PLAYLIST", "VIDEO"]).optional(),
1768
1829
  endDate: IsoCalendarDateSchema.optional(),
1769
1830
  format: ToolFormatSchema2.optional(),
1770
- locationTargets: z7.array(LocationTargetSchema).optional(),
1771
- mediaAssetIds: z7.array(z7.string().uuid()).optional(),
1772
- spotifyUrl: z7.string().trim().min(1).max(500).optional(),
1773
- youtubeVideoId: z7.string().trim().min(1).max(128).optional()
1831
+ locationTargets: z8.array(LocationTargetSchema).optional(),
1832
+ mediaAssetIds: z8.array(z8.string().uuid()).optional(),
1833
+ spotifyUrl: z8.string().trim().min(1).max(500).optional(),
1834
+ youtubeVideoId: z8.string().trim().min(1).max(128).optional()
1774
1835
  }).strict();
1775
- var DynamoiGetCampaignDeploymentStatusInputSchema = z7.object({
1776
- campaignId: z7.string().uuid(),
1836
+ var DynamoiGetCampaignDeploymentStatusInputSchema = z8.object({
1837
+ campaignId: z8.string().uuid(),
1777
1838
  format: ToolFormatSchema2.optional()
1778
1839
  }).strict();
1779
- var DynamoiPauseCampaignInputSchema = z7.object({
1780
- campaignId: z7.string().uuid(),
1840
+ var DynamoiPauseCampaignInputSchema = z8.object({
1841
+ campaignId: z8.string().uuid(),
1781
1842
  clientRequestId: ClientRequestIdSchema,
1782
1843
  expectedCurrentStatus: ExpectedCampaignStatusSchema,
1783
1844
  userIntentSummary: UserIntentSummarySchema
1784
1845
  }).strict();
1785
- var DynamoiResumeCampaignInputSchema = z7.object({
1786
- campaignId: z7.string().uuid(),
1846
+ var DynamoiResumeCampaignInputSchema = z8.object({
1847
+ campaignId: z8.string().uuid(),
1787
1848
  clientRequestId: ClientRequestIdSchema,
1788
1849
  expectedCurrentStatus: ExpectedCampaignStatusSchema,
1789
1850
  userIntentSummary: UserIntentSummarySchema
1790
1851
  }).strict();
1791
- var DynamoiUpdateBudgetInputSchema = z7.object({
1792
- budgetAmount: z7.number().finite().positive(),
1793
- campaignId: z7.string().uuid(),
1852
+ var DynamoiUpdateBudgetInputSchema = z8.object({
1853
+ acceptedConsentCopyHash: z8.literal(PROSPECTIVE_BUDGET_FUNDING_CONSENT_COPY_HASH).optional(),
1854
+ acceptedConsentVersion: z8.literal(PROSPECTIVE_BUDGET_FUNDING_CONSENT_VERSION).optional(),
1855
+ authorizeAutomaticDailyFunding: z8.literal(true).describe(`Set only after the client explicitly accepts: “${PROSPECTIVE_BUDGET_FUNDING_CONSENT_COPY}”`).optional(),
1856
+ budgetAmount: z8.number().finite().positive(),
1857
+ campaignId: z8.string().uuid(),
1794
1858
  clientRequestId: ClientRequestIdSchema,
1795
1859
  endDate: IsoCalendarDateSchema.optional(),
1796
- expectedCurrentBudgetAmount: z7.number().finite().positive().optional(),
1860
+ expectedCurrentBudgetAmount: z8.number().finite().positive().optional(),
1797
1861
  expectedCurrentEndDate: IsoCalendarDateSchema.optional(),
1798
1862
  userIntentSummary: UserIntentSummarySchema
1799
- }).strict();
1800
- var DynamoiUpdateCampaignInputSchema = z7.object({
1801
- action: z7.enum(["pause", "resume", "update_budget"]),
1802
- budgetAmount: z7.number().finite().positive().optional(),
1803
- campaignId: z7.string().uuid(),
1863
+ }).strict().superRefine((data, ctx) => {
1864
+ if (data.authorizeAutomaticDailyFunding && !(data.acceptedConsentCopyHash && data.acceptedConsentVersion && data.clientRequestId)) {
1865
+ ctx.addIssue({
1866
+ code: "custom",
1867
+ message: "acceptedConsentCopyHash, acceptedConsentVersion, and clientRequestId are required with automatic daily funding authorization",
1868
+ path: ["authorizeAutomaticDailyFunding"]
1869
+ });
1870
+ }
1871
+ });
1872
+ var DynamoiUpdateCampaignInputSchema = z8.object({
1873
+ action: z8.enum(["pause", "resume", "update_budget"]),
1874
+ acceptedConsentCopyHash: z8.literal(PROSPECTIVE_BUDGET_FUNDING_CONSENT_COPY_HASH).optional(),
1875
+ acceptedConsentVersion: z8.literal(PROSPECTIVE_BUDGET_FUNDING_CONSENT_VERSION).optional(),
1876
+ authorizeAutomaticDailyFunding: z8.literal(true).describe(`Set only after the client explicitly accepts: “${PROSPECTIVE_BUDGET_FUNDING_CONSENT_COPY}”`).optional(),
1877
+ budgetAmount: z8.number().finite().positive().optional(),
1878
+ campaignId: z8.string().uuid(),
1804
1879
  clientRequestId: ClientRequestIdSchema,
1805
1880
  endDate: IsoCalendarDateSchema.optional(),
1806
- expectedCurrentBudgetAmount: z7.number().finite().positive().optional(),
1881
+ expectedCurrentBudgetAmount: z8.number().finite().positive().optional(),
1807
1882
  expectedCurrentEndDate: IsoCalendarDateSchema.optional(),
1808
1883
  expectedCurrentStatus: ExpectedCampaignStatusSchema,
1809
1884
  userIntentSummary: UserIntentSummarySchema
1810
1885
  }).strict().superRefine((data, ctx) => {
1811
- if (data.action === "update_budget" && data.budgetAmount === void 0) {
1886
+ if (data.action === "update_budget" && data.budgetAmount === undefined) {
1812
1887
  ctx.addIssue({
1813
1888
  code: "custom",
1814
1889
  message: "budgetAmount is required when action is update_budget",
@@ -1817,12 +1892,15 @@ var DynamoiUpdateCampaignInputSchema = z7.object({
1817
1892
  }
1818
1893
  if (data.action !== "update_budget") {
1819
1894
  for (const field of [
1895
+ "acceptedConsentCopyHash",
1896
+ "acceptedConsentVersion",
1820
1897
  "budgetAmount",
1898
+ "authorizeAutomaticDailyFunding",
1821
1899
  "endDate",
1822
1900
  "expectedCurrentBudgetAmount",
1823
1901
  "expectedCurrentEndDate"
1824
1902
  ]) {
1825
- if (data[field] !== void 0) {
1903
+ if (data[field] !== undefined) {
1826
1904
  ctx.addIssue({
1827
1905
  code: "custom",
1828
1906
  message: `${field} is only valid when action is update_budget`,
@@ -1831,46 +1909,41 @@ var DynamoiUpdateCampaignInputSchema = z7.object({
1831
1909
  }
1832
1910
  }
1833
1911
  }
1912
+ if (data.authorizeAutomaticDailyFunding && !(data.acceptedConsentCopyHash && data.acceptedConsentVersion && data.clientRequestId)) {
1913
+ ctx.addIssue({
1914
+ code: "custom",
1915
+ message: "acceptedConsentCopyHash, acceptedConsentVersion, and clientRequestId are required with automatic daily funding authorization",
1916
+ path: ["authorizeAutomaticDailyFunding"]
1917
+ });
1918
+ }
1834
1919
  });
1835
- var DynamoiListMediaAssetsInputSchema = z7.object({
1836
- artistId: z7.string().uuid(),
1837
- cursor: z7.string().optional(),
1920
+ var DynamoiListMediaAssetsInputSchema = z8.object({
1921
+ artistId: z8.string().uuid(),
1922
+ cursor: z8.string().optional(),
1838
1923
  format: ToolFormatSchema2.optional(),
1839
- includeUrls: z7.boolean().optional(),
1840
- limit: z7.number().int().min(1).max(50).optional()
1924
+ includeUrls: z8.boolean().optional(),
1925
+ limit: z8.number().int().min(1).max(50).optional()
1841
1926
  }).strict();
1842
- var DynamoiLaunchCampaignInputSchema = z7.object({
1843
- // Creative
1844
- adCopy: z7.string().trim().max(500).optional(),
1845
- appleMusicUrl: z7.string().trim().min(1).max(500).optional(),
1846
- artistId: z7.string().uuid(),
1847
- // Budget
1848
- budgetAmount: z7.number().finite().positive(),
1849
- budgetSplits: z7.record(
1850
- z7.enum(["META", "GOOGLE"]),
1851
- z7.number().int().min(0).max(100)
1852
- ),
1853
- budgetType: z7.enum(["DAILY", "TOTAL"]),
1854
- campaignType: z7.enum(["SMART_CAMPAIGN", "YOUTUBE"]),
1855
- // Idempotency (client-generated UUID)
1856
- clientRequestId: z7.string().uuid(),
1857
- // Content
1858
- contentTitle: z7.string().trim().min(1).max(160),
1859
- contentType: z7.enum(["TRACK", "ALBUM", "PLAYLIST", "VIDEO"]),
1927
+ var DynamoiLaunchCampaignInputSchema = z8.object({
1928
+ adCopy: z8.string().trim().max(500).optional(),
1929
+ appleMusicUrl: z8.string().trim().min(1).max(500).optional(),
1930
+ artistId: z8.string().uuid(),
1931
+ budgetAmount: z8.number().finite().positive(),
1932
+ budgetSplits: z8.record(z8.enum(["META", "GOOGLE"]), z8.number().int().min(0).max(100)),
1933
+ budgetType: z8.enum(["DAILY", "TOTAL"]),
1934
+ campaignType: z8.enum(["SMART_CAMPAIGN", "YOUTUBE"]),
1935
+ clientRequestId: z8.string().uuid(),
1936
+ contentTitle: z8.string().trim().min(1).max(160),
1937
+ contentType: z8.enum(["TRACK", "ALBUM", "PLAYLIST", "VIDEO"]),
1860
1938
  endDate: IsoCalendarDateSchema.optional(),
1861
- // Targeting
1862
- locationTargets: z7.array(LocationTargetSchema).optional(),
1863
- // Smart Campaign creative selection (existing assets only in Phase 3)
1864
- mediaAssetIds: z7.array(z7.string().uuid()).optional(),
1865
- spotifyUrl: z7.string().trim().min(1).max(500).optional(),
1866
- useAiGeneratedCopy: z7.boolean().optional(),
1939
+ locationTargets: z8.array(LocationTargetSchema).optional(),
1940
+ mediaAssetIds: z8.array(z8.string().uuid()).optional(),
1941
+ spotifyUrl: z8.string().trim().min(1).max(500).optional(),
1942
+ useAiGeneratedCopy: z8.boolean().optional(),
1867
1943
  userIntentSummary: UserIntentSummarySchema,
1868
- youtubeVideoId: z7.string().trim().min(1).max(128).optional()
1944
+ youtubeVideoId: z8.string().trim().min(1).max(128).optional()
1869
1945
  }).strict().superRefine((data, ctx) => {
1870
- const sum = Object.values(data.budgetSplits ?? {}).reduce(
1871
- (acc, v) => acc + (Number.isFinite(v) ? v : 0),
1872
- 0
1873
- );
1946
+ const sum = Object.values(data.budgetSplits ?? {}).reduce((acc, v) => acc + (Number.isFinite(v) ? v : 0), 0);
1874
1947
  if (!(sum > 0)) {
1875
1948
  ctx.addIssue({
1876
1949
  code: "custom",
@@ -1951,7 +2024,7 @@ var PHASE_1_TOOL_DEFINITIONS = [
1951
2024
  title: "Get Account Overview"
1952
2025
  },
1953
2026
  {
1954
- description: "Use this when the user wants to see which artists or YouTube channels they manage, along with billing status, active campaign count, and their role. Pass artistId when you need the full profile/readiness details for one artist instead of a roster page. Do not use this for campaign details; use dynamoi_list_campaigns or dynamoi_get_campaign. Never use this for generic social-media or marketing advice, including Instagram follower-growth questions, unless the user explicitly asked about their Dynamoi roster. If the result is empty, the user is brand-new \u2014 do not stop with 'no records found'; route through dynamoi_get_account_overview.recommendedNextActions.",
2027
+ description: "Use this when the user wants to see which artists or YouTube channels they manage, along with billing status, active campaign count, and their role. Pass artistId when you need the full profile/readiness details for one artist instead of a roster page. Do not use this for campaign details; use dynamoi_list_campaigns or dynamoi_get_campaign. Never use this for generic social-media or marketing advice, including Instagram follower-growth questions, unless the user explicitly asked about their Dynamoi roster. If the result is empty, the user is brand-new — do not stop with 'no records found'; route through dynamoi_get_account_overview.recommendedNextActions.",
1955
2028
  destructiveHint: false,
1956
2029
  name: "dynamoi_list_artists",
1957
2030
  openWorldHint: false,
@@ -1961,7 +2034,7 @@ var PHASE_1_TOOL_DEFINITIONS = [
1961
2034
  title: "List Artists"
1962
2035
  },
1963
2036
  {
1964
- description: "Use this when the user mentions an artist, release, campaign, or smart link but you do not yet know the exact record to inspect. Do not use this for analytics summaries or billing questions once you already know the target record. If the result is empty for a brand-new user (no artists yet), do not respond 'no records found' as a terminal answer \u2014 instead suggest creating their first artist hub via dynamoi_create_smart_links_from_spotify_artist.",
2037
+ description: "Use this when the user mentions an artist, release, campaign, or smart link but you do not yet know the exact record to inspect. Do not use this for analytics summaries or billing questions once you already know the target record. If the result is empty for a brand-new user (no artists yet), do not respond 'no records found' as a terminal answer — instead suggest creating their first artist hub via dynamoi_create_smart_links_from_spotify_artist.",
1965
2038
  destructiveHint: false,
1966
2039
  name: "dynamoi_search",
1967
2040
  openWorldHint: false,
@@ -1972,7 +2045,7 @@ var PHASE_1_TOOL_DEFINITIONS = [
1972
2045
  },
1973
2046
  ...OPENAI_TOOL_DEFINITIONS,
1974
2047
  {
1975
- description: "Use this when the user wants to browse campaigns for one artist, optionally filtered by type or status. Do not use this for a single campaign deep dive; use dynamoi_get_campaign for that. Never use this to personalize generic marketing advice. If the user has no artists yet, do not call this \u2014 route via dynamoi_get_account_overview first.",
2048
+ description: "Use this when the user wants to browse campaigns for one artist, optionally filtered by type or status. Do not use this for a single campaign deep dive; use dynamoi_get_campaign for that. Never use this to personalize generic marketing advice. If the user has no artists yet, do not call this — route via dynamoi_get_account_overview first.",
1976
2049
  destructiveHint: false,
1977
2050
  name: "dynamoi_list_campaigns",
1978
2051
  openWorldHint: false,
@@ -2086,20 +2159,122 @@ var PHASE_3_TOOL_DEFINITIONS = [
2086
2159
  ];
2087
2160
 
2088
2161
  // src/server/create-server.ts
2089
- var SdkToolOutputEnvelopeSchema = z8.object({
2090
- status: z8.enum(["success", "partial_success", "error"])
2162
+ function buildDynamoiToolSecuritySchemes(scopes) {
2163
+ return [{ scopes: [...scopes], type: "oauth2" }];
2164
+ }
2165
+ var DescriptiveEntitySchema = z9.object({
2166
+ id: z9.string().optional(),
2167
+ name: z9.string().optional(),
2168
+ publicUrl: z9.string().optional(),
2169
+ summary: z9.string().optional()
2091
2170
  }).passthrough();
2092
- function buildDynamoiToolSecuritySchemes() {
2093
- return [{ scopes: [...DYNAMOI_MCP_SCOPES], type: "oauth2" }];
2171
+ var CHATGPT_DESCRIPTIVE_DATA_SCHEMAS = {
2172
+ dynamoi_get_account_overview: z9.object({
2173
+ artistCount: z9.number().optional(),
2174
+ artists: z9.object({
2175
+ count: z9.number(),
2176
+ summaries: z9.array(DescriptiveEntitySchema)
2177
+ }).optional(),
2178
+ organizationCount: z9.number().optional(),
2179
+ recommendedNextActions: z9.array(z9.string()).optional(),
2180
+ state: z9.object({}).passthrough().optional(),
2181
+ summary: z9.string().optional(),
2182
+ user: z9.object({ name: z9.string().optional() }).optional()
2183
+ }).passthrough(),
2184
+ dynamoi_get_artist_analytics: z9.object({
2185
+ artistId: z9.string().optional(),
2186
+ artistName: z9.string().optional(),
2187
+ dateRange: z9.object({ end: z9.string(), start: z9.string() }).optional(),
2188
+ summary: z9.string().optional()
2189
+ }).passthrough(),
2190
+ dynamoi_get_campaign: DescriptiveEntitySchema.extend({
2191
+ artistId: z9.string().optional(),
2192
+ contentTitle: z9.string().optional(),
2193
+ nextActions: z9.array(z9.string()).optional(),
2194
+ status: z9.string().optional()
2195
+ }).passthrough(),
2196
+ dynamoi_get_platform_status: z9.object({
2197
+ artistId: z9.string().optional(),
2198
+ artistName: z9.string().optional(),
2199
+ platforms: z9.object({}).passthrough().optional(),
2200
+ summary: z9.string().optional()
2201
+ }).passthrough(),
2202
+ dynamoi_get_smart_link: DescriptiveEntitySchema.extend({
2203
+ artistId: z9.string().optional(),
2204
+ artistName: z9.string().optional(),
2205
+ nextActions: z9.array(z9.string()).optional(),
2206
+ publishState: z9.string().optional(),
2207
+ releaseTitle: z9.string().optional(),
2208
+ theme: z9.string().optional()
2209
+ }).passthrough(),
2210
+ dynamoi_list_artists: z9.object({
2211
+ artists: z9.array(DescriptiveEntitySchema).optional(),
2212
+ nextCursor: z9.string().optional(),
2213
+ summary: z9.string().optional(),
2214
+ totalCount: z9.number().optional()
2215
+ }).passthrough(),
2216
+ dynamoi_list_campaigns: z9.object({
2217
+ campaigns: z9.array(DescriptiveEntitySchema).optional(),
2218
+ nextCursor: z9.string().optional(),
2219
+ summary: z9.string().optional(),
2220
+ totalCount: z9.number().optional()
2221
+ }).passthrough(),
2222
+ dynamoi_preview_smart_link_themes: z9.object({
2223
+ artistName: z9.string(),
2224
+ releaseTitle: z9.string(),
2225
+ themes: z9.array(DescriptiveEntitySchema)
2226
+ }).passthrough(),
2227
+ dynamoi_search: z9.object({
2228
+ nextCursor: z9.string().optional(),
2229
+ results: z9.array(DescriptiveEntitySchema).optional(),
2230
+ summary: z9.string().optional(),
2231
+ totalCount: z9.number().optional()
2232
+ }).passthrough(),
2233
+ dynamoi_update_smart_link: DescriptiveEntitySchema.extend({
2234
+ artistId: z9.string().optional(),
2235
+ artistName: z9.string().optional(),
2236
+ defaultTheme: z9.string().optional(),
2237
+ renderQueuedCount: z9.number().optional(),
2238
+ renderWarning: z9.string().nullable().optional()
2239
+ }).passthrough(),
2240
+ fetch: DescriptiveEntitySchema,
2241
+ search: z9.object({ results: z9.array(DescriptiveEntitySchema).optional() }).passthrough()
2242
+ };
2243
+ function getAdvertisedToolOutputSchema(options) {
2244
+ if (options.toolProfile !== "chatgpt-app") {
2245
+ return options.canonical;
2246
+ }
2247
+ const dataSchema = CHATGPT_DESCRIPTIVE_DATA_SCHEMAS[options.toolName];
2248
+ if (!dataSchema) {
2249
+ return options.canonical;
2250
+ }
2251
+ return z9.object({
2252
+ data: dataSchema.optional(),
2253
+ kind: z9.string().optional(),
2254
+ message: z9.string().optional(),
2255
+ status: z9.enum(["success", "partial_success", "error"])
2256
+ }).passthrough();
2257
+ }
2258
+ function getDynamoiToolOAuthScopes(toolName, providerScopes) {
2259
+ const requiredScopes = DYNAMOI_MCP_TOOL_SCOPES[toolName];
2260
+ if (!providerScopes.some((scope) => scope.startsWith("dynamoi:"))) {
2261
+ return providerScopes;
2262
+ }
2263
+ const missingScopes = requiredScopes.filter((scope) => !providerScopes.includes(scope));
2264
+ if (missingScopes.length > 0) {
2265
+ throw new Error(`MCP provider does not support ${toolName} scopes: ${missingScopes.join(", ")}`);
2266
+ }
2267
+ return requiredScopes;
2094
2268
  }
2095
2269
  var DYNAMOI_TOOL_DEFINITIONS = [
2096
2270
  ...PHASE_1_TOOL_DEFINITIONS,
2097
2271
  ...PHASE_ONBOARDING_TOOL_DEFINITIONS,
2098
2272
  ...PHASE_2_TOOL_DEFINITIONS,
2099
2273
  ...PHASE_3_TOOL_DEFINITIONS,
2274
+ SMART_LINK_THEME_PREVIEW_TOOL_DEFINITION,
2100
2275
  ...PHASE_4_TOOL_DEFINITIONS
2101
2276
  ];
2102
- var CHATGPT_APP_EXCLUDED_TOOL_NAMES = /* @__PURE__ */ new Set([
2277
+ var CHATGPT_APP_EXCLUDED_TOOL_NAMES = new Set([
2103
2278
  "dynamoi_get_billing",
2104
2279
  "dynamoi_get_campaign_readiness",
2105
2280
  "dynamoi_launch_campaign",
@@ -2114,9 +2289,7 @@ function getDynamoiToolDefinitions(options) {
2114
2289
  if ((options?.toolProfile ?? "full") !== "chatgpt-app") {
2115
2290
  return definitions;
2116
2291
  }
2117
- return definitions.filter(
2118
- (definition) => !CHATGPT_APP_EXCLUDED_TOOL_NAMES.has(definition.name)
2119
- );
2292
+ return definitions.filter((definition) => !CHATGPT_APP_EXCLUDED_TOOL_NAMES.has(definition.name));
2120
2293
  }
2121
2294
  var DYNAMOI_TOOL_DISPATCHERS = {
2122
2295
  dynamoi_create_smart_link_from_spotify: (adapter, input) => adapter.createSmartLinkFromSpotify(input),
@@ -2134,6 +2307,7 @@ var DYNAMOI_TOOL_DISPATCHERS = {
2134
2307
  dynamoi_list_campaigns: (adapter, input) => adapter.listCampaigns(input),
2135
2308
  dynamoi_list_media_assets: (adapter, input) => adapter.listMediaAssets(input),
2136
2309
  dynamoi_list_smart_links: (adapter, input) => adapter.listSmartLinks(input),
2310
+ dynamoi_preview_smart_link_themes: (_adapter, input) => Promise.resolve(previewSmartLinkThemes(input)),
2137
2311
  dynamoi_search: (adapter, input) => adapter.search(input),
2138
2312
  dynamoi_start_meta_connection: (adapter, input) => adapter.startMetaConnection(input),
2139
2313
  dynamoi_start_youtube_channel_link: (adapter, input) => adapter.startYoutubeChannelLink(input),
@@ -2181,115 +2355,82 @@ function asValidatedTextResult(options) {
2181
2355
  }
2182
2356
  function createDynamoiMcpServer(options) {
2183
2357
  const toolProfile = options.toolProfile ?? "full";
2184
- const server = new McpServer(
2185
- {
2186
- name: "dynamoi",
2187
- version: DYNAMOI_MCP_VERSION,
2188
- websiteUrl: options.websiteUrl ?? "https://dynamoi.com"
2189
- },
2190
- {
2191
- instructions: toolProfile === "chatgpt-app" ? DYNAMOI_CHATGPT_APP_INSTRUCTIONS : DYNAMOI_MCP_INSTRUCTIONS
2192
- }
2193
- );
2358
+ const server = new McpServer({
2359
+ name: "dynamoi",
2360
+ version: DYNAMOI_MCP_VERSION,
2361
+ websiteUrl: options.websiteUrl ?? "https://dynamoi.com"
2362
+ }, {
2363
+ instructions: toolProfile === "chatgpt-app" ? DYNAMOI_CHATGPT_APP_INSTRUCTIONS : DYNAMOI_MCP_INSTRUCTIONS
2364
+ });
2194
2365
  for (const def of getDynamoiToolDefinitions({ toolProfile })) {
2195
2366
  const title = def.title;
2196
2367
  const dispatcher = DYNAMOI_TOOL_DISPATCHERS[def.name];
2197
- const idempotentHint = "idempotentHint" in def && typeof def.idempotentHint === "boolean" ? def.idempotentHint : void 0;
2198
- server.registerTool(
2199
- def.name,
2200
- {
2201
- _meta: {
2202
- securitySchemes: buildDynamoiToolSecuritySchemes()
2203
- },
2204
- annotations: {
2205
- destructiveHint: def.destructiveHint,
2206
- ...typeof idempotentHint === "boolean" ? { idempotentHint } : {},
2207
- openWorldHint: def.openWorldHint,
2208
- readOnlyHint: def.readOnlyHint
2209
- },
2210
- description: def.description,
2211
- inputSchema: def.schema,
2212
- // The SDK's runtime output validator currently only normalizes object
2213
- // schemas; our canonical output schemas are unions of success/error
2214
- // envelopes and are validated below in asValidatedTextResult().
2215
- outputSchema: SdkToolOutputEnvelopeSchema,
2216
- title
2368
+ const idempotentHint = "idempotentHint" in def && typeof def.idempotentHint === "boolean" ? def.idempotentHint : undefined;
2369
+ server.registerTool(def.name, {
2370
+ _meta: {
2371
+ securitySchemes: buildDynamoiToolSecuritySchemes(getDynamoiToolOAuthScopes(def.name, options.oauthScopes ?? DYNAMOI_BETTER_AUTH_MCP_SCOPES)),
2372
+ ...def.name === "dynamoi_preview_smart_link_themes" ? {
2373
+ "openai/outputTemplate": SMART_LINK_THEME_PREVIEW_RESOURCE_URI,
2374
+ ui: { resourceUri: SMART_LINK_THEME_PREVIEW_RESOURCE_URI }
2375
+ } : {}
2376
+ },
2377
+ annotations: {
2378
+ destructiveHint: def.destructiveHint,
2379
+ ...typeof idempotentHint === "boolean" ? { idempotentHint } : {},
2380
+ openWorldHint: def.openWorldHint,
2381
+ readOnlyHint: def.readOnlyHint
2217
2382
  },
2218
- async (input) => asValidatedTextResult({
2219
- envelope: await dispatcher(options.adapter, input),
2220
- outputSchema: def.outputSchema,
2221
- toolName: def.name
2222
- })
2223
- );
2383
+ description: def.description,
2384
+ inputSchema: def.schema,
2385
+ outputSchema: getAdvertisedToolOutputSchema({
2386
+ canonical: def.outputSchema,
2387
+ toolName: def.name,
2388
+ toolProfile
2389
+ }),
2390
+ title
2391
+ }, async (input) => {
2392
+ const startedAt = Date.now();
2393
+ try {
2394
+ const envelope = await dispatcher(options.adapter, input);
2395
+ try {
2396
+ await options.onToolCall?.({
2397
+ durationMs: Date.now() - startedAt,
2398
+ result: envelope,
2399
+ toolName: def.name
2400
+ });
2401
+ } catch {}
2402
+ return asValidatedTextResult({
2403
+ envelope,
2404
+ outputSchema: def.outputSchema,
2405
+ toolName: def.name
2406
+ });
2407
+ } catch (error) {
2408
+ try {
2409
+ await options.onToolCall?.({
2410
+ durationMs: Date.now() - startedAt,
2411
+ error,
2412
+ toolName: def.name
2413
+ });
2414
+ } catch {}
2415
+ throw error;
2416
+ }
2417
+ });
2224
2418
  }
2419
+ registerSmartLinkThemePreviewResource(server);
2225
2420
  if (toolProfile === "full") {
2226
2421
  registerDynamoiPrompts(server);
2227
2422
  registerDynamoiResources(server, options.adapter);
2228
2423
  }
2229
2424
  return server;
2230
2425
  }
2231
-
2232
2426
  // src/transport/http.ts
2233
- import { randomUUID } from "crypto";
2234
2427
  import { WebStandardStreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/webStandardStreamableHttp.js";
2235
- import { isInitializeRequest } from "@modelcontextprotocol/sdk/types.js";
2236
- var transports = /* @__PURE__ */ new Map();
2237
- var SESSION_TTL_MS = 30 * 60 * 1e3;
2238
- var MAX_SESSIONS = 250;
2239
- function closeTransportBestEffort(entry) {
2240
- void entry.transport.close().catch(() => {
2241
- });
2242
- }
2243
- function cleanupTransports(nowMs) {
2244
- for (const [sid, entry] of transports.entries()) {
2245
- const expired = nowMs - entry.lastUsedAtMs > SESSION_TTL_MS;
2246
- if (expired) {
2247
- closeTransportBestEffort(entry);
2248
- transports.delete(sid);
2249
- }
2250
- }
2251
- if (transports.size > MAX_SESSIONS) {
2252
- const entries = Array.from(transports.entries()).sort(
2253
- (a, b) => a[1].lastUsedAtMs - b[1].lastUsedAtMs
2254
- );
2255
- const over = transports.size - MAX_SESSIONS;
2256
- for (let i = 0; i < over; i += 1) {
2257
- const sid = entries[i]?.[0];
2258
- if (sid) {
2259
- const entry = entries[i]?.[1];
2260
- if (entry) {
2261
- closeTransportBestEffort(entry);
2262
- }
2263
- transports.delete(sid);
2264
- }
2265
- }
2266
- }
2267
- }
2268
- function getHeader(request, name) {
2269
- const value = request.headers.get(name);
2270
- return value && value.trim().length > 0 ? value : null;
2271
- }
2272
- function jsonRpcSessionNotFound() {
2273
- return new Response(
2274
- JSON.stringify({
2275
- error: { code: -32001, message: "Session not found" },
2276
- id: null,
2277
- jsonrpc: "2.0"
2278
- }),
2279
- {
2280
- headers: { "content-type": "application/json" },
2281
- status: 404
2282
- }
2283
- );
2284
- }
2285
2428
  function isRecord(value) {
2286
2429
  return typeof value === "object" && value !== null && !Array.isArray(value);
2287
2430
  }
2288
2431
  function normalizeLegacyDynamoiToolCallArguments(parsedBody) {
2289
2432
  if (Array.isArray(parsedBody)) {
2290
- return parsedBody.map(
2291
- (message) => normalizeLegacyDynamoiToolCallArguments(message)
2292
- );
2433
+ return parsedBody.map((message) => normalizeLegacyDynamoiToolCallArguments(message));
2293
2434
  }
2294
2435
  if (!isRecord(parsedBody) || parsedBody.method !== "tools/call") {
2295
2436
  return parsedBody;
@@ -2311,46 +2452,21 @@ function normalizeLegacyDynamoiToolCallArguments(parsedBody) {
2311
2452
  };
2312
2453
  }
2313
2454
  async function handleMcpHttpRequest(options) {
2314
- const nowMs = Date.now();
2315
- const enableSessions = options.enableSessions ?? true;
2316
- const parsedBody = normalizeLegacyDynamoiToolCallArguments(
2317
- options.parsedBody
2318
- );
2319
- cleanupTransports(nowMs);
2320
- const sessionId = enableSessions ? getHeader(options.request, "mcp-session-id") : null;
2321
- const existing = sessionId ? transports.get(sessionId) : void 0;
2322
- if (existing) {
2323
- if (existing.contextKey !== options.sessionContextKey) {
2324
- closeTransportBestEffort(existing);
2325
- transports.delete(sessionId);
2326
- return jsonRpcSessionNotFound();
2327
- }
2328
- existing.lastUsedAtMs = nowMs;
2329
- const response = await existing.transport.handleRequest(options.request, {
2330
- parsedBody
2455
+ if (options.request.method.toUpperCase() !== "POST") {
2456
+ return new Response(JSON.stringify({
2457
+ error: { code: -32000, message: "Method not allowed." },
2458
+ id: null,
2459
+ jsonrpc: "2.0"
2460
+ }), {
2461
+ headers: {
2462
+ Allow: "POST",
2463
+ "content-type": "application/json"
2464
+ },
2465
+ status: 405
2331
2466
  });
2332
- if (options.request.method.toUpperCase() === "DELETE" && sessionId) {
2333
- closeTransportBestEffort(existing);
2334
- transports.delete(sessionId);
2335
- }
2336
- return response;
2337
- }
2338
- if (sessionId && !isInitializeRequest(parsedBody)) {
2339
- return jsonRpcSessionNotFound();
2340
2467
  }
2341
- const isInit = isInitializeRequest(parsedBody);
2342
- const transport = new WebStandardStreamableHTTPServerTransport({
2343
- onsessioninitialized: (sid) => {
2344
- transports.set(sid, {
2345
- contextKey: options.sessionContextKey,
2346
- createdAtMs: nowMs,
2347
- lastUsedAtMs: nowMs,
2348
- transport
2349
- });
2350
- cleanupTransports(Date.now());
2351
- },
2352
- ...enableSessions && isInit ? { sessionIdGenerator: () => randomUUID() } : {}
2353
- });
2468
+ const parsedBody = normalizeLegacyDynamoiToolCallArguments(options.parsedBody);
2469
+ const transport = new WebStandardStreamableHTTPServerTransport;
2354
2470
  const server = options.createServer();
2355
2471
  await server.connect(transport);
2356
2472
  return transport.handleRequest(options.request, {
@@ -2358,54 +2474,60 @@ async function handleMcpHttpRequest(options) {
2358
2474
  });
2359
2475
  }
2360
2476
  export {
2361
- DYNAMOI_MCP_SCOPES,
2362
- DYNAMOI_MCP_VERSION,
2363
- DateRangeSchema2 as DateRangeSchema,
2364
- DynamoiCreateSmartLinkFromSpotifyInputSchema,
2365
- DynamoiCreateSmartLinksFromSpotifyArtistInputSchema,
2366
- DynamoiGetArtistAnalyticsInputSchema,
2367
- DynamoiGetArtistInputSchema,
2368
- DynamoiGetBillingInputSchema,
2369
- DynamoiGetCampaignAnalyticsInputSchema,
2370
- DynamoiGetCampaignDeploymentStatusInputSchema,
2371
- DynamoiGetCampaignInputSchema,
2372
- DynamoiGetCampaignReadinessInputSchema,
2373
- DynamoiGetCurrentUserInputSchema,
2374
- DynamoiGetOnboardingStatusInputSchema,
2375
- DynamoiGetPlatformStatusInputSchema,
2376
- DynamoiGetSmartLinkAnalyticsInputSchema,
2377
- DynamoiGetSmartLinkArtistSettingsInputSchema,
2378
- DynamoiGetSmartLinkInputSchema,
2379
- DynamoiLaunchCampaignInputSchema,
2380
- DynamoiListArtistsInputSchema,
2381
- DynamoiListAvailableCountriesInputSchema,
2382
- DynamoiListCampaignsInputSchema,
2383
- DynamoiListMediaAssetsInputSchema,
2384
- DynamoiListSmartLinksInputSchema,
2385
- DynamoiOpenAiFetchInputSchema,
2386
- DynamoiOpenAiSearchInputSchema,
2387
- DynamoiPauseCampaignInputSchema,
2388
- DynamoiPublishSmartLinkInputSchema,
2389
- DynamoiResumeCampaignInputSchema,
2390
- DynamoiSearchInputSchema,
2391
- DynamoiStartMetaConnectionInputSchema,
2392
- DynamoiStartYoutubeChannelLinkInputSchema,
2393
- DynamoiUpdateBudgetInputSchema,
2394
- DynamoiUpdateCampaignInputSchema,
2395
- DynamoiUpdateSmartLinkArtistSettingsInputSchema,
2396
- DynamoiUpdateSmartLinkInputSchema,
2397
- PHASE_1_TOOL_DEFINITIONS,
2398
- PHASE_2_TOOL_DEFINITIONS,
2399
- PHASE_3_TOOL_DEFINITIONS,
2400
- PHASE_4_TOOL_DEFINITIONS,
2401
- PHASE_ONBOARDING_TOOL_DEFINITIONS,
2402
- ToolFormatSchema2 as ToolFormatSchema,
2403
- buildProtectedResourceMetadata,
2404
- buildWwwAuthenticateHeader,
2405
- createDynamoiMcpServer,
2406
- getDynamoiToolDefinitions,
2407
- handleMcpHttpRequest,
2477
+ verifyAccessToken,
2408
2478
  parseDynamoiGetSmartLinkInput,
2409
- verifyAccessToken
2479
+ handleMcpHttpRequest,
2480
+ getDynamoiToolDefinitions,
2481
+ createDynamoiMcpServer,
2482
+ buildWwwAuthenticateHeader,
2483
+ buildProtectedResourceMetadata,
2484
+ ToolFormatSchema2 as ToolFormatSchema,
2485
+ PROSPECTIVE_BUDGET_FUNDING_CONSENT_VERSION,
2486
+ PROSPECTIVE_BUDGET_FUNDING_CONSENT_COPY_HASH,
2487
+ PROSPECTIVE_BUDGET_FUNDING_CONSENT_COPY,
2488
+ PHASE_ONBOARDING_TOOL_DEFINITIONS,
2489
+ PHASE_4_TOOL_DEFINITIONS,
2490
+ PHASE_3_TOOL_DEFINITIONS,
2491
+ PHASE_2_TOOL_DEFINITIONS,
2492
+ PHASE_1_TOOL_DEFINITIONS,
2493
+ DynamoiUpdateSmartLinkInputSchema,
2494
+ DynamoiUpdateSmartLinkArtistSettingsInputSchema,
2495
+ DynamoiUpdateCampaignInputSchema,
2496
+ DynamoiUpdateBudgetInputSchema,
2497
+ DynamoiStartYoutubeChannelLinkInputSchema,
2498
+ DynamoiStartMetaConnectionInputSchema,
2499
+ DynamoiSearchInputSchema,
2500
+ DynamoiResumeCampaignInputSchema,
2501
+ DynamoiPauseCampaignInputSchema,
2502
+ DynamoiOpenAiSearchInputSchema,
2503
+ DynamoiOpenAiFetchInputSchema,
2504
+ DynamoiListSmartLinksInputSchema,
2505
+ DynamoiListMediaAssetsInputSchema,
2506
+ DynamoiListCampaignsInputSchema,
2507
+ DynamoiListAvailableCountriesInputSchema,
2508
+ DynamoiListArtistsInputSchema,
2509
+ DynamoiLaunchCampaignInputSchema,
2510
+ DynamoiGetSmartLinkInputSchema,
2511
+ DynamoiGetSmartLinkArtistSettingsInputSchema,
2512
+ DynamoiGetSmartLinkAnalyticsInputSchema,
2513
+ DynamoiGetPlatformStatusInputSchema,
2514
+ DynamoiGetOnboardingStatusInputSchema,
2515
+ DynamoiGetCurrentUserInputSchema,
2516
+ DynamoiGetCampaignReadinessInputSchema,
2517
+ DynamoiGetCampaignInputSchema,
2518
+ DynamoiGetCampaignDeploymentStatusInputSchema,
2519
+ DynamoiGetCampaignAnalyticsInputSchema,
2520
+ DynamoiGetBillingInputSchema,
2521
+ DynamoiGetArtistInputSchema,
2522
+ DynamoiGetArtistAnalyticsInputSchema,
2523
+ DynamoiCreateSmartLinksFromSpotifyArtistInputSchema,
2524
+ DynamoiCreateSmartLinkFromSpotifyInputSchema,
2525
+ DateRangeSchema2 as DateRangeSchema,
2526
+ DYNAMOI_MCP_VERSION,
2527
+ DYNAMOI_MCP_TOOL_SCOPES,
2528
+ DYNAMOI_MCP_SCOPES,
2529
+ DYNAMOI_BETTER_AUTH_MCP_SCOPES
2410
2530
  };
2411
- //# sourceMappingURL=index.js.map
2531
+
2532
+ //# debugId=5EEF6599A31E134864756E2164756E21
2533
+ //# sourceMappingURL=index.js.map