@allstak/wizard 0.1.3
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 +90 -0
- package/README.md +79 -0
- package/dist/api/auth-client.d.ts +22 -0
- package/dist/api/auth-client.d.ts.map +1 -0
- package/dist/api/auth-client.js +65 -0
- package/dist/api/auth-client.js.map +1 -0
- package/dist/api/auth.d.ts +39 -0
- package/dist/api/auth.d.ts.map +1 -0
- package/dist/api/auth.js +69 -0
- package/dist/api/auth.js.map +1 -0
- package/dist/api/client.d.ts +15 -0
- package/dist/api/client.d.ts.map +1 -0
- package/dist/api/client.js +19 -0
- package/dist/api/client.js.map +1 -0
- package/dist/api/http.d.ts +44 -0
- package/dist/api/http.d.ts.map +1 -0
- package/dist/api/http.js +130 -0
- package/dist/api/http.js.map +1 -0
- package/dist/api/index.d.ts +12 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/index.js +12 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/orgs-client.d.ts +16 -0
- package/dist/api/orgs-client.d.ts.map +1 -0
- package/dist/api/orgs-client.js +36 -0
- package/dist/api/orgs-client.js.map +1 -0
- package/dist/api/projects-client.d.ts +27 -0
- package/dist/api/projects-client.d.ts.map +1 -0
- package/dist/api/projects-client.js +58 -0
- package/dist/api/projects-client.js.map +1 -0
- package/dist/api/setup-doctor-client.d.ts +31 -0
- package/dist/api/setup-doctor-client.d.ts.map +1 -0
- package/dist/api/setup-doctor-client.js +68 -0
- package/dist/api/setup-doctor-client.js.map +1 -0
- package/dist/api/types.d.ts +92 -0
- package/dist/api/types.d.ts.map +1 -0
- package/dist/api/types.js +9 -0
- package/dist/api/types.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +303 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/_context.d.ts +37 -0
- package/dist/commands/_context.d.ts.map +1 -0
- package/dist/commands/_context.js +61 -0
- package/dist/commands/_context.js.map +1 -0
- package/dist/commands/config-cmd.d.ts +24 -0
- package/dist/commands/config-cmd.d.ts.map +1 -0
- package/dist/commands/config-cmd.js +137 -0
- package/dist/commands/config-cmd.js.map +1 -0
- package/dist/commands/doctor.d.ts +58 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +389 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/init.d.ts +28 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +157 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/list.d.ts +3 -0
- package/dist/commands/list.d.ts.map +1 -0
- package/dist/commands/list.js +14 -0
- package/dist/commands/list.js.map +1 -0
- package/dist/commands/login.d.ts +27 -0
- package/dist/commands/login.d.ts.map +1 -0
- package/dist/commands/login.js +116 -0
- package/dist/commands/login.js.map +1 -0
- package/dist/commands/logout.d.ts +15 -0
- package/dist/commands/logout.d.ts.map +1 -0
- package/dist/commands/logout.js +36 -0
- package/dist/commands/logout.js.map +1 -0
- package/dist/commands/orgs.d.ts +14 -0
- package/dist/commands/orgs.d.ts.map +1 -0
- package/dist/commands/orgs.js +39 -0
- package/dist/commands/orgs.js.map +1 -0
- package/dist/commands/projects.d.ts +21 -0
- package/dist/commands/projects.d.ts.map +1 -0
- package/dist/commands/projects.js +86 -0
- package/dist/commands/projects.js.map +1 -0
- package/dist/commands/repair.d.ts +12 -0
- package/dist/commands/repair.d.ts.map +1 -0
- package/dist/commands/repair.js +45 -0
- package/dist/commands/repair.js.map +1 -0
- package/dist/commands/restore.d.ts +32 -0
- package/dist/commands/restore.d.ts.map +1 -0
- package/dist/commands/restore.js +120 -0
- package/dist/commands/restore.js.map +1 -0
- package/dist/commands/uninstall.d.ts +13 -0
- package/dist/commands/uninstall.d.ts.map +1 -0
- package/dist/commands/uninstall.js +53 -0
- package/dist/commands/uninstall.js.map +1 -0
- package/dist/commands/whoami.d.ts +13 -0
- package/dist/commands/whoami.d.ts.map +1 -0
- package/dist/commands/whoami.js +54 -0
- package/dist/commands/whoami.js.map +1 -0
- package/dist/compat/engine.d.ts +31 -0
- package/dist/compat/engine.d.ts.map +1 -0
- package/dist/compat/engine.js +82 -0
- package/dist/compat/engine.js.map +1 -0
- package/dist/config/define.d.ts +21 -0
- package/dist/config/define.d.ts.map +1 -0
- package/dist/config/define.js +22 -0
- package/dist/config/define.js.map +1 -0
- package/dist/config/index.d.ts +6 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +6 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/loader.d.ts +26 -0
- package/dist/config/loader.d.ts.map +1 -0
- package/dist/config/loader.js +84 -0
- package/dist/config/loader.js.map +1 -0
- package/dist/config/migrations.d.ts +64 -0
- package/dist/config/migrations.d.ts.map +1 -0
- package/dist/config/migrations.js +66 -0
- package/dist/config/migrations.js.map +1 -0
- package/dist/config/precedence.d.ts +24 -0
- package/dist/config/precedence.d.ts.map +1 -0
- package/dist/config/precedence.js +55 -0
- package/dist/config/precedence.js.map +1 -0
- package/dist/config/schema.d.ts +10 -0
- package/dist/config/schema.d.ts.map +1 -0
- package/dist/config/schema.js +140 -0
- package/dist/config/schema.js.map +1 -0
- package/dist/config/types.d.ts +80 -0
- package/dist/config/types.d.ts.map +1 -0
- package/dist/config/types.js +23 -0
- package/dist/config/types.js.map +1 -0
- package/dist/credentials/encrypted-file.d.ts +3 -0
- package/dist/credentials/encrypted-file.d.ts.map +1 -0
- package/dist/credentials/encrypted-file.js +139 -0
- package/dist/credentials/encrypted-file.js.map +1 -0
- package/dist/credentials/error.d.ts +11 -0
- package/dist/credentials/error.d.ts.map +1 -0
- package/dist/credentials/error.js +14 -0
- package/dist/credentials/error.js.map +1 -0
- package/dist/credentials/index.d.ts +20 -0
- package/dist/credentials/index.d.ts.map +1 -0
- package/dist/credentials/index.js +56 -0
- package/dist/credentials/index.js.map +1 -0
- package/dist/credentials/keychain-darwin.d.ts +11 -0
- package/dist/credentials/keychain-darwin.d.ts.map +1 -0
- package/dist/credentials/keychain-darwin.js +88 -0
- package/dist/credentials/keychain-darwin.js.map +1 -0
- package/dist/credentials/keychain-linux.d.ts +13 -0
- package/dist/credentials/keychain-linux.d.ts.map +1 -0
- package/dist/credentials/keychain-linux.js +88 -0
- package/dist/credentials/keychain-linux.js.map +1 -0
- package/dist/credentials/keychain-win.d.ts +13 -0
- package/dist/credentials/keychain-win.d.ts.map +1 -0
- package/dist/credentials/keychain-win.js +31 -0
- package/dist/credentials/keychain-win.js.map +1 -0
- package/dist/credentials/types.d.ts +38 -0
- package/dist/credentials/types.d.ts.map +1 -0
- package/dist/credentials/types.js +5 -0
- package/dist/credentials/types.js.map +1 -0
- package/dist/detect/framework.d.ts +28 -0
- package/dist/detect/framework.d.ts.map +1 -0
- package/dist/detect/framework.js +131 -0
- package/dist/detect/framework.js.map +1 -0
- package/dist/detect/index.d.ts +4 -0
- package/dist/detect/index.d.ts.map +1 -0
- package/dist/detect/index.js +4 -0
- package/dist/detect/index.js.map +1 -0
- package/dist/detect/monorepo.d.ts +10 -0
- package/dist/detect/monorepo.d.ts.map +1 -0
- package/dist/detect/monorepo.js +42 -0
- package/dist/detect/monorepo.js.map +1 -0
- package/dist/detect/package-manager.d.ts +18 -0
- package/dist/detect/package-manager.d.ts.map +1 -0
- package/dist/detect/package-manager.js +60 -0
- package/dist/detect/package-manager.js.map +1 -0
- package/dist/index.d.ts +36 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +38 -0
- package/dist/index.js.map +1 -0
- package/dist/integrations/_scaffold.d.ts +23 -0
- package/dist/integrations/_scaffold.d.ts.map +1 -0
- package/dist/integrations/_scaffold.js +62 -0
- package/dist/integrations/_scaffold.js.map +1 -0
- package/dist/integrations/_shared.d.ts +18 -0
- package/dist/integrations/_shared.d.ts.map +1 -0
- package/dist/integrations/_shared.js +73 -0
- package/dist/integrations/_shared.js.map +1 -0
- package/dist/integrations/_simple-scaffold.d.ts +19 -0
- package/dist/integrations/_simple-scaffold.d.ts.map +1 -0
- package/dist/integrations/_simple-scaffold.js +23 -0
- package/dist/integrations/_simple-scaffold.js.map +1 -0
- package/dist/integrations/dotnet.d.ts +2 -0
- package/dist/integrations/dotnet.d.ts.map +1 -0
- package/dist/integrations/dotnet.js +9 -0
- package/dist/integrations/dotnet.js.map +1 -0
- package/dist/integrations/expo.d.ts +2 -0
- package/dist/integrations/expo.d.ts.map +1 -0
- package/dist/integrations/expo.js +12 -0
- package/dist/integrations/expo.js.map +1 -0
- package/dist/integrations/fastify.d.ts +2 -0
- package/dist/integrations/fastify.d.ts.map +1 -0
- package/dist/integrations/fastify.js +10 -0
- package/dist/integrations/fastify.js.map +1 -0
- package/dist/integrations/flutter.d.ts +2 -0
- package/dist/integrations/flutter.d.ts.map +1 -0
- package/dist/integrations/flutter.js +9 -0
- package/dist/integrations/flutter.js.map +1 -0
- package/dist/integrations/go.d.ts +2 -0
- package/dist/integrations/go.d.ts.map +1 -0
- package/dist/integrations/go.js +9 -0
- package/dist/integrations/go.js.map +1 -0
- package/dist/integrations/java.d.ts +2 -0
- package/dist/integrations/java.d.ts.map +1 -0
- package/dist/integrations/java.js +9 -0
- package/dist/integrations/java.js.map +1 -0
- package/dist/integrations/js/detect.d.ts +3 -0
- package/dist/integrations/js/detect.d.ts.map +1 -0
- package/dist/integrations/js/detect.js +7 -0
- package/dist/integrations/js/detect.js.map +1 -0
- package/dist/integrations/js/doctor.d.ts +3 -0
- package/dist/integrations/js/doctor.d.ts.map +1 -0
- package/dist/integrations/js/doctor.js +38 -0
- package/dist/integrations/js/doctor.js.map +1 -0
- package/dist/integrations/js/files.d.ts +3 -0
- package/dist/integrations/js/files.d.ts.map +1 -0
- package/dist/integrations/js/files.js +19 -0
- package/dist/integrations/js/files.js.map +1 -0
- package/dist/integrations/js/index.d.ts +3 -0
- package/dist/integrations/js/index.d.ts.map +1 -0
- package/dist/integrations/js/index.js +25 -0
- package/dist/integrations/js/index.js.map +1 -0
- package/dist/integrations/js/manifest.d.ts +3 -0
- package/dist/integrations/js/manifest.d.ts.map +1 -0
- package/dist/integrations/js/manifest.js +19 -0
- package/dist/integrations/js/manifest.js.map +1 -0
- package/dist/integrations/js/patch.d.ts +4 -0
- package/dist/integrations/js/patch.d.ts.map +1 -0
- package/dist/integrations/js/patch.js +24 -0
- package/dist/integrations/js/patch.js.map +1 -0
- package/dist/integrations/js/uninstall.d.ts +4 -0
- package/dist/integrations/js/uninstall.d.ts.map +1 -0
- package/dist/integrations/js/uninstall.js +16 -0
- package/dist/integrations/js/uninstall.js.map +1 -0
- package/dist/integrations/nestjs.d.ts +2 -0
- package/dist/integrations/nestjs.d.ts.map +1 -0
- package/dist/integrations/nestjs.js +10 -0
- package/dist/integrations/nestjs.js.map +1 -0
- package/dist/integrations/next/detect.d.ts +3 -0
- package/dist/integrations/next/detect.d.ts.map +1 -0
- package/dist/integrations/next/detect.js +11 -0
- package/dist/integrations/next/detect.js.map +1 -0
- package/dist/integrations/next/doctor.d.ts +3 -0
- package/dist/integrations/next/doctor.d.ts.map +1 -0
- package/dist/integrations/next/doctor.js +46 -0
- package/dist/integrations/next/doctor.js.map +1 -0
- package/dist/integrations/next/files.d.ts +3 -0
- package/dist/integrations/next/files.d.ts.map +1 -0
- package/dist/integrations/next/files.js +19 -0
- package/dist/integrations/next/files.js.map +1 -0
- package/dist/integrations/next/index.d.ts +3 -0
- package/dist/integrations/next/index.d.ts.map +1 -0
- package/dist/integrations/next/index.js +44 -0
- package/dist/integrations/next/index.js.map +1 -0
- package/dist/integrations/next/manifest.d.ts +3 -0
- package/dist/integrations/next/manifest.d.ts.map +1 -0
- package/dist/integrations/next/manifest.js +29 -0
- package/dist/integrations/next/manifest.js.map +1 -0
- package/dist/integrations/next/patch.d.ts +4 -0
- package/dist/integrations/next/patch.d.ts.map +1 -0
- package/dist/integrations/next/patch.js +49 -0
- package/dist/integrations/next/patch.js.map +1 -0
- package/dist/integrations/next/uninstall.d.ts +4 -0
- package/dist/integrations/next/uninstall.d.ts.map +1 -0
- package/dist/integrations/next/uninstall.js +22 -0
- package/dist/integrations/next/uninstall.js.map +1 -0
- package/dist/integrations/otel.d.ts +2 -0
- package/dist/integrations/otel.d.ts.map +1 -0
- package/dist/integrations/otel.js +10 -0
- package/dist/integrations/otel.js.map +1 -0
- package/dist/integrations/php.d.ts +2 -0
- package/dist/integrations/php.d.ts.map +1 -0
- package/dist/integrations/php.js +9 -0
- package/dist/integrations/php.js.map +1 -0
- package/dist/integrations/python.d.ts +2 -0
- package/dist/integrations/python.d.ts.map +1 -0
- package/dist/integrations/python.js +9 -0
- package/dist/integrations/python.js.map +1 -0
- package/dist/integrations/react/detect.d.ts +3 -0
- package/dist/integrations/react/detect.d.ts.map +1 -0
- package/dist/integrations/react/detect.js +11 -0
- package/dist/integrations/react/detect.js.map +1 -0
- package/dist/integrations/react/doctor.d.ts +3 -0
- package/dist/integrations/react/doctor.d.ts.map +1 -0
- package/dist/integrations/react/doctor.js +65 -0
- package/dist/integrations/react/doctor.js.map +1 -0
- package/dist/integrations/react/files.d.ts +4 -0
- package/dist/integrations/react/files.d.ts.map +1 -0
- package/dist/integrations/react/files.js +24 -0
- package/dist/integrations/react/files.js.map +1 -0
- package/dist/integrations/react/index.d.ts +17 -0
- package/dist/integrations/react/index.d.ts.map +1 -0
- package/dist/integrations/react/index.js +62 -0
- package/dist/integrations/react/index.js.map +1 -0
- package/dist/integrations/react/manifest.d.ts +3 -0
- package/dist/integrations/react/manifest.d.ts.map +1 -0
- package/dist/integrations/react/manifest.js +31 -0
- package/dist/integrations/react/manifest.js.map +1 -0
- package/dist/integrations/react/patch.d.ts +4 -0
- package/dist/integrations/react/patch.d.ts.map +1 -0
- package/dist/integrations/react/patch.js +39 -0
- package/dist/integrations/react/patch.js.map +1 -0
- package/dist/integrations/react/uninstall.d.ts +4 -0
- package/dist/integrations/react/uninstall.d.ts.map +1 -0
- package/dist/integrations/react/uninstall.js +21 -0
- package/dist/integrations/react/uninstall.js.map +1 -0
- package/dist/integrations/react-native.d.ts +10 -0
- package/dist/integrations/react-native.d.ts.map +1 -0
- package/dist/integrations/react-native.js +57 -0
- package/dist/integrations/react-native.js.map +1 -0
- package/dist/integrations/ruby.d.ts +2 -0
- package/dist/integrations/ruby.d.ts.map +1 -0
- package/dist/integrations/ruby.js +9 -0
- package/dist/integrations/ruby.js.map +1 -0
- package/dist/lifecycle/hooks.d.ts +42 -0
- package/dist/lifecycle/hooks.d.ts.map +1 -0
- package/dist/lifecycle/hooks.js +43 -0
- package/dist/lifecycle/hooks.js.map +1 -0
- package/dist/migrations/builtin/dsn-to-api-key.d.ts +3 -0
- package/dist/migrations/builtin/dsn-to-api-key.d.ts.map +1 -0
- package/dist/migrations/builtin/dsn-to-api-key.js +59 -0
- package/dist/migrations/builtin/dsn-to-api-key.js.map +1 -0
- package/dist/migrations/engine.d.ts +52 -0
- package/dist/migrations/engine.d.ts.map +1 -0
- package/dist/migrations/engine.js +46 -0
- package/dist/migrations/engine.js.map +1 -0
- package/dist/migrations/index.d.ts +3 -0
- package/dist/migrations/index.d.ts.map +1 -0
- package/dist/migrations/index.js +11 -0
- package/dist/migrations/index.js.map +1 -0
- package/dist/output/human.d.ts +20 -0
- package/dist/output/human.d.ts.map +1 -0
- package/dist/output/human.js +77 -0
- package/dist/output/human.js.map +1 -0
- package/dist/output/index.d.ts +6 -0
- package/dist/output/index.d.ts.map +1 -0
- package/dist/output/index.js +8 -0
- package/dist/output/index.js.map +1 -0
- package/dist/output/json.d.ts +20 -0
- package/dist/output/json.d.ts.map +1 -0
- package/dist/output/json.js +60 -0
- package/dist/output/json.js.map +1 -0
- package/dist/output/types.d.ts +36 -0
- package/dist/output/types.d.ts.map +1 -0
- package/dist/output/types.js +2 -0
- package/dist/output/types.js.map +1 -0
- package/dist/patchers/env-file.d.ts +21 -0
- package/dist/patchers/env-file.d.ts.map +1 -0
- package/dist/patchers/env-file.js +77 -0
- package/dist/patchers/env-file.js.map +1 -0
- package/dist/patchers/js-ast.d.ts +29 -0
- package/dist/patchers/js-ast.d.ts.map +1 -0
- package/dist/patchers/js-ast.js +71 -0
- package/dist/patchers/js-ast.js.map +1 -0
- package/dist/patchers/json-file.d.ts +19 -0
- package/dist/patchers/json-file.d.ts.map +1 -0
- package/dist/patchers/json-file.js +41 -0
- package/dist/patchers/json-file.js.map +1 -0
- package/dist/patchers/markers.d.ts +28 -0
- package/dist/patchers/markers.d.ts.map +1 -0
- package/dist/patchers/markers.js +49 -0
- package/dist/patchers/markers.js.map +1 -0
- package/dist/patchers/source-block.d.ts +24 -0
- package/dist/patchers/source-block.d.ts.map +1 -0
- package/dist/patchers/source-block.js +40 -0
- package/dist/patchers/source-block.js.map +1 -0
- package/dist/registry/index.d.ts +5 -0
- package/dist/registry/index.d.ts.map +1 -0
- package/dist/registry/index.js +42 -0
- package/dist/registry/index.js.map +1 -0
- package/dist/registry/manifest.d.ts +78 -0
- package/dist/registry/manifest.d.ts.map +1 -0
- package/dist/registry/manifest.js +2 -0
- package/dist/registry/manifest.js.map +1 -0
- package/dist/registry/registry.d.ts +14 -0
- package/dist/registry/registry.d.ts.map +1 -0
- package/dist/registry/registry.js +29 -0
- package/dist/registry/registry.js.map +1 -0
- package/dist/registry/types.d.ts +78 -0
- package/dist/registry/types.d.ts.map +1 -0
- package/dist/registry/types.js +2 -0
- package/dist/registry/types.js.map +1 -0
- package/dist/snapshot/restore.d.ts +41 -0
- package/dist/snapshot/restore.d.ts.map +1 -0
- package/dist/snapshot/restore.js +110 -0
- package/dist/snapshot/restore.js.map +1 -0
- package/dist/snapshot/store.d.ts +105 -0
- package/dist/snapshot/store.d.ts.map +1 -0
- package/dist/snapshot/store.js +162 -0
- package/dist/snapshot/store.js.map +1 -0
- package/dist/sourcemaps/index.d.ts +3 -0
- package/dist/sourcemaps/index.d.ts.map +1 -0
- package/dist/sourcemaps/index.js +17 -0
- package/dist/sourcemaps/index.js.map +1 -0
- package/dist/sourcemaps/metro.d.ts +11 -0
- package/dist/sourcemaps/metro.d.ts.map +1 -0
- package/dist/sourcemaps/metro.js +31 -0
- package/dist/sourcemaps/metro.js.map +1 -0
- package/dist/sourcemaps/next.d.ts +3 -0
- package/dist/sourcemaps/next.d.ts.map +1 -0
- package/dist/sourcemaps/next.js +46 -0
- package/dist/sourcemaps/next.js.map +1 -0
- package/dist/sourcemaps/provider.d.ts +51 -0
- package/dist/sourcemaps/provider.d.ts.map +1 -0
- package/dist/sourcemaps/provider.js +29 -0
- package/dist/sourcemaps/provider.js.map +1 -0
- package/dist/sourcemaps/vite.d.ts +3 -0
- package/dist/sourcemaps/vite.d.ts.map +1 -0
- package/dist/sourcemaps/vite.js +60 -0
- package/dist/sourcemaps/vite.js.map +1 -0
- package/dist/sourcemaps/webpack.d.ts +8 -0
- package/dist/sourcemaps/webpack.d.ts.map +1 -0
- package/dist/sourcemaps/webpack.js +52 -0
- package/dist/sourcemaps/webpack.js.map +1 -0
- package/dist/telemetry/cli-wrap.d.ts +22 -0
- package/dist/telemetry/cli-wrap.d.ts.map +1 -0
- package/dist/telemetry/cli-wrap.js +53 -0
- package/dist/telemetry/cli-wrap.js.map +1 -0
- package/dist/telemetry/http-provider.d.ts +28 -0
- package/dist/telemetry/http-provider.d.ts.map +1 -0
- package/dist/telemetry/http-provider.js +24 -0
- package/dist/telemetry/http-provider.js.map +1 -0
- package/dist/telemetry/index.d.ts +7 -0
- package/dist/telemetry/index.d.ts.map +1 -0
- package/dist/telemetry/index.js +6 -0
- package/dist/telemetry/index.js.map +1 -0
- package/dist/telemetry/install-id.d.ts +3 -0
- package/dist/telemetry/install-id.d.ts.map +1 -0
- package/dist/telemetry/install-id.js +46 -0
- package/dist/telemetry/install-id.js.map +1 -0
- package/dist/telemetry/payload.d.ts +82 -0
- package/dist/telemetry/payload.d.ts.map +1 -0
- package/dist/telemetry/payload.js +82 -0
- package/dist/telemetry/payload.js.map +1 -0
- package/dist/telemetry/provider.d.ts +32 -0
- package/dist/telemetry/provider.d.ts.map +1 -0
- package/dist/telemetry/provider.js +30 -0
- package/dist/telemetry/provider.js.map +1 -0
- package/dist/telemetry/runtime.d.ts +29 -0
- package/dist/telemetry/runtime.d.ts.map +1 -0
- package/dist/telemetry/runtime.js +44 -0
- package/dist/telemetry/runtime.js.map +1 -0
- package/dist/transaction/tx.d.ts +58 -0
- package/dist/transaction/tx.d.ts.map +1 -0
- package/dist/transaction/tx.js +170 -0
- package/dist/transaction/tx.js.map +1 -0
- package/dist/util/error-codes.d.ts +29 -0
- package/dist/util/error-codes.d.ts.map +1 -0
- package/dist/util/error-codes.js +192 -0
- package/dist/util/error-codes.js.map +1 -0
- package/dist/util/errors.d.ts +83 -0
- package/dist/util/errors.d.ts.map +1 -0
- package/dist/util/errors.js +110 -0
- package/dist/util/errors.js.map +1 -0
- package/dist/util/log.d.ts +11 -0
- package/dist/util/log.d.ts.map +1 -0
- package/dist/util/log.js +18 -0
- package/dist/util/log.js.map +1 -0
- package/dist/util/paths.d.ts +3 -0
- package/dist/util/paths.d.ts.map +1 -0
- package/dist/util/paths.js +31 -0
- package/dist/util/paths.js.map +1 -0
- package/dist/util/version.d.ts +15 -0
- package/dist/util/version.d.ts.map +1 -0
- package/dist/util/version.js +40 -0
- package/dist/util/version.js.map +1 -0
- package/dist/util/wizard-version.d.ts +6 -0
- package/dist/util/wizard-version.d.ts.map +1 -0
- package/dist/util/wizard-version.js +6 -0
- package/dist/util/wizard-version.js.map +1 -0
- package/docs/architecture/README.md +58 -0
- package/docs/architecture/dry-run.md +34 -0
- package/docs/architecture/integration-lifecycle.md +77 -0
- package/docs/architecture/patch-pipeline.md +58 -0
- package/docs/architecture/registry.md +52 -0
- package/docs/architecture/rollback.md +47 -0
- package/docs/architecture/sourcemaps.md +53 -0
- package/docs/architecture/stability-levels.md +35 -0
- package/docs/architecture/transaction.md +51 -0
- package/docs/architecture/v02-bare-react-native-spec.md +92 -0
- package/docs/architecture/v02-java-host-fix-spec.md +125 -0
- package/docs/architecture/v02-sourcemaps-e2e-spec.md +157 -0
- package/package.json +98 -0
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { createCipheriv, createDecipheriv, randomBytes, scryptSync, } from 'node:crypto';
|
|
2
|
+
import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync, chmodSync } from 'node:fs';
|
|
3
|
+
import { homedir, hostname, platform, userInfo } from 'node:os';
|
|
4
|
+
import { dirname, resolve } from 'node:path';
|
|
5
|
+
import { CredentialError } from './types.js';
|
|
6
|
+
/**
|
|
7
|
+
* Encrypted-file fallback. AES-256-GCM with a key derived from a stable
|
|
8
|
+
* machine identity (username + hostname + platform). This is NOT as strong as a
|
|
9
|
+
* real OS keychain — anyone with read access to the file AND knowledge of the
|
|
10
|
+
* derivation inputs can decrypt — but it does prevent casual file reads from
|
|
11
|
+
* exposing plaintext tokens.
|
|
12
|
+
*
|
|
13
|
+
* Used on:
|
|
14
|
+
* - Windows (until native Cred Manager support lands in v0.2)
|
|
15
|
+
* - Linux without `secret-tool` / running secret-service
|
|
16
|
+
* - any environment where the OS keychain is broken (e.g. containers)
|
|
17
|
+
*
|
|
18
|
+
* On disk: ~/.config/allstak/credentials.enc — file mode 0600.
|
|
19
|
+
*
|
|
20
|
+
* Format:
|
|
21
|
+
* {
|
|
22
|
+
* v: 1,
|
|
23
|
+
* algo: "aes-256-gcm",
|
|
24
|
+
* entries: { "<host>": { iv, salt, authTag, ciphertext } }
|
|
25
|
+
* }
|
|
26
|
+
*/
|
|
27
|
+
const FILE_NAME = 'credentials.enc';
|
|
28
|
+
const ALGO = 'aes-256-gcm';
|
|
29
|
+
const KEY_LEN = 32; // 256-bit
|
|
30
|
+
const SALT_LEN = 16;
|
|
31
|
+
const IV_LEN = 12;
|
|
32
|
+
function configDir() {
|
|
33
|
+
// Follow XDG on Linux; on macOS/Windows we still keep it here for simplicity.
|
|
34
|
+
// The encrypted file is the same shape on every platform.
|
|
35
|
+
const xdg = process.env.XDG_CONFIG_HOME;
|
|
36
|
+
const base = xdg && xdg.length > 0 ? xdg : resolve(homedir(), '.config');
|
|
37
|
+
return resolve(base, 'allstak');
|
|
38
|
+
}
|
|
39
|
+
function filePath() {
|
|
40
|
+
return resolve(configDir(), FILE_NAME);
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Derive a 256-bit key from machine identity. NOT a substitute for a hardware
|
|
44
|
+
* key — but stable across runs without prompting the user for a passphrase.
|
|
45
|
+
*/
|
|
46
|
+
function deriveKey(salt) {
|
|
47
|
+
const ident = `${userInfo().username}@${hostname()}|${platform()}`;
|
|
48
|
+
return scryptSync(ident, salt, KEY_LEN);
|
|
49
|
+
}
|
|
50
|
+
function readFile() {
|
|
51
|
+
const path = filePath();
|
|
52
|
+
if (!existsSync(path))
|
|
53
|
+
return { v: 1, algo: ALGO, entries: {} };
|
|
54
|
+
try {
|
|
55
|
+
const parsed = JSON.parse(readFileSync(path, 'utf8'));
|
|
56
|
+
if (parsed.v !== 1 || parsed.algo !== ALGO) {
|
|
57
|
+
throw new CredentialError('E_INCOMPATIBLE', `Credential file at ${path} uses an unknown schema (v=${parsed.v}, algo=${parsed.algo}).`);
|
|
58
|
+
}
|
|
59
|
+
return parsed;
|
|
60
|
+
}
|
|
61
|
+
catch (err) {
|
|
62
|
+
if (err instanceof CredentialError)
|
|
63
|
+
throw err;
|
|
64
|
+
throw new CredentialError('E_CORRUPT', `Credential file at ${path} is corrupt — delete it and re-run \`allstak login\`.`);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
function writeFile(file) {
|
|
68
|
+
const path = filePath();
|
|
69
|
+
mkdirSync(dirname(path), { recursive: true });
|
|
70
|
+
writeFileSync(path, JSON.stringify(file, null, 2) + '\n', 'utf8');
|
|
71
|
+
// Restrict to owner read/write only.
|
|
72
|
+
try {
|
|
73
|
+
chmodSync(path, 0o600);
|
|
74
|
+
}
|
|
75
|
+
catch {
|
|
76
|
+
// chmod can fail on some Windows NTFS configurations — the file is still
|
|
77
|
+
// protected by the encryption layer; we just warn rather than abort.
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
export const encryptedFileStore = {
|
|
81
|
+
id: 'encrypted-file',
|
|
82
|
+
label: `Encrypted file (${filePath()})`,
|
|
83
|
+
serviceName: 'allstak-wizard',
|
|
84
|
+
async load(host) {
|
|
85
|
+
const file = readFile();
|
|
86
|
+
const entry = file.entries[host];
|
|
87
|
+
if (!entry)
|
|
88
|
+
return null;
|
|
89
|
+
try {
|
|
90
|
+
const salt = Buffer.from(entry.salt, 'hex');
|
|
91
|
+
const iv = Buffer.from(entry.iv, 'hex');
|
|
92
|
+
const authTag = Buffer.from(entry.authTag, 'hex');
|
|
93
|
+
const ciphertext = Buffer.from(entry.ciphertext, 'hex');
|
|
94
|
+
const key = deriveKey(salt);
|
|
95
|
+
const decipher = createDecipheriv(ALGO, key, iv);
|
|
96
|
+
decipher.setAuthTag(authTag);
|
|
97
|
+
const plain = Buffer.concat([decipher.update(ciphertext), decipher.final()]);
|
|
98
|
+
return JSON.parse(plain.toString('utf8'));
|
|
99
|
+
}
|
|
100
|
+
catch (err) {
|
|
101
|
+
throw new CredentialError('E_DECRYPT', `Could not decrypt credentials for ${host} (${err instanceof Error ? err.message : String(err)}). The machine identity may have changed; re-run \`allstak login\`.`);
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
async save(creds) {
|
|
105
|
+
const salt = randomBytes(SALT_LEN);
|
|
106
|
+
const iv = randomBytes(IV_LEN);
|
|
107
|
+
const key = deriveKey(salt);
|
|
108
|
+
const cipher = createCipheriv(ALGO, key, iv);
|
|
109
|
+
const ciphertext = Buffer.concat([
|
|
110
|
+
cipher.update(JSON.stringify(creds), 'utf8'),
|
|
111
|
+
cipher.final(),
|
|
112
|
+
]);
|
|
113
|
+
const entry = {
|
|
114
|
+
iv: iv.toString('hex'),
|
|
115
|
+
salt: salt.toString('hex'),
|
|
116
|
+
authTag: cipher.getAuthTag().toString('hex'),
|
|
117
|
+
ciphertext: ciphertext.toString('hex'),
|
|
118
|
+
};
|
|
119
|
+
const file = readFile();
|
|
120
|
+
file.entries[creds.host] = entry;
|
|
121
|
+
writeFile(file);
|
|
122
|
+
},
|
|
123
|
+
async clear(host) {
|
|
124
|
+
const file = readFile();
|
|
125
|
+
if (!(host in file.entries))
|
|
126
|
+
return;
|
|
127
|
+
delete file.entries[host];
|
|
128
|
+
if (Object.keys(file.entries).length === 0) {
|
|
129
|
+
try {
|
|
130
|
+
rmSync(filePath());
|
|
131
|
+
}
|
|
132
|
+
catch { /* noop */ }
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
writeFile(file);
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
};
|
|
139
|
+
//# sourceMappingURL=encrypted-file.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"encrypted-file.js","sourceRoot":"","sources":["../../src/credentials/encrypted-file.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,WAAW,EACX,UAAU,GACX,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAChG,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAE7C,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,MAAM,SAAS,GAAG,iBAAiB,CAAC;AACpC,MAAM,IAAI,GAAG,aAAa,CAAC;AAC3B,MAAM,OAAO,GAAG,EAAE,CAAC,CAAC,UAAU;AAC9B,MAAM,QAAQ,GAAG,EAAE,CAAC;AACpB,MAAM,MAAM,GAAG,EAAE,CAAC;AAelB,SAAS,SAAS;IAChB,8EAA8E;IAC9E,0DAA0D;IAC1D,MAAM,GAAG,GAAG,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K,CAAC;YACtB,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;YAC1B,OAAO,EAAE,MAAM,CAAC,UAAU,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC;YAC5C,UAAU,EAAE,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC;SACvC,CAAC;QACF,MAAM,IAAI,GAAG,QAAQ,EAAE,CAAC;QACxB,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC;QACjC,SAAS,CAAC,IAAI,CAAC,CAAC;IAClB,CAAC;IAED,KAAK,CAAC,KAAK,CAAC,IAAY;QACtB,MAAM,IAAI,GAAG,QAAQ,EAAE,CAAC;QACxB,IAAI,CAAC,CAAC,IAAI,IAAI,IAAI,CAAC,OAAO,CAAC;YAAE,OAAO;QACpC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAC1B,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC3C,IAAI,CAAC;gBAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;YAAC,CAAC;YAAC,MAAM,CAAC,CAAC,UAAU,CAAC,CAAC;QAClD,CAAC;aAAM,CAAC;YACN,SAAS,CAAC,IAAI,CAAC,CAAC;QAClB,CAAC;IACH,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { WizardError } from '../util/errors.js';
|
|
2
|
+
/**
|
|
3
|
+
* Internal credential-layer error. Always categorised as `E_PERMISSION_DENIED`
|
|
4
|
+
* at the canonical level (the OS keychain refused or returned a corrupt
|
|
5
|
+
* payload); the original `subcode` is preserved for grep-ability in debug
|
|
6
|
+
* logs and migration scenarios (e.g. `E_KEYCHAIN_NOT_FOUND` vs `E_DECRYPT`).
|
|
7
|
+
*/
|
|
8
|
+
export declare class CredentialError extends WizardError {
|
|
9
|
+
constructor(subcode: string, message: string);
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=error.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../src/credentials/error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD;;;;;GAKG;AACH,qBAAa,eAAgB,SAAQ,WAAW;gBAClC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;CAI7C"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { WizardError } from '../util/errors.js';
|
|
2
|
+
/**
|
|
3
|
+
* Internal credential-layer error. Always categorised as `E_PERMISSION_DENIED`
|
|
4
|
+
* at the canonical level (the OS keychain refused or returned a corrupt
|
|
5
|
+
* payload); the original `subcode` is preserved for grep-ability in debug
|
|
6
|
+
* logs and migration scenarios (e.g. `E_KEYCHAIN_NOT_FOUND` vs `E_DECRYPT`).
|
|
7
|
+
*/
|
|
8
|
+
export class CredentialError extends WizardError {
|
|
9
|
+
constructor(subcode, message) {
|
|
10
|
+
super('E_PERMISSION_DENIED', message, { subcode, stage: 'cli' });
|
|
11
|
+
this.name = 'CredentialError';
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error.js","sourceRoot":"","sources":["../../src/credentials/error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD;;;;;GAKG;AACH,MAAM,OAAO,eAAgB,SAAQ,WAAW;IAC9C,YAAY,OAAe,EAAE,OAAe;QAC1C,KAAK,CAAC,qBAAqB,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;QACjE,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;IAChC,CAAC;CACF"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { CredentialStore } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Pick the best available credential store for the current platform.
|
|
4
|
+
*
|
|
5
|
+
* Order:
|
|
6
|
+
* - macOS → macOS Keychain via `security` (always available on a real Mac)
|
|
7
|
+
* - Linux → Secret Service via `secret-tool` if running, else encrypted-file
|
|
8
|
+
* - Win → Encrypted-file fallback (Cred Manager support is v0.2)
|
|
9
|
+
* - other → Encrypted-file fallback
|
|
10
|
+
*
|
|
11
|
+
* The choice is made once per process and cached so subsequent reads/writes hit
|
|
12
|
+
* the same backend. Override via `ALLSTAK_CREDENTIAL_STORE=encrypted-file` for
|
|
13
|
+
* tests or troubleshooting.
|
|
14
|
+
*/
|
|
15
|
+
export declare function getCredentialStore(): Promise<CredentialStore>;
|
|
16
|
+
/** Test helper — drop the cached store so the next call re-detects. */
|
|
17
|
+
export declare function resetCredentialStore(): void;
|
|
18
|
+
export type { CredentialStore, Credentials } from './types.js';
|
|
19
|
+
export { CredentialError } from './types.js';
|
|
20
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/credentials/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAQlD;;;;;;;;;;;;GAYG;AACH,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,eAAe,CAAC,CA+BnE;AAED,uEAAuE;AACvE,wBAAgB,oBAAoB,IAAI,IAAI,CAE3C;AAED,YAAY,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { platform } from 'node:os';
|
|
2
|
+
import { darwinKeychain } from './keychain-darwin.js';
|
|
3
|
+
import { linuxKeychain, isLinuxKeychainAvailable } from './keychain-linux.js';
|
|
4
|
+
import { isWindowsKeychainAvailable, windowsKeychain } from './keychain-win.js';
|
|
5
|
+
import { encryptedFileStore } from './encrypted-file.js';
|
|
6
|
+
let resolved = null;
|
|
7
|
+
/**
|
|
8
|
+
* Pick the best available credential store for the current platform.
|
|
9
|
+
*
|
|
10
|
+
* Order:
|
|
11
|
+
* - macOS → macOS Keychain via `security` (always available on a real Mac)
|
|
12
|
+
* - Linux → Secret Service via `secret-tool` if running, else encrypted-file
|
|
13
|
+
* - Win → Encrypted-file fallback (Cred Manager support is v0.2)
|
|
14
|
+
* - other → Encrypted-file fallback
|
|
15
|
+
*
|
|
16
|
+
* The choice is made once per process and cached so subsequent reads/writes hit
|
|
17
|
+
* the same backend. Override via `ALLSTAK_CREDENTIAL_STORE=encrypted-file` for
|
|
18
|
+
* tests or troubleshooting.
|
|
19
|
+
*/
|
|
20
|
+
export async function getCredentialStore() {
|
|
21
|
+
if (resolved)
|
|
22
|
+
return resolved;
|
|
23
|
+
const override = process.env.ALLSTAK_CREDENTIAL_STORE;
|
|
24
|
+
if (override === 'encrypted-file') {
|
|
25
|
+
resolved = encryptedFileStore;
|
|
26
|
+
return resolved;
|
|
27
|
+
}
|
|
28
|
+
if (override === 'darwin-keychain') {
|
|
29
|
+
resolved = darwinKeychain;
|
|
30
|
+
return resolved;
|
|
31
|
+
}
|
|
32
|
+
if (override === 'linux-secret-service') {
|
|
33
|
+
resolved = linuxKeychain;
|
|
34
|
+
return resolved;
|
|
35
|
+
}
|
|
36
|
+
switch (platform()) {
|
|
37
|
+
case 'darwin':
|
|
38
|
+
resolved = darwinKeychain;
|
|
39
|
+
return resolved;
|
|
40
|
+
case 'linux':
|
|
41
|
+
resolved = (await isLinuxKeychainAvailable()) ? linuxKeychain : encryptedFileStore;
|
|
42
|
+
return resolved;
|
|
43
|
+
case 'win32':
|
|
44
|
+
resolved = (await isWindowsKeychainAvailable()) ? windowsKeychain : encryptedFileStore;
|
|
45
|
+
return resolved;
|
|
46
|
+
default:
|
|
47
|
+
resolved = encryptedFileStore;
|
|
48
|
+
return resolved;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
/** Test helper — drop the cached store so the next call re-detects. */
|
|
52
|
+
export function resetCredentialStore() {
|
|
53
|
+
resolved = null;
|
|
54
|
+
}
|
|
55
|
+
export { CredentialError } from './types.js';
|
|
56
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/credentials/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEnC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EAAE,0BAA0B,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAChF,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD,IAAI,QAAQ,GAA2B,IAAI,CAAC;AAE5C;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB;IACtC,IAAI,QAAQ;QAAE,OAAO,QAAQ,CAAC;IAE9B,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC;IACtD,IAAI,QAAQ,KAAK,gBAAgB,EAAE,CAAC;QAClC,QAAQ,GAAG,kBAAkB,CAAC;QAC9B,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD,IAAI,QAAQ,KAAK,iBAAiB,EAAE,CAAC;QACnC,QAAQ,GAAG,cAAc,CAAC;QAC1B,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD,IAAI,QAAQ,KAAK,sBAAsB,EAAE,CAAC;QACxC,QAAQ,GAAG,aAAa,CAAC;QACzB,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,QAAQ,QAAQ,EAAE,EAAE,CAAC;QACnB,KAAK,QAAQ;YACX,QAAQ,GAAG,cAAc,CAAC;YAC1B,OAAO,QAAQ,CAAC;QAClB,KAAK,OAAO;YACV,QAAQ,GAAG,CAAC,MAAM,wBAAwB,EAAE,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,kBAAkB,CAAC;YACnF,OAAO,QAAQ,CAAC;QAClB,KAAK,OAAO;YACV,QAAQ,GAAG,CAAC,MAAM,0BAA0B,EAAE,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,kBAAkB,CAAC;YACvF,OAAO,QAAQ,CAAC;QAClB;YACE,QAAQ,GAAG,kBAAkB,CAAC;YAC9B,OAAO,QAAQ,CAAC;IACpB,CAAC;AACH,CAAC;AAED,uEAAuE;AACvE,MAAM,UAAU,oBAAoB;IAClC,QAAQ,GAAG,IAAI,CAAC;AAClB,CAAC;AAGD,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { CredentialStore } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* macOS Keychain via `security` CLI. We avoid native modules (keytar/node-gyp)
|
|
4
|
+
* to keep the wizard's dep tree small and source-installable from any registry.
|
|
5
|
+
*
|
|
6
|
+
* Storage layout: one keychain entry per host. Service is `allstak-wizard`,
|
|
7
|
+
* account is the host (`https://api.allstak.sa`). Generic password (not internet
|
|
8
|
+
* password) so the entry is portable across Keychain.app views.
|
|
9
|
+
*/
|
|
10
|
+
export declare const darwinKeychain: CredentialStore;
|
|
11
|
+
//# sourceMappingURL=keychain-darwin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keychain-darwin.d.ts","sourceRoot":"","sources":["../../src/credentials/keychain-darwin.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAe,MAAM,YAAY,CAAC;AAK/D;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,EAAE,eAgD5B,CAAC"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { spawn } from 'node:child_process';
|
|
2
|
+
import { CredentialError } from './types.js';
|
|
3
|
+
const SERVICE = 'allstak-wizard';
|
|
4
|
+
/**
|
|
5
|
+
* macOS Keychain via `security` CLI. We avoid native modules (keytar/node-gyp)
|
|
6
|
+
* to keep the wizard's dep tree small and source-installable from any registry.
|
|
7
|
+
*
|
|
8
|
+
* Storage layout: one keychain entry per host. Service is `allstak-wizard`,
|
|
9
|
+
* account is the host (`https://api.allstak.sa`). Generic password (not internet
|
|
10
|
+
* password) so the entry is portable across Keychain.app views.
|
|
11
|
+
*/
|
|
12
|
+
export const darwinKeychain = {
|
|
13
|
+
id: 'darwin-keychain',
|
|
14
|
+
label: 'macOS Keychain',
|
|
15
|
+
serviceName: SERVICE,
|
|
16
|
+
async load(host) {
|
|
17
|
+
try {
|
|
18
|
+
const raw = await runSecurity([
|
|
19
|
+
'find-generic-password',
|
|
20
|
+
'-s', SERVICE,
|
|
21
|
+
'-a', host,
|
|
22
|
+
'-w',
|
|
23
|
+
]);
|
|
24
|
+
if (!raw)
|
|
25
|
+
return null;
|
|
26
|
+
return JSON.parse(raw);
|
|
27
|
+
}
|
|
28
|
+
catch (err) {
|
|
29
|
+
if (isNotFound(err))
|
|
30
|
+
return null;
|
|
31
|
+
throw err;
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
async save(creds) {
|
|
35
|
+
// Delete existing entry first — `security add-generic-password -U` exists
|
|
36
|
+
// but only on newer macOS; the delete-then-add pattern is portable.
|
|
37
|
+
try {
|
|
38
|
+
await runSecurity(['delete-generic-password', '-s', SERVICE, '-a', creds.host]);
|
|
39
|
+
}
|
|
40
|
+
catch (err) {
|
|
41
|
+
if (!isNotFound(err))
|
|
42
|
+
throw err;
|
|
43
|
+
}
|
|
44
|
+
await runSecurity([
|
|
45
|
+
'add-generic-password',
|
|
46
|
+
'-s', SERVICE,
|
|
47
|
+
'-a', creds.host,
|
|
48
|
+
'-w', JSON.stringify(creds),
|
|
49
|
+
'-U', // update if exists (no-op after the delete above)
|
|
50
|
+
'-T', '', // no app whitelist — caller (this CLI) reads via password
|
|
51
|
+
'-D', 'allstak-wizard credentials',
|
|
52
|
+
]);
|
|
53
|
+
},
|
|
54
|
+
async clear(host) {
|
|
55
|
+
try {
|
|
56
|
+
await runSecurity(['delete-generic-password', '-s', SERVICE, '-a', host]);
|
|
57
|
+
}
|
|
58
|
+
catch (err) {
|
|
59
|
+
if (isNotFound(err))
|
|
60
|
+
return;
|
|
61
|
+
throw err;
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
function runSecurity(args) {
|
|
66
|
+
return new Promise((resolveP, reject) => {
|
|
67
|
+
const child = spawn('security', args);
|
|
68
|
+
let stdout = '';
|
|
69
|
+
let stderr = '';
|
|
70
|
+
child.stdout.on('data', (chunk) => { stdout += chunk.toString('utf8'); });
|
|
71
|
+
child.stderr.on('data', (chunk) => { stderr += chunk.toString('utf8'); });
|
|
72
|
+
child.on('error', (err) => reject(err));
|
|
73
|
+
child.on('exit', (code) => {
|
|
74
|
+
if (code === 0) {
|
|
75
|
+
resolveP(stdout.replace(/\n$/, ''));
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
reject(new CredentialError('E_KEYCHAIN', stderr.trim() || `security exited with code ${code}`));
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
function isNotFound(err) {
|
|
84
|
+
if (!(err instanceof CredentialError))
|
|
85
|
+
return false;
|
|
86
|
+
return /could not be found/i.test(err.message) || /SecKeychainSearchCopyNext/i.test(err.message);
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=keychain-darwin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keychain-darwin.js","sourceRoot":"","sources":["../../src/credentials/keychain-darwin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EA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iBAAM,CAAC;gBACN,MAAM,CAAC,IAAI,eAAe,CACxB,YAAY,EACZ,MAAM,CAAC,IAAI,EAAE,IAAI,6BAA6B,IAAI,EAAE,CACrD,CAAC,CAAC;YACL,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,UAAU,CAAC,GAAY;IAC9B,IAAI,CAAC,CAAC,GAAG,YAAY,eAAe,CAAC;QAAE,OAAO,KAAK,CAAC;IACpD,OAAO,qBAAqB,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,4BAA4B,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACnG,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { CredentialStore } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Linux Secret Service via `secret-tool` (libsecret). Available on most modern
|
|
4
|
+
* GNOME/KDE-based distros. If `secret-tool` is missing or the user is in a
|
|
5
|
+
* headless session without a running secret-service daemon, the store gracefully
|
|
6
|
+
* fails its `available()` check and the encrypted-file fallback is used.
|
|
7
|
+
*
|
|
8
|
+
* Schema attributes are stable across versions so users can prune entries with
|
|
9
|
+
* `secret-tool clear schema=org.allstak.wizard`.
|
|
10
|
+
*/
|
|
11
|
+
export declare const linuxKeychain: CredentialStore;
|
|
12
|
+
export declare function isLinuxKeychainAvailable(): Promise<boolean>;
|
|
13
|
+
//# sourceMappingURL=keychain-linux.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keychain-linux.d.ts","sourceRoot":"","sources":["../../src/credentials/keychain-linux.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAe,MAAM,YAAY,CAAC;AAM/D;;;;;;;;GAQG;AACH,eAAO,MAAM,aAAa,EAAE,eAwC3B,CAAC;AAEF,wBAAsB,wBAAwB,IAAI,OAAO,CAAC,OAAO,CAAC,CAOjE"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { spawn } from 'node:child_process';
|
|
2
|
+
import { CredentialError } from './types.js';
|
|
3
|
+
const SCHEMA = 'org.allstak.wizard';
|
|
4
|
+
const SERVICE_LABEL = 'allstak-wizard';
|
|
5
|
+
/**
|
|
6
|
+
* Linux Secret Service via `secret-tool` (libsecret). Available on most modern
|
|
7
|
+
* GNOME/KDE-based distros. If `secret-tool` is missing or the user is in a
|
|
8
|
+
* headless session without a running secret-service daemon, the store gracefully
|
|
9
|
+
* fails its `available()` check and the encrypted-file fallback is used.
|
|
10
|
+
*
|
|
11
|
+
* Schema attributes are stable across versions so users can prune entries with
|
|
12
|
+
* `secret-tool clear schema=org.allstak.wizard`.
|
|
13
|
+
*/
|
|
14
|
+
export const linuxKeychain = {
|
|
15
|
+
id: 'linux-secret-service',
|
|
16
|
+
label: 'Linux Secret Service (libsecret)',
|
|
17
|
+
serviceName: SERVICE_LABEL,
|
|
18
|
+
async load(host) {
|
|
19
|
+
try {
|
|
20
|
+
const raw = await runSecretTool([
|
|
21
|
+
'lookup',
|
|
22
|
+
'schema', SCHEMA,
|
|
23
|
+
'host', host,
|
|
24
|
+
]);
|
|
25
|
+
if (!raw)
|
|
26
|
+
return null;
|
|
27
|
+
return JSON.parse(raw);
|
|
28
|
+
}
|
|
29
|
+
catch (err) {
|
|
30
|
+
if (isMissing(err))
|
|
31
|
+
return null;
|
|
32
|
+
throw err;
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
async save(creds) {
|
|
36
|
+
await runSecretTool([
|
|
37
|
+
'store',
|
|
38
|
+
'--label', `${SERVICE_LABEL} (${creds.host})`,
|
|
39
|
+
'schema', SCHEMA,
|
|
40
|
+
'host', creds.host,
|
|
41
|
+
], JSON.stringify(creds));
|
|
42
|
+
},
|
|
43
|
+
async clear(host) {
|
|
44
|
+
try {
|
|
45
|
+
await runSecretTool(['clear', 'schema', SCHEMA, 'host', host]);
|
|
46
|
+
}
|
|
47
|
+
catch (err) {
|
|
48
|
+
if (isMissing(err))
|
|
49
|
+
return;
|
|
50
|
+
throw err;
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
export async function isLinuxKeychainAvailable() {
|
|
55
|
+
try {
|
|
56
|
+
await runSecretTool(['--help']);
|
|
57
|
+
return true;
|
|
58
|
+
}
|
|
59
|
+
catch {
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
function runSecretTool(args, stdin) {
|
|
64
|
+
return new Promise((resolveP, reject) => {
|
|
65
|
+
const child = spawn('secret-tool', args);
|
|
66
|
+
let stdout = '';
|
|
67
|
+
let stderr = '';
|
|
68
|
+
child.stdout.on('data', (chunk) => { stdout += chunk.toString('utf8'); });
|
|
69
|
+
child.stderr.on('data', (chunk) => { stderr += chunk.toString('utf8'); });
|
|
70
|
+
child.on('error', (err) => reject(new CredentialError('E_SECRET_TOOL', err.message)));
|
|
71
|
+
child.on('exit', (code) => {
|
|
72
|
+
if (code === 0)
|
|
73
|
+
resolveP(stdout.replace(/\n$/, ''));
|
|
74
|
+
else
|
|
75
|
+
reject(new CredentialError('E_SECRET_TOOL', stderr.trim() || `secret-tool exited with code ${code}`));
|
|
76
|
+
});
|
|
77
|
+
if (stdin !== undefined) {
|
|
78
|
+
child.stdin.write(stdin);
|
|
79
|
+
child.stdin.end();
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
function isMissing(err) {
|
|
84
|
+
if (!(err instanceof CredentialError))
|
|
85
|
+
return false;
|
|
86
|
+
return /no matching/i.test(err.message);
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=keychain-linux.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keychain-linux.js","sourceRoot":"","sources":["../../src/credentials/keychain-linux.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,OAAO,EAAE,eAAe,EAAE,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C,CAAC;QACL,CAAC,CAAC,CAAC;QACH,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YACzB,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;QACpB,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,SAAS,CAAC,GAAY;IAC7B,IAAI,CAAC,CAAC,GAAG,YAAY,eAAe,CAAC;QAAE,OAAO,KAAK,CAAC;IACpD,OAAO,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AAC1C,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { CredentialStore } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Windows Credential Manager via PowerShell's CredentialManager module is too
|
|
4
|
+
* heavyweight for a tiny wizard. We fall back to `cmdkey` / WinAPI is non-trivial
|
|
5
|
+
* over CLI. For v0.1.2 the Windows path uses the encrypted-file fallback, which
|
|
6
|
+
* is itself secure (DPAPI-derived AES-256-GCM via crypto.scrypt + machine-bound
|
|
7
|
+
* salt). Native Credential Manager support is a v0.2 follow-up.
|
|
8
|
+
*
|
|
9
|
+
* This stub explicitly reports unavailable so the multiplexer skips it.
|
|
10
|
+
*/
|
|
11
|
+
export declare const windowsKeychain: CredentialStore;
|
|
12
|
+
export declare function isWindowsKeychainAvailable(): Promise<boolean>;
|
|
13
|
+
//# sourceMappingURL=keychain-win.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keychain-win.d.ts","sourceRoot":"","sources":["../../src/credentials/keychain-win.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAe,MAAM,YAAY,CAAC;AAK/D;;;;;;;;GAQG;AACH,eAAO,MAAM,eAAe,EAAE,eAW7B,CAAC;AAEF,wBAAsB,0BAA0B,IAAI,OAAO,CAAC,OAAO,CAAC,CAGnE"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { spawn } from 'node:child_process';
|
|
2
|
+
import { CredentialError } from './types.js';
|
|
3
|
+
const SERVICE = 'allstak-wizard';
|
|
4
|
+
/**
|
|
5
|
+
* Windows Credential Manager via PowerShell's CredentialManager module is too
|
|
6
|
+
* heavyweight for a tiny wizard. We fall back to `cmdkey` / WinAPI is non-trivial
|
|
7
|
+
* over CLI. For v0.1.2 the Windows path uses the encrypted-file fallback, which
|
|
8
|
+
* is itself secure (DPAPI-derived AES-256-GCM via crypto.scrypt + machine-bound
|
|
9
|
+
* salt). Native Credential Manager support is a v0.2 follow-up.
|
|
10
|
+
*
|
|
11
|
+
* This stub explicitly reports unavailable so the multiplexer skips it.
|
|
12
|
+
*/
|
|
13
|
+
export const windowsKeychain = {
|
|
14
|
+
id: 'windows-cred-manager',
|
|
15
|
+
label: 'Windows Credential Manager (deferred to v0.2)',
|
|
16
|
+
serviceName: SERVICE,
|
|
17
|
+
async load() {
|
|
18
|
+
throw new CredentialError('E_NOT_IMPL', 'Windows Credential Manager not implemented in v0.1.2; using encrypted-file fallback.');
|
|
19
|
+
},
|
|
20
|
+
async save() {
|
|
21
|
+
throw new CredentialError('E_NOT_IMPL', 'Windows Credential Manager not implemented in v0.1.2.');
|
|
22
|
+
},
|
|
23
|
+
async clear() { },
|
|
24
|
+
};
|
|
25
|
+
export async function isWindowsKeychainAvailable() {
|
|
26
|
+
// Intentionally false in v0.1.2.
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
// Reserved for the future native implementation. Suppresses unused-import warnings.
|
|
30
|
+
void spawn;
|
|
31
|
+
//# sourceMappingURL=keychain-win.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keychain-win.js","sourceRoot":"","sources":["../../src/credentials/keychain-win.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,MAAM,OAAO,GAAG,gBAAgB,CAAC;AAEjC;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,eAAe,GAAoB;IAC9C,EAAE,EAAE,sBAAsB;IAC1B,KAAK,EAAE,+CAA+C;IACtD,WAAW,EAAE,OAAO;IACpB,KAAK,CAAC,IAAI;QACR,MAAM,IAAI,eAAe,CAAC,YAAY,EAAE,sFAAsF,CAAC,CAAC;IAClI,CAAC;IACD,KAAK,CAAC,IAAI;QACR,MAAM,IAAI,eAAe,CAAC,YAAY,EAAE,uDAAuD,CAAC,CAAC;IACnG,CAAC;IACD,KAAK,CAAC,KAAK,KAAwC,CAAC;CACrD,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,0BAA0B;IAC9C,iCAAiC;IACjC,OAAO,KAAK,CAAC;AACf,CAAC;AAED,oFAAoF;AACpF,KAAK,KAAK,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Credential persistence layer.
|
|
3
|
+
*
|
|
4
|
+
* Stored shape (the entire `Credentials` object is serialised as JSON and
|
|
5
|
+
* encrypted in the keychain or fallback file):
|
|
6
|
+
*/
|
|
7
|
+
export interface Credentials {
|
|
8
|
+
/** Schema version — bump if the on-disk format changes incompatibly. */
|
|
9
|
+
schemaVersion: 1;
|
|
10
|
+
/** Tenant host this credential set is bound to. */
|
|
11
|
+
host: string;
|
|
12
|
+
/** Bearer JWT issued by /api/v1/auth/verify-otp (or /refresh). */
|
|
13
|
+
accessToken: string;
|
|
14
|
+
/** Refresh token used to mint new access tokens. */
|
|
15
|
+
refreshToken: string;
|
|
16
|
+
/** Absolute UTC time (ms) the access token expires. */
|
|
17
|
+
accessExpiresAt: number;
|
|
18
|
+
/** User snapshot returned by the backend at login time. */
|
|
19
|
+
user: {
|
|
20
|
+
id: string;
|
|
21
|
+
email: string;
|
|
22
|
+
name?: string;
|
|
23
|
+
};
|
|
24
|
+
/** ms timestamp when this record was written. */
|
|
25
|
+
storedAt: number;
|
|
26
|
+
}
|
|
27
|
+
export interface CredentialStore {
|
|
28
|
+
readonly id: string;
|
|
29
|
+
/** Human label shown in `whoami` so the user knows where their token lives. */
|
|
30
|
+
readonly label: string;
|
|
31
|
+
load(host: string): Promise<Credentials | null>;
|
|
32
|
+
save(creds: Credentials): Promise<void>;
|
|
33
|
+
clear(host: string): Promise<void>;
|
|
34
|
+
/** Unique service account name (used by macOS Keychain / libsecret / wincred). */
|
|
35
|
+
readonly serviceName: string;
|
|
36
|
+
}
|
|
37
|
+
export { CredentialError } from './error.js';
|
|
38
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/credentials/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC1B,wEAAwE;IACxE,aAAa,EAAE,CAAC,CAAC;IACjB,mDAAmD;IACnD,IAAI,EAAE,MAAM,CAAC;IACb,kEAAkE;IAClE,WAAW,EAAE,MAAM,CAAC;IACpB,oDAAoD;IACpD,YAAY,EAAE,MAAM,CAAC;IACrB,uDAAuD;IACvD,eAAe,EAAE,MAAM,CAAC;IACxB,2DAA2D;IAC3D,IAAI,EAAE;QACJ,EAAE,EAAE,MAAM,CAAC;QACX,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;IACF,iDAAiD;IACjD,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,+EAA+E;IAC/E,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAChD,IAAI,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACxC,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACnC,kFAAkF;IAClF,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAKD,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// CredentialError is exported from a separate module to avoid a circular import
|
|
2
|
+
// (errors.ts → error-codes.ts; this file is imported by errors.ts indirectly
|
|
3
|
+
// via the encrypted-file/keychain modules, so we keep it pure-data here).
|
|
4
|
+
export { CredentialError } from './error.js';
|
|
5
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/credentials/types.ts"],"names":[],"mappings":"AAsCA,gFAAgF;AAChF,6EAA6E;AAC7E,0EAA0E;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type PackageManager } from './package-manager.js';
|
|
2
|
+
import { type MonorepoInfo } from './monorepo.js';
|
|
3
|
+
export type IntegrationId = 'react' | 'next' | 'js' | 'react-native' | 'expo' | 'nestjs' | 'fastify' | 'otel' | 'python' | 'go' | 'java' | 'php' | 'ruby' | 'dotnet' | 'flutter';
|
|
4
|
+
export interface DetectedFramework {
|
|
5
|
+
candidates: IntegrationId[];
|
|
6
|
+
evidence: Record<IntegrationId, string[]>;
|
|
7
|
+
packageJson: PackageJsonShape | null;
|
|
8
|
+
pm: PackageManager;
|
|
9
|
+
monorepo: MonorepoInfo;
|
|
10
|
+
/** True when the project root has the file (we still defer to the integration's detector). */
|
|
11
|
+
hasNextConfig: boolean;
|
|
12
|
+
hasViteConfig: boolean;
|
|
13
|
+
hasWebpackConfig: boolean;
|
|
14
|
+
hasMetroConfig: boolean;
|
|
15
|
+
hasExpoConfig: boolean;
|
|
16
|
+
hasAppRouter: boolean;
|
|
17
|
+
hasPagesRouter: boolean;
|
|
18
|
+
}
|
|
19
|
+
export interface PackageJsonShape {
|
|
20
|
+
name?: string;
|
|
21
|
+
version?: string;
|
|
22
|
+
dependencies?: Record<string, string>;
|
|
23
|
+
devDependencies?: Record<string, string>;
|
|
24
|
+
peerDependencies?: Record<string, string>;
|
|
25
|
+
scripts?: Record<string, string>;
|
|
26
|
+
}
|
|
27
|
+
export declare function detectFramework(projectRoot: string): DetectedFramework;
|
|
28
|
+
//# sourceMappingURL=framework.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"framework.d.ts","sourceRoot":"","sources":["../../src/detect/framework.ts"],"names":[],"mappings":"AAEA,OAAO,EAAwB,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACjF,OAAO,EAAkB,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AAElE,MAAM,MAAM,aAAa,GACrB,OAAO,GACP,MAAM,GACN,IAAI,GACJ,cAAc,GACd,MAAM,GACN,QAAQ,GACR,SAAS,GACT,MAAM,GACN,QAAQ,GACR,IAAI,GACJ,MAAM,GACN,KAAK,GACL,MAAM,GACN,QAAQ,GACR,SAAS,CAAC;AAEd,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,aAAa,EAAE,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC,aAAa,EAAE,MAAM,EAAE,CAAC,CAAC;IAC1C,WAAW,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACrC,EAAE,EAAE,cAAc,CAAC;IACnB,QAAQ,EAAE,YAAY,CAAC;IACvB,8FAA8F;IAC9F,aAAa,EAAE,OAAO,CAAC;IACvB,aAAa,EAAE,OAAO,CAAC;IACvB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,cAAc,EAAE,OAAO,CAAC;IACxB,aAAa,EAAE,OAAO,CAAC;IACvB,YAAY,EAAE,OAAO,CAAC;IACtB,cAAc,EAAE,OAAO,CAAC;CACzB;AAED,MAAM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