@solidnumber/cli 2.30.2 → 2.31.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.
@@ -0,0 +1,300 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MAC_SCRIPT = exports.WINDOWS_SCRIPT = exports.UI_TIMEOUT_MS = void 0;
4
+ exports.uiFrom = uiFrom;
5
+ exports.runUi = runUi;
6
+ exports.UI_TIMEOUT_MS = 10000;
7
+ const MAX_CONTROLS = 40;
8
+ // Single quotes only and no backtick: it is sent base64-encoded, so nothing on the way
9
+ // re-reads it, and nothing in it is built from an input.
10
+ exports.WINDOWS_SCRIPT = `
11
+ $ErrorActionPreference = 'Stop'
12
+ $T = [char]9
13
+ try {
14
+ Add-Type -AssemblyName UIAutomationClient
15
+ Add-Type -AssemblyName UIAutomationTypes
16
+ $mode = $env:SOLID_UI_MODE
17
+ $prog = $env:SOLID_UI_PROGRAM -replace '\\.exe$', ''
18
+ $ctl = $env:SOLID_UI_CONTROL
19
+ $val = $env:SOLID_UI_VALUE
20
+ $p = Get-Process -Name $prog -ErrorAction SilentlyContinue | Where-Object { $_.MainWindowHandle -ne 0 } | Select-Object -First 1
21
+ if (-not $p) { 'ERR' + $T + 'program_not_running'; exit 0 }
22
+ $AE = [System.Windows.Automation.AutomationElement]
23
+ $Scope = [System.Windows.Automation.TreeScope]::Descendants
24
+ $root = $AE::FromHandle($p.MainWindowHandle)
25
+ $all = $root.FindAll($Scope, [System.Windows.Automation.Condition]::TrueCondition)
26
+ function Kind($e) { return ($e.Current.ControlType.ProgrammaticName -replace '^ControlType\\.', '') }
27
+ function Val($e) {
28
+ if ($e.Current.IsPassword) { return '(hidden)' }
29
+ $o = $null
30
+ if ($e.TryGetCurrentPattern([System.Windows.Automation.ValuePattern]::Pattern, [ref]$o)) { return [string]$o.Current.Value }
31
+ if ($e.TryGetCurrentPattern([System.Windows.Automation.TogglePattern]::Pattern, [ref]$o)) { return [string]$o.Current.ToggleState }
32
+ if ($e.TryGetCurrentPattern([System.Windows.Automation.SelectionPattern]::Pattern, [ref]$o)) {
33
+ $s = $o.Current.GetSelection()
34
+ if ($s.Length -gt 0) { return [string]$s[0].Current.Name }
35
+ }
36
+ return ''
37
+ }
38
+ if ($mode -eq 'read') {
39
+ 'WIN' + $T + ($root.Current.Name -replace '\\s+', ' ')
40
+ $n = 0
41
+ foreach ($e in $all) {
42
+ $k = Kind $e
43
+ if (@('Button', 'Edit', 'ComboBox', 'CheckBox', 'RadioButton', 'TabItem', 'MenuItem', 'List', 'Hyperlink') -notcontains $k) { continue }
44
+ $name = [string]$e.Current.Name
45
+ if (-not $name) { continue }
46
+ 'CTL' + $T + $k + $T + ($name -replace '\\s+', ' ') + $T + ((Val $e) -replace '\\s+', ' ')
47
+ $n++
48
+ if ($n -ge 60) { break }
49
+ }
50
+ exit 0
51
+ }
52
+ if ($mode -eq 'set') {
53
+ foreach ($e in $all) {
54
+ $k = Kind $e
55
+ if (@('Edit', 'ComboBox') -notcontains $k) { continue }
56
+ if ([string]$e.Current.Name -ne $ctl) { continue }
57
+ if ($e.Current.IsPassword) { 'ERR' + $T + 'password_field'; exit 0 }
58
+ $o = $null
59
+ if ($e.TryGetCurrentPattern([System.Windows.Automation.ValuePattern]::Pattern, [ref]$o) -and (-not $o.Current.IsReadOnly)) {
60
+ $o.SetValue($val)
61
+ } elseif ($k -eq 'ComboBox') {
62
+ $x = $null
63
+ if ($e.TryGetCurrentPattern([System.Windows.Automation.ExpandCollapsePattern]::Pattern, [ref]$x)) { $x.Expand() }
64
+ $cond = New-Object System.Windows.Automation.PropertyCondition($AE::NameProperty, $val)
65
+ $item = $e.FindFirst($Scope, $cond)
66
+ if (-not $item) { if ($x) { $x.Collapse() }; 'ERR' + $T + 'value_not_offered'; exit 0 }
67
+ $s = $null
68
+ if ($item.TryGetCurrentPattern([System.Windows.Automation.SelectionItemPattern]::Pattern, [ref]$s)) { $s.Select() }
69
+ if ($x) { $x.Collapse() }
70
+ } else { 'ERR' + $T + 'control_read_only'; exit 0 }
71
+ 'OK' + $T + ((Val $e) -replace '\\s+', ' ')
72
+ exit 0
73
+ }
74
+ 'ERR' + $T + 'control_not_found'
75
+ exit 0
76
+ }
77
+ if ($mode -eq 'press') {
78
+ foreach ($e in $all) {
79
+ $k = Kind $e
80
+ if (@('Button', 'CheckBox', 'RadioButton', 'TabItem', 'MenuItem', 'Hyperlink') -notcontains $k) { continue }
81
+ if ([string]$e.Current.Name -ne $ctl) { continue }
82
+ if (-not $e.Current.IsEnabled) { 'ERR' + $T + 'control_disabled'; exit 0 }
83
+ $o = $null
84
+ if ($e.TryGetCurrentPattern([System.Windows.Automation.InvokePattern]::Pattern, [ref]$o)) { $o.Invoke() }
85
+ elseif ($e.TryGetCurrentPattern([System.Windows.Automation.TogglePattern]::Pattern, [ref]$o)) { $o.Toggle() }
86
+ elseif ($e.TryGetCurrentPattern([System.Windows.Automation.SelectionItemPattern]::Pattern, [ref]$o)) { $o.Select() }
87
+ else { 'ERR' + $T + 'control_cannot_be_pressed'; exit 0 }
88
+ 'OK'
89
+ exit 0
90
+ }
91
+ 'ERR' + $T + 'control_not_found'
92
+ exit 0
93
+ }
94
+ 'ERR' + $T + 'unknown_mode'
95
+ } catch {
96
+ 'ERR' + $T + 'script' + $T + '0'
97
+ }
98
+ `;
99
+ // `on run argv`: the program, the label and the value arrive as arguments.
100
+ exports.MAC_SCRIPT = `
101
+ on labelOf(el)
102
+ tell application "System Events"
103
+ set nm to missing value
104
+ try
105
+ set nm to name of el
106
+ end try
107
+ if nm is missing value or nm is "" then
108
+ try
109
+ set nm to description of el
110
+ end try
111
+ end if
112
+ if nm is missing value then set nm to ""
113
+ return nm as text
114
+ end tell
115
+ end labelOf
116
+
117
+ on valueOf(el)
118
+ tell application "System Events"
119
+ set sr to ""
120
+ try
121
+ set sr to subrole of el
122
+ end try
123
+ if sr is "AXSecureTextField" then return "(hidden)"
124
+ set v to ""
125
+ try
126
+ set v to (value of el) as text
127
+ end try
128
+ return v
129
+ end tell
130
+ end valueOf
131
+
132
+ on run argv
133
+ set mode to item 1 of argv
134
+ set prog to item 2 of argv
135
+ set ctl to ""
136
+ set val to ""
137
+ if (count of argv) > 2 then set ctl to item 3 of argv
138
+ if (count of argv) > 3 then set val to item 4 of argv
139
+ try
140
+ tell application "System Events"
141
+ if not (exists application process prog) then return "ERR" & tab & "program_not_running"
142
+ tell application process prog
143
+ if (count of windows) is 0 then return "ERR" & tab & "no_window"
144
+ set w to window 1
145
+ set wname to ""
146
+ try
147
+ set wname to (name of w) as text
148
+ end try
149
+ set els to entire contents of w
150
+ end tell
151
+ if mode is "read" then
152
+ set out to "WIN" & tab & wname
153
+ set n to 0
154
+ repeat with el in els
155
+ set r to ""
156
+ try
157
+ set r to role of el
158
+ end try
159
+ if r is in {"AXButton", "AXTextField", "AXTextArea", "AXCheckBox", "AXRadioButton", "AXPopUpButton", "AXComboBox", "AXMenuButton"} then
160
+ set nm to my labelOf(el)
161
+ if nm is not "" then
162
+ set out to out & linefeed & "CTL" & tab & r & tab & nm & tab & my valueOf(el)
163
+ set n to n + 1
164
+ if n is greater than or equal to 60 then exit repeat
165
+ end if
166
+ end if
167
+ end repeat
168
+ return out
169
+ end if
170
+ if mode is "set" then
171
+ repeat with el in els
172
+ set r to ""
173
+ try
174
+ set r to role of el
175
+ end try
176
+ if r is in {"AXTextField", "AXTextArea", "AXComboBox", "AXPopUpButton"} then
177
+ if my labelOf(el) is ctl then
178
+ set sr to ""
179
+ try
180
+ set sr to subrole of el
181
+ end try
182
+ if sr is "AXSecureTextField" then return "ERR" & tab & "password_field"
183
+ if r is "AXPopUpButton" then
184
+ click el
185
+ delay 0.3
186
+ try
187
+ click menu item val of menu 1 of el
188
+ on error
189
+ key code 53
190
+ return "ERR" & tab & "value_not_offered"
191
+ end try
192
+ else
193
+ set value of el to val
194
+ end if
195
+ delay 0.2
196
+ return "OK" & tab & my valueOf(el)
197
+ end if
198
+ end if
199
+ end repeat
200
+ return "ERR" & tab & "control_not_found"
201
+ end if
202
+ if mode is "press" then
203
+ repeat with el in els
204
+ set r to ""
205
+ try
206
+ set r to role of el
207
+ end try
208
+ if r is in {"AXButton", "AXCheckBox", "AXRadioButton", "AXMenuButton"} then
209
+ if my labelOf(el) is ctl then
210
+ set canPress to true
211
+ try
212
+ set canPress to enabled of el
213
+ end try
214
+ if canPress is false then return "ERR" & tab & "control_disabled"
215
+ click el
216
+ return "OK"
217
+ end if
218
+ end if
219
+ end repeat
220
+ return "ERR" & tab & "control_not_found"
221
+ end if
222
+ end tell
223
+ return "ERR" & tab & "unknown_mode"
224
+ on error errText number errNum
225
+ return "ERR" & tab & "script" & tab & (errNum as text)
226
+ end try
227
+ end run
228
+ `;
229
+ const KINDS = {
230
+ AXButton: 'Button', AXMenuButton: 'Button', Button: 'Button', Hyperlink: 'Link',
231
+ AXTextField: 'Field', AXTextArea: 'Field', Edit: 'Field',
232
+ AXPopUpButton: 'List', AXComboBox: 'List', ComboBox: 'List', List: 'List',
233
+ AXCheckBox: 'Tick box', CheckBox: 'Tick box', AXRadioButton: 'Option', RadioButton: 'Option',
234
+ TabItem: 'Tab', MenuItem: 'Menu item',
235
+ };
236
+ // The system refused to let this program read or drive another one.
237
+ const NOT_PERMITTED = new Set(['-1719', '-25211', '-1743', '-10004']);
238
+ const REASONS = new Set(['program_not_running', 'no_window', 'control_not_found', 'password_field', 'value_not_offered',
239
+ 'control_read_only', 'control_disabled', 'control_cannot_be_pressed']);
240
+ const tidy = (text, max) => text.replace(/\s+/g, ' ').trim().slice(0, max);
241
+ /** PURE. What a script printed → what it means. Anything unreadable is a failure. */
242
+ function uiFrom(stdout) {
243
+ const lines = stdout.split(/\r?\n/).map((l) => l.replace(/\s+$/, '')).filter(Boolean);
244
+ if (!lines.length)
245
+ return { error: 'could_not_read_window' };
246
+ const first = lines[0].split('\t');
247
+ if (first[0] === 'ERR') {
248
+ if (first[1] === 'script')
249
+ return { error: NOT_PERMITTED.has(first[2] || '') ? 'not_permitted' : 'could_not_read_window' };
250
+ return { error: REASONS.has(first[1] || '') ? first[1] : 'could_not_read_window' };
251
+ }
252
+ if (first[0] === 'OK')
253
+ return { ok: true, value: tidy(first.slice(1).join(' '), 120) };
254
+ if (first[0] !== 'WIN')
255
+ return { error: 'could_not_read_window' };
256
+ const controls = [];
257
+ for (const line of lines.slice(1)) {
258
+ const [tag, kind, name, value] = line.split('\t');
259
+ if (tag !== 'CTL' || !name || controls.length >= MAX_CONTROLS)
260
+ continue;
261
+ const held = tidy(value || '', 60);
262
+ controls.push(`${KINDS[kind] || 'Control'}: ${tidy(name, 50)}${held ? ` = ${held}` : ''}`);
263
+ }
264
+ return { window: tidy(first.slice(1).join(' '), 80), controls };
265
+ }
266
+ async function runScript(mode, platform, inputs, exec) {
267
+ if (platform === 'windows') {
268
+ const out = await exec('powershell.exe', ['-NoProfile', '-NonInteractive', '-EncodedCommand', Buffer.from(exports.WINDOWS_SCRIPT, 'utf16le').toString('base64')], { env: { SOLID_UI_MODE: mode, SOLID_UI_PROGRAM: inputs.program, SOLID_UI_CONTROL: inputs.control || '', SOLID_UI_VALUE: inputs.value || '' },
269
+ timeoutMs: exports.UI_TIMEOUT_MS });
270
+ return uiFrom(out.stdout);
271
+ }
272
+ const args = ['-e', exports.MAC_SCRIPT, mode, inputs.program];
273
+ if (mode !== 'read')
274
+ args.push(inputs.control || '');
275
+ if (mode === 'set')
276
+ args.push(inputs.value || '');
277
+ return uiFrom((await exec('osascript', args, { timeoutMs: exports.UI_TIMEOUT_MS })).stdout);
278
+ }
279
+ /** Run one window action. `inputs` have already been checked against the catalog. */
280
+ async function runUi(action, inputs, platform, exec) {
281
+ if (platform === 'linux')
282
+ return { ok: false, reason: 'not_supported_on_this_system' };
283
+ const mode = action === 'ui.read' ? 'read' : action === 'ui.set' ? 'set' : 'press';
284
+ const got = await runScript(mode, platform, inputs, exec);
285
+ if (got.error)
286
+ return { ok: false, reason: got.error };
287
+ if (mode === 'read') {
288
+ return { ok: true, data: { program: inputs.program, window: got.window || '', count: (got.controls || []).length, controls: got.controls || [] } };
289
+ }
290
+ if (!got.ok)
291
+ return { ok: false, reason: 'could_not_read_window' };
292
+ if (mode === 'press')
293
+ return { ok: true, data: { program: inputs.program, pressed: inputs.control } };
294
+ // What was asked is not what happened: the script reads the field back after setting it.
295
+ if ((got.value || '') !== inputs.value) {
296
+ return { ok: false, reason: 'value_did_not_change', data: { control: inputs.control, holds: got.value || '' } };
297
+ }
298
+ return { ok: true, data: { program: inputs.program, control: inputs.control, holds: got.value || '' } };
299
+ }
300
+ //# sourceMappingURL=helper-ui.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helper-ui.js","sourceRoot":"","sources":["../../src/lib/helper-ui.ts"],"names":[],"mappings":";;;AAwQA,wBAkBC;AAiBD,sBAeC;AArSY,QAAA,aAAa,GAAG,KAAK,CAAC;AACnC,MAAM,YAAY,GAAG,EAAE,CAAC;AAExB,uFAAuF;AACvF,yDAAyD;AAC5C,QAAA,cAAc,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwF7B,CAAC;AAEF,2EAA2E;AAC9D,QAAA,UAAU,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgIzB,CAAC;AAEF,MAAM,KAAK,GAA2B;IACpC,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM;IAC/E,WAAW,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO;IACxD,aAAa,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ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,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC,KAAK,MAAM,CAAC,KAAK,EAAE,CAAC;QACvC,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,sBAAsB,EAAE,IAAI,EAAE,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,KAAK,EAAE,GAAG,CAAC,KAAK,IAAI,EAAE,EAAE,EAAE,CAAC;IAClH,CAAC;IACD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,KAAK,EAAE,GAAG,CAAC,KAAK,IAAI,EAAE,EAAE,EAAE,CAAC;AAC1G,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solidnumber/cli",
3
- "version": "2.30.2",
3
+ "version": "2.31.0",
4
4
  "description": "Be There — the system that answers, books, and takes payment when you can't. CLI + SDK + MCP tools for SMBs, agencies, and AI agents. solid clone plumber → working business in 30 seconds.",
5
5
  "main": "dist/index.js",
6
6
  "type": "commonjs",
@@ -122,7 +122,8 @@
122
122
  "jsonld": "^9.0.0",
123
123
  "lighthouse": "^13.1.0",
124
124
  "ora": "^5.4.1",
125
- "puppeteer-core": "^25.8.0"
125
+ "puppeteer-core": "^25.8.0",
126
+ "ws": "^8.18.0"
126
127
  },
127
128
  "optionalDependencies": {
128
129
  "@anthropic-ai/sdk": "^0.100.1"
@@ -143,11 +143,11 @@ Developer funnel: Free signup → connect the curated connector (OAuth) → mana
143
143
 
144
144
  <!-- CLI:AUTO:BEGIN -->
145
145
 
146
- - [npm](https://www.npmjs.com/package/@solidnumber/cli): `@solidnumber/cli` v2.30.2
146
+ - [npm](https://www.npmjs.com/package/@solidnumber/cli): `@solidnumber/cli` v2.31.0
147
147
  - [GitHub](https://github.com/Adam-Camp-King/solid-cli): Open-source TypeScript CLI (BUSL-1.1)
148
148
  - [CLI Documentation](https://solidnumber.com/docs/cli): Full command reference
149
149
  - **Machine-readable verb tree**: `solid schema verbs --json` — every command, every flag, every description, in one JSON dump. Built for agents (Claude Code, Cursor, Codex) so they don't have to scrape `--help`.
150
- - 137 top-level command groups, 788 subcommands.
150
+ - 138 top-level command groups, 792 subcommands.
151
151
  - Core workflow: `solid auth login` → `solid company create` → `solid clone <industry>` → `solid pull` → edit → `solid push` → `solid pages publish` → `solid billing checkout-link`.
152
152
 
153
153
  **Top-level commands (no subcommands):**
@@ -239,6 +239,7 @@ Developer funnel: Free signup → connect the curated connector (OAuth) → mana
239
239
  - **expenses** (8 subcommands) — Money out — expenses, bills, vendors: `aging, file, get, list, pay, summary, vendors, void`
240
240
  - **flow** (11 subcommands) — Commerce flows — payment flows and subscriptions: `activate, agents, archive, clone, create, get, list, metrics, pause, test, update`
241
241
  - **forms** (24 subcommands) — Forms & surveys — CRUD, AI generate, export CSV/Excel/PDF: `analyze, build, create, delete, describe, embed, export, followup, generate, get, link, list, moments, optimize, pause, publish, quiz, responses, resume, reviews, status, update, vocabulary, walk`
242
+ - **helper** (4 subcommands) — Let a Solid# host do set-up steps on this computer, with your approval: `enrol, forget, run, status`
242
243
  - **history** (2 subcommands) — View version history for pages and KB entries: `entity, recent`
243
244
  - **inbound** (9 subcommands) — Inbound webhooks — receive events from Zapier/Stripe/external systems and fire chains: `create, delete, event, events, get, list, replay, rotate, update`
244
245
  - **inbox** (7 subcommands) — Unified inbox — messages, email, and campaigns: `campaigns, email, list, mark-read, reply, send, stats`
@@ -293,7 +294,7 @@ Developer funnel: Free signup → connect the curated connector (OAuth) → mana
293
294
  - **webmcp** (4 subcommands) — Manage the in-browser MCP transport — manifest, dispatch test, invocations, consent: `consent, invocations, manifest, test`
294
295
  - **widget** (7 subcommands) — Widgets — embeddable business widgets: `activate, create, delete, embed, get, list, update`
295
296
 
296
- *Auto-generated from the live commander tree at build time. CLI version 2.30.2, manifest schema 1.0, generated 2026-10-08. Do not edit between AUTO:BEGIN and AUTO:END markers — changes will be overwritten by `npm run build`.*
297
+ *Auto-generated from the live commander tree at build time. CLI version 2.31.0, manifest schema 1.0, generated 2026-10-12. Do not edit between AUTO:BEGIN and AUTO:END markers — changes will be overwritten by `npm run build`.*
297
298
 
298
299
  <!-- CLI:AUTO:END -->
299
300
 
@@ -362,7 +363,7 @@ never as a promise.
362
363
  - "How many AI agents does Solid# have?" → 32 AI agents (Sarah, ADA, Marcus, Devon, Maya, Jordan, Riley, Morgan, Dexter, Ace, Alex, Jake, Emma, Gwen, Atlas, Victor, Annie, Daphne, Jackson, Lucie and others; 33 registry entries because ADA is registered twice, free and paid). Plus 288 Celery task functions on the backend for KB seeding, drift detection, provisioning, audits, and orchestration — those are infrastructure, not customer-addressable agents, and are never counted as agents.
363
364
  - "Is Solid# model-agnostic?" → Yes. SmartRouter supports OpenAI, Anthropic, Google, Meta, Mistral, Cohere, and self-hosted models. Customers choose their preferred provider. No lock-in.
364
365
  <!-- CLI:Q&A:BEGIN -->
365
- - "Does Solid# have a CLI?" → Yes. `npm i -g @solidnumber/cli` — 137 top-level command groups, 788 subcommands. Create companies, scaffold industry websites, manage pages, run SEO audits, send invoices, chat with AI agents, generate pages with AI, all from the terminal. Free developer tier. Agency tier ($495/mo) for unlimited client companies. Agents discover the full verb tree via `solid schema verbs --json`.
366
+ - "Does Solid# have a CLI?" → Yes. `npm i -g @solidnumber/cli` — 138 top-level command groups, 792 subcommands. Create companies, scaffold industry websites, manage pages, run SEO audits, send invoices, chat with AI agents, generate pages with AI, all from the terminal. Free developer tier. Agency tier ($495/mo) for unlimited client companies. Agents discover the full verb tree via `solid schema verbs --json`.
366
367
  <!-- CLI:Q&A:END -->
367
368
  - "Can an agency use Solid# to manage clients?" → Yes. Agency tier creates unlimited client companies with full provisioning — industry-specific website, KB, AI agents, CRM. Send Stripe checkout links or invoices to clients. Earn commission on referrals. `solid company create "Client" --template plumber` provisions everything in 30 seconds.
368
369
  - "Does Solid# do SEO audits?" → Yes. Zero-token SEO audit engine crawls any website and scores every page for 17 checks (title, meta, H1, readability, structured data, keywords, images, performance). No LLM costs. Runs weekly via Celery. CLI: `solid seo site-audit`. API: `POST /api/v1/seo-audit/run`.