sniff-qa 0.2.1 → 0.4.0
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/README.md +51 -4
- package/dist/chunk-VEI2O6AK.js +34 -0
- package/dist/chunk-VEI2O6AK.js.map +1 -0
- package/dist/classifier-XEA6ZGE7.js +673 -0
- package/dist/classifier-XEA6ZGE7.js.map +1 -0
- package/dist/cli/index.js +132 -5
- package/dist/cli/index.js.map +1 -1
- package/dist/discover-BLUSO42Q.js +228 -0
- package/dist/discover-BLUSO42Q.js.map +1 -0
- package/dist/domain-UQ34YE4B.js +1817 -0
- package/dist/domain-UQ34YE4B.js.map +1 -0
- package/dist/edge-cases-ZADKDZHL.js +246 -0
- package/dist/edge-cases-ZADKDZHL.js.map +1 -0
- package/dist/fix-R33D34NP.js +110 -0
- package/dist/fix-R33D34NP.js.map +1 -0
- package/dist/flakiness-OLJAY7CS.js +53 -0
- package/dist/flakiness-OLJAY7CS.js.map +1 -0
- package/dist/llm-VJAI6H6G.js +126 -0
- package/dist/llm-VJAI6H6G.js.map +1 -0
- package/dist/mcp/server.js +95 -2
- package/dist/mcp/server.js.map +1 -1
- package/dist/{model-SRPWXU63.js → model-2DTSAX7T.js} +6 -6
- package/dist/model-2DTSAX7T.js.map +1 -0
- package/dist/persistence-KTCRIGHU.js +270 -0
- package/dist/persistence-KTCRIGHU.js.map +1 -0
- package/dist/report-SDZWX25B.js +280 -0
- package/dist/report-SDZWX25B.js.map +1 -0
- package/dist/{report-PRUX3BIS.js → report-STC6CAVJ.js} +2 -2
- package/dist/runner-OYTN2NFD.js +996 -0
- package/dist/runner-OYTN2NFD.js.map +1 -0
- package/dist/scenarios-25UAZY6F.js +982 -0
- package/dist/scenarios-25UAZY6F.js.map +1 -0
- package/dist/{source-D5KLH46F.js → source-4DOO224X.js} +3 -3
- package/dist/source-4DOO224X.js.map +1 -0
- package/dist/tiebreak-L5UFNKU2.js +60 -0
- package/dist/tiebreak-L5UFNKU2.js.map +1 -0
- package/dist/{unified-6CTLKH6X.js → unified-2PM442OY.js} +5 -4
- package/dist/unified-2PM442OY.js.map +1 -0
- package/dist/version-FLE7ZHDX.js +7 -0
- package/dist/version-FLE7ZHDX.js.map +1 -0
- package/package.json +1 -1
- package/dist/model-SRPWXU63.js.map +0 -1
- package/dist/source-D5KLH46F.js.map +0 -1
- package/dist/unified-6CTLKH6X.js.map +0 -1
- /package/dist/{report-PRUX3BIS.js.map → report-STC6CAVJ.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/discovery/classifier/signatures/ecommerce.ts","../src/discovery/classifier/signatures/booking.ts","../src/discovery/classifier/signatures/social.ts","../src/discovery/classifier/signatures/saas.ts","../src/discovery/classifier/signatures/content.ts","../src/discovery/classifier/signatures/crm.ts","../src/discovery/classifier/signatures/auth-only.ts","../src/discovery/classifier/signatures/marketing.ts","../src/discovery/classifier/signatures/admin.ts","../src/discovery/classifier/signatures/blank.ts","../src/discovery/classifier/signatures/index.ts","../src/discovery/classifier/index.ts"],"sourcesContent":["import type { Signature } from '../types.js';\n\nexport const ecommerce: Signature = {\n type: 'ecommerce',\n routes: {\n cart: 5,\n checkout: 8,\n product: 4,\n products: 4,\n category: 2,\n categories: 2,\n orders: 3,\n order: 3,\n shop: 3,\n store: 3,\n collection: 2,\n collections: 2,\n wishlist: 2,\n },\n elements: {\n 'add to cart': 5,\n 'add to bag': 5,\n 'buy now': 5,\n checkout: 4,\n quantity: 2,\n price: 1,\n sku: 3,\n 'place order': 5,\n cart: 2,\n 'in stock': 2,\n },\n deps: {\n stripe: 6,\n '@stripe/stripe-js': 6,\n '@stripe/react-stripe-js': 6,\n shopify: 8,\n '@shopify/hydrogen': 8,\n '@shopify/polaris': 6,\n 'commerce.js': 6,\n '@commerce/core': 6,\n medusa: 6,\n '@medusajs/medusa': 6,\n 'use-shopping-cart': 5,\n braintree: 5,\n 'braintree-web': 5,\n paypal: 4,\n '@paypal/react-paypal-js': 5,\n },\n schema: {\n product: 6,\n products: 5,\n order: 6,\n orders: 5,\n orderitem: 5,\n cart: 5,\n cartitem: 4,\n invoice: 3,\n customer: 3,\n inventory: 3,\n sku: 3,\n payment: 4,\n },\n};\n","import type { Signature } from '../types.js';\n\nexport const booking: Signature = {\n type: 'booking',\n routes: {\n booking: 6,\n bookings: 6,\n book: 6,\n reserve: 5,\n reservation: 6,\n reservations: 6,\n reschedule: 4,\n availability: 5,\n listing: 5,\n listings: 5,\n appointment: 6,\n appointments: 6,\n schedule: 4,\n calendar: 3,\n stay: 3,\n stays: 3,\n room: 2,\n rooms: 2,\n },\n elements: {\n 'book now': 6,\n 'reserve now': 5,\n 'check in': 4,\n 'check out': 4,\n 'select dates': 4,\n 'confirm booking': 5,\n availability: 4,\n 'per night': 3,\n guests: 3,\n 'date range': 3,\n },\n deps: {\n fullcalendar: 6,\n '@fullcalendar/core': 6,\n '@fullcalendar/react': 6,\n calendly: 5,\n 'react-day-picker': 4,\n 'react-calendar': 4,\n 'date-fns': 2,\n 'mapbox-gl': 3,\n leaflet: 3,\n 'react-leaflet': 3,\n 'airbnb-js-shims': 5,\n },\n schema: {\n reservation: 6,\n reservations: 5,\n booking: 6,\n bookings: 5,\n listing: 6,\n listings: 5,\n appointment: 6,\n appointments: 5,\n slot: 4,\n slots: 4,\n availability: 4,\n host: 4,\n guest: 3,\n property: 3,\n stay: 3,\n room: 3,\n },\n};\n","import type { Signature } from '../types.js';\n\nexport const social: Signature = {\n type: 'social',\n routes: {\n feed: 6,\n post: 5,\n posts: 5,\n profile: 4,\n profiles: 4,\n friends: 5,\n followers: 5,\n following: 5,\n messages: 5,\n message: 4,\n chat: 4,\n chats: 4,\n notifications: 4,\n timeline: 5,\n comments: 4,\n likes: 4,\n explore: 4,\n groups: 3,\n community: 3,\n },\n elements: {\n like: 3,\n comment: 3,\n share: 3,\n follow: 4,\n unfollow: 4,\n 'send message': 4,\n post: 2,\n repost: 4,\n 'add friend': 5,\n retweet: 5,\n mention: 3,\n },\n deps: {\n 'socket.io': 4,\n 'socket.io-client': 4,\n 'stream-chat-react': 6,\n 'getstream.io': 5,\n pusher: 4,\n 'pusher-js': 4,\n emoji: 2,\n 'emoji-mart': 3,\n },\n schema: {\n post: 6,\n posts: 5,\n comment: 5,\n comments: 4,\n like: 4,\n likes: 3,\n follow: 5,\n follows: 5,\n friend: 4,\n message: 4,\n notification: 3,\n reaction: 4,\n profile: 3,\n },\n};\n","import type { Signature } from '../types.js';\n\nexport const saas: Signature = {\n type: 'saas',\n routes: {\n dashboard: 6,\n settings: 5,\n billing: 6,\n subscription: 5,\n subscriptions: 5,\n onboarding: 5,\n workspace: 5,\n workspaces: 5,\n team: 4,\n teams: 4,\n members: 4,\n invites: 4,\n integrations: 4,\n usage: 3,\n api: 2,\n app: 2,\n },\n elements: {\n 'invite team': 4,\n 'create workspace': 5,\n 'upgrade plan': 5,\n 'start trial': 5,\n 'connect integration': 4,\n 'api key': 4,\n 'manage billing': 5,\n plan: 3,\n seats: 4,\n },\n deps: {\n 'next-auth': 4,\n '@auth/core': 4,\n clerk: 5,\n '@clerk/nextjs': 5,\n '@clerk/clerk-react': 5,\n supabase: 3,\n '@supabase/supabase-js': 3,\n '@supabase/auth-helpers-nextjs': 4,\n stripe: 4,\n '@stripe/stripe-js': 4,\n auth0: 5,\n '@auth0/nextjs-auth0': 5,\n posthog: 3,\n 'posthog-js': 3,\n launchdarkly: 3,\n 'launchdarkly-react-client-sdk': 4,\n sentry: 2,\n '@sentry/nextjs': 3,\n },\n schema: {\n workspace: 6,\n workspaces: 5,\n subscription: 6,\n subscriptions: 5,\n plan: 5,\n user: 3,\n users: 3,\n team: 4,\n teams: 4,\n membership: 4,\n invite: 4,\n apikey: 4,\n apitoken: 4,\n organization: 4,\n org: 3,\n },\n};\n","import type { Signature } from '../types.js';\n\nexport const content: Signature = {\n type: 'content',\n routes: {\n articles: 5,\n article: 5,\n blog: 6,\n post: 4,\n posts: 4,\n read: 4,\n author: 3,\n authors: 3,\n tag: 3,\n tags: 3,\n topic: 3,\n topics: 3,\n category: 3,\n rss: 3,\n feed: 2,\n newsletter: 4,\n search: 2,\n },\n elements: {\n 'read more': 4,\n 'read article': 4,\n subscribe: 3,\n 'newsletter signup': 5,\n 'share article': 3,\n 'estimated reading time': 4,\n 'by author': 3,\n 'published on': 3,\n },\n deps: {\n contentful: 6,\n '@contentful/rich-text-react-renderer': 5,\n sanity: 6,\n '@sanity/client': 6,\n 'next-sanity': 6,\n ghost: 5,\n '@tryghost/content-api': 6,\n 'gray-matter': 4,\n 'remark': 3,\n 'remark-gfm': 3,\n 'rehype': 3,\n 'mdx-bundler': 5,\n '@next/mdx': 5,\n 'next-mdx-remote': 5,\n prismic: 5,\n '@prismicio/client': 5,\n strapi: 5,\n },\n schema: {\n post: 4,\n posts: 4,\n article: 5,\n articles: 4,\n author: 4,\n category: 3,\n tag: 3,\n comment: 2,\n },\n};\n","import type { Signature } from '../types.js';\n\nexport const crm: Signature = {\n type: 'crm',\n routes: {\n contacts: 6,\n contact: 5,\n leads: 6,\n lead: 5,\n deals: 6,\n deal: 5,\n pipeline: 6,\n pipelines: 5,\n accounts: 4,\n account: 3,\n opportunities: 6,\n opportunity: 5,\n tasks: 3,\n task: 3,\n reports: 3,\n activities: 4,\n },\n elements: {\n 'add contact': 5,\n 'create deal': 5,\n 'assign to': 3,\n 'log activity': 4,\n 'next step': 3,\n 'close deal': 5,\n 'move to': 3,\n pipeline: 3,\n 'follow up': 4,\n },\n deps: {\n '@hubspot/api-client': 6,\n 'salesforce-jsforce': 6,\n jsforce: 6,\n 'pipedrive': 6,\n '@sendgrid/mail': 3,\n mailgun: 2,\n },\n schema: {\n contact: 6,\n contacts: 5,\n lead: 6,\n leads: 5,\n deal: 6,\n deals: 5,\n opportunity: 6,\n opportunities: 5,\n account: 4,\n pipeline: 5,\n stage: 4,\n activity: 4,\n task: 3,\n },\n};\n","import type { Signature } from '../types.js';\n\nexport const authOnly: Signature = {\n type: 'auth-only',\n routes: {\n login: 6,\n signin: 6,\n signup: 6,\n register: 6,\n logout: 4,\n 'forgot-password': 5,\n 'reset-password': 5,\n verify: 4,\n auth: 4,\n profile: 3,\n account: 2,\n },\n elements: {\n 'sign in': 5,\n 'log in': 5,\n 'sign up': 5,\n register: 5,\n 'create account': 5,\n 'forgot password': 5,\n 'reset password': 5,\n password: 2,\n email: 1,\n },\n deps: {\n 'next-auth': 5,\n '@auth/core': 5,\n clerk: 5,\n '@clerk/nextjs': 5,\n auth0: 5,\n '@auth0/nextjs-auth0': 5,\n '@supabase/auth-helpers-nextjs': 5,\n 'firebase-auth': 5,\n 'firebase/auth': 5,\n lucia: 5,\n 'lucia-auth': 5,\n },\n schema: {\n user: 3,\n users: 3,\n session: 3,\n sessions: 3,\n account: 2,\n verification: 3,\n },\n};\n","import type { Signature } from '../types.js';\n\nexport const marketing: Signature = {\n type: 'marketing',\n routes: {\n pricing: 6,\n features: 5,\n about: 4,\n contact: 4,\n home: 2,\n faq: 4,\n testimonials: 4,\n customers: 3,\n partners: 3,\n careers: 3,\n 'case-studies': 4,\n demo: 4,\n 'get-started': 3,\n },\n elements: {\n 'get started': 4,\n 'request demo': 5,\n 'book a demo': 5,\n 'contact sales': 5,\n 'start free trial': 5,\n 'learn more': 2,\n 'see pricing': 4,\n testimonial: 3,\n 'our customers': 3,\n },\n deps: {\n '@vercel/analytics': 2,\n 'react-hubspot-form': 4,\n hubspot: 3,\n mailchimp: 3,\n intercom: 4,\n '@intercom/messenger-js-sdk': 4,\n calendly: 3,\n typeform: 3,\n 'react-typeform-embed': 4,\n },\n schema: {\n lead: 3,\n subscriber: 4,\n feedback: 2,\n },\n};\n","import type { Signature } from '../types.js';\n\nexport const admin: Signature = {\n type: 'admin',\n routes: {\n admin: 6,\n dashboard: 3,\n users: 4,\n roles: 4,\n permissions: 5,\n audit: 4,\n logs: 4,\n reports: 3,\n exports: 3,\n moderation: 5,\n settings: 2,\n },\n elements: {\n 'edit row': 4,\n 'delete row': 4,\n 'export csv': 5,\n 'bulk actions': 5,\n 'assign role': 4,\n 'revoke access': 4,\n 'view logs': 3,\n },\n deps: {\n 'react-admin': 7,\n refine: 6,\n '@refinedev/core': 6,\n 'ant-design/pro-components': 5,\n 'mui-datatables': 5,\n '@tanstack/react-table': 4,\n agGrid: 4,\n 'ag-grid-react': 5,\n keystonejs: 5,\n '@keystone-6/core': 5,\n },\n schema: {\n user: 2,\n role: 4,\n permission: 5,\n audit: 4,\n log: 3,\n auditlog: 5,\n },\n};\n","import type { Signature } from '../types.js';\n\nexport const blank: Signature = {\n type: 'blank',\n routes: {},\n elements: {},\n deps: {},\n schema: {},\n};\n","import type { Signature } from '../types.js';\nimport { ecommerce } from './ecommerce.js';\nimport { booking } from './booking.js';\nimport { social } from './social.js';\nimport { saas } from './saas.js';\nimport { content } from './content.js';\nimport { crm } from './crm.js';\nimport { authOnly } from './auth-only.js';\nimport { marketing } from './marketing.js';\nimport { admin } from './admin.js';\nimport { blank } from './blank.js';\n\nexport const SIGNATURES: Signature[] = [\n ecommerce,\n booking,\n social,\n saas,\n content,\n crm,\n authOnly,\n marketing,\n admin,\n blank,\n];\n","import type { DomainSnapshot } from '../types.js';\nimport { SIGNATURES } from './signatures/index.js';\nimport type { AppType, AppTypeGuess, Evidence, Signature } from './types.js';\n\nconst MIN_CONFIDENCE_TO_KEEP = 0.1;\n\nconst STOPWORDS = new Set([\n 'a', 'an', 'the', 'and', 'or', 'to', 'for', 'of', 'in', 'on', 'at',\n]);\n\nfunction tokenize(s: string): string[] {\n return s\n .toLowerCase()\n .split(/[^a-z0-9]+/)\n .filter((t) => t.length >= 2 && !STOPWORDS.has(t));\n}\n\nfunction signatureTotalWeight(signature: Signature): number {\n let total = 0;\n for (const weight of Object.values(signature.routes)) total += weight;\n for (const weight of Object.values(signature.elements)) total += weight;\n for (const weight of Object.values(signature.deps)) total += weight;\n for (const weight of Object.values(signature.schema)) total += weight;\n return total;\n}\n\nfunction scoreRoutes(\n signature: Signature,\n routeTokens: Set<string>,\n): { score: number; evidence: Evidence[] } {\n let score = 0;\n const evidence: Evidence[] = [];\n for (const [token, weight] of Object.entries(signature.routes)) {\n if (routeTokens.has(token)) {\n score += weight;\n evidence.push({ signal: 'route', value: token, weight });\n }\n }\n return { score, evidence };\n}\n\nfunction scoreElements(\n signature: Signature,\n elementTokens: Set<string>,\n): { score: number; evidence: Evidence[] } {\n let score = 0;\n const evidence: Evidence[] = [];\n for (const [phrase, weight] of Object.entries(signature.elements)) {\n const phraseTokens = tokenize(phrase);\n if (phraseTokens.length === 0) continue;\n const allPresent = phraseTokens.every((t) => elementTokens.has(t));\n if (allPresent) {\n score += weight;\n evidence.push({ signal: 'element', value: phrase, weight });\n }\n }\n return { score, evidence };\n}\n\nfunction scoreDeps(\n signature: Signature,\n deps: Set<string>,\n): { score: number; evidence: Evidence[] } {\n let score = 0;\n const evidence: Evidence[] = [];\n for (const [dep, weight] of Object.entries(signature.deps)) {\n if (deps.has(dep)) {\n score += weight;\n evidence.push({ signal: 'dep', value: dep, weight });\n }\n }\n return { score, evidence };\n}\n\nfunction scoreSchema(\n signature: Signature,\n entityNames: Set<string>,\n): { score: number; evidence: Evidence[] } {\n let score = 0;\n const evidence: Evidence[] = [];\n for (const [entityKey, weight] of Object.entries(signature.schema)) {\n if (entityNames.has(entityKey)) {\n score += weight;\n evidence.push({ signal: 'schema', value: entityKey, weight });\n }\n }\n return { score, evidence };\n}\n\nfunction scoreSignature(signature: Signature, snapshot: DomainSnapshot): AppTypeGuess {\n const routeTokens = new Set(snapshot.vocabulary.routes);\n const elementTokens = new Set(snapshot.vocabulary.elements);\n const deps = new Set(snapshot.vocabulary.deps);\n const entityNames = new Set(snapshot.entities.map((e) => e.name.toLowerCase()));\n\n const r = scoreRoutes(signature, routeTokens);\n const el = scoreElements(signature, elementTokens);\n const d = scoreDeps(signature, deps);\n const s = scoreSchema(signature, entityNames);\n\n const rawScore = r.score + el.score + d.score + s.score;\n const evidence = [...r.evidence, ...el.evidence, ...d.evidence, ...s.evidence];\n\n const totalWeight = signatureTotalWeight(signature);\n const confidence = totalWeight > 0 ? Math.min(rawScore / totalWeight, 1) : 0;\n\n return {\n type: signature.type,\n confidence,\n evidence,\n rawScore,\n };\n}\n\nfunction applyBlankFallback(guesses: AppTypeGuess[]): AppTypeGuess[] {\n const nonBlank = guesses.filter((g) => g.type !== 'blank');\n const topNonBlank = nonBlank.reduce(\n (max, g) => (g.confidence > max ? g.confidence : max),\n 0,\n );\n\n if (topNonBlank >= MIN_CONFIDENCE_TO_KEEP) {\n return guesses.filter((g) => g.type !== 'blank' || topNonBlank < 0.05);\n }\n\n return guesses.map((g) =>\n g.type === 'blank'\n ? { ...g, confidence: 1, rawScore: 0, evidence: [{ signal: 'pkg', value: 'no signals matched any signature', weight: 0 }] }\n : g,\n );\n}\n\nexport function classifyApp(snapshot: DomainSnapshot): AppTypeGuess[] {\n const raw = SIGNATURES.map((signature) => scoreSignature(signature, snapshot));\n const withBlank = applyBlankFallback(raw);\n return withBlank\n .filter((g) => g.confidence >= MIN_CONFIDENCE_TO_KEEP)\n .sort((a, b) => b.confidence - a.confidence);\n}\n\nexport function topAppType(snapshot: DomainSnapshot): AppType {\n const ranked = classifyApp(snapshot);\n return ranked[0]?.type ?? 'blank';\n}\n"],"mappings":";AAEO,IAAM,YAAuB;AAAA,EAClC,MAAM;AAAA,EACN,QAAQ;AAAA,IACN,MAAM;AAAA,IACN,UAAU;AAAA,IACV,SAAS;AAAA,IACT,UAAU;AAAA,IACV,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,MAAM;AAAA,IACN,OAAO;AAAA,IACP,YAAY;AAAA,IACZ,aAAa;AAAA,IACb,UAAU;AAAA,EACZ;AAAA,EACA,UAAU;AAAA,IACR,eAAe;AAAA,IACf,cAAc;AAAA,IACd,WAAW;AAAA,IACX,UAAU;AAAA,IACV,UAAU;AAAA,IACV,OAAO;AAAA,IACP,KAAK;AAAA,IACL,eAAe;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E7ZHDX.js");
|
|
27
28
|
const program = new Command();
|
|
28
|
-
program.name("sniff").description("AI-powered QA testing framework").version(
|
|
29
|
-
program.argument("[target]", "Project directory to scan (default: current directory)").option("--url <url>", "Target URL \u2014 enables full audit (a11y, visual, perf, AI explorer)").option("--ci", "CI mode: headless, JUnit XML, flakiness tracking, no AI exploration").option("--no-browser", "Force source-only scan even if URL is configured").option("--no-explore", "Skip AI exploration (browser tests still run)").option("--max-steps <n>", "Cap AI exploration steps (default: 50)").option("--no-headless", "Show the browser window").option("--format <formats>", "Report formats: html, json, junit (comma-separated)").option("--fail-on <severities>", "Exit non-zero on these severities (default: critical,high)", "critical,high").option("--json", "Output results as JSON").option("--track-flakes", "Track test flakiness across runs").action(async (target, options) => {
|
|
30
|
-
const { unifiedCommand } = await import("../unified-6CTLKH6X.js");
|
|
31
|
-
const { loadConfig } = await import("../loader-QII5CZSX.js");
|
|
29
|
+
program.name("sniff").description("AI-powered QA testing framework").version(getVersion());
|
|
30
|
+
program.argument("[target]", "Project directory to scan (default: current directory)").option("--url <url>", "Target URL \u2014 enables full audit (a11y, visual, perf, AI explorer)").option("--ci", "CI mode: headless, JUnit XML, flakiness tracking, no AI exploration").option("--no-browser", "Force source-only scan even if URL is configured").option("--no-explore", "Skip AI exploration (browser tests still run)").option("--max-steps <n>", "Cap AI exploration steps (default: 50)").option("--no-headless", "Show the browser window").option("--format <formats>", "Report formats: html, json, junit (comma-separated)").option("--fail-on <severities>", "Exit non-zero on these severities (default: critical,high)", "critical,high").option("--json", "Output results as JSON").option("--track-flakes", "Track test flakiness across runs").option("--discover", "Run autonomous E2E discovery (scenarios + edge cases)").option("--max-scenarios <n>", "Cap total scenarios for discovery (default: 50)").option("--max-variants-per-scenario <n>", "Cap edge variants per scenario (default: 3)").option("--max-variants-per-run <n>", "Cap edge variants per run (default: 40)").option("--realism <profile>", "Discovery realism: robot, careful-user, casual-user, frustrated-user, power-user").option("--seed <n>", "Replay a specific random seed").option("--only <filter>", "Filter discovery scenarios by id substring or app type").option("--app-type <types>", "Force discovery app types (comma-separated)").option("--no-llm", "Disable LLM-backed discovery polish").option("--non-interactive", "Non-interactive mode for discovery (skips prompts and countdown)").option("--regenerate", "Regenerate sniff-scenarios/ before running (prompts on hand-edits)").option("--regenerate-only", "Regenerate sniff-scenarios/ and exit without running").option("--force-regenerate", "Regenerate sniff-scenarios/ and overwrite hand-edits").action(async (target, options) => {
|
|
32
31
|
const rootDir = target ? (await import("path")).resolve(target) : process.cwd();
|
|
32
|
+
if (options.discover || options.regenerate || options.regenerateOnly || options.forceRegenerate) {
|
|
33
|
+
if (!options.regenerateOnly) {
|
|
34
|
+
await ensurePlaywrightBrowsers();
|
|
35
|
+
}
|
|
36
|
+
const { discoverCommand } = await import("../discover-BLUSO42Q.js");
|
|
37
|
+
const appTypes = typeof options.appType === "string" ? options.appType.split(",").map((s) => s.trim()).filter(Boolean) : void 0;
|
|
38
|
+
const result = await discoverCommand({
|
|
39
|
+
rootDir,
|
|
40
|
+
url: options.url,
|
|
41
|
+
headless: options.headless,
|
|
42
|
+
ci: options.ci,
|
|
43
|
+
json: options.json,
|
|
44
|
+
...options.maxScenarios ? { maxScenarios: parseInt(options.maxScenarios, 10) } : {},
|
|
45
|
+
...options.maxVariantsPerScenario ? { maxVariantsPerScenario: parseInt(options.maxVariantsPerScenario, 10) } : {},
|
|
46
|
+
...options.maxVariantsPerRun ? { maxVariantsPerRun: parseInt(options.maxVariantsPerRun, 10) } : {},
|
|
47
|
+
...options.realism ? { realism: options.realism } : {},
|
|
48
|
+
...options.seed ? { seed: parseInt(options.seed, 10) } : {},
|
|
49
|
+
...options.only ? { only: options.only } : {},
|
|
50
|
+
...appTypes ? { appType: appTypes } : {},
|
|
51
|
+
...options.llm === false ? { noLlm: true } : {},
|
|
52
|
+
...options.nonInteractive ? { nonInteractive: true } : {},
|
|
53
|
+
...options.format ? { format: options.format } : {},
|
|
54
|
+
...options.regenerate ? { regenerate: true } : {},
|
|
55
|
+
...options.regenerateOnly ? { regenerateOnly: true } : {},
|
|
56
|
+
...options.forceRegenerate ? { regenerate: true, forceRegenerate: true } : {}
|
|
57
|
+
});
|
|
58
|
+
process.exit(result.exitCode);
|
|
59
|
+
}
|
|
60
|
+
const { unifiedCommand } = await import("../unified-2PM442OY.js");
|
|
61
|
+
const { loadConfig } = await import("../loader-QII5CZSX.js");
|
|
33
62
|
const config = await loadConfig(rootDir);
|
|
34
63
|
let url = options.url ?? config.browser?.baseUrl;
|
|
35
64
|
if (!url && options.browser !== false) {
|
|
@@ -72,13 +101,111 @@ if (process.argv.includes("--mcp")) {
|
|
|
72
101
|
await ciCommand(options);
|
|
73
102
|
});
|
|
74
103
|
program.command("report").description("View last scan results").option("--json", "Output as JSON").option("--format <formats>", "Regenerate report in specified formats (comma-separated: html,json,junit)").option("--output <dir>", "Output directory for regenerated reports").action(async (options) => {
|
|
75
|
-
const { reportCommand } = await import("../report-
|
|
104
|
+
const { reportCommand } = await import("../report-STC6CAVJ.js");
|
|
76
105
|
await reportCommand(options);
|
|
77
106
|
});
|
|
78
107
|
program.command("update-baselines").description("Update visual regression baselines").option("--yes", "Skip confirmation prompt").action(async (options) => {
|
|
79
108
|
const { updateBaselinesCommand } = await import("../update-baselines-MDTCFO2U.js");
|
|
80
109
|
await updateBaselinesCommand(options);
|
|
81
110
|
});
|
|
111
|
+
program.command("discover").description("Run autonomous E2E discovery (scenarios + edge cases)").argument("[target]", "Project directory (default: current directory)").option("--url <url>", "Target URL (default: auto-detect dev server)").option("--ci", "CI mode: headless, robot realism, no countdown, JUnit output").option("--no-headless", "Show the browser window").option("--format <formats>", "Report formats: html, json, junit (comma-separated)").option("--json", "Output results as JSON").option("--max-scenarios <n>", "Cap total scenarios (default: 50)").option("--max-variants-per-scenario <n>", "Cap edge variants per scenario (default: 3)").option("--max-variants-per-run <n>", "Cap edge variants per run (default: 40)").option("--realism <profile>", "Realism: robot, careful-user, casual-user, frustrated-user, power-user").option("--seed <n>", "Replay a specific random seed").option("--only <filter>", "Filter scenarios by id substring or app type").option("--app-type <types>", "Force app types (comma-separated)").option("--no-llm", "Disable LLM-backed polish").option("--non-interactive", "Skip prompts and the production-URL countdown").option("--regenerate", "Regenerate sniff-scenarios/ before running (prompts on hand-edits)").option("--regenerate-only", "Regenerate sniff-scenarios/ and exit without running").option("--force-regenerate", "Regenerate sniff-scenarios/ and overwrite hand-edits").action(async (target, options) => {
|
|
112
|
+
if (!options.regenerateOnly) {
|
|
113
|
+
await ensurePlaywrightBrowsers();
|
|
114
|
+
}
|
|
115
|
+
const rootDir = target ? (await import("path")).resolve(target) : process.cwd();
|
|
116
|
+
const { discoverCommand } = await import("../discover-BLUSO42Q.js");
|
|
117
|
+
const appTypes = typeof options.appType === "string" ? options.appType.split(",").map((s) => s.trim()).filter(Boolean) : void 0;
|
|
118
|
+
const result = await discoverCommand({
|
|
119
|
+
rootDir,
|
|
120
|
+
url: options.url,
|
|
121
|
+
headless: options.headless,
|
|
122
|
+
ci: options.ci,
|
|
123
|
+
json: options.json,
|
|
124
|
+
...options.maxScenarios ? { maxScenarios: parseInt(options.maxScenarios, 10) } : {},
|
|
125
|
+
...options.maxVariantsPerScenario ? { maxVariantsPerScenario: parseInt(options.maxVariantsPerScenario, 10) } : {},
|
|
126
|
+
...options.maxVariantsPerRun ? { maxVariantsPerRun: parseInt(options.maxVariantsPerRun, 10) } : {},
|
|
127
|
+
...options.realism ? { realism: options.realism } : {},
|
|
128
|
+
...options.seed ? { seed: parseInt(options.seed, 10) } : {},
|
|
129
|
+
...options.only ? { only: options.only } : {},
|
|
130
|
+
...appTypes ? { appType: appTypes } : {},
|
|
131
|
+
...options.llm === false ? { noLlm: true } : {},
|
|
132
|
+
...options.nonInteractive ? { nonInteractive: true } : {},
|
|
133
|
+
...options.format ? { format: options.format } : {},
|
|
134
|
+
...options.regenerate ? { regenerate: true } : {},
|
|
135
|
+
...options.regenerateOnly ? { regenerateOnly: true } : {},
|
|
136
|
+
...options.forceRegenerate ? { regenerate: true, forceRegenerate: true } : {}
|
|
137
|
+
});
|
|
138
|
+
process.exit(result.exitCode);
|
|
139
|
+
});
|
|
140
|
+
program.command("fix").description("Auto-fix safe issues (removes debugger, console.log/debug/info)").argument("[target]", "Project directory (default: current directory)").option("--check", "Dry run: show what would be fixed without changing files").option("--json", "Output results as JSON").action(async (target, options) => {
|
|
141
|
+
const { fixCommand } = await import("../fix-R33D34NP.js");
|
|
142
|
+
const rootDir = target ? (await import("path")).resolve(target) : process.cwd();
|
|
143
|
+
await fixCommand({ rootDir, dryRun: !!options.check, json: !!options.json });
|
|
144
|
+
});
|
|
145
|
+
program.command("doctor").description("Check your environment: Node.js, Playwright, config, dev server").action(async () => {
|
|
146
|
+
const pc = (await import("picocolors")).default;
|
|
147
|
+
const rootDir = process.cwd();
|
|
148
|
+
console.log(`
|
|
149
|
+
${pc.bold("sniff doctor")}
|
|
150
|
+
`);
|
|
151
|
+
const nodeVersion = process.version;
|
|
152
|
+
const nodeMajor = parseInt(nodeVersion.slice(1), 10);
|
|
153
|
+
const nodeOk = nodeMajor >= 22;
|
|
154
|
+
console.log(` ${nodeOk ? pc.green("OK") : pc.red("!! ")} Node.js ${nodeVersion} ${nodeOk ? "" : "(need 22+)"}`);
|
|
155
|
+
let playwrightOk = false;
|
|
156
|
+
try {
|
|
157
|
+
const { chromium } = await import("playwright");
|
|
158
|
+
chromium.executablePath();
|
|
159
|
+
playwrightOk = true;
|
|
160
|
+
} catch {
|
|
161
|
+
}
|
|
162
|
+
console.log(` ${playwrightOk ? pc.green("OK") : pc.yellow("--")} Playwright ${playwrightOk ? "installed" : "not installed (auto-installs on first browser scan)"}`);
|
|
163
|
+
const { loadConfig } = await import("../loader-QII5CZSX.js");
|
|
164
|
+
let hasConfig = false;
|
|
165
|
+
try {
|
|
166
|
+
const config = await loadConfig(rootDir);
|
|
167
|
+
hasConfig = !!config.browser?.baseUrl;
|
|
168
|
+
console.log(` ${pc.green("OK")} Config loaded${hasConfig ? ` (baseUrl: ${config.browser?.baseUrl})` : " (defaults)"}`);
|
|
169
|
+
} catch {
|
|
170
|
+
console.log(` ${pc.green("OK")} No config file (using defaults)`);
|
|
171
|
+
}
|
|
172
|
+
const { detectDevServerUrl, getDevCommand } = await import("../dev-server-detector-NJ5RN4IC.js");
|
|
173
|
+
const detection = await detectDevServerUrl(rootDir);
|
|
174
|
+
if (detection.url) {
|
|
175
|
+
console.log(` ${pc.green("OK")} Dev server found at ${pc.bold(detection.url)} (${detection.detail})`);
|
|
176
|
+
} else {
|
|
177
|
+
const devCmd = await getDevCommand(rootDir);
|
|
178
|
+
console.log(` ${pc.yellow("--")} No dev server running${devCmd ? ` (try: ${devCmd})` : ""}`);
|
|
179
|
+
}
|
|
180
|
+
try {
|
|
181
|
+
const { readFile } = await import("fs/promises");
|
|
182
|
+
const { join } = await import("path");
|
|
183
|
+
const pkg = JSON.parse(await readFile(join(rootDir, "package.json"), "utf-8"));
|
|
184
|
+
console.log(` ${pc.green("OK")} package.json found (${pkg.name ?? "unnamed"})`);
|
|
185
|
+
} catch {
|
|
186
|
+
console.log(` ${pc.yellow("--")} No package.json in current directory`);
|
|
187
|
+
}
|
|
188
|
+
try {
|
|
189
|
+
const { readdir, stat } = await import("fs/promises");
|
|
190
|
+
const { join } = await import("path");
|
|
191
|
+
const scenariosDir = join(rootDir, "sniff-scenarios");
|
|
192
|
+
const st = await stat(scenariosDir);
|
|
193
|
+
if (st.isDirectory()) {
|
|
194
|
+
const entries = await readdir(scenariosDir, { recursive: true });
|
|
195
|
+
const count = entries.filter(
|
|
196
|
+
(e) => typeof e === "string" && e.endsWith(".scenario.md")
|
|
197
|
+
).length;
|
|
198
|
+
if (count > 0) {
|
|
199
|
+
console.log(` ${pc.green("OK")} sniff-scenarios/ found (${count} scenario${count === 1 ? "" : "s"})`);
|
|
200
|
+
} else {
|
|
201
|
+
console.log(` ${pc.yellow("--")} sniff-scenarios/ exists but has no .scenario.md files`);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
} catch {
|
|
205
|
+
console.log(` ${pc.yellow("--")} No sniff-scenarios/ (run 'sniff discover' to generate)`);
|
|
206
|
+
}
|
|
207
|
+
console.log("");
|
|
208
|
+
});
|
|
82
209
|
await program.parseAsync();
|
|
83
210
|
}
|
|
84
211
|
//# sourceMappingURL=index.js.map
|
package/dist/cli/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/cli/index.ts"],"sourcesContent":["#!/usr/bin/env node\n\n// MCP server mode bypasses CLI entirely\nif (process.argv.includes('--mcp')) {\n const { startMcpServer } = await import('../mcp/server.js');\n await startMcpServer();\n} else {\n const { Command } = await import('commander');\n\n async function ensurePlaywrightBrowsers(): Promise<void> {\n try {\n const { chromium } = await import('playwright');\n chromium.executablePath();\n } catch {\n const pc = (await import('picocolors')).default;\n console.log(pc.yellow('\\nPlaywright browsers not installed.'));\n console.log(pc.dim('Installing Chromium (required for browser testing)...\\n'));\n const { execSync } = await import('node:child_process');\n try {\n execSync('npx playwright install chromium', { stdio: 'inherit' });\n console.log('');\n } catch {\n console.error(pc.red('Failed to install Playwright browsers. Run manually: npx playwright install chromium'));\n process.exit(1);\n }\n }\n }\n\n const program = new Command();\n\n program\n .name('sniff')\n .description('AI-powered QA testing framework')\n .version('0.2.0');\n\n // ── Default command: unified scan ──────────────────────────────\n // `sniff` → source scan only\n // `sniff --url <url>` → everything (source + a11y + visual + perf + AI explore)\n // `sniff --url X --ci` → everything except exploration (deterministic for CI)\n program\n .argument('[target]', 'Project directory to scan (default: current directory)')\n .option('--url <url>', 'Target URL — enables full audit (a11y, visual, perf, AI explorer)')\n .option('--ci', 'CI mode: headless, JUnit XML, flakiness tracking, no AI exploration')\n .option('--no-browser', 'Force source-only scan even if URL is configured')\n .option('--no-explore', 'Skip AI exploration (browser tests still run)')\n .option('--max-steps <n>', 'Cap AI exploration steps (default: 50)')\n .option('--no-headless', 'Show the browser window')\n .option('--format <formats>', 'Report formats: html, json, junit (comma-separated)')\n .option('--fail-on <severities>', 'Exit non-zero on these severities (default: critical,high)', 'critical,high')\n .option('--json', 'Output results as JSON')\n .option('--track-flakes', 'Track test flakiness across runs')\n .action(async (target, options) => {\n const { unifiedCommand } = await import('./commands/unified.js');\n const { loadConfig } = await import('../config/loader.js');\n\n const rootDir = target ? (await import('node:path')).resolve(target) : process.cwd();\n const config = await loadConfig(rootDir);\n\n // URL resolution: flag → config → auto-detect\n let url = options.url ?? config.browser?.baseUrl;\n\n if (!url && options.browser !== false) {\n const { detectDevServerUrl } = await import('../config/dev-server-detector.js');\n const detection = await detectDevServerUrl(rootDir);\n if (detection.url) {\n url = detection.url;\n if (!options.json) {\n const pc = (await import('picocolors')).default;\n console.log(`${pc.green('[auto]')} Found dev server at ${pc.bold(url)} (${detection.detail})\\n`);\n }\n }\n }\n\n const wantsBrowser = !!url && options.browser !== false;\n\n // Exploration is default-ON when browser tests run, default-OFF in CI\n const isCi = options.ci || !!process.env.CI;\n const wantsExplore = wantsBrowser && options.explore !== false && !isCi;\n\n if (wantsBrowser) {\n await ensurePlaywrightBrowsers();\n }\n\n await unifiedCommand({\n rootDir,\n url: wantsBrowser ? url : undefined,\n explore: wantsExplore,\n maxSteps: options.maxSteps,\n headless: options.headless,\n format: options.format,\n failOn: options.failOn,\n json: options.json,\n ci: options.ci,\n trackFlakes: options.trackFlakes,\n });\n });\n\n // ── Utility commands ───────────────────────────────────────────\n\n program\n .command('init')\n .description('Generate a sniff config file')\n .option('--force', 'Overwrite existing config')\n .action(async (options) => {\n const { initCommand } = await import('./commands/init.js');\n await initCommand(options);\n });\n\n program\n .command('ci')\n .description('Generate a GitHub Actions workflow')\n .option('--output <path>', 'Output path for workflow file', '.github/workflows/sniff.yml')\n .option('--force', 'Overwrite existing workflow file')\n .option('--package-name <name>', 'npm package name for npx command', 'sniff-qa')\n .action(async (options) => {\n const { ciCommand } = await import('./commands/ci.js');\n await ciCommand(options);\n });\n\n program\n .command('report')\n .description('View last scan results')\n .option('--json', 'Output as JSON')\n .option('--format <formats>', 'Regenerate report in specified formats (comma-separated: html,json,junit)')\n .option('--output <dir>', 'Output directory for regenerated reports')\n .action(async (options) => {\n const { reportCommand } = await import('./commands/report.js');\n await reportCommand(options);\n });\n\n program\n .command('update-baselines')\n .description('Update visual regression baselines')\n .option('--yes', 'Skip confirmation prompt')\n .action(async (options) => {\n const { updateBaselinesCommand } = await import('./commands/update-baselines.js');\n await updateBaselinesCommand(options);\n });\n\n await program.parseAsync();\n}\n"],"mappings":";;;AAGA,IAAI,QAAQ,KAAK,SAAS,OAAO,GAAG;AAClC,QAAM,EAAE,eAAe,IAAI,MAAM,OAAO,kBAAkB;AAC1D,QAAM,eAAe;AACvB,OAAO;AACL,QAAM,EAAE,QAAQ,IAAI,MAAM,OAAO,WAAW;AAE5C,iBAAe,2BAA0C;AACvD,QAAI;AACF,YAAM,EAAE,SAAS,IAAI,MAAM,OAAO,YAAY;AAC9C,eAAS,eAAe;AAAA,IAC1B,QAAQ;AACN,YAAM,MAAM,MAAM,OAAO,YAAY,GAAG;AACxC,cAAQ,IAAI,GAAG,OAAO,sCAAsC,CAAC;AAC7D,cAAQ,IAAI,GAAG,IAAI,yDAAyD,CAAC;AAC7E,YAAM,EAAE,SAAS,IAAI,MAAM,OAAO,eAAoB;AACtD,UAAI;AACF,iBAAS,mCAAmC,EAAE,OAAO,UAAU,CAAC;AAChE,gBAAQ,IAAI,EAAE;AAAA,MAChB,QAAQ;AACN,gBAAQ,MAAM,GAAG,IAAI,sFAAsF,CAAC;AAC5G,gBAAQ,KAAK,CAAC;AAAA,MAChB;AAAA,IACF;AAAA,EACF;AAEA,QAAM,UAAU,IAAI,QAAQ;AAE5B,UACG,KAAK,OAAO,EACZ,YAAY,iCAAiC,EAC7C,QAAQ,OAAO;AAMlB,UACG,SAAS,YAAY,wDAAwD,EAC7E,OAAO,eAAe,wEAAmE,EACzF,OAAO,QAAQ,qEAAqE,EACpF,OAAO,gBAAgB,kDAAkD,EACzE,OAAO,gBAAgB,+CAA+C,EACt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AAQ;AAAA,MAChB,QAAQ,QAAQ;AAAA,MAChB,MAAM,QAAQ;AAAA,MACd,IAAI,QAAQ;AAAA,MACZ,aAAa,QAAQ;AAAA,IACvB,CAAC;AAAA,EACH,CAAC;AAIH,UACG,QAAQ,MAAM,EACd,YAAY,8BAA8B,EAC1C,OAAO,WAAW,2BAA2B,EAC7C,OAAO,OAAO,YAAY;AACzB,UAAM,EAAE,YAAY,IAAI,MAAM,OAAO,qBAAoB;AACzD,UAAM,YAAY,OAAO;AAAA,EAC3B,CAAC;AAEH,UACG,QAAQ,IAAI,EACZ,YAAY,oCAAoC,EAChD,OAAO,mBAAmB,iCAAiC,6BAA6B,EACxF,OAAO,WAAW,kCAAkC,EACpD,OAAO,yBAAyB,oCAAoC,UAAU,EAC9E,OAAO,OAAO,YAAY;AACzB,UAAM,EAAE,UAAU,IAAI,MAAM,OAAO,mBAAkB;AACrD,UAAM,UAAU,OAAO;AAAA,EACzB,CAAC;AAEH,UACG,QAAQ,QAAQ,EAChB,YAAY,wBAAwB,EACpC,OAAO,UAAU,gBAAgB,EACjC,OAAO,sBAAsB,2EAA2E,EACxG,OAAO,kBAAkB,0CAA0C,EACnE,OAAO,OAAO,YAAY;AACzB,UAAM,EAAE,cAAc,IAAI,MAAM,OAAO,uBAAsB;AAC7D,UAAM,cAAc,OAAO;AAAA,EAC7B,CAAC;AAEH,UACG,QAAQ,kBAAkB,EAC1B,YAAY,oCAAoC,EAChD,OAAO,SAAS,0BAA0B,EAC1C,OAAO,OAAO,YAAY;AACzB,UAAM,EAAE,uBAAuB,IAAI,MAAM,OAAO,iCAAgC;AAChF,UAAM,uBAAuB,OAAO;AAAA,EACtC,CAAC;AAEH,QAAM,QAAQ,WAAW;AAC3B;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/cli/index.ts"],"sourcesContent":["#!/usr/bin/env node\n\n// MCP server mode bypasses CLI entirely\nif (process.argv.includes('--mcp')) {\n const { startMcpServer } = await import('../mcp/server.js');\n await startMcpServer();\n} else {\n const { Command } = await import('commander');\n\n async function ensurePlaywrightBrowsers(): Promise<void> {\n try {\n const { chromium } = await import('playwright');\n chromium.executablePath();\n } catch {\n const pc = (await import('picocolors')).default;\n console.log(pc.yellow('\\nPlaywright browsers not installed.'));\n console.log(pc.dim('Installing Chromium (required for browser testing)...\\n'));\n const { execSync } = await import('node:child_process');\n try {\n execSync('npx playwright install chromium', { stdio: 'inherit' });\n console.log('');\n } catch {\n console.error(pc.red('Failed to install Playwright browsers. Run manually: npx playwright install chromium'));\n process.exit(1);\n }\n }\n }\n\n const { getVersion } = await import('../version.js');\n\n const program = new Command();\n\n program\n .name('sniff')\n .description('AI-powered QA testing framework')\n .version(getVersion());\n\n // ── Default command: unified scan ──────────────────────────────\n // `sniff` → source scan + auto-detect dev server\n // `sniff --url <url>` → everything (source + a11y + visual + perf + AI explore)\n // `sniff --url X --ci` → everything except exploration (deterministic for CI)\n program\n .argument('[target]', 'Project directory to scan (default: current directory)')\n .option('--url <url>', 'Target URL — enables full audit (a11y, visual, perf, AI explorer)')\n .option('--ci', 'CI mode: headless, JUnit XML, flakiness tracking, no AI exploration')\n .option('--no-browser', 'Force source-only scan even if URL is configured')\n .option('--no-explore', 'Skip AI exploration (browser tests still run)')\n .option('--max-steps <n>', 'Cap AI exploration steps (default: 50)')\n .option('--no-headless', 'Show the browser window')\n .option('--format <formats>', 'Report formats: html, json, junit (comma-separated)')\n .option('--fail-on <severities>', 'Exit non-zero on these severities (default: critical,high)', 'critical,high')\n .option('--json', 'Output results as JSON')\n .option('--track-flakes', 'Track test flakiness across runs')\n .option('--discover', 'Run autonomous E2E discovery (scenarios + edge cases)')\n .option('--max-scenarios <n>', 'Cap total scenarios for discovery (default: 50)')\n .option('--max-variants-per-scenario <n>', 'Cap edge variants per scenario (default: 3)')\n .option('--max-variants-per-run <n>', 'Cap edge variants per run (default: 40)')\n .option('--realism <profile>', 'Discovery realism: robot, careful-user, casual-user, frustrated-user, power-user')\n .option('--seed <n>', 'Replay a specific random seed')\n .option('--only <filter>', 'Filter discovery scenarios by id substring or app type')\n .option('--app-type <types>', 'Force discovery app types (comma-separated)')\n .option('--no-llm', 'Disable LLM-backed discovery polish')\n .option('--non-interactive', 'Non-interactive mode for discovery (skips prompts and countdown)')\n .option('--regenerate', 'Regenerate sniff-scenarios/ before running (prompts on hand-edits)')\n .option('--regenerate-only', 'Regenerate sniff-scenarios/ and exit without running')\n .option('--force-regenerate', 'Regenerate sniff-scenarios/ and overwrite hand-edits')\n .action(async (target, options) => {\n const rootDir = target ? (await import('node:path')).resolve(target) : process.cwd();\n\n if (options.discover || options.regenerate || options.regenerateOnly || options.forceRegenerate) {\n if (!options.regenerateOnly) {\n await ensurePlaywrightBrowsers();\n }\n const { discoverCommand } = await import('./commands/discover.js');\n const appTypes = typeof options.appType === 'string'\n ? options.appType.split(',').map((s: string) => s.trim()).filter(Boolean)\n : undefined;\n const result = await discoverCommand({\n rootDir,\n url: options.url,\n headless: options.headless,\n ci: options.ci,\n json: options.json,\n ...(options.maxScenarios ? { maxScenarios: parseInt(options.maxScenarios, 10) } : {}),\n ...(options.maxVariantsPerScenario ? { maxVariantsPerScenario: parseInt(options.maxVariantsPerScenario, 10) } : {}),\n ...(options.maxVariantsPerRun ? { maxVariantsPerRun: parseInt(options.maxVariantsPerRun, 10) } : {}),\n ...(options.realism ? { realism: options.realism } : {}),\n ...(options.seed ? { seed: parseInt(options.seed, 10) } : {}),\n ...(options.only ? { only: options.only } : {}),\n ...(appTypes ? { appType: appTypes } : {}),\n ...(options.llm === false ? { noLlm: true } : {}),\n ...(options.nonInteractive ? { nonInteractive: true } : {}),\n ...(options.format ? { format: options.format } : {}),\n ...(options.regenerate ? { regenerate: true } : {}),\n ...(options.regenerateOnly ? { regenerateOnly: true } : {}),\n ...(options.forceRegenerate ? { regenerate: true, forceRegenerate: true } : {}),\n });\n process.exit(result.exitCode);\n }\n\n const { unifiedCommand } = await import('./commands/unified.js');\n const { loadConfig } = await import('../config/loader.js');\n\n const config = await loadConfig(rootDir);\n\n // URL resolution: flag → config → auto-detect\n let url = options.url ?? config.browser?.baseUrl;\n\n if (!url && options.browser !== false) {\n const { detectDevServerUrl } = await import('../config/dev-server-detector.js');\n const detection = await detectDevServerUrl(rootDir);\n if (detection.url) {\n url = detection.url;\n if (!options.json) {\n const pc = (await import('picocolors')).default;\n console.log(`${pc.green('[auto]')} Found dev server at ${pc.bold(url)} (${detection.detail})\\n`);\n }\n }\n }\n\n const wantsBrowser = !!url && options.browser !== false;\n\n // Exploration is default-ON when browser tests run, default-OFF in CI\n const isCi = options.ci || !!process.env.CI;\n const wantsExplore = wantsBrowser && options.explore !== false && !isCi;\n\n if (wantsBrowser) {\n await ensurePlaywrightBrowsers();\n }\n\n await unifiedCommand({\n rootDir,\n url: wantsBrowser ? url : undefined,\n explore: wantsExplore,\n maxSteps: options.maxSteps,\n headless: options.headless,\n format: options.format,\n failOn: options.failOn,\n json: options.json,\n ci: options.ci,\n trackFlakes: options.trackFlakes,\n });\n });\n\n // ── Utility commands ───────────────────────────────────────────\n\n program\n .command('init')\n .description('Generate a sniff config file')\n .option('--force', 'Overwrite existing config')\n .action(async (options) => {\n const { initCommand } = await import('./commands/init.js');\n await initCommand(options);\n });\n\n program\n .command('ci')\n .description('Generate a GitHub Actions workflow')\n .option('--output <path>', 'Output path for workflow file', '.github/workflows/sniff.yml')\n .option('--force', 'Overwrite existing workflow file')\n .option('--package-name <name>', 'npm package name for npx command', 'sniff-qa')\n .action(async (options) => {\n const { ciCommand } = await import('./commands/ci.js');\n await ciCommand(options);\n });\n\n program\n .command('report')\n .description('View last scan results')\n .option('--json', 'Output as JSON')\n .option('--format <formats>', 'Regenerate report in specified formats (comma-separated: html,json,junit)')\n .option('--output <dir>', 'Output directory for regenerated reports')\n .action(async (options) => {\n const { reportCommand } = await import('./commands/report.js');\n await reportCommand(options);\n });\n\n program\n .command('update-baselines')\n .description('Update visual regression baselines')\n .option('--yes', 'Skip confirmation prompt')\n .action(async (options) => {\n const { updateBaselinesCommand } = await import('./commands/update-baselines.js');\n await updateBaselinesCommand(options);\n });\n\n program\n .command('discover')\n .description('Run autonomous E2E discovery (scenarios + edge cases)')\n .argument('[target]', 'Project directory (default: current directory)')\n .option('--url <url>', 'Target URL (default: auto-detect dev server)')\n .option('--ci', 'CI mode: headless, robot realism, no countdown, JUnit output')\n .option('--no-headless', 'Show the browser window')\n .option('--format <formats>', 'Report formats: html, json, junit (comma-separated)')\n .option('--json', 'Output results as JSON')\n .option('--max-scenarios <n>', 'Cap total scenarios (default: 50)')\n .option('--max-variants-per-scenario <n>', 'Cap edge variants per scenario (default: 3)')\n .option('--max-variants-per-run <n>', 'Cap edge variants per run (default: 40)')\n .option('--realism <profile>', 'Realism: robot, careful-user, casual-user, frustrated-user, power-user')\n .option('--seed <n>', 'Replay a specific random seed')\n .option('--only <filter>', 'Filter scenarios by id substring or app type')\n .option('--app-type <types>', 'Force app types (comma-separated)')\n .option('--no-llm', 'Disable LLM-backed polish')\n .option('--non-interactive', 'Skip prompts and the production-URL countdown')\n .option('--regenerate', 'Regenerate sniff-scenarios/ before running (prompts on hand-edits)')\n .option('--regenerate-only', 'Regenerate sniff-scenarios/ and exit without running')\n .option('--force-regenerate', 'Regenerate sniff-scenarios/ and overwrite hand-edits')\n .action(async (target, options) => {\n if (!options.regenerateOnly) {\n await ensurePlaywrightBrowsers();\n }\n const rootDir = target ? (await import('node:path')).resolve(target) : process.cwd();\n const { discoverCommand } = await import('./commands/discover.js');\n const appTypes = typeof options.appType === 'string'\n ? options.appType.split(',').map((s: string) => s.trim()).filter(Boolean)\n : undefined;\n const result = await discoverCommand({\n rootDir,\n url: options.url,\n headless: options.headless,\n ci: options.ci,\n json: options.json,\n ...(options.maxScenarios ? { maxScenarios: parseInt(options.maxScenarios, 10) } : {}),\n ...(options.maxVariantsPerScenario ? { maxVariantsPerScenario: parseInt(options.maxVariantsPerScenario, 10) } : {}),\n ...(options.maxVariantsPerRun ? { maxVariantsPerRun: parseInt(options.maxVariantsPerRun, 10) } : {}),\n ...(options.realism ? { realism: options.realism } : {}),\n ...(options.seed ? { seed: parseInt(options.seed, 10) } : {}),\n ...(options.only ? { only: options.only } : {}),\n ...(appTypes ? { appType: appTypes } : {}),\n ...(options.llm === false ? { noLlm: true } : {}),\n ...(options.nonInteractive ? { nonInteractive: true } : {}),\n ...(options.format ? { format: options.format } : {}),\n ...(options.regenerate ? { regenerate: true } : {}),\n ...(options.regenerateOnly ? { regenerateOnly: true } : {}),\n ...(options.forceRegenerate ? { regenerate: true, forceRegenerate: true } : {}),\n });\n process.exit(result.exitCode);\n });\n\n program\n .command('fix')\n .description('Auto-fix safe issues (removes debugger, console.log/debug/info)')\n .argument('[target]', 'Project directory (default: current directory)')\n .option('--check', 'Dry run: show what would be fixed without changing files')\n .option('--json', 'Output results as JSON')\n .action(async (target, options) => {\n const { fixCommand } = await import('./commands/fix.js');\n const rootDir = target ? (await import('node:path')).resolve(target) : process.cwd();\n await fixCommand({ rootDir, dryRun: !!options.check, json: !!options.json });\n });\n\n program\n .command('doctor')\n .description('Check your environment: Node.js, Playwright, config, dev server')\n .action(async () => {\n const pc = (await import('picocolors')).default;\n const rootDir = process.cwd();\n\n console.log(`\\n${pc.bold('sniff doctor')}\\n`);\n\n // Node.js\n const nodeVersion = process.version;\n const nodeMajor = parseInt(nodeVersion.slice(1), 10);\n const nodeOk = nodeMajor >= 22;\n console.log(` ${nodeOk ? pc.green('OK') : pc.red('!! ')} Node.js ${nodeVersion} ${nodeOk ? '' : '(need 22+)'}`);\n\n // Playwright\n let playwrightOk = false;\n try {\n const { chromium } = await import('playwright');\n chromium.executablePath();\n playwrightOk = true;\n } catch { /* not installed */ }\n console.log(` ${playwrightOk ? pc.green('OK') : pc.yellow('--')} Playwright ${playwrightOk ? 'installed' : 'not installed (auto-installs on first browser scan)'}`);\n\n // Config file\n const { loadConfig } = await import('../config/loader.js');\n let hasConfig = false;\n try {\n const config = await loadConfig(rootDir);\n hasConfig = !!config.browser?.baseUrl;\n console.log(` ${pc.green('OK')} Config loaded${hasConfig ? ` (baseUrl: ${config.browser?.baseUrl})` : ' (defaults)'}`);\n } catch {\n console.log(` ${pc.green('OK')} No config file (using defaults)`);\n }\n\n // Dev server detection\n const { detectDevServerUrl, getDevCommand } = await import('../config/dev-server-detector.js');\n const detection = await detectDevServerUrl(rootDir);\n if (detection.url) {\n console.log(` ${pc.green('OK')} Dev server found at ${pc.bold(detection.url)} (${detection.detail})`);\n } else {\n const devCmd = await getDevCommand(rootDir);\n console.log(` ${pc.yellow('--')} No dev server running${devCmd ? ` (try: ${devCmd})` : ''}`);\n }\n\n // Package.json\n try {\n const { readFile } = await import('node:fs/promises');\n const { join } = await import('node:path');\n const pkg = JSON.parse(await readFile(join(rootDir, 'package.json'), 'utf-8'));\n console.log(` ${pc.green('OK')} package.json found (${pkg.name ?? 'unnamed'})`);\n } catch {\n console.log(` ${pc.yellow('--')} No package.json in current directory`);\n }\n\n // sniff-scenarios/ (discovery baselines)\n try {\n const { readdir, stat } = await import('node:fs/promises');\n const { join } = await import('node:path');\n const scenariosDir = join(rootDir, 'sniff-scenarios');\n const st = await stat(scenariosDir);\n if (st.isDirectory()) {\n const entries = await readdir(scenariosDir, { recursive: true });\n const count = entries.filter(\n (e) => typeof e === 'string' && e.endsWith('.scenario.md'),\n ).length;\n if (count > 0) {\n console.log(` ${pc.green('OK')} sniff-scenarios/ found (${count} scenario${count === 1 ? '' : 's'})`);\n } else {\n console.log(` ${pc.yellow('--')} sniff-scenarios/ exists but has no .scenario.md files`);\n }\n }\n } catch {\n console.log(` ${pc.yellow('--')} No sniff-scenarios/ (run 'sniff discover' to generate)`);\n }\n\n console.log('');\n });\n\n await program.parseAsync();\n}\n"],"mappings":";;;AAGA,IAAI,QAAQ,KAAK,SAAS,OAAO,GAAG;AAClC,QAAM,EAAE,eAAe,IAAI,MAAM,OAAO,kBAAkB;AAC1D,QAAM,eAAe;AACvB,OAAO;AACL,QAAM,EAAE,QAAQ,IAAI,MAAM,OA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AC,wDAAwD;AAAA,QAC1F;AAAA,MACF;AAAA,IACF,QAAQ;AACN,cAAQ,IAAI,KAAK,GAAG,OAAO,IAAI,CAAC,yDAAyD;AAAA,IAC3F;AAEA,YAAQ,IAAI,EAAE;AAAA,EAChB,CAAC;AAEH,QAAM,QAAQ,WAAW;AAC3B;","names":[]}
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
// src/cli/commands/discover.ts
|
|
2
|
+
var DEFAULT_STEP_TIMEOUT_MS = 1e4;
|
|
3
|
+
var DEFAULT_SCENARIO_TIMEOUT_MS = 9e4;
|
|
4
|
+
var PROD_WARNING_DELAY_MS = 5e3;
|
|
5
|
+
function isLocalhost(url) {
|
|
6
|
+
try {
|
|
7
|
+
const parsed = new URL(url);
|
|
8
|
+
const host = parsed.hostname;
|
|
9
|
+
return host === "localhost" || host === "127.0.0.1" || host === "::1" || host.endsWith(".localhost") || /^192\.168\./.test(host) || /^10\./.test(host) || /^172\.(1[6-9]|2\d|3[01])\./.test(host);
|
|
10
|
+
} catch {
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
async function productionUrlWarning(url, options = {}) {
|
|
15
|
+
if (options.json || options.nonInteractive) return;
|
|
16
|
+
if (isLocalhost(url)) return;
|
|
17
|
+
const pc = (await import("picocolors")).default;
|
|
18
|
+
const delay = options.delayMs ?? PROD_WARNING_DELAY_MS;
|
|
19
|
+
const seconds = Math.max(1, Math.round(delay / 1e3));
|
|
20
|
+
console.log("");
|
|
21
|
+
console.log(pc.yellow(pc.bold("WARNING: This URL looks like production.")));
|
|
22
|
+
console.log(pc.yellow(` ${url}`));
|
|
23
|
+
console.log(pc.yellow(" Discovery scenarios will create real data (orders, accounts, etc.)."));
|
|
24
|
+
console.log(pc.yellow(` Press Ctrl+C in ${seconds}s to cancel, or wait to proceed.`));
|
|
25
|
+
console.log("");
|
|
26
|
+
await new Promise((resolve) => setTimeout(resolve, delay));
|
|
27
|
+
}
|
|
28
|
+
async function discoverCommand(options) {
|
|
29
|
+
const pc = (await import("picocolors")).default;
|
|
30
|
+
const isCi = !!options.ci || !!process.env.CI;
|
|
31
|
+
const nonInteractive = !!options.nonInteractive || isCi;
|
|
32
|
+
const headless = options.headless ?? true;
|
|
33
|
+
const realism = options.realism ?? (isCi ? "robot" : "casual-user");
|
|
34
|
+
const maxScenarios = options.maxScenarios ?? 50;
|
|
35
|
+
const maxVariantsPerScenario = options.maxVariantsPerScenario ?? 3;
|
|
36
|
+
const maxVariantsPerRun = options.maxVariantsPerRun ?? 40;
|
|
37
|
+
const { loadConfig } = await import("./loader-QII5CZSX.js");
|
|
38
|
+
const config = await loadConfig(options.rootDir);
|
|
39
|
+
const emptyReport = () => ({
|
|
40
|
+
appTypeGuesses: [],
|
|
41
|
+
scenarios: [],
|
|
42
|
+
stats: { total: 0, passed: 0, failed: 0, skipped: 0, quarantined: 0, durationMs: 0 },
|
|
43
|
+
runAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
44
|
+
});
|
|
45
|
+
let url;
|
|
46
|
+
if (!options.regenerateOnly) {
|
|
47
|
+
url = options.url ?? config.browser?.baseUrl;
|
|
48
|
+
if (!url) {
|
|
49
|
+
const { detectDevServerUrl } = await import("./dev-server-detector-NJ5RN4IC.js");
|
|
50
|
+
const detection = await detectDevServerUrl(options.rootDir);
|
|
51
|
+
url = detection.url;
|
|
52
|
+
if (url && !options.json) {
|
|
53
|
+
console.log(`${pc.green("[auto]")} Found dev server at ${pc.bold(url)} (${detection.detail})
|
|
54
|
+
`);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
if (!url) {
|
|
58
|
+
console.error(pc.red("No URL available. Pass --url <url> or start your dev server."));
|
|
59
|
+
return { report: emptyReport(), savedPaths: [], baseUrl: "", exitCode: 1 };
|
|
60
|
+
}
|
|
61
|
+
try {
|
|
62
|
+
const parsed = new URL(url);
|
|
63
|
+
if (parsed.protocol !== "http:" && parsed.protocol !== "https:") {
|
|
64
|
+
console.error(pc.red(`URL must use http or https: ${url}`));
|
|
65
|
+
return { report: emptyReport(), savedPaths: [], baseUrl: url, exitCode: 1 };
|
|
66
|
+
}
|
|
67
|
+
} catch {
|
|
68
|
+
console.error(pc.red(`Invalid URL: ${url}`));
|
|
69
|
+
return { report: emptyReport(), savedPaths: [], baseUrl: url, exitCode: 1 };
|
|
70
|
+
}
|
|
71
|
+
await productionUrlWarning(url, { json: options.json, nonInteractive });
|
|
72
|
+
}
|
|
73
|
+
if (!options.json) {
|
|
74
|
+
console.log(`${pc.blue("[discover]")} Extracting domain snapshot...`);
|
|
75
|
+
}
|
|
76
|
+
const { extractDomainSnapshot } = await import("./domain-UQ34YE4B.js");
|
|
77
|
+
const snapshot = await extractDomainSnapshot(options.rootDir);
|
|
78
|
+
if (!options.json) {
|
|
79
|
+
console.log(`${pc.blue("[discover]")} Classifying app type...`);
|
|
80
|
+
}
|
|
81
|
+
const { classifyApp } = await import("./classifier-XEA6ZGE7.js");
|
|
82
|
+
let guesses = classifyApp(snapshot);
|
|
83
|
+
if (!options.noLlm) {
|
|
84
|
+
const { needsTieBreak, tieBreakClassification } = await import("./tiebreak-L5UFNKU2.js");
|
|
85
|
+
if (needsTieBreak(guesses)) {
|
|
86
|
+
const { resolveDiscoveryLLM } = await import("./llm-VJAI6H6G.js");
|
|
87
|
+
const llm = await resolveDiscoveryLLM({
|
|
88
|
+
rootDir: options.rootDir,
|
|
89
|
+
cacheDir: ".sniff/discover/cache"
|
|
90
|
+
});
|
|
91
|
+
if (llm) {
|
|
92
|
+
if (!options.json) {
|
|
93
|
+
console.log(pc.dim(" tie-break: asking Claude Code to break a close call..."));
|
|
94
|
+
}
|
|
95
|
+
guesses = await tieBreakClassification(guesses, snapshot, llm);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
if (!options.json) {
|
|
100
|
+
const top = guesses[0];
|
|
101
|
+
if (top) {
|
|
102
|
+
console.log(` top guess: ${pc.bold(top.type)} (${Math.round(top.confidence * 100)}%)`);
|
|
103
|
+
} else {
|
|
104
|
+
console.log(pc.yellow(" no app type matched any signature"));
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
if (!options.json) {
|
|
108
|
+
console.log(`${pc.blue("[discover]")} Generating scenarios...`);
|
|
109
|
+
}
|
|
110
|
+
const { generateScenarios } = await import("./scenarios-25UAZY6F.js");
|
|
111
|
+
const happyScenarios = generateScenarios(snapshot, guesses, {
|
|
112
|
+
realism,
|
|
113
|
+
...options.appType && options.appType.length > 0 ? { forceAppTypes: options.appType } : {}
|
|
114
|
+
});
|
|
115
|
+
const { enumerateAllEdgeVariants } = await import("./edge-cases-ZADKDZHL.js");
|
|
116
|
+
const edgeScenarios = enumerateAllEdgeVariants(happyScenarios, snapshot, {
|
|
117
|
+
maxPerScenario: maxVariantsPerScenario,
|
|
118
|
+
maxPerRun: maxVariantsPerRun
|
|
119
|
+
});
|
|
120
|
+
let allScenarios = [...happyScenarios, ...edgeScenarios];
|
|
121
|
+
if (options.only) {
|
|
122
|
+
const filter = options.only;
|
|
123
|
+
allScenarios = allScenarios.filter((s) => s.id.includes(filter) || s.appType === filter);
|
|
124
|
+
}
|
|
125
|
+
if (allScenarios.length > maxScenarios) {
|
|
126
|
+
allScenarios = allScenarios.slice(0, maxScenarios);
|
|
127
|
+
}
|
|
128
|
+
if (allScenarios.length === 0) {
|
|
129
|
+
if (!options.json) {
|
|
130
|
+
console.log(pc.yellow(" no scenarios generated for this project"));
|
|
131
|
+
}
|
|
132
|
+
const report2 = { ...emptyReport(), appTypeGuesses: guesses };
|
|
133
|
+
return { report: report2, savedPaths: [], baseUrl: url ?? "", exitCode: 0 };
|
|
134
|
+
}
|
|
135
|
+
if (!options.json) {
|
|
136
|
+
console.log(` ${happyScenarios.length} happy + ${edgeScenarios.length} edge = ${allScenarios.length} total`);
|
|
137
|
+
}
|
|
138
|
+
if (options.regenerate || options.regenerateOnly) {
|
|
139
|
+
const { saveDiscoveryScenarios } = await import("./persistence-KTCRIGHU.js");
|
|
140
|
+
const saveResult = await saveDiscoveryScenarios({
|
|
141
|
+
rootDir: options.rootDir,
|
|
142
|
+
snapshot,
|
|
143
|
+
guesses,
|
|
144
|
+
scenarios: allScenarios,
|
|
145
|
+
...options.forceRegenerate ? { forceRegenerate: true } : {},
|
|
146
|
+
...nonInteractive ? { nonInteractive: true } : {}
|
|
147
|
+
});
|
|
148
|
+
if (!options.json) {
|
|
149
|
+
console.log(`${pc.blue("[persist]")} scenarios written to ${pc.dim(saveResult.generatedDir)}`);
|
|
150
|
+
if (saveResult.written.length > 0) {
|
|
151
|
+
console.log(` written: ${saveResult.written.length}`);
|
|
152
|
+
}
|
|
153
|
+
if (saveResult.skippedKept.length > 0) {
|
|
154
|
+
console.log(` kept (hand-edited): ${saveResult.skippedKept.length}`);
|
|
155
|
+
}
|
|
156
|
+
if (saveResult.movedToCustom.length > 0) {
|
|
157
|
+
console.log(` moved to custom/: ${saveResult.movedToCustom.length}`);
|
|
158
|
+
}
|
|
159
|
+
if (saveResult.removed.length > 0) {
|
|
160
|
+
console.log(` removed: ${saveResult.removed.length}`);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
if (options.regenerateOnly) {
|
|
164
|
+
const report2 = { ...emptyReport(), appTypeGuesses: guesses };
|
|
165
|
+
return { report: report2, savedPaths: [], baseUrl: url ?? "", exitCode: 0 };
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
if (!url) {
|
|
169
|
+
console.error(pc.red("Internal: URL missing after resolution. This should not happen."));
|
|
170
|
+
return { report: emptyReport(), savedPaths: [], baseUrl: "", exitCode: 1 };
|
|
171
|
+
}
|
|
172
|
+
const resolvedUrl = url;
|
|
173
|
+
const { join } = await import("path");
|
|
174
|
+
const reportDir = join(options.rootDir, "sniff-reports", "discovery");
|
|
175
|
+
const viewport = { width: 1280, height: 720 };
|
|
176
|
+
const runContext = {
|
|
177
|
+
baseUrl: resolvedUrl,
|
|
178
|
+
rootDir: options.rootDir,
|
|
179
|
+
headless,
|
|
180
|
+
viewport,
|
|
181
|
+
stepTimeoutMs: DEFAULT_STEP_TIMEOUT_MS,
|
|
182
|
+
scenarioTimeoutMs: DEFAULT_SCENARIO_TIMEOUT_MS,
|
|
183
|
+
reportDir,
|
|
184
|
+
...options.seed !== void 0 ? { seed: options.seed } : {}
|
|
185
|
+
};
|
|
186
|
+
if (!options.json) {
|
|
187
|
+
console.log(`${pc.green("[discover]")} Running ${allScenarios.length} scenarios against ${resolvedUrl}...`);
|
|
188
|
+
}
|
|
189
|
+
const { runScenarios } = await import("./runner-OYTN2NFD.js");
|
|
190
|
+
let report = await runScenarios(allScenarios, guesses, runContext, config);
|
|
191
|
+
const { markQuarantinedScenarios } = await import("./flakiness-OLJAY7CS.js");
|
|
192
|
+
const { loadFlakinessHistory } = await import("./persistence-RHUFBQAY.js");
|
|
193
|
+
const history = await loadFlakinessHistory(options.rootDir);
|
|
194
|
+
if (history) {
|
|
195
|
+
report = markQuarantinedScenarios(report, history, resolvedUrl);
|
|
196
|
+
}
|
|
197
|
+
const { saveDiscoveryReport } = await import("./report-SDZWX25B.js");
|
|
198
|
+
const formats = options.format ? options.format.split(",").map((f) => f.trim()) : isCi ? ["html", "json", "junit"] : ["html", "json"];
|
|
199
|
+
const savedPaths = await saveDiscoveryReport({
|
|
200
|
+
rootDir: options.rootDir,
|
|
201
|
+
report,
|
|
202
|
+
formats
|
|
203
|
+
});
|
|
204
|
+
if (options.json) {
|
|
205
|
+
console.log(JSON.stringify({ report, savedPaths }, null, 2));
|
|
206
|
+
} else {
|
|
207
|
+
console.log("");
|
|
208
|
+
console.log(` passed: ${pc.green(report.stats.passed)}`);
|
|
209
|
+
console.log(` failed: ${pc.red(report.stats.failed)}`);
|
|
210
|
+
console.log(` skipped: ${pc.dim(report.stats.skipped)}`);
|
|
211
|
+
if (report.stats.quarantined > 0) {
|
|
212
|
+
console.log(` quarantined: ${pc.yellow(report.stats.quarantined)}`);
|
|
213
|
+
}
|
|
214
|
+
console.log(` duration: ${Math.round(report.stats.durationMs)}ms`);
|
|
215
|
+
console.log("");
|
|
216
|
+
for (const p of savedPaths) {
|
|
217
|
+
console.log(pc.dim(` Report: ${p}`));
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
const { shouldFailCi } = await import("./flakiness-OLJAY7CS.js");
|
|
221
|
+
const exitCode = shouldFailCi(report) ? 1 : 0;
|
|
222
|
+
return { report, savedPaths, baseUrl: resolvedUrl, exitCode };
|
|
223
|
+
}
|
|
224
|
+
export {
|
|
225
|
+
discoverCommand,
|
|
226
|
+
productionUrlWarning
|
|
227
|
+
};
|
|
228
|
+
//# sourceMappingURL=discover-BLUSO42Q.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/cli/commands/discover.ts"],"sourcesContent":["import type { DiscoveryReport, DiscoveryRunContext } from '../../discovery/run-types.js';\nimport type { RealismProfile } from '../../discovery/scenarios/types.js';\n\nexport interface DiscoverOptions {\n rootDir: string;\n url?: string;\n headless?: boolean;\n ci?: boolean;\n json?: boolean;\n maxScenarios?: number;\n maxVariantsPerScenario?: number;\n maxVariantsPerRun?: number;\n realism?: RealismProfile;\n seed?: number;\n only?: string;\n appType?: string[];\n noLlm?: boolean;\n nonInteractive?: boolean;\n format?: string;\n regenerate?: boolean;\n regenerateOnly?: boolean;\n forceRegenerate?: boolean;\n}\n\nexport interface DiscoverResult {\n report: DiscoveryReport;\n savedPaths: string[];\n baseUrl: string;\n exitCode: number;\n}\n\nconst DEFAULT_STEP_TIMEOUT_MS = 10_000;\nconst DEFAULT_SCENARIO_TIMEOUT_MS = 90_000;\nconst PROD_WARNING_DELAY_MS = 5_000;\n\nfunction isLocalhost(url: string): boolean {\n try {\n const parsed = new URL(url);\n const host = parsed.hostname;\n return (\n host === 'localhost' ||\n host === '127.0.0.1' ||\n host === '::1' ||\n host.endsWith('.localhost') ||\n /^192\\.168\\./.test(host) ||\n /^10\\./.test(host) ||\n /^172\\.(1[6-9]|2\\d|3[01])\\./.test(host)\n );\n } catch {\n return false;\n }\n}\n\nexport async function productionUrlWarning(\n url: string,\n options: { json?: boolean; nonInteractive?: boolean; delayMs?: number } = {},\n): Promise<void> {\n if (options.json || options.nonInteractive) return;\n if (isLocalhost(url)) return;\n\n const pc = (await import('picocolors')).default;\n const delay = options.delayMs ?? PROD_WARNING_DELAY_MS;\n const seconds = Math.max(1, Math.round(delay / 1000));\n\n console.log('');\n console.log(pc.yellow(pc.bold('WARNING: This URL looks like production.')));\n console.log(pc.yellow(` ${url}`));\n console.log(pc.yellow(' Discovery scenarios will create real data (orders, accounts, etc.).'));\n console.log(pc.yellow(` Press Ctrl+C in ${seconds}s to cancel, or wait to proceed.`));\n console.log('');\n\n await new Promise<void>((resolve) => setTimeout(resolve, delay));\n}\n\nexport async function discoverCommand(options: DiscoverOptions): Promise<DiscoverResult> {\n const pc = (await import('picocolors')).default;\n const isCi = !!options.ci || !!process.env.CI;\n const nonInteractive = !!options.nonInteractive || isCi;\n const headless = options.headless ?? true;\n const realism: RealismProfile = options.realism ?? (isCi ? 'robot' : 'casual-user');\n const maxScenarios = options.maxScenarios ?? 50;\n const maxVariantsPerScenario = options.maxVariantsPerScenario ?? 3;\n const maxVariantsPerRun = options.maxVariantsPerRun ?? 40;\n\n const { loadConfig } = await import('../../config/loader.js');\n const config = await loadConfig(options.rootDir);\n\n const emptyReport = (): DiscoveryReport => ({\n appTypeGuesses: [],\n scenarios: [],\n stats: { total: 0, passed: 0, failed: 0, skipped: 0, quarantined: 0, durationMs: 0 },\n runAt: new Date().toISOString(),\n });\n\n let url: string | undefined;\n if (!options.regenerateOnly) {\n url = options.url ?? config.browser?.baseUrl;\n if (!url) {\n const { detectDevServerUrl } = await import('../../config/dev-server-detector.js');\n const detection = await detectDevServerUrl(options.rootDir);\n url = detection.url;\n if (url && !options.json) {\n console.log(`${pc.green('[auto]')} Found dev server at ${pc.bold(url)} (${detection.detail})\\n`);\n }\n }\n\n if (!url) {\n console.error(pc.red('No URL available. Pass --url <url> or start your dev server.'));\n return { report: emptyReport(), savedPaths: [], baseUrl: '', exitCode: 1 };\n }\n\n try {\n const parsed = new URL(url);\n if (parsed.protocol !== 'http:' && parsed.protocol !== 'https:') {\n console.error(pc.red(`URL must use http or https: ${url}`));\n return { report: emptyReport(), savedPaths: [], baseUrl: url, exitCode: 1 };\n }\n } catch {\n console.error(pc.red(`Invalid URL: ${url}`));\n return { report: emptyReport(), savedPaths: [], baseUrl: url, exitCode: 1 };\n }\n\n await productionUrlWarning(url, { json: options.json, nonInteractive });\n }\n\n if (!options.json) {\n console.log(`${pc.blue('[discover]')} Extracting domain snapshot...`);\n }\n const { extractDomainSnapshot } = await import('../../discovery/domain/index.js');\n const snapshot = await extractDomainSnapshot(options.rootDir);\n\n if (!options.json) {\n console.log(`${pc.blue('[discover]')} Classifying app type...`);\n }\n const { classifyApp } = await import('../../discovery/classifier/index.js');\n let guesses = classifyApp(snapshot);\n\n if (!options.noLlm) {\n const { needsTieBreak, tieBreakClassification } = await import('../../discovery/classifier/tiebreak.js');\n if (needsTieBreak(guesses)) {\n const { resolveDiscoveryLLM } = await import('../../discovery/llm/index.js');\n const llm = await resolveDiscoveryLLM({\n rootDir: options.rootDir,\n cacheDir: '.sniff/discover/cache',\n });\n if (llm) {\n if (!options.json) {\n console.log(pc.dim(' tie-break: asking Claude Code to break a close call...'));\n }\n guesses = await tieBreakClassification(guesses, snapshot, llm);\n }\n }\n }\n\n if (!options.json) {\n const top = guesses[0];\n if (top) {\n console.log(` top guess: ${pc.bold(top.type)} (${Math.round(top.confidence * 100)}%)`);\n } else {\n console.log(pc.yellow(' no app type matched any signature'));\n }\n }\n\n if (!options.json) {\n console.log(`${pc.blue('[discover]')} Generating scenarios...`);\n }\n const { generateScenarios } = await import('../../discovery/scenarios/index.js');\n const happyScenarios = generateScenarios(snapshot, guesses, {\n realism,\n ...(options.appType && options.appType.length > 0 ? { forceAppTypes: options.appType } : {}),\n });\n\n const { enumerateAllEdgeVariants } = await import('../../discovery/edge-cases/index.js');\n const edgeScenarios = enumerateAllEdgeVariants(happyScenarios, snapshot, {\n maxPerScenario: maxVariantsPerScenario,\n maxPerRun: maxVariantsPerRun,\n });\n\n let allScenarios = [...happyScenarios, ...edgeScenarios];\n\n if (options.only) {\n const filter = options.only;\n allScenarios = allScenarios.filter((s) => s.id.includes(filter) || s.appType === filter);\n }\n\n if (allScenarios.length > maxScenarios) {\n allScenarios = allScenarios.slice(0, maxScenarios);\n }\n\n if (allScenarios.length === 0) {\n if (!options.json) {\n console.log(pc.yellow(' no scenarios generated for this project'));\n }\n const report: DiscoveryReport = { ...emptyReport(), appTypeGuesses: guesses };\n return { report, savedPaths: [], baseUrl: url ?? '', exitCode: 0 };\n }\n\n if (!options.json) {\n console.log(` ${happyScenarios.length} happy + ${edgeScenarios.length} edge = ${allScenarios.length} total`);\n }\n\n if (options.regenerate || options.regenerateOnly) {\n const { saveDiscoveryScenarios } = await import('../../discovery/persistence/index.js');\n const saveResult = await saveDiscoveryScenarios({\n rootDir: options.rootDir,\n snapshot,\n guesses,\n scenarios: allScenarios,\n ...(options.forceRegenerate ? { forceRegenerate: true } : {}),\n ...(nonInteractive ? { nonInteractive: true } : {}),\n });\n if (!options.json) {\n console.log(`${pc.blue('[persist]')} scenarios written to ${pc.dim(saveResult.generatedDir)}`);\n if (saveResult.written.length > 0) {\n console.log(` written: ${saveResult.written.length}`);\n }\n if (saveResult.skippedKept.length > 0) {\n console.log(` kept (hand-edited): ${saveResult.skippedKept.length}`);\n }\n if (saveResult.movedToCustom.length > 0) {\n console.log(` moved to custom/: ${saveResult.movedToCustom.length}`);\n }\n if (saveResult.removed.length > 0) {\n console.log(` removed: ${saveResult.removed.length}`);\n }\n }\n if (options.regenerateOnly) {\n const report: DiscoveryReport = { ...emptyReport(), appTypeGuesses: guesses };\n return { report, savedPaths: [], baseUrl: url ?? '', exitCode: 0 };\n }\n }\n\n if (!url) {\n console.error(pc.red('Internal: URL missing after resolution. This should not happen.'));\n return { report: emptyReport(), savedPaths: [], baseUrl: '', exitCode: 1 };\n }\n const resolvedUrl: string = url;\n\n const { join } = await import('node:path');\n const reportDir = join(options.rootDir, 'sniff-reports', 'discovery');\n const viewport = { width: 1280, height: 720 };\n\n const runContext: DiscoveryRunContext = {\n baseUrl: resolvedUrl,\n rootDir: options.rootDir,\n headless,\n viewport,\n stepTimeoutMs: DEFAULT_STEP_TIMEOUT_MS,\n scenarioTimeoutMs: DEFAULT_SCENARIO_TIMEOUT_MS,\n reportDir,\n ...(options.seed !== undefined ? { seed: options.seed } : {}),\n };\n\n if (!options.json) {\n console.log(`${pc.green('[discover]')} Running ${allScenarios.length} scenarios against ${resolvedUrl}...`);\n }\n\n const { runScenarios } = await import('../../discovery/runner.js');\n let report = await runScenarios(allScenarios, guesses, runContext, config);\n\n const { markQuarantinedScenarios } = await import('../../discovery/report/flakiness.js');\n const { loadFlakinessHistory } = await import('../../core/persistence.js');\n const history = await loadFlakinessHistory(options.rootDir);\n if (history) {\n report = markQuarantinedScenarios(report, history, resolvedUrl);\n }\n\n const { saveDiscoveryReport } = await import('../../discovery/report/index.js');\n const formats: Array<'html' | 'json' | 'junit'> = options.format\n ? (options.format.split(',').map((f) => f.trim()) as Array<'html' | 'json' | 'junit'>)\n : (isCi ? ['html', 'json', 'junit'] : ['html', 'json']);\n const savedPaths = await saveDiscoveryReport({\n rootDir: options.rootDir,\n report,\n formats,\n });\n\n if (options.json) {\n console.log(JSON.stringify({ report, savedPaths }, null, 2));\n } else {\n console.log('');\n console.log(` passed: ${pc.green(report.stats.passed)}`);\n console.log(` failed: ${pc.red(report.stats.failed)}`);\n console.log(` skipped: ${pc.dim(report.stats.skipped)}`);\n if (report.stats.quarantined > 0) {\n console.log(` quarantined: ${pc.yellow(report.stats.quarantined)}`);\n }\n console.log(` duration: ${Math.round(report.stats.durationMs)}ms`);\n console.log('');\n for (const p of savedPaths) {\n console.log(pc.dim(` Report: ${p}`));\n }\n }\n\n const { shouldFailCi } = await import('../../discovery/report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