@llm-dev-ops/agentics-cli 1.6.2 → 1.6.4

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.
@@ -1 +1 @@
1
- {"version":3,"file":"domain-codegen.d.ts","sourceRoot":"","sources":["../../../../src/pipeline/phase3/phases/domain-codegen.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EACV,aAAa,EACb,iBAAiB,EACjB,sBAAsB,EAGtB,aAAa,EAEd,MAAM,aAAa,CAAC;AAErB,OAAO,KAAK,EACV,iBAAiB,EAQjB,OAAO,EAGP,iBAAiB,EAGlB,MAAM,uBAAuB,CAAC;AAw5G/B;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAC7B,WAAW,EAAE,iBAAiB,EAC9B,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,sBAAsB,EAChC,KAAK,EAAE,iBAAiB,GACvB,aAAa,CAuUf;AA8PD;;;;;;;;;;GAUG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,iBAAiB,CAAC,CAwK5B"}
1
+ {"version":3,"file":"domain-codegen.d.ts","sourceRoot":"","sources":["../../../../src/pipeline/phase3/phases/domain-codegen.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EACV,aAAa,EACb,iBAAiB,EACjB,sBAAsB,EAGtB,aAAa,EAEd,MAAM,aAAa,CAAC;AAErB,OAAO,KAAK,EACV,iBAAiB,EAQjB,OAAO,EAGP,iBAAiB,EAGlB,MAAM,uBAAuB,CAAC;AAshH/B;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAC7B,WAAW,EAAE,iBAAiB,EAC9B,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,sBAAsB,EAChC,KAAK,EAAE,iBAAiB,GACvB,aAAa,CAuUf;AA8PD;;;;;;;;;;GAUG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,iBAAiB,CAAC,CAwK5B"}
@@ -495,6 +495,59 @@ function extractFieldsFromDescription(description, entityName) {
495
495
  { regex: /\b(?:source|origin|provider)\b/i, field: 'dataSource', type: 'string' },
496
496
  { regex: /\b(?:baseline|benchmark|target)\b/i, field: 'baselineValue', type: 'number' },
497
497
  { regex: /\b(?:confidence|accuracy|reliability)\b/i, field: 'confidenceScore', type: 'number' },
498
+ // ADR-PIPELINE-021: Retail / grocery domain fields
499
+ { regex: /\b(?:product|sku|item|merchandise)\b/i, field: 'productId', type: 'string' },
500
+ { regex: /\b(?:shelf[- ]?life|expir|best[- ]?before|use[- ]?by|perishab)\b/i, field: 'expiryDate', type: 'Date' },
501
+ { regex: /\b(?:upc|barcode|ean|gtin)\b/i, field: 'upc', type: 'string' },
502
+ { regex: /\b(?:store|branch|outlet)\b/i, field: 'storeId', type: 'string' },
503
+ { regex: /\b(?:aisle|shelf|bin|slot)\b/i, field: 'shelfLocation', type: 'string' },
504
+ { regex: /\b(?:supplier|vendor|manufacturer)\b/i, field: 'supplierId', type: 'string' },
505
+ { regex: /\b(?:discount|markdown|promotion|clearance)\b/i, field: 'discountPct', type: 'number' },
506
+ { regex: /\b(?:demand|forecast|predict)\b/i, field: 'forecastedDemand', type: 'number' },
507
+ { regex: /\b(?:inventory|stock|on[- ]?hand)\b/i, field: 'quantityOnHand', type: 'number' },
508
+ { regex: /\b(?:reorder|replenish|safety[- ]?stock)\b/i, field: 'reorderPoint', type: 'number' },
509
+ { regex: /\b(?:spoil|shrink|loss|damage)\b/i, field: 'shrinkagePct', type: 'number' },
510
+ // ADR-PIPELINE-021: Real estate / property domain fields
511
+ { regex: /\b(?:property|building|asset)\b/i, field: 'propertyId', type: 'string' },
512
+ { regex: /\b(?:tenant|lessee|occupant)\b/i, field: 'tenantId', type: 'string' },
513
+ { regex: /\b(?:lease|rental|tenancy)\b/i, field: 'leaseId', type: 'string' },
514
+ { regex: /\b(?:square[- ]?f(?:oo|ee)t|sqft|area|floor[- ]?space)\b/i, field: 'squareFootage', type: 'number' },
515
+ { regex: /\b(?:eui|energy[- ]?use[- ]?intensity)\b/i, field: 'energyUseIntensity', type: 'number' },
516
+ { regex: /\b(?:hvac|heating|cooling|ventilation)\b/i, field: 'hvacType', type: 'string' },
517
+ { regex: /\b(?:occupan|vacancy)\b/i, field: 'occupancyPct', type: 'number' },
518
+ { regex: /\b(?:year[- ]?built|construction[- ]?year)\b/i, field: 'yearBuilt', type: 'number' },
519
+ { regex: /\b(?:region|market|metro|geography|zone)\b/i, field: 'region', type: 'string' },
520
+ { regex: /\b(?:upgrade|retrofit|improvement|renovation)\b/i, field: 'upgradeType', type: 'string' },
521
+ { regex: /\b(?:insulation|r[- ]?value)\b/i, field: 'insulationRating', type: 'string' },
522
+ // ADR-PIPELINE-021: Manufacturing domain fields
523
+ { regex: /\b(?:work[- ]?order|job[- ]?order)\b/i, field: 'workOrderId', type: 'string' },
524
+ { regex: /\b(?:bom|bill[- ]?of[- ]?material)\b/i, field: 'bomId', type: 'string' },
525
+ { regex: /\b(?:lot|batch)\b/i, field: 'lotNumber', type: 'string' },
526
+ { regex: /\b(?:yield|output[- ]?rate)\b/i, field: 'yieldPct', type: 'number' },
527
+ { regex: /\b(?:defect|reject|scrap)\b/i, field: 'defectRate', type: 'number' },
528
+ { regex: /\b(?:machine|equipment|asset)\b/i, field: 'machineId', type: 'string' },
529
+ { regex: /\b(?:production[- ]?line|assembly[- ]?line)\b/i, field: 'lineId', type: 'string' },
530
+ { regex: /\b(?:cycle[- ]?time|takt[- ]?time)\b/i, field: 'cycleTimeMinutes', type: 'number' },
531
+ // ADR-PIPELINE-021: Financial domain fields
532
+ { regex: /\b(?:invoice|bill)\b/i, field: 'invoiceId', type: 'string' },
533
+ { regex: /\b(?:payment|remittance)\b/i, field: 'paymentId', type: 'string' },
534
+ { regex: /\b(?:gl[- ]?account|ledger[- ]?account|chart[- ]?of[- ]?account)\b/i, field: 'glAccountId', type: 'string' },
535
+ { regex: /\b(?:journal[- ]?entry|posting)\b/i, field: 'journalEntryId', type: 'string' },
536
+ { regex: /\b(?:reconcil|match)\b/i, field: 'isReconciled', type: 'boolean' },
537
+ { regex: /\b(?:debit|credit)\b/i, field: 'debitAmount', type: 'number' },
538
+ // ADR-PIPELINE-021: Healthcare domain fields
539
+ { regex: /\b(?:patient|member)\b/i, field: 'patientId', type: 'string' },
540
+ { regex: /\b(?:encounter|visit|admission)\b/i, field: 'encounterId', type: 'string' },
541
+ { regex: /\b(?:diagnos|icd|condition)\b/i, field: 'diagnosisCode', type: 'string' },
542
+ { regex: /\b(?:procedure|cpt|treatment)\b/i, field: 'procedureCode', type: 'string' },
543
+ { regex: /\b(?:prescription|medication|drug|rx)\b/i, field: 'prescriptionId', type: 'string' },
544
+ // ADR-PIPELINE-021: Supply chain / logistics domain fields
545
+ { regex: /\b(?:shipment|consignment)\b/i, field: 'shipmentId', type: 'string' },
546
+ { regex: /\b(?:carrier|transport|freight)\b/i, field: 'carrierId', type: 'string' },
547
+ { regex: /\b(?:warehouse|distribution[- ]?center|depot)\b/i, field: 'warehouseId', type: 'string' },
548
+ { regex: /\b(?:route|lane|corridor)\b/i, field: 'routeId', type: 'string' },
549
+ { regex: /\b(?:lead[- ]?time|transit[- ]?time|delivery[- ]?time)\b/i, field: 'leadTimeDays', type: 'number' },
550
+ { regex: /\b(?:weight|tonnage|mass)\b/i, field: 'weightKg', type: 'number' },
498
551
  ];
499
552
  for (const p of patterns) {
500
553
  if (p.regex.test(lower) && !seen.has(p.field)) {
@@ -502,10 +555,18 @@ function extractFieldsFromDescription(description, entityName) {
502
555
  fields.push({ name: p.field, type: p.type });
503
556
  }
504
557
  }
505
- // If no fields were detected, generate a sensible default based on the entity name
558
+ // ADR-PIPELINE-021: If description patterns found nothing, try matching against
559
+ // the entity NAME itself (e.g. "UpgradeOptions" → matches "upgrade" pattern).
560
+ // This catches entities with generic descriptions but domain-specific names.
506
561
  if (fields.length === 0) {
507
- const entitySlug = toCamelCase(entityName);
508
- fields.push({ name: `${entitySlug}Data`, type: 'Record<string, unknown>' });
562
+ const nameFields = extractFieldsFromDescription(entityName.replace(/([A-Z])/g, ' $1'), entityName);
563
+ if (nameFields.length > 0 && !(nameFields.length === 1 && nameFields[0].type === 'Record<string, unknown>')) {
564
+ fields.push(...nameFields);
565
+ }
566
+ }
567
+ // Final fallback: generate common domain entity fields instead of Record<string, unknown>
568
+ if (fields.length === 0) {
569
+ fields.push({ name: 'name', type: 'string' }, { name: 'description', type: 'string' }, { name: 'status', type: 'string' });
509
570
  }
510
571
  return fields;
511
572
  }
@@ -1069,6 +1130,66 @@ function inferDtoFields(typeName) {
1069
1130
  { regex: /input$/i, extraFields: [
1070
1131
  { name: 'data', type: 'Record<string, unknown>' },
1071
1132
  ] },
1133
+ // ADR-PIPELINE-021: Retail / grocery domain DTOs
1134
+ { regex: /product.*risk|risk.*product|unsold|expir|spoil|waste.*product/i, extraFields: [
1135
+ { name: 'productId', type: 'string' }, { name: 'storeId', type: 'string' },
1136
+ { name: 'riskScore', type: 'number' }, { name: 'daysUntilExpiry', type: 'number' },
1137
+ { name: 'quantityOnHand', type: 'number' }, { name: 'forecastedDemand', type: 'number' },
1138
+ { name: 'recommendedAction', type: 'string' }, { name: 'estimatedWasteKg', type: 'number' },
1139
+ ] },
1140
+ { regex: /sales.*pattern|pattern.*sales|sales.*inventory|demand/i, extraFields: [
1141
+ { name: 'storeId', type: 'string' }, { name: 'productId', type: 'string' },
1142
+ { name: 'periodStart', type: 'string' }, { name: 'periodEnd', type: 'string' },
1143
+ { name: 'unitsSold', type: 'number' }, { name: 'revenue', type: 'number' },
1144
+ { name: 'trend', type: 'string' },
1145
+ ] },
1146
+ { regex: /waste.*track|waste.*hotspot|food.*waste|shrink/i, extraFields: [
1147
+ { name: 'storeId', type: 'string' }, { name: 'category', type: 'string' },
1148
+ { name: 'wasteKg', type: 'number' }, { name: 'wasteCost', type: 'number' },
1149
+ { name: 'cause', type: 'string' }, { name: 'reportingPeriod', type: 'string' },
1150
+ ] },
1151
+ { regex: /order.*adjust|adjust.*order|replenish|reorder/i, extraFields: [
1152
+ { name: 'storeId', type: 'string' }, { name: 'productId', type: 'string' },
1153
+ { name: 'currentOrderQty', type: 'number' }, { name: 'recommendedQty', type: 'number' },
1154
+ { name: 'adjustmentReason', type: 'string' }, { name: 'expectedWasteReduction', type: 'number' },
1155
+ ] },
1156
+ // ADR-PIPELINE-021: Real estate / property domain DTOs
1157
+ { regex: /property|building|real.*estate/i, extraFields: [
1158
+ { name: 'address', type: 'string' }, { name: 'propertyType', type: 'string' },
1159
+ { name: 'squareFootage', type: 'number' }, { name: 'yearBuilt', type: 'number' },
1160
+ { name: 'region', type: 'string' }, { name: 'occupancyPct', type: 'number' },
1161
+ { name: 'currentEUI', type: 'number' }, { name: 'emissionsBaseline', type: 'number' },
1162
+ ] },
1163
+ { regex: /upgrade.*option|option.*upgrade|retrofit|improvement/i, extraFields: [
1164
+ { name: 'upgradeType', type: 'string' }, { name: 'estimatedCost', type: 'number' },
1165
+ { name: 'estimatedSavingsKwh', type: 'number' }, { name: 'estimatedEmissionsReduction', type: 'number' },
1166
+ { name: 'tenantDisruptionLevel', type: 'string' }, { name: 'implementationWeeks', type: 'number' },
1167
+ { name: 'paybackPeriodMonths', type: 'number' },
1168
+ ] },
1169
+ { regex: /priorit|opportunit|biggest/i, extraFields: [
1170
+ { name: 'propertyId', type: 'string' }, { name: 'opportunityScore', type: 'number' },
1171
+ { name: 'estimatedSavings', type: 'number' }, { name: 'estimatedCost', type: 'number' },
1172
+ { name: 'roiPct', type: 'number' }, { name: 'priority', type: 'string' },
1173
+ ] },
1174
+ // ADR-PIPELINE-021: Manufacturing domain DTOs
1175
+ { regex: /work.*order|production.*order|job.*order/i, extraFields: [
1176
+ { name: 'bomId', type: 'string' }, { name: 'productId', type: 'string' },
1177
+ { name: 'quantity', type: 'number' }, { name: 'lineId', type: 'string' },
1178
+ { name: 'startDate', type: 'string' }, { name: 'dueDate', type: 'string' },
1179
+ { name: 'yieldPct', type: 'number' }, { name: 'status', type: 'string' },
1180
+ ] },
1181
+ // ADR-PIPELINE-021: Financial domain DTOs
1182
+ { regex: /invoice|accounts.*payable|accounts.*receivable/i, extraFields: [
1183
+ { name: 'vendorId', type: 'string' }, { name: 'amount', type: 'number' },
1184
+ { name: 'currency', type: 'string' }, { name: 'dueDate', type: 'string' },
1185
+ { name: 'lineItems', type: 'number' }, { name: 'status', type: 'string' },
1186
+ ] },
1187
+ // ADR-PIPELINE-021: Supply chain DTOs
1188
+ { regex: /shipment|delivery|transport|logistics/i, extraFields: [
1189
+ { name: 'origin', type: 'string' }, { name: 'destination', type: 'string' },
1190
+ { name: 'carrierId', type: 'string' }, { name: 'weightKg', type: 'number' },
1191
+ { name: 'estimatedDelivery', type: 'string' }, { name: 'status', type: 'string' },
1192
+ ] },
1072
1193
  ];
1073
1194
  let matched = false;
1074
1195
  for (const rule of rules) {