@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.
- package/LICENSE +201 -0
- package/NOTICE +23 -0
- package/README.md +392 -2
- package/dist/actions.d.ts +98 -0
- package/dist/actions.js +86 -0
- package/dist/actions.js.map +1 -0
- package/dist/agent-settings.d.ts +22 -0
- package/dist/agent-settings.js +35 -0
- package/dist/agent-settings.js.map +1 -0
- package/dist/api.d.ts +14 -0
- package/dist/api.js +159 -0
- package/dist/api.js.map +1 -0
- package/dist/article-link.d.ts +16 -0
- package/dist/article-link.js +25 -0
- package/dist/article-link.js.map +1 -0
- package/dist/artifacts.d.ts +45 -0
- package/dist/artifacts.js +144 -0
- package/dist/artifacts.js.map +1 -0
- package/dist/brand.d.ts +4 -0
- package/dist/brand.js +9 -0
- package/dist/brand.js.map +1 -0
- package/dist/bridge.d.ts +2964 -0
- package/dist/bridge.js +1036 -0
- package/dist/bridge.js.map +1 -0
- package/dist/capacity.d.ts +5 -0
- package/dist/capacity.js +11 -0
- package/dist/capacity.js.map +1 -0
- package/dist/credentials.d.ts +13 -0
- package/dist/credentials.js +88 -0
- package/dist/credentials.js.map +1 -0
- package/dist/development-tls.d.ts +8 -0
- package/dist/development-tls.js +38 -0
- package/dist/development-tls.js.map +1 -0
- package/dist/errors.d.ts +15 -0
- package/dist/errors.js +18 -0
- package/dist/errors.js.map +1 -0
- package/dist/export.d.ts +11 -0
- package/dist/export.js +91 -0
- package/dist/export.js.map +1 -0
- package/dist/hosted-operations.d.ts +108 -0
- package/dist/hosted-operations.js +120 -0
- package/dist/hosted-operations.js.map +1 -0
- package/dist/hosting-benefits.d.ts +66 -0
- package/dist/hosting-benefits.js +67 -0
- package/dist/hosting-benefits.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +49 -0
- package/dist/index.js.map +1 -0
- package/dist/local-inventory.d.ts +22 -0
- package/dist/local-inventory.js +59 -0
- package/dist/local-inventory.js.map +1 -0
- package/dist/local-setup.d.ts +208 -0
- package/dist/local-setup.js +140 -0
- package/dist/local-setup.js.map +1 -0
- package/dist/pairing.d.ts +71 -0
- package/dist/pairing.js +235 -0
- package/dist/pairing.js.map +1 -0
- package/dist/preferences.d.ts +18 -0
- package/dist/preferences.js +44 -0
- package/dist/preferences.js.map +1 -0
- package/dist/progress.d.ts +205 -0
- package/dist/progress.js +224 -0
- package/dist/progress.js.map +1 -0
- package/dist/reminders.d.ts +31 -0
- package/dist/reminders.js +73 -0
- package/dist/reminders.js.map +1 -0
- package/dist/replace-connection.d.ts +6 -0
- package/dist/replace-connection.js +77 -0
- package/dist/replace-connection.js.map +1 -0
- package/dist/repository-actions.d.ts +18 -0
- package/dist/repository-actions.js +9 -0
- package/dist/repository-actions.js.map +1 -0
- package/dist/repository-benefits.d.ts +96 -0
- package/dist/repository-benefits.js +64 -0
- package/dist/repository-benefits.js.map +1 -0
- package/dist/run-update.d.ts +17 -0
- package/dist/run-update.js +27 -0
- package/dist/run-update.js.map +1 -0
- package/dist/runs.d.ts +541 -0
- package/dist/runs.js +146 -0
- package/dist/runs.js.map +1 -0
- package/dist/runtime.d.ts +12 -0
- package/dist/runtime.js +58 -0
- package/dist/runtime.js.map +1 -0
- package/dist/schema.d.ts +277 -0
- package/dist/schema.js +66 -0
- package/dist/schema.js.map +1 -0
- package/dist/server.d.ts +4 -0
- package/dist/server.js +298 -0
- package/dist/server.js.map +1 -0
- package/dist/session.d.ts +1714 -0
- package/dist/session.js +619 -0
- package/dist/session.js.map +1 -0
- package/dist/settings.d.ts +9 -0
- package/dist/settings.js +21 -0
- package/dist/settings.js.map +1 -0
- package/dist/sync.d.ts +495 -0
- package/dist/sync.js +191 -0
- package/dist/sync.js.map +1 -0
- package/dist/telemetry-scrub.d.ts +13 -0
- package/dist/telemetry-scrub.js +51 -0
- package/dist/telemetry-scrub.js.map +1 -0
- package/dist/telemetry.d.ts +73 -0
- package/dist/telemetry.js +173 -0
- package/dist/telemetry.js.map +1 -0
- package/dist/walkthroughs.d.ts +224 -0
- package/dist/walkthroughs.js +109 -0
- package/dist/walkthroughs.js.map +1 -0
- package/dist/workspace.d.ts +14 -0
- package/dist/workspace.js +127 -0
- package/dist/workspace.js.map +1 -0
- package/dist/writer-agent.d.ts +21 -0
- package/dist/writer-agent.js +27 -0
- package/dist/writer-agent.js.map +1 -0
- package/dist/writer-entry.d.ts +171 -0
- package/dist/writer-entry.js +233 -0
- package/dist/writer-entry.js.map +1 -0
- package/dist/writing-style.d.ts +7 -0
- package/dist/writing-style.js +52 -0
- package/dist/writing-style.js.map +1 -0
- package/engine/SYNC.json +4 -0
- package/engine/VERSION +1 -0
- package/engine/detect-project/README.md +141 -0
- package/engine/detect-project/SKILL.md +1421 -0
- package/engine/detect-project/assets/desktop/desktop-frame.css +428 -0
- package/engine/detect-project/assets/game/game-frame.css +132 -0
- package/engine/detect-project/assets/macosui/LICENSE-puppertino.txt +21 -0
- package/engine/detect-project/assets/macosui/VERSIONS.txt +1 -0
- package/engine/detect-project/assets/macosui/fonts.css +15 -0
- package/engine/detect-project/assets/macosui/macos-frame.css +481 -0
- package/engine/detect-project/assets/macosui/puppertino.css +2153 -0
- package/engine/detect-project/assets/mobileui/LICENSE-fonts.txt +13 -0
- package/engine/detect-project/assets/mobileui/LICENSE-framework7.txt +52 -0
- package/engine/detect-project/assets/mobileui/VERSIONS.txt +6 -0
- package/engine/detect-project/assets/mobileui/device-frame.css +316 -0
- package/engine/detect-project/assets/mobileui/f7-color-theme.mjs +1345 -0
- package/engine/detect-project/assets/mobileui/f7-icons-names.json +1254 -0
- package/engine/detect-project/assets/mobileui/fonts.css +16 -0
- package/engine/detect-project/assets/mobileui/framework7-components.css +39 -0
- package/engine/detect-project/assets/mobileui/framework7-core.css +5245 -0
- package/engine/detect-project/assets/mobileui/icons.css +31 -0
- package/engine/detect-project/assets/mobileui/md3-defaults.css +89 -0
- package/engine/detect-project/assets/mobileui/platforms.json +46 -0
- package/engine/detect-project/assets/tailwind-fallback.css +1729 -0
- package/engine/detect-project/assets/webtui/LICENSE-webtui.txt +28 -0
- package/engine/detect-project/assets/webtui/VERSIONS.txt +7 -0
- package/engine/detect-project/assets/webtui/terminal-frame.css +195 -0
- package/engine/detect-project/assets/webtui/theme-catppuccin.css +1 -0
- package/engine/detect-project/assets/webtui/theme-everforest.css +1 -0
- package/engine/detect-project/assets/webtui/theme-gruvbox.css +1 -0
- package/engine/detect-project/assets/webtui/theme-nord.css +1 -0
- package/engine/detect-project/assets/webtui/theme-vitesse.css +1 -0
- package/engine/detect-project/assets/webtui/themes.json +37 -0
- package/engine/detect-project/assets/webtui/webtui-core.css +1 -0
- package/engine/detect-project/assets/win32ui/7css.css +2 -0
- package/engine/detect-project/assets/win32ui/LICENSE-7css.txt +21 -0
- package/engine/detect-project/assets/win32ui/VERSIONS.txt +1 -0
- package/engine/detect-project/assets/win32ui/win32-frame.css +278 -0
- package/engine/detect-project/package-lock.json +12 -0
- package/engine/detect-project/package.json +10 -0
- package/engine/detect-project/scripts/apply_runtime_profiles.js +313 -0
- package/engine/detect-project/scripts/check_css_health.js +412 -0
- package/engine/detect-project/scripts/check_project_map.js +150 -0
- package/engine/detect-project/scripts/check_runtime_coverage.js +311 -0
- package/engine/detect-project/scripts/check_runtime_recipe_quality.js +184 -0
- package/engine/detect-project/scripts/classify_app_type.sh +246 -0
- package/engine/detect-project/scripts/classify_surface.sh +95 -0
- package/engine/detect-project/scripts/classify_workspace.js +39 -0
- package/engine/detect-project/scripts/compile_css.sh +447 -0
- package/engine/detect-project/scripts/detect_static.js +645 -0
- package/engine/detect-project/scripts/detect_structure.js +187 -0
- package/engine/detect-project/scripts/include_census.js +451 -0
- package/engine/detect-project/scripts/json_get.js +142 -0
- package/engine/detect-project/scripts/merge_json.js +52 -0
- package/engine/detect-project/scripts/recommend_model_tier.js +252 -0
- package/engine/detect-project/scripts/resolve_route_chains.js +135 -0
- package/engine/detect-project/scripts/run_css_build.sh +40 -0
- package/engine/detect-project/scripts/sanitize_css.js +83 -0
- package/engine/detect-project/scripts/test_classify_surface.js +108 -0
- package/engine/detect-project/scripts/test_node_helpers.js +142 -0
- package/engine/detect-project/scripts/test_recommend_model_tier.js +119 -0
- package/engine/detect-project/scripts/test_resolve_route_chains.js +182 -0
- package/engine/detect-project/scripts/test_runtime_coverage.js +323 -0
- package/engine/detect-project/scripts/test_runtime_recipe_quality.js +187 -0
- package/engine/detect-project/scripts/theme_overrides.js +169 -0
- package/engine/detect-project/scripts/write_branding.js +129 -0
- package/engine/generate-illustrated-article/SKILL.md +461 -0
- package/engine/generate-illustrated-article/contracts/desktop.md +90 -0
- package/engine/generate-illustrated-article/contracts/game.md +38 -0
- package/engine/generate-illustrated-article/contracts/label-evidence.md +38 -0
- package/engine/generate-illustrated-article/contracts/macos.md +79 -0
- package/engine/generate-illustrated-article/contracts/mobile.md +40 -0
- package/engine/generate-illustrated-article/contracts/terminal.md +29 -0
- package/engine/generate-illustrated-article/contracts/win32.md +43 -0
- package/engine/generate-illustrated-article/package-lock.json +366 -0
- package/engine/generate-illustrated-article/package.json +15 -0
- package/engine/generate-illustrated-article/scripts/article_blocks.js +34 -0
- package/engine/generate-illustrated-article/scripts/check_article_json.js +105 -0
- package/engine/generate-illustrated-article/scripts/emit_walkthrough_signals.js +100 -0
- package/engine/generate-illustrated-article/scripts/extract_images.js +187 -0
- package/engine/generate-illustrated-article/scripts/generate_content_images.js +376 -0
- package/engine/generate-illustrated-article/scripts/include_census.js +451 -0
- package/engine/generate-illustrated-article/scripts/inject_assets.js +1691 -0
- package/engine/generate-illustrated-article/scripts/jit_mockup_css.js +191 -0
- package/engine/generate-illustrated-article/scripts/label_evidence.js +87 -0
- package/engine/generate-illustrated-article/scripts/lint_article_copy.js +252 -0
- package/engine/generate-illustrated-article/scripts/lint_mockup_fidelity.js +2403 -0
- package/engine/generate-illustrated-article/scripts/polish_tickets.js +1148 -0
- package/engine/generate-illustrated-article/scripts/related_repos.sh +52 -0
- package/engine/generate-illustrated-article/scripts/render_all.js +177 -0
- package/engine/generate-illustrated-article/scripts/render_mockup.js +665 -0
- package/engine/generate-illustrated-article/scripts/render_ready.js +164 -0
- package/engine/generate-illustrated-article/scripts/resolve_workspace.sh +86 -0
- package/engine/generate-illustrated-article/scripts/runtime_region_geometry.js +55 -0
- package/engine/generate-illustrated-article/scripts/source_paths.js +49 -0
- package/engine/generate-illustrated-article/scripts/test_control_visibility.js +30 -0
- package/engine/generate-illustrated-article/scripts/test_emit_walkthrough_signals.js +157 -0
- package/engine/generate-illustrated-article/scripts/test_generate_content_images.js +168 -0
- package/engine/generate-illustrated-article/scripts/test_include_census.js +126 -0
- package/engine/generate-illustrated-article/scripts/test_label_evidence.js +49 -0
- package/engine/generate-illustrated-article/scripts/test_lint_article_copy.js +138 -0
- package/engine/generate-illustrated-article/scripts/test_lint_mockup_fidelity.js +653 -0
- package/engine/generate-illustrated-article/scripts/test_node_ports.js +152 -0
- package/engine/generate-illustrated-article/scripts/test_polish_tickets.js +481 -0
- package/engine/generate-illustrated-article/scripts/test_related_repos.js +64 -0
- package/engine/generate-illustrated-article/scripts/test_render_ready.js +85 -0
- package/engine/generate-illustrated-article/scripts/test_source_paths.js +68 -0
- package/engine/generate-illustrated-article/scripts/trace_hook.js +79 -0
- package/engine/generate-illustrated-article/scripts/trace_hook.sh +4 -0
- package/engine/generate-illustrated-article/scripts/validate_html.js +114 -0
- package/engine/generate-illustrated-article/scripts/watermark.js +69 -0
- package/install.sh +14 -0
- package/package.json +57 -4
- package/scripts/auth.mjs +33 -0
- package/scripts/auto-update.mjs +7 -0
- package/scripts/build-plugin.mjs +58 -0
- package/scripts/build-release.mjs +94 -0
- package/scripts/check-release.mjs +40 -0
- package/scripts/check-runtime.mjs +10 -0
- package/scripts/cli.mjs +8 -0
- package/scripts/install.mjs +64 -0
- package/scripts/lib/agent-runner.mjs +181 -0
- package/scripts/lib/agent-settings.mjs +215 -0
- package/scripts/lib/article-skills.mjs +82 -0
- package/scripts/lib/auto-update.mjs +50 -0
- package/scripts/lib/brand.mjs +9 -0
- package/scripts/lib/browser.mjs +12 -0
- package/scripts/lib/claude-connection.mjs +33 -0
- package/scripts/lib/claude-permissions.mjs +47 -0
- package/scripts/lib/claude-plugin.mjs +15 -0
- package/scripts/lib/claude-writer.mjs +10 -0
- package/scripts/lib/cli-main.mjs +85 -0
- package/scripts/lib/cli.mjs +888 -0
- package/scripts/lib/codex-config.mjs +51 -0
- package/scripts/lib/codex-integration.mjs +61 -0
- package/scripts/lib/codex-skill.mjs +34 -0
- package/scripts/lib/harness-models.mjs +109 -0
- package/scripts/lib/install.mjs +269 -0
- package/scripts/lib/managed-writer.mjs +38 -0
- package/scripts/lib/planning.mjs +263 -0
- package/scripts/lib/prepare-update.mjs +85 -0
- package/scripts/lib/refresh-writers.mjs +12 -0
- package/scripts/lib/remove.mjs +167 -0
- package/scripts/lib/renderer.mjs +34 -0
- package/scripts/lib/terminal.mjs +252 -0
- package/scripts/lib/uninit.mjs +72 -0
- package/scripts/lib/update.mjs +55 -0
- package/scripts/lib/writer-recovery.mjs +35 -0
- package/scripts/lib/yolo.mjs +362 -0
- package/scripts/plugin-session.mjs +65 -0
- package/scripts/prepare-update.mjs +12 -0
- package/scripts/publish-release.mjs +92 -0
- package/scripts/skills/supportpages/SKILL.md +120 -0
- package/scripts/smoke-release.mjs +101 -0
- package/server.json +27 -0
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
/** Screenshots per locally written article. The engine treats this as a hard
|
|
2
|
+
* limit (RTFM_MAX_IMAGES); each mockup costs minutes of model time. */
|
|
3
|
+
export declare const writerScreenshotLimit = 3;
|
|
4
|
+
export declare function writerEntry(workspace: string, stateRoot: string, runId: string, skillsDir: string, writerToken?: string): {
|
|
5
|
+
command: string;
|
|
6
|
+
args: string[];
|
|
7
|
+
shell_command: string;
|
|
8
|
+
execution: {
|
|
9
|
+
command: string;
|
|
10
|
+
args: string[];
|
|
11
|
+
shell_command: string;
|
|
12
|
+
instruction: string;
|
|
13
|
+
};
|
|
14
|
+
completion: {
|
|
15
|
+
command: string;
|
|
16
|
+
args: string[];
|
|
17
|
+
shell_command: string;
|
|
18
|
+
instruction: string;
|
|
19
|
+
};
|
|
20
|
+
instruction: string;
|
|
21
|
+
};
|
|
22
|
+
export declare function loadWriterInstructions(args: string[], _env?: NodeJS.ProcessEnv): Promise<string>;
|
|
23
|
+
/** Each command gets its own prepared environment; no shell state must survive
|
|
24
|
+
* between agent tool calls. Release the state lock before running so the relay
|
|
25
|
+
* can continue delivering previews. The host still owns stopping old writers. */
|
|
26
|
+
export declare function runWriterCommand(args: string[], command: string[], env?: NodeJS.ProcessEnv): Promise<number>;
|
|
27
|
+
/** Explicit writer success; no API credentials or network requests in this process. */
|
|
28
|
+
export declare function requestWriterCompletion(args: string[], _env?: NodeJS.ProcessEnv): Promise<{
|
|
29
|
+
id: string;
|
|
30
|
+
local_article_id: string;
|
|
31
|
+
artifact_dir: string;
|
|
32
|
+
started_at: string;
|
|
33
|
+
section_id: string | null;
|
|
34
|
+
status: "failed" | "prepared" | "finalized" | "cancelled" | "interrupted";
|
|
35
|
+
skills_version: string;
|
|
36
|
+
article_type?: string | undefined;
|
|
37
|
+
progress?: {
|
|
38
|
+
attempt: string;
|
|
39
|
+
sequence: number;
|
|
40
|
+
next_attempt?: string | undefined;
|
|
41
|
+
article?: {
|
|
42
|
+
id: string;
|
|
43
|
+
revision: string;
|
|
44
|
+
status: "draft" | "published";
|
|
45
|
+
editor_url: string;
|
|
46
|
+
public_url: string | null;
|
|
47
|
+
repository_connection?: {
|
|
48
|
+
state: "not_connected" | "connected" | "disconnected" | "suspended";
|
|
49
|
+
connect_url: string;
|
|
50
|
+
capabilities: {
|
|
51
|
+
sections: boolean;
|
|
52
|
+
suggestions: boolean;
|
|
53
|
+
code_analysis: boolean;
|
|
54
|
+
maintenance: boolean;
|
|
55
|
+
};
|
|
56
|
+
writer?: {
|
|
57
|
+
version: 1;
|
|
58
|
+
actions: Partial<Record<"read_articles" | "create_article" | "update_article" | "edit_article" | "publish_article" | "unpublish_article" | "delete_article" | "find_article_gaps" | "suggest_sections" | "recommend_articles" | "review_sections" | "review_recommendations" | "create_video_walkthrough" | "get_operation" | "generate_help_centre", {
|
|
59
|
+
action: "read_articles" | "create_article" | "update_article" | "edit_article" | "publish_article" | "unpublish_article" | "delete_article" | "find_article_gaps" | "suggest_sections" | "recommend_articles" | "review_sections" | "review_recommendations" | "create_video_walkthrough" | "get_operation" | "generate_help_centre";
|
|
60
|
+
allowed: boolean;
|
|
61
|
+
execution: "local" | "remote" | "hosted";
|
|
62
|
+
required_scopes: string[];
|
|
63
|
+
next_step: {
|
|
64
|
+
code: string;
|
|
65
|
+
message: string;
|
|
66
|
+
requested_action: "read_articles" | "create_article" | "update_article" | "edit_article" | "publish_article" | "unpublish_article" | "delete_article" | "find_article_gaps" | "suggest_sections" | "recommend_articles" | "review_sections" | "review_recommendations" | "create_video_walkthrough" | "get_operation" | "generate_help_centre";
|
|
67
|
+
missing_scopes?: ("read" | "import" | "publish" | "manage" | "generate")[] | undefined;
|
|
68
|
+
url?: string | undefined;
|
|
69
|
+
} | null;
|
|
70
|
+
}>>;
|
|
71
|
+
} | undefined;
|
|
72
|
+
} | undefined;
|
|
73
|
+
} | undefined;
|
|
74
|
+
article_hash?: string | undefined;
|
|
75
|
+
image_hashes?: Record<string, string> | undefined;
|
|
76
|
+
last_heartbeat?: number | undefined;
|
|
77
|
+
open_attempted?: boolean | undefined;
|
|
78
|
+
browser_opened?: boolean | undefined;
|
|
79
|
+
sync_error?: string | undefined;
|
|
80
|
+
sync_failures?: number | undefined;
|
|
81
|
+
pending?: {
|
|
82
|
+
sequence: number;
|
|
83
|
+
directory: string;
|
|
84
|
+
} | undefined;
|
|
85
|
+
} | undefined;
|
|
86
|
+
title?: string | undefined;
|
|
87
|
+
api_origin?: string | undefined;
|
|
88
|
+
project_id?: string | undefined;
|
|
89
|
+
codebase_dir?: string | undefined;
|
|
90
|
+
prefer_background?: boolean | undefined;
|
|
91
|
+
open_when_ready?: boolean | undefined;
|
|
92
|
+
execution_mode?: "background" | "foreground" | undefined;
|
|
93
|
+
host_task_id?: string | undefined;
|
|
94
|
+
writer_token?: string | undefined;
|
|
95
|
+
writer_started_at?: string | undefined;
|
|
96
|
+
writer_completed_at?: string | undefined;
|
|
97
|
+
first_writer_started_at?: string | undefined;
|
|
98
|
+
ready_for_review_at?: string | undefined;
|
|
99
|
+
repository_invitation?: {
|
|
100
|
+
id: string;
|
|
101
|
+
message: string;
|
|
102
|
+
connect_url: string;
|
|
103
|
+
} | undefined;
|
|
104
|
+
repository_reminder_checked?: boolean | undefined;
|
|
105
|
+
hosting_invitation?: {
|
|
106
|
+
id: string;
|
|
107
|
+
message: string;
|
|
108
|
+
} | undefined;
|
|
109
|
+
hosting_reminder_checked?: boolean | undefined;
|
|
110
|
+
session_id?: string | undefined;
|
|
111
|
+
updated_at?: string | undefined;
|
|
112
|
+
phase?: "published" | "failed" | "prepared" | "cancelled" | "interrupted" | "writing" | "finalizing" | "uploading" | "upload_failed" | "ready_for_review" | "saved" | undefined;
|
|
113
|
+
bundle_dir?: string | undefined;
|
|
114
|
+
bundle_hash?: string | undefined;
|
|
115
|
+
local_export?: {
|
|
116
|
+
directory: string;
|
|
117
|
+
markdown_path?: string | undefined;
|
|
118
|
+
sync_error?: string | undefined;
|
|
119
|
+
} | undefined;
|
|
120
|
+
export_path?: string | undefined;
|
|
121
|
+
remote?: {
|
|
122
|
+
id: string;
|
|
123
|
+
revision: string;
|
|
124
|
+
status: "draft" | "published";
|
|
125
|
+
editor_url: string;
|
|
126
|
+
public_url: string | null;
|
|
127
|
+
repository_connection?: {
|
|
128
|
+
state: "not_connected" | "connected" | "disconnected" | "suspended";
|
|
129
|
+
connect_url: string;
|
|
130
|
+
capabilities: {
|
|
131
|
+
sections: boolean;
|
|
132
|
+
suggestions: boolean;
|
|
133
|
+
code_analysis: boolean;
|
|
134
|
+
maintenance: boolean;
|
|
135
|
+
};
|
|
136
|
+
writer?: {
|
|
137
|
+
version: 1;
|
|
138
|
+
actions: Partial<Record<"read_articles" | "create_article" | "update_article" | "edit_article" | "publish_article" | "unpublish_article" | "delete_article" | "find_article_gaps" | "suggest_sections" | "recommend_articles" | "review_sections" | "review_recommendations" | "create_video_walkthrough" | "get_operation" | "generate_help_centre", {
|
|
139
|
+
action: "read_articles" | "create_article" | "update_article" | "edit_article" | "publish_article" | "unpublish_article" | "delete_article" | "find_article_gaps" | "suggest_sections" | "recommend_articles" | "review_sections" | "review_recommendations" | "create_video_walkthrough" | "get_operation" | "generate_help_centre";
|
|
140
|
+
allowed: boolean;
|
|
141
|
+
execution: "local" | "remote" | "hosted";
|
|
142
|
+
required_scopes: string[];
|
|
143
|
+
next_step: {
|
|
144
|
+
code: string;
|
|
145
|
+
message: string;
|
|
146
|
+
requested_action: "read_articles" | "create_article" | "update_article" | "edit_article" | "publish_article" | "unpublish_article" | "delete_article" | "find_article_gaps" | "suggest_sections" | "recommend_articles" | "review_sections" | "review_recommendations" | "create_video_walkthrough" | "get_operation" | "generate_help_centre";
|
|
147
|
+
missing_scopes?: ("read" | "import" | "publish" | "manage" | "generate")[] | undefined;
|
|
148
|
+
url?: string | undefined;
|
|
149
|
+
} | null;
|
|
150
|
+
}>>;
|
|
151
|
+
} | undefined;
|
|
152
|
+
} | undefined;
|
|
153
|
+
} | undefined;
|
|
154
|
+
error?: {
|
|
155
|
+
code: string;
|
|
156
|
+
message: string;
|
|
157
|
+
} | undefined;
|
|
158
|
+
}>;
|
|
159
|
+
export declare function finishWriter(args: string[], env: NodeJS.ProcessEnv, timeoutMs?: number): Promise<{
|
|
160
|
+
status: string;
|
|
161
|
+
run_id: string;
|
|
162
|
+
markdown_path: string;
|
|
163
|
+
instructions: string;
|
|
164
|
+
editor_url?: undefined;
|
|
165
|
+
} | {
|
|
166
|
+
status: string;
|
|
167
|
+
run_id: string;
|
|
168
|
+
editor_url: string;
|
|
169
|
+
instructions: string;
|
|
170
|
+
markdown_path?: undefined;
|
|
171
|
+
}>;
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { readFile } from 'node:fs/promises';
|
|
3
|
+
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
4
|
+
import { Workspace } from './workspace.js';
|
|
5
|
+
import { Runs, runSchema } from './runs.js';
|
|
6
|
+
import { bindingSchema, contextSchema } from './schema.js';
|
|
7
|
+
import { parse, snapshot } from './artifacts.js';
|
|
8
|
+
import { fail, publicError, SupportPagesError } from './errors.js';
|
|
9
|
+
import { setTimeout as delay } from 'node:timers/promises';
|
|
10
|
+
import { spawn } from 'node:child_process';
|
|
11
|
+
import { constants } from 'node:os';
|
|
12
|
+
import { writerReportingInstruction } from './writer-agent.js';
|
|
13
|
+
/** Screenshots per locally written article. The engine treats this as a hard
|
|
14
|
+
* limit (RTFM_MAX_IMAGES); each mockup costs minutes of model time. */
|
|
15
|
+
export const writerScreenshotLimit = 3;
|
|
16
|
+
const recovery = 'Return to the main agent. Before drafting, call supportpages_status and supportpages_prepare_article, or supportpages_retry_article for an existing stopped run. Pass the returned task brief to SupportPages.io. Do not generate from a bare topic or bypass this check by reading the engine directly.';
|
|
17
|
+
export function writerEntry(workspace, stateRoot, runId, skillsDir, writerToken) {
|
|
18
|
+
const command = process.execPath;
|
|
19
|
+
const args = [fileURLToPath(import.meta.url), workspace, stateRoot, runId, skillsDir, ...(writerToken ? [writerToken] : [])];
|
|
20
|
+
const quote = (value) => "'" + value.replaceAll("'", "'\\''") + "'";
|
|
21
|
+
const shell_command = [command, ...args].map(quote).join(' ');
|
|
22
|
+
const execution = { command, args: [...args, '--exec'], shell_command: `${shell_command} --exec`,
|
|
23
|
+
instruction: `Run every generation, rendering and validation command through this prefix: ${shell_command} --exec <executable> <arguments...>. It loads this attempt's saved environment and runs in the application directory. For shell variables, pipes or multiple commands, use ${shell_command} --exec /bin/sh -c '<script>' so variables expand inside the configured child shell. RTFM_WORKSPACE, RTFM_CONTEXT_FILE, RTFM_OUTPUT_DIR, RTFM_SKILLS_DIR, RTFM_MAX_IMAGES, OUT and the bundled runtime PATH are set automatically for every command. Do not rely on exports from a previous shell or manually reconstruct the environment.` };
|
|
24
|
+
const completion = { command, args: [...args, '--complete'], shell_command: `${shell_command} --complete`, instruction: `After the entire writing, rendering and validation pipeline succeeds, run ${shell_command} --complete. No environment exports are needed. This signals successful writing and waits for the MCP to confirm final draft delivery. Stop editing artifacts after this command. Only report success when it returns ready_for_review, published or saved (saved means the article was written to a local folder with no editor link). If it fails or reports delivery_pending/upload_failed, relay its recovery instructions to the parent; do not claim delivery or regenerate. Do not ask the user to publish; the parent handles consent.` };
|
|
25
|
+
return { command, args, shell_command, execution, completion, instruction: `Before reading generation skills or writing any content, run this complete command exactly as supplied: ${shell_command}. No environment exports are needed. This checks the prepared MCP run, records writer startup for live previews and prints the private article instructions and command wrapper. Follow them only if the command succeeds. If it fails, stop and relay its specific error to the main agent.` };
|
|
26
|
+
}
|
|
27
|
+
/** Local workflow gate, not a security boundary: the writer retains normal filesystem access. */
|
|
28
|
+
async function checkedWriter(args) {
|
|
29
|
+
const [workspace, stateRoot, runId, skillsDir, writerToken] = args;
|
|
30
|
+
if (![4, 5].includes(args.length) || !workspace || !stateRoot || !runId || !skillsDir ||
|
|
31
|
+
!/^\.rtfm\/supportpages(?:\/dev\/[a-f0-9]{16})?$/.test(stateRoot))
|
|
32
|
+
fail('invalid_run', 'Missing prepared run arguments.');
|
|
33
|
+
const ws = await Workspace.create(workspace);
|
|
34
|
+
const runs = new Runs(ws, stateRoot);
|
|
35
|
+
const run = await runs.read(runId);
|
|
36
|
+
const contextPath = `${stateRoot}/runs/${runId}/context.json`;
|
|
37
|
+
const context = parse(contextSchema, await ws.json(contextPath));
|
|
38
|
+
if (run.writer_token !== writerToken)
|
|
39
|
+
fail('stale_writer', 'This command does not match the current writer attempt. Use the latest task brief from the parent.');
|
|
40
|
+
if (run.project_id) {
|
|
41
|
+
const binding = parse(bindingSchema, await ws.json(`${stateRoot}/binding.json`));
|
|
42
|
+
if (run.project_id !== binding.project_id || run.api_origin !== binding.api_origin || context.project.id !== binding.project_id) {
|
|
43
|
+
fail('destination_mismatch', 'The prepared article no longer matches the connected help centre. Return to the parent to check the project connection.');
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
else if (!context.local || !await ws.exists(`${stateRoot}/local.json`) || await ws.exists(`${stateRoot}/binding.json`)) {
|
|
47
|
+
// A run prepared for local saving must still be in a folder that saves locally.
|
|
48
|
+
fail('destination_mismatch', 'The prepared article was written for local saving, but this folder now has a help centre. Return to the parent to prepare it again.');
|
|
49
|
+
}
|
|
50
|
+
// Saved, validated state is authoritative; inherited RTFM_* values may belong
|
|
51
|
+
// to another article, or may be absent in a fresh agent shell.
|
|
52
|
+
const environment = {
|
|
53
|
+
RTFM_CONTEXT_FILE: await ws.resolve(contextPath),
|
|
54
|
+
RTFM_WORKSPACE: await ws.resolve(run.codebase_dir ?? '.'),
|
|
55
|
+
RTFM_OUTPUT_DIR: await ws.resolve(run.artifact_dir),
|
|
56
|
+
// Engine commands resolve their scripts through this, not a home-directory shortcut.
|
|
57
|
+
RTFM_SKILLS_DIR: skillsDir,
|
|
58
|
+
RTFM_MAX_IMAGES: String(writerScreenshotLimit),
|
|
59
|
+
};
|
|
60
|
+
return { ws, runs, run, stateRoot, skillsDir, environment };
|
|
61
|
+
}
|
|
62
|
+
async function activeWriter(args) {
|
|
63
|
+
const checked = await checkedWriter(args);
|
|
64
|
+
const { ws, run, stateRoot } = checked;
|
|
65
|
+
const active = parse(runSchema, await ws.json(`${stateRoot}/active-run.json`));
|
|
66
|
+
if (active.id !== run.id || run.status !== 'prepared' || run.writer_completed_at ||
|
|
67
|
+
!['prepared', 'writing'].includes(run.phase ?? 'prepared')) {
|
|
68
|
+
fail('writer_not_active', 'This writer is stopped, replaced or already finished. Return to the parent and check supportpages_status.');
|
|
69
|
+
}
|
|
70
|
+
return checked;
|
|
71
|
+
}
|
|
72
|
+
async function writerLock(args, operation) {
|
|
73
|
+
if (!args[0])
|
|
74
|
+
fail('invalid_run', 'Missing prepared workspace.');
|
|
75
|
+
const ws = await Workspace.create(args[0]);
|
|
76
|
+
// Retry only lock acquisition; never remove another process's lock.
|
|
77
|
+
const deadline = Date.now() + 35_000;
|
|
78
|
+
for (;;) {
|
|
79
|
+
try {
|
|
80
|
+
return await ws.lock(operation);
|
|
81
|
+
}
|
|
82
|
+
catch (error) {
|
|
83
|
+
if (error.code !== 'workspace_busy' || Date.now() >= deadline)
|
|
84
|
+
throw error;
|
|
85
|
+
await delay(100);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
// The optional environment argument remains accepted for older in-process callers.
|
|
90
|
+
export async function loadWriterInstructions(args, _env) {
|
|
91
|
+
try {
|
|
92
|
+
return await writerLock(args, async () => {
|
|
93
|
+
const { ws, runs, run, stateRoot, skillsDir, environment } = await activeWriter(args);
|
|
94
|
+
const skill = path.join(skillsDir, 'generate-illustrated-article', 'SKILL.md');
|
|
95
|
+
let instructions;
|
|
96
|
+
try {
|
|
97
|
+
instructions = await readFile(skill, 'utf8');
|
|
98
|
+
}
|
|
99
|
+
catch {
|
|
100
|
+
fail('missing_dependency', 'The installed article instructions could not be read. Repair the skills installation before retrying this command.');
|
|
101
|
+
}
|
|
102
|
+
if (!run.writer_started_at)
|
|
103
|
+
await runs.save({ ...run, phase: 'writing', writer_started_at: new Date().toISOString() });
|
|
104
|
+
const entrypoint = writerEntry(ws.root, stateRoot, run.id, skillsDir, run.writer_token);
|
|
105
|
+
const reporting = writerReportingInstruction(run.execution_mode ? run.execution_mode === 'background' : run.prefer_background === true);
|
|
106
|
+
return `SupportPages.io prepared run: ${run.id}\nEngine file: ${skill}\nResolve relative engine scripts and resources against ${path.dirname(skill)}.\nUse RTFM_OUTPUT_DIR as OUT and RTFM_CONTEXT_FILE for this run. The main agent handles all MCP calls.\nApplication directory: ${environment.RTFM_WORKSPACE}\nArticle output directory: ${environment.RTFM_OUTPUT_DIR}\nContext file: ${environment.RTFM_CONTEXT_FILE}\n\nReporting policy (takes precedence over routine progress requests in the engine):\n${reporting}\n\nRequired command wrapper:\n${entrypoint.execution.instruction}\n\n${instructions}\n\nRequired execution and final handoff:\n${entrypoint.execution.instruction}\n${entrypoint.completion.instruction}\n${reporting}\n`;
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
catch (error) {
|
|
110
|
+
const safe = publicError(error);
|
|
111
|
+
fail(safe.code, `SupportPages.io writer entry check failed: ${safe.message} ${recovery}`);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
/** Each command gets its own prepared environment; no shell state must survive
|
|
115
|
+
* between agent tool calls. Release the state lock before running so the relay
|
|
116
|
+
* can continue delivering previews. The host still owns stopping old writers. */
|
|
117
|
+
export async function runWriterCommand(args, command, env = process.env) {
|
|
118
|
+
if (!command[0])
|
|
119
|
+
fail('invalid_command', 'Append an executable and its arguments after --exec.');
|
|
120
|
+
const { environment, run } = await writerLock(args, () => activeWriter(args));
|
|
121
|
+
if (!run.writer_started_at)
|
|
122
|
+
fail('writer_not_started', 'Run the supplied writer entrypoint before executing article commands.');
|
|
123
|
+
const childEnv = { ...env, ...environment, OUT: environment.RTFM_OUTPUT_DIR,
|
|
124
|
+
PWD: environment.RTFM_WORKSPACE, PATH: path.dirname(process.execPath) + path.delimiter + (env.PATH ?? '') };
|
|
125
|
+
delete childEnv.SUPPORTPAGES_API_TOKEN;
|
|
126
|
+
delete childEnv.SUPPORTPAGES_API_TOKEN_FILE;
|
|
127
|
+
const child = spawn(command[0], command.slice(1), { cwd: environment.RTFM_WORKSPACE, env: childEnv, stdio: 'inherit', detached: process.platform !== 'win32' });
|
|
128
|
+
const signalGroup = (signal) => {
|
|
129
|
+
if (!child.pid)
|
|
130
|
+
return;
|
|
131
|
+
try {
|
|
132
|
+
process.kill(process.platform === 'win32' ? child.pid : -child.pid, signal);
|
|
133
|
+
}
|
|
134
|
+
catch {
|
|
135
|
+
child.kill(signal);
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
let forceTimer;
|
|
139
|
+
let interrupted;
|
|
140
|
+
const stop = (signal) => {
|
|
141
|
+
interrupted = signal;
|
|
142
|
+
signalGroup(signal);
|
|
143
|
+
forceTimer ??= setTimeout(() => signalGroup('SIGKILL'), 1500);
|
|
144
|
+
};
|
|
145
|
+
const onInterrupt = () => stop('SIGINT'), onTerminate = () => stop('SIGTERM');
|
|
146
|
+
process.on('SIGINT', onInterrupt);
|
|
147
|
+
process.on('SIGTERM', onTerminate);
|
|
148
|
+
try {
|
|
149
|
+
return await new Promise((resolve, reject) => {
|
|
150
|
+
child.once('error', () => reject(new SupportPagesError('command_unavailable', 'The writer command could not start. Check its executable and installation.')));
|
|
151
|
+
child.once('close', (code, signal) => resolve(interrupted ? 128 + constants.signals[interrupted] : code ?? (signal ? 128 + constants.signals[signal] : 1)));
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
finally {
|
|
155
|
+
clearTimeout(forceTimer);
|
|
156
|
+
if (interrupted)
|
|
157
|
+
signalGroup('SIGKILL');
|
|
158
|
+
process.off('SIGINT', onInterrupt);
|
|
159
|
+
process.off('SIGTERM', onTerminate);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
/** Explicit writer success; no API credentials or network requests in this process. */
|
|
163
|
+
export async function requestWriterCompletion(args, _env) {
|
|
164
|
+
return writerLock(args, async () => {
|
|
165
|
+
const { ws, runs, run, stateRoot } = await checkedWriter(args);
|
|
166
|
+
if (!run.writer_token)
|
|
167
|
+
fail('invalid_run', 'Use the finish command from the current task brief.');
|
|
168
|
+
if (run.remote && ['ready_for_review', 'published'].includes(run.phase ?? ''))
|
|
169
|
+
return run;
|
|
170
|
+
if (run.phase === 'saved' && run.status === 'finalized')
|
|
171
|
+
return run;
|
|
172
|
+
const active = parse(runSchema, await ws.json(`${stateRoot}/active-run.json`));
|
|
173
|
+
if (active.id !== run.id || run.status !== 'prepared' || run.phase !== 'writing') {
|
|
174
|
+
if (run.writer_completed_at && run.status === 'finalized')
|
|
175
|
+
return run;
|
|
176
|
+
fail('invalid_run', 'This writer is not running. Return to the parent and check supportpages_status.');
|
|
177
|
+
}
|
|
178
|
+
if (!run.writer_completed_at) {
|
|
179
|
+
// Share final bundle checks with complete_article. A full set of preview
|
|
180
|
+
// images alone cannot signal success, nor can stale or failed validation.
|
|
181
|
+
await snapshot(ws, run.artifact_dir, run.started_at);
|
|
182
|
+
await runs.save({ ...run, writer_completed_at: new Date().toISOString() });
|
|
183
|
+
}
|
|
184
|
+
return runs.read(run.id);
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
export async function finishWriter(args, env, timeoutMs = 125_000) {
|
|
188
|
+
const requested = await requestWriterCompletion(args, env);
|
|
189
|
+
const ws = await Workspace.create(args[0]);
|
|
190
|
+
const runs = new Runs(ws, args[1]);
|
|
191
|
+
const recovery = requested.project_id
|
|
192
|
+
? `The parent must call supportpages_complete_article with run_id=${requested.id} and completed=true. Do not regenerate, mark the writer failed or claim the editor is ready until delivery is confirmed.`
|
|
193
|
+
: `The parent must call supportpages_complete_article with run_id=${requested.id} and completed=true to save the article. Do not regenerate or mark the writer failed.`;
|
|
194
|
+
const deadline = Date.now() + timeoutMs;
|
|
195
|
+
for (;;) {
|
|
196
|
+
const run = await runs.read(requested.id);
|
|
197
|
+
if (run.writer_token !== requested.writer_token)
|
|
198
|
+
fail('invalid_run', 'This writer was replaced. Return to the parent without changing the new attempt.');
|
|
199
|
+
if (run.phase === 'saved' && run.export_path) {
|
|
200
|
+
return { status: 'saved', run_id: run.id, markdown_path: run.export_path,
|
|
201
|
+
instructions: 'The article is saved locally; there is no editor link. Return this result to the parent. The parent must call supportpages_complete_article for the final user-facing response; the writer must not ask to publish.' };
|
|
202
|
+
}
|
|
203
|
+
if (run.remote && ['ready_for_review', 'published'].includes(run.phase ?? '')) {
|
|
204
|
+
return { status: run.remote.status === 'published' ? 'published' : 'ready_for_review', run_id: run.id, editor_url: run.remote.editor_url,
|
|
205
|
+
instructions: 'Final delivery is confirmed. Return this result to the parent. The parent must call supportpages_complete_article for the final user-facing response and publication consent; the writer must not ask to publish.' };
|
|
206
|
+
}
|
|
207
|
+
if (run.error)
|
|
208
|
+
fail(run.phase === 'upload_failed' ? 'upload_failed' : run.error.code, `${run.error.message} ${recovery}`);
|
|
209
|
+
if (['failed', 'interrupted', 'cancelled'].includes(run.status))
|
|
210
|
+
fail('invalid_run', 'This run has stopped. Return to the parent and check supportpages_status.');
|
|
211
|
+
if (Date.now() >= deadline)
|
|
212
|
+
fail('delivery_pending', `The MCP has not confirmed final delivery. ${recovery}`);
|
|
213
|
+
await delay(250);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
if (process.argv[1] && pathToFileURL(path.resolve(process.argv[1])).href === import.meta.url) {
|
|
217
|
+
const args = process.argv.slice(2);
|
|
218
|
+
try {
|
|
219
|
+
const execute = args.indexOf('--exec');
|
|
220
|
+
if (execute !== -1)
|
|
221
|
+
process.exitCode = await runWriterCommand(args.slice(0, execute), args.slice(execute + 1));
|
|
222
|
+
else
|
|
223
|
+
process.stdout.write(args.at(-1) === '--complete'
|
|
224
|
+
? JSON.stringify(await finishWriter(args.slice(0, -1), process.env)) + '\n'
|
|
225
|
+
: await loadWriterInstructions(args, process.env));
|
|
226
|
+
}
|
|
227
|
+
catch (error) {
|
|
228
|
+
const safe = publicError(error);
|
|
229
|
+
process.stderr.write(`${safe.code}: ${error.message}\n`);
|
|
230
|
+
process.exitCode = 1;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
//# sourceMappingURL=writer-entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"writer-entry.js","sourceRoot":"","sources":["../src/writer-entry.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,E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OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,YAAY;gBACpD,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI;gBAC3E,CAAC,CAAC,MAAM,sBAAsB,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;IACvD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC;QAChC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,IAAI,KAAM,KAAe,CAAC,OAAO,IAAI,CAAC,CAAC;QAAC,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IAC5F,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const writingStylePresets: Record<string, {
|
|
2
|
+
label: string;
|
|
3
|
+
hint: string;
|
|
4
|
+
}>;
|
|
5
|
+
export declare const defaultWritingStyle = "friendly";
|
|
6
|
+
/** A preset keyword expands to its guidance; anything else is free-form guidance used verbatim. */
|
|
7
|
+
export declare function composeWritingStyle(tone?: string | null): string;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// Local workspaces have no server to compose writing guidance. These four tone
|
|
2
|
+
// presets mirror the SupportPages.io WritingStyle module so a locally written article sounds
|
|
3
|
+
// the same as one generated for a help centre with the same setting.
|
|
4
|
+
export const writingStylePresets = {
|
|
5
|
+
friendly: { label: 'Friendly & conversational', hint: 'Warm, everyday language' },
|
|
6
|
+
minimal: { label: 'Minimal & scannable', hint: 'Short explanations and easy-to-scan steps' },
|
|
7
|
+
technical: { label: 'Technical & precise', hint: 'Detailed explanations with precise terminology' },
|
|
8
|
+
formal: { label: 'Formal & professional', hint: 'Professional language with a more reserved tone' },
|
|
9
|
+
};
|
|
10
|
+
const toneGuidance = {
|
|
11
|
+
technical: [
|
|
12
|
+
'Voice: precise and authoritative. Assume the reader is comfortable with software and wants accuracy over reassurance.',
|
|
13
|
+
'Vocabulary: exact terminology — real field names, menu paths, error codes, and feature names. Don\'t soften technical terms.',
|
|
14
|
+
'Sentence structure: short, declarative sentences. State the action and its target directly.',
|
|
15
|
+
'Point of view: address the reader as "you", but skip pleasantries and filler.',
|
|
16
|
+
'Do: "Configure the SMTP relay with TLS enabled." / "Set the retention window in **Settings → Data**."',
|
|
17
|
+
'Don\'t: "Let\'s get your email all set up!" / "Don\'t worry, this part is easy."',
|
|
18
|
+
].join('\n'),
|
|
19
|
+
friendly: [
|
|
20
|
+
'Voice: warm and conversational, but never saccharine. Helpful colleague, not a marketing campaign.',
|
|
21
|
+
'Vocabulary: everyday language over jargon — "set up" rather than "configure", "turn on" rather than "enable" where it reads naturally.',
|
|
22
|
+
'Sentence structure: brief and natural. One friendly sentence beats three wordy ones.',
|
|
23
|
+
'Point of view: address the reader directly as "you".',
|
|
24
|
+
'Do: "Open **Settings** and pick the workspace you want to share." / "You\'re all set — changes save automatically."',
|
|
25
|
+
'Don\'t: "We\'re SO excited for you to try this amazing feature!" / corporate cheerfulness or exclamation pile-ups.',
|
|
26
|
+
].join('\n'),
|
|
27
|
+
minimal: [
|
|
28
|
+
'Voice: terse quick-reference, not a tutorial. Every word earns its place.',
|
|
29
|
+
'Vocabulary: plain and concrete. Name the control, name the action, stop.',
|
|
30
|
+
'Sentence structure: sentence fragments and imperative verbs. No introductions, transitions, or encouragement.',
|
|
31
|
+
'Point of view: implied "you" through imperatives.',
|
|
32
|
+
'Do: "Click **Save**." / "Enter your email." / "Select a plan."',
|
|
33
|
+
'Don\'t: "Now that you\'ve done that, the next thing you\'ll want to do is…" / any framing or wind-up.',
|
|
34
|
+
].join('\n'),
|
|
35
|
+
formal: [
|
|
36
|
+
'Voice: neutral and authoritative. Suitable for compliance or regulated contexts.',
|
|
37
|
+
'Vocabulary: complete, proper terms. No slang, no casual asides, no contractions ("do not", not "don\'t").',
|
|
38
|
+
'Sentence structure: complete, well-formed sentences — but concise; formal does not mean verbose.',
|
|
39
|
+
'Point of view: address the reader as "you" or use neutral phrasing ("Users may…"); maintain a professional distance.',
|
|
40
|
+
'Do: "Select **Save** to apply your changes." / "Ensure the certificate is valid before proceeding."',
|
|
41
|
+
'Don\'t: "Just hit save and you\'re good to go." / emoji, slang, or jokey asides.',
|
|
42
|
+
].join('\n'),
|
|
43
|
+
};
|
|
44
|
+
export const defaultWritingStyle = 'friendly';
|
|
45
|
+
/** A preset keyword expands to its guidance; anything else is free-form guidance used verbatim. */
|
|
46
|
+
export function composeWritingStyle(tone) {
|
|
47
|
+
const key = (tone ?? '').trim().toLowerCase();
|
|
48
|
+
if (!key)
|
|
49
|
+
return toneGuidance[defaultWritingStyle];
|
|
50
|
+
return toneGuidance[key] ?? tone.trim();
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=writing-style.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"writing-style.js","sourceRoot":"","sources":["../src/writing-style.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,6FAA6F;AAC7F,qEAAqE;AACrE,MAAM,CAAC,MAAM,mBAAmB,GAAoD;IAClF,QAAQ,EAAE,EAAE,KAAK,EAAE,2BAA2B,EAAE,IAAI,EAAE,yBAAyB,EAAE;IACjF,OAAO,EAAE,EAAE,KAAK,EAAE,qBAAqB,EAAE,IAAI,EAAE,2CAA2C,EAAE;IAC5F,SAAS,EAAE,EAAE,KAAK,EAAE,qBAAqB,EAAE,IAAI,EAAE,gDAAgD,EAAE;IACnG,MAAM,EAAE,EAAE,KAAK,EAAE,uBAAuB,EAAE,IAAI,EAAE,iDAAiD,EAAE;CACpG,CAAC;AAEF,MAAM,YAAY,GAA2B;IAC3C,SAAS,EAAE;QACT,uHAAuH;QACvH,8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