@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.
- package/CHANGELOG.md +53 -1
- package/LICENSE +191 -0
- package/README.md +299 -47
- package/dist/api/http.d.ts +2 -0
- package/dist/api/http.d.ts.map +1 -1
- package/dist/api/http.js +6 -0
- package/dist/api/http.js.map +1 -1
- package/dist/api/index.d.ts +1 -0
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +1 -0
- package/dist/api/index.js.map +1 -1
- package/dist/api/types.d.ts +3 -3
- package/dist/api/types.js +3 -3
- package/dist/certification/fixtures.d.ts +4 -0
- package/dist/certification/fixtures.d.ts.map +1 -0
- package/dist/certification/fixtures.js +109 -0
- package/dist/certification/fixtures.js.map +1 -0
- package/dist/certification/gates.d.ts +10 -0
- package/dist/certification/gates.d.ts.map +1 -0
- package/dist/certification/gates.js +20 -0
- package/dist/certification/gates.js.map +1 -0
- package/dist/certification/index.d.ts +6 -0
- package/dist/certification/index.d.ts.map +1 -0
- package/dist/certification/index.js +5 -0
- package/dist/certification/index.js.map +1 -0
- package/dist/certification/live-backend.d.ts +50 -0
- package/dist/certification/live-backend.d.ts.map +1 -0
- package/dist/certification/live-backend.js +422 -0
- package/dist/certification/live-backend.js.map +1 -0
- package/dist/certification/packages.d.ts +3 -0
- package/dist/certification/packages.d.ts.map +1 -0
- package/dist/certification/packages.js +49 -0
- package/dist/certification/packages.js.map +1 -0
- package/dist/certification/process.d.ts +8 -0
- package/dist/certification/process.d.ts.map +1 -0
- package/dist/certification/process.js +77 -0
- package/dist/certification/process.js.map +1 -0
- package/dist/certification/report.d.ts +3 -0
- package/dist/certification/report.d.ts.map +1 -0
- package/dist/certification/report.js +38 -0
- package/dist/certification/report.js.map +1 -0
- package/dist/certification/runner.d.ts +3 -0
- package/dist/certification/runner.d.ts.map +1 -0
- package/dist/certification/runner.js +299 -0
- package/dist/certification/runner.js.map +1 -0
- package/dist/certification/runtime.d.ts +11 -0
- package/dist/certification/runtime.d.ts.map +1 -0
- package/dist/certification/runtime.js +60 -0
- package/dist/certification/runtime.js.map +1 -0
- package/dist/certification/types.d.ts +73 -0
- package/dist/certification/types.d.ts.map +1 -0
- package/dist/certification/types.js +2 -0
- package/dist/certification/types.js.map +1 -0
- package/dist/cli.js +70 -3
- package/dist/cli.js.map +1 -1
- package/dist/commands/certify.d.ts +18 -0
- package/dist/commands/certify.d.ts.map +1 -0
- package/dist/commands/certify.js +27 -0
- package/dist/commands/certify.js.map +1 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +13 -0
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/list.d.ts +5 -1
- package/dist/commands/list.d.ts.map +1 -1
- package/dist/commands/list.js +9 -3
- package/dist/commands/list.js.map +1 -1
- package/dist/commands/security-snapshot.d.ts +24 -0
- package/dist/commands/security-snapshot.d.ts.map +1 -0
- package/dist/commands/security-snapshot.js +113 -0
- package/dist/commands/security-snapshot.js.map +1 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/integrations/_scaffold.d.ts +2 -1
- package/dist/integrations/_scaffold.d.ts.map +1 -1
- package/dist/integrations/_scaffold.js +36 -13
- package/dist/integrations/_scaffold.js.map +1 -1
- package/dist/integrations/_simple-scaffold.d.ts +5 -2
- package/dist/integrations/_simple-scaffold.d.ts.map +1 -1
- package/dist/integrations/_simple-scaffold.js +3 -0
- package/dist/integrations/_simple-scaffold.js.map +1 -1
- package/dist/integrations/dotnet.d.ts.map +1 -1
- package/dist/integrations/dotnet.js +3 -0
- package/dist/integrations/dotnet.js.map +1 -1
- package/dist/integrations/expo/detect.d.ts +13 -0
- package/dist/integrations/expo/detect.d.ts.map +1 -0
- package/dist/integrations/expo/detect.js +38 -0
- package/dist/integrations/expo/detect.js.map +1 -0
- package/dist/integrations/expo/doctor.d.ts +6 -0
- package/dist/integrations/expo/doctor.d.ts.map +1 -0
- package/dist/integrations/expo/doctor.js +136 -0
- package/dist/integrations/expo/doctor.js.map +1 -0
- package/dist/integrations/expo/files.d.ts +15 -0
- package/dist/integrations/expo/files.d.ts.map +1 -0
- package/dist/integrations/expo/files.js +62 -0
- package/dist/integrations/expo/files.js.map +1 -0
- package/dist/integrations/expo/index.d.ts +24 -0
- package/dist/integrations/expo/index.d.ts.map +1 -0
- package/dist/integrations/expo/index.js +68 -0
- package/dist/integrations/expo/index.js.map +1 -0
- package/dist/integrations/expo/manifest.d.ts +3 -0
- package/dist/integrations/expo/manifest.d.ts.map +1 -0
- package/dist/integrations/expo/manifest.js +39 -0
- package/dist/integrations/expo/manifest.js.map +1 -0
- package/dist/integrations/expo/patch.d.ts +13 -0
- package/dist/integrations/expo/patch.d.ts.map +1 -0
- package/dist/integrations/expo/patch.js +215 -0
- package/dist/integrations/expo/patch.js.map +1 -0
- package/dist/integrations/expo/uninstall.d.ts +4 -0
- package/dist/integrations/expo/uninstall.d.ts.map +1 -0
- package/dist/integrations/expo/uninstall.js +77 -0
- package/dist/integrations/expo/uninstall.js.map +1 -0
- package/dist/integrations/expo.d.ts +8 -1
- package/dist/integrations/expo.d.ts.map +1 -1
- package/dist/integrations/expo.js +8 -11
- package/dist/integrations/expo.js.map +1 -1
- package/dist/integrations/fastify/detect.d.ts +3 -0
- package/dist/integrations/fastify/detect.d.ts.map +1 -0
- package/dist/integrations/fastify/detect.js +12 -0
- package/dist/integrations/fastify/detect.js.map +1 -0
- package/dist/integrations/fastify/doctor.d.ts +3 -0
- package/dist/integrations/fastify/doctor.d.ts.map +1 -0
- package/dist/integrations/fastify/doctor.js +81 -0
- package/dist/integrations/fastify/doctor.js.map +1 -0
- package/dist/integrations/fastify/files.d.ts +17 -0
- package/dist/integrations/fastify/files.d.ts.map +1 -0
- package/dist/integrations/fastify/files.js +51 -0
- package/dist/integrations/fastify/files.js.map +1 -0
- package/dist/integrations/fastify/index.d.ts +3 -0
- package/dist/integrations/fastify/index.d.ts.map +1 -0
- package/dist/integrations/fastify/index.js +47 -0
- package/dist/integrations/fastify/index.js.map +1 -0
- package/dist/integrations/fastify/manifest.d.ts +3 -0
- package/dist/integrations/fastify/manifest.d.ts.map +1 -0
- package/dist/integrations/fastify/manifest.js +34 -0
- package/dist/integrations/fastify/manifest.js.map +1 -0
- package/dist/integrations/fastify/patch.d.ts +27 -0
- package/dist/integrations/fastify/patch.d.ts.map +1 -0
- package/dist/integrations/fastify/patch.js +91 -0
- package/dist/integrations/fastify/patch.js.map +1 -0
- package/dist/integrations/fastify/uninstall.d.ts +4 -0
- package/dist/integrations/fastify/uninstall.d.ts.map +1 -0
- package/dist/integrations/fastify/uninstall.js +18 -0
- package/dist/integrations/fastify/uninstall.js.map +1 -0
- package/dist/integrations/fastify.d.ts +5 -1
- package/dist/integrations/fastify.d.ts.map +1 -1
- package/dist/integrations/fastify.js +5 -9
- package/dist/integrations/fastify.js.map +1 -1
- package/dist/integrations/flutter.d.ts.map +1 -1
- package/dist/integrations/flutter.js +3 -0
- package/dist/integrations/flutter.js.map +1 -1
- package/dist/integrations/go/index.d.ts +3 -0
- package/dist/integrations/go/index.d.ts.map +1 -0
- package/dist/integrations/go/index.js +199 -0
- package/dist/integrations/go/index.js.map +1 -0
- package/dist/integrations/go.d.ts.map +1 -1
- package/dist/integrations/go.js +5 -2
- package/dist/integrations/go.js.map +1 -1
- package/dist/integrations/java/index.d.ts +3 -0
- package/dist/integrations/java/index.d.ts.map +1 -0
- package/dist/integrations/java/index.js +472 -0
- package/dist/integrations/java/index.js.map +1 -0
- package/dist/integrations/java.d.ts.map +1 -1
- package/dist/integrations/java.js +5 -2
- package/dist/integrations/java.js.map +1 -1
- package/dist/integrations/js/manifest.d.ts.map +1 -1
- package/dist/integrations/js/manifest.js +3 -0
- package/dist/integrations/js/manifest.js.map +1 -1
- package/dist/integrations/nestjs/detect.d.ts +3 -0
- package/dist/integrations/nestjs/detect.d.ts.map +1 -0
- package/dist/integrations/nestjs/detect.js +12 -0
- package/dist/integrations/nestjs/detect.js.map +1 -0
- package/dist/integrations/nestjs/doctor.d.ts +3 -0
- package/dist/integrations/nestjs/doctor.d.ts.map +1 -0
- package/dist/integrations/nestjs/doctor.js +76 -0
- package/dist/integrations/nestjs/doctor.js.map +1 -0
- package/dist/integrations/nestjs/files.d.ts +18 -0
- package/dist/integrations/nestjs/files.d.ts.map +1 -0
- package/dist/integrations/nestjs/files.js +39 -0
- package/dist/integrations/nestjs/files.js.map +1 -0
- package/dist/integrations/nestjs/index.d.ts +3 -0
- package/dist/integrations/nestjs/index.d.ts.map +1 -0
- package/dist/integrations/nestjs/index.js +43 -0
- package/dist/integrations/nestjs/index.js.map +1 -0
- package/dist/integrations/nestjs/manifest.d.ts +3 -0
- package/dist/integrations/nestjs/manifest.d.ts.map +1 -0
- package/dist/integrations/nestjs/manifest.js +32 -0
- package/dist/integrations/nestjs/manifest.js.map +1 -0
- package/dist/integrations/nestjs/patch.d.ts +25 -0
- package/dist/integrations/nestjs/patch.d.ts.map +1 -0
- package/dist/integrations/nestjs/patch.js +66 -0
- package/dist/integrations/nestjs/patch.js.map +1 -0
- package/dist/integrations/nestjs/uninstall.d.ts +4 -0
- package/dist/integrations/nestjs/uninstall.d.ts.map +1 -0
- package/dist/integrations/nestjs/uninstall.js +18 -0
- package/dist/integrations/nestjs/uninstall.js.map +1 -0
- package/dist/integrations/nestjs.d.ts +5 -1
- package/dist/integrations/nestjs.d.ts.map +1 -1
- package/dist/integrations/nestjs.js +5 -9
- package/dist/integrations/nestjs.js.map +1 -1
- package/dist/integrations/next/index.js +2 -2
- package/dist/integrations/next/index.js.map +1 -1
- package/dist/integrations/next/manifest.d.ts.map +1 -1
- package/dist/integrations/next/manifest.js +4 -1
- package/dist/integrations/next/manifest.js.map +1 -1
- package/dist/integrations/next/patch.js +8 -3
- package/dist/integrations/next/patch.js.map +1 -1
- package/dist/integrations/next/uninstall.d.ts.map +1 -1
- package/dist/integrations/next/uninstall.js +10 -1
- package/dist/integrations/next/uninstall.js.map +1 -1
- package/dist/integrations/otel.d.ts.map +1 -1
- package/dist/integrations/otel.js +4 -1
- package/dist/integrations/otel.js.map +1 -1
- package/dist/integrations/php.d.ts.map +1 -1
- package/dist/integrations/php.js +16 -3
- package/dist/integrations/php.js.map +1 -1
- package/dist/integrations/python/index.d.ts +3 -0
- package/dist/integrations/python/index.d.ts.map +1 -0
- package/dist/integrations/python/index.js +222 -0
- package/dist/integrations/python/index.js.map +1 -0
- package/dist/integrations/python.d.ts.map +1 -1
- package/dist/integrations/python.js +5 -2
- package/dist/integrations/python.js.map +1 -1
- package/dist/integrations/react/doctor.d.ts.map +1 -1
- package/dist/integrations/react/doctor.js +41 -8
- package/dist/integrations/react/doctor.js.map +1 -1
- package/dist/integrations/react/index.d.ts.map +1 -1
- package/dist/integrations/react/index.js +1 -4
- package/dist/integrations/react/index.js.map +1 -1
- package/dist/integrations/react/manifest.d.ts.map +1 -1
- package/dist/integrations/react/manifest.js +4 -1
- package/dist/integrations/react/manifest.js.map +1 -1
- package/dist/integrations/react/patch.d.ts.map +1 -1
- package/dist/integrations/react/patch.js +120 -8
- package/dist/integrations/react/patch.js.map +1 -1
- package/dist/integrations/react/uninstall.d.ts.map +1 -1
- package/dist/integrations/react/uninstall.js +20 -1
- package/dist/integrations/react/uninstall.js.map +1 -1
- package/dist/integrations/react-native.d.ts.map +1 -1
- package/dist/integrations/react-native.js +3 -0
- package/dist/integrations/react-native.js.map +1 -1
- package/dist/integrations/ruby.d.ts.map +1 -1
- package/dist/integrations/ruby.js +3 -0
- package/dist/integrations/ruby.js.map +1 -1
- package/dist/output/human.d.ts.map +1 -1
- package/dist/output/human.js +38 -7
- package/dist/output/human.js.map +1 -1
- package/dist/registry/index.d.ts.map +1 -1
- package/dist/registry/index.js +9 -23
- package/dist/registry/index.js.map +1 -1
- package/dist/registry/manifest.d.ts +8 -0
- package/dist/registry/manifest.d.ts.map +1 -1
- package/dist/security-snapshot/builder.d.ts +3 -0
- package/dist/security-snapshot/builder.d.ts.map +1 -0
- package/dist/security-snapshot/builder.js +343 -0
- package/dist/security-snapshot/builder.js.map +1 -0
- package/dist/security-snapshot/client.d.ts +3 -0
- package/dist/security-snapshot/client.d.ts.map +1 -0
- package/dist/security-snapshot/client.js +38 -0
- package/dist/security-snapshot/client.js.map +1 -0
- package/dist/security-snapshot/index.d.ts +4 -0
- package/dist/security-snapshot/index.d.ts.map +1 -0
- package/dist/security-snapshot/index.js +3 -0
- package/dist/security-snapshot/index.js.map +1 -0
- package/dist/security-snapshot/types.d.ts +57 -0
- package/dist/security-snapshot/types.d.ts.map +1 -0
- package/dist/security-snapshot/types.js +2 -0
- package/dist/security-snapshot/types.js.map +1 -0
- package/dist/sourcemaps/next.js +3 -3
- package/dist/sourcemaps/next.js.map +1 -1
- package/dist/sourcemaps/vite.d.ts.map +1 -1
- package/dist/sourcemaps/vite.js +92 -9
- package/dist/sourcemaps/vite.js.map +1 -1
- package/dist/util/wizard-version.d.ts +1 -1
- package/dist/util/wizard-version.js +1 -1
- package/docs/architecture/v02-java-host-fix-spec.md +4 -8
- package/docs/architecture/v02-sourcemaps-e2e-spec.md +1 -1
- package/docs/beta/README.md +17 -0
- package/docs/beta/ci.md +122 -0
- package/docs/beta/config.md +124 -0
- package/docs/beta/doctor.md +79 -0
- package/docs/beta/expo.md +69 -0
- package/docs/beta/fastify.md +62 -0
- package/docs/beta/known-limitations.md +93 -0
- package/docs/beta/nestjs.md +69 -0
- package/docs/beta/next.md +76 -0
- package/docs/beta/node.md +60 -0
- package/docs/beta/privacy.md +99 -0
- package/docs/beta/quickstart.md +89 -0
- package/docs/beta/react.md +91 -0
- package/docs/beta/reliability.md +33 -0
- package/docs/beta/restore.md +84 -0
- package/docs/beta/troubleshooting.md +133 -0
- package/docs/errors.md +88 -0
- package/package.json +23 -5
package/CHANGELOG.md
CHANGED
|
@@ -4,7 +4,59 @@ All notable changes to `@allstak/wizard` will be documented here. The format
|
|
|
4
4
|
follows [Keep a Changelog](https://keepachangelog.com/) and this project
|
|
5
5
|
adheres to [Semantic Versioning](https://semver.org/).
|
|
6
6
|
|
|
7
|
-
## [Unreleased] — 0.1.
|
|
7
|
+
## [Unreleased] — 0.1.4-beta.0
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
- **Expo (managed workflow) → beta.** New `expo` integration patches
|
|
11
|
+
`app.json:expo.plugins[]` (idempotent), AST-injects `AllStakProvider`
|
|
12
|
+
import in `App.tsx`, and appends a managed-block hint. Refuses on
|
|
13
|
+
prebuilt projects (`ios/` or `android/` present) with a clear error.
|
|
14
|
+
See `docs/beta/expo.md`.
|
|
15
|
+
- **NestJS → beta.** New `nestjs` integration AST-injects
|
|
16
|
+
`AllStakNestExceptionFilter` / `AllStakNestInterceptor` imports and
|
|
17
|
+
appends a managed-block hint demonstrating `useGlobalFilters` /
|
|
18
|
+
`useGlobalInterceptors` registration. Wizard does NOT auto-mutate
|
|
19
|
+
`bootstrap()`. Compat: `@nestjs/core >= 9`. See `docs/beta/nestjs.md`.
|
|
20
|
+
- **Fastify → beta.** New `fastify` integration; ESM entries get an
|
|
21
|
+
AST-injected `allstakFastify` import, CJS entries get a hint-only
|
|
22
|
+
patch. Both branches append a managed-block hint demonstrating
|
|
23
|
+
`app.register(allstakFastify, ...)`. Compat: `fastify >= 4`. See
|
|
24
|
+
`docs/beta/fastify.md`.
|
|
25
|
+
- Next 15 fixture (`fixtures/next-app-router-15`) added to the
|
|
26
|
+
integration test matrix; `next` integration now exercised against
|
|
27
|
+
Next 13/14/15 in unit tests + CI.
|
|
28
|
+
- Three new fixtures (`fixtures/expo-managed`, `fixtures/nestjs-app`,
|
|
29
|
+
`fixtures/fastify-server`) drive ~30 new integration tests covering
|
|
30
|
+
detect (incl. version refusal), patch shape, idempotency (byte-equal
|
|
31
|
+
re-run), uninstall reversal, and `doctor` warn→pass transitions.
|
|
32
|
+
- CI matrix expanded to 8 fixtures × 3 Node versions (18/20/22) =
|
|
33
|
+
**24 install/uninstall/repair/restore/idempotency cycles per push**.
|
|
34
|
+
|
|
35
|
+
### Changed
|
|
36
|
+
- Test count: **157 / 157** passing (was 123/123).
|
|
37
|
+
- Next.js uninstall ordering fixed: `removeManagedSourceBlock` now runs
|
|
38
|
+
BEFORE `patchJsModule(removeImport)`, so wizard-created
|
|
39
|
+
`instrumentation.ts` files (whose entire content lives inside the
|
|
40
|
+
managed markers) are correctly deleted on uninstall instead of being
|
|
41
|
+
orphaned.
|
|
42
|
+
- Next.js `ensureInstrumentationFile` now wraps wizard-generated
|
|
43
|
+
`register()` content inside managed-block markers when creating the
|
|
44
|
+
file from scratch — required for clean uninstall round-trip.
|
|
45
|
+
- `next` stability **explicitly held at `beta`** until source-map upload
|
|
46
|
+
+ symbolication roundtrip is validated end-to-end (tracked by an
|
|
47
|
+
assertion in the unit tests so we cannot accidentally promote it).
|
|
48
|
+
- README rewritten to reflect the v0.1.3 beta surface (real auth, full
|
|
49
|
+
command list, telemetry contract, error catalog, current v0.2
|
|
50
|
+
roadmap), and the integration matrix updated to show Expo / NestJS /
|
|
51
|
+
Fastify at `beta`.
|
|
52
|
+
- Package metadata polished for npm: tighter description, `sdk-install`
|
|
53
|
+
keyword consolidated to `sdk`, exports map gains `./config` and
|
|
54
|
+
`./errors` subpaths, `files` whitelist gains `docs/errors.md` and
|
|
55
|
+
`docs/beta/`.
|
|
56
|
+
- Scrubbed two absolute local paths from shipped content
|
|
57
|
+
(`docs/architecture/v02-java-host-fix-spec.md`, `src/api/types.ts`).
|
|
58
|
+
|
|
59
|
+
## [0.1.3] — 2026-05-07
|
|
8
60
|
|
|
9
61
|
### Added
|
|
10
62
|
- Privacy-safe telemetry (`src/telemetry/*`) — disabled by default until an
|
package/LICENSE
ADDED
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to the Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by the Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding any notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
Copyright 2024-2026 AllStak
|
|
180
|
+
|
|
181
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
182
|
+
you may not use this file except in compliance with the License.
|
|
183
|
+
You may obtain a copy of the License at
|
|
184
|
+
|
|
185
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
186
|
+
|
|
187
|
+
Unless required by applicable law or agreed to in writing, software
|
|
188
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
189
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
190
|
+
See the License for the specific language governing permissions and
|
|
191
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,79 +1,331 @@
|
|
|
1
1
|
# @allstak/wizard
|
|
2
2
|
|
|
3
|
-
> v0.1 — Unified installation and configuration wizard for AllStak SDKs.
|
|
3
|
+
> **v0.1.4** — Unified installation and configuration wizard for AllStak SDKs.
|
|
4
4
|
|
|
5
|
-
A Sentry-Wizard-style CLI that installs and configures AllStak SDKs in
|
|
5
|
+
A Sentry-Wizard-style CLI that installs and configures AllStak SDKs in
|
|
6
|
+
your project with one command where automation is complete, and shows
|
|
7
|
+
Manual/light setup guidance where the runtime is Stable but automation is not
|
|
8
|
+
finished. Designed to be **honest by default**: runtime stability and wizard
|
|
9
|
+
automation maturity are separate claims.
|
|
6
10
|
|
|
7
|
-
## Status
|
|
11
|
+
## Public SDK Status
|
|
8
12
|
|
|
9
|
-
| Integration
|
|
10
|
-
|
|
11
|
-
| `
|
|
12
|
-
| `
|
|
13
|
-
| `
|
|
14
|
-
| `
|
|
15
|
-
| `
|
|
16
|
-
| `
|
|
13
|
+
| Integration | Runtime status | Wizard status | Notes |
|
|
14
|
+
|-------------|----------------|-------------------|-------|
|
|
15
|
+
| `js` (JavaScript / TypeScript) | Stable | Stable | Validated end-to-end; wizard can install and wire init. |
|
|
16
|
+
| `react` (Vite or CRA) | Stable | Stable | Validated end-to-end; wizard can install and wire common app entry patterns. |
|
|
17
|
+
| `react-native` (Expo + bare RN) | Stable | Manual/light | Runtime is Stable; wizard provides setup guidance. |
|
|
18
|
+
| `next` (13+, app + pages router) | Beta | Beta | Runtime is Beta (certification score 32); wizard provides App Router and pages-router onboarding. Edge Runtime and Server Actions are not certified. |
|
|
19
|
+
| `java` (Java / Spring Boot) | Beta | Manual/light | Runtime is Beta (certification score 34); wizard provides setup guidance. |
|
|
20
|
+
| `python` | Beta | Manual/light | Runtime is Beta (certification score 34); wizard provides setup guidance. |
|
|
21
|
+
| `go` | Beta | Manual/light | Runtime is Beta (certification score 33); wizard provides setup guidance. |
|
|
17
22
|
|
|
18
|
-
|
|
23
|
+
`allstak-wizard list` prints public runtime SDKs and makes wizard maturity
|
|
24
|
+
explicit. Manual/light entries are setup guidance, not full automation.
|
|
19
25
|
|
|
20
|
-
## Install
|
|
26
|
+
## Install + run
|
|
21
27
|
|
|
22
|
-
|
|
28
|
+
```bash
|
|
29
|
+
# Show help (also fetches and runs the package via npx).
|
|
30
|
+
npx @allstak/wizard --help
|
|
31
|
+
|
|
32
|
+
# Authenticate against AllStak (email OTP, optional 2FA).
|
|
33
|
+
npx @allstak/wizard login
|
|
34
|
+
|
|
35
|
+
# Configure your project (auto-detects React / Next / Node).
|
|
36
|
+
npx @allstak/wizard -i react
|
|
37
|
+
|
|
38
|
+
# Verify with a real test event roundtrip.
|
|
39
|
+
npx @allstak/wizard doctor --live-probe \
|
|
40
|
+
--api-key ask_live_... \
|
|
41
|
+
--project-id <project-uuid>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Five-minute walkthrough: [`docs/beta/quickstart.md`](./docs/beta/quickstart.md).
|
|
45
|
+
|
|
46
|
+
## Authentication
|
|
47
|
+
|
|
48
|
+
Real AllStak auth flow — no fake endpoints. Backed by the verified
|
|
49
|
+
`/api/v1/auth/*` endpoints on `api.allstak.sa`.
|
|
23
50
|
|
|
24
51
|
```bash
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
52
|
+
allstak-wizard login # email OTP → JWT pair stored in OS keychain
|
|
53
|
+
allstak-wizard whoami [--verify] # show current user; --verify round-trips /auth/me
|
|
54
|
+
allstak-wizard logout # revoke session + clear local credentials
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Supports:
|
|
58
|
+
|
|
59
|
+
- **Email OTP** primary flow (`/api/v1/auth/request-otp` → `/api/v1/auth/verify-otp`).
|
|
60
|
+
- **TOTP** second factor when enabled on the account.
|
|
61
|
+
- **JWT refresh** with proactive 60s pre-expiry refresh + token rotation.
|
|
62
|
+
- **CI mode** via `--api-key` / `ALLSTAK_API_KEY` (skip login entirely).
|
|
63
|
+
- **Cross-platform credential storage**: macOS Keychain, Linux Secret
|
|
64
|
+
Service (`secret-tool`), AES-256-GCM encrypted-file fallback.
|
|
65
|
+
|
|
66
|
+
`--api-key` is for project-scoped data-plane operations (sending events).
|
|
67
|
+
The user JWT is for control-plane operations (orgs, projects, doctor). The
|
|
68
|
+
two are NOT interchangeable — that mirrors the backend's design.
|
|
69
|
+
|
|
70
|
+
## Commands
|
|
71
|
+
|
|
72
|
+
```
|
|
73
|
+
init [-i <integration>] [--api-key|--org|--project|--release|...] [--dry-run] [-y]
|
|
74
|
+
doctor [-i <integration>] [--live-probe --api-key --project-id <uuid>]
|
|
75
|
+
repair -i <integration> [--dry-run]
|
|
76
|
+
uninstall -i <integration> [-y] [--dry-run]
|
|
77
|
+
list
|
|
78
|
+
|
|
79
|
+
login [--email <e> --code <c>] [--totp <c>]
|
|
80
|
+
logout [--local-only]
|
|
81
|
+
whoami [--verify]
|
|
82
|
+
|
|
83
|
+
orgs list
|
|
84
|
+
projects list [--org <id>]
|
|
85
|
+
projects create [--name --slug --platform --with-api-key]
|
|
86
|
+
|
|
87
|
+
restore list
|
|
88
|
+
restore show <id|latest>
|
|
89
|
+
restore apply <id|latest> [--files=a,b,c] [--dry-run] [-y]
|
|
90
|
+
restore diff <id|latest>
|
|
91
|
+
|
|
92
|
+
config validate
|
|
93
|
+
config migrate [--dry-run]
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Global flags:
|
|
97
|
+
|
|
98
|
+
```
|
|
99
|
+
--debug verbose debug logging
|
|
100
|
+
--json machine-readable output to stdout (status text → stderr)
|
|
101
|
+
--no-telemetry disable anonymous usage telemetry for this run
|
|
102
|
+
--telemetry-debug print the telemetry payload to stderr without sending
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## Telemetry & privacy
|
|
106
|
+
|
|
107
|
+
**Default provider is `noopTelemetry`** — the wizard does not phone home in
|
|
108
|
+
beta. An HTTP provider exists (`httpTelemetry({ endpoint })`) for operators
|
|
109
|
+
to wire in once a backend telemetry endpoint is decided on.
|
|
110
|
+
|
|
111
|
+
Three independent ways to opt out, any one suffices:
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
npx @allstak/wizard --no-telemetry ...
|
|
115
|
+
ALLSTAK_WIZARD_TELEMETRY=0 npx @allstak/wizard ...
|
|
116
|
+
# Or: leave the default noop provider in place (no operator config).
|
|
28
117
|
```
|
|
29
118
|
|
|
30
|
-
|
|
119
|
+
Inspect what _would_ be sent:
|
|
31
120
|
|
|
32
121
|
```bash
|
|
33
|
-
|
|
34
|
-
|
|
122
|
+
npx @allstak/wizard --telemetry-debug -i react --dry-run
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
The wizard's payload type is the entire on-the-wire contract. We do **NOT**
|
|
126
|
+
collect:
|
|
127
|
+
|
|
128
|
+
- API keys, DSNs, refresh tokens, OAuth secrets
|
|
129
|
+
- Org names, project names, project ids, org ids
|
|
130
|
+
- File paths (absolute or relative)
|
|
131
|
+
- Env-var values
|
|
132
|
+
- Source code, error message text, stack frames
|
|
133
|
+
- Email addresses, IP addresses, hostnames
|
|
134
|
+
|
|
135
|
+
We do collect: wizard version, command, integration id, stability level,
|
|
136
|
+
OS family + major, Node major, package manager, outcome, stage, canonical
|
|
137
|
+
error code (no message text), `rollbackTriggered` (boolean), `durationMs`.
|
|
35
138
|
|
|
36
|
-
|
|
37
|
-
allstak-wizard -i react --api-key $ALLSTAK_API_KEY -y
|
|
139
|
+
Full contract: [`docs/beta/privacy.md`](./docs/beta/privacy.md).
|
|
38
140
|
|
|
39
|
-
|
|
40
|
-
allstak-wizard -i next --host https://api.acme.allstak.com --api-key $KEY -y
|
|
141
|
+
## Config (`allstak.config.{ts,mjs,js,cjs,json}`)
|
|
41
142
|
|
|
42
|
-
|
|
43
|
-
|
|
143
|
+
Optional project-level config so you don't repeat `--org`, `--project`,
|
|
144
|
+
`--host`, etc. on every wizard invocation.
|
|
44
145
|
|
|
45
|
-
|
|
46
|
-
allstak
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
146
|
+
```ts
|
|
147
|
+
import { defineConfig } from '@allstak/wizard/config';
|
|
148
|
+
|
|
149
|
+
export default defineConfig({
|
|
150
|
+
schemaVersion: 1,
|
|
151
|
+
organization: 'my-org',
|
|
152
|
+
project: 'my-project',
|
|
153
|
+
environment: 'production',
|
|
154
|
+
release: process.env.GIT_SHA,
|
|
155
|
+
sourceMaps: {
|
|
156
|
+
enabled: true,
|
|
157
|
+
ignore: ['node_modules'],
|
|
158
|
+
},
|
|
159
|
+
selfHosted: {
|
|
160
|
+
apiHost: 'https://api.allstak.example',
|
|
161
|
+
ingestHost: 'https://api.allstak.example',
|
|
162
|
+
dashboardHost: 'https://app.allstak.example',
|
|
163
|
+
},
|
|
164
|
+
});
|
|
50
165
|
```
|
|
51
166
|
|
|
52
|
-
|
|
167
|
+
**Precedence:** `CLI flag > env var > config file > built-in default`.
|
|
53
168
|
|
|
54
|
-
|
|
169
|
+
Validate:
|
|
55
170
|
|
|
56
|
-
|
|
171
|
+
```bash
|
|
172
|
+
allstak-wizard config validate
|
|
173
|
+
```
|
|
57
174
|
|
|
58
|
-
|
|
59
|
-
- **Transaction** — every file mutation goes through a `Transaction` that snapshots before writing, validates syntax after writing, and rolls back the entire batch on any failure.
|
|
60
|
-
- **Markers** — every injected region is wrapped with `>>> allstak-wizard:v1` markers. Re-runs replace the existing block (idempotent). `uninstall` removes the block cleanly.
|
|
61
|
-
- **AST patching** — JS/TS files use `magicast` (recast under the hood) to add imports without disturbing user code; non-AST changes (provider wrap hints, Vite plugin hints) live in marker blocks.
|
|
62
|
-
- **Dry-run** — every command supports `--dry-run`; the transaction layer captures the diff but skips disk writes.
|
|
175
|
+
Migrate to a new schema version:
|
|
63
176
|
|
|
64
|
-
|
|
177
|
+
```bash
|
|
178
|
+
allstak-wizard config migrate --dry-run # preview
|
|
179
|
+
allstak-wizard config migrate # rewrites .json in place
|
|
180
|
+
```
|
|
65
181
|
|
|
66
|
-
|
|
182
|
+
Full reference: [`docs/beta/config.md`](./docs/beta/config.md).
|
|
67
183
|
|
|
68
|
-
##
|
|
184
|
+
## Doctor (deterministic diagnostics)
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
allstak-wizard doctor # offline check
|
|
188
|
+
allstak-wizard doctor --live-probe \ # send + verify a real event
|
|
189
|
+
--api-key ask_live_... --project-id <uuid>
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
Runs seven named stages in fixed order — `auth → reachability → config →
|
|
193
|
+
integration → event-ingest → release-linkage → source-maps`. Each stage
|
|
194
|
+
reports `pass`/`warn`/`fail`/`skip` with an actionable fix. Live probe POSTs
|
|
195
|
+
to `/ingest/v1/errors`, polls `/api/v1/errors`, and prints the dashboard URL
|
|
196
|
+
of the captured event.
|
|
197
|
+
|
|
198
|
+
Full reference: [`docs/beta/doctor.md`](./docs/beta/doctor.md).
|
|
199
|
+
|
|
200
|
+
SDK reliability and outage behavior are documented in
|
|
201
|
+
[`docs/beta/reliability.md`](./docs/beta/reliability.md). Wizard-generated
|
|
202
|
+
runtime integrations must be fail-open: AllStak ingest outages should drop or
|
|
203
|
+
delay telemetry, not break the host application.
|
|
204
|
+
|
|
205
|
+
## Restore (persistent snapshots)
|
|
206
|
+
|
|
207
|
+
Every wizard mutation is captured under
|
|
208
|
+
`.allstak-wizard/backups/<id>/manifest.json` plus per-file pre-images.
|
|
69
209
|
|
|
70
210
|
```bash
|
|
71
|
-
|
|
72
|
-
|
|
211
|
+
allstak-wizard restore list
|
|
212
|
+
allstak-wizard restore show latest
|
|
213
|
+
allstak-wizard restore diff latest
|
|
214
|
+
allstak-wizard restore apply latest [--files=src/main.tsx]
|
|
73
215
|
```
|
|
74
216
|
|
|
75
|
-
|
|
217
|
+
Full reference: [`docs/beta/restore.md`](./docs/beta/restore.md).
|
|
218
|
+
|
|
219
|
+
## Error codes
|
|
220
|
+
|
|
221
|
+
22 canonical error codes — stable across releases (added; never renamed).
|
|
222
|
+
Both human and `--json` output expose `{code, stage, subcode?, message,
|
|
223
|
+
hint}`. Catalog: [`docs/errors.md`](./docs/errors.md).
|
|
224
|
+
|
|
225
|
+
```bash
|
|
226
|
+
$ allstak-wizard --json -i react -y --skip-deps
|
|
227
|
+
{
|
|
228
|
+
"outcome": "failure",
|
|
229
|
+
"errorCode": "E_AUTH_REQUIRED",
|
|
230
|
+
"data": { "error": {
|
|
231
|
+
"code": "E_AUTH_REQUIRED",
|
|
232
|
+
"stage": "auth",
|
|
233
|
+
"subcode": "E_MISSING_KEY",
|
|
234
|
+
"message": "...",
|
|
235
|
+
"hint": "Pass --api-key or run `allstak login`."
|
|
236
|
+
} }
|
|
237
|
+
}
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
Exit codes: `0` success, `2` `WizardError`, `130` user cancellation.
|
|
241
|
+
|
|
242
|
+
## Self-hosted
|
|
243
|
+
|
|
244
|
+
Pass `--host`, `--ingest-host`, `--dashboard-host` directly, or set
|
|
245
|
+
`selfHosted.*` in `allstak.config.*`. The wizard never assumes
|
|
246
|
+
`api.allstak.sa`.
|
|
247
|
+
|
|
248
|
+
**Caveat:** `allstak-java-sdk` currently hardcodes its host. Until that
|
|
249
|
+
SDK ships a configurable `host` field, the wizard's `--host` flag is a
|
|
250
|
+
no-op for `-i java`. Spec for the SDK fix:
|
|
251
|
+
[`docs/architecture/v02-java-host-fix-spec.md`](./docs/architecture/v02-java-host-fix-spec.md).
|
|
252
|
+
|
|
253
|
+
## Architecture
|
|
254
|
+
|
|
255
|
+
- **Registry** — every integration is an `Integration` object with
|
|
256
|
+
`detect`, `plan`, `install`, `patch`, `validate`, `uninstall`, `repair`,
|
|
257
|
+
`doctor` methods. New integrations register themselves; the CLI is
|
|
258
|
+
integration-agnostic.
|
|
259
|
+
- **Transaction** — every file mutation snapshots before write, syntax-
|
|
260
|
+
validates after write, and rolls back the entire batch on any failure.
|
|
261
|
+
- **Persistent snapshots** — alongside in-memory rollback, every run
|
|
262
|
+
writes a backup under `.allstak-wizard/backups/<id>/` for cross-run
|
|
263
|
+
recovery via `restore`.
|
|
264
|
+
- **Markers** — every injected region wrapped with `>>> allstak-wizard:v1`
|
|
265
|
+
markers. Re-runs replace in place (idempotent). `uninstall` removes the
|
|
266
|
+
block cleanly.
|
|
267
|
+
- **AST patching** — `magicast` (recast under the hood) for JS/TS imports;
|
|
268
|
+
managed-block hints for non-AST patches (Vite plugins, Next config).
|
|
269
|
+
- **Dry-run** — every command supports `--dry-run`; transaction layer
|
|
270
|
+
captures the diff and skips disk writes.
|
|
271
|
+
- **Source-map providers** — pluggable abstraction (`vite`, `webpack`,
|
|
272
|
+
`next`, `metro`); integrations select a provider by id.
|
|
273
|
+
- **Lifecycle hooks** — `beforeInstall`/`afterInstall`/`beforePatch`/
|
|
274
|
+
`afterPatch`/`beforeRollback`/`afterRollback`/`beforeUninstall`/
|
|
275
|
+
`afterUninstall` for telemetry + plugin extensions.
|
|
276
|
+
|
|
277
|
+
Full design docs: [`docs/architecture/`](./docs/architecture/).
|
|
278
|
+
|
|
279
|
+
## Development from source
|
|
280
|
+
|
|
281
|
+
```bash
|
|
282
|
+
cd /path/to/sdks/allstak-wizard
|
|
283
|
+
npm install
|
|
284
|
+
npm run type-check # tsc --noEmit (clean)
|
|
285
|
+
npm test # 157 tests, ~5s
|
|
286
|
+
npm run build # emits dist/ with .d.ts + source maps
|
|
287
|
+
npx tsx src/cli.ts --help # run from source
|
|
288
|
+
|
|
289
|
+
# Smoke against a fixture (no network, no SDK install):
|
|
290
|
+
cd fixtures/react-vite
|
|
291
|
+
ALLSTAK_API_KEY=ask_test \
|
|
292
|
+
npx --prefix ../.. tsx ../../src/cli.ts -i react --dry-run -y --skip-deps
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
## Testing
|
|
296
|
+
|
|
297
|
+
| Status | Count |
|
|
298
|
+
|--------|-------|
|
|
299
|
+
| Type-check | clean |
|
|
300
|
+
| Unit + integration tests | **157 / 157** passing |
|
|
301
|
+
| Build | clean (.js + .d.ts + source maps) |
|
|
302
|
+
|
|
303
|
+
Tests run on temp-dir fixtures (no network, no real SDK install) and
|
|
304
|
+
validate idempotency, rollback, dry-run, restore round-trip, error catalog
|
|
305
|
+
coverage, telemetry payload contract, and config migration plumbing.
|
|
306
|
+
|
|
307
|
+
## Roadmap
|
|
308
|
+
|
|
309
|
+
Beta is shipping intentionally narrow. v0.2 priorities:
|
|
310
|
+
|
|
311
|
+
1. **Bare React Native** — Podfile + Gradle patchers + iOS/Android
|
|
312
|
+
validation matrix. Spec:
|
|
313
|
+
[`docs/architecture/v02-bare-react-native-spec.md`](./docs/architecture/v02-bare-react-native-spec.md).
|
|
314
|
+
2. **Source-maps end-to-end** — upload + symbolication round-trip against
|
|
315
|
+
`/api/v1/sourcemaps/upload`. Spec:
|
|
316
|
+
[`docs/architecture/v02-sourcemaps-e2e-spec.md`](./docs/architecture/v02-sourcemaps-e2e-spec.md).
|
|
317
|
+
3. **Astro support** — currently falls through to `js` (env vars only).
|
|
318
|
+
4. **Java SDK host fix** — coordinate with `allstak-java-sdk` to make
|
|
319
|
+
host configurable.
|
|
320
|
+
5. **Backend SDK framework wiring** — NestJS `main.ts`, Spring Boot
|
|
321
|
+
`application.yml`, Django/FastAPI/Flask/Rails/.NET/Go/PHP entry-point
|
|
322
|
+
patching with per-framework fixture validation.
|
|
323
|
+
6. **Telemetry HTTP endpoint** — backend contract pending.
|
|
324
|
+
|
|
325
|
+
## License
|
|
326
|
+
|
|
327
|
+
Apache-2.0 — see [`LICENSE`](./LICENSE).
|
|
76
328
|
|
|
77
|
-
##
|
|
329
|
+
## Issues
|
|
78
330
|
|
|
79
|
-
|
|
331
|
+
[github.com/allstak-io/sdks/issues](https://github.com/allstak-io/sdks/issues)
|
package/dist/api/http.d.ts
CHANGED
|
@@ -33,6 +33,8 @@ export interface RequestInit {
|
|
|
33
33
|
signal?: AbortSignal;
|
|
34
34
|
/** Override Content-Type — used by source-map upload (still JSON in body but custom MIME). */
|
|
35
35
|
contentType?: string;
|
|
36
|
+
/** Extra non-auth headers. Callers must not pass secrets except purpose-scoped control-plane headers. */
|
|
37
|
+
headers?: Record<string, string | undefined>;
|
|
36
38
|
}
|
|
37
39
|
export interface ApiResponse<T> {
|
|
38
40
|
status: number;
|
package/dist/api/http.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/api/http.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;GAYG;AAEH,MAAM,MAAM,QAAQ,GAChB;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAChB;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACjC;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;AAEpC,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,CAAC;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,uBAAuB;IACvB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC,CAAC;IAC9D,IAAI,EAAE,QAAQ,CAAC;IACf,qCAAqC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sDAAsD;IACtD,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,8FAA8F;IAC9F,WAAW,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/api/http.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;GAYG;AAEH,MAAM,MAAM,QAAQ,GAChB;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAChB;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACjC;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;AAEpC,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,CAAC;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,uBAAuB;IACvB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC,CAAC;IAC9D,IAAI,EAAE,QAAQ,CAAC;IACf,qCAAqC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sDAAsD;IACtD,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,8FAA8F;IAC9F,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,yGAAyG;IACzG,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;CAC9C;AAED,MAAM,WAAW,WAAW,CAAC,CAAC;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,CAAC,CAAC;IACR,oBAAoB;IACpB,EAAE,EAAE,OAAO,CAAC;CACb;AAID,wBAAsB,UAAU,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CA2E5F"}
|
package/dist/api/http.js
CHANGED
|
@@ -13,6 +13,12 @@ export async function apiRequest(host, init) {
|
|
|
13
13
|
else if (init.auth.kind === 'apiKey') {
|
|
14
14
|
headers['X-AllStak-Key'] = init.auth.key;
|
|
15
15
|
}
|
|
16
|
+
if (init.headers) {
|
|
17
|
+
for (const [key, value] of Object.entries(init.headers)) {
|
|
18
|
+
if (value !== undefined && value !== '')
|
|
19
|
+
headers[key] = value;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
16
22
|
const controller = new AbortController();
|
|
17
23
|
const externalSignal = init.signal;
|
|
18
24
|
const timeout = setTimeout(() => controller.abort(new Error('timeout')), init.timeoutMs ?? DEFAULT_TIMEOUT);
|