@extenshi/mcp 0.7.0 → 0.9.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.
Files changed (69) hide show
  1. package/README.md +9 -4
  2. package/dist/bff.d.ts +17 -0
  3. package/dist/bff.d.ts.map +1 -1
  4. package/dist/bff.js +4 -0
  5. package/dist/bff.js.map +1 -1
  6. package/dist/development-guide.d.ts +109 -79
  7. package/dist/development-guide.d.ts.map +1 -1
  8. package/dist/development-guide.js +133 -45
  9. package/dist/development-guide.js.map +1 -1
  10. package/dist/docs.d.ts +45 -4
  11. package/dist/docs.d.ts.map +1 -1
  12. package/dist/docs.js +162 -17
  13. package/dist/docs.js.map +1 -1
  14. package/dist/icon-workflow.d.ts +5 -4
  15. package/dist/icon-workflow.d.ts.map +1 -1
  16. package/dist/icon-workflow.js +33 -32
  17. package/dist/icon-workflow.js.map +1 -1
  18. package/dist/json-ld.d.ts +89 -0
  19. package/dist/json-ld.d.ts.map +1 -0
  20. package/dist/json-ld.js +118 -0
  21. package/dist/json-ld.js.map +1 -0
  22. package/dist/landing-page.d.ts +123 -0
  23. package/dist/landing-page.d.ts.map +1 -0
  24. package/dist/landing-page.js +405 -0
  25. package/dist/landing-page.js.map +1 -0
  26. package/dist/landing-workflow.d.ts +49 -0
  27. package/dist/landing-workflow.d.ts.map +1 -0
  28. package/dist/landing-workflow.js +80 -0
  29. package/dist/landing-workflow.js.map +1 -0
  30. package/dist/localize-workflow.d.ts +6 -1
  31. package/dist/localize-workflow.d.ts.map +1 -1
  32. package/dist/localize-workflow.js +65 -47
  33. package/dist/localize-workflow.js.map +1 -1
  34. package/dist/pay.d.ts +1 -1
  35. package/dist/pay.d.ts.map +1 -1
  36. package/dist/pay.js +11 -11
  37. package/dist/pay.js.map +1 -1
  38. package/dist/privacy-ai-outcome.d.ts +21 -0
  39. package/dist/privacy-ai-outcome.d.ts.map +1 -0
  40. package/dist/privacy-ai-outcome.js +69 -0
  41. package/dist/privacy-ai-outcome.js.map +1 -0
  42. package/dist/scan.d.ts +7 -0
  43. package/dist/scan.d.ts.map +1 -1
  44. package/dist/scan.js +26 -2
  45. package/dist/scan.js.map +1 -1
  46. package/dist/search-filters.js +1 -1
  47. package/dist/search-filters.js.map +1 -1
  48. package/dist/shape.d.ts +34 -0
  49. package/dist/shape.d.ts.map +1 -1
  50. package/dist/shape.js +150 -3
  51. package/dist/shape.js.map +1 -1
  52. package/dist/telemetry.d.ts.map +1 -1
  53. package/dist/telemetry.js +3 -0
  54. package/dist/telemetry.js.map +1 -1
  55. package/dist/templates.js +5 -5
  56. package/dist/templates.js.map +1 -1
  57. package/dist/tools.d.ts +2 -1
  58. package/dist/tools.d.ts.map +1 -1
  59. package/dist/tools.js +398 -115
  60. package/dist/tools.js.map +1 -1
  61. package/dist/welcome-agent-brief.d.ts +9 -9
  62. package/dist/welcome-agent-brief.d.ts.map +1 -1
  63. package/dist/welcome-agent-brief.js +32 -32
  64. package/dist/welcome-agent-brief.js.map +1 -1
  65. package/dist/welcome-workflow.d.ts +5 -5
  66. package/dist/welcome-workflow.d.ts.map +1 -1
  67. package/dist/welcome-workflow.js +13 -14
  68. package/dist/welcome-workflow.js.map +1 -1
  69. package/package.json +3 -2
package/dist/docs.js CHANGED
@@ -156,30 +156,175 @@ export function rankSections(full, query, limit) {
156
156
  .sort((a, b) => b.score - a.score);
157
157
  return scored.slice(0, Math.max(1, limit)).map((s) => s.section);
158
158
  }
159
- /** Keep each returned section bounded; large enough to hold a full docs page. */
160
- const MAX_SECTION_CHARS = 8000;
161
- function clampSection(body) {
162
- if (body.length <= MAX_SECTION_CHARS)
163
- return body;
164
- return `${body.slice(0, MAX_SECTION_CHARS).trimEnd()}\n\n…(section truncated — open the source link for the rest)`;
159
+ const SOURCE_LINE = /^\*Source:\s*(\S+?)\*\s*$/m;
160
+ /** Split `llms-full.txt` into `##`-level passages, fence-aware, carrying the page source URL. */
161
+ export function splitPassages(full) {
162
+ const passages = [];
163
+ const urlByTitle = new Map();
164
+ for (const section of splitSections(full)) {
165
+ // The export sometimes repeats a page's H1 after its source line; the
166
+ // repeat inherits the URL recorded for the same title.
167
+ const url = SOURCE_LINE.exec(section.body)?.[1] ?? urlByTitle.get(section.title);
168
+ if (url)
169
+ urlByTitle.set(section.title, url);
170
+ const body = section.body.replace(SOURCE_LINE, '').trim();
171
+ let heading;
172
+ let lines = [];
173
+ let inFence = false;
174
+ const flush = () => {
175
+ const text = lines.join('\n').trim();
176
+ if (text || heading)
177
+ passages.push({ page: section.title, heading, url, body: text });
178
+ };
179
+ for (const line of body.split('\n')) {
180
+ if (/^\s*```/.test(line))
181
+ inFence = !inFence;
182
+ const h2 = !inFence ? /^##\s+(.+)$/.exec(line) : null;
183
+ if (h2) {
184
+ flush();
185
+ heading = h2[1].trim();
186
+ lines = [];
187
+ continue;
188
+ }
189
+ lines.push(line);
190
+ }
191
+ flush();
192
+ }
193
+ return passages;
194
+ }
195
+ /** Passages returned from one page at most, so a single long page cannot crowd out the rest. */
196
+ const MAX_PASSAGES_PER_PAGE = 2;
197
+ /** BM25 parameters: term-frequency saturation and length normalisation. */
198
+ const BM25_K1 = 1.2;
199
+ const BM25_B = 0.75;
200
+ function wordCounts(text) {
201
+ const counts = new Map();
202
+ for (const token of text.toLowerCase().split(/[^a-z0-9]+/)) {
203
+ if (token)
204
+ counts.set(token, (counts.get(token) ?? 0) + 1);
205
+ }
206
+ return counts;
207
+ }
208
+ /**
209
+ * Rank passages against a query with BM25 over passage bodies, so a long
210
+ * passage that merely repeats common words does not outrank a short one that
211
+ * answers the question. Heading and page-title matches add a bonus; hyphenated
212
+ * or long tokens (command and flag names) get a phrase boost. Pure (no I/O) so
213
+ * it is unit-testable with a fixture.
214
+ */
215
+ export function rankPassages(full, query, limit) {
216
+ const { words, phrases } = tokenize(query);
217
+ if (words.length === 0)
218
+ return [];
219
+ const indexed = splitPassages(full).map((passage, index) => {
220
+ const body = passage.body.toLowerCase();
221
+ const tf = wordCounts(body);
222
+ let len = 0;
223
+ for (const n of tf.values())
224
+ len += n;
225
+ return {
226
+ passage,
227
+ index,
228
+ body,
229
+ heading: (passage.heading ?? '').toLowerCase(),
230
+ headingWords: wordCounts(passage.heading ?? ''),
231
+ pageWords: wordCounts(passage.page),
232
+ tf,
233
+ len,
234
+ };
235
+ });
236
+ if (indexed.length === 0)
237
+ return [];
238
+ const avgLen = indexed.reduce((sum, d) => sum + d.len, 0) / indexed.length || 1;
239
+ const n = indexed.length;
240
+ const idf = (df) => Math.log(1 + (n - df + 0.5) / (df + 0.5));
241
+ const saturate = (tf, len) => (tf * (BM25_K1 + 1)) / (tf + BM25_K1 * (1 - BM25_B + (BM25_B * len) / avgLen));
242
+ const wordIdf = new Map(words.map((w) => [w, idf(indexed.filter((d) => d.tf.has(w) || d.headingWords.has(w)).length)]));
243
+ const phraseIdf = new Map(phrases.map((p) => [p, idf(indexed.filter((d) => d.body.includes(p) || d.heading.includes(p)).length)]));
244
+ const scored = indexed
245
+ .map((d) => {
246
+ let score = 0;
247
+ for (const w of words) {
248
+ const weight = wordIdf.get(w) ?? 0;
249
+ const tf = d.tf.get(w) ?? 0;
250
+ if (tf > 0)
251
+ score += weight * saturate(tf, d.len);
252
+ if (d.headingWords.has(w))
253
+ score += weight * 2;
254
+ if (d.pageWords.has(w))
255
+ score += weight;
256
+ }
257
+ for (const p of phrases) {
258
+ const weight = phraseIdf.get(p) ?? 0;
259
+ const count = countOccurrences(d.body, p);
260
+ if (count > 0)
261
+ score += weight * 1.5 * saturate(count, d.len);
262
+ if (d.heading.includes(p))
263
+ score += weight * 3;
264
+ }
265
+ return { passage: d.passage, score, index: d.index };
266
+ })
267
+ .filter((s) => s.score > 0)
268
+ .sort((a, b) => b.score - a.score || a.index - b.index);
269
+ const perPage = new Map();
270
+ const picked = [];
271
+ for (const { passage } of scored) {
272
+ if (picked.length >= Math.max(1, limit))
273
+ break;
274
+ const seen = perPage.get(passage.page) ?? 0;
275
+ if (seen >= MAX_PASSAGES_PER_PAGE)
276
+ continue;
277
+ perPage.set(passage.page, seen + 1);
278
+ picked.push(passage);
279
+ }
280
+ return picked;
281
+ }
282
+ /** Default and bounds for the per-result excerpt length (characters). */
283
+ export const DEFAULT_EXCERPT_CHARS = 1500;
284
+ export const MIN_EXCERPT_CHARS = 200;
285
+ export const MAX_EXCERPT_CHARS = 8000;
286
+ /**
287
+ * Cut a passage to `maxChars` on a line boundary. An unterminated code fence is
288
+ * closed so the rest of the response still renders as prose.
289
+ */
290
+ export function excerpt(body, maxChars) {
291
+ if (body.length <= maxChars)
292
+ return { text: body, truncated: false };
293
+ let cut = body.slice(0, maxChars);
294
+ const lastBreak = cut.lastIndexOf('\n');
295
+ if (lastBreak > maxChars / 2)
296
+ cut = cut.slice(0, lastBreak);
297
+ cut = cut.trimEnd();
298
+ const fences = cut.split('\n').filter((line) => /^\s*```/.test(line)).length;
299
+ if (fences % 2 === 1)
300
+ cut += '\n```';
301
+ return { text: cut, truncated: true };
165
302
  }
166
303
  /** Fetch the docs index (`llms.txt`) — the page list returned when no query is given. */
167
304
  export async function getDocsIndex(docsUrl) {
168
305
  return fetchCached(`${docsUrl}/llms.txt`);
169
306
  }
307
+ /** Render ranked passages: page › heading, source URL, bounded excerpt. Pure. */
308
+ export function renderPassages(query, matches, maxChars) {
309
+ if (matches.length === 0) {
310
+ return `No documentation passage matched "${query}". The full page index is returned when the query is omitted.`;
311
+ }
312
+ const blocks = matches.map((m) => {
313
+ const title = [m.page || 'Untitled', m.heading].filter(Boolean).join(' › ');
314
+ const { text, truncated } = excerpt(m.body, maxChars);
315
+ const source = m.url ? `Source: ${m.url}\n\n` : '';
316
+ const more = truncated ? `\n\n…(excerpt truncated${m.url ? `; full page: ${m.url}` : ''})` : '';
317
+ return `## ${title}\n${source}${text}${more}`;
318
+ });
319
+ return `Top ${matches.length} documentation passage(s) for "${query}":\n\n${blocks.join('\n\n---\n\n')}`;
320
+ }
170
321
  /**
171
- * Search the docs and return a formatted, LLM-friendly answer: the top matching
172
- * sections, each with its source link. Falls back to a clear "nothing matched"
173
- * note pointing at the index.
322
+ * Search the docs and return the top matching passages, each with its source
323
+ * link and a bounded excerpt. Falls back to a "nothing matched" note.
174
324
  */
175
- export async function searchDocs(docsUrl, query, limit) {
325
+ export async function searchDocs(docsUrl, query, options) {
176
326
  const full = await fetchCached(`${docsUrl}/llms-full.txt`);
177
- const matches = rankSections(full, query, limit);
178
- if (matches.length === 0) {
179
- return (`No documentation section matched "${query}". ` +
180
- 'Call search_docs with no query to list every available page, then read the relevant one.');
181
- }
182
- const blocks = matches.map((m) => `## ${m.title || 'Untitled'}\n\n${clampSection(m.body)}`);
183
- return `Top ${matches.length} documentation section(s) for "${query}":\n\n${blocks.join('\n\n---\n\n')}`;
327
+ const maxChars = Math.min(MAX_EXCERPT_CHARS, Math.max(MIN_EXCERPT_CHARS, options.maxChars ?? DEFAULT_EXCERPT_CHARS));
328
+ return renderPassages(query, rankPassages(full, query, options.limit), maxChars);
184
329
  }
185
330
  //# sourceMappingURL=docs.js.map
package/dist/docs.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"docs.js","sourceRoot":"","sources":["../src/docs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,qEAAqE;AACrE,MAAM,OAAO,SAAU,SAAQ,KAAK;IACnC,YAAY,OAAe;QAC1B,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,WAAW,CAAA;IACxB,CAAC;CACD;AAQD,MAAM,gBAAgB,GAAG,MAAM,CAAA;AAC/B,MAAM,YAAY,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAA;AAEnC,4EAA4E;AAC5E,+EAA+E;AAC/E,4EAA4E;AAC5E,2EAA2E;AAC3E,MAAM,aAAa,GAAG,yDAAyD,CAAA;AAO/E,gFAAgF;AAChF,MAAM,KAAK,GAAG,IAAI,GAAG,EAAsB,CAAA;AAE3C,wEAAwE;AACxE,SAAS,GAAG;IACX,OA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AC,EAAE,CAAA;QAClD,MAAM,IAAI,GAAG,SAAS,CAAC,CAAC,CAAC,0BAA0B,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,CAAA;QAC/F,OAAO,MAAM,KAAK,KAAK,MAAM,GAAG,IAAI,GAAG,IAAI,EAAE,CAAA;IAC9C,CAAC,CAAC,CAAA;IACF,OAAO,OAAO,OAAO,CAAC,MAAM,kCAAkC,KAAK,SAAS,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE,CAAA;AACzG,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAC/B,OAAe,EACf,KAAa,EACb,OAA0B;IAE1B,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC,GAAG,OAAO,gBAAgB,CAAC,CAAA;IAC1D,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CACxB,iBAAiB,EACjB,IAAI,CAAC,GAAG,CAAC,iBAAiB,EAAE,OAAO,CAAC,QAAQ,IAAI,qBAAqB,CAAC,CACtE,CAAA;IACD,OAAO,cAAc,CAAC,KAAK,EAAE,YAAY,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,CAAA;AACjF,CAAC"}
@@ -1,11 +1,12 @@
1
1
  /**
2
2
  * Static content for the free `generate_icon_workflow` MCP tool.
3
3
  *
4
- * The free icon path deliberately spends ZERO Extenshi tokens and touches no
5
- * Extenshi infrastructure: the coding agent draws the SVG itself, and
4
+ * The free icon path spends ZERO Extenshi tokens and touches no Extenshi
5
+ * infrastructure: the SVG master is authored locally, and
6
6
  * `@extenshi/cli icon preview` renders the verification page fully offline.
7
- * This tool exists so an agent connected through the MCP connector gets the
8
- * exact requirements and commands instead of guessing them.
7
+ * The tool returns the icon specification and the exact commands as reference
8
+ * material — requirements, file formats and a process description — written so
9
+ * a developer could read it on its own.
9
10
  *
10
11
  * Kept as a template function (not a docs fetch) so the tool works without
11
12
  * network access and never fails on a docs outage.
@@ -1 +1 @@
1
- {"version":3,"file":"icon-workflow.d.ts","sourceRoot":"","sources":["../src/icon-workflow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,MAAM,WAAW,gBAAgB;IAChC,aAAa,CAAC,EAAE,MAAM,CAAA;CACtB;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,gBAAgB,GAAG,MAAM,CA0DjE"}
1
+ {"version":3,"file":"icon-workflow.d.ts","sourceRoot":"","sources":["../src/icon-workflow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,MAAM,WAAW,gBAAgB;IAChC,aAAa,CAAC,EAAE,MAAM,CAAA;CACtB;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,gBAAgB,GAAG,MAAM,CA0DjE"}
@@ -1,11 +1,12 @@
1
1
  /**
2
2
  * Static content for the free `generate_icon_workflow` MCP tool.
3
3
  *
4
- * The free icon path deliberately spends ZERO Extenshi tokens and touches no
5
- * Extenshi infrastructure: the coding agent draws the SVG itself, and
4
+ * The free icon path spends ZERO Extenshi tokens and touches no Extenshi
5
+ * infrastructure: the SVG master is authored locally, and
6
6
  * `@extenshi/cli icon preview` renders the verification page fully offline.
7
- * This tool exists so an agent connected through the MCP connector gets the
8
- * exact requirements and commands instead of guessing them.
7
+ * The tool returns the icon specification and the exact commands as reference
8
+ * material — requirements, file formats and a process description — written so
9
+ * a developer could read it on its own.
9
10
  *
10
11
  * Kept as a template function (not a docs fetch) so the tool works without
11
12
  * network access and never fails on a docs outage.
@@ -13,44 +14,44 @@
13
14
  export function renderIconWorkflow(args) {
14
15
  const name = args.extensionName?.trim() || 'My Extension';
15
16
  const iconFile = 'icon.svg';
16
- return `# Browser-extension icon — design requirements and local workflow
17
+ return `# Browser-extension icon — specification and local workflow
17
18
 
18
- This workflow is FREE and fully local: you (the agent) draw the SVG yourself, and the
19
+ Cost and access: free and fully local. The SVG master is authored in the project, and the
19
20
  Extenshi CLI renders an offline verification page. No API key, no credits, no uploads.
20
21
 
21
- ## Icon requirements (all stores: Chrome, Firefox, Edge)
22
+ ## Icon requirements (Chrome, Firefox, Edge)
22
23
 
23
24
  - Deliverables: PNG at 16, 32, 48 and 128 px (128 px is the store-listing size), plus the
24
25
  SVG master. Chrome Web Store also uses a 440×280 promo tile.
25
- - The 16 px toolbar render is what users see most. Design for it:
26
+ - The 16 px toolbar render is the most-seen size, so the design targets it:
26
27
  - one bold silhouette, minimal interior detail, generous negative space;
27
- - no text, no thin outlines (<1.5 px at 16 px they dissolve);
28
- - keep ~1 px of breathing room to the edges (toolbar buttons crop nothing, but
28
+ - no text and no thin outlines (below 1.5 px at 16 px they dissolve);
29
+ - about 1 px of breathing room to the edges (toolbar buttons crop nothing, but
29
30
  adjacent icons sit 8–12 px away).
30
- - Must survive light AND dark toolbars: avoid mid-gray (#7a7a7a-ish) fills that melt
31
- into both themes; prefer a saturated brand color or add a contrasting outline/backdrop shape.
32
- - Single \`<svg>\` element, square viewBox (e.g. \`viewBox="0 0 24 24"\` or \`0 0 128 128\`),
33
- flat shapes, no embedded rasters, no scripts, no external references.
31
+ - Legible on light AND dark toolbars: mid-gray fills (around #7a7a7a) melt into both
32
+ themes; a saturated brand color or a contrasting outline/backdrop shape holds up.
33
+ - File format: a single \`<svg>\` element, square viewBox (e.g. \`viewBox="0 0 24 24"\` or
34
+ \`0 0 128 128\`), flat shapes, no embedded rasters, no scripts, no external references.
34
35
 
35
- ## Workflow
36
+ ## Process
36
37
 
37
- 1. **Draw the SVG yourself** — write it to \`${iconFile}\` in the project. Iterate on the
38
- silhouette at conceptual 16 px scale before adding any detail.
38
+ 1. **Author the SVG master** — saved as \`${iconFile}\` in the project. The silhouette is
39
+ settled at conceptual 16 px scale before any detail is added.
39
40
  2. **Render the verification page** (free, offline):
40
41
 
41
42
  \`\`\`bash
42
43
  npx @extenshi/cli@latest icon preview ${iconFile} --name "${name}"
43
44
  \`\`\`
44
45
 
45
- This writes a self-contained HTML file and opens it: Chrome / Firefox / Edge toolbar
46
- mockups with the icon pinned in place, switchable palettes (light, tinted, dark, black,
47
- saturated + a custom color picker) with an automatic contrast warning per palette, a
48
- store-size matrix, and an 8× pixel magnifier of the 16 px render.
49
- 3. **Ask the human to review the page.** Iterate: edit \`${iconFile}\`, re-run the command
50
- (add \`--no-open\` on re-runs; the browser tab just needs a refresh).
51
- 4. **Export** straight from the page buttons: per-size PNGs, or the ZIP containing
52
- \`icons/{16,32,48,128}.png\`, the SVG master and \`manifest-icons.json\`; there is also a
53
- copy-paste manifest snippet:
46
+ The command writes a self-contained HTML file and opens it: Chrome / Firefox / Edge
47
+ toolbar mockups with the icon pinned in place, switchable palettes (light, tinted, dark,
48
+ black, saturated, plus a custom color picker) with an automatic contrast warning per
49
+ palette, a store-size matrix, and an 8× pixel magnifier of the 16 px render.
50
+ 3. **Review and iterate.** The developer reviews the page; after each edit to \`${iconFile}\`
51
+ the same command re-renders it (\`--no-open\` on re-runs; refreshing the open tab is enough).
52
+ 4. **Export** from the page buttons: per-size PNGs, or a ZIP containing
53
+ \`icons/{16,32,48,128}.png\`, the SVG master and \`manifest-icons.json\`. The page also shows
54
+ this manifest snippet:
54
55
 
55
56
  \`\`\`json
56
57
  {
@@ -58,15 +59,15 @@ Extenshi CLI renders an offline verification page. No API key, no credits, no up
58
59
  "action": { "default_icon": { "16": "icons/16.png", "32": "icons/32.png" } }
59
60
  }
60
61
  \`\`\`
61
- 5. Unpack the exported \`icons/\` folder into the extension and reference it from
62
- \`manifest.json\` as above.
62
+ 5. **Install** — the exported \`icons/\` folder is unpacked into the extension and referenced
63
+ from \`manifest.json\` as above.
63
64
 
64
65
  ## Related
65
66
 
66
- - Hosted AI icon generation (no local agent needed) lives at
67
- https://dojo.extenshi.io/tools/icon-generator.
68
- - Uploading the finished icon into a dojo project is planned but not available yet —
69
- do not look for an upload API.
67
+ - Hosted AI icon generation (no local tooling needed): https://dojo.extenshi.io/tools/icon-generator
68
+ - Uploading a finished icon into a dojo project is planned and not available yet; there is
69
+ no upload API.
70
+ - Documentation: https://docs.extenshi.io/developers/icon-generator
70
71
  `;
71
72
  }
72
73
  //# sourceMappingURL=icon-workflow.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"icon-workflow.js","sourceRoot":"","sources":["../src/icon-workflow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAMH,MAAM,UAAU,kBAAkB,CAAC,IAAsB;IACxD,MAAM,IAAI,GAAG,IAAI,CAAC,aAAa,EAAE,IAAI,EAAE,IAAI,cAAc,CAAA;IACzD,MAAM,QAAQ,GAAG,UAAU,CAAA;IAC3B,OAAO;;;;;;;;;;;;;;;;;;;;;+CAqBuC,QAAQ;;;;;2CAKZ,QAAQ,YAAY,IAAI;;;;;;;2DAOR,QAAQ;;;;;;;;;;;;;;;;;;;;;CAqBlE,CAAA;AACD,CAAC"}
1
+ {"version":3,"file":"icon-workflow.js","sourceRoot":"","sources":["../src/icon-workflow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAMH,MAAM,UAAU,kBAAkB,CAAC,IAAsB;IACxD,MAAM,IAAI,GAAG,IAAI,CAAC,aAAa,EAAE,IAAI,EAAE,IAAI,cAAc,CAAA;IACzD,MAAM,QAAQ,GAAG,UAAU,CAAA;IAC3B,OAAO;;;;;;;;;;;;;;;;;;;;;4CAqBoC,QAAQ;;;;;2CAKT,QAAQ,YAAY,IAAI;;;;;;;kFAOe,QAAQ;;;;;;;;;;;;;;;;;;;;;CAqBzF,CAAA;AACD,CAAC"}
@@ -0,0 +1,89 @@
1
+ /**
2
+ * Schema.org SoftwareApplication JSON-LD for an extension's public site.
3
+ *
4
+ * Pure and dependency-free on purpose: the landing-page generator
5
+ * (./landing-page.ts) embeds it, and that generator ships in three places —
6
+ * dojo (through shared-types), the published @extenshi/mcp package and the
7
+ * published @extenshi/cli package. Those two cannot import workspace
8
+ * shared-types at runtime, so they carry copies of this file:
9
+ *
10
+ * shared-types/json-ld.ts (canonical — edit here)
11
+ * tools/extenshi-mcp/src/json-ld.ts (byte-identical copy)
12
+ * tools/extenshi-cli/src/json-ld.ts (byte-identical copy)
13
+ *
14
+ * `landing-page-sync.test.ts` in each package fails when a copy drifts. After
15
+ * editing, run:
16
+ * cp shared-types/json-ld.ts tools/extenshi-mcp/src/json-ld.ts
17
+ * cp shared-types/json-ld.ts tools/extenshi-cli/src/json-ld.ts
18
+ *
19
+ * `shared-types/ai-visibility.ts` re-exports everything here, so existing
20
+ * `shared-types/ai-visibility.js` imports keep working.
21
+ */
22
+ export interface JsonLdInput {
23
+ extensionName: string;
24
+ description: string;
25
+ websiteUrl?: string;
26
+ authorName?: string;
27
+ chromeUrl?: string;
28
+ firefoxUrl?: string;
29
+ edgeUrl?: string;
30
+ privacyPolicyUrl?: string;
31
+ /** Free (default) vs paid. Paid still omits a number — we are not the store. */
32
+ offersPrice?: '0' | 'paid';
33
+ capabilities?: string[];
34
+ /** ISO date; omitted when blank. */
35
+ datePublished?: string;
36
+ /** Absolute https screenshot URLs; anything else is dropped. */
37
+ screenshots?: string[];
38
+ }
39
+ export interface SoftwareApplicationJsonLd {
40
+ '@context': 'https://schema.org';
41
+ '@type': 'SoftwareApplication';
42
+ name: string;
43
+ description?: string;
44
+ url?: string;
45
+ applicationCategory: 'BrowserApplication';
46
+ operatingSystem?: string;
47
+ author?: {
48
+ '@type': 'Organization';
49
+ name: string;
50
+ };
51
+ offers?: {
52
+ '@type': 'Offer';
53
+ price: string;
54
+ priceCurrency: 'USD';
55
+ };
56
+ installUrl?: string;
57
+ sameAs?: string[];
58
+ featureList?: string[];
59
+ privacyPolicy?: string;
60
+ screenshot?: string[];
61
+ }
62
+ /**
63
+ * Schema.org SoftwareApplication. Only fields we have evidence for are emitted —
64
+ * empty author / URL / install links are omitted rather than faked.
65
+ */
66
+ export declare function generateJsonLd(input: JsonLdInput): SoftwareApplicationJsonLd;
67
+ export declare function generateJsonLdSnippet(input: JsonLdInput): string;
68
+ /**
69
+ * A `<script type="application/ld+json">` tag safe to drop into HTML.
70
+ * `<` is escaped so a description cannot close the script element.
71
+ */
72
+ export declare function jsonLdScriptTag(input: JsonLdInput): string;
73
+ /** Map a landing-page form onto JSON-LD without a second source of truth. */
74
+ export declare function jsonLdFromLanding(input: {
75
+ extensionName: string;
76
+ tagline: string;
77
+ description: string;
78
+ storeUrls: Partial<Record<'chrome' | 'firefox' | 'edge', string>>;
79
+ features: {
80
+ title: string;
81
+ description: string;
82
+ }[];
83
+ privacyPolicyUrl: string;
84
+ /** Canonical URL of the landing page itself (JSON-LD `url`). */
85
+ homepageUrl?: string;
86
+ /** Absolute https screenshot URLs (JSON-LD `screenshot`). */
87
+ screenshots?: string[];
88
+ }): JsonLdInput;
89
+ //# sourceMappingURL=json-ld.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json-ld.d.ts","sourceRoot":"","sources":["../src/json-ld.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,MAAM,WAAW,WAAW;IAC3B,aAAa,EAAE,MAAM,CAAA;IACrB,WAAW,EAAE,MAAM,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,gFAAgF;IAChF,WAAW,CAAC,EAAE,GAAG,GAAG,MAAM,CAAA;IAC1B,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;IACvB,oCAAoC;IACpC,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,gEAAgE;IAChE,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;CACtB;AAED,MAAM,WAAW,yBAAyB;IACz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ClD,gBAAgB,EAAE,MAAM,CAAA;IACxB,gEAAgE;IAChE,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,6DAA6D;IAC7D,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;CACtB,GAAG,WAAW,CAqBd"}
@@ -0,0 +1,118 @@
1
+ /**
2
+ * Schema.org SoftwareApplication JSON-LD for an extension's public site.
3
+ *
4
+ * Pure and dependency-free on purpose: the landing-page generator
5
+ * (./landing-page.ts) embeds it, and that generator ships in three places —
6
+ * dojo (through shared-types), the published @extenshi/mcp package and the
7
+ * published @extenshi/cli package. Those two cannot import workspace
8
+ * shared-types at runtime, so they carry copies of this file:
9
+ *
10
+ * shared-types/json-ld.ts (canonical — edit here)
11
+ * tools/extenshi-mcp/src/json-ld.ts (byte-identical copy)
12
+ * tools/extenshi-cli/src/json-ld.ts (byte-identical copy)
13
+ *
14
+ * `landing-page-sync.test.ts` in each package fails when a copy drifts. After
15
+ * editing, run:
16
+ * cp shared-types/json-ld.ts tools/extenshi-mcp/src/json-ld.ts
17
+ * cp shared-types/json-ld.ts tools/extenshi-cli/src/json-ld.ts
18
+ *
19
+ * `shared-types/ai-visibility.ts` re-exports everything here, so existing
20
+ * `shared-types/ai-visibility.js` imports keep working.
21
+ */
22
+ function httpUrl(raw) {
23
+ const u = (raw ?? '').trim();
24
+ return /^https?:\/\//i.test(u) ? u : null;
25
+ }
26
+ const OS_FOR = {
27
+ chrome: 'Chrome',
28
+ firefox: 'Firefox',
29
+ edge: 'Microsoft Edge',
30
+ };
31
+ /**
32
+ * Schema.org SoftwareApplication. Only fields we have evidence for are emitted —
33
+ * empty author / URL / install links are omitted rather than faked.
34
+ */
35
+ export function generateJsonLd(input) {
36
+ const name = input.extensionName.trim() || 'Extension';
37
+ const description = input.description.trim();
38
+ const site = httpUrl(input.websiteUrl);
39
+ const author = (input.authorName ?? '').trim();
40
+ const chrome = httpUrl(input.chromeUrl);
41
+ const firefox = httpUrl(input.firefoxUrl);
42
+ const edge = httpUrl(input.edgeUrl);
43
+ const privacy = httpUrl(input.privacyPolicyUrl);
44
+ const features = (input.capabilities ?? []).map((c) => c.trim()).filter(Boolean);
45
+ const screenshots = (input.screenshots ?? []).map((s) => s.trim()).filter((s) => /^https:\/\/\S+$/i.test(s));
46
+ const sameAs = [chrome, firefox, edge].filter((u) => Boolean(u));
47
+ const os = [
48
+ chrome ? OS_FOR.chrome : null,
49
+ firefox ? OS_FOR.firefox : null,
50
+ edge ? OS_FOR.edge : null,
51
+ ].filter((x) => Boolean(x));
52
+ const json = {
53
+ '@context': 'https://schema.org',
54
+ '@type': 'SoftwareApplication',
55
+ name,
56
+ applicationCategory: 'BrowserApplication',
57
+ };
58
+ if (description)
59
+ json.description = description;
60
+ if (site)
61
+ json.url = site;
62
+ if (os.length > 0)
63
+ json.operatingSystem = os.join(', ');
64
+ if (author)
65
+ json.author = { '@type': 'Organization', name: author };
66
+ if (input.offersPrice !== 'paid') {
67
+ json.offers = { '@type': 'Offer', price: '0', priceCurrency: 'USD' };
68
+ }
69
+ if (sameAs[0])
70
+ json.installUrl = sameAs[0];
71
+ if (sameAs.length > 0)
72
+ json.sameAs = sameAs;
73
+ if (features.length > 0)
74
+ json.featureList = features;
75
+ if (privacy)
76
+ json.privacyPolicy = privacy;
77
+ if (screenshots.length > 0)
78
+ json.screenshot = screenshots;
79
+ return json;
80
+ }
81
+ export function generateJsonLdSnippet(input) {
82
+ return `${JSON.stringify(generateJsonLd(input), null, 2)}\n`;
83
+ }
84
+ /**
85
+ * A `<script type="application/ld+json">` tag safe to drop into HTML.
86
+ * `<` is escaped so a description cannot close the script element.
87
+ */
88
+ export function jsonLdScriptTag(input) {
89
+ const body = JSON.stringify(generateJsonLd(input)).replace(/</g, '\\u003c');
90
+ return `<script type="application/ld+json">${body}</script>`;
91
+ }
92
+ /** Map a landing-page form onto JSON-LD without a second source of truth. */
93
+ export function jsonLdFromLanding(input) {
94
+ const capabilities = input.features
95
+ .map((f) => {
96
+ const title = f.title.trim();
97
+ const desc = f.description.trim();
98
+ if (!title)
99
+ return '';
100
+ return desc ? `${title}: ${desc}` : title;
101
+ })
102
+ .filter(Boolean);
103
+ const out = {
104
+ extensionName: input.extensionName,
105
+ description: input.description.trim() || input.tagline.trim(),
106
+ chromeUrl: input.storeUrls.chrome,
107
+ firefoxUrl: input.storeUrls.firefox,
108
+ edgeUrl: input.storeUrls.edge,
109
+ privacyPolicyUrl: input.privacyPolicyUrl,
110
+ capabilities,
111
+ };
112
+ if (input.homepageUrl)
113
+ out.websiteUrl = input.homepageUrl;
114
+ if (input.screenshots && input.screenshots.length > 0)
115
+ out.screenshots = input.screenshots;
116
+ return out;
117
+ }
118
+ //# sourceMappingURL=json-ld.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json-ld.js","sourceRoot":"","sources":["../src/json-ld.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAqCH,SAAS,OAAO,CAAC,GAAuB;IACvC,MAAM,CAAC,GAAG,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAA;IAC5B,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;AAC1C,CAAC;AAED,MAAM,MAAM,GAA2B;IACtC,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,gBAAgB;CACtB,CAAA;AAED;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,KAAkB;IAChD,MAAM,IAAI,GAAG,KAAK,CAAC,aAAa,CAAC,IAAI,EAAE,IAAI,WAAW,CAAA;IACtD,MAAM,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC,IAAI,EAAE,CAAA;IAC5C,MAAM,IAAI,GAAG,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,CAAA;IACtC,MAAM,MAAM,GAAG,CAAC,KAAK,CAAC,UAAU,IAAI,EAAE,CAAC,CA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