@axiom-lattice/core 2.1.65 → 2.1.66
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +71 -2
- package/dist/index.d.ts +71 -2
- package/dist/index.js +547 -274
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +623 -355
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -53,6 +53,8 @@ __export(index_exports, {
|
|
|
53
53
|
FilesystemBackend: () => FilesystemBackend,
|
|
54
54
|
HumanMessage: () => import_messages5.HumanMessage,
|
|
55
55
|
InMemoryAssistantStore: () => InMemoryAssistantStore,
|
|
56
|
+
InMemoryBindingStore: () => InMemoryBindingStore,
|
|
57
|
+
InMemoryChannelInstallationStore: () => InMemoryChannelInstallationStore,
|
|
56
58
|
InMemoryChunkBuffer: () => InMemoryChunkBuffer,
|
|
57
59
|
InMemoryDatabaseConfigStore: () => InMemoryDatabaseConfigStore,
|
|
58
60
|
InMemoryMailboxStore: () => InMemoryMailboxStore,
|
|
@@ -138,6 +140,7 @@ __export(index_exports, {
|
|
|
138
140
|
describeCronExpression: () => describeCronExpression,
|
|
139
141
|
embeddingsLatticeManager: () => embeddingsLatticeManager,
|
|
140
142
|
encrypt: () => encrypt,
|
|
143
|
+
ensureBuiltinAgentsForTenant: () => ensureBuiltinAgentsForTenant,
|
|
141
144
|
eventBus: () => eventBus,
|
|
142
145
|
eventBusDefault: () => event_bus_default,
|
|
143
146
|
fileDataToString: () => fileDataToString,
|
|
@@ -150,6 +153,7 @@ __export(index_exports, {
|
|
|
150
153
|
getAllAgentConfigs: () => getAllAgentConfigs,
|
|
151
154
|
getAllBuiltInSkillMetas: () => getAllBuiltInSkillMetas,
|
|
152
155
|
getAllToolDefinitions: () => getAllToolDefinitions,
|
|
156
|
+
getBindingRegistry: () => getBindingRegistry,
|
|
153
157
|
getBuiltInSkillContent: () => getBuiltInSkillContent,
|
|
154
158
|
getBuiltInSkillMeta: () => getBuiltInSkillMeta,
|
|
155
159
|
getBuiltInSkillNames: () => getBuiltInSkillNames,
|
|
@@ -206,6 +210,7 @@ __export(index_exports, {
|
|
|
206
210
|
sandboxLatticeManager: () => sandboxLatticeManager,
|
|
207
211
|
sanitizeToolCallId: () => sanitizeToolCallId,
|
|
208
212
|
scheduleLatticeManager: () => scheduleLatticeManager,
|
|
213
|
+
setBindingRegistry: () => setBindingRegistry,
|
|
209
214
|
skillLatticeManager: () => skillLatticeManager,
|
|
210
215
|
sqlDatabaseManager: () => sqlDatabaseManager,
|
|
211
216
|
storeLatticeManager: () => storeLatticeManager,
|
|
@@ -976,6 +981,124 @@ registerToolLattice(
|
|
|
976
981
|
}
|
|
977
982
|
);
|
|
978
983
|
|
|
984
|
+
// src/tool_lattice/manage_binding/index.ts
|
|
985
|
+
var import_zod3 = __toESM(require("zod"));
|
|
986
|
+
|
|
987
|
+
// src/bindings_lattice/BindingRegistryHolder.ts
|
|
988
|
+
var registry = null;
|
|
989
|
+
function setBindingRegistry(r) {
|
|
990
|
+
registry = r;
|
|
991
|
+
}
|
|
992
|
+
function getBindingRegistry() {
|
|
993
|
+
if (!registry) {
|
|
994
|
+
throw new Error("BindingRegistry not initialized. Call setBindingRegistry() before any agent invocation.");
|
|
995
|
+
}
|
|
996
|
+
return registry;
|
|
997
|
+
}
|
|
998
|
+
|
|
999
|
+
// src/tool_lattice/manage_binding/index.ts
|
|
1000
|
+
var manageBindingSchema = import_zod3.default.object({
|
|
1001
|
+
action: import_zod3.default.enum(["create", "update", "delete", "list"]).describe("Action to perform on the binding"),
|
|
1002
|
+
channel: import_zod3.default.string().describe("Channel type: 'lark', 'email', 'slack'"),
|
|
1003
|
+
channelInstallationId: import_zod3.default.string().optional().describe("Channel installation ID"),
|
|
1004
|
+
senderId: import_zod3.default.string().optional().describe("Sender identifier (email address, Lark openId, Slack userId)"),
|
|
1005
|
+
agentId: import_zod3.default.string().optional().describe("Target agent ID to route messages to"),
|
|
1006
|
+
threadMode: import_zod3.default.enum(["fixed", "per_conversation"]).optional().describe("Thread mode: fixed or per_conversation"),
|
|
1007
|
+
senderDisplayName: import_zod3.default.string().optional().describe("Human-readable name for the sender")
|
|
1008
|
+
});
|
|
1009
|
+
registerToolLattice(
|
|
1010
|
+
"manage_binding",
|
|
1011
|
+
{
|
|
1012
|
+
name: "manage_binding",
|
|
1013
|
+
description: `Manage sender-to-agent bindings for external channels (email, Lark, Slack).
|
|
1014
|
+
Use this tool to create, update, delete, or list bindings that map external senders to agents.
|
|
1015
|
+
|
|
1016
|
+
- create: Bind a sender (email/Lark user/Slack user) to an agent. Required: channel, channelInstallationId, senderId, agentId. Optional: threadMode, senderDisplayName.
|
|
1017
|
+
- update: Update an existing binding's agentId, threadMode, or displayName. Required: channel, senderId, channelInstallationId. Optional: agentId, threadMode, senderDisplayName.
|
|
1018
|
+
- delete: Remove a binding. Required: channel, senderId, channelInstallationId.
|
|
1019
|
+
- list: List all bindings. Optional: channel, agentId, channelInstallationId.
|
|
1020
|
+
|
|
1021
|
+
A sender can only be bound to ONE agent per channel+installation combination.`,
|
|
1022
|
+
schema: manageBindingSchema
|
|
1023
|
+
},
|
|
1024
|
+
async (input) => {
|
|
1025
|
+
const registry2 = getBindingRegistry();
|
|
1026
|
+
switch (input.action) {
|
|
1027
|
+
case "create": {
|
|
1028
|
+
if (!input.channelInstallationId || !input.senderId || !input.agentId) {
|
|
1029
|
+
return JSON.stringify({
|
|
1030
|
+
success: false,
|
|
1031
|
+
error: "create requires channelInstallationId, senderId, and agentId"
|
|
1032
|
+
});
|
|
1033
|
+
}
|
|
1034
|
+
const binding = await registry2.create({
|
|
1035
|
+
channel: input.channel,
|
|
1036
|
+
channelInstallationId: input.channelInstallationId,
|
|
1037
|
+
tenantId: "default",
|
|
1038
|
+
senderId: input.senderId,
|
|
1039
|
+
agentId: input.agentId,
|
|
1040
|
+
threadMode: input.threadMode,
|
|
1041
|
+
senderDisplayName: input.senderDisplayName
|
|
1042
|
+
});
|
|
1043
|
+
return JSON.stringify({ success: true, data: binding });
|
|
1044
|
+
}
|
|
1045
|
+
case "update": {
|
|
1046
|
+
if (!input.channelInstallationId || !input.senderId) {
|
|
1047
|
+
return JSON.stringify({
|
|
1048
|
+
success: false,
|
|
1049
|
+
error: "update requires channelInstallationId and senderId to find the binding"
|
|
1050
|
+
});
|
|
1051
|
+
}
|
|
1052
|
+
const existing = await registry2.resolve({
|
|
1053
|
+
channel: input.channel,
|
|
1054
|
+
senderId: input.senderId,
|
|
1055
|
+
channelInstallationId: input.channelInstallationId,
|
|
1056
|
+
tenantId: "default"
|
|
1057
|
+
});
|
|
1058
|
+
if (!existing) {
|
|
1059
|
+
return JSON.stringify({ success: false, error: "Binding not found" });
|
|
1060
|
+
}
|
|
1061
|
+
const updated = await registry2.update(existing.id, {
|
|
1062
|
+
agentId: input.agentId,
|
|
1063
|
+
threadMode: input.threadMode,
|
|
1064
|
+
senderDisplayName: input.senderDisplayName
|
|
1065
|
+
});
|
|
1066
|
+
return JSON.stringify({ success: true, data: updated });
|
|
1067
|
+
}
|
|
1068
|
+
case "delete": {
|
|
1069
|
+
if (!input.channelInstallationId || !input.senderId) {
|
|
1070
|
+
return JSON.stringify({
|
|
1071
|
+
success: false,
|
|
1072
|
+
error: "delete requires channelInstallationId and senderId to find the binding"
|
|
1073
|
+
});
|
|
1074
|
+
}
|
|
1075
|
+
const existing = await registry2.resolve({
|
|
1076
|
+
channel: input.channel,
|
|
1077
|
+
senderId: input.senderId,
|
|
1078
|
+
channelInstallationId: input.channelInstallationId,
|
|
1079
|
+
tenantId: "default"
|
|
1080
|
+
});
|
|
1081
|
+
if (!existing) {
|
|
1082
|
+
return JSON.stringify({ success: false, error: "Binding not found" });
|
|
1083
|
+
}
|
|
1084
|
+
await registry2.delete(existing.id);
|
|
1085
|
+
return JSON.stringify({ success: true, message: "Binding deleted" });
|
|
1086
|
+
}
|
|
1087
|
+
case "list": {
|
|
1088
|
+
const bindings = await registry2.list({
|
|
1089
|
+
channel: input.channel,
|
|
1090
|
+
agentId: input.agentId,
|
|
1091
|
+
tenantId: "default",
|
|
1092
|
+
channelInstallationId: input.channelInstallationId
|
|
1093
|
+
});
|
|
1094
|
+
return JSON.stringify({ success: true, data: bindings });
|
|
1095
|
+
}
|
|
1096
|
+
default:
|
|
1097
|
+
return JSON.stringify({ success: false, error: `Unknown action: ${input.action}` });
|
|
1098
|
+
}
|
|
1099
|
+
}
|
|
1100
|
+
);
|
|
1101
|
+
|
|
979
1102
|
// src/tool_lattice/sql/SqlDatabaseManager.ts
|
|
980
1103
|
var PostgresDatabase = class {
|
|
981
1104
|
constructor(config) {
|
|
@@ -1336,7 +1459,7 @@ var SqlDatabaseManager = class _SqlDatabaseManager {
|
|
|
1336
1459
|
var sqlDatabaseManager = SqlDatabaseManager.getInstance();
|
|
1337
1460
|
|
|
1338
1461
|
// src/tool_lattice/sql/list_tables_sql.ts
|
|
1339
|
-
var
|
|
1462
|
+
var import_zod4 = __toESM(require("zod"));
|
|
1340
1463
|
var import_langchain = require("langchain");
|
|
1341
1464
|
|
|
1342
1465
|
// src/tool_lattice/sql/utils.ts
|
|
@@ -1380,15 +1503,15 @@ ${databaseKeys.map(
|
|
|
1380
1503
|
{
|
|
1381
1504
|
name: "list_tables_sql",
|
|
1382
1505
|
description: `${LIST_TABLES_SQL_DESCRIPTION}${availableDbsText}`,
|
|
1383
|
-
schema:
|
|
1384
|
-
databaseKey:
|
|
1506
|
+
schema: import_zod4.default.object({
|
|
1507
|
+
databaseKey: import_zod4.default.string().describe(`Target database to list tables. Choose from: ${databaseKeys.join(", ")}`)
|
|
1385
1508
|
})
|
|
1386
1509
|
}
|
|
1387
1510
|
);
|
|
1388
1511
|
};
|
|
1389
1512
|
|
|
1390
1513
|
// src/tool_lattice/sql/info_sql.ts
|
|
1391
|
-
var
|
|
1514
|
+
var import_zod5 = __toESM(require("zod"));
|
|
1392
1515
|
var import_langchain2 = require("langchain");
|
|
1393
1516
|
var INFO_SQL_DESCRIPTION = `Get detailed schema information for specified tables, including column names, types, constraints (primary keys, foreign keys), and sample rows. Input should be a comma-separated list of table names.`;
|
|
1394
1517
|
var createInfoSqlTool = ({ databaseKeys, databaseDescriptions, getTenantId: getTenantId2 }) => {
|
|
@@ -1429,11 +1552,11 @@ ${databaseKeys.map(
|
|
|
1429
1552
|
{
|
|
1430
1553
|
name: "info_sql",
|
|
1431
1554
|
description: `${INFO_SQL_DESCRIPTION}${availableDbsText}`,
|
|
1432
|
-
schema:
|
|
1433
|
-
tables:
|
|
1555
|
+
schema: import_zod5.default.object({
|
|
1556
|
+
tables: import_zod5.default.string().describe(
|
|
1434
1557
|
"Comma-separated list of table names to get information for. Example: 'users, orders, products'"
|
|
1435
1558
|
),
|
|
1436
|
-
databaseKey:
|
|
1559
|
+
databaseKey: import_zod5.default.string().describe(`Target database to get table info. Choose from: ${databaseKeys.join(", ")}`)
|
|
1437
1560
|
})
|
|
1438
1561
|
}
|
|
1439
1562
|
);
|
|
@@ -1464,7 +1587,7 @@ Table: ${schema.tableName}`);
|
|
|
1464
1587
|
}
|
|
1465
1588
|
|
|
1466
1589
|
// src/tool_lattice/sql/query_checker_sql.ts
|
|
1467
|
-
var
|
|
1590
|
+
var import_zod6 = __toESM(require("zod"));
|
|
1468
1591
|
var import_langchain3 = require("langchain");
|
|
1469
1592
|
var DANGEROUS_KEYWORDS = [
|
|
1470
1593
|
"DROP",
|
|
@@ -1607,16 +1730,16 @@ ${trimmedQuery}
|
|
|
1607
1730
|
{
|
|
1608
1731
|
name: "query_checker_sql",
|
|
1609
1732
|
description: `Check a SQL query for common issues before execution. This tool validates syntax, checks for dangerous operations, and provides suggestions for improvement. Use this before executing queries to ensure they are safe and correct.${availableDbsText}`,
|
|
1610
|
-
schema:
|
|
1611
|
-
query:
|
|
1612
|
-
databaseKey:
|
|
1733
|
+
schema: import_zod6.default.object({
|
|
1734
|
+
query: import_zod6.default.string().describe("The SQL query to check and validate."),
|
|
1735
|
+
databaseKey: import_zod6.default.string().describe(`Target database to validate query against. Choose from: ${databaseKeys.join(", ")}`)
|
|
1613
1736
|
})
|
|
1614
1737
|
}
|
|
1615
1738
|
);
|
|
1616
1739
|
};
|
|
1617
1740
|
|
|
1618
1741
|
// src/tool_lattice/sql/query_sql.ts
|
|
1619
|
-
var
|
|
1742
|
+
var import_zod7 = __toESM(require("zod"));
|
|
1620
1743
|
var import_langchain4 = require("langchain");
|
|
1621
1744
|
function formatQueryResult(rows, fields) {
|
|
1622
1745
|
if (rows.length === 0) {
|
|
@@ -1679,11 +1802,11 @@ ${databaseKeys.map(
|
|
|
1679
1802
|
{
|
|
1680
1803
|
name: "query_sql",
|
|
1681
1804
|
description: `Execute a SQL query against the database and return the results.${availableDbsText}`,
|
|
1682
|
-
schema:
|
|
1683
|
-
query:
|
|
1805
|
+
schema: import_zod7.default.object({
|
|
1806
|
+
query: import_zod7.default.string().describe(
|
|
1684
1807
|
"The SQL query to execute. Should be a valid SELECT, INSERT, UPDATE, or DELETE statement."
|
|
1685
1808
|
),
|
|
1686
|
-
databaseKey:
|
|
1809
|
+
databaseKey: import_zod7.default.string().describe(`Target database to execute the query. Choose from: ${databaseKeys.join(", ")}`)
|
|
1687
1810
|
})
|
|
1688
1811
|
}
|
|
1689
1812
|
);
|
|
@@ -2541,7 +2664,7 @@ var MetricsServerManager = class _MetricsServerManager {
|
|
|
2541
2664
|
var metricsServerManager = MetricsServerManager.getInstance();
|
|
2542
2665
|
|
|
2543
2666
|
// src/tool_lattice/metrics/list_metrics_servers.ts
|
|
2544
|
-
var
|
|
2667
|
+
var import_zod8 = __toESM(require("zod"));
|
|
2545
2668
|
var import_langchain5 = require("langchain");
|
|
2546
2669
|
var LIST_METRICS_SERVERS_DESCRIPTION = `List all registered metrics servers. Returns a list of available metrics servers with their keys and types. Use this tool first to understand what metrics servers are available.`;
|
|
2547
2670
|
var createListMetricsServersTool = ({ serverKeys, serverDescriptions, getTenantId: getTenantId2 }) => {
|
|
@@ -2572,13 +2695,13 @@ ${lines.join("\n")}`;
|
|
|
2572
2695
|
{
|
|
2573
2696
|
name: "list_metrics_servers",
|
|
2574
2697
|
description: `${LIST_METRICS_SERVERS_DESCRIPTION}${availableServersText}`,
|
|
2575
|
-
schema:
|
|
2698
|
+
schema: import_zod8.default.object({})
|
|
2576
2699
|
}
|
|
2577
2700
|
);
|
|
2578
2701
|
};
|
|
2579
2702
|
|
|
2580
2703
|
// src/tool_lattice/metrics/list_datasources.ts
|
|
2581
|
-
var
|
|
2704
|
+
var import_zod9 = __toESM(require("zod"));
|
|
2582
2705
|
var import_langchain6 = require("langchain");
|
|
2583
2706
|
var LIST_METRICS_DATASOURCES_DESCRIPTION = `List all available datasources from all configured metrics servers. Returns a table with Server Key, DataSource ID, and DataSource Name. Use this tool first to discover what datasources are available before querying metrics.`;
|
|
2584
2707
|
var createListMetricsDataSourcesTool = ({ serverKeys, serverDescriptions, getTenantId: getTenantId2, connectAll }) => {
|
|
@@ -2657,13 +2780,13 @@ To view all available data sources, please clear the current selection or reopen
|
|
|
2657
2780
|
{
|
|
2658
2781
|
name: "list_datasources",
|
|
2659
2782
|
description: `${LIST_METRICS_DATASOURCES_DESCRIPTION}${availableServersText}`,
|
|
2660
|
-
schema:
|
|
2783
|
+
schema: import_zod9.default.object({})
|
|
2661
2784
|
}
|
|
2662
2785
|
);
|
|
2663
2786
|
};
|
|
2664
2787
|
|
|
2665
2788
|
// src/tool_lattice/metrics/query_metrics_list.ts
|
|
2666
|
-
var
|
|
2789
|
+
var import_zod10 = __toESM(require("zod"));
|
|
2667
2790
|
var import_langchain7 = require("langchain");
|
|
2668
2791
|
var QUERY_METRICS_LIST_DESCRIPTION = `Query Available Metrics - Step 1 of the Metrics Workflow
|
|
2669
2792
|
|
|
@@ -2804,16 +2927,16 @@ ${serverKeys.map(
|
|
|
2804
2927
|
{
|
|
2805
2928
|
name: "query_metrics_list",
|
|
2806
2929
|
description: `${QUERY_METRICS_LIST_DESCRIPTION}${availableServersText}`,
|
|
2807
|
-
schema:
|
|
2808
|
-
serverKey:
|
|
2809
|
-
datasourceIds:
|
|
2930
|
+
schema: import_zod10.default.object({
|
|
2931
|
+
serverKey: import_zod10.default.string().optional().describe(`Target semantic metrics server. Choose from: ${serverKeys.join(", ")}. Optional if configured in runConfig.metricsDataSource`),
|
|
2932
|
+
datasourceIds: import_zod10.default.array(import_zod10.default.string()).optional().describe("Optional array of datasource IDs to query. If not provided, uses all selected datasources or the one configured in runConfig.metricsDataSource.")
|
|
2810
2933
|
})
|
|
2811
2934
|
}
|
|
2812
2935
|
);
|
|
2813
2936
|
};
|
|
2814
2937
|
|
|
2815
2938
|
// src/tool_lattice/metrics/query_metric_definition.ts
|
|
2816
|
-
var
|
|
2939
|
+
var import_zod11 = __toESM(require("zod"));
|
|
2817
2940
|
var import_langchain8 = require("langchain");
|
|
2818
2941
|
var QUERY_METRIC_DEFINITION_DESCRIPTION = `Get Metric Definition - Step 2 of the Metrics Workflow
|
|
2819
2942
|
|
|
@@ -2925,17 +3048,17 @@ ${serverKeys.map(
|
|
|
2925
3048
|
{
|
|
2926
3049
|
name: "query_metric_definition",
|
|
2927
3050
|
description: `${QUERY_METRIC_DEFINITION_DESCRIPTION}${availableServersText}`,
|
|
2928
|
-
schema:
|
|
2929
|
-
serverKey:
|
|
2930
|
-
metricName:
|
|
2931
|
-
datasourceId:
|
|
3051
|
+
schema: import_zod11.default.object({
|
|
3052
|
+
serverKey: import_zod11.default.string().optional().describe(`Target semantic metrics server. Choose from: ${serverKeys.join(", ")}. Optional if configured in runConfig.metricsDataSource`),
|
|
3053
|
+
metricName: import_zod11.default.string().describe("The name of the metric to get definition for."),
|
|
3054
|
+
datasourceId: import_zod11.default.string().optional().describe("Optional specific datasource ID to search in. If not provided, uses the one configured in runConfig.metricsDataSource or searches all selected datasources.")
|
|
2932
3055
|
})
|
|
2933
3056
|
}
|
|
2934
3057
|
);
|
|
2935
3058
|
};
|
|
2936
3059
|
|
|
2937
3060
|
// src/tool_lattice/metrics/query_semantic_metric_data.ts
|
|
2938
|
-
var
|
|
3061
|
+
var import_zod12 = __toESM(require("zod"));
|
|
2939
3062
|
var import_langchain9 = require("langchain");
|
|
2940
3063
|
var QUERY_SEMANTIC_METRIC_DATA_DESCRIPTION = `Query Metric Data - Step 3 of the Metrics Workflow
|
|
2941
3064
|
|
|
@@ -3152,24 +3275,24 @@ ${serverKeys.map(
|
|
|
3152
3275
|
{
|
|
3153
3276
|
name: "query_semantic_metric_data",
|
|
3154
3277
|
description: `${QUERY_SEMANTIC_METRIC_DATA_DESCRIPTION}${availableServersText}`,
|
|
3155
|
-
schema:
|
|
3156
|
-
serverKey:
|
|
3157
|
-
datasourceId:
|
|
3158
|
-
metrics:
|
|
3159
|
-
groupBy:
|
|
3160
|
-
filters:
|
|
3161
|
-
dimension:
|
|
3162
|
-
operator:
|
|
3163
|
-
values:
|
|
3278
|
+
schema: import_zod12.default.object({
|
|
3279
|
+
serverKey: import_zod12.default.string().optional().describe(`Target semantic metrics server. Choose from: ${serverKeys.join(", ")}. Optional if configured in runConfig.metricsDataSource`),
|
|
3280
|
+
datasourceId: import_zod12.default.string().optional().describe("The data source ID to query metrics from. Optional if configured in runConfig.metricsDataSource"),
|
|
3281
|
+
metrics: import_zod12.default.array(import_zod12.default.string()).describe("Array of metric names to query (e.g., ['net_sales_amt', 'gross_profit'])."),
|
|
3282
|
+
groupBy: import_zod12.default.array(import_zod12.default.string()).optional().describe("Optional array of dimensions to group by (e.g., ['DocDate__month', 'CustomerCode'])."),
|
|
3283
|
+
filters: import_zod12.default.array(import_zod12.default.object({
|
|
3284
|
+
dimension: import_zod12.default.string().describe("Dimension/column name to filter on"),
|
|
3285
|
+
operator: import_zod12.default.string().describe("Operator (e.g., 'BETWEEN', '=', '>', '<')"),
|
|
3286
|
+
values: import_zod12.default.array(import_zod12.default.union([import_zod12.default.string(), import_zod12.default.number(), import_zod12.default.boolean()])).describe("Filter values")
|
|
3164
3287
|
})).optional().describe("Optional array of filters to apply to the query."),
|
|
3165
|
-
limit:
|
|
3288
|
+
limit: import_zod12.default.number().optional().describe("Maximum number of results to return (default: 1000).")
|
|
3166
3289
|
})
|
|
3167
3290
|
}
|
|
3168
3291
|
);
|
|
3169
3292
|
};
|
|
3170
3293
|
|
|
3171
3294
|
// src/tool_lattice/metrics/query_tables_list.ts
|
|
3172
|
-
var
|
|
3295
|
+
var import_zod13 = __toESM(require("zod"));
|
|
3173
3296
|
var import_langchain10 = require("langchain");
|
|
3174
3297
|
var QUERY_TABLES_LIST_DESCRIPTION = `Query available tables from a semantic metrics server. Returns a list of data tables with their schemas and descriptions. Use this tool to discover what tables are available in the data source.`;
|
|
3175
3298
|
var createQueryTablesListTool = ({ serverKeys, serverDescriptions, getTenantId: getTenantId2, connectAll }) => {
|
|
@@ -3264,16 +3387,16 @@ ${serverKeys.map(
|
|
|
3264
3387
|
{
|
|
3265
3388
|
name: "query_tables_list",
|
|
3266
3389
|
description: `${QUERY_TABLES_LIST_DESCRIPTION}${availableServersText}`,
|
|
3267
|
-
schema:
|
|
3268
|
-
serverKey:
|
|
3269
|
-
datasourceIds:
|
|
3390
|
+
schema: import_zod13.default.object({
|
|
3391
|
+
serverKey: import_zod13.default.string().optional().describe(`Target semantic metrics server. Choose from: ${serverKeys.join(", ")}. Optional if configured in runConfig.metricsDataSource`),
|
|
3392
|
+
datasourceIds: import_zod13.default.array(import_zod13.default.string()).optional().describe("Optional array of datasource IDs to query. If not provided, uses the one configured in runConfig.metricsDataSource or all selected datasources.")
|
|
3270
3393
|
})
|
|
3271
3394
|
}
|
|
3272
3395
|
);
|
|
3273
3396
|
};
|
|
3274
3397
|
|
|
3275
3398
|
// src/tool_lattice/metrics/query_table_definition.ts
|
|
3276
|
-
var
|
|
3399
|
+
var import_zod14 = __toESM(require("zod"));
|
|
3277
3400
|
var import_langchain11 = require("langchain");
|
|
3278
3401
|
var QUERY_TABLE_DEFINITION_DESCRIPTION = `Get detailed definition and schema for a specific table from a semantic metrics server. Returns comprehensive information including column definitions, SQL query, and table relationships.`;
|
|
3279
3402
|
var createQueryTableDefinitionTool = ({ serverKeys, serverDescriptions, getTenantId: getTenantId2, connectAll }) => {
|
|
@@ -3366,17 +3489,17 @@ ${serverKeys.map(
|
|
|
3366
3489
|
{
|
|
3367
3490
|
name: "query_table_definition",
|
|
3368
3491
|
description: `${QUERY_TABLE_DEFINITION_DESCRIPTION}${availableServersText}`,
|
|
3369
|
-
schema:
|
|
3370
|
-
serverKey:
|
|
3371
|
-
tableName:
|
|
3372
|
-
datasourceId:
|
|
3492
|
+
schema: import_zod14.default.object({
|
|
3493
|
+
serverKey: import_zod14.default.string().optional().describe(`Target semantic metrics server. Choose from: ${serverKeys.join(", ")}. Optional if configured in runConfig.metricsDataSource`),
|
|
3494
|
+
tableName: import_zod14.default.string().describe("The name of the table to get definition for."),
|
|
3495
|
+
datasourceId: import_zod14.default.string().optional().describe("Optional specific datasource ID to search in. If not provided, uses the one configured in runConfig.metricsDataSource or searches all selected datasources.")
|
|
3373
3496
|
})
|
|
3374
3497
|
}
|
|
3375
3498
|
);
|
|
3376
3499
|
};
|
|
3377
3500
|
|
|
3378
3501
|
// src/tool_lattice/metrics/execute_sql_query.ts
|
|
3379
|
-
var
|
|
3502
|
+
var import_zod15 = __toESM(require("zod"));
|
|
3380
3503
|
var import_langchain12 = require("langchain");
|
|
3381
3504
|
var EXECUTE_SQL_QUERY_DESCRIPTION = `Execute Custom SQL Query - Advanced Data Analysis Tool
|
|
3382
3505
|
|
|
@@ -3472,19 +3595,19 @@ ${serverKeys.map(
|
|
|
3472
3595
|
{
|
|
3473
3596
|
name: "execute_sql_query",
|
|
3474
3597
|
description: `${EXECUTE_SQL_QUERY_DESCRIPTION}${availableServersText}`,
|
|
3475
|
-
schema:
|
|
3476
|
-
serverKey:
|
|
3477
|
-
datasourceId:
|
|
3478
|
-
customSql:
|
|
3479
|
-
params:
|
|
3480
|
-
limit:
|
|
3598
|
+
schema: import_zod15.default.object({
|
|
3599
|
+
serverKey: import_zod15.default.string().optional().describe(`Target semantic metrics server. Choose from: ${serverKeys.join(", ")}. Optional if configured in runConfig.metricsDataSource`),
|
|
3600
|
+
datasourceId: import_zod15.default.string().optional().describe("The data source ID to execute SQL against. Optional if configured in runConfig.metricsDataSource"),
|
|
3601
|
+
customSql: import_zod15.default.string().describe("Custom SQL query string with named parameters (e.g., :year, :category). Use double quotes for identifiers."),
|
|
3602
|
+
params: import_zod15.default.record(import_zod15.default.union([import_zod15.default.string(), import_zod15.default.number(), import_zod15.default.boolean()])).optional().describe("Optional parameters for the SQL query. Keys should match the :paramName placeholders in customSql."),
|
|
3603
|
+
limit: import_zod15.default.number().optional().describe("Maximum number of results to return (default: 100).")
|
|
3481
3604
|
})
|
|
3482
3605
|
}
|
|
3483
3606
|
);
|
|
3484
3607
|
};
|
|
3485
3608
|
|
|
3486
3609
|
// src/tool_lattice/code_eval/index.ts
|
|
3487
|
-
var
|
|
3610
|
+
var import_zod16 = __toESM(require("zod"));
|
|
3488
3611
|
|
|
3489
3612
|
// src/deep_agent_new/backends/volumeFilesystem.ts
|
|
3490
3613
|
var VolumeFilesystem = class {
|
|
@@ -3757,7 +3880,7 @@ var getSandBoxManager = (key = "default") => {
|
|
|
3757
3880
|
var import_langchain13 = require("langchain");
|
|
3758
3881
|
|
|
3759
3882
|
// src/tool_lattice/shell_exec/index.ts
|
|
3760
|
-
var
|
|
3883
|
+
var import_zod17 = __toESM(require("zod"));
|
|
3761
3884
|
var import_langchain14 = require("langchain");
|
|
3762
3885
|
var SHELL_EXEC_DESCRIPTION = `Execute a shell command in the sandbox environment.
|
|
3763
3886
|
|
|
@@ -3807,17 +3930,17 @@ ${executeResult.output}`;
|
|
|
3807
3930
|
{
|
|
3808
3931
|
name: "shell_exec",
|
|
3809
3932
|
description: SHELL_EXEC_DESCRIPTION,
|
|
3810
|
-
schema:
|
|
3811
|
-
command:
|
|
3812
|
-
exec_dir:
|
|
3813
|
-
timeout:
|
|
3933
|
+
schema: import_zod17.default.object({
|
|
3934
|
+
command: import_zod17.default.string().describe("Shell command to execute"),
|
|
3935
|
+
exec_dir: import_zod17.default.string().optional().describe("Working directory for the command (defaults to sandbox home directory)"),
|
|
3936
|
+
timeout: import_zod17.default.number().optional().describe("Timeout in seconds (defaults to 300)")
|
|
3814
3937
|
})
|
|
3815
3938
|
}
|
|
3816
3939
|
);
|
|
3817
3940
|
};
|
|
3818
3941
|
|
|
3819
3942
|
// src/tool_lattice/convert_to_markdown/index.ts
|
|
3820
|
-
var
|
|
3943
|
+
var import_zod18 = __toESM(require("zod"));
|
|
3821
3944
|
var CONVERT_TO_MARKDOWN_DESCRIPTION = `Convert a resource described by an http:, https:, file: or data: URI to markdown.
|
|
3822
3945
|
|
|
3823
3946
|
Args:
|
|
@@ -3834,8 +3957,8 @@ registerToolLattice(
|
|
|
3834
3957
|
name: "convert_to_markdown",
|
|
3835
3958
|
description: CONVERT_TO_MARKDOWN_DESCRIPTION,
|
|
3836
3959
|
needUserApprove: false,
|
|
3837
|
-
schema:
|
|
3838
|
-
uri:
|
|
3960
|
+
schema: import_zod18.default.object({
|
|
3961
|
+
uri: import_zod18.default.string().describe("The URI to convert.")
|
|
3839
3962
|
})
|
|
3840
3963
|
},
|
|
3841
3964
|
async (input, exe_config) => {
|
|
@@ -3867,7 +3990,7 @@ registerToolLattice(
|
|
|
3867
3990
|
);
|
|
3868
3991
|
|
|
3869
3992
|
// src/tool_lattice/browser/browser_navigate.ts
|
|
3870
|
-
var
|
|
3993
|
+
var import_zod19 = __toESM(require("zod"));
|
|
3871
3994
|
var import_langchain15 = require("langchain");
|
|
3872
3995
|
var import_sandbox = require("@agent-infra/sandbox");
|
|
3873
3996
|
var BROWSER_NAVIGATE_DESCRIPTION = `Navigate to a URL.
|
|
@@ -3896,15 +4019,15 @@ var createBrowserNavigateTool = ({ vmIsolation }) => {
|
|
|
3896
4019
|
{
|
|
3897
4020
|
name: "browser_navigate",
|
|
3898
4021
|
description: BROWSER_NAVIGATE_DESCRIPTION,
|
|
3899
|
-
schema:
|
|
3900
|
-
url:
|
|
4022
|
+
schema: import_zod19.default.object({
|
|
4023
|
+
url: import_zod19.default.string().describe("The URL to navigate to.")
|
|
3901
4024
|
})
|
|
3902
4025
|
}
|
|
3903
4026
|
);
|
|
3904
4027
|
};
|
|
3905
4028
|
|
|
3906
4029
|
// src/tool_lattice/browser/browser_click.ts
|
|
3907
|
-
var
|
|
4030
|
+
var import_zod20 = __toESM(require("zod"));
|
|
3908
4031
|
var import_langchain16 = require("langchain");
|
|
3909
4032
|
var import_sandbox2 = require("@agent-infra/sandbox");
|
|
3910
4033
|
var BROWSER_CLICK_DESCRIPTION = `Click an element on the page, before using the tool, use \`browser_get_clickable_elements\` to get the index of the element, but not call \`browser_get_clickable_elements\` multiple times.
|
|
@@ -3933,15 +4056,15 @@ var createBrowserClickTool = ({ vmIsolation }) => {
|
|
|
3933
4056
|
{
|
|
3934
4057
|
name: "browser_click",
|
|
3935
4058
|
description: BROWSER_CLICK_DESCRIPTION,
|
|
3936
|
-
schema:
|
|
3937
|
-
index:
|
|
4059
|
+
schema: import_zod20.default.object({
|
|
4060
|
+
index: import_zod20.default.number().describe("Index of the element to click")
|
|
3938
4061
|
})
|
|
3939
4062
|
}
|
|
3940
4063
|
);
|
|
3941
4064
|
};
|
|
3942
4065
|
|
|
3943
4066
|
// src/tool_lattice/browser/browser_get_text.ts
|
|
3944
|
-
var
|
|
4067
|
+
var import_zod21 = __toESM(require("zod"));
|
|
3945
4068
|
var import_langchain17 = require("langchain");
|
|
3946
4069
|
var import_sandbox3 = require("@agent-infra/sandbox");
|
|
3947
4070
|
var BROWSER_GET_TEXT_DESCRIPTION = `Get the text content of the current page.
|
|
@@ -3968,13 +4091,13 @@ var createBrowserGetTextTool = ({ vmIsolation }) => {
|
|
|
3968
4091
|
{
|
|
3969
4092
|
name: "browser_get_text",
|
|
3970
4093
|
description: BROWSER_GET_TEXT_DESCRIPTION,
|
|
3971
|
-
schema:
|
|
4094
|
+
schema: import_zod21.default.object({})
|
|
3972
4095
|
}
|
|
3973
4096
|
);
|
|
3974
4097
|
};
|
|
3975
4098
|
|
|
3976
4099
|
// src/tool_lattice/browser/browser_get_markdown.ts
|
|
3977
|
-
var
|
|
4100
|
+
var import_zod22 = __toESM(require("zod"));
|
|
3978
4101
|
var import_langchain18 = require("langchain");
|
|
3979
4102
|
var import_sandbox4 = require("@agent-infra/sandbox");
|
|
3980
4103
|
var BROWSER_GET_MARKDOWN_DESCRIPTION = `Get the markdown content of the current page.
|
|
@@ -4001,13 +4124,13 @@ var createBrowserGetMarkdownTool = ({ vmIsolation }) => {
|
|
|
4001
4124
|
{
|
|
4002
4125
|
name: "browser_get_markdown",
|
|
4003
4126
|
description: BROWSER_GET_MARKDOWN_DESCRIPTION,
|
|
4004
|
-
schema:
|
|
4127
|
+
schema: import_zod22.default.object({})
|
|
4005
4128
|
}
|
|
4006
4129
|
);
|
|
4007
4130
|
};
|
|
4008
4131
|
|
|
4009
4132
|
// src/tool_lattice/browser/browser_evaluate.ts
|
|
4010
|
-
var
|
|
4133
|
+
var import_zod23 = __toESM(require("zod"));
|
|
4011
4134
|
var import_langchain19 = require("langchain");
|
|
4012
4135
|
var import_sandbox5 = require("@agent-infra/sandbox");
|
|
4013
4136
|
var BROWSER_EVALUATE_DESCRIPTION = `Execute JavaScript in the browser console.
|
|
@@ -4036,15 +4159,15 @@ var createBrowserEvaluateTool = ({ vmIsolation }) => {
|
|
|
4036
4159
|
{
|
|
4037
4160
|
name: "browser_evaluate",
|
|
4038
4161
|
description: BROWSER_EVALUATE_DESCRIPTION,
|
|
4039
|
-
schema:
|
|
4040
|
-
script:
|
|
4162
|
+
schema: import_zod23.default.object({
|
|
4163
|
+
script: import_zod23.default.string().describe("JavaScript code to execute, () => { /* code */ }")
|
|
4041
4164
|
})
|
|
4042
4165
|
}
|
|
4043
4166
|
);
|
|
4044
4167
|
};
|
|
4045
4168
|
|
|
4046
4169
|
// src/tool_lattice/browser/browser_screenshot.ts
|
|
4047
|
-
var
|
|
4170
|
+
var import_zod24 = __toESM(require("zod"));
|
|
4048
4171
|
var import_langchain20 = require("langchain");
|
|
4049
4172
|
var import_sandbox6 = require("@agent-infra/sandbox");
|
|
4050
4173
|
var BROWSER_SCREENSHOT_DESCRIPTION = `Take a screenshot of the current page or a specific element.
|
|
@@ -4111,21 +4234,21 @@ var createBrowserScreenshotTool = ({ vmIsolation }) => {
|
|
|
4111
4234
|
{
|
|
4112
4235
|
name: "browser_screenshot",
|
|
4113
4236
|
description: BROWSER_SCREENSHOT_DESCRIPTION,
|
|
4114
|
-
schema:
|
|
4115
|
-
name:
|
|
4116
|
-
selector:
|
|
4117
|
-
index:
|
|
4118
|
-
width:
|
|
4119
|
-
height:
|
|
4120
|
-
fullPage:
|
|
4121
|
-
highlight:
|
|
4237
|
+
schema: import_zod24.default.object({
|
|
4238
|
+
name: import_zod24.default.string().optional().describe("Name for the screenshot"),
|
|
4239
|
+
selector: import_zod24.default.string().optional().describe("CSS selector for element to screenshot"),
|
|
4240
|
+
index: import_zod24.default.number().optional().describe("index of the element to screenshot"),
|
|
4241
|
+
width: import_zod24.default.number().optional().describe("Width in pixels (default: viewport width)"),
|
|
4242
|
+
height: import_zod24.default.number().optional().describe("Height in pixels (default: viewport height)"),
|
|
4243
|
+
fullPage: import_zod24.default.boolean().optional().describe("Full page screenshot (default: false)"),
|
|
4244
|
+
highlight: import_zod24.default.boolean().default(false).describe("Highlight the element")
|
|
4122
4245
|
})
|
|
4123
4246
|
}
|
|
4124
4247
|
);
|
|
4125
4248
|
};
|
|
4126
4249
|
|
|
4127
4250
|
// src/tool_lattice/browser/browser_scroll.ts
|
|
4128
|
-
var
|
|
4251
|
+
var import_zod25 = __toESM(require("zod"));
|
|
4129
4252
|
var import_langchain21 = require("langchain");
|
|
4130
4253
|
var import_sandbox7 = require("@agent-infra/sandbox");
|
|
4131
4254
|
var BROWSER_SCROLL_DESCRIPTION = `Scroll the page.
|
|
@@ -4154,15 +4277,15 @@ var createBrowserScrollTool = ({ vmIsolation }) => {
|
|
|
4154
4277
|
{
|
|
4155
4278
|
name: "browser_scroll",
|
|
4156
4279
|
description: BROWSER_SCROLL_DESCRIPTION,
|
|
4157
|
-
schema:
|
|
4158
|
-
amount:
|
|
4280
|
+
schema: import_zod25.default.object({
|
|
4281
|
+
amount: import_zod25.default.number().optional().describe("Pixels to scroll (positive for down, negative for up)")
|
|
4159
4282
|
})
|
|
4160
4283
|
}
|
|
4161
4284
|
);
|
|
4162
4285
|
};
|
|
4163
4286
|
|
|
4164
4287
|
// src/tool_lattice/browser/browser_form_input_fill.ts
|
|
4165
|
-
var
|
|
4288
|
+
var import_zod26 = __toESM(require("zod"));
|
|
4166
4289
|
var import_langchain22 = require("langchain");
|
|
4167
4290
|
var import_sandbox8 = require("@agent-infra/sandbox");
|
|
4168
4291
|
var BROWSER_FORM_INPUT_FILL_DESCRIPTION = `Fill out an input field, before using the tool, Either 'index' or 'selector' must be provided.
|
|
@@ -4197,18 +4320,18 @@ var createBrowserFormInputFillTool = ({ vmIsolation }) => {
|
|
|
4197
4320
|
{
|
|
4198
4321
|
name: "browser_form_input_fill",
|
|
4199
4322
|
description: BROWSER_FORM_INPUT_FILL_DESCRIPTION,
|
|
4200
|
-
schema:
|
|
4201
|
-
selector:
|
|
4202
|
-
index:
|
|
4203
|
-
value:
|
|
4204
|
-
clear:
|
|
4323
|
+
schema: import_zod26.default.object({
|
|
4324
|
+
selector: import_zod26.default.string().optional().describe("CSS selector for input field"),
|
|
4325
|
+
index: import_zod26.default.number().optional().describe("Index of the element to fill"),
|
|
4326
|
+
value: import_zod26.default.string().describe("Value to fill"),
|
|
4327
|
+
clear: import_zod26.default.boolean().default(false).describe("Whether to clear existing text before filling")
|
|
4205
4328
|
})
|
|
4206
4329
|
}
|
|
4207
4330
|
);
|
|
4208
4331
|
};
|
|
4209
4332
|
|
|
4210
4333
|
// src/tool_lattice/browser/browser_select.ts
|
|
4211
|
-
var
|
|
4334
|
+
var import_zod27 = __toESM(require("zod"));
|
|
4212
4335
|
var import_langchain23 = require("langchain");
|
|
4213
4336
|
var import_sandbox9 = require("@agent-infra/sandbox");
|
|
4214
4337
|
var BROWSER_SELECT_DESCRIPTION = `Select an element on the page with index, Either 'index' or 'selector' must be provided.
|
|
@@ -4241,17 +4364,17 @@ var createBrowserSelectTool = ({ vmIsolation }) => {
|
|
|
4241
4364
|
{
|
|
4242
4365
|
name: "browser_select",
|
|
4243
4366
|
description: BROWSER_SELECT_DESCRIPTION,
|
|
4244
|
-
schema:
|
|
4245
|
-
index:
|
|
4246
|
-
selector:
|
|
4247
|
-
value:
|
|
4367
|
+
schema: import_zod27.default.object({
|
|
4368
|
+
index: import_zod27.default.number().optional().describe("Index of the element to select"),
|
|
4369
|
+
selector: import_zod27.default.string().optional().describe("CSS selector for element to select"),
|
|
4370
|
+
value: import_zod27.default.string().describe("Value to select")
|
|
4248
4371
|
})
|
|
4249
4372
|
}
|
|
4250
4373
|
);
|
|
4251
4374
|
};
|
|
4252
4375
|
|
|
4253
4376
|
// src/tool_lattice/browser/browser_hover.ts
|
|
4254
|
-
var
|
|
4377
|
+
var import_zod28 = __toESM(require("zod"));
|
|
4255
4378
|
var import_langchain24 = require("langchain");
|
|
4256
4379
|
var import_sandbox10 = require("@agent-infra/sandbox");
|
|
4257
4380
|
var BROWSER_HOVER_DESCRIPTION = `Hover an element on the page, Either 'index' or 'selector' must be provided.
|
|
@@ -4282,16 +4405,16 @@ var createBrowserHoverTool = ({ vmIsolation }) => {
|
|
|
4282
4405
|
{
|
|
4283
4406
|
name: "browser_hover",
|
|
4284
4407
|
description: BROWSER_HOVER_DESCRIPTION,
|
|
4285
|
-
schema:
|
|
4286
|
-
index:
|
|
4287
|
-
selector:
|
|
4408
|
+
schema: import_zod28.default.object({
|
|
4409
|
+
index: import_zod28.default.number().optional().describe("Index of the element to hover"),
|
|
4410
|
+
selector: import_zod28.default.string().optional().describe("CSS selector for element to hover")
|
|
4288
4411
|
})
|
|
4289
4412
|
}
|
|
4290
4413
|
);
|
|
4291
4414
|
};
|
|
4292
4415
|
|
|
4293
4416
|
// src/tool_lattice/browser/browser_go_back.ts
|
|
4294
|
-
var
|
|
4417
|
+
var import_zod29 = __toESM(require("zod"));
|
|
4295
4418
|
var import_langchain25 = require("langchain");
|
|
4296
4419
|
var import_sandbox11 = require("@agent-infra/sandbox");
|
|
4297
4420
|
var BROWSER_GO_BACK_DESCRIPTION = `Go back to the previous page.
|
|
@@ -4318,13 +4441,13 @@ var createBrowserGoBackTool = ({ vmIsolation }) => {
|
|
|
4318
4441
|
{
|
|
4319
4442
|
name: "browser_go_back",
|
|
4320
4443
|
description: BROWSER_GO_BACK_DESCRIPTION,
|
|
4321
|
-
schema:
|
|
4444
|
+
schema: import_zod29.default.object({})
|
|
4322
4445
|
}
|
|
4323
4446
|
);
|
|
4324
4447
|
};
|
|
4325
4448
|
|
|
4326
4449
|
// src/tool_lattice/browser/browser_go_forward.ts
|
|
4327
|
-
var
|
|
4450
|
+
var import_zod30 = __toESM(require("zod"));
|
|
4328
4451
|
var import_langchain26 = require("langchain");
|
|
4329
4452
|
var import_sandbox12 = require("@agent-infra/sandbox");
|
|
4330
4453
|
var BROWSER_GO_FORWARD_DESCRIPTION = `Go forward to the next page.
|
|
@@ -4351,13 +4474,13 @@ var createBrowserGoForwardTool = ({ vmIsolation }) => {
|
|
|
4351
4474
|
{
|
|
4352
4475
|
name: "browser_go_forward",
|
|
4353
4476
|
description: BROWSER_GO_FORWARD_DESCRIPTION,
|
|
4354
|
-
schema:
|
|
4477
|
+
schema: import_zod30.default.object({})
|
|
4355
4478
|
}
|
|
4356
4479
|
);
|
|
4357
4480
|
};
|
|
4358
4481
|
|
|
4359
4482
|
// src/tool_lattice/browser/browser_new_tab.ts
|
|
4360
|
-
var
|
|
4483
|
+
var import_zod31 = __toESM(require("zod"));
|
|
4361
4484
|
var import_langchain27 = require("langchain");
|
|
4362
4485
|
var import_sandbox13 = require("@agent-infra/sandbox");
|
|
4363
4486
|
var BROWSER_NEW_TAB_DESCRIPTION = `Open a new tab.
|
|
@@ -4386,15 +4509,15 @@ var createBrowserNewTabTool = ({ vmIsolation }) => {
|
|
|
4386
4509
|
{
|
|
4387
4510
|
name: "browser_new_tab",
|
|
4388
4511
|
description: BROWSER_NEW_TAB_DESCRIPTION,
|
|
4389
|
-
schema:
|
|
4390
|
-
url:
|
|
4512
|
+
schema: import_zod31.default.object({
|
|
4513
|
+
url: import_zod31.default.string().describe("URL to open in the new tab")
|
|
4391
4514
|
})
|
|
4392
4515
|
}
|
|
4393
4516
|
);
|
|
4394
4517
|
};
|
|
4395
4518
|
|
|
4396
4519
|
// src/tool_lattice/browser/browser_tab_list.ts
|
|
4397
|
-
var
|
|
4520
|
+
var import_zod32 = __toESM(require("zod"));
|
|
4398
4521
|
var import_langchain28 = require("langchain");
|
|
4399
4522
|
var import_sandbox14 = require("@agent-infra/sandbox");
|
|
4400
4523
|
var BROWSER_TAB_LIST_DESCRIPTION = `Get the list of tabs.
|
|
@@ -4421,13 +4544,13 @@ var createBrowserTabListTool = ({ vmIsolation }) => {
|
|
|
4421
4544
|
{
|
|
4422
4545
|
name: "browser_tab_list",
|
|
4423
4546
|
description: BROWSER_TAB_LIST_DESCRIPTION,
|
|
4424
|
-
schema:
|
|
4547
|
+
schema: import_zod32.default.object({})
|
|
4425
4548
|
}
|
|
4426
4549
|
);
|
|
4427
4550
|
};
|
|
4428
4551
|
|
|
4429
4552
|
// src/tool_lattice/browser/browser_switch_tab.ts
|
|
4430
|
-
var
|
|
4553
|
+
var import_zod33 = __toESM(require("zod"));
|
|
4431
4554
|
var import_langchain29 = require("langchain");
|
|
4432
4555
|
var import_sandbox15 = require("@agent-infra/sandbox");
|
|
4433
4556
|
var BROWSER_SWITCH_TAB_DESCRIPTION = `Switch to a specific tab.
|
|
@@ -4456,15 +4579,15 @@ var createBrowserSwitchTabTool = ({ vmIsolation }) => {
|
|
|
4456
4579
|
{
|
|
4457
4580
|
name: "browser_switch_tab",
|
|
4458
4581
|
description: BROWSER_SWITCH_TAB_DESCRIPTION,
|
|
4459
|
-
schema:
|
|
4460
|
-
index:
|
|
4582
|
+
schema: import_zod33.default.object({
|
|
4583
|
+
index: import_zod33.default.number().describe("Tab index to switch to")
|
|
4461
4584
|
})
|
|
4462
4585
|
}
|
|
4463
4586
|
);
|
|
4464
4587
|
};
|
|
4465
4588
|
|
|
4466
4589
|
// src/tool_lattice/browser/browser_close_tab.ts
|
|
4467
|
-
var
|
|
4590
|
+
var import_zod34 = __toESM(require("zod"));
|
|
4468
4591
|
var import_langchain30 = require("langchain");
|
|
4469
4592
|
var import_sandbox16 = require("@agent-infra/sandbox");
|
|
4470
4593
|
var BROWSER_CLOSE_TAB_DESCRIPTION = `Close the current tab.
|
|
@@ -4491,13 +4614,13 @@ var createBrowserCloseTabTool = ({ vmIsolation }) => {
|
|
|
4491
4614
|
{
|
|
4492
4615
|
name: "browser_close_tab",
|
|
4493
4616
|
description: BROWSER_CLOSE_TAB_DESCRIPTION,
|
|
4494
|
-
schema:
|
|
4617
|
+
schema: import_zod34.default.object({})
|
|
4495
4618
|
}
|
|
4496
4619
|
);
|
|
4497
4620
|
};
|
|
4498
4621
|
|
|
4499
4622
|
// src/tool_lattice/browser/browser_close.ts
|
|
4500
|
-
var
|
|
4623
|
+
var import_zod35 = __toESM(require("zod"));
|
|
4501
4624
|
var import_langchain31 = require("langchain");
|
|
4502
4625
|
var import_sandbox17 = require("@agent-infra/sandbox");
|
|
4503
4626
|
var BROWSER_CLOSE_DESCRIPTION = `Close the browser when the task is done and the browser is not needed anymore.
|
|
@@ -4524,13 +4647,13 @@ var createBrowserCloseTool = ({ vmIsolation }) => {
|
|
|
4524
4647
|
{
|
|
4525
4648
|
name: "browser_close",
|
|
4526
4649
|
description: BROWSER_CLOSE_DESCRIPTION,
|
|
4527
|
-
schema:
|
|
4650
|
+
schema: import_zod35.default.object({})
|
|
4528
4651
|
}
|
|
4529
4652
|
);
|
|
4530
4653
|
};
|
|
4531
4654
|
|
|
4532
4655
|
// src/tool_lattice/browser/browser_press_key.ts
|
|
4533
|
-
var
|
|
4656
|
+
var import_zod36 = __toESM(require("zod"));
|
|
4534
4657
|
var import_langchain32 = require("langchain");
|
|
4535
4658
|
var import_sandbox18 = require("@agent-infra/sandbox");
|
|
4536
4659
|
var BROWSER_PRESS_KEY_DESCRIPTION = `Press a key on the keyboard.
|
|
@@ -4559,8 +4682,8 @@ var createBrowserPressKeyTool = ({ vmIsolation }) => {
|
|
|
4559
4682
|
{
|
|
4560
4683
|
name: "browser_press_key",
|
|
4561
4684
|
description: BROWSER_PRESS_KEY_DESCRIPTION,
|
|
4562
|
-
schema:
|
|
4563
|
-
key:
|
|
4685
|
+
schema: import_zod36.default.object({
|
|
4686
|
+
key: import_zod36.default.enum([
|
|
4564
4687
|
"Enter",
|
|
4565
4688
|
"Tab",
|
|
4566
4689
|
"Escape",
|
|
@@ -4607,7 +4730,7 @@ var createBrowserPressKeyTool = ({ vmIsolation }) => {
|
|
|
4607
4730
|
};
|
|
4608
4731
|
|
|
4609
4732
|
// src/tool_lattice/browser/browser_read_links.ts
|
|
4610
|
-
var
|
|
4733
|
+
var import_zod37 = __toESM(require("zod"));
|
|
4611
4734
|
var import_langchain33 = require("langchain");
|
|
4612
4735
|
var import_sandbox19 = require("@agent-infra/sandbox");
|
|
4613
4736
|
var BROWSER_READ_LINKS_DESCRIPTION = `Get all links on the current page.
|
|
@@ -4634,13 +4757,13 @@ var createBrowserReadLinksTool = ({ vmIsolation }) => {
|
|
|
4634
4757
|
{
|
|
4635
4758
|
name: "browser_read_links",
|
|
4636
4759
|
description: BROWSER_READ_LINKS_DESCRIPTION,
|
|
4637
|
-
schema:
|
|
4760
|
+
schema: import_zod37.default.object({})
|
|
4638
4761
|
}
|
|
4639
4762
|
);
|
|
4640
4763
|
};
|
|
4641
4764
|
|
|
4642
4765
|
// src/tool_lattice/browser/browser_get_clickable_elements.ts
|
|
4643
|
-
var
|
|
4766
|
+
var import_zod38 = __toESM(require("zod"));
|
|
4644
4767
|
var import_langchain34 = require("langchain");
|
|
4645
4768
|
var import_sandbox20 = require("@agent-infra/sandbox");
|
|
4646
4769
|
var BROWSER_GET_CLICKABLE_ELEMENTS_DESCRIPTION = `Get the clickable or hoverable or selectable elements on the current page, don't call this tool multiple times.
|
|
@@ -4667,13 +4790,13 @@ var createBrowserGetClickableElementsTool = ({ vmIsolation }) => {
|
|
|
4667
4790
|
{
|
|
4668
4791
|
name: "browser_get_clickable_elements",
|
|
4669
4792
|
description: BROWSER_GET_CLICKABLE_ELEMENTS_DESCRIPTION,
|
|
4670
|
-
schema:
|
|
4793
|
+
schema: import_zod38.default.object({})
|
|
4671
4794
|
}
|
|
4672
4795
|
);
|
|
4673
4796
|
};
|
|
4674
4797
|
|
|
4675
4798
|
// src/tool_lattice/browser/browser_get_download_list.ts
|
|
4676
|
-
var
|
|
4799
|
+
var import_zod39 = __toESM(require("zod"));
|
|
4677
4800
|
var import_langchain35 = require("langchain");
|
|
4678
4801
|
var import_sandbox21 = require("@agent-infra/sandbox");
|
|
4679
4802
|
var BROWSER_GET_DOWNLOAD_LIST_DESCRIPTION = `Get the list of downloaded files.
|
|
@@ -4700,13 +4823,13 @@ var createBrowserGetDownloadListTool = ({ vmIsolation }) => {
|
|
|
4700
4823
|
{
|
|
4701
4824
|
name: "browser_get_download_list",
|
|
4702
4825
|
description: BROWSER_GET_DOWNLOAD_LIST_DESCRIPTION,
|
|
4703
|
-
schema:
|
|
4826
|
+
schema: import_zod39.default.object({})
|
|
4704
4827
|
}
|
|
4705
4828
|
);
|
|
4706
4829
|
};
|
|
4707
4830
|
|
|
4708
4831
|
// src/tool_lattice/browser/get_info.ts
|
|
4709
|
-
var
|
|
4832
|
+
var import_zod40 = __toESM(require("zod"));
|
|
4710
4833
|
var import_langchain36 = require("langchain");
|
|
4711
4834
|
var import_sandbox22 = require("@agent-infra/sandbox");
|
|
4712
4835
|
var BROWSER_GET_INFO_DESCRIPTION = `Get information about browser, like CDP URL, viewport size, etc.
|
|
@@ -4735,7 +4858,7 @@ var createBrowserGetInfoTool = ({ vmIsolation }) => {
|
|
|
4735
4858
|
{
|
|
4736
4859
|
name: "browser_get_info",
|
|
4737
4860
|
description: BROWSER_GET_INFO_DESCRIPTION,
|
|
4738
|
-
schema:
|
|
4861
|
+
schema: import_zod40.default.object({})
|
|
4739
4862
|
}
|
|
4740
4863
|
);
|
|
4741
4864
|
};
|
|
@@ -4827,7 +4950,7 @@ var memory = new import_langgraph2.MemorySaver();
|
|
|
4827
4950
|
registerCheckpointSaver("default", memory);
|
|
4828
4951
|
|
|
4829
4952
|
// src/agent_lattice/builders/state.ts
|
|
4830
|
-
var
|
|
4953
|
+
var import_zod41 = require("@langchain/langgraph/zod");
|
|
4831
4954
|
var import_langgraph3 = require("@langchain/langgraph");
|
|
4832
4955
|
var createReactAgentSchema = (schema) => {
|
|
4833
4956
|
return schema ? import_langgraph3.MessagesZodState.extend(schema.shape) : void 0;
|
|
@@ -4840,9 +4963,9 @@ var import_langchain56 = require("langchain");
|
|
|
4840
4963
|
var import_langchain37 = require("langchain");
|
|
4841
4964
|
|
|
4842
4965
|
// src/middlewares/contextSchema.ts
|
|
4843
|
-
var
|
|
4844
|
-
var contextSchema =
|
|
4845
|
-
runConfig:
|
|
4966
|
+
var import_zod42 = __toESM(require("zod"));
|
|
4967
|
+
var contextSchema = import_zod42.default.object({
|
|
4968
|
+
runConfig: import_zod42.default.any()
|
|
4846
4969
|
});
|
|
4847
4970
|
|
|
4848
4971
|
// src/middlewares/codeEvalMiddleware.ts
|
|
@@ -5044,11 +5167,11 @@ function safeJsonParse(text, fallback) {
|
|
|
5044
5167
|
}
|
|
5045
5168
|
|
|
5046
5169
|
// src/tool_lattice/skill/load_skills.ts
|
|
5047
|
-
var
|
|
5170
|
+
var import_zod43 = __toESM(require("zod"));
|
|
5048
5171
|
var import_langchain40 = require("langchain");
|
|
5049
5172
|
|
|
5050
5173
|
// src/tool_lattice/skill/load_skill_content.ts
|
|
5051
|
-
var
|
|
5174
|
+
var import_zod44 = __toESM(require("zod"));
|
|
5052
5175
|
var import_langchain41 = require("langchain");
|
|
5053
5176
|
|
|
5054
5177
|
// src/skill_lattice/builtinSkills.ts
|
|
@@ -5410,8 +5533,8 @@ var createLoadSkillContentTool = () => {
|
|
|
5410
5533
|
{
|
|
5411
5534
|
name: "skill",
|
|
5412
5535
|
description: LOAD_SKILL_CONTENT_DESCRIPTION,
|
|
5413
|
-
schema:
|
|
5414
|
-
skill_name:
|
|
5536
|
+
schema: import_zod44.default.object({
|
|
5537
|
+
skill_name: import_zod44.default.string().describe("The name of the skill to load")
|
|
5415
5538
|
})
|
|
5416
5539
|
}
|
|
5417
5540
|
);
|
|
@@ -5504,7 +5627,7 @@ ${skillsPrompt}
|
|
|
5504
5627
|
var import_langchain43 = require("langchain");
|
|
5505
5628
|
var import_langgraph4 = require("@langchain/langgraph");
|
|
5506
5629
|
var import_v3 = require("zod/v3");
|
|
5507
|
-
var
|
|
5630
|
+
var import_zod45 = require("@langchain/langgraph/zod");
|
|
5508
5631
|
|
|
5509
5632
|
// src/deep_agent_new/backends/utils.ts
|
|
5510
5633
|
var import_micromatch = __toESM(require("micromatch"));
|
|
@@ -5975,7 +6098,7 @@ function fileDataReducer(left, right) {
|
|
|
5975
6098
|
return result;
|
|
5976
6099
|
}
|
|
5977
6100
|
var FilesystemStateSchema = import_v3.z.object({
|
|
5978
|
-
files: (0,
|
|
6101
|
+
files: (0, import_zod45.withLangGraph)(
|
|
5979
6102
|
import_v3.z.record(import_v3.z.string(), FileDataSchema).default({}),
|
|
5980
6103
|
{
|
|
5981
6104
|
reducer: {
|
|
@@ -6407,16 +6530,16 @@ var import_langgraph5 = require("@langchain/langgraph");
|
|
|
6407
6530
|
|
|
6408
6531
|
// src/tool_lattice/ask_user_to_clarify/index.ts
|
|
6409
6532
|
var import_langchain45 = require("langchain");
|
|
6410
|
-
var
|
|
6411
|
-
var questionSchema =
|
|
6412
|
-
question:
|
|
6413
|
-
options:
|
|
6414
|
-
type:
|
|
6415
|
-
required:
|
|
6416
|
-
allowOther:
|
|
6533
|
+
var import_zod46 = __toESM(require("zod"));
|
|
6534
|
+
var questionSchema = import_zod46.default.object({
|
|
6535
|
+
question: import_zod46.default.string().describe("The question text to ask the user"),
|
|
6536
|
+
options: import_zod46.default.array(import_zod46.default.string()).describe("List of EXACT, selectable values. Maximum 3 options allowed. DO NOT include any 'placeholder' options that require the user to type (e.g., do NOT add 'Enter manual value'). If manual input is needed, set allowOther to true instead."),
|
|
6537
|
+
type: import_zod46.default.enum(["single", "multiple"]).describe("Whether the question allows single or multiple selections"),
|
|
6538
|
+
required: import_zod46.default.boolean().optional().default(false).describe("Whether this question must be answered"),
|
|
6539
|
+
allowOther: import_zod46.default.boolean().optional().default(true).describe("Set to true to append an 'Other' option that opens a free-text input field. Use this for open-ended answers or when the 3 options cannot cover all possibilities.")
|
|
6417
6540
|
});
|
|
6418
|
-
var inputSchema =
|
|
6419
|
-
questions:
|
|
6541
|
+
var inputSchema = import_zod46.default.object({
|
|
6542
|
+
questions: import_zod46.default.array(questionSchema).min(1, "At least one question is required").describe("A structured sequence of clarification questions. Use these to gather missing parameters or disambiguate user intent before proceeding.")
|
|
6420
6543
|
});
|
|
6421
6544
|
function createAskUserToClarifyTool() {
|
|
6422
6545
|
return (0, import_langchain45.tool)(
|
|
@@ -6523,7 +6646,7 @@ var import_langchain49 = require("langchain");
|
|
|
6523
6646
|
|
|
6524
6647
|
// src/tool_lattice/widget/loadGuidelines.ts
|
|
6525
6648
|
var import_langchain47 = require("langchain");
|
|
6526
|
-
var
|
|
6649
|
+
var import_zod47 = require("zod");
|
|
6527
6650
|
|
|
6528
6651
|
// src/middlewares/guidelines/index.ts
|
|
6529
6652
|
var CORE = `# Imagine \u2014 Visual Creation Suite
|
|
@@ -7314,8 +7437,8 @@ function getGuidelines(modules) {
|
|
|
7314
7437
|
var AVAILABLE_MODULES = Object.keys(MODULE_SECTIONS);
|
|
7315
7438
|
|
|
7316
7439
|
// src/tool_lattice/widget/loadGuidelines.ts
|
|
7317
|
-
var LoadGuidelinesInputSchema =
|
|
7318
|
-
modules:
|
|
7440
|
+
var LoadGuidelinesInputSchema = import_zod47.z.object({
|
|
7441
|
+
modules: import_zod47.z.array(import_zod47.z.string()).describe(
|
|
7319
7442
|
"Which design modules to load. Choose all that apply. Available modules: [" + AVAILABLE_MODULES.join(",") + "]"
|
|
7320
7443
|
)
|
|
7321
7444
|
});
|
|
@@ -7335,7 +7458,7 @@ function createLoadGuidelinesTool() {
|
|
|
7335
7458
|
|
|
7336
7459
|
// src/tool_lattice/widget/showWidget.ts
|
|
7337
7460
|
var import_langchain48 = require("langchain");
|
|
7338
|
-
var
|
|
7461
|
+
var import_zod48 = require("zod");
|
|
7339
7462
|
function containsForbiddenTags(code) {
|
|
7340
7463
|
const forbiddenPatterns = [
|
|
7341
7464
|
/<!DOCTYPE/i,
|
|
@@ -7357,15 +7480,15 @@ function validateWidgetCode(code) {
|
|
|
7357
7480
|
}
|
|
7358
7481
|
return { valid: true };
|
|
7359
7482
|
}
|
|
7360
|
-
var ShowWidgetInputSchema =
|
|
7361
|
-
i_have_seen_guidelines:
|
|
7483
|
+
var ShowWidgetInputSchema = import_zod48.z.object({
|
|
7484
|
+
i_have_seen_guidelines: import_zod48.z.boolean().describe(
|
|
7362
7485
|
"Must be true. Confirm you have called load_guidelines first."
|
|
7363
7486
|
),
|
|
7364
|
-
title:
|
|
7365
|
-
loading_messages:
|
|
7487
|
+
title: import_zod48.z.string().describe("Title displayed above the widget"),
|
|
7488
|
+
loading_messages: import_zod48.z.array(import_zod48.z.string()).optional().describe(
|
|
7366
7489
|
"1-4 short strings shown while the widget renders"
|
|
7367
7490
|
),
|
|
7368
|
-
widget_code:
|
|
7491
|
+
widget_code: import_zod48.z.string().describe(
|
|
7369
7492
|
"HTML fragment to render. Rules: 1. No DOCTYPE, <html>, <head>, or <body> tags. 2. Order: <style> block first, then HTML content, then <script> last. 3. Use only CSS variables for colors (e.g. var(--color-accent)). 4. No gradients, shadows, or blur effects. For SVG: start directly with <svg> tag."
|
|
7370
7493
|
)
|
|
7371
7494
|
});
|
|
@@ -8133,7 +8256,7 @@ Please select a valid tool from the list above.`
|
|
|
8133
8256
|
|
|
8134
8257
|
// src/deep_agent_new/middleware/date.ts
|
|
8135
8258
|
var import_langchain53 = require("langchain");
|
|
8136
|
-
var
|
|
8259
|
+
var import_zod49 = require("zod");
|
|
8137
8260
|
function formatCurrentDate(timezone = "UTC") {
|
|
8138
8261
|
const now = /* @__PURE__ */ new Date();
|
|
8139
8262
|
let validTimezone = timezone;
|
|
@@ -8194,7 +8317,7 @@ function createDateMiddleware(options = {}) {
|
|
|
8194
8317
|
{
|
|
8195
8318
|
name: "get_current_date_time",
|
|
8196
8319
|
description: "Get the exact current date and time at the moment of invocation. Use this when the user asks about the current time (e.g., 'what time is it', '\u51E0\u70B9\u4E86', '\u73B0\u5728\u51E0\u70B9'), or when you need to know the precise time for scheduling, deadlines, or time-sensitive operations.",
|
|
8197
|
-
schema:
|
|
8320
|
+
schema: import_zod49.z.object({})
|
|
8198
8321
|
}
|
|
8199
8322
|
)
|
|
8200
8323
|
],
|
|
@@ -8213,7 +8336,7 @@ ${currentSystemPrompt}` : dateContext;
|
|
|
8213
8336
|
|
|
8214
8337
|
// src/deep_agent_new/middleware/scheduler.ts
|
|
8215
8338
|
var import_langchain55 = require("langchain");
|
|
8216
|
-
var
|
|
8339
|
+
var import_zod50 = require("zod");
|
|
8217
8340
|
var import_uuid2 = require("uuid");
|
|
8218
8341
|
var import_protocols8 = require("@axiom-lattice/protocols");
|
|
8219
8342
|
|
|
@@ -11153,6 +11276,138 @@ var InMemoryWorkflowTrackingStore = class {
|
|
|
11153
11276
|
}
|
|
11154
11277
|
};
|
|
11155
11278
|
|
|
11279
|
+
// src/store_lattice/InMemoryChannelInstallationStore.ts
|
|
11280
|
+
var InMemoryChannelInstallationStore = class {
|
|
11281
|
+
constructor() {
|
|
11282
|
+
this.installations = /* @__PURE__ */ new Map();
|
|
11283
|
+
}
|
|
11284
|
+
async getInstallationById(installationId) {
|
|
11285
|
+
return this.installations.get(installationId) || null;
|
|
11286
|
+
}
|
|
11287
|
+
async getInstallationsByTenant(tenantId, channel) {
|
|
11288
|
+
return Array.from(this.installations.values()).filter(
|
|
11289
|
+
(inst) => inst.tenantId === tenantId && (!channel || inst.channel === channel)
|
|
11290
|
+
);
|
|
11291
|
+
}
|
|
11292
|
+
async createInstallation(tenantId, installationId, data) {
|
|
11293
|
+
const now = /* @__PURE__ */ new Date();
|
|
11294
|
+
const installation = {
|
|
11295
|
+
id: installationId,
|
|
11296
|
+
tenantId,
|
|
11297
|
+
channel: data.channel,
|
|
11298
|
+
name: data.name,
|
|
11299
|
+
config: data.config,
|
|
11300
|
+
enabled: data.enabled ?? true,
|
|
11301
|
+
fallbackAgentId: data.fallbackAgentId,
|
|
11302
|
+
rejectWhenNoBinding: data.rejectWhenNoBinding ?? true,
|
|
11303
|
+
createdAt: now,
|
|
11304
|
+
updatedAt: now
|
|
11305
|
+
};
|
|
11306
|
+
this.installations.set(installationId, installation);
|
|
11307
|
+
return installation;
|
|
11308
|
+
}
|
|
11309
|
+
async updateInstallation(tenantId, installationId, updates) {
|
|
11310
|
+
const existing = this.installations.get(installationId);
|
|
11311
|
+
if (!existing || existing.tenantId !== tenantId) return null;
|
|
11312
|
+
const updated = {
|
|
11313
|
+
...existing,
|
|
11314
|
+
name: updates.name !== void 0 ? updates.name : existing.name,
|
|
11315
|
+
config: updates.config !== void 0 ? { ...existing.config, ...updates.config } : existing.config,
|
|
11316
|
+
enabled: updates.enabled !== void 0 ? updates.enabled : existing.enabled,
|
|
11317
|
+
fallbackAgentId: updates.fallbackAgentId !== void 0 ? updates.fallbackAgentId : existing.fallbackAgentId,
|
|
11318
|
+
rejectWhenNoBinding: updates.rejectWhenNoBinding !== void 0 ? updates.rejectWhenNoBinding : existing.rejectWhenNoBinding,
|
|
11319
|
+
updatedAt: /* @__PURE__ */ new Date()
|
|
11320
|
+
};
|
|
11321
|
+
this.installations.set(installationId, updated);
|
|
11322
|
+
return updated;
|
|
11323
|
+
}
|
|
11324
|
+
async deleteInstallation(tenantId, installationId) {
|
|
11325
|
+
const existing = this.installations.get(installationId);
|
|
11326
|
+
if (!existing || existing.tenantId !== tenantId) return false;
|
|
11327
|
+
return this.installations.delete(installationId);
|
|
11328
|
+
}
|
|
11329
|
+
clear() {
|
|
11330
|
+
this.installations.clear();
|
|
11331
|
+
}
|
|
11332
|
+
};
|
|
11333
|
+
|
|
11334
|
+
// src/store_lattice/InMemoryBindingStore.ts
|
|
11335
|
+
var import_crypto = require("crypto");
|
|
11336
|
+
var InMemoryBindingStore = class {
|
|
11337
|
+
constructor() {
|
|
11338
|
+
this.bindings = /* @__PURE__ */ new Map();
|
|
11339
|
+
}
|
|
11340
|
+
async resolve(params) {
|
|
11341
|
+
for (const binding of this.bindings.values()) {
|
|
11342
|
+
if (binding.channel === params.channel && binding.senderId === params.senderId && binding.channelInstallationId === params.channelInstallationId && binding.tenantId === params.tenantId && binding.enabled) {
|
|
11343
|
+
return binding;
|
|
11344
|
+
}
|
|
11345
|
+
}
|
|
11346
|
+
return null;
|
|
11347
|
+
}
|
|
11348
|
+
async create(input) {
|
|
11349
|
+
const now = /* @__PURE__ */ new Date();
|
|
11350
|
+
const binding = {
|
|
11351
|
+
id: (0, import_crypto.randomUUID)(),
|
|
11352
|
+
channel: input.channel,
|
|
11353
|
+
channelInstallationId: input.channelInstallationId,
|
|
11354
|
+
tenantId: input.tenantId,
|
|
11355
|
+
senderId: input.senderId,
|
|
11356
|
+
agentId: input.agentId,
|
|
11357
|
+
threadId: void 0,
|
|
11358
|
+
workspaceId: input.workspaceId,
|
|
11359
|
+
projectId: input.projectId,
|
|
11360
|
+
threadMode: input.threadMode || "fixed",
|
|
11361
|
+
senderDisplayName: input.senderDisplayName,
|
|
11362
|
+
senderMetadata: input.senderMetadata,
|
|
11363
|
+
enabled: true,
|
|
11364
|
+
createdAt: now,
|
|
11365
|
+
updatedAt: now
|
|
11366
|
+
};
|
|
11367
|
+
this.bindings.set(binding.id, binding);
|
|
11368
|
+
return binding;
|
|
11369
|
+
}
|
|
11370
|
+
async update(id, patch) {
|
|
11371
|
+
const existing = this.bindings.get(id);
|
|
11372
|
+
if (!existing) throw new Error(`Binding ${id} not found`);
|
|
11373
|
+
const updated = {
|
|
11374
|
+
...existing,
|
|
11375
|
+
...patch,
|
|
11376
|
+
updatedAt: /* @__PURE__ */ new Date()
|
|
11377
|
+
};
|
|
11378
|
+
this.bindings.set(id, updated);
|
|
11379
|
+
return updated;
|
|
11380
|
+
}
|
|
11381
|
+
async delete(id) {
|
|
11382
|
+
this.bindings.delete(id);
|
|
11383
|
+
}
|
|
11384
|
+
async list(params) {
|
|
11385
|
+
let results = Array.from(this.bindings.values()).filter((b) => {
|
|
11386
|
+
if (b.tenantId !== params.tenantId) return false;
|
|
11387
|
+
if (params.channel && b.channel !== params.channel) return false;
|
|
11388
|
+
if (params.agentId && b.agentId !== params.agentId) return false;
|
|
11389
|
+
if (params.channelInstallationId && b.channelInstallationId !== params.channelInstallationId) return false;
|
|
11390
|
+
return true;
|
|
11391
|
+
});
|
|
11392
|
+
const offset = params.offset ?? 0;
|
|
11393
|
+
const limit = params.limit ?? 50;
|
|
11394
|
+
return results.slice(offset, offset + limit);
|
|
11395
|
+
}
|
|
11396
|
+
async import(bindings) {
|
|
11397
|
+
const result = [];
|
|
11398
|
+
for (const input of bindings) {
|
|
11399
|
+
result.push(await this.create(input));
|
|
11400
|
+
}
|
|
11401
|
+
return result;
|
|
11402
|
+
}
|
|
11403
|
+
async export(params) {
|
|
11404
|
+
return this.list({ tenantId: params.tenantId, limit: 1e4 });
|
|
11405
|
+
}
|
|
11406
|
+
clear() {
|
|
11407
|
+
this.bindings.clear();
|
|
11408
|
+
}
|
|
11409
|
+
};
|
|
11410
|
+
|
|
11156
11411
|
// src/store_lattice/StoreLatticeManager.ts
|
|
11157
11412
|
var StoreLatticeManager = class _StoreLatticeManager extends BaseLatticeManager {
|
|
11158
11413
|
/**
|
|
@@ -11315,6 +11570,18 @@ storeLatticeManager.registerLattice(
|
|
|
11315
11570
|
"workflowTracking",
|
|
11316
11571
|
defaultWorkflowTrackingStore
|
|
11317
11572
|
);
|
|
11573
|
+
var defaultChannelInstallationStore = new InMemoryChannelInstallationStore();
|
|
11574
|
+
storeLatticeManager.registerLattice(
|
|
11575
|
+
"default",
|
|
11576
|
+
"channelInstallation",
|
|
11577
|
+
defaultChannelInstallationStore
|
|
11578
|
+
);
|
|
11579
|
+
var defaultChannelBindingStore = new InMemoryBindingStore();
|
|
11580
|
+
storeLatticeManager.registerLattice(
|
|
11581
|
+
"default",
|
|
11582
|
+
"channelBinding",
|
|
11583
|
+
defaultChannelBindingStore
|
|
11584
|
+
);
|
|
11318
11585
|
|
|
11319
11586
|
// src/services/Agent.ts
|
|
11320
11587
|
var import_langgraph6 = require("@langchain/langgraph");
|
|
@@ -12677,10 +12944,10 @@ function createSchedulerMiddleware(options = {}) {
|
|
|
12677
12944
|
{
|
|
12678
12945
|
name: "schedule_at",
|
|
12679
12946
|
description: "Schedule a system message for an absolute future timestamp",
|
|
12680
|
-
schema:
|
|
12681
|
-
executeAt:
|
|
12682
|
-
maxRetries:
|
|
12683
|
-
message:
|
|
12947
|
+
schema: import_zod50.z.object({
|
|
12948
|
+
executeAt: import_zod50.z.number(),
|
|
12949
|
+
maxRetries: import_zod50.z.number().int().min(0).optional(),
|
|
12950
|
+
message: import_zod50.z.string()
|
|
12684
12951
|
})
|
|
12685
12952
|
}
|
|
12686
12953
|
),
|
|
@@ -12712,10 +12979,10 @@ function createSchedulerMiddleware(options = {}) {
|
|
|
12712
12979
|
{
|
|
12713
12980
|
name: "schedule_after",
|
|
12714
12981
|
description: "Schedule a system message after a relative delay",
|
|
12715
|
-
schema:
|
|
12716
|
-
delayMs:
|
|
12717
|
-
maxRetries:
|
|
12718
|
-
message:
|
|
12982
|
+
schema: import_zod50.z.object({
|
|
12983
|
+
delayMs: import_zod50.z.number().positive(),
|
|
12984
|
+
maxRetries: import_zod50.z.number().int().min(0).optional(),
|
|
12985
|
+
message: import_zod50.z.string()
|
|
12719
12986
|
})
|
|
12720
12987
|
}
|
|
12721
12988
|
),
|
|
@@ -12754,12 +13021,12 @@ function createSchedulerMiddleware(options = {}) {
|
|
|
12754
13021
|
{
|
|
12755
13022
|
name: "schedule_recurring",
|
|
12756
13023
|
description: "Schedule a recurring system message with a cron expression",
|
|
12757
|
-
schema:
|
|
12758
|
-
cronExpression:
|
|
12759
|
-
maxRuns:
|
|
12760
|
-
expiresAt:
|
|
12761
|
-
maxRetries:
|
|
12762
|
-
message:
|
|
13024
|
+
schema: import_zod50.z.object({
|
|
13025
|
+
cronExpression: import_zod50.z.string(),
|
|
13026
|
+
maxRuns: import_zod50.z.number().int().positive().optional(),
|
|
13027
|
+
expiresAt: import_zod50.z.number().optional(),
|
|
13028
|
+
maxRetries: import_zod50.z.number().int().min(0).optional(),
|
|
13029
|
+
message: import_zod50.z.string()
|
|
12763
13030
|
})
|
|
12764
13031
|
}
|
|
12765
13032
|
),
|
|
@@ -12772,8 +13039,8 @@ function createSchedulerMiddleware(options = {}) {
|
|
|
12772
13039
|
{
|
|
12773
13040
|
name: "cancel_scheduled_task",
|
|
12774
13041
|
description: "Cancel a scheduled task by task id",
|
|
12775
|
-
schema:
|
|
12776
|
-
taskId:
|
|
13042
|
+
schema: import_zod50.z.object({
|
|
13043
|
+
taskId: import_zod50.z.string()
|
|
12777
13044
|
})
|
|
12778
13045
|
}
|
|
12779
13046
|
),
|
|
@@ -12799,11 +13066,11 @@ function createSchedulerMiddleware(options = {}) {
|
|
|
12799
13066
|
{
|
|
12800
13067
|
name: "list_scheduled_tasks",
|
|
12801
13068
|
description: "List scheduled tasks for the current agent context",
|
|
12802
|
-
schema:
|
|
12803
|
-
status:
|
|
12804
|
-
executionType:
|
|
12805
|
-
limit:
|
|
12806
|
-
offset:
|
|
13069
|
+
schema: import_zod50.z.object({
|
|
13070
|
+
status: import_zod50.z.enum(["pending", "running", "completed", "failed", "cancelled", "paused"]).optional(),
|
|
13071
|
+
executionType: import_zod50.z.enum(["once", "cron"]).optional(),
|
|
13072
|
+
limit: import_zod50.z.number().int().positive().optional(),
|
|
13073
|
+
offset: import_zod50.z.number().int().min(0).optional()
|
|
12807
13074
|
})
|
|
12808
13075
|
}
|
|
12809
13076
|
)
|
|
@@ -15037,7 +15304,7 @@ var MemoryBackend = class {
|
|
|
15037
15304
|
|
|
15038
15305
|
// src/deep_agent_new/middleware/todos.ts
|
|
15039
15306
|
var import_langgraph10 = require("@langchain/langgraph");
|
|
15040
|
-
var
|
|
15307
|
+
var import_zod51 = require("zod");
|
|
15041
15308
|
var import_langchain59 = require("langchain");
|
|
15042
15309
|
var WRITE_TODOS_DESCRIPTION = `Use this tool to create and manage a structured task list for your current work session. This helps you track progress, organize complex tasks, and demonstrate thoroughness to the user.
|
|
15043
15310
|
It also helps the user understand the progress of the task and overall progress of their requests.
|
|
@@ -15265,12 +15532,12 @@ Writing todos takes time and tokens, use it when it is helpful for managing comp
|
|
|
15265
15532
|
## Important To-Do List Usage Notes to Remember
|
|
15266
15533
|
- The \`write_todos\` tool should never be called multiple times in parallel.
|
|
15267
15534
|
- Don't be afraid to revise the To-Do list as you go. New information may reveal new tasks that need to be done, or old tasks that are irrelevant.`;
|
|
15268
|
-
var TodoStatus =
|
|
15269
|
-
var TodoSchema =
|
|
15270
|
-
content:
|
|
15535
|
+
var TodoStatus = import_zod51.z.enum(["pending", "in_progress", "completed"]).describe("Status of the todo");
|
|
15536
|
+
var TodoSchema = import_zod51.z.object({
|
|
15537
|
+
content: import_zod51.z.string().describe("Content of the todo item"),
|
|
15271
15538
|
status: TodoStatus
|
|
15272
15539
|
});
|
|
15273
|
-
var stateSchema =
|
|
15540
|
+
var stateSchema = import_zod51.z.object({ todos: import_zod51.z.array(TodoSchema).default([]) });
|
|
15274
15541
|
function todoListMiddleware(options) {
|
|
15275
15542
|
const writeTodos = (0, import_langchain59.tool)(
|
|
15276
15543
|
({ todos }, config) => {
|
|
@@ -15289,8 +15556,8 @@ function todoListMiddleware(options) {
|
|
|
15289
15556
|
{
|
|
15290
15557
|
name: "write_todos",
|
|
15291
15558
|
description: options?.toolDescription ?? WRITE_TODOS_DESCRIPTION,
|
|
15292
|
-
schema:
|
|
15293
|
-
todos:
|
|
15559
|
+
schema: import_zod51.z.object({
|
|
15560
|
+
todos: import_zod51.z.array(TodoSchema).describe("List of todo items to update")
|
|
15294
15561
|
})
|
|
15295
15562
|
}
|
|
15296
15563
|
);
|
|
@@ -17075,11 +17342,11 @@ var import_langchain66 = require("langchain");
|
|
|
17075
17342
|
var import_langchain64 = require("langchain");
|
|
17076
17343
|
var import_messages4 = require("@langchain/core/messages");
|
|
17077
17344
|
var import_langchain65 = require("langchain");
|
|
17078
|
-
var
|
|
17345
|
+
var import_zod52 = require("zod");
|
|
17079
17346
|
var import_langgraph13 = require("@langchain/langgraph");
|
|
17080
|
-
var CompletedEdgeSchema =
|
|
17081
|
-
to:
|
|
17082
|
-
purpose:
|
|
17347
|
+
var CompletedEdgeSchema = import_zod52.z.object({
|
|
17348
|
+
to: import_zod52.z.string(),
|
|
17349
|
+
purpose: import_zod52.z.string()
|
|
17083
17350
|
});
|
|
17084
17351
|
function deriveCompletedEdges(messages, edges) {
|
|
17085
17352
|
const completedToolCallIds = /* @__PURE__ */ new Set();
|
|
@@ -17108,14 +17375,14 @@ function createTopologyMiddleware(options) {
|
|
|
17108
17375
|
const { edges, trackingStore } = options;
|
|
17109
17376
|
return (0, import_langchain64.createMiddleware)({
|
|
17110
17377
|
name: "TopologyMiddleware",
|
|
17111
|
-
contextSchema:
|
|
17112
|
-
runConfig:
|
|
17378
|
+
contextSchema: import_zod52.z.object({
|
|
17379
|
+
runConfig: import_zod52.z.any()
|
|
17113
17380
|
}),
|
|
17114
|
-
stateSchema:
|
|
17115
|
-
currentAgentId:
|
|
17116
|
-
completedEdges:
|
|
17117
|
-
runId:
|
|
17118
|
-
stepIdMap:
|
|
17381
|
+
stateSchema: import_zod52.z.object({
|
|
17382
|
+
currentAgentId: import_zod52.z.string().default(""),
|
|
17383
|
+
completedEdges: import_zod52.z.array(CompletedEdgeSchema).default([]),
|
|
17384
|
+
runId: import_zod52.z.string().default(""),
|
|
17385
|
+
stepIdMap: import_zod52.z.record(import_zod52.z.string()).default({})
|
|
17119
17386
|
}),
|
|
17120
17387
|
beforeAgent: async (state, runtime) => {
|
|
17121
17388
|
const runConfig = runtime.context?.runConfig ?? {};
|
|
@@ -17170,7 +17437,7 @@ ${request.systemPrompt}` : topologyPrompt;
|
|
|
17170
17437
|
{
|
|
17171
17438
|
name: "read_topo_progress",
|
|
17172
17439
|
description: "Check the current progress of the workflow execution plan. Returns which steps have been completed and which are still pending.",
|
|
17173
|
-
schema:
|
|
17440
|
+
schema: import_zod52.z.object({})
|
|
17174
17441
|
}
|
|
17175
17442
|
)
|
|
17176
17443
|
],
|
|
@@ -18121,7 +18388,7 @@ ${body}` : `${frontmatter}
|
|
|
18121
18388
|
};
|
|
18122
18389
|
|
|
18123
18390
|
// src/agent_lattice/agentArchitectTools.ts
|
|
18124
|
-
var
|
|
18391
|
+
var import_zod53 = __toESM(require("zod"));
|
|
18125
18392
|
var import_uuid4 = require("uuid");
|
|
18126
18393
|
var import_protocols10 = require("@axiom-lattice/protocols");
|
|
18127
18394
|
function getTenantId(exeConfig) {
|
|
@@ -18151,7 +18418,7 @@ registerToolLattice(
|
|
|
18151
18418
|
{
|
|
18152
18419
|
name: "list_agents",
|
|
18153
18420
|
description: "List all agents for the current workspace. Returns a summary with id, name, description, and type for each agent.",
|
|
18154
|
-
schema:
|
|
18421
|
+
schema: import_zod53.default.object({})
|
|
18155
18422
|
},
|
|
18156
18423
|
async (_input, exeConfig) => {
|
|
18157
18424
|
try {
|
|
@@ -18178,8 +18445,8 @@ registerToolLattice(
|
|
|
18178
18445
|
{
|
|
18179
18446
|
name: "get_agent",
|
|
18180
18447
|
description: "Get the full configuration of a specific agent by its ID. Returns the complete AgentConfig including prompt, middleware, tools, and sub-agents.",
|
|
18181
|
-
schema:
|
|
18182
|
-
id:
|
|
18448
|
+
schema: import_zod53.default.object({
|
|
18449
|
+
id: import_zod53.default.string().describe("The agent ID to retrieve")
|
|
18183
18450
|
})
|
|
18184
18451
|
},
|
|
18185
18452
|
async (input, exeConfig) => {
|
|
@@ -18196,24 +18463,24 @@ registerToolLattice(
|
|
|
18196
18463
|
}
|
|
18197
18464
|
}
|
|
18198
18465
|
);
|
|
18199
|
-
var middlewareConfigSchema =
|
|
18200
|
-
id:
|
|
18201
|
-
type:
|
|
18202
|
-
name:
|
|
18203
|
-
description:
|
|
18204
|
-
enabled:
|
|
18205
|
-
config:
|
|
18466
|
+
var middlewareConfigSchema = import_zod53.default.object({
|
|
18467
|
+
id: import_zod53.default.string(),
|
|
18468
|
+
type: import_zod53.default.string(),
|
|
18469
|
+
name: import_zod53.default.string(),
|
|
18470
|
+
description: import_zod53.default.string(),
|
|
18471
|
+
enabled: import_zod53.default.boolean(),
|
|
18472
|
+
config: import_zod53.default.record(import_zod53.default.any()).optional()
|
|
18206
18473
|
});
|
|
18207
|
-
var createAgentSchema =
|
|
18208
|
-
name:
|
|
18209
|
-
description:
|
|
18210
|
-
type:
|
|
18211
|
-
prompt:
|
|
18212
|
-
tools:
|
|
18213
|
-
middleware:
|
|
18214
|
-
subAgents:
|
|
18215
|
-
internalSubAgents:
|
|
18216
|
-
modelKey:
|
|
18474
|
+
var createAgentSchema = import_zod53.default.object({
|
|
18475
|
+
name: import_zod53.default.string().describe("Human-friendly display name for the agent. The machine ID (used in other tools) is auto-generated as a slug from this name (e.g. 'My Cool Agent' \u2192 'my-cool-agent')."),
|
|
18476
|
+
description: import_zod53.default.string().optional().describe("Short description"),
|
|
18477
|
+
type: import_zod53.default.enum(["react", "deep_agent"]).describe("Agent type. Use 'react' for simple single-responsibility agents, 'deep_agent' for complex open-ended agents. For PROCESSING agents (workflow orchestration), use create_processing_agent instead."),
|
|
18478
|
+
prompt: import_zod53.default.string().describe("System prompt for the agent"),
|
|
18479
|
+
tools: import_zod53.default.array(import_zod53.default.string()).optional().describe("Tool keys (strings) to assign. Call list_tools first to see available keys. Each element is a plain string like 'sap_api_search'. IMPORTANT: tools is a FLAT string array of tool names. Do NOT put middleware-like objects here \u2014 middleware goes in the separate 'middleware' field."),
|
|
18480
|
+
middleware: import_zod53.default.array(middlewareConfigSchema).optional().describe("Middleware configuration objects. Each has {id, type, name, description, enabled, config}. IMPORTANT: middleware objects are NOT tools. Do NOT put tool keys (strings) here \u2014 tool names go in the separate 'tools' array. For user approval/confirmation scenarios, use type: 'ask_user_to_clarify' with config: {}."),
|
|
18481
|
+
subAgents: import_zod53.default.array(import_zod53.default.string()).optional().describe("Sub-agent IDs (deep_agent only)"),
|
|
18482
|
+
internalSubAgents: import_zod53.default.array(import_zod53.default.any()).optional().describe("Inline sub-agent configs (deep_agent only)"),
|
|
18483
|
+
modelKey: import_zod53.default.string().optional().describe("Model key to use")
|
|
18217
18484
|
});
|
|
18218
18485
|
registerToolLattice(
|
|
18219
18486
|
"create_agent",
|
|
@@ -18251,21 +18518,21 @@ registerToolLattice(
|
|
|
18251
18518
|
}
|
|
18252
18519
|
}
|
|
18253
18520
|
);
|
|
18254
|
-
var topologyEdgeSchema =
|
|
18255
|
-
from:
|
|
18256
|
-
to:
|
|
18257
|
-
purpose:
|
|
18521
|
+
var topologyEdgeSchema = import_zod53.default.object({
|
|
18522
|
+
from: import_zod53.default.string().describe("Source agent ID. For the first edge, this is the orchestrator (use the orchestrator's name as a placeholder \u2014 the tool will replace it with the actual ID). For subsequent chained edges, this is the previous stage's sub-agent ID."),
|
|
18523
|
+
to: import_zod53.default.string().describe("Target agent ID (the sub-agent to delegate to)"),
|
|
18524
|
+
purpose: import_zod53.default.string().describe("Business purpose of this delegation step \u2014 what the sub-agent should accomplish")
|
|
18258
18525
|
});
|
|
18259
|
-
var createProcessingAgentSchema =
|
|
18260
|
-
name:
|
|
18261
|
-
description:
|
|
18262
|
-
prompt:
|
|
18263
|
-
edges:
|
|
18264
|
-
tools:
|
|
18265
|
-
subAgents:
|
|
18266
|
-
internalSubAgents:
|
|
18267
|
-
middleware:
|
|
18268
|
-
modelKey:
|
|
18526
|
+
var createProcessingAgentSchema = import_zod53.default.object({
|
|
18527
|
+
name: import_zod53.default.string().describe("Display name for the processing agent"),
|
|
18528
|
+
description: import_zod53.default.string().optional().describe("Short description"),
|
|
18529
|
+
prompt: import_zod53.default.string().describe("System prompt for the orchestrator. Should describe how to route tasks through the topology."),
|
|
18530
|
+
edges: import_zod53.default.array(topologyEdgeSchema).min(1).describe("Topology edges defining the workflow. Each edge describes a delegation step with its business purpose. The orchestrator will follow this topology to delegate tasks to sub-agents."),
|
|
18531
|
+
tools: import_zod53.default.array(import_zod53.default.string()).optional().describe("Tool keys (strings) to assign to the orchestrator. Call list_tools first to see available keys. Each element is a plain string like 'sap_api_search'. IMPORTANT: tools is a FLAT string array. Do NOT put middleware-like objects here \u2014 middleware goes in the separate 'middleware' field."),
|
|
18532
|
+
subAgents: import_zod53.default.array(import_zod53.default.string()).describe("IDs of sub-agents that form the workflow pipeline. These must be created first via create_agent."),
|
|
18533
|
+
internalSubAgents: import_zod53.default.array(import_zod53.default.any()).optional().describe("Inline sub-agent configs (alternative to pre-created sub-agents)"),
|
|
18534
|
+
middleware: import_zod53.default.array(middlewareConfigSchema).optional().describe("Additional middleware config objects beyond the auto-managed topology middleware. Each has {id, type, name, description, enabled, config}. IMPORTANT: middleware objects are NOT tools. Do NOT put tool keys (strings) here. For user approval/confirmation scenarios, use type: 'ask_user_to_clarify' with config: {}."),
|
|
18535
|
+
modelKey: import_zod53.default.string().optional().describe("Model key to use")
|
|
18269
18536
|
}).refine(
|
|
18270
18537
|
(data) => {
|
|
18271
18538
|
const edgeTargets = new Set(data.edges.map((e) => e.to));
|
|
@@ -18347,16 +18614,16 @@ registerToolLattice(
|
|
|
18347
18614
|
}
|
|
18348
18615
|
}
|
|
18349
18616
|
);
|
|
18350
|
-
var updateProcessingAgentSchema =
|
|
18351
|
-
id:
|
|
18352
|
-
name:
|
|
18353
|
-
description:
|
|
18354
|
-
prompt:
|
|
18355
|
-
edges:
|
|
18356
|
-
tools:
|
|
18357
|
-
subAgents:
|
|
18358
|
-
middleware:
|
|
18359
|
-
modelKey:
|
|
18617
|
+
var updateProcessingAgentSchema = import_zod53.default.object({
|
|
18618
|
+
id: import_zod53.default.string().describe("The PROCESSING agent ID to update"),
|
|
18619
|
+
name: import_zod53.default.string().optional().describe("New display name for the orchestrator"),
|
|
18620
|
+
description: import_zod53.default.string().optional().describe("New short description"),
|
|
18621
|
+
prompt: import_zod53.default.string().optional().describe("New system prompt for the orchestrator"),
|
|
18622
|
+
edges: import_zod53.default.array(topologyEdgeSchema).min(1).optional().describe("New topology edges. First edge's from must reference the orchestrator by name (the tool replaces it). Subsequent edges chain from previous sub-agent IDs."),
|
|
18623
|
+
tools: import_zod53.default.array(import_zod53.default.string()).optional().describe("Tool keys (strings) to assign to the orchestrator. Each element is a plain string like 'sap_api_search'. IMPORTANT: tools is a FLAT string array \u2014 do NOT put middleware-like objects here."),
|
|
18624
|
+
subAgents: import_zod53.default.array(import_zod53.default.string()).optional().describe("New IDs of sub-agents in the workflow pipeline"),
|
|
18625
|
+
middleware: import_zod53.default.array(middlewareConfigSchema).optional().describe("Additional middleware config objects (topology middleware is auto-managed, do not include it). Each has {id, type, name, description, enabled, config}. IMPORTANT: middleware objects are NOT tools. Do NOT put tool keys (strings) here. For user approval/confirmation scenarios, use type: 'ask_user_to_clarify' with config: {}."),
|
|
18626
|
+
modelKey: import_zod53.default.string().optional().describe("New model key")
|
|
18360
18627
|
}).refine(
|
|
18361
18628
|
(data) => {
|
|
18362
18629
|
if (!data.edges) return true;
|
|
@@ -18484,18 +18751,18 @@ registerToolLattice(
|
|
|
18484
18751
|
}
|
|
18485
18752
|
}
|
|
18486
18753
|
);
|
|
18487
|
-
var updateAgentSchema =
|
|
18488
|
-
id:
|
|
18489
|
-
config:
|
|
18490
|
-
name:
|
|
18491
|
-
description:
|
|
18492
|
-
type:
|
|
18493
|
-
prompt:
|
|
18494
|
-
tools:
|
|
18495
|
-
middleware:
|
|
18496
|
-
subAgents:
|
|
18497
|
-
internalSubAgents:
|
|
18498
|
-
modelKey:
|
|
18754
|
+
var updateAgentSchema = import_zod53.default.object({
|
|
18755
|
+
id: import_zod53.default.string().describe("The agent ID to update"),
|
|
18756
|
+
config: import_zod53.default.object({
|
|
18757
|
+
name: import_zod53.default.string().optional().describe("New display name for the agent"),
|
|
18758
|
+
description: import_zod53.default.string().optional().describe("New short description"),
|
|
18759
|
+
type: import_zod53.default.enum(["react", "deep_agent"]).optional().describe("Agent type"),
|
|
18760
|
+
prompt: import_zod53.default.string().optional().describe("New system prompt for the agent"),
|
|
18761
|
+
tools: import_zod53.default.array(import_zod53.default.string()).optional().describe("Tool keys to assign to this agent. These are registered tool names (strings), NOT middleware objects."),
|
|
18762
|
+
middleware: import_zod53.default.array(middlewareConfigSchema).optional().describe("Middleware configurations. NOTE: middleware objects have type/name/description/enabled/config fields and are NOT the same as tools. Tool keys go in the 'tools' array. For user approval/confirmation scenarios, use type: 'ask_user_to_clarify' with config: {}."),
|
|
18763
|
+
subAgents: import_zod53.default.array(import_zod53.default.string()).optional().describe("Sub-agent IDs (deep_agent only)"),
|
|
18764
|
+
internalSubAgents: import_zod53.default.array(import_zod53.default.any()).optional().describe("Inline sub-agent configs (deep_agent only)"),
|
|
18765
|
+
modelKey: import_zod53.default.string().optional().describe("Model key to use")
|
|
18499
18766
|
}).describe("Configuration fields to update. Only include the fields you want to change.")
|
|
18500
18767
|
});
|
|
18501
18768
|
registerToolLattice(
|
|
@@ -18533,8 +18800,8 @@ registerToolLattice(
|
|
|
18533
18800
|
{
|
|
18534
18801
|
name: "delete_agent",
|
|
18535
18802
|
description: "Permanently delete an agent by its ID. This action cannot be undone.",
|
|
18536
|
-
schema:
|
|
18537
|
-
id:
|
|
18803
|
+
schema: import_zod53.default.object({
|
|
18804
|
+
id: import_zod53.default.string().describe("The agent ID to delete")
|
|
18538
18805
|
})
|
|
18539
18806
|
},
|
|
18540
18807
|
async (input, exeConfig) => {
|
|
@@ -18560,7 +18827,7 @@ registerToolLattice(
|
|
|
18560
18827
|
{
|
|
18561
18828
|
name: "list_tools",
|
|
18562
18829
|
description: "List all available tools that can be assigned to agents. Returns each tool's name (use this string value in the 'tools' array), description, and whether it requires user approval. The tool names from this list are what you pass as strings in the 'tools' field of create_agent or update_agent.",
|
|
18563
|
-
schema:
|
|
18830
|
+
schema: import_zod53.default.object({})
|
|
18564
18831
|
},
|
|
18565
18832
|
async (_input, _exeConfig) => {
|
|
18566
18833
|
try {
|
|
@@ -18582,9 +18849,9 @@ registerToolLattice(
|
|
|
18582
18849
|
{
|
|
18583
18850
|
name: "invoke_agent",
|
|
18584
18851
|
description: "Invoke an agent with a test message and return its response. Use this to verify an agent works correctly after creating or modifying it. The agent must be compiled (already created and valid).",
|
|
18585
|
-
schema:
|
|
18586
|
-
id:
|
|
18587
|
-
message:
|
|
18852
|
+
schema: import_zod53.default.object({
|
|
18853
|
+
id: import_zod53.default.string().describe("The agent ID to invoke"),
|
|
18854
|
+
message: import_zod53.default.string().describe("The test message to send to the agent")
|
|
18588
18855
|
})
|
|
18589
18856
|
},
|
|
18590
18857
|
async (input, exeConfig) => {
|
|
@@ -19252,7 +19519,8 @@ var agentArchitectConfig = {
|
|
|
19252
19519
|
"create_processing_agent",
|
|
19253
19520
|
"update_processing_agent",
|
|
19254
19521
|
"update_agent",
|
|
19255
|
-
"delete_agent"
|
|
19522
|
+
"delete_agent",
|
|
19523
|
+
"manage_binding"
|
|
19256
19524
|
],
|
|
19257
19525
|
internalSubAgents: [agentReviewerConfig],
|
|
19258
19526
|
middleware: [
|
|
@@ -21777,7 +22045,7 @@ function createSandboxProvider(config) {
|
|
|
21777
22045
|
var Protocols = __toESM(require("@axiom-lattice/protocols"));
|
|
21778
22046
|
|
|
21779
22047
|
// src/util/encryption.ts
|
|
21780
|
-
var
|
|
22048
|
+
var import_crypto2 = require("crypto");
|
|
21781
22049
|
var ALGORITHM = "aes-256-gcm";
|
|
21782
22050
|
var IV_LENGTH = 16;
|
|
21783
22051
|
var SALT_LENGTH = 32;
|
|
@@ -21790,7 +22058,7 @@ function getEncryptionKey() {
|
|
|
21790
22058
|
return cachedKey;
|
|
21791
22059
|
}
|
|
21792
22060
|
const key = process.env.LATTICE_ENCRYPTION_KEY || DEFAULT_ENCRYPTION_KEY;
|
|
21793
|
-
cachedKey = (0,
|
|
22061
|
+
cachedKey = (0, import_crypto2.pbkdf2Sync)(key, "lattice-encryption-salt", ITERATIONS, 32, "sha256");
|
|
21794
22062
|
if (!keyValidated) {
|
|
21795
22063
|
keyValidated = true;
|
|
21796
22064
|
validateEncryptionKey();
|
|
@@ -21799,10 +22067,10 @@ function getEncryptionKey() {
|
|
|
21799
22067
|
}
|
|
21800
22068
|
function encrypt(plaintext, key) {
|
|
21801
22069
|
const actualKey = key || getEncryptionKey();
|
|
21802
|
-
const salt = (0,
|
|
21803
|
-
const iv = (0,
|
|
21804
|
-
const derivedKey = (0,
|
|
21805
|
-
const cipher = (0,
|
|
22070
|
+
const salt = (0, import_crypto2.randomBytes)(SALT_LENGTH);
|
|
22071
|
+
const iv = (0, import_crypto2.randomBytes)(IV_LENGTH);
|
|
22072
|
+
const derivedKey = (0, import_crypto2.pbkdf2Sync)(actualKey, salt, ITERATIONS, 32, "sha256");
|
|
22073
|
+
const cipher = (0, import_crypto2.createCipheriv)(ALGORITHM, derivedKey, iv);
|
|
21806
22074
|
const encrypted = Buffer.concat([cipher.update(plaintext, "utf8"), cipher.final()]);
|
|
21807
22075
|
const authTag = cipher.getAuthTag();
|
|
21808
22076
|
return Buffer.concat([salt, iv, encrypted, authTag]).toString("base64");
|
|
@@ -21814,8 +22082,8 @@ function decrypt(encrypted, key) {
|
|
|
21814
22082
|
const iv = data.subarray(SALT_LENGTH, SALT_LENGTH + IV_LENGTH);
|
|
21815
22083
|
const authTag = data.subarray(-16);
|
|
21816
22084
|
const ciphertext = data.subarray(SALT_LENGTH + IV_LENGTH, -16);
|
|
21817
|
-
const derivedKey = (0,
|
|
21818
|
-
const decipher = (0,
|
|
22085
|
+
const derivedKey = (0, import_crypto2.pbkdf2Sync)(actualKey, salt, ITERATIONS, 32, "sha256");
|
|
22086
|
+
const decipher = (0, import_crypto2.createDecipheriv)(ALGORITHM, derivedKey, iv);
|
|
21819
22087
|
decipher.setAuthTag(authTag);
|
|
21820
22088
|
return Buffer.concat([decipher.update(ciphertext), decipher.final()]).toString("utf8");
|
|
21821
22089
|
}
|
|
@@ -21864,6 +22132,8 @@ function clearEncryptionKeyCache() {
|
|
|
21864
22132
|
FilesystemBackend,
|
|
21865
22133
|
HumanMessage,
|
|
21866
22134
|
InMemoryAssistantStore,
|
|
22135
|
+
InMemoryBindingStore,
|
|
22136
|
+
InMemoryChannelInstallationStore,
|
|
21867
22137
|
InMemoryChunkBuffer,
|
|
21868
22138
|
InMemoryDatabaseConfigStore,
|
|
21869
22139
|
InMemoryMailboxStore,
|
|
@@ -21949,6 +22219,7 @@ function clearEncryptionKeyCache() {
|
|
|
21949
22219
|
describeCronExpression,
|
|
21950
22220
|
embeddingsLatticeManager,
|
|
21951
22221
|
encrypt,
|
|
22222
|
+
ensureBuiltinAgentsForTenant,
|
|
21952
22223
|
eventBus,
|
|
21953
22224
|
eventBusDefault,
|
|
21954
22225
|
fileDataToString,
|
|
@@ -21961,6 +22232,7 @@ function clearEncryptionKeyCache() {
|
|
|
21961
22232
|
getAllAgentConfigs,
|
|
21962
22233
|
getAllBuiltInSkillMetas,
|
|
21963
22234
|
getAllToolDefinitions,
|
|
22235
|
+
getBindingRegistry,
|
|
21964
22236
|
getBuiltInSkillContent,
|
|
21965
22237
|
getBuiltInSkillMeta,
|
|
21966
22238
|
getBuiltInSkillNames,
|
|
@@ -22017,6 +22289,7 @@ function clearEncryptionKeyCache() {
|
|
|
22017
22289
|
sandboxLatticeManager,
|
|
22018
22290
|
sanitizeToolCallId,
|
|
22019
22291
|
scheduleLatticeManager,
|
|
22292
|
+
setBindingRegistry,
|
|
22020
22293
|
skillLatticeManager,
|
|
22021
22294
|
sqlDatabaseManager,
|
|
22022
22295
|
storeLatticeManager,
|