@m2-ai/lattice-cli 0.0.0-stage → 0.8.7
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/DISCLOSURE +1 -0
- package/README.md +118 -2
- package/bundles/expo-mobile/.agents/skills/lattice-feature-handoff/SKILL.md +31 -0
- package/bundles/expo-mobile/.agents/skills/lattice-release-manager/SKILL.md +29 -0
- package/bundles/expo-mobile/.agents/skills/lattice-verify/SKILL.md +27 -0
- package/bundles/expo-mobile/.claude/agents/lattice-feature-agent.md +10 -0
- package/bundles/expo-mobile/.claude/agents/lattice-release-manager.md +9 -0
- package/bundles/expo-mobile/.claude/hooks/README.md +9 -0
- package/bundles/expo-mobile/.claude/hooks/pre-commit-verify.mjs +10 -0
- package/bundles/expo-mobile/.claude/hooks/pre-tool-use.mjs +51 -0
- package/bundles/expo-mobile/.claude/rules/lattice-core.md +20 -0
- package/bundles/expo-mobile/.claude/settings.json +38 -0
- package/bundles/expo-mobile/.claude/skills/lattice-verify/SKILL.md +27 -0
- package/bundles/expo-mobile/.codex/agents/lattice-feature-agent.toml +9 -0
- package/bundles/expo-mobile/.codex/agents/lattice-release-manager.toml +9 -0
- package/bundles/expo-mobile/.cursor/mcp.json +34 -0
- package/bundles/expo-mobile/.cursor/rules/lattice-core.mdc +35 -0
- package/bundles/expo-mobile/.cursor/rules.md +94 -0
- package/bundles/expo-mobile/.env.example +19 -0
- package/bundles/expo-mobile/.github/PULL_REQUEST_TEMPLATE.md +42 -0
- package/bundles/expo-mobile/.github/agents/lattice-feature-agent.agent.md +7 -0
- package/bundles/expo-mobile/.github/agents/lattice-release-manager.agent.md +7 -0
- package/bundles/expo-mobile/.github/copilot-instructions.md +37 -0
- package/bundles/expo-mobile/.github/instructions/lattice-core.instructions.md +11 -0
- package/bundles/expo-mobile/.github/workflows/ci.yml +26 -0
- package/bundles/expo-mobile/.gitmessage +24 -0
- package/bundles/expo-mobile/.lattice/config.json +9 -0
- package/bundles/expo-mobile/.lattice/dependency-security.json +91 -0
- package/bundles/expo-mobile/.lattice/prompts/01-feature.md +36 -0
- package/bundles/expo-mobile/.lattice/prompts/02-bugfix.md +32 -0
- package/bundles/expo-mobile/.lattice/prompts/03-refactor.md +30 -0
- package/bundles/expo-mobile/.lattice/prompts/04-test.md +31 -0
- package/bundles/expo-mobile/.lattice/prompts/05-polish.md +38 -0
- package/bundles/expo-mobile/.lattice/prompts/06-security.md +32 -0
- package/bundles/expo-mobile/.lattice/release-workflow.json +55 -0
- package/bundles/expo-mobile/.lattice/schemas/feature-handoff.schema.json +264 -0
- package/bundles/expo-mobile/.lattice/templates/feature-handoff.json +52 -0
- package/bundles/expo-mobile/.mcp.json +35 -0
- package/bundles/expo-mobile/AGENTS.md +58 -0
- package/bundles/expo-mobile/CLAUDE.md +75 -0
- package/bundles/expo-mobile/PROJECT_GUIDE.md +299 -0
- package/bundles/expo-mobile/README.md +39 -0
- package/bundles/expo-mobile/__tests__/home.test.tsx +22 -0
- package/bundles/expo-mobile/app/_layout.tsx +20 -0
- package/bundles/expo-mobile/app/index.tsx +72 -0
- package/bundles/expo-mobile/app.json +33 -0
- package/bundles/expo-mobile/components/ui/Button.tsx +75 -0
- package/bundles/expo-mobile/components/ui/Input.tsx +50 -0
- package/bundles/expo-mobile/components/ui/index.ts +2 -0
- package/bundles/expo-mobile/docs/LATTICE_RELEASE_WORKFLOW.md +53 -0
- package/bundles/expo-mobile/docs/rules/codex.md +62 -0
- package/bundles/expo-mobile/eslint.config.js +7 -0
- package/bundles/expo-mobile/lib/supabase/client.ts +22 -0
- package/bundles/expo-mobile/lib/supabase/realtime.ts +10 -0
- package/bundles/expo-mobile/lib/supabase/storage.ts +6 -0
- package/bundles/expo-mobile/package.json +65 -0
- package/bundles/expo-mobile/plugins/with-lattice-commons-io.cjs +42 -0
- package/bundles/expo-mobile/prompts/01-feature-implementation.md +48 -0
- package/bundles/expo-mobile/prompts/02-bug-fix.md +43 -0
- package/bundles/expo-mobile/prompts/03-safe-refactor.md +38 -0
- package/bundles/expo-mobile/prompts/04-test-first.md +41 -0
- package/bundles/expo-mobile/prompts/05-ui-polish.md +44 -0
- package/bundles/expo-mobile/prompts/06-security-review.md +39 -0
- package/bundles/expo-mobile/prompts/quality.md +143 -0
- package/bundles/expo-mobile/supabase/migrations/001_initial_schema.sql +66 -0
- package/bundles/expo-mobile/tsconfig.json +21 -0
- package/bundles/expo-mobile/types/database.types.ts +76 -0
- package/bundles/expo-mobile/vendor/m2ai-braces-3.0.3-m2ai.1.tar +0 -0
- package/bundles/expo-supabase/.agents/skills/lattice-feature-handoff/SKILL.md +31 -0
- package/bundles/expo-supabase/.agents/skills/lattice-release-manager/SKILL.md +29 -0
- package/bundles/expo-supabase/.agents/skills/lattice-verify/SKILL.md +27 -0
- package/bundles/expo-supabase/.claude/agents/lattice-feature-agent.md +10 -0
- package/bundles/expo-supabase/.claude/agents/lattice-release-manager.md +9 -0
- package/bundles/expo-supabase/.claude/hooks/README.md +9 -0
- package/bundles/expo-supabase/.claude/hooks/pre-commit-verify.mjs +10 -0
- package/bundles/expo-supabase/.claude/hooks/pre-tool-use.mjs +51 -0
- package/bundles/expo-supabase/.claude/rules/lattice-core.md +20 -0
- package/bundles/expo-supabase/.claude/settings.json +38 -0
- package/bundles/expo-supabase/.claude/skills/lattice-verify/SKILL.md +27 -0
- package/bundles/expo-supabase/.codex/agents/lattice-feature-agent.toml +9 -0
- package/bundles/expo-supabase/.codex/agents/lattice-release-manager.toml +9 -0
- package/bundles/expo-supabase/.cursor/mcp.json +34 -0
- package/bundles/expo-supabase/.cursor/rules/lattice-core.mdc +35 -0
- package/bundles/expo-supabase/.cursor/rules.md +94 -0
- package/bundles/expo-supabase/.env.example +12 -0
- package/bundles/expo-supabase/.github/PULL_REQUEST_TEMPLATE.md +42 -0
- package/bundles/expo-supabase/.github/agents/lattice-feature-agent.agent.md +7 -0
- package/bundles/expo-supabase/.github/agents/lattice-release-manager.agent.md +7 -0
- package/bundles/expo-supabase/.github/copilot-instructions.md +37 -0
- package/bundles/expo-supabase/.github/instructions/lattice-core.instructions.md +11 -0
- package/bundles/expo-supabase/.github/workflows/ci.yml +26 -0
- package/bundles/expo-supabase/.gitmessage +24 -0
- package/bundles/expo-supabase/.lattice/config.json +9 -0
- package/bundles/expo-supabase/.lattice/dependency-security.json +91 -0
- package/bundles/expo-supabase/.lattice/prompts/01-feature.md +36 -0
- package/bundles/expo-supabase/.lattice/prompts/02-bugfix.md +32 -0
- package/bundles/expo-supabase/.lattice/prompts/03-refactor.md +30 -0
- package/bundles/expo-supabase/.lattice/prompts/04-test.md +31 -0
- package/bundles/expo-supabase/.lattice/prompts/05-polish.md +38 -0
- package/bundles/expo-supabase/.lattice/prompts/06-security.md +32 -0
- package/bundles/expo-supabase/.lattice/release-workflow.json +55 -0
- package/bundles/expo-supabase/.lattice/schemas/feature-handoff.schema.json +264 -0
- package/bundles/expo-supabase/.lattice/templates/feature-handoff.json +52 -0
- package/bundles/expo-supabase/.mcp.json +35 -0
- package/bundles/expo-supabase/AGENTS.md +58 -0
- package/bundles/expo-supabase/CLAUDE.md +75 -0
- package/bundles/expo-supabase/PROJECT_GUIDE.md +201 -0
- package/bundles/expo-supabase/README.md +38 -0
- package/bundles/expo-supabase/__tests__/home.test.tsx +22 -0
- package/bundles/expo-supabase/app/_layout.tsx +14 -0
- package/bundles/expo-supabase/app/index.tsx +72 -0
- package/bundles/expo-supabase/app.json +33 -0
- package/bundles/expo-supabase/components/ui/Button.tsx +75 -0
- package/bundles/expo-supabase/components/ui/Input.tsx +50 -0
- package/bundles/expo-supabase/components/ui/index.ts +2 -0
- package/bundles/expo-supabase/docs/LATTICE_RELEASE_WORKFLOW.md +53 -0
- package/bundles/expo-supabase/docs/rules/codex.md +62 -0
- package/bundles/expo-supabase/eslint.config.js +7 -0
- package/bundles/expo-supabase/lib/supabase/client.ts +22 -0
- package/bundles/expo-supabase/lib/supabase/realtime.ts +10 -0
- package/bundles/expo-supabase/lib/supabase/storage.ts +6 -0
- package/bundles/expo-supabase/package.json +60 -0
- package/bundles/expo-supabase/plugins/with-lattice-commons-io.cjs +42 -0
- package/bundles/expo-supabase/prompts/01-feature-implementation.md +8 -0
- package/bundles/expo-supabase/prompts/02-bug-fix.md +9 -0
- package/bundles/expo-supabase/prompts/03-safe-refactor.md +8 -0
- package/bundles/expo-supabase/prompts/04-test-first.md +7 -0
- package/bundles/expo-supabase/prompts/05-ui-polish.md +7 -0
- package/bundles/expo-supabase/prompts/06-security-review.md +7 -0
- package/bundles/expo-supabase/prompts/quality.md +143 -0
- package/bundles/expo-supabase/supabase/migrations/001_initial_schema.sql +66 -0
- package/bundles/expo-supabase/tsconfig.json +21 -0
- package/bundles/expo-supabase/types/database.types.ts +76 -0
- package/bundles/expo-supabase/vendor/m2ai-braces-3.0.3-m2ai.1.tar +0 -0
- package/bundles/nextjs-landing/.agents/skills/lattice-feature-handoff/SKILL.md +31 -0
- package/bundles/nextjs-landing/.agents/skills/lattice-release-manager/SKILL.md +29 -0
- package/bundles/nextjs-landing/.agents/skills/lattice-verify/SKILL.md +27 -0
- package/bundles/nextjs-landing/.claude/agents/lattice-feature-agent.md +10 -0
- package/bundles/nextjs-landing/.claude/agents/lattice-release-manager.md +9 -0
- package/bundles/nextjs-landing/.claude/hooks/README.md +9 -0
- package/bundles/nextjs-landing/.claude/hooks/pre-commit-verify.mjs +10 -0
- package/bundles/nextjs-landing/.claude/hooks/pre-tool-use.mjs +51 -0
- package/bundles/nextjs-landing/.claude/rules/lattice-core.md +20 -0
- package/bundles/nextjs-landing/.claude/settings.json +38 -0
- package/bundles/nextjs-landing/.claude/skills/lattice-verify/SKILL.md +27 -0
- package/bundles/nextjs-landing/.codex/agents/lattice-feature-agent.toml +9 -0
- package/bundles/nextjs-landing/.codex/agents/lattice-release-manager.toml +9 -0
- package/bundles/nextjs-landing/.cursor/mcp.json +34 -0
- package/bundles/nextjs-landing/.cursor/rules/lattice-core.mdc +35 -0
- package/bundles/nextjs-landing/.cursor/rules.md +95 -0
- package/bundles/nextjs-landing/.env.example +24 -0
- package/bundles/nextjs-landing/.github/PULL_REQUEST_TEMPLATE.md +42 -0
- package/bundles/nextjs-landing/.github/agents/lattice-feature-agent.agent.md +7 -0
- package/bundles/nextjs-landing/.github/agents/lattice-release-manager.agent.md +7 -0
- package/bundles/nextjs-landing/.github/copilot-instructions.md +37 -0
- package/bundles/nextjs-landing/.github/instructions/lattice-core.instructions.md +11 -0
- package/bundles/nextjs-landing/.github/workflows/ci.yml +26 -0
- package/bundles/nextjs-landing/.gitmessage +24 -0
- package/bundles/nextjs-landing/.lattice/config.json +9 -0
- package/bundles/nextjs-landing/.lattice/dependency-security.json +46 -0
- package/bundles/nextjs-landing/.lattice/prompts/01-feature.md +36 -0
- package/bundles/nextjs-landing/.lattice/prompts/02-bugfix.md +32 -0
- package/bundles/nextjs-landing/.lattice/prompts/03-refactor.md +30 -0
- package/bundles/nextjs-landing/.lattice/prompts/04-test.md +31 -0
- package/bundles/nextjs-landing/.lattice/prompts/05-polish.md +38 -0
- package/bundles/nextjs-landing/.lattice/prompts/06-security.md +32 -0
- package/bundles/nextjs-landing/.lattice/release-workflow.json +55 -0
- package/bundles/nextjs-landing/.lattice/schemas/feature-handoff.schema.json +264 -0
- package/bundles/nextjs-landing/.lattice/templates/feature-handoff.json +52 -0
- package/bundles/nextjs-landing/.mcp.json +35 -0
- package/bundles/nextjs-landing/AGENTS.md +58 -0
- package/bundles/nextjs-landing/CLAUDE.md +76 -0
- package/bundles/nextjs-landing/PROJECT_GUIDE.md +216 -0
- package/bundles/nextjs-landing/README.md +39 -0
- package/bundles/nextjs-landing/app/api/example/[id]/route.ts +34 -0
- package/bundles/nextjs-landing/app/api/example/route.ts +24 -0
- package/bundles/nextjs-landing/app/api/health/route.ts +8 -0
- package/bundles/nextjs-landing/app/global-error.tsx +17 -0
- package/bundles/nextjs-landing/app/globals.css +55 -0
- package/bundles/nextjs-landing/app/layout.tsx +22 -0
- package/bundles/nextjs-landing/app/page.tsx +42 -0
- package/bundles/nextjs-landing/components/ui/button.tsx +39 -0
- package/bundles/nextjs-landing/components/ui/card.tsx +53 -0
- package/bundles/nextjs-landing/components/ui/index.ts +4 -0
- package/bundles/nextjs-landing/components/ui/input.tsx +23 -0
- package/bundles/nextjs-landing/components/ui/spinner.tsx +22 -0
- package/bundles/nextjs-landing/docs/LATTICE_RELEASE_WORKFLOW.md +53 -0
- package/bundles/nextjs-landing/docs/rules/codex.md +62 -0
- package/bundles/nextjs-landing/eslint.config.mjs +16 -0
- package/bundles/nextjs-landing/instrumentation-client.ts +30 -0
- package/bundles/nextjs-landing/instrumentation.ts +12 -0
- package/bundles/nextjs-landing/jest.config.mjs +16 -0
- package/bundles/nextjs-landing/jest.setup.js +1 -0
- package/bundles/nextjs-landing/lib/utils.ts +6 -0
- package/bundles/nextjs-landing/next-env.d.ts +5 -0
- package/bundles/nextjs-landing/next.config.ts +15 -0
- package/bundles/nextjs-landing/package.json +48 -0
- package/bundles/nextjs-landing/postcss.config.mjs +7 -0
- package/bundles/nextjs-landing/prompts/01-feature-implementation.md +9 -0
- package/bundles/nextjs-landing/prompts/02-bug-fix.md +10 -0
- package/bundles/nextjs-landing/prompts/03-safe-refactor.md +8 -0
- package/bundles/nextjs-landing/prompts/04-test-first.md +8 -0
- package/bundles/nextjs-landing/prompts/05-ui-polish.md +8 -0
- package/bundles/nextjs-landing/prompts/06-security-review.md +7 -0
- package/bundles/nextjs-landing/prompts/quality.md +269 -0
- package/bundles/nextjs-landing/sentry.edge.config.ts +15 -0
- package/bundles/nextjs-landing/sentry.server.config.ts +15 -0
- package/bundles/nextjs-landing/tsconfig.json +42 -0
- package/bundles/nextjs-landing/vendor/m2ai-braces-3.0.3-m2ai.1.tar +0 -0
- package/bundles/nextjs-saas/.agents/skills/lattice-feature-handoff/SKILL.md +31 -0
- package/bundles/nextjs-saas/.agents/skills/lattice-release-manager/SKILL.md +29 -0
- package/bundles/nextjs-saas/.agents/skills/lattice-verify/SKILL.md +27 -0
- package/bundles/nextjs-saas/.claude/agents/lattice-feature-agent.md +10 -0
- package/bundles/nextjs-saas/.claude/agents/lattice-release-manager.md +9 -0
- package/bundles/nextjs-saas/.claude/hooks/README.md +9 -0
- package/bundles/nextjs-saas/.claude/hooks/pre-commit-verify.mjs +10 -0
- package/bundles/nextjs-saas/.claude/hooks/pre-tool-use.mjs +51 -0
- package/bundles/nextjs-saas/.claude/rules/lattice-core.md +20 -0
- package/bundles/nextjs-saas/.claude/settings.json +38 -0
- package/bundles/nextjs-saas/.claude/skills/lattice-verify/SKILL.md +27 -0
- package/bundles/nextjs-saas/.codex/agents/lattice-feature-agent.toml +9 -0
- package/bundles/nextjs-saas/.codex/agents/lattice-release-manager.toml +9 -0
- package/bundles/nextjs-saas/.cursor/mcp.json +34 -0
- package/bundles/nextjs-saas/.cursor/rules/lattice-core.mdc +35 -0
- package/bundles/nextjs-saas/.cursor/rules.md +95 -0
- package/bundles/nextjs-saas/.env.example +48 -0
- package/bundles/nextjs-saas/.github/PULL_REQUEST_TEMPLATE.md +42 -0
- package/bundles/nextjs-saas/.github/agents/lattice-feature-agent.agent.md +7 -0
- package/bundles/nextjs-saas/.github/agents/lattice-release-manager.agent.md +7 -0
- package/bundles/nextjs-saas/.github/copilot-instructions.md +37 -0
- package/bundles/nextjs-saas/.github/instructions/lattice-core.instructions.md +11 -0
- package/bundles/nextjs-saas/.github/workflows/ci.yml +26 -0
- package/bundles/nextjs-saas/.gitmessage +24 -0
- package/bundles/nextjs-saas/.lattice/config.json +9 -0
- package/bundles/nextjs-saas/.lattice/dependency-security.json +46 -0
- package/bundles/nextjs-saas/.lattice/prompts/01-feature.md +36 -0
- package/bundles/nextjs-saas/.lattice/prompts/02-bugfix.md +32 -0
- package/bundles/nextjs-saas/.lattice/prompts/03-refactor.md +30 -0
- package/bundles/nextjs-saas/.lattice/prompts/04-test.md +31 -0
- package/bundles/nextjs-saas/.lattice/prompts/05-polish.md +38 -0
- package/bundles/nextjs-saas/.lattice/prompts/06-security.md +32 -0
- package/bundles/nextjs-saas/.lattice/prompts/quality.md +269 -0
- package/bundles/nextjs-saas/.lattice/release-workflow.json +55 -0
- package/bundles/nextjs-saas/.lattice/schemas/feature-handoff.schema.json +264 -0
- package/bundles/nextjs-saas/.lattice/templates/feature-handoff.json +52 -0
- package/bundles/nextjs-saas/.mcp.json +35 -0
- package/bundles/nextjs-saas/AGENTS.md +58 -0
- package/bundles/nextjs-saas/CLAUDE.md +76 -0
- package/bundles/nextjs-saas/PROJECT_GUIDE.md +279 -0
- package/bundles/nextjs-saas/README.md +42 -0
- package/bundles/nextjs-saas/app/(auth)/forgot-password/page.tsx +101 -0
- package/bundles/nextjs-saas/app/(auth)/layout.tsx +7 -0
- package/bundles/nextjs-saas/app/(auth)/login/page.tsx +108 -0
- package/bundles/nextjs-saas/app/(auth)/reset-password/page.tsx +135 -0
- package/bundles/nextjs-saas/app/(auth)/signup/page.tsx +144 -0
- package/bundles/nextjs-saas/app/(dashboard)/dashboard/page.tsx +80 -0
- package/bundles/nextjs-saas/app/(dashboard)/layout.tsx +49 -0
- package/bundles/nextjs-saas/app/api/billing/checkout/route.ts +47 -0
- package/bundles/nextjs-saas/app/api/billing/portal/route.ts +29 -0
- package/bundles/nextjs-saas/app/api/example/[id]/route.ts +93 -0
- package/bundles/nextjs-saas/app/api/example/route.ts +61 -0
- package/bundles/nextjs-saas/app/api/health/route.ts +8 -0
- package/bundles/nextjs-saas/app/api/stripe/webhook/route.ts +57 -0
- package/bundles/nextjs-saas/app/api/user/route.ts +49 -0
- package/bundles/nextjs-saas/app/auth/callback/route.ts +16 -0
- package/bundles/nextjs-saas/app/auth/signout/route.ts +10 -0
- package/bundles/nextjs-saas/app/global-error.tsx +17 -0
- package/bundles/nextjs-saas/app/globals.css +55 -0
- package/bundles/nextjs-saas/app/layout.tsx +22 -0
- package/bundles/nextjs-saas/app/page.tsx +84 -0
- package/bundles/nextjs-saas/components/ui/button.tsx +39 -0
- package/bundles/nextjs-saas/components/ui/card.tsx +53 -0
- package/bundles/nextjs-saas/components/ui/index.ts +4 -0
- package/bundles/nextjs-saas/components/ui/input.tsx +23 -0
- package/bundles/nextjs-saas/components/ui/spinner.tsx +22 -0
- package/bundles/nextjs-saas/docs/LATTICE_RELEASE_WORKFLOW.md +53 -0
- package/bundles/nextjs-saas/docs/rules/codex.md +62 -0
- package/bundles/nextjs-saas/eslint.config.mjs +16 -0
- package/bundles/nextjs-saas/instrumentation-client.ts +30 -0
- package/bundles/nextjs-saas/instrumentation.ts +12 -0
- package/bundles/nextjs-saas/jest.config.mjs +16 -0
- package/bundles/nextjs-saas/jest.setup.js +1 -0
- package/bundles/nextjs-saas/lib/auth/password-recovery.ts +94 -0
- package/bundles/nextjs-saas/lib/stripe.ts +10 -0
- package/bundles/nextjs-saas/lib/supabase/admin.ts +14 -0
- package/bundles/nextjs-saas/lib/supabase/client.ts +8 -0
- package/bundles/nextjs-saas/lib/supabase/server.ts +27 -0
- package/bundles/nextjs-saas/lib/utils.ts +6 -0
- package/bundles/nextjs-saas/next-env.d.ts +5 -0
- package/bundles/nextjs-saas/next.config.ts +15 -0
- package/bundles/nextjs-saas/package.json +50 -0
- package/bundles/nextjs-saas/postcss.config.mjs +7 -0
- package/bundles/nextjs-saas/prompts/01-feature-implementation.md +92 -0
- package/bundles/nextjs-saas/prompts/02-bug-fix.md +78 -0
- package/bundles/nextjs-saas/prompts/03-safe-refactor.md +82 -0
- package/bundles/nextjs-saas/prompts/04-test-first.md +80 -0
- package/bundles/nextjs-saas/prompts/05-ui-polish.md +82 -0
- package/bundles/nextjs-saas/prompts/06-security-review.md +74 -0
- package/bundles/nextjs-saas/proxy.ts +61 -0
- package/bundles/nextjs-saas/sentry.edge.config.ts +15 -0
- package/bundles/nextjs-saas/sentry.server.config.ts +15 -0
- package/bundles/nextjs-saas/supabase/migrations/001_initial_schema.sql +66 -0
- package/bundles/nextjs-saas/supabase/migrations/002_billing.sql +17 -0
- package/bundles/nextjs-saas/tsconfig.json +42 -0
- package/bundles/nextjs-saas/types/database.types.ts +76 -0
- package/bundles/nextjs-saas/vendor/m2ai-braces-3.0.3-m2ai.1.tar +0 -0
- package/bundles/nextjs-trpc/.agents/skills/lattice-feature-handoff/SKILL.md +31 -0
- package/bundles/nextjs-trpc/.agents/skills/lattice-release-manager/SKILL.md +29 -0
- package/bundles/nextjs-trpc/.agents/skills/lattice-verify/SKILL.md +27 -0
- package/bundles/nextjs-trpc/.claude/agents/lattice-feature-agent.md +10 -0
- package/bundles/nextjs-trpc/.claude/agents/lattice-release-manager.md +9 -0
- package/bundles/nextjs-trpc/.claude/hooks/README.md +9 -0
- package/bundles/nextjs-trpc/.claude/hooks/pre-commit-verify.mjs +10 -0
- package/bundles/nextjs-trpc/.claude/hooks/pre-tool-use.mjs +51 -0
- package/bundles/nextjs-trpc/.claude/rules/lattice-core.md +20 -0
- package/bundles/nextjs-trpc/.claude/settings.json +38 -0
- package/bundles/nextjs-trpc/.claude/skills/lattice-verify/SKILL.md +27 -0
- package/bundles/nextjs-trpc/.codex/agents/lattice-feature-agent.toml +9 -0
- package/bundles/nextjs-trpc/.codex/agents/lattice-release-manager.toml +9 -0
- package/bundles/nextjs-trpc/.cursor/mcp.json +34 -0
- package/bundles/nextjs-trpc/.cursor/rules/lattice-core.mdc +35 -0
- package/bundles/nextjs-trpc/.cursor/rules.md +95 -0
- package/bundles/nextjs-trpc/.env.example +21 -0
- package/bundles/nextjs-trpc/.github/PULL_REQUEST_TEMPLATE.md +42 -0
- package/bundles/nextjs-trpc/.github/agents/lattice-feature-agent.agent.md +7 -0
- package/bundles/nextjs-trpc/.github/agents/lattice-release-manager.agent.md +7 -0
- package/bundles/nextjs-trpc/.github/copilot-instructions.md +37 -0
- package/bundles/nextjs-trpc/.github/instructions/lattice-core.instructions.md +11 -0
- package/bundles/nextjs-trpc/.github/workflows/ci.yml +26 -0
- package/bundles/nextjs-trpc/.gitmessage +24 -0
- package/bundles/nextjs-trpc/.lattice/config.json +9 -0
- package/bundles/nextjs-trpc/.lattice/dependency-security.json +46 -0
- package/bundles/nextjs-trpc/.lattice/prompts/01-feature.md +36 -0
- package/bundles/nextjs-trpc/.lattice/prompts/02-bugfix.md +32 -0
- package/bundles/nextjs-trpc/.lattice/prompts/03-refactor.md +30 -0
- package/bundles/nextjs-trpc/.lattice/prompts/04-test.md +31 -0
- package/bundles/nextjs-trpc/.lattice/prompts/05-polish.md +38 -0
- package/bundles/nextjs-trpc/.lattice/prompts/06-security.md +32 -0
- package/bundles/nextjs-trpc/.lattice/release-workflow.json +55 -0
- package/bundles/nextjs-trpc/.lattice/schemas/feature-handoff.schema.json +264 -0
- package/bundles/nextjs-trpc/.lattice/templates/feature-handoff.json +52 -0
- package/bundles/nextjs-trpc/.mcp.json +35 -0
- package/bundles/nextjs-trpc/AGENTS.md +58 -0
- package/bundles/nextjs-trpc/CLAUDE.md +76 -0
- package/bundles/nextjs-trpc/PROJECT_GUIDE.md +187 -0
- package/bundles/nextjs-trpc/README.md +49 -0
- package/bundles/nextjs-trpc/app/api/trpc/[trpc]/route.ts +12 -0
- package/bundles/nextjs-trpc/app/global-error.tsx +17 -0
- package/bundles/nextjs-trpc/app/globals.css +55 -0
- package/bundles/nextjs-trpc/app/layout.tsx +19 -0
- package/bundles/nextjs-trpc/app/page.tsx +16 -0
- package/bundles/nextjs-trpc/app/providers.tsx +24 -0
- package/bundles/nextjs-trpc/components/ui/button.tsx +39 -0
- package/bundles/nextjs-trpc/components/ui/card.tsx +53 -0
- package/bundles/nextjs-trpc/components/ui/index.ts +4 -0
- package/bundles/nextjs-trpc/components/ui/input.tsx +23 -0
- package/bundles/nextjs-trpc/components/ui/spinner.tsx +22 -0
- package/bundles/nextjs-trpc/components/user-list.tsx +17 -0
- package/bundles/nextjs-trpc/docs/LATTICE_RELEASE_WORKFLOW.md +53 -0
- package/bundles/nextjs-trpc/docs/rules/codex.md +62 -0
- package/bundles/nextjs-trpc/eslint.config.mjs +16 -0
- package/bundles/nextjs-trpc/instrumentation-client.ts +20 -0
- package/bundles/nextjs-trpc/instrumentation.ts +12 -0
- package/bundles/nextjs-trpc/jest.config.mjs +16 -0
- package/bundles/nextjs-trpc/jest.setup.js +1 -0
- package/bundles/nextjs-trpc/lib/db.ts +17 -0
- package/bundles/nextjs-trpc/lib/trpc/react.tsx +7 -0
- package/bundles/nextjs-trpc/lib/utils.ts +6 -0
- package/bundles/nextjs-trpc/next-env.d.ts +5 -0
- package/bundles/nextjs-trpc/next.config.ts +15 -0
- package/bundles/nextjs-trpc/package.json +62 -0
- package/bundles/nextjs-trpc/postcss.config.mjs +7 -0
- package/bundles/nextjs-trpc/prisma/schema.prisma +41 -0
- package/bundles/nextjs-trpc/prisma.config.ts +10 -0
- package/bundles/nextjs-trpc/prompts/01-feature-implementation.md +9 -0
- package/bundles/nextjs-trpc/prompts/02-bug-fix.md +9 -0
- package/bundles/nextjs-trpc/prompts/03-safe-refactor.md +8 -0
- package/bundles/nextjs-trpc/prompts/04-test-first.md +8 -0
- package/bundles/nextjs-trpc/prompts/05-ui-polish.md +7 -0
- package/bundles/nextjs-trpc/prompts/06-security-review.md +7 -0
- package/bundles/nextjs-trpc/prompts/quality.md +269 -0
- package/bundles/nextjs-trpc/sentry.edge.config.ts +15 -0
- package/bundles/nextjs-trpc/sentry.server.config.ts +15 -0
- package/bundles/nextjs-trpc/server/routers/_app.test.ts +60 -0
- package/bundles/nextjs-trpc/server/routers/_app.ts +25 -0
- package/bundles/nextjs-trpc/server/trpc.ts +12 -0
- package/bundles/nextjs-trpc/tsconfig.json +42 -0
- package/bundles/nextjs-trpc/vendor/m2ai-braces-3.0.3-m2ai.1.tar +0 -0
- package/dist/agent-install-session.d.ts +17 -0
- package/dist/agent-install-session.d.ts.map +1 -0
- package/dist/agent-install-session.js +106 -0
- package/dist/agent-install-session.js.map +1 -0
- package/dist/agent-install-session.test.d.ts +2 -0
- package/dist/agent-install-session.test.d.ts.map +1 -0
- package/dist/agent-install-session.test.js +62 -0
- package/dist/agent-install-session.test.js.map +1 -0
- package/dist/agent-install.d.ts +41 -0
- package/dist/agent-install.d.ts.map +1 -0
- package/dist/agent-install.js +42 -0
- package/dist/agent-install.js.map +1 -0
- package/dist/agent-install.test.d.ts +2 -0
- package/dist/agent-install.test.d.ts.map +1 -0
- package/dist/agent-install.test.js +58 -0
- package/dist/agent-install.test.js.map +1 -0
- package/dist/apply-merge.test.d.ts +2 -0
- package/dist/apply-merge.test.d.ts.map +1 -0
- package/dist/apply-merge.test.js +123 -0
- package/dist/apply-merge.test.js.map +1 -0
- package/dist/bundle-download.d.ts +23 -0
- package/dist/bundle-download.d.ts.map +1 -0
- package/dist/bundle-download.js +180 -0
- package/dist/bundle-download.js.map +1 -0
- package/dist/bundle-download.test.d.ts +2 -0
- package/dist/bundle-download.test.d.ts.map +1 -0
- package/dist/bundle-download.test.js +200 -0
- package/dist/bundle-download.test.js.map +1 -0
- package/dist/bundle-rollback.test.d.ts +2 -0
- package/dist/bundle-rollback.test.d.ts.map +1 -0
- package/dist/bundle-rollback.test.js +127 -0
- package/dist/bundle-rollback.test.js.map +1 -0
- package/dist/bundle-scaffold.test.d.ts +2 -0
- package/dist/bundle-scaffold.test.d.ts.map +1 -0
- package/dist/bundle-scaffold.test.js +105 -0
- package/dist/bundle-scaffold.test.js.map +1 -0
- package/dist/commands.d.ts +132 -0
- package/dist/commands.d.ts.map +1 -0
- package/dist/commands.js +2012 -0
- package/dist/commands.js.map +1 -0
- package/dist/credential-store.d.ts +27 -0
- package/dist/credential-store.d.ts.map +1 -0
- package/dist/credential-store.js +48 -0
- package/dist/credential-store.js.map +1 -0
- package/dist/credential-store.test.d.ts +2 -0
- package/dist/credential-store.test.d.ts.map +1 -0
- package/dist/credential-store.test.js +80 -0
- package/dist/credential-store.test.js.map +1 -0
- package/dist/delivered-project-files.d.ts +31 -0
- package/dist/delivered-project-files.d.ts.map +1 -0
- package/dist/delivered-project-files.js +158 -0
- package/dist/delivered-project-files.js.map +1 -0
- package/dist/delivered-project-files.test.d.ts +2 -0
- package/dist/delivered-project-files.test.d.ts.map +1 -0
- package/dist/delivered-project-files.test.js +107 -0
- package/dist/delivered-project-files.test.js.map +1 -0
- package/dist/doctor-agents.test.d.ts +2 -0
- package/dist/doctor-agents.test.d.ts.map +1 -0
- package/dist/doctor-agents.test.js +65 -0
- package/dist/doctor-agents.test.js.map +1 -0
- package/dist/hermes-install.d.ts +102 -0
- package/dist/hermes-install.d.ts.map +1 -0
- package/dist/hermes-install.js +641 -0
- package/dist/hermes-install.js.map +1 -0
- package/dist/hermes-install.test.d.ts +2 -0
- package/dist/hermes-install.test.d.ts.map +1 -0
- package/dist/hermes-install.test.js +866 -0
- package/dist/hermes-install.test.js.map +1 -0
- package/dist/index.d.ts +115 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5311 -0
- package/dist/index.js.map +1 -0
- package/dist/openclaw-install.d.ts +67 -0
- package/dist/openclaw-install.d.ts.map +1 -0
- package/dist/openclaw-install.js +358 -0
- package/dist/openclaw-install.js.map +1 -0
- package/dist/openclaw-install.test.d.ts +2 -0
- package/dist/openclaw-install.test.d.ts.map +1 -0
- package/dist/openclaw-install.test.js +296 -0
- package/dist/openclaw-install.test.js.map +1 -0
- package/dist/password-recovery-bundle.test.d.ts +2 -0
- package/dist/password-recovery-bundle.test.d.ts.map +1 -0
- package/dist/password-recovery-bundle.test.js +132 -0
- package/dist/password-recovery-bundle.test.js.map +1 -0
- package/dist/project-bundle-env.d.ts +19 -0
- package/dist/project-bundle-env.d.ts.map +1 -0
- package/dist/project-bundle-env.js +111 -0
- package/dist/project-bundle-env.js.map +1 -0
- package/dist/project-bundle-env.test.d.ts +2 -0
- package/dist/project-bundle-env.test.d.ts.map +1 -0
- package/dist/project-bundle-env.test.js +93 -0
- package/dist/project-bundle-env.test.js.map +1 -0
- package/dist/project-path-confinement.test.d.ts +2 -0
- package/dist/project-path-confinement.test.d.ts.map +1 -0
- package/dist/project-path-confinement.test.js +222 -0
- package/dist/project-path-confinement.test.js.map +1 -0
- package/dist/security/api.d.ts +18 -0
- package/dist/security/api.d.ts.map +1 -0
- package/dist/security/api.js +238 -0
- package/dist/security/api.js.map +1 -0
- package/dist/security/api.test.d.ts +2 -0
- package/dist/security/api.test.d.ts.map +1 -0
- package/dist/security/api.test.js +220 -0
- package/dist/security/api.test.js.map +1 -0
- package/dist/security/artifact.d.ts +10 -0
- package/dist/security/artifact.d.ts.map +1 -0
- package/dist/security/artifact.js +283 -0
- package/dist/security/artifact.js.map +1 -0
- package/dist/security/artifact.test.d.ts +2 -0
- package/dist/security/artifact.test.d.ts.map +1 -0
- package/dist/security/artifact.test.js +229 -0
- package/dist/security/artifact.test.js.map +1 -0
- package/dist/security/commands.d.ts +42 -0
- package/dist/security/commands.d.ts.map +1 -0
- package/dist/security/commands.js +825 -0
- package/dist/security/commands.js.map +1 -0
- package/dist/security/commands.test.d.ts +2 -0
- package/dist/security/commands.test.d.ts.map +1 -0
- package/dist/security/commands.test.js +1051 -0
- package/dist/security/commands.test.js.map +1 -0
- package/dist/security/connection.d.ts +19 -0
- package/dist/security/connection.d.ts.map +1 -0
- package/dist/security/connection.js +145 -0
- package/dist/security/connection.js.map +1 -0
- package/dist/security/connection.test.d.ts +2 -0
- package/dist/security/connection.test.d.ts.map +1 -0
- package/dist/security/connection.test.js +62 -0
- package/dist/security/connection.test.js.map +1 -0
- package/dist/security/index-routing.test.d.ts +2 -0
- package/dist/security/index-routing.test.d.ts.map +1 -0
- package/dist/security/index-routing.test.js +169 -0
- package/dist/security/index-routing.test.js.map +1 -0
- package/dist/security/journal.d.ts +26 -0
- package/dist/security/journal.d.ts.map +1 -0
- package/dist/security/journal.js +441 -0
- package/dist/security/journal.js.map +1 -0
- package/dist/security/journal.test.d.ts +2 -0
- package/dist/security/journal.test.d.ts.map +1 -0
- package/dist/security/journal.test.js +226 -0
- package/dist/security/journal.test.js.map +1 -0
- package/dist/security/package-verifier.d.ts +15 -0
- package/dist/security/package-verifier.d.ts.map +1 -0
- package/dist/security/package-verifier.js +65 -0
- package/dist/security/package-verifier.js.map +1 -0
- package/dist/security/package-verifier.test.d.ts +2 -0
- package/dist/security/package-verifier.test.d.ts.map +1 -0
- package/dist/security/package-verifier.test.js +57 -0
- package/dist/security/package-verifier.test.js.map +1 -0
- package/dist/security/runtime.d.ts +43 -0
- package/dist/security/runtime.d.ts.map +1 -0
- package/dist/security/runtime.js +81 -0
- package/dist/security/runtime.js.map +1 -0
- package/dist/security/runtime.test.d.ts +2 -0
- package/dist/security/runtime.test.d.ts.map +1 -0
- package/dist/security/runtime.test.js +88 -0
- package/dist/security/runtime.test.js.map +1 -0
- package/dist/security/types.d.ts +169 -0
- package/dist/security/types.d.ts.map +1 -0
- package/dist/security/types.js +3 -0
- package/dist/security/types.js.map +1 -0
- package/dist/security-runtime/LICENSE +202 -0
- package/dist/security-runtime/NOTICE +16 -0
- package/dist/security-runtime/artifact-manifest.json +960 -0
- package/dist/security-runtime/bin/vsg.mjs +5 -0
- package/dist/security-runtime/lattice-catalog.json +176585 -0
- package/dist/security-runtime/lattice-runtime.mjs +90 -0
- package/dist/security-runtime/licensing/candidates/apache-source-license-evidence.json +478 -0
- package/dist/security-runtime/licensing/candidates/betterleaks-generic-api-key.json +76 -0
- package/dist/security-runtime/licensing/candidates/betterleaks-jwt.json +74 -0
- package/dist/security-runtime/licensing/candidates/blackberry-additional-source-declaration-evidence.json +276 -0
- package/dist/security-runtime/licensing/candidates/blackberry-source-declaration-evidence.json +369 -0
- package/dist/security-runtime/licensing/candidates/cado-source-declaration-evidence.json +283 -0
- package/dist/security-runtime/licensing/candidates/commercial-rule-candidate.json +280 -0
- package/dist/security-runtime/licensing/candidates/commercial-runtime-release.json +389 -0
- package/dist/security-runtime/licensing/candidates/data-feed-evidence.json +259 -0
- package/dist/security-runtime/licensing/candidates/gitlab-sast-rule-identities.json +178 -0
- package/dist/security-runtime/licensing/candidates/gitlab-sast-source-evidence.json +1824 -0
- package/dist/security-runtime/licensing/candidates/gitlab-sast-source-notice-bundle.json +45 -0
- package/dist/security-runtime/licensing/candidates/malpedia-source-license-evidence.json +41 -0
- package/dist/security-runtime/licensing/candidates/rule-license-evidence.json +376 -0
- package/dist/security-runtime/licensing/candidates/runner-image-composition.json +1500 -0
- package/dist/security-runtime/licensing/candidates/selected-runtime-coverage.json +91 -0
- package/dist/security-runtime/licensing/candidates/yara-forge-20260927.json +58502 -0
- package/dist/security-runtime/licensing/commercial-components.json +379 -0
- package/dist/security-runtime/licensing/notices/betterleaks-1.9.0-MIT.txt +21 -0
- package/dist/security-runtime/licensing/notices/candidate-sources/sha256/28a9529c7d0bb4dc51f4bf5c116a3d16ef247a052f7591466768ddf563fd1cf5.txt +428 -0
- package/dist/security-runtime/licensing/notices/candidate-sources/sha256/33acf42afdd03163d75fe856cb431e70710e0b5deede3362e6d1c4697cfe1c6a.txt +28 -0
- package/dist/security-runtime/licensing/notices/candidate-sources/sha256/3972dc9744f6499f0f9b2dbf76696f2ae7ad8af9b23dde66d6af86c9dfb36986.txt +674 -0
- package/dist/security-runtime/licensing/notices/candidate-sources/sha256/4fecb8fcaf80fd9a6315bca5225ee43377015b46a0459c2925495be885cab19a.txt +21 -0
- package/dist/security-runtime/licensing/notices/candidate-sources/sha256/811515f8723aa4007de2fbb75a364127fdec51cda534b87a7ea8f2fef2f96dd7.txt +24 -0
- package/dist/security-runtime/licensing/notices/candidate-sources/sha256/814442c3987a2c0411171ad8ad43118e8c08f85c9c5d1dcdecc9787c7ca8689b.txt +664 -0
- package/dist/security-runtime/licensing/notices/candidate-sources/sha256/8a959b2413d0c83ca1b3ce9153076c649abf2e4bbfebbb493fb24c2074a1eb8a.txt +38 -0
- package/dist/security-runtime/licensing/notices/candidate-sources/sha256/995182e185856186fbbe49f150409ae026aa4cda7e94f83c6ed737cbb77fa9c7.txt +23 -0
- package/dist/security-runtime/licensing/notices/candidate-sources/sha256/9b8e1305e46d1dd4011b6ed933c9f6223e08c9c4625001c5fd75a34fa930f616.txt +202 -0
- package/dist/security-runtime/licensing/notices/candidate-sources/sha256/a01f1a28424bfe7f49a23d339a01847cfa9ace3864d5e7295051772a4bae2271.txt +38 -0
- package/dist/security-runtime/licensing/notices/candidate-sources/sha256/a5681bf9b05db14d86776930017c647ad9e6e56ff6bbcfdf21e5848288dfaf1b.txt +165 -0
- package/dist/security-runtime/licensing/notices/candidate-sources/sha256/a5b8bd9ae96c630bbf229d61c5c5def20274e00be39abfd2fab4d7879ceab462.txt +24 -0
- package/dist/security-runtime/licensing/notices/candidate-sources/sha256/ada32b3747ce108d5e8bab7918af94abbd03f2fe2a46304f74c6333bbfd914ed.txt +8 -0
- package/dist/security-runtime/licensing/notices/candidate-sources/sha256/c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4.txt +201 -0
- package/dist/security-runtime/licensing/notices/candidate-sources/sha256/c738ae413cf561f174e34f6961f8ca458aae2369a73640dda6234c629b98bcc4.txt +2732 -0
- package/dist/security-runtime/licensing/notices/candidate-sources/sha256/ce41c9a2c986277f7f9ab146a2195c1888a5d8da062e22d7c9c88666bb7c38cd.txt +17 -0
- package/dist/security-runtime/licensing/notices/candidate-sources/sha256/d5f4c36a0528e01cfdd9e4fc60879201d3af49b41c520200643d321fe53da5f9.txt +17 -0
- package/dist/security-runtime/licensing/notices/candidate-sources/sha256/e08c368ccd455f85c7fb9e04830e730f26e9dbb5c0f77bc88e09a5b0cb37df5b.txt +38 -0
- package/dist/security-runtime/licensing/notices/candidate-sources/sha256/e9efb2f7daf11bb6379c06c16b870dddcecc4a10f8704bb8aad807529c8b3c97.txt +8 -0
- package/dist/security-runtime/licensing/notices/gitleaks-generic-origin-782f3104-MIT.txt +21 -0
- package/dist/security-runtime/package.json +17 -0
- package/dist/security-runtime/playbook/README.md +76 -0
- package/dist/security-runtime/playbook/access-control.md +56 -0
- package/dist/security-runtime/playbook/ai-features.md +53 -0
- package/dist/security-runtime/playbook/desktop-python.md +59 -0
- package/dist/security-runtime/playbook/input-handling.md +59 -0
- package/dist/security-runtime/playbook/mobile-expo.md +59 -0
- package/dist/security-runtime/playbook/payments.md +53 -0
- package/dist/security-runtime/playbook/privacy-account-recovery.md +59 -0
- package/dist/security-runtime/playbook/secrets-config.md +47 -0
- package/dist/security-runtime/playbook/supabase.md +48 -0
- package/dist/security-runtime/playbook/supply-chain.md +62 -0
- package/dist/security-runtime/playbook/webhooks-integrations.md +52 -0
- package/dist/security-runtime/rules/vsg-ai-key-in-client.yaml +41 -0
- package/dist/security-runtime/rules/vsg-ai-output-raw-html.yaml +35 -0
- package/dist/security-runtime/rules/vsg-angular-sanitizer-bypass.yaml +23 -0
- package/dist/security-runtime/rules/vsg-expo-token-in-asyncstorage.yaml +22 -0
- package/dist/security-runtime/rules/vsg-flask-public-bind.yaml +32 -0
- package/dist/security-runtime/rules/vsg-nextjs-action-write-no-auth.yaml +144 -0
- package/dist/security-runtime/rules/vsg-nextjs-inline-action-write-no-auth.yaml +161 -0
- package/dist/security-runtime/rules/vsg-nextjs-route-write-no-auth.yaml +193 -0
- package/dist/security-runtime/rules/vsg-nosql-where-injection.yaml +36 -0
- package/dist/security-runtime/rules/vsg-python-pickle-load.yaml +26 -0
- package/dist/security-runtime/rules/vsg-python-requests-verify-false.yaml +34 -0
- package/dist/security-runtime/rules/vsg-python-subprocess-shell.yaml +23 -0
- package/dist/security-runtime/rules/vsg-stripe-client-price.yaml +51 -0
- package/dist/security-runtime/rules/vsg-stripe-webhook-no-signature.yaml +31 -0
- package/dist/security-runtime/rules/vsg-stripe-webhook-pages-no-signature.yaml +51 -0
- package/dist/security-runtime/rules/vsg-supabase-service-role-in-client.yaml +27 -0
- package/dist/security-runtime/rules/vsg-supabase-service-role-public-env.yaml +24 -0
- package/dist/security-runtime/rules/vsg-xml-external-entities.yaml +19 -0
- package/dist/security-runtime/src/agent/brief.mjs +95 -0
- package/dist/security-runtime/src/agent/discover.mjs +108 -0
- package/dist/security-runtime/src/agent/exec.mjs +64 -0
- package/dist/security-runtime/src/agent/ingest.mjs +213 -0
- package/dist/security-runtime/src/agent/report.mjs +94 -0
- package/dist/security-runtime/src/agent/schema.mjs +62 -0
- package/dist/security-runtime/src/agent/tokenize.mjs +38 -0
- package/dist/security-runtime/src/checks/README.md +8 -0
- package/dist/security-runtime/src/checks/_lib/gitfiles.mjs +35 -0
- package/dist/security-runtime/src/checks/_lib/lockfiles.mjs +135 -0
- package/dist/security-runtime/src/checks/_lib/osv.mjs +6 -0
- package/dist/security-runtime/src/checks/_lib/secrets.mjs +381 -0
- package/dist/security-runtime/src/checks/_lib/targets.mjs +79 -0
- package/dist/security-runtime/src/checks/agent-review/index.mjs +52 -0
- package/dist/security-runtime/src/checks/agent-surface/config.mjs +223 -0
- package/dist/security-runtime/src/checks/agent-surface/index.mjs +113 -0
- package/dist/security-runtime/src/checks/agent-surface/instructions.mjs +87 -0
- package/dist/security-runtime/src/checks/agent-surface/patterns.mjs +68 -0
- package/dist/security-runtime/src/checks/agent-surface/unicode.mjs +88 -0
- package/dist/security-runtime/src/checks/code/auth-helpers.mjs +659 -0
- package/dist/security-runtime/src/checks/code/index.mjs +617 -0
- package/dist/security-runtime/src/checks/code/opengrep-container.mjs +85 -0
- package/dist/security-runtime/src/checks/code/opengrep-runner.mjs +86 -0
- package/dist/security-runtime/src/checks/code/selected-opengrep-runner.mjs +112 -0
- package/dist/security-runtime/src/checks/dep-change/guarddog.mjs +142 -0
- package/dist/security-runtime/src/checks/dep-change/index.mjs +316 -0
- package/dist/security-runtime/src/checks/dep-change/registries.mjs +199 -0
- package/dist/security-runtime/src/checks/deps-vuln/index.mjs +305 -0
- package/dist/security-runtime/src/checks/desktop-config/index.mjs +112 -0
- package/dist/security-runtime/src/checks/dns-mail/index.mjs +71 -0
- package/dist/security-runtime/src/checks/iac/index.mjs +83 -0
- package/dist/security-runtime/src/checks/install-posture/index.mjs +123 -0
- package/dist/security-runtime/src/checks/licenses/index.mjs +143 -0
- package/dist/security-runtime/src/checks/live-basic/index.mjs +77 -0
- package/dist/security-runtime/src/checks/live-js-secrets/index.mjs +100 -0
- package/dist/security-runtime/src/checks/malware/clamav.mjs +17 -0
- package/dist/security-runtime/src/checks/malware/defender.mjs +43 -0
- package/dist/security-runtime/src/checks/malware/index.mjs +186 -0
- package/dist/security-runtime/src/checks/malware/targets.mjs +147 -0
- package/dist/security-runtime/src/checks/malware/yara-runner.mjs +201 -0
- package/dist/security-runtime/src/checks/malware/yara.mjs +124 -0
- package/dist/security-runtime/src/checks/mobile-config/index.mjs +173 -0
- package/dist/security-runtime/src/checks/mobile-config/mobsf.mjs +105 -0
- package/dist/security-runtime/src/checks/posture/index.mjs +133 -0
- package/dist/security-runtime/src/checks/project-scripts/index.mjs +187 -0
- package/dist/security-runtime/src/checks/sbom/index.mjs +98 -0
- package/dist/security-runtime/src/checks/secrets-build/index.mjs +63 -0
- package/dist/security-runtime/src/checks/secrets-history/index.mjs +112 -0
- package/dist/security-runtime/src/checks/secrets-tree/env.mjs +120 -0
- package/dist/security-runtime/src/checks/secrets-tree/index.mjs +73 -0
- package/dist/security-runtime/src/checks/supabase-static/index.mjs +240 -0
- package/dist/security-runtime/src/checks/supabase-static/sql.mjs +557 -0
- package/dist/security-runtime/src/checks/workflows/index.mjs +93 -0
- package/dist/security-runtime/src/cli/deep.mjs +13 -0
- package/dist/security-runtime/src/cli/doctor.mjs +82 -0
- package/dist/security-runtime/src/cli/index.mjs +60 -0
- package/dist/security-runtime/src/cli/live-common.mjs +27 -0
- package/dist/security-runtime/src/cli/parse.mjs +56 -0
- package/dist/security-runtime/src/cli/portfolio.mjs +34 -0
- package/dist/security-runtime/src/cli/release.mjs +28 -0
- package/dist/security-runtime/src/cli/report.mjs +18 -0
- package/dist/security-runtime/src/cli/run-common.mjs +54 -0
- package/dist/security-runtime/src/cli/scan.mjs +12 -0
- package/dist/security-runtime/src/cli/setup.mjs +59 -0
- package/dist/security-runtime/src/cli/url.mjs +38 -0
- package/dist/security-runtime/src/core/accept.mjs +141 -0
- package/dist/security-runtime/src/core/archive.mjs +114 -0
- package/dist/security-runtime/src/core/base-ref.mjs +43 -0
- package/dist/security-runtime/src/core/checks.mjs +39 -0
- package/dist/security-runtime/src/core/detect.mjs +90 -0
- package/dist/security-runtime/src/core/errors.mjs +5 -0
- package/dist/security-runtime/src/core/fetch.mjs +139 -0
- package/dist/security-runtime/src/core/findings.mjs +177 -0
- package/dist/security-runtime/src/core/gate.mjs +131 -0
- package/dist/security-runtime/src/core/installer.mjs +255 -0
- package/dist/security-runtime/src/core/lock.mjs +38 -0
- package/dist/security-runtime/src/core/nested.mjs +107 -0
- package/dist/security-runtime/src/core/paths.mjs +20 -0
- package/dist/security-runtime/src/core/pipeline.mjs +196 -0
- package/dist/security-runtime/src/core/registry.mjs +81 -0
- package/dist/security-runtime/src/core/report.mjs +128 -0
- package/dist/security-runtime/src/core/runner.mjs +86 -0
- package/dist/security-runtime/src/core/sarif.mjs +141 -0
- package/dist/security-runtime/src/lattice/artifact.mjs +1201 -0
- package/dist/security-runtime/src/lattice/execution.mjs +45 -0
- package/dist/security-runtime/src/lattice/export.mjs +215 -0
- package/dist/security-runtime/src/lattice/provenance.mjs +70 -0
- package/dist/security-runtime/src/lattice/runtime.mjs +158 -0
- package/dist/security-runtime/src/lattice/selected-runtime.mjs +189 -0
- package/dist/security-runtime/src/lattice/source-acquirer.mjs +51 -0
- package/dist/security-runtime/src/lattice/source-fetcher.mjs +88 -0
- package/dist/security-runtime/src/lattice/transport.mjs +232 -0
- package/dist/security-runtime/src/live/analyze.mjs +101 -0
- package/dist/security-runtime/src/live/exposure.mjs +79 -0
- package/dist/security-runtime/src/live/secrets.mjs +31 -0
- package/dist/security-runtime/src/live/session.mjs +98 -0
- package/dist/security-runtime/src/live/targets.mjs +81 -0
- package/dist/security-runtime/src/portfolio/index.mjs +116 -0
- package/dist/security-runtime/tools/registry/betterleaks.json +29 -0
- package/dist/security-runtime/tools/registry/guarddog.json +9 -0
- package/dist/security-runtime/tools/registry/mobsf.json +10 -0
- package/dist/security-runtime/tools/registry/opengrep.json +28 -0
- package/dist/security-runtime/tools/registry/osv-scanner.json +14 -0
- package/dist/security-runtime/tools/registry/semgrep-rules.json +21 -0
- package/dist/security-runtime/tools/registry/trivy.json +30 -0
- package/dist/security-runtime/tools/registry/yara-forge-exclusions.json +14 -0
- package/dist/security-runtime/tools/registry/yara-forge.json +22 -0
- package/dist/security-runtime/tools/registry/yara-runner.json +10 -0
- package/dist/security-runtime/tools/registry/yara-x.json +24 -0
- package/dist/security-runtime/tools/registry/zizmor.json +30 -0
- package/dist/spinner.d.ts +16 -0
- package/dist/spinner.d.ts.map +1 -0
- package/dist/spinner.js +72 -0
- package/dist/spinner.js.map +1 -0
- package/dist/verify.test.d.ts +2 -0
- package/dist/verify.test.d.ts.map +1 -0
- package/dist/verify.test.js +98 -0
- package/dist/verify.test.js.map +1 -0
- package/package.json +73 -4
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const strict_1 = __importDefault(require("node:assert/strict"));
|
|
7
|
+
const node_test_1 = __importDefault(require("node:test"));
|
|
8
|
+
const project_bundle_env_js_1 = require("./project-bundle-env.js");
|
|
9
|
+
(0, node_test_1.default)('normalizeProjectBundleEnvVariables supports legacy and structured shapes', () => {
|
|
10
|
+
strict_1.default.deepEqual((0, project_bundle_env_js_1.normalizeProjectBundleEnvVariables)([
|
|
11
|
+
'NEXT_PUBLIC_SUPABASE_URL',
|
|
12
|
+
{
|
|
13
|
+
key: 'SUPABASE_SERVICE_ROLE_KEY',
|
|
14
|
+
description: 'Server-only key',
|
|
15
|
+
defaultValue: 'your-service-role-key',
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
name: 'DATABASE_URL',
|
|
19
|
+
group: 'Database',
|
|
20
|
+
example: 'postgresql://postgres:postgres@localhost:5432/app',
|
|
21
|
+
},
|
|
22
|
+
]), [
|
|
23
|
+
{ name: 'NEXT_PUBLIC_SUPABASE_URL' },
|
|
24
|
+
{
|
|
25
|
+
name: 'SUPABASE_SERVICE_ROLE_KEY',
|
|
26
|
+
comment: 'Server-only key',
|
|
27
|
+
example: 'your-service-role-key',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
name: 'DATABASE_URL',
|
|
31
|
+
group: 'Database',
|
|
32
|
+
example: 'postgresql://postgres:postgres@localhost:5432/app',
|
|
33
|
+
},
|
|
34
|
+
]);
|
|
35
|
+
});
|
|
36
|
+
(0, node_test_1.default)('renderEnvExampleFile groups and annotates variables', () => {
|
|
37
|
+
const specs = [
|
|
38
|
+
{
|
|
39
|
+
name: 'NEXT_PUBLIC_SUPABASE_URL',
|
|
40
|
+
group: 'Supabase',
|
|
41
|
+
comment: 'Project URL from Supabase settings.',
|
|
42
|
+
example: 'https://your-project.supabase.co',
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: 'SUPABASE_SERVICE_ROLE_KEY',
|
|
46
|
+
group: 'Supabase',
|
|
47
|
+
comment: 'Server-only key.',
|
|
48
|
+
example: 'your-service-role-key',
|
|
49
|
+
},
|
|
50
|
+
];
|
|
51
|
+
strict_1.default.equal((0, project_bundle_env_js_1.renderEnvExampleFile)(specs), [
|
|
52
|
+
'# Environment variables',
|
|
53
|
+
'',
|
|
54
|
+
'# Supabase',
|
|
55
|
+
'# Project URL from Supabase settings.',
|
|
56
|
+
'NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co',
|
|
57
|
+
'',
|
|
58
|
+
'# Server-only key.',
|
|
59
|
+
'SUPABASE_SERVICE_ROLE_KEY=your-service-role-key',
|
|
60
|
+
'',
|
|
61
|
+
].join('\n'));
|
|
62
|
+
});
|
|
63
|
+
(0, node_test_1.default)('renderEnvLocalFile keeps examples in comments and blanks the values', () => {
|
|
64
|
+
const specs = [
|
|
65
|
+
{
|
|
66
|
+
name: 'NEXT_PUBLIC_SUPABASE_URL',
|
|
67
|
+
group: 'Supabase',
|
|
68
|
+
comment: 'Project URL from Supabase settings.',
|
|
69
|
+
example: 'https://your-project.supabase.co',
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
name: 'SUPABASE_SERVICE_ROLE_KEY',
|
|
73
|
+
group: 'Supabase',
|
|
74
|
+
comment: 'Server-only key.',
|
|
75
|
+
example: 'your-service-role-key',
|
|
76
|
+
},
|
|
77
|
+
];
|
|
78
|
+
strict_1.default.equal((0, project_bundle_env_js_1.renderEnvLocalFile)(specs), [
|
|
79
|
+
'# Copy from .env.example and fill in your values',
|
|
80
|
+
'# DO NOT commit this file to git',
|
|
81
|
+
'',
|
|
82
|
+
'# Supabase',
|
|
83
|
+
'# Project URL from Supabase settings.',
|
|
84
|
+
'# Example: https://your-project.supabase.co',
|
|
85
|
+
'NEXT_PUBLIC_SUPABASE_URL=',
|
|
86
|
+
'',
|
|
87
|
+
'# Server-only key.',
|
|
88
|
+
'# Example: your-service-role-key',
|
|
89
|
+
'SUPABASE_SERVICE_ROLE_KEY=',
|
|
90
|
+
'',
|
|
91
|
+
].join('\n'));
|
|
92
|
+
});
|
|
93
|
+
//# sourceMappingURL=project-bundle-env.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-bundle-env.test.js","sourceRoot":"","sources":["../src/project-bundle-env.test.ts"],"names":[],"mappings":";;;;;AAAA,gEAAwC;AACxC,0DAA6B;AAC7B,mEAKiC;AAEjC,IAAA,mBAAI,EAAC,0EAA0E,EAAE,GAAG,EAAE;IACpF,gBAAM,CAAC,SAAS,CACd,IAAA,0DAAkC,EAAC;QACjC,0BAA0B;QAC1B;YACE,GAAG,EAAE,2BAA2B;YAChC,WAAW,EAAE,iBAAiB;YAC9B,YAAY,EAAE,uBAAuB;SACtC;QACD;YACE,IAAI,EAAE,cAAc;YACpB,KAAK,EAAE,UAAU;YACjB,OAAO,EAAE,mDAAmD;SAC7D;KACF,CAAC,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kDAAkD;QAClD,kCAAkC;QAClC,EAAE;QACF,YAAY;QACZ,uCAAuC;QACvC,6CAA6C;QAC7C,2BAA2B;QAC3B,EAAE;QACF,oBAAoB;QACpB,kCAAkC;QAClC,4BAA4B;QAC5B,EAAE;KACH,CAAC,IAAI,CAAC,IAAI,CAAC,CACb,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-path-confinement.test.d.ts","sourceRoot":"","sources":["../src/project-path-confinement.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const strict_1 = __importDefault(require("node:assert/strict"));
|
|
7
|
+
const node_crypto_1 = require("node:crypto");
|
|
8
|
+
const node_fs_1 = require("node:fs");
|
|
9
|
+
const node_os_1 = require("node:os");
|
|
10
|
+
const node_path_1 = require("node:path");
|
|
11
|
+
const node_test_1 = __importDefault(require("node:test"));
|
|
12
|
+
const index_js_1 = require("./index.js");
|
|
13
|
+
const quietLog = console.log;
|
|
14
|
+
async function fixture(run) {
|
|
15
|
+
const root = await node_fs_1.promises.mkdtemp((0, node_path_1.join)((0, node_os_1.tmpdir)(), 'lattice-path-confinement-'));
|
|
16
|
+
const pack = (0, node_path_1.join)(root, 'pack');
|
|
17
|
+
const target = (0, node_path_1.join)(root, 'target');
|
|
18
|
+
const outside = (0, node_path_1.join)(root, 'outside');
|
|
19
|
+
await Promise.all([node_fs_1.promises.mkdir(pack), node_fs_1.promises.mkdir(target), node_fs_1.promises.mkdir(outside)]);
|
|
20
|
+
console.log = () => { };
|
|
21
|
+
try {
|
|
22
|
+
await run({ root, pack, target, outside });
|
|
23
|
+
}
|
|
24
|
+
finally {
|
|
25
|
+
console.log = quietLog;
|
|
26
|
+
await node_fs_1.promises.rm(root, { recursive: true, force: true });
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
function sha256(content) {
|
|
30
|
+
return (0, node_crypto_1.createHash)('sha256').update(content).digest('hex');
|
|
31
|
+
}
|
|
32
|
+
async function writePack(pack, files) {
|
|
33
|
+
for (const [filePath, content] of Object.entries(files)) {
|
|
34
|
+
const absolutePath = (0, node_path_1.join)(pack, ...filePath.split('/'));
|
|
35
|
+
await node_fs_1.promises.mkdir((0, node_path_1.dirname)(absolutePath), { recursive: true });
|
|
36
|
+
await node_fs_1.promises.writeFile(absolutePath, content);
|
|
37
|
+
}
|
|
38
|
+
const manifest = {
|
|
39
|
+
generatorVersion: 'test',
|
|
40
|
+
policyVersion: 'test',
|
|
41
|
+
configHash: 'test',
|
|
42
|
+
files: Object.entries(files).map(([path, content]) => ({ path, sha256: sha256(content) })),
|
|
43
|
+
};
|
|
44
|
+
await node_fs_1.promises.mkdir((0, node_path_1.join)(pack, '.lattice'), { recursive: true });
|
|
45
|
+
await node_fs_1.promises.writeFile((0, node_path_1.join)(pack, '.lattice', 'manifest.json'), JSON.stringify(manifest));
|
|
46
|
+
}
|
|
47
|
+
(0, node_test_1.default)('apply rejects a later junction path before an earlier file or outside sentinel is written', async () => {
|
|
48
|
+
await fixture(async ({ pack, target, outside }) => {
|
|
49
|
+
await writePack(pack, {
|
|
50
|
+
'safe.txt': Buffer.from('must not be written'),
|
|
51
|
+
'.github/workflows/ci.yml': Buffer.from('attacker content'),
|
|
52
|
+
});
|
|
53
|
+
const sentinel = (0, node_path_1.join)(outside, 'workflows', 'ci.yml');
|
|
54
|
+
await node_fs_1.promises.mkdir((0, node_path_1.dirname)(sentinel), { recursive: true });
|
|
55
|
+
await node_fs_1.promises.writeFile(sentinel, 'outside sentinel\n');
|
|
56
|
+
await node_fs_1.promises.symlink(outside, (0, node_path_1.join)(target, '.github'), process.platform === 'win32' ? 'junction' : 'dir');
|
|
57
|
+
await strict_1.default.rejects((0, index_js_1.apply)(pack, target), /symbolic link or junction/);
|
|
58
|
+
await strict_1.default.rejects(node_fs_1.promises.access((0, node_path_1.join)(target, 'safe.txt')), { code: 'ENOENT' });
|
|
59
|
+
strict_1.default.equal(await node_fs_1.promises.readFile(sentinel, 'utf8'), 'outside sentinel\n');
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
(0, node_test_1.default)('apply preview validates a missing target without creating it', async () => {
|
|
63
|
+
await fixture(async ({ root, pack }) => {
|
|
64
|
+
const target = (0, node_path_1.join)(root, 'missing-target');
|
|
65
|
+
await writePack(pack, { 'binary.dat': Buffer.from([0, 255, 1, 254]) });
|
|
66
|
+
await (0, index_js_1.apply)(pack, target, { preview: true });
|
|
67
|
+
await strict_1.default.rejects(node_fs_1.promises.access(target), { code: 'ENOENT' });
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
(0, node_test_1.default)('apply preserves binary bytes in the normal missing-file journey', async () => {
|
|
71
|
+
await fixture(async ({ pack, target }) => {
|
|
72
|
+
const bytes = Buffer.from([0, 255, 1, 254, 13, 10, 0]);
|
|
73
|
+
await writePack(pack, { 'assets/binary.dat': bytes });
|
|
74
|
+
await (0, index_js_1.apply)(pack, target);
|
|
75
|
+
strict_1.default.deepEqual(await node_fs_1.promises.readFile((0, node_path_1.join)(target, 'assets', 'binary.dat')), bytes);
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
(0, node_test_1.default)('apply preserves a source pack in a sibling with the same target-name prefix', async () => {
|
|
79
|
+
await fixture(async ({ root }) => {
|
|
80
|
+
const target = (0, node_path_1.join)(root, 'app');
|
|
81
|
+
const pack = (0, node_path_1.join)(root, 'application', 'lattice-pack');
|
|
82
|
+
await node_fs_1.promises.mkdir(pack, { recursive: true });
|
|
83
|
+
await writePack(pack, { 'safe.txt': Buffer.from('normal content') });
|
|
84
|
+
await (0, index_js_1.apply)(pack, target);
|
|
85
|
+
strict_1.default.equal(await node_fs_1.promises.readFile((0, node_path_1.join)(target, 'safe.txt'), 'utf8'), 'normal content');
|
|
86
|
+
strict_1.default.equal(await node_fs_1.promises.readFile((0, node_path_1.join)(pack, 'safe.txt'), 'utf8'), 'normal content');
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
(0, node_test_1.default)('apply rejects manifest traversal before reading a declared source', async () => {
|
|
90
|
+
await fixture(async ({ root, pack, target }) => {
|
|
91
|
+
await node_fs_1.promises.mkdir((0, node_path_1.join)(pack, '.lattice'), { recursive: true });
|
|
92
|
+
await node_fs_1.promises.writeFile((0, node_path_1.join)(root, 'secret.txt'), 'secret');
|
|
93
|
+
await node_fs_1.promises.writeFile((0, node_path_1.join)(pack, '.lattice', 'manifest.json'), JSON.stringify({
|
|
94
|
+
files: [{ path: '../secret.txt', sha256: 'irrelevant' }],
|
|
95
|
+
}));
|
|
96
|
+
await strict_1.default.rejects((0, index_js_1.apply)(pack, target), /unsafe segment|escapes/);
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
(0, node_test_1.default)('drift refuses a manifest-declared read through a junction', async () => {
|
|
100
|
+
await fixture(async ({ target, outside }) => {
|
|
101
|
+
await node_fs_1.promises.mkdir((0, node_path_1.join)(target, '.lattice'), { recursive: true });
|
|
102
|
+
await node_fs_1.promises.writeFile((0, node_path_1.join)(outside, 'secret.txt'), 'secret');
|
|
103
|
+
await node_fs_1.promises.symlink(outside, (0, node_path_1.join)(target, 'linked'), process.platform === 'win32' ? 'junction' : 'dir');
|
|
104
|
+
await node_fs_1.promises.writeFile((0, node_path_1.join)(target, '.lattice', 'manifest.json'), JSON.stringify({
|
|
105
|
+
files: [{ path: 'linked/secret.txt', sha256: sha256(Buffer.from('secret')) }],
|
|
106
|
+
}));
|
|
107
|
+
await strict_1.default.rejects((0, index_js_1.detectDrift)(target), /symbolic link or junction/);
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
(0, node_test_1.default)('bundle preflight rejects a junction before config or outside writes', async () => {
|
|
111
|
+
await fixture(async ({ target, outside }) => {
|
|
112
|
+
await node_fs_1.promises.symlink(outside, (0, node_path_1.join)(target, '.github'), process.platform === 'win32' ? 'junction' : 'dir');
|
|
113
|
+
const previousCwd = process.cwd();
|
|
114
|
+
process.chdir(target);
|
|
115
|
+
try {
|
|
116
|
+
await strict_1.default.rejects((0, index_js_1.applyBundle)({
|
|
117
|
+
version: 'test',
|
|
118
|
+
name: 'test',
|
|
119
|
+
config: { projectType: 'nextjs', strictnessPreset: 'startup' },
|
|
120
|
+
files: { '.github/workflows/ci.yml': 'attacker content' },
|
|
121
|
+
}), /symbolic link or junction/);
|
|
122
|
+
}
|
|
123
|
+
finally {
|
|
124
|
+
process.chdir(previousCwd);
|
|
125
|
+
}
|
|
126
|
+
await strict_1.default.rejects(node_fs_1.promises.access((0, node_path_1.join)(target, '.lattice', 'config.json')), { code: 'ENOENT' });
|
|
127
|
+
await strict_1.default.rejects(node_fs_1.promises.access((0, node_path_1.join)(outside, 'workflows', 'ci.yml')), { code: 'ENOENT' });
|
|
128
|
+
});
|
|
129
|
+
});
|
|
130
|
+
(0, node_test_1.default)('bundle preflight rejects the fixed lattice-pack generation directory when linked', async () => {
|
|
131
|
+
await fixture(async ({ target, outside }) => {
|
|
132
|
+
await node_fs_1.promises.symlink(outside, (0, node_path_1.join)(target, 'lattice-pack'), process.platform === 'win32' ? 'junction' : 'dir');
|
|
133
|
+
const previousCwd = process.cwd();
|
|
134
|
+
process.chdir(target);
|
|
135
|
+
try {
|
|
136
|
+
await strict_1.default.rejects((0, index_js_1.applyBundle)({
|
|
137
|
+
version: 'test',
|
|
138
|
+
name: 'test',
|
|
139
|
+
config: { projectType: 'nextjs', strictnessPreset: 'startup' },
|
|
140
|
+
files: {},
|
|
141
|
+
}), /symbolic link or junction/);
|
|
142
|
+
}
|
|
143
|
+
finally {
|
|
144
|
+
process.chdir(previousCwd);
|
|
145
|
+
}
|
|
146
|
+
await strict_1.default.rejects(node_fs_1.promises.access((0, node_path_1.join)(target, '.lattice', 'config.json')), { code: 'ENOENT' });
|
|
147
|
+
strict_1.default.deepEqual(await node_fs_1.promises.readdir(outside), []);
|
|
148
|
+
});
|
|
149
|
+
});
|
|
150
|
+
(0, node_test_1.default)('generate refuses an output junction without changing its outside target', async () => {
|
|
151
|
+
await fixture(async ({ target, outside }) => {
|
|
152
|
+
await node_fs_1.promises.mkdir((0, node_path_1.join)(target, '.lattice'), { recursive: true });
|
|
153
|
+
await node_fs_1.promises.writeFile((0, node_path_1.join)(target, '.lattice', 'config.json'), JSON.stringify({
|
|
154
|
+
projectType: 'nextjs',
|
|
155
|
+
strictnessPreset: 'startup',
|
|
156
|
+
}));
|
|
157
|
+
const sentinel = (0, node_path_1.join)(outside, 'workflows', 'ci.yml');
|
|
158
|
+
await node_fs_1.promises.mkdir((0, node_path_1.dirname)(sentinel), { recursive: true });
|
|
159
|
+
await node_fs_1.promises.writeFile(sentinel, 'outside sentinel\n');
|
|
160
|
+
await node_fs_1.promises.symlink(outside, (0, node_path_1.join)(target, '.github'), process.platform === 'win32' ? 'junction' : 'dir');
|
|
161
|
+
const previousCwd = process.cwd();
|
|
162
|
+
process.chdir(target);
|
|
163
|
+
try {
|
|
164
|
+
await strict_1.default.rejects((0, index_js_1.generate)(target), /symbolic link or junction/);
|
|
165
|
+
}
|
|
166
|
+
finally {
|
|
167
|
+
process.chdir(previousCwd);
|
|
168
|
+
}
|
|
169
|
+
strict_1.default.equal(await node_fs_1.promises.readFile(sentinel, 'utf8'), 'outside sentinel\n');
|
|
170
|
+
});
|
|
171
|
+
});
|
|
172
|
+
(0, node_test_1.default)('manual Next scaffold rejects a later junction before package.json is written', async () => {
|
|
173
|
+
await fixture(async ({ target, outside }) => {
|
|
174
|
+
await node_fs_1.promises.symlink(outside, (0, node_path_1.join)(target, 'src'), process.platform === 'win32' ? 'junction' : 'dir');
|
|
175
|
+
await strict_1.default.rejects((0, index_js_1.scaffoldNextJsProject)(target, 'fixture-app'), /symbolic link or junction/);
|
|
176
|
+
await strict_1.default.rejects(node_fs_1.promises.access((0, node_path_1.join)(target, 'package.json')), { code: 'ENOENT' });
|
|
177
|
+
strict_1.default.deepEqual(await node_fs_1.promises.readdir(outside), []);
|
|
178
|
+
});
|
|
179
|
+
});
|
|
180
|
+
(0, node_test_1.default)('create preflight rejects a conditional env hard link before scaffold writes', async () => {
|
|
181
|
+
await fixture(async ({ target, outside }) => {
|
|
182
|
+
const sentinel = (0, node_path_1.join)(outside, 'env-sentinel');
|
|
183
|
+
await node_fs_1.promises.writeFile(sentinel, 'outside sentinel\n');
|
|
184
|
+
await node_fs_1.promises.link(sentinel, (0, node_path_1.join)(target, '.env.local'));
|
|
185
|
+
await strict_1.default.rejects((0, index_js_1.prepareCreateOutputPlan)(target, ['PROJECT_GUIDE.md'], false, true), /multiple hard links/);
|
|
186
|
+
await strict_1.default.rejects(node_fs_1.promises.access((0, node_path_1.join)(target, 'package.json')), { code: 'ENOENT' });
|
|
187
|
+
strict_1.default.equal(await node_fs_1.promises.readFile(sentinel, 'utf8'), 'outside sentinel\n');
|
|
188
|
+
});
|
|
189
|
+
});
|
|
190
|
+
(0, node_test_1.default)('init refuses a linked metadata directory without changing the outside sentinel', async () => {
|
|
191
|
+
await fixture(async ({ target, outside }) => {
|
|
192
|
+
const sentinel = (0, node_path_1.join)(outside, 'config.json');
|
|
193
|
+
await node_fs_1.promises.writeFile(sentinel, 'outside sentinel\n');
|
|
194
|
+
await node_fs_1.promises.symlink(outside, (0, node_path_1.join)(target, '.lattice'), process.platform === 'win32' ? 'junction' : 'dir');
|
|
195
|
+
const previousCwd = process.cwd();
|
|
196
|
+
process.chdir(target);
|
|
197
|
+
try {
|
|
198
|
+
await strict_1.default.rejects((0, index_js_1.init)('nextjs', 'startup'), /symbolic link or junction/);
|
|
199
|
+
}
|
|
200
|
+
finally {
|
|
201
|
+
process.chdir(previousCwd);
|
|
202
|
+
}
|
|
203
|
+
strict_1.default.equal(await node_fs_1.promises.readFile(sentinel, 'utf8'), 'outside sentinel\n');
|
|
204
|
+
});
|
|
205
|
+
});
|
|
206
|
+
(0, node_test_1.default)('failure-report fallback does not follow a linked metadata directory', async () => {
|
|
207
|
+
await fixture(async ({ target, outside }) => {
|
|
208
|
+
const sentinel = (0, node_path_1.join)(outside, 'failure-report.json');
|
|
209
|
+
await node_fs_1.promises.writeFile(sentinel, 'outside sentinel\n');
|
|
210
|
+
await node_fs_1.promises.symlink(outside, (0, node_path_1.join)(target, '.lattice'), process.platform === 'win32' ? 'junction' : 'dir');
|
|
211
|
+
const previousCwd = process.cwd();
|
|
212
|
+
process.chdir(target);
|
|
213
|
+
try {
|
|
214
|
+
await (0, index_js_1.writeFailureReport)({ error: new Error('expected'), argv: [], debug: false });
|
|
215
|
+
}
|
|
216
|
+
finally {
|
|
217
|
+
process.chdir(previousCwd);
|
|
218
|
+
}
|
|
219
|
+
strict_1.default.equal(await node_fs_1.promises.readFile(sentinel, 'utf8'), 'outside sentinel\n');
|
|
220
|
+
});
|
|
221
|
+
});
|
|
222
|
+
//# sourceMappingURL=project-path-confinement.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-path-confinement.test.js","sourceRoot":"","sources":["../src/project-path-confinement.test.ts"],"names":[],"mappings":";;;;;AAAA,gEAAwC;AACxC,6CAAyC;AACzC,qCAAyC;AACzC,qCAAiC;AACjC,yCAA0C;AAC1C,0DAA6B;AAC7B,yCASoB;AAEpB,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC;AAE7B,KAAK,UAAU,OAAO,CAAC,GAA8F;IACnH,MAAM,IAAI,GAAG,MAAM,kBAAE,CAAC,OAAO,CAAC,IAAA,gBAAI,EAAC,IAAA,gBAAM,GAAE,EAAE,2BAA2B,CAAC,CAAC,CAAC;IAC3E,MAAM,IAAI,GAAG,IAAA,gBAAI,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAChC,MAAM,MAAM,GAAG,IAAA,gBAAI,EAAC,IAAI,EAAE,QAAQ,CAA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;QACnD,MAAM,kBAAE,CAAC,OAAO,CAAC,OAAO,EAAE,IAAA,gBAAI,EAAC,MAAM,EAAE,UAAU,CAAC,EAAE,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;QACvG,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;QAClC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACtB,IAAI,CAAC;YACH,MAAM,IAAA,6BAAkB,EAAC,EAAE,KAAK,EAAE,IAAI,KAAK,CAAC,UAAU,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;QACrF,CAAC;gBAAS,CAAC;YACT,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;QAC7B,CAAC;QACD,gBAAM,CAAC,KAAK,CAAC,MAAM,kBAAE,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,EAAE,oBAAoB,CAAC,CAAC;IAC1E,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { BeginSecurityRunRequest, BeginSecurityRunResponse, FinishSecurityRunResponse, SecurityAppStatusResponse, SecurityConnection } from './types.js';
|
|
2
|
+
export declare class SecurityApiRequestError extends Error {
|
|
3
|
+
readonly status: number | null;
|
|
4
|
+
readonly code: string;
|
|
5
|
+
readonly retryable: boolean;
|
|
6
|
+
readonly recoveryAt?: string | undefined;
|
|
7
|
+
constructor(message: string, status: number | null, code: string, retryable: boolean, recoveryAt?: string | undefined);
|
|
8
|
+
}
|
|
9
|
+
export interface SecurityApiRequestOptions {
|
|
10
|
+
fetcher?: typeof fetch;
|
|
11
|
+
timeoutMs?: number;
|
|
12
|
+
}
|
|
13
|
+
export declare function getSecurityStatus(connection: SecurityConnection, options?: SecurityApiRequestOptions): Promise<SecurityAppStatusResponse>;
|
|
14
|
+
export declare function beginSecurityRun(connection: SecurityConnection, input: BeginSecurityRunRequest, options?: SecurityApiRequestOptions): Promise<BeginSecurityRunResponse>;
|
|
15
|
+
export declare function finishSecurityRun(connection: SecurityConnection, runId: string, exactRequestBody: string, options?: SecurityApiRequestOptions & {
|
|
16
|
+
retries?: number;
|
|
17
|
+
}): Promise<FinishSecurityRunResponse>;
|
|
18
|
+
//# sourceMappingURL=api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/security/api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EACvB,wBAAwB,EACxB,yBAAyB,EAEzB,yBAAyB,EACzB,kBAAkB,EACnB,MAAM,YAAY,CAAC;AAqDpB,qBAAa,uBAAwB,SAAQ,KAAK;aAG9B,MAAM,EAAE,MAAM,GAAG,IAAI;aACrB,IAAI,EAAE,MAAM;aACZ,SAAS,EAAE,OAAO;aAClB,UAAU,CAAC,EAAE,MAAM;gBAJnC,OAAO,EAAE,MAAM,EACC,MAAM,EAAE,MAAM,GAAG,IAAI,EACrB,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,OAAO,EAClB,UAAU,CAAC,EAAE,MAAM,YAAA;CAKtC;AA2ED,MAAM,WAAW,yBAAyB;IACxC,OAAO,CAAC,EAAE,OAAO,KAAK,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAkDD,wBAAsB,iBAAiB,CACrC,UAAU,EAAE,kBAAkB,EAC9B,OAAO,GAAE,yBAA8B,GACtC,OAAO,CAAC,yBAAyB,CAAC,CAWpC;AAED,wBAAsB,gBAAgB,CACpC,UAAU,EAAE,kBAAkB,EAC9B,KAAK,EAAE,uBAAuB,EAC9B,OAAO,GAAE,yBAA8B,GACtC,OAAO,CAAC,wBAAwB,CAAC,CAoBnC;AAED,wBAAsB,iBAAiB,CACrC,UAAU,EAAE,kBAAkB,EAC9B,KAAK,EAAE,MAAM,EACb,gBAAgB,EAAE,MAAM,EACxB,OAAO,GAAE,yBAAyB,GAAG;IAAE,OAAO,CAAC,EAAE,MAAM,CAAA;CAAO,GAC7D,OAAO,CAAC,yBAAyB,CAAC,CAsCpC"}
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SecurityApiRequestError = void 0;
|
|
4
|
+
exports.getSecurityStatus = getSecurityStatus;
|
|
5
|
+
exports.beginSecurityRun = beginSecurityRun;
|
|
6
|
+
exports.finishSecurityRun = finishSecurityRun;
|
|
7
|
+
const MAX_RESPONSE_BYTES = 262_144;
|
|
8
|
+
const UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
9
|
+
const RUN_MODES = new Set(['scan', 'deep', 'release', 'report']);
|
|
10
|
+
const RELEASE_BLOCKERS = new Set(['feature_disabled', 'configuration_missing', 'commercial_artifact_unavailable', 'payment_required']);
|
|
11
|
+
const PROVIDER_STATUSES = new Set(['checkout_pending', 'active', 'past_due', 'unpaid', 'incomplete', 'disputed', 'canceled', 'refunded', 'expired']);
|
|
12
|
+
const ARTIFACT_STATUSES = new Set(['unavailable', 'synthetic_test', 'rights_cleared']);
|
|
13
|
+
function isoOrNull(value) {
|
|
14
|
+
return value === null || (typeof value === 'string' && !Number.isNaN(Date.parse(value)));
|
|
15
|
+
}
|
|
16
|
+
function hasExactKeys(value, expected) {
|
|
17
|
+
const keys = Object.keys(value);
|
|
18
|
+
return keys.length === expected.length && keys.every((key) => expected.includes(key));
|
|
19
|
+
}
|
|
20
|
+
function validRuntimeIdentity(value) {
|
|
21
|
+
if (!value || typeof value !== 'object' || Array.isArray(value))
|
|
22
|
+
return false;
|
|
23
|
+
const item = value;
|
|
24
|
+
const keys = ['vsgVersion', 'profileId', 'profileVersion', 'rulesDigest', 'registryDigest', 'commercialManifestDigest', 'evaluatorDigest', 'catalogDigest'];
|
|
25
|
+
return hasExactKeys(item, keys)
|
|
26
|
+
&& ['vsgVersion', 'profileId', 'profileVersion'].every((key) => typeof item[key] === 'string' && item[key] !== '')
|
|
27
|
+
&& ['rulesDigest', 'registryDigest', 'commercialManifestDigest', 'evaluatorDigest', 'catalogDigest']
|
|
28
|
+
.every((key) => typeof item[key] === 'string' && /^[0-9a-f]{64}$/.test(item[key]));
|
|
29
|
+
}
|
|
30
|
+
function validStatusResponse(value, appId) {
|
|
31
|
+
if (!value || !hasExactKeys(value, ['app', 'entitledModes', 'entitlements', 'checkoutEnabled', 'publicationEnabled', 'releaseBlockers'])
|
|
32
|
+
|| !value.app || !hasExactKeys(value.app, ['id', 'name', 'repositoryIdentity', 'origin', 'repositoryLockedAt', 'createdAt'])
|
|
33
|
+
|| value.app.id !== appId || typeof value.app.name !== 'string'
|
|
34
|
+
|| typeof value.app.repositoryIdentity !== 'string'
|
|
35
|
+
|| !(value.app.origin === null || typeof value.app.origin === 'string')
|
|
36
|
+
|| !isoOrNull(value.app.repositoryLockedAt)
|
|
37
|
+
|| typeof value.app.createdAt !== 'string' || Number.isNaN(Date.parse(value.app.createdAt))
|
|
38
|
+
|| !Array.isArray(value.entitlements) || !Array.isArray(value.entitledModes)
|
|
39
|
+
|| value.entitledModes.some((mode) => !RUN_MODES.has(mode))
|
|
40
|
+
|| !Array.isArray(value.releaseBlockers) || value.releaseBlockers.some((item) => !RELEASE_BLOCKERS.has(item))
|
|
41
|
+
|| typeof value.publicationEnabled !== 'boolean' || typeof value.checkoutEnabled !== 'boolean')
|
|
42
|
+
return false;
|
|
43
|
+
return value.entitlements.every((item) => hasExactKeys(item, [
|
|
44
|
+
'id', 'kind', 'providerStatus', 'artifactStatus', 'unitLimit', 'consumedUnits', 'reservedUnits',
|
|
45
|
+
'remainingUnits', 'periodStart', 'periodEnd', 'cancelAtPeriodEnd', 'requiredRuntime',
|
|
46
|
+
]) && UUID.test(item.id)
|
|
47
|
+
&& ['security_launch', 'security_subscription'].includes(item.kind)
|
|
48
|
+
&& PROVIDER_STATUSES.has(item.providerStatus) && ARTIFACT_STATUSES.has(item.artifactStatus)
|
|
49
|
+
&& [item.unitLimit, item.consumedUnits, item.reservedUnits, item.remainingUnits]
|
|
50
|
+
.every((number) => Number.isSafeInteger(number) && number >= 0)
|
|
51
|
+
&& isoOrNull(item.periodStart) && isoOrNull(item.periodEnd)
|
|
52
|
+
&& typeof item.cancelAtPeriodEnd === 'boolean'
|
|
53
|
+
&& (item.requiredRuntime === null || validRuntimeIdentity(item.requiredRuntime)));
|
|
54
|
+
}
|
|
55
|
+
class SecurityApiRequestError extends Error {
|
|
56
|
+
status;
|
|
57
|
+
code;
|
|
58
|
+
retryable;
|
|
59
|
+
recoveryAt;
|
|
60
|
+
constructor(message, status, code, retryable, recoveryAt) {
|
|
61
|
+
super(message);
|
|
62
|
+
this.status = status;
|
|
63
|
+
this.code = code;
|
|
64
|
+
this.retryable = retryable;
|
|
65
|
+
this.recoveryAt = recoveryAt;
|
|
66
|
+
this.name = 'SecurityApiRequestError';
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
exports.SecurityApiRequestError = SecurityApiRequestError;
|
|
70
|
+
function redactToken(value, token) {
|
|
71
|
+
return value.split(token).join('[REDACTED]');
|
|
72
|
+
}
|
|
73
|
+
async function cancelResponseBody(response) {
|
|
74
|
+
try {
|
|
75
|
+
await response.body?.cancel();
|
|
76
|
+
}
|
|
77
|
+
catch {
|
|
78
|
+
// The response is being rejected already; cancellation is best-effort socket cleanup.
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
async function readBoundedJson(response) {
|
|
82
|
+
const contentType = response.headers.get('content-type')?.toLowerCase() ?? '';
|
|
83
|
+
if (!contentType.startsWith('application/json')) {
|
|
84
|
+
await cancelResponseBody(response);
|
|
85
|
+
throw new Error('Security API returned a non-JSON response.');
|
|
86
|
+
}
|
|
87
|
+
const declaredLength = response.headers.get('content-length');
|
|
88
|
+
if (declaredLength !== null) {
|
|
89
|
+
const parsed = Number(declaredLength);
|
|
90
|
+
if (!Number.isSafeInteger(parsed) || parsed < 0) {
|
|
91
|
+
await cancelResponseBody(response);
|
|
92
|
+
throw new Error('Security API returned an invalid Content-Length.');
|
|
93
|
+
}
|
|
94
|
+
if (parsed > MAX_RESPONSE_BYTES) {
|
|
95
|
+
await cancelResponseBody(response);
|
|
96
|
+
throw new Error('Security API response exceeded the allowed size.');
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
if (!response.body)
|
|
100
|
+
throw new Error('Security API returned an empty response.');
|
|
101
|
+
const reader = response.body.getReader();
|
|
102
|
+
const chunks = [];
|
|
103
|
+
let total = 0;
|
|
104
|
+
while (true) {
|
|
105
|
+
const { done, value } = await reader.read();
|
|
106
|
+
if (done)
|
|
107
|
+
break;
|
|
108
|
+
total += value.byteLength;
|
|
109
|
+
if (total > MAX_RESPONSE_BYTES) {
|
|
110
|
+
await reader.cancel();
|
|
111
|
+
throw new Error('Security API response exceeded the allowed size.');
|
|
112
|
+
}
|
|
113
|
+
chunks.push(value);
|
|
114
|
+
}
|
|
115
|
+
const bytes = new Uint8Array(total);
|
|
116
|
+
let offset = 0;
|
|
117
|
+
for (const chunk of chunks) {
|
|
118
|
+
bytes.set(chunk, offset);
|
|
119
|
+
offset += chunk.byteLength;
|
|
120
|
+
}
|
|
121
|
+
try {
|
|
122
|
+
return JSON.parse(new TextDecoder('utf-8', { fatal: true }).decode(bytes));
|
|
123
|
+
}
|
|
124
|
+
catch {
|
|
125
|
+
throw new Error('Security API returned invalid UTF-8 JSON.');
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
function parseApiError(value) {
|
|
129
|
+
if (!value || typeof value !== 'object' || Array.isArray(value))
|
|
130
|
+
return null;
|
|
131
|
+
const error = value.error;
|
|
132
|
+
if (!error || typeof error !== 'object' || Array.isArray(error))
|
|
133
|
+
return null;
|
|
134
|
+
const item = error;
|
|
135
|
+
if (typeof item.code !== 'string' || typeof item.message !== 'string' || typeof item.retryable !== 'boolean')
|
|
136
|
+
return null;
|
|
137
|
+
return {
|
|
138
|
+
error: {
|
|
139
|
+
code: item.code,
|
|
140
|
+
message: item.message,
|
|
141
|
+
retryable: item.retryable,
|
|
142
|
+
...(typeof item.recoveryAt === 'string' ? { recoveryAt: item.recoveryAt } : {}),
|
|
143
|
+
},
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
async function requestSecurityJson(connection, pathname, init, options = {}) {
|
|
147
|
+
const controller = new AbortController();
|
|
148
|
+
const timeout = setTimeout(() => controller.abort(), options.timeoutMs ?? 15_000);
|
|
149
|
+
const url = new URL(pathname, `${connection.apiUrl}/`);
|
|
150
|
+
try {
|
|
151
|
+
let response;
|
|
152
|
+
try {
|
|
153
|
+
response = await (options.fetcher ?? fetch)(url, {
|
|
154
|
+
...init,
|
|
155
|
+
redirect: 'error',
|
|
156
|
+
signal: controller.signal,
|
|
157
|
+
headers: {
|
|
158
|
+
Accept: 'application/json',
|
|
159
|
+
Authorization: `Bearer ${connection.token}`,
|
|
160
|
+
...init.headers,
|
|
161
|
+
},
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
catch (error) {
|
|
165
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
166
|
+
throw new SecurityApiRequestError(redactToken(message, connection.token), null, controller.signal.aborted ? 'timeout' : 'network_error', true);
|
|
167
|
+
}
|
|
168
|
+
const body = await readBoundedJson(response);
|
|
169
|
+
if (!response.ok) {
|
|
170
|
+
const parsed = parseApiError(body);
|
|
171
|
+
throw new SecurityApiRequestError(redactToken(parsed?.error.message ?? `Security API request failed (HTTP ${response.status}).`, connection.token), response.status, parsed?.error.code ?? 'invalid_response', parsed?.error.retryable ?? response.status >= 500, parsed?.error.recoveryAt);
|
|
172
|
+
}
|
|
173
|
+
return body;
|
|
174
|
+
}
|
|
175
|
+
finally {
|
|
176
|
+
clearTimeout(timeout);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
async function getSecurityStatus(connection, options = {}) {
|
|
180
|
+
const response = await requestSecurityJson(connection, `/api/security/apps/${encodeURIComponent(connection.appId)}/status`, { method: 'GET' }, options);
|
|
181
|
+
if (!validStatusResponse(response, connection.appId)) {
|
|
182
|
+
throw new SecurityApiRequestError('Security API returned an invalid status response.', 200, 'invalid_response', false);
|
|
183
|
+
}
|
|
184
|
+
return response;
|
|
185
|
+
}
|
|
186
|
+
async function beginSecurityRun(connection, input, options = {}) {
|
|
187
|
+
const response = await requestSecurityJson(connection, `/api/security/apps/${encodeURIComponent(connection.appId)}/runs`, {
|
|
188
|
+
method: 'POST',
|
|
189
|
+
headers: { 'Content-Type': 'application/json', 'Content-Encoding': 'identity' },
|
|
190
|
+
body: JSON.stringify(input),
|
|
191
|
+
}, options);
|
|
192
|
+
if (!response || !['reserved', 'replay'].includes(response.result) || !UUID.test(response.runId)
|
|
193
|
+
|| !['reserved', 'finished', 'aborted', 'expired'].includes(response.state)
|
|
194
|
+
|| Number.isNaN(Date.parse(response.reservationExpiresAt)) || response.entitlementId !== input.entitlementId
|
|
195
|
+
|| !['security_launch', 'security_subscription'].includes(response.grantKind)
|
|
196
|
+
|| !Number.isSafeInteger(response.remainingUnits) || response.remainingUnits < 0
|
|
197
|
+
|| !Number.isSafeInteger(response.reservedUnits) || response.reservedUnits < 0) {
|
|
198
|
+
throw new SecurityApiRequestError('Security API returned an invalid begin response.', 200, 'invalid_response', false);
|
|
199
|
+
}
|
|
200
|
+
return response;
|
|
201
|
+
}
|
|
202
|
+
async function finishSecurityRun(connection, runId, exactRequestBody, options = {}) {
|
|
203
|
+
const attempts = 1 + Math.min(Math.max(options.retries ?? 2, 0), 2);
|
|
204
|
+
let lastError;
|
|
205
|
+
for (let attempt = 0; attempt < attempts; attempt += 1) {
|
|
206
|
+
try {
|
|
207
|
+
const response = await requestSecurityJson(connection, `/api/security/apps/${encodeURIComponent(connection.appId)}/runs/${encodeURIComponent(runId)}`, {
|
|
208
|
+
method: 'PUT',
|
|
209
|
+
headers: { 'Content-Type': 'application/json', 'Content-Encoding': 'identity' },
|
|
210
|
+
body: exactRequestBody,
|
|
211
|
+
}, options);
|
|
212
|
+
const resultMatchesState = response?.result === 'finished'
|
|
213
|
+
? response.state === 'finished'
|
|
214
|
+
: response?.result === 'aborted'
|
|
215
|
+
? response.state === 'aborted'
|
|
216
|
+
: response?.result === 'replay' && ['finished', 'aborted'].includes(response.state);
|
|
217
|
+
const terminalFieldsMatch = response?.state === 'finished'
|
|
218
|
+
? response.verdict !== null
|
|
219
|
+
: response?.state === 'aborted' && response.verdict === null && response.consumedUnit === false;
|
|
220
|
+
if (!response || !resultMatchesState || !terminalFieldsMatch || response.runId !== runId
|
|
221
|
+
|| ![null, 'PASS', 'BLOCKED', 'INCOMPLETE'].includes(response.verdict)
|
|
222
|
+
|| Number.isNaN(Date.parse(response.completedAt)) || !isoOrNull(response.contentExpiresAt)
|
|
223
|
+
|| typeof response.consumedUnit !== 'boolean') {
|
|
224
|
+
throw new SecurityApiRequestError('Security API returned an invalid finish response.', 200, 'invalid_response', false);
|
|
225
|
+
}
|
|
226
|
+
return response;
|
|
227
|
+
}
|
|
228
|
+
catch (error) {
|
|
229
|
+
lastError = error;
|
|
230
|
+
const retry = error instanceof SecurityApiRequestError
|
|
231
|
+
&& (error.status === null || error.status >= 500);
|
|
232
|
+
if (!retry || attempt + 1 >= attempts)
|
|
233
|
+
throw error;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
throw lastError;
|
|
237
|
+
}
|
|
238
|
+
//# sourceMappingURL=api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/security/api.ts"],"names":[],"mappings":";;;AAuMA,8CAcC;AAED,4CAwBC;AAED,8CA2CC;AAnRD,MAAM,kBAAkB,GAAG,OAAO,CAAC;AACnC,MAAM,IAAI,GAAG,4EAA4E,CAAC;AAC1F,MAAM,SAAS,G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