@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,85 @@
|
|
|
1
|
+
import crypto from 'node:crypto';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { packageRoot } from '../../core/paths.mjs';
|
|
4
|
+
|
|
5
|
+
const RUNNER = path.join(packageRoot, 'src', 'checks', 'code', 'opengrep-runner.mjs');
|
|
6
|
+
const SELECTED_RUNNER = path.join(packageRoot, 'src', 'checks', 'code', 'selected-opengrep-runner.mjs');
|
|
7
|
+
const lastJson = (stdout) => {
|
|
8
|
+
for (const line of String(stdout).split('\n').reverse()) {
|
|
9
|
+
if (!line.startsWith('{')) continue;
|
|
10
|
+
try { return JSON.parse(line); } catch { /* keep looking */ }
|
|
11
|
+
}
|
|
12
|
+
return null;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export async function runOpengrepContainer(ctx, { args, opengrep, rulesArchive, rulesRoot, vsgRulesDir, timeoutMs }) {
|
|
16
|
+
const runner = ctx.registry?.get('yara-runner');
|
|
17
|
+
if (!runner?.image) return { status: 'not_run', reason: 'The pinned Linux runner image is not in the tool registry.' };
|
|
18
|
+
const docker = await ctx.runProcess({ command: 'docker', args: ['version', '--format', '{{.Server.Version}}'], timeoutMs: 20_000 });
|
|
19
|
+
if (docker.status !== 'ran' || docker.exitCode !== 0) return { status: 'not_run', reason: 'Docker is not available, so the verified Linux Opengrep runner cannot start.' };
|
|
20
|
+
const name = `vsg-opengrep-${process.pid}-${crypto.randomBytes(4).toString('hex')}`;
|
|
21
|
+
const dockerArgs = [
|
|
22
|
+
'run', '--pull', 'never', '--rm', '--init', '-i', '--name', name, '--network', 'none', '--read-only', '--tmpfs', '/tmp:rw,exec,size=2g', '--memory', '4g', '--cap-drop', 'ALL', '--security-opt', 'no-new-privileges',
|
|
23
|
+
'-v', `${RUNNER}:/vsg/src/checks/code/opengrep-runner.mjs:ro`,
|
|
24
|
+
'-v', `${path.join(packageRoot, 'src', 'core')}:/vsg/src/core:ro`,
|
|
25
|
+
'-v', `${vsgRulesDir}:/vsg/rules:ro`,
|
|
26
|
+
'-v', `${opengrep.path}:/vsg/in/opengrep:ro`,
|
|
27
|
+
'-v', `${rulesArchive.path}:/vsg/in/rules.tar.gz:ro`,
|
|
28
|
+
'-v', `${ctx.repo}:/scan:ro`,
|
|
29
|
+
'-w', '/scan', runner.image, 'node', '/vsg/src/checks/code/opengrep-runner.mjs',
|
|
30
|
+
'--opengrep', '/vsg/in/opengrep', '--rules', '/vsg/in/rules.tar.gz', '--root', '/scan', '--work', '/tmp/vsg-opengrep',
|
|
31
|
+
];
|
|
32
|
+
const input = JSON.stringify({
|
|
33
|
+
args, timeoutMs, opengrepSha256: opengrep.sha256,
|
|
34
|
+
rulesSha256: rulesArchive.sha256, rulesManifest: rulesArchive.files, rulesRoot,
|
|
35
|
+
});
|
|
36
|
+
const result = await ctx.runProcess({ command: 'docker', args: dockerArgs, input, timeoutMs: timeoutMs + 120_000, maxOutputBytes: 80 * 1024 * 1024 });
|
|
37
|
+
if (result.status !== 'ran') {
|
|
38
|
+
await ctx.runProcess({ command: 'docker', args: ['rm', '-f', name], timeoutMs: 30_000 });
|
|
39
|
+
return { status: 'not_run', reason: `Linux Opengrep runner ${result.reason}` };
|
|
40
|
+
}
|
|
41
|
+
if (result.exitCode !== 0 || result.truncated) {
|
|
42
|
+
await ctx.runProcess({ command: 'docker', args: ['rm', '-f', name], timeoutMs: 30_000 });
|
|
43
|
+
const detail = result.truncated ? 'produced truncated output' : `exited with code ${result.exitCode}`;
|
|
44
|
+
return { status: 'not_run', reason: `Linux Opengrep runner ${detail}.` };
|
|
45
|
+
}
|
|
46
|
+
const output = lastJson(result.stdout);
|
|
47
|
+
if (!output) return { status: 'not_run', reason: `Linux Opengrep runner produced no result (exit ${result.exitCode}).` };
|
|
48
|
+
if (!output.ok) return { status: 'not_run', reason: `Linux Opengrep runner failed: ${output.error}` };
|
|
49
|
+
return output.result;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** Runs the fixed commercial selection from a disposable Linux volume without consulting restricted rule registries. */
|
|
53
|
+
export async function runSelectedOpengrepContainer(ctx, { args, opengrep, source, sourceFiles, ruleIdsSha256, vsgRulesDir, timeoutMs, volume }) {
|
|
54
|
+
const runner = ctx.registry?.get('yara-runner');
|
|
55
|
+
if (!runner?.image) return { status: 'not_run', reason: 'The pinned Linux runner image is not in the tool registry.' };
|
|
56
|
+
const name = `vsg-selected-opengrep-${process.pid}-${crypto.randomBytes(4).toString('hex')}`;
|
|
57
|
+
const dockerArgs = [
|
|
58
|
+
'run', '--pull', 'never', '--rm', '--init', '-i', '--name', name, '--network', 'none', '--read-only', '--tmpfs', '/tmp:rw,exec,size=2g', '--memory', '4g', '--cap-drop', 'ALL', '--security-opt', 'no-new-privileges',
|
|
59
|
+
'-v', `${SELECTED_RUNNER}:/vsg/src/checks/code/selected-opengrep-runner.mjs:ro`,
|
|
60
|
+
'-v', `${path.join(packageRoot, 'src', 'core')}:/vsg/src/core:ro`,
|
|
61
|
+
'-v', `${vsgRulesDir}:/vsg/rules:ro`,
|
|
62
|
+
'-v', `${opengrep.path}:/vsg/in/opengrep:ro`,
|
|
63
|
+
'-v', `${volume}:/vsg/selected-source:ro`,
|
|
64
|
+
'-v', `${ctx.repo}:/scan:ro`,
|
|
65
|
+
'-w', '/scan', runner.image, 'node', '/vsg/src/checks/code/selected-opengrep-runner.mjs',
|
|
66
|
+
'--opengrep', '/vsg/in/opengrep', '--source-root', '/vsg/selected-source/files', '--root', '/scan', '--work', '/tmp/vsg-selected-opengrep',
|
|
67
|
+
];
|
|
68
|
+
const input = JSON.stringify({
|
|
69
|
+
args, timeoutMs, opengrepSha256: opengrep.sha256,
|
|
70
|
+
sourceManifestSha256: source.manifestSha256, sourceFiles, ruleIdsSha256,
|
|
71
|
+
});
|
|
72
|
+
const result = await ctx.runProcess({ command: 'docker', args: dockerArgs, input, timeoutMs: timeoutMs + 120_000, maxOutputBytes: 80 * 1024 * 1024 });
|
|
73
|
+
if (result.status !== 'ran') {
|
|
74
|
+
await ctx.runProcess({ command: 'docker', args: ['rm', '-f', name], timeoutMs: 30_000 });
|
|
75
|
+
return { status: 'not_run', reason: `Selected Linux Opengrep runner ${result.reason}` };
|
|
76
|
+
}
|
|
77
|
+
if (result.exitCode !== 0 || result.truncated) {
|
|
78
|
+
const detail = result.truncated ? 'produced truncated output' : `exited with code ${result.exitCode}`;
|
|
79
|
+
return { status: 'not_run', reason: `Selected Linux Opengrep runner ${detail}.` };
|
|
80
|
+
}
|
|
81
|
+
const output = lastJson(result.stdout);
|
|
82
|
+
if (!output) return { status: 'not_run', reason: `Selected Linux Opengrep runner produced no result (exit ${result.exitCode}).` };
|
|
83
|
+
if (!output.ok) return { status: 'not_run', reason: `Selected Linux Opengrep runner failed: ${output.error}` };
|
|
84
|
+
return output.result;
|
|
85
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
// Linux-only Opengrep runner. On Windows the host mounts verified compressed
|
|
2
|
+
// rules and the pinned Linux binary read-only; all extraction stays in /tmp.
|
|
3
|
+
import { spawnSync } from 'node:child_process';
|
|
4
|
+
import crypto from 'node:crypto';
|
|
5
|
+
import fs from 'node:fs';
|
|
6
|
+
import path from 'node:path';
|
|
7
|
+
import { extractArchive, listTarGz, safeJoin } from '../../core/archive.mjs';
|
|
8
|
+
|
|
9
|
+
const sha256 = (bytes) => crypto.createHash('sha256').update(bytes).digest('hex');
|
|
10
|
+
const sameManifest = (a, b) => {
|
|
11
|
+
const ak = Object.keys(a).sort();
|
|
12
|
+
const bk = Object.keys(b).sort();
|
|
13
|
+
return ak.length === bk.length && ak.every((k, i) => k === bk[i] && a[k] === b[k]);
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const treeManifest = (root) => {
|
|
17
|
+
const files = {};
|
|
18
|
+
const walk = (dir, rel = '') => {
|
|
19
|
+
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
20
|
+
const file = path.join(dir, entry.name);
|
|
21
|
+
const child = rel ? `${rel}/${entry.name}` : entry.name;
|
|
22
|
+
if (entry.isDirectory()) walk(file, child);
|
|
23
|
+
else if (entry.isFile()) files[child] = sha256(fs.readFileSync(file));
|
|
24
|
+
else throw new Error(`rules contain unsupported entry ${child}`);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
walk(root);
|
|
28
|
+
return Object.fromEntries(Object.entries(files).sort(([a], [b]) => a.localeCompare(b)));
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export function extractVerifiedRules({ archivePath, expectedSha256, expectedManifest, rulesRoot, workDir }) {
|
|
32
|
+
const archive = fs.readFileSync(archivePath);
|
|
33
|
+
if (sha256(archive) !== expectedSha256) throw new Error('rules archive checksum mismatch inside Linux runner');
|
|
34
|
+
const archiveFiles = {};
|
|
35
|
+
for (const entry of listTarGz(archive)) {
|
|
36
|
+
if (!entry.dir) archiveFiles[entry.name.replaceAll('\\', '/')] = sha256(entry.data());
|
|
37
|
+
}
|
|
38
|
+
const normalized = Object.fromEntries(Object.entries(archiveFiles).sort(([a], [b]) => a.localeCompare(b)));
|
|
39
|
+
if (!sameManifest(normalized, expectedManifest)) throw new Error('rules archive manifest mismatch inside Linux runner');
|
|
40
|
+
const output = path.join(workDir, 'rules');
|
|
41
|
+
extractArchive(archive, 'tar.gz', output);
|
|
42
|
+
if (!sameManifest(treeManifest(output), expectedManifest)) throw new Error('extracted rules manifest mismatch inside Linux runner');
|
|
43
|
+
const root = safeJoin(output, rulesRoot);
|
|
44
|
+
if (!fs.statSync(root).isDirectory()) throw new Error('rules root is not a directory');
|
|
45
|
+
return root;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function arg(name) {
|
|
49
|
+
const i = process.argv.indexOf(`--${name}`);
|
|
50
|
+
return i > 0 ? process.argv[i + 1] : undefined;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function main() {
|
|
54
|
+
const work = arg('work') ?? '/tmp/vsg-opengrep';
|
|
55
|
+
try {
|
|
56
|
+
const input = JSON.parse(fs.readFileSync(0, 'utf8') || '{}');
|
|
57
|
+
fs.rmSync(work, { recursive: true, force: true });
|
|
58
|
+
fs.mkdirSync(work, { recursive: true });
|
|
59
|
+
extractVerifiedRules({
|
|
60
|
+
archivePath: arg('rules'),
|
|
61
|
+
expectedSha256: input.rulesSha256,
|
|
62
|
+
expectedManifest: input.rulesManifest,
|
|
63
|
+
rulesRoot: input.rulesRoot,
|
|
64
|
+
workDir: work,
|
|
65
|
+
});
|
|
66
|
+
const sourceBinary = fs.readFileSync(arg('opengrep'));
|
|
67
|
+
if (sha256(sourceBinary) !== input.opengrepSha256) throw new Error('Opengrep checksum mismatch inside Linux runner');
|
|
68
|
+
const opengrep = path.join(work, 'opengrep');
|
|
69
|
+
fs.writeFileSync(opengrep, sourceBinary, { mode: 0o755 });
|
|
70
|
+
const result = spawnSync(opengrep, input.args, {
|
|
71
|
+
cwd: arg('root'), encoding: 'utf8', maxBuffer: 64 * 1024 * 1024, timeout: input.timeoutMs,
|
|
72
|
+
env: { PATH: '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', HOME: '/tmp', LANG: 'C.UTF-8', LC_ALL: 'C.UTF-8', PYTHONUTF8: '1' },
|
|
73
|
+
});
|
|
74
|
+
const response = result.error
|
|
75
|
+
? { ok: false, error: `Opengrep could not complete: ${result.error.message}` }
|
|
76
|
+
: { ok: true, result: { status: 'ran', exitCode: result.status ?? -1, stdout: result.stdout ?? '', stderr: result.stderr ?? '', truncated: false } };
|
|
77
|
+
fs.rmSync(work, { recursive: true, force: true });
|
|
78
|
+
process.stdout.write(`${JSON.stringify(response)}\n`);
|
|
79
|
+
} catch (error) {
|
|
80
|
+
fs.rmSync(work, { recursive: true, force: true });
|
|
81
|
+
process.stdout.write(`${JSON.stringify({ ok: false, error: error.message })}\n`);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
import { fileURLToPath } from 'node:url';
|
|
86
|
+
if (process.argv[1] && fileURLToPath(import.meta.url) === path.resolve(process.argv[1])) main();
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
// Linux-only selected SAST runner. The 161 reviewed files and two license files are fetched into a
|
|
2
|
+
// disposable Docker volume from fixed upstream URLs, verified again, and staged into tmpfs.
|
|
3
|
+
import crypto from 'node:crypto';
|
|
4
|
+
import fs from 'node:fs';
|
|
5
|
+
import path from 'node:path';
|
|
6
|
+
import { spawnSync } from 'node:child_process';
|
|
7
|
+
import { safeJoin } from '../../core/archive.mjs';
|
|
8
|
+
|
|
9
|
+
const sha256 = (bytes) => crypto.createHash('sha256').update(bytes).digest('hex');
|
|
10
|
+
const same = (a, b) => a.length === b.length && a.every((value, index) => value === b[index]);
|
|
11
|
+
|
|
12
|
+
function arg(name) {
|
|
13
|
+
const index = process.argv.indexOf(`--${name}`);
|
|
14
|
+
return index > 0 ? process.argv[index + 1] : undefined;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function stageSelectedSource({ sourceRoot, files, expectedManifestSha256, expectedRuleIdsSha256, target }) {
|
|
18
|
+
if (!Array.isArray(files) || files.length !== 163) throw new Error('Selected SAST source manifest must contain exactly 163 files.');
|
|
19
|
+
if (sha256(JSON.stringify(files)) !== expectedManifestSha256) throw new Error('Selected SAST source manifest identity changed inside Linux runner.');
|
|
20
|
+
const expected = new Map();
|
|
21
|
+
for (const item of files) {
|
|
22
|
+
if (!item || typeof item.path !== 'string' || !item.path || item.path.includes('\\') || item.path.split('/').some((part) => !part || part === '.' || part === '..')
|
|
23
|
+
|| !/^https:\/\//.test(item.url ?? '') || !/^[0-9a-f]{64}$/.test(item.sha256 ?? '') || !Number.isSafeInteger(item.bytes) || item.bytes < 0 || expected.has(item.path.toLowerCase())) {
|
|
24
|
+
throw new Error('Selected SAST source manifest contains an invalid or duplicate path.');
|
|
25
|
+
}
|
|
26
|
+
expected.set(item.path.toLowerCase(), item);
|
|
27
|
+
}
|
|
28
|
+
const observed = [];
|
|
29
|
+
const walkSource = (dir, rel = '') => {
|
|
30
|
+
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
31
|
+
const childRel = rel ? `${rel}/${entry.name}` : entry.name;
|
|
32
|
+
const child = path.join(dir, entry.name);
|
|
33
|
+
const stat = fs.lstatSync(child);
|
|
34
|
+
if (stat.isSymbolicLink()) throw new Error(`Selected SAST source contains linked path ${childRel}.`);
|
|
35
|
+
if (entry.isDirectory()) walkSource(child, childRel);
|
|
36
|
+
else if (entry.isFile()) observed.push(childRel);
|
|
37
|
+
else throw new Error(`Selected SAST source contains unsupported path ${childRel}.`);
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
walkSource(sourceRoot);
|
|
41
|
+
observed.sort();
|
|
42
|
+
const expectedPaths = files.map((item) => item.path).sort();
|
|
43
|
+
if (!same(observed, expectedPaths)) throw new Error('Selected SAST source volume differs from the fixed manifest.');
|
|
44
|
+
const ruleIds = [];
|
|
45
|
+
for (const item of files) {
|
|
46
|
+
const source = safeJoin(sourceRoot, item.path);
|
|
47
|
+
const sourceStat = fs.lstatSync(source);
|
|
48
|
+
if (!sourceStat.isFile() || sourceStat.isSymbolicLink()) throw new Error(`Selected SAST source path is not a regular file: ${item.path}.`);
|
|
49
|
+
const bytes = fs.readFileSync(source);
|
|
50
|
+
if (bytes.byteLength !== item.bytes || sha256(bytes) !== item.sha256) throw new Error(`Selected SAST source path changed: ${item.path}.`);
|
|
51
|
+
const destination = safeJoin(target, item.path);
|
|
52
|
+
fs.mkdirSync(path.dirname(destination), { recursive: true });
|
|
53
|
+
fs.writeFileSync(destination, bytes, { mode: 0o644 });
|
|
54
|
+
if (/\.ya?ml$/i.test(item.path)) {
|
|
55
|
+
for (const found of bytes.toString('utf8').matchAll(/^\s*(?:-\s*)?id:\s*['"]?([^'"\s#]+)['"]?\s*(?:#.*)?$/gm)) ruleIds.push(found[1]);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
ruleIds.sort();
|
|
59
|
+
if (ruleIds.length !== 161 || new Set(ruleIds).size !== 161 || sha256(JSON.stringify(ruleIds)) !== expectedRuleIdsSha256) {
|
|
60
|
+
throw new Error('Selected SAST rule identities do not match the fixed 161-rule catalog.');
|
|
61
|
+
}
|
|
62
|
+
const written = [];
|
|
63
|
+
const walk = (dir, rel = '') => {
|
|
64
|
+
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
65
|
+
const childRel = rel ? `${rel}/${entry.name}` : entry.name;
|
|
66
|
+
const child = path.join(dir, entry.name);
|
|
67
|
+
if (entry.isDirectory()) walk(child, childRel);
|
|
68
|
+
else if (entry.isFile()) written.push(childRel);
|
|
69
|
+
else throw new Error(`Selected SAST source produced unsupported path ${childRel}.`);
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
walk(target);
|
|
73
|
+
written.sort();
|
|
74
|
+
if (!same(written, expectedPaths)) throw new Error('Selected SAST extracted tree differs from the fixed manifest.');
|
|
75
|
+
return { ruleIds };
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function main() {
|
|
79
|
+
const work = arg('work') ?? '/tmp/vsg-selected-opengrep';
|
|
80
|
+
try {
|
|
81
|
+
const input = JSON.parse(fs.readFileSync(0, 'utf8') || '{}');
|
|
82
|
+
fs.rmSync(work, { recursive: true, force: true });
|
|
83
|
+
fs.mkdirSync(work, { recursive: true });
|
|
84
|
+
const sourceRoot = path.join(work, 'source');
|
|
85
|
+
stageSelectedSource({
|
|
86
|
+
sourceRoot: arg('source-root'),
|
|
87
|
+
files: input.sourceFiles,
|
|
88
|
+
expectedManifestSha256: input.sourceManifestSha256,
|
|
89
|
+
expectedRuleIdsSha256: input.ruleIdsSha256,
|
|
90
|
+
target: sourceRoot,
|
|
91
|
+
});
|
|
92
|
+
const binary = fs.readFileSync(arg('opengrep'));
|
|
93
|
+
if (sha256(binary) !== input.opengrepSha256) throw new Error('Opengrep checksum mismatch inside selected runner.');
|
|
94
|
+
const opengrep = path.join(work, 'opengrep');
|
|
95
|
+
fs.writeFileSync(opengrep, binary, { mode: 0o755 });
|
|
96
|
+
const result = spawnSync(opengrep, input.args, {
|
|
97
|
+
cwd: arg('root'), encoding: 'utf8', maxBuffer: 64 * 1024 * 1024, timeout: input.timeoutMs,
|
|
98
|
+
env: { PATH: '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', HOME: '/tmp', LANG: 'C.UTF-8', LC_ALL: 'C.UTF-8', PYTHONUTF8: '1' },
|
|
99
|
+
});
|
|
100
|
+
const response = result.error
|
|
101
|
+
? { ok: false, error: `Selected Opengrep could not complete: ${result.error.message}` }
|
|
102
|
+
: { ok: true, result: { status: 'ran', exitCode: result.status ?? -1, stdout: result.stdout ?? '', stderr: result.stderr ?? '', truncated: false } };
|
|
103
|
+
fs.rmSync(work, { recursive: true, force: true });
|
|
104
|
+
process.stdout.write(`${JSON.stringify(response)}\n`);
|
|
105
|
+
} catch (error) {
|
|
106
|
+
fs.rmSync(work, { recursive: true, force: true });
|
|
107
|
+
process.stdout.write(`${JSON.stringify({ ok: false, error: error.message })}\n`);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
import { fileURLToPath } from 'node:url';
|
|
112
|
+
if (process.argv[1] && fileURLToPath(import.meta.url) === path.resolve(process.argv[1])) main();
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
// GuardDog (Datadog) malicious-package scan of changed packages, run in a throwaway container pinned by digest (REQ-010).
|
|
2
|
+
// Only called with names and versions that already passed validation, so nothing here can be read as a container flag.
|
|
3
|
+
import { randomBytes } from 'node:crypto';
|
|
4
|
+
import fs from 'node:fs';
|
|
5
|
+
import path from 'node:path';
|
|
6
|
+
import { sha256 } from '../../core/findings.mjs';
|
|
7
|
+
import { vsgHome } from '../../core/paths.mjs';
|
|
8
|
+
|
|
9
|
+
const GUARDDOG_TIMEOUT_MS = 120_000;
|
|
10
|
+
export const CONCURRENCY = 6;
|
|
11
|
+
export const MAX_GUARDDOG = 25;
|
|
12
|
+
/**
|
|
13
|
+
* Wall-clock budget for all GuardDog scans of one run. A working copy once spent 256 s here (25 scans of 5 to 45 s each, three of them
|
|
14
|
+
* running into the 120 s timeout). No new scan starts after the budget; the ones still running get a short grace period. Packages that were
|
|
15
|
+
* not scanned are counted and reported, never silently dropped.
|
|
16
|
+
*/
|
|
17
|
+
export const BUDGET_MS = 60_000;
|
|
18
|
+
const GRACE_MS = 15_000;
|
|
19
|
+
export const CACHE_TTL_MS = 14 * 24 * 3600_000;
|
|
20
|
+
const HARDEN = ['--cap-drop', 'ALL', '--security-opt', 'no-new-privileges', '--memory', '2g', '--pids-limit', '512'];
|
|
21
|
+
|
|
22
|
+
/** { available, reason } : Docker engine reachable. */
|
|
23
|
+
export async function dockerAvailable(ctx) {
|
|
24
|
+
const r = await ctx.runProcess({ command: 'docker', args: ['version', '--format', '{{.Server.Version}}'], timeoutMs: 20_000 });
|
|
25
|
+
if (r.status !== 'ran') return { available: false, reason: `Docker is not available: ${r.reason}` };
|
|
26
|
+
if (r.exitCode !== 0 || !r.stdout.trim()) return { available: false, reason: 'Docker is installed but its engine is not running' };
|
|
27
|
+
return { available: true, reason: '' };
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** Makes sure the pinned image exists locally (pulling it by digest if needed). Returns null or a reason string. */
|
|
31
|
+
async function ensureImage(ctx, image) {
|
|
32
|
+
const have = await ctx.runProcess({ command: 'docker', args: ['image', 'inspect', '--format', '{{.Id}}', image], timeoutMs: 30_000 });
|
|
33
|
+
if (have.status === 'ran' && have.exitCode === 0) return null;
|
|
34
|
+
const pull = await ctx.runProcess({ command: 'docker', args: ['pull', '--quiet', image], timeoutMs: 600_000 });
|
|
35
|
+
return pull.status === 'ran' && pull.exitCode === 0 ? null : `could not pull ${image}: ${pull.reason ?? pull.stderr.trim().split(/\r?\n/).pop()}`;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** Interprets GuardDog JSON. malicious means GuardDog's own risk engine rated the package high_risk. Capability rules are informational and ignored. */
|
|
39
|
+
export function interpretGuardDog(json) {
|
|
40
|
+
const label = json?.risk_score?.label ?? 'unknown';
|
|
41
|
+
const hit = (v) => v !== null && v !== undefined && !(Array.isArray(v) && v.length === 0) && !(typeof v === 'object' && !Array.isArray(v) && Object.keys(v).length === 0) && v !== '';
|
|
42
|
+
const rules = Object.entries(json?.results ?? {})
|
|
43
|
+
.filter(([rule, v]) => !rule.startsWith('capability-') && hit(v))
|
|
44
|
+
.map(([rule, v]) => {
|
|
45
|
+
const first = Array.isArray(v) ? v[0] : v;
|
|
46
|
+
const where = typeof first === 'object' && first ? first.location ?? '' : '';
|
|
47
|
+
const message = typeof first === 'object' && first ? first.message ?? '' : String(first);
|
|
48
|
+
return { rule, where, message };
|
|
49
|
+
});
|
|
50
|
+
return { label, malicious: label === 'high_risk', rules, errors: Object.keys(json?.errors ?? {}) };
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Disk cache of finished scans. A published package version never changes and the image is pinned by digest, so a clean or flagged
|
|
55
|
+
* result stays valid until the image changes; the TTL only bounds how long a result is trusted. Only successful scans are cached.
|
|
56
|
+
* ctx.guarddogCacheDir: a directory, or null/false to switch the cache off (tests); unset means <vsg home>/cache/guarddog.
|
|
57
|
+
*/
|
|
58
|
+
const cacheDir = (ctx) => (ctx.guarddogCacheDir === undefined ? path.join(vsgHome(), 'cache', 'guarddog') : ctx.guarddogCacheDir || null);
|
|
59
|
+
const cacheFile = (dir, image, p) => path.join(dir, `${sha256(`${image}\0${p.ecosystem}\0${p.name}\0${p.version}`).slice(0, 32)}.json`);
|
|
60
|
+
|
|
61
|
+
export function readCache(ctx, image, p, now = Date.now()) {
|
|
62
|
+
const dir = cacheDir(ctx);
|
|
63
|
+
if (!dir) return null;
|
|
64
|
+
try {
|
|
65
|
+
const e = JSON.parse(fs.readFileSync(cacheFile(dir, image, p), 'utf8'));
|
|
66
|
+
if (e.image === image && e.name === p.name && e.version === p.version && e.ecosystem === p.ecosystem && now - e.at < CACHE_TTL_MS && e.result?.label) return { ok: true, sandbox: e.sandbox, result: e.result, cached: true };
|
|
67
|
+
} catch { /* no usable entry */ }
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function writeCache(ctx, image, p, scan, now = Date.now()) {
|
|
72
|
+
const dir = cacheDir(ctx);
|
|
73
|
+
if (!dir || !scan.ok) return;
|
|
74
|
+
try {
|
|
75
|
+
fs.mkdirSync(dir, { recursive: true, mode: 0o700 });
|
|
76
|
+
const file = cacheFile(dir, image, p);
|
|
77
|
+
const tmp = `${file}.${process.pid}.tmp`;
|
|
78
|
+
fs.writeFileSync(tmp, JSON.stringify({ image, ecosystem: p.ecosystem, name: p.name, version: p.version, at: now, sandbox: scan.sandbox, result: scan.result }), { mode: 0o600 });
|
|
79
|
+
fs.renameSync(tmp, file);
|
|
80
|
+
} catch { /* a cache that cannot be written only costs time */ }
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
async function scanOne(ctx, image, p, name, timeoutMs = GUARDDOG_TIMEOUT_MS) {
|
|
84
|
+
const args = ['run', '--rm', '--name', name, ...HARDEN, image, p.ecosystem === 'PyPI' ? 'pypi' : 'npm', 'scan', p.name, '--version', p.version, '--output-format', 'json'];
|
|
85
|
+
let r = await ctx.runProcess({ command: 'docker', args, timeoutMs });
|
|
86
|
+
let sandbox = 'on';
|
|
87
|
+
// GuardDog refuses to run when it cannot start its own sandbox; the container is already isolated, so retry once without it.
|
|
88
|
+
if (r.status === 'ran' && r.exitCode !== 0 && /sandbox/i.test(`${r.stdout}${r.stderr}`)) {
|
|
89
|
+
sandbox = 'off (container only)';
|
|
90
|
+
r = await ctx.runProcess({ command: 'docker', args: [...args, '--no-sandbox'], timeoutMs });
|
|
91
|
+
}
|
|
92
|
+
if (r.status !== 'ran') {
|
|
93
|
+
await ctx.runProcess({ command: 'docker', args: ['rm', '-f', name], timeoutMs: 30_000 }); // timeout killed the client, not the container
|
|
94
|
+
return { ok: false, reason: r.reason };
|
|
95
|
+
}
|
|
96
|
+
if (r.exitCode !== 0) return { ok: false, reason: `GuardDog exited with code ${r.exitCode}: ${r.stderr.trim().split(/\r?\n/).pop() ?? ''}` };
|
|
97
|
+
const start = r.stdout.indexOf('{');
|
|
98
|
+
let result;
|
|
99
|
+
try { result = interpretGuardDog(JSON.parse(r.stdout.slice(start))); } catch { return { ok: false, reason: 'GuardDog did not return valid JSON' }; }
|
|
100
|
+
// GuardDog exits 0 with an "errors" entry when it could not fetch or analyze the package; that is not a clean result.
|
|
101
|
+
if (result.label === 'unknown' && result.errors.length) return { ok: false, reason: `GuardDog reported ${result.errors.join(', ')} (for example the package was removed from the registry)` };
|
|
102
|
+
return { ok: true, sandbox, result };
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Runs GuardDog on up to MAX_GUARDDOG packages, within BUDGET_MS (ctx.guarddogBudgetMs overrides it). Cached results are used first and cost nothing.
|
|
107
|
+
* Returns { ran, reason, results: [{ package, ok, result|reason, cached? }], skipped (over the package cap), budgetSkipped (not started in time), cached, budgetMs }.
|
|
108
|
+
* `ran` is false when GuardDog was skipped entirely (the check itself still ran).
|
|
109
|
+
*/
|
|
110
|
+
export async function runGuardDog(ctx, packages) {
|
|
111
|
+
const tool = ctx.registry?.get('guarddog');
|
|
112
|
+
if (!tool?.image) return { ran: false, reason: 'GuardDog skipped: it is not in the tool registry', results: [] };
|
|
113
|
+
const docker = await dockerAvailable(ctx);
|
|
114
|
+
if (!docker.available) return { ran: false, reason: `GuardDog skipped: ${docker.reason}`, results: [] };
|
|
115
|
+
const pullProblem = await ensureImage(ctx, tool.image);
|
|
116
|
+
if (pullProblem) return { ran: false, reason: `GuardDog skipped: ${pullProblem}`, results: [] };
|
|
117
|
+
const budgetMs = ctx.guarddogBudgetMs ?? BUDGET_MS;
|
|
118
|
+
const started = Date.now();
|
|
119
|
+
const deadline = started + budgetMs;
|
|
120
|
+
const chosen = packages.slice(0, MAX_GUARDDOG);
|
|
121
|
+
const results = [];
|
|
122
|
+
const queue = [];
|
|
123
|
+
for (const p of chosen) {
|
|
124
|
+
const hit = readCache(ctx, tool.image, p);
|
|
125
|
+
if (hit) results.push({ package: `${p.name}@${p.version}`, ecosystem: p.ecosystem, ...hit });
|
|
126
|
+
else queue.push(p);
|
|
127
|
+
}
|
|
128
|
+
const cached = results.length;
|
|
129
|
+
await Promise.all(Array.from({ length: Math.min(CONCURRENCY, queue.length) }, async () => {
|
|
130
|
+
while (queue.length && Date.now() < deadline) {
|
|
131
|
+
const p = queue.shift();
|
|
132
|
+
const name = `vsg-guarddog-${randomBytes(6).toString('hex')}`;
|
|
133
|
+
const timeoutMs = Math.min(GUARDDOG_TIMEOUT_MS, Math.max(10_000, deadline - Date.now() + GRACE_MS));
|
|
134
|
+
const scan = await scanOne(ctx, tool.image, p, name, timeoutMs);
|
|
135
|
+
writeCache(ctx, tool.image, p, scan);
|
|
136
|
+
results.push({ package: `${p.name}@${p.version}`, ecosystem: p.ecosystem, ...scan });
|
|
137
|
+
}
|
|
138
|
+
}));
|
|
139
|
+
results.sort((a, b) => a.package.localeCompare(b.package));
|
|
140
|
+
const skipped = packages.length - chosen.length;
|
|
141
|
+
return { ran: true, reason: '', image: tool.image, version: tool.version, results, skipped, budgetSkipped: queue.length, cached, budgetMs, durationMs: Date.now() - started };
|
|
142
|
+
}
|