@pofky/asc-mcp 1.2.0 → 1.8.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/LIMITATIONS.md +41 -0
- package/README.md +91 -10
- package/USER_GUIDE.md +185 -0
- package/dist/client.d.ts +5 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +58 -1
- package/dist/client.js.map +1 -1
- package/dist/doctor.d.ts +28 -0
- package/dist/doctor.d.ts.map +1 -0
- package/dist/doctor.js +178 -0
- package/dist/doctor.js.map +1 -0
- package/dist/editable.d.ts +9 -0
- package/dist/editable.d.ts.map +1 -0
- package/dist/editable.js +20 -0
- package/dist/editable.js.map +1 -0
- package/dist/elicitation.d.ts +39 -0
- package/dist/elicitation.d.ts.map +1 -0
- package/dist/elicitation.js +63 -0
- package/dist/elicitation.js.map +1 -0
- package/dist/gate.d.ts +8 -0
- package/dist/gate.d.ts.map +1 -0
- package/dist/gate.js +17 -0
- package/dist/gate.js.map +1 -0
- package/dist/index.js +308 -16
- package/dist/index.js.map +1 -1
- package/dist/license.js +1 -1
- package/dist/prompts.d.ts.map +1 -1
- package/dist/prompts.js +101 -0
- package/dist/prompts.js.map +1 -1
- package/dist/sampling.d.ts +53 -0
- package/dist/sampling.d.ts.map +1 -0
- package/dist/sampling.js +109 -0
- package/dist/sampling.js.map +1 -0
- package/dist/setup.d.ts +19 -0
- package/dist/setup.d.ts.map +1 -0
- package/dist/setup.js +153 -0
- package/dist/setup.js.map +1 -0
- package/dist/tools/age-rating.d.ts +14 -0
- package/dist/tools/age-rating.d.ts.map +1 -0
- package/dist/tools/age-rating.js +125 -0
- package/dist/tools/age-rating.js.map +1 -0
- package/dist/tools/app-details.js +2 -2
- package/dist/tools/availability.d.ts +20 -0
- package/dist/tools/availability.d.ts.map +1 -0
- package/dist/tools/availability.js +96 -0
- package/dist/tools/availability.js.map +1 -0
- package/dist/tools/builds.d.ts +26 -0
- package/dist/tools/builds.d.ts.map +1 -0
- package/dist/tools/builds.js +108 -0
- package/dist/tools/builds.js.map +1 -0
- package/dist/tools/draft-review-response.d.ts +37 -0
- package/dist/tools/draft-review-response.d.ts.map +1 -0
- package/dist/tools/draft-review-response.js +236 -0
- package/dist/tools/draft-review-response.js.map +1 -0
- package/dist/tools/eu-trader.d.ts +12 -0
- package/dist/tools/eu-trader.d.ts.map +1 -0
- package/dist/tools/eu-trader.js +25 -0
- package/dist/tools/eu-trader.js.map +1 -0
- package/dist/tools/guide.d.ts +38 -0
- package/dist/tools/guide.d.ts.map +1 -0
- package/dist/tools/guide.js +273 -0
- package/dist/tools/guide.js.map +1 -0
- package/dist/tools/iap.d.ts +43 -0
- package/dist/tools/iap.d.ts.map +1 -0
- package/dist/tools/iap.js +360 -0
- package/dist/tools/iap.js.map +1 -0
- package/dist/tools/list-apps.js +1 -1
- package/dist/tools/list-reviews.js +2 -2
- package/dist/tools/local-build.d.ts +26 -0
- package/dist/tools/local-build.d.ts.map +1 -0
- package/dist/tools/local-build.js +100 -0
- package/dist/tools/local-build.js.map +1 -0
- package/dist/tools/privacy.d.ts +15 -0
- package/dist/tools/privacy.d.ts.map +1 -0
- package/dist/tools/privacy.js +32 -0
- package/dist/tools/privacy.js.map +1 -0
- package/dist/tools/release-control.d.ts +22 -0
- package/dist/tools/release-control.d.ts.map +1 -0
- package/dist/tools/release-control.js +85 -0
- package/dist/tools/release-control.js.map +1 -0
- package/dist/tools/release-preflight.d.ts.map +1 -1
- package/dist/tools/release-preflight.js +139 -0
- package/dist/tools/release-preflight.js.map +1 -1
- package/dist/tools/review-screenshot.d.ts +14 -0
- package/dist/tools/review-screenshot.d.ts.map +1 -0
- package/dist/tools/review-screenshot.js +72 -0
- package/dist/tools/review-screenshot.js.map +1 -0
- package/dist/tools/review-status.js +2 -2
- package/dist/tools/sales-report.js +3 -3
- package/dist/tools/sales-report.js.map +1 -1
- package/dist/tools/screenshots.d.ts +15 -0
- package/dist/tools/screenshots.d.ts.map +1 -0
- package/dist/tools/screenshots.js +106 -0
- package/dist/tools/screenshots.js.map +1 -0
- package/dist/tools/signing.d.ts +21 -0
- package/dist/tools/signing.d.ts.map +1 -0
- package/dist/tools/signing.js +101 -0
- package/dist/tools/signing.js.map +1 -0
- package/dist/tools/submission.d.ts +47 -0
- package/dist/tools/submission.d.ts.map +1 -0
- package/dist/tools/submission.js +199 -0
- package/dist/tools/submission.js.map +1 -0
- package/dist/tools/testflight.d.ts +20 -0
- package/dist/tools/testflight.d.ts.map +1 -0
- package/dist/tools/testflight.js +75 -0
- package/dist/tools/testflight.js.map +1 -0
- package/dist/tools/triage-reviews.d.ts +35 -0
- package/dist/tools/triage-reviews.d.ts.map +1 -0
- package/dist/tools/triage-reviews.js +194 -0
- package/dist/tools/triage-reviews.js.map +1 -0
- package/dist/tools/update-version-metadata.d.ts +17 -0
- package/dist/tools/update-version-metadata.d.ts.map +1 -0
- package/dist/tools/update-version-metadata.js +148 -0
- package/dist/tools/update-version-metadata.js.map +1 -0
- package/dist/tools/version-control.d.ts +21 -0
- package/dist/tools/version-control.d.ts.map +1 -0
- package/dist/tools/version-control.js +144 -0
- package/dist/tools/version-control.js.map +1 -0
- package/package.json +5 -2
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* triage_reviews tool (Pro). Uses MCP Sampling to cluster customer reviews
|
|
4
|
+
* into themes on the user's own Claude (zero cost to us).
|
|
5
|
+
*
|
|
6
|
+
* Pipeline:
|
|
7
|
+
* 1. Fetch up to `limit` reviews via the ASC API (reuses list_reviews logic)
|
|
8
|
+
* 2. If none, return empty result, skip Sampling
|
|
9
|
+
* 3. Ask the user's client to cluster via Sampling
|
|
10
|
+
* 4. Parse JSON response from the model; degrade gracefully on parse error
|
|
11
|
+
*/
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.triageReviews = triageReviews;
|
|
14
|
+
exports.formatTriageForAgent = formatTriageForAgent;
|
|
15
|
+
const sampling_js_1 = require("../sampling.js");
|
|
16
|
+
const MAX_REVIEWS = 30;
|
|
17
|
+
const MIN_FOR_CLUSTERING = 3;
|
|
18
|
+
const SYSTEM_PROMPT = [
|
|
19
|
+
"You are a product-review triage assistant.",
|
|
20
|
+
"Given a list of App Store reviews, group them into 3 to 5 themes.",
|
|
21
|
+
"Each theme gets:",
|
|
22
|
+
" - a short label (3 to 7 words)",
|
|
23
|
+
" - the exact count of reviews that fit it",
|
|
24
|
+
" - an action_bucket from: bug, missing_feature, pricing, ux, content, other",
|
|
25
|
+
" - a single representative verbatim quote (must be one of the reviews, unedited)",
|
|
26
|
+
"",
|
|
27
|
+
"Rules:",
|
|
28
|
+
" - Reply ONLY with a valid JSON object matching the schema below. No prose, no markdown.",
|
|
29
|
+
" - Never invent themes with zero reviews.",
|
|
30
|
+
" - Never invent quotes; they must appear in the input verbatim.",
|
|
31
|
+
" - If fewer than 3 reviews, still produce 1 to 2 themes.",
|
|
32
|
+
"",
|
|
33
|
+
'Schema: { "themes": [{ "theme": string, "count": number, "action_bucket": string, "quote": string }] }',
|
|
34
|
+
].join("\n");
|
|
35
|
+
async function triageReviews(server, client, args, tier) {
|
|
36
|
+
if (tier !== "pro") {
|
|
37
|
+
return {
|
|
38
|
+
app_id: args.app_id,
|
|
39
|
+
reviews_analyzed: 0,
|
|
40
|
+
themes: [],
|
|
41
|
+
degraded: true,
|
|
42
|
+
note: "Review triage requires a Pro license ($9/mo). Get your license at https://buy.polar.sh/polar_cl_Ta3OxEA1EbRyYNPFtSsRXgYWBCCtjwMxlbAeW35RLuu",
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
const limit = Math.min(args.limit ?? 30, MAX_REVIEWS);
|
|
46
|
+
const params = {
|
|
47
|
+
"fields[customerReviews]": "rating,title,body,reviewerNickname,createdDate,territory",
|
|
48
|
+
limit: String(limit),
|
|
49
|
+
sort: "-createdDate",
|
|
50
|
+
};
|
|
51
|
+
if (args.rating && args.rating >= 1 && args.rating <= 5) {
|
|
52
|
+
params["filter[rating]"] = String(args.rating);
|
|
53
|
+
}
|
|
54
|
+
const response = await client.get(`/v1/apps/${args.app_id}/customerReviews`, params);
|
|
55
|
+
const reviews = Array.isArray(response.data) ? response.data : [response.data];
|
|
56
|
+
const total = reviews.length;
|
|
57
|
+
if (total === 0) {
|
|
58
|
+
return {
|
|
59
|
+
app_id: args.app_id,
|
|
60
|
+
reviews_analyzed: 0,
|
|
61
|
+
themes: [],
|
|
62
|
+
degraded: false,
|
|
63
|
+
note: "No reviews found for this app in the requested window.",
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
if (total < MIN_FOR_CLUSTERING) {
|
|
67
|
+
const themes = reviews.map((r) => {
|
|
68
|
+
const a = r.attributes;
|
|
69
|
+
return {
|
|
70
|
+
theme: (a.title || a.body.slice(0, 40) || "Untitled").slice(0, 60),
|
|
71
|
+
count: 1,
|
|
72
|
+
action_bucket: "other",
|
|
73
|
+
quote: (a.body || a.title || "").slice(0, 240),
|
|
74
|
+
};
|
|
75
|
+
});
|
|
76
|
+
return {
|
|
77
|
+
app_id: args.app_id,
|
|
78
|
+
reviews_analyzed: total,
|
|
79
|
+
themes,
|
|
80
|
+
degraded: false,
|
|
81
|
+
note: `Only ${total} review(s) found; returning pass-through summary without Sampling.`,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
const reviewText = reviews
|
|
85
|
+
.map((r, i) => {
|
|
86
|
+
const a = r.attributes;
|
|
87
|
+
return `[${i + 1}] ${a.rating}/5 - ${a.territory} - "${a.title || ""}" :: ${a.body || ""}`;
|
|
88
|
+
})
|
|
89
|
+
.join("\n");
|
|
90
|
+
const samplingResult = await (0, sampling_js_1.sample)(server, {
|
|
91
|
+
system: SYSTEM_PROMPT,
|
|
92
|
+
user: `Cluster these ${total} App Store reviews into 3 to 5 themes. Reply with JSON only.\n\n${reviewText}`,
|
|
93
|
+
maxTokens: 1200,
|
|
94
|
+
modelPreferences: sampling_js_1.MODEL_HINTS.fast,
|
|
95
|
+
});
|
|
96
|
+
if (!samplingResult.ok) {
|
|
97
|
+
if ("unsupported" in samplingResult && samplingResult.unsupported) {
|
|
98
|
+
return {
|
|
99
|
+
app_id: args.app_id,
|
|
100
|
+
reviews_analyzed: total,
|
|
101
|
+
themes: [],
|
|
102
|
+
degraded: true,
|
|
103
|
+
note: "Your MCP client does not support Sampling. Raw review bodies returned; ask your agent to cluster manually.",
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
return {
|
|
107
|
+
app_id: args.app_id,
|
|
108
|
+
reviews_analyzed: total,
|
|
109
|
+
themes: [],
|
|
110
|
+
degraded: true,
|
|
111
|
+
note: `Sampling failed: ${"error" in samplingResult ? samplingResult.error : "unknown"}. Raw reviews returned.`,
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
const parsed = safeParseThemes(samplingResult.text);
|
|
115
|
+
if (!parsed) {
|
|
116
|
+
return {
|
|
117
|
+
app_id: args.app_id,
|
|
118
|
+
reviews_analyzed: total,
|
|
119
|
+
themes: [],
|
|
120
|
+
degraded: true,
|
|
121
|
+
note: `Sampling returned invalid JSON. Raw: ${samplingResult.text.slice(0, 200)}`,
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
return {
|
|
125
|
+
app_id: args.app_id,
|
|
126
|
+
reviews_analyzed: total,
|
|
127
|
+
themes: parsed,
|
|
128
|
+
degraded: false,
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
function safeParseThemes(text) {
|
|
132
|
+
let json = text.trim();
|
|
133
|
+
const fenced = json.match(/```(?:json)?\s*([\s\S]+?)```/);
|
|
134
|
+
if (fenced)
|
|
135
|
+
json = fenced[1].trim();
|
|
136
|
+
try {
|
|
137
|
+
const obj = JSON.parse(json);
|
|
138
|
+
if (!obj.themes || !Array.isArray(obj.themes))
|
|
139
|
+
return null;
|
|
140
|
+
const out = [];
|
|
141
|
+
for (const t of obj.themes) {
|
|
142
|
+
if (!t || typeof t !== "object")
|
|
143
|
+
continue;
|
|
144
|
+
const row = t;
|
|
145
|
+
const theme = String(row.theme ?? "").slice(0, 120);
|
|
146
|
+
const count = Number(row.count ?? 0);
|
|
147
|
+
const actionBucket = String(row.action_bucket ?? "other");
|
|
148
|
+
const quote = String(row.quote ?? "").slice(0, 500);
|
|
149
|
+
if (!theme || count <= 0)
|
|
150
|
+
continue;
|
|
151
|
+
out.push({
|
|
152
|
+
theme,
|
|
153
|
+
count,
|
|
154
|
+
action_bucket: validBucket(actionBucket),
|
|
155
|
+
quote,
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
return out.slice(0, 8);
|
|
159
|
+
}
|
|
160
|
+
catch {
|
|
161
|
+
return null;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
function validBucket(s) {
|
|
165
|
+
const allowed = [
|
|
166
|
+
"bug",
|
|
167
|
+
"missing_feature",
|
|
168
|
+
"pricing",
|
|
169
|
+
"ux",
|
|
170
|
+
"content",
|
|
171
|
+
"other",
|
|
172
|
+
];
|
|
173
|
+
return allowed.includes(s) ? s : "other";
|
|
174
|
+
}
|
|
175
|
+
function formatTriageForAgent(res) {
|
|
176
|
+
if (res.themes.length === 0) {
|
|
177
|
+
return res.note ?? "No reviews to triage.";
|
|
178
|
+
}
|
|
179
|
+
const lines = [
|
|
180
|
+
`# Review triage: app ${res.app_id}`,
|
|
181
|
+
`Reviews analyzed: ${res.reviews_analyzed}${res.degraded ? " (degraded)" : ""}`,
|
|
182
|
+
"",
|
|
183
|
+
];
|
|
184
|
+
for (const t of res.themes) {
|
|
185
|
+
lines.push(`## ${t.theme} (${t.count}, ${t.action_bucket})`);
|
|
186
|
+
lines.push(`> ${t.quote}`);
|
|
187
|
+
lines.push("");
|
|
188
|
+
}
|
|
189
|
+
if (res.note) {
|
|
190
|
+
lines.push(`_${res.note}_`);
|
|
191
|
+
}
|
|
192
|
+
return lines.join("\n");
|
|
193
|
+
}
|
|
194
|
+
//# sourceMappingURL=triage-reviews.js.map
|
|
@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AAC,IAAI,GAAG,CAAC,MAAM,EAAE,CAAC;QAC3B,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,KAAK,MAAM,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,aAAa,GAAG,CAAC,CAAC;QAC9D,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC;QAC3B,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACjB,CAAC;IACD,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC;QACb,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,IAAI,GAAG,CAAC,CAAC;IAC9B,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type ASCClient } from "../client.js";
|
|
2
|
+
import type { Tier } from "../types.js";
|
|
3
|
+
export interface UpdateMetadataArgs {
|
|
4
|
+
app_id: string;
|
|
5
|
+
locale?: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
keywords?: string;
|
|
8
|
+
whats_new?: string;
|
|
9
|
+
promotional_text?: string;
|
|
10
|
+
marketing_url?: string;
|
|
11
|
+
support_url?: string;
|
|
12
|
+
name?: string;
|
|
13
|
+
subtitle?: string;
|
|
14
|
+
privacy_policy_url?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare function updateVersionMetadata(client: ASCClient, args: UpdateMetadataArgs, tier: Tier): Promise<string>;
|
|
17
|
+
//# sourceMappingURL=update-version-metadata.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-version-metadata.d.ts","sourceRoot":"","sources":["../../src/tools/update-version-metadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAwExC,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,SAAS,EACjB,IAAI,EAAE,kBAAkB,EACxB,IAAI,EAAE,IAAI,GACT,OAAO,CAAC,MAAM,CAAC,CA2HjB"}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.updateVersionMetadata = updateVersionMetadata;
|
|
4
|
+
const client_js_1 = require("../client.js");
|
|
5
|
+
const gate_js_1 = require("../gate.js");
|
|
6
|
+
const editable_js_1 = require("../editable.js");
|
|
7
|
+
/**
|
|
8
|
+
* PATCH a localization, but survive Apple's atomic-PATCH gotcha: a single
|
|
9
|
+
* attribute that is not editable in the current state (e.g. whatsNew on a
|
|
10
|
+
* first 1.0 version) returns 409 STATE_ERROR and rejects the WHOLE write,
|
|
11
|
+
* silently losing the valid fields. We drop the offending attribute(s) and
|
|
12
|
+
* retry so the rest still lands, reporting what was skipped.
|
|
13
|
+
*/
|
|
14
|
+
async function patchLocResilient(client, path, type, id, attributes, skipped) {
|
|
15
|
+
let attrs = { ...attributes };
|
|
16
|
+
for (let attempt = 0; attempt < 6 && Object.keys(attrs).length; attempt++) {
|
|
17
|
+
try {
|
|
18
|
+
await client.patch(path, { data: { type, id, attributes: attrs } });
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
catch (err) {
|
|
22
|
+
if (!(err instanceof client_js_1.ASCAPIError) || err.status !== 409)
|
|
23
|
+
throw err;
|
|
24
|
+
const bad = attrFromStateError(err.body, Object.keys(attrs));
|
|
25
|
+
if (!bad)
|
|
26
|
+
throw err;
|
|
27
|
+
delete attrs[bad];
|
|
28
|
+
skipped.push(bad);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
/** Pull the offending attribute name out of a 409 STATE_ERROR body. */
|
|
33
|
+
function attrFromStateError(body, candidates) {
|
|
34
|
+
// Apple phrases it as: Attribute 'whatsNew' cannot be edited at this time
|
|
35
|
+
const m = body.match(/Attribute '([^']+)'/);
|
|
36
|
+
if (m && candidates.includes(m[1]))
|
|
37
|
+
return m[1];
|
|
38
|
+
// Fallback: any candidate name quoted in the body.
|
|
39
|
+
return candidates.find((c) => body.includes(`'${c}'`)) ?? null;
|
|
40
|
+
}
|
|
41
|
+
const LIMITS = {
|
|
42
|
+
description: 4000,
|
|
43
|
+
keywords: 100,
|
|
44
|
+
whatsNew: 4000,
|
|
45
|
+
promotionalText: 170,
|
|
46
|
+
name: 30,
|
|
47
|
+
subtitle: 30,
|
|
48
|
+
};
|
|
49
|
+
async function updateVersionMetadata(client, args, tier) {
|
|
50
|
+
const gate = (0, gate_js_1.requirePro)(tier, "Editing version metadata");
|
|
51
|
+
if (gate)
|
|
52
|
+
return gate;
|
|
53
|
+
// Validate character limits before any write.
|
|
54
|
+
const overLimit = [];
|
|
55
|
+
const check = (field, val) => {
|
|
56
|
+
if (val !== undefined && val.length > LIMITS[field]) {
|
|
57
|
+
overLimit.push(`${field}: ${val.length}/${LIMITS[field]} chars`);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
check("description", args.description);
|
|
61
|
+
check("keywords", args.keywords);
|
|
62
|
+
check("whatsNew", args.whats_new);
|
|
63
|
+
check("promotionalText", args.promotional_text);
|
|
64
|
+
check("name", args.name);
|
|
65
|
+
check("subtitle", args.subtitle);
|
|
66
|
+
if (overLimit.length) {
|
|
67
|
+
return `Refusing to write, over Apple's character limits:\n- ${overLimit.join("\n- ")}`;
|
|
68
|
+
}
|
|
69
|
+
// 1. Find the editable version for this app.
|
|
70
|
+
const versionsRes = await client.get(`/v1/apps/${args.app_id}/appStoreVersions`, { "fields[appStoreVersions]": "versionString,appStoreState,platform", limit: "5" });
|
|
71
|
+
const versions = Array.isArray(versionsRes.data) ? versionsRes.data : [versionsRes.data];
|
|
72
|
+
const editable = versions.find((v) => editable_js_1.EDITABLE_VERSION_STATES.has(v.attributes.appStoreState));
|
|
73
|
+
if (!editable) {
|
|
74
|
+
return ("No editable version found. The current version is locked (in review or released).\n" +
|
|
75
|
+
"Create a new version first with create_version.");
|
|
76
|
+
}
|
|
77
|
+
const targetLocale = args.locale;
|
|
78
|
+
const changes = [];
|
|
79
|
+
const skipped = [];
|
|
80
|
+
// 2. Version-level localization fields (description, keywords, whatsNew, promo, urls).
|
|
81
|
+
const versionLocFields = {};
|
|
82
|
+
if (args.description !== undefined)
|
|
83
|
+
versionLocFields.description = args.description;
|
|
84
|
+
if (args.keywords !== undefined)
|
|
85
|
+
versionLocFields.keywords = args.keywords;
|
|
86
|
+
if (args.whats_new !== undefined)
|
|
87
|
+
versionLocFields.whatsNew = args.whats_new;
|
|
88
|
+
if (args.promotional_text !== undefined)
|
|
89
|
+
versionLocFields.promotionalText = args.promotional_text;
|
|
90
|
+
if (args.marketing_url !== undefined)
|
|
91
|
+
versionLocFields.marketingUrl = args.marketing_url;
|
|
92
|
+
if (args.support_url !== undefined)
|
|
93
|
+
versionLocFields.supportUrl = args.support_url;
|
|
94
|
+
if (Object.keys(versionLocFields).length) {
|
|
95
|
+
const locsRes = await client.get(`/v1/appStoreVersions/${editable.id}/appStoreVersionLocalizations`, { "fields[appStoreVersionLocalizations]": "locale", limit: "50" });
|
|
96
|
+
const locs = Array.isArray(locsRes.data) ? locsRes.data : [locsRes.data];
|
|
97
|
+
const loc = targetLocale
|
|
98
|
+
? locs.find((l) => l.attributes.locale === targetLocale)
|
|
99
|
+
: locs[0];
|
|
100
|
+
if (!loc) {
|
|
101
|
+
return `Locale "${targetLocale}" not found on version ${editable.attributes.versionString}.`;
|
|
102
|
+
}
|
|
103
|
+
const before = skipped.length;
|
|
104
|
+
await patchLocResilient(client, `/v1/appStoreVersionLocalizations/${loc.id}`, "appStoreVersionLocalizations", loc.id, versionLocFields, skipped);
|
|
105
|
+
const dropped = new Set(skipped.slice(before));
|
|
106
|
+
changes.push(...Object.keys(versionLocFields)
|
|
107
|
+
.filter((f) => !dropped.has(f))
|
|
108
|
+
.map((f) => `${f} (${loc.attributes.locale ?? targetLocale})`));
|
|
109
|
+
}
|
|
110
|
+
// 3. App-level localization fields (name, subtitle, privacyPolicyUrl) live on appInfoLocalizations.
|
|
111
|
+
if (args.name !== undefined || args.subtitle !== undefined || args.privacy_policy_url !== undefined) {
|
|
112
|
+
const appInfoRes = await client.get(`/v1/apps/${args.app_id}/appInfos`, { limit: "1" });
|
|
113
|
+
const appInfo = Array.isArray(appInfoRes.data) ? appInfoRes.data[0] : appInfoRes.data;
|
|
114
|
+
if (appInfo) {
|
|
115
|
+
const infoLocsRes = await client.get(`/v1/appInfos/${appInfo.id}/appInfoLocalizations`, { "fields[appInfoLocalizations]": "locale,name,subtitle", limit: "50" });
|
|
116
|
+
const infoLocs = Array.isArray(infoLocsRes.data) ? infoLocsRes.data : [infoLocsRes.data];
|
|
117
|
+
const iloc = targetLocale
|
|
118
|
+
? infoLocs.find((l) => l.attributes.locale === targetLocale)
|
|
119
|
+
: infoLocs[0];
|
|
120
|
+
if (iloc) {
|
|
121
|
+
const attrs = {};
|
|
122
|
+
if (args.name !== undefined)
|
|
123
|
+
attrs.name = args.name;
|
|
124
|
+
if (args.subtitle !== undefined)
|
|
125
|
+
attrs.subtitle = args.subtitle;
|
|
126
|
+
if (args.privacy_policy_url !== undefined)
|
|
127
|
+
attrs.privacyPolicyUrl = args.privacy_policy_url;
|
|
128
|
+
await client.patch(`/v1/appInfoLocalizations/${iloc.id}`, {
|
|
129
|
+
data: { type: "appInfoLocalizations", id: iloc.id, attributes: attrs },
|
|
130
|
+
});
|
|
131
|
+
changes.push(...Object.keys(attrs).map((f) => `${f} (${iloc.attributes.locale ?? targetLocale})`));
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
const skipNote = skipped.length
|
|
136
|
+
? `\n\nSkipped (not editable in this state): ${[...new Set(skipped)].join(", ")}. ` +
|
|
137
|
+
`whatsNew only applies to update versions, not a first 1.0 release.`
|
|
138
|
+
: "";
|
|
139
|
+
if (!changes.length) {
|
|
140
|
+
return ("No metadata fields were applied." +
|
|
141
|
+
(skipped.length ? skipNote : " No fields were provided."));
|
|
142
|
+
}
|
|
143
|
+
return (`Updated version ${editable.attributes.versionString} (${editable.attributes.appStoreState}):\n` +
|
|
144
|
+
changes.map((c) => `- ${c}`).join("\n") +
|
|
145
|
+
skipNote +
|
|
146
|
+
`\n\nRun release_preflight to validate, then submit_for_review when ready.`);
|
|
147
|
+
}
|
|
148
|
+
//# sourceMappingURL=update-version-metadata.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-version-metadata.js","sourceRoot":"","sources":["../../src/tools/update-version-metadata.ts"],"names":[],"mappings":";;AAuFA,sDA+HC;AAtND,4CAA2D;AAE3D,wCAAwC;AACxC,gDAAqE;AAErE;;;;;;GAMG;AACH,KAAK,UAAU,iBAAiB,CAC9B,MAAiB,EACjB,IAAY,EACZ,IAAY,EACZ,EAAU,EACV,UAAkC,EAClC,OAAiB;IAEjB,IAAI,KAAK,GAAG,EAAE,GAAG,UAAU,EAAE,CAAC;IAC9B,KAAK,IAAI,OAAO,GAAG,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE,CAAC;QAC1E,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AA2E,CAC5E,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type ASCClient } from "../client.js";
|
|
2
|
+
import type { Tier } from "../types.js";
|
|
3
|
+
type Platform = "IOS" | "MAC_OS" | "TV_OS" | "VISION_OS";
|
|
4
|
+
/** Create a new editable App Store version (the "next version" you edit + submit). */
|
|
5
|
+
export declare function createVersion(client: ASCClient, args: {
|
|
6
|
+
app_id: string;
|
|
7
|
+
version_string: string;
|
|
8
|
+
platform?: Platform;
|
|
9
|
+
copyright?: string;
|
|
10
|
+
}, tier: Tier): Promise<string>;
|
|
11
|
+
/**
|
|
12
|
+
* Submit the app's editable version to App Review via the reviewSubmissions API.
|
|
13
|
+
* Three steps: open a submission, add the version as an item, mark it submitted.
|
|
14
|
+
*/
|
|
15
|
+
export declare function submitForReview(client: ASCClient, args: {
|
|
16
|
+
app_id: string;
|
|
17
|
+
platform?: Platform;
|
|
18
|
+
confirm?: boolean;
|
|
19
|
+
}, tier: Tier): Promise<string>;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=version-control.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version-control.d.ts","sourceRoot":"","sources":["../../src/tools/version-control.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAUxC,KAAK,QAAQ,GAAG,KAAK,GAAG,QAAQ,GAAG,OAAO,GAAG,WAAW,CAAC;AAsBzD,sFAAsF;AACtF,wBAAsB,aAAa,CACjC,MAAM,EAAE,SAAS,EACjB,IAAI,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,EACzF,IAAI,EAAE,IAAI,GACT,OAAO,CAAC,MAAM,CAAC,CAyBjB;AAED;;;GAGG;AACH,wBAAsB,eAAe,CACnC,MAAM,EAAE,SAAS,EACjB,IAAI,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,EAChE,IAAI,EAAE,IAAI,GACT,OAAO,CAAC,MAAM,CAAC,CA6GjB"}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createVersion = createVersion;
|
|
4
|
+
exports.submitForReview = submitForReview;
|
|
5
|
+
const client_js_1 = require("../client.js");
|
|
6
|
+
const gate_js_1 = require("../gate.js");
|
|
7
|
+
const editable_js_1 = require("../editable.js");
|
|
8
|
+
/**
|
|
9
|
+
* Apple does not let the API bundle an app's FIRST in-app purchases with the
|
|
10
|
+
* version (the API has no shared submission for them). Rather than submit the
|
|
11
|
+
* version alone and orphan the products, return the exact website steps.
|
|
12
|
+
*/
|
|
13
|
+
function firstIapGuidance(appId, products) {
|
|
14
|
+
return ("Not submitted. Your app's first in-app purchases must be submitted TOGETHER with the app " +
|
|
15
|
+
"version, which Apple only supports in the App Store Connect website (not the API). " +
|
|
16
|
+
"Submitting the version alone would orphan the products, so this stopped instead.\n\n" +
|
|
17
|
+
`Finish in the website (one time):\n` +
|
|
18
|
+
`1. Open https://appstoreconnect.apple.com/apps/${appId}/appstore\n` +
|
|
19
|
+
`2. Open the editable version (1.0).\n` +
|
|
20
|
+
`3. In the "In-App Purchases and Subscriptions" section, select: ${products.join(", ")}.\n` +
|
|
21
|
+
`4. Click "Add for Review", then "Submit for Review" - version + products go together.\n\n` +
|
|
22
|
+
"After this first release is live, future IAPs can be submitted via the API.");
|
|
23
|
+
}
|
|
24
|
+
/** Create a new editable App Store version (the "next version" you edit + submit). */
|
|
25
|
+
async function createVersion(client, args, tier) {
|
|
26
|
+
const gate = (0, gate_js_1.requirePro)(tier, "Creating a new version");
|
|
27
|
+
if (gate)
|
|
28
|
+
return gate;
|
|
29
|
+
const attributes = {
|
|
30
|
+
platform: args.platform ?? "IOS",
|
|
31
|
+
versionString: args.version_string,
|
|
32
|
+
};
|
|
33
|
+
if (args.copyright)
|
|
34
|
+
attributes.copyright = args.copyright;
|
|
35
|
+
const res = await client.post("/v1/appStoreVersions", {
|
|
36
|
+
data: {
|
|
37
|
+
type: "appStoreVersions",
|
|
38
|
+
attributes,
|
|
39
|
+
relationships: {
|
|
40
|
+
app: { data: { type: "apps", id: args.app_id } },
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
const created = res && !Array.isArray(res.data) ? res.data : null;
|
|
45
|
+
return (`Created version ${args.version_string} (${attributes.platform}).` +
|
|
46
|
+
(created ? ` Version ID: ${created.id}` : "") +
|
|
47
|
+
`\n\nEdit it with update_version_metadata, attach a build, then submit_for_review.`);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Submit the app's editable version to App Review via the reviewSubmissions API.
|
|
51
|
+
* Three steps: open a submission, add the version as an item, mark it submitted.
|
|
52
|
+
*/
|
|
53
|
+
async function submitForReview(client, args, tier) {
|
|
54
|
+
const gate = (0, gate_js_1.requirePro)(tier, "Submitting for review");
|
|
55
|
+
if (gate)
|
|
56
|
+
return gate;
|
|
57
|
+
if (!args.confirm) {
|
|
58
|
+
return ("This submits your app to Apple App Review (a real, outward-facing action).\n" +
|
|
59
|
+
"Re-run with confirm: true to proceed.");
|
|
60
|
+
}
|
|
61
|
+
const platform = args.platform ?? "IOS";
|
|
62
|
+
// Find the editable version to submit.
|
|
63
|
+
const versionsRes = await client.get(`/v1/apps/${args.app_id}/appStoreVersions`, { "fields[appStoreVersions]": "versionString,appStoreState,platform", limit: "5" });
|
|
64
|
+
const versions = Array.isArray(versionsRes.data) ? versionsRes.data : [versionsRes.data];
|
|
65
|
+
const target = versions.find((v) => editable_js_1.EDITABLE_VERSION_STATES.has(v.attributes.appStoreState));
|
|
66
|
+
if (!target) {
|
|
67
|
+
return "No editable version to submit. Create one with create_version and attach a build first.";
|
|
68
|
+
}
|
|
69
|
+
// 0. Submit READY_TO_SUBMIT in-app purchases / subscriptions FIRST, before we
|
|
70
|
+
// open the version review. These are NOT reviewSubmission items: IAPs use
|
|
71
|
+
// /v1/inAppPurchaseSubmissions, subscriptions use /v1/subscriptionSubmissions.
|
|
72
|
+
// Doing them first lets us fail safely: an app's FIRST in-app purchases must be
|
|
73
|
+
// bundled with the version in the ASC website (Apple does not support that via
|
|
74
|
+
// the API). If we hit that, we abort WITHOUT submitting the version alone, so
|
|
75
|
+
// the products are never orphaned.
|
|
76
|
+
const productItems = [];
|
|
77
|
+
const FIRST_IAP_BLOCK = /MUST_BE_SUBMITTED_ON_VERSION/;
|
|
78
|
+
const iapRes = await client.get(`/v1/apps/${args.app_id}/inAppPurchasesV2`, { "fields[inAppPurchases]": "productId,state", limit: "100" });
|
|
79
|
+
const grpRes = await client.get(`/v1/apps/${args.app_id}/subscriptionGroups`, { include: "subscriptions", limit: "25" });
|
|
80
|
+
const subItems = (grpRes.included ?? [])
|
|
81
|
+
.filter((x) => x.type === "subscriptions");
|
|
82
|
+
const pendingIaps = (Array.isArray(iapRes.data) ? iapRes.data : [iapRes.data])
|
|
83
|
+
.filter(Boolean)
|
|
84
|
+
.filter((i) => i.attributes.state === "READY_TO_SUBMIT");
|
|
85
|
+
const pendingSubs = subItems.filter((s) => s.attributes.state === "READY_TO_SUBMIT");
|
|
86
|
+
const submitProduct = async (path, relKey, relType, id, label) => {
|
|
87
|
+
try {
|
|
88
|
+
await client.post(path, {
|
|
89
|
+
data: { type: path.split("/")[2], relationships: { [relKey]: { data: { type: relType, id } } } },
|
|
90
|
+
});
|
|
91
|
+
productItems.push(label);
|
|
92
|
+
return null;
|
|
93
|
+
}
|
|
94
|
+
catch (err) {
|
|
95
|
+
if (err instanceof client_js_1.ASCAPIError && FIRST_IAP_BLOCK.test(err.body))
|
|
96
|
+
return "first-iap-block";
|
|
97
|
+
return null; // already submitted / not eligible - skip
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
for (const iap of pendingIaps) {
|
|
101
|
+
const r = await submitProduct("/v1/inAppPurchaseSubmissions", "inAppPurchaseV2", "inAppPurchases", iap.id, iap.attributes.productId);
|
|
102
|
+
if (r === "first-iap-block")
|
|
103
|
+
return firstIapGuidance(args.app_id, [...pendingIaps, ...pendingSubs].map((p) => p.attributes.productId));
|
|
104
|
+
}
|
|
105
|
+
for (const s of pendingSubs) {
|
|
106
|
+
const r = await submitProduct("/v1/subscriptionSubmissions", "subscription", "subscriptions", s.id, s.attributes.productId);
|
|
107
|
+
if (r === "first-iap-block")
|
|
108
|
+
return firstIapGuidance(args.app_id, [...pendingIaps, ...pendingSubs].map((p) => p.attributes.productId));
|
|
109
|
+
}
|
|
110
|
+
// 1. Open a review submission for the app.
|
|
111
|
+
const subRes = await client.post("/v1/reviewSubmissions", {
|
|
112
|
+
data: {
|
|
113
|
+
type: "reviewSubmissions",
|
|
114
|
+
attributes: { platform },
|
|
115
|
+
relationships: { app: { data: { type: "apps", id: args.app_id } } },
|
|
116
|
+
},
|
|
117
|
+
});
|
|
118
|
+
const submission = subRes && !Array.isArray(subRes.data) ? subRes.data : null;
|
|
119
|
+
if (!submission)
|
|
120
|
+
return "Failed to open a review submission.";
|
|
121
|
+
// 2. Add the version as a submission item.
|
|
122
|
+
await client.post("/v1/reviewSubmissionItems", {
|
|
123
|
+
data: {
|
|
124
|
+
type: "reviewSubmissionItems",
|
|
125
|
+
relationships: {
|
|
126
|
+
reviewSubmission: { data: { type: "reviewSubmissions", id: submission.id } },
|
|
127
|
+
appStoreVersion: { data: { type: "appStoreVersions", id: target.id } },
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
});
|
|
131
|
+
// 3. Mark it submitted.
|
|
132
|
+
await client.patch(`/v1/reviewSubmissions/${submission.id}`, {
|
|
133
|
+
data: {
|
|
134
|
+
type: "reviewSubmissions",
|
|
135
|
+
id: submission.id,
|
|
136
|
+
attributes: { submitted: true },
|
|
137
|
+
},
|
|
138
|
+
});
|
|
139
|
+
return (`Submitted version ${target.attributes.versionString} to App Review.\n` +
|
|
140
|
+
`Submission ID: ${submission.id}\n` +
|
|
141
|
+
(productItems.length ? `Included ${productItems.length} product(s): ${productItems.join(", ")}\n` : "") +
|
|
142
|
+
"Typical review time: 24-48 hours. Track with review_status.");
|
|
143
|
+
}
|
|
144
|
+
//# sourceMappingURL=version-control.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version-control.js","sourceRoot":"","sources":["../../src/tools/version-control.ts"],"names":[],"mappings":";;AAkCA,sCA6BC;AAMD,0CAiHC;AAtLD,4CAA2D;AAE3D,wCAAwC;AACxC,gDAAqE;AAWrE;;;;GAIG;AACH,SAAS,gBAAgB,CAAC,KAAa,EAAE,QAAkB;IACzD,OAAO,CACL,2FAA2F;QAC3F,qFAAqF;QACrF,sFAAsF;QACtF,qCAAqC;QACrC,kDAAkD,KAAK,aAAa;QACpE,uCAAuC;QACvC,mEAAmE,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK;QAC3F,2FAA2F;QAC3F,6EAA6E,CAC9E,CAAC;AACJ,CAAC;AAED,sFAAsF;AAC/E,KAAK,UAAU,aAAa,CACjC,MAAiB,EACjB,IAAyF,EACzF,IAAU;IAEV,MAAM,IAAI,GAAG,IAAA,oBAAU,EAAC,IAAI,EAAE,wBAAwB,CAAC,CAAC;IACxD,IAAI,IAAI;QAAE,OAAO,IAAI,CAAC;IAEtB,MAAM,UAAU,GAA2B;QACzC,QAAQ,EAAE,IAAI,CAAC,QAAQ,IAAI,KAAK;QAChC,aAAa,EAAE,IAAI,CAAC,cAAc;KACnC,CAAC;IACF,IAAI,IAAI,CAAC,SAAS;QAAE,UAAU,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;IAE1D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EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,mBAAmB,EAAE,EAAE,EAAE,UAAU,CAAC,EAAE,EAAE,EAAE;gBAC5E,eAAe,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,kBAAkB,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE;aACvE;SACF;KACF,CAAC,CAAC;IAEH,wBAAwB;IACxB,MAAM,MAAM,CAAC,KAAK,CAAC,yBAAyB,UAAU,CAAC,EAAE,EAAE,EAAE;QAC3D,IAAI,EAAE;YACJ,IAAI,EAAE,mBAAmB;YACzB,EAAE,EAAE,UAAU,CAAC,EAAE;YACjB,UAAU,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE;SAChC;KACF,CAAC,CAAC;IAEH,OAAO,CACL,qBAAqB,MAAM,CAAC,UAAU,CAAC,aAAa,mBAAmB;QACvE,kBAAkB,UAAU,CAAC,EAAE,IAAI;QACnC,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,YAAY,YAAY,CAAC,MAAM,gBAAgB,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;QACvG,6DAA6D,CAC9D,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pofky/asc-mcp",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.8.0",
|
|
4
|
+
"description": "Full control of your App Store Connect from your coding agent. 40 tools incl. asc_setup_check (self-diagnosing setup) and asc_guide (the in-agent playbook that flags every manual website step), read intelligence (reviews, sales, preflight), and Pro write/control (metadata, screenshots, builds, IAP/subscriptions, TestFlight, submit + release, local build/upload). 6 slash-command Prompts and a bundled Claude Skill. Works with Claude Code, Claude Desktop, Cursor, Windsurf, or any MCP client. Free read tier included.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"asc-mcp": "dist/index.js",
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
"dev": "tsx src/index.ts",
|
|
13
13
|
"start": "node dist/index.js",
|
|
14
14
|
"test": "vitest run",
|
|
15
|
+
"docs": "tsc && node scripts/gen-docs.mjs",
|
|
15
16
|
"lint": "tsc --noEmit"
|
|
16
17
|
},
|
|
17
18
|
"keywords": [
|
|
@@ -59,6 +60,8 @@
|
|
|
59
60
|
"dist/",
|
|
60
61
|
"skills/",
|
|
61
62
|
"README.md",
|
|
63
|
+
"USER_GUIDE.md",
|
|
64
|
+
"LIMITATIONS.md",
|
|
62
65
|
"LICENSE"
|
|
63
66
|
]
|
|
64
67
|
}
|