@carbonstopper/agent-mcp 0.1.47 → 0.1.48

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/dist/tools.js CHANGED
@@ -516,36 +516,36 @@ const enterpriseEmissionComputationUpdateSchema = z.object({
516
516
  unit: z.string().optional().describe("Total emission unit. Agent normally should omit this unless backend requires a known display unit."),
517
517
  sourceList: z.array(enterpriseEmissionSourceUpdateSchema).min(1).describe("Emission source updates under this computation. Every item must include sourceId."),
518
518
  });
519
- const cbam2Language = z.enum(["zh", "en"])
519
+ const cbamLanguage = z.enum(["zh", "en"])
520
520
  .optional()
521
- .describe("Response language for this CBAM2 call. Omit to use Chinese; supported values are zh and en.");
522
- const cbam2Code = z.union([
521
+ .describe("Response language for this CBAM call. Omit to use Chinese; supported values are zh and en.");
522
+ const cbamCode = z.union([
523
523
  z.number().int().nonnegative(),
524
524
  z.string().trim().regex(/^\d+$/, "Expected a numeric CBAM code"),
525
525
  ]);
526
- const cbam2ZeroOne = z.union([
526
+ const cbamZeroOne = z.union([
527
527
  z.literal(0),
528
528
  z.literal(1),
529
529
  z.literal("0"),
530
530
  z.literal("1"),
531
531
  ]);
532
- const cbam2Date = z.string().trim()
532
+ const cbamDate = z.string().trim()
533
533
  .regex(/^\d{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12]\d|3[01])$/, "Expected yyyy-MM-dd")
534
534
  .describe("Calendar date in yyyy-MM-dd format.");
535
- const cbam2ReadFields = {
535
+ const cbamReadFields = {
536
536
  sessionId,
537
537
  ...skillTraceFields,
538
- lang: cbam2Language,
538
+ lang: cbamLanguage,
539
539
  };
540
- const cbam2WriteFields = {
541
- ...cbam2ReadFields,
540
+ const cbamWriteFields = {
541
+ ...cbamReadFields,
542
542
  idempotencyKey: idempotencyKey.max(128),
543
543
  };
544
- const cbam2ConfirmedWriteFields = {
545
- ...cbam2WriteFields,
544
+ const cbamConfirmedWriteFields = {
545
+ ...cbamWriteFields,
546
546
  ...confirmedActionFields,
547
547
  };
548
- const cbam2ReferenceType = z.enum([
548
+ const cbamReferenceType = z.enum([
549
549
  "ORGANIZATION",
550
550
  "FACTORY",
551
551
  "COUNTRY",
@@ -559,7 +559,7 @@ const cbam2ReferenceType = z.enum([
559
559
  "DEFAULT_SALE",
560
560
  "CARBON_TAX_CANDIDATE",
561
561
  ]);
562
- const cbam2Section = z.enum([
562
+ const cbamSection = z.enum([
563
563
  "GENERAL_INFO",
564
564
  "PROCESS",
565
565
  "PRECURSOR",
@@ -572,7 +572,7 @@ const cbam2Section = z.enum([
572
572
  "DATA_QUALITY",
573
573
  "RESULT_SUMMARY",
574
574
  ]);
575
- const cbam2ItemType = z.enum([
575
+ const cbamItemType = z.enum([
576
576
  "PROCESS",
577
577
  "PRECURSOR",
578
578
  "SOURCE_FLOW",
@@ -581,30 +581,30 @@ const cbam2ItemType = z.enum([
581
581
  "CARBON_TAX",
582
582
  "DATA_QUALITY",
583
583
  ]);
584
- function cbam2Coordinate(minimum, maximum, name) {
584
+ function cbamCoordinate(minimum, maximum, name) {
585
585
  return z.string().trim().min(1).max(50)
586
586
  .refine((value) => Number.isFinite(Number(value)), `${name} must be a decimal number`)
587
587
  .refine((value) => Number(value) >= minimum && Number(value) <= maximum, `${name} must be between ${minimum} and ${maximum}`);
588
588
  }
589
- const cbam2FactoryForm = z.object({
589
+ const cbamFactoryForm = z.object({
590
590
  factorName: z.string().trim().min(1).max(100).describe("Factory Chinese or local name."),
591
- orgId: longId.describe("Organization id returned by cbam2_reference_search with type ORGANIZATION."),
591
+ orgId: longId.describe("Organization id returned by cbam_reference_search with type ORGANIZATION."),
592
592
  factoryCode: z.string().max(100).optional().describe("Optional globally unique factory code. Omit it on create to let the backend generate one; preserve the returned value on update."),
593
593
  factoryNameEn: z.string().trim().min(1).max(200).describe("Factory English name."),
594
- country: z.string().trim().min(1).max(100).describe("Country dictionary value returned by cbam2_reference_search with type COUNTRY."),
594
+ country: z.string().trim().min(1).max(100).describe("Country dictionary value returned by cbam_reference_search with type COUNTRY."),
595
595
  locationCode: z.string().trim().min(1).max(100).describe("UN/LOCODE or supported location code."),
596
596
  city: z.string().trim().min(1).max(100),
597
597
  detailedAddress: z.string().trim().min(1).max(500),
598
598
  postalCode: z.string().trim().min(1).max(30),
599
599
  postOfficeBox: z.string().trim().min(1).max(100),
600
- longitude: cbam2Coordinate(-180, 180, "longitude"),
601
- latitude: cbam2Coordinate(-90, 90, "latitude"),
600
+ longitude: cbamCoordinate(-180, 180, "longitude"),
601
+ latitude: cbamCoordinate(-90, 90, "latitude"),
602
602
  economicActivity: z.string().max(1000).optional(),
603
603
  authorizedRepresentative: z.string().max(100).optional(),
604
604
  email: z.union([z.string().email().max(100), z.literal("")]).optional(),
605
605
  mobile: z.string().max(50).optional(),
606
606
  });
607
- const cbam2Verification = z.object({
607
+ const cbamVerification = z.object({
608
608
  corporateName: z.string().max(200).optional(),
609
609
  detailedAddress: z.string().max(500).optional(),
610
610
  city: z.string().max(100).optional(),
@@ -618,39 +618,39 @@ const cbam2Verification = z.object({
618
618
  certificationName: z.string().max(200).optional(),
619
619
  registrationNo: z.string().max(100).optional(),
620
620
  });
621
- const cbam2ReportForm = z.object({
621
+ const cbamReportForm = z.object({
622
622
  reportName: z.string().trim().min(1).max(200),
623
623
  orgId: longId.describe("Organization id for the report. It must be visible to the current user."),
624
- startDate: cbam2Date,
625
- endDate: cbam2Date,
626
- factoryId: longId.describe("Factory id returned by cbam2_reference_search or cbam2_factory_save."),
627
- include: cbam2ZeroOne.describe("Heat-power cogeneration flag. 0=include heat-power data; 1=do not include it, matching the migrated CBAM2 convention."),
628
- verification: cbam2Verification.optional().describe("Optional verification organization information. Omit on update to preserve the current verification record."),
624
+ startDate: cbamDate,
625
+ endDate: cbamDate,
626
+ factoryId: longId.describe("Factory id returned by cbam_reference_search or cbam_factory_save."),
627
+ include: cbamZeroOne.describe("Heat-power cogeneration flag. 0=include heat-power data; 1=do not include it, matching the migrated CBAM convention."),
628
+ verification: cbamVerification.optional().describe("Optional verification organization information. Omit on update to preserve the current verification record."),
629
629
  });
630
- const cbam2ProcessDefinition = z.object({
630
+ const cbamProcessDefinition = z.object({
631
631
  id: longId.optional().describe("Existing process id for update. Omit to create a new process."),
632
632
  processName: z.string().trim().min(1).max(200),
633
- productCategoryId: longId.describe("Product category id returned by cbam2_reference_search."),
633
+ productCategoryId: longId.describe("Product category id returned by cbam_reference_search."),
634
634
  preId: z.string().optional().describe("Comma-separated preceding process ids from this report. Use an empty string to clear."),
635
635
  elseProduct: z.string().optional().describe("Comma-separated default-product ids for the selected category. Use an empty string to clear."),
636
636
  preProcess: z.string().optional().describe("Comma-separated precursor ids from this report. Use an empty string to clear."),
637
637
  orderNum: z.number().int().min(1).max(10).optional(),
638
- productRoute: z.string().optional().describe("Comma-separated default-process route ids returned by cbam2_reference_search."),
639
- includeType: cbam2ZeroOne.optional().describe("Production-route selection mode: 0=automatic, 1=manual."),
638
+ productRoute: z.string().optional().describe("Comma-separated default-process route ids returned by cbam_reference_search."),
639
+ includeType: cbamZeroOne.optional().describe("Production-route selection mode: 0=automatic, 1=manual."),
640
640
  });
641
- const cbam2PrecursorDefinition = z.object({
641
+ const cbamPrecursorDefinition = z.object({
642
642
  id: longId.optional().describe("Existing precursor id for update. Omit to create a new precursor."),
643
643
  preName: z.string().trim().min(1).max(200),
644
- productCategoryId: longId.describe("Product category id returned by cbam2_reference_search."),
645
- countryCode: z.string().max(100).optional().describe("Country dictionary value returned by cbam2_reference_search; omit or clear when not yet known."),
644
+ productCategoryId: longId.describe("Product category id returned by cbam_reference_search."),
645
+ countryCode: z.string().max(100).optional().describe("Country dictionary value returned by cbam_reference_search; omit or clear when not yet known."),
646
646
  orderNum: z.number().int().min(1).max(20).optional(),
647
- productRoute: z.string().optional().describe("Comma-separated default-process route ids returned by cbam2_reference_search."),
647
+ productRoute: z.string().optional().describe("Comma-separated default-process route ids returned by cbam_reference_search."),
648
648
  });
649
- const cbam2SourceFlow = z.object({
649
+ const cbamSourceFlow = z.object({
650
650
  id: longId.optional().describe("Existing source-flow id for update. Omit to create a new row."),
651
651
  productProcessId: longId.describe("Owning process id from the same report."),
652
- processMethod: cbam2Code.describe("Process-method code returned by CBAM_ENUM reference data."),
653
- sourceType: cbam2Code.describe("Source-flow type code returned by CBAM_ENUM reference data."),
652
+ processMethod: cbamCode.describe("Process-method code returned by CBAM_ENUM reference data."),
653
+ sourceType: cbamCode.describe("Source-flow type code returned by CBAM_ENUM reference data."),
654
654
  sourceName: z.string().trim().min(1).max(200),
655
655
  activityData: nonNegativeNumericValue.optional().describe("Activity amount. Required for sourceType=1 with processMethod 1/2/3 and for sourceType=2 with processMethod 4/5."),
656
656
  activityUnit: z.string().max(100).optional().describe("Unit of activityData."),
@@ -660,7 +660,7 @@ const cbam2SourceFlow = z.object({
660
660
  emissionCoefficientUnit: z.string().max(100).optional().describe("Emission-coefficient unit. For sourceType=1, value tCO2/TJ additionally requires lowHeat."),
661
661
  conversionRate: nonNegativeNumericValue.optional().describe("Conversion factor for sourceType=1/processMethod=2; slope coefficient for sourceType=2/processMethod=4; average flue-gas flow for sourceType=3."),
662
662
  oxRate: nonNegativeNumericValue.optional().describe("Oxidation rate for sourceType=1/processMethod=1; C2F6 fraction for sourceType=2/processMethod=4/5."),
663
- carbon: nonNegativeNumericValue.optional().describe("Carbon content for sourceType=1/processMethod=3; PFC collection efficiency for sourceType=2. It is required and must be greater than zero for sourceType=2/processMethod=5. The backend defaults it only where the CBAM2 formula allows."),
663
+ carbon: nonNegativeNumericValue.optional().describe("Carbon content for sourceType=1/processMethod=3; PFC collection efficiency for sourceType=2. It is required and must be greater than zero for sourceType=2/processMethod=5. The backend defaults it only where the CBAM formula allows."),
664
664
  carbonUnit: z.string().max(100).optional(),
665
665
  conversionRateUnit: z.string().max(100).optional(),
666
666
  biomassContent: nonNegativeNumericValue.optional().describe("Biomass content for sourceType=1; anode-effect overvoltage AEO for sourceType=2/processMethod=5; biomass share for sourceType=3."),
@@ -668,7 +668,7 @@ const cbam2SourceFlow = z.object({
668
668
  carbonFossil: nonNegativeNumericValue.optional().describe("Non-zero anode-effect CE denominator, required only for sourceType=2/processMethod=5."),
669
669
  carbonBiological: nonNegativeNumericValue.optional().describe("Overvoltage coefficient, required only for sourceType=2/processMethod=5."),
670
670
  }).describe("Editable source-flow inputs. Valid combinations are sourceType=1 with processMethod=1/2/3, sourceType=2 with processMethod=4/5, or sourceType=3 with processMethod=6/7. energyFossil and attachments are backend-owned and are never accepted.");
671
- const cbam2HeatPowerData = z.object({
671
+ const cbamHeatPowerData = z.object({
672
672
  fuelIn: positiveNumericValue.describe("Fuel input; must be greater than zero."),
673
673
  hotPer: positiveNumericValue.describe("Heat allocation parameter; must be greater than zero."),
674
674
  elePer: positiveNumericValue.describe("Electricity allocation parameter; must be greater than zero."),
@@ -678,54 +678,54 @@ const cbam2HeatPowerData = z.object({
678
678
  smokeOut: nonNegativeNumericValue,
679
679
  inputFactor: nonNegativeNumericValue.optional(),
680
680
  });
681
- const cbam2ActivityRow = z.object({
681
+ const cbamActivityRow = z.object({
682
682
  relationId: longId.describe("Default-process id or related process id selected from the current item route."),
683
- isDefault: cbam2ZeroOne.describe("0=default-process route row; 1=related in-report process row."),
683
+ isDefault: cbamZeroOne.describe("0=default-process route row; 1=related in-report process row."),
684
684
  emission: nonNegativeNumericValue.describe("Activity amount for this route row."),
685
685
  });
686
- const cbam2ProductAttribution = z.object({
687
- id: longId.optional().describe("Existing attribution id returned by cbam2_report_read. Omit for a new row."),
688
- emissionElement: cbam2Code.describe("Emission-element code returned by CBAM_ENUM reference data."),
689
- isExists: cbam2Code.describe("Whether this emission element is included; use the exact CBAM_ENUM code."),
686
+ const cbamProductAttribution = z.object({
687
+ id: longId.optional().describe("Existing attribution id returned by cbam_report_read. Omit for a new row."),
688
+ emissionElement: cbamCode.describe("Emission-element code returned by CBAM_ENUM reference data."),
689
+ isExists: cbamCode.describe("Whether this emission element is included; use the exact CBAM_ENUM code."),
690
690
  inputPower: nonNegativeNumericValue.optional(),
691
691
  inputFactor: nonNegativeNumericValue.optional(),
692
692
  outPower: nonNegativeNumericValue.optional(),
693
693
  outFactor: nonNegativeNumericValue.optional(),
694
- emissionSource: cbam2Code.optional(),
694
+ emissionSource: cbamCode.optional(),
695
695
  eleSource: z.string().max(100).optional(),
696
- eleChoose: cbam2Code.optional(),
696
+ eleChoose: cbamCode.optional(),
697
697
  defaultCnId: longId.optional(),
698
698
  cnCode: z.string().max(100).optional(),
699
699
  });
700
- const cbam2ElectricityCalculator = z.object({
700
+ const cbamElectricityCalculator = z.object({
701
701
  id: longId.optional(),
702
702
  eleValue: nonNegativeNumericValue,
703
703
  coefficient: nonNegativeNumericValue,
704
704
  });
705
- const cbam2ProcessProductData = z.object({
705
+ const cbamProcessProductData = z.object({
706
706
  id: longId.describe("Existing process id from the same report."),
707
707
  totalVolume: nonNegativeNumericValue.describe("Total output. Must satisfy totalVolume - salesVolume - nonProduct - sum(processList emission where isDefault=1) = 0 at six-decimal precision."),
708
708
  salesVolume: nonNegativeNumericValue.describe("Sold output used in the process balance equation."),
709
709
  nonProduct: nonNegativeNumericValue.optional().describe("Non-product output used in the process balance equation; omit to treat it as zero."),
710
- processList: z.array(cbam2ActivityRow).max(100).optional().describe("Activity route rows. Rows with isDefault=1 are subtracted in the process balance equation."),
711
- productAttributionList: z.array(cbam2ProductAttribution).max(100).optional(),
712
- eleCalculatorList: z.array(cbam2ElectricityCalculator).max(100).optional(),
710
+ processList: z.array(cbamActivityRow).max(100).optional().describe("Activity route rows. Rows with isDefault=1 are subtracted in the process balance equation."),
711
+ productAttributionList: z.array(cbamProductAttribution).max(100).optional(),
712
+ eleCalculatorList: z.array(cbamElectricityCalculator).max(100).optional(),
713
713
  }).describe("Complete product activity/emission data for one existing process. The backend rejects an unbalanced item.");
714
- const cbam2PrecursorProductData = z.object({
714
+ const cbamPrecursorProductData = z.object({
715
715
  id: longId.describe("Existing precursor id from the same report."),
716
716
  purchaseVolume: nonNegativeNumericValue.optional(),
717
717
  nonProduct: nonNegativeNumericValue.optional().describe("Non-product amount subtracted in the precursor balance equation."),
718
- defaultReason: cbam2Code.optional(),
719
- isDefault: cbam2ZeroOne.optional(),
720
- processList: z.array(cbam2ActivityRow).max(100).optional().describe("Must satisfy sum(emission where isDefault=0) - sum(emission where isDefault=1) - nonProduct = 0 at six-decimal precision."),
721
- productAttributionList: z.array(cbam2ProductAttribution).max(100).optional(),
718
+ defaultReason: cbamCode.optional(),
719
+ isDefault: cbamZeroOne.optional(),
720
+ processList: z.array(cbamActivityRow).max(100).optional().describe("Must satisfy sum(emission where isDefault=0) - sum(emission where isDefault=1) - nonProduct = 0 at six-decimal precision."),
721
+ productAttributionList: z.array(cbamProductAttribution).max(100).optional(),
722
722
  }).describe("Complete activity/emission data for one existing precursor. The backend rejects an unbalanced item.");
723
- const cbam2SaleProduct = z.object({
723
+ const cbamSaleProduct = z.object({
724
724
  id: longId.optional().describe("Existing sale-product id for update. Omit to create."),
725
725
  cnCode: z.string().trim().min(1).max(100).describe("CN code valid for the selected process product category."),
726
726
  processId: longId.describe("Owning process id from the same report."),
727
727
  productName: z.string().trim().min(1).max(200),
728
- reducing: cbam2Code.optional(),
728
+ reducing: cbamCode.optional(),
729
729
  steelCode: z.string().max(100).optional(),
730
730
  mnPer: nonNegativeNumericValue.optional(),
731
731
  crPer: nonNegativeNumericValue.optional(),
@@ -737,9 +737,9 @@ const cbam2SaleProduct = z.object({
737
737
  wasteMaterial: nonNegativeNumericValue.optional(),
738
738
  alUse: nonNegativeNumericValue.optional(),
739
739
  nonAl: nonNegativeNumericValue.optional(),
740
- clinker: nonNegativeNumericValue.describe("Cement clinker value required by the migrated CBAM2 form contract."),
741
- calcine: cbam2Code.describe("Calcination flag code required by the migrated CBAM2 form contract."),
742
- solution: nonNegativeNumericValue.describe("Aqueous-solution concentration required by the migrated CBAM2 form contract."),
740
+ clinker: nonNegativeNumericValue.describe("Cement clinker value required by the migrated CBAM form contract."),
741
+ calcine: cbamCode.describe("Calcination flag code required by the migrated CBAM form contract."),
742
+ solution: nonNegativeNumericValue.describe("Aqueous-solution concentration required by the migrated CBAM form contract."),
743
743
  nitric: nonNegativeNumericValue.optional(),
744
744
  urea: nonNegativeNumericValue.optional(),
745
745
  nitrogen: nonNegativeNumericValue.optional(),
@@ -748,31 +748,31 @@ const cbam2SaleProduct = z.object({
748
748
  urPer: nonNegativeNumericValue.optional(),
749
749
  organic: nonNegativeNumericValue.optional(),
750
750
  });
751
- const cbam2CarbonTax = z.object({
751
+ const cbamCarbonTax = z.object({
752
752
  id: longId.optional().describe("Existing carbon-tax row id for update. Omit to create."),
753
753
  saleProductId: longId.describe("Sale-product id from the same report."),
754
- reportSelected: cbam2ZeroOne.optional(),
755
- emissionValueType: cbam2Code.optional(),
756
- emissionSourceType: cbam2Code.optional(),
754
+ reportSelected: cbamZeroOne.optional(),
755
+ emissionValueType: cbamCode.optional(),
756
+ emissionSourceType: cbamCode.optional(),
757
757
  emissionSourceSaleProductId: longId.optional(),
758
758
  emissionSourceDefaultCnId: longId.optional(),
759
759
  emissionSourceYear: z.number().int().min(1900).max(9999).optional(),
760
760
  productBenchmarkId: longId.optional(),
761
- productBenchmarkType: cbam2Code.optional(),
761
+ productBenchmarkType: cbamCode.optional(),
762
762
  cbamAdjustmentFactor: nonNegativeNumericValue.optional(),
763
763
  paidCarbonPrice: nonNegativeNumericValue.optional(),
764
- taxType: cbam2Code.optional(),
764
+ taxType: cbamCode.optional(),
765
765
  emissionPer: nonNegativeNumericValue.optional(),
766
- currencyType: z.string().trim().min(1).max(100).describe("Currency dictionary value returned by cbam2_reference_search."),
766
+ currencyType: z.string().trim().min(1).max(100).describe("Currency dictionary value returned by cbam_reference_search."),
767
767
  taxValue: nonNegativeNumericValue.optional(),
768
- offsetMethod: cbam2Code.optional(),
768
+ offsetMethod: cbamCode.optional(),
769
769
  offsetPer: nonNegativeNumericValue.optional(),
770
770
  offsetPrice: nonNegativeNumericValue.optional(),
771
771
  });
772
- const cbam2DataQuality = z.object({
773
- generalInformation: cbam2Code.optional(),
774
- defaultReason: cbam2Code.optional(),
775
- qualityAssurance: cbam2Code.optional(),
772
+ const cbamDataQuality = z.object({
773
+ generalInformation: cbamCode.optional(),
774
+ defaultReason: cbamCode.optional(),
775
+ qualityAssurance: cbamCode.optional(),
776
776
  carbonPrice: z.string().max(5000).optional(),
777
777
  supplement: z.string().max(5000).optional(),
778
778
  });
@@ -780,13 +780,13 @@ export const schemas = {
780
780
  session_carbon_objects: z.object({
781
781
  sessionId,
782
782
  module: z
783
- .enum(["all", "footprint3", "enterprise", "cbam2"])
783
+ .enum(["all", "footprint3", "enterprise", "cbam"])
784
784
  .optional()
785
- .describe("Optional module filter. Omit it or use all to return product-carbon, enterprise-carbon, and CBAM2 objects."),
785
+ .describe("Optional module filter. Omit it or use all to return product-carbon, enterprise-carbon, and CBAM objects."),
786
786
  }),
787
- cbam2_reference_search: z.object({
788
- ...cbam2ReadFields,
789
- types: z.array(cbam2ReferenceType).min(1).max(12)
787
+ cbam_reference_search: z.object({
788
+ ...cbamReadFields,
789
+ types: z.array(cbamReferenceType).min(1).max(12)
790
790
  .describe("Only the reference-data families needed for the current step. CARBON_TAX_CANDIDATE additionally requires reportId."),
791
791
  keyword: z.string().trim().max(200).optional(),
792
792
  orgId: longId.optional(),
@@ -795,8 +795,8 @@ export const schemas = {
795
795
  pageNum: z.number().int().min(1).optional(),
796
796
  pageSize: z.number().int().min(1).max(200).optional(),
797
797
  }),
798
- cbam2_report_search: z.object({
799
- ...cbam2ReadFields,
798
+ cbam_report_search: z.object({
799
+ ...cbamReadFields,
800
800
  reportName: z.string().trim().max(200).optional(),
801
801
  orgId: longId.optional(),
802
802
  factoryId: longId.optional(),
@@ -804,94 +804,94 @@ export const schemas = {
804
804
  pageNum: z.number().int().min(1).optional(),
805
805
  pageSize: z.number().int().min(1).max(100).optional(),
806
806
  }),
807
- cbam2_report_read: z.object({
808
- ...cbam2ReadFields,
809
- reportId: longId.describe("Exact CBAM2 report id returned by cbam2_report_search, cbam2_report_save, or session_carbon_objects."),
807
+ cbam_report_read: z.object({
808
+ ...cbamReadFields,
809
+ reportId: longId.describe("Exact CBAM report id returned by cbam_report_search, cbam_report_save, or session_carbon_objects."),
810
810
  view: z.enum(["snapshot", "section", "item", "result", "readiness", "carbon_tax_status"])
811
811
  .describe("Read mode. snapshot=whole workflow overview; section=one form section; item=one child record; result=result summary; readiness=generation blockers; carbon_tax_status=asynchronous tax calculation status."),
812
- section: cbam2Section.optional().describe("Required only when view=section."),
813
- itemType: cbam2ItemType.optional().describe("Required only when view=item."),
812
+ section: cbamSection.optional().describe("Required only when view=section."),
813
+ itemType: cbamItemType.optional().describe("Required only when view=item."),
814
814
  itemId: longId.optional().describe("Required only when view=item; must belong to reportId."),
815
815
  }),
816
- cbam2_factory_read: z.object({
817
- ...cbam2ReadFields,
818
- factoryId: longId.describe("Exact factory id returned by cbam2_reference_search or cbam2_factory_save."),
816
+ cbam_factory_read: z.object({
817
+ ...cbamReadFields,
818
+ factoryId: longId.describe("Exact factory id returned by cbam_reference_search or cbam_factory_save."),
819
819
  }),
820
- cbam2_factory_save: z.object({
821
- ...cbam2ConfirmedWriteFields,
820
+ cbam_factory_save: z.object({
821
+ ...cbamConfirmedWriteFields,
822
822
  action: z.enum(["create", "update"]),
823
823
  factoryId: longId.optional().describe("Required for action=update and omitted for action=create."),
824
- factory: cbam2FactoryForm.describe("Complete factory form. For update, first call cbam2_factory_read and preserve unchanged fields and orgId."),
824
+ factory: cbamFactoryForm.describe("Complete factory form. For update, first call cbam_factory_read and preserve unchanged fields and orgId."),
825
825
  }),
826
- cbam2_report_save: z.object({
827
- ...cbam2WriteFields,
826
+ cbam_report_save: z.object({
827
+ ...cbamWriteFields,
828
828
  action: z.enum(["create", "update"]),
829
829
  reportId: longId.optional().describe("Required for action=update and omitted for action=create."),
830
- report: cbam2ReportForm.describe("Complete CBAM2 general-information form."),
830
+ report: cbamReportForm.describe("Complete CBAM general-information form."),
831
831
  }),
832
- cbam2_process_manage: z.object({
833
- ...cbam2ConfirmedWriteFields,
832
+ cbam_process_manage: z.object({
833
+ ...cbamConfirmedWriteFields,
834
834
  reportId: longId,
835
835
  action: z.enum(["save", "delete", "reorder"]).describe("save requires items and forbids ids; delete requires ids and uses WAIT_CONFIRM; reorder requires the complete ordered ids list and forbids items."),
836
- items: z.array(cbam2ProcessDefinition).min(1).max(10).optional()
836
+ items: z.array(cbamProcessDefinition).min(1).max(10).optional()
837
837
  .describe("Required only for action=save. The report can contain at most 10 processes."),
838
838
  ids: z.array(longId).min(1).max(10).optional()
839
839
  .describe("Required for delete/reorder. Reorder must contain every report process exactly once in target order."),
840
840
  }),
841
- cbam2_precursor_manage: z.object({
842
- ...cbam2ConfirmedWriteFields,
841
+ cbam_precursor_manage: z.object({
842
+ ...cbamConfirmedWriteFields,
843
843
  reportId: longId,
844
844
  action: z.enum(["save", "delete"]).describe("save requires items and forbids ids; delete requires ids and uses WAIT_CONFIRM."),
845
- items: z.array(cbam2PrecursorDefinition).min(1).max(20).optional()
845
+ items: z.array(cbamPrecursorDefinition).min(1).max(20).optional()
846
846
  .describe("Required only for action=save. The report can contain at most 20 manually entered precursors."),
847
847
  ids: z.array(longId).min(1).max(20).optional().describe("Required only for action=delete."),
848
848
  }),
849
- cbam2_source_flow_manage: z.object({
850
- ...cbam2ConfirmedWriteFields,
849
+ cbam_source_flow_manage: z.object({
850
+ ...cbamConfirmedWriteFields,
851
851
  reportId: longId,
852
852
  action: z.enum(["save", "delete"]).describe("save requires items and forbids ids; delete requires ids and uses WAIT_CONFIRM."),
853
- items: z.array(cbam2SourceFlow).min(1).max(200).optional().describe("Required only for action=save."),
853
+ items: z.array(cbamSourceFlow).min(1).max(200).optional().describe("Required only for action=save."),
854
854
  ids: z.array(longId).min(1).max(100).optional().describe("Required only for action=delete."),
855
855
  }),
856
- cbam2_heat_power_update: z.object({
857
- ...cbam2WriteFields,
856
+ cbam_heat_power_update: z.object({
857
+ ...cbamWriteFields,
858
858
  reportId: longId,
859
- data: cbam2HeatPowerData.describe("Complete heat-power input form. The backend calculates outPower and outFactor; never submit calculated outputs."),
859
+ data: cbamHeatPowerData.describe("Complete heat-power input form. The backend calculates outPower and outFactor; never submit calculated outputs."),
860
860
  }),
861
- cbam2_product_data_update: z.object({
862
- ...cbam2WriteFields,
861
+ cbam_product_data_update: z.object({
862
+ ...cbamWriteFields,
863
863
  reportId: longId,
864
864
  dataType: z.enum(["process", "precursor"])
865
865
  .describe("Select process for self-produced process activity data or precursor for purchased-precursor activity/emission data."),
866
- items: z.array(z.union([cbam2ProcessProductData, cbam2PrecursorProductData])).min(1).max(100),
866
+ items: z.array(z.union([cbamProcessProductData, cbamPrecursorProductData])).min(1).max(100),
867
867
  }),
868
- cbam2_sale_product_manage: z.object({
869
- ...cbam2ConfirmedWriteFields,
868
+ cbam_sale_product_manage: z.object({
869
+ ...cbamConfirmedWriteFields,
870
870
  reportId: longId,
871
871
  action: z.enum(["save", "delete"]).describe("save requires items and forbids ids; delete requires ids and uses WAIT_CONFIRM."),
872
- items: z.array(cbam2SaleProduct).min(1).max(100).optional().describe("Required only for action=save."),
872
+ items: z.array(cbamSaleProduct).min(1).max(100).optional().describe("Required only for action=save."),
873
873
  ids: z.array(longId).min(1).max(100).optional().describe("Required only for action=delete."),
874
874
  }),
875
- cbam2_carbon_tax_manage: z.object({
876
- ...cbam2ConfirmedWriteFields,
875
+ cbam_carbon_tax_manage: z.object({
876
+ ...cbamConfirmedWriteFields,
877
877
  reportId: longId,
878
878
  action: z.enum(["save", "delete", "calculate"]).describe("save requires items; delete requires ids and WAIT_CONFIRM; calculate forbids items/ids and uses WAIT_CONFIRM."),
879
- items: z.array(cbam2CarbonTax).min(1).max(100).optional().describe("Required only for action=save."),
879
+ items: z.array(cbamCarbonTax).min(1).max(100).optional().describe("Required only for action=save."),
880
880
  ids: z.array(longId).min(1).max(100).optional().describe("Required only for action=delete."),
881
881
  }),
882
- cbam2_data_quality_update: z.object({
883
- ...cbam2WriteFields,
882
+ cbam_data_quality_update: z.object({
883
+ ...cbamWriteFields,
884
884
  reportId: longId,
885
- data: cbam2DataQuality.describe("Complete data-quality form. Read DATA_QUALITY first and preserve fields the user did not change."),
885
+ data: cbamDataQuality.describe("Complete data-quality form. Read DATA_QUALITY first and preserve fields the user did not change."),
886
886
  }),
887
- cbam2_report_generate: z.object({
888
- ...cbam2ConfirmedWriteFields,
889
- reportId: longId.describe("CBAM2 report id to generate. Basic general information is sufficient to start; readiness reports optional missing sections separately."),
887
+ cbam_report_generate: z.object({
888
+ ...cbamConfirmedWriteFields,
889
+ reportId: longId.describe("CBAM report id to generate. Basic general information is sufficient to start; readiness reports optional missing sections separately."),
890
890
  }),
891
- cbam2_report_generation_status: z.object({
892
- ...cbam2ReadFields,
891
+ cbam_report_generation_status: z.object({
892
+ ...cbamReadFields,
893
893
  reportId: longId,
894
- generationId: longId.describe("Generation task id returned by cbam2_report_generate."),
894
+ generationId: longId.describe("Generation task id returned by cbam_report_generate."),
895
895
  }),
896
896
  user_memory_recall: z.object({
897
897
  sessionId,
@@ -1344,22 +1344,22 @@ export const schemas = {
1344
1344
  schemas.enterprise_report_regenerate = schemas.enterprise_report_generate;
1345
1345
  export const exposedToolNames = [
1346
1346
  "session_carbon_objects",
1347
- "cbam2_reference_search",
1348
- "cbam2_report_search",
1349
- "cbam2_report_read",
1350
- "cbam2_factory_read",
1351
- "cbam2_factory_save",
1352
- "cbam2_report_save",
1353
- "cbam2_process_manage",
1354
- "cbam2_precursor_manage",
1355
- "cbam2_source_flow_manage",
1356
- "cbam2_heat_power_update",
1357
- "cbam2_product_data_update",
1358
- "cbam2_sale_product_manage",
1359
- "cbam2_carbon_tax_manage",
1360
- "cbam2_data_quality_update",
1361
- "cbam2_report_generate",
1362
- "cbam2_report_generation_status",
1347
+ "cbam_reference_search",
1348
+ "cbam_report_search",
1349
+ "cbam_report_read",
1350
+ "cbam_factory_read",
1351
+ "cbam_factory_save",
1352
+ "cbam_report_save",
1353
+ "cbam_process_manage",
1354
+ "cbam_precursor_manage",
1355
+ "cbam_source_flow_manage",
1356
+ "cbam_heat_power_update",
1357
+ "cbam_product_data_update",
1358
+ "cbam_sale_product_manage",
1359
+ "cbam_carbon_tax_manage",
1360
+ "cbam_data_quality_update",
1361
+ "cbam_report_generate",
1362
+ "cbam_report_generation_status",
1363
1363
  "user_memory_recall",
1364
1364
  "user_memory_get",
1365
1365
  "user_memory_upsert",
@@ -1416,23 +1416,23 @@ export const exposedToolNames = [
1416
1416
  "enterprise_emission_batch_delete",
1417
1417
  ];
1418
1418
  export const descriptions = {
1419
- session_carbon_objects: "Recover product-carbon accounts, enterprise-carbon computations, and CBAM2 reports bound to the current Agent session. Call this before guessing a lost business id. Omit module or use all for every family; module=footprint3 returns productCarbonAccounts, module=enterprise returns enterpriseCarbonComputations, and module=cbam2 returns cbam2Reports. One session may contain multiple CBAM2 reports, so match by reportName/org/factory and then pass the exact cbam2Reports[].reportId to every report-specific tool. Never substitute an enterprise year, product accountId, or another report id. This tool is read-only and requires sessionId.",
1420
- cbam2_reference_search: "Read CBAM2 reference data needed for the current step: accessible organizations and factories, countries, currencies, enum codes, product categories, default processes/precursors/products/CN/sale data, or report-scoped carbon-tax candidates. Request only needed types. Use returned ids/codes exactly and never invent dictionary or organization values. CARBON_TAX_CANDIDATE requires reportId. Large reference tables are paginated with pageNum/pageSize. Read-only.",
1421
- cbam2_report_search: "Search CBAM2 reports accessible to the current user by optional name, organization, factory, year, and pagination. Use this or session_carbon_objects to resolve an exact reportId. A single Agent session can create and work with multiple CBAM2 reports; never silently select the first result when several reports match. Read-only.",
1422
- cbam2_report_read: "Unified read-only CBAM2 report inspection. view=snapshot returns workflow overview/counts/readiness; section returns one complete editable section and requires section; item reads one child record and requires itemType+itemId; result returns result analysis; readiness returns generation blockers/warnings; carbon_tax_status returns asynchronous carbon-tax calculation state. itemId must belong to reportId. Call the corresponding read view before a full-form update so unchanged fields are preserved.",
1423
- cbam2_factory_read: "Read the complete accessible CBAM2 factory form by exact factoryId. Call before updating a shared factory because factory updates are full-form writes and orgId is immutable. Read-only.",
1424
- cbam2_factory_save: "Create or fully update a shared CBAM2 factory. action=create omits factoryId; action=update requires factoryId and must follow cbam2_factory_read, preserving unchanged fields and orgId. Country and orgId must come from cbam2_reference_search. Both actions are shared-data mutations and use the backend WAIT_CONFIRM two-step flow: first call without confirmed, then repeat the identical payload/idempotencyKey with confirmed=true and the returned pendingActionId after user confirmation. MCP never automatically retries this write.",
1425
- cbam2_report_save: "Create or fully update CBAM2 report general information. action=create omits reportId; every create call creates a NEW report and binds it to the same Agent session without replacing earlier CBAM2 reports. One session may therefore contain multiple reports. action=update requires an explicit reportId and should follow cbam2_report_read view=section section=GENERAL_INFO. After more than one report exists, always pass the intended reportId to subsequent tools and ask the user when context is ambiguous. Basic general information is enough to create a report and later generate it; other sections are progressive supplements. Requires idempotencyKey.",
1426
- cbam2_process_manage: "Manage self-produced CBAM2 process definitions for one report. action=save batch-creates/updates complete definition rows; action=delete removes exact ids; action=reorder requires every current process id exactly once in target order. Read PROCESS before updates/deletes/reorder. A report supports at most 10 processes. Delete uses WAIT_CONFIRM and must repeat the identical request with returned pendingActionId after confirmation. Requires idempotencyKey; MCP never automatically retries.",
1427
- cbam2_precursor_manage: "Manage manually entered purchased-precursor definitions. action=save batch-creates/updates complete rows; action=delete removes exact precursor ids. Read PRECURSOR first, and resolve category/country/route values through cbam2_reference_search. A report supports at most 20 precursors. Delete uses WAIT_CONFIRM. Requires idempotencyKey; MCP never automatically retries.",
1428
- cbam2_source_flow_manage: "Manage direct-emission source-flow rows under report processes. action=save creates/updates rows and the backend recalculates direct emissions; action=delete removes exact ids. Read SOURCE_FLOW first, use process ids from the same report, and use CBAM_ENUM codes for processMethod/sourceType. Calculated results and support files are backend-owned and are not accepted by this tool. Delete uses WAIT_CONFIRM. Requires idempotencyKey.",
1429
- cbam2_heat_power_update: "Update complete heat-power cogeneration inputs for a report whose include flag enables this section. Read HEAT_POWER first. Submit only input fields; the backend calculates outPower/outFactor and invalidates dependent sale calculations. Requires idempotencyKey.",
1430
- cbam2_product_data_update: "Update product activity/emission data for existing process or precursor rows. dataType=process requires process items with totalVolume and salesVolume; dataType=precursor requires precursor items. Read PROCESS_PRODUCT_DATA or PRECURSOR_PRODUCT_DATA first. The backend preserves definitions, validates report ownership and activity balances, replaces route rows transactionally, calculates dependent fields, and rejects server-owned result fields. Requires idempotencyKey.",
1431
- cbam2_sale_product_manage: "Manage sale products for one CBAM2 report. action=save batch-creates/updates complete form rows tied to exact report process ids; action=delete removes exact ids and dependent tax rows. Read SALE_PRODUCT first and use CN/category data from cbam2_reference_search. Calculated emissions, versions, fill status, and payTax are backend-owned. Delete uses WAIT_CONFIRM. Requires idempotencyKey.",
1432
- cbam2_carbon_tax_manage: "Manage or calculate report carbon tax. action=save batch-creates/updates rows using exact saleProductId, currency, benchmark, and source candidates returned by CBAM2 reads/reference search; action=delete removes exact ids; action=calculate starts asynchronous calculation. Read CARBON_TAX and carbon-tax candidates first. delete and calculate use WAIT_CONFIRM; after calculate succeeds, poll cbam2_report_read with view=carbon_tax_status. Requires idempotencyKey and is never automatically retried.",
1433
- cbam2_data_quality_update: "Update the complete CBAM2 data-quality form. First call cbam2_report_read view=section section=DATA_QUALITY and preserve fields the user did not change. Use CBAM_ENUM codes for enum fields. Requires idempotencyKey.",
1434
- cbam2_report_generate: "Start backend generation of the selected CBAM2 report file. General information alone is sufficient to request generation; optional missing sections remain visible through cbam2_report_read view=readiness and may produce warnings or incomplete content according to backend rules. The backend creates the file, uploads it, and records it in Carbon Cloud download management; the Agent must not create a parallel spreadsheet. This costly asynchronous action uses WAIT_CONFIRM. After confirmation repeat the identical payload/idempotencyKey with confirmed=true and pendingActionId, then poll cbam2_report_generation_status using returned generationId. Timeout/network/5xx failures are not automatically retried.",
1435
- cbam2_report_generation_status: "Poll one CBAM2 report-generation task using the exact reportId and generationId returned by cbam2_report_generate. Returns RUNNING, COMPLETED, or FAILED plus the generated download record/path when available. Read-only.",
1419
+ session_carbon_objects: "Recover product-carbon accounts, enterprise-carbon computations, and CBAM reports bound to the current Agent session. Call this before guessing a lost business id. Omit module or use all for every family; module=footprint3 returns productCarbonAccounts, module=enterprise returns enterpriseCarbonComputations, and module=cbam returns cbamReports. One session may contain multiple CBAM reports, so match by reportName/org/factory and then pass the exact cbamReports[].reportId to every report-specific tool. Never substitute an enterprise year, product accountId, or another report id. This tool is read-only and requires sessionId.",
1420
+ cbam_reference_search: "Read CBAM reference data needed for the current step: accessible organizations and factories, countries, currencies, enum codes, product categories, default processes/precursors/products/CN/sale data, or report-scoped carbon-tax candidates. Request only needed types. Use returned ids/codes exactly and never invent dictionary or organization values. CARBON_TAX_CANDIDATE requires reportId. Large reference tables are paginated with pageNum/pageSize. Read-only.",
1421
+ cbam_report_search: "Search CBAM reports accessible to the current user by optional name, organization, factory, year, and pagination. Use this or session_carbon_objects to resolve an exact reportId. A single Agent session can create and work with multiple CBAM reports; never silently select the first result when several reports match. Read-only.",
1422
+ cbam_report_read: "Unified read-only CBAM report inspection. view=snapshot returns workflow overview/counts/readiness; section returns one complete editable section and requires section; item reads one child record and requires itemType+itemId; result returns result analysis; readiness returns generation blockers/warnings; carbon_tax_status returns asynchronous carbon-tax calculation state. itemId must belong to reportId. Call the corresponding read view before a full-form update so unchanged fields are preserved.",
1423
+ cbam_factory_read: "Read the complete accessible CBAM factory form by exact factoryId. Call before updating a shared factory because factory updates are full-form writes and orgId is immutable. Read-only.",
1424
+ cbam_factory_save: "Create or fully update a shared CBAM factory. action=create omits factoryId; action=update requires factoryId and must follow cbam_factory_read, preserving unchanged fields and orgId. Country and orgId must come from cbam_reference_search. Both actions are shared-data mutations and use the backend WAIT_CONFIRM two-step flow: first call without confirmed, then repeat the identical payload/idempotencyKey with confirmed=true and the returned pendingActionId after user confirmation. MCP never automatically retries this write.",
1425
+ cbam_report_save: "Create or fully update CBAM report general information. action=create omits reportId; every create call creates a NEW report and binds it to the same Agent session without replacing earlier CBAM reports. One session may therefore contain multiple reports. action=update requires an explicit reportId and should follow cbam_report_read view=section section=GENERAL_INFO. After more than one report exists, always pass the intended reportId to subsequent tools and ask the user when context is ambiguous. Basic general information is enough to create a report and later generate it; other sections are progressive supplements. Requires idempotencyKey.",
1426
+ cbam_process_manage: "Manage self-produced CBAM process definitions for one report. action=save batch-creates/updates complete definition rows; action=delete removes exact ids; action=reorder requires every current process id exactly once in target order. Read PROCESS before updates/deletes/reorder. A report supports at most 10 processes. Delete uses WAIT_CONFIRM and must repeat the identical request with returned pendingActionId after confirmation. Requires idempotencyKey; MCP never automatically retries.",
1427
+ cbam_precursor_manage: "Manage manually entered purchased-precursor definitions. action=save batch-creates/updates complete rows; action=delete removes exact precursor ids. Read PRECURSOR first, and resolve category/country/route values through cbam_reference_search. A report supports at most 20 precursors. Delete uses WAIT_CONFIRM. Requires idempotencyKey; MCP never automatically retries.",
1428
+ cbam_source_flow_manage: "Manage direct-emission source-flow rows under report processes. action=save creates/updates rows and the backend recalculates direct emissions; action=delete removes exact ids. Read SOURCE_FLOW first, use process ids from the same report, and use CBAM_ENUM codes for processMethod/sourceType. Calculated results and support files are backend-owned and are not accepted by this tool. Delete uses WAIT_CONFIRM. Requires idempotencyKey.",
1429
+ cbam_heat_power_update: "Update complete heat-power cogeneration inputs for a report whose include flag enables this section. Read HEAT_POWER first. Submit only input fields; the backend calculates outPower/outFactor and invalidates dependent sale calculations. Requires idempotencyKey.",
1430
+ cbam_product_data_update: "Update product activity/emission data for existing process or precursor rows. dataType=process requires process items with totalVolume and salesVolume; dataType=precursor requires precursor items. Read PROCESS_PRODUCT_DATA or PRECURSOR_PRODUCT_DATA first. The backend preserves definitions, validates report ownership and activity balances, replaces route rows transactionally, calculates dependent fields, and rejects server-owned result fields. Requires idempotencyKey.",
1431
+ cbam_sale_product_manage: "Manage sale products for one CBAM report. action=save batch-creates/updates complete form rows tied to exact report process ids; action=delete removes exact ids and dependent tax rows. Read SALE_PRODUCT first and use CN/category data from cbam_reference_search. Calculated emissions, versions, fill status, and payTax are backend-owned. Delete uses WAIT_CONFIRM. Requires idempotencyKey.",
1432
+ cbam_carbon_tax_manage: "Manage or calculate report carbon tax. action=save batch-creates/updates rows using exact saleProductId, currency, benchmark, and source candidates returned by CBAM reads/reference search; action=delete removes exact ids; action=calculate starts asynchronous calculation. Read CARBON_TAX and carbon-tax candidates first. delete and calculate use WAIT_CONFIRM; after calculate succeeds, poll cbam_report_read with view=carbon_tax_status. Requires idempotencyKey and is never automatically retried.",
1433
+ cbam_data_quality_update: "Update the complete CBAM data-quality form. First call cbam_report_read view=section section=DATA_QUALITY and preserve fields the user did not change. Use CBAM_ENUM codes for enum fields. Requires idempotencyKey.",
1434
+ cbam_report_generate: "Start backend generation of the selected CBAM report file. General information alone is sufficient to request generation; optional missing sections remain visible through cbam_report_read view=readiness and may produce warnings or incomplete content according to backend rules. The backend creates the file, uploads it, and records it in Carbon Cloud download management; the Agent must not create a parallel spreadsheet. This costly asynchronous action uses WAIT_CONFIRM. After confirmation repeat the identical payload/idempotencyKey with confirmed=true and pendingActionId, then poll cbam_report_generation_status using returned generationId. Timeout/network/5xx failures are not automatically retried.",
1435
+ cbam_report_generation_status: "Poll one CBAM report-generation task using the exact reportId and generationId returned by cbam_report_generate. Returns RUNNING, COMPLETED, or FAILED plus the generated download record/path when available. Read-only.",
1436
1436
  user_memory_recall: "Recall the current user's stored cross-session preferences, long-term constraints, carbon-domain habits, and response-style preferences. Call this when stable prior preferences can materially improve the current task, when the user asks what was remembered, and before user_memory_upsert or user_memory_forget if this turn has not already recalled the same target topic. A direct write or forget needs this lookup even when the current request supplies the new value, so the Agent can reuse an existing memoryKey and memoryId instead of creating a semantic duplicate. Do not repeatedly recall the same topic in one turn. Write query as a concise question about the preference or constraint needed now; never copy the full user message or include unrelated sensitive business data. Optional memoryTypes: preference=general preference, constraint=persistent rule or boundary, domain_habit=carbon-accounting/modeling/reporting workflow habit, format_habit=response language/structure/length/file-format habit. The response contains rules and items with memoryId, scope, type, memoryKey, normalized content, recallMode, version, and relevance metadata. count=0 is a successful empty recall; continue the task using current context. The current user request always overrides recalled memory, and current business data is authoritative. Treat recalled items as guidance, not authoritative business facts. Never reveal memory ids, versions, scores, source metadata, or internal implementation details to the user. Requires sessionId, a messageId belonging to that session, and query.",
1437
1437
  user_memory_get: "Read exactly one current-user memory by the stable memoryId returned by user_memory_recall or a previous write. Use this immediately before updating or forgetting a memory to obtain its latest version and avoid stale writes. Do not enumerate, guess, or probe memory ids, and do not use this tool to access another user or project: authorization is derived from sessionId and messageId. The response is reduced to Agent-safe fields and must not be displayed as internal metadata to the user. Requires sessionId, a messageId belonging to that session, and memoryId.",
1438
1438
  user_memory_upsert: "Create or update one stable long-term user memory. Call only when the user explicitly asks the Agent to remember a lasting preference/constraint, or after the user clearly confirms it; ordinary observations, one-off task details, sensitive data, changing business facts, account ids, emission values, and unconfirmed model inferences must not be stored. Before writing, call user_memory_recall once for the target topic unless the same topic was already recalled in this turn. If recall finds the same independently updatable slot, reuse its exact memoryKey; for an exact update, also reuse its memoryId, call user_memory_get, and preferably pass the latest positive version as expectedVersion. If recall finds no matching slot, omit memoryId and create by a new stable memoryKey. memoryId determines the operation: omit it or pass a blank value to create/upsert by memoryKey; pass a valid memoryId to update that exact item. For compatibility, expectedVersion may be omitted or 0 and the backend will use the latest version read at update time; never blindly retry a version conflict. expectedVersion is ignored when memoryId is absent. memoryKey represents one independently updatable slot: never include mutable attitude/state such as like/dislike or enabled/disabled. A single-valued attribute uses one fixed key without the changing value, such as preference.favorite_color or format.response.language. A multi-valued collection includes a canonical lowercase English object so values can coexist, such as preference.color.white and preference.color.red; liking and disliking white both reuse preference.color.white. Different wording or languages for the same slot or object must reuse the recalled key. USER applies across sessions; USER_PROJECT applies only to the current session project, which the backend derives automatically. Prefer source=EXPLICIT_USER for a direct request or CONFIRMED_CONVERSATION after confirmation. Use ALWAYS for persistent constraints/response-style rules and SEMANTIC for context-dependent preferences, or omit recallMode for the backend default. Requires sessionId, messageId, scope, type, memoryKey, and normalized content no longer than 120 characters. MCP never automatically retries this write.",
@@ -1501,134 +1501,135 @@ export const toolRoutes = {
1501
1501
  method: "POST",
1502
1502
  path: apipath.SessionBusinessRefs(),
1503
1503
  bodyKind: "sessionContext",
1504
+ responseKind: "sessionCarbonObjects",
1504
1505
  },
1505
- cbam2_reference_search: {
1506
+ cbam_reference_search: {
1506
1507
  method: "POST",
1507
- path: apipath.Cbam2ReferenceSearch(),
1508
- bodyKind: "cbam2",
1508
+ path: apipath.CbamReferenceSearch(),
1509
+ bodyKind: "cbam",
1509
1510
  },
1510
- cbam2_report_search: {
1511
+ cbam_report_search: {
1511
1512
  method: "POST",
1512
- path: apipath.Cbam2ReportSearch(),
1513
- bodyKind: "cbam2",
1513
+ path: apipath.CbamReportSearch(),
1514
+ bodyKind: "cbam",
1514
1515
  },
1515
- cbam2_report_read: {
1516
+ cbam_report_read: {
1516
1517
  method: "POST",
1517
1518
  path: (args) => {
1518
1519
  if (args.view === "section")
1519
- return apipath.Cbam2SectionSnapshot();
1520
+ return apipath.CbamSectionSnapshot();
1520
1521
  if (args.view === "item")
1521
- return apipath.Cbam2ItemDetail();
1522
+ return apipath.CbamItemDetail();
1522
1523
  if (args.view === "result")
1523
- return apipath.Cbam2ResultSummary();
1524
+ return apipath.CbamResultSummary();
1524
1525
  if (args.view === "readiness")
1525
- return apipath.Cbam2ReportReadiness();
1526
+ return apipath.CbamReportReadiness();
1526
1527
  if (args.view === "carbon_tax_status")
1527
- return apipath.Cbam2CarbonTaxStatus();
1528
- return apipath.Cbam2ReportSnapshot();
1528
+ return apipath.CbamCarbonTaxStatus();
1529
+ return apipath.CbamReportSnapshot();
1529
1530
  },
1530
- bodyKind: "cbam2",
1531
+ bodyKind: "cbam",
1531
1532
  },
1532
- cbam2_factory_read: {
1533
+ cbam_factory_read: {
1533
1534
  method: "POST",
1534
- path: apipath.Cbam2FactoryDetail(),
1535
- bodyKind: "cbam2",
1535
+ path: apipath.CbamFactoryDetail(),
1536
+ bodyKind: "cbam",
1536
1537
  },
1537
- cbam2_factory_save: {
1538
+ cbam_factory_save: {
1538
1539
  method: "POST",
1539
1540
  path: (args) => args.action === "update"
1540
- ? apipath.Cbam2FactoryUpdate()
1541
- : apipath.Cbam2FactoryCreate(),
1542
- bodyKind: "cbam2",
1541
+ ? apipath.CbamFactoryUpdate()
1542
+ : apipath.CbamFactoryCreate(),
1543
+ bodyKind: "cbam",
1543
1544
  maxRetries: 0,
1544
1545
  },
1545
- cbam2_report_save: {
1546
+ cbam_report_save: {
1546
1547
  method: "POST",
1547
1548
  path: (args) => args.action === "update"
1548
- ? apipath.Cbam2ReportUpdate()
1549
- : apipath.Cbam2ReportCreate(),
1550
- bodyKind: "cbam2",
1549
+ ? apipath.CbamReportUpdate()
1550
+ : apipath.CbamReportCreate(),
1551
+ bodyKind: "cbam",
1551
1552
  maxRetries: 0,
1552
1553
  },
1553
- cbam2_process_manage: {
1554
+ cbam_process_manage: {
1554
1555
  method: "POST",
1555
1556
  path: (args) => {
1556
1557
  if (args.action === "delete")
1557
- return apipath.Cbam2ProcessBatchDelete();
1558
+ return apipath.CbamProcessBatchDelete();
1558
1559
  if (args.action === "reorder")
1559
- return apipath.Cbam2ProcessReorder();
1560
- return apipath.Cbam2ProcessBatchSave();
1560
+ return apipath.CbamProcessReorder();
1561
+ return apipath.CbamProcessBatchSave();
1561
1562
  },
1562
- bodyKind: "cbam2",
1563
+ bodyKind: "cbam",
1563
1564
  maxRetries: 0,
1564
1565
  },
1565
- cbam2_precursor_manage: {
1566
+ cbam_precursor_manage: {
1566
1567
  method: "POST",
1567
1568
  path: (args) => args.action === "delete"
1568
- ? apipath.Cbam2PrecursorBatchDelete()
1569
- : apipath.Cbam2PrecursorBatchSave(),
1570
- bodyKind: "cbam2",
1569
+ ? apipath.CbamPrecursorBatchDelete()
1570
+ : apipath.CbamPrecursorBatchSave(),
1571
+ bodyKind: "cbam",
1571
1572
  maxRetries: 0,
1572
1573
  },
1573
- cbam2_source_flow_manage: {
1574
+ cbam_source_flow_manage: {
1574
1575
  method: "POST",
1575
1576
  path: (args) => args.action === "delete"
1576
- ? apipath.Cbam2SourceFlowBatchDelete()
1577
- : apipath.Cbam2SourceFlowBatchSave(),
1578
- bodyKind: "cbam2",
1577
+ ? apipath.CbamSourceFlowBatchDelete()
1578
+ : apipath.CbamSourceFlowBatchSave(),
1579
+ bodyKind: "cbam",
1579
1580
  maxRetries: 0,
1580
1581
  },
1581
- cbam2_heat_power_update: {
1582
+ cbam_heat_power_update: {
1582
1583
  method: "POST",
1583
- path: apipath.Cbam2HeatPowerUpdate(),
1584
- bodyKind: "cbam2",
1584
+ path: apipath.CbamHeatPowerUpdate(),
1585
+ bodyKind: "cbam",
1585
1586
  maxRetries: 0,
1586
1587
  },
1587
- cbam2_product_data_update: {
1588
+ cbam_product_data_update: {
1588
1589
  method: "POST",
1589
1590
  path: (args) => args.dataType === "precursor"
1590
- ? apipath.Cbam2PrecursorProductBatchUpdate()
1591
- : apipath.Cbam2ProcessProductBatchUpdate(),
1592
- bodyKind: "cbam2",
1591
+ ? apipath.CbamPrecursorProductBatchUpdate()
1592
+ : apipath.CbamProcessProductBatchUpdate(),
1593
+ bodyKind: "cbam",
1593
1594
  maxRetries: 0,
1594
1595
  },
1595
- cbam2_sale_product_manage: {
1596
+ cbam_sale_product_manage: {
1596
1597
  method: "POST",
1597
1598
  path: (args) => args.action === "delete"
1598
- ? apipath.Cbam2SaleProductBatchDelete()
1599
- : apipath.Cbam2SaleProductBatchSave(),
1600
- bodyKind: "cbam2",
1599
+ ? apipath.CbamSaleProductBatchDelete()
1600
+ : apipath.CbamSaleProductBatchSave(),
1601
+ bodyKind: "cbam",
1601
1602
  maxRetries: 0,
1602
1603
  },
1603
- cbam2_carbon_tax_manage: {
1604
+ cbam_carbon_tax_manage: {
1604
1605
  method: "POST",
1605
1606
  path: (args) => {
1606
1607
  if (args.action === "delete")
1607
- return apipath.Cbam2CarbonTaxBatchDelete();
1608
+ return apipath.CbamCarbonTaxBatchDelete();
1608
1609
  if (args.action === "calculate")
1609
- return apipath.Cbam2CarbonTaxCalculate();
1610
- return apipath.Cbam2CarbonTaxBatchSave();
1610
+ return apipath.CbamCarbonTaxCalculate();
1611
+ return apipath.CbamCarbonTaxBatchSave();
1611
1612
  },
1612
- bodyKind: "cbam2",
1613
+ bodyKind: "cbam",
1613
1614
  maxRetries: 0,
1614
1615
  },
1615
- cbam2_data_quality_update: {
1616
+ cbam_data_quality_update: {
1616
1617
  method: "POST",
1617
- path: apipath.Cbam2DataQualityUpdate(),
1618
- bodyKind: "cbam2",
1618
+ path: apipath.CbamDataQualityUpdate(),
1619
+ bodyKind: "cbam",
1619
1620
  maxRetries: 0,
1620
1621
  },
1621
- cbam2_report_generate: {
1622
+ cbam_report_generate: {
1622
1623
  method: "POST",
1623
- path: apipath.Cbam2ReportGenerate(),
1624
- bodyKind: "cbam2",
1624
+ path: apipath.CbamReportGenerate(),
1625
+ bodyKind: "cbam",
1625
1626
  timeoutSeconds: 120,
1626
1627
  maxRetries: 0,
1627
1628
  },
1628
- cbam2_report_generation_status: {
1629
+ cbam_report_generation_status: {
1629
1630
  method: "POST",
1630
- path: apipath.Cbam2ReportGenerationStatus(),
1631
- bodyKind: "cbam2",
1631
+ path: apipath.CbamReportGenerationStatus(),
1632
+ bodyKind: "cbam",
1632
1633
  },
1633
1634
  user_memory_recall: {
1634
1635
  method: "POST",
@@ -1942,7 +1943,7 @@ export const toolRoutes = {
1942
1943
  },
1943
1944
  };
1944
1945
  export function buildBody(route, args) {
1945
- if (route.bodyKind === "cbam2") {
1946
+ if (route.bodyKind === "cbam") {
1946
1947
  const body = { ...args };
1947
1948
  const action = body.action;
1948
1949
  const view = body.view;
@@ -1971,18 +1972,22 @@ export function buildBody(route, args) {
1971
1972
  delete body.items;
1972
1973
  delete body.ids;
1973
1974
  }
1974
- const confirmationRequired = route === toolRoutes.cbam2_factory_save
1975
- || route === toolRoutes.cbam2_report_generate
1975
+ const confirmationRequired = route === toolRoutes.cbam_factory_save
1976
+ || route === toolRoutes.cbam_report_generate
1976
1977
  || action === "delete"
1977
1978
  || action === "calculate";
1978
1979
  if (!confirmationRequired) {
1979
1980
  delete body.confirmed;
1980
1981
  delete body.pendingActionId;
1981
1982
  }
1982
- return normalizeCbam2Codes(normalizeIds(pickDefined(body)));
1983
+ return normalizeCbamCodes(normalizeIds(pickDefined(body)));
1983
1984
  }
1984
1985
  if (route.bodyKind === "sessionContext") {
1985
- return pickDefined({ sessionId: args.sessionId, module: args.module });
1986
+ return pickDefined({
1987
+ sessionId: args.sessionId,
1988
+ // The Agent-facing module is CBAM; the existing Java contract still uses cbam2.
1989
+ module: args.module === "cbam" ? "cbam2" : args.module,
1990
+ });
1986
1991
  }
1987
1992
  if (route.bodyKind === "projectRead") {
1988
1993
  const projectTaskId = typeof args.projectTaskId === "string"
@@ -2228,7 +2233,7 @@ function normalizeEnterpriseEmissionSource(source, gasListField) {
2228
2233
  function normalizeNumericCode(value) {
2229
2234
  return typeof value === "string" && /^\d+$/.test(value) ? Number(value) : value;
2230
2235
  }
2231
- const cbam2NumericCodeFields = new Set([
2236
+ const cbamNumericCodeFields = new Set([
2232
2237
  "include",
2233
2238
  "includeType",
2234
2239
  "processMethod",
@@ -2252,22 +2257,22 @@ const cbam2NumericCodeFields = new Set([
2252
2257
  "qualityAssurance",
2253
2258
  "orderNum",
2254
2259
  ]);
2255
- const cbam2GenericIdFields = new Set(["id"]);
2256
- function normalizeCbam2Codes(value) {
2260
+ const cbamGenericIdFields = new Set(["id"]);
2261
+ function normalizeCbamCodes(value) {
2257
2262
  if (Array.isArray(value))
2258
- return value.map(normalizeCbam2Codes);
2263
+ return value.map(normalizeCbamCodes);
2259
2264
  if (!value || typeof value !== "object")
2260
2265
  return value;
2261
2266
  const result = {};
2262
2267
  for (const [key, childValue] of Object.entries(value)) {
2263
- if (cbam2NumericCodeFields.has(key)) {
2268
+ if (cbamNumericCodeFields.has(key)) {
2264
2269
  result[key] = normalizeNumericCode(childValue);
2265
2270
  }
2266
- else if (cbam2GenericIdFields.has(key) && typeof childValue === "string" && /^\d+$/.test(childValue)) {
2271
+ else if (cbamGenericIdFields.has(key) && typeof childValue === "string" && /^\d+$/.test(childValue)) {
2267
2272
  result[key] = normalizeNumericId(childValue);
2268
2273
  }
2269
2274
  else {
2270
- result[key] = normalizeCbam2Codes(childValue);
2275
+ result[key] = normalizeCbamCodes(childValue);
2271
2276
  }
2272
2277
  }
2273
2278
  return result;
@@ -2281,8 +2286,8 @@ function normalizeDecimalValue(value) {
2281
2286
  return Number(normalized);
2282
2287
  }
2283
2288
  export function validateToolArgs(name, args) {
2284
- if (name.startsWith("cbam2_")) {
2285
- validateCbam2Args(name, args);
2289
+ if (name.startsWith("cbam_")) {
2290
+ validateCbamArgs(name, args);
2286
2291
  return;
2287
2292
  }
2288
2293
  if (name === "enterprise_emission_batch_save" && Array.isArray(args.orgList)) {
@@ -2293,122 +2298,122 @@ export function validateToolArgs(name, args) {
2293
2298
  validateEnterpriseEmissionUpdateArgs(args.computationList);
2294
2299
  }
2295
2300
  }
2296
- function validateCbam2Args(name, args) {
2297
- if (name === "cbam2_reference_search") {
2301
+ function validateCbamArgs(name, args) {
2302
+ if (name === "cbam_reference_search") {
2298
2303
  const types = Array.isArray(args.types) ? args.types.map(String) : [];
2299
2304
  requireUniqueValues(types, "types");
2300
2305
  if (types.includes("CARBON_TAX_CANDIDATE") && args.reportId === undefined) {
2301
- cbam2InputError("REPORT_ID_REQUIRED", "reportId", "reportId is required when types contains CARBON_TAX_CANDIDATE");
2306
+ cbamInputError("REPORT_ID_REQUIRED", "reportId", "reportId is required when types contains CARBON_TAX_CANDIDATE");
2302
2307
  }
2303
2308
  return;
2304
2309
  }
2305
- if (name === "cbam2_report_read") {
2310
+ if (name === "cbam_report_read") {
2306
2311
  if (args.view === "section" && args.section === undefined) {
2307
- cbam2InputError("SECTION_REQUIRED", "section", "section is required when view=section");
2312
+ cbamInputError("SECTION_REQUIRED", "section", "section is required when view=section");
2308
2313
  }
2309
2314
  if (args.view === "item") {
2310
2315
  if (args.itemType === undefined)
2311
- cbam2InputError("ITEM_TYPE_REQUIRED", "itemType", "itemType is required when view=item");
2316
+ cbamInputError("ITEM_TYPE_REQUIRED", "itemType", "itemType is required when view=item");
2312
2317
  if (args.itemId === undefined)
2313
- cbam2InputError("ITEM_ID_REQUIRED", "itemId", "itemId is required when view=item");
2318
+ cbamInputError("ITEM_ID_REQUIRED", "itemId", "itemId is required when view=item");
2314
2319
  }
2315
2320
  return;
2316
2321
  }
2317
- if (name === "cbam2_factory_save") {
2322
+ if (name === "cbam_factory_save") {
2318
2323
  validateCreateUpdateId(args, "factoryId");
2319
- validateCbam2Confirmation(args, true);
2324
+ validateCbamConfirmation(args, true);
2320
2325
  return;
2321
2326
  }
2322
- if (name === "cbam2_report_save") {
2327
+ if (name === "cbam_report_save") {
2323
2328
  validateCreateUpdateId(args, "reportId");
2324
2329
  const report = args.report;
2325
2330
  if (report)
2326
- validateCbam2DateRange(report.startDate, report.endDate);
2331
+ validateCbamDateRange(report.startDate, report.endDate);
2327
2332
  return;
2328
2333
  }
2329
- if (name === "cbam2_process_manage") {
2330
- validateCbam2ActionPayload(args, ["save", "delete", "reorder"]);
2334
+ if (name === "cbam_process_manage") {
2335
+ validateCbamActionPayload(args, ["save", "delete", "reorder"]);
2331
2336
  if (args.action === "reorder" || args.action === "delete")
2332
2337
  requireUniqueIdArray(args.ids, "ids");
2333
2338
  if (args.action === "save")
2334
2339
  requireUniqueItemIds(args.items);
2335
- validateCbam2Confirmation(args, args.action === "delete");
2340
+ validateCbamConfirmation(args, args.action === "delete");
2336
2341
  return;
2337
2342
  }
2338
- if (["cbam2_precursor_manage", "cbam2_source_flow_manage", "cbam2_sale_product_manage"].includes(name)) {
2339
- validateCbam2ActionPayload(args, ["save", "delete"]);
2343
+ if (["cbam_precursor_manage", "cbam_source_flow_manage", "cbam_sale_product_manage"].includes(name)) {
2344
+ validateCbamActionPayload(args, ["save", "delete"]);
2340
2345
  if (args.action === "delete")
2341
2346
  requireUniqueIdArray(args.ids, "ids");
2342
2347
  if (args.action === "save")
2343
2348
  requireUniqueItemIds(args.items);
2344
- if (name === "cbam2_source_flow_manage" && args.action === "save") {
2345
- validateCbam2SourceFlows(args.items);
2349
+ if (name === "cbam_source_flow_manage" && args.action === "save") {
2350
+ validateCbamSourceFlows(args.items);
2346
2351
  }
2347
- validateCbam2Confirmation(args, args.action === "delete");
2352
+ validateCbamConfirmation(args, args.action === "delete");
2348
2353
  return;
2349
2354
  }
2350
- if (name === "cbam2_carbon_tax_manage") {
2351
- validateCbam2ActionPayload(args, ["save", "delete", "calculate"]);
2355
+ if (name === "cbam_carbon_tax_manage") {
2356
+ validateCbamActionPayload(args, ["save", "delete", "calculate"]);
2352
2357
  if (args.action === "delete")
2353
2358
  requireUniqueIdArray(args.ids, "ids");
2354
2359
  if (args.action === "save")
2355
2360
  requireUniqueItemIds(args.items);
2356
- validateCbam2Confirmation(args, args.action === "delete" || args.action === "calculate");
2361
+ validateCbamConfirmation(args, args.action === "delete" || args.action === "calculate");
2357
2362
  return;
2358
2363
  }
2359
- if (name === "cbam2_product_data_update") {
2364
+ if (name === "cbam_product_data_update") {
2360
2365
  const itemSchema = args.dataType === "precursor"
2361
- ? cbam2PrecursorProductData
2362
- : cbam2ProcessProductData;
2366
+ ? cbamPrecursorProductData
2367
+ : cbamProcessProductData;
2363
2368
  const items = Array.isArray(args.items) ? args.items : [];
2364
2369
  for (let index = 0; index < items.length; index++) {
2365
2370
  if (!itemSchema.safeParse(items[index]).success) {
2366
- cbam2InputError("PRODUCT_DATA_TYPE_MISMATCH", `items[${index}]`, `item does not match dataType=${String(args.dataType)}`);
2371
+ cbamInputError("PRODUCT_DATA_TYPE_MISMATCH", `items[${index}]`, `item does not match dataType=${String(args.dataType)}`);
2367
2372
  }
2368
2373
  }
2369
2374
  requireUniqueItemIds(items);
2370
2375
  return;
2371
2376
  }
2372
- if (name === "cbam2_report_generate") {
2373
- validateCbam2Confirmation(args, true);
2377
+ if (name === "cbam_report_generate") {
2378
+ validateCbamConfirmation(args, true);
2374
2379
  }
2375
2380
  }
2376
2381
  function validateCreateUpdateId(args, idField) {
2377
2382
  if (args.action === "update" && args[idField] === undefined) {
2378
- cbam2InputError("ID_REQUIRED", idField, `${idField} is required when action=update`);
2383
+ cbamInputError("ID_REQUIRED", idField, `${idField} is required when action=update`);
2379
2384
  }
2380
2385
  if (args.action === "create" && args[idField] !== undefined) {
2381
- cbam2InputError("ID_NOT_ALLOWED", idField, `${idField} must be omitted when action=create`);
2386
+ cbamInputError("ID_NOT_ALLOWED", idField, `${idField} must be omitted when action=create`);
2382
2387
  }
2383
2388
  }
2384
- function validateCbam2ActionPayload(args, supported) {
2389
+ function validateCbamActionPayload(args, supported) {
2385
2390
  const action = String(args.action || "");
2386
2391
  if (!supported.includes(action))
2387
- cbam2InputError("INVALID_ACTION", "action", `unsupported action: ${action}`);
2392
+ cbamInputError("INVALID_ACTION", "action", `unsupported action: ${action}`);
2388
2393
  if (action === "save") {
2389
2394
  requireNonEmptyArray(args.items, "items");
2390
2395
  if (args.ids !== undefined)
2391
- cbam2InputError("UNEXPECTED_IDS", "ids", "ids must be omitted when action=save");
2396
+ cbamInputError("UNEXPECTED_IDS", "ids", "ids must be omitted when action=save");
2392
2397
  }
2393
2398
  else if (action === "delete" || action === "reorder") {
2394
2399
  requireNonEmptyArray(args.ids, "ids");
2395
2400
  if (args.items !== undefined)
2396
- cbam2InputError("UNEXPECTED_ITEMS", "items", `items must be omitted when action=${action}`);
2401
+ cbamInputError("UNEXPECTED_ITEMS", "items", `items must be omitted when action=${action}`);
2397
2402
  }
2398
2403
  else if (action === "calculate") {
2399
2404
  if (args.items !== undefined || args.ids !== undefined) {
2400
- cbam2InputError("UNEXPECTED_PAYLOAD", "items", "items and ids must be omitted when action=calculate");
2405
+ cbamInputError("UNEXPECTED_PAYLOAD", "items", "items and ids must be omitted when action=calculate");
2401
2406
  }
2402
2407
  }
2403
2408
  }
2404
- function validateCbam2Confirmation(args, required) {
2409
+ function validateCbamConfirmation(args, required) {
2405
2410
  if (!required || args.confirmed !== true)
2406
2411
  return;
2407
2412
  if (typeof args.pendingActionId !== "string" || args.pendingActionId.trim().length === 0) {
2408
- cbam2InputError("PENDING_ACTION_ID_REQUIRED", "pendingActionId", "pendingActionId returned by WAIT_CONFIRM is required when confirmed=true");
2413
+ cbamInputError("PENDING_ACTION_ID_REQUIRED", "pendingActionId", "pendingActionId returned by WAIT_CONFIRM is required when confirmed=true");
2409
2414
  }
2410
2415
  }
2411
- function validateCbam2SourceFlows(value) {
2416
+ function validateCbamSourceFlows(value) {
2412
2417
  if (!Array.isArray(value))
2413
2418
  return;
2414
2419
  for (let index = 0; index < value.length; index++) {
@@ -2420,45 +2425,45 @@ function validateCbam2SourceFlows(value) {
2420
2425
  const processMethod = numericCode(source.processMethod);
2421
2426
  const path = `items[${index}]`;
2422
2427
  if (![1, 2, 3].includes(sourceType)) {
2423
- cbam2InputError("INVALID_SOURCE_FLOW_TYPE", `${path}.sourceType`, "sourceType must be 1, 2, or 3");
2428
+ cbamInputError("INVALID_SOURCE_FLOW_TYPE", `${path}.sourceType`, "sourceType must be 1, 2, or 3");
2424
2429
  }
2425
2430
  if (![1, 2, 3, 4, 5, 6, 7].includes(processMethod)) {
2426
- cbam2InputError("INVALID_PROCESS_METHOD", `${path}.processMethod`, "processMethod must be between 1 and 7");
2431
+ cbamInputError("INVALID_PROCESS_METHOD", `${path}.processMethod`, "processMethod must be between 1 and 7");
2427
2432
  }
2428
2433
  if (sourceType === 1 && ![1, 2, 3].includes(processMethod)) {
2429
- cbam2InputError("INVALID_SOURCE_FLOW_COMBINATION", `${path}.processMethod`, "sourceType=1 supports processMethod 1, 2, or 3");
2434
+ cbamInputError("INVALID_SOURCE_FLOW_COMBINATION", `${path}.processMethod`, "sourceType=1 supports processMethod 1, 2, or 3");
2430
2435
  }
2431
2436
  if (sourceType === 2 && ![4, 5].includes(processMethod)) {
2432
- cbam2InputError("INVALID_SOURCE_FLOW_COMBINATION", `${path}.processMethod`, "sourceType=2 supports processMethod 4 or 5");
2437
+ cbamInputError("INVALID_SOURCE_FLOW_COMBINATION", `${path}.processMethod`, "sourceType=2 supports processMethod 4 or 5");
2433
2438
  }
2434
2439
  if (sourceType === 3 && ![6, 7].includes(processMethod)) {
2435
- cbam2InputError("INVALID_SOURCE_FLOW_COMBINATION", `${path}.processMethod`, "sourceType=3 supports processMethod 6 or 7");
2440
+ cbamInputError("INVALID_SOURCE_FLOW_COMBINATION", `${path}.processMethod`, "sourceType=3 supports processMethod 6 or 7");
2436
2441
  }
2437
2442
  if (sourceType === 1 && processMethod === 1) {
2438
- requireCbam2Fields(source, path, ["activityData", "emissionCoefficient", "oxRate"]);
2443
+ requireCbamFields(source, path, ["activityData", "emissionCoefficient", "oxRate"]);
2439
2444
  requireLowHeatForEnergyUnit(source, path);
2440
2445
  }
2441
2446
  else if (sourceType === 1 && processMethod === 2) {
2442
- requireCbam2Fields(source, path, ["activityData", "emissionCoefficient", "conversionRate"]);
2447
+ requireCbamFields(source, path, ["activityData", "emissionCoefficient", "conversionRate"]);
2443
2448
  requireLowHeatForEnergyUnit(source, path);
2444
2449
  }
2445
2450
  else if (sourceType === 1 && processMethod === 3) {
2446
- requireCbam2Fields(source, path, ["activityData", "carbon", "biomassContent"]);
2451
+ requireCbamFields(source, path, ["activityData", "carbon", "biomassContent"]);
2447
2452
  }
2448
2453
  else if (sourceType === 2 && processMethod === 4) {
2449
- requireCbam2Fields(source, path, ["activityData", "lowHeat", "emissionCoefficient", "conversionRate", "oxRate"]);
2454
+ requireCbamFields(source, path, ["activityData", "lowHeat", "emissionCoefficient", "conversionRate", "oxRate"]);
2450
2455
  }
2451
2456
  else if (sourceType === 2 && processMethod === 5) {
2452
- requireCbam2Fields(source, path, ["activityData", "biomassContent", "carbon", "carbonFossil", "carbonBiological", "oxRate"]);
2457
+ requireCbamFields(source, path, ["activityData", "biomassContent", "carbon", "carbonFossil", "carbonBiological", "oxRate"]);
2453
2458
  if (Number(source.carbonFossil) === 0) {
2454
- cbam2InputError("INVALID_SOURCE_FLOW_VALUE", `${path}.carbonFossil`, "carbonFossil must be greater than zero for sourceType=2/processMethod=5");
2459
+ cbamInputError("INVALID_SOURCE_FLOW_VALUE", `${path}.carbonFossil`, "carbonFossil must be greater than zero for sourceType=2/processMethod=5");
2455
2460
  }
2456
2461
  if (Number(source.carbon) === 0) {
2457
- cbam2InputError("INVALID_SOURCE_FLOW_VALUE", `${path}.carbon`, "carbon must be greater than zero for sourceType=2/processMethod=5");
2462
+ cbamInputError("INVALID_SOURCE_FLOW_VALUE", `${path}.carbon`, "carbon must be greater than zero for sourceType=2/processMethod=5");
2458
2463
  }
2459
2464
  }
2460
2465
  else if (sourceType === 3 && [6, 7].includes(processMethod)) {
2461
- requireCbam2Fields(source, path, ["lowHeat", "emissionCoefficient", "conversionRate", "biomassContent"]);
2466
+ requireCbamFields(source, path, ["lowHeat", "emissionCoefficient", "conversionRate", "biomassContent"]);
2462
2467
  }
2463
2468
  }
2464
2469
  }
@@ -2469,27 +2474,27 @@ function numericCode(value) {
2469
2474
  return Number(value.trim());
2470
2475
  return Number.NaN;
2471
2476
  }
2472
- function requireCbam2Fields(item, path, fields) {
2477
+ function requireCbamFields(item, path, fields) {
2473
2478
  for (const field of fields) {
2474
2479
  if (item[field] === undefined || item[field] === null || item[field] === "") {
2475
- cbam2InputError("SOURCE_FLOW_FIELD_REQUIRED", `${path}.${field}`, `${field} is required for the selected sourceType/processMethod formula`);
2480
+ cbamInputError("SOURCE_FLOW_FIELD_REQUIRED", `${path}.${field}`, `${field} is required for the selected sourceType/processMethod formula`);
2476
2481
  }
2477
2482
  }
2478
2483
  }
2479
2484
  function requireLowHeatForEnergyUnit(item, path) {
2480
2485
  if (item.emissionCoefficientUnit === "tCO2/TJ") {
2481
- requireCbam2Fields(item, path, ["lowHeat"]);
2486
+ requireCbamFields(item, path, ["lowHeat"]);
2482
2487
  }
2483
2488
  }
2484
- function validateCbam2DateRange(startValue, endValue) {
2489
+ function validateCbamDateRange(startValue, endValue) {
2485
2490
  const start = String(startValue || "");
2486
2491
  const end = String(endValue || "");
2487
2492
  if (!isExactCalendarDate(start))
2488
- cbam2InputError("INVALID_DATE", "report.startDate", "startDate must be a valid yyyy-MM-dd date");
2493
+ cbamInputError("INVALID_DATE", "report.startDate", "startDate must be a valid yyyy-MM-dd date");
2489
2494
  if (!isExactCalendarDate(end))
2490
- cbam2InputError("INVALID_DATE", "report.endDate", "endDate must be a valid yyyy-MM-dd date");
2495
+ cbamInputError("INVALID_DATE", "report.endDate", "endDate must be a valid yyyy-MM-dd date");
2491
2496
  if (start > end)
2492
- cbam2InputError("INVALID_PERIOD", "report.startDate", "startDate must not be after endDate");
2497
+ cbamInputError("INVALID_PERIOD", "report.startDate", "startDate must not be after endDate");
2493
2498
  }
2494
2499
  function isExactCalendarDate(value) {
2495
2500
  const match = /^(\d{4})-(\d{2})-(\d{2})$/.exec(value);
@@ -2505,7 +2510,7 @@ function isExactCalendarDate(value) {
2505
2510
  }
2506
2511
  function requireNonEmptyArray(value, path) {
2507
2512
  if (!Array.isArray(value) || value.length === 0) {
2508
- cbam2InputError("NON_EMPTY_ARRAY_REQUIRED", path, `${path} must be a non-empty array`);
2513
+ cbamInputError("NON_EMPTY_ARRAY_REQUIRED", path, `${path} must be a non-empty array`);
2509
2514
  }
2510
2515
  }
2511
2516
  function requireUniqueIdArray(value, path) {
@@ -2527,11 +2532,11 @@ function requireUniqueValues(values, path) {
2527
2532
  const seen = new Set();
2528
2533
  for (const value of values) {
2529
2534
  if (seen.has(value))
2530
- cbam2InputError("DUPLICATE_VALUE", path, `${path} must not contain duplicate values`);
2535
+ cbamInputError("DUPLICATE_VALUE", path, `${path} must not contain duplicate values`);
2531
2536
  seen.add(value);
2532
2537
  }
2533
2538
  }
2534
- function cbam2InputError(code, path, message) {
2539
+ function cbamInputError(code, path, message) {
2535
2540
  throw new ToolInputValidationError(code, path, message);
2536
2541
  }
2537
2542
  function validateEnterpriseEmissionSaveArgs(orgList) {