@supportpages.io/wtfm 0.0.0-stage → 0.3.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 (275) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +23 -0
  3. package/README.md +392 -2
  4. package/dist/actions.d.ts +98 -0
  5. package/dist/actions.js +86 -0
  6. package/dist/actions.js.map +1 -0
  7. package/dist/agent-settings.d.ts +22 -0
  8. package/dist/agent-settings.js +35 -0
  9. package/dist/agent-settings.js.map +1 -0
  10. package/dist/api.d.ts +14 -0
  11. package/dist/api.js +159 -0
  12. package/dist/api.js.map +1 -0
  13. package/dist/article-link.d.ts +16 -0
  14. package/dist/article-link.js +25 -0
  15. package/dist/article-link.js.map +1 -0
  16. package/dist/artifacts.d.ts +45 -0
  17. package/dist/artifacts.js +144 -0
  18. package/dist/artifacts.js.map +1 -0
  19. package/dist/brand.d.ts +4 -0
  20. package/dist/brand.js +9 -0
  21. package/dist/brand.js.map +1 -0
  22. package/dist/bridge.d.ts +2964 -0
  23. package/dist/bridge.js +1036 -0
  24. package/dist/bridge.js.map +1 -0
  25. package/dist/capacity.d.ts +5 -0
  26. package/dist/capacity.js +11 -0
  27. package/dist/capacity.js.map +1 -0
  28. package/dist/credentials.d.ts +13 -0
  29. package/dist/credentials.js +88 -0
  30. package/dist/credentials.js.map +1 -0
  31. package/dist/development-tls.d.ts +8 -0
  32. package/dist/development-tls.js +38 -0
  33. package/dist/development-tls.js.map +1 -0
  34. package/dist/errors.d.ts +15 -0
  35. package/dist/errors.js +18 -0
  36. package/dist/errors.js.map +1 -0
  37. package/dist/export.d.ts +11 -0
  38. package/dist/export.js +91 -0
  39. package/dist/export.js.map +1 -0
  40. package/dist/hosted-operations.d.ts +108 -0
  41. package/dist/hosted-operations.js +120 -0
  42. package/dist/hosted-operations.js.map +1 -0
  43. package/dist/hosting-benefits.d.ts +66 -0
  44. package/dist/hosting-benefits.js +67 -0
  45. package/dist/hosting-benefits.js.map +1 -0
  46. package/dist/index.d.ts +2 -0
  47. package/dist/index.js +49 -0
  48. package/dist/index.js.map +1 -0
  49. package/dist/local-inventory.d.ts +22 -0
  50. package/dist/local-inventory.js +59 -0
  51. package/dist/local-inventory.js.map +1 -0
  52. package/dist/local-setup.d.ts +208 -0
  53. package/dist/local-setup.js +140 -0
  54. package/dist/local-setup.js.map +1 -0
  55. package/dist/pairing.d.ts +71 -0
  56. package/dist/pairing.js +235 -0
  57. package/dist/pairing.js.map +1 -0
  58. package/dist/preferences.d.ts +18 -0
  59. package/dist/preferences.js +44 -0
  60. package/dist/preferences.js.map +1 -0
  61. package/dist/progress.d.ts +205 -0
  62. package/dist/progress.js +224 -0
  63. package/dist/progress.js.map +1 -0
  64. package/dist/reminders.d.ts +31 -0
  65. package/dist/reminders.js +73 -0
  66. package/dist/reminders.js.map +1 -0
  67. package/dist/replace-connection.d.ts +6 -0
  68. package/dist/replace-connection.js +77 -0
  69. package/dist/replace-connection.js.map +1 -0
  70. package/dist/repository-actions.d.ts +18 -0
  71. package/dist/repository-actions.js +9 -0
  72. package/dist/repository-actions.js.map +1 -0
  73. package/dist/repository-benefits.d.ts +96 -0
  74. package/dist/repository-benefits.js +64 -0
  75. package/dist/repository-benefits.js.map +1 -0
  76. package/dist/run-update.d.ts +17 -0
  77. package/dist/run-update.js +27 -0
  78. package/dist/run-update.js.map +1 -0
  79. package/dist/runs.d.ts +541 -0
  80. package/dist/runs.js +146 -0
  81. package/dist/runs.js.map +1 -0
  82. package/dist/runtime.d.ts +12 -0
  83. package/dist/runtime.js +58 -0
  84. package/dist/runtime.js.map +1 -0
  85. package/dist/schema.d.ts +277 -0
  86. package/dist/schema.js +66 -0
  87. package/dist/schema.js.map +1 -0
  88. package/dist/server.d.ts +4 -0
  89. package/dist/server.js +298 -0
  90. package/dist/server.js.map +1 -0
  91. package/dist/session.d.ts +1714 -0
  92. package/dist/session.js +619 -0
  93. package/dist/session.js.map +1 -0
  94. package/dist/settings.d.ts +9 -0
  95. package/dist/settings.js +21 -0
  96. package/dist/settings.js.map +1 -0
  97. package/dist/sync.d.ts +495 -0
  98. package/dist/sync.js +191 -0
  99. package/dist/sync.js.map +1 -0
  100. package/dist/telemetry-scrub.d.ts +13 -0
  101. package/dist/telemetry-scrub.js +51 -0
  102. package/dist/telemetry-scrub.js.map +1 -0
  103. package/dist/telemetry.d.ts +73 -0
  104. package/dist/telemetry.js +173 -0
  105. package/dist/telemetry.js.map +1 -0
  106. package/dist/walkthroughs.d.ts +224 -0
  107. package/dist/walkthroughs.js +109 -0
  108. package/dist/walkthroughs.js.map +1 -0
  109. package/dist/workspace.d.ts +14 -0
  110. package/dist/workspace.js +127 -0
  111. package/dist/workspace.js.map +1 -0
  112. package/dist/writer-agent.d.ts +21 -0
  113. package/dist/writer-agent.js +27 -0
  114. package/dist/writer-agent.js.map +1 -0
  115. package/dist/writer-entry.d.ts +171 -0
  116. package/dist/writer-entry.js +233 -0
  117. package/dist/writer-entry.js.map +1 -0
  118. package/dist/writing-style.d.ts +7 -0
  119. package/dist/writing-style.js +52 -0
  120. package/dist/writing-style.js.map +1 -0
  121. package/engine/SYNC.json +4 -0
  122. package/engine/VERSION +1 -0
  123. package/engine/detect-project/README.md +141 -0
  124. package/engine/detect-project/SKILL.md +1421 -0
  125. package/engine/detect-project/assets/desktop/desktop-frame.css +428 -0
  126. package/engine/detect-project/assets/game/game-frame.css +132 -0
  127. package/engine/detect-project/assets/macosui/LICENSE-puppertino.txt +21 -0
  128. package/engine/detect-project/assets/macosui/VERSIONS.txt +1 -0
  129. package/engine/detect-project/assets/macosui/fonts.css +15 -0
  130. package/engine/detect-project/assets/macosui/macos-frame.css +481 -0
  131. package/engine/detect-project/assets/macosui/puppertino.css +2153 -0
  132. package/engine/detect-project/assets/mobileui/LICENSE-fonts.txt +13 -0
  133. package/engine/detect-project/assets/mobileui/LICENSE-framework7.txt +52 -0
  134. package/engine/detect-project/assets/mobileui/VERSIONS.txt +6 -0
  135. package/engine/detect-project/assets/mobileui/device-frame.css +316 -0
  136. package/engine/detect-project/assets/mobileui/f7-color-theme.mjs +1345 -0
  137. package/engine/detect-project/assets/mobileui/f7-icons-names.json +1254 -0
  138. package/engine/detect-project/assets/mobileui/fonts.css +16 -0
  139. package/engine/detect-project/assets/mobileui/framework7-components.css +39 -0
  140. package/engine/detect-project/assets/mobileui/framework7-core.css +5245 -0
  141. package/engine/detect-project/assets/mobileui/icons.css +31 -0
  142. package/engine/detect-project/assets/mobileui/md3-defaults.css +89 -0
  143. package/engine/detect-project/assets/mobileui/platforms.json +46 -0
  144. package/engine/detect-project/assets/tailwind-fallback.css +1729 -0
  145. package/engine/detect-project/assets/webtui/LICENSE-webtui.txt +28 -0
  146. package/engine/detect-project/assets/webtui/VERSIONS.txt +7 -0
  147. package/engine/detect-project/assets/webtui/terminal-frame.css +195 -0
  148. package/engine/detect-project/assets/webtui/theme-catppuccin.css +1 -0
  149. package/engine/detect-project/assets/webtui/theme-everforest.css +1 -0
  150. package/engine/detect-project/assets/webtui/theme-gruvbox.css +1 -0
  151. package/engine/detect-project/assets/webtui/theme-nord.css +1 -0
  152. package/engine/detect-project/assets/webtui/theme-vitesse.css +1 -0
  153. package/engine/detect-project/assets/webtui/themes.json +37 -0
  154. package/engine/detect-project/assets/webtui/webtui-core.css +1 -0
  155. package/engine/detect-project/assets/win32ui/7css.css +2 -0
  156. package/engine/detect-project/assets/win32ui/LICENSE-7css.txt +21 -0
  157. package/engine/detect-project/assets/win32ui/VERSIONS.txt +1 -0
  158. package/engine/detect-project/assets/win32ui/win32-frame.css +278 -0
  159. package/engine/detect-project/package-lock.json +12 -0
  160. package/engine/detect-project/package.json +10 -0
  161. package/engine/detect-project/scripts/apply_runtime_profiles.js +313 -0
  162. package/engine/detect-project/scripts/check_css_health.js +412 -0
  163. package/engine/detect-project/scripts/check_project_map.js +150 -0
  164. package/engine/detect-project/scripts/check_runtime_coverage.js +311 -0
  165. package/engine/detect-project/scripts/check_runtime_recipe_quality.js +184 -0
  166. package/engine/detect-project/scripts/classify_app_type.sh +246 -0
  167. package/engine/detect-project/scripts/classify_surface.sh +95 -0
  168. package/engine/detect-project/scripts/classify_workspace.js +39 -0
  169. package/engine/detect-project/scripts/compile_css.sh +447 -0
  170. package/engine/detect-project/scripts/detect_static.js +645 -0
  171. package/engine/detect-project/scripts/detect_structure.js +187 -0
  172. package/engine/detect-project/scripts/include_census.js +451 -0
  173. package/engine/detect-project/scripts/json_get.js +142 -0
  174. package/engine/detect-project/scripts/merge_json.js +52 -0
  175. package/engine/detect-project/scripts/recommend_model_tier.js +252 -0
  176. package/engine/detect-project/scripts/resolve_route_chains.js +135 -0
  177. package/engine/detect-project/scripts/run_css_build.sh +40 -0
  178. package/engine/detect-project/scripts/sanitize_css.js +83 -0
  179. package/engine/detect-project/scripts/test_classify_surface.js +108 -0
  180. package/engine/detect-project/scripts/test_node_helpers.js +142 -0
  181. package/engine/detect-project/scripts/test_recommend_model_tier.js +119 -0
  182. package/engine/detect-project/scripts/test_resolve_route_chains.js +182 -0
  183. package/engine/detect-project/scripts/test_runtime_coverage.js +323 -0
  184. package/engine/detect-project/scripts/test_runtime_recipe_quality.js +187 -0
  185. package/engine/detect-project/scripts/theme_overrides.js +169 -0
  186. package/engine/detect-project/scripts/write_branding.js +129 -0
  187. package/engine/generate-illustrated-article/SKILL.md +461 -0
  188. package/engine/generate-illustrated-article/contracts/desktop.md +90 -0
  189. package/engine/generate-illustrated-article/contracts/game.md +38 -0
  190. package/engine/generate-illustrated-article/contracts/label-evidence.md +38 -0
  191. package/engine/generate-illustrated-article/contracts/macos.md +79 -0
  192. package/engine/generate-illustrated-article/contracts/mobile.md +40 -0
  193. package/engine/generate-illustrated-article/contracts/terminal.md +29 -0
  194. package/engine/generate-illustrated-article/contracts/win32.md +43 -0
  195. package/engine/generate-illustrated-article/package-lock.json +366 -0
  196. package/engine/generate-illustrated-article/package.json +15 -0
  197. package/engine/generate-illustrated-article/scripts/article_blocks.js +34 -0
  198. package/engine/generate-illustrated-article/scripts/check_article_json.js +105 -0
  199. package/engine/generate-illustrated-article/scripts/emit_walkthrough_signals.js +100 -0
  200. package/engine/generate-illustrated-article/scripts/extract_images.js +187 -0
  201. package/engine/generate-illustrated-article/scripts/generate_content_images.js +376 -0
  202. package/engine/generate-illustrated-article/scripts/include_census.js +451 -0
  203. package/engine/generate-illustrated-article/scripts/inject_assets.js +1691 -0
  204. package/engine/generate-illustrated-article/scripts/jit_mockup_css.js +191 -0
  205. package/engine/generate-illustrated-article/scripts/label_evidence.js +87 -0
  206. package/engine/generate-illustrated-article/scripts/lint_article_copy.js +252 -0
  207. package/engine/generate-illustrated-article/scripts/lint_mockup_fidelity.js +2403 -0
  208. package/engine/generate-illustrated-article/scripts/polish_tickets.js +1148 -0
  209. package/engine/generate-illustrated-article/scripts/related_repos.sh +52 -0
  210. package/engine/generate-illustrated-article/scripts/render_all.js +177 -0
  211. package/engine/generate-illustrated-article/scripts/render_mockup.js +665 -0
  212. package/engine/generate-illustrated-article/scripts/render_ready.js +164 -0
  213. package/engine/generate-illustrated-article/scripts/resolve_workspace.sh +86 -0
  214. package/engine/generate-illustrated-article/scripts/runtime_region_geometry.js +55 -0
  215. package/engine/generate-illustrated-article/scripts/source_paths.js +49 -0
  216. package/engine/generate-illustrated-article/scripts/test_control_visibility.js +30 -0
  217. package/engine/generate-illustrated-article/scripts/test_emit_walkthrough_signals.js +157 -0
  218. package/engine/generate-illustrated-article/scripts/test_generate_content_images.js +168 -0
  219. package/engine/generate-illustrated-article/scripts/test_include_census.js +126 -0
  220. package/engine/generate-illustrated-article/scripts/test_label_evidence.js +49 -0
  221. package/engine/generate-illustrated-article/scripts/test_lint_article_copy.js +138 -0
  222. package/engine/generate-illustrated-article/scripts/test_lint_mockup_fidelity.js +653 -0
  223. package/engine/generate-illustrated-article/scripts/test_node_ports.js +152 -0
  224. package/engine/generate-illustrated-article/scripts/test_polish_tickets.js +481 -0
  225. package/engine/generate-illustrated-article/scripts/test_related_repos.js +64 -0
  226. package/engine/generate-illustrated-article/scripts/test_render_ready.js +85 -0
  227. package/engine/generate-illustrated-article/scripts/test_source_paths.js +68 -0
  228. package/engine/generate-illustrated-article/scripts/trace_hook.js +79 -0
  229. package/engine/generate-illustrated-article/scripts/trace_hook.sh +4 -0
  230. package/engine/generate-illustrated-article/scripts/validate_html.js +114 -0
  231. package/engine/generate-illustrated-article/scripts/watermark.js +69 -0
  232. package/install.sh +14 -0
  233. package/package.json +57 -4
  234. package/scripts/auth.mjs +33 -0
  235. package/scripts/auto-update.mjs +7 -0
  236. package/scripts/build-plugin.mjs +58 -0
  237. package/scripts/build-release.mjs +94 -0
  238. package/scripts/check-release.mjs +40 -0
  239. package/scripts/check-runtime.mjs +10 -0
  240. package/scripts/cli.mjs +8 -0
  241. package/scripts/install.mjs +64 -0
  242. package/scripts/lib/agent-runner.mjs +181 -0
  243. package/scripts/lib/agent-settings.mjs +215 -0
  244. package/scripts/lib/article-skills.mjs +82 -0
  245. package/scripts/lib/auto-update.mjs +50 -0
  246. package/scripts/lib/brand.mjs +9 -0
  247. package/scripts/lib/browser.mjs +12 -0
  248. package/scripts/lib/claude-connection.mjs +33 -0
  249. package/scripts/lib/claude-permissions.mjs +47 -0
  250. package/scripts/lib/claude-plugin.mjs +15 -0
  251. package/scripts/lib/claude-writer.mjs +10 -0
  252. package/scripts/lib/cli-main.mjs +85 -0
  253. package/scripts/lib/cli.mjs +888 -0
  254. package/scripts/lib/codex-config.mjs +51 -0
  255. package/scripts/lib/codex-integration.mjs +61 -0
  256. package/scripts/lib/codex-skill.mjs +34 -0
  257. package/scripts/lib/harness-models.mjs +109 -0
  258. package/scripts/lib/install.mjs +269 -0
  259. package/scripts/lib/managed-writer.mjs +38 -0
  260. package/scripts/lib/planning.mjs +263 -0
  261. package/scripts/lib/prepare-update.mjs +85 -0
  262. package/scripts/lib/refresh-writers.mjs +12 -0
  263. package/scripts/lib/remove.mjs +167 -0
  264. package/scripts/lib/renderer.mjs +34 -0
  265. package/scripts/lib/terminal.mjs +252 -0
  266. package/scripts/lib/uninit.mjs +72 -0
  267. package/scripts/lib/update.mjs +55 -0
  268. package/scripts/lib/writer-recovery.mjs +35 -0
  269. package/scripts/lib/yolo.mjs +362 -0
  270. package/scripts/plugin-session.mjs +65 -0
  271. package/scripts/prepare-update.mjs +12 -0
  272. package/scripts/publish-release.mjs +92 -0
  273. package/scripts/skills/supportpages/SKILL.md +120 -0
  274. package/scripts/smoke-release.mjs +101 -0
  275. package/server.json +27 -0
package/dist/server.js ADDED
@@ -0,0 +1,298 @@
1
+ import { fileURLToPath } from 'node:url';
2
+ import { readFileSync } from 'node:fs';
3
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
4
+ import { z } from 'zod';
5
+ import { articleType, idSchema, remoteId } from './schema.js';
6
+ import { fail, publicError } from './errors.js';
7
+ import { articleLinkContent, showArticleLinkInstruction } from './article-link.js';
8
+ import { writerLaunchInstruction, codexWriterLaunchInstruction, backgroundParentInstruction } from './writer-agent.js';
9
+ import { runUpdateAcknowledgement, runUpdateText } from './run-update.js';
10
+ import { resolveAction, writerAction } from './actions.js';
11
+ import { repositoryAction } from './repository-actions.js';
12
+ import { Walkthroughs } from './walkthroughs.js';
13
+ import { activeTelemetry, reportError } from './telemetry.js';
14
+ import { CLI_NAME } from './brand.js';
15
+ /** Shared errors and decisions name terminal commands because the CLI shows
16
+ * them too. A coding agent recovers through these tools instead: it never sends
17
+ * the user to a terminal, and it asks before signing anyone in. */
18
+ const signInGuidance = 'Ask whether the user wants to sign in or create a free SupportPages.io account to host articles there. If they do, call supportpages_init with host_local=true (signup=true for a new account): it opens browser approval, then offers the help centre choice; call it again with the chosen project_id to link this folder. Retry this request afterwards. Never direct the user to a terminal command.';
19
+ const mcpRecovery = {
20
+ authentication_required: { next_tool: 'supportpages_init', message: `This device is not signed in to SupportPages.io. ${signInGuidance}` },
21
+ missing_credentials: { next_tool: 'supportpages_init', message: `This device is not signed in to SupportPages.io. ${signInGuidance}` },
22
+ invalid_credentials_file: { next_tool: 'supportpages_init', message: `The saved device sign-in cannot be read. ${signInGuidance}` },
23
+ invalid_credentials: { next_tool: 'supportpages_init', message: 'The device sign-in has expired or was revoked. Ask before signing in again with supportpages_init, then retry this request. Never direct the user to a terminal command.' },
24
+ local_workspace: { next_tool: 'supportpages_init', message: 'This folder saves articles locally and has no help centre. Ask whether the user wants to sign in or create a free SupportPages.io account. If they do, call supportpages_init with host_local=true (signup=true for a new account): it opens browser approval, offers the help centre choice and links this folder once called again with the chosen project_id; saved files stay in place. Use supportpages_publish instead when the saved articles should be uploaded as well. Never direct the user to a terminal command.' },
25
+ local_required: { next_tool: 'supportpages_init', message: 'This folder is no longer set up to save articles locally. Call supportpages_init to set it up again, then retry.' },
26
+ setup_required: { next_tool: 'supportpages_init', message: 'This folder is not set up yet, and setting it up needs no account. It can save articles in the project as Markdown and screenshots with no sign-in, or publish them to a SupportPages.io help centre for a public URL, editor review and AI answers. Ask which the user wants, then call supportpages_init (signup=true only when they chose to create a new account) and retry. Never present hosting as required, and never direct the user to a terminal command.' },
27
+ project_required: { next_tool: 'supportpages_init', message: 'Signed in, but this folder is not linked to a help centre. Ask which help centre to use (supportpages_list_projects), or create one with supportpages_create_project, then call supportpages_init with that project_id and retry.' },
28
+ permission_required: { next_tool: 'supportpages_request_permissions', message: 'This action needs device permissions the user has not approved yet. Call supportpages_request_permissions with the missing scopes, wait for browser consent, then retry. Never direct the user to a terminal command.' },
29
+ };
30
+ function forAgent(value) {
31
+ if (!value || typeof value !== 'object')
32
+ return value;
33
+ const record = value;
34
+ const rewrite = (item) => {
35
+ const recovery = typeof item.code === 'string' ? mcpRecovery[item.code] : undefined;
36
+ if (!recovery || typeof item.message !== 'string')
37
+ return item;
38
+ const scopes = Array.isArray(item.missing_scopes) && item.missing_scopes.length ? ` Missing scopes: ${item.missing_scopes.join(', ')}.` : '';
39
+ return { ...item, message: recovery.message + scopes, next_tool: recovery.next_tool };
40
+ };
41
+ const decision = (item) => item && typeof item === 'object' && item.next_step && typeof item.next_step === 'object'
42
+ ? { ...item, next_step: rewrite(item.next_step) } : item;
43
+ let result = decision(record);
44
+ if (result.writer_action)
45
+ result = { ...result, writer_action: decision(result.writer_action) };
46
+ if (result.error && typeof result.error === 'object') {
47
+ const error = rewrite(result.error);
48
+ const details = error.details && typeof error.details === 'object' ? error.details : undefined;
49
+ result = { ...result, error: details?.writer_action ? { ...error, details: { ...details, writer_action: decision(details.writer_action) } } : error };
50
+ }
51
+ return result;
52
+ }
53
+ function packageVersion() {
54
+ try {
55
+ return JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8')).version;
56
+ }
57
+ catch {
58
+ return '0.0.0';
59
+ }
60
+ }
61
+ export function createServer(source) {
62
+ const server = new McpServer({ name: 'supportpages', version: packageVersion() }, { instructions: 'For article inventory questions such as what support articles do we have, call supportpages_list_articles first, without status or init. It reads local files when signed out or in local mode; report those results without requesting login. Use source=hosted only when the user explicitly requests the hosted inventory. Do not infer local inventory from git status. ' +
63
+ 'Every account step happens through these tools with the user’s browser consent: never direct the user to run a ' + CLI_NAME + ' (or supportpages) terminal command. When a tool reports authentication_required, or the user asks for anything hosted while signed out, first ask whether they want to sign in or create a free SupportPages.io account; then call supportpages_init (host_local=true from a folder that saves articles locally, signup=true for a new account) and again with the chosen project_id, or supportpages_publish when saved local articles should be uploaded too. For requested hosted generation or analysis, follow the returned setup step in order: browser sign-in/account creation, help-centre selection, device permissions, then browser repository connection. The action tools open required setup pages; show the returned URL only if browser_opened is false. Continue with supportpages_setup_hosted and its next_arguments after each step, then retry resume_tool with resume_arguments. Never substitute the app homepage or skip sign-in to invite repository connection. User browser consent remains required. ' +
64
+ 'For questions about existing hosted videos or video walkthroughs, call supportpages_list_walkthroughs, then supportpages_get_walkthrough for details. Article lists and local files are not the hosted video inventory. If the tools report server_update_required, explain that the hosted API needs deployment and stop this read request; do not substitute a filesystem search or infer that there are no videos. ' + showArticleLinkInstruction + ' ' + writerLaunchInstruction + ' ' + codexWriterLaunchInstruction + ' ' + backgroundParentInstruction + ' For article creation requests, check supportpages_status and finish supportpages_init when needed, preserving the original request. Always call supportpages_create_article to choose the permitted execution location before writing any article content or images, even if a generation skill was selected directly or is cached in this session. A hosted operation runs entirely in SupportPages: show the returned review link, which fills in as the article is written, then finish the turn. Do not poll it with supportpages_get_operation — use that only when the user asks how a run is going, or to recover after a client restart — and never launch a local writer. A local result uses the prepared task described below. Generation skills are private writer implementation files, not the main-agent entry point. Hand the prepared task brief to the writer, which must pass its entrypoint check first. It checks account-wide hosting capacity first. If preparation returns plan_limit, do not launch a writer: show the usage, upgrade link and manage-articles link, then wait for the user to free capacity or upgrade before retrying preparation. Prepare the article without preference overrides unless the user explicitly requests a different behavior; saved personal preferences apply. Preparation creates the preview when supported. Show its editor_url before launching any writer. Preparation does not start writing: follow the returned prefer_background setting to launch the task_brief in the foreground or using the current coding client background facility, then report started with supportpages_update_run. Use the existing directory in task_brief.workspace without worktree isolation or a new checkout. If background execution is unavailable or requires a worktree, explain and use foreground for the same prepared run. After update_run, show its preview link again, including when it came from an earlier run. If a tool reports an error, show any editor_url in error.details alongside the error and recovery instructions. The writer entrypoint records actual startup locally and activates the prepared relay even if the host misses update_run. Host updates still record execution mode and task identity. The relay uploads live previews and opens the browser once when readable text arrives if enabled. Do not open it a second time. For retry requests call retry_article after stopping the old writer. The writer only generates and validates local artifacts; the main agent handles MCP calls after the host completion notification. On success call supportpages_complete_article automatically, show its draft editor link, open it only if the returned open_when_ready is true, and ask whether the user wants this draft published. If completion reports upload_failed, generation is finished but delivery to the editor is unconfirmed: show the specific cause, editor link and next action, do not call update_run with failed, and do not infer that no remote draft exists. No answer means leave a draft. Never publish without an affirmative response for that draft, automate browser publication, or overwrite browser edits after a revision conflict. Stop host tasks before releasing runs. Do not claim progress is live after a client restart. Do not launch a separate agent CLI or ask for model/API credentials. If status or init reports local, this folder has no help centre: articles are saved as Markdown and screenshots, and the saved markdown path returned by complete_article is the deliverable. Show that path instead of an editor link and never ask whether to publish automatically. Only when the user explicitly asks to host or publish saved local articles, call supportpages_publish and follow its sign-in, help-centre and article-selection steps. Otherwise do not start browser sign-in or upload. A completion may return show_to_user: show that text verbatim as its own paragraph, after the saved path or draft review link, and nothing more; when absent, add no hosting or repository copy. If the user asks to stop hosting reminders, call supportpages_set_hosting_reminders with enabled=false. When a result includes telemetry_notice, show it once, verbatim. If the user asks to stop or allow anonymous usage reporting, call supportpages_set_telemetry.' });
65
+ activeTelemetry()?.setClient(() => server.server.getClientVersion()?.name);
66
+ const atWorkspace = async (workspace, resumeCompletion = true) => 'bridge' in source ? source.bridge(await source.workspace(workspace), { resumeCompletion }) : source;
67
+ const bridge = new Proxy({}, { get: (_target, key) => async (...args) => {
68
+ const resolved = 'bridge' in source ? await source.bridge() : source;
69
+ return resolved[key].apply(resolved, args);
70
+ } });
71
+ if ('bridge' in source)
72
+ source.roots = async () => {
73
+ if (!server.server.getClientCapabilities()?.roots)
74
+ return undefined;
75
+ const { roots } = await server.server.listRoots();
76
+ return roots.filter(root => root.uri.startsWith('file:')).map(root => fileURLToPath(root.uri));
77
+ };
78
+ if ('bridge' in source) {
79
+ source.approval = async (request) => {
80
+ if (!server.server.getClientCapabilities()?.elicitation?.url)
81
+ return 'unsupported';
82
+ const result = await server.server.elicitInput({ mode: 'url', url: request.url,
83
+ elicitationId: request.id,
84
+ message: `Sign in to SupportPages.io from this device. Compare code ${request.code} in your browser and approve sign-in. Allowing publishing is optional.` }, { timeout: 30_000 });
85
+ return result.action;
86
+ };
87
+ source.approvalCompleted = id => server.server.createElicitationCompletionNotifier(id)();
88
+ source.askForm = async (message, requestedSchema) => {
89
+ if (!server.server.getClientCapabilities()?.elicitation?.form)
90
+ return undefined;
91
+ const result = await server.server.elicitInput({ mode: 'form', message, requestedSchema }, { timeout: 300_000 });
92
+ return { action: result.action, content: result.content };
93
+ };
94
+ }
95
+ // Hosted requests the device cannot serve without an account: the client's
96
+ // own dialog asks first, and a linked folder retries the request in place.
97
+ const accountOffered = new Set(['list_articles', 'list_walkthroughs', 'get_walkthrough', 'get_article', 'update_article', 'publish_article', 'unpublish_article', 'delete_article', 'edit_article',
98
+ 'list_sections', 'list_recommendations', 'review_sections', 'review_recommendations', 'get_operation', 'retry_operation', 'sync', 'list_projects', 'upload_draft']);
99
+ const accountCodes = new Set(['authentication_required', 'missing_credentials', 'local_workspace']);
100
+ server.server.onclose = () => source.close();
101
+ const tool = (name, description, schema, handler, readOnly = false, remote = false, options = {}) => {
102
+ const { successText, ...annotations } = options;
103
+ server.registerTool(`supportpages_${name}`, {
104
+ description, inputSchema: z.object(schema),
105
+ outputSchema: z.object({ result: z.unknown().optional(), error: z.object({ code: z.string(), message: z.string(), details: z.unknown().optional() }).optional() }),
106
+ annotations: { readOnlyHint: readOnly, destructiveHint: !readOnly && remote, openWorldHint: remote, ...annotations },
107
+ }, async (args) => {
108
+ const attempt = async (offer) => {
109
+ try {
110
+ const result = forAgent(await handler(z.object(schema).parse(args)));
111
+ const data = { result };
112
+ return { content: [{ type: 'text', text: successText ? successText(result) : JSON.stringify(data) }, ...articleLinkContent(result)], structuredContent: data };
113
+ }
114
+ catch (error) {
115
+ reportError(error, name);
116
+ const safe = publicError(error);
117
+ const input = args;
118
+ if (offer && 'offerAccount' in source && accountOffered.has(name) && accountCodes.has(safe.code)) {
119
+ const outcome = await source.offerAccount(await source.workspace(typeof input.workspace === 'string' ? input.workspace : undefined), { need: 'This request needs your SupportPages.io help centre.' });
120
+ if (outcome.status === 'linked')
121
+ return attempt(false);
122
+ if (outcome.status !== 'unavailable') {
123
+ const message = outcome.status === 'declined'
124
+ ? `${outcome.asked ? 'The user chose not to sign in.' : 'The user chose not to sign in earlier in this session.'} Continue without the hosted help centre and do not ask again unless they raise it.`
125
+ : outcome.status === 'authentication_required' ? `The user chose to sign in and the approval page ${outcome.browser_opened ? 'was opened in their browser: tell them to approve it there and show the comparison code, not the link' : 'could not be opened automatically: say so, show browser_url for them to open, and show the comparison code'}. It was not approved within the wait, so call supportpages_status to check and retry this request once signed in.`
126
+ : 'Sign-in finished but no help centre was chosen. Ask which help centre to use, then call supportpages_init with host_local=true and that project_id, and retry this request.';
127
+ const data = { error: { code: safe.code, message, details: { ...(safe.details && typeof safe.details === 'object' ? safe.details : {}), account_offer: outcome } } };
128
+ return { isError: true, content: [{ type: 'text', text: JSON.stringify(data) }], structuredContent: data };
129
+ }
130
+ }
131
+ const data = forAgent({ error: safe });
132
+ const details = data.error.details && typeof data.error.details === 'object' ? data.error.details : {};
133
+ if (input.run_id || input.title || input.artifact_dir || details.run_id) {
134
+ try {
135
+ const selected = await atWorkspace(typeof input.workspace === 'string' ? input.workspace : undefined);
136
+ const link = await selected.articleErrorContext({ ...input, run_id: input.run_id ?? details.run_id });
137
+ if (link)
138
+ data.error.details = { ...link, ...details };
139
+ }
140
+ catch { /* Preserve the original error when its local journal cannot be read. */ }
141
+ }
142
+ return { isError: true, content: [{ type: 'text', text: JSON.stringify(data) }, ...articleLinkContent(data.error)], structuredContent: data };
143
+ }
144
+ };
145
+ return attempt(true);
146
+ });
147
+ };
148
+ tool('init', 'Sign this device in to SupportPages.io if needed and link the current workspace to a help centre. A folder set up to save articles locally returns local without any sign-in unless host_local=true, which means the user explicitly asked to sign in or use a help centre from it. Without a device sign-in it opens browser approval when supported, otherwise returns an approval link: show the link and comparison code to the user; sign-in completes privately in the background (check supportpages_status). Once signed in, a workspace with no linked help centre returns project_required with the account’s help centres: ask the user which one to use, then call this tool again with that project_id, or call supportpages_create_project first. Never accept a token in chat or approve for the user.', { workspace: z.string().optional().describe('Select an absolute client workspace root only when discovery is ambiguous.'), project_id: remoteId.optional().describe('Help centre to link this workspace to when it is not linked yet.'), signup: z.boolean().optional().describe('True when the user chose to create a free SupportPages.io account: browser approval starts on registration instead of sign-in.'), host_local: z.boolean().optional().describe('True when the user explicitly asked to sign in or use a help centre from a folder that saves articles locally. Sign-in proceeds and, once a project_id is chosen, the link makes the folder hosted while its saved files stay in place.') }, async (a) => {
149
+ const result = await ('init' in source ? source.init(a) : source.context());
150
+ const status = result && typeof result === 'object' ? result.status : undefined;
151
+ const notice = status === 'local' || status === 'ready' ? await activeTelemetry()?.notice() : undefined;
152
+ return notice ? { ...result, telemetry_notice: notice } : result;
153
+ }, false, true);
154
+ const dir = z.string().min(1).max(500).describe('Workspace-relative article output directory.');
155
+ tool('publish', 'Host saved local articles on a SupportPages.io help centre. Use only when the user asks to host or publish saved local articles, after asking whether they want to sign in or create a free account. Signs in through browser approval if needed, links a chosen help centre, and uploads selected articles as drafts. With no slugs, returns the available articles for selection; pass their slugs to upload. Follow authentication_required or project_required responses and call again after approval or selection. This changes the folder to hosted generation and preserves local files. It does not make articles publicly visible; publish_article is the separate public publication action. Never use automatically after local generation.', {
156
+ workspace: z.string().optional(), project_id: remoteId.optional().describe('The help centre the user selected; cannot replace an existing destination.'),
157
+ slugs: z.array(idSchema).max(1000).optional().describe('Saved article slugs selected by the user. Omit to list choices; an empty array uploads nothing.'),
158
+ signup: z.boolean().optional().describe('True when the user chose to create a free SupportPages.io account rather than sign in.'),
159
+ }, async (a) => {
160
+ if ('bridge' in source)
161
+ return source.publish(a);
162
+ if (a.project_id)
163
+ await source.bind(a.project_id, { requireIdle: true });
164
+ return source.uploadLocalArticles(a.slugs);
165
+ }, false, true, { destructiveHint: false });
166
+ tool('status', 'Check article progress and draft links, the signed-in account, browser approval progress and access to the linked help centre. Does not start authentication, open a browser, change bindings or expose credentials. Uses a read-only API check when configured.', { workspace: z.string().optional().describe('Select a client workspace root when discovery is ambiguous.'), run_id: z.uuid().optional().describe('Inspect a particular article run; otherwise shows the active or most recent run.') }, a => 'init' in source ? source.status(a) : source.status(a.run_id), true, true);
167
+ tool('doctor', 'Check configuration and local generation prerequisites without exposing credentials.', {}, () => bridge.doctor(), true);
168
+ tool('get_capabilities', 'Check whether an action can run and return its execution location or next setup step. No job or browser consent is started.', {
169
+ workspace: z.string().optional(), action: writerAction, article_id: remoteId.optional(),
170
+ }, async (a) => resolveAction(await atWorkspace(a.workspace, false), a.action, a.article_id), true, true);
171
+ tool('request_permissions', 'Request explicit browser consent for missing Writer permissions. Preserve the original action and retry it after consent. Never approve the browser form for the user.', {
172
+ workspace: z.string().optional(), action: writerAction, article_id: remoteId.optional(), scopes: z.array(z.enum(['publish', 'manage', 'generate'])).min(1).max(3),
173
+ }, async (a) => {
174
+ if ('requestPermissions' in source)
175
+ return source.requestPermissions(a);
176
+ throw new Error('Permission consent requires a managed device session.');
177
+ }, false, true);
178
+ for (const action of ['find_article_gaps', 'suggest_sections', 'recommend_articles']) {
179
+ tool(action, 'Run hosted documentation analysis and return a durable operation. Suggestions remain pending for review. Never analyse locally, accept suggestions automatically or generate articles implicitly.', {
180
+ workspace: z.string().optional(), request_id: z.uuid().optional().describe('Use a new UUID for a new intentional request, and reuse it for recovery. Omitted reuses the saved identical request.'), prefer_background: z.boolean().optional(), open_when_ready: z.boolean().optional(),
181
+ }, async (a) => {
182
+ const selected = await atWorkspace(a.workspace, false);
183
+ const decision = await resolveAction(selected, action);
184
+ if (!decision.allowed)
185
+ return 'setupHosted' in source
186
+ ? { ...await source.setupHosted({ workspace: a.workspace, action, resume_arguments: a }), resume_tool: `supportpages_${action}`, resume_arguments: a }
187
+ : { status: 'action_required', ...decision };
188
+ return selected.hosted.submit(action, {}, { ...a, decision });
189
+ }, false, true);
190
+ }
191
+ for (const kind of ['sections', 'recommendations']) {
192
+ tool(`list_${kind}`, 'List persisted suggestions with IDs and review state. Use after_id to read the next page.', { workspace: z.string().optional(), after_id: remoteId.optional() }, async (a) => (await atWorkspace(a.workspace, false)).listSuggestions(kind, a.after_id), true, true);
193
+ tool(`review_${kind}`, 'Accept or reject one selected suggestion. Acceptance never advances onboarding or starts generation. Generate an accepted article recommendation explicitly with create_article and recommendation_id.', { workspace: z.string().optional(), id: remoteId, decision: z.enum(['accept', 'reject']) }, async (a) => (await atWorkspace(a.workspace, false)).reviewSuggestion(kind, a.id, a.decision), false, true);
194
+ }
195
+ tool('create_video_walkthrough', 'Create a hosted video walkthrough for a completed eligible article. Uses project voice/settings and returns a durable operation. Review/playback is private until the user explicitly shares it in SupportPages; never publish, share or record locally.', {
196
+ workspace: z.string().optional(), article_id: remoteId.optional(), expected_revision: z.string().regex(/^[a-f0-9]{64}$/).optional(), request_id: z.uuid().optional().describe('Use a new UUID for a new intentional request, and reuse it for recovery. Omitted reuses the saved identical request.'), prefer_background: z.boolean().optional(), open_when_ready: z.boolean().optional(),
197
+ }, async (a) => {
198
+ const selected = await atWorkspace(a.workspace, false);
199
+ const response = await selected.createWalkthrough(a);
200
+ if (response.status === 'action_required' && 'setupHosted' in source)
201
+ return { ...await source.setupHosted({ workspace: a.workspace, action: 'create_video_walkthrough', article_id: a.article_id, resume_arguments: a }), resume_tool: 'supportpages_create_video_walkthrough', resume_arguments: a };
202
+ return response;
203
+ }, false, true);
204
+ const setupAction = z.enum(['find_article_gaps', 'suggest_sections', 'recommend_articles', 'create_video_walkthrough']);
205
+ const setupInput = { workspace: z.string().optional(), project_id: remoteId.optional(), article_id: remoteId.optional(),
206
+ signup: z.boolean().optional().describe('True when the user chose to create a free SupportPages.io account rather than sign in.'),
207
+ resume_arguments: z.object({ article_id: remoteId.optional(), expected_revision: z.string().regex(/^[a-f0-9]{64}$/).optional(), request_id: z.uuid().optional(), prefer_background: z.boolean().optional(), open_when_ready: z.boolean().optional() }).optional() };
208
+ const setupDescription = 'Sign in or create an account and connect a repository for the original requested hosted action. Opens browser sign-in first, asks which help centre to use, requests missing device consent, then opens that project repository connection or repair page. After the user completes a step, call again with next_arguments (and the selected project_id when asked). Returns resume_tool and resume_arguments when ready. Never approves consent, chooses a repository, uploads local articles or starts generation.';
209
+ tool('setup_hosted', setupDescription, { ...setupInput, action: setupAction }, async (a) => {
210
+ if ('setupHosted' in source)
211
+ return source.setupHosted(a);
212
+ fail('managed_session_required', 'Browser setup requires the managed SupportPages MCP session.');
213
+ }, false, true, { destructiveHint: false });
214
+ tool('connect_repository', 'Compatibility alias for supportpages_setup_hosted. ' + setupDescription, {
215
+ ...setupInput, action: setupAction.optional(), feature: z.enum(['article_gaps', 'video_walkthrough']).default('article_gaps'),
216
+ }, async (a) => 'setupHosted' in source
217
+ ? source.setupHosted({ ...a, action: a.action ?? (a.feature === 'video_walkthrough' ? 'create_video_walkthrough' : 'find_article_gaps') })
218
+ : repositoryAction(await atWorkspace(a.workspace, false), 'connect_repository', a.feature), false, true, { destructiveHint: false });
219
+ tool('set_repository_reminders', 'Enable or disable optional repository connection reminders when the user asks. Applies to the bound help centre across local checkouts on this device, for this API origin. Disabling lasts until explicitly enabled again; it does not affect article generation or publication.', {
220
+ workspace: z.string().optional(), enabled: z.boolean()
221
+ }, async (a) => (await atWorkspace(a.workspace)).repositoryReminders(a.enabled));
222
+ tool('set_hosting_reminders', 'Enable or disable the optional hosting reminders shown after an article is saved locally, when the user asks. Needs no account or help centre: the preference covers every local folder on this device for this API origin. Disabling lasts until explicitly enabled again; it does not affect article generation or hosting.', {
223
+ workspace: z.string().optional(), enabled: z.boolean()
224
+ }, async (a) => (await atWorkspace(a.workspace, false)).hostingReminders(a.enabled));
225
+ tool('set_telemetry', 'Turn the Writer’s anonymous usage counts and crash reports on or off for this device when the user asks. Needs no account. Returns what is sent and the current state; environment variables such as SUPPORTPAGES_TELEMETRY=0 or DO_NOT_TRACK=1 still win.', {
226
+ enabled: z.boolean(),
227
+ }, async (a) => {
228
+ const telemetry = activeTelemetry();
229
+ if (!telemetry)
230
+ fail('invalid_configuration', 'Telemetry settings are not available in this session.');
231
+ return telemetry.setEnabled(a.enabled);
232
+ });
233
+ tool('list_projects', 'List accessible SupportPages.io help centres.', {}, () => bridge.listProjects(), true, true);
234
+ tool('create_project', 'Create a SupportPages.io project for local generation; no repository connection is needed.', { name: z.string().trim().min(1).max(100), subdomain: z.string().regex(/^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/).min(3).max(63) }, a => bridge.createProject(a.name, a.subdomain), false, true);
235
+ tool('bind_workspace', 'Bind this configured local workspace to a remote project. Refuses to silently change an existing destination.', { project_id: remoteId }, a => bridge.bind(a.project_id), false, true);
236
+ tool('get_context', 'Fetch writing guidance, sections, article inventory and current account-wide article hosting capacity with billing and management links. A local folder returns its writing guidance with no sections, inventory or capacity.', {}, async () => bridge.contextFor(await bridge.destination()), true, true);
237
+ tool('get_local_plan', `Read validated local project detection context. Sections, recommendations and PR analysis require a repository connection in the web app. This compatibility tool does not expose a local plan. Run ${CLI_NAME} analyse in the project terminal if analysis is required.`, {}, () => bridge.localPlan(), true);
238
+ tool('create_article', 'Create one illustrated article using the permitted execution location. Hosted projects run in SupportPages with configured repositories/models; never launch a local writer for a hosted operation. Local responses return the existing prepared writer task. Defaults to draft even if project auto-publish is enabled. Set publish only for an explicit user publication request. Reuse request_id when recovering a lost response.', {
239
+ workspace: z.string().optional(), title: z.string().trim().min(1).max(500).optional(), recommendation_id: remoteId.optional(), description: z.string().max(20_000).optional(), article_type: articleType.default('how-to'),
240
+ publish: z.boolean().default(false), request_id: z.uuid().optional().describe('Use a new UUID for a new intentional request, and reuse it for recovery. Omitted reuses the saved identical request.'), prefer_background: z.boolean().optional(), open_when_ready: z.boolean().optional(),
241
+ }, async (a) => (await atWorkspace(a.workspace, false)).createArticle(a), false, true);
242
+ tool('edit_article', 'Edit an existing article according to instructions. Read it first and supply its current revision. Repository-connected edits run in SupportPages: send instructions, never write the replacement locally. Account-only drafts return local editing guidance. Successful published edits become live immediately; failures preserve the existing article and images.', {
243
+ workspace: z.string().optional(), article_id: remoteId, expected_revision: z.string().regex(/^[a-f0-9]{64}$/), instructions: z.string().trim().min(1).max(20_000), request_id: z.uuid().optional().describe('Use a new UUID for a new intentional request, and reuse it for recovery. Omitted reuses the saved identical request.'), prefer_background: z.boolean().optional(), open_when_ready: z.boolean().optional(),
244
+ }, async (a) => (await atWorkspace(a.workspace, false)).editArticle(a), false, true);
245
+ tool('get_operation', 'Check a hosted operation once, when the user asks how it is going or after a client restart; it never resubmits work. Do not call it on a loop while an operation runs: the review link shows progress as it is written. After a restart use the saved operation_id, or omit it to recover the most recent request, including a lost submission response. Polling is bounded to 20 seconds.', {
246
+ workspace: z.string().optional(), operation_id: remoteId.optional(), wait_ms: z.number().int().min(0).max(20_000).default(0),
247
+ }, async (a) => await (await atWorkspace(a.workspace, false)).hosted.get(a.operation_id, a.wait_ms) ?? { status: 'no_operation' }, true, true);
248
+ tool('retry_operation', 'Explicitly retry a failed hosted operation after fixing its reported prerequisite. Reuses the operation and target; rechecks permissions. Pass the current attempt from get_operation. Revision conflicts require a new request with a freshly read revision; retry cannot overwrite an old snapshot.', {
249
+ workspace: z.string().optional(), operation_id: remoteId, expected_attempt: z.number().int().positive(),
250
+ }, async (a) => (await atWorkspace(a.workspace, false)).hosted.retry(a.operation_id, a.expected_attempt), false, true);
251
+ tool('prepare_article', 'Check account-wide article hosting capacity before preparing a writing task and self-contained task brief. Call this before writing content or rendering images. In a local folder there is no capacity check or preview: the response says where the article will be saved. On plan_limit, show usage, upgrade and article-management links and stop; no writer should launch. This creates a preview when supported and returns its editor_url. Show that link immediately before launching the writer. This does not execute generation. Follow the returned personal preference for background or foreground execution; report started after launch and complete automatically after success.', {
252
+ workspace: z.string().optional(), title: z.string().trim().min(1).max(120), description: z.string().max(2000).optional(), article_type: articleType.default('how-to'), section_id: remoteId.optional(),
253
+ allow_duplicate: z.boolean().optional().describe('Only true when the user explicitly wants a separate article despite an existing article with the same title.'),
254
+ prefer_background: z.boolean().optional().describe('Override the saved personal preference only when explicitly requested.'), open_when_ready: z.boolean().optional().describe('Override the saved personal preference only when explicitly requested. Opening does not publish.')
255
+ }, async (a) => (await atWorkspace(a.workspace)).prepare(a), false, true);
256
+ tool('update_run', 'Report actual host task start, failure, interruption or cancellation. Returns a compact acknowledgement and editor link; use supportpages_status for full run details when needed. Always show the returned editor_url, including after failure or interruption. Cannot mark content delivered or published. Stop the writer before reporting a terminal event.', {
257
+ workspace: z.string().optional(), run_id: z.uuid(), event: z.enum(['started', 'failed', 'interrupted', 'cancelled']),
258
+ execution_mode: z.enum(['foreground', 'background']).optional(), host_task_id: z.string().min(1).max(200).optional(), stopped: z.boolean().optional()
259
+ }, async (a) => runUpdateAcknowledgement(await (await atWorkspace(a.workspace)).updateRun(a), a.event), false, false, { successText: runUpdateText });
260
+ tool('retry_article', 'Resume the same partial article after stopping the previous writer. Run the returned recovery task, report started, and complete after validation. Always show its returned editor_url before retrying, even if the link was already shown or the operation fails. Never retry a draft the user kept for editing.', { workspace: z.string().optional(), run_id: z.uuid(), stopped: z.literal(true) }, async (a) => (await atWorkspace(a.workspace)).retryArticle(a), false, true);
261
+ tool('complete_article', 'After successful host writing and validation, finalize and upload this run as a draft. In a local folder it saves the article as Markdown with its screenshots and returns the saved path instead of an editor link. Safe to retry after an upload failure without regenerating. The writer finish handshake can already have delivered the draft; still call this tool to get the final response. Never infer completion from the writer’s prose or preview link. Return the editor link, then any show_to_user text verbatim, open only if the returned open_when_ready is true, and ask whether the user wants to publish. Never call for a partial or interrupted writer.', {
262
+ workspace: z.string().optional(), run_id: z.uuid(), completed: z.literal(true)
263
+ }, async (a) => (await atWorkspace(a.workspace)).complete(a), false, true);
264
+ tool('cancel_run', 'Release a generation run after the host agent has stopped. Does not stop processes or delete files. A writing run requires stopped=true.', { workspace: z.string().optional(), run_id: z.uuid(), stopped: z.boolean().optional() }, async (a) => (await atWorkspace(a.workspace)).cancel(a.run_id, a.stopped));
265
+ tool('sync', 'Refresh remote project settings, articles and video walkthroughs, including remote-only resources, publication/sharing, review links and changes. Missing walkthroughs are unavailable, not confirmed deletion tombstones. Preserves local content and upload baselines. Review conflicts in the editor; never recreate deleted resources automatically.', { workspace: z.string().optional() }, async (a) => (await atWorkspace(a.workspace)).sync(), false, true, { destructiveHint: false });
266
+ tool('list_walkthroughs', 'List existing hosted video walkthroughs, including videos created in the browser. Returns generation, readiness, sharing and article-publication state with review/playback links. Optional article_id filters to one article. For the next page pass both next_cursor as after_id and through_id. Does not generate or share videos.', {
267
+ workspace: z.string().optional(), article_id: remoteId.optional(), after_id: remoteId.optional(), through_id: z.string().regex(/^\d+$/).optional(),
268
+ }, async ({ workspace, ...input }) => new Walkthroughs(await atWorkspace(workspace, false)).list(input), true, true);
269
+ tool('get_walkthrough', 'Read a hosted video walkthrough by ID: current generation and public visibility, revision, assets, transcript when available, and private review/playback links. Use get_operation for a Writer generation job; this tool also reads videos created outside Writer. Read-only: never publishes, shares or starts generation.', {
270
+ workspace: z.string().optional(), walkthrough_id: remoteId,
271
+ }, async (a) => new Walkthroughs(await atWorkspace(a.workspace, false)).get(a.walkthrough_id), true, true);
272
+ tool('list_local_articles', 'List current local article files when signed out or in local mode, without login or network requests. Otherwise refresh the linked project inventory, including remote-only articles and conflicts. Preserves local content.', { workspace: z.string().optional() }, async (a) => (await atWorkspace(a.workspace, false)).listLocal(), false, true, { destructiveHint: false });
273
+ tool('validate_article', 'Validate article schema, image references and available lint results. Validation does not finalize a generation run.', { artifact_dir: dir }, a => bridge.validate(a.artifact_dir), true);
274
+ tool('preview_article', 'Create a self-contained local preview. Returns a file path and URI; no network requests or article scripts execute in the preview.', { artifact_dir: dir }, a => bridge.preview(a.artifact_dir));
275
+ tool('finalize_article', 'Snapshot a successfully completed article for upload. Set completed=true only after the full skill pipeline succeeds (or after reviewing an existing finished article). Prepared runs require their run_id. Never finalize interrupted generation.', { artifact_dir: dir, completed: z.literal(true), run_id: z.uuid().optional(), section_id: remoteId.optional() }, a => bridge.finalize(a));
276
+ tool('upload_draft', 'Upload the finalized article bundle to the bound SupportPages.io project as an unreviewed draft. Repeating an upload is safe. Published-article changes are rejected.', { slug: idSchema }, a => bridge.upload(a.slug), false, true);
277
+ tool('get_article', 'Read remote content, revision and publication state for an article in the bound project.', { article_id: remoteId }, a => bridge.getArticle(a.article_id), true, true);
278
+ const revision = z.string().regex(/^[a-f0-9]{64}$/);
279
+ const addressed = { workspace: z.string().optional(), article_id: remoteId, expected_revision: revision };
280
+ tool('list_articles', 'List existing support articles. By default, inspect local article files when signed out or in local mode; otherwise list the linked help centre. Do not call status or init first and do not ask for login for a local listing. An empty local result does not mean the hosted help centre is empty. Use source=hosted only for an explicitly hosted inventory request, or source=local to inspect local files while signed in. Hosted results use next_cursor as after_id.', {
281
+ workspace: z.string().optional(), after_id: remoteId.optional(), source: z.enum(['auto', 'local', 'hosted']).default('auto'),
282
+ }, async (a) => (await atWorkspace(a.workspace, false)).listArticles(a.after_id, a.source), true, true);
283
+ tool('update_article', 'Save an exact content update using the current revision from get_article. Structured articles use structured_content; Markdown articles use body and optional title. Preserves images and publication state. Published changes become live immediately and require repository access and publish permission. On conflict read again; never overwrite browser changes.', {
284
+ ...addressed, structured_content: z.record(z.string(), z.unknown()).optional(), body: z.string().max(200_000).optional(), title: z.string().max(200).optional(),
285
+ }, async (a) => (await atWorkspace(a.workspace, false)).mutateArticle('update_article', a), false, true);
286
+ tool('publish_article', 'Make an article visible in the hosted help centre. It can be unpublished again in the web editor or with unpublish_article. Use only when the user has instructed publication. Address by article_id and current revision, or use the legacy slug and uploaded bundle revision; never both.', {
287
+ workspace: z.string().optional(), article_id: remoteId.optional(), slug: idSchema.optional(), expected_revision: revision,
288
+ }, async (a) => {
289
+ if (Boolean(a.article_id) === Boolean(a.slug))
290
+ fail('invalid_request', 'Supply either article_id or the legacy local slug.');
291
+ const selected = await atWorkspace(a.workspace, false);
292
+ return a.article_id ? selected.mutateArticle('publish_article', { article_id: a.article_id, expected_revision: a.expected_revision }) : selected.publish(a.slug, a.expected_revision);
293
+ }, false, true, { destructiveHint: false });
294
+ tool('unpublish_article', 'Remove an article from the public help centre while retaining it as a draft. Requires an account and publish permission, not a repository. Use the latest revision.', addressed, async (a) => (await atWorkspace(a.workspace, false)).mutateArticle('unpublish_article', a), false, true);
295
+ tool('delete_article', 'Soft-delete the selected article using its latest revision. Use only when the user requests deletion. Existing retention and browser restoration apply; never recreate it through upload or retry.', addressed, async (a) => (await atWorkspace(a.workspace, false)).mutateArticle('delete_article', a), false, true);
296
+ return server;
297
+ }
298
+ //# sourceM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