@dynamoi/mcp 0.6.5 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -4,12 +4,246 @@ import {
4
4
  DYNAMOI_MCP_TOOL_SCOPES,
5
5
  buildProtectedResourceMetadata,
6
6
  buildWwwAuthenticateHeader
7
- } from "./chunk-4jfaxshz.js";
7
+ } from "./chunk-2jm8hjsz.js";
8
8
  import {
9
9
  PROSPECTIVE_BUDGET_FUNDING_CONSENT_COPY,
10
10
  PROSPECTIVE_BUDGET_FUNDING_CONSENT_COPY_HASH,
11
11
  PROSPECTIVE_BUDGET_FUNDING_CONSENT_VERSION
12
12
  } from "./chunk-kb3xpcrb.js";
13
+
14
+ // src/server/distribution-tools.ts
15
+ import * as z2 from "zod/v4";
16
+
17
+ // src/server/output-schemas.ts
18
+ import * as z from "zod/v4";
19
+ var MoneyDisplayOutputSchema = z.object({
20
+ amountUsd: z.number(),
21
+ formatted: z.string()
22
+ }).strict();
23
+ function createOutputEnvelopeSchema(dataSchema, options) {
24
+ const statuses = options?.allowPartial ? ["success", "partial_success", "error"] : ["success", "error"];
25
+ return z.object({
26
+ data: dataSchema.optional(),
27
+ kind: z.enum(["validation", "business", "platform", "unknown"]).optional(),
28
+ message: z.string().optional(),
29
+ status: z.enum(statuses)
30
+ }).strict().superRefine((value, context) => {
31
+ if (value.status === "error" && !value.message) {
32
+ context.addIssue({
33
+ code: "custom",
34
+ message: "Error tool results require a message.",
35
+ path: ["message"]
36
+ });
37
+ }
38
+ if (value.status !== "error" && value.data === undefined) {
39
+ context.addIssue({
40
+ code: "custom",
41
+ message: "Successful tool results require data.",
42
+ path: ["data"]
43
+ });
44
+ }
45
+ });
46
+ }
47
+ var AnyToolDataOutputSchema = z.object({}).passthrough();
48
+ var MediaAssetSummaryOutputSchema = z.object({
49
+ aspectRatio: z.string().optional(),
50
+ createdAt: z.string(),
51
+ fileName: z.string().optional(),
52
+ fileType: z.string(),
53
+ height: z.number().optional(),
54
+ id: z.string(),
55
+ url: z.string().optional(),
56
+ urlExpiresAt: z.string().optional(),
57
+ width: z.number().optional()
58
+ }).strict();
59
+ var ListMediaAssetsDataOutputSchema = z.object({
60
+ assets: z.array(MediaAssetSummaryOutputSchema),
61
+ nextCursor: z.string().optional()
62
+ }).strict();
63
+ var ListMediaAssetsSummaryOutputSchema = z.object({
64
+ nextCursor: z.string().optional(),
65
+ summary: z.string(),
66
+ totalCount: z.number()
67
+ }).strict();
68
+ var SmartLinkStatusSchemas = {
69
+ claimStatus: z.enum([
70
+ "auto_approved",
71
+ "pending_ops_review",
72
+ "verification_deferred",
73
+ "approved_by_ops",
74
+ "rejected"
75
+ ]),
76
+ odesliStatus: z.enum(["pending", "resolved", "failed"]),
77
+ publishState: z.enum(["published", "unpublished"]),
78
+ renderState: z.enum(["queued", "rendering", "rendered", "failed"]),
79
+ takedownStatus: z.enum(["none", "active", "resolved"]),
80
+ theme: z.enum(["classic", "brutalist", "aurora", "cinematic"])
81
+ };
82
+ var SmartLinkSummaryOutputSchema = z.object({
83
+ artistHubUrl: z.string(),
84
+ artistId: z.string(),
85
+ artistName: z.string(),
86
+ claimStatus: SmartLinkStatusSchemas.claimStatus,
87
+ createdAt: z.string(),
88
+ id: z.string(),
89
+ isPublic: z.boolean(),
90
+ localizedPublicUrls: z.array(z.string()).optional(),
91
+ odesliStatus: SmartLinkStatusSchemas.odesliStatus,
92
+ publicUrl: z.string(),
93
+ publishState: SmartLinkStatusSchemas.publishState,
94
+ releaseSlug: z.string(),
95
+ releaseTitle: z.string(),
96
+ releaseType: z.string(),
97
+ renderState: SmartLinkStatusSchemas.renderState,
98
+ spotifyUrl: z.string().nullable(),
99
+ takedownStatus: SmartLinkStatusSchemas.takedownStatus,
100
+ theme: SmartLinkStatusSchemas.theme,
101
+ updatedAt: z.string()
102
+ }).strict();
103
+ var SmartLinkDetailsOutputSchema = SmartLinkSummaryOutputSchema.extend({
104
+ actionRequired: z.array(z.string()).optional(),
105
+ customDescription: z.string().nullable(),
106
+ nextActions: z.array(z.string()),
107
+ originalSpotifyUrl: z.string().nullable(),
108
+ summary: z.string(),
109
+ warnings: z.array(z.string()).optional()
110
+ }).strict();
111
+ var ListSmartLinksDataOutputSchema = z.object({
112
+ nextCursor: z.string().optional(),
113
+ smartLinks: z.array(SmartLinkSummaryOutputSchema)
114
+ }).strict();
115
+ var ListSmartLinksSummaryOutputSchema = z.object({
116
+ nextCursor: z.string().optional(),
117
+ summary: z.string(),
118
+ totalCount: z.number()
119
+ }).strict();
120
+ var AvailableCountryOutputSchema = z.object({
121
+ code: z.string(),
122
+ dominantLanguage: z.string().optional(),
123
+ googleAdsId: z.number(),
124
+ name: z.string()
125
+ }).strict();
126
+ var ListAvailableCountriesDataOutputSchema = z.object({
127
+ campaignType: z.enum(["SMART_CAMPAIGN", "YOUTUBE"]),
128
+ countries: z.array(AvailableCountryOutputSchema),
129
+ nextCursor: z.string().optional(),
130
+ notes: z.array(z.string()),
131
+ source: z.enum(["SMART_CAMPAIGN_COUNTRIES", "GOOGLE_ADS_COUNTRIES"]),
132
+ totalCount: z.number()
133
+ }).strict();
134
+ var SummaryCountOutputSchema = z.object({
135
+ nextCursor: z.string().optional(),
136
+ summary: z.string(),
137
+ totalCount: z.number()
138
+ }).strict();
139
+ var SummaryWarningsActionsOutputSchema = z.object({
140
+ actionRequired: z.array(z.string()).optional(),
141
+ summary: z.string(),
142
+ warnings: z.array(z.string()).optional()
143
+ }).strict();
144
+ var NormalizedTargetingOutputSchema = z.union([
145
+ z.object({ mode: z.literal("GLOBAL") }).strict(),
146
+ z.object({
147
+ countries: z.array(z.object({ code: z.string(), name: z.string() }).strict()),
148
+ mode: z.literal("COUNTRIES")
149
+ }).strict()
150
+ ]);
151
+ var GetCampaignReadinessDataOutputSchema = z.object({
152
+ artistId: z.string(),
153
+ artistName: z.string(),
154
+ blockingIssues: z.array(z.string()),
155
+ campaignType: z.enum(["SMART_CAMPAIGN", "YOUTUBE"]),
156
+ isReady: z.boolean(),
157
+ missingInputs: z.array(z.string()),
158
+ normalizedTargeting: NormalizedTargetingOutputSchema,
159
+ recommendedNextAction: z.string(),
160
+ warnings: z.array(z.string())
161
+ }).strict();
162
+ var CreateSmartLinkFromSpotifyDataOutputSchema = SmartLinkDetailsOutputSchema.extend({
163
+ outcome: z.enum(["created", "existing"]),
164
+ workflowWarning: z.string().nullable()
165
+ }).strict();
166
+ var CreateSmartLinksFromSpotifyArtistDataOutputSchema = z.object({
167
+ artistCreatedFromSpotify: z.boolean().optional(),
168
+ artistHubUrl: z.string(),
169
+ artistId: z.string(),
170
+ artistName: z.string(),
171
+ catalogImportStatus: z.enum(["started", "start_failed"]),
172
+ currentSmartLinkCount: z.number(),
173
+ existingCount: z.number(),
174
+ initialSmartLink: SmartLinkSummaryOutputSchema.nullable(),
175
+ newlyAvailableCount: z.number(),
176
+ nextActions: z.array(z.string()),
177
+ smartLinks: z.array(SmartLinkSummaryOutputSchema),
178
+ spotifyArtistUrl: z.string(),
179
+ summary: z.string(),
180
+ warnings: z.array(z.string()).optional()
181
+ }).strict();
182
+ var LaunchCampaignDataOutputSchema = z.object({
183
+ budget: MoneyDisplayOutputSchema,
184
+ budgetType: z.enum(["DAILY", "TOTAL"]),
185
+ campaignType: z.enum(["SMART_CAMPAIGN", "YOUTUBE"]),
186
+ contentTitle: z.string(),
187
+ deliveryState: z.enum(["ACTIVE", "PENDING_REVIEW", "CONTENT_VALIDATION"]),
188
+ id: z.string(),
189
+ isLive: z.boolean(),
190
+ nextSteps: z.array(z.string()),
191
+ platforms: z.array(z.string()),
192
+ status: z.string(),
193
+ summary: z.string(),
194
+ warnings: z.array(z.string()).optional()
195
+ }).strict();
196
+ var AnyOutputEnvelopeSchema = createOutputEnvelopeSchema(AnyToolDataOutputSchema, { allowPartial: true });
197
+ var ListMediaAssetsOutputEnvelopeSchema = createOutputEnvelopeSchema(z.union([
198
+ ListMediaAssetsDataOutputSchema,
199
+ ListMediaAssetsSummaryOutputSchema
200
+ ]));
201
+ var LaunchCampaignOutputEnvelopeSchema = createOutputEnvelopeSchema(LaunchCampaignDataOutputSchema);
202
+ var ListAvailableCountriesOutputEnvelopeSchema = createOutputEnvelopeSchema(z.union([ListAvailableCountriesDataOutputSchema, SummaryCountOutputSchema]));
203
+ var GetCampaignReadinessOutputEnvelopeSchema = createOutputEnvelopeSchema(z.union([
204
+ GetCampaignReadinessDataOutputSchema,
205
+ SummaryWarningsActionsOutputSchema
206
+ ]));
207
+ var CreateSmartLinkFromSpotifyOutputEnvelopeSchema = createOutputEnvelopeSchema(CreateSmartLinkFromSpotifyDataOutputSchema);
208
+ var CreateSmartLinksFromSpotifyArtistOutputEnvelopeSchema = createOutputEnvelopeSchema(CreateSmartLinksFromSpotifyArtistDataOutputSchema);
209
+ var ListSmartLinksOutputEnvelopeSchema = createOutputEnvelopeSchema(z.union([ListSmartLinksDataOutputSchema, ListSmartLinksSummaryOutputSchema]));
210
+
211
+ // src/server/distribution-tools.ts
212
+ var DynamoiGetDistributionApplicationInputSchema = z2.object({
213
+ artistId: z2.string().uuid()
214
+ }).strict();
215
+ var DynamoiApplyForDistributionInputSchema = z2.object({
216
+ adultSignerAttestation: z2.literal(true),
217
+ applicantCountry: z2.string().trim().length(2),
218
+ artistId: z2.string().uuid(),
219
+ confirmApplicationSubmission: z2.literal(true),
220
+ payoutCountry: z2.string().trim().length(2),
221
+ taxResidencyCountry: z2.string().trim().length(2),
222
+ userIntentSummary: z2.string().trim().min(1).max(500)
223
+ }).strict();
224
+ var DISTRIBUTION_TOOL_DEFINITIONS = [
225
+ {
226
+ description: "Use this when the user asks whether an artist qualifies for Dynamoi music distribution, wants the five application requirements, or wants the status of an existing distribution application. It checks Spotify connection, at least 1,000 Spotify followers, at least 10,000 verified Soundcharts monthly listeners, connected Facebook Page plus Instagram professional identity, and a connected YouTube channel. Meeting all five requirements permits an application but never guarantees approval. When the connection tools are available, use purpose=distribution_identity for missing Meta or YouTube identity; otherwise send the user to the distribution application in Dynamoi. Identity connections do not require advertising billing.",
227
+ destructiveHint: false,
228
+ name: "dynamoi_get_distribution_application",
229
+ openWorldHint: false,
230
+ outputSchema: AnyOutputEnvelopeSchema,
231
+ readOnlyHint: true,
232
+ schema: DynamoiGetDistributionApplicationInputSchema,
233
+ title: "Check Distribution Application"
234
+ },
235
+ {
236
+ description: "Submit an artist's application for Dynamoi music distribution after the user explicitly asks to apply and all five eligibility requirements are met. This records an application for manual review; it does not approve distribution, accept an agreement, submit a release, transfer rights, configure splits or tax forms, or deliver music to stores. All three two-letter country codes, an adult signer attestation, confirmApplicationSubmission=true, and a concise userIntentSummary are required. Repeated submission is idempotent for an active application.",
237
+ destructiveHint: false,
238
+ idempotentHint: true,
239
+ name: "dynamoi_apply_for_distribution",
240
+ openWorldHint: false,
241
+ outputSchema: AnyOutputEnvelopeSchema,
242
+ readOnlyHint: false,
243
+ schema: DynamoiApplyForDistributionInputSchema,
244
+ title: "Apply for Music Distribution"
245
+ }
246
+ ];
13
247
  // src/auth/verify-token.ts
14
248
  import { createRemoteJWKSet, jwtVerify } from "jose";
15
249
  var jwksByUrl = new Map;
@@ -79,24 +313,25 @@ async function verifyAccessToken(options) {
79
313
  }
80
314
  // src/server/create-server.ts
81
315
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
82
- import * as z9 from "zod/v4";
316
+ import * as z10 from "zod/v4";
83
317
 
84
318
  // src/version.ts
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";
319
+ var BUNDLED_DYNAMOI_MCP_VERSION = "0.7.1";
320
+ var DYNAMOI_MCP_VERSION = BUNDLED_DYNAMOI_MCP_VERSION.length > 0 && !BUNDLED_DYNAMOI_MCP_VERSION.includes("__") ? BUNDLED_DYNAMOI_MCP_VERSION : "0.7.1";
87
321
 
88
322
  // src/server/instructions.ts
89
323
  var DYNAMOI_MCP_INSTRUCTIONS = `
90
324
  You are operating Dynamoi's tools on behalf of the authenticated user. Dynamoi helps
91
- music artists promote on Spotify and YouTube creators grow channels through managed
92
- Meta and Google ad campaigns. Smart Links are free to create and manage. High-popularity
325
+ artists and labels create music-promotion campaigns, build Smart Links, review analytics,
326
+ and apply for music distribution. YouTube creators can grow channels through managed
327
+ Google ad campaigns. Smart Links are free to create and manage. High-popularity
93
328
  or unverifiable artist links may stay unpublished in verification hold until Dynamoi
94
329
  can verify the client relationship. Managed advertising and ad budgets are separate
95
330
  paid campaign services.
96
331
 
97
332
  === Session Start Routine ===
98
333
 
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.
334
+ When the user's first message in a Dynamoi session is account-relevant (artists, campaigns, smart links, analytics, distribution, 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.
100
335
 
101
336
  Route by state from dynamoi_get_account_overview:
102
337
 
@@ -124,7 +359,7 @@ Principles:
124
359
  - Answer general knowledge or advice questions directly without Dynamoi tools unless the user is asking about their Dynamoi account, artists, campaigns, billing, connections, or launches.
125
360
  - Do not call Dynamoi tools just to "check context" before answering generic advice questions. If the question is about Instagram growth, lyrics, songwriting, promotion strategy, or general marketing education and does not require the user's account data, answer natively and do not mention inspecting Dynamoi.
126
361
  - Even when Dynamoi is attached, generic advice stays native. If the user asks something like "How do I get more followers on Instagram organically without running any ads?", answer directly with no Dynamoi tool calls.
127
- - \`dynamoi_get_account_overview\` is only for explicit account-overview questions. Do not use it as a zero-context scout before answering unrelated prompts.
362
+ - \`dynamoi_get_account_overview\` is the first call for account-relevant session starts and explicit account-overview questions. Do not use it as a zero-context scout before answering unrelated prompts.
128
363
  - Never claim you changed something unless the tool returned status "success" or
129
364
  "partial_success".
130
365
  - Prefer read tools first before write tools. For writes, confirm intent and restate
@@ -137,6 +372,9 @@ Principles:
137
372
  - When a user asks to create a shareable release link, landing page, link-in-bio destination, streaming link, Spotify link page, or free promotion asset, prefer Smart Link tools before campaign tools. Use dynamoi_create_smart_links_from_spotify_artist for Spotify artist URLs when the user wants the artist hub, full catalog, or all Smart Links. Use dynamoi_create_smart_link_from_spotify for a single album or track URL. Do not imply that creating a Smart Link creates a paid campaign.
138
373
  - 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.
139
374
  - Smart Link pixel tools accept validated pixel IDs only. Do not ask for arbitrary JavaScript, tag-manager snippets, or script code.
375
+ - When the user asks about music distribution, call dynamoi_get_distribution_application before making eligibility claims. Treat its five scored requirements as authoritative. Applicant country, tax-residency country, payout country, and the adult signer attestation are required submission fields, but they are not additional eligibility-score requirements.
376
+ - For missing Meta or YouTube distribution identity, use purpose=distribution_identity on the relevant connection tool when that tool is available. These least-privilege identity flows do not require advertising billing. Never substitute the advertising flow.
377
+ - Call dynamoi_apply_for_distribution only after the user explicitly asks to submit, confirms the application, provides all required country fields, and attests that the signer is an adult. Submission starts manual review; it never implies approval, agreement acceptance, release submission, rights clearance, store delivery, royalty setup, or payout readiness.
140
378
  - Money values are shown in USD as presented in Dynamoi.
141
379
  - Budget minimums: $10/day (daily), $50 total (Smart Campaign), $50 total (YouTube).
142
380
  - Product and pricing details are available as MCP resources. Keep runtime answers
@@ -154,13 +392,14 @@ Common workflows:
154
392
  - 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
155
393
  - Free Smart Link single-release creation: dynamoi_list_artists → dynamoi_create_smart_link_from_spotify
156
394
  - Smart Link analytics/settings: dynamoi_list_smart_links → dynamoi_get_smart_link with includeAnalytics=true or includeArtistSettings=true
395
+ - Distribution: dynamoi_get_distribution_application → satisfy missing identity requirements with purpose=distribution_identity when available → collect required country fields and adult attestation → explicit confirmation → dynamoi_apply_for_distribution
157
396
  - 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.
158
397
  - 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.
159
398
  `.trim();
160
399
  var DYNAMOI_CHATGPT_APP_INSTRUCTIONS = `
161
400
  You are operating Dynamoi's ChatGPT app tools on behalf of the authenticated user.
162
- Dynamoi helps artists and labels create free Spotify Smart Links and inspect existing
163
- music-promotion records from ChatGPT.
401
+ Dynamoi helps artists and labels create music-promotion assets, review campaign and
402
+ Smart Link analytics, and check or submit music-distribution applications from ChatGPT.
164
403
 
165
404
  This ChatGPT app surface is review-safe and does not start billing, external OAuth
166
405
  connections, campaign launches, campaign budget changes, or direct purchase flows.
@@ -178,6 +417,10 @@ Principles:
178
417
  - For artist rosters, use dynamoi_list_artists.
179
418
  - For existing campaigns, use dynamoi_list_campaigns, dynamoi_get_campaign, and
180
419
  dynamoi_get_artist_analytics. These tools are read-only.
420
+ - For music distribution, use dynamoi_get_distribution_application to explain the exact
421
+ five requirements and current application status. Use dynamoi_apply_for_distribution
422
+ only after explicit user confirmation and complete country/adult-attestation fields.
423
+ An application starts manual review and never guarantees approval or distributes a release.
181
424
  - For free Smart Links, use dynamoi_create_smart_link_from_spotify,
182
425
  dynamoi_create_smart_links_from_spotify_artist, dynamoi_list_smart_links,
183
426
  dynamoi_get_smart_link, and dynamoi_update_smart_link.
@@ -197,7 +440,7 @@ Principles:
197
440
  `.trim();
198
441
 
199
442
  // src/server/prompts.ts
200
- import * as z from "zod/v4";
443
+ import * as z3 from "zod/v4";
201
444
  function asTextPrompt(text) {
202
445
  return {
203
446
  messages: [
@@ -211,8 +454,8 @@ function asTextPrompt(text) {
211
454
  function registerDynamoiPrompts(server) {
212
455
  server.registerPrompt("dynamoi_find_smart_link_url", {
213
456
  argsSchema: {
214
- artistId: z.string().uuid().optional(),
215
- query: z.string().trim().optional()
457
+ artistId: z3.string().uuid().optional(),
458
+ query: z3.string().trim().optional()
216
459
  },
217
460
  description: "Find a user's free Smart Link URL and answer with public URLs, titles, and statuses.",
218
461
  title: "Find Smart Link URL"
@@ -238,8 +481,8 @@ function registerDynamoiPrompts(server) {
238
481
  `)));
239
482
  server.registerPrompt("dynamoi_create_free_smart_link", {
240
483
  argsSchema: {
241
- artistId: z.string().uuid().optional(),
242
- spotifyUrl: z.string().trim().optional()
484
+ artistId: z3.string().uuid().optional(),
485
+ spotifyUrl: z3.string().trim().optional()
243
486
  },
244
487
  description: "Create free Smart Links from a Spotify artist, album, or track URL.",
245
488
  title: "Create Free Smart Link"
@@ -254,7 +497,7 @@ function registerDynamoiPrompts(server) {
254
497
  `)));
255
498
  server.registerPrompt("dynamoi_audit_campaigns", {
256
499
  argsSchema: {
257
- artistId: z.string().uuid().optional()
500
+ artistId: z3.string().uuid().optional()
258
501
  },
259
502
  description: "Audit an artist's campaigns and summarize what is working and what to fix next.",
260
503
  title: "Audit Campaigns"
@@ -270,9 +513,9 @@ function registerDynamoiPrompts(server) {
270
513
  `)));
271
514
  server.registerPrompt("dynamoi_release_launch_plan", {
272
515
  argsSchema: {
273
- artistId: z.string().uuid().optional(),
274
- contentTitle: z.string().trim().optional(),
275
- contentType: z.enum(["TRACK", "ALBUM", "PLAYLIST", "VIDEO"]).optional()
516
+ artistId: z3.string().uuid().optional(),
517
+ contentTitle: z3.string().trim().optional(),
518
+ contentType: z3.enum(["TRACK", "ALBUM", "PLAYLIST", "VIDEO"]).optional()
276
519
  },
277
520
  description: "Create a pragmatic release launch plan and propose a Dynamoi campaign setup.",
278
521
  title: "Release Launch Plan"
@@ -296,7 +539,7 @@ function registerDynamoiPrompts(server) {
296
539
  `)));
297
540
  server.registerPrompt("dynamoi_why_campaign_blocked", {
298
541
  argsSchema: {
299
- campaignId: z.string().uuid()
542
+ campaignId: z3.string().uuid()
300
543
  },
301
544
  description: "Diagnose why a campaign is blocked/stuck and recommend the next fix.",
302
545
  title: "Why Is My Campaign Blocked?"
@@ -316,7 +559,7 @@ function registerDynamoiPrompts(server) {
316
559
  import {
317
560
  ResourceTemplate
318
561
  } from "@modelcontextprotocol/sdk/server/mcp.js";
319
- import * as z2 from "zod/v4";
562
+ import * as z4 from "zod/v4";
320
563
 
321
564
  // src/server/playbook-resources.ts
322
565
  function registerPlaybookResources(server) {
@@ -767,7 +1010,7 @@ function registerDynamoiResources(server, adapter) {
767
1010
  list: async () => ({ resources: [] })
768
1011
  }), { mimeType: "application/json", title: "Artist" }, async (uri, variables) => {
769
1012
  const artistId = variables["artistId"];
770
- const parsed = z2.string().uuid().safeParse(artistId);
1013
+ const parsed = z4.string().uuid().safeParse(artistId);
771
1014
  if (!parsed.success) {
772
1015
  return {
773
1016
  contents: [
@@ -799,7 +1042,7 @@ function registerDynamoiResources(server, adapter) {
799
1042
  list: async () => ({ resources: [] })
800
1043
  }), { mimeType: "application/json", title: "Campaign" }, async (uri, variables) => {
801
1044
  const campaignId = variables["campaignId"];
802
- const parsed = z2.string().uuid().safeParse(campaignId);
1045
+ const parsed = z4.string().uuid().safeParse(campaignId);
803
1046
  if (!parsed.success) {
804
1047
  return {
805
1048
  contents: [
@@ -831,7 +1074,7 @@ function registerDynamoiResources(server, adapter) {
831
1074
  list: async () => ({ resources: [] })
832
1075
  }), { mimeType: "application/json", title: "Smart Link" }, async (uri, variables) => {
833
1076
  const playLinkId = variables["playLinkId"];
834
- const parsed = z2.string().uuid().safeParse(playLinkId);
1077
+ const parsed = z4.string().uuid().safeParse(playLinkId);
835
1078
  if (!parsed.success) {
836
1079
  return {
837
1080
  contents: [
@@ -863,7 +1106,7 @@ function registerDynamoiResources(server, adapter) {
863
1106
  list: async () => ({ resources: [] })
864
1107
  }), { mimeType: "application/json", title: "Smart Link Artist Settings" }, async (uri, variables) => {
865
1108
  const artistId = variables["artistId"];
866
- const parsed = z2.string().uuid().safeParse(artistId);
1109
+ const parsed = z4.string().uuid().safeParse(artistId);
867
1110
  if (!parsed.success) {
868
1111
  return {
869
1112
  contents: [
@@ -894,206 +1137,10 @@ function registerDynamoiResources(server, adapter) {
894
1137
  }
895
1138
 
896
1139
  // src/server/smart-link-theme-preview.ts
897
- import * as z4 from "zod/v4";
898
-
899
- // src/server/output-schemas.ts
900
- import * as z3 from "zod/v4";
901
- var MoneyDisplayOutputSchema = z3.object({
902
- amountUsd: z3.number(),
903
- formatted: z3.string()
904
- }).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
- }
929
- var AnyToolDataOutputSchema = z3.object({}).passthrough();
930
- var MediaAssetSummaryOutputSchema = z3.object({
931
- aspectRatio: z3.string().optional(),
932
- createdAt: z3.string(),
933
- fileName: z3.string().optional(),
934
- fileType: z3.string(),
935
- height: z3.number().optional(),
936
- id: z3.string(),
937
- url: z3.string().optional(),
938
- urlExpiresAt: z3.string().optional(),
939
- width: z3.number().optional()
940
- }).strict();
941
- var ListMediaAssetsDataOutputSchema = z3.object({
942
- assets: z3.array(MediaAssetSummaryOutputSchema),
943
- nextCursor: z3.string().optional()
944
- }).strict();
945
- var ListMediaAssetsSummaryOutputSchema = z3.object({
946
- nextCursor: z3.string().optional(),
947
- summary: z3.string(),
948
- totalCount: z3.number()
949
- }).strict();
950
- var SmartLinkStatusSchemas = {
951
- claimStatus: z3.enum([
952
- "auto_approved",
953
- "pending_ops_review",
954
- "verification_deferred",
955
- "approved_by_ops",
956
- "rejected"
957
- ]),
958
- odesliStatus: z3.enum(["pending", "resolved", "failed"]),
959
- publishState: z3.enum(["published", "unpublished"]),
960
- renderState: z3.enum(["queued", "rendering", "rendered", "failed"]),
961
- takedownStatus: z3.enum(["none", "active", "resolved"]),
962
- theme: z3.enum(["classic", "brutalist", "aurora", "cinematic"])
963
- };
964
- var SmartLinkSummaryOutputSchema = z3.object({
965
- artistHubUrl: z3.string(),
966
- artistId: z3.string(),
967
- artistName: z3.string(),
968
- claimStatus: SmartLinkStatusSchemas.claimStatus,
969
- createdAt: z3.string(),
970
- id: z3.string(),
971
- isPublic: z3.boolean(),
972
- localizedPublicUrls: z3.array(z3.string()).optional(),
973
- odesliStatus: SmartLinkStatusSchemas.odesliStatus,
974
- publicUrl: z3.string(),
975
- publishState: SmartLinkStatusSchemas.publishState,
976
- releaseSlug: z3.string(),
977
- releaseTitle: z3.string(),
978
- releaseType: z3.string(),
979
- renderState: SmartLinkStatusSchemas.renderState,
980
- spotifyUrl: z3.string().nullable(),
981
- takedownStatus: SmartLinkStatusSchemas.takedownStatus,
982
- theme: SmartLinkStatusSchemas.theme,
983
- updatedAt: z3.string()
984
- }).strict();
985
- var SmartLinkDetailsOutputSchema = SmartLinkSummaryOutputSchema.extend({
986
- actionRequired: z3.array(z3.string()).optional(),
987
- customDescription: z3.string().nullable(),
988
- nextActions: z3.array(z3.string()),
989
- originalSpotifyUrl: z3.string().nullable(),
990
- summary: z3.string(),
991
- warnings: z3.array(z3.string()).optional()
992
- }).strict();
993
- var ListSmartLinksDataOutputSchema = z3.object({
994
- nextCursor: z3.string().optional(),
995
- smartLinks: z3.array(SmartLinkSummaryOutputSchema)
996
- }).strict();
997
- var ListSmartLinksSummaryOutputSchema = z3.object({
998
- nextCursor: z3.string().optional(),
999
- summary: z3.string(),
1000
- totalCount: z3.number()
1001
- }).strict();
1002
- var AvailableCountryOutputSchema = z3.object({
1003
- code: z3.string(),
1004
- dominantLanguage: z3.string().optional(),
1005
- googleAdsId: z3.number(),
1006
- name: z3.string()
1007
- }).strict();
1008
- var ListAvailableCountriesDataOutputSchema = z3.object({
1009
- campaignType: z3.enum(["SMART_CAMPAIGN", "YOUTUBE"]),
1010
- countries: z3.array(AvailableCountryOutputSchema),
1011
- nextCursor: z3.string().optional(),
1012
- notes: z3.array(z3.string()),
1013
- source: z3.enum(["SMART_CAMPAIGN_COUNTRIES", "GOOGLE_ADS_COUNTRIES"]),
1014
- totalCount: z3.number()
1015
- }).strict();
1016
- var SummaryCountOutputSchema = z3.object({
1017
- nextCursor: z3.string().optional(),
1018
- summary: z3.string(),
1019
- totalCount: z3.number()
1020
- }).strict();
1021
- var SummaryWarningsActionsOutputSchema = z3.object({
1022
- actionRequired: z3.array(z3.string()).optional(),
1023
- summary: z3.string(),
1024
- warnings: z3.array(z3.string()).optional()
1025
- }).strict();
1026
- var NormalizedTargetingOutputSchema = z3.union([
1027
- z3.object({ mode: z3.literal("GLOBAL") }).strict(),
1028
- z3.object({
1029
- countries: z3.array(z3.object({ code: z3.string(), name: z3.string() }).strict()),
1030
- mode: z3.literal("COUNTRIES")
1031
- }).strict()
1032
- ]);
1033
- var GetCampaignReadinessDataOutputSchema = z3.object({
1034
- artistId: z3.string(),
1035
- artistName: z3.string(),
1036
- blockingIssues: z3.array(z3.string()),
1037
- campaignType: z3.enum(["SMART_CAMPAIGN", "YOUTUBE"]),
1038
- isReady: z3.boolean(),
1039
- missingInputs: z3.array(z3.string()),
1040
- normalizedTargeting: NormalizedTargetingOutputSchema,
1041
- recommendedNextAction: z3.string(),
1042
- warnings: z3.array(z3.string())
1043
- }).strict();
1044
- var CreateSmartLinkFromSpotifyDataOutputSchema = SmartLinkDetailsOutputSchema.extend({
1045
- outcome: z3.enum(["created", "existing"]),
1046
- workflowWarning: z3.string().nullable()
1047
- }).strict();
1048
- var CreateSmartLinksFromSpotifyArtistDataOutputSchema = z3.object({
1049
- artistCreatedFromSpotify: z3.boolean().optional(),
1050
- artistHubUrl: z3.string(),
1051
- artistId: z3.string(),
1052
- artistName: z3.string(),
1053
- catalogImportStatus: z3.enum(["started", "start_failed"]),
1054
- currentSmartLinkCount: z3.number(),
1055
- existingCount: z3.number(),
1056
- initialSmartLink: SmartLinkSummaryOutputSchema.nullable(),
1057
- newlyAvailableCount: z3.number(),
1058
- nextActions: z3.array(z3.string()),
1059
- smartLinks: z3.array(SmartLinkSummaryOutputSchema),
1060
- spotifyArtistUrl: z3.string(),
1061
- summary: z3.string(),
1062
- warnings: z3.array(z3.string()).optional()
1063
- }).strict();
1064
- var LaunchCampaignDataOutputSchema = z3.object({
1065
- budget: MoneyDisplayOutputSchema,
1066
- budgetType: z3.enum(["DAILY", "TOTAL"]),
1067
- campaignType: z3.enum(["SMART_CAMPAIGN", "YOUTUBE"]),
1068
- contentTitle: z3.string(),
1069
- deliveryState: z3.enum(["ACTIVE", "PENDING_REVIEW", "CONTENT_VALIDATION"]),
1070
- id: z3.string(),
1071
- isLive: z3.boolean(),
1072
- nextSteps: z3.array(z3.string()),
1073
- platforms: z3.array(z3.string()),
1074
- status: z3.string(),
1075
- summary: z3.string(),
1076
- warnings: z3.array(z3.string()).optional()
1077
- }).strict();
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
1140
+ import * as z5 from "zod/v4";
1094
1141
  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({
1142
+ var SampleTextSchema = z5.string().trim().min(1).max(80);
1143
+ var DynamoiPreviewSmartLinkThemesInputSchema = z5.object({
1097
1144
  artistName: SampleTextSchema.optional(),
1098
1145
  releaseTitle: SampleTextSchema.optional()
1099
1146
  }).strict();
@@ -1352,15 +1399,15 @@ function registerSmartLinkThemePreviewResource(server) {
1352
1399
  }
1353
1400
 
1354
1401
  // src/server/smart-link-tools.ts
1355
- import * as z6 from "zod/v4";
1402
+ import * as z7 from "zod/v4";
1356
1403
 
1357
1404
  // src/server/shared-schemas.ts
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();
1405
+ import * as z6 from "zod/v4";
1406
+ var ToolFormatSchema = z6.enum(["json", "summary"]);
1407
+ var IsoDateSchema = z6.string().regex(/^\d{4}-\d{2}-\d{2}$/);
1408
+ var UserIntentSummarySchema = z6.string().trim().max(500).optional();
1409
+ var ClientRequestIdSchema = z6.string().uuid().optional();
1410
+ var RequiredClientRequestIdSchema = z6.string().uuid();
1364
1411
  function isValidCalendarDate(value) {
1365
1412
  const date = new Date(`${value}T00:00:00.000Z`);
1366
1413
  return Number.isFinite(date.getTime()) && date.toISOString().slice(0, 10) === value;
@@ -1368,7 +1415,7 @@ function isValidCalendarDate(value) {
1368
1415
  var IsoCalendarDateSchema = IsoDateSchema.refine(isValidCalendarDate, {
1369
1416
  message: "must be a valid calendar date"
1370
1417
  });
1371
- var DateRangeSchema = z5.object({
1418
+ var DateRangeSchema = z6.object({
1372
1419
  end: IsoDateSchema,
1373
1420
  start: IsoDateSchema
1374
1421
  }).strict().superRefine((data, ctx) => {
@@ -1397,23 +1444,23 @@ var DateRangeSchema = z5.object({
1397
1444
 
1398
1445
  // src/server/smart-link-tools.ts
1399
1446
  var SmartLinkStatusFiltersSchema = {
1400
- claimStatus: z6.enum([
1447
+ claimStatus: z7.enum([
1401
1448
  "auto_approved",
1402
1449
  "pending_ops_review",
1403
1450
  "verification_deferred",
1404
1451
  "approved_by_ops",
1405
1452
  "rejected"
1406
1453
  ]).optional(),
1407
- publishState: z6.enum(["published", "unpublished"]).optional(),
1408
- renderState: z6.enum(["queued", "rendering", "rendered", "failed"]).optional()
1454
+ publishState: z7.enum(["published", "unpublished"]).optional(),
1455
+ renderState: z7.enum(["queued", "rendering", "rendered", "failed"]).optional()
1409
1456
  };
1410
- var SmartLinkThemeSchema = z6.enum([
1457
+ var SmartLinkThemeSchema = z7.enum([
1411
1458
  "classic",
1412
1459
  "brutalist",
1413
1460
  "aurora",
1414
1461
  "cinematic"
1415
1462
  ]);
1416
- var LegacySmartLinkIncludeSchema = z6.array(z6.enum(["analytics", "artist_settings"]));
1463
+ var LegacySmartLinkIncludeSchema = z7.array(z7.enum(["analytics", "artist_settings"]));
1417
1464
  function normalizeLegacySmartLinkInclude(rawInput) {
1418
1465
  if (!rawInput || typeof rawInput !== "object" || Array.isArray(rawInput)) {
1419
1466
  return rawInput;
@@ -1435,39 +1482,39 @@ function normalizeLegacySmartLinkInclude(rawInput) {
1435
1482
  }
1436
1483
  return normalized;
1437
1484
  }
1438
- var DynamoiCreateSmartLinkFromSpotifyInputSchema = z6.object({
1439
- artistId: z6.string().uuid(),
1485
+ var DynamoiCreateSmartLinkFromSpotifyInputSchema = z7.object({
1486
+ artistId: z7.string().uuid(),
1440
1487
  clientRequestId: RequiredClientRequestIdSchema.optional(),
1441
- customDescription: z6.string().trim().max(500).optional(),
1488
+ customDescription: z7.string().trim().max(500).optional(),
1442
1489
  format: ToolFormatSchema.optional(),
1443
- spotifyUrl: z6.string().trim().min(1).max(500),
1490
+ spotifyUrl: z7.string().trim().min(1).max(500),
1444
1491
  userIntentSummary: UserIntentSummarySchema
1445
1492
  }).strict();
1446
- var DynamoiCreateSmartLinksFromSpotifyArtistInputSchema = z6.object({
1447
- artistId: z6.string().uuid().optional(),
1493
+ var DynamoiCreateSmartLinksFromSpotifyArtistInputSchema = z7.object({
1494
+ artistId: z7.string().uuid().optional(),
1448
1495
  clientRequestId: RequiredClientRequestIdSchema.optional(),
1449
1496
  format: ToolFormatSchema.optional(),
1450
- spotifyArtistUrl: z6.string().trim().min(1).max(500),
1497
+ spotifyArtistUrl: z7.string().trim().min(1).max(500),
1451
1498
  userIntentSummary: UserIntentSummarySchema
1452
1499
  }).strict();
1453
- var DynamoiListSmartLinksInputSchema = z6.object({
1454
- artistId: z6.string().uuid(),
1455
- cursor: z6.string().optional(),
1500
+ var DynamoiListSmartLinksInputSchema = z7.object({
1501
+ artistId: z7.string().uuid(),
1502
+ cursor: z7.string().optional(),
1456
1503
  format: ToolFormatSchema.optional(),
1457
- limit: z6.number().int().min(1).max(50).optional(),
1458
- query: z6.string().trim().max(120).optional(),
1504
+ limit: z7.number().int().min(1).max(50).optional(),
1505
+ query: z7.string().trim().max(120).optional(),
1459
1506
  ...SmartLinkStatusFiltersSchema
1460
1507
  }).strict();
1461
1508
  var DynamoiGetSmartLinkInputShape = {
1462
- artistId: z6.string().uuid().optional(),
1509
+ artistId: z7.string().uuid().optional(),
1463
1510
  dateRange: DateRangeSchema.optional(),
1464
1511
  format: ToolFormatSchema.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()
1512
+ granularity: z7.enum(["TOTAL", "DAILY"]).optional(),
1513
+ includeAnalytics: z7.boolean().optional(),
1514
+ includeArtistSettings: z7.boolean().optional(),
1515
+ includeBreakdowns: z7.boolean().optional(),
1516
+ playLinkId: z7.string().uuid().optional(),
1517
+ spotifyUrl: z7.string().trim().min(1).max(500).optional()
1471
1518
  };
1472
1519
  function validateDynamoiGetSmartLinkInput(data, ctx) {
1473
1520
  const settingsOnly = data.includeArtistSettings === true && !data.playLinkId && !data.spotifyUrl && Boolean(data.artistId);
@@ -1486,33 +1533,33 @@ function validateDynamoiGetSmartLinkInput(data, ctx) {
1486
1533
  });
1487
1534
  }
1488
1535
  }
1489
- var StrictDynamoiGetSmartLinkInputSchema = z6.object(DynamoiGetSmartLinkInputShape).strict().superRefine(validateDynamoiGetSmartLinkInput);
1536
+ var StrictDynamoiGetSmartLinkInputSchema = z7.object(DynamoiGetSmartLinkInputShape).strict().superRefine(validateDynamoiGetSmartLinkInput);
1490
1537
  var DynamoiGetSmartLinkInputSchema = StrictDynamoiGetSmartLinkInputSchema;
1491
1538
  function parseDynamoiGetSmartLinkInput(rawInput) {
1492
1539
  return StrictDynamoiGetSmartLinkInputSchema.parse(normalizeLegacySmartLinkInclude(rawInput));
1493
1540
  }
1494
- var DynamoiGetSmartLinkAnalyticsInputSchema = z6.object({
1541
+ var DynamoiGetSmartLinkAnalyticsInputSchema = z7.object({
1495
1542
  dateRange: DateRangeSchema.optional(),
1496
1543
  format: ToolFormatSchema.optional(),
1497
- granularity: z6.enum(["TOTAL", "DAILY"]).optional(),
1498
- includeBreakdowns: z6.boolean().optional(),
1499
- playLinkId: z6.string().uuid()
1544
+ granularity: z7.enum(["TOTAL", "DAILY"]).optional(),
1545
+ includeBreakdowns: z7.boolean().optional(),
1546
+ playLinkId: z7.string().uuid()
1500
1547
  }).strict();
1501
- var DynamoiGetSmartLinkArtistSettingsInputSchema = z6.object({
1502
- artistId: z6.string().uuid(),
1548
+ var DynamoiGetSmartLinkArtistSettingsInputSchema = z7.object({
1549
+ artistId: z7.string().uuid(),
1503
1550
  format: ToolFormatSchema.optional()
1504
1551
  }).strict();
1505
- var DynamoiUpdateSmartLinkInputSchema = z6.object({
1506
- action: z6.enum(["update_description", "update_artist_settings"]),
1507
- artistId: z6.string().uuid().optional(),
1552
+ var DynamoiUpdateSmartLinkInputSchema = z7.object({
1553
+ action: z7.enum(["update_description", "update_artist_settings"]),
1554
+ artistId: z7.string().uuid().optional(),
1508
1555
  clientRequestId: ClientRequestIdSchema,
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(),
1556
+ customDescription: z7.string().max(500).nullable().optional(),
1557
+ expectedUpdatedAt: z7.string().datetime().optional(),
1558
+ googleAdsConversionId: z7.string().trim().max(32).nullable().optional(),
1559
+ metaPixelId: z7.string().trim().max(32).nullable().optional(),
1560
+ playLinkId: z7.string().uuid().optional(),
1514
1561
  theme: SmartLinkThemeSchema.optional(),
1515
- tiktokPixelId: z6.string().trim().max(32).nullable().optional(),
1562
+ tiktokPixelId: z7.string().trim().max(32).nullable().optional(),
1516
1563
  userIntentSummary: UserIntentSummarySchema
1517
1564
  }).strict().superRefine((data, ctx) => {
1518
1565
  if (data.action === "update_description" && data.customDescription === undefined) {
@@ -1563,13 +1610,13 @@ var DynamoiUpdateSmartLinkInputSchema = z6.object({
1563
1610
  }
1564
1611
  }
1565
1612
  });
1566
- var DynamoiUpdateSmartLinkArtistSettingsInputSchema = z6.object({
1567
- artistId: z6.string().uuid(),
1613
+ var DynamoiUpdateSmartLinkArtistSettingsInputSchema = z7.object({
1614
+ artistId: z7.string().uuid(),
1568
1615
  clientRequestId: ClientRequestIdSchema,
1569
- googleAdsConversionId: z6.string().trim().max(32).nullable().optional(),
1570
- metaPixelId: z6.string().trim().max(32).nullable().optional(),
1616
+ googleAdsConversionId: z7.string().trim().max(32).nullable().optional(),
1617
+ metaPixelId: z7.string().trim().max(32).nullable().optional(),
1571
1618
  theme: SmartLinkThemeSchema.optional(),
1572
- tiktokPixelId: z6.string().trim().max(32).nullable().optional(),
1619
+ tiktokPixelId: z7.string().trim().max(32).nullable().optional(),
1573
1620
  userIntentSummary: UserIntentSummarySchema
1574
1621
  }).strict().superRefine((data, ctx) => {
1575
1622
  if (data.theme === undefined && data.metaPixelId === undefined && data.tiktokPixelId === undefined && data.googleAdsConversionId === undefined) {
@@ -1637,13 +1684,13 @@ var PHASE_4_TOOL_DEFINITIONS = [
1637
1684
  ];
1638
1685
 
1639
1686
  // src/server/tools.ts
1640
- import * as z8 from "zod/v4";
1687
+ import * as z9 from "zod/v4";
1641
1688
 
1642
1689
  // src/server/onboarding-tool-definitions.ts
1643
1690
  function createPhaseOnboardingToolDefinitions(schemas) {
1644
1691
  return [
1645
1692
  {
1646
- description: "Use this when the user is ready to link a YouTube channel to one Dynamoi artist from chat. This returns a Google OAuth URL bound to the signed-in user and artist. Google returns to a Dynamoi page that tells the user to come back to the AI assistant; after that, poll dynamoi_get_platform_status with the returned onboardingAttemptId and onboardingFlow=youtube until platforms.youtube.connected is true.",
1693
+ description: "Use this when the user is ready to link a YouTube channel to one Dynamoi artist from chat. Set purpose=distribution_identity for the least-privilege identity connection required by a distribution application; that flow does not require advertising billing or Google Ads linking, and its result is checked with dynamoi_get_distribution_application. Use purpose=advertising (the default) for managed YouTube promotion, then poll dynamoi_get_platform_status until platforms.youtube.connected is true. The tool returns a Google OAuth URL bound to the signed-in user and artist.",
1647
1694
  destructiveHint: false,
1648
1695
  idempotentHint: true,
1649
1696
  name: "dynamoi_start_youtube_channel_link",
@@ -1654,7 +1701,7 @@ function createPhaseOnboardingToolDefinitions(schemas) {
1654
1701
  title: "Start YouTube Channel Link"
1655
1702
  },
1656
1703
  {
1657
- description: "Use this when billing is active and the user is ready to connect Meta for Spotify Smart Campaigns from chat. This returns a signed Meta OAuth URL and may send the user through a Page/Instagram selection step before the chat-first return page. If billing is not active, it returns billing_required instead of an OAuth URL. If billing cannot be verified due to a transient snapshot/API issue, it returns billing_check_unavailable and should be retried shortly. After the user returns, poll dynamoi_get_platform_status with the returned onboardingAttemptId and onboardingFlow=meta until platforms.meta.status is oauth_complete, partnership_pending, or partnership_active.",
1704
+ description: "Use this when the user is ready to connect a Facebook Page and Instagram professional account to one Dynamoi artist. Set purpose=distribution_identity for the least-privilege identity connection required by a distribution application; that flow does not require advertising billing, and its result is checked with dynamoi_get_distribution_application. Use purpose=advertising (the default) for Spotify Smart Campaigns; advertising requires active billing and is checked with dynamoi_get_platform_status until platforms.meta.status is oauth_complete, partnership_pending, or partnership_active. Advertising returns billing_required when inactive and billing_check_unavailable for a transient verification failure. This returns a signed Meta OAuth URL and may include a Page/Instagram selection step.",
1658
1705
  destructiveHint: false,
1659
1706
  idempotentHint: true,
1660
1707
  name: "dynamoi_start_meta_connection",
@@ -1668,12 +1715,12 @@ function createPhaseOnboardingToolDefinitions(schemas) {
1668
1715
  }
1669
1716
 
1670
1717
  // src/server/openai-tools.ts
1671
- import * as z7 from "zod/v4";
1672
- var DynamoiOpenAiSearchInputSchema = z7.object({
1673
- query: z7.string().trim().min(1).max(500)
1718
+ import * as z8 from "zod/v4";
1719
+ var DynamoiOpenAiSearchInputSchema = z8.object({
1720
+ query: z8.string().trim().min(1).max(500)
1674
1721
  }).strict();
1675
- var DynamoiOpenAiFetchInputSchema = z7.object({
1676
- id: z7.string().trim().min(1).max(200)
1722
+ var DynamoiOpenAiFetchInputSchema = z8.object({
1723
+ id: z8.string().trim().min(1).max(200)
1677
1724
  }).strict();
1678
1725
  var OPENAI_TOOL_DEFINITIONS = [
1679
1726
  {
@@ -1701,8 +1748,8 @@ var OPENAI_TOOL_DEFINITIONS = [
1701
1748
  // src/server/tools.ts
1702
1749
  var DateRangeSchema2 = DateRangeSchema;
1703
1750
  var ToolFormatSchema2 = ToolFormatSchema;
1704
- var OnboardingAttemptIdSchema = z8.string().trim().min(1).max(120).optional();
1705
- var ExpectedCampaignStatusEnum = z8.enum([
1751
+ var OnboardingAttemptIdSchema = z9.string().trim().min(1).max(120).optional();
1752
+ var ExpectedCampaignStatusEnum = z9.enum([
1706
1753
  "AWAITING_SMART_LINK",
1707
1754
  "ACTIVE",
1708
1755
  "ARCHIVED",
@@ -1718,20 +1765,20 @@ var ExpectedCampaignStatusSchema = ExpectedCampaignStatusEnum.optional();
1718
1765
  var CampaignStatusFilterSchema = ExpectedCampaignStatusEnum.exclude([
1719
1766
  "ENDED"
1720
1767
  ]).optional();
1721
- var DynamoiListArtistsInputSchema = z8.object({
1722
- artistId: z8.string().uuid().optional(),
1723
- cursor: z8.string().optional(),
1768
+ var DynamoiListArtistsInputSchema = z9.object({
1769
+ artistId: z9.string().uuid().optional(),
1770
+ cursor: z9.string().optional(),
1724
1771
  format: ToolFormatSchema2.optional(),
1725
- limit: z8.number().int().min(1).max(50).optional()
1772
+ limit: z9.number().int().min(1).max(50).optional()
1726
1773
  }).strict();
1727
- var DynamoiSearchInputSchema = z8.object({
1728
- artistId: z8.string().uuid().optional(),
1729
- cursor: z8.string().optional(),
1774
+ var DynamoiSearchInputSchema = z9.object({
1775
+ artistId: z9.string().uuid().optional(),
1776
+ cursor: z9.string().optional(),
1730
1777
  format: ToolFormatSchema2.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()
1778
+ includeArchived: z9.boolean().optional(),
1779
+ limit: z9.number().int().min(1).max(50).optional(),
1780
+ query: z9.string().trim().max(120).optional(),
1781
+ type: z9.enum(["artist", "campaign", "smartlink"]).optional()
1735
1782
  }).strict().superRefine((data, ctx) => {
1736
1783
  if (!(data.type || data.query)) {
1737
1784
  ctx.addIssue({
@@ -1741,123 +1788,125 @@ var DynamoiSearchInputSchema = z8.object({
1741
1788
  });
1742
1789
  }
1743
1790
  });
1744
- var DynamoiGetCurrentUserIntentSchema = z8.enum([
1791
+ var DynamoiGetCurrentUserIntentSchema = z9.enum([
1745
1792
  "account_overview",
1746
1793
  "artist_access_check",
1747
1794
  "organization_access_check",
1748
1795
  "platform_connection_check"
1749
1796
  ]);
1750
- var DynamoiGetCurrentUserInputSchema = z8.object({
1797
+ var DynamoiGetCurrentUserInputSchema = z9.object({
1751
1798
  format: ToolFormatSchema2.optional(),
1752
1799
  intent: DynamoiGetCurrentUserIntentSchema
1753
1800
  }).strict();
1754
- var DynamoiGetArtistInputSchema = z8.object({
1755
- artistId: z8.string().uuid(),
1801
+ var DynamoiGetArtistInputSchema = z9.object({
1802
+ artistId: z9.string().uuid(),
1756
1803
  format: ToolFormatSchema2.optional()
1757
1804
  }).strict();
1758
- var DynamoiListCampaignsInputSchema = z8.object({
1759
- artistId: z8.string().uuid(),
1760
- campaignType: z8.enum(["SMART_CAMPAIGN", "YOUTUBE"]).optional(),
1761
- cursor: z8.string().optional(),
1805
+ var DynamoiListCampaignsInputSchema = z9.object({
1806
+ artistId: z9.string().uuid(),
1807
+ campaignType: z9.enum(["SMART_CAMPAIGN", "YOUTUBE"]).optional(),
1808
+ cursor: z9.string().optional(),
1762
1809
  format: ToolFormatSchema2.optional(),
1763
- limit: z8.number().int().min(1).max(50).optional(),
1810
+ limit: z9.number().int().min(1).max(50).optional(),
1764
1811
  status: CampaignStatusFilterSchema
1765
1812
  }).strict();
1766
- var DynamoiGetCampaignInputSchema = z8.object({
1813
+ var DynamoiGetCampaignInputSchema = z9.object({
1767
1814
  analyticsDateRange: DateRangeSchema2.optional(),
1768
- analyticsGranularity: z8.enum(["TOTAL", "DAILY"]).optional(),
1769
- campaignId: z8.string().uuid(),
1815
+ analyticsGranularity: z9.enum(["TOTAL", "DAILY"]).optional(),
1816
+ campaignId: z9.string().uuid(),
1770
1817
  format: ToolFormatSchema2.optional(),
1771
- includeAnalytics: z8.boolean().optional(),
1772
- includeCountries: z8.boolean().optional(),
1773
- includeDeploymentStatus: z8.boolean().optional()
1818
+ includeAnalytics: z9.boolean().optional(),
1819
+ includeCountries: z9.boolean().optional(),
1820
+ includeDeploymentStatus: z9.boolean().optional()
1774
1821
  }).strict();
1775
- var DynamoiGetCampaignAnalyticsInputSchema = z8.object({
1776
- campaignId: z8.string().uuid(),
1822
+ var DynamoiGetCampaignAnalyticsInputSchema = z9.object({
1823
+ campaignId: z9.string().uuid(),
1777
1824
  dateRange: DateRangeSchema2.optional(),
1778
1825
  format: ToolFormatSchema2.optional(),
1779
- granularity: z8.enum(["TOTAL", "DAILY"]).optional()
1826
+ granularity: z9.enum(["TOTAL", "DAILY"]).optional()
1780
1827
  }).strict();
1781
- var DynamoiGetArtistAnalyticsInputSchema = z8.object({
1782
- artistId: z8.string().uuid(),
1828
+ var DynamoiGetArtistAnalyticsInputSchema = z9.object({
1829
+ artistId: z9.string().uuid(),
1783
1830
  dateRange: DateRangeSchema2.optional(),
1784
1831
  format: ToolFormatSchema2.optional(),
1785
- granularity: z8.enum(["TOTAL", "DAILY"]).optional()
1832
+ granularity: z9.enum(["TOTAL", "DAILY"]).optional()
1786
1833
  }).strict();
1787
- var DynamoiGetBillingInputSchema = z8.object({
1788
- artistId: z8.string().uuid(),
1834
+ var DynamoiGetBillingInputSchema = z9.object({
1835
+ artistId: z9.string().uuid(),
1789
1836
  format: ToolFormatSchema2.optional(),
1790
1837
  onboardingAttemptId: OnboardingAttemptIdSchema
1791
1838
  }).strict();
1792
- var LocationTargetSchema = z8.object({
1793
- code: z8.string().trim().min(1).max(8),
1794
- name: z8.string().trim().min(1).max(120)
1839
+ var LocationTargetSchema = z9.object({
1840
+ code: z9.string().trim().min(1).max(8),
1841
+ name: z9.string().trim().min(1).max(120)
1795
1842
  }).strict();
1796
- var DynamoiGetPlatformStatusInputSchema = z8.object({
1797
- artistId: z8.string().uuid(),
1843
+ var DynamoiGetPlatformStatusInputSchema = z9.object({
1844
+ artistId: z9.string().uuid(),
1798
1845
  format: ToolFormatSchema2.optional(),
1799
1846
  onboardingAttemptId: OnboardingAttemptIdSchema,
1800
- onboardingFlow: z8.enum(["meta", "youtube"]).optional()
1847
+ onboardingFlow: z9.enum(["meta", "youtube"]).optional()
1801
1848
  }).strict();
1802
- var DynamoiStartYoutubeChannelLinkInputSchema = z8.object({
1803
- artistId: z8.string().uuid(),
1849
+ var DynamoiStartYoutubeChannelLinkInputSchema = z9.object({
1850
+ artistId: z9.string().uuid(),
1804
1851
  format: ToolFormatSchema2.optional(),
1852
+ purpose: z9.enum(["advertising", "distribution_identity"]).optional(),
1805
1853
  userIntentSummary: UserIntentSummarySchema
1806
1854
  }).strict();
1807
- var DynamoiStartMetaConnectionInputSchema = z8.object({
1808
- artistId: z8.string().uuid(),
1855
+ var DynamoiStartMetaConnectionInputSchema = z9.object({
1856
+ artistId: z9.string().uuid(),
1809
1857
  format: ToolFormatSchema2.optional(),
1858
+ purpose: z9.enum(["advertising", "distribution_identity"]).optional(),
1810
1859
  userIntentSummary: UserIntentSummarySchema
1811
1860
  }).strict();
1812
- var DynamoiListAvailableCountriesInputSchema = z8.object({
1813
- campaignType: z8.enum(["SMART_CAMPAIGN", "YOUTUBE"]),
1814
- cursor: z8.string().optional(),
1861
+ var DynamoiListAvailableCountriesInputSchema = z9.object({
1862
+ campaignType: z9.enum(["SMART_CAMPAIGN", "YOUTUBE"]),
1863
+ cursor: z9.string().optional(),
1815
1864
  format: ToolFormatSchema2.optional(),
1816
- limit: z8.number().int().min(1).max(100).optional(),
1817
- query: z8.string().trim().max(120).optional()
1865
+ limit: z9.number().int().min(1).max(100).optional(),
1866
+ query: z9.string().trim().max(120).optional()
1818
1867
  }).strict();
1819
- var DynamoiGetOnboardingStatusInputSchema = z8.object({
1820
- artistId: z8.string().uuid(),
1868
+ var DynamoiGetOnboardingStatusInputSchema = z9.object({
1869
+ artistId: z9.string().uuid(),
1821
1870
  format: ToolFormatSchema2.optional()
1822
1871
  }).strict();
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(),
1872
+ var DynamoiGetCampaignReadinessInputSchema = z9.object({
1873
+ artistId: z9.string().uuid(),
1874
+ budgetAmount: z9.number().finite().positive().optional(),
1875
+ budgetType: z9.enum(["DAILY", "TOTAL"]).optional(),
1876
+ campaignType: z9.enum(["SMART_CAMPAIGN", "YOUTUBE"]),
1877
+ contentType: z9.enum(["TRACK", "ALBUM", "PLAYLIST", "VIDEO"]).optional(),
1829
1878
  endDate: IsoCalendarDateSchema.optional(),
1830
1879
  format: ToolFormatSchema2.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()
1880
+ locationTargets: z9.array(LocationTargetSchema).optional(),
1881
+ mediaAssetIds: z9.array(z9.string().uuid()).optional(),
1882
+ spotifyUrl: z9.string().trim().min(1).max(500).optional(),
1883
+ youtubeVideoId: z9.string().trim().min(1).max(128).optional()
1835
1884
  }).strict();
1836
- var DynamoiGetCampaignDeploymentStatusInputSchema = z8.object({
1837
- campaignId: z8.string().uuid(),
1885
+ var DynamoiGetCampaignDeploymentStatusInputSchema = z9.object({
1886
+ campaignId: z9.string().uuid(),
1838
1887
  format: ToolFormatSchema2.optional()
1839
1888
  }).strict();
1840
- var DynamoiPauseCampaignInputSchema = z8.object({
1841
- campaignId: z8.string().uuid(),
1889
+ var DynamoiPauseCampaignInputSchema = z9.object({
1890
+ campaignId: z9.string().uuid(),
1842
1891
  clientRequestId: ClientRequestIdSchema,
1843
1892
  expectedCurrentStatus: ExpectedCampaignStatusSchema,
1844
1893
  userIntentSummary: UserIntentSummarySchema
1845
1894
  }).strict();
1846
- var DynamoiResumeCampaignInputSchema = z8.object({
1847
- campaignId: z8.string().uuid(),
1895
+ var DynamoiResumeCampaignInputSchema = z9.object({
1896
+ campaignId: z9.string().uuid(),
1848
1897
  clientRequestId: ClientRequestIdSchema,
1849
1898
  expectedCurrentStatus: ExpectedCampaignStatusSchema,
1850
1899
  userIntentSummary: UserIntentSummarySchema
1851
1900
  }).strict();
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(),
1901
+ var DynamoiUpdateBudgetInputSchema = z9.object({
1902
+ acceptedConsentCopyHash: z9.literal(PROSPECTIVE_BUDGET_FUNDING_CONSENT_COPY_HASH).optional(),
1903
+ acceptedConsentVersion: z9.literal(PROSPECTIVE_BUDGET_FUNDING_CONSENT_VERSION).optional(),
1904
+ authorizeAutomaticDailyFunding: z9.literal(true).describe(`Set only after the client explicitly accepts: “${PROSPECTIVE_BUDGET_FUNDING_CONSENT_COPY}”`).optional(),
1905
+ budgetAmount: z9.number().finite().positive(),
1906
+ campaignId: z9.string().uuid(),
1858
1907
  clientRequestId: ClientRequestIdSchema,
1859
1908
  endDate: IsoCalendarDateSchema.optional(),
1860
- expectedCurrentBudgetAmount: z8.number().finite().positive().optional(),
1909
+ expectedCurrentBudgetAmount: z9.number().finite().positive().optional(),
1861
1910
  expectedCurrentEndDate: IsoCalendarDateSchema.optional(),
1862
1911
  userIntentSummary: UserIntentSummarySchema
1863
1912
  }).strict().superRefine((data, ctx) => {
@@ -1869,16 +1918,16 @@ var DynamoiUpdateBudgetInputSchema = z8.object({
1869
1918
  });
1870
1919
  }
1871
1920
  });
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(),
1921
+ var DynamoiUpdateCampaignInputSchema = z9.object({
1922
+ action: z9.enum(["pause", "resume", "update_budget"]),
1923
+ acceptedConsentCopyHash: z9.literal(PROSPECTIVE_BUDGET_FUNDING_CONSENT_COPY_HASH).optional(),
1924
+ acceptedConsentVersion: z9.literal(PROSPECTIVE_BUDGET_FUNDING_CONSENT_VERSION).optional(),
1925
+ authorizeAutomaticDailyFunding: z9.literal(true).describe(`Set only after the client explicitly accepts: “${PROSPECTIVE_BUDGET_FUNDING_CONSENT_COPY}”`).optional(),
1926
+ budgetAmount: z9.number().finite().positive().optional(),
1927
+ campaignId: z9.string().uuid(),
1879
1928
  clientRequestId: ClientRequestIdSchema,
1880
1929
  endDate: IsoCalendarDateSchema.optional(),
1881
- expectedCurrentBudgetAmount: z8.number().finite().positive().optional(),
1930
+ expectedCurrentBudgetAmount: z9.number().finite().positive().optional(),
1882
1931
  expectedCurrentEndDate: IsoCalendarDateSchema.optional(),
1883
1932
  expectedCurrentStatus: ExpectedCampaignStatusSchema,
1884
1933
  userIntentSummary: UserIntentSummarySchema
@@ -1917,31 +1966,31 @@ var DynamoiUpdateCampaignInputSchema = z8.object({
1917
1966
  });
1918
1967
  }
1919
1968
  });
1920
- var DynamoiListMediaAssetsInputSchema = z8.object({
1921
- artistId: z8.string().uuid(),
1922
- cursor: z8.string().optional(),
1969
+ var DynamoiListMediaAssetsInputSchema = z9.object({
1970
+ artistId: z9.string().uuid(),
1971
+ cursor: z9.string().optional(),
1923
1972
  format: ToolFormatSchema2.optional(),
1924
- includeUrls: z8.boolean().optional(),
1925
- limit: z8.number().int().min(1).max(50).optional()
1973
+ includeUrls: z9.boolean().optional(),
1974
+ limit: z9.number().int().min(1).max(50).optional()
1926
1975
  }).strict();
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"]),
1976
+ var DynamoiLaunchCampaignInputSchema = z9.object({
1977
+ adCopy: z9.string().trim().max(500).optional(),
1978
+ appleMusicUrl: z9.string().trim().min(1).max(500).optional(),
1979
+ artistId: z9.string().uuid(),
1980
+ budgetAmount: z9.number().finite().positive(),
1981
+ budgetSplits: z9.record(z9.enum(["META", "GOOGLE"]), z9.number().int().min(0).max(100)),
1982
+ budgetType: z9.enum(["DAILY", "TOTAL"]),
1983
+ campaignType: z9.enum(["SMART_CAMPAIGN", "YOUTUBE"]),
1984
+ clientRequestId: z9.string().uuid(),
1985
+ contentTitle: z9.string().trim().min(1).max(160),
1986
+ contentType: z9.enum(["TRACK", "ALBUM", "PLAYLIST", "VIDEO"]),
1938
1987
  endDate: IsoCalendarDateSchema.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(),
1988
+ locationTargets: z9.array(LocationTargetSchema).optional(),
1989
+ mediaAssetIds: z9.array(z9.string().uuid()).optional(),
1990
+ spotifyUrl: z9.string().trim().min(1).max(500).optional(),
1991
+ useAiGeneratedCopy: z9.boolean().optional(),
1943
1992
  userIntentSummary: UserIntentSummarySchema,
1944
- youtubeVideoId: z8.string().trim().min(1).max(128).optional()
1993
+ youtubeVideoId: z9.string().trim().min(1).max(128).optional()
1945
1994
  }).strict().superRefine((data, ctx) => {
1946
1995
  const sum = Object.values(data.budgetSplits ?? {}).reduce((acc, v) => acc + (Number.isFinite(v) ? v : 0), 0);
1947
1996
  if (!(sum > 0)) {
@@ -2162,83 +2211,83 @@ var PHASE_3_TOOL_DEFINITIONS = [
2162
2211
  function buildDynamoiToolSecuritySchemes(scopes) {
2163
2212
  return [{ scopes: [...scopes], type: "oauth2" }];
2164
2213
  }
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()
2214
+ var DescriptiveEntitySchema = z10.object({
2215
+ id: z10.string().optional(),
2216
+ name: z10.string().optional(),
2217
+ publicUrl: z10.string().optional(),
2218
+ summary: z10.string().optional()
2170
2219
  }).passthrough();
2171
2220
  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)
2221
+ dynamoi_get_account_overview: z10.object({
2222
+ artistCount: z10.number().optional(),
2223
+ artists: z10.object({
2224
+ count: z10.number(),
2225
+ summaries: z10.array(DescriptiveEntitySchema)
2177
2226
  }).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()
2227
+ organizationCount: z10.number().optional(),
2228
+ recommendedNextActions: z10.array(z10.string()).optional(),
2229
+ state: z10.object({}).passthrough().optional(),
2230
+ summary: z10.string().optional(),
2231
+ user: z10.object({ name: z10.string().optional() }).optional()
2183
2232
  }).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()
2233
+ dynamoi_get_artist_analytics: z10.object({
2234
+ artistId: z10.string().optional(),
2235
+ artistName: z10.string().optional(),
2236
+ dateRange: z10.object({ end: z10.string(), start: z10.string() }).optional(),
2237
+ summary: z10.string().optional()
2189
2238
  }).passthrough(),
2190
2239
  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()
2240
+ artistId: z10.string().optional(),
2241
+ contentTitle: z10.string().optional(),
2242
+ nextActions: z10.array(z10.string()).optional(),
2243
+ status: z10.string().optional()
2195
2244
  }).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()
2245
+ dynamoi_get_platform_status: z10.object({
2246
+ artistId: z10.string().optional(),
2247
+ artistName: z10.string().optional(),
2248
+ platforms: z10.object({}).passthrough().optional(),
2249
+ summary: z10.string().optional()
2201
2250
  }).passthrough(),
2202
2251
  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()
2252
+ artistId: z10.string().optional(),
2253
+ artistName: z10.string().optional(),
2254
+ nextActions: z10.array(z10.string()).optional(),
2255
+ publishState: z10.string().optional(),
2256
+ releaseTitle: z10.string().optional(),
2257
+ theme: z10.string().optional()
2209
2258
  }).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()
2259
+ dynamoi_list_artists: z10.object({
2260
+ artists: z10.array(DescriptiveEntitySchema).optional(),
2261
+ nextCursor: z10.string().optional(),
2262
+ summary: z10.string().optional(),
2263
+ totalCount: z10.number().optional()
2215
2264
  }).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()
2265
+ dynamoi_list_campaigns: z10.object({
2266
+ campaigns: z10.array(DescriptiveEntitySchema).optional(),
2267
+ nextCursor: z10.string().optional(),
2268
+ summary: z10.string().optional(),
2269
+ totalCount: z10.number().optional()
2221
2270
  }).passthrough(),
2222
- dynamoi_preview_smart_link_themes: z9.object({
2223
- artistName: z9.string(),
2224
- releaseTitle: z9.string(),
2225
- themes: z9.array(DescriptiveEntitySchema)
2271
+ dynamoi_preview_smart_link_themes: z10.object({
2272
+ artistName: z10.string(),
2273
+ releaseTitle: z10.string(),
2274
+ themes: z10.array(DescriptiveEntitySchema)
2226
2275
  }).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()
2276
+ dynamoi_search: z10.object({
2277
+ nextCursor: z10.string().optional(),
2278
+ results: z10.array(DescriptiveEntitySchema).optional(),
2279
+ summary: z10.string().optional(),
2280
+ totalCount: z10.number().optional()
2232
2281
  }).passthrough(),
2233
2282
  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()
2283
+ artistId: z10.string().optional(),
2284
+ artistName: z10.string().optional(),
2285
+ defaultTheme: z10.string().optional(),
2286
+ renderQueuedCount: z10.number().optional(),
2287
+ renderWarning: z10.string().nullable().optional()
2239
2288
  }).passthrough(),
2240
2289
  fetch: DescriptiveEntitySchema,
2241
- search: z9.object({ results: z9.array(DescriptiveEntitySchema).optional() }).passthrough()
2290
+ search: z10.object({ results: z10.array(DescriptiveEntitySchema).optional() }).passthrough()
2242
2291
  };
2243
2292
  function getAdvertisedToolOutputSchema(options) {
2244
2293
  if (options.toolProfile !== "chatgpt-app") {
@@ -2248,11 +2297,11 @@ function getAdvertisedToolOutputSchema(options) {
2248
2297
  if (!dataSchema) {
2249
2298
  return options.canonical;
2250
2299
  }
2251
- return z9.object({
2300
+ return z10.object({
2252
2301
  data: dataSchema.optional(),
2253
- kind: z9.string().optional(),
2254
- message: z9.string().optional(),
2255
- status: z9.enum(["success", "partial_success", "error"])
2302
+ kind: z10.string().optional(),
2303
+ message: z10.string().optional(),
2304
+ status: z10.enum(["success", "partial_success", "error"])
2256
2305
  }).passthrough();
2257
2306
  }
2258
2307
  function getDynamoiToolOAuthScopes(toolName, providerScopes) {
@@ -2271,6 +2320,7 @@ var DYNAMOI_TOOL_DEFINITIONS = [
2271
2320
  ...PHASE_ONBOARDING_TOOL_DEFINITIONS,
2272
2321
  ...PHASE_2_TOOL_DEFINITIONS,
2273
2322
  ...PHASE_3_TOOL_DEFINITIONS,
2323
+ ...DISTRIBUTION_TOOL_DEFINITIONS,
2274
2324
  SMART_LINK_THEME_PREVIEW_TOOL_DEFINITION,
2275
2325
  ...PHASE_4_TOOL_DEFINITIONS
2276
2326
  ];
@@ -2292,6 +2342,7 @@ function getDynamoiToolDefinitions(options) {
2292
2342
  return definitions.filter((definition) => !CHATGPT_APP_EXCLUDED_TOOL_NAMES.has(definition.name));
2293
2343
  }
2294
2344
  var DYNAMOI_TOOL_DISPATCHERS = {
2345
+ dynamoi_apply_for_distribution: (adapter, input) => adapter.applyForDistribution(input),
2295
2346
  dynamoi_create_smart_link_from_spotify: (adapter, input) => adapter.createSmartLinkFromSpotify(input),
2296
2347
  dynamoi_create_smart_links_from_spotify_artist: (adapter, input) => adapter.createSmartLinksFromSpotifyArtist(input),
2297
2348
  dynamoi_get_account_overview: (adapter, input) => adapter.getCurrentUser(input),
@@ -2299,6 +2350,7 @@ var DYNAMOI_TOOL_DISPATCHERS = {
2299
2350
  dynamoi_get_billing: (adapter, input) => adapter.getBilling(input),
2300
2351
  dynamoi_get_campaign: (adapter, input) => adapter.getCampaign(input),
2301
2352
  dynamoi_get_campaign_readiness: (adapter, input) => adapter.getCampaignReadiness(input),
2353
+ dynamoi_get_distribution_application: (adapter, input) => adapter.getDistributionApplication(input),
2302
2354
  dynamoi_get_platform_status: (adapter, input) => adapter.getPlatformStatus(input),
2303
2355
  dynamoi_get_smart_link: (adapter, input) => adapter.getSmartLink(input),
2304
2356
  dynamoi_launch_campaign: (adapter, input) => adapter.launchCampaign(input),
@@ -2336,11 +2388,14 @@ function asTextResult(envelope) {
2336
2388
  }
2337
2389
  return JSON.stringify(envelope);
2338
2390
  })();
2339
- return {
2391
+ const result = {
2340
2392
  content: [{ text: plainText, type: "text" }],
2341
- structuredContent: envelope,
2342
- ...isToolError ? { isError: true } : {}
2393
+ structuredContent: envelope
2343
2394
  };
2395
+ if (isToolError) {
2396
+ result.isError = true;
2397
+ }
2398
+ return result;
2344
2399
  }
2345
2400
  function asValidatedTextResult(options) {
2346
2401
  const parsed = options.outputSchema.safeParse(options.envelope);
@@ -2366,20 +2421,24 @@ function createDynamoiMcpServer(options) {
2366
2421
  const title = def.title;
2367
2422
  const dispatcher = DYNAMOI_TOOL_DISPATCHERS[def.name];
2368
2423
  const idempotentHint = "idempotentHint" in def && typeof def.idempotentHint === "boolean" ? def.idempotentHint : undefined;
2424
+ const meta = {
2425
+ securitySchemes: buildDynamoiToolSecuritySchemes(getDynamoiToolOAuthScopes(def.name, options.oauthScopes ?? DYNAMOI_BETTER_AUTH_MCP_SCOPES))
2426
+ };
2427
+ if (def.name === "dynamoi_preview_smart_link_themes") {
2428
+ meta["openai/outputTemplate"] = SMART_LINK_THEME_PREVIEW_RESOURCE_URI;
2429
+ meta["ui"] = { resourceUri: SMART_LINK_THEME_PREVIEW_RESOURCE_URI };
2430
+ }
2431
+ const annotations = {
2432
+ destructiveHint: def.destructiveHint,
2433
+ openWorldHint: def.openWorldHint,
2434
+ readOnlyHint: def.readOnlyHint
2435
+ };
2436
+ if (typeof idempotentHint === "boolean") {
2437
+ annotations["idempotentHint"] = idempotentHint;
2438
+ }
2369
2439
  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
2382
- },
2440
+ _meta: meta,
2441
+ annotations,
2383
2442
  description: def.description,
2384
2443
  inputSchema: def.schema,
2385
2444
  outputSchema: getAdvertisedToolOutputSchema({
@@ -2512,6 +2571,7 @@ export {
2512
2571
  DynamoiGetSmartLinkAnalyticsInputSchema,
2513
2572
  DynamoiGetPlatformStatusInputSchema,
2514
2573
  DynamoiGetOnboardingStatusInputSchema,
2574
+ DynamoiGetDistributionApplicationInputSchema,
2515
2575
  DynamoiGetCurrentUserInputSchema,
2516
2576
  DynamoiGetCampaignReadinessInputSchema,
2517
2577
  DynamoiGetCampaignInputSchema,
@@ -2522,12 +2582,14 @@ export {
2522
2582
  DynamoiGetArtistAnalyticsInputSchema,
2523
2583
  DynamoiCreateSmartLinksFromSpotifyArtistInputSchema,
2524
2584
  DynamoiCreateSmartLinkFromSpotifyInputSchema,
2585
+ DynamoiApplyForDistributionInputSchema,
2525
2586
  DateRangeSchema2 as DateRangeSchema,
2526
2587
  DYNAMOI_MCP_VERSION,
2527
2588
  DYNAMOI_MCP_TOOL_SCOPES,
2528
2589
  DYNAMOI_MCP_SCOPES,
2529
- DYNAMOI_BETTER_AUTH_MCP_SCOPES
2590
+ DYNAMOI_BETTER_AUTH_MCP_SCOPES,
2591
+ DISTRIBUTION_TOOL_DEFINITIONS
2530
2592
  };
2531
2593
 
2532
- //# debugId=5EEF6599A31E134864756E2164756E21
2594
+ //# debugId=D3E585F59FF3955D64756E2164756E21
2533
2595
  //# sourceMappingURL=index.js.map