@extenshi/mcp 0.6.0 → 0.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.
Files changed (50) hide show
  1. package/README.md +35 -3
  2. package/dist/bff.d.ts +35 -5
  3. package/dist/bff.d.ts.map +1 -1
  4. package/dist/bff.js +15 -0
  5. package/dist/bff.js.map +1 -1
  6. package/dist/development-guide.d.ts +118 -76
  7. package/dist/development-guide.d.ts.map +1 -1
  8. package/dist/development-guide.js +151 -44
  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/localize-workflow.d.ts +8 -0
  19. package/dist/localize-workflow.d.ts.map +1 -0
  20. package/dist/localize-workflow.js +105 -0
  21. package/dist/localize-workflow.js.map +1 -0
  22. package/dist/pay.d.ts +214 -0
  23. package/dist/pay.d.ts.map +1 -0
  24. package/dist/pay.js +202 -0
  25. package/dist/pay.js.map +1 -0
  26. package/dist/search-filters.js +1 -1
  27. package/dist/search-filters.js.map +1 -1
  28. package/dist/shape.d.ts +34 -0
  29. package/dist/shape.d.ts.map +1 -1
  30. package/dist/shape.js +150 -3
  31. package/dist/shape.js.map +1 -1
  32. package/dist/templates.js +5 -5
  33. package/dist/templates.js.map +1 -1
  34. package/dist/tools.d.ts +2 -1
  35. package/dist/tools.d.ts.map +1 -1
  36. package/dist/tools.js +333 -106
  37. package/dist/tools.js.map +1 -1
  38. package/dist/welcome-agent-brief.d.ts +9 -9
  39. package/dist/welcome-agent-brief.d.ts.map +1 -1
  40. package/dist/welcome-agent-brief.js +32 -32
  41. package/dist/welcome-agent-brief.js.map +1 -1
  42. package/dist/welcome-workflow.d.ts +5 -5
  43. package/dist/welcome-workflow.d.ts.map +1 -1
  44. package/dist/welcome-workflow.js +13 -14
  45. package/dist/welcome-workflow.js.map +1 -1
  46. package/package.json +10 -8
  47. package/dist/project-workspace.d.ts +0 -1976
  48. package/dist/project-workspace.d.ts.map +0 -1
  49. package/dist/project-workspace.js +0 -350
  50. package/dist/project-workspace.js.map +0 -1
@@ -4,21 +4,21 @@ export const DEVELOPMENT_GUIDE_URL = docs('development-workflow');
4
4
  export const DEVELOPMENT_SERVICES = [
5
5
  {
6
6
  id: 'documentation',
7
- purpose: 'Discover capabilities, extension shapes, exact CLI commands and reusable agent skills.',
7
+ purpose: 'Capabilities, extension shapes, exact CLI commands and reusable skill packages.',
8
8
  tools: ['get_development_guide', 'search_docs', 'list_extension_templates'],
9
- access: 'Free guidance; no API key. Hosted transport still requires connector sign-in.',
9
+ access: 'Free reference; no API key. Hosted transport still requires connector sign-in.',
10
10
  urls: [docs('mcp'), DEVELOPMENT_GUIDE_URL, docs('agent-skills')],
11
11
  },
12
12
  {
13
13
  id: 'account',
14
- purpose: 'Sign in, provision an API key for local tools and check credit pools before paid work.',
14
+ purpose: 'Sign-in, API keys for local tools and credit-pool balances ahead of paid work.',
15
15
  tools: ['get_credit_balance', 'connection_diagnostics'],
16
16
  access: 'Balance lookup is free and requires identity; catalog reads and scans use credit pools.',
17
17
  urls: [docs('scan-credits'), 'https://dojo.extenshi.io/api-keys', 'https://dojo.extenshi.io/billing'],
18
18
  },
19
19
  {
20
20
  id: 'research',
21
- purpose: 'Validate demand, competitors, user complaints, permissions and existing security findings.',
21
+ purpose: 'Demand, competitors, user complaints, permissions and existing security findings.',
22
22
  tools: [
23
23
  'search_extensions',
24
24
  'get_extension',
@@ -27,12 +27,12 @@ export const DEVELOPMENT_SERVICES = [
27
27
  'get_risk_by_store_ids',
28
28
  'market_overview',
29
29
  ],
30
- access: 'Identity required. Catalog tools cost 1 read per call; get_security costs 3. Bulk risk: up to 40 per call. Chrome review text is unavailable; use its aggregate.',
30
+ access: 'Identity required. Catalog tools cost 1 read per call; get_security costs 3. Bulk risk: up to 40 per call. Chrome review text is unavailable; its aggregate rating is available.',
31
31
  urls: [docs('mcp'), 'https://catalog.extenshi.io'],
32
32
  },
33
33
  {
34
34
  id: 'projects',
35
- purpose: 'Read an existing project, selected browser types, manifests, repository binding, saved tool state, hosted URLs and starter files.',
35
+ purpose: 'Existing projects: selected browser types, manifests, repository binding, saved tool state, hosted URLs and starter files.',
36
36
  tools: [
37
37
  'list_my_projects',
38
38
  'get_project_state',
@@ -42,9 +42,14 @@ export const DEVELOPMENT_SERVICES = [
42
42
  'diff_project_state',
43
43
  'apply_project_patch',
44
44
  'record_project_evidence',
45
+ 'create_ci_ingest_secret',
46
+ 'upsert_hosted_page',
47
+ 'verify_hosted_artifact',
48
+ 'remove_hosted_page',
49
+ 'list_hosted_pages',
45
50
  'get_release_readiness',
46
51
  ],
47
- access: 'Own-project MCP reads are free and require identity. Create projects in the cabinet. Synchronize repository metadata, source/built manifests and scope with typed revisioned patches. project.write and evidence.write require explicit OAuth consent. Repository metadata does not grant GitHub access. Automated release-readiness access requires a Pro project.',
52
+ access: 'Own-project MCP reads are free and require identity. Projects are created in the cabinet. Repository metadata, source/built manifests and scope synchronize through typed revisioned patches. project.write, evidence.write and hosted.write require explicit OAuth consent. Repository metadata does not grant GitHub access. CI evidence (source=ci) is written only by the verified ingest endpoint, which authenticates with a secret from create_ci_ingest_secret. Automated release-readiness access requires a Pro project.',
48
53
  urls: [
49
54
  DEVELOPMENT_GUIDE_URL,
50
55
  'https://dojo.extenshi.io/projects',
@@ -53,21 +58,28 @@ export const DEVELOPMENT_SERVICES = [
53
58
  },
54
59
  {
55
60
  id: 'manifest',
56
- purpose: 'Choose minimum permissions, target browsers and manifest entries; validate every referenced file.',
61
+ purpose: 'Minimum permissions, target browsers and manifest entries, with every referenced file present.',
57
62
  tools: ['list_extension_templates', 'get_project_state', 'get_project_scaffold'],
58
- access: 'Free template guidance; project reads require identity. The cabinet also has a manifest editor.',
63
+ access: 'Free template reference; project reads require identity. The cabinet also has a manifest editor.',
59
64
  urls: [docs('manifest-generator'), toolPage('manifest-generator')],
60
65
  },
66
+ {
67
+ id: 'localization',
68
+ purpose: 'Local translation of extension messages and validation of the resulting locales.',
69
+ tools: ['localize_workflow'],
70
+ access: "Free static reference; local CLI validation requires no key or Extenshi credits. Translation uses the developer's own provider. CLI release availability is part of the reference.",
71
+ urls: [docs('localization')],
72
+ },
61
73
  {
62
74
  id: 'icons',
63
- purpose: 'Design the SVG, preview at toolbar sizes and export store assets with the local CLI.',
75
+ purpose: 'SVG icon design, toolbar-size preview and store-asset export with the local CLI.',
64
76
  tools: ['generate_icon_workflow'],
65
- access: 'Free workflow. Drawing, browser preview and file export happen in the local agent environment; the cabinet offers its own icon generator subject to availability and credits.',
77
+ access: 'Free. Drawing, browser preview and file export happen locally; the cabinet offers its own icon generator subject to availability and credits.',
66
78
  urls: [docs('icon-generator'), toolPage('icon-generator')],
67
79
  },
68
80
  {
69
81
  id: 'privacy',
70
- purpose: 'Describe actual data practices; generate/export a policy or maintain a hosted policy and its version history.',
82
+ purpose: 'A policy that reflects actual data practices: generated and exported, or hosted with version history.',
71
83
  tools: [
72
84
  'list_privacy_policy_versions',
73
85
  'get_privacy_policy_version',
@@ -79,9 +91,9 @@ export const DEVELOPMENT_SERVICES = [
79
91
  },
80
92
  {
81
93
  id: 'onboarding',
82
- purpose: 'Prepare a welcome page, pin guide, install instructions and uninstall survey; wire verified URLs into the extension.',
94
+ purpose: 'Welcome page, pin guide, install instructions and uninstall survey, with verified URLs wired into the extension.',
83
95
  tools: ['generate_welcome_page_workflow', 'get_project_state'],
84
- access: 'Free welcome-page brief. Edit, host and inspect responses in the cabinet where enabled; account/project limits apply. MCP returns guidance and saved state, not a page-publishing tool.',
96
+ access: 'Free welcome-page specification. Editing, hosting and responses live in the cabinet where enabled; account/project limits apply. MCP returns specifications and saved state; it has no page-publishing tool.',
85
97
  urls: [
86
98
  DEVELOPMENT_GUIDE_URL,
87
99
  docs('pin-guide'),
@@ -94,9 +106,9 @@ export const DEVELOPMENT_SERVICES = [
94
106
  },
95
107
  {
96
108
  id: 'listing-and-marketing',
97
- purpose: 'Prepare listing copy, screenshots, landing page, support links and AI discovery assets.',
109
+ purpose: 'Listing copy, screenshots, landing page, support links and AI discovery assets.',
98
110
  tools: [],
99
- access: 'Use CLI generate-listing / review-risk and cabinet tools where enabled. MCP has no listing, landing-page or SEO execution tool.',
111
+ access: 'Covered by CLI generate-listing / review-risk and cabinet tools where enabled. MCP has no listing, landing-page or SEO execution tool.',
100
112
  urls: [
101
113
  docs('cli'),
102
114
  docs('ai-visibility'),
@@ -108,23 +120,23 @@ export const DEVELOPMENT_SERVICES = [
108
120
  },
109
121
  {
110
122
  id: 'verification-and-ci',
111
- purpose: 'Test the built extension in each target browser, review store risks, scan the final package and retain reports in CI.',
123
+ purpose: 'Testing the built extension in each target browser, store-risk review, final package scan and CI report retention.',
112
124
  tools: ['scan_extension'],
113
- access: 'Scan requires a local artifact and API key, and spends 1 scan credit. CLI review-risk is local. Configure GitHub Actions in the repository; browser tests use the agent environment.',
125
+ access: 'Scan requires a local artifact and API key, and spends 1 scan credit. CLI review-risk is local. GitHub Actions is configured in the repository; browser tests run in the local environment.',
114
126
  urls: [docs('cli'), docs('cli-github-actions'), docs('store-policies')],
115
127
  },
116
128
  {
117
129
  id: 'publishing',
118
- purpose: 'Validate store credentials, submit the exact tested package and verify review status and the public listing.',
130
+ purpose: 'Store credential validation, submission of the exact tested package, and verification of review status and the public listing.',
119
131
  tools: ['publish_extension'],
120
132
  access: 'Local stdio or CLI with local store credentials; publishing access is checked. Store registration, disclosures and review are separate steps. Upload success alone does not establish a live release.',
121
133
  urls: [docs('cli'), docs('publish-to-chrome-web-store'), toolPage('publish')],
122
134
  },
123
135
  {
124
136
  id: 'maintenance',
125
- purpose: 'Claim the listing, respond to findings, inspect reviews/uninstall feedback, update policies and maintain releases.',
137
+ purpose: 'Listing claims, finding responses, reviews and uninstall feedback, policy updates and ongoing releases.',
126
138
  tools: ['get_reviews', 'get_security', 'get_project_state'],
127
- access: 'Catalog reads are metered. Ownership, declarations, responses, badges and feedback management use the cabinet; consult account access.',
139
+ access: 'Catalog reads are metered. Ownership, declarations, responses, badges and feedback management live in the cabinet and depend on account access.',
128
140
  urls: [
129
141
  docs('claim-your-extension'),
130
142
  docs('respond-to-findings'),
@@ -136,64 +148,126 @@ export const DEVELOPMENT_SERVICES = [
136
148
  {
137
149
  id: 'monetization',
138
150
  purpose: 'Optional paid-feature integration: seller setup, offers, checkout, signed entitlements and purchase verification.',
139
- tools: [],
140
- access: 'Conditional integration, not a callable MCP service. Verify current SDK distribution, project access, seller agreement and payment readiness in the documentation and cabinet before planning installation or promising working payments.',
141
- urls: [docs('pay-sdk'), 'https://dojo.extenshi.io/projects'],
151
+ tools: [
152
+ 'list_pay_apps',
153
+ 'create_pay_app',
154
+ 'get_pay_app',
155
+ 'get_pay_readiness',
156
+ 'link_pay_app',
157
+ 'unlink_pay_app',
158
+ 'archive_pay_app',
159
+ 'export_pay_data',
160
+ 'get_pay_seller',
161
+ 'connect_pay_seller',
162
+ 'refresh_pay_seller',
163
+ 'set_pay_seller_profile',
164
+ 'upsert_pay_offer',
165
+ 'archive_pay_offer',
166
+ 'set_pay_enabled',
167
+ 'rotate_pay_key',
168
+ ],
169
+ access: 'Pay applications work independently of development projects. Explicit pay.read/pay.write permission is required; older connections and API keys have no Pay grant. Readiness (get_pay_readiness) and the actual SDK distribution determine whether integration is possible. The author completes the seller agreement and Stripe KYC in the browser. Checkout is enabled only after offers and profile are configured, and only with explicit authorization. Registration does not prove production deployment or npm publication.',
170
+ urls: [docs('pay-sdk'), 'https://dojo.extenshi.io/payments'],
142
171
  },
143
172
  ];
173
+ /**
174
+ * The development lifecycle as a process description. `actions` describes what
175
+ * the stage consists of; `relatedTools` is a factual list of the tools that
176
+ * cover it (not an instruction to call them); `doneWhen` is the exit criterion.
177
+ */
144
178
  const WORKFLOW = [
145
179
  {
146
180
  id: 'scope',
147
- actions: 'Record the user problem, target sites and browsers, MVP, permissions/data needs, acceptance criteria, distribution and optional monetization. Inspect available tools with get_development_guide; use search_docs for current details. Keep deferred features out of release promises.',
181
+ actions: 'Stage 1 — Scope: the user problem, target sites and browsers, MVP, permissions/data needs, acceptance criteria, distribution and optional monetization are written down. Deferred features stay out of release promises.',
182
+ relatedTools: ['get_development_guide', 'search_docs'],
148
183
  doneWhen: 'A written scope and acceptance checklist cover implementation, testing, assets, release and maintenance.',
149
184
  },
150
185
  {
151
186
  id: 'research',
152
- actions: 'If market research is needed, check get_credit_balance, then search_extensions / market_overview, get_extension and get_reviews for a small relevant set. Use get_security for detailed findings or get_risk_by_store_ids for a batch. Record gaps and constraints.',
153
- doneWhen: 'The chosen feature and supported surfaces have evidence; optional research is marked skipped with a reason.',
187
+ actions: 'Stage 2 — Research (optional): demand, competitors, user complaints and security findings for a small relevant set of existing extensions; gaps and constraints are recorded. Catalog reads are metered, so the credit balance matters here.',
188
+ relatedTools: [
189
+ 'get_credit_balance',
190
+ 'search_extensions',
191
+ 'market_overview',
192
+ 'get_extension',
193
+ 'get_reviews',
194
+ 'get_security',
195
+ 'get_risk_by_store_ids',
196
+ ],
197
+ doneWhen: 'The chosen feature and supported surfaces have evidence; skipped research is recorded as skipped with a reason.',
154
198
  },
155
199
  {
156
200
  id: 'project-and-repository',
157
- actions: 'With identity, call list_my_projects then get_project_state for the selected project. Reuse its repository. If no project exists, create/configure one in dojo where available; otherwise continue locally and record that integration is pending. Create or reuse a Git remote, preferably GitHub, before substantial implementation.',
201
+ actions: 'Stage 3 — Project and repository: an existing dojo project and its bound repository are reused. Without a project, one is created in dojo where available, or work continues locally with integration recorded as pending. A Git remote (GitHub preferred) exists before substantial implementation.',
202
+ relatedTools: ['list_my_projects', 'get_project_state'],
158
203
  doneWhen: 'Project ID (or explicit pending status), repository URL, branch, README, build commands and release checklist are recorded.',
159
204
  },
160
205
  {
161
206
  id: 'architecture-and-scaffold',
162
- actions: 'Call list_extension_templates, choose minimum permissions and browser-specific files. For a new project call get_project_scaffold once per browser into separate outputs; preserve existing code when integrating an existing repository. Read includeToolStates only for needed keys. Write integration.file verbatim to integration.path, review integration.unwired and re-read state after cabinet changes.',
207
+ actions: 'Stage 4 — Architecture and scaffold: extension types, minimum permissions and browser-specific files are chosen. A new project gets one scaffold per browser in separate outputs; an existing repository keeps its code. Tool states are read only for the keys the extension needs. integration.file is written verbatim to integration.path, integration.unwired lists what is still unconnected, and project state is re-read after cabinet changes.',
208
+ relatedTools: ['list_extension_templates', 'get_project_scaffold', 'get_project_state'],
163
209
  doneWhen: 'Each manifest references real packaged files; browser variants and the project integration contract are preserved.',
164
210
  },
165
211
  {
166
212
  id: 'implementation',
167
- actions: 'Implement the MVP, accessible popup/options, storage and error handling. Test actual target sites and extension lifecycle, including service-worker restart and permission denial. Plan localization. If payments or user accounts are needed, verify the supported integration and complete its prerequisites before depending on it.',
213
+ actions: 'Stage 5 — Implementation: the MVP, accessible popup/options, storage and error handling, tested on the actual target sites and across the extension lifecycle, including service-worker restart and permission denial. Localization covers message translation, structural validation and manual language/RTL review. Payments or user accounts depend on a verified supported integration with its prerequisites complete.',
214
+ relatedTools: ['localize_workflow'],
168
215
  doneWhen: 'Acceptance criteria pass on real target surfaces; optional integrations have end-to-end evidence or remain explicit blockers.',
169
216
  },
170
217
  {
171
218
  id: 'assets-and-hosted-pages',
172
- actions: "Use generate_icon_workflow and generate_welcome_page_workflow as needed. Prepare screenshots, pin/install instructions, a privacy policy, uninstall feedback, support and landing URLs. For an existing Pro policy, list/read versions, then update_privacy_policy_with_ai when needed, review proposedMarkdown and publish within the author's authorization. Re-read get_project_state and verify the returned URLs.",
219
+ actions: "Stage 6 — Assets and hosted pages: icon, welcome page, screenshots, pin/install instructions, privacy policy, uninstall feedback, support and landing URLs. An existing Pro policy is updated as a reviewed proposal (proposedMarkdown) and published within the author's authorization. Returned URLs are verified against project state.",
220
+ relatedTools: [
221
+ 'generate_icon_workflow',
222
+ 'generate_welcome_page_workflow',
223
+ 'list_privacy_policy_versions',
224
+ 'get_privacy_policy_version',
225
+ 'update_privacy_policy_with_ai',
226
+ 'publish_privacy_policy',
227
+ 'get_project_state',
228
+ ],
173
229
  doneWhen: 'Assets show the real product; hosted links load and match actual data practices; installation/uninstallation flows work.',
174
230
  },
175
231
  {
176
232
  id: 'quality-and-listing',
177
- actions: 'Build each browser package; run unit/integration checks and manual browser scenarios. Get exact review-risk and generate-listing commands from search_docs; review disclosures, permission justifications, listing copy and screenshots against the build. Run scan_extension if available, otherwise the local CLI. Add CI using cli-github-actions docs.',
233
+ actions: 'Stage 7 — Quality and listing: each browser package is built; unit/integration checks and manual browser scenarios run. Disclosures, permission justifications, listing copy and screenshots are reviewed against the build (CLI review-risk and generate-listing; exact commands in the CLI docs). The final package is scanned, and CI follows the cli-github-actions docs.',
234
+ relatedTools: ['search_docs', 'scan_extension'],
178
235
  doneWhen: 'The exact versioned artifact has passing checks, retained scan/review reports and truthful store materials; unresolved findings have a disposition.',
179
236
  },
180
237
  {
181
238
  id: 'release',
182
- actions: "Verify store accounts, credentials and submission access; use publish_extension with validate_only first when available. Submit the tested artifact within the user's publishing authorization through local MCP, CLI or the store console. Record upload, submission, approval and public-listing status separately.",
239
+ actions: "Stage 8 — Release: store accounts, credentials and submission access are verified; a validate-only run precedes submission where available. The tested artifact is submitted within the user's publishing authorization through local MCP, CLI or the store console. Upload, submission, approval and public-listing status are recorded separately.",
240
+ relatedTools: ['publish_extension'],
183
241
  doneWhen: 'Store status and installed version are verified; pending store review is reported as pending, with artifact and source commit recorded.',
184
242
  },
185
243
  {
186
244
  id: 'operate',
187
- actions: 'Claim the catalog listing, maintain declarations and a security badge, review findings and uninstall feedback, verify optional purchase/license flows, and plan updates. Repeat build, review, scan, policy and release checks for later versions.',
245
+ actions: 'Stage 9 — Operate: catalog listing claim, declarations and security badge, findings and uninstall feedback, optional purchase/license flow checks, and planned updates. Later versions repeat the build, review, scan, policy and release checks.',
246
+ relatedTools: ['get_reviews', 'get_security', 'get_project_state'],
188
247
  doneWhen: 'A handoff records repository/commit, artifacts, URLs, checks, remaining blockers, support owner and follow-up work.',
189
248
  },
190
249
  ];
191
- export function buildDevelopmentGuide(registeredTools) {
250
+ /** Top-level sections of the full guide, selectable via the `sections` parameter. */
251
+ export const GUIDE_SECTIONS = [
252
+ 'tools',
253
+ 'localActions',
254
+ 'services',
255
+ 'repository',
256
+ 'workflow',
257
+ 'handoff',
258
+ ];
259
+ const SECTION_SUMMARIES = {
260
+ tools: 'Every tool registered on this connection: description, read-only/destructive hints and docs links.',
261
+ localActions: 'Artifact scan and store publishing: availability on this connection and the local fallback.',
262
+ services: 'Service directory: purpose, related tools, access requirements and URLs per lifecycle area.',
263
+ repository: 'Git repository recommendation, setup, layout and secret-handling practice.',
264
+ workflow: 'The nine lifecycle stages with descriptions, related tools and exit criteria.',
265
+ handoff: 'Items a completed handoff records.',
266
+ };
267
+ const AVAILABILITY = 'Tool lists describe the tools registered on THIS connection. Registration does not prove account access, remaining credits or local prerequisites. Service URLs describe where work happens; account/project access is checked live. Exact input schemas come from MCP tools/list. This guide makes no network calls.';
268
+ function buildSections(registeredTools) {
192
269
  const names = new Set(registeredTools.map((tool) => tool.name));
193
270
  return {
194
- schemaVersion: 1,
195
- documentation: DEVELOPMENT_GUIDE_URL,
196
- availability: 'tools lists the tools registered on THIS connection. Registration does not prove account access, remaining credits or local prerequisites. Service URLs describe where work happens; check live account/project access. Use MCP tools/list for the exact input schemas. This guide makes no network calls.',
197
271
  tools: registeredTools.map((tool) => ({
198
272
  ...tool,
199
273
  docs: [
@@ -203,7 +277,7 @@ export function buildDevelopmentGuide(registeredTools) {
203
277
  localActions: ['scan_extension', 'publish_extension'].map((name) => ({
204
278
  name,
205
279
  availableInThisConnection: names.has(name),
206
- fallback: 'Use local @extenshi/mcp (stdio), or npx @extenshi/cli@latest on the machine holding the artifact. Read search_docs for exact commands and prerequisites.',
280
+ fallback: 'Available through local @extenshi/mcp (stdio), or npx @extenshi/cli@latest on the machine holding the artifact. Exact commands and prerequisites: the CLI documentation.',
207
281
  docs: docs('cli'),
208
282
  })),
209
283
  services: DEVELOPMENT_SERVICES.map(({ tools, ...service }) => ({
@@ -211,18 +285,18 @@ export function buildDevelopmentGuide(registeredTools) {
211
285
  toolsInThisConnection: tools.filter((name) => names.has(name)),
212
286
  })),
213
287
  repository: {
214
- recommendation: 'Keep source in a developer-owned Git repository; prefer GitHub for the existing dojo integration and GitHub Actions. Reuse the bound repository. GitLab, Bitbucket or self-hosted Git also work with local code and CI; their automatic dojo binding is not provided by these MCP tools.',
215
- setup: "Choose repository owner and visibility with the developer; use a private repository unless public source is intended. Connect GitHub at https://dojo.extenshi.io/integrations and select the repository in the project where enabled. Repository creation/writes use GitHub, its connector/CLI or the cabinet, with the user's authorization.",
288
+ recommendation: 'Source lives in a developer-owned Git repository; GitHub fits the existing dojo integration and GitHub Actions. An already-bound repository is reused. GitLab, Bitbucket or self-hosted Git also work with local code and CI; automatic dojo binding for them is not provided by these MCP tools.',
289
+ setup: "Repository owner and visibility are the developer's choice; private unless public source is intended. GitHub connects at https://dojo.extenshi.io/integrations, and the repository is selected in the project where enabled. Repository creation and writes go through GitHub, its connector/CLI or the cabinet, with the user's authorization.",
216
290
  layout: [
217
291
  'README.md: setup, target browsers, build/test/release commands',
218
292
  'src/: extension logic and extenshi.config.js at the path supplied by the project',
219
- 'assets/ and _locales/: icons and translations (follow the chosen framework layout)',
293
+ 'assets/ and _locales/: icons and translations (following the chosen framework layout)',
220
294
  'tests/: behavior and browser scenarios',
221
295
  'docs/: privacy source, listing copy, support and release checklist',
222
296
  '.github/workflows/: build, tests and artifact scan',
223
- 'dist/: generated per-browser packages; attach versioned artifacts to CI/releases',
297
+ 'dist/: generated per-browser packages; versioned artifacts attached to CI/releases',
224
298
  ],
225
- practice: 'Commit source, dependency lockfile and .env.example with placeholders. Keep tokens, store credentials, signing keys, .env and user data in local/CI secret storage. Use branches and reviewable pull requests; associate release artifacts with a source commit/tag.',
299
+ practice: 'Committed: source, dependency lockfile and .env.example with placeholders. Kept in local/CI secret storage: tokens, store credentials, signing keys, .env and user data. Changes go through branches and reviewable pull requests; release artifacts are associated with a source commit/tag.',
226
300
  docs: [
227
301
  'https://docs.github.com/en/repositories/creating-and-managing-repositories/quickstart-for-repositories',
228
302
  docs('cli-github-actions'),
@@ -242,4 +316,37 @@ export function buildDevelopmentGuide(registeredTools) {
242
316
  ],
243
317
  };
244
318
  }
319
+ /** Normalise a caller's `sections` argument: unknown ids are dropped, `all` expands. */
320
+ export function resolveGuideSections(requested) {
321
+ if (!requested || requested.length === 0)
322
+ return [];
323
+ if (requested.includes('all'))
324
+ return [...GUIDE_SECTIONS];
325
+ return GUIDE_SECTIONS.filter((section) => requested.includes(section));
326
+ }
327
+ /**
328
+ * Build the guide. With no `sections`, returns the compact overview: tool names,
329
+ * workflow stage ids with exit criteria, and a table of contents. Listed
330
+ * sections (or `all`) are returned in full.
331
+ */
332
+ export function buildDevelopmentGuide(registeredTools, requested) {
333
+ const sections = resolveGuideSections(requested);
334
+ const full = buildSections(registeredTools);
335
+ const base = { schemaVersion: 2, documentation: DEVELOPMENT_GUIDE_URL, availability: AVAILABILITY };
336
+ if (sections.length > 0) {
337
+ return { ...base, ...Object.fromEntries(sections.map((section) => [section, full[section]])) };
338
+ }
339
+ return {
340
+ ...base,
341
+ overview: 'Extenshi development lifecycle reference: idea and research, project and repository, scaffold, implementation, assets and hosted pages, quality and listing, store release, maintenance.',
342
+ toolNames: registeredTools.map((tool) => tool.name),
343
+ workflowStages: WORKFLOW.map(({ id, doneWhen }) => ({ id, doneWhen })),
344
+ contents: GUIDE_SECTIONS.map((id) => ({
345
+ section: id,
346
+ summary: SECTION_SUMMARIES[id],
347
+ entries: Array.isArray(full[id]) ? full[id].length : undefined,
348
+ })),
349
+ sectionsParameter: 'Full sections are included when named in the `sections` argument (e.g. ["workflow", "services"]); "all" returns every section.',
350
+ };
351
+ }
245
352
  //# sourceMappingURL=development-guide.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"development-guide.js","sourceRoot":"","sources":["../src/development-guide.ts"],"names":[],"mappings":"AAaA,MAAM,IAAI,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,uCAAuC,IAAI,EAAE,CAAA;AAC5E,MAAM,QAAQ,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,kCAAkC,GAAG,EAAE,CAAA;AAEzE,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,CAAC,sBAAsB,CAAC,CAAA;AAEjE,MAAM,CAAC,MAAM,oBAAoB,GAAG;IACnC;QACC,EAAE,EAAE,eAAe;QACnB,OAAO,EAAE,wFAAwF;QACjG,KAAK,EAAE,CAAC,uBAAuB,EAAE,aAAa,EAAE,0BAA0B,CAAC;QAC3E,MAAM,EAAE,+EAA+E;QACvF,IAAI,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,qBAAqB,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;KAChE;IACD;QACC,EAAE,EAAE,SAAS;QACb,OAAO,EAAE,wFAAwF;QACjG,KAAK,EAAE,CAAC,oBAAoB,EAAE,wBAAwB,CAAC;QACvD,MAAM,EAAE,yFAAyF;QACjG,IAAI,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,EAAE,mCAAmC,EAAE,kCAAkC,CAAC;KACrG;IACD;QACC,EAAE,EAAE,UAAU;QACd,OAAO,EAAE,4FAA4F;QACrG,KAAK,EAAE;YACN,mBAAmB;YACnB,eAAe;YACf,aAAa;YACb,cAAc;YACd,uBAAuB;YACvB,iBAAiB;SACjB;QACD,MAAM,EACL,kKAAkK;QACnK,IAAI,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,6BAA6B,CAAC;KAClD;IACD;QACC,EAAE,EAAE,UAAU;QACd,OAAO,EACN,mIAAmI;QACpI,KAAK,EAAE;YACN,kBAAkB;YAClB,mBAAmB;YACnB,sBAAsB;YACtB,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I,GAAG,aAAa,CAAC,eAAe,CAAC,CAAA;IAC3C,MAAM,IAAI,GAAG,EAAE,aAAa,EAAE,CAAU,EAAE,aAAa,EAAE,qBAAqB,EAAE,YAAY,EAAE,YAAY,EAAE,CAAA;IAE5G,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACzB,OAAO,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;IAC/F,CAAC;IAED,OAAO;QACN,GAAG,IAAI;QACP,QAAQ,EACP,0LAA0L;QAC3L,SAAS,EAAE,eAAe,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC;QACnD,cAAc,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;QACtE,QAAQ,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;YACrC,OAAO,EAAE,EAAE;YACX,OAAO,EAAE,iBAAiB,CAAC,EAAE,CAAC;YAC9B,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAE,IAAI,CAAC,EAAE,CAAwB,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;SACtF,CAAC,CAAC;QACH,iBAAiB,EAChB,gIAAgI;KACjI,CAAA;AACF,CAAC"}
package/dist/docs.d.ts CHANGED
@@ -38,12 +38,53 @@ export declare function splitSections(full: string): DocSection[];
38
38
  * the body. Pure (no I/O) so it is unit-testable with a fixture.
39
39
  */
40
40
  export declare function rankSections(full: string, query: string, limit: number): DocSection[];
41
+ /**
42
+ * One searchable passage: a `##` subsection of a docs page (or the page intro
43
+ * before its first `##`). Returning passages instead of whole pages keeps a
44
+ * search result proportional to the question — a page can run to 8k+ chars,
45
+ * while the answer usually lives in one subsection.
46
+ */
47
+ export interface DocPassage {
48
+ page: string;
49
+ heading?: string;
50
+ url?: string;
51
+ body: string;
52
+ }
53
+ /** Split `llms-full.txt` into `##`-level passages, fence-aware, carrying the page source URL. */
54
+ export declare function splitPassages(full: string): DocPassage[];
55
+ /**
56
+ * Rank passages against a query with BM25 over passage bodies, so a long
57
+ * passage that merely repeats common words does not outrank a short one that
58
+ * answers the question. Heading and page-title matches add a bonus; hyphenated
59
+ * or long tokens (command and flag names) get a phrase boost. Pure (no I/O) so
60
+ * it is unit-testable with a fixture.
61
+ */
62
+ export declare function rankPassages(full: string, query: string, limit: number): DocPassage[];
63
+ /** Default and bounds for the per-result excerpt length (characters). */
64
+ export declare const DEFAULT_EXCERPT_CHARS = 1500;
65
+ export declare const MIN_EXCERPT_CHARS = 200;
66
+ export declare const MAX_EXCERPT_CHARS = 8000;
67
+ /**
68
+ * Cut a passage to `maxChars` on a line boundary. An unterminated code fence is
69
+ * closed so the rest of the response still renders as prose.
70
+ */
71
+ export declare function excerpt(body: string, maxChars: number): {
72
+ text: string;
73
+ truncated: boolean;
74
+ };
41
75
  /** Fetch the docs index (`llms.txt`) — the page list returned when no query is given. */
42
76
  export declare function getDocsIndex(docsUrl: string): Promise<string>;
77
+ export interface SearchDocsOptions {
78
+ /** Max passages returned. */
79
+ limit: number;
80
+ /** Max characters per passage excerpt. */
81
+ maxChars?: number;
82
+ }
83
+ /** Render ranked passages: page › heading, source URL, bounded excerpt. Pure. */
84
+ export declare function renderPassages(query: string, matches: DocPassage[], maxChars: number): string;
43
85
  /**
44
- * Search the docs and return a formatted, LLM-friendly answer: the top matching
45
- * sections, each with its source link. Falls back to a clear "nothing matched"
46
- * note pointing at the index.
86
+ * Search the docs and return the top matching passages, each with its source
87
+ * link and a bounded excerpt. Falls back to a "nothing matched" note.
47
88
  */
48
- export declare function searchDocs(docsUrl: string, query: string, limit: number): Promise<string>;
89
+ export declare function searchDocs(docsUrl: string, query: string, options: SearchDocsOptions): Promise<string>;
49
90
  //# sourceMappingURL=docs.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../src/docs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,qEAAqE;AACrE,qBAAa,SAAU,SAAQ,KAAK;gBACvB,OAAO,EAAE,MAAM;CAI3B;AAED,4EAA4E;AAC5E,MAAM,WAAW,UAAU;IAC1B,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;CACZ;AAkDD,mEAAmE;AACnE,wBAAgB,cAAc,IAAI,IAAI,CAErC;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,EAAE,CAyBxD;AAoCD;;;GAGG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,UAAU,EAAE,CAwBrF;AAUD,yFAAyF;AACzF,wBAAsB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAEnE;AAED;;;;GAIG;AACH,wBAAsB,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAa/F"}
1
+ {"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../src/docs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,qEAAqE;AACrE,qBAAa,SAAU,SAAQ,KAAK;gBACvB,OAAO,EAAE,MAAM;CAI3B;AAED,4EAA4E;AAC5E,MAAM,WAAW,UAAU;IAC1B,KAAK,EAAE,MAAM,CAAA;IACb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