@adport/mcp 0.12.0 → 0.12.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/bin.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  assembleRuntime,
4
4
  runStdioServer
5
- } from "./chunk-FKKOEMUR.js";
5
+ } from "./chunk-RE4ZCAVJ.js";
6
6
 
7
7
  // src/bin.ts
8
8
  var includeRawTools = process.argv.includes("--raw-api-tools");
@@ -22,7 +22,7 @@ import { createOpenAIModule } from "@adport/provider-openai";
22
22
  // package.json
23
23
  var package_default = {
24
24
  name: "@adport/mcp",
25
- version: "0.12.0",
25
+ version: "0.12.1",
26
26
  description: "adport MCP server \u2014 the open control plane for paid media",
27
27
  license: "Apache-2.0",
28
28
  type: "module",
@@ -1032,7 +1032,7 @@ var OPERATION_UI_SCRIPT = String.raw`
1032
1032
  if (!object(value) || depth>8) return [];
1033
1033
  return Object.entries(value).filter(([key])=>!['_adport','data_source','pending_operation_id'].includes(key)).flatMap(([key,item])=>{
1034
1034
  const path=prefix?prefix+'.'+key:key;
1035
- return object(item)?dataFields(item,path,depth+1):[{label:human(path),after:item}];
1035
+ return object(item)?dataFields(item,path,depth+1):[{path,label:human(path),after:item}];
1036
1036
  });
1037
1037
  }
1038
1038
  function valueHTML(value,compact=false) {
@@ -1289,6 +1289,118 @@ var APPLE_REPORT_UI_SCRIPT = String.raw`
1289
1289
  }
1290
1290
  `;
1291
1291
 
1292
+ // src/gaql-report-ui.ts
1293
+ var GAQL_REPORT_UI = String.raw`
1294
+ const gaqlEntities = new Map([
1295
+ ['searchTermView.searchTerm', 'Search term'], ['campaignSearchTermView.searchTerm', 'Search term'],
1296
+ ['adGroupCriterion.keyword.text', 'Keyword'], ['segments.keyword.info.text', 'Keyword'],
1297
+ ['adGroupAd.ad.name', 'Ad'], ['adGroupAd.ad.id', 'Ad ID'],
1298
+ ['asset.name', 'Asset'], ['asset.id', 'Asset ID'], ['assetGroup.name', 'Asset group'], ['assetGroup.id', 'Asset group ID'],
1299
+ ['adGroup.name', 'Ad group'], ['adGroup.id', 'Ad group ID'], ['campaign.name', 'Campaign'], ['campaign.id', 'Campaign ID'],
1300
+ ['customer.descriptiveName', 'Account'], ['customer.id', 'Account ID']
1301
+ ]);
1302
+
1303
+ function gaqlDimensions(row) {
1304
+ const {metrics, ...dimensions} = row;
1305
+ return new Map(dataFields(dimensions)
1306
+ .filter(({path, after}) => after != null && !Array.isArray(after) && String(after).trim() &&
1307
+ !/(?:currency(?:_?code)?$|token|secret|password|authorization)/i.test(path))
1308
+ .map(({path, after}) => [path, String(after)]));
1309
+ }
1310
+
1311
+ function gaqlDimensionLabel(path) {
1312
+ if (gaqlEntities.has(path)) return gaqlEntities.get(path);
1313
+ if (path.endsWith('.keyword.matchType') || path.endsWith('.keyword.info.matchType')) return 'Match type';
1314
+ return human(human(path.replace(/^segments\./, '')).toLowerCase()).replace(/\bid\b/i, 'ID');
1315
+ }
1316
+
1317
+ const gaqlMoneyFormats = new Map();
1318
+ function gaqlAmount(amount, currency) {
1319
+ const locale = state.host.locale || 'en', key = locale + '/' + (currency || '');
1320
+ if (!gaqlMoneyFormats.has(key)) {
1321
+ const digits = currency ? new Intl.NumberFormat(locale, {style:'currency', currency}).resolvedOptions().maximumFractionDigits : 2;
1322
+ gaqlMoneyFormats.set(key, {
1323
+ format: new Intl.NumberFormat(locale, {minimumFractionDigits:digits, maximumFractionDigits:digits}),
1324
+ unit: 10 ** -digits
1325
+ });
1326
+ }
1327
+ const {format, unit} = gaqlMoneyFormats.get(key);
1328
+ if (Number(amount) !== 0 && Math.abs(Number(amount)) < unit) {
1329
+ return Number(amount) < 0 ? '>' + format.format(-unit) : '<' + format.format(unit);
1330
+ }
1331
+ return format.format(amount);
1332
+ }
1333
+
1334
+ function gaqlHasTrend(points, dimensions, paths) {
1335
+ // A dated series must refer to the same returned entity and breakdown on every date.
1336
+ if (points.length > 366 || new Set(points.map(point => point.date)).size < 2) return false;
1337
+ const series = new Map(), observations = new Set();
1338
+ const seriesPaths = paths.filter(path => path !== 'segments.date');
1339
+ return points.every((point, i) => {
1340
+ if (!point.date) return false;
1341
+ const identity = JSON.stringify(seriesPaths.map(path => dimensions[i].get(path)));
1342
+ const observation = JSON.stringify([point.series, point.date]);
1343
+ if (observations.has(observation) || (series.has(point.series) && series.get(point.series) !== identity)) return false;
1344
+ observations.add(observation);
1345
+ series.set(point.series, identity);
1346
+ return true;
1347
+ }) && series.size <= 3;
1348
+ }
1349
+
1350
+ function gaqlReportTable(records, points) {
1351
+ const dimensions = records.map(record => record?.gaqlDimensions || new Map());
1352
+ const paths = [...new Set(dimensions.flatMap(row => [...row.keys()]))];
1353
+ const fields = [...new Set(points.flatMap(row => row.fields.map(field => field.key)))];
1354
+ const first = records[0];
1355
+ const commonEntity = first?.gaqlEntity && records.every(row => row?.gaqlEntity === first.gaqlEntity);
1356
+ if (points.length <= 8 && fields.length === 1 && commonEntity && !points.some(point => point.date) &&
1357
+ new Set(points.map(point => point.name)).size === points.length) return null;
1358
+ const monetary = fields.some(key => nativeReportMoneyField(key, 'google'));
1359
+ const currencies = new Set(records.map(row => row?.currency || ''));
1360
+ if ((!monetary || currencies.size === 1) && gaqlHasTrend(points, dimensions, paths)) return null;
1361
+
1362
+ const varies = path => dimensions.some(row => row.get(path) !== dimensions[0].get(path));
1363
+ const varying = paths.filter(varies);
1364
+ const identifiers = [...gaqlEntities.keys()].filter(path => varying.includes(path));
1365
+ const names = identifiers.filter(path => !path.endsWith('.id'));
1366
+ const columns = [...new Set([...names, ...identifiers, ...varying])].filter(path => !path.endsWith('.resourceName'));
1367
+ const distinct = keys => new Set(dimensions.map(row => JSON.stringify(keys.map(key => row.get(key))))).size;
1368
+ let identities = distinct(columns);
1369
+ for (const path of varying.filter(path => path.endsWith('.resourceName'))) {
1370
+ const withResource = distinct([...columns, path]);
1371
+ if (withResource > identities) { columns.push(path); identities = withResource; }
1372
+ }
1373
+ const primary = columns.shift() ?? (records.length === 1 ? first?.gaqlEntity : undefined);
1374
+ const metrics = fields.sort((a, b) => reportMetricPriority(a) - reportMetricPriority(b));
1375
+ const mixed = monetary && currencies.size > 1;
1376
+ const currency = currencies.size === 1 ? first?.currency : null;
1377
+ const headers = [primary ? gaqlDimensionLabel(primary) : 'Row', ...metrics.map(key =>
1378
+ nativeReportLabel(key) + (currency && nativeReportMoneyField(key, 'google') ? ' · ' + currency : '')),
1379
+ ...(mixed ? ['Currency'] : []), ...columns.map(gaqlDimensionLabel)];
1380
+ const values = points.map((point, i) => [
1381
+ primary ? dimensions[i].get(primary) : i + 1,
1382
+ ...metrics.map(key => {
1383
+ const field = point.fields.find(field => field.key === key);
1384
+ return field?.shortDisplay ?? field?.display;
1385
+ }),
1386
+ ...(mixed ? [records[i]?.currency] : []), ...columns.map(path => dimensions[i].get(path))
1387
+ ]);
1388
+ const scope = paths.filter(path => path !== primary && !varying.includes(path) &&
1389
+ (gaqlEntities.has(path) || path.startsWith('segments.')) &&
1390
+ !(path.endsWith('.id') && paths.includes(path.slice(0, -2) + 'name')))
1391
+ .map(path => gaqlEntities.has(path) && !path.endsWith('.id') ? dimensions[0].get(path) :
1392
+ gaqlDimensionLabel(path) + ' ' + dimensions[0].get(path));
1393
+ if (monetary && currencies.has('')) scope.push('Currency unavailable');
1394
+ return {
1395
+ title: gaqlEntities.has(primary) ? gaqlDimensionLabel(primary).replace(/ ID$/, '') + ' performance' : 'Google Ads query results',
1396
+ subject: [...new Set(scope)].join(' · '),
1397
+ html: (identities < records.length ?
1398
+ workflowNote('Some rows have identical labels. Include a more specific name, ID or segment to distinguish them.') : '') +
1399
+ workflowTable(headers, values, 'Google Ads query results')
1400
+ };
1401
+ }
1402
+ `;
1403
+
1292
1404
  // src/native-report-ui.ts
1293
1405
  var NATIVE_REPORT_TOOLS = [
1294
1406
  "ga4_report",
@@ -1312,6 +1424,7 @@ var NATIVE_REPORT_UI_STYLES = String.raw`
1312
1424
  `;
1313
1425
  var NATIVE_REPORT_UI_SCRIPT = String.raw`
1314
1426
  const nativeReportTools=new Set(${JSON.stringify(NATIVE_REPORT_TOOLS)});
1427
+ ${GAQL_REPORT_UI}
1315
1428
  function nativeReportDecimal(value,scale=0) {
1316
1429
  const text=typeof value==='number'&&Number.isFinite(value)?String(value):typeof value==='string'?value:'';
1317
1430
  if(!/^-?\d+(?:\.\d+)?$/.test(text))return null;
@@ -1324,7 +1437,7 @@ var NATIVE_REPORT_UI_SCRIPT = String.raw`
1324
1437
  const known={spend:'Spend',costMicros:'Spend',conversionsValue:'Conversion value',impressions:'Impressions',clicks:'Clicks',conversion:'Conversions',conversions:'Conversions',purchases:'Purchases',cpc:'CPC',cpm:'CPM',ctr:'CTR',roas:'ROAS',total_complete_payment_rate:'Purchase value',complete_payment_roas:'Purchase ROAS',lowImpressionShare:'Impression share · lower bound',highImpressionShare:'Impression share · upper bound',searchPopularity1to5:'Popularity · 1–5',searchPopularity1to100:'Popularity · 1–100',searchPopularityInGenre:'Genre popularity · 1–100',rankInGenre:'Genre rank',OverallSuccessRate:'Success rate · ratio',OverallSuccessCount:'Succeeded',SuccessCount:'Succeeded',FailureCount:'Failed',OverallUnattributedCount:'Unattributed'};
1325
1438
  return known[key]||known[key.toLowerCase()]||human(human(key).toLowerCase());
1326
1439
  }
1327
- function nativeReportRatio(key,provider) {return provider==='gsc'&&key==='ctr'||provider==='ga4'&&!key.includes(':')&&/Rate$/.test(key);}
1440
+ function nativeReportRatio(key,provider) {return (provider==='gsc'||provider==='google')&&key==='ctr'||provider==='ga4'&&!key.includes(':')&&/Rate$/.test(key);}
1328
1441
  function nativeReportMetric(key,value,provider,currency,moneyFields=[]) {
1329
1442
  if(key==='costInUsd')currency='USD';
1330
1443
  const lower=key.toLowerCase(),decimal=nativeReportDecimal(value);
@@ -1357,7 +1470,9 @@ var NATIVE_REPORT_UI_SCRIPT = String.raw`
1357
1470
  const names=provider==='microsoft'?['SearchQuery','Keyword','ConversionName','UploadDate']:provider==='apple'?['searchTerm','appName']:['ad_name','adgroup_name','adset_name','campaign_name','account_name','advertiser_name','name','entity_name'];
1358
1471
  const ids=['ad_id','adgroup_id','adset_id','campaign_id','advertiser_id','account_id','entity_id','id','GoalId','urn'];
1359
1472
  const first=(keys,sources)=>keys.flatMap(key=>sources.map(source=>source[key])).find(value=>(typeof value==='string'&&value.trim())||typeof value==='number');
1360
- const googleName=provider==='google'?[row.adGroupAd?.ad?.name,row.adGroup?.name,row.campaign?.name,row.customer?.descriptiveName,row.searchTermView?.searchTerm,row.adGroupCriterion?.keyword?.text].find(value=>typeof value==='string'&&value):null;
1473
+ const googleDimensions=provider==='google'?gaqlDimensions(row):null;
1474
+ const googleEntity=googleDimensions&&[...gaqlEntities.keys()].find(path=>googleDimensions.has(path));
1475
+ const googleName=googleDimensions?.get(googleEntity);
1361
1476
  const bucket=dimensions.conversionLagBucket??dimensions.conversionOrAdjustmentLagBucket;
1362
1477
  const analyticsName=['ga4','gsc'].includes(provider)?Object.values(dimensions).filter(value=>typeof value==='string'&&value).join(' · '):null;
1363
1478
  const name=bucket?reportBucket(bucket):googleName??analyticsName??first(names,[row,metrics,dimensions]) ?? first(ids,[row,dimensions]) ?? (provider==='google'?'Report':'Result '+(index+1));
@@ -1378,7 +1493,7 @@ var NATIVE_REPORT_UI_SCRIPT = String.raw`
1378
1493
  const priority=key=>/^(spend|impressions|clicks)$/i.test(key)?['spend','impressions','clicks'].indexOf(key.toLowerCase()):/^(conversion|conversions|purchases)$|^actions · purchase$/i.test(key)?3:4;
1379
1494
  fields.sort((a,b)=>priority(a[0])-priority(b[0]));
1380
1495
  const moneyFields=provider==='ga4'?arr(payload.metric_headers).filter(header=>header.type==='TYPE_CURRENCY').map(header=>header.name):[];
1381
- return {name,status,context,currency,moneyFields,provider,fields,native:row,date:reportDate(dimensions.stat_time_day??(provider==='ga4'&&/^\d{8}$/.test(dimensions.date||'')?dimensions.date.replace(/^(\d{4})(\d{2})(\d{2})$/,'$1-$2-$3'):dimensions.date)??(row.date_start===row.date_stop?row.date_start:null)??(row.date_range?.start===row.date_range?.end?row.date_range?.start:null)),series:googleName||(['ga4','gsc'].includes(provider)?Object.entries(dimensions).filter(([key])=>key!=='date').map(([,value])=>value).join(' · ')||'Website':name)};
1496
+ return {name,status,context,currency,moneyFields,provider,fields,gaqlDimensions:googleDimensions,gaqlEntity:googleEntity,native:row,date:reportDate(dimensions.stat_time_day??(provider==='ga4'&&/^\d{8}$/.test(dimensions.date||'')?dimensions.date.replace(/^(\d{4})(\d{2})(\d{2})$/,'$1-$2-$3'):dimensions.date)??(row.date_start===row.date_stop?row.date_start:null)??(row.date_range?.start===row.date_range?.end?row.date_range?.start:null)),series:googleName||(['ga4','gsc'].includes(provider)?Object.entries(dimensions).filter(([key])=>key!=='date').map(([,value])=>value).join(' · ')||'Website':name)};
1382
1497
  }
1383
1498
  function nativeChartRecord(record) {
1384
1499
  if(!record)return {name:'Unavailable row',context:[],fields:[]};
@@ -1387,7 +1502,9 @@ var NATIVE_REPORT_UI_SCRIPT = String.raw`
1387
1502
  const ratio=nativeReportRatio(key,record.provider);
1388
1503
  const value=record.provider==='spotify'&&String(raw)==='-5'?null:reportNumber(monetary?scaled:raw);
1389
1504
  const display=nativeReportMetric(key,raw,record.provider,record.currency,record.moneyFields);
1390
- return {key,label:key==='costInLocalCurrency'?'Spend':key==='costInUsd'?'Spend · USD':nativeReportLabel(key),value:ratio&&value!==null?value*100:value,display,unit:ratio?'%':monetary?key==='costInUsd'?'USD':record.currency||'Account units':''};
1505
+ const googleMoney=record.provider==='google'&&monetary;
1506
+ const shortDisplay=googleMoney&&scaled!==null?gaqlAmount(scaled,record.currency):undefined;
1507
+ return {key,label:key==='costInLocalCurrency'?'Spend':key==='costInUsd'?'Spend · USD':nativeReportLabel(key),value:ratio&&value!==null?value*100:value,display,shortDisplay,unit:ratio?'%':monetary?key==='costInUsd'?'USD':record.currency||(googleMoney?'Currency unavailable':'Account units'):''};
1391
1508
  });
1392
1509
  const low=record.native.lowImpressionShare,high=record.native.highImpressionShare;
1393
1510
  const range=record.provider==='apple'&&[low,high].every(value=>typeof value==='number'&&Number.isFinite(value)&&value>=0&&value<=1)&&low<=high?[low,high]:undefined;
@@ -1410,13 +1527,19 @@ var NATIVE_REPORT_UI_SCRIPT = String.raw`
1410
1527
  const errors=arr(data.errors).filter(error=>error?.error_code).map(error=>'<p class="notice">Goal '+esc(error.goal_id||'unavailable')+': '+esc(error.error_code)+'</p>').join('');
1411
1528
  const missingGoals=arr(data.not_returned_goal_ids).filter(id=>!arr(data.errors).some(error=>error?.goal_id===id&&error?.error_code));
1412
1529
  const absent=missingGoals.length?'<p class="notice">No summary returned for goal'+(missingGoals.length===1?'':'s')+' '+missingGoals.map(esc).join(', ')+'.</p>':'';
1413
- const records=entries.slice(0,1000).map((row,index)=>nativeReportRecord(row,index,meta,payload)),delay=provider==='google'&&entries.some(row=>row.segments?.conversionLagBucket||row.segments?.conversionOrAdjustmentLagBucket);
1530
+ const records=entries.slice(0,1000).map((row,index)=>nativeReportRecord(row,index,meta,payload)),delay=provider==='google'&&entries.some(row=>row?.segments?.conversionLagBucket||row?.segments?.conversionOrAdjustmentLagBucket);
1414
1531
  const pageArgs=['ga4_report','gsc_search_analytics'].includes(meta.tool)?readPageArgs(meta,'data-report-next'):null;
1415
- const chart=reportCharts(records.map(nativeChartRecord),delay?{dimension:'delay',mode:'bars',metric:records.some(record=>record?.fields.some(([key])=>key==='conversions'))?'conversions':undefined}:meta.tool==='apple_impression_share'?{metric:'Impression share',dimension:'search term'}:{});
1532
+ const points=records.map(nativeChartRecord);
1533
+ const table=provider==='google'&&!delay&&entries.length?gaqlReportTable(records,points):null;
1534
+ const entity=records[0]?.gaqlEntity;
1535
+ const dimension=entity&&records.every(row=>row?.gaqlEntity===entity)?gaqlEntities.get(entity).toLowerCase():undefined;
1536
+ const chart=table?null:reportCharts(points,delay?{dimension:'delay',mode:'bars',metric:records.some(record=>record?.fields.some(([key])=>key==='conversions'))?'conversions':undefined}:meta.tool==='apple_impression_share'?{metric:'Impression share',dimension:'search term'}:{dimension});
1416
1537
  const analytics=['ga4','gsc'].includes(provider),range=payload?.date_range;
1417
1538
  const period=analytics&&object(range)?[range.start_date??range.start,range.end_date??range.end].filter(workflowText).join(' – '):'';
1418
- app.innerHTML=chrome(operationHeader(delay?'Conversion delay':title,analytics?[meta.accountId,period].filter(Boolean).join(' · '):'',provider)+notices({...data,...(meta.tool==='linkedin_demographic_report'?{notes:[]}:{}),errors:arr(data.errors).filter(error=>!error?.error_code)})+errors+absent+'<section data-native-report data-read-page-focus tabindex="-1">'+(entries.length?chart.html:'<p class="operation-note">'+missing+'</p>')+(meta.tool==='linkedin_demographic_report'?'<p class="report-chart-foot">Approximate demographics · privacy thresholds apply</p>':'')+(entries.length>1000?'<p class="operation-note">Showing 1,000 returned rows. The full response is in Details.</p>':'')+readPageMarkup(pageArgs,'data-report-next','data-report-page-status')+'<details class="report-data"><summary>Details · '+entries.length+' results</summary>'+(entries.length?'<div class="record-list" role="region" aria-label="Native report data" tabindex="0">'+entries.slice(0,1000).map((row,index)=>nativeReportRow(row,index,meta,payload)).join('')+'</div>':'')+'<pre>'+esc(JSON.stringify(clean,null,2))+'</pre></details></section>','');
1419
- chart.mount();
1539
+ const subject=table?.subject||(analytics?[meta.accountId,period].filter(Boolean).join(' · '):'');
1540
+ const body=table?.html||(entries.length?chart.html:'<p class="operation-note">'+missing+'</p>');
1541
+ app.innerHTML=chrome(operationHeader(table?.title||(delay?'Conversion delay':title),subject,provider)+notices({...data,...(meta.tool==='linkedin_demographic_report'?{notes:[]}:{}),errors:arr(data.errors).filter(error=>!error?.error_code)})+errors+absent+'<section data-native-report data-read-page-focus tabindex="-1">'+body+(meta.tool==='linkedin_demographic_report'?'<p class="report-chart-foot">Approximate demographics · privacy thresholds apply</p>':'')+(entries.length>1000?'<p class="operation-note">Showing 1,000 returned rows. The full response is in Details.</p>':'')+readPageMarkup(pageArgs,'data-report-next','data-report-page-status')+'<details class="report-data"><summary>Details · '+entries.length+' results</summary>'+(!table&&entries.length?'<div class="record-list" role="region" aria-label="Native report data" tabindex="0">'+entries.slice(0,1000).map((row,index)=>nativeReportRow(row,index,meta,payload)).join('')+'</div>':'')+'<pre>'+esc(JSON.stringify(clean,null,2))+'</pre></details></section>',table?entries.length+(entries.length===1?' row':' rows'):'');
1542
+ chart?.mount();
1420
1543
  bindReadPage(meta,pageArgs,'data-report-next','data-report-page-status',value=>Array.isArray(recordPayload(value)?.rows));
1421
1544
  }
1422
1545
  `;
@@ -1999,7 +2122,7 @@ var REPORT_CHART_SCRIPT = String.raw`
1999
2122
  const label=pretty(point.name)+(point.context?.length?' · '+point.context.join(' · '):'');
2000
2123
  const range=point.range&&point.range.every(available)?point.range:null;
2001
2124
  const fill=range?'<span class="report-bar-fill report-bar-range" style="left:'+Math.max(0,range[0]*100)+'%;width:'+Math.max(0,(range[1]-range[0])*100)+'%"></span>':'<span class="report-bar-fill" style="left:'+left.toFixed(5)+'%;width:'+width.toFixed(5)+'%"></span>';
2002
- return '<li data-chart-value="'+(value===null?'':value)+'"><div class="report-bar-label"><span title="'+esc(label)+'">'+esc(label)+'</span><strong>'+esc(point.display)+'</strong></div><div class="report-bar-track" aria-hidden="true">'+fill+(min<0?'<span class="report-bar-zero" style="left:'+(-min/span*100).toFixed(5)+'%"></span>':'')+'</div></li>';
2125
+ return '<li data-chart-value="'+(value===null?'':value)+'"><div class="report-bar-label"><span title="'+esc(label)+'">'+esc(label)+'</span><strong>'+esc(point.shortDisplay??point.display)+'</strong></div><div class="report-bar-track" aria-hidden="true">'+fill+(min<0?'<span class="report-bar-zero" style="left:'+(-min/span*100).toFixed(5)+'%"></span>':'')+'</div></li>';
2003
2126
  }).join('')+'</ol>';
2004
2127
  return '<section class="report-chart" data-report-chart><div class="report-chart-head"><b>'+esc(title)+'</b>'+(unit?'<span>'+esc(unit)+'</span>':'')+'</div>'+body+(!trend&&model.returned>shown.length?'<p class="report-chart-foot">'+shown.length+' of '+model.returned+' returned rows · all rows in Details</p>':trend&&model.returned>points.length?'<p class="report-chart-foot">'+points.length+' of '+model.returned+' dated observations · all data in Details</p>':'')+'</section>';
2005
2128
  }).join('')+(groups.size>4?'<p class="report-chart-foot">Showing four units. All returned values are in Details.</p>':'');
@@ -2032,8 +2155,8 @@ var REPORT_CHART_SCRIPT = String.raw`
2032
2155
  `;
2033
2156
 
2034
2157
  // src/ui.ts
2035
- var ADPORT_UI_URI = "ui://adport/insight-card-v32.html";
2036
- var ADPORT_SUMMARY_UI_URI = "ui://adport/summary-card-v32.html";
2158
+ var ADPORT_UI_URI = "ui://adport/insight-card-v33.html";
2159
+ var ADPORT_SUMMARY_UI_URI = "ui://adport/summary-card-v33.html";
2037
2160
  var ADPORT_UI_DOMAIN = "https://app.adport.dev";
2038
2161
  var ADPORT_UI_RESOURCE_DOMAINS = [
2039
2162
  ADPORT_UI_DOMAIN,
@@ -2511,7 +2634,7 @@ ${PLANNING_UI}
2511
2634
 
2512
2635
  // src/index.ts
2513
2636
  var PROVIDER_IDS = ["ga4", "gsc", "gtm", "google", "meta", "tiktok", "apple", "microsoft", "reddit", "snapchat", "spotify", "pinterest", "linkedin", "x", "openai"];
2514
- var ADPORT_UI_RESOURCE_URIS = [ADPORT_UI_URI, "ui://adport/insight-card-v31.html", "ui://adport/insight-card-v30.html", "ui://adport/insight-card-v29.html", "ui://adport/insight-card-v28.html", "ui://adport/insight-card-v27.html", "ui://adport/insight-card-v26.html", "ui://adport/insight-card-v25.html", "ui://adport/insight-card-v24.html", "ui://adport/insight-card-v23.html", "ui://adport/insight-card-v22.html", "ui://adport/insight-card-v21.html", "ui://adport/insight-card-v20.html", "ui://adport/insight-card-v19.html", "ui://adport/insight-card-v18.html", "ui://adport/insight-card-v17.html", "ui://adport/insight-card-v16.html", "ui://adport/insight-card-v15.html", "ui://adport/insight-card-v14.html", "ui://adport/insight-card-v13.html", "ui://adport/insight-card-v12.html", "ui://adport/insight-card-v11.html", "ui://adport/insight-card-v10.html", "ui://adport/insight-card-v9.html", "ui://adport/insight-card-v8.html", "ui://adport/insight-card-v7.html", "ui://adport/insight-card-v6.html", "ui://adport/insight-card-v5.html", "ui://adport/insight-card-v4.html", "ui://adport/insight-card-v3.html", "ui://adport/insight-card-v2.html", ADPORT_SUMMARY_UI_URI, "ui://adport/summary-card-v30.html"];
2637
+ var ADPORT_UI_RESOURCE_URIS = [ADPORT_UI_URI, "ui://adport/insight-card-v32.html", "ui://adport/insight-card-v31.html", "ui://adport/insight-card-v30.html", "ui://adport/insight-card-v29.html", "ui://adport/insight-card-v28.html", "ui://adport/insight-card-v27.html", "ui://adport/insight-card-v26.html", "ui://adport/insight-card-v25.html", "ui://adport/insight-card-v24.html", "ui://adport/insight-card-v23.html", "ui://adport/insight-card-v22.html", "ui://adport/insight-card-v21.html", "ui://adport/insight-card-v20.html", "ui://adport/insight-card-v19.html", "ui://adport/insight-card-v18.html", "ui://adport/insight-card-v17.html", "ui://adport/insight-card-v16.html", "ui://adport/insight-card-v15.html", "ui://adport/insight-card-v14.html", "ui://adport/insight-card-v13.html", "ui://adport/insight-card-v12.html", "ui://adport/insight-card-v11.html", "ui://adport/insight-card-v10.html", "ui://adport/insight-card-v9.html", "ui://adport/insight-card-v8.html", "ui://adport/insight-card-v7.html", "ui://adport/insight-card-v6.html", "ui://adport/insight-card-v5.html", "ui://adport/insight-card-v4.html", "ui://adport/insight-card-v3.html", "ui://adport/insight-card-v2.html", ADPORT_SUMMARY_UI_URI, "ui://adport/summary-card-v32.html", "ui://adport/summary-card-v30.html"];
2515
2638
  var DEFAULT_MCP_ICONS = [{
2516
2639
  src: "https://app.adport.dev/icon.svg?brand=orange-dot-v2",
2517
2640
  mimeType: "image/svg+xml",
@@ -2538,7 +2661,7 @@ function createMcpUiServer({ name = "adport", version = package_default.version,
2538
2661
  function registerUiResources(server, uiDomain, uiResourceDomains, uiConnectDomains) {
2539
2662
  const summaryDomains = uiResourceDomains.filter((domain) => domain === ADPORT_UI_DOMAIN || uiConnectDomains.includes(domain));
2540
2663
  for (const uri of ADPORT_UI_RESOURCE_URIS) {
2541
- const summary = uri === ADPORT_SUMMARY_UI_URI || uri === "ui://adport/summary-card-v30.html";
2664
+ const summary = uri.startsWith("ui://adport/summary-card-");
2542
2665
  const resourceMeta = {
2543
2666
  ui: {
2544
2667
  ...uiDomain ? { domain: uiDomain } : {},
@@ -2730,4 +2853,4 @@ export {
2730
2853
  createMcpServer,
2731
2854
  runStdioServer
2732
2855
  };
2733
- //# sourceMappingURL=chunk-FKKOEMUR.js.map
2856
+ //# sourceMappingURL=chunk-RE4ZCAVJ.js.map