@allstak/wizard 0.1.3 → 0.1.5

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 (296) hide show
  1. package/CHANGELOG.md +53 -1
  2. package/LICENSE +191 -0
  3. package/README.md +299 -47
  4. package/dist/api/http.d.ts +2 -0
  5. package/dist/api/http.d.ts.map +1 -1
  6. package/dist/api/http.js +6 -0
  7. package/dist/api/http.js.map +1 -1
  8. package/dist/api/index.d.ts +1 -0
  9. package/dist/api/index.d.ts.map +1 -1
  10. package/dist/api/index.js +1 -0
  11. package/dist/api/index.js.map +1 -1
  12. package/dist/api/types.d.ts +3 -3
  13. package/dist/api/types.js +3 -3
  14. package/dist/certification/fixtures.d.ts +4 -0
  15. package/dist/certification/fixtures.d.ts.map +1 -0
  16. package/dist/certification/fixtures.js +109 -0
  17. package/dist/certification/fixtures.js.map +1 -0
  18. package/dist/certification/gates.d.ts +10 -0
  19. package/dist/certification/gates.d.ts.map +1 -0
  20. package/dist/certification/gates.js +20 -0
  21. package/dist/certification/gates.js.map +1 -0
  22. package/dist/certification/index.d.ts +6 -0
  23. package/dist/certification/index.d.ts.map +1 -0
  24. package/dist/certification/index.js +5 -0
  25. package/dist/certification/index.js.map +1 -0
  26. package/dist/certification/live-backend.d.ts +50 -0
  27. package/dist/certification/live-backend.d.ts.map +1 -0
  28. package/dist/certification/live-backend.js +422 -0
  29. package/dist/certification/live-backend.js.map +1 -0
  30. package/dist/certification/packages.d.ts +3 -0
  31. package/dist/certification/packages.d.ts.map +1 -0
  32. package/dist/certification/packages.js +49 -0
  33. package/dist/certification/packages.js.map +1 -0
  34. package/dist/certification/process.d.ts +8 -0
  35. package/dist/certification/process.d.ts.map +1 -0
  36. package/dist/certification/process.js +77 -0
  37. package/dist/certification/process.js.map +1 -0
  38. package/dist/certification/report.d.ts +3 -0
  39. package/dist/certification/report.d.ts.map +1 -0
  40. package/dist/certification/report.js +38 -0
  41. package/dist/certification/report.js.map +1 -0
  42. package/dist/certification/runner.d.ts +3 -0
  43. package/dist/certification/runner.d.ts.map +1 -0
  44. package/dist/certification/runner.js +299 -0
  45. package/dist/certification/runner.js.map +1 -0
  46. package/dist/certification/runtime.d.ts +11 -0
  47. package/dist/certification/runtime.d.ts.map +1 -0
  48. package/dist/certification/runtime.js +60 -0
  49. package/dist/certification/runtime.js.map +1 -0
  50. package/dist/certification/types.d.ts +73 -0
  51. package/dist/certification/types.d.ts.map +1 -0
  52. package/dist/certification/types.js +2 -0
  53. package/dist/certification/types.js.map +1 -0
  54. package/dist/cli.js +70 -3
  55. package/dist/cli.js.map +1 -1
  56. package/dist/commands/certify.d.ts +18 -0
  57. package/dist/commands/certify.d.ts.map +1 -0
  58. package/dist/commands/certify.js +27 -0
  59. package/dist/commands/certify.js.map +1 -0
  60. package/dist/commands/init.d.ts.map +1 -1
  61. package/dist/commands/init.js +13 -0
  62. package/dist/commands/init.js.map +1 -1
  63. package/dist/commands/list.d.ts +5 -1
  64. package/dist/commands/list.d.ts.map +1 -1
  65. package/dist/commands/list.js +9 -3
  66. package/dist/commands/list.js.map +1 -1
  67. package/dist/commands/security-snapshot.d.ts +24 -0
  68. package/dist/commands/security-snapshot.d.ts.map +1 -0
  69. package/dist/commands/security-snapshot.js +113 -0
  70. package/dist/commands/security-snapshot.js.map +1 -0
  71. package/dist/index.d.ts +3 -1
  72. package/dist/index.d.ts.map +1 -1
  73. package/dist/index.js +3 -1
  74. package/dist/index.js.map +1 -1
  75. package/dist/integrations/_scaffold.d.ts +2 -1
  76. package/dist/integrations/_scaffold.d.ts.map +1 -1
  77. package/dist/integrations/_scaffold.js +36 -13
  78. package/dist/integrations/_scaffold.js.map +1 -1
  79. package/dist/integrations/_simple-scaffold.d.ts +5 -2
  80. package/dist/integrations/_simple-scaffold.d.ts.map +1 -1
  81. package/dist/integrations/_simple-scaffold.js +3 -0
  82. package/dist/integrations/_simple-scaffold.js.map +1 -1
  83. package/dist/integrations/dotnet.d.ts.map +1 -1
  84. package/dist/integrations/dotnet.js +3 -0
  85. package/dist/integrations/dotnet.js.map +1 -1
  86. package/dist/integrations/expo/detect.d.ts +13 -0
  87. package/dist/integrations/expo/detect.d.ts.map +1 -0
  88. package/dist/integrations/expo/detect.js +38 -0
  89. package/dist/integrations/expo/detect.js.map +1 -0
  90. package/dist/integrations/expo/doctor.d.ts +6 -0
  91. package/dist/integrations/expo/doctor.d.ts.map +1 -0
  92. package/dist/integrations/expo/doctor.js +136 -0
  93. package/dist/integrations/expo/doctor.js.map +1 -0
  94. package/dist/integrations/expo/files.d.ts +15 -0
  95. package/dist/integrations/expo/files.d.ts.map +1 -0
  96. package/dist/integrations/expo/files.js +62 -0
  97. package/dist/integrations/expo/files.js.map +1 -0
  98. package/dist/integrations/expo/index.d.ts +24 -0
  99. package/dist/integrations/expo/index.d.ts.map +1 -0
  100. package/dist/integrations/expo/index.js +68 -0
  101. package/dist/integrations/expo/index.js.map +1 -0
  102. package/dist/integrations/expo/manifest.d.ts +3 -0
  103. package/dist/integrations/expo/manifest.d.ts.map +1 -0
  104. package/dist/integrations/expo/manifest.js +39 -0
  105. package/dist/integrations/expo/manifest.js.map +1 -0
  106. package/dist/integrations/expo/patch.d.ts +13 -0
  107. package/dist/integrations/expo/patch.d.ts.map +1 -0
  108. package/dist/integrations/expo/patch.js +215 -0
  109. package/dist/integrations/expo/patch.js.map +1 -0
  110. package/dist/integrations/expo/uninstall.d.ts +4 -0
  111. package/dist/integrations/expo/uninstall.d.ts.map +1 -0
  112. package/dist/integrations/expo/uninstall.js +77 -0
  113. package/dist/integrations/expo/uninstall.js.map +1 -0
  114. package/dist/integrations/expo.d.ts +8 -1
  115. package/dist/integrations/expo.d.ts.map +1 -1
  116. package/dist/integrations/expo.js +8 -11
  117. package/dist/integrations/expo.js.map +1 -1
  118. package/dist/integrations/fastify/detect.d.ts +3 -0
  119. package/dist/integrations/fastify/detect.d.ts.map +1 -0
  120. package/dist/integrations/fastify/detect.js +12 -0
  121. package/dist/integrations/fastify/detect.js.map +1 -0
  122. package/dist/integrations/fastify/doctor.d.ts +3 -0
  123. package/dist/integrations/fastify/doctor.d.ts.map +1 -0
  124. package/dist/integrations/fastify/doctor.js +81 -0
  125. package/dist/integrations/fastify/doctor.js.map +1 -0
  126. package/dist/integrations/fastify/files.d.ts +17 -0
  127. package/dist/integrations/fastify/files.d.ts.map +1 -0
  128. package/dist/integrations/fastify/files.js +51 -0
  129. package/dist/integrations/fastify/files.js.map +1 -0
  130. package/dist/integrations/fastify/index.d.ts +3 -0
  131. package/dist/integrations/fastify/index.d.ts.map +1 -0
  132. package/dist/integrations/fastify/index.js +47 -0
  133. package/dist/integrations/fastify/index.js.map +1 -0
  134. package/dist/integrations/fastify/manifest.d.ts +3 -0
  135. package/dist/integrations/fastify/manifest.d.ts.map +1 -0
  136. package/dist/integrations/fastify/manifest.js +34 -0
  137. package/dist/integrations/fastify/manifest.js.map +1 -0
  138. package/dist/integrations/fastify/patch.d.ts +27 -0
  139. package/dist/integrations/fastify/patch.d.ts.map +1 -0
  140. package/dist/integrations/fastify/patch.js +91 -0
  141. package/dist/integrations/fastify/patch.js.map +1 -0
  142. package/dist/integrations/fastify/uninstall.d.ts +4 -0
  143. package/dist/integrations/fastify/uninstall.d.ts.map +1 -0
  144. package/dist/integrations/fastify/uninstall.js +18 -0
  145. package/dist/integrations/fastify/uninstall.js.map +1 -0
  146. package/dist/integrations/fastify.d.ts +5 -1
  147. package/dist/integrations/fastify.d.ts.map +1 -1
  148. package/dist/integrations/fastify.js +5 -9
  149. package/dist/integrations/fastify.js.map +1 -1
  150. package/dist/integrations/flutter.d.ts.map +1 -1
  151. package/dist/integrations/flutter.js +3 -0
  152. package/dist/integrations/flutter.js.map +1 -1
  153. package/dist/integrations/go/index.d.ts +3 -0
  154. package/dist/integrations/go/index.d.ts.map +1 -0
  155. package/dist/integrations/go/index.js +199 -0
  156. package/dist/integrations/go/index.js.map +1 -0
  157. package/dist/integrations/go.d.ts.map +1 -1
  158. package/dist/integrations/go.js +5 -2
  159. package/dist/integrations/go.js.map +1 -1
  160. package/dist/integrations/java/index.d.ts +3 -0
  161. package/dist/integrations/java/index.d.ts.map +1 -0
  162. package/dist/integrations/java/index.js +472 -0
  163. package/dist/integrations/java/index.js.map +1 -0
  164. package/dist/integrations/java.d.ts.map +1 -1
  165. package/dist/integrations/java.js +5 -2
  166. package/dist/integrations/java.js.map +1 -1
  167. package/dist/integrations/js/manifest.d.ts.map +1 -1
  168. package/dist/integrations/js/manifest.js +3 -0
  169. package/dist/integrations/js/manifest.js.map +1 -1
  170. package/dist/integrations/nestjs/detect.d.ts +3 -0
  171. package/dist/integrations/nestjs/detect.d.ts.map +1 -0
  172. package/dist/integrations/nestjs/detect.js +12 -0
  173. package/dist/integrations/nestjs/detect.js.map +1 -0
  174. package/dist/integrations/nestjs/doctor.d.ts +3 -0
  175. package/dist/integrations/nestjs/doctor.d.ts.map +1 -0
  176. package/dist/integrations/nestjs/doctor.js +76 -0
  177. package/dist/integrations/nestjs/doctor.js.map +1 -0
  178. package/dist/integrations/nestjs/files.d.ts +18 -0
  179. package/dist/integrations/nestjs/files.d.ts.map +1 -0
  180. package/dist/integrations/nestjs/files.js +39 -0
  181. package/dist/integrations/nestjs/files.js.map +1 -0
  182. package/dist/integrations/nestjs/index.d.ts +3 -0
  183. package/dist/integrations/nestjs/index.d.ts.map +1 -0
  184. package/dist/integrations/nestjs/index.js +43 -0
  185. package/dist/integrations/nestjs/index.js.map +1 -0
  186. package/dist/integrations/nestjs/manifest.d.ts +3 -0
  187. package/dist/integrations/nestjs/manifest.d.ts.map +1 -0
  188. package/dist/integrations/nestjs/manifest.js +32 -0
  189. package/dist/integrations/nestjs/manifest.js.map +1 -0
  190. package/dist/integrations/nestjs/patch.d.ts +25 -0
  191. package/dist/integrations/nestjs/patch.d.ts.map +1 -0
  192. package/dist/integrations/nestjs/patch.js +66 -0
  193. package/dist/integrations/nestjs/patch.js.map +1 -0
  194. package/dist/integrations/nestjs/uninstall.d.ts +4 -0
  195. package/dist/integrations/nestjs/uninstall.d.ts.map +1 -0
  196. package/dist/integrations/nestjs/uninstall.js +18 -0
  197. package/dist/integrations/nestjs/uninstall.js.map +1 -0
  198. package/dist/integrations/nestjs.d.ts +5 -1
  199. package/dist/integrations/nestjs.d.ts.map +1 -1
  200. package/dist/integrations/nestjs.js +5 -9
  201. package/dist/integrations/nestjs.js.map +1 -1
  202. package/dist/integrations/next/index.js +2 -2
  203. package/dist/integrations/next/index.js.map +1 -1
  204. package/dist/integrations/next/manifest.d.ts.map +1 -1
  205. package/dist/integrations/next/manifest.js +4 -1
  206. package/dist/integrations/next/manifest.js.map +1 -1
  207. package/dist/integrations/next/patch.js +8 -3
  208. package/dist/integrations/next/patch.js.map +1 -1
  209. package/dist/integrations/next/uninstall.d.ts.map +1 -1
  210. package/dist/integrations/next/uninstall.js +10 -1
  211. package/dist/integrations/next/uninstall.js.map +1 -1
  212. package/dist/integrations/otel.d.ts.map +1 -1
  213. package/dist/integrations/otel.js +4 -1
  214. package/dist/integrations/otel.js.map +1 -1
  215. package/dist/integrations/php.d.ts.map +1 -1
  216. package/dist/integrations/php.js +16 -3
  217. package/dist/integrations/php.js.map +1 -1
  218. package/dist/integrations/python/index.d.ts +3 -0
  219. package/dist/integrations/python/index.d.ts.map +1 -0
  220. package/dist/integrations/python/index.js +222 -0
  221. package/dist/integrations/python/index.js.map +1 -0
  222. package/dist/integrations/python.d.ts.map +1 -1
  223. package/dist/integrations/python.js +5 -2
  224. package/dist/integrations/python.js.map +1 -1
  225. package/dist/integrations/react/doctor.d.ts.map +1 -1
  226. package/dist/integrations/react/doctor.js +41 -8
  227. package/dist/integrations/react/doctor.js.map +1 -1
  228. package/dist/integrations/react/index.d.ts.map +1 -1
  229. package/dist/integrations/react/index.js +1 -4
  230. package/dist/integrations/react/index.js.map +1 -1
  231. package/dist/integrations/react/manifest.d.ts.map +1 -1
  232. package/dist/integrations/react/manifest.js +4 -1
  233. package/dist/integrations/react/manifest.js.map +1 -1
  234. package/dist/integrations/react/patch.d.ts.map +1 -1
  235. package/dist/integrations/react/patch.js +120 -8
  236. package/dist/integrations/react/patch.js.map +1 -1
  237. package/dist/integrations/react/uninstall.d.ts.map +1 -1
  238. package/dist/integrations/react/uninstall.js +20 -1
  239. package/dist/integrations/react/uninstall.js.map +1 -1
  240. package/dist/integrations/react-native.d.ts.map +1 -1
  241. package/dist/integrations/react-native.js +3 -0
  242. package/dist/integrations/react-native.js.map +1 -1
  243. package/dist/integrations/ruby.d.ts.map +1 -1
  244. package/dist/integrations/ruby.js +3 -0
  245. package/dist/integrations/ruby.js.map +1 -1
  246. package/dist/output/human.d.ts.map +1 -1
  247. package/dist/output/human.js +38 -7
  248. package/dist/output/human.js.map +1 -1
  249. package/dist/registry/index.d.ts.map +1 -1
  250. package/dist/registry/index.js +9 -23
  251. package/dist/registry/index.js.map +1 -1
  252. package/dist/registry/manifest.d.ts +8 -0
  253. package/dist/registry/manifest.d.ts.map +1 -1
  254. package/dist/security-snapshot/builder.d.ts +3 -0
  255. package/dist/security-snapshot/builder.d.ts.map +1 -0
  256. package/dist/security-snapshot/builder.js +343 -0
  257. package/dist/security-snapshot/builder.js.map +1 -0
  258. package/dist/security-snapshot/client.d.ts +3 -0
  259. package/dist/security-snapshot/client.d.ts.map +1 -0
  260. package/dist/security-snapshot/client.js +38 -0
  261. package/dist/security-snapshot/client.js.map +1 -0
  262. package/dist/security-snapshot/index.d.ts +4 -0
  263. package/dist/security-snapshot/index.d.ts.map +1 -0
  264. package/dist/security-snapshot/index.js +3 -0
  265. package/dist/security-snapshot/index.js.map +1 -0
  266. package/dist/security-snapshot/types.d.ts +57 -0
  267. package/dist/security-snapshot/types.d.ts.map +1 -0
  268. package/dist/security-snapshot/types.js +2 -0
  269. package/dist/security-snapshot/types.js.map +1 -0
  270. package/dist/sourcemaps/next.js +3 -3
  271. package/dist/sourcemaps/next.js.map +1 -1
  272. package/dist/sourcemaps/vite.d.ts.map +1 -1
  273. package/dist/sourcemaps/vite.js +92 -9
  274. package/dist/sourcemaps/vite.js.map +1 -1
  275. package/dist/util/wizard-version.d.ts +1 -1
  276. package/dist/util/wizard-version.js +1 -1
  277. package/docs/architecture/v02-java-host-fix-spec.md +4 -8
  278. package/docs/architecture/v02-sourcemaps-e2e-spec.md +1 -1
  279. package/docs/beta/README.md +17 -0
  280. package/docs/beta/ci.md +122 -0
  281. package/docs/beta/config.md +124 -0
  282. package/docs/beta/doctor.md +79 -0
  283. package/docs/beta/expo.md +69 -0
  284. package/docs/beta/fastify.md +62 -0
  285. package/docs/beta/known-limitations.md +93 -0
  286. package/docs/beta/nestjs.md +69 -0
  287. package/docs/beta/next.md +76 -0
  288. package/docs/beta/node.md +60 -0
  289. package/docs/beta/privacy.md +99 -0
  290. package/docs/beta/quickstart.md +89 -0
  291. package/docs/beta/react.md +91 -0
  292. package/docs/beta/reliability.md +33 -0
  293. package/docs/beta/restore.md +84 -0
  294. package/docs/beta/troubleshooting.md +133 -0
  295. package/docs/errors.md +88 -0
  296. package/package.json +23 -5
@@ -0,0 +1,84 @@
1
+ # `allstak restore`
2
+
3
+ Every wizard mutation is captured in a persistent snapshot under
4
+ `.allstak-wizard/backups/<timestamp>--<integration>--<random>/`. The
5
+ `restore` family lets you inspect and roll back those snapshots.
6
+
7
+ ## Subcommands
8
+
9
+ ```bash
10
+ npx @allstak/wizard@beta restore list
11
+ npx @allstak/wizard@beta restore show <id|latest>
12
+ npx @allstak/wizard@beta restore diff <id|latest>
13
+ npx @allstak/wizard@beta restore apply <id|latest> [--files=a,b,c] [--dry-run]
14
+ ```
15
+
16
+ `<id>` is the trailing slug of a backup directory. `latest` always
17
+ resolves to the most recent snapshot.
18
+
19
+ ## What's in a snapshot
20
+
21
+ ```
22
+ .allstak-wizard/backups/2026-05-07T..--react--abc123/
23
+ manifest.json schemaVersion, integration, files[], dryRun, label
24
+ files/
25
+ src/main.tsx pre-image bytes (UTF-8)
26
+ .env.local pre-image bytes
27
+ .env.local.allstak-deleted marker (file did not exist before)
28
+ ```
29
+
30
+ Manifests and pre-images are plain text — they're safe to inspect with `cat`.
31
+
32
+ ## Common workflows
33
+
34
+ ### "I made a mess, give me my files back"
35
+
36
+ ```bash
37
+ npx @allstak/wizard@beta restore apply latest
38
+ ```
39
+
40
+ Confirms before writing. Pass `-y` to skip confirmation.
41
+
42
+ ### "What did the wizard change vs my current state?"
43
+
44
+ ```bash
45
+ npx @allstak/wizard@beta restore diff latest
46
+ ```
47
+
48
+ Each file shows one of: `identical`, `modified`, `created-since`, or
49
+ `deleted-since`.
50
+
51
+ ### "Restore one file from a specific run"
52
+
53
+ ```bash
54
+ npx @allstak/wizard@beta restore apply 2026-05-07T..--react--abc123 \
55
+ --files=src/main.tsx,.env.local
56
+ ```
57
+
58
+ ### "What WOULD restore do?"
59
+
60
+ ```bash
61
+ npx @allstak/wizard@beta restore apply latest --dry-run
62
+ ```
63
+
64
+ ## Retention
65
+
66
+ `init` prunes old snapshots after a successful run. The default keeps the
67
+ 10 most recent — override with `--snapshot-keep <n>` (0 disables pruning).
68
+ `repair` and `uninstall` also write snapshots but do NOT prune.
69
+
70
+ ## Transactional
71
+
72
+ Restoring is itself a transaction — partial failure rolls back to the
73
+ pre-restore state. If a file in the snapshot is missing on disk, the
74
+ restore reports `skipped` for that file and continues.
75
+
76
+ ## Limitations
77
+
78
+ - Restoring across wizard major versions is supported but a `manifest.json`
79
+ with a `schemaVersion` higher than the running wizard's is refused.
80
+ - Snapshots live in your repo by default. Add
81
+ `.allstak-wizard/` to `.gitignore` to keep them out of git (the wizard
82
+ does not auto-edit your `.gitignore`).
83
+ - Snapshots are NOT encrypted. Don't store them in a public artifact bucket
84
+ — they contain the original contents of files the wizard touched.
@@ -0,0 +1,133 @@
1
+ # Troubleshooting
2
+
3
+ Common failure modes mapped to canonical error codes (see [errors.md](../errors.md)).
4
+
5
+ ## "I just ran `allstak login` and got `E_AUTH_FAILED`"
6
+
7
+ - The OTP code expires after ~10 minutes. Run `login` again to request a new one.
8
+ - Codes are 4–8 digits. If you typed an extra space, the wizard rejects with
9
+ the same code.
10
+ - If you see `OTP_RATE_LIMITED` in the subcode, wait a minute and retry.
11
+
12
+ ## "`E_AUTH_REQUIRED` from `orgs list` but I am logged in"
13
+
14
+ You were logged in to a different host. The wizard scopes credentials by
15
+ host. Check `allstak whoami --verify` and rerun with the matching `--host`,
16
+ or re-run `login --host <url>`.
17
+
18
+ ## "`E_AUTH_EXPIRED` after a long break"
19
+
20
+ The refresh token was probably revoked (server-side logout, password reset,
21
+ or it just expired). Run `allstak logout && allstak login`.
22
+
23
+ ## "`E_NETWORK_FAILED` everywhere"
24
+
25
+ - Verify the configured host with `allstak whoami` (it prints the host).
26
+ - Pass `--debug` and re-run; the underlying message includes the URL.
27
+ - For self-hosted: confirm DNS + TLS are working from the wizard's host.
28
+
29
+ ## "`E_UNSUPPORTED_FRAMEWORK` even though I'm using React"
30
+
31
+ - `package.json` may not declare `react` directly. The wizard reads
32
+ `dependencies` + `devDependencies`.
33
+ - For monorepos, run the wizard from the **package directory**, not the
34
+ root.
35
+ - Pass `-i react` explicitly if detection is ambiguous.
36
+
37
+ ## "`E_UNSUPPORTED_VERSION` but my React/Next is current"
38
+
39
+ The compat engine reads the version range from `package.json`. If you have
40
+ `"react": "*"` it cannot infer a minimum and reports too-old. Pin a real
41
+ version range in `package.json`.
42
+
43
+ ## "`E_PACKAGE_MANAGER_CONFLICT`"
44
+
45
+ Two lockfiles in the project root (e.g. both `pnpm-lock.yaml` and
46
+ `package-lock.json`). The wizard refuses to guess. Delete the stale one.
47
+
48
+ ## "`E_PATCH_FAILED` mid-run"
49
+
50
+ The transaction layer ALREADY rolled back your files. Re-run with
51
+ `--debug` to see which patcher threw. Common causes:
52
+
53
+ - A pre-existing syntax error in the file we tried to patch — fix the
54
+ syntax first, re-run the wizard.
55
+ - File permissions denied on the entry file or `.env.local`.
56
+
57
+ If rollback itself failed (`E_PATCH_ROLLBACK_FAILED`):
58
+
59
+ ```bash
60
+ allstak restore list
61
+ allstak restore apply <id>
62
+ ```
63
+
64
+ ## "`E_RESTORE_FAILED: No snapshot matches "<id>""
65
+
66
+ `allstak restore list` shows what's available. Use the trailing slug
67
+ (e.g. `2026-05-07T..--react--abc123`) or just `latest`.
68
+
69
+ ## "`E_INGEST_VERIFY_FAILED` on `--live-probe`"
70
+
71
+ - The probe uses `--api-key` (project-scoped). If the key was issued for
72
+ a different project than `--project-id`, verification will never see the
73
+ event. Check both match.
74
+ - The probe waits 60s by default. Increase via
75
+ `--live-probe-timeout 120000` if your backend is slow.
76
+ - Open the dashboard URL printed in the probe output and look for the
77
+ fingerprint manually. The event id is in the JSON output even when
78
+ polling times out.
79
+
80
+ ## "`E_CONFIG_INVALID` after editing `allstak.config.ts`"
81
+
82
+ ```bash
83
+ allstak config validate
84
+ ```
85
+
86
+ prints the exact path-to-blame (e.g. `selfHosted.apiHost — expected
87
+ absolute URL, got "api.acme"`). Fix and rerun.
88
+
89
+ ## "`E_CONFIG_MIGRATION_FAILED`"
90
+
91
+ The migration runner refuses on:
92
+
93
+ - A `schemaVersion` higher than the wizard supports (subcode
94
+ `E_CONFIG_FUTURE_VERSION`) — upgrade `@allstak/wizard`.
95
+ - A migration that didn't bump the version correctly (subcode
96
+ `E_MIGRATION_NO_BUMP`) — file an issue, this is a wizard bug.
97
+
98
+ ## "`E_USER_CANCELLED` in CI"
99
+
100
+ You forgot `-y`. The wizard refuses to apply changes without it in
101
+ non-interactive mode.
102
+
103
+ ## "Wizard hung at the login OTP prompt in CI"
104
+
105
+ CI has no TTY, so `@clack/prompts` rejects. Pass `--email` AND `--code` (or
106
+ use a long-lived API key with `--api-key` instead of logging in).
107
+
108
+ ## "Telemetry warning showed up in my CI logs"
109
+
110
+ Telemetry is on by default. To silence:
111
+
112
+ ```bash
113
+ ALLSTAK_WIZARD_TELEMETRY=0
114
+ # or
115
+ allstak --no-telemetry ...
116
+ ```
117
+
118
+ ## "I see `// >>> allstak-wizard:v1` in my git diff"
119
+
120
+ That's the wizard's idempotency marker. It's intentional — re-runs replace
121
+ the block in place; `uninstall` removes it. Commit it; do not hand-edit
122
+ inside the markers (your edits will be overwritten on the next run).
123
+
124
+ ## Last resort: nuke everything
125
+
126
+ ```bash
127
+ allstak uninstall -i react -y # remove SDK + patches
128
+ allstak logout # clear credentials
129
+ rm -rf .allstak-wizard/ # drop persistent snapshots
130
+ ```
131
+
132
+ The local credential store on macOS may keep the keychain entry until you
133
+ explicitly clear it: `security delete-generic-password -s allstak-wizard`.
package/docs/errors.md ADDED
@@ -0,0 +1,88 @@
1
+ # `@allstak/wizard` error catalog
2
+
3
+ Every error thrown out of the wizard CLI carries a canonical `code` from this
4
+ catalog. The code is stable across releases (we add new codes; we never
5
+ rename or remove existing ones without a major-version bump). The `subcode`
6
+ field exists for finer-grained internal granularity and is **not** part of
7
+ the public contract — it can change between minors.
8
+
9
+ JSON output (`--json`) and telemetry (when enabled) only include the
10
+ canonical `code` + `stage` + (sanitised) `context`. Raw error messages and
11
+ stack traces are NEVER sent to telemetry.
12
+
13
+ | Code | Stage | What it means | What to try |
14
+ |------|-------|---------------|-------------|
15
+ | `E_AUTH_REQUIRED` | auth | A command needs credentials but none were available. | Run `allstak login`, or pass `--api-key` for ingest-only commands. |
16
+ | `E_AUTH_FAILED` | auth | Credentials were rejected by the AllStak backend. | Verify the email and OTP are correct; check `allstak.config.*` host setting. |
17
+ | `E_AUTH_EXPIRED` | auth | Stored credentials are no longer valid (token revoked or refresh failed). | Run `allstak login` to refresh. |
18
+ | `E_BACKEND_CONTRACT_MISSING` | reachability | The wizard requires a backend endpoint that does not exist on the configured host. | Confirm `--host` points at a current AllStak deployment, or open an issue. |
19
+ | `E_PROJECT_NOT_FOUND` | config | The specified project could not be found. | Run `allstak projects list`. |
20
+ | `E_PROJECT_CREATE_FAILED` | config | Backend rejected the project-create call. | Check the slug is unique and the org has quota. |
21
+ | `E_API_KEY_CREATE_FAILED` | config | Backend refused to mint a new API key. | Check API-key quota for the org's plan. |
22
+ | `E_UNSUPPORTED_FRAMEWORK` | detect | No registered integration matches the project, or detection was ambiguous. | Pass `-i <integration>`. Run `allstak list`. |
23
+ | `E_UNSUPPORTED_VERSION` | detect | Detected framework version is below the supported minimum. | Upgrade the framework, or pin to a wizard version that supports your range. |
24
+ | `E_PACKAGE_MANAGER_CONFLICT` | install | Multiple lockfiles present. | Delete the unused lockfile and re-run. |
25
+ | `E_PATCH_FAILED` | patch | A wizard patch threw mid-transaction; all changes rolled back. | Re-run with `--debug`; consult `allstak doctor`. |
26
+ | `E_PATCH_ROLLBACK_FAILED` | rollback | A patch failed AND the in-process rollback could not restore one or more files. | Use `allstak restore list` then `restore apply <id>`. |
27
+ | `E_RESTORE_FAILED` | restore | A `restore` operation could not complete. | Inspect `.allstak-wizard/backups/<snapshot>/manifest.json`. |
28
+ | `E_CONFIG_INVALID` | config | `allstak.config.*` failed schema validation. | Run `allstak config validate`. |
29
+ | `E_CONFIG_MIGRATION_FAILED` | config | A config-schema migration threw or refused. | Run `allstak config migrate --dry-run`. |
30
+ | `E_DOCTOR_FAILED` | validate | One or more `doctor` stages failed. | Read the per-stage `fix:` lines in the doctor output. |
31
+ | `E_INGEST_VERIFY_FAILED` | event-ingest | Live event probe could not be confirmed. | Verify API-key scope and project id. Increase `--live-probe-timeout`. |
32
+ | `E_SOURCEMAP_VERIFY_FAILED` | source-maps | Source-map upload or symbolication failed. | Run `allstak doctor`, then `allstak repair`. |
33
+ | `E_NETWORK_FAILED` | reachability | A network call timed out, refused, or hit DNS failure. | Check connectivity and the configured `--host`. |
34
+ | `E_PERMISSION_DENIED` | cli | OS-level permission was denied (file write, keychain, secret-tool, etc). | Check filesystem permissions; unlock your OS keychain. |
35
+ | `E_USER_CANCELLED` | cli | The user cancelled the operation. | No action needed. |
36
+ | `E_UNKNOWN` | cli | An unexpected error not yet categorised. | Re-run with `--debug` and open an issue. |
37
+
38
+ ## Subcodes
39
+
40
+ Subcodes are an internal grep-aid for support; they are visible in `--debug`
41
+ output and in the wizard's stack traces but are **not** part of the JSON
42
+ contract. Examples currently in use:
43
+
44
+ - `E_NO_EMAIL` / `E_NO_CODE` / `E_2FA_REQUIRED` (under `E_AUTH_REQUIRED`)
45
+ - `E_AUTH_REFRESH_FAILED` (under `E_AUTH_EXPIRED`)
46
+ - `E_NO_DETECT` / `E_AMBIGUOUS` (under `E_UNSUPPORTED_FRAMEWORK`)
47
+ - `E_HTTP_TIMEOUT` / `E_HTTP_NETWORK` (under `E_NETWORK_FAILED`)
48
+ - `E_PATCH_SYNTAX` / `E_TX_ABORT` (under `E_PATCH_FAILED`)
49
+ - `E_KEYCHAIN` / `E_DECRYPT` / `E_SECRET_TOOL` (under `E_PERMISSION_DENIED`)
50
+ - `E_NO_CONFIRM` / `E_CANCELLED` (under `E_USER_CANCELLED`)
51
+ - `E_RESTORE_UNKNOWN_FILES` / `E_NO_SNAPSHOTS` / `E_SNAPSHOT_NOT_FOUND` (under `E_RESTORE_FAILED`)
52
+
53
+ Adding a new subcode does not require a wizard release bump. Adding a new
54
+ canonical code does — this is enforced by the type union in
55
+ `src/util/error-codes.ts`.
56
+
57
+ ## Reading wizard errors
58
+
59
+ ### Human (default) output
60
+
61
+ ```
62
+ ✗ E_AUTH_EXPIRED: Stored credentials for https://api.allstak.sa are no longer valid (...)
63
+ › Run `allstak login` to refresh.
64
+ ```
65
+
66
+ ### `--json` output
67
+
68
+ ```json
69
+ {
70
+ "outcome": "failure",
71
+ "errorCode": "E_AUTH_EXPIRED",
72
+ "data": {
73
+ "error": {
74
+ "code": "E_AUTH_EXPIRED",
75
+ "stage": "auth",
76
+ "subcode": "E_AUTH_REFRESH_FAILED",
77
+ "message": "Stored credentials for https://api.allstak.sa are no longer valid (...)",
78
+ "hint": "Run `allstak login` to refresh."
79
+ }
80
+ }
81
+ }
82
+ ```
83
+
84
+ ### `--debug` output
85
+
86
+ Adds the underlying `originalCause` stack and the `context` bag. Both are
87
+ intentionally limited — `context` keys are checked against a documented
88
+ allowlist (no file paths, no token values, no PII).
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@allstak/wizard",
3
- "version": "0.1.3",
4
- "description": "Unified installation and configuration wizard for AllStak SDKs.",
3
+ "version": "0.1.5",
4
+ "description": "AllStak SDK installation and configuration wizard. Lists public Stable runtimes, fully/assisted-wires JS, React, and Next.js, and keeps manual-light server SDK setup honest.",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "allstak-wizard": "./dist/cli.js"
@@ -40,6 +40,22 @@
40
40
  "./snapshot": {
41
41
  "types": "./dist/snapshot/store.d.ts",
42
42
  "import": "./dist/snapshot/store.js"
43
+ },
44
+ "./security-snapshot": {
45
+ "types": "./dist/security-snapshot/index.d.ts",
46
+ "import": "./dist/security-snapshot/index.js"
47
+ },
48
+ "./certification": {
49
+ "types": "./dist/certification/index.d.ts",
50
+ "import": "./dist/certification/index.js"
51
+ },
52
+ "./config": {
53
+ "types": "./dist/config/index.d.ts",
54
+ "import": "./dist/config/index.js"
55
+ },
56
+ "./errors": {
57
+ "types": "./dist/util/error-codes.d.ts",
58
+ "import": "./dist/util/error-codes.js"
43
59
  }
44
60
  },
45
61
  "files": [
@@ -47,7 +63,9 @@
47
63
  "README.md",
48
64
  "LICENSE",
49
65
  "CHANGELOG.md",
50
- "docs/architecture"
66
+ "docs/errors.md",
67
+ "docs/architecture",
68
+ "docs/beta"
51
69
  ],
52
70
  "engines": {
53
71
  "node": ">=18"
@@ -55,7 +73,7 @@
55
73
  "scripts": {
56
74
  "build": "tsc -p tsconfig.json",
57
75
  "type-check": "tsc -p tsconfig.json --noEmit",
58
- "test": "node --test --test-concurrency=1 --import tsx test/markers.test.mts test/transaction.test.mts test/patchers.test.mts test/detect.test.mts test/integration-react.test.mts test/integration-next.test.mts test/integration-js.test.mts test/snapshot.test.mts test/compat.test.mts test/lifecycle.test.mts test/sourcemaps.test.mts test/migrations.test.mts test/output.test.mts test/config.test.mts test/credentials.test.mts test/restore.test.mts test/error-codes.test.mts test/telemetry.test.mts test/config-migrations.test.mts",
76
+ "test": "node --test --test-concurrency=1 --import tsx test/markers.test.mts test/transaction.test.mts test/patchers.test.mts test/detect.test.mts test/security-snapshot.test.mts test/certification.test.mts test/integration-react.test.mts test/integration-next.test.mts test/integration-js.test.mts test/integration-expo.test.mts test/integration-nestjs.test.mts test/integration-fastify.test.mts test/integration-java.test.mts test/integration-php.test.mts test/integration-python.test.mts test/integration-go.test.mts test/snapshot.test.mts test/compat.test.mts test/lifecycle.test.mts test/sourcemaps.test.mts test/migrations.test.mts test/output.test.mts test/config.test.mts test/credentials.test.mts test/restore.test.mts test/error-codes.test.mts test/telemetry.test.mts test/config-migrations.test.mts test/sensitive-data-masking.test.mts",
59
77
  "test:integration": "node --test --test-concurrency=1 --import tsx test/integration-*.test.mts",
60
78
  "wizard": "tsx src/cli.ts",
61
79
  "prepublishOnly": "npm run type-check && npm run test && npm run build"
@@ -79,7 +97,7 @@
79
97
  "allstak",
80
98
  "wizard",
81
99
  "cli",
82
- "sdk-install",
100
+ "sdk",
83
101
  "observability",
84
102
  "react",
85
103
  "nextjs"