@inkeep/agents-cli 0.0.0-dev-20251012022558 → 0.0.0-dev-20251012045242
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.js +334 -373
- package/package.json +6 -5
package/dist/index.js
CHANGED
|
@@ -1577,7 +1577,7 @@ import {
|
|
|
1577
1577
|
text,
|
|
1578
1578
|
unique
|
|
1579
1579
|
} from "drizzle-orm/sqlite-core";
|
|
1580
|
-
var tenantScoped, projectScoped,
|
|
1580
|
+
var tenantScoped, projectScoped, agentScoped, subAgentScoped, uiProperties, timestamps, projects, agents, contextConfigs, contextCache, subAgents, subAgentRelations, externalAgents, tasks, taskRelations, dataComponents, subAgentDataComponents, artifactComponents, subAgentArtifactComponents, tools, functionTools, functions, subAgentToolRelations, agentFunctionToolRelations, conversations, messages, ledgerArtifacts, apiKeys, credentialReferences, tasksRelations, projectsRelations, taskRelationsRelations, contextConfigsRelations, contextCacheRelations, subAgentsRelations, agentRelations, externalAgentsRelations, apiKeysRelations, agentToolRelationsRelations, credentialReferencesRelations, toolsRelations, conversationsRelations, messagesRelations, artifactComponentsRelations, subAgentArtifactComponentsRelations, dataComponentsRelations, subAgentDataComponentsRelations, ledgerArtifactsRelations, functionsRelations, subAgentRelationsRelations, functionToolsRelations, agentFunctionToolRelationsRelations;
|
|
1581
1581
|
var init_schema = __esm({
|
|
1582
1582
|
"../packages/agents-core/src/db/schema.ts"() {
|
|
1583
1583
|
"use strict";
|
|
@@ -1590,12 +1590,12 @@ var init_schema = __esm({
|
|
|
1590
1590
|
...tenantScoped,
|
|
1591
1591
|
projectId: text("project_id").notNull()
|
|
1592
1592
|
};
|
|
1593
|
-
|
|
1593
|
+
agentScoped = {
|
|
1594
1594
|
...projectScoped,
|
|
1595
|
-
|
|
1595
|
+
agentId: text("agent_id").notNull()
|
|
1596
1596
|
};
|
|
1597
1597
|
subAgentScoped = {
|
|
1598
|
-
...
|
|
1598
|
+
...agentScoped,
|
|
1599
1599
|
subAgentId: text("sub_agent_id").notNull()
|
|
1600
1600
|
};
|
|
1601
1601
|
uiProperties = {
|
|
@@ -1611,9 +1611,9 @@ var init_schema = __esm({
|
|
|
1611
1611
|
{
|
|
1612
1612
|
...tenantScoped,
|
|
1613
1613
|
...uiProperties,
|
|
1614
|
-
// Project-level default model settings that can be inherited by
|
|
1614
|
+
// Project-level default model settings that can be inherited by agents
|
|
1615
1615
|
models: text("models", { mode: "json" }).$type(),
|
|
1616
|
-
// Project-level stopWhen configuration that can be inherited by
|
|
1616
|
+
// Project-level stopWhen configuration that can be inherited by agents
|
|
1617
1617
|
stopWhen: text("stop_when", { mode: "json" }).$type(),
|
|
1618
1618
|
// Project-level sandbox configuration for function execution
|
|
1619
1619
|
sandboxConfig: text("sandbox_config", { mode: "json" }).$type(),
|
|
@@ -1621,23 +1621,17 @@ var init_schema = __esm({
|
|
|
1621
1621
|
},
|
|
1622
1622
|
(table) => [primaryKey({ columns: [table.tenantId, table.id] })]
|
|
1623
1623
|
);
|
|
1624
|
-
|
|
1625
|
-
"
|
|
1624
|
+
agents = sqliteTable(
|
|
1625
|
+
"agent",
|
|
1626
1626
|
{
|
|
1627
1627
|
...projectScoped,
|
|
1628
1628
|
name: text("name").notNull(),
|
|
1629
1629
|
description: text("description"),
|
|
1630
1630
|
defaultSubAgentId: text("default_sub_agent_id"),
|
|
1631
|
-
// Reference to shared context configuration for all agents in this graph
|
|
1632
1631
|
contextConfigId: text("context_config_id"),
|
|
1633
|
-
// add fk relationship
|
|
1634
|
-
// Graph-level model settingsuration that can be inherited by agents
|
|
1635
1632
|
models: text("models", { mode: "json" }).$type(),
|
|
1636
|
-
// Status updates configuration for intelligent progress summaries
|
|
1637
1633
|
statusUpdates: text("status_updates", { mode: "json" }).$type(),
|
|
1638
|
-
|
|
1639
|
-
graphPrompt: text("graph_prompt"),
|
|
1640
|
-
// Graph-level stopWhen configuration that can be inherited by agents
|
|
1634
|
+
prompt: text("prompt"),
|
|
1641
1635
|
stopWhen: text("stop_when", { mode: "json" }).$type(),
|
|
1642
1636
|
...timestamps
|
|
1643
1637
|
},
|
|
@@ -1646,27 +1640,26 @@ var init_schema = __esm({
|
|
|
1646
1640
|
foreignKey({
|
|
1647
1641
|
columns: [table.tenantId, table.projectId],
|
|
1648
1642
|
foreignColumns: [projects.tenantId, projects.id],
|
|
1649
|
-
name: "
|
|
1643
|
+
name: "agent_project_fk"
|
|
1650
1644
|
}).onDelete("cascade")
|
|
1651
1645
|
]
|
|
1652
1646
|
);
|
|
1653
1647
|
contextConfigs = sqliteTable(
|
|
1654
1648
|
"context_configs",
|
|
1655
1649
|
{
|
|
1656
|
-
...
|
|
1650
|
+
...agentScoped,
|
|
1657
1651
|
// Developer-defined Zod schema for validating incoming request context
|
|
1658
1652
|
headersSchema: blob("headers_schema", { mode: "json" }).$type(),
|
|
1659
|
-
// Stores serialized Zod schema
|
|
1660
1653
|
// Object mapping template keys to fetch definitions that use request context data
|
|
1661
1654
|
contextVariables: blob("context_variables", { mode: "json" }).$type(),
|
|
1662
1655
|
...timestamps
|
|
1663
1656
|
},
|
|
1664
1657
|
(table) => [
|
|
1665
|
-
primaryKey({ columns: [table.tenantId, table.projectId, table.
|
|
1658
|
+
primaryKey({ columns: [table.tenantId, table.projectId, table.agentId, table.id] }),
|
|
1666
1659
|
foreignKey({
|
|
1667
|
-
columns: [table.tenantId, table.projectId, table.
|
|
1668
|
-
foreignColumns: [
|
|
1669
|
-
name: "
|
|
1660
|
+
columns: [table.tenantId, table.projectId, table.agentId],
|
|
1661
|
+
foreignColumns: [agents.tenantId, agents.projectId, agents.id],
|
|
1662
|
+
name: "context_configs_agent_fk"
|
|
1670
1663
|
}).onDelete("cascade")
|
|
1671
1664
|
]
|
|
1672
1665
|
);
|
|
@@ -1679,16 +1672,12 @@ var init_schema = __esm({
|
|
|
1679
1672
|
// Reference to the context config and specific fetch definition
|
|
1680
1673
|
contextConfigId: text("context_config_id").notNull(),
|
|
1681
1674
|
contextVariableKey: text("context_variable_key").notNull(),
|
|
1682
|
-
// Key from contextVariables object
|
|
1683
|
-
// The actual cached context data
|
|
1684
1675
|
value: blob("value", { mode: "json" }).$type().notNull(),
|
|
1685
1676
|
// Request hash for cache invalidation based on context changes
|
|
1686
1677
|
requestHash: text("request_hash"),
|
|
1687
|
-
// Hash of request context that triggered this cache
|
|
1688
1678
|
// Metadata for monitoring and debugging
|
|
1689
1679
|
fetchedAt: text("fetched_at").notNull(),
|
|
1690
1680
|
fetchSource: text("fetch_source"),
|
|
1691
|
-
// URL or source identifier
|
|
1692
1681
|
fetchDurationMs: integer("fetch_duration_ms"),
|
|
1693
1682
|
...timestamps
|
|
1694
1683
|
},
|
|
@@ -1709,30 +1698,29 @@ var init_schema = __esm({
|
|
|
1709
1698
|
subAgents = sqliteTable(
|
|
1710
1699
|
"sub_agents",
|
|
1711
1700
|
{
|
|
1712
|
-
...
|
|
1701
|
+
...agentScoped,
|
|
1713
1702
|
...uiProperties,
|
|
1714
1703
|
prompt: text("prompt").notNull(),
|
|
1715
1704
|
conversationHistoryConfig: text("conversation_history_config", {
|
|
1716
1705
|
mode: "json"
|
|
1717
1706
|
}).$type(),
|
|
1718
1707
|
models: text("models", { mode: "json" }).$type(),
|
|
1719
|
-
// Agent-level stopWhen configuration (inherited from project)
|
|
1720
1708
|
stopWhen: text("stop_when", { mode: "json" }).$type(),
|
|
1721
1709
|
...timestamps
|
|
1722
1710
|
},
|
|
1723
1711
|
(table) => [
|
|
1724
|
-
primaryKey({ columns: [table.tenantId, table.projectId, table.
|
|
1712
|
+
primaryKey({ columns: [table.tenantId, table.projectId, table.agentId, table.id] }),
|
|
1725
1713
|
foreignKey({
|
|
1726
|
-
columns: [table.tenantId, table.projectId, table.
|
|
1727
|
-
foreignColumns: [
|
|
1728
|
-
name: "
|
|
1714
|
+
columns: [table.tenantId, table.projectId, table.agentId],
|
|
1715
|
+
foreignColumns: [agents.tenantId, agents.projectId, agents.id],
|
|
1716
|
+
name: "sub_agents_agents_fk"
|
|
1729
1717
|
}).onDelete("cascade")
|
|
1730
1718
|
]
|
|
1731
1719
|
);
|
|
1732
1720
|
subAgentRelations = sqliteTable(
|
|
1733
1721
|
"sub_agent_relations",
|
|
1734
1722
|
{
|
|
1735
|
-
...
|
|
1723
|
+
...agentScoped,
|
|
1736
1724
|
sourceSubAgentId: text("source_sub_agent_id").notNull(),
|
|
1737
1725
|
// For internal relationships
|
|
1738
1726
|
targetSubAgentId: text("target_sub_agent_id"),
|
|
@@ -1742,31 +1730,30 @@ var init_schema = __esm({
|
|
|
1742
1730
|
...timestamps
|
|
1743
1731
|
},
|
|
1744
1732
|
(table) => [
|
|
1745
|
-
primaryKey({ columns: [table.tenantId, table.projectId, table.
|
|
1733
|
+
primaryKey({ columns: [table.tenantId, table.projectId, table.agentId, table.id] }),
|
|
1746
1734
|
foreignKey({
|
|
1747
|
-
columns: [table.tenantId, table.projectId, table.
|
|
1748
|
-
foreignColumns: [
|
|
1749
|
-
name: "
|
|
1735
|
+
columns: [table.tenantId, table.projectId, table.agentId],
|
|
1736
|
+
foreignColumns: [agents.tenantId, agents.projectId, agents.id],
|
|
1737
|
+
name: "sub_agent_relations_agent_fk"
|
|
1750
1738
|
}).onDelete("cascade")
|
|
1751
1739
|
]
|
|
1752
1740
|
);
|
|
1753
1741
|
externalAgents = sqliteTable(
|
|
1754
1742
|
"external_agents",
|
|
1755
1743
|
{
|
|
1756
|
-
...
|
|
1744
|
+
...agentScoped,
|
|
1757
1745
|
...uiProperties,
|
|
1758
1746
|
baseUrl: text("base_url").notNull(),
|
|
1759
|
-
// A2A endpoint URL
|
|
1760
1747
|
credentialReferenceId: text("credential_reference_id"),
|
|
1761
1748
|
headers: blob("headers", { mode: "json" }).$type(),
|
|
1762
1749
|
...timestamps
|
|
1763
1750
|
},
|
|
1764
1751
|
(table) => [
|
|
1765
|
-
primaryKey({ columns: [table.tenantId, table.projectId, table.
|
|
1752
|
+
primaryKey({ columns: [table.tenantId, table.projectId, table.agentId, table.id] }),
|
|
1766
1753
|
foreignKey({
|
|
1767
|
-
columns: [table.tenantId, table.projectId, table.
|
|
1768
|
-
foreignColumns: [
|
|
1769
|
-
name: "
|
|
1754
|
+
columns: [table.tenantId, table.projectId, table.agentId],
|
|
1755
|
+
foreignColumns: [agents.tenantId, agents.projectId, agents.id],
|
|
1756
|
+
name: "external_agents_agent_fk"
|
|
1770
1757
|
}).onDelete("cascade"),
|
|
1771
1758
|
foreignKey({
|
|
1772
1759
|
columns: [table.tenantId, table.projectId, table.credentialReferenceId],
|
|
@@ -1791,8 +1778,8 @@ var init_schema = __esm({
|
|
|
1791
1778
|
(table) => [
|
|
1792
1779
|
primaryKey({ columns: [table.tenantId, table.projectId, table.id] }),
|
|
1793
1780
|
foreignKey({
|
|
1794
|
-
columns: [table.tenantId, table.projectId, table.
|
|
1795
|
-
foreignColumns: [subAgents.tenantId, subAgents.projectId, subAgents.
|
|
1781
|
+
columns: [table.tenantId, table.projectId, table.agentId, table.subAgentId],
|
|
1782
|
+
foreignColumns: [subAgents.tenantId, subAgents.projectId, subAgents.agentId, subAgents.id],
|
|
1796
1783
|
name: "tasks_sub_agent_fk"
|
|
1797
1784
|
}).onDelete("cascade")
|
|
1798
1785
|
]
|
|
@@ -1804,7 +1791,6 @@ var init_schema = __esm({
|
|
|
1804
1791
|
parentTaskId: text("parent_task_id").notNull(),
|
|
1805
1792
|
childTaskId: text("child_task_id").notNull(),
|
|
1806
1793
|
relationType: text("relation_type").default("parent_child"),
|
|
1807
|
-
// Could be extended for other relation types
|
|
1808
1794
|
...timestamps
|
|
1809
1795
|
},
|
|
1810
1796
|
(table) => [
|
|
@@ -1842,13 +1828,11 @@ var init_schema = __esm({
|
|
|
1842
1828
|
},
|
|
1843
1829
|
(table) => [
|
|
1844
1830
|
primaryKey({ columns: [table.tenantId, table.projectId, table.id] }),
|
|
1845
|
-
// Foreign key constraint to agents table (ensures graph and project exist via cascade)
|
|
1846
1831
|
foreignKey({
|
|
1847
|
-
columns: [table.tenantId, table.projectId, table.
|
|
1848
|
-
foreignColumns: [subAgents.tenantId, subAgents.projectId, subAgents.
|
|
1832
|
+
columns: [table.tenantId, table.projectId, table.agentId, table.subAgentId],
|
|
1833
|
+
foreignColumns: [subAgents.tenantId, subAgents.projectId, subAgents.agentId, subAgents.id],
|
|
1849
1834
|
name: "sub_agent_data_components_sub_agent_fk"
|
|
1850
1835
|
}).onDelete("cascade"),
|
|
1851
|
-
// Foreign key constraint to data_components table
|
|
1852
1836
|
foreignKey({
|
|
1853
1837
|
columns: [table.tenantId, table.projectId, table.dataComponentId],
|
|
1854
1838
|
foreignColumns: [dataComponents.tenantId, dataComponents.projectId, dataComponents.id],
|
|
@@ -1882,15 +1866,13 @@ var init_schema = __esm({
|
|
|
1882
1866
|
},
|
|
1883
1867
|
(table) => [
|
|
1884
1868
|
primaryKey({
|
|
1885
|
-
columns: [table.tenantId, table.projectId, table.
|
|
1869
|
+
columns: [table.tenantId, table.projectId, table.agentId, table.subAgentId, table.id]
|
|
1886
1870
|
}),
|
|
1887
|
-
// Foreign key constraint to agents table (ensures graph and project exist via cascade)
|
|
1888
1871
|
foreignKey({
|
|
1889
|
-
columns: [table.tenantId, table.projectId, table.
|
|
1890
|
-
foreignColumns: [subAgents.tenantId, subAgents.projectId, subAgents.
|
|
1872
|
+
columns: [table.tenantId, table.projectId, table.agentId, table.subAgentId],
|
|
1873
|
+
foreignColumns: [subAgents.tenantId, subAgents.projectId, subAgents.agentId, subAgents.id],
|
|
1891
1874
|
name: "sub_agent_artifact_components_sub_agent_fk"
|
|
1892
1875
|
}).onDelete("cascade"),
|
|
1893
|
-
// Foreign key constraint to artifact_components table
|
|
1894
1876
|
foreignKey({
|
|
1895
1877
|
columns: [table.tenantId, table.projectId, table.artifactComponentId],
|
|
1896
1878
|
foreignColumns: [
|
|
@@ -1930,18 +1912,18 @@ var init_schema = __esm({
|
|
|
1930
1912
|
functionTools = sqliteTable(
|
|
1931
1913
|
"function_tools",
|
|
1932
1914
|
{
|
|
1933
|
-
...
|
|
1915
|
+
...agentScoped,
|
|
1934
1916
|
name: text("name").notNull(),
|
|
1935
1917
|
description: text("description"),
|
|
1936
1918
|
functionId: text("function_id").notNull(),
|
|
1937
1919
|
...timestamps
|
|
1938
1920
|
},
|
|
1939
1921
|
(table) => [
|
|
1940
|
-
primaryKey({ columns: [table.tenantId, table.projectId, table.
|
|
1922
|
+
primaryKey({ columns: [table.tenantId, table.projectId, table.agentId, table.id] }),
|
|
1941
1923
|
foreignKey({
|
|
1942
|
-
columns: [table.tenantId, table.projectId, table.
|
|
1943
|
-
foreignColumns: [
|
|
1944
|
-
name: "
|
|
1924
|
+
columns: [table.tenantId, table.projectId, table.agentId],
|
|
1925
|
+
foreignColumns: [agents.tenantId, agents.projectId, agents.id],
|
|
1926
|
+
name: "function_tools_agent_fk"
|
|
1945
1927
|
}).onDelete("cascade"),
|
|
1946
1928
|
// Foreign key constraint to functions table
|
|
1947
1929
|
foreignKey({
|
|
@@ -1979,14 +1961,12 @@ var init_schema = __esm({
|
|
|
1979
1961
|
...timestamps
|
|
1980
1962
|
},
|
|
1981
1963
|
(table) => [
|
|
1982
|
-
primaryKey({ columns: [table.tenantId, table.projectId, table.
|
|
1983
|
-
// Foreign key constraint to agents table (which includes project and graph scope)
|
|
1964
|
+
primaryKey({ columns: [table.tenantId, table.projectId, table.agentId, table.id] }),
|
|
1984
1965
|
foreignKey({
|
|
1985
|
-
columns: [table.tenantId, table.projectId, table.
|
|
1986
|
-
foreignColumns: [subAgents.tenantId, subAgents.projectId, subAgents.
|
|
1966
|
+
columns: [table.tenantId, table.projectId, table.agentId, table.subAgentId],
|
|
1967
|
+
foreignColumns: [subAgents.tenantId, subAgents.projectId, subAgents.agentId, subAgents.id],
|
|
1987
1968
|
name: "sub_agent_tool_relations_agent_fk"
|
|
1988
1969
|
}).onDelete("cascade"),
|
|
1989
|
-
// Foreign key constraint to tools table (MCP tools)
|
|
1990
1970
|
foreignKey({
|
|
1991
1971
|
columns: [table.tenantId, table.projectId, table.toolId],
|
|
1992
1972
|
foreignColumns: [tools.tenantId, tools.projectId, tools.id],
|
|
@@ -2002,20 +1982,20 @@ var init_schema = __esm({
|
|
|
2002
1982
|
...timestamps
|
|
2003
1983
|
},
|
|
2004
1984
|
(table) => [
|
|
2005
|
-
primaryKey({ columns: [table.tenantId, table.projectId, table.
|
|
1985
|
+
primaryKey({ columns: [table.tenantId, table.projectId, table.agentId, table.id] }),
|
|
2006
1986
|
// Foreign key constraint to agents table
|
|
2007
1987
|
foreignKey({
|
|
2008
|
-
columns: [table.tenantId, table.projectId, table.
|
|
2009
|
-
foreignColumns: [subAgents.tenantId, subAgents.projectId, subAgents.
|
|
1988
|
+
columns: [table.tenantId, table.projectId, table.agentId, table.subAgentId],
|
|
1989
|
+
foreignColumns: [subAgents.tenantId, subAgents.projectId, subAgents.agentId, subAgents.id],
|
|
2010
1990
|
name: "agent_function_tool_relations_agent_fk"
|
|
2011
1991
|
}).onDelete("cascade"),
|
|
2012
1992
|
// Foreign key constraint to functionTools table
|
|
2013
1993
|
foreignKey({
|
|
2014
|
-
columns: [table.tenantId, table.projectId, table.
|
|
1994
|
+
columns: [table.tenantId, table.projectId, table.agentId, table.functionToolId],
|
|
2015
1995
|
foreignColumns: [
|
|
2016
1996
|
functionTools.tenantId,
|
|
2017
1997
|
functionTools.projectId,
|
|
2018
|
-
functionTools.
|
|
1998
|
+
functionTools.agentId,
|
|
2019
1999
|
functionTools.id
|
|
2020
2000
|
],
|
|
2021
2001
|
name: "agent_function_tool_relations_function_tool_fk"
|
|
@@ -2049,33 +2029,23 @@ var init_schema = __esm({
|
|
|
2049
2029
|
conversationId: text("conversation_id").notNull(),
|
|
2050
2030
|
// Role mapping: user, agent, system (unified for both formats)
|
|
2051
2031
|
role: text("role").notNull(),
|
|
2052
|
-
// 'user' | 'agent' | 'system'
|
|
2053
2032
|
// Agent sender/recipient tracking (nullable - only populated when relevant)
|
|
2054
2033
|
fromSubAgentId: text("from_sub_agent_id"),
|
|
2055
|
-
// Populated when message is from an agent
|
|
2056
2034
|
toSubAgentId: text("to_sub_agent_id"),
|
|
2057
|
-
// Populated when message is directed to a specific agent (e.g., transfers/delegations)
|
|
2058
2035
|
// External agent sender tracking
|
|
2059
2036
|
fromExternalAgentId: text("from_external_sub_agent_id"),
|
|
2060
|
-
// Populated when message is directed from an external agent
|
|
2061
2037
|
// External agent recipient tracking
|
|
2062
2038
|
toExternalAgentId: text("to_external_sub_agent_id"),
|
|
2063
|
-
// Populated when message is directed to an external agent
|
|
2064
2039
|
// Message content stored as JSON to support both formats
|
|
2065
2040
|
content: blob("content", { mode: "json" }).$type().notNull(),
|
|
2066
2041
|
// Message classification and filtering
|
|
2067
2042
|
visibility: text("visibility").notNull().default("user-facing"),
|
|
2068
|
-
// 'user-facing' | 'internal' | 'system' | 'external'
|
|
2069
2043
|
messageType: text("message_type").notNull().default("chat"),
|
|
2070
|
-
// 'chat' | 'a2a-request' | 'a2a-response' | 'task-update' | 'tool-call'
|
|
2071
2044
|
taskId: text("task_id"),
|
|
2072
2045
|
parentMessageId: text("parent_message_id"),
|
|
2073
|
-
// Remove self-reference constraint here
|
|
2074
2046
|
// A2A specific fields
|
|
2075
2047
|
a2aTaskId: text("a2a_task_id"),
|
|
2076
|
-
// Links to A2A task when relevant
|
|
2077
2048
|
a2aSessionId: text("a2a_session_id"),
|
|
2078
|
-
// A2A session identifier
|
|
2079
2049
|
// Metadata for extensions
|
|
2080
2050
|
metadata: blob("metadata", { mode: "json" }).$type(),
|
|
2081
2051
|
...timestamps
|
|
@@ -2096,7 +2066,6 @@ var init_schema = __esm({
|
|
|
2096
2066
|
// Links
|
|
2097
2067
|
taskId: text("task_id").notNull(),
|
|
2098
2068
|
toolCallId: text("tool_call_id"),
|
|
2099
|
-
// Added for traceability to the specific tool execution
|
|
2100
2069
|
contextId: text("context_id").notNull(),
|
|
2101
2070
|
// Core Artifact fields
|
|
2102
2071
|
type: text("type").notNull().default("source"),
|
|
@@ -2132,13 +2101,10 @@ var init_schema = __esm({
|
|
|
2132
2101
|
apiKeys = sqliteTable(
|
|
2133
2102
|
"api_keys",
|
|
2134
2103
|
{
|
|
2135
|
-
...
|
|
2104
|
+
...agentScoped,
|
|
2136
2105
|
publicId: text("public_id").notNull().unique(),
|
|
2137
|
-
// Public ID for O(1) lookup (e.g., "abc123def456")
|
|
2138
2106
|
keyHash: text("key_hash").notNull(),
|
|
2139
|
-
// Hashed API key (never store plaintext)
|
|
2140
2107
|
keyPrefix: text("key_prefix").notNull(),
|
|
2141
|
-
// First 8 chars for identification (e.g., "sk_live_abc...")
|
|
2142
2108
|
name: text("name"),
|
|
2143
2109
|
lastUsedAt: text("last_used_at"),
|
|
2144
2110
|
expiresAt: text("expires_at"),
|
|
@@ -2151,11 +2117,11 @@ var init_schema = __esm({
|
|
|
2151
2117
|
name: "api_keys_project_fk"
|
|
2152
2118
|
}).onDelete("cascade"),
|
|
2153
2119
|
foreignKey({
|
|
2154
|
-
columns: [t2.tenantId, t2.projectId, t2.
|
|
2155
|
-
foreignColumns: [
|
|
2156
|
-
name: "
|
|
2120
|
+
columns: [t2.tenantId, t2.projectId, t2.agentId],
|
|
2121
|
+
foreignColumns: [agents.tenantId, agents.projectId, agents.id],
|
|
2122
|
+
name: "api_keys_agent_fk"
|
|
2157
2123
|
}).onDelete("cascade"),
|
|
2158
|
-
index("
|
|
2124
|
+
index("api_keys_tenant_agent_idx").on(t2.tenantId, t2.agentId),
|
|
2159
2125
|
index("api_keys_prefix_idx").on(t2.keyPrefix),
|
|
2160
2126
|
index("api_keys_public_id_idx").on(t2.publicId)
|
|
2161
2127
|
]
|
|
@@ -2165,9 +2131,7 @@ var init_schema = __esm({
|
|
|
2165
2131
|
{
|
|
2166
2132
|
...projectScoped,
|
|
2167
2133
|
type: text("type").notNull(),
|
|
2168
|
-
// Implementation type: 'keychain', 'nango', 'memory', etc.
|
|
2169
2134
|
credentialStoreId: text("credential_store_id").notNull(),
|
|
2170
|
-
// Maps to framework.getCredentialStore(id)
|
|
2171
2135
|
retrievalParams: blob("retrieval_params", { mode: "json" }).$type(),
|
|
2172
2136
|
...timestamps
|
|
2173
2137
|
},
|
|
@@ -2181,7 +2145,6 @@ var init_schema = __esm({
|
|
|
2181
2145
|
]
|
|
2182
2146
|
);
|
|
2183
2147
|
tasksRelations = relations(tasks, ({ one, many }) => ({
|
|
2184
|
-
// A task belongs to one project
|
|
2185
2148
|
project: one(projects, {
|
|
2186
2149
|
fields: [tasks.tenantId, tasks.projectId],
|
|
2187
2150
|
references: [projects.tenantId, projects.id]
|
|
@@ -2198,14 +2161,12 @@ var init_schema = __esm({
|
|
|
2198
2161
|
fields: [tasks.subAgentId],
|
|
2199
2162
|
references: [subAgents.id]
|
|
2200
2163
|
}),
|
|
2201
|
-
// A task can have many messages associated with it
|
|
2202
2164
|
messages: many(messages),
|
|
2203
|
-
// A task can have many ledger artifacts
|
|
2204
2165
|
ledgerArtifacts: many(ledgerArtifacts)
|
|
2205
2166
|
}));
|
|
2206
2167
|
projectsRelations = relations(projects, ({ many }) => ({
|
|
2207
2168
|
subAgents: many(subAgents),
|
|
2208
|
-
|
|
2169
|
+
agents: many(agents),
|
|
2209
2170
|
tools: many(tools),
|
|
2210
2171
|
functions: many(functions),
|
|
2211
2172
|
contextConfigs: many(contextConfigs),
|
|
@@ -2234,7 +2195,7 @@ var init_schema = __esm({
|
|
|
2234
2195
|
fields: [contextConfigs.tenantId, contextConfigs.projectId],
|
|
2235
2196
|
references: [projects.tenantId, projects.id]
|
|
2236
2197
|
}),
|
|
2237
|
-
|
|
2198
|
+
agents: many(agents),
|
|
2238
2199
|
cache: many(contextCache)
|
|
2239
2200
|
}));
|
|
2240
2201
|
contextCacheRelations = relations(contextCache, ({ one }) => ({
|
|
@@ -2249,7 +2210,7 @@ var init_schema = __esm({
|
|
|
2249
2210
|
references: [projects.tenantId, projects.id]
|
|
2250
2211
|
}),
|
|
2251
2212
|
tasks: many(tasks),
|
|
2252
|
-
|
|
2213
|
+
defaultForAgents: many(agents),
|
|
2253
2214
|
sourceRelations: many(subAgentRelations, {
|
|
2254
2215
|
relationName: "sourceRelations"
|
|
2255
2216
|
}),
|
|
@@ -2262,25 +2223,22 @@ var init_schema = __esm({
|
|
|
2262
2223
|
receivedMessages: many(messages, {
|
|
2263
2224
|
relationName: "receivedMessages"
|
|
2264
2225
|
}),
|
|
2265
|
-
associatedMessages: many(messages, {
|
|
2266
|
-
relationName: "associatedAgent"
|
|
2267
|
-
}),
|
|
2268
2226
|
toolRelations: many(subAgentToolRelations),
|
|
2269
2227
|
functionToolRelations: many(agentFunctionToolRelations),
|
|
2270
2228
|
dataComponentRelations: many(subAgentDataComponents),
|
|
2271
2229
|
artifactComponentRelations: many(subAgentArtifactComponents)
|
|
2272
2230
|
}));
|
|
2273
|
-
|
|
2231
|
+
agentRelations = relations(agents, ({ one, many }) => ({
|
|
2274
2232
|
project: one(projects, {
|
|
2275
|
-
fields: [
|
|
2233
|
+
fields: [agents.tenantId, agents.projectId],
|
|
2276
2234
|
references: [projects.tenantId, projects.id]
|
|
2277
2235
|
}),
|
|
2278
2236
|
defaultSubAgent: one(subAgents, {
|
|
2279
|
-
fields: [
|
|
2237
|
+
fields: [agents.defaultSubAgentId],
|
|
2280
2238
|
references: [subAgents.id]
|
|
2281
2239
|
}),
|
|
2282
2240
|
contextConfig: one(contextConfigs, {
|
|
2283
|
-
fields: [
|
|
2241
|
+
fields: [agents.contextConfigId],
|
|
2284
2242
|
references: [contextConfigs.id]
|
|
2285
2243
|
}),
|
|
2286
2244
|
functionTools: many(functionTools)
|
|
@@ -2301,9 +2259,9 @@ var init_schema = __esm({
|
|
|
2301
2259
|
fields: [apiKeys.tenantId, apiKeys.projectId],
|
|
2302
2260
|
references: [projects.tenantId, projects.id]
|
|
2303
2261
|
}),
|
|
2304
|
-
|
|
2305
|
-
fields: [apiKeys.
|
|
2306
|
-
references: [
|
|
2262
|
+
agent: one(agents, {
|
|
2263
|
+
fields: [apiKeys.agentId],
|
|
2264
|
+
references: [agents.id]
|
|
2307
2265
|
})
|
|
2308
2266
|
}));
|
|
2309
2267
|
agentToolRelationsRelations = relations(subAgentToolRelations, ({ one }) => ({
|
|
@@ -2316,8 +2274,13 @@ var init_schema = __esm({
|
|
|
2316
2274
|
references: [tools.id]
|
|
2317
2275
|
})
|
|
2318
2276
|
}));
|
|
2319
|
-
credentialReferencesRelations = relations(credentialReferences, ({ many }) => ({
|
|
2320
|
-
|
|
2277
|
+
credentialReferencesRelations = relations(credentialReferences, ({ one, many }) => ({
|
|
2278
|
+
project: one(projects, {
|
|
2279
|
+
fields: [credentialReferences.tenantId, credentialReferences.projectId],
|
|
2280
|
+
references: [projects.tenantId, projects.id]
|
|
2281
|
+
}),
|
|
2282
|
+
tools: many(tools),
|
|
2283
|
+
externalAgents: many(externalAgents)
|
|
2321
2284
|
}));
|
|
2322
2285
|
toolsRelations = relations(tools, ({ one, many }) => ({
|
|
2323
2286
|
project: one(projects, {
|
|
@@ -2426,13 +2389,17 @@ var init_schema = __esm({
|
|
|
2426
2389
|
references: [tasks.id]
|
|
2427
2390
|
})
|
|
2428
2391
|
}));
|
|
2429
|
-
functionsRelations = relations(functions, ({ many }) => ({
|
|
2430
|
-
functionTools: many(functionTools)
|
|
2392
|
+
functionsRelations = relations(functions, ({ many, one }) => ({
|
|
2393
|
+
functionTools: many(functionTools),
|
|
2394
|
+
project: one(projects, {
|
|
2395
|
+
fields: [functions.tenantId, functions.projectId],
|
|
2396
|
+
references: [projects.tenantId, projects.id]
|
|
2397
|
+
})
|
|
2431
2398
|
}));
|
|
2432
2399
|
subAgentRelationsRelations = relations(subAgentRelations, ({ one }) => ({
|
|
2433
|
-
|
|
2434
|
-
fields: [subAgentRelations.
|
|
2435
|
-
references: [
|
|
2400
|
+
agent: one(agents, {
|
|
2401
|
+
fields: [subAgentRelations.agentId],
|
|
2402
|
+
references: [agents.id]
|
|
2436
2403
|
}),
|
|
2437
2404
|
sourceSubAgent: one(subAgents, {
|
|
2438
2405
|
fields: [subAgentRelations.sourceSubAgentId],
|
|
@@ -2454,9 +2421,9 @@ var init_schema = __esm({
|
|
|
2454
2421
|
fields: [functionTools.tenantId, functionTools.projectId],
|
|
2455
2422
|
references: [projects.tenantId, projects.id]
|
|
2456
2423
|
}),
|
|
2457
|
-
|
|
2458
|
-
fields: [functionTools.tenantId, functionTools.projectId, functionTools.
|
|
2459
|
-
references: [
|
|
2424
|
+
agent: one(agents, {
|
|
2425
|
+
fields: [functionTools.tenantId, functionTools.projectId, functionTools.agentId],
|
|
2426
|
+
references: [agents.tenantId, agents.projectId, agents.id]
|
|
2460
2427
|
}),
|
|
2461
2428
|
function: one(functions, {
|
|
2462
2429
|
fields: [functionTools.tenantId, functionTools.projectId, functionTools.functionId],
|
|
@@ -2505,7 +2472,7 @@ var init_utility = __esm({
|
|
|
2505
2472
|
});
|
|
2506
2473
|
|
|
2507
2474
|
// ../packages/agents-core/src/validation/schemas.ts
|
|
2508
|
-
var StopWhenSchema,
|
|
2475
|
+
var StopWhenSchema, AgentStopWhenSchema, SubAgentStopWhenSchema, MIN_ID_LENGTH, MAX_ID_LENGTH, URL_SAFE_ID_PATTERN, resourceIdSchema, ModelSettingsSchema, ModelSchema, ProjectModelSchema, SandboxConfigSchema, 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, CredentialReferenceSelectSchema, CredentialReferenceInsertSchema, CredentialReferenceUpdateSchema, CredentialReferenceApiSelectSchema, CredentialReferenceApiInsertSchema, CredentialReferenceApiUpdateSchema, 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, LedgerArtifactSelectSchema, LedgerArtifactInsertSchema, LedgerArtifactUpdateSchema, LedgerArtifactApiSelectSchema, LedgerArtifactApiInsertSchema, LedgerArtifactApiUpdateSchema, StatusComponentSchema, StatusUpdateSchema, CanUseItemSchema, FullAgentAgentInsertSchema, AgentWithinContextOfProjectSchema, PaginationSchema, ErrorResponseSchema, ExistsResponseSchema, RemovedResponseSchema, ProjectSelectSchema, ProjectInsertSchema, ProjectUpdateSchema, ProjectApiSelectSchema, ProjectApiInsertSchema, ProjectApiUpdateSchema, FullProjectDefinitionSchema, HeadersScopeSchema, TenantId, ProjectId, AgentId, SubAgentId, TenantParamsSchema, TenantIdParamsSchema, TenantProjectParamsSchema, TenantProjectIdParamsSchema, TenantProjectAgentParamsSchema, TenantProjectAgentIdParamsSchema, TenantProjectAgentSubAgentParamsSchema, TenantProjectAgentSubAgentIdParamsSchema, PaginationQueryParamsSchema;
|
|
2509
2476
|
var init_schemas = __esm({
|
|
2510
2477
|
"../packages/agents-core/src/validation/schemas.ts"() {
|
|
2511
2478
|
"use strict";
|
|
@@ -2518,7 +2485,7 @@ var init_schemas = __esm({
|
|
|
2518
2485
|
transferCountIs: z2.number().min(1).max(100).optional(),
|
|
2519
2486
|
stepCountIs: z2.number().min(1).max(1e3).optional()
|
|
2520
2487
|
});
|
|
2521
|
-
|
|
2488
|
+
AgentStopWhenSchema = StopWhenSchema.pick({ transferCountIs: true });
|
|
2522
2489
|
SubAgentStopWhenSchema = StopWhenSchema.pick({ stepCountIs: true });
|
|
2523
2490
|
MIN_ID_LENGTH = 1;
|
|
2524
2491
|
MAX_ID_LENGTH = 255;
|
|
@@ -2559,31 +2526,31 @@ var init_schemas = __esm({
|
|
|
2559
2526
|
createApiSchema = (schema) => schema.omit({ tenantId: true, projectId: true });
|
|
2560
2527
|
createApiInsertSchema = (schema) => schema.omit({ tenantId: true, projectId: true });
|
|
2561
2528
|
createApiUpdateSchema = (schema) => schema.omit({ tenantId: true, projectId: true }).partial();
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2529
|
+
createAgentScopedApiSchema = (schema) => schema.omit({ tenantId: true, projectId: true, agentId: true });
|
|
2530
|
+
createAgentScopedApiInsertSchema = (schema) => schema.omit({ tenantId: true, projectId: true, agentId: true });
|
|
2531
|
+
createAgentScopedApiUpdateSchema = (schema) => schema.omit({ tenantId: true, projectId: true, agentId: true }).partial();
|
|
2565
2532
|
SubAgentSelectSchema = createSelectSchema(subAgents);
|
|
2566
2533
|
SubAgentInsertSchema = createInsertSchema(subAgents).extend({
|
|
2567
2534
|
id: resourceIdSchema,
|
|
2568
2535
|
models: ModelSchema.optional()
|
|
2569
2536
|
});
|
|
2570
2537
|
SubAgentUpdateSchema = SubAgentInsertSchema.partial();
|
|
2571
|
-
SubAgentApiSelectSchema =
|
|
2572
|
-
SubAgentApiInsertSchema =
|
|
2573
|
-
SubAgentApiUpdateSchema =
|
|
2538
|
+
SubAgentApiSelectSchema = createAgentScopedApiSchema(SubAgentSelectSchema);
|
|
2539
|
+
SubAgentApiInsertSchema = createAgentScopedApiInsertSchema(SubAgentInsertSchema);
|
|
2540
|
+
SubAgentApiUpdateSchema = createAgentScopedApiUpdateSchema(SubAgentUpdateSchema);
|
|
2574
2541
|
SubAgentRelationSelectSchema = createSelectSchema(subAgentRelations);
|
|
2575
2542
|
SubAgentRelationInsertSchema = createInsertSchema(subAgentRelations).extend({
|
|
2576
2543
|
id: resourceIdSchema,
|
|
2577
|
-
|
|
2544
|
+
agentId: resourceIdSchema,
|
|
2578
2545
|
sourceSubAgentId: resourceIdSchema,
|
|
2579
2546
|
targetSubAgentId: resourceIdSchema.optional(),
|
|
2580
2547
|
externalSubAgentId: resourceIdSchema.optional()
|
|
2581
2548
|
});
|
|
2582
2549
|
SubAgentRelationUpdateSchema = SubAgentRelationInsertSchema.partial();
|
|
2583
|
-
SubAgentRelationApiSelectSchema =
|
|
2550
|
+
SubAgentRelationApiSelectSchema = createAgentScopedApiSchema(
|
|
2584
2551
|
SubAgentRelationSelectSchema
|
|
2585
2552
|
);
|
|
2586
|
-
SubAgentRelationApiInsertSchema =
|
|
2553
|
+
SubAgentRelationApiInsertSchema = createAgentScopedApiInsertSchema(
|
|
2587
2554
|
SubAgentRelationInsertSchema
|
|
2588
2555
|
).extend({
|
|
2589
2556
|
relationType: z2.enum(VALID_RELATION_TYPES)
|
|
@@ -2598,7 +2565,7 @@ var init_schemas = __esm({
|
|
|
2598
2565
|
path: ["targetSubAgentId", "externalSubAgentId"]
|
|
2599
2566
|
}
|
|
2600
2567
|
);
|
|
2601
|
-
SubAgentRelationApiUpdateSchema =
|
|
2568
|
+
SubAgentRelationApiUpdateSchema = createAgentScopedApiUpdateSchema(
|
|
2602
2569
|
SubAgentRelationUpdateSchema
|
|
2603
2570
|
).extend({
|
|
2604
2571
|
relationType: z2.enum(VALID_RELATION_TYPES).optional()
|
|
@@ -2623,23 +2590,23 @@ var init_schemas = __esm({
|
|
|
2623
2590
|
});
|
|
2624
2591
|
ExternalSubAgentRelationInsertSchema = createInsertSchema(subAgentRelations).extend({
|
|
2625
2592
|
id: resourceIdSchema,
|
|
2626
|
-
|
|
2593
|
+
agentId: resourceIdSchema,
|
|
2627
2594
|
sourceSubAgentId: resourceIdSchema,
|
|
2628
2595
|
externalSubAgentId: resourceIdSchema
|
|
2629
2596
|
});
|
|
2630
2597
|
ExternalSubAgentRelationApiInsertSchema = createApiInsertSchema(
|
|
2631
2598
|
ExternalSubAgentRelationInsertSchema
|
|
2632
2599
|
);
|
|
2633
|
-
|
|
2634
|
-
|
|
2600
|
+
AgentSelectSchema = createSelectSchema(agents);
|
|
2601
|
+
AgentInsertSchema = createInsertSchema(agents).extend({
|
|
2635
2602
|
id: resourceIdSchema
|
|
2636
2603
|
});
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2604
|
+
AgentUpdateSchema = AgentInsertSchema.partial();
|
|
2605
|
+
AgentApiSelectSchema = createApiSchema(AgentSelectSchema);
|
|
2606
|
+
AgentApiInsertSchema = createApiInsertSchema(AgentInsertSchema).extend({
|
|
2640
2607
|
id: resourceIdSchema
|
|
2641
2608
|
});
|
|
2642
|
-
|
|
2609
|
+
AgentApiUpdateSchema = createApiUpdateSchema(AgentUpdateSchema);
|
|
2643
2610
|
TaskSelectSchema = createSelectSchema(tasks);
|
|
2644
2611
|
TaskInsertSchema = createInsertSchema(tasks).extend({
|
|
2645
2612
|
id: resourceIdSchema,
|
|
@@ -2682,7 +2649,10 @@ var init_schemas = __esm({
|
|
|
2682
2649
|
type: z2.enum(MCPTransportType),
|
|
2683
2650
|
requestInit: z2.record(z2.string(), z2.unknown()).optional(),
|
|
2684
2651
|
eventSourceInit: z2.record(z2.string(), z2.unknown()).optional(),
|
|
2685
|
-
reconnectionOptions: z2.
|
|
2652
|
+
reconnectionOptions: z2.any().optional().openapi({
|
|
2653
|
+
type: "object",
|
|
2654
|
+
description: "Reconnection options for streamable HTTP transport"
|
|
2655
|
+
}),
|
|
2686
2656
|
sessionId: z2.string().optional()
|
|
2687
2657
|
});
|
|
2688
2658
|
ToolStatusSchema = z2.enum(TOOL_STATUS_VALUES);
|
|
@@ -2699,13 +2669,16 @@ var init_schemas = __esm({
|
|
|
2699
2669
|
type: z2.literal("mcp"),
|
|
2700
2670
|
mcp: z2.object({
|
|
2701
2671
|
server: z2.object({
|
|
2702
|
-
url: z2.
|
|
2672
|
+
url: z2.url()
|
|
2703
2673
|
}),
|
|
2704
2674
|
transport: z2.object({
|
|
2705
2675
|
type: z2.enum(MCPTransportType),
|
|
2706
2676
|
requestInit: z2.record(z2.string(), z2.unknown()).optional(),
|
|
2707
2677
|
eventSourceInit: z2.record(z2.string(), z2.unknown()).optional(),
|
|
2708
|
-
reconnectionOptions: z2.
|
|
2678
|
+
reconnectionOptions: z2.any().optional().openapi({
|
|
2679
|
+
type: "object",
|
|
2680
|
+
description: "Reconnection options for streamable HTTP transport"
|
|
2681
|
+
}),
|
|
2709
2682
|
sessionId: z2.string().optional()
|
|
2710
2683
|
}).optional(),
|
|
2711
2684
|
activeTools: z2.array(z2.string()).optional()
|
|
@@ -2752,7 +2725,7 @@ var init_schemas = __esm({
|
|
|
2752
2725
|
SubAgentDataComponentSelectSchema = createSelectSchema(subAgentDataComponents);
|
|
2753
2726
|
SubAgentDataComponentInsertSchema = createInsertSchema(subAgentDataComponents);
|
|
2754
2727
|
SubAgentDataComponentUpdateSchema = SubAgentDataComponentInsertSchema.partial();
|
|
2755
|
-
SubAgentDataComponentApiSelectSchema =
|
|
2728
|
+
SubAgentDataComponentApiSelectSchema = createAgentScopedApiSchema(
|
|
2756
2729
|
SubAgentDataComponentSelectSchema
|
|
2757
2730
|
);
|
|
2758
2731
|
SubAgentDataComponentApiInsertSchema = SubAgentDataComponentInsertSchema.omit({
|
|
@@ -2761,7 +2734,7 @@ var init_schemas = __esm({
|
|
|
2761
2734
|
id: true,
|
|
2762
2735
|
createdAt: true
|
|
2763
2736
|
});
|
|
2764
|
-
SubAgentDataComponentApiUpdateSchema =
|
|
2737
|
+
SubAgentDataComponentApiUpdateSchema = createAgentScopedApiUpdateSchema(
|
|
2765
2738
|
SubAgentDataComponentUpdateSchema
|
|
2766
2739
|
);
|
|
2767
2740
|
ArtifactComponentSelectSchema = createSelectSchema(artifactComponents);
|
|
@@ -2788,7 +2761,7 @@ var init_schemas = __esm({
|
|
|
2788
2761
|
artifactComponentId: resourceIdSchema
|
|
2789
2762
|
});
|
|
2790
2763
|
SubAgentArtifactComponentUpdateSchema = SubAgentArtifactComponentInsertSchema.partial();
|
|
2791
|
-
SubAgentArtifactComponentApiSelectSchema =
|
|
2764
|
+
SubAgentArtifactComponentApiSelectSchema = createAgentScopedApiSchema(
|
|
2792
2765
|
SubAgentArtifactComponentSelectSchema
|
|
2793
2766
|
);
|
|
2794
2767
|
SubAgentArtifactComponentApiInsertSchema = SubAgentArtifactComponentInsertSchema.omit({
|
|
@@ -2797,7 +2770,7 @@ var init_schemas = __esm({
|
|
|
2797
2770
|
id: true,
|
|
2798
2771
|
createdAt: true
|
|
2799
2772
|
});
|
|
2800
|
-
SubAgentArtifactComponentApiUpdateSchema =
|
|
2773
|
+
SubAgentArtifactComponentApiUpdateSchema = createAgentScopedApiUpdateSchema(
|
|
2801
2774
|
SubAgentArtifactComponentUpdateSchema
|
|
2802
2775
|
);
|
|
2803
2776
|
ExternalAgentSelectSchema = createSelectSchema(externalAgents).extend({
|
|
@@ -2808,9 +2781,9 @@ var init_schemas = __esm({
|
|
|
2808
2781
|
id: resourceIdSchema
|
|
2809
2782
|
});
|
|
2810
2783
|
ExternalAgentUpdateSchema = ExternalAgentInsertSchema.partial();
|
|
2811
|
-
ExternalAgentApiSelectSchema =
|
|
2812
|
-
ExternalAgentApiInsertSchema =
|
|
2813
|
-
ExternalAgentApiUpdateSchema =
|
|
2784
|
+
ExternalAgentApiSelectSchema = createAgentScopedApiSchema(ExternalAgentSelectSchema);
|
|
2785
|
+
ExternalAgentApiInsertSchema = createAgentScopedApiInsertSchema(ExternalAgentInsertSchema);
|
|
2786
|
+
ExternalAgentApiUpdateSchema = createAgentScopedApiUpdateSchema(ExternalAgentUpdateSchema);
|
|
2814
2787
|
AllAgentSchema = z2.discriminatedUnion("type", [
|
|
2815
2788
|
SubAgentApiSelectSchema.extend({ type: z2.literal("internal") }),
|
|
2816
2789
|
ExternalAgentApiSelectSchema.extend({ type: z2.literal("external") })
|
|
@@ -2818,7 +2791,7 @@ var init_schemas = __esm({
|
|
|
2818
2791
|
ApiKeySelectSchema = createSelectSchema(apiKeys);
|
|
2819
2792
|
ApiKeyInsertSchema = createInsertSchema(apiKeys).extend({
|
|
2820
2793
|
id: resourceIdSchema,
|
|
2821
|
-
|
|
2794
|
+
agentId: resourceIdSchema
|
|
2822
2795
|
});
|
|
2823
2796
|
ApiKeyUpdateSchema = ApiKeyInsertSchema.partial().omit({
|
|
2824
2797
|
tenantId: true,
|
|
@@ -2925,7 +2898,7 @@ var init_schemas = __esm({
|
|
|
2925
2898
|
});
|
|
2926
2899
|
FunctionToolUpdateSchema = FunctionToolInsertSchema.partial();
|
|
2927
2900
|
FunctionToolApiSelectSchema = createApiSchema(FunctionToolSelectSchema);
|
|
2928
|
-
FunctionToolApiInsertSchema =
|
|
2901
|
+
FunctionToolApiInsertSchema = createAgentScopedApiInsertSchema(FunctionToolInsertSchema);
|
|
2929
2902
|
FunctionToolApiUpdateSchema = createApiUpdateSchema(FunctionToolUpdateSchema);
|
|
2930
2903
|
FunctionSelectSchema = createSelectSchema(functions);
|
|
2931
2904
|
FunctionInsertSchema = createInsertSchema(functions).extend({
|
|
@@ -2951,28 +2924,40 @@ var init_schemas = __esm({
|
|
|
2951
2924
|
fetchConfig: FetchConfigSchema,
|
|
2952
2925
|
responseSchema: z2.any().optional(),
|
|
2953
2926
|
// JSON Schema for validating HTTP response
|
|
2954
|
-
defaultValue: z2.
|
|
2927
|
+
defaultValue: z2.any().optional().openapi({
|
|
2928
|
+
description: "Default value if fetch fails"
|
|
2929
|
+
}),
|
|
2955
2930
|
credential: CredentialReferenceApiInsertSchema.optional()
|
|
2956
2931
|
});
|
|
2957
2932
|
ContextConfigSelectSchema = createSelectSchema(contextConfigs).extend({
|
|
2958
|
-
headersSchema: z2.
|
|
2933
|
+
headersSchema: z2.any().optional().openapi({
|
|
2934
|
+
type: "object",
|
|
2935
|
+
description: "JSON Schema for validating request headers"
|
|
2936
|
+
})
|
|
2959
2937
|
});
|
|
2960
2938
|
ContextConfigInsertSchema = createInsertSchema(contextConfigs).extend({
|
|
2961
2939
|
id: resourceIdSchema.optional(),
|
|
2962
|
-
headersSchema: z2.
|
|
2940
|
+
headersSchema: z2.any().nullable().optional().openapi({
|
|
2941
|
+
type: "object",
|
|
2942
|
+
description: "JSON Schema for validating request headers"
|
|
2943
|
+
}),
|
|
2944
|
+
contextVariables: z2.any().nullable().optional().openapi({
|
|
2945
|
+
type: "object",
|
|
2946
|
+
description: "Context variables configuration with fetch definitions"
|
|
2947
|
+
})
|
|
2963
2948
|
}).omit({
|
|
2964
2949
|
createdAt: true,
|
|
2965
2950
|
updatedAt: true
|
|
2966
2951
|
});
|
|
2967
2952
|
ContextConfigUpdateSchema = ContextConfigInsertSchema.partial();
|
|
2968
2953
|
ContextConfigApiSelectSchema = createApiSchema(ContextConfigSelectSchema).omit({
|
|
2969
|
-
|
|
2954
|
+
agentId: true
|
|
2970
2955
|
});
|
|
2971
2956
|
ContextConfigApiInsertSchema = createApiInsertSchema(ContextConfigInsertSchema).omit({
|
|
2972
|
-
|
|
2957
|
+
agentId: true
|
|
2973
2958
|
});
|
|
2974
2959
|
ContextConfigApiUpdateSchema = createApiUpdateSchema(ContextConfigUpdateSchema).omit({
|
|
2975
|
-
|
|
2960
|
+
agentId: true
|
|
2976
2961
|
});
|
|
2977
2962
|
SubAgentToolRelationSelectSchema = createSelectSchema(subAgentToolRelations);
|
|
2978
2963
|
SubAgentToolRelationInsertSchema = createInsertSchema(subAgentToolRelations).extend({
|
|
@@ -2983,13 +2968,13 @@ var init_schemas = __esm({
|
|
|
2983
2968
|
headers: z2.record(z2.string(), z2.string()).nullish()
|
|
2984
2969
|
});
|
|
2985
2970
|
SubAgentToolRelationUpdateSchema = SubAgentToolRelationInsertSchema.partial();
|
|
2986
|
-
SubAgentToolRelationApiSelectSchema =
|
|
2971
|
+
SubAgentToolRelationApiSelectSchema = createAgentScopedApiSchema(
|
|
2987
2972
|
SubAgentToolRelationSelectSchema
|
|
2988
2973
|
);
|
|
2989
|
-
SubAgentToolRelationApiInsertSchema =
|
|
2974
|
+
SubAgentToolRelationApiInsertSchema = createAgentScopedApiInsertSchema(
|
|
2990
2975
|
SubAgentToolRelationInsertSchema
|
|
2991
2976
|
);
|
|
2992
|
-
SubAgentToolRelationApiUpdateSchema =
|
|
2977
|
+
SubAgentToolRelationApiUpdateSchema = createAgentScopedApiUpdateSchema(
|
|
2993
2978
|
SubAgentToolRelationUpdateSchema
|
|
2994
2979
|
);
|
|
2995
2980
|
LedgerArtifactSelectSchema = createSelectSchema(ledgerArtifacts);
|
|
@@ -3020,7 +3005,7 @@ var init_schemas = __esm({
|
|
|
3020
3005
|
toolSelection: z2.array(z2.string()).nullish(),
|
|
3021
3006
|
headers: z2.record(z2.string(), z2.string()).nullish()
|
|
3022
3007
|
});
|
|
3023
|
-
|
|
3008
|
+
FullAgentAgentInsertSchema = SubAgentApiInsertSchema.extend({
|
|
3024
3009
|
type: z2.literal("internal"),
|
|
3025
3010
|
canUse: z2.array(CanUseItemSchema),
|
|
3026
3011
|
// All tools (both MCP and function tools)
|
|
@@ -3029,44 +3014,23 @@ var init_schemas = __esm({
|
|
|
3029
3014
|
canTransferTo: z2.array(z2.string()).optional(),
|
|
3030
3015
|
canDelegateTo: z2.array(z2.string()).optional()
|
|
3031
3016
|
});
|
|
3032
|
-
|
|
3017
|
+
AgentWithinContextOfProjectSchema = AgentApiInsertSchema.extend({
|
|
3033
3018
|
subAgents: z2.record(
|
|
3034
3019
|
z2.string(),
|
|
3035
|
-
z2.union([
|
|
3020
|
+
z2.union([FullAgentAgentInsertSchema, ExternalAgentApiInsertSchema])
|
|
3036
3021
|
),
|
|
3037
3022
|
// Lookup maps for UI to resolve canUse items
|
|
3038
3023
|
tools: z2.record(z2.string(), ToolApiInsertSchema).optional(),
|
|
3039
3024
|
// MCP tools (project-scoped)
|
|
3040
3025
|
functionTools: z2.record(z2.string(), FunctionToolApiInsertSchema).optional(),
|
|
3041
|
-
// Function tools (
|
|
3026
|
+
// Function tools (agent-scoped)
|
|
3042
3027
|
functions: z2.record(z2.string(), FunctionApiInsertSchema).optional(),
|
|
3043
3028
|
// Get function code for function tools
|
|
3044
3029
|
contextConfig: z2.optional(ContextConfigApiInsertSchema),
|
|
3045
3030
|
statusUpdates: z2.optional(StatusUpdateSchema),
|
|
3046
3031
|
models: ModelSchema.optional(),
|
|
3047
|
-
stopWhen:
|
|
3048
|
-
|
|
3049
|
-
});
|
|
3050
|
-
GraphWithinContextOfProjectSchema = AgentGraphApiInsertSchema.extend({
|
|
3051
|
-
subAgents: z2.record(
|
|
3052
|
-
z2.string(),
|
|
3053
|
-
z2.discriminatedUnion("type", [
|
|
3054
|
-
FullGraphAgentInsertSchema,
|
|
3055
|
-
ExternalAgentApiInsertSchema.extend({ type: z2.literal("external") })
|
|
3056
|
-
])
|
|
3057
|
-
),
|
|
3058
|
-
// Lookup maps for UI to resolve canUse items
|
|
3059
|
-
tools: z2.record(z2.string(), ToolApiInsertSchema).optional(),
|
|
3060
|
-
// MCP tools (project-scoped)
|
|
3061
|
-
functionTools: z2.record(z2.string(), FunctionToolApiInsertSchema).optional(),
|
|
3062
|
-
// Function tools (graph-scoped)
|
|
3063
|
-
functions: z2.record(z2.string(), FunctionApiInsertSchema).optional(),
|
|
3064
|
-
// Get function code for function tools
|
|
3065
|
-
contextConfig: z2.optional(ContextConfigApiInsertSchema),
|
|
3066
|
-
statusUpdates: z2.optional(StatusUpdateSchema),
|
|
3067
|
-
models: ModelSchema.optional(),
|
|
3068
|
-
stopWhen: GraphStopWhenSchema.optional(),
|
|
3069
|
-
graphPrompt: z2.string().max(5e3, "Graph prompt cannot exceed 5000 characters").optional()
|
|
3032
|
+
stopWhen: AgentStopWhenSchema.optional(),
|
|
3033
|
+
prompt: z2.string().max(5e3, "Agent prompt cannot exceed 5000 characters").optional()
|
|
3070
3034
|
});
|
|
3071
3035
|
PaginationSchema = z2.object({
|
|
3072
3036
|
page: z2.coerce.number().min(1).default(1),
|
|
@@ -3077,7 +3041,9 @@ var init_schemas = __esm({
|
|
|
3077
3041
|
ErrorResponseSchema = z2.object({
|
|
3078
3042
|
error: z2.string(),
|
|
3079
3043
|
message: z2.string().optional(),
|
|
3080
|
-
details: z2.
|
|
3044
|
+
details: z2.any().optional().openapi({
|
|
3045
|
+
description: "Additional error details"
|
|
3046
|
+
})
|
|
3081
3047
|
});
|
|
3082
3048
|
ExistsResponseSchema = z2.object({
|
|
3083
3049
|
exists: z2.boolean()
|
|
@@ -3100,11 +3066,9 @@ var init_schemas = __esm({
|
|
|
3100
3066
|
ProjectApiInsertSchema = ProjectInsertSchema.omit({ tenantId: true });
|
|
3101
3067
|
ProjectApiUpdateSchema = ProjectUpdateSchema.omit({ tenantId: true });
|
|
3102
3068
|
FullProjectDefinitionSchema = ProjectApiInsertSchema.extend({
|
|
3103
|
-
|
|
3069
|
+
agents: z2.record(z2.string(), AgentWithinContextOfProjectSchema),
|
|
3104
3070
|
tools: z2.record(z2.string(), ToolApiInsertSchema),
|
|
3105
|
-
// MCP tools (project-scoped)
|
|
3106
3071
|
functions: z2.record(z2.string(), FunctionApiInsertSchema).optional(),
|
|
3107
|
-
// Functions (project-scoped)
|
|
3108
3072
|
dataComponents: z2.record(z2.string(), DataComponentApiInsertSchema).optional(),
|
|
3109
3073
|
artifactComponents: z2.record(z2.string(), ArtifactComponentApiInsertSchema).optional(),
|
|
3110
3074
|
statusUpdates: z2.optional(StatusUpdateSchema),
|
|
@@ -3121,9 +3085,9 @@ var init_schemas = __esm({
|
|
|
3121
3085
|
description: "Project identifier",
|
|
3122
3086
|
example: "project_456"
|
|
3123
3087
|
}),
|
|
3124
|
-
"x-inkeep-
|
|
3125
|
-
description: "
|
|
3126
|
-
example: "
|
|
3088
|
+
"x-inkeep-agent-id": z2.string().optional().openapi({
|
|
3089
|
+
description: "Agent identifier",
|
|
3090
|
+
example: "agent_789"
|
|
3127
3091
|
})
|
|
3128
3092
|
});
|
|
3129
3093
|
TenantId = z2.string().openapi({
|
|
@@ -3134,9 +3098,9 @@ var init_schemas = __esm({
|
|
|
3134
3098
|
description: "Project identifier",
|
|
3135
3099
|
example: "project_456"
|
|
3136
3100
|
});
|
|
3137
|
-
|
|
3138
|
-
description: "
|
|
3139
|
-
example: "
|
|
3101
|
+
AgentId = z2.string().openapi({
|
|
3102
|
+
description: "Agent identifier",
|
|
3103
|
+
example: "agent_789"
|
|
3140
3104
|
});
|
|
3141
3105
|
SubAgentId = z2.string().openapi({
|
|
3142
3106
|
description: "Sub-agent identifier",
|
|
@@ -3154,18 +3118,18 @@ var init_schemas = __esm({
|
|
|
3154
3118
|
TenantProjectIdParamsSchema = TenantProjectParamsSchema.extend({
|
|
3155
3119
|
id: resourceIdSchema
|
|
3156
3120
|
}).openapi("TenantProjectIdParams");
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
}).openapi("
|
|
3160
|
-
|
|
3121
|
+
TenantProjectAgentParamsSchema = TenantProjectParamsSchema.extend({
|
|
3122
|
+
agentId: AgentId
|
|
3123
|
+
}).openapi("TenantProjectAgentParams");
|
|
3124
|
+
TenantProjectAgentIdParamsSchema = TenantProjectAgentParamsSchema.extend({
|
|
3161
3125
|
id: resourceIdSchema
|
|
3162
|
-
}).openapi("
|
|
3163
|
-
|
|
3126
|
+
}).openapi("TenantProjectAgentIdParams");
|
|
3127
|
+
TenantProjectAgentSubAgentParamsSchema = TenantProjectAgentParamsSchema.extend({
|
|
3164
3128
|
subAgentId: SubAgentId
|
|
3165
|
-
}).openapi("
|
|
3166
|
-
|
|
3129
|
+
}).openapi("TenantProjectAgentSubAgentParams");
|
|
3130
|
+
TenantProjectAgentSubAgentIdParamsSchema = TenantProjectAgentSubAgentParamsSchema.extend({
|
|
3167
3131
|
id: resourceIdSchema
|
|
3168
|
-
}).openapi("
|
|
3132
|
+
}).openapi("TenantProjectAgentSubAgentIdParams");
|
|
3169
3133
|
PaginationQueryParamsSchema = z2.object({
|
|
3170
3134
|
page: z2.coerce.number().min(1).default(1),
|
|
3171
3135
|
limit: z2.coerce.number().min(1).max(100).default(10)
|
|
@@ -226813,10 +226777,10 @@ var init_tools = __esm({
|
|
|
226813
226777
|
}
|
|
226814
226778
|
});
|
|
226815
226779
|
|
|
226816
|
-
// ../packages/agents-core/src/data-access/
|
|
226780
|
+
// ../packages/agents-core/src/data-access/agents.ts
|
|
226817
226781
|
import { and as and9, count as count8, desc as desc8, eq as eq9, inArray as inArray2 } from "drizzle-orm";
|
|
226818
|
-
var
|
|
226819
|
-
"../packages/agents-core/src/data-access/
|
|
226782
|
+
var init_agents = __esm({
|
|
226783
|
+
"../packages/agents-core/src/data-access/agents.ts"() {
|
|
226820
226784
|
"use strict";
|
|
226821
226785
|
init_esm_shims();
|
|
226822
226786
|
init_schema();
|
|
@@ -233367,24 +233331,24 @@ var init_dataComponents = __esm({
|
|
|
233367
233331
|
}
|
|
233368
233332
|
});
|
|
233369
233333
|
|
|
233370
|
-
// ../packages/agents-core/src/validation/
|
|
233371
|
-
var
|
|
233372
|
-
"../packages/agents-core/src/validation/
|
|
233334
|
+
// ../packages/agents-core/src/validation/agentFull.ts
|
|
233335
|
+
var init_agentFull = __esm({
|
|
233336
|
+
"../packages/agents-core/src/validation/agentFull.ts"() {
|
|
233373
233337
|
"use strict";
|
|
233374
233338
|
init_esm_shims();
|
|
233375
233339
|
init_schemas();
|
|
233376
233340
|
}
|
|
233377
233341
|
});
|
|
233378
233342
|
|
|
233379
|
-
// ../packages/agents-core/src/data-access/
|
|
233343
|
+
// ../packages/agents-core/src/data-access/agentFull.ts
|
|
233380
233344
|
import { and as and15, eq as eq15, inArray as inArray3, not } from "drizzle-orm";
|
|
233381
|
-
var
|
|
233382
|
-
"../packages/agents-core/src/data-access/
|
|
233345
|
+
var init_agentFull2 = __esm({
|
|
233346
|
+
"../packages/agents-core/src/data-access/agentFull.ts"() {
|
|
233383
233347
|
"use strict";
|
|
233384
233348
|
init_esm_shims();
|
|
233385
233349
|
init_schema();
|
|
233386
|
-
|
|
233387
|
-
|
|
233350
|
+
init_agentFull();
|
|
233351
|
+
init_agents();
|
|
233388
233352
|
init_artifactComponents();
|
|
233389
233353
|
init_contextConfigs();
|
|
233390
233354
|
init_dataComponents();
|
|
@@ -233434,12 +233398,12 @@ var init_projectFull = __esm({
|
|
|
233434
233398
|
"use strict";
|
|
233435
233399
|
init_esm_shims();
|
|
233436
233400
|
init_logger();
|
|
233437
|
-
|
|
233401
|
+
init_agents();
|
|
233438
233402
|
init_artifactComponents();
|
|
233439
233403
|
init_credentialReferences();
|
|
233440
233404
|
init_dataComponents();
|
|
233441
233405
|
init_functions();
|
|
233442
|
-
|
|
233406
|
+
init_agentFull2();
|
|
233443
233407
|
init_projects();
|
|
233444
233408
|
init_tools();
|
|
233445
233409
|
defaultLogger = getLogger("projectFull");
|
|
@@ -233471,7 +233435,7 @@ var init_data_access = __esm({
|
|
|
233471
233435
|
"use strict";
|
|
233472
233436
|
init_esm_shims();
|
|
233473
233437
|
init_client();
|
|
233474
|
-
|
|
233438
|
+
init_agents();
|
|
233475
233439
|
init_apiKeys2();
|
|
233476
233440
|
init_artifactComponents();
|
|
233477
233441
|
init_contextCache();
|
|
@@ -233482,7 +233446,7 @@ var init_data_access = __esm({
|
|
|
233482
233446
|
init_externalAgents();
|
|
233483
233447
|
init_functions();
|
|
233484
233448
|
init_functionTools();
|
|
233485
|
-
|
|
233449
|
+
init_agentFull2();
|
|
233486
233450
|
init_ledgerArtifacts();
|
|
233487
233451
|
init_messages();
|
|
233488
233452
|
init_projectFull();
|
|
@@ -233542,7 +233506,7 @@ var init_contextValidation = __esm({
|
|
|
233542
233506
|
init_esm_shims();
|
|
233543
233507
|
import_ajv3 = __toESM(require_ajv2(), 1);
|
|
233544
233508
|
init_ContextResolver();
|
|
233545
|
-
|
|
233509
|
+
init_agents();
|
|
233546
233510
|
init_contextConfigs();
|
|
233547
233511
|
init_error();
|
|
233548
233512
|
init_execution();
|
|
@@ -233920,7 +233884,7 @@ var init_validation2 = __esm({
|
|
|
233920
233884
|
"use strict";
|
|
233921
233885
|
init_esm_shims();
|
|
233922
233886
|
init_event_schemas();
|
|
233923
|
-
|
|
233887
|
+
init_agentFull();
|
|
233924
233888
|
init_id_validation();
|
|
233925
233889
|
init_props_validation();
|
|
233926
233890
|
init_schemas();
|
|
@@ -234220,54 +234184,51 @@ var init_api = __esm({
|
|
|
234220
234184
|
const projectId = projectIdOverride || "";
|
|
234221
234185
|
return new _ManagementApiClient(resolvedApiUrl, tenantId, projectId, config.agentsManageApiKey);
|
|
234222
234186
|
}
|
|
234223
|
-
async
|
|
234187
|
+
async listAgents() {
|
|
234224
234188
|
const tenantId = this.checkTenantId();
|
|
234225
234189
|
const projectId = this.getProjectId();
|
|
234226
234190
|
const response = await this.authenticatedFetch(
|
|
234227
|
-
`${this.apiUrl}/tenants/${tenantId}/projects/${projectId}/
|
|
234191
|
+
`${this.apiUrl}/tenants/${tenantId}/projects/${projectId}/agents`,
|
|
234228
234192
|
{
|
|
234229
234193
|
method: "GET"
|
|
234230
234194
|
}
|
|
234231
234195
|
);
|
|
234232
234196
|
if (!response.ok) {
|
|
234233
|
-
throw new Error(`Failed to list
|
|
234197
|
+
throw new Error(`Failed to list agents: ${response.statusText}`);
|
|
234234
234198
|
}
|
|
234235
234199
|
const data = await response.json();
|
|
234236
234200
|
return data.data || [];
|
|
234237
234201
|
}
|
|
234238
|
-
async
|
|
234239
|
-
const
|
|
234240
|
-
const
|
|
234241
|
-
return
|
|
234202
|
+
async getAgent(agentId) {
|
|
234203
|
+
const agents2 = await this.listAgents();
|
|
234204
|
+
const agent = agents2.find((g) => g.id === agentId);
|
|
234205
|
+
return agent || null;
|
|
234242
234206
|
}
|
|
234243
|
-
async
|
|
234207
|
+
async pushAgent(agentDefinition) {
|
|
234244
234208
|
const tenantId = this.checkTenantId();
|
|
234245
234209
|
const projectId = this.getProjectId();
|
|
234246
|
-
const
|
|
234247
|
-
if (!
|
|
234248
|
-
throw new Error("
|
|
234210
|
+
const agentId = agentDefinition.id;
|
|
234211
|
+
if (!agentId) {
|
|
234212
|
+
throw new Error("Agent must have an id property");
|
|
234249
234213
|
}
|
|
234250
234214
|
const response = await this.authenticatedFetch(
|
|
234251
|
-
`${this.apiUrl}/tenants/${tenantId}/projects/${projectId}/
|
|
234215
|
+
`${this.apiUrl}/tenants/${tenantId}/projects/${projectId}/agents/${agentId}`,
|
|
234252
234216
|
{
|
|
234253
234217
|
method: "PUT",
|
|
234254
234218
|
body: JSON.stringify({
|
|
234255
|
-
...
|
|
234219
|
+
...agentDefinition,
|
|
234256
234220
|
tenantId
|
|
234257
234221
|
})
|
|
234258
234222
|
}
|
|
234259
234223
|
);
|
|
234260
234224
|
if (!response.ok) {
|
|
234261
234225
|
const errorText = await response.text();
|
|
234262
|
-
throw new Error(`Failed to push
|
|
234226
|
+
throw new Error(`Failed to push agent: ${response.statusText}
|
|
234263
234227
|
${errorText}`);
|
|
234264
234228
|
}
|
|
234265
234229
|
const data = await response.json();
|
|
234266
234230
|
return data.data;
|
|
234267
234231
|
}
|
|
234268
|
-
/**
|
|
234269
|
-
* Fetch full project data including all graphs, tools, and components
|
|
234270
|
-
*/
|
|
234271
234232
|
async getFullProject(projectId) {
|
|
234272
234233
|
const tenantId = this.checkTenantId();
|
|
234273
234234
|
const response = await this.authenticatedFetch(
|
|
@@ -234301,14 +234262,14 @@ ${errorText}`);
|
|
|
234301
234262
|
const projectId = projectIdOverride || "";
|
|
234302
234263
|
return new _ExecutionApiClient(resolvedApiUrl, tenantId, projectId, config.agentsRunApiKey);
|
|
234303
234264
|
}
|
|
234304
|
-
async chatCompletion(
|
|
234265
|
+
async chatCompletion(agentId, messages2, conversationId, emitOperations) {
|
|
234305
234266
|
const response = await this.authenticatedFetch(`${this.apiUrl}/v1/chat/completions`, {
|
|
234306
234267
|
method: "POST",
|
|
234307
234268
|
headers: {
|
|
234308
234269
|
Accept: "text/event-stream",
|
|
234309
234270
|
"x-inkeep-tenant-id": this.tenantId || "test-tenant-id",
|
|
234310
234271
|
"x-inkeep-project-id": this.projectId,
|
|
234311
|
-
"x-inkeep-
|
|
234272
|
+
"x-inkeep-agent-id": agentId,
|
|
234312
234273
|
...emitOperations && { "x-emit-operations": "true" }
|
|
234313
234274
|
},
|
|
234314
234275
|
body: JSON.stringify({
|
|
@@ -234401,7 +234362,7 @@ import * as readline from "readline";
|
|
|
234401
234362
|
import chalk9 from "chalk";
|
|
234402
234363
|
import inquirer2 from "inquirer";
|
|
234403
234364
|
import ora7 from "ora";
|
|
234404
|
-
async function chatCommandEnhanced(
|
|
234365
|
+
async function chatCommandEnhanced(agentIdInput, options) {
|
|
234405
234366
|
console.log(chalk9.cyan("\u{1F916} Inkeep Chat Interface\n"));
|
|
234406
234367
|
const configPath = options?.config || options?.configFilePath;
|
|
234407
234368
|
const { config } = await initializeCommand({
|
|
@@ -234420,20 +234381,20 @@ async function chatCommandEnhanced(graphIdInput, options) {
|
|
|
234420
234381
|
configPath,
|
|
234421
234382
|
config.tenantId
|
|
234422
234383
|
);
|
|
234423
|
-
let
|
|
234424
|
-
if (!
|
|
234425
|
-
const spinner2 = ora7("Fetching available
|
|
234384
|
+
let agentId = agentIdInput;
|
|
234385
|
+
if (!agentId) {
|
|
234386
|
+
const spinner2 = ora7("Fetching available agent...").start();
|
|
234426
234387
|
try {
|
|
234427
|
-
const
|
|
234388
|
+
const agent = await managementApi.listAgents();
|
|
234428
234389
|
spinner2.stop();
|
|
234429
|
-
if (
|
|
234390
|
+
if (agent.length === 0) {
|
|
234430
234391
|
console.error(
|
|
234431
|
-
chalk9.red("No
|
|
234392
|
+
chalk9.red("No agent available. Define agent in your project and run: inkeep push")
|
|
234432
234393
|
);
|
|
234433
234394
|
process.exit(1);
|
|
234434
234395
|
}
|
|
234435
|
-
const
|
|
234436
|
-
name: `${chalk9.cyan(g.id)} - ${g.name || "Unnamed
|
|
234396
|
+
const agentChoices = agent.map((g) => ({
|
|
234397
|
+
name: `${chalk9.cyan(g.id)} - ${g.name || "Unnamed Agent"}`,
|
|
234437
234398
|
value: g.id,
|
|
234438
234399
|
short: g.id,
|
|
234439
234400
|
searchText: `${g.id} ${g.name || ""}`.toLowerCase()
|
|
@@ -234441,48 +234402,48 @@ async function chatCommandEnhanced(graphIdInput, options) {
|
|
|
234441
234402
|
const answer = await inquirer2.prompt([
|
|
234442
234403
|
{
|
|
234443
234404
|
type: "list",
|
|
234444
|
-
name: "
|
|
234445
|
-
message: "Select
|
|
234446
|
-
choices:
|
|
234405
|
+
name: "agentId",
|
|
234406
|
+
message: "Select an agent to chat with:",
|
|
234407
|
+
choices: agentChoices,
|
|
234447
234408
|
pageSize: 10
|
|
234448
234409
|
}
|
|
234449
234410
|
]);
|
|
234450
|
-
|
|
234411
|
+
agentId = answer.agentId;
|
|
234451
234412
|
} catch (error) {
|
|
234452
|
-
spinner2.fail("Failed to fetch
|
|
234413
|
+
spinner2.fail("Failed to fetch agent");
|
|
234453
234414
|
console.error(chalk9.red("Error:"), error instanceof Error ? error.message : error);
|
|
234454
234415
|
process.exit(1);
|
|
234455
234416
|
}
|
|
234456
234417
|
}
|
|
234457
|
-
const spinner = ora7("Connecting to
|
|
234418
|
+
const spinner = ora7("Connecting to agent...").start();
|
|
234458
234419
|
try {
|
|
234459
|
-
if (!
|
|
234460
|
-
throw new Error("No
|
|
234420
|
+
if (!agentId) {
|
|
234421
|
+
throw new Error("No agent selected");
|
|
234461
234422
|
}
|
|
234462
|
-
const
|
|
234463
|
-
if (!
|
|
234464
|
-
spinner.fail(`
|
|
234465
|
-
const
|
|
234466
|
-
if (
|
|
234467
|
-
console.log(chalk9.yellow("\nAvailable
|
|
234468
|
-
|
|
234423
|
+
const agent = await managementApi.getAgent(agentId);
|
|
234424
|
+
if (!agent) {
|
|
234425
|
+
spinner.fail(`Agent "${agentId}" not found`);
|
|
234426
|
+
const agent2 = await managementApi.listAgents();
|
|
234427
|
+
if (agent2.length > 0) {
|
|
234428
|
+
console.log(chalk9.yellow("\nAvailable agent:"));
|
|
234429
|
+
agent2.forEach((g) => {
|
|
234469
234430
|
console.log(chalk9.gray(` \u2022 ${g.id} - ${g.name || "Unnamed"}`));
|
|
234470
234431
|
});
|
|
234471
234432
|
console.log(chalk9.gray('\nRun "inkeep chat" without arguments for interactive selection'));
|
|
234472
234433
|
} else {
|
|
234473
|
-
console.log(chalk9.yellow("\nNo
|
|
234434
|
+
console.log(chalk9.yellow("\nNo agent found. Please define agent and push your project."));
|
|
234474
234435
|
}
|
|
234475
234436
|
process.exit(1);
|
|
234476
234437
|
}
|
|
234477
|
-
spinner.succeed(`Connected to
|
|
234478
|
-
if (
|
|
234479
|
-
console.log(chalk9.gray(`Description: ${
|
|
234438
|
+
spinner.succeed(`Connected to agent: ${chalk9.green(agent.name || agentId)}`);
|
|
234439
|
+
if (agent.description) {
|
|
234440
|
+
console.log(chalk9.gray(`Description: ${agent.description}`));
|
|
234480
234441
|
}
|
|
234481
|
-
if (
|
|
234482
|
-
console.log(chalk9.gray(`Default Agent: ${
|
|
234442
|
+
if (agent.defaultSubAgentId) {
|
|
234443
|
+
console.log(chalk9.gray(`Default Agent: ${agent.defaultSubAgentId}`));
|
|
234483
234444
|
}
|
|
234484
234445
|
} catch (error) {
|
|
234485
|
-
spinner.fail("Failed to connect to
|
|
234446
|
+
spinner.fail("Failed to connect to agent");
|
|
234486
234447
|
console.error(chalk9.red("Error:"), error instanceof Error ? error.message : error);
|
|
234487
234448
|
process.exit(1);
|
|
234488
234449
|
}
|
|
@@ -234541,17 +234502,17 @@ async function chatCommandEnhanced(graphIdInput, options) {
|
|
|
234541
234502
|
const opType = dataOp.data?.type || "unknown";
|
|
234542
234503
|
const label = dataOp.data?.label || "Unknown operation";
|
|
234543
234504
|
const details = dataOp.data?.details || {};
|
|
234544
|
-
const
|
|
234505
|
+
const subAgentId = details.subAgentId || "unknown-agent";
|
|
234545
234506
|
let displayText = "";
|
|
234546
234507
|
if (opType === "completion") {
|
|
234547
|
-
displayText = `${label} (agent: ${
|
|
234508
|
+
displayText = `${label} (sub-agent: ${subAgentId})`;
|
|
234548
234509
|
} else if (opType === "tool_execution") {
|
|
234549
234510
|
const toolData = details.data || {};
|
|
234550
234511
|
displayText = `${label} - ${toolData.toolName || "unknown tool"}`;
|
|
234551
234512
|
} else if (opType === "agent_generate" || opType === "agent_reasoning") {
|
|
234552
234513
|
displayText = `${label}`;
|
|
234553
234514
|
} else {
|
|
234554
|
-
displayText = `${label} (${
|
|
234515
|
+
displayText = `${label} (${subAgentId})`;
|
|
234555
234516
|
}
|
|
234556
234517
|
if (opType === "completion" && hasStartedResponse) {
|
|
234557
234518
|
console.log("");
|
|
@@ -234663,9 +234624,9 @@ async function chatCommandEnhanced(graphIdInput, options) {
|
|
|
234663
234624
|
}
|
|
234664
234625
|
messages2.push({ role: "user", content: trimmedInput });
|
|
234665
234626
|
try {
|
|
234666
|
-
if (!
|
|
234627
|
+
if (!agentId) throw new Error("No agent selected");
|
|
234667
234628
|
const response = await executionApi.chatCompletion(
|
|
234668
|
-
|
|
234629
|
+
agentId,
|
|
234669
234630
|
messages2,
|
|
234670
234631
|
conversationId,
|
|
234671
234632
|
emitOperations
|
|
@@ -234685,7 +234646,7 @@ async function chatCommandEnhanced(graphIdInput, options) {
|
|
|
234685
234646
|
});
|
|
234686
234647
|
rl.on("close", () => {
|
|
234687
234648
|
console.log(chalk9.gray("\n\u{1F4CA} Session Summary:"));
|
|
234688
|
-
console.log(chalk9.gray(` \u2022
|
|
234649
|
+
console.log(chalk9.gray(` \u2022 Agent: ${agentId}`));
|
|
234689
234650
|
console.log(chalk9.gray(` \u2022 Messages: ${messages2.length}`));
|
|
234690
234651
|
console.log(chalk9.gray(` \u2022 Duration: ${(/* @__PURE__ */ new Date()).toLocaleTimeString()}`));
|
|
234691
234652
|
console.log(chalk9.gray("\nChat session ended."));
|
|
@@ -235287,7 +235248,7 @@ export default defineConfig({
|
|
|
235287
235248
|
writeFileSync2(configPath, configContent);
|
|
235288
235249
|
console.log(chalk4.green("\u2713"), `Created ${chalk4.cyan(configPath)}`);
|
|
235289
235250
|
console.log(chalk4.gray("\nYou can now use the Inkeep CLI commands."));
|
|
235290
|
-
console.log(chalk4.gray("For example: inkeep list-
|
|
235251
|
+
console.log(chalk4.gray("For example: inkeep list-agent"));
|
|
235291
235252
|
const configDir = dirname2(configPath);
|
|
235292
235253
|
if (configDir !== process.cwd()) {
|
|
235293
235254
|
console.log(chalk4.gray(`
|
|
@@ -235302,14 +235263,14 @@ Note: Config file created in ${configDir}`));
|
|
|
235302
235263
|
}
|
|
235303
235264
|
}
|
|
235304
235265
|
|
|
235305
|
-
// src/commands/list-
|
|
235266
|
+
// src/commands/list-agents.ts
|
|
235306
235267
|
init_esm_shims();
|
|
235307
235268
|
init_api();
|
|
235308
235269
|
init_cli_pipeline();
|
|
235309
235270
|
import chalk6 from "chalk";
|
|
235310
235271
|
import Table from "cli-table3";
|
|
235311
235272
|
import ora4 from "ora";
|
|
235312
|
-
async function
|
|
235273
|
+
async function listAgentsCommand(options) {
|
|
235313
235274
|
const configPath = options.config || options.configFilePath;
|
|
235314
235275
|
const { config } = await initializeCommand({
|
|
235315
235276
|
configPath,
|
|
@@ -235324,21 +235285,21 @@ async function listGraphsCommand(options) {
|
|
|
235324
235285
|
options.project
|
|
235325
235286
|
// pass project ID as projectIdOverride
|
|
235326
235287
|
);
|
|
235327
|
-
const spinner = ora4("Fetching
|
|
235288
|
+
const spinner = ora4("Fetching agent...").start();
|
|
235328
235289
|
try {
|
|
235329
|
-
const
|
|
235330
|
-
spinner.succeed(`Found ${
|
|
235331
|
-
if (
|
|
235290
|
+
const agents2 = await api.listAgents();
|
|
235291
|
+
spinner.succeed(`Found ${agents2.length} agent(s) in project "${options.project}"`);
|
|
235292
|
+
if (agents2.length === 0) {
|
|
235332
235293
|
console.log(
|
|
235333
235294
|
chalk6.gray(
|
|
235334
|
-
`No
|
|
235295
|
+
`No agent found in project "${options.project}". Define agent in your project and run: inkeep push`
|
|
235335
235296
|
)
|
|
235336
235297
|
);
|
|
235337
235298
|
return;
|
|
235338
235299
|
}
|
|
235339
235300
|
const table = new Table({
|
|
235340
235301
|
head: [
|
|
235341
|
-
chalk6.cyan("
|
|
235302
|
+
chalk6.cyan("Agent ID"),
|
|
235342
235303
|
chalk6.cyan("Name"),
|
|
235343
235304
|
chalk6.cyan("Default Agent"),
|
|
235344
235305
|
chalk6.cyan("Created")
|
|
@@ -235348,19 +235309,19 @@ async function listGraphsCommand(options) {
|
|
|
235348
235309
|
border: []
|
|
235349
235310
|
}
|
|
235350
235311
|
});
|
|
235351
|
-
for (const
|
|
235352
|
-
const createdDate =
|
|
235312
|
+
for (const agent of agents2) {
|
|
235313
|
+
const createdDate = agent.createdAt ? new Date(agent.createdAt).toLocaleDateString() : "Unknown";
|
|
235353
235314
|
table.push([
|
|
235354
|
-
|
|
235355
|
-
|
|
235356
|
-
|
|
235315
|
+
agent.id || "",
|
|
235316
|
+
agent.name || agent.id || "",
|
|
235317
|
+
agent.defaultSubAgentId || chalk6.gray("None"),
|
|
235357
235318
|
createdDate
|
|
235358
235319
|
]);
|
|
235359
235320
|
}
|
|
235360
235321
|
console.log(`
|
|
235361
235322
|
${table.toString()}`);
|
|
235362
235323
|
} catch (error) {
|
|
235363
|
-
spinner.fail("Failed to fetch
|
|
235324
|
+
spinner.fail("Failed to fetch agent");
|
|
235364
235325
|
console.error(chalk6.red("Error:"), error instanceof Error ? error.message : error);
|
|
235365
235326
|
process.exit(1);
|
|
235366
235327
|
}
|
|
@@ -235662,7 +235623,7 @@ var PROJECT_JSON_EXAMPLE = `
|
|
|
235662
235623
|
"transferCountIs": 10,
|
|
235663
235624
|
"stepCountIs": 24
|
|
235664
235625
|
},
|
|
235665
|
-
"
|
|
235626
|
+
"agent": {
|
|
235666
235627
|
"customer-service": {
|
|
235667
235628
|
"id": "customer-service",
|
|
235668
235629
|
"name": "customer-service",
|
|
@@ -235787,7 +235748,7 @@ CRITICAL NAMING CONVENTION RULES (Apply to ALL imports/exports):
|
|
|
235787
235748
|
- Examples:
|
|
235788
235749
|
- Tool: import { inkeepFacts } from '../tools/inkeep_facts'; export const inkeepFacts = mcpTool({ id: 'inkeep_facts', ... })
|
|
235789
235750
|
- Component: import { userProfile } from '../data-components/user-profile'; export const userProfile = dataComponent({ id: 'user-profile', ... })
|
|
235790
|
-
-
|
|
235751
|
+
- Agent: import { myAgent } from './agent/my-agent'; export const myAgent = agent({ id: 'my-agent', ... })
|
|
235791
235752
|
`;
|
|
235792
235753
|
var IMPORT_INSTRUCTIONS = `
|
|
235793
235754
|
CRITICAL: All imports MUST be alphabetically sorted (both named imports and path names)
|
|
@@ -235796,7 +235757,7 @@ CRITICAL IMPORT PATTERNS:
|
|
|
235796
235757
|
- Tools: Import from '../tools/{toolId}' (individual files)
|
|
235797
235758
|
- Data components: Import from '../data-components/{componentId}' (individual files)
|
|
235798
235759
|
- Artifact components: Import from '../artifact-components/{componentId}' (individual files)
|
|
235799
|
-
-
|
|
235760
|
+
- Agent: Import from './agent/{agentId}' (individual files)
|
|
235800
235761
|
|
|
235801
235762
|
NEVER use barrel imports from directories:
|
|
235802
235763
|
\u274C WRONG: import { ordersList, refundApproval } from '../data-components';
|
|
@@ -235813,9 +235774,9 @@ import { refundApproval } from '../data-components/refund-approval';
|
|
|
235813
235774
|
import { inkeepFacts } from '../tools/inkeep_facts';
|
|
235814
235775
|
import { weatherApi } from '../tools/weather-api';
|
|
235815
235776
|
|
|
235816
|
-
//
|
|
235817
|
-
import {
|
|
235818
|
-
import {
|
|
235777
|
+
// Agent - each from individual file:
|
|
235778
|
+
import { inkeepQaAgent } from './agent/inkeep-qa-agent';
|
|
235779
|
+
import { weatherAgent } from './agent/weather-agent';
|
|
235819
235780
|
`;
|
|
235820
235781
|
function cleanGeneratedCode(text2) {
|
|
235821
235782
|
return text2.replace(/^```(?:typescript|ts)?\n?/, "").replace(/\n?```$/, "").trim();
|
|
@@ -235904,14 +235865,14 @@ Generate ONLY the TypeScript code without any markdown or explanations.`;
|
|
|
235904
235865
|
});
|
|
235905
235866
|
writeFileSync3(outputPath, cleanGeneratedCode(text2));
|
|
235906
235867
|
}
|
|
235907
|
-
async function
|
|
235868
|
+
async function generateAgentFile(agentData, agentId, outputPath, modelSettings, debug = false) {
|
|
235908
235869
|
const model = createModel(modelSettings);
|
|
235909
|
-
const promptTemplate = `Generate a TypeScript file for an Inkeep agent
|
|
235870
|
+
const promptTemplate = `Generate a TypeScript file for an Inkeep agent agent.
|
|
235910
235871
|
|
|
235911
|
-
|
|
235872
|
+
AGENT DATA:
|
|
235912
235873
|
{{DATA}}
|
|
235913
235874
|
|
|
235914
|
-
|
|
235875
|
+
AGENT ID: ${agentId}
|
|
235915
235876
|
|
|
235916
235877
|
${getTypeDefinitions()}
|
|
235917
235878
|
|
|
@@ -235925,9 +235886,9 @@ ${NAMING_CONVENTION_RULES}
|
|
|
235925
235886
|
${IMPORT_INSTRUCTIONS}
|
|
235926
235887
|
|
|
235927
235888
|
REQUIREMENTS:
|
|
235928
|
-
1. Import { agent,
|
|
235889
|
+
1. Import { agent, subAgent } from '@inkeep/agents-sdk'
|
|
235929
235890
|
2. Define each agent using the agent() function following the type definitions provided above
|
|
235930
|
-
3. Create the
|
|
235891
|
+
3. Create the agent using agent() with proper structure
|
|
235931
235892
|
- IMPORTANT: If description is null, undefined, or empty string, omit the description field entirely
|
|
235932
235893
|
4. CRITICAL: For multi-line strings (especially prompts), ALWAYS use template literals with backticks:
|
|
235933
235894
|
- Single-line strings: use regular quotes 'short string'
|
|
@@ -235935,7 +235896,7 @@ REQUIREMENTS:
|
|
|
235935
235896
|
- IMPORTANT: ANY placeholder that starts with < and ends with > MUST be wrapped in template literals (backticks)
|
|
235936
235897
|
- Placeholders contain multi-line content and require template literals
|
|
235937
235898
|
- This prevents TypeScript syntax errors with newlines and special characters
|
|
235938
|
-
- you must import { z } from 'zod' if you are using zod schemas in the
|
|
235899
|
+
- you must import { z } from 'zod' if you are using zod schemas in the agent file.
|
|
235939
235900
|
- you must import { headers } from '@inkeep/agents-core' and use it to create the headers schema if you are using headers in a contextConfig.
|
|
235940
235901
|
- convert template literals to use the appropriate headers schema or context config toTemplate method. a template literal is a substring that starts with {{ and ends with }}.
|
|
235941
235902
|
- if you see a template literal with {{headers.}}, convert it to use the headers schema toTemplate method.
|
|
@@ -235950,14 +235911,14 @@ prompt: \`<{{subAgents.facts.prompt.abc12345}}>\`
|
|
|
235950
235911
|
prompt: '<{{subAgents.facts.prompt.abc12345}}>'
|
|
235951
235912
|
|
|
235952
235913
|
FULL EXAMPLE:
|
|
235953
|
-
import { agent,
|
|
235914
|
+
import { agent, agent } from '@inkeep/agents-sdk';
|
|
235954
235915
|
import { contextConfig, fetchDefinition, headers } from '@inkeep/agents-core';
|
|
235955
235916
|
import { userProfile } from '../data-components/user-profile';
|
|
235956
235917
|
import { searchTool } from '../tools/search-tool';
|
|
235957
235918
|
import { weatherTool } from '../tools/weather-tool';
|
|
235958
235919
|
import { z } from 'zod';
|
|
235959
235920
|
|
|
235960
|
-
const
|
|
235921
|
+
const supportAgentHeaders = headers({
|
|
235961
235922
|
schema: z.object({
|
|
235962
235923
|
userId: z.string(),
|
|
235963
235924
|
sessionToken: z.string(),
|
|
@@ -235972,7 +235933,7 @@ const supportDescriptionFetchDefinition = fetchDefinition({
|
|
|
235972
235933
|
url: 'https://api.example.com/support-description',
|
|
235973
235934
|
method: 'GET',
|
|
235974
235935
|
headers: {
|
|
235975
|
-
'Authorization': \`Bearer \${
|
|
235936
|
+
'Authorization': \`Bearer \${supportAgentHeaders.toTemplate('sessionToken')}\`,
|
|
235976
235937
|
},
|
|
235977
235938
|
transform: 'data',
|
|
235978
235939
|
},
|
|
@@ -235982,8 +235943,8 @@ const supportDescriptionFetchDefinition = fetchDefinition({
|
|
|
235982
235943
|
defaultValue: 'Support Description',
|
|
235983
235944
|
});
|
|
235984
235945
|
|
|
235985
|
-
const
|
|
235986
|
-
headers:
|
|
235946
|
+
const supportAgentContext = contextConfig({
|
|
235947
|
+
headers: supportAgentHeaders,
|
|
235987
235948
|
contextVariables: {
|
|
235988
235949
|
supportDescription: supportDescriptionDefinition,
|
|
235989
235950
|
},
|
|
@@ -235992,7 +235953,7 @@ const supportGraphContext = contextConfig({
|
|
|
235992
235953
|
const routerAgent = agent({
|
|
235993
235954
|
id: 'router',
|
|
235994
235955
|
name: 'Router Agent',
|
|
235995
|
-
prompt: \`Route requests to appropriate agents using \${
|
|
235956
|
+
prompt: \`Route requests to appropriate agents using \${supportAgentContext.toTemplate('supportDescription.description')} for the user \${supportAgentHeaders.toTemplate('userId')}\`,
|
|
235996
235957
|
canTransferTo: () => [qaAgent]
|
|
235997
235958
|
});
|
|
235998
235959
|
|
|
@@ -236004,7 +235965,7 @@ const qaAgent = agent({
|
|
|
236004
235965
|
Follow these rules:
|
|
236005
235966
|
- Always be helpful
|
|
236006
235967
|
- Provide accurate answers
|
|
236007
|
-
- Use the user's name \${
|
|
235968
|
+
- Use the user's name \${supportAgentHeaders.toTemplate('userId')} when applicable
|
|
236008
235969
|
- Use available tools\`,
|
|
236009
235970
|
canUse: () => [searchTool, weatherTool],
|
|
236010
235971
|
selectedTools: {
|
|
@@ -236014,9 +235975,9 @@ Follow these rules:
|
|
|
236014
235975
|
dataComponents: () => [userProfile.config]
|
|
236015
235976
|
});
|
|
236016
235977
|
|
|
236017
|
-
export const
|
|
236018
|
-
id: 'support-
|
|
236019
|
-
name: 'Support
|
|
235978
|
+
export const supportAgent = agent({
|
|
235979
|
+
id: 'support-agent',
|
|
235980
|
+
name: 'Support Agent',
|
|
236020
235981
|
description: 'Multi-agent support system', // Only include if description has a value
|
|
236021
235982
|
defaultSubAgent: routerAgent,
|
|
236022
235983
|
subAgents: () => [routerAgent, qaAgent]
|
|
@@ -236025,38 +235986,38 @@ export const supportGraph = agentGraph({
|
|
|
236025
235986
|
Generate ONLY the TypeScript code without any markdown or explanations.`;
|
|
236026
235987
|
if (debug) {
|
|
236027
235988
|
console.log(`
|
|
236028
|
-
[DEBUG] === Starting
|
|
235989
|
+
[DEBUG] === Starting agent generation for: ${agentId} ===`);
|
|
236029
235990
|
console.log(`[DEBUG] Output path: ${outputPath}`);
|
|
236030
235991
|
console.log(`[DEBUG] Model: ${modelSettings.model || "default"}`);
|
|
236031
|
-
console.log(`[DEBUG]
|
|
236032
|
-
const agentCount = Object.keys(
|
|
235992
|
+
console.log(`[DEBUG] Agent data size: ${JSON.stringify(agentData).length} characters`);
|
|
235993
|
+
const agentCount = Object.keys(agentData.subAgents || {}).length;
|
|
236033
235994
|
const toolIds = /* @__PURE__ */ new Set();
|
|
236034
235995
|
const dataComponentIds = /* @__PURE__ */ new Set();
|
|
236035
235996
|
const artifactComponentIds = /* @__PURE__ */ new Set();
|
|
236036
|
-
for (const agent of Object.values(
|
|
236037
|
-
const
|
|
236038
|
-
if (
|
|
236039
|
-
for (const toolId of Object.keys(
|
|
235997
|
+
for (const agent of Object.values(agentData.subAgents || {})) {
|
|
235998
|
+
const agentData2 = agent;
|
|
235999
|
+
if (agentData2.tools) {
|
|
236000
|
+
for (const toolId of Object.keys(agentData2.tools)) {
|
|
236040
236001
|
toolIds.add(toolId);
|
|
236041
236002
|
}
|
|
236042
236003
|
}
|
|
236043
|
-
if (
|
|
236044
|
-
for (const id of Object.keys(
|
|
236004
|
+
if (agentData2.dataComponents) {
|
|
236005
|
+
for (const id of Object.keys(agentData2.dataComponents)) {
|
|
236045
236006
|
dataComponentIds.add(id);
|
|
236046
236007
|
}
|
|
236047
236008
|
}
|
|
236048
|
-
if (
|
|
236049
|
-
for (const id of Object.keys(
|
|
236009
|
+
if (agentData2.artifactComponents) {
|
|
236010
|
+
for (const id of Object.keys(agentData2.artifactComponents)) {
|
|
236050
236011
|
artifactComponentIds.add(id);
|
|
236051
236012
|
}
|
|
236052
236013
|
}
|
|
236053
236014
|
}
|
|
236054
|
-
console.log(`[DEBUG]
|
|
236015
|
+
console.log(`[DEBUG] Agent complexity:`);
|
|
236055
236016
|
console.log(`[DEBUG] - Agents: ${agentCount}`);
|
|
236056
236017
|
console.log(`[DEBUG] - Unique tools: ${toolIds.size}`);
|
|
236057
236018
|
console.log(`[DEBUG] - Data components: ${dataComponentIds.size}`);
|
|
236058
236019
|
console.log(`[DEBUG] - Artifact components: ${artifactComponentIds.size}`);
|
|
236059
|
-
console.log(`[DEBUG] - Context config: ${
|
|
236020
|
+
console.log(`[DEBUG] - Context config: ${agentData.contextConfig ? "Yes" : "No"}`);
|
|
236060
236021
|
}
|
|
236061
236022
|
try {
|
|
236062
236023
|
const startTime = Date.now();
|
|
@@ -236065,13 +236026,13 @@ Generate ONLY the TypeScript code without any markdown or explanations.`;
|
|
|
236065
236026
|
}
|
|
236066
236027
|
const text2 = await generateTextWithPlaceholders(
|
|
236067
236028
|
model,
|
|
236068
|
-
|
|
236029
|
+
agentData,
|
|
236069
236030
|
promptTemplate,
|
|
236070
236031
|
{
|
|
236071
236032
|
temperature: 0.1,
|
|
236072
236033
|
maxOutputTokens: 16e3,
|
|
236073
236034
|
abortSignal: AbortSignal.timeout(24e4)
|
|
236074
|
-
// 240 second timeout for complex
|
|
236035
|
+
// 240 second timeout for complex agent
|
|
236075
236036
|
},
|
|
236076
236037
|
debug
|
|
236077
236038
|
// Pass debug flag to show placeholder optimization info
|
|
@@ -236085,18 +236046,18 @@ Generate ONLY the TypeScript code without any markdown or explanations.`;
|
|
|
236085
236046
|
const cleanedCode = cleanGeneratedCode(text2);
|
|
236086
236047
|
writeFileSync3(outputPath, cleanedCode);
|
|
236087
236048
|
if (debug) {
|
|
236088
|
-
console.log(`[DEBUG]
|
|
236089
|
-
console.log(`[DEBUG] === Completed
|
|
236049
|
+
console.log(`[DEBUG] Agent file written successfully`);
|
|
236050
|
+
console.log(`[DEBUG] === Completed agent generation for: ${agentId} ===
|
|
236090
236051
|
`);
|
|
236091
236052
|
}
|
|
236092
236053
|
} catch (error) {
|
|
236093
236054
|
if (debug) {
|
|
236094
|
-
console.error(`[DEBUG] === ERROR generating
|
|
236055
|
+
console.error(`[DEBUG] === ERROR generating agent file ${agentId} ===`);
|
|
236095
236056
|
console.error(`[DEBUG] Error name: ${error.name}`);
|
|
236096
236057
|
console.error(`[DEBUG] Error message: ${error.message}`);
|
|
236097
236058
|
if (error.name === "AbortError") {
|
|
236098
236059
|
console.error(`[DEBUG] Request timed out after 240 seconds`);
|
|
236099
|
-
console.error(`[DEBUG] This might indicate the
|
|
236060
|
+
console.error(`[DEBUG] This might indicate the agent is too complex or the API is slow`);
|
|
236100
236061
|
}
|
|
236101
236062
|
if (error.response) {
|
|
236102
236063
|
console.error(`[DEBUG] Response status: ${error.response.status}`);
|
|
@@ -236498,7 +236459,7 @@ async function verifyGeneratedFiles(projectDir, originalProjectData, debug = fal
|
|
|
236498
236459
|
console.log(chalk7.gray("\n\u{1F50D} Structural Verification Summary:"));
|
|
236499
236460
|
console.log(chalk7.gray(` \u2022 Project loaded successfully: ${!!project}`));
|
|
236500
236461
|
console.log(
|
|
236501
|
-
chalk7.gray(` \u2022 Expected
|
|
236462
|
+
chalk7.gray(` \u2022 Expected agents: ${Object.keys(originalProjectData.agents || {}).length}`)
|
|
236502
236463
|
);
|
|
236503
236464
|
console.log(
|
|
236504
236465
|
chalk7.gray(` \u2022 Expected tools: ${Object.keys(originalProjectData.tools || {}).length}`)
|
|
@@ -236549,20 +236510,20 @@ function ensureDirectoryExists(dirPath) {
|
|
|
236549
236510
|
function createProjectStructure(projectDir, projectId) {
|
|
236550
236511
|
const dirName = projectDir.split("/").pop() || projectDir;
|
|
236551
236512
|
const projectRoot = dirName === projectId ? projectDir : join7(projectDir, projectId);
|
|
236552
|
-
const
|
|
236513
|
+
const agentsDir = join7(projectRoot, "agents");
|
|
236553
236514
|
const toolsDir = join7(projectRoot, "tools");
|
|
236554
236515
|
const dataComponentsDir = join7(projectRoot, "data-components");
|
|
236555
236516
|
const artifactComponentsDir = join7(projectRoot, "artifact-components");
|
|
236556
236517
|
const environmentsDir = join7(projectRoot, "environments");
|
|
236557
236518
|
ensureDirectoryExists(projectRoot);
|
|
236558
|
-
ensureDirectoryExists(
|
|
236519
|
+
ensureDirectoryExists(agentsDir);
|
|
236559
236520
|
ensureDirectoryExists(toolsDir);
|
|
236560
236521
|
ensureDirectoryExists(dataComponentsDir);
|
|
236561
236522
|
ensureDirectoryExists(artifactComponentsDir);
|
|
236562
236523
|
ensureDirectoryExists(environmentsDir);
|
|
236563
236524
|
return {
|
|
236564
236525
|
projectRoot,
|
|
236565
|
-
|
|
236526
|
+
agentsDir,
|
|
236566
236527
|
toolsDir,
|
|
236567
236528
|
dataComponentsDir,
|
|
236568
236529
|
artifactComponentsDir,
|
|
@@ -236570,17 +236531,17 @@ function createProjectStructure(projectDir, projectId) {
|
|
|
236570
236531
|
};
|
|
236571
236532
|
}
|
|
236572
236533
|
async function generateProjectFiles(dirs, projectData, modelSettings, environment = "development", debug = false) {
|
|
236573
|
-
const {
|
|
236534
|
+
const { agents: agents2, tools: tools2, dataComponents: dataComponents2, artifactComponents: artifactComponents2, credentialReferences: credentialReferences2 } = projectData;
|
|
236574
236535
|
const generationTasks = [];
|
|
236575
236536
|
const fileInfo = [];
|
|
236576
236537
|
const indexPath = join7(dirs.projectRoot, "index.ts");
|
|
236577
236538
|
generationTasks.push(generateIndexFile(projectData, indexPath, modelSettings));
|
|
236578
236539
|
fileInfo.push({ type: "config", name: "index.ts" });
|
|
236579
|
-
if (
|
|
236580
|
-
for (const [
|
|
236581
|
-
const
|
|
236582
|
-
generationTasks.push(
|
|
236583
|
-
fileInfo.push({ type: "
|
|
236540
|
+
if (agents2 && Object.keys(agents2).length > 0) {
|
|
236541
|
+
for (const [agentId, agentData] of Object.entries(agents2)) {
|
|
236542
|
+
const agentPath = join7(dirs.agentsDir, `${agentId}.ts`);
|
|
236543
|
+
generationTasks.push(generateAgentFile(agentData, agentId, agentPath, modelSettings));
|
|
236544
|
+
fileInfo.push({ type: "agent", name: `${agentId}.ts` });
|
|
236584
236545
|
}
|
|
236585
236546
|
}
|
|
236586
236547
|
if (tools2 && Object.keys(tools2).length > 0) {
|
|
@@ -236625,8 +236586,8 @@ async function generateProjectFiles(dirs, projectData, modelSettings, environmen
|
|
|
236625
236586
|
if (filesByType.config) {
|
|
236626
236587
|
console.log(chalk7.gray(` \u2022 Config files: ${filesByType.config.join(", ")}`));
|
|
236627
236588
|
}
|
|
236628
|
-
if (filesByType.
|
|
236629
|
-
console.log(chalk7.gray(` \u2022
|
|
236589
|
+
if (filesByType.agent) {
|
|
236590
|
+
console.log(chalk7.gray(` \u2022 Agent: ${filesByType.agent.join(", ")}`));
|
|
236630
236591
|
}
|
|
236631
236592
|
if (filesByType.tool) {
|
|
236632
236593
|
console.log(chalk7.gray(` \u2022 Tools: ${filesByType.tool.join(", ")}`));
|
|
@@ -236828,19 +236789,19 @@ async function pullProjectCommand(options) {
|
|
|
236828
236789
|
finalConfig.projectId
|
|
236829
236790
|
);
|
|
236830
236791
|
spinner.succeed("Project data fetched");
|
|
236831
|
-
const
|
|
236792
|
+
const agentCount = Object.keys(projectData.agents || {}).length;
|
|
236832
236793
|
const toolCount = Object.keys(projectData.tools || {}).length;
|
|
236833
|
-
const
|
|
236834
|
-
return total + Object.keys(
|
|
236794
|
+
const subAgentCount = Object.values(projectData.agents || {}).reduce((total, agent) => {
|
|
236795
|
+
return total + Object.keys(agent.subAgents || {}).length;
|
|
236835
236796
|
}, 0);
|
|
236836
236797
|
const dataComponentCount = Object.keys(projectData.dataComponents || {}).length;
|
|
236837
236798
|
const artifactComponentCount = Object.keys(projectData.artifactComponents || {}).length;
|
|
236838
236799
|
console.log(chalk7.cyan("\n\u{1F4CA} Project Summary:"));
|
|
236839
236800
|
console.log(chalk7.gray(` \u2022 Name: ${projectData.name}`));
|
|
236840
236801
|
console.log(chalk7.gray(` \u2022 Description: ${projectData.description || "No description"}`));
|
|
236841
|
-
console.log(chalk7.gray(` \u2022 Graphs: ${graphCount}`));
|
|
236842
|
-
console.log(chalk7.gray(` \u2022 Tools: ${toolCount}`));
|
|
236843
236802
|
console.log(chalk7.gray(` \u2022 Agents: ${agentCount}`));
|
|
236803
|
+
console.log(chalk7.gray(` \u2022 Tools: ${toolCount}`));
|
|
236804
|
+
console.log(chalk7.gray(` \u2022 SubAgents: ${subAgentCount}`));
|
|
236844
236805
|
if (dataComponentCount > 0) {
|
|
236845
236806
|
console.log(chalk7.gray(` \u2022 Data Components: ${dataComponentCount}`));
|
|
236846
236807
|
}
|
|
@@ -236893,12 +236854,12 @@ async function pullProjectCommand(options) {
|
|
|
236893
236854
|
options.debug || false
|
|
236894
236855
|
);
|
|
236895
236856
|
const fileCount = {
|
|
236896
|
-
|
|
236857
|
+
agents: Object.keys(projectData.agents || {}).length,
|
|
236897
236858
|
tools: Object.keys(projectData.tools || {}).length,
|
|
236898
236859
|
dataComponents: Object.keys(projectData.dataComponents || {}).length,
|
|
236899
236860
|
artifactComponents: Object.keys(projectData.artifactComponents || {}).length
|
|
236900
236861
|
};
|
|
236901
|
-
const totalFiles = fileCount.
|
|
236862
|
+
const totalFiles = fileCount.agents + fileCount.tools + fileCount.dataComponents + fileCount.artifactComponents + 5;
|
|
236902
236863
|
spinner.succeed(`Project files generated (${totalFiles} files created)`);
|
|
236903
236864
|
spinner.start("Verifying generated files...");
|
|
236904
236865
|
try {
|
|
@@ -236943,8 +236904,8 @@ async function pullProjectCommand(options) {
|
|
|
236943
236904
|
console.log(chalk7.cyan("\n\u{1F4C1} Generated structure:"));
|
|
236944
236905
|
console.log(chalk7.gray(` ${dirs.projectRoot}/`));
|
|
236945
236906
|
console.log(chalk7.gray(` \u251C\u2500\u2500 index.ts`));
|
|
236946
|
-
if (fileCount.
|
|
236947
|
-
console.log(chalk7.gray(` \u251C\u2500\u2500
|
|
236907
|
+
if (fileCount.agents > 0) {
|
|
236908
|
+
console.log(chalk7.gray(` \u251C\u2500\u2500 agents/ (${fileCount.agents} files)`));
|
|
236948
236909
|
}
|
|
236949
236910
|
if (fileCount.tools > 0) {
|
|
236950
236911
|
console.log(chalk7.gray(` \u251C\u2500\u2500 tools/ (${fileCount.tools} files)`));
|
|
@@ -237116,15 +237077,15 @@ async function pushCommand(options) {
|
|
|
237116
237077
|
spinner.succeed(`Project data saved to ${jsonFilePath}`);
|
|
237117
237078
|
console.log(chalk8.gray(` \u2022 File: ${jsonFilePath}`));
|
|
237118
237079
|
console.log(chalk8.gray(` \u2022 Size: ${JSON.stringify(projectDefinition).length} bytes`));
|
|
237119
|
-
const
|
|
237080
|
+
const agentCount = Object.keys(projectDefinition.agents || {}).length;
|
|
237120
237081
|
const toolCount = Object.keys(projectDefinition.tools || {}).length;
|
|
237121
|
-
const
|
|
237122
|
-
return total + Object.keys(
|
|
237082
|
+
const subAgentCount = Object.values(projectDefinition.agents || {}).reduce((total, agent) => {
|
|
237083
|
+
return total + Object.keys(agent.subAgents || {}).length;
|
|
237123
237084
|
}, 0);
|
|
237124
237085
|
console.log(chalk8.cyan("\n\u{1F4CA} Project Data Summary:"));
|
|
237125
|
-
console.log(chalk8.gray(` \u2022
|
|
237086
|
+
console.log(chalk8.gray(` \u2022 Agent: ${agentCount}`));
|
|
237126
237087
|
console.log(chalk8.gray(` \u2022 Tools: ${toolCount}`));
|
|
237127
|
-
console.log(chalk8.gray(` \u2022
|
|
237088
|
+
console.log(chalk8.gray(` \u2022 SubAgent: ${subAgentCount}`));
|
|
237128
237089
|
console.log(chalk8.green("\n\u2728 JSON file generated successfully!"));
|
|
237129
237090
|
process.exit(0);
|
|
237130
237091
|
} catch (error) {
|
|
@@ -237142,15 +237103,15 @@ async function pushCommand(options) {
|
|
|
237142
237103
|
console.log(chalk8.cyan("\n\u{1F4CA} Project Summary:"));
|
|
237143
237104
|
console.log(chalk8.gray(` \u2022 Project ID: ${projectId}`));
|
|
237144
237105
|
console.log(chalk8.gray(` \u2022 Name: ${projectName}`));
|
|
237145
|
-
console.log(chalk8.gray(` \u2022
|
|
237106
|
+
console.log(chalk8.gray(` \u2022 Agent: ${stats.agentCount}`));
|
|
237146
237107
|
console.log(chalk8.gray(` \u2022 Tenant: ${stats.tenantId}`));
|
|
237147
|
-
const
|
|
237148
|
-
if (
|
|
237149
|
-
console.log(chalk8.cyan("\n\u{1F4CA}
|
|
237150
|
-
for (const
|
|
237151
|
-
const
|
|
237108
|
+
const agents2 = project.getAgents();
|
|
237109
|
+
if (agents2.length > 0) {
|
|
237110
|
+
console.log(chalk8.cyan("\n\u{1F4CA} Agent Details:"));
|
|
237111
|
+
for (const agent of agents2) {
|
|
237112
|
+
const agentStats = agent.getStats();
|
|
237152
237113
|
console.log(
|
|
237153
|
-
chalk8.gray(` \u2022 ${
|
|
237114
|
+
chalk8.gray(` \u2022 ${agent.getName()} (${agent.getId()}): ${agentStats.agentCount} agents`)
|
|
237154
237115
|
);
|
|
237155
237116
|
}
|
|
237156
237117
|
}
|
|
@@ -237182,7 +237143,7 @@ async function pushCommand(options) {
|
|
|
237182
237143
|
}
|
|
237183
237144
|
console.log(chalk8.green("\n\u2728 Next steps:"));
|
|
237184
237145
|
console.log(chalk8.gray(` \u2022 Test your project: inkeep chat`));
|
|
237185
|
-
console.log(chalk8.gray(` \u2022 View all
|
|
237146
|
+
console.log(chalk8.gray(` \u2022 View all agent: inkeep list-agent`));
|
|
237186
237147
|
process.exit(0);
|
|
237187
237148
|
} catch (_error) {
|
|
237188
237149
|
if (spinner) {
|
|
@@ -237235,16 +237196,16 @@ program.command("pull").description("Pull entire project configuration from back
|
|
|
237235
237196
|
).option("--json", "Generate project data JSON file instead of updating files").option("--debug", "Enable debug logging for LLM generation").action(async (options) => {
|
|
237236
237197
|
await pullProjectCommand(options);
|
|
237237
237198
|
});
|
|
237238
|
-
program.command("chat [
|
|
237239
|
-
"Start an interactive chat session with
|
|
237240
|
-
).option("--tenant-id <tenant-id>", "Tenant ID").option("--agents-manage-api-url <url>", "Agents manage API URL").option("--agents-run-api-url <url>", "Agents run API URL").option("--config <path>", "Path to configuration file").option("--config-file-path <path>", "Path to configuration file (deprecated, use --config)").action(async (
|
|
237199
|
+
program.command("chat [agent-id]").description(
|
|
237200
|
+
"Start an interactive chat session with an agent (interactive selection if no ID provided)"
|
|
237201
|
+
).option("--tenant-id <tenant-id>", "Tenant ID").option("--agents-manage-api-url <url>", "Agents manage API URL").option("--agents-run-api-url <url>", "Agents run API URL").option("--config <path>", "Path to configuration file").option("--config-file-path <path>", "Path to configuration file (deprecated, use --config)").action(async (agentId, options) => {
|
|
237241
237202
|
const { chatCommandEnhanced: chatCommandEnhanced2 } = await Promise.resolve().then(() => (init_chat_enhanced(), chat_enhanced_exports));
|
|
237242
237203
|
const config = options.config || options.configFilePath;
|
|
237243
|
-
await chatCommandEnhanced2(
|
|
237204
|
+
await chatCommandEnhanced2(agentId, { ...options, config });
|
|
237244
237205
|
});
|
|
237245
|
-
program.command("list-
|
|
237206
|
+
program.command("list-agent").description("List all available agent for a specific project").requiredOption("--project <project-id>", "Project ID to list agent for").option("--tenant-id <tenant-id>", "Tenant ID").option("--agents-manage-api-url <url>", "Agents manage API URL").option("--config <path>", "Path to configuration file").option("--config-file-path <path>", "Path to configuration file (deprecated, use --config)").action(async (options) => {
|
|
237246
237207
|
const config = options.config || options.configFilePath;
|
|
237247
|
-
await
|
|
237208
|
+
await listAgentsCommand({ ...options, config });
|
|
237248
237209
|
});
|
|
237249
237210
|
program.command("dev").description("Start the Inkeep dashboard server").option("--port <port>", "Port to run the server on", "3000").option("--host <host>", "Host to bind the server to", "localhost").option("--build", "Build the Dashboard UI for production", false).option("--export", "Export the Next.js project source files", false).option("--output-dir <dir>", "Output directory for build files", "./inkeep-dev").option("--path", "Output the path to the Dashboard UI", false).action(async (options) => {
|
|
237250
237211
|
await devCommand({
|