@dynamoi/mcp 0.6.2 → 0.6.3
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/CHANGELOG.md +18 -0
- package/dist/auth/protected-resource.d.ts +2 -1
- package/dist/auth/protected-resource.js +1 -1
- package/dist/{chunk-53YNLVA3.js → chunk-CHQUK72A.js} +14 -14
- package/dist/chunk-CHQUK72A.js.map +1 -0
- package/dist/index.d.ts +109 -64
- package/dist/index.js +400 -391
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/server.json +2 -2
- package/dist/chunk-53YNLVA3.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
DYNAMOI_MCP_SCOPES,
|
|
3
3
|
buildProtectedResourceMetadata,
|
|
4
4
|
buildWwwAuthenticateHeader
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-CHQUK72A.js";
|
|
6
6
|
|
|
7
7
|
// src/auth/verify-token.ts
|
|
8
8
|
import { createRemoteJWKSet, jwtVerify } from "jose";
|
|
@@ -73,18 +73,20 @@ async function verifyAccessToken(options) {
|
|
|
73
73
|
|
|
74
74
|
// src/server/create-server.ts
|
|
75
75
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
76
|
-
import * as
|
|
76
|
+
import * as z8 from "zod/v4";
|
|
77
77
|
|
|
78
78
|
// src/version.ts
|
|
79
|
-
var
|
|
79
|
+
var BUNDLED_DYNAMOI_MCP_VERSION = true ? "0.6.3" : "";
|
|
80
|
+
var DYNAMOI_MCP_VERSION = BUNDLED_DYNAMOI_MCP_VERSION.length > 0 && !BUNDLED_DYNAMOI_MCP_VERSION.includes("__") ? BUNDLED_DYNAMOI_MCP_VERSION : "0.6.3";
|
|
80
81
|
|
|
81
82
|
// src/server/instructions.ts
|
|
82
83
|
var DYNAMOI_MCP_INSTRUCTIONS = `
|
|
83
84
|
You are operating Dynamoi's tools on behalf of the authenticated user. Dynamoi helps
|
|
84
85
|
music artists promote on Spotify and YouTube creators grow channels through managed
|
|
85
|
-
Meta and Google ad campaigns. Smart Links are free to create and manage
|
|
86
|
-
|
|
87
|
-
budgets are separate
|
|
86
|
+
Meta and Google ad campaigns. Smart Links are free to create and manage. High-popularity
|
|
87
|
+
or unverifiable artist links may stay unpublished in verification hold until Dynamoi
|
|
88
|
+
can verify the client relationship. Managed advertising and ad budgets are separate
|
|
89
|
+
paid campaign services.
|
|
88
90
|
|
|
89
91
|
=== Session Start Routine ===
|
|
90
92
|
|
|
@@ -145,10 +147,48 @@ Common workflows:
|
|
|
145
147
|
- Launch: dynamoi_list_media_assets \u2192 dynamoi_launch_campaign
|
|
146
148
|
- 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
|
|
147
149
|
- Free Smart Link single-release creation: dynamoi_list_artists \u2192 dynamoi_create_smart_link_from_spotify
|
|
148
|
-
- Smart Link analytics/settings: dynamoi_list_smart_links \u2192 dynamoi_get_smart_link with
|
|
150
|
+
- Smart Link analytics/settings: dynamoi_list_smart_links \u2192 dynamoi_get_smart_link with includeAnalytics=true or includeArtistSettings=true
|
|
149
151
|
- 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.
|
|
150
152
|
- 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.
|
|
151
153
|
`.trim();
|
|
154
|
+
var DYNAMOI_CHATGPT_APP_INSTRUCTIONS = `
|
|
155
|
+
You are operating Dynamoi's ChatGPT app tools on behalf of the authenticated user.
|
|
156
|
+
Dynamoi helps artists and labels create free Spotify Smart Links and inspect existing
|
|
157
|
+
music-promotion records from ChatGPT.
|
|
158
|
+
|
|
159
|
+
This ChatGPT app surface is review-safe and does not start billing, external OAuth
|
|
160
|
+
connections, campaign launches, campaign budget changes, or direct purchase flows.
|
|
161
|
+
When the user asks to buy, subscribe, launch a paid campaign, connect Meta or YouTube,
|
|
162
|
+
or change a live campaign, explain that those steps happen in the Dynamoi dashboard.
|
|
163
|
+
Use the available read tools afterward to check existing status, analytics, and setup
|
|
164
|
+
state.
|
|
165
|
+
|
|
166
|
+
Principles:
|
|
167
|
+
- Answer general marketing, songwriting, lyrics, or social-media advice natively
|
|
168
|
+
unless the user explicitly asks about their Dynamoi account, artists, campaigns,
|
|
169
|
+
analytics, or Smart Links.
|
|
170
|
+
- Do not call Dynamoi tools just to "check context" for generic advice.
|
|
171
|
+
- For account questions, use dynamoi_get_account_overview first.
|
|
172
|
+
- For artist rosters, use dynamoi_list_artists.
|
|
173
|
+
- For existing campaigns, use dynamoi_list_campaigns, dynamoi_get_campaign, and
|
|
174
|
+
dynamoi_get_artist_analytics. These tools are read-only.
|
|
175
|
+
- For free Smart Links, use dynamoi_create_smart_link_from_spotify,
|
|
176
|
+
dynamoi_create_smart_links_from_spotify_artist, dynamoi_list_smart_links,
|
|
177
|
+
dynamoi_get_smart_link, and dynamoi_update_smart_link.
|
|
178
|
+
- When reading Smart Links, set includeAnalytics=true for visit/click analytics and
|
|
179
|
+
includeArtistSettings=true for artist-level theme or pixel settings.
|
|
180
|
+
- Smart Link pixel tools accept validated pixel IDs only. Do not ask for arbitrary
|
|
181
|
+
JavaScript, tag-manager snippets, or script code.
|
|
182
|
+
- Never claim you changed something unless the tool returned status "success" or
|
|
183
|
+
"partial_success".
|
|
184
|
+
- For writes, confirm intent and restate what will change.
|
|
185
|
+
- After a successful write tool call, answer directly from the returned record instead
|
|
186
|
+
of chaining more tools just to restate the result.
|
|
187
|
+
- When answering from Smart Link tools, lead with the artist hub URL when present,
|
|
188
|
+
then public release URLs, release title, artist name, status, and next action. Do
|
|
189
|
+
not include internal UUIDs unless the user explicitly asks for IDs or you need an ID
|
|
190
|
+
for a follow-up tool call.
|
|
191
|
+
`.trim();
|
|
152
192
|
|
|
153
193
|
// src/server/prompts.ts
|
|
154
194
|
import * as z from "zod/v4";
|
|
@@ -195,7 +235,7 @@ function registerDynamoiPrompts(server) {
|
|
|
195
235
|
[
|
|
196
236
|
"Explain Dynamoi free Smart Links.",
|
|
197
237
|
"Use MCP resources if needed, especially dynamoi://smart-links/free-plan and dynamoi://business/free-vs-paid.",
|
|
198
|
-
"Be clear: Smart Links are free
|
|
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.",
|
|
199
239
|
"Do not inspect my account data unless I ask about my artists, links, campaigns, billing, or settings."
|
|
200
240
|
].join("\n")
|
|
201
241
|
)
|
|
@@ -216,7 +256,7 @@ function registerDynamoiPrompts(server) {
|
|
|
216
256
|
args.artistId ? `Artist ID: ${args.artistId}` : "If no artistId is provided, list artists first and ask me which artist owns the link.",
|
|
217
257
|
args.spotifyUrl ? `Spotify URL: ${args.spotifyUrl}` : "Ask me for a Spotify artist, album, or track URL. Playlist URLs are not supported today.",
|
|
218
258
|
"",
|
|
219
|
-
"Smart Links are free
|
|
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.",
|
|
220
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."
|
|
221
261
|
].join("\n")
|
|
222
262
|
)
|
|
@@ -318,7 +358,7 @@ function registerPlaybookResources(server) {
|
|
|
318
358
|
mimeType: "application/json",
|
|
319
359
|
text: JSON.stringify({
|
|
320
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.",
|
|
321
|
-
freePlanReminder: "Free Smart Links have no per-link fee
|
|
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.",
|
|
322
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.",
|
|
323
363
|
persona: "Independent musician or small artist with at least one Spotify release. Goal: increase Spotify streams.",
|
|
324
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.",
|
|
@@ -639,7 +679,7 @@ function registerDynamoiResources(server, adapter) {
|
|
|
639
679
|
"Validated Meta, TikTok, and Google Ads pixel IDs",
|
|
640
680
|
"Publish and unpublish controls"
|
|
641
681
|
],
|
|
642
|
-
noCatch: "No per-link fee
|
|
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.",
|
|
643
683
|
paidSeparately: "Managed advertising campaigns and ad budgets are separate paid products."
|
|
644
684
|
}),
|
|
645
685
|
uri: uri.href
|
|
@@ -693,7 +733,7 @@ function registerDynamoiResources(server, adapter) {
|
|
|
693
733
|
text: JSON.stringify({
|
|
694
734
|
agentGuidance: "Do not imply that a Smart Link creates an ad campaign. Do not imply that campaign budgets are free.",
|
|
695
735
|
freeSmartLinks: {
|
|
696
|
-
claim: "Smart Links are free
|
|
736
|
+
claim: "Smart Links are free to create and manage. High-popularity or unverifiable artist links may require verification before public publishing.",
|
|
697
737
|
useFor: "Spotify landing pages, public release links, link sharing, basic link analytics, artist-level themes, and validated pixel IDs."
|
|
698
738
|
},
|
|
699
739
|
managedAdvertising: {
|
|
@@ -973,7 +1013,7 @@ function registerDynamoiResources(server, adapter) {
|
|
|
973
1013
|
}
|
|
974
1014
|
|
|
975
1015
|
// src/server/smart-link-tools.ts
|
|
976
|
-
import * as
|
|
1016
|
+
import * as z5 from "zod/v4";
|
|
977
1017
|
|
|
978
1018
|
// src/server/output-schemas.ts
|
|
979
1019
|
import * as z3 from "zod/v4";
|
|
@@ -1011,6 +1051,7 @@ var SmartLinkStatusSchemas = {
|
|
|
1011
1051
|
claimStatus: z3.enum([
|
|
1012
1052
|
"auto_approved",
|
|
1013
1053
|
"pending_ops_review",
|
|
1054
|
+
"verification_deferred",
|
|
1014
1055
|
"approved_by_ops",
|
|
1015
1056
|
"rejected"
|
|
1016
1057
|
]),
|
|
@@ -1213,7 +1254,8 @@ var ListSmartLinksOutputEnvelopeSchema = z3.union([
|
|
|
1213
1254
|
ErrorEnvelopeOutputSchema
|
|
1214
1255
|
]);
|
|
1215
1256
|
|
|
1216
|
-
// src/server/
|
|
1257
|
+
// src/server/shared-schemas.ts
|
|
1258
|
+
import * as z4 from "zod/v4";
|
|
1217
1259
|
var ToolFormatSchema = z4.enum(["json", "summary"]);
|
|
1218
1260
|
var IsoDateSchema = z4.string().regex(/^\d{4}-\d{2}-\d{2}$/);
|
|
1219
1261
|
var UserIntentSummarySchema = z4.string().trim().max(500).optional();
|
|
@@ -1223,6 +1265,9 @@ function isValidCalendarDate(value) {
|
|
|
1223
1265
|
const date = /* @__PURE__ */ new Date(`${value}T00:00:00.000Z`);
|
|
1224
1266
|
return Number.isFinite(date.getTime()) && date.toISOString().slice(0, 10) === value;
|
|
1225
1267
|
}
|
|
1268
|
+
var IsoCalendarDateSchema = IsoDateSchema.refine(isValidCalendarDate, {
|
|
1269
|
+
message: "must be a valid calendar date"
|
|
1270
|
+
});
|
|
1226
1271
|
var DateRangeSchema = z4.object({
|
|
1227
1272
|
end: IsoDateSchema,
|
|
1228
1273
|
start: IsoDateSchema
|
|
@@ -1249,99 +1294,137 @@ var DateRangeSchema = z4.object({
|
|
|
1249
1294
|
});
|
|
1250
1295
|
}
|
|
1251
1296
|
});
|
|
1297
|
+
|
|
1298
|
+
// src/server/smart-link-tools.ts
|
|
1252
1299
|
var SmartLinkStatusFiltersSchema = {
|
|
1253
|
-
claimStatus:
|
|
1300
|
+
claimStatus: z5.enum([
|
|
1254
1301
|
"auto_approved",
|
|
1255
1302
|
"pending_ops_review",
|
|
1303
|
+
"verification_deferred",
|
|
1256
1304
|
"approved_by_ops",
|
|
1257
1305
|
"rejected"
|
|
1258
1306
|
]).optional(),
|
|
1259
|
-
publishState:
|
|
1260
|
-
renderState:
|
|
1307
|
+
publishState: z5.enum(["published", "unpublished"]).optional(),
|
|
1308
|
+
renderState: z5.enum(["queued", "rendering", "rendered", "failed"]).optional()
|
|
1261
1309
|
};
|
|
1262
|
-
var SmartLinkThemeSchema =
|
|
1310
|
+
var SmartLinkThemeSchema = z5.enum([
|
|
1263
1311
|
"classic",
|
|
1264
1312
|
"brutalist",
|
|
1265
1313
|
"aurora",
|
|
1266
1314
|
"cinematic"
|
|
1267
1315
|
]);
|
|
1268
|
-
var
|
|
1269
|
-
|
|
1316
|
+
var LegacySmartLinkIncludeSchema = z5.array(
|
|
1317
|
+
z5.enum(["analytics", "artist_settings"])
|
|
1318
|
+
);
|
|
1319
|
+
function normalizeLegacySmartLinkInclude(rawInput) {
|
|
1320
|
+
if (!rawInput || typeof rawInput !== "object" || Array.isArray(rawInput)) {
|
|
1321
|
+
return rawInput;
|
|
1322
|
+
}
|
|
1323
|
+
const input = rawInput;
|
|
1324
|
+
if (!Object.hasOwn(input, "include")) {
|
|
1325
|
+
return rawInput;
|
|
1326
|
+
}
|
|
1327
|
+
const legacyInclude = LegacySmartLinkIncludeSchema.safeParse(
|
|
1328
|
+
input["include"]
|
|
1329
|
+
);
|
|
1330
|
+
if (!legacyInclude.success) {
|
|
1331
|
+
return rawInput;
|
|
1332
|
+
}
|
|
1333
|
+
const { include: _include, ...normalized } = input;
|
|
1334
|
+
if (normalized["includeAnalytics"] === void 0 && legacyInclude.data.includes("analytics")) {
|
|
1335
|
+
normalized["includeAnalytics"] = true;
|
|
1336
|
+
}
|
|
1337
|
+
if (normalized["includeArtistSettings"] === void 0 && legacyInclude.data.includes("artist_settings")) {
|
|
1338
|
+
normalized["includeArtistSettings"] = true;
|
|
1339
|
+
}
|
|
1340
|
+
return normalized;
|
|
1341
|
+
}
|
|
1342
|
+
var DynamoiCreateSmartLinkFromSpotifyInputSchema = z5.object({
|
|
1343
|
+
artistId: z5.string().uuid(),
|
|
1270
1344
|
clientRequestId: RequiredClientRequestIdSchema.optional(),
|
|
1271
|
-
customDescription:
|
|
1345
|
+
customDescription: z5.string().trim().max(500).optional(),
|
|
1272
1346
|
format: ToolFormatSchema.optional(),
|
|
1273
|
-
spotifyUrl:
|
|
1347
|
+
spotifyUrl: z5.string().trim().min(1).max(500),
|
|
1274
1348
|
userIntentSummary: UserIntentSummarySchema
|
|
1275
1349
|
}).strict();
|
|
1276
|
-
var DynamoiCreateSmartLinksFromSpotifyArtistInputSchema =
|
|
1277
|
-
artistId:
|
|
1350
|
+
var DynamoiCreateSmartLinksFromSpotifyArtistInputSchema = z5.object({
|
|
1351
|
+
artistId: z5.string().uuid().optional(),
|
|
1278
1352
|
clientRequestId: RequiredClientRequestIdSchema.optional(),
|
|
1279
1353
|
format: ToolFormatSchema.optional(),
|
|
1280
|
-
spotifyArtistUrl:
|
|
1354
|
+
spotifyArtistUrl: z5.string().trim().min(1).max(500),
|
|
1281
1355
|
userIntentSummary: UserIntentSummarySchema
|
|
1282
1356
|
}).strict();
|
|
1283
|
-
var DynamoiListSmartLinksInputSchema =
|
|
1284
|
-
artistId:
|
|
1285
|
-
cursor:
|
|
1357
|
+
var DynamoiListSmartLinksInputSchema = z5.object({
|
|
1358
|
+
artistId: z5.string().uuid(),
|
|
1359
|
+
cursor: z5.string().optional(),
|
|
1286
1360
|
format: ToolFormatSchema.optional(),
|
|
1287
|
-
limit:
|
|
1288
|
-
query:
|
|
1361
|
+
limit: z5.number().int().min(1).max(50).optional(),
|
|
1362
|
+
query: z5.string().trim().max(120).optional(),
|
|
1289
1363
|
...SmartLinkStatusFiltersSchema
|
|
1290
1364
|
}).strict();
|
|
1291
|
-
var
|
|
1292
|
-
artistId:
|
|
1365
|
+
var DynamoiGetSmartLinkInputShape = {
|
|
1366
|
+
artistId: z5.string().uuid().optional(),
|
|
1293
1367
|
dateRange: DateRangeSchema.optional(),
|
|
1294
1368
|
format: ToolFormatSchema.optional(),
|
|
1295
|
-
granularity:
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
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()
|
|
1375
|
+
};
|
|
1376
|
+
function validateDynamoiGetSmartLinkInput(data, ctx) {
|
|
1377
|
+
const settingsOnly = data.includeArtistSettings === true && !data.playLinkId && !data.spotifyUrl && Boolean(data.artistId);
|
|
1302
1378
|
if (!(data.playLinkId || data.artistId && data.spotifyUrl || settingsOnly)) {
|
|
1303
1379
|
ctx.addIssue({
|
|
1304
1380
|
code: "custom",
|
|
1305
|
-
message: "Provide playLinkId, artistId with spotifyUrl, or artistId with
|
|
1381
|
+
message: "Provide playLinkId, artistId with spotifyUrl, or artistId with includeArtistSettings=true",
|
|
1306
1382
|
path: ["playLinkId"]
|
|
1307
1383
|
});
|
|
1308
1384
|
}
|
|
1309
|
-
if ((data.dateRange || data.granularity || data.includeBreakdowns) &&
|
|
1385
|
+
if ((data.dateRange || data.granularity || data.includeBreakdowns) && data.includeAnalytics !== true) {
|
|
1310
1386
|
ctx.addIssue({
|
|
1311
1387
|
code: "custom",
|
|
1312
|
-
message: "dateRange, granularity, and includeBreakdowns require
|
|
1313
|
-
path: ["
|
|
1388
|
+
message: "dateRange, granularity, and includeBreakdowns require includeAnalytics=true",
|
|
1389
|
+
path: ["includeAnalytics"]
|
|
1314
1390
|
});
|
|
1315
1391
|
}
|
|
1316
|
-
}
|
|
1317
|
-
var
|
|
1392
|
+
}
|
|
1393
|
+
var StrictDynamoiGetSmartLinkInputSchema = z5.object(DynamoiGetSmartLinkInputShape).strict().superRefine(validateDynamoiGetSmartLinkInput);
|
|
1394
|
+
var DynamoiGetSmartLinkInputSchema = StrictDynamoiGetSmartLinkInputSchema;
|
|
1395
|
+
function parseDynamoiGetSmartLinkInput(rawInput) {
|
|
1396
|
+
return StrictDynamoiGetSmartLinkInputSchema.parse(
|
|
1397
|
+
normalizeLegacySmartLinkInclude(rawInput)
|
|
1398
|
+
);
|
|
1399
|
+
}
|
|
1400
|
+
var DynamoiGetSmartLinkAnalyticsInputSchema = z5.object({
|
|
1318
1401
|
dateRange: DateRangeSchema.optional(),
|
|
1319
1402
|
format: ToolFormatSchema.optional(),
|
|
1320
|
-
granularity:
|
|
1321
|
-
includeBreakdowns:
|
|
1322
|
-
playLinkId:
|
|
1403
|
+
granularity: z5.enum(["TOTAL", "DAILY"]).optional(),
|
|
1404
|
+
includeBreakdowns: z5.boolean().optional(),
|
|
1405
|
+
playLinkId: z5.string().uuid()
|
|
1323
1406
|
}).strict();
|
|
1324
|
-
var DynamoiGetSmartLinkArtistSettingsInputSchema =
|
|
1325
|
-
artistId:
|
|
1407
|
+
var DynamoiGetSmartLinkArtistSettingsInputSchema = z5.object({
|
|
1408
|
+
artistId: z5.string().uuid(),
|
|
1326
1409
|
format: ToolFormatSchema.optional()
|
|
1327
1410
|
}).strict();
|
|
1328
|
-
var DynamoiUpdateSmartLinkInputSchema =
|
|
1329
|
-
action:
|
|
1411
|
+
var DynamoiUpdateSmartLinkInputSchema = z5.object({
|
|
1412
|
+
action: z5.enum([
|
|
1330
1413
|
"update_description",
|
|
1331
1414
|
"update_artist_settings",
|
|
1332
1415
|
"publish",
|
|
1333
1416
|
"unpublish"
|
|
1334
1417
|
]),
|
|
1335
|
-
artistId:
|
|
1418
|
+
artistId: z5.string().uuid().optional(),
|
|
1336
1419
|
clientRequestId: ClientRequestIdSchema,
|
|
1337
|
-
customDescription:
|
|
1338
|
-
expectedPublishState:
|
|
1339
|
-
expectedUpdatedAt:
|
|
1340
|
-
googleAdsConversionId:
|
|
1341
|
-
metaPixelId:
|
|
1342
|
-
playLinkId:
|
|
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(),
|
|
1343
1426
|
theme: SmartLinkThemeSchema.optional(),
|
|
1344
|
-
tiktokPixelId:
|
|
1427
|
+
tiktokPixelId: z5.string().trim().max(32).nullable().optional(),
|
|
1345
1428
|
userIntentSummary: UserIntentSummarySchema
|
|
1346
1429
|
}).strict().superRefine((data, ctx) => {
|
|
1347
1430
|
if (data.action === "update_description" && data.customDescription === void 0) {
|
|
@@ -1406,13 +1489,13 @@ var DynamoiUpdateSmartLinkInputSchema = z4.object({
|
|
|
1406
1489
|
});
|
|
1407
1490
|
}
|
|
1408
1491
|
});
|
|
1409
|
-
var DynamoiUpdateSmartLinkArtistSettingsInputSchema =
|
|
1410
|
-
artistId:
|
|
1492
|
+
var DynamoiUpdateSmartLinkArtistSettingsInputSchema = z5.object({
|
|
1493
|
+
artistId: z5.string().uuid(),
|
|
1411
1494
|
clientRequestId: ClientRequestIdSchema,
|
|
1412
|
-
googleAdsConversionId:
|
|
1413
|
-
metaPixelId:
|
|
1495
|
+
googleAdsConversionId: z5.string().trim().max(32).nullable().optional(),
|
|
1496
|
+
metaPixelId: z5.string().trim().max(32).nullable().optional(),
|
|
1414
1497
|
theme: SmartLinkThemeSchema.optional(),
|
|
1415
|
-
tiktokPixelId:
|
|
1498
|
+
tiktokPixelId: z5.string().trim().max(32).nullable().optional(),
|
|
1416
1499
|
userIntentSummary: UserIntentSummarySchema
|
|
1417
1500
|
}).strict().superRefine((data, ctx) => {
|
|
1418
1501
|
if (data.theme === void 0 && data.metaPixelId === void 0 && data.tiktokPixelId === void 0 && data.googleAdsConversionId === void 0) {
|
|
@@ -1423,15 +1506,15 @@ var DynamoiUpdateSmartLinkArtistSettingsInputSchema = z4.object({
|
|
|
1423
1506
|
});
|
|
1424
1507
|
}
|
|
1425
1508
|
});
|
|
1426
|
-
var DynamoiPublishSmartLinkInputSchema =
|
|
1509
|
+
var DynamoiPublishSmartLinkInputSchema = z5.object({
|
|
1427
1510
|
clientRequestId: ClientRequestIdSchema,
|
|
1428
|
-
expectedPublishState:
|
|
1429
|
-
playLinkId:
|
|
1511
|
+
expectedPublishState: z5.enum(["published", "unpublished"]).optional(),
|
|
1512
|
+
playLinkId: z5.string().uuid(),
|
|
1430
1513
|
userIntentSummary: UserIntentSummarySchema
|
|
1431
1514
|
}).strict();
|
|
1432
1515
|
var PHASE_4_TOOL_DEFINITIONS = [
|
|
1433
1516
|
{
|
|
1434
|
-
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
|
|
1517
|
+
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.",
|
|
1435
1518
|
destructiveHint: true,
|
|
1436
1519
|
idempotentHint: true,
|
|
1437
1520
|
name: "dynamoi_create_smart_link_from_spotify",
|
|
@@ -1442,8 +1525,8 @@ var PHASE_4_TOOL_DEFINITIONS = [
|
|
|
1442
1525
|
title: "Create Free Smart Link from Spotify"
|
|
1443
1526
|
},
|
|
1444
1527
|
{
|
|
1445
|
-
description: "Use this when the user gives a Spotify artist URL and wants Dynamoi to create, import, or refresh free Smart Links for the artist catalog and return the artist hub. If the signed-in user has no Dynamoi artist yet, omit artistId so Dynamoi can create the first artist from the Spotify artist profile. This starts the background catalog import so the user does not need to open the dashboard. Smart Links are free
|
|
1446
|
-
destructiveHint:
|
|
1528
|
+
description: "Use this when the user gives a Spotify artist URL and wants Dynamoi to create, import, or refresh free Smart Links for the artist catalog and return the artist hub. If the signed-in user has no Dynamoi artist yet, omit artistId so Dynamoi can create the first artist from the Spotify artist profile. This starts the background catalog import so the user does not need to open the dashboard. Smart Links are free to create and manage. High-popularity or unverifiable artist catalog links may stay unpublished in verification hold until Dynamoi can verify the client relationship. This does not create a paid ad campaign. In the final answer, lead with the artist hub URL and current public Smart Link URLs; do not expose internal IDs unless asked.",
|
|
1529
|
+
destructiveHint: true,
|
|
1447
1530
|
idempotentHint: true,
|
|
1448
1531
|
name: "dynamoi_create_smart_links_from_spotify_artist",
|
|
1449
1532
|
openWorldHint: true,
|
|
@@ -1463,7 +1546,7 @@ var PHASE_4_TOOL_DEFINITIONS = [
|
|
|
1463
1546
|
title: "List Smart Links"
|
|
1464
1547
|
},
|
|
1465
1548
|
{
|
|
1466
|
-
description: "Use this when the user wants full details for one free Smart Link, including release, Spotify URL, public play.dynamoi.com URL, current status, theme source, and next actions.
|
|
1549
|
+
description: "Use this when the user wants full details for one free Smart Link, including release, Spotify URL, public play.dynamoi.com URL, current status, theme source, and next actions. Set includeAnalytics=true for visit/click analytics and includeArtistSettings=true for artist-level theme/pixel settings. In the final answer, lead with the public URL and do not expose internal IDs unless asked.",
|
|
1467
1550
|
destructiveHint: false,
|
|
1468
1551
|
name: "dynamoi_get_smart_link",
|
|
1469
1552
|
openWorldHint: false,
|
|
@@ -1486,7 +1569,7 @@ var PHASE_4_TOOL_DEFINITIONS = [
|
|
|
1486
1569
|
];
|
|
1487
1570
|
|
|
1488
1571
|
// src/server/tools.ts
|
|
1489
|
-
import * as
|
|
1572
|
+
import * as z7 from "zod/v4";
|
|
1490
1573
|
|
|
1491
1574
|
// src/server/onboarding-tool-definitions.ts
|
|
1492
1575
|
function createPhaseOnboardingToolDefinitions(schemas) {
|
|
@@ -1517,12 +1600,12 @@ function createPhaseOnboardingToolDefinitions(schemas) {
|
|
|
1517
1600
|
}
|
|
1518
1601
|
|
|
1519
1602
|
// src/server/openai-tools.ts
|
|
1520
|
-
import * as
|
|
1521
|
-
var DynamoiOpenAiSearchInputSchema =
|
|
1522
|
-
query:
|
|
1603
|
+
import * as z6 from "zod/v4";
|
|
1604
|
+
var DynamoiOpenAiSearchInputSchema = z6.object({
|
|
1605
|
+
query: z6.string().trim().min(1).max(500)
|
|
1523
1606
|
}).strict();
|
|
1524
|
-
var DynamoiOpenAiFetchInputSchema =
|
|
1525
|
-
id:
|
|
1607
|
+
var DynamoiOpenAiFetchInputSchema = z6.object({
|
|
1608
|
+
id: z6.string().trim().min(1).max(200)
|
|
1526
1609
|
}).strict();
|
|
1527
1610
|
var OPENAI_TOOL_DEFINITIONS = [
|
|
1528
1611
|
{
|
|
@@ -1555,12 +1638,10 @@ var OPENAI_TOOL_DEFINITIONS = [
|
|
|
1555
1638
|
];
|
|
1556
1639
|
|
|
1557
1640
|
// src/server/tools.ts
|
|
1558
|
-
var
|
|
1559
|
-
var
|
|
1560
|
-
var
|
|
1561
|
-
var
|
|
1562
|
-
var OnboardingAttemptIdSchema = z6.string().trim().min(1).max(120).optional();
|
|
1563
|
-
var ExpectedCampaignStatusSchema = z6.enum([
|
|
1641
|
+
var DateRangeSchema2 = DateRangeSchema;
|
|
1642
|
+
var ToolFormatSchema2 = ToolFormatSchema;
|
|
1643
|
+
var OnboardingAttemptIdSchema = z7.string().trim().min(1).max(120).optional();
|
|
1644
|
+
var ExpectedCampaignStatusEnum = z7.enum([
|
|
1564
1645
|
"AWAITING_SMART_LINK",
|
|
1565
1646
|
"ACTIVE",
|
|
1566
1647
|
"ARCHIVED",
|
|
@@ -1571,25 +1652,25 @@ var ExpectedCampaignStatusSchema = z6.enum([
|
|
|
1571
1652
|
"PAUSED",
|
|
1572
1653
|
"READY_FOR_REVIEW",
|
|
1573
1654
|
"SUBSCRIPTION_PAUSED"
|
|
1655
|
+
]);
|
|
1656
|
+
var ExpectedCampaignStatusSchema = ExpectedCampaignStatusEnum.optional();
|
|
1657
|
+
var CampaignStatusFilterSchema = ExpectedCampaignStatusEnum.exclude([
|
|
1658
|
+
"ENDED"
|
|
1574
1659
|
]).optional();
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
}
|
|
1579
|
-
var DynamoiListArtistsInputSchema = z6.object({
|
|
1580
|
-
artistId: z6.string().uuid().optional(),
|
|
1581
|
-
cursor: z6.string().optional(),
|
|
1660
|
+
var DynamoiListArtistsInputSchema = z7.object({
|
|
1661
|
+
artistId: z7.string().uuid().optional(),
|
|
1662
|
+
cursor: z7.string().optional(),
|
|
1582
1663
|
format: ToolFormatSchema2.optional(),
|
|
1583
|
-
limit:
|
|
1664
|
+
limit: z7.number().int().min(1).max(50).optional()
|
|
1584
1665
|
}).strict();
|
|
1585
|
-
var DynamoiSearchInputSchema =
|
|
1586
|
-
artistId:
|
|
1587
|
-
cursor:
|
|
1666
|
+
var DynamoiSearchInputSchema = z7.object({
|
|
1667
|
+
artistId: z7.string().uuid().optional(),
|
|
1668
|
+
cursor: z7.string().optional(),
|
|
1588
1669
|
format: ToolFormatSchema2.optional(),
|
|
1589
|
-
includeArchived:
|
|
1590
|
-
limit:
|
|
1591
|
-
query:
|
|
1592
|
-
type:
|
|
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()
|
|
1593
1674
|
}).strict().superRefine((data, ctx) => {
|
|
1594
1675
|
if (!(data.type || data.query)) {
|
|
1595
1676
|
ctx.addIssue({
|
|
@@ -1599,159 +1680,133 @@ var DynamoiSearchInputSchema = z6.object({
|
|
|
1599
1680
|
});
|
|
1600
1681
|
}
|
|
1601
1682
|
});
|
|
1602
|
-
var DynamoiGetCurrentUserIntentSchema =
|
|
1683
|
+
var DynamoiGetCurrentUserIntentSchema = z7.enum([
|
|
1603
1684
|
"account_overview",
|
|
1604
1685
|
"artist_access_check",
|
|
1605
1686
|
"organization_access_check",
|
|
1606
1687
|
"platform_connection_check"
|
|
1607
1688
|
]);
|
|
1608
|
-
var DynamoiGetCurrentUserInputSchema =
|
|
1689
|
+
var DynamoiGetCurrentUserInputSchema = z7.object({
|
|
1609
1690
|
format: ToolFormatSchema2.optional(),
|
|
1610
1691
|
intent: DynamoiGetCurrentUserIntentSchema
|
|
1611
1692
|
}).strict();
|
|
1612
|
-
var DynamoiGetArtistInputSchema =
|
|
1613
|
-
artistId:
|
|
1693
|
+
var DynamoiGetArtistInputSchema = z7.object({
|
|
1694
|
+
artistId: z7.string().uuid(),
|
|
1614
1695
|
format: ToolFormatSchema2.optional()
|
|
1615
1696
|
}).strict();
|
|
1616
|
-
var DynamoiListCampaignsInputSchema =
|
|
1617
|
-
artistId:
|
|
1618
|
-
campaignType:
|
|
1619
|
-
cursor:
|
|
1697
|
+
var DynamoiListCampaignsInputSchema = z7.object({
|
|
1698
|
+
artistId: z7.string().uuid(),
|
|
1699
|
+
campaignType: z7.enum(["SMART_CAMPAIGN", "YOUTUBE"]).optional(),
|
|
1700
|
+
cursor: z7.string().optional(),
|
|
1620
1701
|
format: ToolFormatSchema2.optional(),
|
|
1621
|
-
limit:
|
|
1622
|
-
status:
|
|
1702
|
+
limit: z7.number().int().min(1).max(50).optional(),
|
|
1703
|
+
status: CampaignStatusFilterSchema
|
|
1623
1704
|
}).strict();
|
|
1624
|
-
var
|
|
1625
|
-
end: IsoDateSchema2,
|
|
1626
|
-
start: IsoDateSchema2
|
|
1627
|
-
}).strict().superRefine((data, ctx) => {
|
|
1628
|
-
if (!isValidCalendarDate2(data.start)) {
|
|
1629
|
-
ctx.addIssue({
|
|
1630
|
-
code: "custom",
|
|
1631
|
-
message: "start must be a valid calendar date",
|
|
1632
|
-
path: ["start"]
|
|
1633
|
-
});
|
|
1634
|
-
}
|
|
1635
|
-
if (!isValidCalendarDate2(data.end)) {
|
|
1636
|
-
ctx.addIssue({
|
|
1637
|
-
code: "custom",
|
|
1638
|
-
message: "end must be a valid calendar date",
|
|
1639
|
-
path: ["end"]
|
|
1640
|
-
});
|
|
1641
|
-
}
|
|
1642
|
-
if (isValidCalendarDate2(data.start) && isValidCalendarDate2(data.end) && data.start > data.end) {
|
|
1643
|
-
ctx.addIssue({
|
|
1644
|
-
code: "custom",
|
|
1645
|
-
message: "start must be on or before end",
|
|
1646
|
-
path: ["start"]
|
|
1647
|
-
});
|
|
1648
|
-
}
|
|
1649
|
-
});
|
|
1650
|
-
var DynamoiGetCampaignInputSchema = z6.object({
|
|
1705
|
+
var DynamoiGetCampaignInputSchema = z7.object({
|
|
1651
1706
|
analyticsDateRange: DateRangeSchema2.optional(),
|
|
1652
|
-
analyticsGranularity:
|
|
1653
|
-
campaignId:
|
|
1707
|
+
analyticsGranularity: z7.enum(["TOTAL", "DAILY"]).optional(),
|
|
1708
|
+
campaignId: z7.string().uuid(),
|
|
1654
1709
|
format: ToolFormatSchema2.optional(),
|
|
1655
|
-
includeAnalytics:
|
|
1656
|
-
includeCountries:
|
|
1657
|
-
includeDeploymentStatus:
|
|
1710
|
+
includeAnalytics: z7.boolean().optional(),
|
|
1711
|
+
includeCountries: z7.boolean().optional(),
|
|
1712
|
+
includeDeploymentStatus: z7.boolean().optional()
|
|
1658
1713
|
}).strict();
|
|
1659
|
-
var DynamoiGetCampaignAnalyticsInputSchema =
|
|
1660
|
-
campaignId:
|
|
1714
|
+
var DynamoiGetCampaignAnalyticsInputSchema = z7.object({
|
|
1715
|
+
campaignId: z7.string().uuid(),
|
|
1661
1716
|
dateRange: DateRangeSchema2.optional(),
|
|
1662
1717
|
format: ToolFormatSchema2.optional(),
|
|
1663
|
-
granularity:
|
|
1718
|
+
granularity: z7.enum(["TOTAL", "DAILY"]).optional()
|
|
1664
1719
|
}).strict();
|
|
1665
|
-
var DynamoiGetArtistAnalyticsInputSchema =
|
|
1666
|
-
artistId:
|
|
1720
|
+
var DynamoiGetArtistAnalyticsInputSchema = z7.object({
|
|
1721
|
+
artistId: z7.string().uuid(),
|
|
1667
1722
|
dateRange: DateRangeSchema2.optional(),
|
|
1668
1723
|
format: ToolFormatSchema2.optional(),
|
|
1669
|
-
granularity:
|
|
1724
|
+
granularity: z7.enum(["TOTAL", "DAILY"]).optional()
|
|
1670
1725
|
}).strict();
|
|
1671
|
-
var DynamoiGetBillingInputSchema =
|
|
1672
|
-
artistId:
|
|
1726
|
+
var DynamoiGetBillingInputSchema = z7.object({
|
|
1727
|
+
artistId: z7.string().uuid(),
|
|
1673
1728
|
format: ToolFormatSchema2.optional(),
|
|
1674
1729
|
onboardingAttemptId: OnboardingAttemptIdSchema
|
|
1675
1730
|
}).strict();
|
|
1676
|
-
var LocationTargetSchema =
|
|
1677
|
-
code:
|
|
1678
|
-
name:
|
|
1731
|
+
var LocationTargetSchema = z7.object({
|
|
1732
|
+
code: z7.string().trim().min(1).max(8),
|
|
1733
|
+
name: z7.string().trim().min(1).max(120)
|
|
1679
1734
|
}).strict();
|
|
1680
|
-
var DynamoiGetPlatformStatusInputSchema =
|
|
1681
|
-
artistId:
|
|
1735
|
+
var DynamoiGetPlatformStatusInputSchema = z7.object({
|
|
1736
|
+
artistId: z7.string().uuid(),
|
|
1682
1737
|
format: ToolFormatSchema2.optional(),
|
|
1683
1738
|
onboardingAttemptId: OnboardingAttemptIdSchema,
|
|
1684
|
-
onboardingFlow:
|
|
1739
|
+
onboardingFlow: z7.enum(["meta", "youtube"]).optional()
|
|
1685
1740
|
}).strict();
|
|
1686
|
-
var DynamoiStartYoutubeChannelLinkInputSchema =
|
|
1687
|
-
artistId:
|
|
1741
|
+
var DynamoiStartYoutubeChannelLinkInputSchema = z7.object({
|
|
1742
|
+
artistId: z7.string().uuid(),
|
|
1688
1743
|
format: ToolFormatSchema2.optional(),
|
|
1689
|
-
userIntentSummary:
|
|
1744
|
+
userIntentSummary: UserIntentSummarySchema
|
|
1690
1745
|
}).strict();
|
|
1691
|
-
var DynamoiStartMetaConnectionInputSchema =
|
|
1692
|
-
artistId:
|
|
1746
|
+
var DynamoiStartMetaConnectionInputSchema = z7.object({
|
|
1747
|
+
artistId: z7.string().uuid(),
|
|
1693
1748
|
format: ToolFormatSchema2.optional(),
|
|
1694
|
-
userIntentSummary:
|
|
1749
|
+
userIntentSummary: UserIntentSummarySchema
|
|
1695
1750
|
}).strict();
|
|
1696
|
-
var DynamoiListAvailableCountriesInputSchema =
|
|
1697
|
-
campaignType:
|
|
1698
|
-
cursor:
|
|
1751
|
+
var DynamoiListAvailableCountriesInputSchema = z7.object({
|
|
1752
|
+
campaignType: z7.enum(["SMART_CAMPAIGN", "YOUTUBE"]),
|
|
1753
|
+
cursor: z7.string().optional(),
|
|
1699
1754
|
format: ToolFormatSchema2.optional(),
|
|
1700
|
-
limit:
|
|
1701
|
-
query:
|
|
1755
|
+
limit: z7.number().int().min(1).max(100).optional(),
|
|
1756
|
+
query: z7.string().trim().max(120).optional()
|
|
1702
1757
|
}).strict();
|
|
1703
|
-
var DynamoiGetOnboardingStatusInputSchema =
|
|
1704
|
-
artistId:
|
|
1758
|
+
var DynamoiGetOnboardingStatusInputSchema = z7.object({
|
|
1759
|
+
artistId: z7.string().uuid(),
|
|
1705
1760
|
format: ToolFormatSchema2.optional()
|
|
1706
1761
|
}).strict();
|
|
1707
|
-
var DynamoiGetCampaignReadinessInputSchema =
|
|
1708
|
-
artistId:
|
|
1709
|
-
budgetAmount:
|
|
1710
|
-
budgetType:
|
|
1711
|
-
campaignType:
|
|
1712
|
-
contentType:
|
|
1713
|
-
endDate:
|
|
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(),
|
|
1768
|
+
endDate: IsoCalendarDateSchema.optional(),
|
|
1714
1769
|
format: ToolFormatSchema2.optional(),
|
|
1715
|
-
locationTargets:
|
|
1716
|
-
mediaAssetIds:
|
|
1717
|
-
spotifyUrl:
|
|
1718
|
-
youtubeVideoId:
|
|
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()
|
|
1719
1774
|
}).strict();
|
|
1720
|
-
var DynamoiGetCampaignDeploymentStatusInputSchema =
|
|
1721
|
-
campaignId:
|
|
1775
|
+
var DynamoiGetCampaignDeploymentStatusInputSchema = z7.object({
|
|
1776
|
+
campaignId: z7.string().uuid(),
|
|
1722
1777
|
format: ToolFormatSchema2.optional()
|
|
1723
1778
|
}).strict();
|
|
1724
|
-
var DynamoiPauseCampaignInputSchema =
|
|
1725
|
-
campaignId:
|
|
1726
|
-
clientRequestId:
|
|
1779
|
+
var DynamoiPauseCampaignInputSchema = z7.object({
|
|
1780
|
+
campaignId: z7.string().uuid(),
|
|
1781
|
+
clientRequestId: ClientRequestIdSchema,
|
|
1727
1782
|
expectedCurrentStatus: ExpectedCampaignStatusSchema,
|
|
1728
|
-
userIntentSummary:
|
|
1783
|
+
userIntentSummary: UserIntentSummarySchema
|
|
1729
1784
|
}).strict();
|
|
1730
|
-
var DynamoiResumeCampaignInputSchema =
|
|
1731
|
-
campaignId:
|
|
1732
|
-
clientRequestId:
|
|
1785
|
+
var DynamoiResumeCampaignInputSchema = z7.object({
|
|
1786
|
+
campaignId: z7.string().uuid(),
|
|
1787
|
+
clientRequestId: ClientRequestIdSchema,
|
|
1733
1788
|
expectedCurrentStatus: ExpectedCampaignStatusSchema,
|
|
1734
|
-
userIntentSummary:
|
|
1789
|
+
userIntentSummary: UserIntentSummarySchema
|
|
1735
1790
|
}).strict();
|
|
1736
|
-
var DynamoiUpdateBudgetInputSchema =
|
|
1737
|
-
budgetAmount:
|
|
1738
|
-
campaignId:
|
|
1739
|
-
clientRequestId:
|
|
1740
|
-
endDate:
|
|
1741
|
-
expectedCurrentBudgetAmount:
|
|
1742
|
-
expectedCurrentEndDate:
|
|
1743
|
-
userIntentSummary:
|
|
1791
|
+
var DynamoiUpdateBudgetInputSchema = z7.object({
|
|
1792
|
+
budgetAmount: z7.number().finite().positive(),
|
|
1793
|
+
campaignId: z7.string().uuid(),
|
|
1794
|
+
clientRequestId: ClientRequestIdSchema,
|
|
1795
|
+
endDate: IsoCalendarDateSchema.optional(),
|
|
1796
|
+
expectedCurrentBudgetAmount: z7.number().finite().positive().optional(),
|
|
1797
|
+
expectedCurrentEndDate: IsoCalendarDateSchema.optional(),
|
|
1798
|
+
userIntentSummary: UserIntentSummarySchema
|
|
1744
1799
|
}).strict();
|
|
1745
|
-
var DynamoiUpdateCampaignInputSchema =
|
|
1746
|
-
action:
|
|
1747
|
-
budgetAmount:
|
|
1748
|
-
campaignId:
|
|
1749
|
-
clientRequestId:
|
|
1750
|
-
endDate:
|
|
1751
|
-
expectedCurrentBudgetAmount:
|
|
1752
|
-
expectedCurrentEndDate:
|
|
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(),
|
|
1804
|
+
clientRequestId: ClientRequestIdSchema,
|
|
1805
|
+
endDate: IsoCalendarDateSchema.optional(),
|
|
1806
|
+
expectedCurrentBudgetAmount: z7.number().finite().positive().optional(),
|
|
1807
|
+
expectedCurrentEndDate: IsoCalendarDateSchema.optional(),
|
|
1753
1808
|
expectedCurrentStatus: ExpectedCampaignStatusSchema,
|
|
1754
|
-
userIntentSummary:
|
|
1809
|
+
userIntentSummary: UserIntentSummarySchema
|
|
1755
1810
|
}).strict().superRefine((data, ctx) => {
|
|
1756
1811
|
if (data.action === "update_budget" && data.budgetAmount === void 0) {
|
|
1757
1812
|
ctx.addIssue({
|
|
@@ -1777,40 +1832,40 @@ var DynamoiUpdateCampaignInputSchema = z6.object({
|
|
|
1777
1832
|
}
|
|
1778
1833
|
}
|
|
1779
1834
|
});
|
|
1780
|
-
var DynamoiListMediaAssetsInputSchema =
|
|
1781
|
-
artistId:
|
|
1782
|
-
cursor:
|
|
1835
|
+
var DynamoiListMediaAssetsInputSchema = z7.object({
|
|
1836
|
+
artistId: z7.string().uuid(),
|
|
1837
|
+
cursor: z7.string().optional(),
|
|
1783
1838
|
format: ToolFormatSchema2.optional(),
|
|
1784
|
-
includeUrls:
|
|
1785
|
-
limit:
|
|
1839
|
+
includeUrls: z7.boolean().optional(),
|
|
1840
|
+
limit: z7.number().int().min(1).max(50).optional()
|
|
1786
1841
|
}).strict();
|
|
1787
|
-
var DynamoiLaunchCampaignInputSchema =
|
|
1842
|
+
var DynamoiLaunchCampaignInputSchema = z7.object({
|
|
1788
1843
|
// Creative
|
|
1789
|
-
adCopy:
|
|
1790
|
-
appleMusicUrl:
|
|
1791
|
-
artistId:
|
|
1844
|
+
adCopy: z7.string().trim().max(500).optional(),
|
|
1845
|
+
appleMusicUrl: z7.string().trim().min(1).max(500).optional(),
|
|
1846
|
+
artistId: z7.string().uuid(),
|
|
1792
1847
|
// Budget
|
|
1793
|
-
budgetAmount:
|
|
1794
|
-
budgetSplits:
|
|
1795
|
-
|
|
1796
|
-
|
|
1848
|
+
budgetAmount: z7.number().finite().positive(),
|
|
1849
|
+
budgetSplits: z7.record(
|
|
1850
|
+
z7.enum(["META", "GOOGLE"]),
|
|
1851
|
+
z7.number().int().min(0).max(100)
|
|
1797
1852
|
),
|
|
1798
|
-
budgetType:
|
|
1799
|
-
campaignType:
|
|
1853
|
+
budgetType: z7.enum(["DAILY", "TOTAL"]),
|
|
1854
|
+
campaignType: z7.enum(["SMART_CAMPAIGN", "YOUTUBE"]),
|
|
1800
1855
|
// Idempotency (client-generated UUID)
|
|
1801
|
-
clientRequestId:
|
|
1856
|
+
clientRequestId: z7.string().uuid(),
|
|
1802
1857
|
// Content
|
|
1803
|
-
contentTitle:
|
|
1804
|
-
contentType:
|
|
1805
|
-
endDate:
|
|
1858
|
+
contentTitle: z7.string().trim().min(1).max(160),
|
|
1859
|
+
contentType: z7.enum(["TRACK", "ALBUM", "PLAYLIST", "VIDEO"]),
|
|
1860
|
+
endDate: IsoCalendarDateSchema.optional(),
|
|
1806
1861
|
// Targeting
|
|
1807
|
-
locationTargets:
|
|
1862
|
+
locationTargets: z7.array(LocationTargetSchema).optional(),
|
|
1808
1863
|
// Smart Campaign creative selection (existing assets only in Phase 3)
|
|
1809
|
-
mediaAssetIds:
|
|
1810
|
-
spotifyUrl:
|
|
1811
|
-
useAiGeneratedCopy:
|
|
1812
|
-
userIntentSummary:
|
|
1813
|
-
youtubeVideoId:
|
|
1864
|
+
mediaAssetIds: z7.array(z7.string().uuid()).optional(),
|
|
1865
|
+
spotifyUrl: z7.string().trim().min(1).max(500).optional(),
|
|
1866
|
+
useAiGeneratedCopy: z7.boolean().optional(),
|
|
1867
|
+
userIntentSummary: UserIntentSummarySchema,
|
|
1868
|
+
youtubeVideoId: z7.string().trim().min(1).max(128).optional()
|
|
1814
1869
|
}).strict().superRefine((data, ctx) => {
|
|
1815
1870
|
const sum = Object.values(data.budgetSplits ?? {}).reduce(
|
|
1816
1871
|
(acc, v) => acc + (Number.isFinite(v) ? v : 0),
|
|
@@ -1896,7 +1951,7 @@ var PHASE_1_TOOL_DEFINITIONS = [
|
|
|
1896
1951
|
title: "Get Account Overview"
|
|
1897
1952
|
},
|
|
1898
1953
|
{
|
|
1899
|
-
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';
|
|
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.",
|
|
1900
1955
|
destructiveHint: false,
|
|
1901
1956
|
name: "dynamoi_list_artists",
|
|
1902
1957
|
openWorldHint: false,
|
|
@@ -1906,7 +1961,7 @@ var PHASE_1_TOOL_DEFINITIONS = [
|
|
|
1906
1961
|
title: "List Artists"
|
|
1907
1962
|
},
|
|
1908
1963
|
{
|
|
1909
|
-
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
|
|
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.",
|
|
1910
1965
|
destructiveHint: false,
|
|
1911
1966
|
name: "dynamoi_search",
|
|
1912
1967
|
openWorldHint: false,
|
|
@@ -1957,7 +2012,7 @@ var PHASE_1_TOOL_DEFINITIONS = [
|
|
|
1957
2012
|
title: "Get Billing"
|
|
1958
2013
|
},
|
|
1959
2014
|
{
|
|
1960
|
-
description: "Use this when the user wants to know whether Spotify, Meta, or YouTube are connected and what setup steps still block launches. When polling after
|
|
2015
|
+
description: "Use this when the user wants to know whether Spotify, Meta, or YouTube are connected and what setup steps still block launches. When polling after a connection-start flow, pass the returned onboardingAttemptId and onboardingFlow so Dynamoi ops can correlate the browser step. Do not use this for detailed billing questions. Never use this to personalize generic Instagram or marketing-advice questions.",
|
|
1961
2016
|
destructiveHint: false,
|
|
1962
2017
|
name: "dynamoi_get_platform_status",
|
|
1963
2018
|
openWorldHint: false,
|
|
@@ -2031,9 +2086,62 @@ var PHASE_3_TOOL_DEFINITIONS = [
|
|
|
2031
2086
|
];
|
|
2032
2087
|
|
|
2033
2088
|
// src/server/create-server.ts
|
|
2034
|
-
var SdkToolOutputEnvelopeSchema =
|
|
2035
|
-
status:
|
|
2089
|
+
var SdkToolOutputEnvelopeSchema = z8.object({
|
|
2090
|
+
status: z8.enum(["success", "partial_success", "error"])
|
|
2036
2091
|
}).passthrough();
|
|
2092
|
+
function buildDynamoiToolSecuritySchemes() {
|
|
2093
|
+
return [{ scopes: [...DYNAMOI_MCP_SCOPES], type: "oauth2" }];
|
|
2094
|
+
}
|
|
2095
|
+
var DYNAMOI_TOOL_DEFINITIONS = [
|
|
2096
|
+
...PHASE_1_TOOL_DEFINITIONS,
|
|
2097
|
+
...PHASE_ONBOARDING_TOOL_DEFINITIONS,
|
|
2098
|
+
...PHASE_2_TOOL_DEFINITIONS,
|
|
2099
|
+
...PHASE_3_TOOL_DEFINITIONS,
|
|
2100
|
+
...PHASE_4_TOOL_DEFINITIONS
|
|
2101
|
+
];
|
|
2102
|
+
var CHATGPT_APP_EXCLUDED_TOOL_NAMES = /* @__PURE__ */ new Set([
|
|
2103
|
+
"dynamoi_get_billing",
|
|
2104
|
+
"dynamoi_get_campaign_readiness",
|
|
2105
|
+
"dynamoi_launch_campaign",
|
|
2106
|
+
"dynamoi_list_available_countries",
|
|
2107
|
+
"dynamoi_list_media_assets",
|
|
2108
|
+
"dynamoi_start_meta_connection",
|
|
2109
|
+
"dynamoi_start_youtube_channel_link",
|
|
2110
|
+
"dynamoi_update_campaign"
|
|
2111
|
+
]);
|
|
2112
|
+
function getDynamoiToolDefinitions(options) {
|
|
2113
|
+
const definitions = [...DYNAMOI_TOOL_DEFINITIONS];
|
|
2114
|
+
if ((options?.toolProfile ?? "full") !== "chatgpt-app") {
|
|
2115
|
+
return definitions;
|
|
2116
|
+
}
|
|
2117
|
+
return definitions.filter(
|
|
2118
|
+
(definition) => !CHATGPT_APP_EXCLUDED_TOOL_NAMES.has(definition.name)
|
|
2119
|
+
);
|
|
2120
|
+
}
|
|
2121
|
+
var DYNAMOI_TOOL_DISPATCHERS = {
|
|
2122
|
+
dynamoi_create_smart_link_from_spotify: (adapter, input) => adapter.createSmartLinkFromSpotify(input),
|
|
2123
|
+
dynamoi_create_smart_links_from_spotify_artist: (adapter, input) => adapter.createSmartLinksFromSpotifyArtist(input),
|
|
2124
|
+
dynamoi_get_account_overview: (adapter, input) => adapter.getCurrentUser(input),
|
|
2125
|
+
dynamoi_get_artist_analytics: (adapter, input) => adapter.getArtistAnalytics(input),
|
|
2126
|
+
dynamoi_get_billing: (adapter, input) => adapter.getBilling(input),
|
|
2127
|
+
dynamoi_get_campaign: (adapter, input) => adapter.getCampaign(input),
|
|
2128
|
+
dynamoi_get_campaign_readiness: (adapter, input) => adapter.getCampaignReadiness(input),
|
|
2129
|
+
dynamoi_get_platform_status: (adapter, input) => adapter.getPlatformStatus(input),
|
|
2130
|
+
dynamoi_get_smart_link: (adapter, input) => adapter.getSmartLink(input),
|
|
2131
|
+
dynamoi_launch_campaign: (adapter, input) => adapter.launchCampaign(input),
|
|
2132
|
+
dynamoi_list_artists: (adapter, input) => adapter.listArtists(input),
|
|
2133
|
+
dynamoi_list_available_countries: (adapter, input) => adapter.listAvailableCountries(input),
|
|
2134
|
+
dynamoi_list_campaigns: (adapter, input) => adapter.listCampaigns(input),
|
|
2135
|
+
dynamoi_list_media_assets: (adapter, input) => adapter.listMediaAssets(input),
|
|
2136
|
+
dynamoi_list_smart_links: (adapter, input) => adapter.listSmartLinks(input),
|
|
2137
|
+
dynamoi_search: (adapter, input) => adapter.search(input),
|
|
2138
|
+
dynamoi_start_meta_connection: (adapter, input) => adapter.startMetaConnection(input),
|
|
2139
|
+
dynamoi_start_youtube_channel_link: (adapter, input) => adapter.startYoutubeChannelLink(input),
|
|
2140
|
+
dynamoi_update_campaign: (adapter, input) => adapter.updateCampaign(input),
|
|
2141
|
+
dynamoi_update_smart_link: (adapter, input) => adapter.updateSmartLink(input),
|
|
2142
|
+
fetch: (adapter, input) => adapter.openAiFetch(input),
|
|
2143
|
+
search: (adapter, input) => adapter.openAiSearch(input)
|
|
2144
|
+
};
|
|
2037
2145
|
function asTextResult(envelope) {
|
|
2038
2146
|
const isToolError = Boolean(envelope) && typeof envelope === "object" && envelope.status === "error";
|
|
2039
2147
|
const plainText = (() => {
|
|
@@ -2072,26 +2180,27 @@ function asValidatedTextResult(options) {
|
|
|
2072
2180
|
return asTextResult(options.envelope);
|
|
2073
2181
|
}
|
|
2074
2182
|
function createDynamoiMcpServer(options) {
|
|
2183
|
+
const toolProfile = options.toolProfile ?? "full";
|
|
2075
2184
|
const server = new McpServer(
|
|
2076
2185
|
{
|
|
2077
2186
|
name: "dynamoi",
|
|
2078
2187
|
version: DYNAMOI_MCP_VERSION,
|
|
2079
2188
|
websiteUrl: options.websiteUrl ?? "https://dynamoi.com"
|
|
2080
2189
|
},
|
|
2081
|
-
{
|
|
2190
|
+
{
|
|
2191
|
+
instructions: toolProfile === "chatgpt-app" ? DYNAMOI_CHATGPT_APP_INSTRUCTIONS : DYNAMOI_MCP_INSTRUCTIONS
|
|
2192
|
+
}
|
|
2082
2193
|
);
|
|
2083
|
-
for (const def of
|
|
2084
|
-
...PHASE_1_TOOL_DEFINITIONS,
|
|
2085
|
-
...PHASE_ONBOARDING_TOOL_DEFINITIONS,
|
|
2086
|
-
...PHASE_2_TOOL_DEFINITIONS,
|
|
2087
|
-
...PHASE_3_TOOL_DEFINITIONS,
|
|
2088
|
-
...PHASE_4_TOOL_DEFINITIONS
|
|
2089
|
-
]) {
|
|
2194
|
+
for (const def of getDynamoiToolDefinitions({ toolProfile })) {
|
|
2090
2195
|
const title = def.title;
|
|
2196
|
+
const dispatcher = DYNAMOI_TOOL_DISPATCHERS[def.name];
|
|
2091
2197
|
const idempotentHint = "idempotentHint" in def && typeof def.idempotentHint === "boolean" ? def.idempotentHint : void 0;
|
|
2092
2198
|
server.registerTool(
|
|
2093
2199
|
def.name,
|
|
2094
2200
|
{
|
|
2201
|
+
_meta: {
|
|
2202
|
+
securitySchemes: buildDynamoiToolSecuritySchemes()
|
|
2203
|
+
},
|
|
2095
2204
|
annotations: {
|
|
2096
2205
|
destructiveHint: def.destructiveHint,
|
|
2097
2206
|
...typeof idempotentHint === "boolean" ? { idempotentHint } : {},
|
|
@@ -2106,151 +2215,17 @@ function createDynamoiMcpServer(options) {
|
|
|
2106
2215
|
outputSchema: SdkToolOutputEnvelopeSchema,
|
|
2107
2216
|
title
|
|
2108
2217
|
},
|
|
2109
|
-
async (input) => {
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
outputSchema: def.outputSchema,
|
|
2115
|
-
toolName: def.name
|
|
2116
|
-
});
|
|
2117
|
-
case "dynamoi_list_artists":
|
|
2118
|
-
return asValidatedTextResult({
|
|
2119
|
-
envelope: await options.adapter.listArtists(input),
|
|
2120
|
-
outputSchema: def.outputSchema,
|
|
2121
|
-
toolName: def.name
|
|
2122
|
-
});
|
|
2123
|
-
case "dynamoi_search":
|
|
2124
|
-
return asValidatedTextResult({
|
|
2125
|
-
envelope: await options.adapter.search(input),
|
|
2126
|
-
outputSchema: def.outputSchema,
|
|
2127
|
-
toolName: def.name
|
|
2128
|
-
});
|
|
2129
|
-
case "search":
|
|
2130
|
-
return asValidatedTextResult({
|
|
2131
|
-
envelope: await options.adapter.openAiSearch(input),
|
|
2132
|
-
outputSchema: def.outputSchema,
|
|
2133
|
-
toolName: def.name
|
|
2134
|
-
});
|
|
2135
|
-
case "fetch":
|
|
2136
|
-
return asValidatedTextResult({
|
|
2137
|
-
envelope: await options.adapter.openAiFetch(input),
|
|
2138
|
-
outputSchema: def.outputSchema,
|
|
2139
|
-
toolName: def.name
|
|
2140
|
-
});
|
|
2141
|
-
case "dynamoi_get_artist_analytics":
|
|
2142
|
-
return asValidatedTextResult({
|
|
2143
|
-
envelope: await options.adapter.getArtistAnalytics(input),
|
|
2144
|
-
outputSchema: def.outputSchema,
|
|
2145
|
-
toolName: def.name
|
|
2146
|
-
});
|
|
2147
|
-
case "dynamoi_list_campaigns":
|
|
2148
|
-
return asValidatedTextResult({
|
|
2149
|
-
envelope: await options.adapter.listCampaigns(input),
|
|
2150
|
-
outputSchema: def.outputSchema,
|
|
2151
|
-
toolName: def.name
|
|
2152
|
-
});
|
|
2153
|
-
case "dynamoi_get_campaign":
|
|
2154
|
-
return asValidatedTextResult({
|
|
2155
|
-
envelope: await options.adapter.getCampaign(input),
|
|
2156
|
-
outputSchema: def.outputSchema,
|
|
2157
|
-
toolName: def.name
|
|
2158
|
-
});
|
|
2159
|
-
case "dynamoi_get_billing":
|
|
2160
|
-
return asValidatedTextResult({
|
|
2161
|
-
envelope: await options.adapter.getBilling(input),
|
|
2162
|
-
outputSchema: def.outputSchema,
|
|
2163
|
-
toolName: def.name
|
|
2164
|
-
});
|
|
2165
|
-
case "dynamoi_start_meta_connection":
|
|
2166
|
-
return asValidatedTextResult({
|
|
2167
|
-
envelope: await options.adapter.startMetaConnection(input),
|
|
2168
|
-
outputSchema: def.outputSchema,
|
|
2169
|
-
toolName: def.name
|
|
2170
|
-
});
|
|
2171
|
-
case "dynamoi_get_platform_status":
|
|
2172
|
-
return asValidatedTextResult({
|
|
2173
|
-
envelope: await options.adapter.getPlatformStatus(input),
|
|
2174
|
-
outputSchema: def.outputSchema,
|
|
2175
|
-
toolName: def.name
|
|
2176
|
-
});
|
|
2177
|
-
case "dynamoi_start_youtube_channel_link":
|
|
2178
|
-
return asValidatedTextResult({
|
|
2179
|
-
envelope: await options.adapter.startYoutubeChannelLink(input),
|
|
2180
|
-
outputSchema: def.outputSchema,
|
|
2181
|
-
toolName: def.name
|
|
2182
|
-
});
|
|
2183
|
-
case "dynamoi_list_available_countries":
|
|
2184
|
-
return asValidatedTextResult({
|
|
2185
|
-
envelope: await options.adapter.listAvailableCountries(input),
|
|
2186
|
-
outputSchema: def.outputSchema,
|
|
2187
|
-
toolName: def.name
|
|
2188
|
-
});
|
|
2189
|
-
case "dynamoi_get_campaign_readiness":
|
|
2190
|
-
return asValidatedTextResult({
|
|
2191
|
-
envelope: await options.adapter.getCampaignReadiness(input),
|
|
2192
|
-
outputSchema: def.outputSchema,
|
|
2193
|
-
toolName: def.name
|
|
2194
|
-
});
|
|
2195
|
-
case "dynamoi_update_campaign":
|
|
2196
|
-
return asValidatedTextResult({
|
|
2197
|
-
envelope: await options.adapter.updateCampaign(input),
|
|
2198
|
-
outputSchema: def.outputSchema,
|
|
2199
|
-
toolName: def.name
|
|
2200
|
-
});
|
|
2201
|
-
case "dynamoi_list_media_assets":
|
|
2202
|
-
return asValidatedTextResult({
|
|
2203
|
-
envelope: await options.adapter.listMediaAssets(input),
|
|
2204
|
-
outputSchema: def.outputSchema,
|
|
2205
|
-
toolName: def.name
|
|
2206
|
-
});
|
|
2207
|
-
case "dynamoi_launch_campaign":
|
|
2208
|
-
return asValidatedTextResult({
|
|
2209
|
-
envelope: await options.adapter.launchCampaign(input),
|
|
2210
|
-
outputSchema: def.outputSchema,
|
|
2211
|
-
toolName: def.name
|
|
2212
|
-
});
|
|
2213
|
-
case "dynamoi_create_smart_link_from_spotify":
|
|
2214
|
-
return asValidatedTextResult({
|
|
2215
|
-
envelope: await options.adapter.createSmartLinkFromSpotify(input),
|
|
2216
|
-
outputSchema: def.outputSchema,
|
|
2217
|
-
toolName: def.name
|
|
2218
|
-
});
|
|
2219
|
-
case "dynamoi_create_smart_links_from_spotify_artist":
|
|
2220
|
-
return asValidatedTextResult({
|
|
2221
|
-
envelope: await options.adapter.createSmartLinksFromSpotifyArtist(input),
|
|
2222
|
-
outputSchema: def.outputSchema,
|
|
2223
|
-
toolName: def.name
|
|
2224
|
-
});
|
|
2225
|
-
case "dynamoi_list_smart_links":
|
|
2226
|
-
return asValidatedTextResult({
|
|
2227
|
-
envelope: await options.adapter.listSmartLinks(input),
|
|
2228
|
-
outputSchema: def.outputSchema,
|
|
2229
|
-
toolName: def.name
|
|
2230
|
-
});
|
|
2231
|
-
case "dynamoi_get_smart_link":
|
|
2232
|
-
return asValidatedTextResult({
|
|
2233
|
-
envelope: await options.adapter.getSmartLink(input),
|
|
2234
|
-
outputSchema: def.outputSchema,
|
|
2235
|
-
toolName: def.name
|
|
2236
|
-
});
|
|
2237
|
-
case "dynamoi_update_smart_link":
|
|
2238
|
-
return asValidatedTextResult({
|
|
2239
|
-
envelope: await options.adapter.updateSmartLink(input),
|
|
2240
|
-
outputSchema: def.outputSchema,
|
|
2241
|
-
toolName: def.name
|
|
2242
|
-
});
|
|
2243
|
-
default:
|
|
2244
|
-
return asTextResult({
|
|
2245
|
-
message: "Unknown tool",
|
|
2246
|
-
status: "error"
|
|
2247
|
-
});
|
|
2248
|
-
}
|
|
2249
|
-
}
|
|
2218
|
+
async (input) => asValidatedTextResult({
|
|
2219
|
+
envelope: await dispatcher(options.adapter, input),
|
|
2220
|
+
outputSchema: def.outputSchema,
|
|
2221
|
+
toolName: def.name
|
|
2222
|
+
})
|
|
2250
2223
|
);
|
|
2251
2224
|
}
|
|
2252
|
-
|
|
2253
|
-
|
|
2225
|
+
if (toolProfile === "full") {
|
|
2226
|
+
registerDynamoiPrompts(server);
|
|
2227
|
+
registerDynamoiResources(server, options.adapter);
|
|
2228
|
+
}
|
|
2254
2229
|
return server;
|
|
2255
2230
|
}
|
|
2256
2231
|
|
|
@@ -2307,9 +2282,40 @@ function jsonRpcSessionNotFound() {
|
|
|
2307
2282
|
}
|
|
2308
2283
|
);
|
|
2309
2284
|
}
|
|
2285
|
+
function isRecord(value) {
|
|
2286
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
2287
|
+
}
|
|
2288
|
+
function normalizeLegacyDynamoiToolCallArguments(parsedBody) {
|
|
2289
|
+
if (Array.isArray(parsedBody)) {
|
|
2290
|
+
return parsedBody.map(
|
|
2291
|
+
(message) => normalizeLegacyDynamoiToolCallArguments(message)
|
|
2292
|
+
);
|
|
2293
|
+
}
|
|
2294
|
+
if (!isRecord(parsedBody) || parsedBody.method !== "tools/call") {
|
|
2295
|
+
return parsedBody;
|
|
2296
|
+
}
|
|
2297
|
+
const params = parsedBody.params;
|
|
2298
|
+
if (!isRecord(params) || params.name !== "dynamoi_get_smart_link") {
|
|
2299
|
+
return parsedBody;
|
|
2300
|
+
}
|
|
2301
|
+
const normalizedArguments = normalizeLegacySmartLinkInclude(params.arguments);
|
|
2302
|
+
if (normalizedArguments === params.arguments) {
|
|
2303
|
+
return parsedBody;
|
|
2304
|
+
}
|
|
2305
|
+
return {
|
|
2306
|
+
...parsedBody,
|
|
2307
|
+
params: {
|
|
2308
|
+
...params,
|
|
2309
|
+
arguments: normalizedArguments
|
|
2310
|
+
}
|
|
2311
|
+
};
|
|
2312
|
+
}
|
|
2310
2313
|
async function handleMcpHttpRequest(options) {
|
|
2311
2314
|
const nowMs = Date.now();
|
|
2312
2315
|
const enableSessions = options.enableSessions ?? true;
|
|
2316
|
+
const parsedBody = normalizeLegacyDynamoiToolCallArguments(
|
|
2317
|
+
options.parsedBody
|
|
2318
|
+
);
|
|
2313
2319
|
cleanupTransports(nowMs);
|
|
2314
2320
|
const sessionId = enableSessions ? getHeader(options.request, "mcp-session-id") : null;
|
|
2315
2321
|
const existing = sessionId ? transports.get(sessionId) : void 0;
|
|
@@ -2321,7 +2327,7 @@ async function handleMcpHttpRequest(options) {
|
|
|
2321
2327
|
}
|
|
2322
2328
|
existing.lastUsedAtMs = nowMs;
|
|
2323
2329
|
const response = await existing.transport.handleRequest(options.request, {
|
|
2324
|
-
parsedBody
|
|
2330
|
+
parsedBody
|
|
2325
2331
|
});
|
|
2326
2332
|
if (options.request.method.toUpperCase() === "DELETE" && sessionId) {
|
|
2327
2333
|
closeTransportBestEffort(existing);
|
|
@@ -2329,10 +2335,10 @@ async function handleMcpHttpRequest(options) {
|
|
|
2329
2335
|
}
|
|
2330
2336
|
return response;
|
|
2331
2337
|
}
|
|
2332
|
-
if (sessionId && !isInitializeRequest(
|
|
2338
|
+
if (sessionId && !isInitializeRequest(parsedBody)) {
|
|
2333
2339
|
return jsonRpcSessionNotFound();
|
|
2334
2340
|
}
|
|
2335
|
-
const isInit = isInitializeRequest(
|
|
2341
|
+
const isInit = isInitializeRequest(parsedBody);
|
|
2336
2342
|
const transport = new WebStandardStreamableHTTPServerTransport({
|
|
2337
2343
|
onsessioninitialized: (sid) => {
|
|
2338
2344
|
transports.set(sid, {
|
|
@@ -2348,11 +2354,12 @@ async function handleMcpHttpRequest(options) {
|
|
|
2348
2354
|
const server = options.createServer();
|
|
2349
2355
|
await server.connect(transport);
|
|
2350
2356
|
return transport.handleRequest(options.request, {
|
|
2351
|
-
parsedBody
|
|
2357
|
+
parsedBody
|
|
2352
2358
|
});
|
|
2353
2359
|
}
|
|
2354
2360
|
export {
|
|
2355
2361
|
DYNAMOI_MCP_SCOPES,
|
|
2362
|
+
DYNAMOI_MCP_VERSION,
|
|
2356
2363
|
DateRangeSchema2 as DateRangeSchema,
|
|
2357
2364
|
DynamoiCreateSmartLinkFromSpotifyInputSchema,
|
|
2358
2365
|
DynamoiCreateSmartLinksFromSpotifyArtistInputSchema,
|
|
@@ -2396,7 +2403,9 @@ export {
|
|
|
2396
2403
|
buildProtectedResourceMetadata,
|
|
2397
2404
|
buildWwwAuthenticateHeader,
|
|
2398
2405
|
createDynamoiMcpServer,
|
|
2406
|
+
getDynamoiToolDefinitions,
|
|
2399
2407
|
handleMcpHttpRequest,
|
|
2408
|
+
parseDynamoiGetSmartLinkInput,
|
|
2400
2409
|
verifyAccessToken
|
|
2401
2410
|
};
|
|
2402
2411
|
//# sourceMappingURL=index.js.map
|