@inkeep/agents-cli 0.32.1 → 0.32.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +556 -360
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -1565,279 +1565,6 @@ var init_dist4 = __esm({
1565
1565
  }
1566
1566
  });
1567
1567
 
1568
- // ../node_modules/.pnpm/drizzle-zod@0.8.3_drizzle-orm@0.44.7_@electric-sql+pglite@0.3.13_@libsql+client@0.15.15_22ba19730a44533012b2cd3f01ff9ba6/node_modules/drizzle-zod/index.mjs
1569
- import { z as z6 } from "zod/v4";
1570
- import { isTable, getTableColumns, getViewSelectedFields, is, Column, SQL, isView } from "drizzle-orm";
1571
- function isColumnType(column, columnTypes) {
1572
- return columnTypes.includes(column.columnType);
1573
- }
1574
- function isWithEnum(column) {
1575
- return "enumValues" in column && Array.isArray(column.enumValues) && column.enumValues.length > 0;
1576
- }
1577
- function columnToSchema(column, factory) {
1578
- const z$1 = factory?.zodInstance ?? z6;
1579
- const coerce = factory?.coerce ?? {};
1580
- let schema;
1581
- if (isWithEnum(column)) {
1582
- schema = column.enumValues.length ? z$1.enum(column.enumValues) : z$1.string();
1583
- }
1584
- if (!schema) {
1585
- if (isColumnType(column, ["PgGeometry", "PgPointTuple"])) {
1586
- schema = z$1.tuple([z$1.number(), z$1.number()]);
1587
- } else if (isColumnType(column, ["PgGeometryObject", "PgPointObject"])) {
1588
- schema = z$1.object({ x: z$1.number(), y: z$1.number() });
1589
- } else if (isColumnType(column, ["PgHalfVector", "PgVector"])) {
1590
- schema = z$1.array(z$1.number());
1591
- schema = column.dimensions ? schema.length(column.dimensions) : schema;
1592
- } else if (isColumnType(column, ["PgLine"])) {
1593
- schema = z$1.tuple([z$1.number(), z$1.number(), z$1.number()]);
1594
- } else if (isColumnType(column, ["PgLineABC"])) {
1595
- schema = z$1.object({
1596
- a: z$1.number(),
1597
- b: z$1.number(),
1598
- c: z$1.number()
1599
- });
1600
- } else if (isColumnType(column, ["PgArray"])) {
1601
- schema = z$1.array(columnToSchema(column.baseColumn, factory));
1602
- schema = column.size ? schema.length(column.size) : schema;
1603
- } else if (column.dataType === "array") {
1604
- schema = z$1.array(z$1.any());
1605
- } else if (column.dataType === "number") {
1606
- schema = numberColumnToSchema(column, z$1, coerce);
1607
- } else if (column.dataType === "bigint") {
1608
- schema = bigintColumnToSchema(column, z$1, coerce);
1609
- } else if (column.dataType === "boolean") {
1610
- schema = coerce === true || coerce.boolean ? z$1.coerce.boolean() : z$1.boolean();
1611
- } else if (column.dataType === "date") {
1612
- schema = coerce === true || coerce.date ? z$1.coerce.date() : z$1.date();
1613
- } else if (column.dataType === "string") {
1614
- schema = stringColumnToSchema(column, z$1, coerce);
1615
- } else if (column.dataType === "json") {
1616
- schema = jsonSchema;
1617
- } else if (column.dataType === "custom") {
1618
- schema = z$1.any();
1619
- } else if (column.dataType === "buffer") {
1620
- schema = bufferSchema;
1621
- }
1622
- }
1623
- if (!schema) {
1624
- schema = z$1.any();
1625
- }
1626
- return schema;
1627
- }
1628
- function numberColumnToSchema(column, z16, coerce) {
1629
- let unsigned = column.getSQLType().includes("unsigned");
1630
- let min;
1631
- let max;
1632
- let integer2 = false;
1633
- if (isColumnType(column, ["MySqlTinyInt", "SingleStoreTinyInt"])) {
1634
- min = unsigned ? 0 : CONSTANTS.INT8_MIN;
1635
- max = unsigned ? CONSTANTS.INT8_UNSIGNED_MAX : CONSTANTS.INT8_MAX;
1636
- integer2 = true;
1637
- } else if (isColumnType(column, [
1638
- "PgSmallInt",
1639
- "PgSmallSerial",
1640
- "MySqlSmallInt",
1641
- "SingleStoreSmallInt"
1642
- ])) {
1643
- min = unsigned ? 0 : CONSTANTS.INT16_MIN;
1644
- max = unsigned ? CONSTANTS.INT16_UNSIGNED_MAX : CONSTANTS.INT16_MAX;
1645
- integer2 = true;
1646
- } else if (isColumnType(column, [
1647
- "PgReal",
1648
- "MySqlFloat",
1649
- "MySqlMediumInt",
1650
- "SingleStoreMediumInt",
1651
- "SingleStoreFloat"
1652
- ])) {
1653
- min = unsigned ? 0 : CONSTANTS.INT24_MIN;
1654
- max = unsigned ? CONSTANTS.INT24_UNSIGNED_MAX : CONSTANTS.INT24_MAX;
1655
- integer2 = isColumnType(column, ["MySqlMediumInt", "SingleStoreMediumInt"]);
1656
- } else if (isColumnType(column, [
1657
- "PgInteger",
1658
- "PgSerial",
1659
- "MySqlInt",
1660
- "SingleStoreInt"
1661
- ])) {
1662
- min = unsigned ? 0 : CONSTANTS.INT32_MIN;
1663
- max = unsigned ? CONSTANTS.INT32_UNSIGNED_MAX : CONSTANTS.INT32_MAX;
1664
- integer2 = true;
1665
- } else if (isColumnType(column, [
1666
- "PgDoublePrecision",
1667
- "MySqlReal",
1668
- "MySqlDouble",
1669
- "SingleStoreReal",
1670
- "SingleStoreDouble",
1671
- "SQLiteReal"
1672
- ])) {
1673
- min = unsigned ? 0 : CONSTANTS.INT48_MIN;
1674
- max = unsigned ? CONSTANTS.INT48_UNSIGNED_MAX : CONSTANTS.INT48_MAX;
1675
- } else if (isColumnType(column, [
1676
- "PgBigInt53",
1677
- "PgBigSerial53",
1678
- "MySqlBigInt53",
1679
- "MySqlSerial",
1680
- "SingleStoreBigInt53",
1681
- "SingleStoreSerial",
1682
- "SQLiteInteger"
1683
- ])) {
1684
- unsigned = unsigned || isColumnType(column, ["MySqlSerial", "SingleStoreSerial"]);
1685
- min = unsigned ? 0 : Number.MIN_SAFE_INTEGER;
1686
- max = Number.MAX_SAFE_INTEGER;
1687
- integer2 = true;
1688
- } else if (isColumnType(column, ["MySqlYear", "SingleStoreYear"])) {
1689
- min = 1901;
1690
- max = 2155;
1691
- integer2 = true;
1692
- } else {
1693
- min = Number.MIN_SAFE_INTEGER;
1694
- max = Number.MAX_SAFE_INTEGER;
1695
- }
1696
- let schema = coerce === true || coerce?.number ? integer2 ? z16.coerce.number() : z16.coerce.number().int() : integer2 ? z16.int() : z16.number();
1697
- schema = schema.gte(min).lte(max);
1698
- return schema;
1699
- }
1700
- function bigintColumnToSchema(column, z16, coerce) {
1701
- const unsigned = column.getSQLType().includes("unsigned");
1702
- const min = unsigned ? 0n : CONSTANTS.INT64_MIN;
1703
- const max = unsigned ? CONSTANTS.INT64_UNSIGNED_MAX : CONSTANTS.INT64_MAX;
1704
- const schema = coerce === true || coerce?.bigint ? z16.coerce.bigint() : z16.bigint();
1705
- return schema.gte(min).lte(max);
1706
- }
1707
- function stringColumnToSchema(column, z16, coerce) {
1708
- if (isColumnType(column, ["PgUUID"])) {
1709
- return z16.uuid();
1710
- }
1711
- let max;
1712
- let regex;
1713
- let fixed = false;
1714
- if (isColumnType(column, ["PgVarchar", "SQLiteText"])) {
1715
- max = column.length;
1716
- } else if (isColumnType(column, ["MySqlVarChar", "SingleStoreVarChar"])) {
1717
- max = column.length ?? CONSTANTS.INT16_UNSIGNED_MAX;
1718
- } else if (isColumnType(column, ["MySqlText", "SingleStoreText"])) {
1719
- if (column.textType === "longtext") {
1720
- max = CONSTANTS.INT32_UNSIGNED_MAX;
1721
- } else if (column.textType === "mediumtext") {
1722
- max = CONSTANTS.INT24_UNSIGNED_MAX;
1723
- } else if (column.textType === "text") {
1724
- max = CONSTANTS.INT16_UNSIGNED_MAX;
1725
- } else {
1726
- max = CONSTANTS.INT8_UNSIGNED_MAX;
1727
- }
1728
- }
1729
- if (isColumnType(column, [
1730
- "PgChar",
1731
- "MySqlChar",
1732
- "SingleStoreChar"
1733
- ])) {
1734
- max = column.length;
1735
- fixed = true;
1736
- }
1737
- if (isColumnType(column, ["PgBinaryVector"])) {
1738
- regex = /^[01]+$/;
1739
- max = column.dimensions;
1740
- }
1741
- let schema = coerce === true || coerce?.string ? z16.coerce.string() : z16.string();
1742
- schema = regex ? schema.regex(regex) : schema;
1743
- return max && fixed ? schema.length(max) : max ? schema.max(max) : schema;
1744
- }
1745
- function getColumns(tableLike) {
1746
- return isTable(tableLike) ? getTableColumns(tableLike) : getViewSelectedFields(tableLike);
1747
- }
1748
- function handleColumns(columns, refinements, conditions, factory) {
1749
- const columnSchemas = {};
1750
- for (const [key, selected] of Object.entries(columns)) {
1751
- if (!is(selected, Column) && !is(selected, SQL) && !is(selected, SQL.Aliased) && typeof selected === "object") {
1752
- const columns2 = isTable(selected) || isView(selected) ? getColumns(selected) : selected;
1753
- columnSchemas[key] = handleColumns(columns2, refinements[key] ?? {}, conditions, factory);
1754
- continue;
1755
- }
1756
- const refinement = refinements[key];
1757
- if (refinement !== void 0 && typeof refinement !== "function") {
1758
- columnSchemas[key] = refinement;
1759
- continue;
1760
- }
1761
- const column = is(selected, Column) ? selected : void 0;
1762
- const schema = column ? columnToSchema(column, factory) : z6.any();
1763
- const refined = typeof refinement === "function" ? refinement(schema) : schema;
1764
- if (conditions.never(column)) {
1765
- continue;
1766
- } else {
1767
- columnSchemas[key] = refined;
1768
- }
1769
- if (column) {
1770
- if (conditions.nullable(column)) {
1771
- columnSchemas[key] = columnSchemas[key].nullable();
1772
- }
1773
- if (conditions.optional(column)) {
1774
- columnSchemas[key] = columnSchemas[key].optional();
1775
- }
1776
- }
1777
- }
1778
- return z6.object(columnSchemas);
1779
- }
1780
- function handleEnum(enum_, factory) {
1781
- const zod = factory?.zodInstance ?? z6;
1782
- return zod.enum(enum_.enumValues);
1783
- }
1784
- var CONSTANTS, isPgEnum, literalSchema, jsonSchema, bufferSchema, selectConditions, insertConditions, createSelectSchema, createInsertSchema;
1785
- var init_drizzle_zod = __esm({
1786
- "../node_modules/.pnpm/drizzle-zod@0.8.3_drizzle-orm@0.44.7_@electric-sql+pglite@0.3.13_@libsql+client@0.15.15_22ba19730a44533012b2cd3f01ff9ba6/node_modules/drizzle-zod/index.mjs"() {
1787
- "use strict";
1788
- init_esm_shims();
1789
- CONSTANTS = {
1790
- INT8_MIN: -128,
1791
- INT8_MAX: 127,
1792
- INT8_UNSIGNED_MAX: 255,
1793
- INT16_MIN: -32768,
1794
- INT16_MAX: 32767,
1795
- INT16_UNSIGNED_MAX: 65535,
1796
- INT24_MIN: -8388608,
1797
- INT24_MAX: 8388607,
1798
- INT24_UNSIGNED_MAX: 16777215,
1799
- INT32_MIN: -2147483648,
1800
- INT32_MAX: 2147483647,
1801
- INT32_UNSIGNED_MAX: 4294967295,
1802
- INT48_MIN: -140737488355328,
1803
- INT48_MAX: 140737488355327,
1804
- INT48_UNSIGNED_MAX: 281474976710655,
1805
- INT64_MIN: -9223372036854775808n,
1806
- INT64_MAX: 9223372036854775807n,
1807
- INT64_UNSIGNED_MAX: 18446744073709551615n
1808
- };
1809
- isPgEnum = isWithEnum;
1810
- literalSchema = z6.union([z6.string(), z6.number(), z6.boolean(), z6.null()]);
1811
- jsonSchema = z6.union([
1812
- literalSchema,
1813
- z6.record(z6.string(), z6.any()),
1814
- z6.array(z6.any())
1815
- ]);
1816
- bufferSchema = z6.custom((v3) => v3 instanceof Buffer);
1817
- selectConditions = {
1818
- never: () => false,
1819
- optional: () => false,
1820
- nullable: (column) => !column.notNull
1821
- };
1822
- insertConditions = {
1823
- never: (column) => column?.generated?.type === "always" || column?.generatedIdentity?.type === "always",
1824
- optional: (column) => !column.notNull || column.notNull && column.hasDefault,
1825
- nullable: (column) => !column.notNull
1826
- };
1827
- createSelectSchema = (entity, refine) => {
1828
- if (isPgEnum(entity)) {
1829
- return handleEnum(entity);
1830
- }
1831
- const columns = getColumns(entity);
1832
- return handleColumns(columns, refine ?? {}, selectConditions);
1833
- };
1834
- createInsertSchema = (entity, refine) => {
1835
- const columns = getColumns(entity);
1836
- return handleColumns(columns, refine ?? {}, insertConditions);
1837
- };
1838
- }
1839
- });
1840
-
1841
1568
  // ../packages/agents-core/src/db/schema.ts
1842
1569
  import { relations } from "drizzle-orm";
1843
1570
  import {
@@ -2814,17 +2541,446 @@ var init_utility = __esm({
2814
2541
  }
2815
2542
  });
2816
2543
 
2544
+ // ../node_modules/.pnpm/drizzle-zod@0.8.3_drizzle-orm@0.44.7_@electric-sql+pglite@0.3.13_@libsql+client@0.15.15_22ba19730a44533012b2cd3f01ff9ba6/node_modules/drizzle-zod/index.mjs
2545
+ import { z as z6 } from "zod/v4";
2546
+ import { isTable, getTableColumns, getViewSelectedFields, is, Column, SQL, isView } from "drizzle-orm";
2547
+ function isColumnType(column, columnTypes) {
2548
+ return columnTypes.includes(column.columnType);
2549
+ }
2550
+ function isWithEnum(column) {
2551
+ return "enumValues" in column && Array.isArray(column.enumValues) && column.enumValues.length > 0;
2552
+ }
2553
+ function columnToSchema(column, factory) {
2554
+ const z$1 = factory?.zodInstance ?? z6;
2555
+ const coerce = factory?.coerce ?? {};
2556
+ let schema;
2557
+ if (isWithEnum(column)) {
2558
+ schema = column.enumValues.length ? z$1.enum(column.enumValues) : z$1.string();
2559
+ }
2560
+ if (!schema) {
2561
+ if (isColumnType(column, ["PgGeometry", "PgPointTuple"])) {
2562
+ schema = z$1.tuple([z$1.number(), z$1.number()]);
2563
+ } else if (isColumnType(column, ["PgGeometryObject", "PgPointObject"])) {
2564
+ schema = z$1.object({ x: z$1.number(), y: z$1.number() });
2565
+ } else if (isColumnType(column, ["PgHalfVector", "PgVector"])) {
2566
+ schema = z$1.array(z$1.number());
2567
+ schema = column.dimensions ? schema.length(column.dimensions) : schema;
2568
+ } else if (isColumnType(column, ["PgLine"])) {
2569
+ schema = z$1.tuple([z$1.number(), z$1.number(), z$1.number()]);
2570
+ } else if (isColumnType(column, ["PgLineABC"])) {
2571
+ schema = z$1.object({
2572
+ a: z$1.number(),
2573
+ b: z$1.number(),
2574
+ c: z$1.number()
2575
+ });
2576
+ } else if (isColumnType(column, ["PgArray"])) {
2577
+ schema = z$1.array(columnToSchema(column.baseColumn, factory));
2578
+ schema = column.size ? schema.length(column.size) : schema;
2579
+ } else if (column.dataType === "array") {
2580
+ schema = z$1.array(z$1.any());
2581
+ } else if (column.dataType === "number") {
2582
+ schema = numberColumnToSchema(column, z$1, coerce);
2583
+ } else if (column.dataType === "bigint") {
2584
+ schema = bigintColumnToSchema(column, z$1, coerce);
2585
+ } else if (column.dataType === "boolean") {
2586
+ schema = coerce === true || coerce.boolean ? z$1.coerce.boolean() : z$1.boolean();
2587
+ } else if (column.dataType === "date") {
2588
+ schema = coerce === true || coerce.date ? z$1.coerce.date() : z$1.date();
2589
+ } else if (column.dataType === "string") {
2590
+ schema = stringColumnToSchema(column, z$1, coerce);
2591
+ } else if (column.dataType === "json") {
2592
+ schema = jsonSchema;
2593
+ } else if (column.dataType === "custom") {
2594
+ schema = z$1.any();
2595
+ } else if (column.dataType === "buffer") {
2596
+ schema = bufferSchema;
2597
+ }
2598
+ }
2599
+ if (!schema) {
2600
+ schema = z$1.any();
2601
+ }
2602
+ return schema;
2603
+ }
2604
+ function numberColumnToSchema(column, z16, coerce) {
2605
+ let unsigned = column.getSQLType().includes("unsigned");
2606
+ let min;
2607
+ let max;
2608
+ let integer2 = false;
2609
+ if (isColumnType(column, ["MySqlTinyInt", "SingleStoreTinyInt"])) {
2610
+ min = unsigned ? 0 : CONSTANTS.INT8_MIN;
2611
+ max = unsigned ? CONSTANTS.INT8_UNSIGNED_MAX : CONSTANTS.INT8_MAX;
2612
+ integer2 = true;
2613
+ } else if (isColumnType(column, [
2614
+ "PgSmallInt",
2615
+ "PgSmallSerial",
2616
+ "MySqlSmallInt",
2617
+ "SingleStoreSmallInt"
2618
+ ])) {
2619
+ min = unsigned ? 0 : CONSTANTS.INT16_MIN;
2620
+ max = unsigned ? CONSTANTS.INT16_UNSIGNED_MAX : CONSTANTS.INT16_MAX;
2621
+ integer2 = true;
2622
+ } else if (isColumnType(column, [
2623
+ "PgReal",
2624
+ "MySqlFloat",
2625
+ "MySqlMediumInt",
2626
+ "SingleStoreMediumInt",
2627
+ "SingleStoreFloat"
2628
+ ])) {
2629
+ min = unsigned ? 0 : CONSTANTS.INT24_MIN;
2630
+ max = unsigned ? CONSTANTS.INT24_UNSIGNED_MAX : CONSTANTS.INT24_MAX;
2631
+ integer2 = isColumnType(column, ["MySqlMediumInt", "SingleStoreMediumInt"]);
2632
+ } else if (isColumnType(column, [
2633
+ "PgInteger",
2634
+ "PgSerial",
2635
+ "MySqlInt",
2636
+ "SingleStoreInt"
2637
+ ])) {
2638
+ min = unsigned ? 0 : CONSTANTS.INT32_MIN;
2639
+ max = unsigned ? CONSTANTS.INT32_UNSIGNED_MAX : CONSTANTS.INT32_MAX;
2640
+ integer2 = true;
2641
+ } else if (isColumnType(column, [
2642
+ "PgDoublePrecision",
2643
+ "MySqlReal",
2644
+ "MySqlDouble",
2645
+ "SingleStoreReal",
2646
+ "SingleStoreDouble",
2647
+ "SQLiteReal"
2648
+ ])) {
2649
+ min = unsigned ? 0 : CONSTANTS.INT48_MIN;
2650
+ max = unsigned ? CONSTANTS.INT48_UNSIGNED_MAX : CONSTANTS.INT48_MAX;
2651
+ } else if (isColumnType(column, [
2652
+ "PgBigInt53",
2653
+ "PgBigSerial53",
2654
+ "MySqlBigInt53",
2655
+ "MySqlSerial",
2656
+ "SingleStoreBigInt53",
2657
+ "SingleStoreSerial",
2658
+ "SQLiteInteger"
2659
+ ])) {
2660
+ unsigned = unsigned || isColumnType(column, ["MySqlSerial", "SingleStoreSerial"]);
2661
+ min = unsigned ? 0 : Number.MIN_SAFE_INTEGER;
2662
+ max = Number.MAX_SAFE_INTEGER;
2663
+ integer2 = true;
2664
+ } else if (isColumnType(column, ["MySqlYear", "SingleStoreYear"])) {
2665
+ min = 1901;
2666
+ max = 2155;
2667
+ integer2 = true;
2668
+ } else {
2669
+ min = Number.MIN_SAFE_INTEGER;
2670
+ max = Number.MAX_SAFE_INTEGER;
2671
+ }
2672
+ let schema = coerce === true || coerce?.number ? integer2 ? z16.coerce.number() : z16.coerce.number().int() : integer2 ? z16.int() : z16.number();
2673
+ schema = schema.gte(min).lte(max);
2674
+ return schema;
2675
+ }
2676
+ function bigintColumnToSchema(column, z16, coerce) {
2677
+ const unsigned = column.getSQLType().includes("unsigned");
2678
+ const min = unsigned ? 0n : CONSTANTS.INT64_MIN;
2679
+ const max = unsigned ? CONSTANTS.INT64_UNSIGNED_MAX : CONSTANTS.INT64_MAX;
2680
+ const schema = coerce === true || coerce?.bigint ? z16.coerce.bigint() : z16.bigint();
2681
+ return schema.gte(min).lte(max);
2682
+ }
2683
+ function stringColumnToSchema(column, z16, coerce) {
2684
+ if (isColumnType(column, ["PgUUID"])) {
2685
+ return z16.uuid();
2686
+ }
2687
+ let max;
2688
+ let regex;
2689
+ let fixed = false;
2690
+ if (isColumnType(column, ["PgVarchar", "SQLiteText"])) {
2691
+ max = column.length;
2692
+ } else if (isColumnType(column, ["MySqlVarChar", "SingleStoreVarChar"])) {
2693
+ max = column.length ?? CONSTANTS.INT16_UNSIGNED_MAX;
2694
+ } else if (isColumnType(column, ["MySqlText", "SingleStoreText"])) {
2695
+ if (column.textType === "longtext") {
2696
+ max = CONSTANTS.INT32_UNSIGNED_MAX;
2697
+ } else if (column.textType === "mediumtext") {
2698
+ max = CONSTANTS.INT24_UNSIGNED_MAX;
2699
+ } else if (column.textType === "text") {
2700
+ max = CONSTANTS.INT16_UNSIGNED_MAX;
2701
+ } else {
2702
+ max = CONSTANTS.INT8_UNSIGNED_MAX;
2703
+ }
2704
+ }
2705
+ if (isColumnType(column, [
2706
+ "PgChar",
2707
+ "MySqlChar",
2708
+ "SingleStoreChar"
2709
+ ])) {
2710
+ max = column.length;
2711
+ fixed = true;
2712
+ }
2713
+ if (isColumnType(column, ["PgBinaryVector"])) {
2714
+ regex = /^[01]+$/;
2715
+ max = column.dimensions;
2716
+ }
2717
+ let schema = coerce === true || coerce?.string ? z16.coerce.string() : z16.string();
2718
+ schema = regex ? schema.regex(regex) : schema;
2719
+ return max && fixed ? schema.length(max) : max ? schema.max(max) : schema;
2720
+ }
2721
+ function getColumns(tableLike) {
2722
+ return isTable(tableLike) ? getTableColumns(tableLike) : getViewSelectedFields(tableLike);
2723
+ }
2724
+ function handleColumns(columns, refinements, conditions, factory) {
2725
+ const columnSchemas = {};
2726
+ for (const [key, selected] of Object.entries(columns)) {
2727
+ if (!is(selected, Column) && !is(selected, SQL) && !is(selected, SQL.Aliased) && typeof selected === "object") {
2728
+ const columns2 = isTable(selected) || isView(selected) ? getColumns(selected) : selected;
2729
+ columnSchemas[key] = handleColumns(columns2, refinements[key] ?? {}, conditions, factory);
2730
+ continue;
2731
+ }
2732
+ const refinement = refinements[key];
2733
+ if (refinement !== void 0 && typeof refinement !== "function") {
2734
+ columnSchemas[key] = refinement;
2735
+ continue;
2736
+ }
2737
+ const column = is(selected, Column) ? selected : void 0;
2738
+ const schema = column ? columnToSchema(column, factory) : z6.any();
2739
+ const refined = typeof refinement === "function" ? refinement(schema) : schema;
2740
+ if (conditions.never(column)) {
2741
+ continue;
2742
+ } else {
2743
+ columnSchemas[key] = refined;
2744
+ }
2745
+ if (column) {
2746
+ if (conditions.nullable(column)) {
2747
+ columnSchemas[key] = columnSchemas[key].nullable();
2748
+ }
2749
+ if (conditions.optional(column)) {
2750
+ columnSchemas[key] = columnSchemas[key].optional();
2751
+ }
2752
+ }
2753
+ }
2754
+ return z6.object(columnSchemas);
2755
+ }
2756
+ function handleEnum(enum_, factory) {
2757
+ const zod = factory?.zodInstance ?? z6;
2758
+ return zod.enum(enum_.enumValues);
2759
+ }
2760
+ var CONSTANTS, isPgEnum, literalSchema, jsonSchema, bufferSchema, selectConditions, insertConditions, createSelectSchema, createInsertSchema;
2761
+ var init_drizzle_zod = __esm({
2762
+ "../node_modules/.pnpm/drizzle-zod@0.8.3_drizzle-orm@0.44.7_@electric-sql+pglite@0.3.13_@libsql+client@0.15.15_22ba19730a44533012b2cd3f01ff9ba6/node_modules/drizzle-zod/index.mjs"() {
2763
+ "use strict";
2764
+ init_esm_shims();
2765
+ CONSTANTS = {
2766
+ INT8_MIN: -128,
2767
+ INT8_MAX: 127,
2768
+ INT8_UNSIGNED_MAX: 255,
2769
+ INT16_MIN: -32768,
2770
+ INT16_MAX: 32767,
2771
+ INT16_UNSIGNED_MAX: 65535,
2772
+ INT24_MIN: -8388608,
2773
+ INT24_MAX: 8388607,
2774
+ INT24_UNSIGNED_MAX: 16777215,
2775
+ INT32_MIN: -2147483648,
2776
+ INT32_MAX: 2147483647,
2777
+ INT32_UNSIGNED_MAX: 4294967295,
2778
+ INT48_MIN: -140737488355328,
2779
+ INT48_MAX: 140737488355327,
2780
+ INT48_UNSIGNED_MAX: 281474976710655,
2781
+ INT64_MIN: -9223372036854775808n,
2782
+ INT64_MAX: 9223372036854775807n,
2783
+ INT64_UNSIGNED_MAX: 18446744073709551615n
2784
+ };
2785
+ isPgEnum = isWithEnum;
2786
+ literalSchema = z6.union([z6.string(), z6.number(), z6.boolean(), z6.null()]);
2787
+ jsonSchema = z6.union([
2788
+ literalSchema,
2789
+ z6.record(z6.string(), z6.any()),
2790
+ z6.array(z6.any())
2791
+ ]);
2792
+ bufferSchema = z6.custom((v3) => v3 instanceof Buffer);
2793
+ selectConditions = {
2794
+ never: () => false,
2795
+ optional: () => false,
2796
+ nullable: (column) => !column.notNull
2797
+ };
2798
+ insertConditions = {
2799
+ never: (column) => column?.generated?.type === "always" || column?.generatedIdentity?.type === "always",
2800
+ optional: (column) => !column.notNull || column.notNull && column.hasDefault,
2801
+ nullable: (column) => !column.notNull
2802
+ };
2803
+ createSelectSchema = (entity, refine) => {
2804
+ if (isPgEnum(entity)) {
2805
+ return handleEnum(entity);
2806
+ }
2807
+ const columns = getColumns(entity);
2808
+ return handleColumns(columns, refine ?? {}, selectConditions);
2809
+ };
2810
+ createInsertSchema = (entity, refine) => {
2811
+ const columns = getColumns(entity);
2812
+ return handleColumns(columns, refine ?? {}, insertConditions);
2813
+ };
2814
+ }
2815
+ });
2816
+
2817
+ // ../packages/agents-core/src/validation/drizzle-schema-helpers.ts
2818
+ function createSelectSchemaWithModifiers(table, overrides) {
2819
+ const tableColumns = table._?.columns;
2820
+ if (!tableColumns) {
2821
+ return createSelectSchema(table, overrides);
2822
+ }
2823
+ const tableFieldNames = Object.keys(tableColumns);
2824
+ const modifiers = {};
2825
+ for (const fieldName of tableFieldNames) {
2826
+ const fieldNameStr = String(fieldName);
2827
+ if (fieldNameStr in FIELD_MODIFIERS) {
2828
+ modifiers[fieldNameStr] = FIELD_MODIFIERS[fieldNameStr];
2829
+ }
2830
+ }
2831
+ const mergedModifiers = { ...modifiers, ...overrides };
2832
+ return createSelectSchema(table, mergedModifiers);
2833
+ }
2834
+ function createInsertSchemaWithModifiers(table, overrides) {
2835
+ const tableColumns = table._?.columns;
2836
+ if (!tableColumns) {
2837
+ return createInsertSchema(table, overrides);
2838
+ }
2839
+ const tableFieldNames = Object.keys(tableColumns);
2840
+ const modifiers = {};
2841
+ for (const fieldName of tableFieldNames) {
2842
+ const fieldNameStr = String(fieldName);
2843
+ if (fieldNameStr in FIELD_MODIFIERS) {
2844
+ modifiers[fieldNameStr] = FIELD_MODIFIERS[fieldNameStr];
2845
+ }
2846
+ }
2847
+ const mergedModifiers = { ...modifiers, ...overrides };
2848
+ return createInsertSchema(table, mergedModifiers);
2849
+ }
2850
+ function registerFieldSchemas(schema) {
2851
+ if (!(schema instanceof z5.ZodObject)) {
2852
+ return schema;
2853
+ }
2854
+ const shape = schema.shape;
2855
+ const fieldMetadata = {
2856
+ id: { description: "Resource identifier" },
2857
+ name: { description: "Name" },
2858
+ description: { description: "Description" },
2859
+ tenantId: { description: "Tenant identifier" },
2860
+ projectId: { description: "Project identifier" },
2861
+ agentId: { description: "Agent identifier" },
2862
+ subAgentId: { description: "Sub-agent identifier" },
2863
+ createdAt: { description: "Creation timestamp" },
2864
+ updatedAt: { description: "Last update timestamp" }
2865
+ };
2866
+ for (const [fieldName, fieldSchema] of Object.entries(shape)) {
2867
+ if (fieldName in fieldMetadata && fieldSchema) {
2868
+ let zodFieldSchema = fieldSchema;
2869
+ let innerSchema = null;
2870
+ if (zodFieldSchema instanceof z5.ZodOptional) {
2871
+ innerSchema = zodFieldSchema._def.innerType;
2872
+ zodFieldSchema = innerSchema;
2873
+ }
2874
+ zodFieldSchema.meta(fieldMetadata[fieldName]);
2875
+ if (fieldName === "id" && zodFieldSchema instanceof z5.ZodString) {
2876
+ zodFieldSchema.openapi({
2877
+ description: "Resource identifier",
2878
+ minLength: MIN_ID_LENGTH,
2879
+ maxLength: MAX_ID_LENGTH,
2880
+ pattern: URL_SAFE_ID_PATTERN.source,
2881
+ example: "resource_789"
2882
+ });
2883
+ } else if (zodFieldSchema instanceof z5.ZodString) {
2884
+ zodFieldSchema.openapi({
2885
+ description: fieldMetadata[fieldName].description
2886
+ });
2887
+ }
2888
+ if (innerSchema && fieldSchema instanceof z5.ZodOptional) {
2889
+ fieldSchema.meta(fieldMetadata[fieldName]);
2890
+ }
2891
+ }
2892
+ }
2893
+ return schema;
2894
+ }
2895
+ var MIN_ID_LENGTH, MAX_ID_LENGTH, URL_SAFE_ID_PATTERN, resourceIdSchema, FIELD_MODIFIERS, createSelectSchema2, createInsertSchema2;
2896
+ var init_drizzle_schema_helpers = __esm({
2897
+ "../packages/agents-core/src/validation/drizzle-schema-helpers.ts"() {
2898
+ "use strict";
2899
+ init_esm_shims();
2900
+ init_dist4();
2901
+ init_drizzle_zod();
2902
+ MIN_ID_LENGTH = 1;
2903
+ MAX_ID_LENGTH = 255;
2904
+ URL_SAFE_ID_PATTERN = /^[a-zA-Z0-9\-_.]+$/;
2905
+ resourceIdSchema = z5.string().min(MIN_ID_LENGTH).max(MAX_ID_LENGTH).describe("Resource identifier").regex(URL_SAFE_ID_PATTERN, {
2906
+ message: "ID must contain only letters, numbers, hyphens, underscores, and dots"
2907
+ }).openapi({
2908
+ description: "Resource identifier",
2909
+ example: "resource_789"
2910
+ });
2911
+ resourceIdSchema.meta({
2912
+ description: "Resource identifier"
2913
+ });
2914
+ FIELD_MODIFIERS = {
2915
+ id: (schema) => {
2916
+ const modified = schema.min(MIN_ID_LENGTH).max(MAX_ID_LENGTH).describe("Resource identifier").regex(URL_SAFE_ID_PATTERN, {
2917
+ message: "ID must contain only letters, numbers, hyphens, underscores, and dots"
2918
+ }).openapi({
2919
+ description: "Resource identifier",
2920
+ example: "resource_789"
2921
+ });
2922
+ modified.meta({
2923
+ description: "Resource identifier"
2924
+ });
2925
+ return modified;
2926
+ },
2927
+ name: (_schema) => {
2928
+ const modified = z5.string().describe("Name");
2929
+ modified.meta({ description: "Name" });
2930
+ return modified;
2931
+ },
2932
+ description: (_schema) => {
2933
+ const modified = z5.string().describe("Description");
2934
+ modified.meta({ description: "Description" });
2935
+ return modified;
2936
+ },
2937
+ tenantId: (schema) => {
2938
+ const modified = schema.describe("Tenant identifier");
2939
+ modified.meta({ description: "Tenant identifier" });
2940
+ return modified;
2941
+ },
2942
+ projectId: (schema) => {
2943
+ const modified = schema.describe("Project identifier");
2944
+ modified.meta({ description: "Project identifier" });
2945
+ return modified;
2946
+ },
2947
+ agentId: (schema) => {
2948
+ const modified = schema.describe("Agent identifier");
2949
+ modified.meta({ description: "Agent identifier" });
2950
+ return modified;
2951
+ },
2952
+ subAgentId: (schema) => {
2953
+ const modified = schema.describe("Sub-agent identifier");
2954
+ modified.meta({ description: "Sub-agent identifier" });
2955
+ return modified;
2956
+ },
2957
+ createdAt: (schema) => {
2958
+ const modified = schema.describe("Creation timestamp");
2959
+ modified.meta({ description: "Creation timestamp" });
2960
+ return modified;
2961
+ },
2962
+ updatedAt: (schema) => {
2963
+ const modified = schema.describe("Last update timestamp");
2964
+ modified.meta({ description: "Last update timestamp" });
2965
+ return modified;
2966
+ }
2967
+ };
2968
+ createSelectSchema2 = createSelectSchemaWithModifiers;
2969
+ createInsertSchema2 = createInsertSchemaWithModifiers;
2970
+ }
2971
+ });
2972
+
2817
2973
  // ../packages/agents-core/src/validation/schemas.ts
2818
- var AGENT_EXECUTION_TRANSFER_COUNT_MAX2, AGENT_EXECUTION_TRANSFER_COUNT_MIN2, CONTEXT_FETCHER_HTTP_TIMEOUT_MS_DEFAULT2, STATUS_UPDATE_MAX_INTERVAL_SECONDS2, STATUS_UPDATE_MAX_NUM_EVENTS2, SUB_AGENT_TURN_GENERATION_STEPS_MAX2, SUB_AGENT_TURN_GENERATION_STEPS_MIN2, VALIDATION_AGENT_PROMPT_MAX_CHARS2, VALIDATION_SUB_AGENT_PROMPT_MAX_CHARS2, StopWhenSchema, AgentStopWhenSchema, SubAgentStopWhenSchema, MIN_ID_LENGTH, MAX_ID_LENGTH, URL_SAFE_ID_PATTERN, resourceIdSchema, ModelSettingsSchema, ModelSchema, ProjectModelSchema, FunctionToolConfigSchema, createApiSchema, createApiInsertSchema, createApiUpdateSchema, createAgentScopedApiSchema, createAgentScopedApiInsertSchema, createAgentScopedApiUpdateSchema, SubAgentSelectSchema, SubAgentInsertSchema, SubAgentUpdateSchema, SubAgentApiSelectSchema, SubAgentApiInsertSchema, SubAgentApiUpdateSchema, SubAgentRelationSelectSchema, SubAgentRelationInsertSchema, SubAgentRelationUpdateSchema, SubAgentRelationApiSelectSchema, SubAgentRelationApiInsertSchema, SubAgentRelationApiUpdateSchema, SubAgentRelationQuerySchema, ExternalSubAgentRelationInsertSchema, ExternalSubAgentRelationApiInsertSchema, AgentSelectSchema, AgentInsertSchema, AgentUpdateSchema, AgentApiSelectSchema, AgentApiInsertSchema, AgentApiUpdateSchema, TaskSelectSchema, TaskInsertSchema, TaskUpdateSchema, TaskApiSelectSchema, TaskApiInsertSchema, TaskApiUpdateSchema, TaskRelationSelectSchema, TaskRelationInsertSchema, TaskRelationUpdateSchema, TaskRelationApiSelectSchema, TaskRelationApiInsertSchema, TaskRelationApiUpdateSchema, imageUrlSchema, McpTransportConfigSchema, ToolStatusSchema, McpToolDefinitionSchema, ToolSelectSchema, ToolInsertSchema, ConversationSelectSchema, ConversationInsertSchema, ConversationUpdateSchema, ConversationApiSelectSchema, ConversationApiInsertSchema, ConversationApiUpdateSchema, MessageSelectSchema, MessageInsertSchema, MessageUpdateSchema, MessageApiSelectSchema, MessageApiInsertSchema, MessageApiUpdateSchema, ContextCacheSelectSchema, ContextCacheInsertSchema, ContextCacheUpdateSchema, ContextCacheApiSelectSchema, ContextCacheApiInsertSchema, ContextCacheApiUpdateSchema, DataComponentSelectSchema, DataComponentInsertSchema, DataComponentBaseSchema, DataComponentUpdateSchema, DataComponentApiSelectSchema, DataComponentApiInsertSchema, DataComponentApiUpdateSchema, SubAgentDataComponentSelectSchema, SubAgentDataComponentInsertSchema, SubAgentDataComponentUpdateSchema, SubAgentDataComponentApiSelectSchema, SubAgentDataComponentApiInsertSchema, SubAgentDataComponentApiUpdateSchema, ArtifactComponentSelectSchema, ArtifactComponentInsertSchema, ArtifactComponentUpdateSchema, ArtifactComponentApiSelectSchema, ArtifactComponentApiInsertSchema, ArtifactComponentApiUpdateSchema, SubAgentArtifactComponentSelectSchema, SubAgentArtifactComponentInsertSchema, SubAgentArtifactComponentUpdateSchema, SubAgentArtifactComponentApiSelectSchema, SubAgentArtifactComponentApiInsertSchema, SubAgentArtifactComponentApiUpdateSchema, ExternalAgentSelectSchema, ExternalAgentInsertSchema, ExternalAgentUpdateSchema, ExternalAgentApiSelectSchema, ExternalAgentApiInsertSchema, ExternalAgentApiUpdateSchema, AllAgentSchema, ApiKeySelectSchema, ApiKeyInsertSchema, ApiKeyUpdateSchema, ApiKeyApiSelectSchema, ApiKeyApiCreationResponseSchema, ApiKeyApiInsertSchema, ApiKeyApiUpdateSchema, CredentialReferenceSelectSchema, CredentialReferenceInsertSchema, CredentialReferenceUpdateSchema, CredentialReferenceApiSelectSchema, CredentialReferenceApiInsertSchema, CredentialReferenceApiUpdateSchema, CredentialStoreSchema, CredentialStoreListResponseSchema, CreateCredentialInStoreRequestSchema, CreateCredentialInStoreResponseSchema, RelatedAgentInfoSchema, ComponentAssociationSchema, OAuthLoginQuerySchema, OAuthCallbackQuerySchema, McpToolSchema, MCPToolConfigSchema, ToolUpdateSchema, ToolApiSelectSchema, ToolApiInsertSchema, ToolApiUpdateSchema, FunctionToolSelectSchema, FunctionToolInsertSchema, FunctionToolUpdateSchema, FunctionToolApiSelectSchema, FunctionToolApiInsertSchema, FunctionToolApiUpdateSchema, FunctionSelectSchema, FunctionInsertSchema, FunctionUpdateSchema, FunctionApiSelectSchema, FunctionApiInsertSchema, FunctionApiUpdateSchema, FetchConfigSchema, FetchDefinitionSchema, ContextConfigSelectSchema, ContextConfigInsertSchema, ContextConfigUpdateSchema, ContextConfigApiSelectSchema, ContextConfigApiInsertSchema, ContextConfigApiUpdateSchema, SubAgentToolRelationSelectSchema, SubAgentToolRelationInsertSchema, SubAgentToolRelationUpdateSchema, SubAgentToolRelationApiSelectSchema, SubAgentToolRelationApiInsertSchema, SubAgentToolRelationApiUpdateSchema, SubAgentExternalAgentRelationSelectSchema, SubAgentExternalAgentRelationInsertSchema, SubAgentExternalAgentRelationUpdateSchema, SubAgentExternalAgentRelationApiSelectSchema, SubAgentExternalAgentRelationApiInsertSchema, SubAgentExternalAgentRelationApiUpdateSchema, SubAgentTeamAgentRelationSelectSchema, SubAgentTeamAgentRelationInsertSchema, SubAgentTeamAgentRelationUpdateSchema, SubAgentTeamAgentRelationApiSelectSchema, SubAgentTeamAgentRelationApiInsertSchema, SubAgentTeamAgentRelationApiUpdateSchema, LedgerArtifactSelectSchema, LedgerArtifactInsertSchema, LedgerArtifactUpdateSchema, LedgerArtifactApiSelectSchema, LedgerArtifactApiInsertSchema, LedgerArtifactApiUpdateSchema, StatusComponentSchema, StatusUpdateSchema, CanUseItemSchema, canDelegateToExternalAgentSchema, canDelegateToTeamAgentSchema, TeamAgentSchema, FullAgentAgentInsertSchema, AgentWithinContextOfProjectSchema, PaginationSchema, ErrorResponseSchema, ExistsResponseSchema, RemovedResponseSchema, ProjectSelectSchema, ProjectInsertSchema, ProjectUpdateSchema, ProjectApiSelectSchema, ProjectApiInsertSchema, ProjectApiUpdateSchema, FullProjectDefinitionSchema, ProjectResponse, SubAgentResponse, AgentResponse, ToolResponse, ExternalAgentResponse, ContextConfigResponse, ApiKeyResponse, CredentialReferenceResponse, FunctionResponse, FunctionToolResponse, DataComponentResponse, ArtifactComponentResponse, SubAgentRelationResponse, SubAgentToolRelationResponse, ConversationResponse, MessageResponse, ProjectListResponse, SubAgentListResponse, AgentListResponse, ToolListResponse, ExternalAgentListResponse, ContextConfigListResponse, ApiKeyListResponse, CredentialReferenceListResponse, FunctionListResponse, FunctionToolListResponse, DataComponentListResponse, ArtifactComponentListResponse, SubAgentRelationListResponse, SubAgentToolRelationListResponse, ConversationListResponse, MessageListResponse, SubAgentDataComponentResponse, SubAgentArtifactComponentResponse, SubAgentDataComponentListResponse, SubAgentArtifactComponentListResponse, HeadersScopeSchema, TenantId, ProjectId, AgentId, SubAgentId, TenantParamsSchema, TenantIdParamsSchema, TenantProjectParamsSchema, TenantProjectIdParamsSchema, TenantProjectAgentParamsSchema, TenantProjectAgentIdParamsSchema, TenantProjectAgentSubAgentParamsSchema, TenantProjectAgentSubAgentIdParamsSchema, PaginationQueryParamsSchema;
2974
+ var AGENT_EXECUTION_TRANSFER_COUNT_MAX2, AGENT_EXECUTION_TRANSFER_COUNT_MIN2, CONTEXT_FETCHER_HTTP_TIMEOUT_MS_DEFAULT2, STATUS_UPDATE_MAX_INTERVAL_SECONDS2, STATUS_UPDATE_MAX_NUM_EVENTS2, SUB_AGENT_TURN_GENERATION_STEPS_MAX2, SUB_AGENT_TURN_GENERATION_STEPS_MIN2, VALIDATION_AGENT_PROMPT_MAX_CHARS2, VALIDATION_SUB_AGENT_PROMPT_MAX_CHARS2, StopWhenSchema, AgentStopWhenSchema, SubAgentStopWhenSchema, pageNumber, limitNumber, ModelSettingsSchema, ModelSchema, ProjectModelSchema, FunctionToolConfigSchema, createApiSchema, createApiInsertSchema, createApiUpdateSchema, createAgentScopedApiSchema, createAgentScopedApiInsertSchema, createAgentScopedApiUpdateSchema, SubAgentSelectSchema, SubAgentInsertSchema, SubAgentUpdateSchema, SubAgentApiSelectSchema, SubAgentApiInsertSchema, SubAgentApiUpdateSchema, SubAgentRelationSelectSchema, SubAgentRelationInsertSchema, SubAgentRelationUpdateSchema, SubAgentRelationApiSelectSchema, SubAgentRelationApiInsertSchema, SubAgentRelationApiUpdateSchema, SubAgentRelationQuerySchema, ExternalSubAgentRelationInsertSchema, ExternalSubAgentRelationApiInsertSchema, AgentSelectSchema, AgentInsertSchema, AgentUpdateSchema, AgentApiSelectSchema, AgentApiInsertSchema, AgentApiUpdateSchema, TaskSelectSchema, TaskInsertSchema, TaskUpdateSchema, TaskApiSelectSchema, TaskApiInsertSchema, TaskApiUpdateSchema, TaskRelationSelectSchema, TaskRelationInsertSchema, TaskRelationUpdateSchema, TaskRelationApiSelectSchema, TaskRelationApiInsertSchema, TaskRelationApiUpdateSchema, imageUrlSchema, McpTransportConfigSchema, ToolStatusSchema, McpToolDefinitionSchema, ToolSelectSchema, ToolInsertSchema, ConversationSelectSchema, ConversationInsertSchema, ConversationUpdateSchema, ConversationApiSelectSchema, ConversationApiInsertSchema, ConversationApiUpdateSchema, MessageSelectSchema, MessageInsertSchema, MessageUpdateSchema, MessageApiSelectSchema, MessageApiInsertSchema, MessageApiUpdateSchema, ContextCacheSelectSchema, ContextCacheInsertSchema, ContextCacheUpdateSchema, ContextCacheApiSelectSchema, ContextCacheApiInsertSchema, ContextCacheApiUpdateSchema, DataComponentSelectSchema, DataComponentInsertSchema, DataComponentBaseSchema, DataComponentUpdateSchema, DataComponentApiSelectSchema, DataComponentApiInsertSchema, DataComponentApiUpdateSchema, SubAgentDataComponentSelectSchema, SubAgentDataComponentInsertSchema, SubAgentDataComponentUpdateSchema, SubAgentDataComponentApiSelectSchema, SubAgentDataComponentApiInsertSchema, SubAgentDataComponentApiUpdateSchema, ArtifactComponentSelectSchema, ArtifactComponentInsertSchema, ArtifactComponentUpdateSchema, ArtifactComponentApiSelectSchema, ArtifactComponentApiInsertSchema, ArtifactComponentApiUpdateSchema, SubAgentArtifactComponentSelectSchema, SubAgentArtifactComponentInsertSchema, SubAgentArtifactComponentUpdateSchema, SubAgentArtifactComponentApiSelectSchema, SubAgentArtifactComponentApiInsertSchema, SubAgentArtifactComponentApiUpdateSchema, ExternalAgentSelectSchema, ExternalAgentInsertSchema, ExternalAgentUpdateSchema, ExternalAgentApiSelectSchema, ExternalAgentApiInsertSchema, ExternalAgentApiUpdateSchema, AllAgentSchema, ApiKeySelectSchema, ApiKeyInsertSchema, ApiKeyUpdateSchema, ApiKeyApiSelectSchema, ApiKeyApiCreationResponseSchema, ApiKeyApiInsertSchema, ApiKeyApiUpdateSchema, CredentialReferenceSelectSchema, CredentialReferenceInsertSchema, CredentialReferenceUpdateSchema, CredentialReferenceApiSelectSchema, CredentialReferenceApiInsertSchema, CredentialReferenceApiUpdateSchema, CredentialStoreSchema, CredentialStoreListResponseSchema, CreateCredentialInStoreRequestSchema, CreateCredentialInStoreResponseSchema, RelatedAgentInfoSchema, ComponentAssociationSchema, OAuthLoginQuerySchema, OAuthCallbackQuerySchema, McpToolSchema, MCPToolConfigSchema, ToolUpdateSchema, ToolApiSelectSchema, ToolApiInsertSchema, ToolApiUpdateSchema, FunctionToolSelectSchema, FunctionToolInsertSchema, FunctionToolUpdateSchema, FunctionToolApiSelectSchema, FunctionToolApiInsertSchema, FunctionToolApiUpdateSchema, FunctionSelectSchema, FunctionInsertSchema, FunctionUpdateSchema, FunctionApiSelectSchema, FunctionApiInsertSchema, FunctionApiUpdateSchema, FetchConfigSchema, FetchDefinitionSchema, ContextConfigSelectSchema, ContextConfigInsertSchema, ContextConfigUpdateSchema, ContextConfigApiSelectSchema, ContextConfigApiInsertSchema, ContextConfigApiUpdateSchema, SubAgentToolRelationSelectSchema, SubAgentToolRelationInsertSchema, SubAgentToolRelationUpdateSchema, SubAgentToolRelationApiSelectSchema, SubAgentToolRelationApiInsertSchema, SubAgentToolRelationApiUpdateSchema, SubAgentExternalAgentRelationSelectSchema, SubAgentExternalAgentRelationInsertSchema, SubAgentExternalAgentRelationUpdateSchema, SubAgentExternalAgentRelationApiSelectSchema, SubAgentExternalAgentRelationApiInsertSchema, SubAgentExternalAgentRelationApiUpdateSchema, SubAgentTeamAgentRelationSelectSchema, SubAgentTeamAgentRelationInsertSchema, SubAgentTeamAgentRelationUpdateSchema, SubAgentTeamAgentRelationApiSelectSchema, SubAgentTeamAgentRelationApiInsertSchema, SubAgentTeamAgentRelationApiUpdateSchema, LedgerArtifactSelectSchema, LedgerArtifactInsertSchema, LedgerArtifactUpdateSchema, LedgerArtifactApiSelectSchema, LedgerArtifactApiInsertSchema, LedgerArtifactApiUpdateSchema, StatusComponentSchema, StatusUpdateSchema, CanUseItemSchema, canDelegateToExternalAgentSchema, canDelegateToTeamAgentSchema, TeamAgentSchema, FullAgentAgentInsertSchema, AgentWithinContextOfProjectSchema, PaginationSchema, ErrorResponseSchema, ExistsResponseSchema, RemovedResponseSchema, ProjectSelectSchema, ProjectInsertSchema, ProjectUpdateSchema, ProjectApiSelectSchema, ProjectApiInsertSchema, ProjectApiUpdateSchema, FullProjectDefinitionSchema, ProjectResponse, SubAgentResponse, AgentResponse, ToolResponse, ExternalAgentResponse, ContextConfigResponse, ApiKeyResponse, CredentialReferenceResponse, FunctionResponse, FunctionToolResponse, DataComponentResponse, ArtifactComponentResponse, SubAgentRelationResponse, SubAgentToolRelationResponse, ConversationResponse, MessageResponse, ProjectListResponse, SubAgentListResponse, AgentListResponse, ToolListResponse, ExternalAgentListResponse, ContextConfigListResponse, ApiKeyListResponse, CredentialReferenceListResponse, FunctionListResponse, FunctionToolListResponse, DataComponentListResponse, ArtifactComponentListResponse, SubAgentRelationListResponse, SubAgentToolRelationListResponse, ConversationListResponse, MessageListResponse, SubAgentDataComponentResponse, SubAgentArtifactComponentResponse, SubAgentDataComponentListResponse, SubAgentArtifactComponentListResponse, FullProjectDefinitionResponse, AgentWithinContextOfProjectResponse, RelatedAgentInfoListResponse, ComponentAssociationListResponse, McpToolResponse, McpToolListResponse, SubAgentTeamAgentRelationResponse, SubAgentTeamAgentRelationListResponse, SubAgentExternalAgentRelationResponse, SubAgentExternalAgentRelationListResponse, DataComponentArrayResponse, ArtifactComponentArrayResponse, HeadersScopeSchema, TenantId, ProjectId, AgentId, SubAgentId, TenantParamsSchema, TenantIdParamsSchema, TenantProjectParamsSchema, TenantProjectIdParamsSchema, TenantProjectAgentParamsSchema, TenantProjectAgentIdParamsSchema, TenantProjectAgentSubAgentParamsSchema, TenantProjectAgentSubAgentIdParamsSchema, PaginationQueryParamsSchema;
2819
2975
  var init_schemas = __esm({
2820
2976
  "../packages/agents-core/src/validation/schemas.ts"() {
2821
2977
  "use strict";
2822
2978
  init_esm_shims();
2823
2979
  init_dist4();
2824
- init_drizzle_zod();
2825
2980
  init_defaults2();
2826
2981
  init_schema();
2827
2982
  init_utility();
2983
+ init_drizzle_schema_helpers();
2828
2984
  ({
2829
2985
  AGENT_EXECUTION_TRANSFER_COUNT_MAX: AGENT_EXECUTION_TRANSFER_COUNT_MAX2,
2830
2986
  AGENT_EXECUTION_TRANSFER_COUNT_MIN: AGENT_EXECUTION_TRANSFER_COUNT_MIN2,
@@ -2846,14 +3002,8 @@ var init_schemas = __esm({
2846
3002
  SubAgentStopWhenSchema = StopWhenSchema.pick({ stepCountIs: true }).openapi(
2847
3003
  "SubAgentStopWhen"
2848
3004
  );
2849
- MIN_ID_LENGTH = 1;
2850
- MAX_ID_LENGTH = 255;
2851
- URL_SAFE_ID_PATTERN = /^[a-zA-Z0-9\-_.]+$/;
2852
- resourceIdSchema = z5.string().min(MIN_ID_LENGTH).max(MAX_ID_LENGTH).describe("Resource identifier").regex(URL_SAFE_ID_PATTERN, {
2853
- message: "ID must contain only letters, numbers, hyphens, underscores, and dots"
2854
- }).openapi({
2855
- example: "resource_789"
2856
- });
3005
+ pageNumber = z5.coerce.number().min(1).default(1).openapi("PaginationPageQueryParam");
3006
+ limitNumber = z5.coerce.number().min(1).max(100).default(10).openapi("PaginationLimitQueryParam");
2857
3007
  ModelSettingsSchema = z5.object({
2858
3008
  model: z5.string().optional().describe("The model to use for the project."),
2859
3009
  providerOptions: z5.record(z5.string(), z5.any()).optional().describe("The provider options to use for the project.")
@@ -2881,8 +3031,8 @@ var init_schemas = __esm({
2881
3031
  createAgentScopedApiSchema = (schema) => schema.omit({ tenantId: true, projectId: true, agentId: true });
2882
3032
  createAgentScopedApiInsertSchema = (schema) => schema.omit({ tenantId: true, projectId: true, agentId: true });
2883
3033
  createAgentScopedApiUpdateSchema = (schema) => schema.omit({ tenantId: true, projectId: true, agentId: true }).partial();
2884
- SubAgentSelectSchema = createSelectSchema(subAgents);
2885
- SubAgentInsertSchema = createInsertSchema(subAgents).extend({
3034
+ SubAgentSelectSchema = createSelectSchema2(subAgents);
3035
+ SubAgentInsertSchema = createInsertSchema2(subAgents).extend({
2886
3036
  id: resourceIdSchema,
2887
3037
  models: ModelSchema.optional()
2888
3038
  });
@@ -2890,8 +3040,8 @@ var init_schemas = __esm({
2890
3040
  SubAgentApiSelectSchema = createAgentScopedApiSchema(SubAgentSelectSchema).openapi("SubAgent");
2891
3041
  SubAgentApiInsertSchema = createAgentScopedApiInsertSchema(SubAgentInsertSchema).openapi("SubAgentCreate");
2892
3042
  SubAgentApiUpdateSchema = createAgentScopedApiUpdateSchema(SubAgentUpdateSchema).openapi("SubAgentUpdate");
2893
- SubAgentRelationSelectSchema = createSelectSchema(subAgentRelations);
2894
- SubAgentRelationInsertSchema = createInsertSchema(subAgentRelations).extend({
3043
+ SubAgentRelationSelectSchema = createSelectSchema2(subAgentRelations);
3044
+ SubAgentRelationInsertSchema = createInsertSchema2(subAgentRelations).extend({
2895
3045
  id: resourceIdSchema,
2896
3046
  agentId: resourceIdSchema,
2897
3047
  sourceSubAgentId: resourceIdSchema,
@@ -2946,7 +3096,7 @@ var init_schemas = __esm({
2946
3096
  externalSubAgentId: z5.string().optional(),
2947
3097
  teamSubAgentId: z5.string().optional()
2948
3098
  });
2949
- ExternalSubAgentRelationInsertSchema = createInsertSchema(subAgentRelations).extend({
3099
+ ExternalSubAgentRelationInsertSchema = createInsertSchema2(subAgentRelations).extend({
2950
3100
  id: resourceIdSchema,
2951
3101
  agentId: resourceIdSchema,
2952
3102
  sourceSubAgentId: resourceIdSchema,
@@ -2955,8 +3105,8 @@ var init_schemas = __esm({
2955
3105
  ExternalSubAgentRelationApiInsertSchema = createApiInsertSchema(
2956
3106
  ExternalSubAgentRelationInsertSchema
2957
3107
  );
2958
- AgentSelectSchema = createSelectSchema(agents);
2959
- AgentInsertSchema = createInsertSchema(agents).extend({
3108
+ AgentSelectSchema = createSelectSchema2(agents);
3109
+ AgentInsertSchema = createInsertSchema2(agents).extend({
2960
3110
  id: resourceIdSchema,
2961
3111
  name: z5.string().trim().nonempty()
2962
3112
  });
@@ -2966,8 +3116,8 @@ var init_schemas = __esm({
2966
3116
  id: resourceIdSchema
2967
3117
  }).openapi("AgentCreate");
2968
3118
  AgentApiUpdateSchema = createApiUpdateSchema(AgentUpdateSchema).openapi("AgentUpdate");
2969
- TaskSelectSchema = createSelectSchema(tasks);
2970
- TaskInsertSchema = createInsertSchema(tasks).extend({
3119
+ TaskSelectSchema = createSelectSchema2(tasks);
3120
+ TaskInsertSchema = createInsertSchema2(tasks).extend({
2971
3121
  id: resourceIdSchema,
2972
3122
  conversationId: resourceIdSchema.optional()
2973
3123
  });
@@ -2975,8 +3125,8 @@ var init_schemas = __esm({
2975
3125
  TaskApiSelectSchema = createApiSchema(TaskSelectSchema);
2976
3126
  TaskApiInsertSchema = createApiInsertSchema(TaskInsertSchema);
2977
3127
  TaskApiUpdateSchema = createApiUpdateSchema(TaskUpdateSchema);
2978
- TaskRelationSelectSchema = createSelectSchema(taskRelations);
2979
- TaskRelationInsertSchema = createInsertSchema(taskRelations).extend({
3128
+ TaskRelationSelectSchema = createSelectSchema2(taskRelations);
3129
+ TaskRelationInsertSchema = createInsertSchema2(taskRelations).extend({
2980
3130
  id: resourceIdSchema,
2981
3131
  parentTaskId: resourceIdSchema,
2982
3132
  childTaskId: resourceIdSchema
@@ -3020,8 +3170,8 @@ var init_schemas = __esm({
3020
3170
  description: z5.string().optional(),
3021
3171
  inputSchema: z5.record(z5.string(), z5.unknown()).optional()
3022
3172
  });
3023
- ToolSelectSchema = createSelectSchema(tools);
3024
- ToolInsertSchema = createInsertSchema(tools).extend({
3173
+ ToolSelectSchema = createSelectSchema2(tools);
3174
+ ToolInsertSchema = createInsertSchema2(tools).extend({
3025
3175
  id: resourceIdSchema,
3026
3176
  imageUrl: imageUrlSchema,
3027
3177
  config: z5.object({
@@ -3044,8 +3194,8 @@ var init_schemas = __esm({
3044
3194
  })
3045
3195
  })
3046
3196
  });
3047
- ConversationSelectSchema = createSelectSchema(conversations);
3048
- ConversationInsertSchema = createInsertSchema(conversations).extend({
3197
+ ConversationSelectSchema = createSelectSchema2(conversations);
3198
+ ConversationInsertSchema = createInsertSchema2(conversations).extend({
3049
3199
  id: resourceIdSchema,
3050
3200
  contextConfigId: resourceIdSchema.optional()
3051
3201
  });
@@ -3053,8 +3203,8 @@ var init_schemas = __esm({
3053
3203
  ConversationApiSelectSchema = createApiSchema(ConversationSelectSchema).openapi("Conversation");
3054
3204
  ConversationApiInsertSchema = createApiInsertSchema(ConversationInsertSchema).openapi("ConversationCreate");
3055
3205
  ConversationApiUpdateSchema = createApiUpdateSchema(ConversationUpdateSchema).openapi("ConversationUpdate");
3056
- MessageSelectSchema = createSelectSchema(messages);
3057
- MessageInsertSchema = createInsertSchema(messages).extend({
3206
+ MessageSelectSchema = createSelectSchema2(messages);
3207
+ MessageInsertSchema = createInsertSchema2(messages).extend({
3058
3208
  id: resourceIdSchema,
3059
3209
  conversationId: resourceIdSchema,
3060
3210
  taskId: resourceIdSchema.optional()
@@ -3063,14 +3213,14 @@ var init_schemas = __esm({
3063
3213
  MessageApiSelectSchema = createApiSchema(MessageSelectSchema).openapi("Message");
3064
3214
  MessageApiInsertSchema = createApiInsertSchema(MessageInsertSchema).openapi("MessageCreate");
3065
3215
  MessageApiUpdateSchema = createApiUpdateSchema(MessageUpdateSchema).openapi("MessageUpdate");
3066
- ContextCacheSelectSchema = createSelectSchema(contextCache);
3067
- ContextCacheInsertSchema = createInsertSchema(contextCache);
3216
+ ContextCacheSelectSchema = createSelectSchema2(contextCache);
3217
+ ContextCacheInsertSchema = createInsertSchema2(contextCache);
3068
3218
  ContextCacheUpdateSchema = ContextCacheInsertSchema.partial();
3069
3219
  ContextCacheApiSelectSchema = createApiSchema(ContextCacheSelectSchema);
3070
3220
  ContextCacheApiInsertSchema = createApiInsertSchema(ContextCacheInsertSchema);
3071
3221
  ContextCacheApiUpdateSchema = createApiUpdateSchema(ContextCacheUpdateSchema);
3072
- DataComponentSelectSchema = createSelectSchema(dataComponents);
3073
- DataComponentInsertSchema = createInsertSchema(dataComponents).extend({
3222
+ DataComponentSelectSchema = createSelectSchema2(dataComponents);
3223
+ DataComponentInsertSchema = createInsertSchema2(dataComponents).extend({
3074
3224
  id: resourceIdSchema
3075
3225
  });
3076
3226
  DataComponentBaseSchema = DataComponentInsertSchema.omit({
@@ -3081,8 +3231,8 @@ var init_schemas = __esm({
3081
3231
  DataComponentApiSelectSchema = createApiSchema(DataComponentSelectSchema).openapi("DataComponent");
3082
3232
  DataComponentApiInsertSchema = createApiInsertSchema(DataComponentInsertSchema).openapi("DataComponentCreate");
3083
3233
  DataComponentApiUpdateSchema = createApiUpdateSchema(DataComponentUpdateSchema).openapi("DataComponentUpdate");
3084
- SubAgentDataComponentSelectSchema = createSelectSchema(subAgentDataComponents);
3085
- SubAgentDataComponentInsertSchema = createInsertSchema(subAgentDataComponents);
3234
+ SubAgentDataComponentSelectSchema = createSelectSchema2(subAgentDataComponents);
3235
+ SubAgentDataComponentInsertSchema = createInsertSchema2(subAgentDataComponents);
3086
3236
  SubAgentDataComponentUpdateSchema = SubAgentDataComponentInsertSchema.partial();
3087
3237
  SubAgentDataComponentApiSelectSchema = createAgentScopedApiSchema(
3088
3238
  SubAgentDataComponentSelectSchema
@@ -3096,8 +3246,8 @@ var init_schemas = __esm({
3096
3246
  SubAgentDataComponentApiUpdateSchema = createAgentScopedApiUpdateSchema(
3097
3247
  SubAgentDataComponentUpdateSchema
3098
3248
  );
3099
- ArtifactComponentSelectSchema = createSelectSchema(artifactComponents);
3100
- ArtifactComponentInsertSchema = createInsertSchema(artifactComponents).extend({
3249
+ ArtifactComponentSelectSchema = createSelectSchema2(artifactComponents);
3250
+ ArtifactComponentInsertSchema = createInsertSchema2(artifactComponents).extend({
3101
3251
  id: resourceIdSchema
3102
3252
  });
3103
3253
  ArtifactComponentUpdateSchema = ArtifactComponentInsertSchema.partial();
@@ -3113,8 +3263,8 @@ var init_schemas = __esm({
3113
3263
  ArtifactComponentApiUpdateSchema = createApiUpdateSchema(
3114
3264
  ArtifactComponentUpdateSchema
3115
3265
  ).openapi("ArtifactComponentUpdate");
3116
- SubAgentArtifactComponentSelectSchema = createSelectSchema(subAgentArtifactComponents);
3117
- SubAgentArtifactComponentInsertSchema = createInsertSchema(
3266
+ SubAgentArtifactComponentSelectSchema = createSelectSchema2(subAgentArtifactComponents);
3267
+ SubAgentArtifactComponentInsertSchema = createInsertSchema2(
3118
3268
  subAgentArtifactComponents
3119
3269
  ).extend({
3120
3270
  id: resourceIdSchema,
@@ -3134,10 +3284,10 @@ var init_schemas = __esm({
3134
3284
  SubAgentArtifactComponentApiUpdateSchema = createAgentScopedApiUpdateSchema(
3135
3285
  SubAgentArtifactComponentUpdateSchema
3136
3286
  );
3137
- ExternalAgentSelectSchema = createSelectSchema(externalAgents).extend({
3287
+ ExternalAgentSelectSchema = createSelectSchema2(externalAgents).extend({
3138
3288
  credentialReferenceId: z5.string().nullable().optional()
3139
3289
  });
3140
- ExternalAgentInsertSchema = createInsertSchema(externalAgents).extend({
3290
+ ExternalAgentInsertSchema = createInsertSchema2(externalAgents).extend({
3141
3291
  id: resourceIdSchema
3142
3292
  });
3143
3293
  ExternalAgentUpdateSchema = ExternalAgentInsertSchema.partial();
@@ -3148,8 +3298,8 @@ var init_schemas = __esm({
3148
3298
  SubAgentApiSelectSchema.extend({ type: z5.literal("internal") }),
3149
3299
  ExternalAgentApiSelectSchema.extend({ type: z5.literal("external") })
3150
3300
  ]);
3151
- ApiKeySelectSchema = createSelectSchema(apiKeys);
3152
- ApiKeyInsertSchema = createInsertSchema(apiKeys).extend({
3301
+ ApiKeySelectSchema = createSelectSchema2(apiKeys);
3302
+ ApiKeyInsertSchema = createInsertSchema2(apiKeys).extend({
3153
3303
  id: resourceIdSchema,
3154
3304
  agentId: resourceIdSchema
3155
3305
  });
@@ -3200,7 +3350,7 @@ var init_schemas = __esm({
3200
3350
  createdAt: z5.string(),
3201
3351
  updatedAt: z5.string()
3202
3352
  });
3203
- CredentialReferenceInsertSchema = createInsertSchema(credentialReferences).extend({
3353
+ CredentialReferenceInsertSchema = createInsertSchema2(credentialReferences).extend({
3204
3354
  id: resourceIdSchema,
3205
3355
  type: z5.string(),
3206
3356
  credentialStoreId: resourceIdSchema,
@@ -3271,7 +3421,7 @@ var init_schemas = __esm({
3271
3421
  createdAt: z5.date(),
3272
3422
  updatedAt: z5.date(),
3273
3423
  expiresAt: z5.date().optional()
3274
- });
3424
+ }).openapi("McpTool");
3275
3425
  MCPToolConfigSchema = McpToolSchema.omit({
3276
3426
  config: true,
3277
3427
  tenantId: true,
@@ -3295,16 +3445,16 @@ var init_schemas = __esm({
3295
3445
  ToolApiSelectSchema = createApiSchema(ToolSelectSchema).openapi("Tool");
3296
3446
  ToolApiInsertSchema = createApiInsertSchema(ToolInsertSchema).openapi("ToolCreate");
3297
3447
  ToolApiUpdateSchema = createApiUpdateSchema(ToolUpdateSchema).openapi("ToolUpdate");
3298
- FunctionToolSelectSchema = createSelectSchema(functionTools);
3299
- FunctionToolInsertSchema = createInsertSchema(functionTools).extend({
3448
+ FunctionToolSelectSchema = createSelectSchema2(functionTools);
3449
+ FunctionToolInsertSchema = createInsertSchema2(functionTools).extend({
3300
3450
  id: resourceIdSchema
3301
3451
  });
3302
3452
  FunctionToolUpdateSchema = FunctionToolInsertSchema.partial();
3303
3453
  FunctionToolApiSelectSchema = createApiSchema(FunctionToolSelectSchema).openapi("FunctionTool");
3304
3454
  FunctionToolApiInsertSchema = createAgentScopedApiInsertSchema(FunctionToolInsertSchema).openapi("FunctionToolCreate");
3305
3455
  FunctionToolApiUpdateSchema = createApiUpdateSchema(FunctionToolUpdateSchema).openapi("FunctionToolUpdate");
3306
- FunctionSelectSchema = createSelectSchema(functions);
3307
- FunctionInsertSchema = createInsertSchema(functions).extend({
3456
+ FunctionSelectSchema = createSelectSchema2(functions);
3457
+ FunctionInsertSchema = createInsertSchema2(functions).extend({
3308
3458
  id: resourceIdSchema
3309
3459
  });
3310
3460
  FunctionUpdateSchema = FunctionInsertSchema.partial();
@@ -3332,13 +3482,13 @@ var init_schemas = __esm({
3332
3482
  }),
3333
3483
  credential: CredentialReferenceApiInsertSchema.optional()
3334
3484
  }).openapi("FetchDefinition");
3335
- ContextConfigSelectSchema = createSelectSchema(contextConfigs).extend({
3485
+ ContextConfigSelectSchema = createSelectSchema2(contextConfigs).extend({
3336
3486
  headersSchema: z5.any().optional().openapi({
3337
3487
  type: "object",
3338
3488
  description: "JSON Schema for validating request headers"
3339
3489
  })
3340
3490
  });
3341
- ContextConfigInsertSchema = createInsertSchema(contextConfigs).extend({
3491
+ ContextConfigInsertSchema = createInsertSchema2(contextConfigs).extend({
3342
3492
  id: resourceIdSchema.optional(),
3343
3493
  headersSchema: z5.any().nullable().optional().openapi({
3344
3494
  type: "object",
@@ -3362,8 +3512,8 @@ var init_schemas = __esm({
3362
3512
  ContextConfigApiUpdateSchema = createApiUpdateSchema(ContextConfigUpdateSchema).omit({
3363
3513
  agentId: true
3364
3514
  }).openapi("ContextConfigUpdate");
3365
- SubAgentToolRelationSelectSchema = createSelectSchema(subAgentToolRelations);
3366
- SubAgentToolRelationInsertSchema = createInsertSchema(subAgentToolRelations).extend({
3515
+ SubAgentToolRelationSelectSchema = createSelectSchema2(subAgentToolRelations);
3516
+ SubAgentToolRelationInsertSchema = createInsertSchema2(subAgentToolRelations).extend({
3367
3517
  id: resourceIdSchema,
3368
3518
  subAgentId: resourceIdSchema,
3369
3519
  toolId: resourceIdSchema,
@@ -3380,10 +3530,10 @@ var init_schemas = __esm({
3380
3530
  SubAgentToolRelationApiUpdateSchema = createAgentScopedApiUpdateSchema(
3381
3531
  SubAgentToolRelationUpdateSchema
3382
3532
  ).openapi("SubAgentToolRelationUpdate");
3383
- SubAgentExternalAgentRelationSelectSchema = createSelectSchema(
3533
+ SubAgentExternalAgentRelationSelectSchema = createSelectSchema2(
3384
3534
  subAgentExternalAgentRelations
3385
3535
  );
3386
- SubAgentExternalAgentRelationInsertSchema = createInsertSchema(
3536
+ SubAgentExternalAgentRelationInsertSchema = createInsertSchema2(
3387
3537
  subAgentExternalAgentRelations
3388
3538
  ).extend({
3389
3539
  id: resourceIdSchema,
@@ -3401,8 +3551,8 @@ var init_schemas = __esm({
3401
3551
  SubAgentExternalAgentRelationApiUpdateSchema = createAgentScopedApiUpdateSchema(
3402
3552
  SubAgentExternalAgentRelationUpdateSchema
3403
3553
  ).openapi("SubAgentExternalAgentRelationUpdate");
3404
- SubAgentTeamAgentRelationSelectSchema = createSelectSchema(subAgentTeamAgentRelations);
3405
- SubAgentTeamAgentRelationInsertSchema = createInsertSchema(
3554
+ SubAgentTeamAgentRelationSelectSchema = createSelectSchema2(subAgentTeamAgentRelations);
3555
+ SubAgentTeamAgentRelationInsertSchema = createInsertSchema2(
3406
3556
  subAgentTeamAgentRelations
3407
3557
  ).extend({
3408
3558
  id: resourceIdSchema,
@@ -3420,8 +3570,8 @@ var init_schemas = __esm({
3420
3570
  SubAgentTeamAgentRelationApiUpdateSchema = createAgentScopedApiUpdateSchema(
3421
3571
  SubAgentTeamAgentRelationUpdateSchema
3422
3572
  ).openapi("SubAgentTeamAgentRelationUpdate");
3423
- LedgerArtifactSelectSchema = createSelectSchema(ledgerArtifacts);
3424
- LedgerArtifactInsertSchema = createInsertSchema(ledgerArtifacts);
3573
+ LedgerArtifactSelectSchema = createSelectSchema2(ledgerArtifacts);
3574
+ LedgerArtifactInsertSchema = createInsertSchema2(ledgerArtifacts);
3425
3575
  LedgerArtifactUpdateSchema = LedgerArtifactInsertSchema.partial();
3426
3576
  LedgerArtifactApiSelectSchema = createApiSchema(LedgerArtifactSelectSchema);
3427
3577
  LedgerArtifactApiInsertSchema = createApiInsertSchema(LedgerArtifactInsertSchema);
@@ -3455,17 +3605,17 @@ var init_schemas = __esm({
3455
3605
  externalAgentId: z5.string(),
3456
3606
  subAgentExternalAgentRelationId: z5.string().optional(),
3457
3607
  headers: z5.record(z5.string(), z5.string()).nullish()
3458
- });
3608
+ }).openapi("CanDelegateToExternalAgent");
3459
3609
  canDelegateToTeamAgentSchema = z5.object({
3460
3610
  agentId: z5.string(),
3461
3611
  subAgentTeamAgentRelationId: z5.string().optional(),
3462
3612
  headers: z5.record(z5.string(), z5.string()).nullish()
3463
- });
3613
+ }).openapi("CanDelegateToTeamAgent");
3464
3614
  TeamAgentSchema = z5.object({
3465
3615
  id: z5.string(),
3466
3616
  name: z5.string(),
3467
3617
  description: z5.string()
3468
- });
3618
+ }).openapi("TeamAgent");
3469
3619
  FullAgentAgentInsertSchema = SubAgentApiInsertSchema.extend({
3470
3620
  type: z5.literal("internal"),
3471
3621
  canUse: z5.array(CanUseItemSchema),
@@ -3484,7 +3634,7 @@ var init_schemas = __esm({
3484
3634
  // Team agent with headers
3485
3635
  ])
3486
3636
  ).optional()
3487
- });
3637
+ }).openapi("FullAgentAgentInsert");
3488
3638
  AgentWithinContextOfProjectSchema = AgentApiInsertSchema.extend({
3489
3639
  subAgents: z5.record(z5.string(), FullAgentAgentInsertSchema),
3490
3640
  // Lookup maps for UI to resolve canUse items
@@ -3506,10 +3656,10 @@ var init_schemas = __esm({
3506
3656
  VALIDATION_AGENT_PROMPT_MAX_CHARS2,
3507
3657
  `Agent prompt cannot exceed ${VALIDATION_AGENT_PROMPT_MAX_CHARS2} characters`
3508
3658
  ).optional()
3509
- });
3659
+ }).openapi("AgentWithinContextOfProject");
3510
3660
  PaginationSchema = z5.object({
3511
- page: z5.coerce.number().min(1).default(1),
3512
- limit: z5.coerce.number().min(1).max(100).default(10),
3661
+ page: pageNumber,
3662
+ limit: limitNumber,
3513
3663
  total: z5.number(),
3514
3664
  pages: z5.number()
3515
3665
  }).openapi("Pagination");
@@ -3527,24 +3677,30 @@ var init_schemas = __esm({
3527
3677
  message: z5.string(),
3528
3678
  removed: z5.boolean()
3529
3679
  }).openapi("RemovedResponse");
3530
- ProjectSelectSchema = createSelectSchema(projects);
3531
- ProjectInsertSchema = createInsertSchema(projects).extend({
3680
+ ProjectSelectSchema = registerFieldSchemas(
3681
+ createSelectSchema2(projects).extend({
3682
+ models: ProjectModelSchema.nullable(),
3683
+ stopWhen: StopWhenSchema.nullable()
3684
+ })
3685
+ );
3686
+ ProjectInsertSchema = createInsertSchema2(projects).extend({
3532
3687
  models: ProjectModelSchema,
3533
3688
  stopWhen: StopWhenSchema.optional()
3534
3689
  }).omit({
3535
3690
  createdAt: true,
3536
3691
  updatedAt: true
3537
3692
  });
3538
- ProjectUpdateSchema = ProjectInsertSchema.partial();
3693
+ ProjectUpdateSchema = ProjectInsertSchema.partial().omit({
3694
+ id: true,
3695
+ tenantId: true
3696
+ });
3539
3697
  ProjectApiSelectSchema = ProjectSelectSchema.omit({ tenantId: true }).openapi(
3540
3698
  "Project"
3541
3699
  );
3542
3700
  ProjectApiInsertSchema = ProjectInsertSchema.omit({ tenantId: true }).openapi(
3543
3701
  "ProjectCreate"
3544
3702
  );
3545
- ProjectApiUpdateSchema = ProjectUpdateSchema.omit({ tenantId: true }).openapi(
3546
- "ProjectUpdate"
3547
- );
3703
+ ProjectApiUpdateSchema = ProjectUpdateSchema.openapi("ProjectUpdate");
3548
3704
  FullProjectDefinitionSchema = ProjectApiInsertSchema.extend({
3549
3705
  agents: z5.record(z5.string(), AgentWithinContextOfProjectSchema),
3550
3706
  tools: z5.record(z5.string(), ToolApiInsertSchema),
@@ -3557,7 +3713,7 @@ var init_schemas = __esm({
3557
3713
  credentialReferences: z5.record(z5.string(), CredentialReferenceApiInsertSchema).optional(),
3558
3714
  createdAt: z5.string().optional(),
3559
3715
  updatedAt: z5.string().optional()
3560
- });
3716
+ }).openapi("FullProjectDefinition");
3561
3717
  ProjectResponse = z5.object({ data: ProjectApiSelectSchema }).openapi("ProjectResponse");
3562
3718
  SubAgentResponse = z5.object({ data: SubAgentApiSelectSchema }).openapi("SubAgentResponse");
3563
3719
  AgentResponse = z5.object({ data: AgentApiSelectSchema }).openapi("AgentResponse");
@@ -3648,6 +3804,30 @@ var init_schemas = __esm({
3648
3804
  data: z5.array(SubAgentArtifactComponentApiSelectSchema),
3649
3805
  pagination: PaginationSchema
3650
3806
  }).openapi("SubAgentArtifactComponentListResponse");
3807
+ FullProjectDefinitionResponse = z5.object({ data: FullProjectDefinitionSchema }).openapi("FullProjectDefinitionResponse");
3808
+ AgentWithinContextOfProjectResponse = z5.object({ data: AgentWithinContextOfProjectSchema }).openapi("AgentWithinContextOfProjectResponse");
3809
+ RelatedAgentInfoListResponse = z5.object({
3810
+ data: z5.array(RelatedAgentInfoSchema),
3811
+ pagination: PaginationSchema
3812
+ }).openapi("RelatedAgentInfoListResponse");
3813
+ ComponentAssociationListResponse = z5.object({ data: z5.array(ComponentAssociationSchema) }).openapi("ComponentAssociationListResponse");
3814
+ McpToolResponse = z5.object({ data: McpToolSchema }).openapi("McpToolResponse");
3815
+ McpToolListResponse = z5.object({
3816
+ data: z5.array(McpToolSchema),
3817
+ pagination: PaginationSchema
3818
+ }).openapi("McpToolListResponse");
3819
+ SubAgentTeamAgentRelationResponse = z5.object({ data: SubAgentTeamAgentRelationApiSelectSchema }).openapi("SubAgentTeamAgentRelationResponse");
3820
+ SubAgentTeamAgentRelationListResponse = z5.object({
3821
+ data: z5.array(SubAgentTeamAgentRelationApiSelectSchema),
3822
+ pagination: PaginationSchema
3823
+ }).openapi("SubAgentTeamAgentRelationListResponse");
3824
+ SubAgentExternalAgentRelationResponse = z5.object({ data: SubAgentExternalAgentRelationApiSelectSchema }).openapi("SubAgentExternalAgentRelationResponse");
3825
+ SubAgentExternalAgentRelationListResponse = z5.object({
3826
+ data: z5.array(SubAgentExternalAgentRelationApiSelectSchema),
3827
+ pagination: PaginationSchema
3828
+ }).openapi("SubAgentExternalAgentRelationListResponse");
3829
+ DataComponentArrayResponse = z5.object({ data: z5.array(DataComponentApiSelectSchema) }).openapi("DataComponentArrayResponse");
3830
+ ArtifactComponentArrayResponse = z5.object({ data: z5.array(ArtifactComponentApiSelectSchema) }).openapi("ArtifactComponentArrayResponse");
3651
3831
  HeadersScopeSchema = z5.object({
3652
3832
  "x-inkeep-tenant-id": z5.string().optional().openapi({
3653
3833
  description: "Tenant identifier",
@@ -3662,50 +3842,66 @@ var init_schemas = __esm({
3662
3842
  example: "agent_789"
3663
3843
  })
3664
3844
  });
3665
- TenantId = z5.string().openapi({
3845
+ TenantId = z5.string().openapi("TenantIdPathParam", {
3846
+ param: {
3847
+ name: "tenantId",
3848
+ in: "path"
3849
+ },
3666
3850
  description: "Tenant identifier",
3667
3851
  example: "tenant_123"
3668
3852
  });
3669
- ProjectId = z5.string().openapi({
3853
+ ProjectId = z5.string().openapi("ProjectIdPathParam", {
3854
+ param: {
3855
+ name: "projectId",
3856
+ in: "path"
3857
+ },
3670
3858
  description: "Project identifier",
3671
3859
  example: "project_456"
3672
3860
  });
3673
- AgentId = z5.string().openapi({
3861
+ AgentId = z5.string().openapi("AgentIdPathParam", {
3862
+ param: {
3863
+ name: "agentId",
3864
+ in: "path"
3865
+ },
3674
3866
  description: "Agent identifier",
3675
3867
  example: "agent_789"
3676
3868
  });
3677
- SubAgentId = z5.string().openapi({
3869
+ SubAgentId = z5.string().openapi("SubAgentIdPathParam", {
3870
+ param: {
3871
+ name: "subAgentId",
3872
+ in: "path"
3873
+ },
3678
3874
  description: "Sub-agent identifier",
3679
3875
  example: "sub_agent_123"
3680
3876
  });
3681
3877
  TenantParamsSchema = z5.object({
3682
3878
  tenantId: TenantId
3683
- }).openapi("TenantParams");
3879
+ });
3684
3880
  TenantIdParamsSchema = TenantParamsSchema.extend({
3685
3881
  id: resourceIdSchema
3686
- }).openapi("TenantIdParams");
3882
+ });
3687
3883
  TenantProjectParamsSchema = TenantParamsSchema.extend({
3688
3884
  projectId: ProjectId
3689
- }).openapi("TenantProjectParams");
3885
+ });
3690
3886
  TenantProjectIdParamsSchema = TenantProjectParamsSchema.extend({
3691
3887
  id: resourceIdSchema
3692
- }).openapi("TenantProjectIdParams");
3888
+ });
3693
3889
  TenantProjectAgentParamsSchema = TenantProjectParamsSchema.extend({
3694
3890
  agentId: AgentId
3695
- }).openapi("TenantProjectAgentParams");
3891
+ });
3696
3892
  TenantProjectAgentIdParamsSchema = TenantProjectAgentParamsSchema.extend({
3697
3893
  id: resourceIdSchema
3698
- }).openapi("TenantProjectAgentIdParams");
3894
+ });
3699
3895
  TenantProjectAgentSubAgentParamsSchema = TenantProjectAgentParamsSchema.extend({
3700
3896
  subAgentId: SubAgentId
3701
- }).openapi("TenantProjectAgentSubAgentParams");
3897
+ });
3702
3898
  TenantProjectAgentSubAgentIdParamsSchema = TenantProjectAgentSubAgentParamsSchema.extend({
3703
3899
  id: resourceIdSchema
3704
- }).openapi("TenantProjectAgentSubAgentIdParams");
3705
- PaginationQueryParamsSchema = z5.object({
3706
- page: z5.coerce.number().min(1).default(1),
3707
- limit: z5.coerce.number().min(1).max(100).default(10)
3708
3900
  });
3901
+ PaginationQueryParamsSchema = z5.object({
3902
+ page: pageNumber,
3903
+ limit: limitNumber
3904
+ }).openapi("PaginationQueryParams");
3709
3905
  }
3710
3906
  });
3711
3907
 
@@ -234423,7 +234619,7 @@ var init_id_validation = __esm({
234423
234619
  "../packages/agents-core/src/validation/id-validation.ts"() {
234424
234620
  "use strict";
234425
234621
  init_esm_shims();
234426
- init_schemas();
234622
+ init_drizzle_schema_helpers();
234427
234623
  }
234428
234624
  });
234429
234625
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inkeep/agents-cli",
3
- "version": "0.32.1",
3
+ "version": "0.32.2",
4
4
  "description": "Inkeep CLI tool",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -49,8 +49,8 @@
49
49
  "ts-morph": "^26.0.0",
50
50
  "tsx": "^4.20.5",
51
51
  "open": "^10.2.0",
52
- "@inkeep/agents-core": "^0.32.1",
53
- "@inkeep/agents-sdk": "^0.32.1"
52
+ "@inkeep/agents-core": "^0.32.2",
53
+ "@inkeep/agents-sdk": "^0.32.2"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@types/degit": "^2.8.6",