@agentforge/tools 0.16.70 → 0.16.72

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/index.d.cts CHANGED
@@ -5553,7 +5553,7 @@ declare function validateColumnTypes(schema: DatabaseSchema, tableName: string,
5553
5553
  * Database type → TypeScript type mapper.
5554
5554
  *
5555
5555
  * Maps vendor-specific SQL column types to their closest TypeScript
5556
- * equivalents. Used for code generation hints, documentation, and
5556
+ * equivalents. Used for code generation hints, documentation, and
5557
5557
  * schema-aware validation utilities.
5558
5558
  *
5559
5559
  * @module schema/type-mapper
@@ -5575,8 +5575,9 @@ interface MappedType {
5575
5575
  /**
5576
5576
  * Map a single database column type to its TypeScript equivalent.
5577
5577
  *
5578
- * Normalises the input type to lower-case and strips size suffixes
5579
- * (e.g. `varchar(255)` → `varchar`) before looking up the mapping.
5578
+ * Normalises the input type to lower-case and strips PostgreSQL array
5579
+ * suffixes, MySQL `unsigned`, and size/precision suffixes such as
5580
+ * `varchar(255)` or `numeric(10,2)` before map lookup.
5580
5581
  *
5581
5582
  * @param vendor - Database vendor
5582
5583
  * @param dbType - The raw column type string from the database
@@ -5587,7 +5588,7 @@ declare function mapColumnType(vendor: DatabaseVendor, dbType: string, nullable?
5587
5588
  /**
5588
5589
  * Map all columns in a database schema to TypeScript types.
5589
5590
  *
5590
- * Returns a nested map: `tableName → columnName → MappedType`.
5591
+ * Returns a nested map: `tableName → columnName → MappedType`.
5591
5592
  *
5592
5593
  * @param vendor - Database vendor
5593
5594
  * @param columns - Array of columns with their metadata
@@ -5608,20 +5609,13 @@ declare function mapSchemaTypes(vendor: DatabaseVendor, columns: Array<{
5608
5609
  declare function getVendorTypeMap(vendor: DatabaseVendor): Readonly<Record<string, string>>;
5609
5610
 
5610
5611
  /**
5611
- * Schema diff and serialisation utilities.
5612
- *
5613
- * Compare two {@link DatabaseSchema} instances and produce a structured
5614
- * diff report. Also provide JSON export / import for snapshot testing
5615
- * and cross-environment schema comparison.
5616
- *
5617
- * @module schema/schema-diff
5612
+ * Shared public diff-report types for relational schema comparison.
5618
5613
  */
5619
-
5620
5614
  /** Describes a difference for a single column. */
5621
5615
  interface ColumnDiff {
5622
5616
  column: string;
5623
5617
  type: 'added' | 'removed' | 'changed';
5624
- /** Present when type is `changed` */
5618
+ /** Present when type is `changed`. */
5625
5619
  changes?: Array<{
5626
5620
  property: string;
5627
5621
  before: unknown;
@@ -5632,9 +5626,9 @@ interface ColumnDiff {
5632
5626
  interface TableDiff {
5633
5627
  table: string;
5634
5628
  type: 'added' | 'removed' | 'changed';
5635
- /** Present when type is `changed` — per-column changes */
5629
+ /** Present when type is `changed` with per-column changes. */
5636
5630
  columns?: ColumnDiff[];
5637
- /** Present when type is `changed` — primary-key changes */
5631
+ /** Present when type is `changed` with primary-key changes. */
5638
5632
  primaryKeyChanged?: {
5639
5633
  before: string[];
5640
5634
  after: string[];
@@ -5642,11 +5636,11 @@ interface TableDiff {
5642
5636
  }
5643
5637
  /** Full diff report between two schemas. */
5644
5638
  interface SchemaDiffResult {
5645
- /** Whether the schemas are identical */
5639
+ /** Whether the schemas are identical. */
5646
5640
  identical: boolean;
5647
- /** Per-table differences */
5641
+ /** Per-table differences. */
5648
5642
  tables: TableDiff[];
5649
- /** Summary counts */
5643
+ /** Summary counts. */
5650
5644
  summary: {
5651
5645
  tablesAdded: number;
5652
5646
  tablesRemoved: number;
@@ -5656,36 +5650,21 @@ interface SchemaDiffResult {
5656
5650
  columnsChanged: number;
5657
5651
  };
5658
5652
  }
5653
+
5659
5654
  /**
5660
5655
  * Compare two database schemas and return a structured diff report.
5661
5656
  *
5662
5657
  * The comparison is name-based and case-insensitive. Schema-qualified
5663
5658
  * names are supported (e.g. `public.users`).
5664
- *
5665
- * @param before - The baseline schema
5666
- * @param after - The schema to compare against the baseline
5667
- * @returns A structured diff report
5668
5659
  */
5669
5660
  declare function diffSchemas(before: DatabaseSchema, after: DatabaseSchema): SchemaDiffResult;
5661
+
5670
5662
  /**
5671
- * Export a {@link DatabaseSchema} to a JSON string.
5672
- *
5673
- * The output is deterministic (keys sorted, 2-space indent) so that it
5674
- * can be used for snapshot testing.
5675
- *
5676
- * @param schema - The schema to serialise
5677
- * @returns Pretty-printed JSON string
5663
+ * Export a database schema to deterministic JSON for snapshots and fixtures.
5678
5664
  */
5679
5665
  declare function exportSchemaToJson(schema: DatabaseSchema): string;
5680
5666
  /**
5681
- * Import a {@link DatabaseSchema} from a JSON string.
5682
- *
5683
- * Performs basic structural validation to ensure the parsed object has the
5684
- * required shape.
5685
- *
5686
- * @param json - JSON string produced by {@link exportSchemaToJson}
5687
- * @returns Parsed database schema
5688
- * @throws Error when the JSON is not a valid DatabaseSchema
5667
+ * Import a database schema from JSON with basic structural validation.
5689
5668
  */
5690
5669
  declare function importSchemaFromJson(json: string): DatabaseSchema;
5691
5670
 
package/dist/index.d.ts CHANGED
@@ -5553,7 +5553,7 @@ declare function validateColumnTypes(schema: DatabaseSchema, tableName: string,
5553
5553
  * Database type → TypeScript type mapper.
5554
5554
  *
5555
5555
  * Maps vendor-specific SQL column types to their closest TypeScript
5556
- * equivalents. Used for code generation hints, documentation, and
5556
+ * equivalents. Used for code generation hints, documentation, and
5557
5557
  * schema-aware validation utilities.
5558
5558
  *
5559
5559
  * @module schema/type-mapper
@@ -5575,8 +5575,9 @@ interface MappedType {
5575
5575
  /**
5576
5576
  * Map a single database column type to its TypeScript equivalent.
5577
5577
  *
5578
- * Normalises the input type to lower-case and strips size suffixes
5579
- * (e.g. `varchar(255)` → `varchar`) before looking up the mapping.
5578
+ * Normalises the input type to lower-case and strips PostgreSQL array
5579
+ * suffixes, MySQL `unsigned`, and size/precision suffixes such as
5580
+ * `varchar(255)` or `numeric(10,2)` before map lookup.
5580
5581
  *
5581
5582
  * @param vendor - Database vendor
5582
5583
  * @param dbType - The raw column type string from the database
@@ -5587,7 +5588,7 @@ declare function mapColumnType(vendor: DatabaseVendor, dbType: string, nullable?
5587
5588
  /**
5588
5589
  * Map all columns in a database schema to TypeScript types.
5589
5590
  *
5590
- * Returns a nested map: `tableName → columnName → MappedType`.
5591
+ * Returns a nested map: `tableName → columnName → MappedType`.
5591
5592
  *
5592
5593
  * @param vendor - Database vendor
5593
5594
  * @param columns - Array of columns with their metadata
@@ -5608,20 +5609,13 @@ declare function mapSchemaTypes(vendor: DatabaseVendor, columns: Array<{
5608
5609
  declare function getVendorTypeMap(vendor: DatabaseVendor): Readonly<Record<string, string>>;
5609
5610
 
5610
5611
  /**
5611
- * Schema diff and serialisation utilities.
5612
- *
5613
- * Compare two {@link DatabaseSchema} instances and produce a structured
5614
- * diff report. Also provide JSON export / import for snapshot testing
5615
- * and cross-environment schema comparison.
5616
- *
5617
- * @module schema/schema-diff
5612
+ * Shared public diff-report types for relational schema comparison.
5618
5613
  */
5619
-
5620
5614
  /** Describes a difference for a single column. */
5621
5615
  interface ColumnDiff {
5622
5616
  column: string;
5623
5617
  type: 'added' | 'removed' | 'changed';
5624
- /** Present when type is `changed` */
5618
+ /** Present when type is `changed`. */
5625
5619
  changes?: Array<{
5626
5620
  property: string;
5627
5621
  before: unknown;
@@ -5632,9 +5626,9 @@ interface ColumnDiff {
5632
5626
  interface TableDiff {
5633
5627
  table: string;
5634
5628
  type: 'added' | 'removed' | 'changed';
5635
- /** Present when type is `changed` — per-column changes */
5629
+ /** Present when type is `changed` with per-column changes. */
5636
5630
  columns?: ColumnDiff[];
5637
- /** Present when type is `changed` — primary-key changes */
5631
+ /** Present when type is `changed` with primary-key changes. */
5638
5632
  primaryKeyChanged?: {
5639
5633
  before: string[];
5640
5634
  after: string[];
@@ -5642,11 +5636,11 @@ interface TableDiff {
5642
5636
  }
5643
5637
  /** Full diff report between two schemas. */
5644
5638
  interface SchemaDiffResult {
5645
- /** Whether the schemas are identical */
5639
+ /** Whether the schemas are identical. */
5646
5640
  identical: boolean;
5647
- /** Per-table differences */
5641
+ /** Per-table differences. */
5648
5642
  tables: TableDiff[];
5649
- /** Summary counts */
5643
+ /** Summary counts. */
5650
5644
  summary: {
5651
5645
  tablesAdded: number;
5652
5646
  tablesRemoved: number;
@@ -5656,36 +5650,21 @@ interface SchemaDiffResult {
5656
5650
  columnsChanged: number;
5657
5651
  };
5658
5652
  }
5653
+
5659
5654
  /**
5660
5655
  * Compare two database schemas and return a structured diff report.
5661
5656
  *
5662
5657
  * The comparison is name-based and case-insensitive. Schema-qualified
5663
5658
  * names are supported (e.g. `public.users`).
5664
- *
5665
- * @param before - The baseline schema
5666
- * @param after - The schema to compare against the baseline
5667
- * @returns A structured diff report
5668
5659
  */
5669
5660
  declare function diffSchemas(before: DatabaseSchema, after: DatabaseSchema): SchemaDiffResult;
5661
+
5670
5662
  /**
5671
- * Export a {@link DatabaseSchema} to a JSON string.
5672
- *
5673
- * The output is deterministic (keys sorted, 2-space indent) so that it
5674
- * can be used for snapshot testing.
5675
- *
5676
- * @param schema - The schema to serialise
5677
- * @returns Pretty-printed JSON string
5663
+ * Export a database schema to deterministic JSON for snapshots and fixtures.
5678
5664
  */
5679
5665
  declare function exportSchemaToJson(schema: DatabaseSchema): string;
5680
5666
  /**
5681
- * Import a {@link DatabaseSchema} from a JSON string.
5682
- *
5683
- * Performs basic structural validation to ensure the parsed object has the
5684
- * required shape.
5685
- *
5686
- * @param json - JSON string produced by {@link exportSchemaToJson}
5687
- * @returns Parsed database schema
5688
- * @throws Error when the JSON is not a valid DatabaseSchema
5667
+ * Import a database schema from JSON with basic structural validation.
5689
5668
  */
5690
5669
  declare function importSchemaFromJson(json: string): DatabaseSchema;
5691
5670