@planu/cli 0.45.4 → 0.46.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.
Files changed (51) hide show
  1. package/dist/config/license-plans.json +1 -0
  2. package/dist/config/tool-groups.json +1 -0
  3. package/dist/engine/legal-compliance/criteria-injector.d.ts +18 -0
  4. package/dist/engine/legal-compliance/criteria-injector.d.ts.map +1 -0
  5. package/dist/engine/legal-compliance/criteria-injector.js +176 -0
  6. package/dist/engine/legal-compliance/criteria-injector.js.map +1 -0
  7. package/dist/engine/legal-compliance/detector.d.ts +25 -0
  8. package/dist/engine/legal-compliance/detector.d.ts.map +1 -0
  9. package/dist/engine/legal-compliance/detector.js +515 -0
  10. package/dist/engine/legal-compliance/detector.js.map +1 -0
  11. package/dist/engine/legal-compliance/index.d.ts +4 -0
  12. package/dist/engine/legal-compliance/index.d.ts.map +1 -0
  13. package/dist/engine/legal-compliance/index.js +5 -0
  14. package/dist/engine/legal-compliance/index.js.map +1 -0
  15. package/dist/engine/legal-compliance/question-framework.d.ts +14 -0
  16. package/dist/engine/legal-compliance/question-framework.d.ts.map +1 -0
  17. package/dist/engine/legal-compliance/question-framework.js +461 -0
  18. package/dist/engine/legal-compliance/question-framework.js.map +1 -0
  19. package/dist/engine/validator/dor-dod.d.ts +2 -2
  20. package/dist/engine/validator/dor-dod.d.ts.map +1 -1
  21. package/dist/engine/validator/dor-dod.js +62 -14
  22. package/dist/engine/validator/dor-dod.js.map +1 -1
  23. package/dist/tools/create-spec/spec-builder.d.ts.map +1 -1
  24. package/dist/tools/create-spec/spec-builder.js +39 -5
  25. package/dist/tools/create-spec/spec-builder.js.map +1 -1
  26. package/dist/tools/init-project/handler.d.ts.map +1 -1
  27. package/dist/tools/init-project/handler.js +6 -0
  28. package/dist/tools/init-project/handler.js.map +1 -1
  29. package/dist/tools/legal-compliance-report.d.ts +3 -0
  30. package/dist/tools/legal-compliance-report.d.ts.map +1 -0
  31. package/dist/tools/legal-compliance-report.js +65 -0
  32. package/dist/tools/legal-compliance-report.js.map +1 -0
  33. package/dist/tools/register-governance-tools.d.ts.map +1 -1
  34. package/dist/tools/register-governance-tools.js +13 -1
  35. package/dist/tools/register-governance-tools.js.map +1 -1
  36. package/dist/types/index.d.ts +1 -0
  37. package/dist/types/index.d.ts.map +1 -1
  38. package/dist/types/index.js +1 -0
  39. package/dist/types/index.js.map +1 -1
  40. package/dist/types/legal.d.ts +71 -0
  41. package/dist/types/legal.d.ts.map +1 -0
  42. package/dist/types/legal.js +3 -0
  43. package/dist/types/legal.js.map +1 -0
  44. package/dist/types/project/core.d.ts +2 -0
  45. package/dist/types/project/core.d.ts.map +1 -1
  46. package/dist/types/project/core.js.map +1 -1
  47. package/dist/types/spec/core.d.ts +2 -0
  48. package/dist/types/spec/core.d.ts.map +1 -1
  49. package/package.json +1 -1
  50. package/src/config/license-plans.json +1 -0
  51. package/src/config/tool-groups.json +1 -0
@@ -0,0 +1,515 @@
1
+ // ---------------------------------------------------------------------------
2
+ // Keyword dictionaries
3
+ // ---------------------------------------------------------------------------
4
+ const DOMAIN_KEYWORDS = {
5
+ fintech: [
6
+ 'stripe',
7
+ 'paypal',
8
+ 'braintree',
9
+ 'square',
10
+ 'adyen',
11
+ 'plaid',
12
+ 'dwolla',
13
+ 'wise',
14
+ 'mercadopago',
15
+ 'conekta',
16
+ 'openpay',
17
+ 'payment',
18
+ 'banking',
19
+ 'wallet',
20
+ 'crypto',
21
+ 'blockchain',
22
+ 'ledger',
23
+ 'kyc',
24
+ 'aml',
25
+ ],
26
+ health: [
27
+ 'fhir',
28
+ 'hl7',
29
+ 'medical',
30
+ 'health',
31
+ 'patient',
32
+ 'clinic',
33
+ 'hospital',
34
+ 'pharma',
35
+ 'hipaa',
36
+ 'ehr',
37
+ 'emr',
38
+ 'dicom',
39
+ 'telehealth',
40
+ 'telemedicine',
41
+ ],
42
+ billing: [
43
+ 'invoice',
44
+ 'billing',
45
+ 'tax',
46
+ 'vat',
47
+ 'subscription',
48
+ 'recurring',
49
+ 'checkout',
50
+ 'pricing',
51
+ 'plan',
52
+ 'coupon',
53
+ 'refund',
54
+ 'chargeback',
55
+ ],
56
+ ecommerce: [
57
+ 'ecommerce',
58
+ 'e-commerce',
59
+ 'shopify',
60
+ 'woocommerce',
61
+ 'magento',
62
+ 'prestashop',
63
+ 'cart',
64
+ 'catalog',
65
+ 'product',
66
+ 'storefront',
67
+ 'marketplace',
68
+ 'medusa',
69
+ 'saleor',
70
+ 'vendure',
71
+ ],
72
+ 'ai-ml': [
73
+ 'openai',
74
+ 'langchain',
75
+ 'llm',
76
+ 'gpt',
77
+ 'claude',
78
+ 'anthropic',
79
+ 'huggingface',
80
+ 'tensorflow',
81
+ 'pytorch',
82
+ 'scikit',
83
+ 'ml',
84
+ 'machine-learning',
85
+ 'inference',
86
+ 'embedding',
87
+ 'vector',
88
+ 'rag',
89
+ 'fine-tune',
90
+ 'model-training',
91
+ ],
92
+ social: [
93
+ 'socket.io',
94
+ 'chat',
95
+ 'social',
96
+ 'messaging',
97
+ 'feed',
98
+ 'timeline',
99
+ 'friend',
100
+ 'follower',
101
+ 'community',
102
+ 'forum',
103
+ 'comment',
104
+ 'reaction',
105
+ 'notification',
106
+ 'real-time',
107
+ ],
108
+ gaming: [
109
+ 'unity',
110
+ 'godot',
111
+ 'unreal',
112
+ 'game',
113
+ 'gaming',
114
+ 'player',
115
+ 'leaderboard',
116
+ 'match',
117
+ 'lobby',
118
+ 'multiplayer',
119
+ 'phaser',
120
+ 'pixi',
121
+ 'three.js',
122
+ ],
123
+ education: [
124
+ 'lms',
125
+ 'course',
126
+ 'student',
127
+ 'teacher',
128
+ 'school',
129
+ 'university',
130
+ 'classroom',
131
+ 'quiz',
132
+ 'exam',
133
+ 'grade',
134
+ 'enrollment',
135
+ 'moodle',
136
+ 'canvas',
137
+ 'edtech',
138
+ ],
139
+ iot: [
140
+ 'mqtt',
141
+ 'iot',
142
+ 'sensor',
143
+ 'device',
144
+ 'firmware',
145
+ 'embedded',
146
+ 'arduino',
147
+ 'raspberry',
148
+ 'zigbee',
149
+ 'z-wave',
150
+ 'home-assistant',
151
+ 'smart-home',
152
+ ],
153
+ hr: [
154
+ 'hr',
155
+ 'employee',
156
+ 'payroll',
157
+ 'recruitment',
158
+ 'hiring',
159
+ 'onboarding',
160
+ 'timesheet',
161
+ 'attendance',
162
+ 'performance-review',
163
+ 'workforce',
164
+ ],
165
+ 'real-estate': [
166
+ 'property',
167
+ 'real-estate',
168
+ 'realestate',
169
+ 'listing',
170
+ 'tenant',
171
+ 'landlord',
172
+ 'mortgage',
173
+ 'mls',
174
+ 'zillow',
175
+ 'rental',
176
+ ],
177
+ logistics: [
178
+ 'logistics',
179
+ 'shipping',
180
+ 'delivery',
181
+ 'warehouse',
182
+ 'inventory',
183
+ 'tracking',
184
+ 'fleet',
185
+ 'route',
186
+ 'freight',
187
+ 'supply-chain',
188
+ 'fulfillment',
189
+ ],
190
+ media: [
191
+ 'media',
192
+ 'streaming',
193
+ 'video',
194
+ 'audio',
195
+ 'podcast',
196
+ 'cms',
197
+ 'content',
198
+ 'publishing',
199
+ 'editorial',
200
+ 'drm',
201
+ 'copyright',
202
+ ],
203
+ government: [
204
+ 'government',
205
+ 'gov',
206
+ 'citizen',
207
+ 'municipal',
208
+ 'public-sector',
209
+ 'e-gov',
210
+ 'permit',
211
+ 'license',
212
+ 'compliance',
213
+ 'regulation',
214
+ 'fedramp',
215
+ ],
216
+ };
217
+ const COUNTRY_HINTS = {
218
+ // Currencies
219
+ MXN: ['MX'],
220
+ USD: ['US'],
221
+ COP: ['CO'],
222
+ ARS: ['AR'],
223
+ BRL: ['BR'],
224
+ EUR: ['DE', 'FR', 'ES', 'IT'],
225
+ GBP: ['GB'],
226
+ CAD: ['CA'],
227
+ JPY: ['JP'],
228
+ INR: ['IN'],
229
+ AUD: ['AU'],
230
+ CLP: ['CL'],
231
+ PEN: ['PE'],
232
+ // Timezones (partial matches)
233
+ 'America/Mexico': ['MX'],
234
+ 'America/Bogota': ['CO'],
235
+ 'America/Argentina': ['AR'],
236
+ 'America/Sao_Paulo': ['BR'],
237
+ 'America/New_York': ['US'],
238
+ 'America/Chicago': ['US'],
239
+ 'America/Los_Angeles': ['US'],
240
+ 'America/Toronto': ['CA'],
241
+ 'Europe/London': ['GB'],
242
+ 'Europe/Berlin': ['DE'],
243
+ 'Europe/Paris': ['FR'],
244
+ 'Europe/Madrid': ['ES'],
245
+ 'Asia/Tokyo': ['JP'],
246
+ 'Asia/Kolkata': ['IN'],
247
+ // Locale prefixes
248
+ 'es-MX': ['MX'],
249
+ 'es-CO': ['CO'],
250
+ 'es-AR': ['AR'],
251
+ 'es-CL': ['CL'],
252
+ 'es-PE': ['PE'],
253
+ 'en-US': ['US'],
254
+ 'en-GB': ['GB'],
255
+ 'pt-BR': ['BR'],
256
+ 'fr-FR': ['FR'],
257
+ 'de-DE': ['DE'],
258
+ 'ja-JP': ['JP'],
259
+ };
260
+ const MINOR_KEYWORDS = [
261
+ 'child',
262
+ 'children',
263
+ 'minor',
264
+ 'kid',
265
+ 'teen',
266
+ 'youth',
267
+ 'coppa',
268
+ 'age-gate',
269
+ 'parental',
270
+ 'school',
271
+ 'student',
272
+ ];
273
+ const HEALTH_KEYWORDS = [
274
+ 'patient',
275
+ 'medical',
276
+ 'health',
277
+ 'hipaa',
278
+ 'clinical',
279
+ 'diagnosis',
280
+ 'prescription',
281
+ 'ehr',
282
+ 'emr',
283
+ 'telehealth',
284
+ ];
285
+ const AUTH_KEYWORDS = [
286
+ 'auth',
287
+ 'login',
288
+ 'signup',
289
+ 'register',
290
+ 'session',
291
+ 'jwt',
292
+ 'oauth',
293
+ 'passport',
294
+ 'next-auth',
295
+ 'clerk',
296
+ 'supabase',
297
+ 'firebase',
298
+ ];
299
+ // ---------------------------------------------------------------------------
300
+ // Helpers
301
+ // ---------------------------------------------------------------------------
302
+ /** Normalize a string for keyword matching (lowercase, trim) */
303
+ function normalize(s) {
304
+ return s.toLowerCase().trim();
305
+ }
306
+ /** Build a flat searchable corpus from ProjectKnowledge.
307
+ * Defensive against partial data — callers may pass incomplete objects (e.g., tests with `as never`). */
308
+ function buildCorpus(knowledge) {
309
+ /* eslint-disable @typescript-eslint/no-unnecessary-condition */
310
+ const parts = [
311
+ knowledge.language ?? '',
312
+ knowledge.framework ?? '',
313
+ knowledge.orm ?? '',
314
+ knowledge.database ?? '',
315
+ knowledge.packageManager ?? '',
316
+ ...(knowledge.stack ?? []),
317
+ ...(knowledge.externalServices ?? []),
318
+ ...(knowledge.layers ?? []),
319
+ ...Object.keys(knowledge.conventions ?? {}),
320
+ ...Object.values(knowledge.conventions ?? {}),
321
+ ...Object.keys(knowledge.tooling ?? {}),
322
+ ...Object.values(knowledge.tooling ?? {}),
323
+ ...(knowledge.apiContracts ?? []).map((c) => `${c.type} ${c.endpoints.join(' ')}`),
324
+ ...(knowledge.apps ?? []).flatMap((a) => [
325
+ a.name,
326
+ a.type,
327
+ a.language,
328
+ a.framework ?? '',
329
+ a.orm ?? '',
330
+ ]),
331
+ ];
332
+ /* eslint-enable @typescript-eslint/no-unnecessary-condition */
333
+ return normalize(parts.join(' '));
334
+ }
335
+ /** Check if corpus contains any keyword from list */
336
+ function matchesAny(corpus, keywords) {
337
+ return keywords.some((kw) => corpus.includes(normalize(kw)));
338
+ }
339
+ // ---------------------------------------------------------------------------
340
+ // Public API
341
+ // ---------------------------------------------------------------------------
342
+ /**
343
+ * Detect which legal domains apply to a project based on its knowledge.
344
+ * Always includes 'universal'.
345
+ */
346
+ export function detectLegalDomains(knowledge) {
347
+ const corpus = buildCorpus(knowledge);
348
+ const domains = ['universal'];
349
+ for (const [domain, keywords] of Object.entries(DOMAIN_KEYWORDS)) {
350
+ if (matchesAny(corpus, keywords)) {
351
+ domains.push(domain);
352
+ }
353
+ }
354
+ return domains;
355
+ }
356
+ /**
357
+ * Detect target countries from locale, currency, timezone, and i18n hints.
358
+ * Returns ISO country codes. Empty array if nothing detected.
359
+ */
360
+ export function detectCountries(knowledge) {
361
+ const corpus = buildCorpus(knowledge);
362
+ const countries = new Set();
363
+ // Check locale field directly
364
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
365
+ const localeUpper = (knowledge.locale ?? '').toUpperCase();
366
+ for (const [hint, codes] of Object.entries(COUNTRY_HINTS)) {
367
+ if (localeUpper.includes(hint.toUpperCase())) {
368
+ for (const code of codes) {
369
+ countries.add(code);
370
+ }
371
+ }
372
+ }
373
+ // Scan corpus for currency, timezone, and locale patterns
374
+ for (const [hint, codes] of Object.entries(COUNTRY_HINTS)) {
375
+ if (corpus.includes(normalize(hint))) {
376
+ for (const code of codes) {
377
+ countries.add(code);
378
+ }
379
+ }
380
+ }
381
+ return [...countries];
382
+ }
383
+ /**
384
+ * Detect audience characteristics (minors, patients, B2B/B2C, employees).
385
+ */
386
+ export function detectAudience(knowledge) {
387
+ const corpus = buildCorpus(knowledge);
388
+ const domains = detectLegalDomains(knowledge);
389
+ const includesMinors = matchesAny(corpus, MINOR_KEYWORDS) ||
390
+ domains.includes('education') ||
391
+ (domains.includes('gaming') && matchesAny(corpus, MINOR_KEYWORDS)) ||
392
+ (domains.includes('social') && matchesAny(corpus, ['age-gate', 'parental', 'coppa']));
393
+ const includesPatients = matchesAny(corpus, HEALTH_KEYWORDS) || domains.includes('health');
394
+ const includesEmployees = domains.includes('hr');
395
+ // B2B heuristic: admin panels, dashboards, SaaS indicators
396
+ const b2bKeywords = [
397
+ 'admin',
398
+ 'dashboard',
399
+ 'saas',
400
+ 'tenant',
401
+ 'organization',
402
+ 'workspace',
403
+ 'enterprise',
404
+ 'b2b',
405
+ 'crm',
406
+ 'erp',
407
+ ];
408
+ const isB2B = matchesAny(corpus, b2bKeywords);
409
+ // B2C heuristic: public-facing user apps
410
+ const b2cKeywords = [
411
+ 'user',
412
+ 'signup',
413
+ 'register',
414
+ 'profile',
415
+ 'cart',
416
+ 'wishlist',
417
+ 'b2c',
418
+ 'consumer',
419
+ 'customer',
420
+ ];
421
+ const isB2C = matchesAny(corpus, b2cKeywords);
422
+ return { includesMinors, includesPatients, includesEmployees, isB2B, isB2C };
423
+ }
424
+ /**
425
+ * Detect types of sensitive data the project likely handles.
426
+ */
427
+ export function detectDataTypes(knowledge) {
428
+ const corpus = buildCorpus(knowledge);
429
+ const domains = detectLegalDomains(knowledge);
430
+ const types = new Set();
431
+ // PII — almost any app with user models
432
+ const piiKeywords = ['user', 'email', 'name', 'address', 'phone', 'profile', 'account'];
433
+ if (matchesAny(corpus, piiKeywords)) {
434
+ types.add('pii');
435
+ }
436
+ // Credentials — auth-based apps
437
+ if (matchesAny(corpus, AUTH_KEYWORDS)) {
438
+ types.add('credentials');
439
+ }
440
+ // Financial data
441
+ if (domains.includes('fintech') || domains.includes('billing') || domains.includes('ecommerce')) {
442
+ types.add('financial');
443
+ }
444
+ const financialKeywords = ['payment', 'card', 'bank', 'transaction', 'balance'];
445
+ if (matchesAny(corpus, financialKeywords)) {
446
+ types.add('financial');
447
+ }
448
+ // Health data
449
+ if (domains.includes('health') || matchesAny(corpus, HEALTH_KEYWORDS)) {
450
+ types.add('health');
451
+ }
452
+ // Children data
453
+ if (matchesAny(corpus, MINOR_KEYWORDS) || domains.includes('education')) {
454
+ types.add('children');
455
+ }
456
+ // Location data
457
+ const locationKeywords = [
458
+ 'location',
459
+ 'gps',
460
+ 'geolocation',
461
+ 'latitude',
462
+ 'longitude',
463
+ 'map',
464
+ 'geofence',
465
+ 'tracking',
466
+ ];
467
+ if (matchesAny(corpus, locationKeywords)) {
468
+ types.add('location');
469
+ }
470
+ // Biometric data
471
+ const biometricKeywords = [
472
+ 'biometric',
473
+ 'fingerprint',
474
+ 'face-id',
475
+ 'faceid',
476
+ 'retina',
477
+ 'voice-print',
478
+ 'facial-recognition',
479
+ ];
480
+ if (matchesAny(corpus, biometricKeywords)) {
481
+ types.add('biometric');
482
+ }
483
+ // Behavioral data
484
+ const behavioralKeywords = [
485
+ 'analytics',
486
+ 'tracking',
487
+ 'behavior',
488
+ 'activity',
489
+ 'session-recording',
490
+ 'heatmap',
491
+ 'mixpanel',
492
+ 'amplitude',
493
+ 'segment',
494
+ ];
495
+ if (matchesAny(corpus, behavioralKeywords)) {
496
+ types.add('behavioral');
497
+ }
498
+ return [...types];
499
+ }
500
+ /**
501
+ * Build a complete LegalProfile by combining all detectors.
502
+ * This is the main entry point called by init_project.
503
+ */
504
+ export function buildLegalProfile(knowledge) {
505
+ return {
506
+ domains: detectLegalDomains(knowledge),
507
+ countries: detectCountries(knowledge),
508
+ audience: detectAudience(knowledge),
509
+ dataTypes: detectDataTypes(knowledge),
510
+ detectedAt: new Date().toISOString(),
511
+ cachedRequirements: null,
512
+ lastRefreshedAt: null,
513
+ };
514
+ }
515
+ //# sourceMappingURL=detector.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"detector.js","sourceRoot":"","sources":["../../../src/engine/legal-compliance/detector.ts"],"names":[],"mappings":"AAQA,8EAA8E;AAC9E,uBAAuB;AACvB,8EAA8E;AAE9E,MAAM,eAAe,GAAwD;IAC3E,OAAO,EAAE;QACP,QAAQ;QACR,QAAQ;QACR,WAAW;QACX,QAAQ;QACR,OAAO;QACP,OAAO;QACP,QAAQ;QACR,MAAM;QACN,aAAa;QACb,SAAS;QACT,SAAS;QACT,SAAS;QACT,SAAS;QACT,QAAQ;QACR,QAAQ;QACR,YAAY;QACZ,QAAQ;QACR,KAAK;QACL,KAAK;KACN;IACD,MAAM,EAAE;QACN,MAAM;QACN,KAAK;QACL,SAAS;QACT,QAAQ;QACR,SAAS;QACT,QAAQ;QACR,UAAU;QACV,QAAQ;QACR,OAAO;QACP,KAAK;QACL,KAAK;QACL,OAAO;QACP,YAAY;QACZ,cAAc;KACf;IACD,OAAO,EAAE;QACP,SAAS;QACT,SAAS;QACT,KAAK;QACL,KAAK;QACL,cAAc;QACd,WAAW;QACX,UAAU;QACV,SAAS;QACT,MAAM;QACN,QAAQ;QACR,QAAQ;QACR,YAAY;KACb;IACD,SAAS,EAAE;QACT,WAA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C;IACF,IAAI,UAAU,CAAC,MAAM,EAAE,iBAAiB,CAAC,EAAE,CAAC;QAC1C,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IACzB,CAAC;IAED,kBAAkB;IAClB,MAAM,kBAAkB,GAAG;QACzB,WAAW;QACX,UAAU;QACV,UAAU;QACV,UAAU;QACV,mBAAmB;QACnB,SAAS;QACT,UAAU;QACV,WAAW;QACX,SAAS;KACV,CAAC;IACF,IAAI,UAAU,CAAC,MAAM,EAAE,kBAAkB,CAAC,EAAE,CAAC;QAC3C,KAAK,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IAC1B,CAAC;IAED,OAAO,CAAC,GAAG,KAAK,CAAC,CAAC;AACpB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,SAA2B;IAC3D,OAAO;QACL,OAAO,EAAE,kBAAkB,CAAC,SAAS,CAAC;QACtC,SAAS,EAAE,eAAe,CAAC,SAAS,CAAC;QACrC,QAAQ,EAAE,cAAc,CAAC,SAAS,CAAC;QACnC,SAAS,EAAE,eAAe,CAAC,SAAS,CAAC;QACrC,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QACpC,kBAAkB,EAAE,IAAI;QACxB,eAAe,EAAE,IAAI;KACtB,CAAC;AACJ,CAAC"}
@@ -0,0 +1,4 @@
1
+ export { getQuestionsForDomains, buildLegalPrompt } from './question-framework.js';
2
+ export { detectLegalDomains, detectCountries, detectAudience, detectDataTypes, buildLegalProfile, } from './detector.js';
3
+ export { generateLegalSection, generateLegalCriteria, shouldInjectLegal, } from './criteria-injector.js';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/engine/legal-compliance/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AACnF,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,eAAe,EACf,iBAAiB,GAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,GAClB,MAAM,wBAAwB,CAAC"}
@@ -0,0 +1,5 @@
1
+ // legal-compliance — Barrel exports
2
+ export { getQuestionsForDomains, buildLegalPrompt } from './question-framework.js';
3
+ export { detectLegalDomains, detectCountries, detectAudience, detectDataTypes, buildLegalProfile, } from './detector.js';
4
+ export { generateLegalSection, generateLegalCriteria, shouldInjectLegal, } from './criteria-injector.js';
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/engine/legal-compliance/index.ts"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,OAAO,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AACnF,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,eAAe,EACf,iBAAiB,GAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,GAClB,MAAM,wBAAwB,CAAC"}
@@ -0,0 +1,14 @@
1
+ import type { LegalDomain, LegalQuestion } from '../../types/index.js';
2
+ /** Complete catalog of legal questions organized by domain */
3
+ export declare const LEGAL_QUESTIONS: LegalQuestion[];
4
+ /**
5
+ * Returns all questions for the given domains, always including 'universal'.
6
+ * Deduplicates in case 'universal' is already in the input list.
7
+ */
8
+ export declare function getQuestionsForDomains(domains: LegalDomain[]): LegalQuestion[];
9
+ /**
10
+ * Builds a prompt string that an LLM can use to investigate legal requirements
11
+ * for a project's target countries and applicable domains.
12
+ */
13
+ export declare function buildLegalPrompt(questions: LegalQuestion[], countries: string[], specDescription: string): string;
14
+ //# sourceMappingURL=question-framework.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"question-framework.d.ts","sourceRoot":"","sources":["../../../src/engine/legal-compliance/question-framework.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAycvE,8DAA8D;AAC9D,eAAO,MAAM,eAAe,EAAE,aAAa,EAU1C,CAAC;AAMF;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,WAAW,EAAE,GAAG,aAAa,EAAE,CAK9E;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,aAAa,EAAE,EAC1B,SAAS,EAAE,MAAM,EAAE,EACnB,eAAe,EAAE,MAAM,GACtB,MAAM,CAsDR"}