@axiom-lattice/core 2.1.64 → 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.mjs CHANGED
@@ -756,6 +756,124 @@ registerToolLattice(
756
756
  }
757
757
  );
758
758
 
759
+ // src/tool_lattice/manage_binding/index.ts
760
+ import z3 from "zod";
761
+
762
+ // src/bindings_lattice/BindingRegistryHolder.ts
763
+ var registry = null;
764
+ function setBindingRegistry(r) {
765
+ registry = r;
766
+ }
767
+ function getBindingRegistry() {
768
+ if (!registry) {
769
+ throw new Error("BindingRegistry not initialized. Call setBindingRegistry() before any agent invocation.");
770
+ }
771
+ return registry;
772
+ }
773
+
774
+ // src/tool_lattice/manage_binding/index.ts
775
+ var manageBindingSchema = z3.object({
776
+ action: z3.enum(["create", "update", "delete", "list"]).describe("Action to perform on the binding"),
777
+ channel: z3.string().describe("Channel type: 'lark', 'email', 'slack'"),
778
+ channelInstallationId: z3.string().optional().describe("Channel installation ID"),
779
+ senderId: z3.string().optional().describe("Sender identifier (email address, Lark openId, Slack userId)"),
780
+ agentId: z3.string().optional().describe("Target agent ID to route messages to"),
781
+ threadMode: z3.enum(["fixed", "per_conversation"]).optional().describe("Thread mode: fixed or per_conversation"),
782
+ senderDisplayName: z3.string().optional().describe("Human-readable name for the sender")
783
+ });
784
+ registerToolLattice(
785
+ "manage_binding",
786
+ {
787
+ name: "manage_binding",
788
+ description: `Manage sender-to-agent bindings for external channels (email, Lark, Slack).
789
+ Use this tool to create, update, delete, or list bindings that map external senders to agents.
790
+
791
+ - create: Bind a sender (email/Lark user/Slack user) to an agent. Required: channel, channelInstallationId, senderId, agentId. Optional: threadMode, senderDisplayName.
792
+ - update: Update an existing binding's agentId, threadMode, or displayName. Required: channel, senderId, channelInstallationId. Optional: agentId, threadMode, senderDisplayName.
793
+ - delete: Remove a binding. Required: channel, senderId, channelInstallationId.
794
+ - list: List all bindings. Optional: channel, agentId, channelInstallationId.
795
+
796
+ A sender can only be bound to ONE agent per channel+installation combination.`,
797
+ schema: manageBindingSchema
798
+ },
799
+ async (input) => {
800
+ const registry2 = getBindingRegistry();
801
+ switch (input.action) {
802
+ case "create": {
803
+ if (!input.channelInstallationId || !input.senderId || !input.agentId) {
804
+ return JSON.stringify({
805
+ success: false,
806
+ error: "create requires channelInstallationId, senderId, and agentId"
807
+ });
808
+ }
809
+ const binding = await registry2.create({
810
+ channel: input.channel,
811
+ channelInstallationId: input.channelInstallationId,
812
+ tenantId: "default",
813
+ senderId: input.senderId,
814
+ agentId: input.agentId,
815
+ threadMode: input.threadMode,
816
+ senderDisplayName: input.senderDisplayName
817
+ });
818
+ return JSON.stringify({ success: true, data: binding });
819
+ }
820
+ case "update": {
821
+ if (!input.channelInstallationId || !input.senderId) {
822
+ return JSON.stringify({
823
+ success: false,
824
+ error: "update requires channelInstallationId and senderId to find the binding"
825
+ });
826
+ }
827
+ const existing = await registry2.resolve({
828
+ channel: input.channel,
829
+ senderId: input.senderId,
830
+ channelInstallationId: input.channelInstallationId,
831
+ tenantId: "default"
832
+ });
833
+ if (!existing) {
834
+ return JSON.stringify({ success: false, error: "Binding not found" });
835
+ }
836
+ const updated = await registry2.update(existing.id, {
837
+ agentId: input.agentId,
838
+ threadMode: input.threadMode,
839
+ senderDisplayName: input.senderDisplayName
840
+ });
841
+ return JSON.stringify({ success: true, data: updated });
842
+ }
843
+ case "delete": {
844
+ if (!input.channelInstallationId || !input.senderId) {
845
+ return JSON.stringify({
846
+ success: false,
847
+ error: "delete requires channelInstallationId and senderId to find the binding"
848
+ });
849
+ }
850
+ const existing = await registry2.resolve({
851
+ channel: input.channel,
852
+ senderId: input.senderId,
853
+ channelInstallationId: input.channelInstallationId,
854
+ tenantId: "default"
855
+ });
856
+ if (!existing) {
857
+ return JSON.stringify({ success: false, error: "Binding not found" });
858
+ }
859
+ await registry2.delete(existing.id);
860
+ return JSON.stringify({ success: true, message: "Binding deleted" });
861
+ }
862
+ case "list": {
863
+ const bindings = await registry2.list({
864
+ channel: input.channel,
865
+ agentId: input.agentId,
866
+ tenantId: "default",
867
+ channelInstallationId: input.channelInstallationId
868
+ });
869
+ return JSON.stringify({ success: true, data: bindings });
870
+ }
871
+ default:
872
+ return JSON.stringify({ success: false, error: `Unknown action: ${input.action}` });
873
+ }
874
+ }
875
+ );
876
+
759
877
  // src/tool_lattice/sql/SqlDatabaseManager.ts
760
878
  var PostgresDatabase = class {
761
879
  constructor(config) {
@@ -1116,7 +1234,7 @@ var SqlDatabaseManager = class _SqlDatabaseManager {
1116
1234
  var sqlDatabaseManager = SqlDatabaseManager.getInstance();
1117
1235
 
1118
1236
  // src/tool_lattice/sql/list_tables_sql.ts
1119
- import z3 from "zod";
1237
+ import z4 from "zod";
1120
1238
  import { tool as tool2 } from "langchain";
1121
1239
 
1122
1240
  // src/tool_lattice/sql/utils.ts
@@ -1160,15 +1278,15 @@ ${databaseKeys.map(
1160
1278
  {
1161
1279
  name: "list_tables_sql",
1162
1280
  description: `${LIST_TABLES_SQL_DESCRIPTION}${availableDbsText}`,
1163
- schema: z3.object({
1164
- databaseKey: z3.string().describe(`Target database to list tables. Choose from: ${databaseKeys.join(", ")}`)
1281
+ schema: z4.object({
1282
+ databaseKey: z4.string().describe(`Target database to list tables. Choose from: ${databaseKeys.join(", ")}`)
1165
1283
  })
1166
1284
  }
1167
1285
  );
1168
1286
  };
1169
1287
 
1170
1288
  // src/tool_lattice/sql/info_sql.ts
1171
- import z4 from "zod";
1289
+ import z5 from "zod";
1172
1290
  import { tool as tool3 } from "langchain";
1173
1291
  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.`;
1174
1292
  var createInfoSqlTool = ({ databaseKeys, databaseDescriptions, getTenantId: getTenantId2 }) => {
@@ -1209,11 +1327,11 @@ ${databaseKeys.map(
1209
1327
  {
1210
1328
  name: "info_sql",
1211
1329
  description: `${INFO_SQL_DESCRIPTION}${availableDbsText}`,
1212
- schema: z4.object({
1213
- tables: z4.string().describe(
1330
+ schema: z5.object({
1331
+ tables: z5.string().describe(
1214
1332
  "Comma-separated list of table names to get information for. Example: 'users, orders, products'"
1215
1333
  ),
1216
- databaseKey: z4.string().describe(`Target database to get table info. Choose from: ${databaseKeys.join(", ")}`)
1334
+ databaseKey: z5.string().describe(`Target database to get table info. Choose from: ${databaseKeys.join(", ")}`)
1217
1335
  })
1218
1336
  }
1219
1337
  );
@@ -1244,7 +1362,7 @@ Table: ${schema.tableName}`);
1244
1362
  }
1245
1363
 
1246
1364
  // src/tool_lattice/sql/query_checker_sql.ts
1247
- import z5 from "zod";
1365
+ import z6 from "zod";
1248
1366
  import { tool as tool4 } from "langchain";
1249
1367
  var DANGEROUS_KEYWORDS = [
1250
1368
  "DROP",
@@ -1387,16 +1505,16 @@ ${trimmedQuery}
1387
1505
  {
1388
1506
  name: "query_checker_sql",
1389
1507
  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}`,
1390
- schema: z5.object({
1391
- query: z5.string().describe("The SQL query to check and validate."),
1392
- databaseKey: z5.string().describe(`Target database to validate query against. Choose from: ${databaseKeys.join(", ")}`)
1508
+ schema: z6.object({
1509
+ query: z6.string().describe("The SQL query to check and validate."),
1510
+ databaseKey: z6.string().describe(`Target database to validate query against. Choose from: ${databaseKeys.join(", ")}`)
1393
1511
  })
1394
1512
  }
1395
1513
  );
1396
1514
  };
1397
1515
 
1398
1516
  // src/tool_lattice/sql/query_sql.ts
1399
- import z6 from "zod";
1517
+ import z7 from "zod";
1400
1518
  import { tool as tool5 } from "langchain";
1401
1519
  function formatQueryResult(rows, fields) {
1402
1520
  if (rows.length === 0) {
@@ -1459,11 +1577,11 @@ ${databaseKeys.map(
1459
1577
  {
1460
1578
  name: "query_sql",
1461
1579
  description: `Execute a SQL query against the database and return the results.${availableDbsText}`,
1462
- schema: z6.object({
1463
- query: z6.string().describe(
1580
+ schema: z7.object({
1581
+ query: z7.string().describe(
1464
1582
  "The SQL query to execute. Should be a valid SELECT, INSERT, UPDATE, or DELETE statement."
1465
1583
  ),
1466
- databaseKey: z6.string().describe(`Target database to execute the query. Choose from: ${databaseKeys.join(", ")}`)
1584
+ databaseKey: z7.string().describe(`Target database to execute the query. Choose from: ${databaseKeys.join(", ")}`)
1467
1585
  })
1468
1586
  }
1469
1587
  );
@@ -2321,7 +2439,7 @@ var MetricsServerManager = class _MetricsServerManager {
2321
2439
  var metricsServerManager = MetricsServerManager.getInstance();
2322
2440
 
2323
2441
  // src/tool_lattice/metrics/list_metrics_servers.ts
2324
- import z7 from "zod";
2442
+ import z8 from "zod";
2325
2443
  import { tool as tool6 } from "langchain";
2326
2444
  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.`;
2327
2445
  var createListMetricsServersTool = ({ serverKeys, serverDescriptions, getTenantId: getTenantId2 }) => {
@@ -2352,13 +2470,13 @@ ${lines.join("\n")}`;
2352
2470
  {
2353
2471
  name: "list_metrics_servers",
2354
2472
  description: `${LIST_METRICS_SERVERS_DESCRIPTION}${availableServersText}`,
2355
- schema: z7.object({})
2473
+ schema: z8.object({})
2356
2474
  }
2357
2475
  );
2358
2476
  };
2359
2477
 
2360
2478
  // src/tool_lattice/metrics/list_datasources.ts
2361
- import z8 from "zod";
2479
+ import z9 from "zod";
2362
2480
  import { tool as tool7 } from "langchain";
2363
2481
  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.`;
2364
2482
  var createListMetricsDataSourcesTool = ({ serverKeys, serverDescriptions, getTenantId: getTenantId2, connectAll }) => {
@@ -2437,13 +2555,13 @@ To view all available data sources, please clear the current selection or reopen
2437
2555
  {
2438
2556
  name: "list_datasources",
2439
2557
  description: `${LIST_METRICS_DATASOURCES_DESCRIPTION}${availableServersText}`,
2440
- schema: z8.object({})
2558
+ schema: z9.object({})
2441
2559
  }
2442
2560
  );
2443
2561
  };
2444
2562
 
2445
2563
  // src/tool_lattice/metrics/query_metrics_list.ts
2446
- import z9 from "zod";
2564
+ import z10 from "zod";
2447
2565
  import { tool as tool8 } from "langchain";
2448
2566
  var QUERY_METRICS_LIST_DESCRIPTION = `Query Available Metrics - Step 1 of the Metrics Workflow
2449
2567
 
@@ -2584,16 +2702,16 @@ ${serverKeys.map(
2584
2702
  {
2585
2703
  name: "query_metrics_list",
2586
2704
  description: `${QUERY_METRICS_LIST_DESCRIPTION}${availableServersText}`,
2587
- schema: z9.object({
2588
- serverKey: z9.string().optional().describe(`Target semantic metrics server. Choose from: ${serverKeys.join(", ")}. Optional if configured in runConfig.metricsDataSource`),
2589
- datasourceIds: z9.array(z9.string()).optional().describe("Optional array of datasource IDs to query. If not provided, uses all selected datasources or the one configured in runConfig.metricsDataSource.")
2705
+ schema: z10.object({
2706
+ serverKey: z10.string().optional().describe(`Target semantic metrics server. Choose from: ${serverKeys.join(", ")}. Optional if configured in runConfig.metricsDataSource`),
2707
+ datasourceIds: z10.array(z10.string()).optional().describe("Optional array of datasource IDs to query. If not provided, uses all selected datasources or the one configured in runConfig.metricsDataSource.")
2590
2708
  })
2591
2709
  }
2592
2710
  );
2593
2711
  };
2594
2712
 
2595
2713
  // src/tool_lattice/metrics/query_metric_definition.ts
2596
- import z10 from "zod";
2714
+ import z11 from "zod";
2597
2715
  import { tool as tool9 } from "langchain";
2598
2716
  var QUERY_METRIC_DEFINITION_DESCRIPTION = `Get Metric Definition - Step 2 of the Metrics Workflow
2599
2717
 
@@ -2705,17 +2823,17 @@ ${serverKeys.map(
2705
2823
  {
2706
2824
  name: "query_metric_definition",
2707
2825
  description: `${QUERY_METRIC_DEFINITION_DESCRIPTION}${availableServersText}`,
2708
- schema: z10.object({
2709
- serverKey: z10.string().optional().describe(`Target semantic metrics server. Choose from: ${serverKeys.join(", ")}. Optional if configured in runConfig.metricsDataSource`),
2710
- metricName: z10.string().describe("The name of the metric to get definition for."),
2711
- datasourceId: z10.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.")
2826
+ schema: z11.object({
2827
+ serverKey: z11.string().optional().describe(`Target semantic metrics server. Choose from: ${serverKeys.join(", ")}. Optional if configured in runConfig.metricsDataSource`),
2828
+ metricName: z11.string().describe("The name of the metric to get definition for."),
2829
+ datasourceId: z11.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.")
2712
2830
  })
2713
2831
  }
2714
2832
  );
2715
2833
  };
2716
2834
 
2717
2835
  // src/tool_lattice/metrics/query_semantic_metric_data.ts
2718
- import z11 from "zod";
2836
+ import z12 from "zod";
2719
2837
  import { tool as tool10 } from "langchain";
2720
2838
  var QUERY_SEMANTIC_METRIC_DATA_DESCRIPTION = `Query Metric Data - Step 3 of the Metrics Workflow
2721
2839
 
@@ -2932,24 +3050,24 @@ ${serverKeys.map(
2932
3050
  {
2933
3051
  name: "query_semantic_metric_data",
2934
3052
  description: `${QUERY_SEMANTIC_METRIC_DATA_DESCRIPTION}${availableServersText}`,
2935
- schema: z11.object({
2936
- serverKey: z11.string().optional().describe(`Target semantic metrics server. Choose from: ${serverKeys.join(", ")}. Optional if configured in runConfig.metricsDataSource`),
2937
- datasourceId: z11.string().optional().describe("The data source ID to query metrics from. Optional if configured in runConfig.metricsDataSource"),
2938
- metrics: z11.array(z11.string()).describe("Array of metric names to query (e.g., ['net_sales_amt', 'gross_profit'])."),
2939
- groupBy: z11.array(z11.string()).optional().describe("Optional array of dimensions to group by (e.g., ['DocDate__month', 'CustomerCode'])."),
2940
- filters: z11.array(z11.object({
2941
- dimension: z11.string().describe("Dimension/column name to filter on"),
2942
- operator: z11.string().describe("Operator (e.g., 'BETWEEN', '=', '>', '<')"),
2943
- values: z11.array(z11.union([z11.string(), z11.number(), z11.boolean()])).describe("Filter values")
3053
+ schema: z12.object({
3054
+ serverKey: z12.string().optional().describe(`Target semantic metrics server. Choose from: ${serverKeys.join(", ")}. Optional if configured in runConfig.metricsDataSource`),
3055
+ datasourceId: z12.string().optional().describe("The data source ID to query metrics from. Optional if configured in runConfig.metricsDataSource"),
3056
+ metrics: z12.array(z12.string()).describe("Array of metric names to query (e.g., ['net_sales_amt', 'gross_profit'])."),
3057
+ groupBy: z12.array(z12.string()).optional().describe("Optional array of dimensions to group by (e.g., ['DocDate__month', 'CustomerCode'])."),
3058
+ filters: z12.array(z12.object({
3059
+ dimension: z12.string().describe("Dimension/column name to filter on"),
3060
+ operator: z12.string().describe("Operator (e.g., 'BETWEEN', '=', '>', '<')"),
3061
+ values: z12.array(z12.union([z12.string(), z12.number(), z12.boolean()])).describe("Filter values")
2944
3062
  })).optional().describe("Optional array of filters to apply to the query."),
2945
- limit: z11.number().optional().describe("Maximum number of results to return (default: 1000).")
3063
+ limit: z12.number().optional().describe("Maximum number of results to return (default: 1000).")
2946
3064
  })
2947
3065
  }
2948
3066
  );
2949
3067
  };
2950
3068
 
2951
3069
  // src/tool_lattice/metrics/query_tables_list.ts
2952
- import z12 from "zod";
3070
+ import z13 from "zod";
2953
3071
  import { tool as tool11 } from "langchain";
2954
3072
  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.`;
2955
3073
  var createQueryTablesListTool = ({ serverKeys, serverDescriptions, getTenantId: getTenantId2, connectAll }) => {
@@ -3044,16 +3162,16 @@ ${serverKeys.map(
3044
3162
  {
3045
3163
  name: "query_tables_list",
3046
3164
  description: `${QUERY_TABLES_LIST_DESCRIPTION}${availableServersText}`,
3047
- schema: z12.object({
3048
- serverKey: z12.string().optional().describe(`Target semantic metrics server. Choose from: ${serverKeys.join(", ")}. Optional if configured in runConfig.metricsDataSource`),
3049
- datasourceIds: z12.array(z12.string()).optional().describe("Optional array of datasource IDs to query. If not provided, uses the one configured in runConfig.metricsDataSource or all selected datasources.")
3165
+ schema: z13.object({
3166
+ serverKey: z13.string().optional().describe(`Target semantic metrics server. Choose from: ${serverKeys.join(", ")}. Optional if configured in runConfig.metricsDataSource`),
3167
+ datasourceIds: z13.array(z13.string()).optional().describe("Optional array of datasource IDs to query. If not provided, uses the one configured in runConfig.metricsDataSource or all selected datasources.")
3050
3168
  })
3051
3169
  }
3052
3170
  );
3053
3171
  };
3054
3172
 
3055
3173
  // src/tool_lattice/metrics/query_table_definition.ts
3056
- import z13 from "zod";
3174
+ import z14 from "zod";
3057
3175
  import { tool as tool12 } from "langchain";
3058
3176
  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.`;
3059
3177
  var createQueryTableDefinitionTool = ({ serverKeys, serverDescriptions, getTenantId: getTenantId2, connectAll }) => {
@@ -3146,17 +3264,17 @@ ${serverKeys.map(
3146
3264
  {
3147
3265
  name: "query_table_definition",
3148
3266
  description: `${QUERY_TABLE_DEFINITION_DESCRIPTION}${availableServersText}`,
3149
- schema: z13.object({
3150
- serverKey: z13.string().optional().describe(`Target semantic metrics server. Choose from: ${serverKeys.join(", ")}. Optional if configured in runConfig.metricsDataSource`),
3151
- tableName: z13.string().describe("The name of the table to get definition for."),
3152
- datasourceId: z13.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.")
3267
+ schema: z14.object({
3268
+ serverKey: z14.string().optional().describe(`Target semantic metrics server. Choose from: ${serverKeys.join(", ")}. Optional if configured in runConfig.metricsDataSource`),
3269
+ tableName: z14.string().describe("The name of the table to get definition for."),
3270
+ datasourceId: z14.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.")
3153
3271
  })
3154
3272
  }
3155
3273
  );
3156
3274
  };
3157
3275
 
3158
3276
  // src/tool_lattice/metrics/execute_sql_query.ts
3159
- import z14 from "zod";
3277
+ import z15 from "zod";
3160
3278
  import { tool as tool13 } from "langchain";
3161
3279
  var EXECUTE_SQL_QUERY_DESCRIPTION = `Execute Custom SQL Query - Advanced Data Analysis Tool
3162
3280
 
@@ -3252,19 +3370,19 @@ ${serverKeys.map(
3252
3370
  {
3253
3371
  name: "execute_sql_query",
3254
3372
  description: `${EXECUTE_SQL_QUERY_DESCRIPTION}${availableServersText}`,
3255
- schema: z14.object({
3256
- serverKey: z14.string().optional().describe(`Target semantic metrics server. Choose from: ${serverKeys.join(", ")}. Optional if configured in runConfig.metricsDataSource`),
3257
- datasourceId: z14.string().optional().describe("The data source ID to execute SQL against. Optional if configured in runConfig.metricsDataSource"),
3258
- customSql: z14.string().describe("Custom SQL query string with named parameters (e.g., :year, :category). Use double quotes for identifiers."),
3259
- params: z14.record(z14.union([z14.string(), z14.number(), z14.boolean()])).optional().describe("Optional parameters for the SQL query. Keys should match the :paramName placeholders in customSql."),
3260
- limit: z14.number().optional().describe("Maximum number of results to return (default: 100).")
3373
+ schema: z15.object({
3374
+ serverKey: z15.string().optional().describe(`Target semantic metrics server. Choose from: ${serverKeys.join(", ")}. Optional if configured in runConfig.metricsDataSource`),
3375
+ datasourceId: z15.string().optional().describe("The data source ID to execute SQL against. Optional if configured in runConfig.metricsDataSource"),
3376
+ customSql: z15.string().describe("Custom SQL query string with named parameters (e.g., :year, :category). Use double quotes for identifiers."),
3377
+ params: z15.record(z15.union([z15.string(), z15.number(), z15.boolean()])).optional().describe("Optional parameters for the SQL query. Keys should match the :paramName placeholders in customSql."),
3378
+ limit: z15.number().optional().describe("Maximum number of results to return (default: 100).")
3261
3379
  })
3262
3380
  }
3263
3381
  );
3264
3382
  };
3265
3383
 
3266
3384
  // src/tool_lattice/code_eval/index.ts
3267
- import z15 from "zod";
3385
+ import z16 from "zod";
3268
3386
 
3269
3387
  // src/deep_agent_new/backends/volumeFilesystem.ts
3270
3388
  var VolumeFilesystem = class {
@@ -3537,7 +3655,7 @@ var getSandBoxManager = (key = "default") => {
3537
3655
  import { tool as tool14 } from "langchain";
3538
3656
 
3539
3657
  // src/tool_lattice/shell_exec/index.ts
3540
- import z16 from "zod";
3658
+ import z17 from "zod";
3541
3659
  import { tool as tool15 } from "langchain";
3542
3660
  var SHELL_EXEC_DESCRIPTION = `Execute a shell command in the sandbox environment.
3543
3661
 
@@ -3587,17 +3705,17 @@ ${executeResult.output}`;
3587
3705
  {
3588
3706
  name: "shell_exec",
3589
3707
  description: SHELL_EXEC_DESCRIPTION,
3590
- schema: z16.object({
3591
- command: z16.string().describe("Shell command to execute"),
3592
- exec_dir: z16.string().optional().describe("Working directory for the command (defaults to sandbox home directory)"),
3593
- timeout: z16.number().optional().describe("Timeout in seconds (defaults to 300)")
3708
+ schema: z17.object({
3709
+ command: z17.string().describe("Shell command to execute"),
3710
+ exec_dir: z17.string().optional().describe("Working directory for the command (defaults to sandbox home directory)"),
3711
+ timeout: z17.number().optional().describe("Timeout in seconds (defaults to 300)")
3594
3712
  })
3595
3713
  }
3596
3714
  );
3597
3715
  };
3598
3716
 
3599
3717
  // src/tool_lattice/convert_to_markdown/index.ts
3600
- import z17 from "zod";
3718
+ import z18 from "zod";
3601
3719
  var CONVERT_TO_MARKDOWN_DESCRIPTION = `Convert a resource described by an http:, https:, file: or data: URI to markdown.
3602
3720
 
3603
3721
  Args:
@@ -3614,8 +3732,8 @@ registerToolLattice(
3614
3732
  name: "convert_to_markdown",
3615
3733
  description: CONVERT_TO_MARKDOWN_DESCRIPTION,
3616
3734
  needUserApprove: false,
3617
- schema: z17.object({
3618
- uri: z17.string().describe("The URI to convert.")
3735
+ schema: z18.object({
3736
+ uri: z18.string().describe("The URI to convert.")
3619
3737
  })
3620
3738
  },
3621
3739
  async (input, exe_config) => {
@@ -3647,7 +3765,7 @@ registerToolLattice(
3647
3765
  );
3648
3766
 
3649
3767
  // src/tool_lattice/browser/browser_navigate.ts
3650
- import z18 from "zod";
3768
+ import z19 from "zod";
3651
3769
  import { tool as tool16 } from "langchain";
3652
3770
  import { SandboxClient } from "@agent-infra/sandbox";
3653
3771
  var BROWSER_NAVIGATE_DESCRIPTION = `Navigate to a URL.
@@ -3676,15 +3794,15 @@ var createBrowserNavigateTool = ({ vmIsolation }) => {
3676
3794
  {
3677
3795
  name: "browser_navigate",
3678
3796
  description: BROWSER_NAVIGATE_DESCRIPTION,
3679
- schema: z18.object({
3680
- url: z18.string().describe("The URL to navigate to.")
3797
+ schema: z19.object({
3798
+ url: z19.string().describe("The URL to navigate to.")
3681
3799
  })
3682
3800
  }
3683
3801
  );
3684
3802
  };
3685
3803
 
3686
3804
  // src/tool_lattice/browser/browser_click.ts
3687
- import z19 from "zod";
3805
+ import z20 from "zod";
3688
3806
  import { tool as tool17 } from "langchain";
3689
3807
  import { SandboxClient as SandboxClient2 } from "@agent-infra/sandbox";
3690
3808
  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.
@@ -3713,15 +3831,15 @@ var createBrowserClickTool = ({ vmIsolation }) => {
3713
3831
  {
3714
3832
  name: "browser_click",
3715
3833
  description: BROWSER_CLICK_DESCRIPTION,
3716
- schema: z19.object({
3717
- index: z19.number().describe("Index of the element to click")
3834
+ schema: z20.object({
3835
+ index: z20.number().describe("Index of the element to click")
3718
3836
  })
3719
3837
  }
3720
3838
  );
3721
3839
  };
3722
3840
 
3723
3841
  // src/tool_lattice/browser/browser_get_text.ts
3724
- import z20 from "zod";
3842
+ import z21 from "zod";
3725
3843
  import { tool as tool18 } from "langchain";
3726
3844
  import { SandboxClient as SandboxClient3 } from "@agent-infra/sandbox";
3727
3845
  var BROWSER_GET_TEXT_DESCRIPTION = `Get the text content of the current page.
@@ -3748,13 +3866,13 @@ var createBrowserGetTextTool = ({ vmIsolation }) => {
3748
3866
  {
3749
3867
  name: "browser_get_text",
3750
3868
  description: BROWSER_GET_TEXT_DESCRIPTION,
3751
- schema: z20.object({})
3869
+ schema: z21.object({})
3752
3870
  }
3753
3871
  );
3754
3872
  };
3755
3873
 
3756
3874
  // src/tool_lattice/browser/browser_get_markdown.ts
3757
- import z21 from "zod";
3875
+ import z22 from "zod";
3758
3876
  import { tool as tool19 } from "langchain";
3759
3877
  import { SandboxClient as SandboxClient4 } from "@agent-infra/sandbox";
3760
3878
  var BROWSER_GET_MARKDOWN_DESCRIPTION = `Get the markdown content of the current page.
@@ -3781,13 +3899,13 @@ var createBrowserGetMarkdownTool = ({ vmIsolation }) => {
3781
3899
  {
3782
3900
  name: "browser_get_markdown",
3783
3901
  description: BROWSER_GET_MARKDOWN_DESCRIPTION,
3784
- schema: z21.object({})
3902
+ schema: z22.object({})
3785
3903
  }
3786
3904
  );
3787
3905
  };
3788
3906
 
3789
3907
  // src/tool_lattice/browser/browser_evaluate.ts
3790
- import z22 from "zod";
3908
+ import z23 from "zod";
3791
3909
  import { tool as tool20 } from "langchain";
3792
3910
  import { SandboxClient as SandboxClient5 } from "@agent-infra/sandbox";
3793
3911
  var BROWSER_EVALUATE_DESCRIPTION = `Execute JavaScript in the browser console.
@@ -3816,15 +3934,15 @@ var createBrowserEvaluateTool = ({ vmIsolation }) => {
3816
3934
  {
3817
3935
  name: "browser_evaluate",
3818
3936
  description: BROWSER_EVALUATE_DESCRIPTION,
3819
- schema: z22.object({
3820
- script: z22.string().describe("JavaScript code to execute, () => { /* code */ }")
3937
+ schema: z23.object({
3938
+ script: z23.string().describe("JavaScript code to execute, () => { /* code */ }")
3821
3939
  })
3822
3940
  }
3823
3941
  );
3824
3942
  };
3825
3943
 
3826
3944
  // src/tool_lattice/browser/browser_screenshot.ts
3827
- import z23 from "zod";
3945
+ import z24 from "zod";
3828
3946
  import { tool as tool21 } from "langchain";
3829
3947
  import { SandboxClient as SandboxClient6 } from "@agent-infra/sandbox";
3830
3948
  var BROWSER_SCREENSHOT_DESCRIPTION = `Take a screenshot of the current page or a specific element.
@@ -3891,21 +4009,21 @@ var createBrowserScreenshotTool = ({ vmIsolation }) => {
3891
4009
  {
3892
4010
  name: "browser_screenshot",
3893
4011
  description: BROWSER_SCREENSHOT_DESCRIPTION,
3894
- schema: z23.object({
3895
- name: z23.string().optional().describe("Name for the screenshot"),
3896
- selector: z23.string().optional().describe("CSS selector for element to screenshot"),
3897
- index: z23.number().optional().describe("index of the element to screenshot"),
3898
- width: z23.number().optional().describe("Width in pixels (default: viewport width)"),
3899
- height: z23.number().optional().describe("Height in pixels (default: viewport height)"),
3900
- fullPage: z23.boolean().optional().describe("Full page screenshot (default: false)"),
3901
- highlight: z23.boolean().default(false).describe("Highlight the element")
4012
+ schema: z24.object({
4013
+ name: z24.string().optional().describe("Name for the screenshot"),
4014
+ selector: z24.string().optional().describe("CSS selector for element to screenshot"),
4015
+ index: z24.number().optional().describe("index of the element to screenshot"),
4016
+ width: z24.number().optional().describe("Width in pixels (default: viewport width)"),
4017
+ height: z24.number().optional().describe("Height in pixels (default: viewport height)"),
4018
+ fullPage: z24.boolean().optional().describe("Full page screenshot (default: false)"),
4019
+ highlight: z24.boolean().default(false).describe("Highlight the element")
3902
4020
  })
3903
4021
  }
3904
4022
  );
3905
4023
  };
3906
4024
 
3907
4025
  // src/tool_lattice/browser/browser_scroll.ts
3908
- import z24 from "zod";
4026
+ import z25 from "zod";
3909
4027
  import { tool as tool22 } from "langchain";
3910
4028
  import { SandboxClient as SandboxClient7 } from "@agent-infra/sandbox";
3911
4029
  var BROWSER_SCROLL_DESCRIPTION = `Scroll the page.
@@ -3934,15 +4052,15 @@ var createBrowserScrollTool = ({ vmIsolation }) => {
3934
4052
  {
3935
4053
  name: "browser_scroll",
3936
4054
  description: BROWSER_SCROLL_DESCRIPTION,
3937
- schema: z24.object({
3938
- amount: z24.number().optional().describe("Pixels to scroll (positive for down, negative for up)")
4055
+ schema: z25.object({
4056
+ amount: z25.number().optional().describe("Pixels to scroll (positive for down, negative for up)")
3939
4057
  })
3940
4058
  }
3941
4059
  );
3942
4060
  };
3943
4061
 
3944
4062
  // src/tool_lattice/browser/browser_form_input_fill.ts
3945
- import z25 from "zod";
4063
+ import z26 from "zod";
3946
4064
  import { tool as tool23 } from "langchain";
3947
4065
  import { SandboxClient as SandboxClient8 } from "@agent-infra/sandbox";
3948
4066
  var BROWSER_FORM_INPUT_FILL_DESCRIPTION = `Fill out an input field, before using the tool, Either 'index' or 'selector' must be provided.
@@ -3977,18 +4095,18 @@ var createBrowserFormInputFillTool = ({ vmIsolation }) => {
3977
4095
  {
3978
4096
  name: "browser_form_input_fill",
3979
4097
  description: BROWSER_FORM_INPUT_FILL_DESCRIPTION,
3980
- schema: z25.object({
3981
- selector: z25.string().optional().describe("CSS selector for input field"),
3982
- index: z25.number().optional().describe("Index of the element to fill"),
3983
- value: z25.string().describe("Value to fill"),
3984
- clear: z25.boolean().default(false).describe("Whether to clear existing text before filling")
4098
+ schema: z26.object({
4099
+ selector: z26.string().optional().describe("CSS selector for input field"),
4100
+ index: z26.number().optional().describe("Index of the element to fill"),
4101
+ value: z26.string().describe("Value to fill"),
4102
+ clear: z26.boolean().default(false).describe("Whether to clear existing text before filling")
3985
4103
  })
3986
4104
  }
3987
4105
  );
3988
4106
  };
3989
4107
 
3990
4108
  // src/tool_lattice/browser/browser_select.ts
3991
- import z26 from "zod";
4109
+ import z27 from "zod";
3992
4110
  import { tool as tool24 } from "langchain";
3993
4111
  import { SandboxClient as SandboxClient9 } from "@agent-infra/sandbox";
3994
4112
  var BROWSER_SELECT_DESCRIPTION = `Select an element on the page with index, Either 'index' or 'selector' must be provided.
@@ -4021,17 +4139,17 @@ var createBrowserSelectTool = ({ vmIsolation }) => {
4021
4139
  {
4022
4140
  name: "browser_select",
4023
4141
  description: BROWSER_SELECT_DESCRIPTION,
4024
- schema: z26.object({
4025
- index: z26.number().optional().describe("Index of the element to select"),
4026
- selector: z26.string().optional().describe("CSS selector for element to select"),
4027
- value: z26.string().describe("Value to select")
4142
+ schema: z27.object({
4143
+ index: z27.number().optional().describe("Index of the element to select"),
4144
+ selector: z27.string().optional().describe("CSS selector for element to select"),
4145
+ value: z27.string().describe("Value to select")
4028
4146
  })
4029
4147
  }
4030
4148
  );
4031
4149
  };
4032
4150
 
4033
4151
  // src/tool_lattice/browser/browser_hover.ts
4034
- import z27 from "zod";
4152
+ import z28 from "zod";
4035
4153
  import { tool as tool25 } from "langchain";
4036
4154
  import { SandboxClient as SandboxClient10 } from "@agent-infra/sandbox";
4037
4155
  var BROWSER_HOVER_DESCRIPTION = `Hover an element on the page, Either 'index' or 'selector' must be provided.
@@ -4062,16 +4180,16 @@ var createBrowserHoverTool = ({ vmIsolation }) => {
4062
4180
  {
4063
4181
  name: "browser_hover",
4064
4182
  description: BROWSER_HOVER_DESCRIPTION,
4065
- schema: z27.object({
4066
- index: z27.number().optional().describe("Index of the element to hover"),
4067
- selector: z27.string().optional().describe("CSS selector for element to hover")
4183
+ schema: z28.object({
4184
+ index: z28.number().optional().describe("Index of the element to hover"),
4185
+ selector: z28.string().optional().describe("CSS selector for element to hover")
4068
4186
  })
4069
4187
  }
4070
4188
  );
4071
4189
  };
4072
4190
 
4073
4191
  // src/tool_lattice/browser/browser_go_back.ts
4074
- import z28 from "zod";
4192
+ import z29 from "zod";
4075
4193
  import { tool as tool26 } from "langchain";
4076
4194
  import { SandboxClient as SandboxClient11 } from "@agent-infra/sandbox";
4077
4195
  var BROWSER_GO_BACK_DESCRIPTION = `Go back to the previous page.
@@ -4098,13 +4216,13 @@ var createBrowserGoBackTool = ({ vmIsolation }) => {
4098
4216
  {
4099
4217
  name: "browser_go_back",
4100
4218
  description: BROWSER_GO_BACK_DESCRIPTION,
4101
- schema: z28.object({})
4219
+ schema: z29.object({})
4102
4220
  }
4103
4221
  );
4104
4222
  };
4105
4223
 
4106
4224
  // src/tool_lattice/browser/browser_go_forward.ts
4107
- import z29 from "zod";
4225
+ import z30 from "zod";
4108
4226
  import { tool as tool27 } from "langchain";
4109
4227
  import { SandboxClient as SandboxClient12 } from "@agent-infra/sandbox";
4110
4228
  var BROWSER_GO_FORWARD_DESCRIPTION = `Go forward to the next page.
@@ -4131,13 +4249,13 @@ var createBrowserGoForwardTool = ({ vmIsolation }) => {
4131
4249
  {
4132
4250
  name: "browser_go_forward",
4133
4251
  description: BROWSER_GO_FORWARD_DESCRIPTION,
4134
- schema: z29.object({})
4252
+ schema: z30.object({})
4135
4253
  }
4136
4254
  );
4137
4255
  };
4138
4256
 
4139
4257
  // src/tool_lattice/browser/browser_new_tab.ts
4140
- import z30 from "zod";
4258
+ import z31 from "zod";
4141
4259
  import { tool as tool28 } from "langchain";
4142
4260
  import { SandboxClient as SandboxClient13 } from "@agent-infra/sandbox";
4143
4261
  var BROWSER_NEW_TAB_DESCRIPTION = `Open a new tab.
@@ -4166,15 +4284,15 @@ var createBrowserNewTabTool = ({ vmIsolation }) => {
4166
4284
  {
4167
4285
  name: "browser_new_tab",
4168
4286
  description: BROWSER_NEW_TAB_DESCRIPTION,
4169
- schema: z30.object({
4170
- url: z30.string().describe("URL to open in the new tab")
4287
+ schema: z31.object({
4288
+ url: z31.string().describe("URL to open in the new tab")
4171
4289
  })
4172
4290
  }
4173
4291
  );
4174
4292
  };
4175
4293
 
4176
4294
  // src/tool_lattice/browser/browser_tab_list.ts
4177
- import z31 from "zod";
4295
+ import z32 from "zod";
4178
4296
  import { tool as tool29 } from "langchain";
4179
4297
  import { SandboxClient as SandboxClient14 } from "@agent-infra/sandbox";
4180
4298
  var BROWSER_TAB_LIST_DESCRIPTION = `Get the list of tabs.
@@ -4201,13 +4319,13 @@ var createBrowserTabListTool = ({ vmIsolation }) => {
4201
4319
  {
4202
4320
  name: "browser_tab_list",
4203
4321
  description: BROWSER_TAB_LIST_DESCRIPTION,
4204
- schema: z31.object({})
4322
+ schema: z32.object({})
4205
4323
  }
4206
4324
  );
4207
4325
  };
4208
4326
 
4209
4327
  // src/tool_lattice/browser/browser_switch_tab.ts
4210
- import z32 from "zod";
4328
+ import z33 from "zod";
4211
4329
  import { tool as tool30 } from "langchain";
4212
4330
  import { SandboxClient as SandboxClient15 } from "@agent-infra/sandbox";
4213
4331
  var BROWSER_SWITCH_TAB_DESCRIPTION = `Switch to a specific tab.
@@ -4236,15 +4354,15 @@ var createBrowserSwitchTabTool = ({ vmIsolation }) => {
4236
4354
  {
4237
4355
  name: "browser_switch_tab",
4238
4356
  description: BROWSER_SWITCH_TAB_DESCRIPTION,
4239
- schema: z32.object({
4240
- index: z32.number().describe("Tab index to switch to")
4357
+ schema: z33.object({
4358
+ index: z33.number().describe("Tab index to switch to")
4241
4359
  })
4242
4360
  }
4243
4361
  );
4244
4362
  };
4245
4363
 
4246
4364
  // src/tool_lattice/browser/browser_close_tab.ts
4247
- import z33 from "zod";
4365
+ import z34 from "zod";
4248
4366
  import { tool as tool31 } from "langchain";
4249
4367
  import { SandboxClient as SandboxClient16 } from "@agent-infra/sandbox";
4250
4368
  var BROWSER_CLOSE_TAB_DESCRIPTION = `Close the current tab.
@@ -4271,13 +4389,13 @@ var createBrowserCloseTabTool = ({ vmIsolation }) => {
4271
4389
  {
4272
4390
  name: "browser_close_tab",
4273
4391
  description: BROWSER_CLOSE_TAB_DESCRIPTION,
4274
- schema: z33.object({})
4392
+ schema: z34.object({})
4275
4393
  }
4276
4394
  );
4277
4395
  };
4278
4396
 
4279
4397
  // src/tool_lattice/browser/browser_close.ts
4280
- import z34 from "zod";
4398
+ import z35 from "zod";
4281
4399
  import { tool as tool32 } from "langchain";
4282
4400
  import { SandboxClient as SandboxClient17 } from "@agent-infra/sandbox";
4283
4401
  var BROWSER_CLOSE_DESCRIPTION = `Close the browser when the task is done and the browser is not needed anymore.
@@ -4304,13 +4422,13 @@ var createBrowserCloseTool = ({ vmIsolation }) => {
4304
4422
  {
4305
4423
  name: "browser_close",
4306
4424
  description: BROWSER_CLOSE_DESCRIPTION,
4307
- schema: z34.object({})
4425
+ schema: z35.object({})
4308
4426
  }
4309
4427
  );
4310
4428
  };
4311
4429
 
4312
4430
  // src/tool_lattice/browser/browser_press_key.ts
4313
- import z35 from "zod";
4431
+ import z36 from "zod";
4314
4432
  import { tool as tool33 } from "langchain";
4315
4433
  import { SandboxClient as SandboxClient18 } from "@agent-infra/sandbox";
4316
4434
  var BROWSER_PRESS_KEY_DESCRIPTION = `Press a key on the keyboard.
@@ -4339,8 +4457,8 @@ var createBrowserPressKeyTool = ({ vmIsolation }) => {
4339
4457
  {
4340
4458
  name: "browser_press_key",
4341
4459
  description: BROWSER_PRESS_KEY_DESCRIPTION,
4342
- schema: z35.object({
4343
- key: z35.enum([
4460
+ schema: z36.object({
4461
+ key: z36.enum([
4344
4462
  "Enter",
4345
4463
  "Tab",
4346
4464
  "Escape",
@@ -4387,7 +4505,7 @@ var createBrowserPressKeyTool = ({ vmIsolation }) => {
4387
4505
  };
4388
4506
 
4389
4507
  // src/tool_lattice/browser/browser_read_links.ts
4390
- import z36 from "zod";
4508
+ import z37 from "zod";
4391
4509
  import { tool as tool34 } from "langchain";
4392
4510
  import { SandboxClient as SandboxClient19 } from "@agent-infra/sandbox";
4393
4511
  var BROWSER_READ_LINKS_DESCRIPTION = `Get all links on the current page.
@@ -4414,13 +4532,13 @@ var createBrowserReadLinksTool = ({ vmIsolation }) => {
4414
4532
  {
4415
4533
  name: "browser_read_links",
4416
4534
  description: BROWSER_READ_LINKS_DESCRIPTION,
4417
- schema: z36.object({})
4535
+ schema: z37.object({})
4418
4536
  }
4419
4537
  );
4420
4538
  };
4421
4539
 
4422
4540
  // src/tool_lattice/browser/browser_get_clickable_elements.ts
4423
- import z37 from "zod";
4541
+ import z38 from "zod";
4424
4542
  import { tool as tool35 } from "langchain";
4425
4543
  import { SandboxClient as SandboxClient20 } from "@agent-infra/sandbox";
4426
4544
  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.
@@ -4447,13 +4565,13 @@ var createBrowserGetClickableElementsTool = ({ vmIsolation }) => {
4447
4565
  {
4448
4566
  name: "browser_get_clickable_elements",
4449
4567
  description: BROWSER_GET_CLICKABLE_ELEMENTS_DESCRIPTION,
4450
- schema: z37.object({})
4568
+ schema: z38.object({})
4451
4569
  }
4452
4570
  );
4453
4571
  };
4454
4572
 
4455
4573
  // src/tool_lattice/browser/browser_get_download_list.ts
4456
- import z38 from "zod";
4574
+ import z39 from "zod";
4457
4575
  import { tool as tool36 } from "langchain";
4458
4576
  import { SandboxClient as SandboxClient21 } from "@agent-infra/sandbox";
4459
4577
  var BROWSER_GET_DOWNLOAD_LIST_DESCRIPTION = `Get the list of downloaded files.
@@ -4480,13 +4598,13 @@ var createBrowserGetDownloadListTool = ({ vmIsolation }) => {
4480
4598
  {
4481
4599
  name: "browser_get_download_list",
4482
4600
  description: BROWSER_GET_DOWNLOAD_LIST_DESCRIPTION,
4483
- schema: z38.object({})
4601
+ schema: z39.object({})
4484
4602
  }
4485
4603
  );
4486
4604
  };
4487
4605
 
4488
4606
  // src/tool_lattice/browser/get_info.ts
4489
- import z39 from "zod";
4607
+ import z40 from "zod";
4490
4608
  import { tool as tool37 } from "langchain";
4491
4609
  import { SandboxClient as SandboxClient22 } from "@agent-infra/sandbox";
4492
4610
  var BROWSER_GET_INFO_DESCRIPTION = `Get information about browser, like CDP URL, viewport size, etc.
@@ -4515,7 +4633,7 @@ var createBrowserGetInfoTool = ({ vmIsolation }) => {
4515
4633
  {
4516
4634
  name: "browser_get_info",
4517
4635
  description: BROWSER_GET_INFO_DESCRIPTION,
4518
- schema: z39.object({})
4636
+ schema: z40.object({})
4519
4637
  }
4520
4638
  );
4521
4639
  };
@@ -4628,9 +4746,9 @@ import { createAgent } from "langchain";
4628
4746
  import { createMiddleware } from "langchain";
4629
4747
 
4630
4748
  // src/middlewares/contextSchema.ts
4631
- import z40 from "zod";
4632
- var contextSchema = z40.object({
4633
- runConfig: z40.any()
4749
+ import z41 from "zod";
4750
+ var contextSchema = z41.object({
4751
+ runConfig: z41.any()
4634
4752
  });
4635
4753
 
4636
4754
  // src/middlewares/codeEvalMiddleware.ts
@@ -4832,11 +4950,11 @@ function safeJsonParse(text, fallback) {
4832
4950
  }
4833
4951
 
4834
4952
  // src/tool_lattice/skill/load_skills.ts
4835
- import z41 from "zod";
4953
+ import z42 from "zod";
4836
4954
  import { tool as tool38 } from "langchain";
4837
4955
 
4838
4956
  // src/tool_lattice/skill/load_skill_content.ts
4839
- import z42 from "zod";
4957
+ import z43 from "zod";
4840
4958
  import { tool as tool39 } from "langchain";
4841
4959
 
4842
4960
  // src/skill_lattice/builtinSkills.ts
@@ -5198,8 +5316,8 @@ var createLoadSkillContentTool = () => {
5198
5316
  {
5199
5317
  name: "skill",
5200
5318
  description: LOAD_SKILL_CONTENT_DESCRIPTION,
5201
- schema: z42.object({
5202
- skill_name: z42.string().describe("The name of the skill to load")
5319
+ schema: z43.object({
5320
+ skill_name: z43.string().describe("The name of the skill to load")
5203
5321
  })
5204
5322
  }
5205
5323
  );
@@ -6195,16 +6313,16 @@ import { GraphInterrupt as GraphInterrupt2, interrupt as interrupt2 } from "@lan
6195
6313
 
6196
6314
  // src/tool_lattice/ask_user_to_clarify/index.ts
6197
6315
  import { tool as tool41 } from "langchain";
6198
- import z43 from "zod";
6199
- var questionSchema = z43.object({
6200
- question: z43.string().describe("The question text to ask the user"),
6201
- options: z43.array(z43.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."),
6202
- type: z43.enum(["single", "multiple"]).describe("Whether the question allows single or multiple selections"),
6203
- required: z43.boolean().optional().default(false).describe("Whether this question must be answered"),
6204
- allowOther: z43.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.")
6316
+ import z44 from "zod";
6317
+ var questionSchema = z44.object({
6318
+ question: z44.string().describe("The question text to ask the user"),
6319
+ options: z44.array(z44.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."),
6320
+ type: z44.enum(["single", "multiple"]).describe("Whether the question allows single or multiple selections"),
6321
+ required: z44.boolean().optional().default(false).describe("Whether this question must be answered"),
6322
+ allowOther: z44.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.")
6205
6323
  });
6206
- var inputSchema = z43.object({
6207
- questions: z43.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.")
6324
+ var inputSchema = z44.object({
6325
+ questions: z44.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.")
6208
6326
  });
6209
6327
  function createAskUserToClarifyTool() {
6210
6328
  return tool41(
@@ -6311,7 +6429,7 @@ import { createMiddleware as createMiddleware8 } from "langchain";
6311
6429
 
6312
6430
  // src/tool_lattice/widget/loadGuidelines.ts
6313
6431
  import { tool as tool42 } from "langchain";
6314
- import { z as z44 } from "zod";
6432
+ import { z as z45 } from "zod";
6315
6433
 
6316
6434
  // src/middlewares/guidelines/index.ts
6317
6435
  var CORE = `# Imagine \u2014 Visual Creation Suite
@@ -7102,8 +7220,8 @@ function getGuidelines(modules) {
7102
7220
  var AVAILABLE_MODULES = Object.keys(MODULE_SECTIONS);
7103
7221
 
7104
7222
  // src/tool_lattice/widget/loadGuidelines.ts
7105
- var LoadGuidelinesInputSchema = z44.object({
7106
- modules: z44.array(z44.string()).describe(
7223
+ var LoadGuidelinesInputSchema = z45.object({
7224
+ modules: z45.array(z45.string()).describe(
7107
7225
  "Which design modules to load. Choose all that apply. Available modules: [" + AVAILABLE_MODULES.join(",") + "]"
7108
7226
  )
7109
7227
  });
@@ -7123,7 +7241,7 @@ function createLoadGuidelinesTool() {
7123
7241
 
7124
7242
  // src/tool_lattice/widget/showWidget.ts
7125
7243
  import { tool as tool43 } from "langchain";
7126
- import { z as z45 } from "zod";
7244
+ import { z as z46 } from "zod";
7127
7245
  function containsForbiddenTags(code) {
7128
7246
  const forbiddenPatterns = [
7129
7247
  /<!DOCTYPE/i,
@@ -7145,15 +7263,15 @@ function validateWidgetCode(code) {
7145
7263
  }
7146
7264
  return { valid: true };
7147
7265
  }
7148
- var ShowWidgetInputSchema = z45.object({
7149
- i_have_seen_guidelines: z45.boolean().describe(
7266
+ var ShowWidgetInputSchema = z46.object({
7267
+ i_have_seen_guidelines: z46.boolean().describe(
7150
7268
  "Must be true. Confirm you have called load_guidelines first."
7151
7269
  ),
7152
- title: z45.string().describe("Title displayed above the widget"),
7153
- loading_messages: z45.array(z45.string()).optional().describe(
7270
+ title: z46.string().describe("Title displayed above the widget"),
7271
+ loading_messages: z46.array(z46.string()).optional().describe(
7154
7272
  "1-4 short strings shown while the widget renders"
7155
7273
  ),
7156
- widget_code: z45.string().describe(
7274
+ widget_code: z46.string().describe(
7157
7275
  "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."
7158
7276
  )
7159
7277
  });
@@ -7921,7 +8039,7 @@ Please select a valid tool from the list above.`
7921
8039
 
7922
8040
  // src/deep_agent_new/middleware/date.ts
7923
8041
  import { createMiddleware as createMiddleware12, tool as tool44 } from "langchain";
7924
- import { z as z46 } from "zod";
8042
+ import { z as z47 } from "zod";
7925
8043
  function formatCurrentDate(timezone = "UTC") {
7926
8044
  const now = /* @__PURE__ */ new Date();
7927
8045
  let validTimezone = timezone;
@@ -7982,7 +8100,7 @@ function createDateMiddleware(options = {}) {
7982
8100
  {
7983
8101
  name: "get_current_date_time",
7984
8102
  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.",
7985
- schema: z46.object({})
8103
+ schema: z47.object({})
7986
8104
  }
7987
8105
  )
7988
8106
  ],
@@ -8001,7 +8119,7 @@ ${currentSystemPrompt}` : dateContext;
8001
8119
 
8002
8120
  // src/deep_agent_new/middleware/scheduler.ts
8003
8121
  import { tool as tool45, createMiddleware as createMiddleware13 } from "langchain";
8004
- import { z as z47 } from "zod";
8122
+ import { z as z48 } from "zod";
8005
8123
  import { v4 as uuidv4 } from "uuid";
8006
8124
  import { ScheduledTaskStatus as ScheduledTaskStatus3, ScheduleExecutionType as ScheduleExecutionType3 } from "@axiom-lattice/protocols";
8007
8125
 
@@ -10950,6 +11068,138 @@ var InMemoryWorkflowTrackingStore = class {
10950
11068
  }
10951
11069
  };
10952
11070
 
11071
+ // src/store_lattice/InMemoryChannelInstallationStore.ts
11072
+ var InMemoryChannelInstallationStore = class {
11073
+ constructor() {
11074
+ this.installations = /* @__PURE__ */ new Map();
11075
+ }
11076
+ async getInstallationById(installationId) {
11077
+ return this.installations.get(installationId) || null;
11078
+ }
11079
+ async getInstallationsByTenant(tenantId, channel) {
11080
+ return Array.from(this.installations.values()).filter(
11081
+ (inst) => inst.tenantId === tenantId && (!channel || inst.channel === channel)
11082
+ );
11083
+ }
11084
+ async createInstallation(tenantId, installationId, data) {
11085
+ const now = /* @__PURE__ */ new Date();
11086
+ const installation = {
11087
+ id: installationId,
11088
+ tenantId,
11089
+ channel: data.channel,
11090
+ name: data.name,
11091
+ config: data.config,
11092
+ enabled: data.enabled ?? true,
11093
+ fallbackAgentId: data.fallbackAgentId,
11094
+ rejectWhenNoBinding: data.rejectWhenNoBinding ?? true,
11095
+ createdAt: now,
11096
+ updatedAt: now
11097
+ };
11098
+ this.installations.set(installationId, installation);
11099
+ return installation;
11100
+ }
11101
+ async updateInstallation(tenantId, installationId, updates) {
11102
+ const existing = this.installations.get(installationId);
11103
+ if (!existing || existing.tenantId !== tenantId) return null;
11104
+ const updated = {
11105
+ ...existing,
11106
+ name: updates.name !== void 0 ? updates.name : existing.name,
11107
+ config: updates.config !== void 0 ? { ...existing.config, ...updates.config } : existing.config,
11108
+ enabled: updates.enabled !== void 0 ? updates.enabled : existing.enabled,
11109
+ fallbackAgentId: updates.fallbackAgentId !== void 0 ? updates.fallbackAgentId : existing.fallbackAgentId,
11110
+ rejectWhenNoBinding: updates.rejectWhenNoBinding !== void 0 ? updates.rejectWhenNoBinding : existing.rejectWhenNoBinding,
11111
+ updatedAt: /* @__PURE__ */ new Date()
11112
+ };
11113
+ this.installations.set(installationId, updated);
11114
+ return updated;
11115
+ }
11116
+ async deleteInstallation(tenantId, installationId) {
11117
+ const existing = this.installations.get(installationId);
11118
+ if (!existing || existing.tenantId !== tenantId) return false;
11119
+ return this.installations.delete(installationId);
11120
+ }
11121
+ clear() {
11122
+ this.installations.clear();
11123
+ }
11124
+ };
11125
+
11126
+ // src/store_lattice/InMemoryBindingStore.ts
11127
+ import { randomUUID } from "crypto";
11128
+ var InMemoryBindingStore = class {
11129
+ constructor() {
11130
+ this.bindings = /* @__PURE__ */ new Map();
11131
+ }
11132
+ async resolve(params) {
11133
+ for (const binding of this.bindings.values()) {
11134
+ if (binding.channel === params.channel && binding.senderId === params.senderId && binding.channelInstallationId === params.channelInstallationId && binding.tenantId === params.tenantId && binding.enabled) {
11135
+ return binding;
11136
+ }
11137
+ }
11138
+ return null;
11139
+ }
11140
+ async create(input) {
11141
+ const now = /* @__PURE__ */ new Date();
11142
+ const binding = {
11143
+ id: randomUUID(),
11144
+ channel: input.channel,
11145
+ channelInstallationId: input.channelInstallationId,
11146
+ tenantId: input.tenantId,
11147
+ senderId: input.senderId,
11148
+ agentId: input.agentId,
11149
+ threadId: void 0,
11150
+ workspaceId: input.workspaceId,
11151
+ projectId: input.projectId,
11152
+ threadMode: input.threadMode || "fixed",
11153
+ senderDisplayName: input.senderDisplayName,
11154
+ senderMetadata: input.senderMetadata,
11155
+ enabled: true,
11156
+ createdAt: now,
11157
+ updatedAt: now
11158
+ };
11159
+ this.bindings.set(binding.id, binding);
11160
+ return binding;
11161
+ }
11162
+ async update(id, patch) {
11163
+ const existing = this.bindings.get(id);
11164
+ if (!existing) throw new Error(`Binding ${id} not found`);
11165
+ const updated = {
11166
+ ...existing,
11167
+ ...patch,
11168
+ updatedAt: /* @__PURE__ */ new Date()
11169
+ };
11170
+ this.bindings.set(id, updated);
11171
+ return updated;
11172
+ }
11173
+ async delete(id) {
11174
+ this.bindings.delete(id);
11175
+ }
11176
+ async list(params) {
11177
+ let results = Array.from(this.bindings.values()).filter((b) => {
11178
+ if (b.tenantId !== params.tenantId) return false;
11179
+ if (params.channel && b.channel !== params.channel) return false;
11180
+ if (params.agentId && b.agentId !== params.agentId) return false;
11181
+ if (params.channelInstallationId && b.channelInstallationId !== params.channelInstallationId) return false;
11182
+ return true;
11183
+ });
11184
+ const offset = params.offset ?? 0;
11185
+ const limit = params.limit ?? 50;
11186
+ return results.slice(offset, offset + limit);
11187
+ }
11188
+ async import(bindings) {
11189
+ const result = [];
11190
+ for (const input of bindings) {
11191
+ result.push(await this.create(input));
11192
+ }
11193
+ return result;
11194
+ }
11195
+ async export(params) {
11196
+ return this.list({ tenantId: params.tenantId, limit: 1e4 });
11197
+ }
11198
+ clear() {
11199
+ this.bindings.clear();
11200
+ }
11201
+ };
11202
+
10953
11203
  // src/store_lattice/StoreLatticeManager.ts
10954
11204
  var StoreLatticeManager = class _StoreLatticeManager extends BaseLatticeManager {
10955
11205
  /**
@@ -11112,6 +11362,18 @@ storeLatticeManager.registerLattice(
11112
11362
  "workflowTracking",
11113
11363
  defaultWorkflowTrackingStore
11114
11364
  );
11365
+ var defaultChannelInstallationStore = new InMemoryChannelInstallationStore();
11366
+ storeLatticeManager.registerLattice(
11367
+ "default",
11368
+ "channelInstallation",
11369
+ defaultChannelInstallationStore
11370
+ );
11371
+ var defaultChannelBindingStore = new InMemoryBindingStore();
11372
+ storeLatticeManager.registerLattice(
11373
+ "default",
11374
+ "channelBinding",
11375
+ defaultChannelBindingStore
11376
+ );
11115
11377
 
11116
11378
  // src/services/Agent.ts
11117
11379
  import { Command as Command2 } from "@langchain/langgraph";
@@ -12478,10 +12740,10 @@ function createSchedulerMiddleware(options = {}) {
12478
12740
  {
12479
12741
  name: "schedule_at",
12480
12742
  description: "Schedule a system message for an absolute future timestamp",
12481
- schema: z47.object({
12482
- executeAt: z47.number(),
12483
- maxRetries: z47.number().int().min(0).optional(),
12484
- message: z47.string()
12743
+ schema: z48.object({
12744
+ executeAt: z48.number(),
12745
+ maxRetries: z48.number().int().min(0).optional(),
12746
+ message: z48.string()
12485
12747
  })
12486
12748
  }
12487
12749
  ),
@@ -12513,10 +12775,10 @@ function createSchedulerMiddleware(options = {}) {
12513
12775
  {
12514
12776
  name: "schedule_after",
12515
12777
  description: "Schedule a system message after a relative delay",
12516
- schema: z47.object({
12517
- delayMs: z47.number().positive(),
12518
- maxRetries: z47.number().int().min(0).optional(),
12519
- message: z47.string()
12778
+ schema: z48.object({
12779
+ delayMs: z48.number().positive(),
12780
+ maxRetries: z48.number().int().min(0).optional(),
12781
+ message: z48.string()
12520
12782
  })
12521
12783
  }
12522
12784
  ),
@@ -12555,12 +12817,12 @@ function createSchedulerMiddleware(options = {}) {
12555
12817
  {
12556
12818
  name: "schedule_recurring",
12557
12819
  description: "Schedule a recurring system message with a cron expression",
12558
- schema: z47.object({
12559
- cronExpression: z47.string(),
12560
- maxRuns: z47.number().int().positive().optional(),
12561
- expiresAt: z47.number().optional(),
12562
- maxRetries: z47.number().int().min(0).optional(),
12563
- message: z47.string()
12820
+ schema: z48.object({
12821
+ cronExpression: z48.string(),
12822
+ maxRuns: z48.number().int().positive().optional(),
12823
+ expiresAt: z48.number().optional(),
12824
+ maxRetries: z48.number().int().min(0).optional(),
12825
+ message: z48.string()
12564
12826
  })
12565
12827
  }
12566
12828
  ),
@@ -12573,8 +12835,8 @@ function createSchedulerMiddleware(options = {}) {
12573
12835
  {
12574
12836
  name: "cancel_scheduled_task",
12575
12837
  description: "Cancel a scheduled task by task id",
12576
- schema: z47.object({
12577
- taskId: z47.string()
12838
+ schema: z48.object({
12839
+ taskId: z48.string()
12578
12840
  })
12579
12841
  }
12580
12842
  ),
@@ -12600,11 +12862,11 @@ function createSchedulerMiddleware(options = {}) {
12600
12862
  {
12601
12863
  name: "list_scheduled_tasks",
12602
12864
  description: "List scheduled tasks for the current agent context",
12603
- schema: z47.object({
12604
- status: z47.enum(["pending", "running", "completed", "failed", "cancelled", "paused"]).optional(),
12605
- executionType: z47.enum(["once", "cron"]).optional(),
12606
- limit: z47.number().int().positive().optional(),
12607
- offset: z47.number().int().min(0).optional()
12865
+ schema: z48.object({
12866
+ status: z48.enum(["pending", "running", "completed", "failed", "cancelled", "paused"]).optional(),
12867
+ executionType: z48.enum(["once", "cron"]).optional(),
12868
+ limit: z48.number().int().positive().optional(),
12869
+ offset: z48.number().int().min(0).optional()
12608
12870
  })
12609
12871
  }
12610
12872
  )
@@ -12908,7 +13170,7 @@ import {
12908
13170
  } from "langchain";
12909
13171
 
12910
13172
  // src/deep_agent_new/middleware/subagents.ts
12911
- import { z as z48 } from "zod/v3";
13173
+ import { z as z49 } from "zod/v3";
12912
13174
  import {
12913
13175
  createMiddleware as createMiddleware14,
12914
13176
  createAgent as createAgent2,
@@ -13463,15 +13725,15 @@ The result will be delivered as a notification when complete. Do not poll.`,
13463
13725
  {
13464
13726
  name: "task",
13465
13727
  description: finalTaskDescription,
13466
- schema: z48.object({
13467
- description: z48.string().describe("The task to execute with the selected agent"),
13468
- subagent_type: z48.string().describe(
13728
+ schema: z49.object({
13729
+ description: z49.string().describe("The task to execute with the selected agent"),
13730
+ subagent_type: z49.string().describe(
13469
13731
  `Name of the agent to use. Available: ${Object.keys(
13470
13732
  subagentGraphs
13471
13733
  ).join(", ")}`
13472
13734
  ),
13473
13735
  ...allowAsync ? {
13474
- async: z48.boolean().default(false).describe(
13736
+ async: z49.boolean().default(false).describe(
13475
13737
  "When true, runs the task in the background and returns immediately. Use for independent tasks that can run in parallel. The result is delivered as a notification when complete. Use check_async_task or list_async_tasks to monitor progress."
13476
13738
  )
13477
13739
  } : {}
@@ -13550,8 +13812,8 @@ Description: ${cached.description}`;
13550
13812
  {
13551
13813
  name: "check_async_task",
13552
13814
  description: "Get the current status and result of an async background task. Use this to check if a previously launched async task has completed.",
13553
- schema: z48.object({
13554
- task_id: z48.string().describe("The task ID returned when the async task was started")
13815
+ schema: z49.object({
13816
+ task_id: z49.string().describe("The task ID returned when the async task was started")
13555
13817
  })
13556
13818
  }
13557
13819
  );
@@ -13603,7 +13865,7 @@ function createListAsyncTasksTool() {
13603
13865
  {
13604
13866
  name: "list_async_tasks",
13605
13867
  description: "List all async background tasks with their current status. Use this before reporting task status to the user. Statuses in conversation history may be stale.",
13606
- schema: z48.object({})
13868
+ schema: z49.object({})
13607
13869
  }
13608
13870
  );
13609
13871
  }
@@ -13647,8 +13909,8 @@ function createCancelAsyncTaskTool() {
13647
13909
  {
13648
13910
  name: "cancel_async_task",
13649
13911
  description: "Cancel a running async background task.",
13650
- schema: z48.object({
13651
- task_id: z48.string().describe("The task ID to cancel")
13912
+ schema: z49.object({
13913
+ task_id: z49.string().describe("The task ID to cancel")
13652
13914
  })
13653
13915
  }
13654
13916
  );
@@ -14858,7 +15120,7 @@ var MemoryBackend = class {
14858
15120
 
14859
15121
  // src/deep_agent_new/middleware/todos.ts
14860
15122
  import { Command as Command4 } from "@langchain/langgraph";
14861
- import { z as z49 } from "zod";
15123
+ import { z as z50 } from "zod";
14862
15124
  import { createMiddleware as createMiddleware16, tool as tool47, ToolMessage as ToolMessage6 } from "langchain";
14863
15125
  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.
14864
15126
  It also helps the user understand the progress of the task and overall progress of their requests.
@@ -15086,12 +15348,12 @@ Writing todos takes time and tokens, use it when it is helpful for managing comp
15086
15348
  ## Important To-Do List Usage Notes to Remember
15087
15349
  - The \`write_todos\` tool should never be called multiple times in parallel.
15088
15350
  - 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.`;
15089
- var TodoStatus = z49.enum(["pending", "in_progress", "completed"]).describe("Status of the todo");
15090
- var TodoSchema = z49.object({
15091
- content: z49.string().describe("Content of the todo item"),
15351
+ var TodoStatus = z50.enum(["pending", "in_progress", "completed"]).describe("Status of the todo");
15352
+ var TodoSchema = z50.object({
15353
+ content: z50.string().describe("Content of the todo item"),
15092
15354
  status: TodoStatus
15093
15355
  });
15094
- var stateSchema = z49.object({ todos: z49.array(TodoSchema).default([]) });
15356
+ var stateSchema = z50.object({ todos: z50.array(TodoSchema).default([]) });
15095
15357
  function todoListMiddleware(options) {
15096
15358
  const writeTodos = tool47(
15097
15359
  ({ todos }, config) => {
@@ -15110,8 +15372,8 @@ function todoListMiddleware(options) {
15110
15372
  {
15111
15373
  name: "write_todos",
15112
15374
  description: options?.toolDescription ?? WRITE_TODOS_DESCRIPTION,
15113
- schema: z49.object({
15114
- todos: z49.array(TodoSchema).describe("List of todo items to update")
15375
+ schema: z50.object({
15376
+ todos: z50.array(TodoSchema).describe("List of todo items to update")
15115
15377
  })
15116
15378
  }
15117
15379
  );
@@ -15267,7 +15529,7 @@ var DeepAgentGraphBuilder = class {
15267
15529
  };
15268
15530
 
15269
15531
  // src/agent_team/agent_team.ts
15270
- import { z as z52 } from "zod/v3";
15532
+ import { z as z53 } from "zod/v3";
15271
15533
  import { createAgent as createAgent5 } from "langchain";
15272
15534
 
15273
15535
  // src/agent_team/types.ts
@@ -15703,13 +15965,13 @@ var InMemoryMailboxStore = class {
15703
15965
  };
15704
15966
 
15705
15967
  // src/agent_team/middleware/team.ts
15706
- import { z as z51 } from "zod/v3";
15968
+ import { z as z52 } from "zod/v3";
15707
15969
  import { createMiddleware as createMiddleware17, createAgent as createAgent4, tool as tool49, ToolMessage as ToolMessage8 } from "langchain";
15708
15970
  import { Command as Command6, getCurrentTaskInput as getCurrentTaskInput3 } from "@langchain/langgraph";
15709
15971
  import { v4 as uuidv42 } from "uuid";
15710
15972
 
15711
15973
  // src/agent_team/middleware/teammate_tools.ts
15712
- import { z as z50 } from "zod/v3";
15974
+ import { z as z51 } from "zod/v3";
15713
15975
  import { tool as tool48, ToolMessage as ToolMessage7 } from "langchain";
15714
15976
  import { Command as Command5 } from "@langchain/langgraph";
15715
15977
 
@@ -15760,8 +16022,8 @@ function createTeammateTools(options) {
15760
16022
  {
15761
16023
  name: "claim_task",
15762
16024
  description: "Pick a task to work on by task_id. Use check_tasks first to see all tasks; then call this with the task_id you choose. The task's assignee is set to you and you should focus on that task until you complete_task or fail_task it.",
15763
- schema: z50.object({
15764
- task_id: z50.string().describe("ID of the task to claim (e.g. task-01). Use check_tasks to see IDs.")
16025
+ schema: z51.object({
16026
+ task_id: z51.string().describe("ID of the task to claim (e.g. task-01). Use check_tasks to see IDs.")
15765
16027
  })
15766
16028
  }
15767
16029
  );
@@ -15786,9 +16048,9 @@ function createTeammateTools(options) {
15786
16048
  {
15787
16049
  name: "complete_task",
15788
16050
  description: "Mark a claimed task as completed with a result summary. Call this after you have finished working on a task.",
15789
- schema: z50.object({
15790
- task_id: z50.string().describe("ID of the task to complete"),
15791
- result: z50.string().describe("Summary of the task result")
16051
+ schema: z51.object({
16052
+ task_id: z51.string().describe("ID of the task to complete"),
16053
+ result: z51.string().describe("Summary of the task result")
15792
16054
  })
15793
16055
  }
15794
16056
  );
@@ -15813,9 +16075,9 @@ function createTeammateTools(options) {
15813
16075
  {
15814
16076
  name: "fail_task",
15815
16077
  description: "Mark a claimed task as failed with an error description. Call this if you cannot complete the task.",
15816
- schema: z50.object({
15817
- task_id: z50.string().describe("ID of the task to fail"),
15818
- error: z50.string().describe("Description of why the task failed")
16078
+ schema: z51.object({
16079
+ task_id: z51.string().describe("ID of the task to fail"),
16080
+ error: z51.string().describe("Description of why the task failed")
15819
16081
  })
15820
16082
  }
15821
16083
  );
@@ -15833,11 +16095,11 @@ function createTeammateTools(options) {
15833
16095
  {
15834
16096
  name: "send_message",
15835
16097
  description: 'Send a message to the team lead or another teammate via the mailbox. Use "team_lead" to message the team lead. Use this to report discoveries, request guidance, or suggest new tasks.',
15836
- schema: z50.object({
15837
- to: z50.string().describe(
16098
+ schema: z51.object({
16099
+ to: z51.string().describe(
15838
16100
  'Recipient agent name (e.g. "team_lead" or a teammate name)'
15839
16101
  ),
15840
- content: z50.string().describe("Message content")
16102
+ content: z51.string().describe("Message content")
15841
16103
  })
15842
16104
  }
15843
16105
  );
@@ -15916,7 +16178,7 @@ function createTeammateTools(options) {
15916
16178
  {
15917
16179
  name: "read_messages",
15918
16180
  description: "Read unread messages from the mailbox. Returns immediately if messages exist, otherwise waits for up to 3 minutes for new messages.",
15919
- schema: z50.object({})
16181
+ schema: z51.object({})
15920
16182
  }
15921
16183
  );
15922
16184
  const checkTasksTool = tool48(
@@ -15927,7 +16189,7 @@ function createTeammateTools(options) {
15927
16189
  {
15928
16190
  name: "check_tasks",
15929
16191
  description: "Use this tool to get the current status of all tasks in a team. This is your primary way to monitor task progress.",
15930
- schema: z50.object({})
16192
+ schema: z51.object({})
15931
16193
  }
15932
16194
  );
15933
16195
  const broadcastMessageTool = tool48(
@@ -15949,8 +16211,8 @@ function createTeammateTools(options) {
15949
16211
  {
15950
16212
  name: "broadcast_message",
15951
16213
  description: "Send a message to everyone in the team except yourself. Use this to share updates or information with all teammates and the team lead at once.",
15952
- schema: z50.object({
15953
- content: z50.string().describe("Message content to broadcast to others")
16214
+ schema: z51.object({
16215
+ content: z51.string().describe("Message content to broadcast to others")
15954
16216
  })
15955
16217
  }
15956
16218
  );
@@ -16339,20 +16601,20 @@ After calling create_team, you MUST:
16339
16601
  2. When messages indicate task changes, call check_tasks to get full task status
16340
16602
  3. Continue until all tasks show "completed" or "failed"
16341
16603
  4. Do NOT assume tasks are done - always verify with check_tasks`,
16342
- schema: z51.object({
16343
- tasks: z51.array(
16344
- z51.object({
16345
- id: z51.string().describe("Task ID in format task-01, task-02, etc."),
16346
- title: z51.string().describe("Short task title"),
16347
- description: z51.string().describe("Detailed task description - what exactly needs to be done"),
16348
- dependencies: z51.array(z51.string()).optional().default([]).describe('Array of task IDs that must complete before this task (e.g. ["task-01"])')
16604
+ schema: z52.object({
16605
+ tasks: z52.array(
16606
+ z52.object({
16607
+ id: z52.string().describe("Task ID in format task-01, task-02, etc."),
16608
+ title: z52.string().describe("Short task title"),
16609
+ description: z52.string().describe("Detailed task description - what exactly needs to be done"),
16610
+ dependencies: z52.array(z52.string()).optional().default([]).describe('Array of task IDs that must complete before this task (e.g. ["task-01"])')
16349
16611
  })
16350
16612
  ).describe("List of tasks for teammates to work on. Each task needs unique ID (task-01, task-02, etc.)."),
16351
- teammates: z51.array(
16352
- z51.object({
16353
- name: z51.string().describe("Teammate name (must match a pre-configured teammate type)"),
16354
- role: z51.string().describe("Role category (e.g. researcher, writer, coder, reviewer)"),
16355
- description: z51.string().describe("What this teammate will focus on - specific instructions for their work")
16613
+ teammates: z52.array(
16614
+ z52.object({
16615
+ name: z52.string().describe("Teammate name (must match a pre-configured teammate type)"),
16616
+ role: z52.string().describe("Role category (e.g. researcher, writer, coder, reviewer)"),
16617
+ description: z52.string().describe("What this teammate will focus on - specific instructions for their work")
16356
16618
  })
16357
16619
  ).describe("Teammate agents to create. Each should have a clear role and focus.")
16358
16620
  })
@@ -16415,14 +16677,14 @@ IMPORTANT: Dependencies
16415
16677
 
16416
16678
  IMPORTANT: Assigning to a specific teammate
16417
16679
  - When you need a particular teammate to do the work, set assignee to that teammate's name (e.g. assignee: "researcher"). They can then claim or see the task as assigned to them.`,
16418
- schema: z51.object({
16419
- tasks: z51.array(
16420
- z51.object({
16421
- id: z51.string().describe("Task ID in format task-01, task-02, etc. Must be unique."),
16422
- title: z51.string().describe("Short task title"),
16423
- description: z51.string().describe("Detailed task description - what needs to be done"),
16424
- assignee: z51.string().optional().describe("Teammate name to assign this task to (use when you need that person to do the work)"),
16425
- dependencies: z51.array(z51.string()).optional().default([]).describe("Array of task IDs that must complete before this task")
16680
+ schema: z52.object({
16681
+ tasks: z52.array(
16682
+ z52.object({
16683
+ id: z52.string().describe("Task ID in format task-01, task-02, etc. Must be unique."),
16684
+ title: z52.string().describe("Short task title"),
16685
+ description: z52.string().describe("Detailed task description - what needs to be done"),
16686
+ assignee: z52.string().optional().describe("Teammate name to assign this task to (use when you need that person to do the work)"),
16687
+ dependencies: z52.array(z52.string()).optional().default([]).describe("Array of task IDs that must complete before this task")
16426
16688
  })
16427
16689
  ).describe("New tasks to add to the team")
16428
16690
  })
@@ -16450,9 +16712,9 @@ IMPORTANT: Assigning to a specific teammate
16450
16712
  {
16451
16713
  name: "assign_task",
16452
16714
  description: "Assign a task to a specific teammate. Use when you need to reassign work to a different teammate. Omit team_id to use the active team from state.",
16453
- schema: z51.object({
16454
- task_id: z51.string().describe("Task ID to assign"),
16455
- assignee: z51.string().describe("Teammate name to assign this task to")
16715
+ schema: z52.object({
16716
+ task_id: z52.string().describe("Task ID to assign"),
16717
+ assignee: z52.string().describe("Teammate name to assign this task to")
16456
16718
  })
16457
16719
  }
16458
16720
  );
@@ -16478,9 +16740,9 @@ IMPORTANT: Assigning to a specific teammate
16478
16740
  {
16479
16741
  name: "set_task_status",
16480
16742
  description: "Set a task's status. Use to reopen a task (set to pending), mark as failed, or correct status. Values: pending, claimed, in_progress, completed, failed. Omit team_id to use the active team from state.",
16481
- schema: z51.object({
16482
- task_id: z51.string().describe("Task ID to update"),
16483
- status: z51.enum(["pending", "claimed", "in_progress", "completed", "failed"]).describe("New status for the task")
16743
+ schema: z52.object({
16744
+ task_id: z52.string().describe("Task ID to update"),
16745
+ status: z52.enum(["pending", "claimed", "in_progress", "completed", "failed"]).describe("New status for the task")
16484
16746
  })
16485
16747
  }
16486
16748
  );
@@ -16506,9 +16768,9 @@ IMPORTANT: Assigning to a specific teammate
16506
16768
  {
16507
16769
  name: "set_task_dependencies",
16508
16770
  description: 'Set which task IDs must complete before this task can be claimed. Pass an array of task IDs (e.g. ["task-01", "task-02"]). Use to fix task order or add/remove dependencies. Omit team_id to use the active team from state.',
16509
- schema: z51.object({
16510
- task_id: z51.string().describe("Task ID to update"),
16511
- dependencies: z51.array(z51.string()).describe("Task IDs that must complete before this task can be claimed")
16771
+ schema: z52.object({
16772
+ task_id: z52.string().describe("Task ID to update"),
16773
+ dependencies: z52.array(z52.string()).describe("Task IDs that must complete before this task can be claimed")
16512
16774
  })
16513
16775
  }
16514
16776
  );
@@ -16552,8 +16814,8 @@ Task Status Values:
16552
16814
  - in_progress: Teammate is actively working on this task
16553
16815
  - completed: Task finished successfully
16554
16816
  - failed: Task encountered an error`,
16555
- schema: z51.object({
16556
- team_id: z51.string().optional().describe("Team ID (omit to use active team)")
16817
+ schema: z52.object({
16818
+ team_id: z52.string().optional().describe("Team ID (omit to use active team)")
16557
16819
  })
16558
16820
  }
16559
16821
  );
@@ -16576,9 +16838,9 @@ Task Status Values:
16576
16838
  {
16577
16839
  name: "send_message",
16578
16840
  description: "Send a message to a specific teammate in the team. Omit team_id to use the active team from state.",
16579
- schema: z51.object({
16580
- to: z51.string().describe("Recipient teammate name"),
16581
- content: z51.string().describe("Message content")
16841
+ schema: z52.object({
16842
+ to: z52.string().describe("Recipient teammate name"),
16843
+ content: z52.string().describe("Message content")
16582
16844
  })
16583
16845
  }
16584
16846
  );
@@ -16664,8 +16926,8 @@ Task Status Values:
16664
16926
  {
16665
16927
  name: "read_messages",
16666
16928
  description: "Read unread messages from teammates. Returns immediately if messages exist, otherwise waits for up to 3 minutes for new messages.",
16667
- schema: z51.object({
16668
- team_id: z51.string().optional().describe("Team ID (omit to use active team)")
16929
+ schema: z52.object({
16930
+ team_id: z52.string().optional().describe("Team ID (omit to use active team)")
16669
16931
  })
16670
16932
  }
16671
16933
  );
@@ -16708,8 +16970,8 @@ Task Status Values:
16708
16970
  {
16709
16971
  name: "broadcast_message",
16710
16972
  description: "Send a message to all teammates at once. Use this to communicate with everyone in the team. Omit team_id to use the active team from state.",
16711
- schema: z51.object({
16712
- content: z51.string().describe("Message content to broadcast to all teammates")
16973
+ schema: z52.object({
16974
+ content: z52.string().describe("Message content to broadcast to all teammates")
16713
16975
  })
16714
16976
  }
16715
16977
  );
@@ -16741,37 +17003,37 @@ ${TEAM_SYSTEM_PROMPT}` : TEAM_SYSTEM_PROMPT;
16741
17003
  }
16742
17004
 
16743
17005
  // src/agent_team/agent_team.ts
16744
- var TeammateInfoSchema = z52.object({
16745
- name: z52.string().describe("Teammate name"),
16746
- role: z52.string().describe("Role category (e.g. research, writing, review)"),
16747
- description: z52.string().describe("What this teammate focuses on")
17006
+ var TeammateInfoSchema = z53.object({
17007
+ name: z53.string().describe("Teammate name"),
17008
+ role: z53.string().describe("Role category (e.g. research, writing, review)"),
17009
+ description: z53.string().describe("What this teammate focuses on")
16748
17010
  });
16749
- var TeamTaskInfoSchema = z52.object({
16750
- id: z52.string(),
16751
- title: z52.string(),
16752
- description: z52.string(),
16753
- status: z52.string().optional()
17011
+ var TeamTaskInfoSchema = z53.object({
17012
+ id: z53.string(),
17013
+ title: z53.string(),
17014
+ description: z53.string(),
17015
+ status: z53.string().optional()
16754
17016
  });
16755
- var MailboxMessageSchema = z52.object({
16756
- id: z52.string().describe("Unique message identifier"),
16757
- from: z52.string().describe("Sender agent name"),
16758
- to: z52.string().describe("Recipient agent name"),
16759
- content: z52.string().describe("Message content"),
16760
- timestamp: z52.string().describe("ISO timestamp when the message was sent"),
16761
- type: z52.nativeEnum(MessageType).describe("Message type"),
16762
- read: z52.boolean().describe("Whether the recipient has read this message")
17017
+ var MailboxMessageSchema = z53.object({
17018
+ id: z53.string().describe("Unique message identifier"),
17019
+ from: z53.string().describe("Sender agent name"),
17020
+ to: z53.string().describe("Recipient agent name"),
17021
+ content: z53.string().describe("Message content"),
17022
+ timestamp: z53.string().describe("ISO timestamp when the message was sent"),
17023
+ type: z53.nativeEnum(MessageType).describe("Message type"),
17024
+ read: z53.boolean().describe("Whether the recipient has read this message")
16763
17025
  });
16764
- var TeamInfoSchema = z52.object({
16765
- teamId: z52.string().describe("Unique team identifier"),
16766
- teamLeadId: z52.string().default("team_lead").describe("Team lead agent ID"),
16767
- teammates: z52.array(TeammateInfoSchema).describe("Active teammates in this team"),
16768
- tasks: z52.array(TeamTaskInfoSchema).optional().describe("Initial tasks snapshot"),
16769
- createdAt: z52.string().optional().describe("ISO timestamp when team was created")
17026
+ var TeamInfoSchema = z53.object({
17027
+ teamId: z53.string().describe("Unique team identifier"),
17028
+ teamLeadId: z53.string().default("team_lead").describe("Team lead agent ID"),
17029
+ teammates: z53.array(TeammateInfoSchema).describe("Active teammates in this team"),
17030
+ tasks: z53.array(TeamTaskInfoSchema).optional().describe("Initial tasks snapshot"),
17031
+ createdAt: z53.string().optional().describe("ISO timestamp when team was created")
16770
17032
  });
16771
- var TEAM_STATE_SCHEMA = z52.object({
17033
+ var TEAM_STATE_SCHEMA = z53.object({
16772
17034
  team: TeamInfoSchema.optional().describe("Team info: teamId, teamLeadId, teammates, tasks. Set when create_team succeeds."),
16773
- tasks: z52.array(TeamTaskInfoSchema).optional().describe("Current tasks snapshot from check_tasks. Updated on each check."),
16774
- team_mailbox: z52.array(MailboxMessageSchema).optional().describe("All team mailbox messages for display")
17035
+ tasks: z53.array(TeamTaskInfoSchema).optional().describe("Current tasks snapshot from check_tasks. Updated on each check."),
17036
+ team_mailbox: z53.array(MailboxMessageSchema).optional().describe("All team mailbox messages for display")
16775
17037
  });
16776
17038
  var TEAM_LEAD_BASE_PROMPT = `You are a team lead that coordinates a team of specialized agents. In order to complete the objective that the user asks of you, you will need to:
16777
17039
 
@@ -16901,11 +17163,11 @@ import {
16901
17163
  import { createMiddleware as createMiddleware18 } from "langchain";
16902
17164
  import { AIMessage as AIMessage3, ToolMessage as ToolMessage9 } from "@langchain/core/messages";
16903
17165
  import { tool as tool50 } from "langchain";
16904
- import { z as z53 } from "zod";
17166
+ import { z as z54 } from "zod";
16905
17167
  import { GraphInterrupt as GraphInterrupt4 } from "@langchain/langgraph";
16906
- var CompletedEdgeSchema = z53.object({
16907
- to: z53.string(),
16908
- purpose: z53.string()
17168
+ var CompletedEdgeSchema = z54.object({
17169
+ to: z54.string(),
17170
+ purpose: z54.string()
16909
17171
  });
16910
17172
  function deriveCompletedEdges(messages, edges) {
16911
17173
  const completedToolCallIds = /* @__PURE__ */ new Set();
@@ -16934,14 +17196,14 @@ function createTopologyMiddleware(options) {
16934
17196
  const { edges, trackingStore } = options;
16935
17197
  return createMiddleware18({
16936
17198
  name: "TopologyMiddleware",
16937
- contextSchema: z53.object({
16938
- runConfig: z53.any()
17199
+ contextSchema: z54.object({
17200
+ runConfig: z54.any()
16939
17201
  }),
16940
- stateSchema: z53.object({
16941
- currentAgentId: z53.string().default(""),
16942
- completedEdges: z53.array(CompletedEdgeSchema).default([]),
16943
- runId: z53.string().default(""),
16944
- stepIdMap: z53.record(z53.string()).default({})
17202
+ stateSchema: z54.object({
17203
+ currentAgentId: z54.string().default(""),
17204
+ completedEdges: z54.array(CompletedEdgeSchema).default([]),
17205
+ runId: z54.string().default(""),
17206
+ stepIdMap: z54.record(z54.string()).default({})
16945
17207
  }),
16946
17208
  beforeAgent: async (state, runtime) => {
16947
17209
  const runConfig = runtime.context?.runConfig ?? {};
@@ -16996,7 +17258,7 @@ ${request.systemPrompt}` : topologyPrompt;
16996
17258
  {
16997
17259
  name: "read_topo_progress",
16998
17260
  description: "Check the current progress of the workflow execution plan. Returns which steps have been completed and which are still pending.",
16999
- schema: z53.object({})
17261
+ schema: z54.object({})
17000
17262
  }
17001
17263
  )
17002
17264
  ],
@@ -17952,7 +18214,7 @@ ${body}` : `${frontmatter}
17952
18214
  };
17953
18215
 
17954
18216
  // src/agent_lattice/agentArchitectTools.ts
17955
- import z54 from "zod";
18217
+ import z55 from "zod";
17956
18218
  import { v4 as v42 } from "uuid";
17957
18219
  import { AgentType as AgentType2 } from "@axiom-lattice/protocols";
17958
18220
  function getTenantId(exeConfig) {
@@ -17982,7 +18244,7 @@ registerToolLattice(
17982
18244
  {
17983
18245
  name: "list_agents",
17984
18246
  description: "List all agents for the current workspace. Returns a summary with id, name, description, and type for each agent.",
17985
- schema: z54.object({})
18247
+ schema: z55.object({})
17986
18248
  },
17987
18249
  async (_input, exeConfig) => {
17988
18250
  try {
@@ -18009,8 +18271,8 @@ registerToolLattice(
18009
18271
  {
18010
18272
  name: "get_agent",
18011
18273
  description: "Get the full configuration of a specific agent by its ID. Returns the complete AgentConfig including prompt, middleware, tools, and sub-agents.",
18012
- schema: z54.object({
18013
- id: z54.string().describe("The agent ID to retrieve")
18274
+ schema: z55.object({
18275
+ id: z55.string().describe("The agent ID to retrieve")
18014
18276
  })
18015
18277
  },
18016
18278
  async (input, exeConfig) => {
@@ -18027,24 +18289,24 @@ registerToolLattice(
18027
18289
  }
18028
18290
  }
18029
18291
  );
18030
- var middlewareConfigSchema = z54.object({
18031
- id: z54.string(),
18032
- type: z54.string(),
18033
- name: z54.string(),
18034
- description: z54.string(),
18035
- enabled: z54.boolean(),
18036
- config: z54.record(z54.any()).optional()
18292
+ var middlewareConfigSchema = z55.object({
18293
+ id: z55.string(),
18294
+ type: z55.string(),
18295
+ name: z55.string(),
18296
+ description: z55.string(),
18297
+ enabled: z55.boolean(),
18298
+ config: z55.record(z55.any()).optional()
18037
18299
  });
18038
- var createAgentSchema = z54.object({
18039
- name: z54.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')."),
18040
- description: z54.string().optional().describe("Short description"),
18041
- type: z54.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."),
18042
- prompt: z54.string().describe("System prompt for the agent"),
18043
- tools: z54.array(z54.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."),
18044
- middleware: z54.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: {}."),
18045
- subAgents: z54.array(z54.string()).optional().describe("Sub-agent IDs (deep_agent only)"),
18046
- internalSubAgents: z54.array(z54.any()).optional().describe("Inline sub-agent configs (deep_agent only)"),
18047
- modelKey: z54.string().optional().describe("Model key to use")
18300
+ var createAgentSchema = z55.object({
18301
+ name: z55.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')."),
18302
+ description: z55.string().optional().describe("Short description"),
18303
+ type: z55.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."),
18304
+ prompt: z55.string().describe("System prompt for the agent"),
18305
+ tools: z55.array(z55.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."),
18306
+ middleware: z55.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: {}."),
18307
+ subAgents: z55.array(z55.string()).optional().describe("Sub-agent IDs (deep_agent only)"),
18308
+ internalSubAgents: z55.array(z55.any()).optional().describe("Inline sub-agent configs (deep_agent only)"),
18309
+ modelKey: z55.string().optional().describe("Model key to use")
18048
18310
  });
18049
18311
  registerToolLattice(
18050
18312
  "create_agent",
@@ -18082,21 +18344,21 @@ registerToolLattice(
18082
18344
  }
18083
18345
  }
18084
18346
  );
18085
- var topologyEdgeSchema = z54.object({
18086
- from: z54.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."),
18087
- to: z54.string().describe("Target agent ID (the sub-agent to delegate to)"),
18088
- purpose: z54.string().describe("Business purpose of this delegation step \u2014 what the sub-agent should accomplish")
18347
+ var topologyEdgeSchema = z55.object({
18348
+ from: z55.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."),
18349
+ to: z55.string().describe("Target agent ID (the sub-agent to delegate to)"),
18350
+ purpose: z55.string().describe("Business purpose of this delegation step \u2014 what the sub-agent should accomplish")
18089
18351
  });
18090
- var createProcessingAgentSchema = z54.object({
18091
- name: z54.string().describe("Display name for the processing agent"),
18092
- description: z54.string().optional().describe("Short description"),
18093
- prompt: z54.string().describe("System prompt for the orchestrator. Should describe how to route tasks through the topology."),
18094
- edges: z54.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."),
18095
- tools: z54.array(z54.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."),
18096
- subAgents: z54.array(z54.string()).describe("IDs of sub-agents that form the workflow pipeline. These must be created first via create_agent."),
18097
- internalSubAgents: z54.array(z54.any()).optional().describe("Inline sub-agent configs (alternative to pre-created sub-agents)"),
18098
- middleware: z54.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: {}."),
18099
- modelKey: z54.string().optional().describe("Model key to use")
18352
+ var createProcessingAgentSchema = z55.object({
18353
+ name: z55.string().describe("Display name for the processing agent"),
18354
+ description: z55.string().optional().describe("Short description"),
18355
+ prompt: z55.string().describe("System prompt for the orchestrator. Should describe how to route tasks through the topology."),
18356
+ edges: z55.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."),
18357
+ tools: z55.array(z55.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."),
18358
+ subAgents: z55.array(z55.string()).describe("IDs of sub-agents that form the workflow pipeline. These must be created first via create_agent."),
18359
+ internalSubAgents: z55.array(z55.any()).optional().describe("Inline sub-agent configs (alternative to pre-created sub-agents)"),
18360
+ middleware: z55.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: {}."),
18361
+ modelKey: z55.string().optional().describe("Model key to use")
18100
18362
  }).refine(
18101
18363
  (data) => {
18102
18364
  const edgeTargets = new Set(data.edges.map((e) => e.to));
@@ -18178,16 +18440,16 @@ registerToolLattice(
18178
18440
  }
18179
18441
  }
18180
18442
  );
18181
- var updateProcessingAgentSchema = z54.object({
18182
- id: z54.string().describe("The PROCESSING agent ID to update"),
18183
- name: z54.string().optional().describe("New display name for the orchestrator"),
18184
- description: z54.string().optional().describe("New short description"),
18185
- prompt: z54.string().optional().describe("New system prompt for the orchestrator"),
18186
- edges: z54.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."),
18187
- tools: z54.array(z54.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."),
18188
- subAgents: z54.array(z54.string()).optional().describe("New IDs of sub-agents in the workflow pipeline"),
18189
- middleware: z54.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: {}."),
18190
- modelKey: z54.string().optional().describe("New model key")
18443
+ var updateProcessingAgentSchema = z55.object({
18444
+ id: z55.string().describe("The PROCESSING agent ID to update"),
18445
+ name: z55.string().optional().describe("New display name for the orchestrator"),
18446
+ description: z55.string().optional().describe("New short description"),
18447
+ prompt: z55.string().optional().describe("New system prompt for the orchestrator"),
18448
+ edges: z55.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."),
18449
+ tools: z55.array(z55.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."),
18450
+ subAgents: z55.array(z55.string()).optional().describe("New IDs of sub-agents in the workflow pipeline"),
18451
+ middleware: z55.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: {}."),
18452
+ modelKey: z55.string().optional().describe("New model key")
18191
18453
  }).refine(
18192
18454
  (data) => {
18193
18455
  if (!data.edges) return true;
@@ -18315,18 +18577,18 @@ registerToolLattice(
18315
18577
  }
18316
18578
  }
18317
18579
  );
18318
- var updateAgentSchema = z54.object({
18319
- id: z54.string().describe("The agent ID to update"),
18320
- config: z54.object({
18321
- name: z54.string().optional().describe("New display name for the agent"),
18322
- description: z54.string().optional().describe("New short description"),
18323
- type: z54.enum(["react", "deep_agent"]).optional().describe("Agent type"),
18324
- prompt: z54.string().optional().describe("New system prompt for the agent"),
18325
- tools: z54.array(z54.string()).optional().describe("Tool keys to assign to this agent. These are registered tool names (strings), NOT middleware objects."),
18326
- middleware: z54.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: {}."),
18327
- subAgents: z54.array(z54.string()).optional().describe("Sub-agent IDs (deep_agent only)"),
18328
- internalSubAgents: z54.array(z54.any()).optional().describe("Inline sub-agent configs (deep_agent only)"),
18329
- modelKey: z54.string().optional().describe("Model key to use")
18580
+ var updateAgentSchema = z55.object({
18581
+ id: z55.string().describe("The agent ID to update"),
18582
+ config: z55.object({
18583
+ name: z55.string().optional().describe("New display name for the agent"),
18584
+ description: z55.string().optional().describe("New short description"),
18585
+ type: z55.enum(["react", "deep_agent"]).optional().describe("Agent type"),
18586
+ prompt: z55.string().optional().describe("New system prompt for the agent"),
18587
+ tools: z55.array(z55.string()).optional().describe("Tool keys to assign to this agent. These are registered tool names (strings), NOT middleware objects."),
18588
+ middleware: z55.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: {}."),
18589
+ subAgents: z55.array(z55.string()).optional().describe("Sub-agent IDs (deep_agent only)"),
18590
+ internalSubAgents: z55.array(z55.any()).optional().describe("Inline sub-agent configs (deep_agent only)"),
18591
+ modelKey: z55.string().optional().describe("Model key to use")
18330
18592
  }).describe("Configuration fields to update. Only include the fields you want to change.")
18331
18593
  });
18332
18594
  registerToolLattice(
@@ -18364,8 +18626,8 @@ registerToolLattice(
18364
18626
  {
18365
18627
  name: "delete_agent",
18366
18628
  description: "Permanently delete an agent by its ID. This action cannot be undone.",
18367
- schema: z54.object({
18368
- id: z54.string().describe("The agent ID to delete")
18629
+ schema: z55.object({
18630
+ id: z55.string().describe("The agent ID to delete")
18369
18631
  })
18370
18632
  },
18371
18633
  async (input, exeConfig) => {
@@ -18391,7 +18653,7 @@ registerToolLattice(
18391
18653
  {
18392
18654
  name: "list_tools",
18393
18655
  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.",
18394
- schema: z54.object({})
18656
+ schema: z55.object({})
18395
18657
  },
18396
18658
  async (_input, _exeConfig) => {
18397
18659
  try {
@@ -18413,9 +18675,9 @@ registerToolLattice(
18413
18675
  {
18414
18676
  name: "invoke_agent",
18415
18677
  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).",
18416
- schema: z54.object({
18417
- id: z54.string().describe("The agent ID to invoke"),
18418
- message: z54.string().describe("The test message to send to the agent")
18678
+ schema: z55.object({
18679
+ id: z55.string().describe("The agent ID to invoke"),
18680
+ message: z55.string().describe("The test message to send to the agent")
18419
18681
  })
18420
18682
  },
18421
18683
  async (input, exeConfig) => {
@@ -19083,7 +19345,8 @@ var agentArchitectConfig = {
19083
19345
  "create_processing_agent",
19084
19346
  "update_processing_agent",
19085
19347
  "update_agent",
19086
- "delete_agent"
19348
+ "delete_agent",
19349
+ "manage_binding"
19087
19350
  ],
19088
19351
  internalSubAgents: [agentReviewerConfig],
19089
19352
  middleware: [
@@ -20814,7 +21077,7 @@ function parseOptionalNumberEnv(name, fallback) {
20814
21077
  }
20815
21078
  function getDefaultMicrosandboxRemoteConfig() {
20816
21079
  return {
20817
- image: process.env.MICROSANDBOX_IMAGE ?? "daytona-cn-shanghai.cr.volces.com/daytona/sandbox:0.0.5",
21080
+ image: process.env.MICROSANDBOX_IMAGE ?? "kioko12520/sandbox:0.1.0",
20818
21081
  //"daytonaio/sandbox:0.6.0",
20819
21082
  cpus: parseOptionalNumberEnv("MICROSANDBOX_CPUS", 1),
20820
21083
  memoryMib: parseOptionalNumberEnv("MICROSANDBOX_MEMORY", 512),
@@ -21696,6 +21959,8 @@ export {
21696
21959
  FilesystemBackend,
21697
21960
  HumanMessage3 as HumanMessage,
21698
21961
  InMemoryAssistantStore,
21962
+ InMemoryBindingStore,
21963
+ InMemoryChannelInstallationStore,
21699
21964
  InMemoryChunkBuffer,
21700
21965
  InMemoryDatabaseConfigStore,
21701
21966
  InMemoryMailboxStore,
@@ -21781,6 +22046,7 @@ export {
21781
22046
  describeCronExpression,
21782
22047
  embeddingsLatticeManager,
21783
22048
  encrypt,
22049
+ ensureBuiltinAgentsForTenant,
21784
22050
  eventBus,
21785
22051
  event_bus_default as eventBusDefault,
21786
22052
  fileDataToString,
@@ -21793,6 +22059,7 @@ export {
21793
22059
  getAllAgentConfigs,
21794
22060
  getAllBuiltInSkillMetas,
21795
22061
  getAllToolDefinitions,
22062
+ getBindingRegistry,
21796
22063
  getBuiltInSkillContent,
21797
22064
  getBuiltInSkillMeta,
21798
22065
  getBuiltInSkillNames,
@@ -21849,6 +22116,7 @@ export {
21849
22116
  sandboxLatticeManager,
21850
22117
  sanitizeToolCallId,
21851
22118
  scheduleLatticeManager,
22119
+ setBindingRegistry,
21852
22120
  skillLatticeManager,
21853
22121
  sqlDatabaseManager,
21854
22122
  storeLatticeManager,