@extenshi/mcp 0.21.0 → 0.22.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/README.md +11 -5
- package/dist/bff.d.ts +39 -1
- package/dist/bff.d.ts.map +1 -1
- package/dist/bff.js +5 -0
- package/dist/bff.js.map +1 -1
- package/dist/development-guide.d.ts +36 -24
- package/dist/development-guide.d.ts.map +1 -1
- package/dist/development-guide.js +24 -4
- package/dist/development-guide.js.map +1 -1
- package/dist/feedback-form-tools.d.ts +101 -0
- package/dist/feedback-form-tools.d.ts.map +1 -0
- package/dist/feedback-form-tools.js +189 -0
- package/dist/feedback-form-tools.js.map +1 -0
- package/dist/pay.d.ts +15 -1
- package/dist/pay.d.ts.map +1 -1
- package/dist/pay.js +18 -3
- package/dist/pay.js.map +1 -1
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +13 -7
- package/dist/tools.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Feedback form tools — the hosted page an extension opens while it is still
|
|
3
|
+
* installed (feedback.extenshi.io). Same shape as uninstall-form-tools.ts: read,
|
|
4
|
+
* preview and update an existing form through the validation the Dojo editor
|
|
5
|
+
* uses, and read its answers. Translations stay with get/set_page_translations
|
|
6
|
+
* (surface `feedback`); the form itself is created in Dojo.
|
|
7
|
+
*/
|
|
8
|
+
import type { FastMCPSessionAuth, Tool, ToolParameters } from 'fastmcp';
|
|
9
|
+
import { z } from 'zod';
|
|
10
|
+
import type { Bff } from './bff.js';
|
|
11
|
+
import type { ToolCallContext } from './tools.js';
|
|
12
|
+
type AddTool = <P extends ToolParameters>(tool: Tool<FastMCPSessionAuth, P>) => void;
|
|
13
|
+
/** Mirrors the BFF's partial patch; the server validates the merged form again. */
|
|
14
|
+
export declare const feedbackFormPatchSchema: z.ZodObject<{
|
|
15
|
+
name: z.ZodOptional<z.ZodString>;
|
|
16
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
17
|
+
accentColor: z.ZodOptional<z.ZodString>;
|
|
18
|
+
theme: z.ZodOptional<z.ZodEnum<["light", "dark"]>>;
|
|
19
|
+
headline: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
20
|
+
thankYouMessage: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
21
|
+
categories: z.ZodOptional<z.ZodArray<z.ZodEnum<["bug", "site_not_working", "idea"]>, "many">>;
|
|
22
|
+
customCategories: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
23
|
+
askContact: z.ZodOptional<z.ZodBoolean>;
|
|
24
|
+
askSite: z.ZodOptional<z.ZodBoolean>;
|
|
25
|
+
categoryOutcomes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
26
|
+
category: z.ZodString;
|
|
27
|
+
thankYouMessage: z.ZodOptional<z.ZodString>;
|
|
28
|
+
}, "strip", z.ZodTypeAny, {
|
|
29
|
+
category: string;
|
|
30
|
+
thankYouMessage?: string | undefined;
|
|
31
|
+
}, {
|
|
32
|
+
category: string;
|
|
33
|
+
thankYouMessage?: string | undefined;
|
|
34
|
+
}>, "many">>;
|
|
35
|
+
categoryFollowups: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
36
|
+
category: z.ZodString;
|
|
37
|
+
prompt: z.ZodString;
|
|
38
|
+
kind: z.ZodEnum<["text", "choice"]>;
|
|
39
|
+
choices: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
40
|
+
multiple: z.ZodOptional<z.ZodBoolean>;
|
|
41
|
+
}, "strip", z.ZodTypeAny, {
|
|
42
|
+
kind: "text" | "choice";
|
|
43
|
+
category: string;
|
|
44
|
+
prompt: string;
|
|
45
|
+
choices?: string[] | undefined;
|
|
46
|
+
multiple?: boolean | undefined;
|
|
47
|
+
}, {
|
|
48
|
+
kind: "text" | "choice";
|
|
49
|
+
category: string;
|
|
50
|
+
prompt: string;
|
|
51
|
+
choices?: string[] | undefined;
|
|
52
|
+
multiple?: boolean | undefined;
|
|
53
|
+
}>, "many">>;
|
|
54
|
+
}, "strict", z.ZodTypeAny, {
|
|
55
|
+
name?: string | undefined;
|
|
56
|
+
enabled?: boolean | undefined;
|
|
57
|
+
accentColor?: string | undefined;
|
|
58
|
+
theme?: "light" | "dark" | undefined;
|
|
59
|
+
categories?: ("bug" | "site_not_working" | "idea")[] | undefined;
|
|
60
|
+
headline?: string | null | undefined;
|
|
61
|
+
thankYouMessage?: string | null | undefined;
|
|
62
|
+
askContact?: boolean | undefined;
|
|
63
|
+
customCategories?: string[] | undefined;
|
|
64
|
+
askSite?: boolean | undefined;
|
|
65
|
+
categoryOutcomes?: {
|
|
66
|
+
category: string;
|
|
67
|
+
thankYouMessage?: string | undefined;
|
|
68
|
+
}[] | undefined;
|
|
69
|
+
categoryFollowups?: {
|
|
70
|
+
kind: "text" | "choice";
|
|
71
|
+
category: string;
|
|
72
|
+
prompt: string;
|
|
73
|
+
choices?: string[] | undefined;
|
|
74
|
+
multiple?: boolean | undefined;
|
|
75
|
+
}[] | undefined;
|
|
76
|
+
}, {
|
|
77
|
+
name?: string | undefined;
|
|
78
|
+
enabled?: boolean | undefined;
|
|
79
|
+
accentColor?: string | undefined;
|
|
80
|
+
theme?: "light" | "dark" | undefined;
|
|
81
|
+
categories?: ("bug" | "site_not_working" | "idea")[] | undefined;
|
|
82
|
+
headline?: string | null | undefined;
|
|
83
|
+
thankYouMessage?: string | null | undefined;
|
|
84
|
+
askContact?: boolean | undefined;
|
|
85
|
+
customCategories?: string[] | undefined;
|
|
86
|
+
askSite?: boolean | undefined;
|
|
87
|
+
categoryOutcomes?: {
|
|
88
|
+
category: string;
|
|
89
|
+
thankYouMessage?: string | undefined;
|
|
90
|
+
}[] | undefined;
|
|
91
|
+
categoryFollowups?: {
|
|
92
|
+
kind: "text" | "choice";
|
|
93
|
+
category: string;
|
|
94
|
+
prompt: string;
|
|
95
|
+
choices?: string[] | undefined;
|
|
96
|
+
multiple?: boolean | undefined;
|
|
97
|
+
}[] | undefined;
|
|
98
|
+
}>;
|
|
99
|
+
export declare function registerFeedbackFormTools(add: AddTool, bff: (context: ToolCallContext) => Bff, fail: (err: unknown) => never): void;
|
|
100
|
+
export {};
|
|
101
|
+
//# sourceMappingURL=feedback-form-tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feedback-form-tools.d.ts","sourceRoot":"","sources":["../src/feedback-form-tools.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AACvE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AACnC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAGjD,KAAK,OAAO,GAAG,CAAC,CAAC,SAAS,cAAc,EAAE,IAAI,EAAE,IAAI,CAAC,kBAAkB,EAAE,CAAC,CAAC,KAAK,IAAI,CAAA;AAOpF,mFAAmF;AACnF,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8C1B,CAAA;AAEV,wBAAgB,yBAAyB,CACxC,GAAG,EAAE,OAAO,EACZ,GAAG,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,GAAG,EACtC,IAAI,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,KAAK,GAC3B,IAAI,CAqIN"}
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Feedback form tools — the hosted page an extension opens while it is still
|
|
3
|
+
* installed (feedback.extenshi.io). Same shape as uninstall-form-tools.ts: read,
|
|
4
|
+
* preview and update an existing form through the validation the Dojo editor
|
|
5
|
+
* uses, and read its answers. Translations stay with get/set_page_translations
|
|
6
|
+
* (surface `feedback`); the form itself is created in Dojo.
|
|
7
|
+
*/
|
|
8
|
+
import { z } from 'zod';
|
|
9
|
+
import { renderCatalogPayload } from './untrusted.js';
|
|
10
|
+
const READ_ONLY = { readOnlyHint: true, idempotentHint: true, destructiveHint: false, openWorldHint: true };
|
|
11
|
+
const FEEDBACK_CATEGORIES = ['bug', 'site_not_working', 'idea'];
|
|
12
|
+
const FEEDBACK_SOURCES = ['popup', 'options', 'trial_end', 'nudge'];
|
|
13
|
+
/** Mirrors the BFF's partial patch; the server validates the merged form again. */
|
|
14
|
+
export const feedbackFormPatchSchema = z
|
|
15
|
+
.object({
|
|
16
|
+
name: z.string().min(1).max(80).describe('Dev-facing form name (not shown on the page).'),
|
|
17
|
+
enabled: z.boolean(),
|
|
18
|
+
accentColor: z.string().regex(/^#[0-9a-fA-F]{3,8}$/),
|
|
19
|
+
theme: z.enum(['light', 'dark']),
|
|
20
|
+
headline: z
|
|
21
|
+
.string()
|
|
22
|
+
.max(120)
|
|
23
|
+
.nullable()
|
|
24
|
+
.describe('Page heading. null = the built-in "Feedback on <title>" in the page language.'),
|
|
25
|
+
thankYouMessage: z.string().max(300).nullable().describe('Shown after an answer. null = built-in text.'),
|
|
26
|
+
categories: z
|
|
27
|
+
.array(z.enum(FEEDBACK_CATEGORIES))
|
|
28
|
+
.max(FEEDBACK_CATEGORIES.length)
|
|
29
|
+
.describe('Built-in categories shown; `other` is offered as well.'),
|
|
30
|
+
customCategories: z.array(z.string().min(1).max(60)).max(2).describe('Your own categories (max 2).'),
|
|
31
|
+
askContact: z
|
|
32
|
+
.boolean()
|
|
33
|
+
.describe('Ask for an optional email. Turning it on needs confirmPrivacyChange: true.'),
|
|
34
|
+
askSite: z
|
|
35
|
+
.boolean()
|
|
36
|
+
.describe('Show the editable website field (when the extension passes `site` or `site_not_working` is picked).'),
|
|
37
|
+
categoryOutcomes: z
|
|
38
|
+
.array(z.object({
|
|
39
|
+
category: z.string().min(1).max(80).describe('A category key, `custom:<label>`, or `other`.'),
|
|
40
|
+
thankYouMessage: z.string().max(300).optional(),
|
|
41
|
+
}))
|
|
42
|
+
.describe('Per-category thank-you message. Replaces the whole list.'),
|
|
43
|
+
categoryFollowups: z
|
|
44
|
+
.array(z.object({
|
|
45
|
+
category: z.string().min(1).max(80),
|
|
46
|
+
prompt: z.string().min(1).max(200),
|
|
47
|
+
kind: z.enum(['text', 'choice']),
|
|
48
|
+
choices: z.array(z.string().min(1).max(60)).max(8).optional(),
|
|
49
|
+
multiple: z.boolean().optional(),
|
|
50
|
+
}))
|
|
51
|
+
.describe('Per-category follow-up question. Replaces the whole list.'),
|
|
52
|
+
})
|
|
53
|
+
.partial()
|
|
54
|
+
.strict();
|
|
55
|
+
export function registerFeedbackFormTools(add, bff, fail) {
|
|
56
|
+
const ids = {
|
|
57
|
+
projectId: z.string().uuid(),
|
|
58
|
+
formId: z.string().uuid().describe('From list_feedback_forms.'),
|
|
59
|
+
};
|
|
60
|
+
add({
|
|
61
|
+
name: 'list_feedback_forms',
|
|
62
|
+
description: "The project's hosted feedback forms (feedback.extenshi.io): {id, name, publicCode, url, enabled, " +
|
|
63
|
+
'primary, responseCount, createdAt, updatedAt} and the per-project `limit`. `primary` is the one ' +
|
|
64
|
+
'FEEDBACK_FORM_URL in the generated config points at; a form keeps its URL for life. Forms are ' +
|
|
65
|
+
'created in Dojo. Requires project.read. FREE.',
|
|
66
|
+
parameters: z.object({ projectId: z.string().uuid() }),
|
|
67
|
+
annotations: { title: 'List feedback forms', ...READ_ONLY },
|
|
68
|
+
execute: async (args, context) => {
|
|
69
|
+
try {
|
|
70
|
+
return JSON.stringify(await bff(context).listFeedbackForms(args));
|
|
71
|
+
}
|
|
72
|
+
catch (err) {
|
|
73
|
+
return fail(err);
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
});
|
|
77
|
+
add({
|
|
78
|
+
name: 'get_feedback_form',
|
|
79
|
+
description: 'One feedback form in full: every setting, the per-category questions and thank-you messages, its ' +
|
|
80
|
+
'URL, `updatedAt` (pass it back as expectedUpdatedAt to update_feedback_form), the page heading and ' +
|
|
81
|
+
'where it comes from (`headline`, or `default` built from `title`, the store listing name or the ' +
|
|
82
|
+
'project name), translation status per project language {translated, missing, outdated}, and ' +
|
|
83
|
+
'`openSnippet`: the extension-side openFeedbackForm(src, extra) helper that opens the form with the ' +
|
|
84
|
+
'parameters it reads (site only from the popup\'s "Doesn’t work on this site?"). ' +
|
|
85
|
+
'Requires project.read. FREE.',
|
|
86
|
+
parameters: z.object(ids),
|
|
87
|
+
annotations: { title: 'Read a feedback form', ...READ_ONLY },
|
|
88
|
+
execute: async (args, context) => {
|
|
89
|
+
try {
|
|
90
|
+
return JSON.stringify(await bff(context).getFeedbackForm(args));
|
|
91
|
+
}
|
|
92
|
+
catch (err) {
|
|
93
|
+
return fail(err);
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
});
|
|
97
|
+
add({
|
|
98
|
+
name: 'update_feedback_form',
|
|
99
|
+
description: 'Change a feedback form. `patch` is partial: absent fields keep their value, null clears an optional ' +
|
|
100
|
+
'text, list fields replace the whole list. The merged form passes the same validation as the Dojo ' +
|
|
101
|
+
'editor (lengths, questions and thank-you messages only for categories the form offers, no empty ' +
|
|
102
|
+
'option list). dryRun: true returns {changes [{field, before, after}], staleTranslations [{locale, ' +
|
|
103
|
+
'paths}], warnings} and writes nothing. A write needs expectedUpdatedAt (from get_feedback_form) and an ' +
|
|
104
|
+
'idempotencyKey (UUID): a form saved since you read it is refused (CONFLICT FORM_CHANGED); a retry with ' +
|
|
105
|
+
'the same key returns the first result (replayed: true). Translations whose original changed are kept ' +
|
|
106
|
+
'and listed as stale; `followUps` (also on a dry run) names set_page_translations with the count of ' +
|
|
107
|
+
'missing and outdated fields per language. Turning askContact on needs confirmPrivacyChange: true, ' +
|
|
108
|
+
'since the privacy policy then has to cover email collection. The public URL and the collected answers ' +
|
|
109
|
+
'stay as they are. The change is listed for the owner in Dojo with proposedBy. Requires hosted.write.',
|
|
110
|
+
parameters: z.object({
|
|
111
|
+
...ids,
|
|
112
|
+
patch: feedbackFormPatchSchema,
|
|
113
|
+
expectedUpdatedAt: z.string().datetime().optional().describe('`updatedAt` from get_feedback_form.'),
|
|
114
|
+
dryRun: z.boolean().optional(),
|
|
115
|
+
idempotencyKey: z.string().uuid().optional().describe('Required for a write; reuse it only to retry.'),
|
|
116
|
+
confirmPrivacyChange: z.boolean().optional(),
|
|
117
|
+
proposedBy: z.string().max(120).optional().describe('Your agent/tool name, shown to the owner.'),
|
|
118
|
+
}),
|
|
119
|
+
annotations: {
|
|
120
|
+
title: 'Update a feedback form',
|
|
121
|
+
readOnlyHint: false,
|
|
122
|
+
idempotentHint: true,
|
|
123
|
+
destructiveHint: false,
|
|
124
|
+
openWorldHint: true,
|
|
125
|
+
},
|
|
126
|
+
execute: async (args, context) => {
|
|
127
|
+
try {
|
|
128
|
+
return JSON.stringify(await bff(context).updateFeedbackForm(args));
|
|
129
|
+
}
|
|
130
|
+
catch (err) {
|
|
131
|
+
return fail(err);
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
});
|
|
135
|
+
add({
|
|
136
|
+
name: 'preview_feedback_form',
|
|
137
|
+
description: 'What the live feedback form shows in one language, built by the functions the page uses: heading, ' +
|
|
138
|
+
'subheading, the categories with their labels and follow-up questions, whether the email and website ' +
|
|
139
|
+
'fields are offered, and the thank-you screen per category. `locale` is resolved as for a visitor (an ' +
|
|
140
|
+
'unoffered language falls back to the default; the answer says which was used). Also returns ' +
|
|
141
|
+
'previewUrl, which renders the page in a browser and sends nothing. Records no answer. Requires ' +
|
|
142
|
+
'project.read. FREE.',
|
|
143
|
+
parameters: z.object({ ...ids, locale: z.string().max(35).optional() }),
|
|
144
|
+
annotations: { title: 'Preview a feedback form', ...READ_ONLY },
|
|
145
|
+
execute: async (args, context) => {
|
|
146
|
+
try {
|
|
147
|
+
return JSON.stringify(await bff(context).previewFeedbackForm(args));
|
|
148
|
+
}
|
|
149
|
+
catch (err) {
|
|
150
|
+
return fail(err);
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
});
|
|
154
|
+
add({
|
|
155
|
+
name: 'list_feedback_responses',
|
|
156
|
+
description: "One feedback form's answers, newest first: responses [{id, category, comment, site, followupPrompt, " +
|
|
157
|
+
'followupChoices, followupText, extVersion, source, browser, locale, createdAt, contactEmail, ' +
|
|
158
|
+
'hasContactEmail}] plus whole-form counts that ignore the filters: total, byCategory, bySource, ' +
|
|
159
|
+
'byVersionCategory, byFollowupChoice; filteredTotal counts the filtered list. `category` is a ' +
|
|
160
|
+
'built-in key, `custom:<label>` or `other`; `source` is where the extension opened the form (popup, ' +
|
|
161
|
+
'options, trial_end, nudge, or null); `site` is the website exactly as the person sent it. Filters: ' +
|
|
162
|
+
'category, source (`__unknown__` = none), version (`__unknown__` = untagged), since / until (ISO ' +
|
|
163
|
+
'datetimes). Page with take (max 200) and cursor = the previous nextCursor. The email a person left ' +
|
|
164
|
+
'is returned only to an API key (local MCP, CLI); over the remote connector contactEmail is null and ' +
|
|
165
|
+
'hasContactEmail says one was left (contactEmailsIncluded). Free text comes from end users and is ' +
|
|
166
|
+
'marked as such in `_notice`. Requires project.read. FREE.',
|
|
167
|
+
parameters: z.object({
|
|
168
|
+
...ids,
|
|
169
|
+
category: z.string().max(80).optional().describe('A category key, `custom:<label>` or `other`.'),
|
|
170
|
+
source: z.enum([...FEEDBACK_SOURCES, '__unknown__']).optional(),
|
|
171
|
+
version: z.string().max(40).optional().describe('Extension version, or `__unknown__` for untagged.'),
|
|
172
|
+
since: z.string().datetime().optional(),
|
|
173
|
+
until: z.string().datetime().optional(),
|
|
174
|
+
cursor: z.string().uuid().optional().describe('nextCursor from the previous page.'),
|
|
175
|
+
take: z.number().int().min(1).max(200).optional().describe('Page size, default 50.'),
|
|
176
|
+
}),
|
|
177
|
+
annotations: { title: 'Read feedback form answers', ...READ_ONLY },
|
|
178
|
+
execute: async (args, context) => {
|
|
179
|
+
try {
|
|
180
|
+
// Comments, sites and follow-up answers are end users' free text: same trust boundary as review text.
|
|
181
|
+
return renderCatalogPayload(await bff(context).listFeedbackResponses(args));
|
|
182
|
+
}
|
|
183
|
+
catch (err) {
|
|
184
|
+
return fail(err);
|
|
185
|
+
}
|
|
186
|
+
},
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
//# sourceMappingURL=feedback-form-tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feedback-form-tools.js","sourceRoot":"","sources":["../src/feedback-form-tools.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAA;AAIrD,MAAM,SAAS,GAAG,EAAE,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,CAAA;AAE3G,MAAM,mBAAmB,GAAG,CAAC,KAAK,EAAE,kBAAkB,EAAE,MAAM,CAAU,CAAA;AACxE,MAAM,gBAAgB,GAAG,CAAC,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,OAAO,CAAU,CAAA;AAE5E,mFAAmF;AACnF,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC;KACtC,MAAM,CAAC;IACP,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,+CAA+C,CAAC;IACzF,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;IACpB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,qBAAqB,CAAC;IACpD,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAChC,QAAQ,EAAE,CAAC;SACT,MAAM,EAAE;SAC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C,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,wBAAwB,CAAC;SACpF,CAAC;QACF,WAAW,EAAE,EAAE,KAAK,EAAE,4BAA4B,EAAE,GAAG,SAAS,EAAE;QAClE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE;YAChC,IAAI,CAAC;gBACJ,sGAAsG;gBACtG,OAAO,oBAAoB,CAAC,MAAM,GAAG,CAAC,OAAO,CAAC,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC,CAAA;YAC5E,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACd,OAAO,IAAI,CAAC,GAAG,CAAC,CAAA;YACjB,CAAC;QACF,CAAC;KACD,CAAC,CAAA;AACH,CAAC"}
|
package/dist/pay.d.ts
CHANGED
|
@@ -17,12 +17,15 @@ export declare const paySchemas: {
|
|
|
17
17
|
readonly createPayApp: z.ZodObject<{
|
|
18
18
|
name: z.ZodString;
|
|
19
19
|
linkedProjectId: z.ZodOptional<z.ZodString>;
|
|
20
|
+
trialDays: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
20
21
|
}, "strict", z.ZodTypeAny, {
|
|
21
22
|
name: string;
|
|
22
23
|
linkedProjectId?: string | undefined;
|
|
24
|
+
trialDays?: number | null | undefined;
|
|
23
25
|
}, {
|
|
24
26
|
name: string;
|
|
25
27
|
linkedProjectId?: string | undefined;
|
|
28
|
+
trialDays?: number | null | undefined;
|
|
26
29
|
}>;
|
|
27
30
|
readonly getPayApp: z.ZodObject<{
|
|
28
31
|
appId: z.ZodString;
|
|
@@ -230,6 +233,17 @@ export declare const paySchemas: {
|
|
|
230
233
|
appId: string;
|
|
231
234
|
enabled: boolean;
|
|
232
235
|
}>;
|
|
236
|
+
readonly setPayTrial: z.ZodObject<{
|
|
237
|
+
appId: z.ZodString;
|
|
238
|
+
} & {
|
|
239
|
+
trialDays: z.ZodNullable<z.ZodNumber>;
|
|
240
|
+
}, "strict", z.ZodTypeAny, {
|
|
241
|
+
appId: string;
|
|
242
|
+
trialDays: number | null;
|
|
243
|
+
}, {
|
|
244
|
+
appId: string;
|
|
245
|
+
trialDays: number | null;
|
|
246
|
+
}>;
|
|
233
247
|
readonly rotatePayKey: z.ZodObject<{
|
|
234
248
|
appId: z.ZodString;
|
|
235
249
|
}, "strict", z.ZodTypeAny, {
|
|
@@ -242,7 +256,7 @@ export type PayMethod = keyof typeof paySchemas;
|
|
|
242
256
|
export type PayBff = {
|
|
243
257
|
[M in PayMethod]: (input: z.infer<(typeof paySchemas)[M]>) => Promise<unknown>;
|
|
244
258
|
};
|
|
245
|
-
export declare const PAY_OPERATIONS: readonly [readonly ["listPayApps", "list_pay_apps", "list", "payApp.list", false, "List your independent Pay applications. No development project required. Paginated: nextCursor is set while more results exist."], readonly ["createPayApp", "create_pay_app", "create", "payApp.create", true, "Create an independent Pay application; linking a development project is optional. Not idempotent: each call creates a new application, including a call repeated after a timeout."], readonly ["getPayApp", "get_pay_app", "get", "payApp.get", false, "Read your Pay application
|
|
259
|
+
export declare const PAY_OPERATIONS: readonly [readonly ["listPayApps", "list_pay_apps", "list", "payApp.list", false, "List your independent Pay applications. No development project required. Paginated: nextCursor is set while more results exist."], readonly ["createPayApp", "create_pay_app", "create", "payApp.create", true, "Create an independent Pay application; linking a development project is optional. `trialDays` (0–365, optional) sets a free trial at once, since a new application has no buyers yet; set_pay_trial changes it later. Not idempotent: each call creates a new application, including a call repeated after a timeout."], readonly ["getPayApp", "get_pay_app", "get", "payApp.get", false, "Read your Pay application, its optional project link and its free trial (`trialDays`, null when there is none)."], readonly ["getPayReadiness", "get_pay_readiness", "readiness", "payApp.readiness", false, "Check current checkout and launch prerequisites. A passing checkout check does not prove a live external purchase or SDK publication. `warnings` are non-blocking (`ready` ignores them): offer_translations lists offer text not yet translated into the project's languages, with counts per language and fixWith (get_pay_offer_translations → set_pay_offer_translations)."], readonly ["getPayPaymentEvidence", "get_pay_payment_evidence", "payment-evidence", "payApp.paymentEvidence", false, "Read what Extenshi's own payment ledger proves about this application's payment path, per mode: checkout completed, license issued, an installation received the signed license, restored on a second installation, refund revoked. Derived from provider-signed webhooks, not from any report; opaque IDs and timestamps only, no buyer data. Only a live-mode purchase can satisfy a release's payment requirement; test-mode purchases are listed without satisfying it."], readonly ["linkPayApp", "link_pay_app", "link", "payApp.link", true, "Link your Pay application to your development project. Existing purchases remain attached to the Pay application."], readonly ["unlinkPayApp", "unlink_pay_app", "unlink", "payApp.unlink", true, "Remove the optional development-project link without deleting Pay data."], readonly ["archivePayApp", "archive_pay_app", "archive", "payApp.archive", true, "Archive your application and stop new checkout. Payment records and existing entitlements are preserved."], readonly ["exportPayData", "export_pay_data", "export", "payApp.export", false, "Export one page of one resource (offers, payments, subscriptions, entitlements or customers). nextCursor is null on the last page. Offer rows include sortOrder, their position on the paywall (lower shows first). The output contains sensitive customer and payment data."], readonly ["getPaySeller", "get_pay_seller", "seller", "paySeller.get", false, "Read seller connection, public profile, offers (terms, sortOrder, active and sync state), the publishable SDK key and the public entitlement verification key. Those two keys are the ones meant to be embedded in extension code; secret keys are not part of the response. Agreement signing and KYC take place in the browser."], readonly ["connectPaySeller", "connect_pay_seller", "connect", "paySeller.connect", true, "Start Stripe Connect onboarding and return a browser action URL. KYC and legal acceptance are completed by the author at that URL; this tool does not perform them."], readonly ["refreshPaySeller", "refresh_pay_seller", "refresh", "paySeller.refreshStatus", true, "Refresh current payment-provider onboarding status. This does not complete KYC or accept agreements."], readonly ["setPaySellerProfile", "set_pay_seller_profile", "profile", "paySeller.setPublicProfile", true, "Save the public seller profile: display name, support URL or email, and terms URL. The values are stored as provided and are publicly visible."], readonly ["upsertPayOffer", "upsert_pay_offer", "offer-upsert", "paySeller.upsertOffer", true, "Create or update an offer keyed by a stable SKU. On an existing offer every omitted field keeps its stored value: to change only the title or description, send appId, sku and the new text, and the price, features and paywall order (sortOrder) stay as they are; `description: null` clears the description. A new SKU needs kind, amountMinor, currency and title (and interval for a subscription), with sortOrder 0 when omitted (lower shows first). An archived SKU needs the same, since saving it puts it back on sale. Price is in minor currency units. Subscriptions keep the given billing interval; one-time and lifetime offers store no interval. Price and features are stored as provided. `features` are entitlement keys (e.g. `full`): the SDK checks them with hasFeature and extensions match offers by them, so they stay untranslated; localized paywall bullets come from the extension, via showPaywall({ features }) with text from its _locales. `followUps` names the translations a changed title or description left missing or outdated (set_pay_offer_translations)."], readonly ["archivePayOffer", "archive_pay_offer", "offer-archive", "paySeller.archiveOffer", true, "Stop offering a SKU for new checkout; historical purchases are preserved."], readonly ["getPayOfferTranslations", "get_pay_offer_translations", "offer-translations", "paySeller.getOfferTranslations", false, "Read the translatable text of the application's active offers (title, description) keyed `<sku>/<field>`, with the project's languages and each language's translated, missing and outdated fields. Feature keys are entitlement keys, listed under `notTranslated` and not counted as missing. The paywall shows an offer in the buyer's browser language when the project ships it; the SDK's own buttons and labels are already translated. get_project_state `localization` summarizes this with every other translated surface."], readonly ["setPayOfferTranslations", "set_pay_offer_translations", "offer-translate", "paySeller.setOfferTranslations", true, "Save one language of the offers' translations: `translations` maps `<sku>/<field>` keys from get_pay_offer_translations to text; `sources` (optional) carries the original each was translated from, and a save whose original has changed since is refused. An empty string removes a translation; a `<sku>/feature:<n>` key is refused (TRANSLATIONS_INVALID: features are entitlement keys). Prices, SKUs, plans and feature keys are not changed. Answers with the saved language's translations and every language's status (`view: 'saved_locale'`, the default); `view: 'all_locales'` returns every language's translations, as get_pay_offer_translations does."], readonly ["setPayEnabled", "set_pay_enabled", "enable", "paySeller.setEnabled", true, "Enable or disable new payments for the application; requires a connected payment provider. Enabling re-reads the seller status from the provider (charges and payouts). It does not verify the public profile, agreement or offer sync: buyers can check out only when every readiness check reported by get_pay_readiness passes. Enabling is a live commerce change."], readonly ["setPayTrial", "set_pay_trial", "trial", "payApp.setTrial", true, "Set the application's free trial: `trialDays` (0–365) free days for every installation, counted on Extenshi's server from the first time the SDK reads that installation's license; null turns the trial off. One clock per installation per application, so switching offers does not restart it, and an installation restored through purchase recovery keeps the earliest start. The end is derived from the stored start, so a new length also moves trials already running. The SDK reads it with getTrial() and the trial:ending / trial:ended events; the extension does not store a start date itself."], readonly ["rotatePayKey", "rotate_pay_key", "rotate-key", "paySeller.rotatePublishableKey", true, "Generate a new publishable SDK key. Not idempotent: each call issues another key. Prior keys remain accepted for installed extension builds; this does not revoke any secret."]];
|
|
246
260
|
/** The legacy seller API uses projectId as the payment namespace. Never substitute a linked project ID. */
|
|
247
261
|
export declare function payWireInput(method: PayMethod, input: Record<string, unknown>): Record<string, unknown>;
|
|
248
262
|
//# sourceMappingURL=pay.d.ts.map
|
package/dist/pay.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pay.d.ts","sourceRoot":"","sources":["../src/pay.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"pay.d.ts","sourceRoot":"","sources":["../src/pay.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAevB,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiEb,CAAA;AACV,MAAM,MAAM,SAAS,GAAG,MAAM,OAAO,UAAU,CAAA;AAC/C,MAAM,MAAM,MAAM,GAAG;KAAG,CAAC,IAAI,SAAS,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,OAAO,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,OAAO,CAAC;CAAE,CAAA;AACvG,eAAO,MAAM,cAAc,2zPAiKjB,CAAA;AAEV,2GAA2G;AAC3G,wBAAgB,YAAY,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAIvG"}
|
package/dist/pay.js
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
const app = z.object({ appId: z.string().uuid() }).strict();
|
|
4
4
|
const sku = z.string().regex(/^[a-z0-9][a-z0-9_-]{1,39}$/);
|
|
5
|
+
// Free days per installation; null is no trial (PAY_TRIAL_MAX_DAYS in shared-types).
|
|
6
|
+
const trialDays = z.number().int().min(0).max(365).nullable();
|
|
5
7
|
const publicUrl = z
|
|
6
8
|
.string()
|
|
7
9
|
.trim()
|
|
@@ -20,7 +22,11 @@ export const paySchemas = {
|
|
|
20
22
|
})
|
|
21
23
|
.strict(),
|
|
22
24
|
createPayApp: z
|
|
23
|
-
.object({
|
|
25
|
+
.object({
|
|
26
|
+
name: z.string().trim().min(1).max(120),
|
|
27
|
+
linkedProjectId: z.string().uuid().optional(),
|
|
28
|
+
trialDays: trialDays.optional(),
|
|
29
|
+
})
|
|
24
30
|
.strict(),
|
|
25
31
|
getPayApp: app,
|
|
26
32
|
getPayReadiness: app,
|
|
@@ -70,6 +76,7 @@ export const paySchemas = {
|
|
|
70
76
|
view: z.enum(['saved_locale', 'all_locales']).default('saved_locale'),
|
|
71
77
|
}),
|
|
72
78
|
setPayEnabled: app.extend({ enabled: z.boolean() }),
|
|
79
|
+
setPayTrial: app.extend({ trialDays }),
|
|
73
80
|
rotatePayKey: app,
|
|
74
81
|
};
|
|
75
82
|
export const PAY_OPERATIONS = [
|
|
@@ -87,7 +94,7 @@ export const PAY_OPERATIONS = [
|
|
|
87
94
|
'create',
|
|
88
95
|
'payApp.create',
|
|
89
96
|
true,
|
|
90
|
-
'Create an independent Pay application; linking a development project is optional. Not idempotent: each call creates a new application, including a call repeated after a timeout.',
|
|
97
|
+
'Create an independent Pay application; linking a development project is optional. `trialDays` (0–365, optional) sets a free trial at once, since a new application has no buyers yet; set_pay_trial changes it later. Not idempotent: each call creates a new application, including a call repeated after a timeout.',
|
|
91
98
|
],
|
|
92
99
|
[
|
|
93
100
|
'getPayApp',
|
|
@@ -95,7 +102,7 @@ export const PAY_OPERATIONS = [
|
|
|
95
102
|
'get',
|
|
96
103
|
'payApp.get',
|
|
97
104
|
false,
|
|
98
|
-
'Read your Pay application
|
|
105
|
+
'Read your Pay application, its optional project link and its free trial (`trialDays`, null when there is none).',
|
|
99
106
|
],
|
|
100
107
|
[
|
|
101
108
|
'getPayReadiness',
|
|
@@ -217,6 +224,14 @@ export const PAY_OPERATIONS = [
|
|
|
217
224
|
true,
|
|
218
225
|
'Enable or disable new payments for the application; requires a connected payment provider. Enabling re-reads the seller status from the provider (charges and payouts). It does not verify the public profile, agreement or offer sync: buyers can check out only when every readiness check reported by get_pay_readiness passes. Enabling is a live commerce change.',
|
|
219
226
|
],
|
|
227
|
+
[
|
|
228
|
+
'setPayTrial',
|
|
229
|
+
'set_pay_trial',
|
|
230
|
+
'trial',
|
|
231
|
+
'payApp.setTrial',
|
|
232
|
+
true,
|
|
233
|
+
"Set the application's free trial: `trialDays` (0–365) free days for every installation, counted on Extenshi's server from the first time the SDK reads that installation's license; null turns the trial off. One clock per installation per application, so switching offers does not restart it, and an installation restored through purchase recovery keeps the earliest start. The end is derived from the stored start, so a new length also moves trials already running. The SDK reads it with getTrial() and the trial:ending / trial:ended events; the extension does not store a start date itself.",
|
|
234
|
+
],
|
|
220
235
|
[
|
|
221
236
|
'rotatePayKey',
|
|
222
237
|
'rotate_pay_key',
|
package/dist/pay.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pay.js","source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AC1iC;IACD;QACC,iBAAiB;QACjB,mBAAmB;QACnB,eAAe;QACf,wBAAwB;QACxB,IAAI;QACJ,2EAA2E;KAC3E;IACD;QACC,yBAAyB;QACzB,4BAA4B;QAC5B,oBAAoB;QACpB,gCAAgC;QAChC,KAAK;QACL,sgBAAsgB;KACtgB;IACD;QACC,yBAAyB;QACzB,4BAA4B;QAC5B,iBAAiB;QACjB,gCAAgC;QAChC,IAAI;QACJ,0oBAA0oB;KAC1oB;IACD;QACC,eAAe;QACf,iBAAiB;QACjB,QAAQ;QACR,sBAAsB;QACtB,IAAI;QACJ,wWAAwW;KACxW;IACD;QACC,aAAa;QACb,eAAe;QACf,OAAO;QACP,iBAAiB;QACjB,IAAI;QACJ,glBAAglB;KAChlB;IACD;QACC,cAAc;QACd,gBAAgB;QAChB,YAAY;QACZ,gCAAgC;QAChC,IAAI;QACJ,+KAA+K;KAC/K;CACQ,CAAA;AAEV,2GAA2G;AAC3G,MAAM,UAAU,YAAY,CAAC,MAAiB,EAAE,KAA8B;IAC7E,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,GAAG,KAAK,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,YAAY,CAAC;QAAE,OAAO,KAAK,CAAA;IAC/F,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAA;IAChC,OAAO,EAAE,GAAG,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,CAAA;AACrC,CAAC"}
|
package/dist/tools.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAUH,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,kBAAkB,EAA6C,MAAM,SAAS,CAAA;AAG1G,OAA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,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,QAAQ;IACxB,kEAAkE;IAClE,GAAG,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAA;IACzD,+BAA+B;IAC/B,YAAY,EAAE,WAAW,CAAC,UAAU,CAAC,CAAA;IACrC;;;;;OAKG;IACH,MAAM,EAAE,CAAC,GAAG,EAAE,eAAe,KAAK,GAAG,CAAA;IACrC;;;;;OAKG;IACH,aAAa,CAAC,EAAE,CAAC,GAAG,EAAE,eAAe,KAAK,MAAM,CAAA;IAChD;;;;OAIG;IACH,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,eAAe,KAAK,MAAM,GAAG,SAAS,CAAA;IACxD;;;;OAIG;IACH,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,qFAAqF;IACrF,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B;;;;;OAKG;IACH,YAAY,CAAC,EAAE,CAAC,UAAU,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,eAAe,CAAC,CAAA;CAChE;AAED,+GAA+G;AAC/G,eAAO,MAAM,iBAAiB,OAAQ,CAAA;AAuFtC;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,GAAE,MAA2B,GAAG,OAAO,CAGxF;AA2uBD;;;GAGG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,GAAG,IAAI,CAw9DnE"}
|
package/dist/tools.js
CHANGED
|
@@ -39,6 +39,7 @@ import { z } from 'zod';
|
|
|
39
39
|
import { zodToJsonSchema } from 'zod-to-json-schema';
|
|
40
40
|
import { buildDevelopmentGuide, GUIDE_SECTIONS } from './development-guide.js';
|
|
41
41
|
import { DEFAULT_EXCERPT_CHARS, DocsError, getDocsIndex, MAX_EXCERPT_CHARS, MIN_EXCERPT_CHARS, searchDocs, } from './docs.js';
|
|
42
|
+
import { registerFeedbackFormTools } from './feedback-form-tools.js';
|
|
42
43
|
import { renderIconWorkflow } from './icon-workflow.js';
|
|
43
44
|
import { LANDING_LIMITS } from './landing-page.js';
|
|
44
45
|
import { LANDING_READ_SHAPE, shapeLandingRead } from './landing-read.js';
|
|
@@ -147,6 +148,7 @@ const APPROVAL_GATED_PAY = new Set([
|
|
|
147
148
|
'archivePayApp',
|
|
148
149
|
'archivePayOffer',
|
|
149
150
|
'setPaySellerProfile',
|
|
151
|
+
'setPayTrial',
|
|
150
152
|
]);
|
|
151
153
|
/** Match initialize instructions to the same capabilities used for registration. */
|
|
152
154
|
export function getServerInstructions(capabilities, auth = 'api-key') {
|
|
@@ -723,13 +725,13 @@ const TOOL_ANNOTATIONS = {
|
|
|
723
725
|
openWorldHint: true,
|
|
724
726
|
},
|
|
725
727
|
get_page_translations: {
|
|
726
|
-
title: 'Read uninstall / welcome page translations',
|
|
728
|
+
title: 'Read uninstall / feedback / welcome page translations',
|
|
727
729
|
readOnlyHint: true,
|
|
728
730
|
idempotentHint: true,
|
|
729
731
|
openWorldHint: true,
|
|
730
732
|
},
|
|
731
733
|
set_page_translations: {
|
|
732
|
-
title: 'Save translations of an uninstall / welcome page',
|
|
734
|
+
title: 'Save translations of an uninstall / feedback / welcome page',
|
|
733
735
|
readOnlyHint: false,
|
|
734
736
|
idempotentHint: true,
|
|
735
737
|
destructiveHint: false,
|
|
@@ -1620,8 +1622,8 @@ export function registerTools(server, deps) {
|
|
|
1620
1622
|
});
|
|
1621
1623
|
add({
|
|
1622
1624
|
name: 'get_page_translations',
|
|
1623
|
-
description: "The developer-written text on the project's hosted uninstall forms, welcome pages
|
|
1624
|
-
'instructions (the features list), for ' +
|
|
1625
|
+
description: "The developer-written text on the project's hosted uninstall forms, feedback forms, welcome pages " +
|
|
1626
|
+
'and install instructions (the features list), for ' +
|
|
1625
1627
|
'translation: per page {surface, publicCode, name, defaultLocale, locales, fields [{path, source, ' +
|
|
1626
1628
|
'label, max, multiline}], status per language [{locale, translated, missing, outdated}], ' +
|
|
1627
1629
|
'translations}. Languages are the project’s (manifest translations + the targetLocales decision); ' +
|
|
@@ -1629,7 +1631,8 @@ export function registerTools(server, deps) {
|
|
|
1629
1631
|
'Built-in text (buttons, reasons, footers) is translated by Extenshi into en, es, pt-BR, fr, de, ' +
|
|
1630
1632
|
'it, ru, ja, ko, zh-CN and ar and is not listed. A page is shown in the user’s browser language ' +
|
|
1631
1633
|
'when the project offers it, otherwise in defaultLocale; an untranslated or outdated field shows ' +
|
|
1632
|
-
'its original. Uninstall survey text itself is changed with update_uninstall_form
|
|
1634
|
+
'its original. Uninstall survey and feedback form text itself is changed with update_uninstall_form / ' +
|
|
1635
|
+
'update_feedback_form. Requires project.read.',
|
|
1633
1636
|
parameters: z.object({ projectId: z.string().uuid() }),
|
|
1634
1637
|
execute: async (args, context) => {
|
|
1635
1638
|
try {
|
|
@@ -1642,7 +1645,8 @@ export function registerTools(server, deps) {
|
|
|
1642
1645
|
});
|
|
1643
1646
|
add({
|
|
1644
1647
|
name: 'set_page_translations',
|
|
1645
|
-
description: 'Save one language of one uninstall form, welcome page or install instructions page:
|
|
1648
|
+
description: 'Save one language of one uninstall form, feedback form, welcome page or install instructions page: ' +
|
|
1649
|
+
'`translations` ' +
|
|
1646
1650
|
'maps field paths (from ' +
|
|
1647
1651
|
'get_page_translations) to translated text; the server records which original each translates, so ' +
|
|
1648
1652
|
'a later edit of the original marks it outdated. An empty string removes a translation. Unknown ' +
|
|
@@ -1651,7 +1655,7 @@ export function registerTools(server, deps) {
|
|
|
1651
1655
|
'hosted.write.',
|
|
1652
1656
|
parameters: z.object({
|
|
1653
1657
|
projectId: z.string().uuid(),
|
|
1654
|
-
surface: z.enum(['uninstall', 'welcome', 'instructions']),
|
|
1658
|
+
surface: z.enum(['uninstall', 'welcome', 'instructions', 'feedback']),
|
|
1655
1659
|
publicCode: z.string().max(40).describe('The page code, from get_page_translations.'),
|
|
1656
1660
|
locale: z.string().max(35).describe('BCP 47 tag or the _locales spelling (de, pt-BR, pt_BR).'),
|
|
1657
1661
|
translations: z.record(z.string().max(80), z.string().max(2000)),
|
|
@@ -1734,6 +1738,8 @@ export function registerTools(server, deps) {
|
|
|
1734
1738
|
registerLicenseTermsTools(add, bff, (err) => readError(err, missingKeyMessage), { oauth });
|
|
1735
1739
|
// list/get/update/preview_uninstall_form + find_brand_mentions (project.read / hosted.write).
|
|
1736
1740
|
registerUninstallFormTools(add, bff, (err) => readError(err, missingKeyMessage));
|
|
1741
|
+
// list/get/update/preview_feedback_form + list_feedback_responses (project.read / hosted.write).
|
|
1742
|
+
registerFeedbackFormTools(add, bff, (err) => readError(err, missingKeyMessage));
|
|
1737
1743
|
// A local filesystem exists only where local artifacts do (stdio).
|
|
1738
1744
|
const localFiles = caps.has('scan');
|
|
1739
1745
|
add({
|