@fload-ai/mcp 0.8.0 → 0.10.0
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/README.md +1 -1
- package/dist/.tsbuildinfo +1 -1
- package/dist/bin.js +142 -76
- package/dist/bin.js.map +4 -4
- package/dist/index.js +146 -80
- package/dist/index.js.map +4 -4
- package/dist/tools/actions.d.ts.map +1 -1
- package/dist/tools/analytics.d.ts.map +1 -1
- package/dist/tools/download-impact.d.ts +27 -0
- package/dist/tools/download-impact.d.ts.map +1 -0
- package/dist/tools/index.d.ts +1 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +144 -76
- package/dist/tools/index.js.map +4 -4
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../src/tools/actions.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../src/tools/actions.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AA2CvD,eAAO,MAAM,wBAAwB;;;;;;;iBAenC,CAAC;AAEH,eAAO,MAAM,mBAAmB;;iBAI9B,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;iBAa7B,CAAC;AAGH,eAAO,MAAM,oBAAoB;;iBAM/B,CAAC;AAGH,eAAO,MAAM,4BAA4B;;;iBAcvC,CAAC;AAiCH,wBAAsB,kBAAkB,CACtC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,EAC/C,MAAM,EAAE,cAAc;;;;;;GAgBvB;AAoED,wBAAsB,aAAa,CACjC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,EAC1C,MAAM,EAAE,cAAc;;;;;;GA6BvB;AAGD,wBAAsB,YAAY,CAChC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,EACzC,MAAM,EAAE,cAAc;;;;;;GA8BvB;AAOD,wBAAsB,cAAc,CAClC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,EAC3C,MAAM,EAAE,cAAc;;;;;;GAqCvB;AAyED,wBAAsB,sBAAsB,CAC1C,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,EACnD,MAAM,EAAE,cAAc;;;;;;GAwDvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analytics.d.ts","sourceRoot":"","sources":["../../src/tools/analytics.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"analytics.d.ts","sourceRoot":"","sources":["../../src/tools/analytics.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAuGvD,eAAO,MAAM,qBAAqB;;iBAKhC,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;iBAgC3B,CAAC;AAEH,eAAO,MAAM,wBAAwB;;;iBAQnC,CAAC;AAmIH,wBAAsB,eAAe,CACnC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,EAC5C,MAAM,EAAE,cAAc;;;;;;;;;;;;GA8CvB;AAED,wBAAsB,UAAU,CAC9B,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,EACvC,MAAM,EAAE,cAAc;;;;;;;;;;;;GAyFvB;AAED,wBAAsB,kBAAkB,CACtC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,EAC/C,MAAM,EAAE,cAAc;;;;;;;;;;;;GAuDvB"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { FloadApiClient } from '../api-client.js';
|
|
3
|
+
export declare const getDownloadImpactSchema: z.ZodObject<{
|
|
4
|
+
assetId: z.ZodString;
|
|
5
|
+
from: z.ZodOptional<z.ZodString>;
|
|
6
|
+
to: z.ZodOptional<z.ZodString>;
|
|
7
|
+
beforeFrom: z.ZodOptional<z.ZodString>;
|
|
8
|
+
beforeTo: z.ZodOptional<z.ZodString>;
|
|
9
|
+
afterFrom: z.ZodOptional<z.ZodString>;
|
|
10
|
+
afterTo: z.ZodOptional<z.ZodString>;
|
|
11
|
+
country: z.ZodOptional<z.ZodString>;
|
|
12
|
+
includeDays: z.ZodOptional<z.ZodBoolean>;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
export declare function getDownloadImpact(input: z.input<typeof getDownloadImpactSchema>, client: FloadApiClient): Promise<{
|
|
15
|
+
content: {
|
|
16
|
+
type: "text";
|
|
17
|
+
text: string;
|
|
18
|
+
}[];
|
|
19
|
+
isError?: undefined;
|
|
20
|
+
} | {
|
|
21
|
+
content: {
|
|
22
|
+
type: "text";
|
|
23
|
+
text: string;
|
|
24
|
+
}[];
|
|
25
|
+
isError: boolean;
|
|
26
|
+
}>;
|
|
27
|
+
//# sourceMappingURL=download-impact.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"download-impact.d.ts","sourceRoot":"","sources":["../../src/tools/download-impact.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAQvD,eAAO,MAAM,uBAAuB;;;;;;;;;;iBA2BlC,CAAC;AAQH,wBAAsB,iBAAiB,CACrC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,EAC9C,MAAM,EAAE,cAAc;;;;;;;;;;;;GAyBvB"}
|
package/dist/tools/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { RateLimiter } from '../rate-limiter.js';
|
|
|
4
4
|
export * from './apps.js';
|
|
5
5
|
export * from './reviews.js';
|
|
6
6
|
export * from './analytics.js';
|
|
7
|
+
export * from './download-impact.js';
|
|
7
8
|
export * from './agents.js';
|
|
8
9
|
export * from './ads.js';
|
|
9
10
|
export * from './dashboard.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EACV,SAAS,EAEV,MAAM,yCAAyC,CAAC;AAGjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EACV,SAAS,EAEV,MAAM,yCAAyC,CAAC;AAGjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAwF1B,MAAM,WAAW,oBAAoB;IAMnC,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B;AAoBD,wBAAgB,aAAa,CAC3B,MAAM,EAAE,SAAS,EACjB,MAAM,EAAE,cAAc,EACtB,OAAO,GAAE,oBAAyB,GACjC,IAAI,CA4VN"}
|
package/dist/tools/index.js
CHANGED
|
@@ -423,7 +423,7 @@ var getMetricsSchema = z3.object({
|
|
|
423
423
|
endDate: z3.string().optional().describe("End date (YYYY-MM-DD). Defaults to today."),
|
|
424
424
|
granularity: z3.enum(["daily", "weekly", "monthly"]).default("daily").describe("Data granularity"),
|
|
425
425
|
dimension: z3.string().optional().describe(
|
|
426
|
-
'Optional dimension to break down by (e.g., "storefront" for country, "platform" for device). Use discover_dimensions to see options.'
|
|
426
|
+
'Optional dimension to break down by (e.g., "storefront" for country, "platform" for device). Use discover_dimensions to see options. Each metric then carries `breakdown`: the period value, share and change of every value, aggregated for the metric type (read its `basis`: "latest" is the last day, never a sum; "daily_average" is an average a day, never a period total). Answer per-country questions from `breakdown`, never by adding up `timeseries`, which keeps only the top values each day.'
|
|
427
427
|
),
|
|
428
428
|
dimensionFilter: z3.string().optional().describe(
|
|
429
429
|
'Filter to a specific dimension value (e.g., "US" when dimension is "storefront")'
|
|
@@ -637,7 +637,10 @@ async function getMetrics(input, client) {
|
|
|
637
637
|
displayName: info[name]?.displayName || name,
|
|
638
638
|
type: info[name]?.type || "count",
|
|
639
639
|
summary: summaries[name],
|
|
640
|
-
change: changes[name] || null
|
|
640
|
+
change: changes[name] || null,
|
|
641
|
+
...input.dimension && {
|
|
642
|
+
breakdown: summaryResponse.breakdownTotals?.[name] ?? null
|
|
643
|
+
}
|
|
641
644
|
})),
|
|
642
645
|
timeseries: data,
|
|
643
646
|
meta
|
|
@@ -701,8 +704,58 @@ async function discoverDimensions(input, client) {
|
|
|
701
704
|
}
|
|
702
705
|
}
|
|
703
706
|
|
|
704
|
-
// src/tools/
|
|
707
|
+
// src/tools/download-impact.ts
|
|
705
708
|
import { z as z4 } from "zod";
|
|
709
|
+
var Day = z4.string().regex(/^\d{4}-\d{2}-\d{2}$/).optional();
|
|
710
|
+
var getDownloadImpactSchema = z4.object({
|
|
711
|
+
assetId: z4.string().uuid().describe("App UUID (App Store apps)"),
|
|
712
|
+
from: Day.describe(
|
|
713
|
+
"First day drawn (YYYY-MM-DD); default 20 weeks before `to`"
|
|
714
|
+
),
|
|
715
|
+
to: Day.describe(
|
|
716
|
+
"Last day drawn (YYYY-MM-DD); default the newest day with data"
|
|
717
|
+
),
|
|
718
|
+
beforeFrom: Day.describe(
|
|
719
|
+
'Start of the "before" window compared (needs beforeTo; all windows within 400 days of each other)'
|
|
720
|
+
),
|
|
721
|
+
beforeTo: Day.describe('End of the "before" window compared'),
|
|
722
|
+
afterFrom: Day.describe(
|
|
723
|
+
'Start of the "after" window compared (needs afterTo)'
|
|
724
|
+
),
|
|
725
|
+
afterTo: Day.describe('End of the "after" window compared'),
|
|
726
|
+
country: z4.string().regex(/^[a-zA-Z]{2}$/).optional().describe(
|
|
727
|
+
'One storefront, two-letter code (e.g. "us"): narrows countries and keywords'
|
|
728
|
+
),
|
|
729
|
+
includeDays: z4.boolean().optional().describe("Also return every day (long). Weeks carry the same downloads.")
|
|
730
|
+
});
|
|
731
|
+
async function getDownloadImpact(input, client) {
|
|
732
|
+
try {
|
|
733
|
+
const { assetId, includeDays, ...query } = input;
|
|
734
|
+
const impact = await client.get(
|
|
735
|
+
`/api/assets/${assetId}/metrics/download-impact`,
|
|
736
|
+
query
|
|
737
|
+
);
|
|
738
|
+
const { days, lastYearDays, ...rest } = impact;
|
|
739
|
+
return {
|
|
740
|
+
content: [
|
|
741
|
+
{
|
|
742
|
+
type: "text",
|
|
743
|
+
text: formatAsJson(
|
|
744
|
+
includeDays ? { ...rest, days, lastYearDays } : rest
|
|
745
|
+
)
|
|
746
|
+
}
|
|
747
|
+
]
|
|
748
|
+
};
|
|
749
|
+
} catch (error) {
|
|
750
|
+
return {
|
|
751
|
+
content: [{ type: "text", text: formatError(error) }],
|
|
752
|
+
isError: true
|
|
753
|
+
};
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
// src/tools/agents.ts
|
|
758
|
+
import { z as z5 } from "zod";
|
|
706
759
|
function asRecord(value) {
|
|
707
760
|
return value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
708
761
|
}
|
|
@@ -711,28 +764,28 @@ var AGENT_DESCRIPTIONS = {
|
|
|
711
764
|
review: "AI-powered review management \u2014 drafts and sends replies to app store reviews",
|
|
712
765
|
aso: "App Store Optimization \u2014 listing optimization suggestions for better visibility"
|
|
713
766
|
};
|
|
714
|
-
var listAgentsSchema =
|
|
715
|
-
var getAgentDetailsSchema =
|
|
716
|
-
agentType:
|
|
717
|
-
assetId:
|
|
767
|
+
var listAgentsSchema = z5.object({});
|
|
768
|
+
var getAgentDetailsSchema = z5.object({
|
|
769
|
+
agentType: z5.enum(AGENT_TYPES).describe("The type of agent to get details for"),
|
|
770
|
+
assetId: z5.string().uuid().optional().describe("App UUID to get agent config for (when agent is per-asset)")
|
|
718
771
|
});
|
|
719
|
-
var getAgentRunHistorySchema =
|
|
720
|
-
agentType:
|
|
721
|
-
assetId:
|
|
722
|
-
limit:
|
|
772
|
+
var getAgentRunHistorySchema = z5.object({
|
|
773
|
+
agentType: z5.enum(AGENT_TYPES).describe("The type of agent to get run history for"),
|
|
774
|
+
assetId: z5.string().uuid().optional().describe("App UUID to filter runs"),
|
|
775
|
+
limit: z5.number().int().min(1).max(100).default(20).describe("Maximum number of runs to return")
|
|
723
776
|
});
|
|
724
|
-
var triggerAgentRunSchema =
|
|
725
|
-
agentId:
|
|
726
|
-
assetId:
|
|
777
|
+
var triggerAgentRunSchema = z5.object({
|
|
778
|
+
agentId: z5.string().describe("The agent ID to trigger a run for (the `id` from list_agents)"),
|
|
779
|
+
assetId: z5.string().uuid().optional().describe("Optional app UUID to run the agent against")
|
|
727
780
|
});
|
|
728
|
-
var pauseAgentSchema =
|
|
729
|
-
agentId:
|
|
781
|
+
var pauseAgentSchema = z5.object({
|
|
782
|
+
agentId: z5.string().describe("The agent ID to pause (the `id` from list_agents)")
|
|
730
783
|
});
|
|
731
|
-
var resumeAgentSchema =
|
|
732
|
-
agentId:
|
|
784
|
+
var resumeAgentSchema = z5.object({
|
|
785
|
+
agentId: z5.string().describe("The agent ID to resume (the `id` from list_agents)")
|
|
733
786
|
});
|
|
734
|
-
var getAgentActivitySchema =
|
|
735
|
-
agentId:
|
|
787
|
+
var getAgentActivitySchema = z5.object({
|
|
788
|
+
agentId: z5.string().describe("The agent ID to get activity for (the `id` from list_agents)")
|
|
736
789
|
});
|
|
737
790
|
async function listAgents(_input, client) {
|
|
738
791
|
try {
|
|
@@ -990,13 +1043,13 @@ async function getAgentActivity(input, client) {
|
|
|
990
1043
|
}
|
|
991
1044
|
|
|
992
1045
|
// src/tools/ads.ts
|
|
993
|
-
import { z as
|
|
994
|
-
var getAdsPerformanceSchema =
|
|
995
|
-
assetId:
|
|
996
|
-
platform:
|
|
997
|
-
fromDate:
|
|
998
|
-
toDate:
|
|
999
|
-
limit:
|
|
1046
|
+
import { z as z6 } from "zod";
|
|
1047
|
+
var getAdsPerformanceSchema = z6.object({
|
|
1048
|
+
assetId: z6.string().uuid().optional().describe("Filter by app UUID"),
|
|
1049
|
+
platform: z6.enum(["apple_search_ads", "google_ads", "meta_ads", "tiktok_ads"]).optional().describe("Filter by ad platform"),
|
|
1050
|
+
fromDate: z6.string().optional().describe("Start date for performance data (YYYY-MM-DD)"),
|
|
1051
|
+
toDate: z6.string().optional().describe("End date for performance data (YYYY-MM-DD)"),
|
|
1052
|
+
limit: z6.number().int().min(1).max(100).default(50).describe("Maximum number of campaigns to return")
|
|
1000
1053
|
});
|
|
1001
1054
|
async function getAdsPerformance(input, client) {
|
|
1002
1055
|
try {
|
|
@@ -1062,7 +1115,7 @@ async function getAdsPerformance(input, client) {
|
|
|
1062
1115
|
}
|
|
1063
1116
|
|
|
1064
1117
|
// src/tools/dashboard.ts
|
|
1065
|
-
import { z as
|
|
1118
|
+
import { z as z7 } from "zod";
|
|
1066
1119
|
function parseDashboardNumber(value) {
|
|
1067
1120
|
if (value === null || value === void 0 || value === "") return null;
|
|
1068
1121
|
const parsed = typeof value === "number" ? value : Number.parseFloat(value);
|
|
@@ -1073,7 +1126,7 @@ function getSidebarAssets(response) {
|
|
|
1073
1126
|
if (Array.isArray(response)) return response;
|
|
1074
1127
|
return response.data ?? [];
|
|
1075
1128
|
}
|
|
1076
|
-
var getDashboardOverviewSchema =
|
|
1129
|
+
var getDashboardOverviewSchema = z7.object({});
|
|
1077
1130
|
async function getDashboardOverview(_input, client) {
|
|
1078
1131
|
try {
|
|
1079
1132
|
const overviewPromise = client.get("/api/dashboard/overview-metrics").catch(() => null);
|
|
@@ -1129,7 +1182,7 @@ async function getDashboardOverview(_input, client) {
|
|
|
1129
1182
|
|
|
1130
1183
|
// src/tools/actions.ts
|
|
1131
1184
|
import { randomUUID } from "node:crypto";
|
|
1132
|
-
import { z as
|
|
1185
|
+
import { z as z8 } from "zod";
|
|
1133
1186
|
|
|
1134
1187
|
// src/public-errors.ts
|
|
1135
1188
|
var INTERNAL_ERROR_PATTERNS = [
|
|
@@ -1155,32 +1208,32 @@ function publicMcpErrorMessage(message, fallbackMessage = "Fload could not compl
|
|
|
1155
1208
|
}
|
|
1156
1209
|
|
|
1157
1210
|
// src/tools/actions.ts
|
|
1158
|
-
var listPendingActionsSchema =
|
|
1159
|
-
assetId:
|
|
1160
|
-
view:
|
|
1211
|
+
var listPendingActionsSchema = z8.object({
|
|
1212
|
+
assetId: z8.string().uuid().optional().describe("Filter by app UUID"),
|
|
1213
|
+
view: z8.enum(["open", "queued"]).default("open").describe(
|
|
1161
1214
|
"open (default): items waiting on the user. queued: approved work Fload is sending or checking in the store (an item being checked offers check_now)."
|
|
1162
1215
|
),
|
|
1163
|
-
limit:
|
|
1216
|
+
limit: z8.number().int().min(1).max(100).default(50).describe("Maximum number of actions to return")
|
|
1164
1217
|
});
|
|
1165
|
-
var approveActionSchema =
|
|
1166
|
-
actionId:
|
|
1218
|
+
var approveActionSchema = z8.object({
|
|
1219
|
+
actionId: z8.string().describe("The inbox item ID to approve (from list_pending_actions)")
|
|
1167
1220
|
});
|
|
1168
|
-
var rejectActionSchema =
|
|
1169
|
-
actionId:
|
|
1170
|
-
reason:
|
|
1221
|
+
var rejectActionSchema = z8.object({
|
|
1222
|
+
actionId: z8.string().describe("The inbox item ID to reject (from list_pending_actions)"),
|
|
1223
|
+
reason: z8.string().trim().min(1).max(1e3).optional().describe(
|
|
1171
1224
|
"Why, in the user's words. Kept with the rejection so the agents do not propose the same thing again."
|
|
1172
1225
|
)
|
|
1173
1226
|
});
|
|
1174
|
-
var checkActionNowSchema =
|
|
1175
|
-
actionId:
|
|
1227
|
+
var checkActionNowSchema = z8.object({
|
|
1228
|
+
actionId: z8.string().describe(
|
|
1176
1229
|
'The inbox item ID to check now (from list_pending_actions with view "queued", or an approve_action result; its commands include check_now)'
|
|
1177
1230
|
)
|
|
1178
1231
|
});
|
|
1179
|
-
var renameCustomPageActionSchema =
|
|
1180
|
-
actionId:
|
|
1232
|
+
var renameCustomPageActionSchema = z8.object({
|
|
1233
|
+
actionId: z8.string().describe(
|
|
1181
1234
|
'The inbox item ID of the "Create custom product page" request (from list_pending_actions; it failed because App Store Connect already has a page of that name, or it waits for approval)'
|
|
1182
1235
|
),
|
|
1183
|
-
name:
|
|
1236
|
+
name: z8.string().trim().min(1).max(100).describe(
|
|
1184
1237
|
"The new page name: at most 100 characters (UTF-16 units), not its current name, not a page the app already has"
|
|
1185
1238
|
)
|
|
1186
1239
|
});
|
|
@@ -1254,6 +1307,11 @@ async function commandItem(client, itemId, intent, reason) {
|
|
|
1254
1307
|
}
|
|
1255
1308
|
};
|
|
1256
1309
|
}
|
|
1310
|
+
function refusedMessage(result) {
|
|
1311
|
+
const said = result?.error ?? "The approval could not be recorded.";
|
|
1312
|
+
const check = result?.policyRefusal?.check;
|
|
1313
|
+
return check ? `Stopped by the ${check}: ${said}` : said;
|
|
1314
|
+
}
|
|
1257
1315
|
async function approveAction(input, client) {
|
|
1258
1316
|
try {
|
|
1259
1317
|
const { command, result } = await commandItem(
|
|
@@ -1269,7 +1327,7 @@ async function approveAction(input, client) {
|
|
|
1269
1327
|
command,
|
|
1270
1328
|
result: result?.result ?? "unknown",
|
|
1271
1329
|
...result?.error ? { error: result.error } : {},
|
|
1272
|
-
message: applied2 ? command === "acknowledge" ? "Acknowledged." : "Approved. Fload delivers it after a short undo window; the inbox shows where it is." : result
|
|
1330
|
+
message: applied2 ? command === "acknowledge" ? "Acknowledged." : "Approved. Fload delivers it after a short undo window; the inbox shows where it is." : refusedMessage(result),
|
|
1273
1331
|
item: result?.item
|
|
1274
1332
|
},
|
|
1275
1333
|
!applied2
|
|
@@ -1419,22 +1477,22 @@ async function renameCustomPageAction(input, client) {
|
|
|
1419
1477
|
}
|
|
1420
1478
|
|
|
1421
1479
|
// src/tools/aso.ts
|
|
1422
|
-
import { z as
|
|
1423
|
-
var getAsoSummarySchema =
|
|
1424
|
-
assetId:
|
|
1480
|
+
import { z as z9 } from "zod";
|
|
1481
|
+
var getAsoSummarySchema = z9.object({
|
|
1482
|
+
assetId: z9.string().uuid().describe("App UUID to get ASO summary for")
|
|
1425
1483
|
});
|
|
1426
|
-
var getAsoRecommendationsSchema =
|
|
1427
|
-
assetId:
|
|
1484
|
+
var getAsoRecommendationsSchema = z9.object({
|
|
1485
|
+
assetId: z9.string().uuid().describe("App UUID to get ASO recommendations for")
|
|
1428
1486
|
});
|
|
1429
|
-
var getAsoKeywordsSchema =
|
|
1430
|
-
assetId:
|
|
1431
|
-
locale:
|
|
1487
|
+
var getAsoKeywordsSchema = z9.object({
|
|
1488
|
+
assetId: z9.string().uuid().describe("App UUID to get keyword intelligence for"),
|
|
1489
|
+
locale: z9.string().optional().describe(
|
|
1432
1490
|
'Locale code to filter keywords (e.g., "en-US", "de-DE"). Returns all locales if omitted.'
|
|
1433
1491
|
)
|
|
1434
1492
|
});
|
|
1435
|
-
var getAsoExperimentsSchema =
|
|
1436
|
-
assetId:
|
|
1437
|
-
status:
|
|
1493
|
+
var getAsoExperimentsSchema = z9.object({
|
|
1494
|
+
assetId: z9.string().uuid().describe("App UUID to list ASO experiments for"),
|
|
1495
|
+
status: z9.enum([
|
|
1438
1496
|
"proposed",
|
|
1439
1497
|
"approved",
|
|
1440
1498
|
"applied",
|
|
@@ -1442,22 +1500,22 @@ var getAsoExperimentsSchema = z8.object({
|
|
|
1442
1500
|
"completed",
|
|
1443
1501
|
"reverted"
|
|
1444
1502
|
]).optional().describe("Filter experiments by status"),
|
|
1445
|
-
limit:
|
|
1446
|
-
cursor:
|
|
1503
|
+
limit: z9.number().int().min(1).max(100).default(20).describe("Maximum number of experiments to return"),
|
|
1504
|
+
cursor: z9.string().optional().describe("Pagination cursor from a previous response (meta.nextCursor)")
|
|
1447
1505
|
});
|
|
1448
|
-
var getAsoLocaleSnapshotsSchema =
|
|
1449
|
-
assetId:
|
|
1450
|
-
store:
|
|
1451
|
-
locale:
|
|
1506
|
+
var getAsoLocaleSnapshotsSchema = z9.object({
|
|
1507
|
+
assetId: z9.string().uuid().describe("App UUID to get locale snapshots for"),
|
|
1508
|
+
store: z9.enum(["ios", "android"]).default("ios").describe("Which store listing to read"),
|
|
1509
|
+
locale: z9.string().optional().describe(
|
|
1452
1510
|
'Filter to a single locale (e.g. "en-US"). Returns all locales if omitted.'
|
|
1453
1511
|
),
|
|
1454
|
-
view:
|
|
1512
|
+
view: z9.enum(["latest", "history"]).default("latest").describe(
|
|
1455
1513
|
'"latest" (default) = newest snapshot per (locale, type); "history" = raw revisions newest first'
|
|
1456
1514
|
),
|
|
1457
|
-
limit:
|
|
1515
|
+
limit: z9.number().int().min(1).max(500).optional().describe("Maximum snapshot rows to return (newest first)")
|
|
1458
1516
|
});
|
|
1459
|
-
var triggerAsoAnalysisSchema =
|
|
1460
|
-
assetId:
|
|
1517
|
+
var triggerAsoAnalysisSchema = z9.object({
|
|
1518
|
+
assetId: z9.string().uuid().describe("App UUID to trigger ASO analysis for")
|
|
1461
1519
|
});
|
|
1462
1520
|
async function getAsoSummary(input, client) {
|
|
1463
1521
|
try {
|
|
@@ -1625,7 +1683,7 @@ async function triggerAsoAnalysis(input, client) {
|
|
|
1625
1683
|
};
|
|
1626
1684
|
}
|
|
1627
1685
|
}
|
|
1628
|
-
var getAsoEvidenceSchema =
|
|
1686
|
+
var getAsoEvidenceSchema = z9.object({ assetId: z9.string().uuid() });
|
|
1629
1687
|
async function getAsoEvidence(input, client) {
|
|
1630
1688
|
try {
|
|
1631
1689
|
const response = await client.get(
|
|
@@ -1644,19 +1702,19 @@ async function getAsoEvidence(input, client) {
|
|
|
1644
1702
|
|
|
1645
1703
|
// src/tools/chat.ts
|
|
1646
1704
|
import { randomUUID as randomUUID2 } from "node:crypto";
|
|
1647
|
-
import { z as
|
|
1648
|
-
var listConversationsSchema =
|
|
1649
|
-
limit:
|
|
1705
|
+
import { z as z10 } from "zod";
|
|
1706
|
+
var listConversationsSchema = z10.object({
|
|
1707
|
+
limit: z10.number().int().min(1).max(100).default(20).describe("Maximum number of conversations to return")
|
|
1650
1708
|
});
|
|
1651
|
-
var getConversationMessagesSchema =
|
|
1652
|
-
conversationId:
|
|
1709
|
+
var getConversationMessagesSchema = z10.object({
|
|
1710
|
+
conversationId: z10.string().uuid().describe("The conversation UUID to get messages for")
|
|
1653
1711
|
});
|
|
1654
|
-
var sendChatMessageSchema =
|
|
1655
|
-
message:
|
|
1656
|
-
conversationId:
|
|
1712
|
+
var sendChatMessageSchema = z10.object({
|
|
1713
|
+
message: z10.string().describe("The message to send to the AI chat"),
|
|
1714
|
+
conversationId: z10.string().uuid().optional().describe(
|
|
1657
1715
|
"Existing conversation UUID to continue. Starts a new conversation if omitted."
|
|
1658
1716
|
),
|
|
1659
|
-
agentType:
|
|
1717
|
+
agentType: z10.string().optional().describe(
|
|
1660
1718
|
"Agent type to use for the conversation (e.g., review, monitoring)"
|
|
1661
1719
|
)
|
|
1662
1720
|
});
|
|
@@ -1912,6 +1970,14 @@ function registerTools(server, client, options = {}) {
|
|
|
1912
1970
|
discoverDimensions,
|
|
1913
1971
|
{ readOnlyHint: true, openWorldHint: false }
|
|
1914
1972
|
);
|
|
1973
|
+
tool(
|
|
1974
|
+
"get_download_impact",
|
|
1975
|
+
"Get what Fload changed on downloads",
|
|
1976
|
+
"Did Fload's listing changes move downloads, overall or in one country? For an App Store app: downloads by source a week (organicSearch = App Store search minus Apple Ads, appleAds, browse, appReferrer, webReferrer, other, total) with the same days last year (364 days back) and an index of each year to its own first four weeks; markers for releases, each Fload listing change on the day written and the day live (with the storefronts that read its locales) and the iOS launch week; the 21 days before Fload's first change against the latest 21 days; storefronts by role (changed: a changed localization is its own language; reads_changed: it also reads one, e.g. the US reads es-MX; control: reads nothing changed) with organic downloads a day before and after, this year and last; and each touched keyword's median rank before and after. Listing changes can only move organic App Store search: judge them on organicSearch against last year, never on total, paid or browse. Null means unknown, never 0.",
|
|
1977
|
+
getDownloadImpactSchema,
|
|
1978
|
+
getDownloadImpact,
|
|
1979
|
+
{ readOnlyHint: true, openWorldHint: false }
|
|
1980
|
+
);
|
|
1915
1981
|
tool(
|
|
1916
1982
|
"list_agents",
|
|
1917
1983
|
"List agents",
|
|
@@ -2152,6 +2218,8 @@ export {
|
|
|
2152
2218
|
getConversationMessagesSchema,
|
|
2153
2219
|
getDashboardOverview,
|
|
2154
2220
|
getDashboardOverviewSchema,
|
|
2221
|
+
getDownloadImpact,
|
|
2222
|
+
getDownloadImpactSchema,
|
|
2155
2223
|
getMetrics,
|
|
2156
2224
|
getMetricsSchema,
|
|
2157
2225
|
getReviews,
|