@axiom-lattice/core 2.1.25 → 2.1.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +53 -12
- package/dist/index.d.ts +53 -12
- package/dist/index.js +387 -261
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +405 -280
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -508,11 +508,11 @@ var ToolLatticeManager = class _ToolLatticeManager extends BaseLatticeManager {
|
|
|
508
508
|
* @param key Lattice键名
|
|
509
509
|
* @param tool 已有的StructuredTool实例
|
|
510
510
|
*/
|
|
511
|
-
registerExistingTool(key,
|
|
511
|
+
registerExistingTool(key, tool47) {
|
|
512
512
|
const config = {
|
|
513
|
-
name:
|
|
514
|
-
description:
|
|
515
|
-
schema:
|
|
513
|
+
name: tool47.name,
|
|
514
|
+
description: tool47.description,
|
|
515
|
+
schema: tool47.schema,
|
|
516
516
|
// StructuredTool的schema已经是Zod兼容的
|
|
517
517
|
needUserApprove: false
|
|
518
518
|
// MCP工具默认不需要用户批准
|
|
@@ -520,7 +520,7 @@ var ToolLatticeManager = class _ToolLatticeManager extends BaseLatticeManager {
|
|
|
520
520
|
const toolLattice = {
|
|
521
521
|
key,
|
|
522
522
|
config,
|
|
523
|
-
client:
|
|
523
|
+
client: tool47
|
|
524
524
|
};
|
|
525
525
|
this.register(key, toolLattice);
|
|
526
526
|
}
|
|
@@ -546,7 +546,7 @@ var ToolLatticeManager = class _ToolLatticeManager extends BaseLatticeManager {
|
|
|
546
546
|
};
|
|
547
547
|
var toolLatticeManager = ToolLatticeManager.getInstance();
|
|
548
548
|
var registerToolLattice = (key, config, executor) => toolLatticeManager.registerLattice(key, config, executor);
|
|
549
|
-
var registerExistingTool = (key,
|
|
549
|
+
var registerExistingTool = (key, tool47) => toolLatticeManager.registerExistingTool(key, tool47);
|
|
550
550
|
var getToolLattice = (key) => toolLatticeManager.getToolLattice(key);
|
|
551
551
|
var getToolDefinition = (key) => toolLatticeManager.getToolDefinition(key);
|
|
552
552
|
var getToolClient = (key) => toolLatticeManager.getToolClient(key);
|
|
@@ -1434,6 +1434,28 @@ var SemanticMetricsClient = class {
|
|
|
1434
1434
|
}
|
|
1435
1435
|
return data.data;
|
|
1436
1436
|
}
|
|
1437
|
+
/**
|
|
1438
|
+
* Execute a custom SQL query
|
|
1439
|
+
* POST /metrics/query
|
|
1440
|
+
*/
|
|
1441
|
+
async executeSqlQuery(request) {
|
|
1442
|
+
const response = await fetch(`${this.baseUrl}/metrics/query`, {
|
|
1443
|
+
method: "POST",
|
|
1444
|
+
headers: {
|
|
1445
|
+
...this.getHeaders(),
|
|
1446
|
+
"Content-Type": "application/json"
|
|
1447
|
+
},
|
|
1448
|
+
body: JSON.stringify(request)
|
|
1449
|
+
});
|
|
1450
|
+
if (!response.ok) {
|
|
1451
|
+
throw new Error(`HTTP ${response.status}: ${response.statusText}`);
|
|
1452
|
+
}
|
|
1453
|
+
const data = await response.json();
|
|
1454
|
+
if (data.code !== 200) {
|
|
1455
|
+
throw new Error(`API error: ${data.message}`);
|
|
1456
|
+
}
|
|
1457
|
+
return data.data;
|
|
1458
|
+
}
|
|
1437
1459
|
/**
|
|
1438
1460
|
* Get selected data sources for this configuration
|
|
1439
1461
|
*/
|
|
@@ -1902,7 +1924,9 @@ ${serverKeys.map(
|
|
|
1902
1924
|
}
|
|
1903
1925
|
const client = metricsServerManager.getClient(serverKey);
|
|
1904
1926
|
const dataSources = await client.getDataSources();
|
|
1905
|
-
|
|
1927
|
+
const selectedIds = config.selectedDataSources || [];
|
|
1928
|
+
const filteredDataSources = selectedIds.length > 0 ? dataSources.filter((ds) => selectedIds.includes(String(ds.id))) : dataSources;
|
|
1929
|
+
for (const ds of filteredDataSources) {
|
|
1906
1930
|
allDataSources.push({
|
|
1907
1931
|
serverKey,
|
|
1908
1932
|
datasourceId: String(ds.id),
|
|
@@ -2804,8 +2828,105 @@ ${serverKeys.map(
|
|
|
2804
2828
|
);
|
|
2805
2829
|
};
|
|
2806
2830
|
|
|
2807
|
-
// src/tool_lattice/
|
|
2831
|
+
// src/tool_lattice/metrics/execute_sql_query.ts
|
|
2808
2832
|
import z14 from "zod";
|
|
2833
|
+
import { tool as tool13 } from "langchain";
|
|
2834
|
+
var EXECUTE_SQL_QUERY_DESCRIPTION = `Execute Custom SQL Query - Advanced Data Analysis Tool
|
|
2835
|
+
|
|
2836
|
+
Use this tool when you need to perform complex queries that cannot be achieved through the standard semantic metric query interface.
|
|
2837
|
+
|
|
2838
|
+
When to Use This Tool:
|
|
2839
|
+
- When you need custom aggregations, calculations, or joins
|
|
2840
|
+
- When the standard metric query patterns don't meet your requirements
|
|
2841
|
+
- When you need to query raw table data with custom filters
|
|
2842
|
+
- When you want to perform complex analytical queries (e.g., window functions, CTEs)
|
|
2843
|
+
|
|
2844
|
+
When NOT to Use This Tool:
|
|
2845
|
+
- For simple metric queries - use query_semantic_metric_data instead
|
|
2846
|
+
- When you haven't identified the correct datasource yet - use list_metrics_datasources first
|
|
2847
|
+
|
|
2848
|
+
Prerequisites:
|
|
2849
|
+
1. Call list_metrics_datasources to get available datasource IDs
|
|
2850
|
+
2. Call query_tables_list to see available tables and their structures
|
|
2851
|
+
3. Call query_table_definition to understand table columns before writing SQL
|
|
2852
|
+
|
|
2853
|
+
SQL Query Guidelines:
|
|
2854
|
+
- Use named parameters with :paramName syntax (e.g., :year, :category)
|
|
2855
|
+
- Provide parameter values in the params object
|
|
2856
|
+
- Always use proper table and column names from table definitions
|
|
2857
|
+
- Include appropriate WHERE clauses to limit data
|
|
2858
|
+
- Use LIMIT to prevent returning too many rows
|
|
2859
|
+
|
|
2860
|
+
Example:
|
|
2861
|
+
{
|
|
2862
|
+
"serverKey": "production_metrics",
|
|
2863
|
+
"datasourceId": "1",
|
|
2864
|
+
"customSql": "SELECT \\"Code\\" AS period, SUM(\\"LineTotal\\") AS revenue FROM \\"MTC_VW_SalesRevenueCost\\" WHERE \\"Category\\" = :year GROUP BY \\"Code\\" ORDER BY \\"Code\\" ASC",
|
|
2865
|
+
"params": {
|
|
2866
|
+
"year": "2024"
|
|
2867
|
+
},
|
|
2868
|
+
"limit": 1000
|
|
2869
|
+
}`;
|
|
2870
|
+
var createExecuteSqlQueryTool = ({ serverKeys, serverDescriptions }) => {
|
|
2871
|
+
const availableServersText = serverKeys.length > 0 ? `
|
|
2872
|
+
|
|
2873
|
+
Available metrics servers:
|
|
2874
|
+
${serverKeys.map(
|
|
2875
|
+
(key) => `- ${key}${serverDescriptions?.[key] ? `: ${serverDescriptions[key]}` : ""}`
|
|
2876
|
+
).join("\n")}` : "";
|
|
2877
|
+
return tool13(
|
|
2878
|
+
async ({
|
|
2879
|
+
serverKey,
|
|
2880
|
+
datasourceId,
|
|
2881
|
+
customSql,
|
|
2882
|
+
params,
|
|
2883
|
+
limit
|
|
2884
|
+
}, _exeConfig) => {
|
|
2885
|
+
try {
|
|
2886
|
+
if (!serverKey) {
|
|
2887
|
+
return "Error: serverKey parameter is required. Available servers: " + serverKeys.join(", ");
|
|
2888
|
+
}
|
|
2889
|
+
if (!serverKeys.includes(serverKey)) {
|
|
2890
|
+
return `Error: serverKey "${serverKey}" is not in the allowed list: [${serverKeys.join(", ")}]`;
|
|
2891
|
+
}
|
|
2892
|
+
if (!datasourceId) {
|
|
2893
|
+
return "Error: datasourceId parameter is required.";
|
|
2894
|
+
}
|
|
2895
|
+
if (!customSql || customSql.trim().length === 0) {
|
|
2896
|
+
return "Error: customSql parameter is required and cannot be empty.";
|
|
2897
|
+
}
|
|
2898
|
+
const config = metricsServerManager.getConfig(serverKey);
|
|
2899
|
+
if (config.type !== "semantic") {
|
|
2900
|
+
return `Error: Server "${serverKey}" is not a semantic metrics server. This tool only works with semantic servers.`;
|
|
2901
|
+
}
|
|
2902
|
+
const client = metricsServerManager.getClient(serverKey);
|
|
2903
|
+
const result = await client.executeSqlQuery({
|
|
2904
|
+
datasourceId,
|
|
2905
|
+
customSql,
|
|
2906
|
+
params,
|
|
2907
|
+
limit: limit || 1e3
|
|
2908
|
+
});
|
|
2909
|
+
return JSON.stringify(result, null, 2);
|
|
2910
|
+
} catch (error) {
|
|
2911
|
+
return `Error executing SQL query: ${error instanceof Error ? error.message : String(error)}`;
|
|
2912
|
+
}
|
|
2913
|
+
},
|
|
2914
|
+
{
|
|
2915
|
+
name: "execute_sql_query",
|
|
2916
|
+
description: `${EXECUTE_SQL_QUERY_DESCRIPTION}${availableServersText}`,
|
|
2917
|
+
schema: z14.object({
|
|
2918
|
+
serverKey: z14.string().describe(`Target semantic metrics server. Choose from: ${serverKeys.join(", ")}`),
|
|
2919
|
+
datasourceId: z14.string().describe("The data source ID to execute SQL against."),
|
|
2920
|
+
customSql: z14.string().describe("Custom SQL query string with named parameters (e.g., :year, :category). Use double quotes for identifiers."),
|
|
2921
|
+
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."),
|
|
2922
|
+
limit: z14.number().optional().describe("Maximum number of results to return (default: 1000).")
|
|
2923
|
+
})
|
|
2924
|
+
}
|
|
2925
|
+
);
|
|
2926
|
+
};
|
|
2927
|
+
|
|
2928
|
+
// src/tool_lattice/code_eval/index.ts
|
|
2929
|
+
import z15 from "zod";
|
|
2809
2930
|
|
|
2810
2931
|
// src/sandbox_lattice/SandboxLatticeManager.ts
|
|
2811
2932
|
import { SandboxClient } from "@agent-infra/sandbox";
|
|
@@ -3044,7 +3165,7 @@ var getSandBoxManager = (key = "default") => {
|
|
|
3044
3165
|
};
|
|
3045
3166
|
|
|
3046
3167
|
// src/tool_lattice/code_eval/index.ts
|
|
3047
|
-
import { tool as
|
|
3168
|
+
import { tool as tool14 } from "langchain";
|
|
3048
3169
|
var CODE_EVAL_DESCRIPTION = `Execute code in Python or JavaScript runtime.
|
|
3049
3170
|
|
|
3050
3171
|
Args:
|
|
@@ -3054,7 +3175,7 @@ Args:
|
|
|
3054
3175
|
Returns:
|
|
3055
3176
|
Dict containing output, errors, and execution details`;
|
|
3056
3177
|
var createCodeEvalTool = ({ isolatedLevel }) => {
|
|
3057
|
-
return
|
|
3178
|
+
return tool14(async (input, exe_config) => {
|
|
3058
3179
|
try {
|
|
3059
3180
|
const runConfig = exe_config.configurable?.runConfig;
|
|
3060
3181
|
const sandboxManager = getSandBoxManager();
|
|
@@ -3095,16 +3216,16 @@ ${traceback.join("\n")}`);
|
|
|
3095
3216
|
}, {
|
|
3096
3217
|
name: "execute_code",
|
|
3097
3218
|
description: CODE_EVAL_DESCRIPTION,
|
|
3098
|
-
schema:
|
|
3099
|
-
language:
|
|
3100
|
-
code:
|
|
3219
|
+
schema: z15.object({
|
|
3220
|
+
language: z15.enum(["python", "javascript"]).describe("Programming language: 'python' or 'javascript'"),
|
|
3221
|
+
code: z15.string().describe("Code to execute")
|
|
3101
3222
|
})
|
|
3102
3223
|
});
|
|
3103
3224
|
};
|
|
3104
3225
|
|
|
3105
3226
|
// src/tool_lattice/code_execute_file/index.ts
|
|
3106
|
-
import
|
|
3107
|
-
import { tool as
|
|
3227
|
+
import z16 from "zod";
|
|
3228
|
+
import { tool as tool15 } from "langchain";
|
|
3108
3229
|
import * as path from "path";
|
|
3109
3230
|
var CODE_EXECUTE_FILE_DESCRIPTION = `Execute a code file from the sandbox filesystem. Only supports Python (.py) and JavaScript (.js, .mjs) files. Other file types are not supported. The tool reads the file content and executes it in an isolated sandbox environment. Language is automatically inferred from the file extension. Output is returned via stdout; errors appear in stderr and traceback.`;
|
|
3110
3231
|
function inferLanguageFromPath(filePath) {
|
|
@@ -3117,7 +3238,7 @@ function inferLanguageFromPath(filePath) {
|
|
|
3117
3238
|
return null;
|
|
3118
3239
|
}
|
|
3119
3240
|
var createCodeExecuteFileTool = ({ isolatedLevel }) => {
|
|
3120
|
-
return
|
|
3241
|
+
return tool15(
|
|
3121
3242
|
async (input, exe_config) => {
|
|
3122
3243
|
try {
|
|
3123
3244
|
const runConfig = exe_config.configurable?.runConfig;
|
|
@@ -3180,15 +3301,15 @@ ${traceback.join("\n")}`);
|
|
|
3180
3301
|
{
|
|
3181
3302
|
name: "execute_code_file",
|
|
3182
3303
|
description: CODE_EXECUTE_FILE_DESCRIPTION,
|
|
3183
|
-
schema:
|
|
3184
|
-
file_path:
|
|
3304
|
+
schema: z16.object({
|
|
3305
|
+
file_path: z16.string().describe("Path to the code file to execute (absolute path in sandbox filesystem). Only supports .py (Python) and .js/.mjs (JavaScript) files.")
|
|
3185
3306
|
})
|
|
3186
3307
|
}
|
|
3187
3308
|
);
|
|
3188
3309
|
};
|
|
3189
3310
|
|
|
3190
3311
|
// src/tool_lattice/convert_to_markdown/index.ts
|
|
3191
|
-
import
|
|
3312
|
+
import z17 from "zod";
|
|
3192
3313
|
var CONVERT_TO_MARKDOWN_DESCRIPTION = `Convert a resource described by an http:, https:, file: or data: URI to markdown.
|
|
3193
3314
|
|
|
3194
3315
|
Args:
|
|
@@ -3205,8 +3326,8 @@ registerToolLattice(
|
|
|
3205
3326
|
name: "convert_to_markdown",
|
|
3206
3327
|
description: CONVERT_TO_MARKDOWN_DESCRIPTION,
|
|
3207
3328
|
needUserApprove: false,
|
|
3208
|
-
schema:
|
|
3209
|
-
uri:
|
|
3329
|
+
schema: z17.object({
|
|
3330
|
+
uri: z17.string().describe("The URI to convert.")
|
|
3210
3331
|
})
|
|
3211
3332
|
},
|
|
3212
3333
|
async (input, exe_config) => {
|
|
@@ -3229,15 +3350,15 @@ registerToolLattice(
|
|
|
3229
3350
|
);
|
|
3230
3351
|
|
|
3231
3352
|
// src/tool_lattice/browser/browser_navigate.ts
|
|
3232
|
-
import
|
|
3233
|
-
import { tool as
|
|
3353
|
+
import z18 from "zod";
|
|
3354
|
+
import { tool as tool16 } from "langchain";
|
|
3234
3355
|
var BROWSER_NAVIGATE_DESCRIPTION = `Navigate to a URL.
|
|
3235
3356
|
|
|
3236
3357
|
Args:
|
|
3237
3358
|
url (str): The URL to navigate to.
|
|
3238
3359
|
`;
|
|
3239
3360
|
var createBrowserNavigateTool = ({ isolatedLevel }) => {
|
|
3240
|
-
return
|
|
3361
|
+
return tool16(
|
|
3241
3362
|
async (input, exe_config) => {
|
|
3242
3363
|
try {
|
|
3243
3364
|
const runConfig = exe_config.configurable?.runConfig;
|
|
@@ -3257,23 +3378,23 @@ var createBrowserNavigateTool = ({ isolatedLevel }) => {
|
|
|
3257
3378
|
{
|
|
3258
3379
|
name: "browser_navigate",
|
|
3259
3380
|
description: BROWSER_NAVIGATE_DESCRIPTION,
|
|
3260
|
-
schema:
|
|
3261
|
-
url:
|
|
3381
|
+
schema: z18.object({
|
|
3382
|
+
url: z18.string().describe("The URL to navigate to.")
|
|
3262
3383
|
})
|
|
3263
3384
|
}
|
|
3264
3385
|
);
|
|
3265
3386
|
};
|
|
3266
3387
|
|
|
3267
3388
|
// src/tool_lattice/browser/browser_click.ts
|
|
3268
|
-
import
|
|
3269
|
-
import { tool as
|
|
3389
|
+
import z19 from "zod";
|
|
3390
|
+
import { tool as tool17 } from "langchain";
|
|
3270
3391
|
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.
|
|
3271
3392
|
|
|
3272
3393
|
Args:
|
|
3273
3394
|
index (int): Index of the element to click
|
|
3274
3395
|
`;
|
|
3275
3396
|
var createBrowserClickTool = ({ isolatedLevel }) => {
|
|
3276
|
-
return
|
|
3397
|
+
return tool17(
|
|
3277
3398
|
async (input, exe_config) => {
|
|
3278
3399
|
try {
|
|
3279
3400
|
const runConfig = exe_config.configurable?.runConfig;
|
|
@@ -3293,23 +3414,23 @@ var createBrowserClickTool = ({ isolatedLevel }) => {
|
|
|
3293
3414
|
{
|
|
3294
3415
|
name: "browser_click",
|
|
3295
3416
|
description: BROWSER_CLICK_DESCRIPTION,
|
|
3296
|
-
schema:
|
|
3297
|
-
index:
|
|
3417
|
+
schema: z19.object({
|
|
3418
|
+
index: z19.number().describe("Index of the element to click")
|
|
3298
3419
|
})
|
|
3299
3420
|
}
|
|
3300
3421
|
);
|
|
3301
3422
|
};
|
|
3302
3423
|
|
|
3303
3424
|
// src/tool_lattice/browser/browser_get_text.ts
|
|
3304
|
-
import
|
|
3305
|
-
import { tool as
|
|
3425
|
+
import z20 from "zod";
|
|
3426
|
+
import { tool as tool18 } from "langchain";
|
|
3306
3427
|
var BROWSER_GET_TEXT_DESCRIPTION = `Get the text content of the current page.
|
|
3307
3428
|
|
|
3308
3429
|
Args:
|
|
3309
3430
|
None
|
|
3310
3431
|
`;
|
|
3311
3432
|
var createBrowserGetTextTool = ({ isolatedLevel }) => {
|
|
3312
|
-
return
|
|
3433
|
+
return tool18(
|
|
3313
3434
|
async (input, exe_config) => {
|
|
3314
3435
|
try {
|
|
3315
3436
|
const runConfig = exe_config.configurable?.runConfig;
|
|
@@ -3327,21 +3448,21 @@ var createBrowserGetTextTool = ({ isolatedLevel }) => {
|
|
|
3327
3448
|
{
|
|
3328
3449
|
name: "browser_get_text",
|
|
3329
3450
|
description: BROWSER_GET_TEXT_DESCRIPTION,
|
|
3330
|
-
schema:
|
|
3451
|
+
schema: z20.object({})
|
|
3331
3452
|
}
|
|
3332
3453
|
);
|
|
3333
3454
|
};
|
|
3334
3455
|
|
|
3335
3456
|
// src/tool_lattice/browser/browser_get_markdown.ts
|
|
3336
|
-
import
|
|
3337
|
-
import { tool as
|
|
3457
|
+
import z21 from "zod";
|
|
3458
|
+
import { tool as tool19 } from "langchain";
|
|
3338
3459
|
var BROWSER_GET_MARKDOWN_DESCRIPTION = `Get the markdown content of the current page.
|
|
3339
3460
|
|
|
3340
3461
|
Args:
|
|
3341
3462
|
None
|
|
3342
3463
|
`;
|
|
3343
3464
|
var createBrowserGetMarkdownTool = ({ isolatedLevel }) => {
|
|
3344
|
-
return
|
|
3465
|
+
return tool19(
|
|
3345
3466
|
async (input, exe_config) => {
|
|
3346
3467
|
try {
|
|
3347
3468
|
const runConfig = exe_config.configurable?.runConfig;
|
|
@@ -3359,21 +3480,21 @@ var createBrowserGetMarkdownTool = ({ isolatedLevel }) => {
|
|
|
3359
3480
|
{
|
|
3360
3481
|
name: "browser_get_markdown",
|
|
3361
3482
|
description: BROWSER_GET_MARKDOWN_DESCRIPTION,
|
|
3362
|
-
schema:
|
|
3483
|
+
schema: z21.object({})
|
|
3363
3484
|
}
|
|
3364
3485
|
);
|
|
3365
3486
|
};
|
|
3366
3487
|
|
|
3367
3488
|
// src/tool_lattice/browser/browser_evaluate.ts
|
|
3368
|
-
import
|
|
3369
|
-
import { tool as
|
|
3489
|
+
import z22 from "zod";
|
|
3490
|
+
import { tool as tool20 } from "langchain";
|
|
3370
3491
|
var BROWSER_EVALUATE_DESCRIPTION = `Execute JavaScript in the browser console.
|
|
3371
3492
|
|
|
3372
3493
|
Args:
|
|
3373
3494
|
script (str): JavaScript code to execute, () => { /* code */ }
|
|
3374
3495
|
`;
|
|
3375
3496
|
var createBrowserEvaluateTool = ({ isolatedLevel }) => {
|
|
3376
|
-
return
|
|
3497
|
+
return tool20(
|
|
3377
3498
|
async (input, exe_config) => {
|
|
3378
3499
|
try {
|
|
3379
3500
|
const runConfig = exe_config.configurable?.runConfig;
|
|
@@ -3393,16 +3514,16 @@ var createBrowserEvaluateTool = ({ isolatedLevel }) => {
|
|
|
3393
3514
|
{
|
|
3394
3515
|
name: "browser_evaluate",
|
|
3395
3516
|
description: BROWSER_EVALUATE_DESCRIPTION,
|
|
3396
|
-
schema:
|
|
3397
|
-
script:
|
|
3517
|
+
schema: z22.object({
|
|
3518
|
+
script: z22.string().describe("JavaScript code to execute, () => { /* code */ }")
|
|
3398
3519
|
})
|
|
3399
3520
|
}
|
|
3400
3521
|
);
|
|
3401
3522
|
};
|
|
3402
3523
|
|
|
3403
3524
|
// src/tool_lattice/browser/browser_screenshot.ts
|
|
3404
|
-
import
|
|
3405
|
-
import { tool as
|
|
3525
|
+
import z23 from "zod";
|
|
3526
|
+
import { tool as tool21 } from "langchain";
|
|
3406
3527
|
var BROWSER_SCREENSHOT_DESCRIPTION = `Take a screenshot of the current page or a specific element.
|
|
3407
3528
|
|
|
3408
3529
|
Args:
|
|
@@ -3415,7 +3536,7 @@ Args:
|
|
|
3415
3536
|
highlight (bool): Highlight the element
|
|
3416
3537
|
`;
|
|
3417
3538
|
var createBrowserScreenshotTool = ({ isolatedLevel }) => {
|
|
3418
|
-
return
|
|
3539
|
+
return tool21(
|
|
3419
3540
|
async (input, exe_config) => {
|
|
3420
3541
|
try {
|
|
3421
3542
|
const runConfig = exe_config.configurable?.runConfig;
|
|
@@ -3467,29 +3588,29 @@ var createBrowserScreenshotTool = ({ isolatedLevel }) => {
|
|
|
3467
3588
|
{
|
|
3468
3589
|
name: "browser_screenshot",
|
|
3469
3590
|
description: BROWSER_SCREENSHOT_DESCRIPTION,
|
|
3470
|
-
schema:
|
|
3471
|
-
name:
|
|
3472
|
-
selector:
|
|
3473
|
-
index:
|
|
3474
|
-
width:
|
|
3475
|
-
height:
|
|
3476
|
-
fullPage:
|
|
3477
|
-
highlight:
|
|
3591
|
+
schema: z23.object({
|
|
3592
|
+
name: z23.string().optional().describe("Name for the screenshot"),
|
|
3593
|
+
selector: z23.string().optional().describe("CSS selector for element to screenshot"),
|
|
3594
|
+
index: z23.number().optional().describe("index of the element to screenshot"),
|
|
3595
|
+
width: z23.number().optional().describe("Width in pixels (default: viewport width)"),
|
|
3596
|
+
height: z23.number().optional().describe("Height in pixels (default: viewport height)"),
|
|
3597
|
+
fullPage: z23.boolean().optional().describe("Full page screenshot (default: false)"),
|
|
3598
|
+
highlight: z23.boolean().default(false).describe("Highlight the element")
|
|
3478
3599
|
})
|
|
3479
3600
|
}
|
|
3480
3601
|
);
|
|
3481
3602
|
};
|
|
3482
3603
|
|
|
3483
3604
|
// src/tool_lattice/browser/browser_scroll.ts
|
|
3484
|
-
import
|
|
3485
|
-
import { tool as
|
|
3605
|
+
import z24 from "zod";
|
|
3606
|
+
import { tool as tool22 } from "langchain";
|
|
3486
3607
|
var BROWSER_SCROLL_DESCRIPTION = `Scroll the page.
|
|
3487
3608
|
|
|
3488
3609
|
Args:
|
|
3489
3610
|
amount (int): Pixels to scroll (positive for down, negative for up), if the amount is not provided, scroll to the bottom of the page
|
|
3490
3611
|
`;
|
|
3491
3612
|
var createBrowserScrollTool = ({ isolatedLevel }) => {
|
|
3492
|
-
return
|
|
3613
|
+
return tool22(
|
|
3493
3614
|
async (input, exe_config) => {
|
|
3494
3615
|
try {
|
|
3495
3616
|
const runConfig = exe_config.configurable?.runConfig;
|
|
@@ -3509,16 +3630,16 @@ var createBrowserScrollTool = ({ isolatedLevel }) => {
|
|
|
3509
3630
|
{
|
|
3510
3631
|
name: "browser_scroll",
|
|
3511
3632
|
description: BROWSER_SCROLL_DESCRIPTION,
|
|
3512
|
-
schema:
|
|
3513
|
-
amount:
|
|
3633
|
+
schema: z24.object({
|
|
3634
|
+
amount: z24.number().optional().describe("Pixels to scroll (positive for down, negative for up)")
|
|
3514
3635
|
})
|
|
3515
3636
|
}
|
|
3516
3637
|
);
|
|
3517
3638
|
};
|
|
3518
3639
|
|
|
3519
3640
|
// src/tool_lattice/browser/browser_form_input_fill.ts
|
|
3520
|
-
import
|
|
3521
|
-
import { tool as
|
|
3641
|
+
import z25 from "zod";
|
|
3642
|
+
import { tool as tool23 } from "langchain";
|
|
3522
3643
|
var BROWSER_FORM_INPUT_FILL_DESCRIPTION = `Fill out an input field, before using the tool, Either 'index' or 'selector' must be provided.
|
|
3523
3644
|
|
|
3524
3645
|
Args:
|
|
@@ -3528,7 +3649,7 @@ Args:
|
|
|
3528
3649
|
clear (bool): Whether to clear existing text before filling
|
|
3529
3650
|
`;
|
|
3530
3651
|
var createBrowserFormInputFillTool = ({ isolatedLevel }) => {
|
|
3531
|
-
return
|
|
3652
|
+
return tool23(
|
|
3532
3653
|
async (input, exe_config) => {
|
|
3533
3654
|
try {
|
|
3534
3655
|
const runConfig = exe_config.configurable?.runConfig;
|
|
@@ -3551,19 +3672,19 @@ var createBrowserFormInputFillTool = ({ isolatedLevel }) => {
|
|
|
3551
3672
|
{
|
|
3552
3673
|
name: "browser_form_input_fill",
|
|
3553
3674
|
description: BROWSER_FORM_INPUT_FILL_DESCRIPTION,
|
|
3554
|
-
schema:
|
|
3555
|
-
selector:
|
|
3556
|
-
index:
|
|
3557
|
-
value:
|
|
3558
|
-
clear:
|
|
3675
|
+
schema: z25.object({
|
|
3676
|
+
selector: z25.string().optional().describe("CSS selector for input field"),
|
|
3677
|
+
index: z25.number().optional().describe("Index of the element to fill"),
|
|
3678
|
+
value: z25.string().describe("Value to fill"),
|
|
3679
|
+
clear: z25.boolean().default(false).describe("Whether to clear existing text before filling")
|
|
3559
3680
|
})
|
|
3560
3681
|
}
|
|
3561
3682
|
);
|
|
3562
3683
|
};
|
|
3563
3684
|
|
|
3564
3685
|
// src/tool_lattice/browser/browser_select.ts
|
|
3565
|
-
import
|
|
3566
|
-
import { tool as
|
|
3686
|
+
import z26 from "zod";
|
|
3687
|
+
import { tool as tool24 } from "langchain";
|
|
3567
3688
|
var BROWSER_SELECT_DESCRIPTION = `Select an element on the page with index, Either 'index' or 'selector' must be provided.
|
|
3568
3689
|
|
|
3569
3690
|
Args:
|
|
@@ -3572,7 +3693,7 @@ Args:
|
|
|
3572
3693
|
value (str): Value to select
|
|
3573
3694
|
`;
|
|
3574
3695
|
var createBrowserSelectTool = ({ isolatedLevel }) => {
|
|
3575
|
-
return
|
|
3696
|
+
return tool24(
|
|
3576
3697
|
async (input, exe_config) => {
|
|
3577
3698
|
try {
|
|
3578
3699
|
const runConfig = exe_config.configurable?.runConfig;
|
|
@@ -3594,18 +3715,18 @@ var createBrowserSelectTool = ({ isolatedLevel }) => {
|
|
|
3594
3715
|
{
|
|
3595
3716
|
name: "browser_select",
|
|
3596
3717
|
description: BROWSER_SELECT_DESCRIPTION,
|
|
3597
|
-
schema:
|
|
3598
|
-
index:
|
|
3599
|
-
selector:
|
|
3600
|
-
value:
|
|
3718
|
+
schema: z26.object({
|
|
3719
|
+
index: z26.number().optional().describe("Index of the element to select"),
|
|
3720
|
+
selector: z26.string().optional().describe("CSS selector for element to select"),
|
|
3721
|
+
value: z26.string().describe("Value to select")
|
|
3601
3722
|
})
|
|
3602
3723
|
}
|
|
3603
3724
|
);
|
|
3604
3725
|
};
|
|
3605
3726
|
|
|
3606
3727
|
// src/tool_lattice/browser/browser_hover.ts
|
|
3607
|
-
import
|
|
3608
|
-
import { tool as
|
|
3728
|
+
import z27 from "zod";
|
|
3729
|
+
import { tool as tool25 } from "langchain";
|
|
3609
3730
|
var BROWSER_HOVER_DESCRIPTION = `Hover an element on the page, Either 'index' or 'selector' must be provided.
|
|
3610
3731
|
|
|
3611
3732
|
Args:
|
|
@@ -3613,7 +3734,7 @@ Args:
|
|
|
3613
3734
|
selector (str): CSS selector for element to hover
|
|
3614
3735
|
`;
|
|
3615
3736
|
var createBrowserHoverTool = ({ isolatedLevel }) => {
|
|
3616
|
-
return
|
|
3737
|
+
return tool25(
|
|
3617
3738
|
async (input, exe_config) => {
|
|
3618
3739
|
try {
|
|
3619
3740
|
const runConfig = exe_config.configurable?.runConfig;
|
|
@@ -3634,24 +3755,24 @@ var createBrowserHoverTool = ({ isolatedLevel }) => {
|
|
|
3634
3755
|
{
|
|
3635
3756
|
name: "browser_hover",
|
|
3636
3757
|
description: BROWSER_HOVER_DESCRIPTION,
|
|
3637
|
-
schema:
|
|
3638
|
-
index:
|
|
3639
|
-
selector:
|
|
3758
|
+
schema: z27.object({
|
|
3759
|
+
index: z27.number().optional().describe("Index of the element to hover"),
|
|
3760
|
+
selector: z27.string().optional().describe("CSS selector for element to hover")
|
|
3640
3761
|
})
|
|
3641
3762
|
}
|
|
3642
3763
|
);
|
|
3643
3764
|
};
|
|
3644
3765
|
|
|
3645
3766
|
// src/tool_lattice/browser/browser_go_back.ts
|
|
3646
|
-
import
|
|
3647
|
-
import { tool as
|
|
3767
|
+
import z28 from "zod";
|
|
3768
|
+
import { tool as tool26 } from "langchain";
|
|
3648
3769
|
var BROWSER_GO_BACK_DESCRIPTION = `Go back to the previous page.
|
|
3649
3770
|
|
|
3650
3771
|
Args:
|
|
3651
3772
|
None
|
|
3652
3773
|
`;
|
|
3653
3774
|
var createBrowserGoBackTool = ({ isolatedLevel }) => {
|
|
3654
|
-
return
|
|
3775
|
+
return tool26(
|
|
3655
3776
|
async (input, exe_config) => {
|
|
3656
3777
|
try {
|
|
3657
3778
|
const runConfig = exe_config.configurable?.runConfig;
|
|
@@ -3669,21 +3790,21 @@ var createBrowserGoBackTool = ({ isolatedLevel }) => {
|
|
|
3669
3790
|
{
|
|
3670
3791
|
name: "browser_go_back",
|
|
3671
3792
|
description: BROWSER_GO_BACK_DESCRIPTION,
|
|
3672
|
-
schema:
|
|
3793
|
+
schema: z28.object({})
|
|
3673
3794
|
}
|
|
3674
3795
|
);
|
|
3675
3796
|
};
|
|
3676
3797
|
|
|
3677
3798
|
// src/tool_lattice/browser/browser_go_forward.ts
|
|
3678
|
-
import
|
|
3679
|
-
import { tool as
|
|
3799
|
+
import z29 from "zod";
|
|
3800
|
+
import { tool as tool27 } from "langchain";
|
|
3680
3801
|
var BROWSER_GO_FORWARD_DESCRIPTION = `Go forward to the next page.
|
|
3681
3802
|
|
|
3682
3803
|
Args:
|
|
3683
3804
|
None
|
|
3684
3805
|
`;
|
|
3685
3806
|
var createBrowserGoForwardTool = ({ isolatedLevel }) => {
|
|
3686
|
-
return
|
|
3807
|
+
return tool27(
|
|
3687
3808
|
async (input, exe_config) => {
|
|
3688
3809
|
try {
|
|
3689
3810
|
const runConfig = exe_config.configurable?.runConfig;
|
|
@@ -3701,21 +3822,21 @@ var createBrowserGoForwardTool = ({ isolatedLevel }) => {
|
|
|
3701
3822
|
{
|
|
3702
3823
|
name: "browser_go_forward",
|
|
3703
3824
|
description: BROWSER_GO_FORWARD_DESCRIPTION,
|
|
3704
|
-
schema:
|
|
3825
|
+
schema: z29.object({})
|
|
3705
3826
|
}
|
|
3706
3827
|
);
|
|
3707
3828
|
};
|
|
3708
3829
|
|
|
3709
3830
|
// src/tool_lattice/browser/browser_new_tab.ts
|
|
3710
|
-
import
|
|
3711
|
-
import { tool as
|
|
3831
|
+
import z30 from "zod";
|
|
3832
|
+
import { tool as tool28 } from "langchain";
|
|
3712
3833
|
var BROWSER_NEW_TAB_DESCRIPTION = `Open a new tab.
|
|
3713
3834
|
|
|
3714
3835
|
Args:
|
|
3715
3836
|
url (str): URL to open in the new tab
|
|
3716
3837
|
`;
|
|
3717
3838
|
var createBrowserNewTabTool = ({ isolatedLevel }) => {
|
|
3718
|
-
return
|
|
3839
|
+
return tool28(
|
|
3719
3840
|
async (input, exe_config) => {
|
|
3720
3841
|
try {
|
|
3721
3842
|
const runConfig = exe_config.configurable?.runConfig;
|
|
@@ -3735,23 +3856,23 @@ var createBrowserNewTabTool = ({ isolatedLevel }) => {
|
|
|
3735
3856
|
{
|
|
3736
3857
|
name: "browser_new_tab",
|
|
3737
3858
|
description: BROWSER_NEW_TAB_DESCRIPTION,
|
|
3738
|
-
schema:
|
|
3739
|
-
url:
|
|
3859
|
+
schema: z30.object({
|
|
3860
|
+
url: z30.string().describe("URL to open in the new tab")
|
|
3740
3861
|
})
|
|
3741
3862
|
}
|
|
3742
3863
|
);
|
|
3743
3864
|
};
|
|
3744
3865
|
|
|
3745
3866
|
// src/tool_lattice/browser/browser_tab_list.ts
|
|
3746
|
-
import
|
|
3747
|
-
import { tool as
|
|
3867
|
+
import z31 from "zod";
|
|
3868
|
+
import { tool as tool29 } from "langchain";
|
|
3748
3869
|
var BROWSER_TAB_LIST_DESCRIPTION = `Get the list of tabs.
|
|
3749
3870
|
|
|
3750
3871
|
Args:
|
|
3751
3872
|
None
|
|
3752
3873
|
`;
|
|
3753
3874
|
var createBrowserTabListTool = ({ isolatedLevel }) => {
|
|
3754
|
-
return
|
|
3875
|
+
return tool29(
|
|
3755
3876
|
async (input, exe_config) => {
|
|
3756
3877
|
try {
|
|
3757
3878
|
const runConfig = exe_config.configurable?.runConfig;
|
|
@@ -3769,21 +3890,21 @@ var createBrowserTabListTool = ({ isolatedLevel }) => {
|
|
|
3769
3890
|
{
|
|
3770
3891
|
name: "browser_tab_list",
|
|
3771
3892
|
description: BROWSER_TAB_LIST_DESCRIPTION,
|
|
3772
|
-
schema:
|
|
3893
|
+
schema: z31.object({})
|
|
3773
3894
|
}
|
|
3774
3895
|
);
|
|
3775
3896
|
};
|
|
3776
3897
|
|
|
3777
3898
|
// src/tool_lattice/browser/browser_switch_tab.ts
|
|
3778
|
-
import
|
|
3779
|
-
import { tool as
|
|
3899
|
+
import z32 from "zod";
|
|
3900
|
+
import { tool as tool30 } from "langchain";
|
|
3780
3901
|
var BROWSER_SWITCH_TAB_DESCRIPTION = `Switch to a specific tab.
|
|
3781
3902
|
|
|
3782
3903
|
Args:
|
|
3783
3904
|
index (int): Tab index to switch to
|
|
3784
3905
|
`;
|
|
3785
3906
|
var createBrowserSwitchTabTool = ({ isolatedLevel }) => {
|
|
3786
|
-
return
|
|
3907
|
+
return tool30(
|
|
3787
3908
|
async (input, exe_config) => {
|
|
3788
3909
|
try {
|
|
3789
3910
|
const runConfig = exe_config.configurable?.runConfig;
|
|
@@ -3803,23 +3924,23 @@ var createBrowserSwitchTabTool = ({ isolatedLevel }) => {
|
|
|
3803
3924
|
{
|
|
3804
3925
|
name: "browser_switch_tab",
|
|
3805
3926
|
description: BROWSER_SWITCH_TAB_DESCRIPTION,
|
|
3806
|
-
schema:
|
|
3807
|
-
index:
|
|
3927
|
+
schema: z32.object({
|
|
3928
|
+
index: z32.number().describe("Tab index to switch to")
|
|
3808
3929
|
})
|
|
3809
3930
|
}
|
|
3810
3931
|
);
|
|
3811
3932
|
};
|
|
3812
3933
|
|
|
3813
3934
|
// src/tool_lattice/browser/browser_close_tab.ts
|
|
3814
|
-
import
|
|
3815
|
-
import { tool as
|
|
3935
|
+
import z33 from "zod";
|
|
3936
|
+
import { tool as tool31 } from "langchain";
|
|
3816
3937
|
var BROWSER_CLOSE_TAB_DESCRIPTION = `Close the current tab.
|
|
3817
3938
|
|
|
3818
3939
|
Args:
|
|
3819
3940
|
None
|
|
3820
3941
|
`;
|
|
3821
3942
|
var createBrowserCloseTabTool = ({ isolatedLevel }) => {
|
|
3822
|
-
return
|
|
3943
|
+
return tool31(
|
|
3823
3944
|
async (input, exe_config) => {
|
|
3824
3945
|
try {
|
|
3825
3946
|
const runConfig = exe_config.configurable?.runConfig;
|
|
@@ -3837,21 +3958,21 @@ var createBrowserCloseTabTool = ({ isolatedLevel }) => {
|
|
|
3837
3958
|
{
|
|
3838
3959
|
name: "browser_close_tab",
|
|
3839
3960
|
description: BROWSER_CLOSE_TAB_DESCRIPTION,
|
|
3840
|
-
schema:
|
|
3961
|
+
schema: z33.object({})
|
|
3841
3962
|
}
|
|
3842
3963
|
);
|
|
3843
3964
|
};
|
|
3844
3965
|
|
|
3845
3966
|
// src/tool_lattice/browser/browser_close.ts
|
|
3846
|
-
import
|
|
3847
|
-
import { tool as
|
|
3967
|
+
import z34 from "zod";
|
|
3968
|
+
import { tool as tool32 } from "langchain";
|
|
3848
3969
|
var BROWSER_CLOSE_DESCRIPTION = `Close the browser when the task is done and the browser is not needed anymore.
|
|
3849
3970
|
|
|
3850
3971
|
Args:
|
|
3851
3972
|
None
|
|
3852
3973
|
`;
|
|
3853
3974
|
var createBrowserCloseTool = ({ isolatedLevel }) => {
|
|
3854
|
-
return
|
|
3975
|
+
return tool32(
|
|
3855
3976
|
async (input, exe_config) => {
|
|
3856
3977
|
try {
|
|
3857
3978
|
const runConfig = exe_config.configurable?.runConfig;
|
|
@@ -3869,21 +3990,21 @@ var createBrowserCloseTool = ({ isolatedLevel }) => {
|
|
|
3869
3990
|
{
|
|
3870
3991
|
name: "browser_close",
|
|
3871
3992
|
description: BROWSER_CLOSE_DESCRIPTION,
|
|
3872
|
-
schema:
|
|
3993
|
+
schema: z34.object({})
|
|
3873
3994
|
}
|
|
3874
3995
|
);
|
|
3875
3996
|
};
|
|
3876
3997
|
|
|
3877
3998
|
// src/tool_lattice/browser/browser_press_key.ts
|
|
3878
|
-
import
|
|
3879
|
-
import { tool as
|
|
3999
|
+
import z35 from "zod";
|
|
4000
|
+
import { tool as tool33 } from "langchain";
|
|
3880
4001
|
var BROWSER_PRESS_KEY_DESCRIPTION = `Press a key on the keyboard.
|
|
3881
4002
|
|
|
3882
4003
|
Args:
|
|
3883
4004
|
key (str): Name of the key to press or a character to generate, such as Enter, Tab, Escape, Backspace, Delete, Insert, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, ArrowLeft, ArrowRight, ArrowUp, ArrowDown, PageUp, PageDown, Home, End, ShiftLeft, ShiftRight, ControlLeft, ControlRight, AltLeft, AltRight, MetaLeft, MetaRight, CapsLock, PrintScreen, ScrollLock, Pause, ContextMenu
|
|
3884
4005
|
`;
|
|
3885
4006
|
var createBrowserPressKeyTool = ({ isolatedLevel }) => {
|
|
3886
|
-
return
|
|
4007
|
+
return tool33(
|
|
3887
4008
|
async (input, exe_config) => {
|
|
3888
4009
|
try {
|
|
3889
4010
|
const runConfig = exe_config.configurable?.runConfig;
|
|
@@ -3903,8 +4024,8 @@ var createBrowserPressKeyTool = ({ isolatedLevel }) => {
|
|
|
3903
4024
|
{
|
|
3904
4025
|
name: "browser_press_key",
|
|
3905
4026
|
description: BROWSER_PRESS_KEY_DESCRIPTION,
|
|
3906
|
-
schema:
|
|
3907
|
-
key:
|
|
4027
|
+
schema: z35.object({
|
|
4028
|
+
key: z35.enum([
|
|
3908
4029
|
"Enter",
|
|
3909
4030
|
"Tab",
|
|
3910
4031
|
"Escape",
|
|
@@ -3951,15 +4072,15 @@ var createBrowserPressKeyTool = ({ isolatedLevel }) => {
|
|
|
3951
4072
|
};
|
|
3952
4073
|
|
|
3953
4074
|
// src/tool_lattice/browser/browser_read_links.ts
|
|
3954
|
-
import
|
|
3955
|
-
import { tool as
|
|
4075
|
+
import z36 from "zod";
|
|
4076
|
+
import { tool as tool34 } from "langchain";
|
|
3956
4077
|
var BROWSER_READ_LINKS_DESCRIPTION = `Get all links on the current page.
|
|
3957
4078
|
|
|
3958
4079
|
Args:
|
|
3959
4080
|
None
|
|
3960
4081
|
`;
|
|
3961
4082
|
var createBrowserReadLinksTool = ({ isolatedLevel }) => {
|
|
3962
|
-
return
|
|
4083
|
+
return tool34(
|
|
3963
4084
|
async (input, exe_config) => {
|
|
3964
4085
|
try {
|
|
3965
4086
|
const runConfig = exe_config.configurable?.runConfig;
|
|
@@ -3977,21 +4098,21 @@ var createBrowserReadLinksTool = ({ isolatedLevel }) => {
|
|
|
3977
4098
|
{
|
|
3978
4099
|
name: "browser_read_links",
|
|
3979
4100
|
description: BROWSER_READ_LINKS_DESCRIPTION,
|
|
3980
|
-
schema:
|
|
4101
|
+
schema: z36.object({})
|
|
3981
4102
|
}
|
|
3982
4103
|
);
|
|
3983
4104
|
};
|
|
3984
4105
|
|
|
3985
4106
|
// src/tool_lattice/browser/browser_get_clickable_elements.ts
|
|
3986
|
-
import
|
|
3987
|
-
import { tool as
|
|
4107
|
+
import z37 from "zod";
|
|
4108
|
+
import { tool as tool35 } from "langchain";
|
|
3988
4109
|
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.
|
|
3989
4110
|
|
|
3990
4111
|
Args:
|
|
3991
4112
|
None
|
|
3992
4113
|
`;
|
|
3993
4114
|
var createBrowserGetClickableElementsTool = ({ isolatedLevel }) => {
|
|
3994
|
-
return
|
|
4115
|
+
return tool35(
|
|
3995
4116
|
async (input, exe_config) => {
|
|
3996
4117
|
try {
|
|
3997
4118
|
const runConfig = exe_config.configurable?.runConfig;
|
|
@@ -4009,21 +4130,21 @@ var createBrowserGetClickableElementsTool = ({ isolatedLevel }) => {
|
|
|
4009
4130
|
{
|
|
4010
4131
|
name: "browser_get_clickable_elements",
|
|
4011
4132
|
description: BROWSER_GET_CLICKABLE_ELEMENTS_DESCRIPTION,
|
|
4012
|
-
schema:
|
|
4133
|
+
schema: z37.object({})
|
|
4013
4134
|
}
|
|
4014
4135
|
);
|
|
4015
4136
|
};
|
|
4016
4137
|
|
|
4017
4138
|
// src/tool_lattice/browser/browser_get_download_list.ts
|
|
4018
|
-
import
|
|
4019
|
-
import { tool as
|
|
4139
|
+
import z38 from "zod";
|
|
4140
|
+
import { tool as tool36 } from "langchain";
|
|
4020
4141
|
var BROWSER_GET_DOWNLOAD_LIST_DESCRIPTION = `Get the list of downloaded files.
|
|
4021
4142
|
|
|
4022
4143
|
Args:
|
|
4023
4144
|
None
|
|
4024
4145
|
`;
|
|
4025
4146
|
var createBrowserGetDownloadListTool = ({ isolatedLevel }) => {
|
|
4026
|
-
return
|
|
4147
|
+
return tool36(
|
|
4027
4148
|
async (input, exe_config) => {
|
|
4028
4149
|
try {
|
|
4029
4150
|
const runConfig = exe_config.configurable?.runConfig;
|
|
@@ -4041,14 +4162,14 @@ var createBrowserGetDownloadListTool = ({ isolatedLevel }) => {
|
|
|
4041
4162
|
{
|
|
4042
4163
|
name: "browser_get_download_list",
|
|
4043
4164
|
description: BROWSER_GET_DOWNLOAD_LIST_DESCRIPTION,
|
|
4044
|
-
schema:
|
|
4165
|
+
schema: z38.object({})
|
|
4045
4166
|
}
|
|
4046
4167
|
);
|
|
4047
4168
|
};
|
|
4048
4169
|
|
|
4049
4170
|
// src/tool_lattice/browser/get_info.ts
|
|
4050
|
-
import
|
|
4051
|
-
import { tool as
|
|
4171
|
+
import z39 from "zod";
|
|
4172
|
+
import { tool as tool37 } from "langchain";
|
|
4052
4173
|
var BROWSER_GET_INFO_DESCRIPTION = `Get information about browser, like CDP URL, viewport size, etc.
|
|
4053
4174
|
|
|
4054
4175
|
Args:
|
|
@@ -4057,7 +4178,7 @@ Args:
|
|
|
4057
4178
|
Returns:
|
|
4058
4179
|
Dict containing browser information including CDP URL, viewport dimensions, and other browser metadata.`;
|
|
4059
4180
|
var createBrowserGetInfoTool = ({ isolatedLevel }) => {
|
|
4060
|
-
return
|
|
4181
|
+
return tool37(
|
|
4061
4182
|
async (input, exe_config) => {
|
|
4062
4183
|
try {
|
|
4063
4184
|
const runConfig = exe_config.configurable?.runConfig;
|
|
@@ -4075,7 +4196,7 @@ var createBrowserGetInfoTool = ({ isolatedLevel }) => {
|
|
|
4075
4196
|
{
|
|
4076
4197
|
name: "browser_get_info",
|
|
4077
4198
|
description: BROWSER_GET_INFO_DESCRIPTION,
|
|
4078
|
-
schema:
|
|
4199
|
+
schema: z39.object({})
|
|
4079
4200
|
}
|
|
4080
4201
|
);
|
|
4081
4202
|
};
|
|
@@ -5924,11 +6045,11 @@ storeLatticeManager.registerLattice("default", "tenant", defaultTenantStore);
|
|
|
5924
6045
|
storeLatticeManager.registerLattice("default", "userTenantLink", defaultUserTenantLinkStore);
|
|
5925
6046
|
|
|
5926
6047
|
// src/tool_lattice/skill/load_skills.ts
|
|
5927
|
-
import
|
|
5928
|
-
import { tool as
|
|
6048
|
+
import z40 from "zod";
|
|
6049
|
+
import { tool as tool39 } from "langchain";
|
|
5929
6050
|
var LOAD_SKILLS_DESCRIPTION = `Load all available skills and return their metadata (name, description, license, compatibility, metadata, and subSkills) without the content. This tool returns skill information including hierarchical relationships (subSkills). Use this to discover what skills are available and their structure.`;
|
|
5930
6051
|
var createLoadSkillsTool = ({ skills } = {}) => {
|
|
5931
|
-
return
|
|
6052
|
+
return tool39(
|
|
5932
6053
|
async (_input, _exe_config) => {
|
|
5933
6054
|
try {
|
|
5934
6055
|
const storeLattice = getStoreLattice("default", "skill");
|
|
@@ -5952,17 +6073,17 @@ var createLoadSkillsTool = ({ skills } = {}) => {
|
|
|
5952
6073
|
{
|
|
5953
6074
|
name: "load_skills",
|
|
5954
6075
|
description: LOAD_SKILLS_DESCRIPTION,
|
|
5955
|
-
schema:
|
|
6076
|
+
schema: z40.object({})
|
|
5956
6077
|
}
|
|
5957
6078
|
);
|
|
5958
6079
|
};
|
|
5959
6080
|
|
|
5960
6081
|
// src/tool_lattice/skill/load_skill_content.ts
|
|
5961
|
-
import
|
|
5962
|
-
import { tool as
|
|
6082
|
+
import z41 from "zod";
|
|
6083
|
+
import { tool as tool40 } from "langchain";
|
|
5963
6084
|
var LOAD_SKILL_CONTENT_DESCRIPTION = `Load a specific skill's content by name and return its full content including markdown body. This tool returns the complete skill content including frontmatter and markdown body. If the skill has resources, they will be listed at the end of the content with instructions on how to access them. Use this tool to get the complete skill content for a skill that you want to use.`;
|
|
5964
6085
|
var createLoadSkillContentTool = () => {
|
|
5965
|
-
return
|
|
6086
|
+
return tool40(
|
|
5966
6087
|
async (input, _exe_config) => {
|
|
5967
6088
|
try {
|
|
5968
6089
|
const storeLattice = getStoreLattice("default", "skill");
|
|
@@ -6020,19 +6141,19 @@ ${content}`;
|
|
|
6020
6141
|
{
|
|
6021
6142
|
name: "load_skill_content",
|
|
6022
6143
|
description: LOAD_SKILL_CONTENT_DESCRIPTION,
|
|
6023
|
-
schema:
|
|
6024
|
-
skill_name:
|
|
6144
|
+
schema: z41.object({
|
|
6145
|
+
skill_name: z41.string().describe("The name of the skill to load")
|
|
6025
6146
|
})
|
|
6026
6147
|
}
|
|
6027
6148
|
);
|
|
6028
6149
|
};
|
|
6029
6150
|
|
|
6030
6151
|
// src/tool_lattice/skill/load_skill_resource.ts
|
|
6031
|
-
import
|
|
6032
|
-
import { tool as
|
|
6152
|
+
import z42 from "zod";
|
|
6153
|
+
import { tool as tool41 } from "langchain";
|
|
6033
6154
|
var LOAD_SKILL_RESOURCE_DESCRIPTION = `Load a specific resource file from a skill's resources directory. Use this tool when you need to access template files, example data, or other resources bundled with a skill. The resource paths are listed in the skill content when using the load_skill_content tool.`;
|
|
6034
6155
|
var createLoadSkillResourceTool = () => {
|
|
6035
|
-
return
|
|
6156
|
+
return tool41(
|
|
6036
6157
|
async (input, _exe_config) => {
|
|
6037
6158
|
try {
|
|
6038
6159
|
const storeLattice = getStoreLattice("default", "skill");
|
|
@@ -6053,9 +6174,9 @@ var createLoadSkillResourceTool = () => {
|
|
|
6053
6174
|
{
|
|
6054
6175
|
name: "load_skill_resource",
|
|
6055
6176
|
description: LOAD_SKILL_RESOURCE_DESCRIPTION,
|
|
6056
|
-
schema:
|
|
6057
|
-
skill_name:
|
|
6058
|
-
resource_path:
|
|
6177
|
+
schema: z42.object({
|
|
6178
|
+
skill_name: z42.string().describe("The name of the skill containing the resource"),
|
|
6179
|
+
resource_path: z42.string().describe("The path to the resource relative to the skill's resources/ directory")
|
|
6059
6180
|
})
|
|
6060
6181
|
}
|
|
6061
6182
|
);
|
|
@@ -6122,7 +6243,7 @@ ${extraNote}`;
|
|
|
6122
6243
|
}
|
|
6123
6244
|
|
|
6124
6245
|
// src/deep_agent_new/middleware/fs.ts
|
|
6125
|
-
import { createMiddleware as createMiddleware5, tool as
|
|
6246
|
+
import { createMiddleware as createMiddleware5, tool as tool42, ToolMessage } from "langchain";
|
|
6126
6247
|
import { Command, isCommand, getCurrentTaskInput } from "@langchain/langgraph";
|
|
6127
6248
|
import { z as z310 } from "zod/v3";
|
|
6128
6249
|
import { withLangGraph } from "@langchain/langgraph/zod";
|
|
@@ -6621,7 +6742,7 @@ var GLOB_TOOL_DESCRIPTION = "Find files matching a glob pattern (e.g., '**/*.py'
|
|
|
6621
6742
|
var GREP_TOOL_DESCRIPTION = "Search for a regex pattern in files. Returns matching files and line numbers";
|
|
6622
6743
|
function createLsTool(backend, options) {
|
|
6623
6744
|
const { customDescription } = options;
|
|
6624
|
-
return
|
|
6745
|
+
return tool42(
|
|
6625
6746
|
async (input, config) => {
|
|
6626
6747
|
const { runConfig } = config.configurable;
|
|
6627
6748
|
const stateAndStore = {
|
|
@@ -6657,7 +6778,7 @@ function createLsTool(backend, options) {
|
|
|
6657
6778
|
}
|
|
6658
6779
|
function createReadFileTool(backend, options) {
|
|
6659
6780
|
const { customDescription } = options;
|
|
6660
|
-
return
|
|
6781
|
+
return tool42(
|
|
6661
6782
|
async (input, config) => {
|
|
6662
6783
|
const { runConfig } = config.configurable;
|
|
6663
6784
|
const stateAndStore = {
|
|
@@ -6682,7 +6803,7 @@ function createReadFileTool(backend, options) {
|
|
|
6682
6803
|
}
|
|
6683
6804
|
function createWriteFileTool(backend, options) {
|
|
6684
6805
|
const { customDescription } = options;
|
|
6685
|
-
return
|
|
6806
|
+
return tool42(
|
|
6686
6807
|
async (input, config) => {
|
|
6687
6808
|
const { runConfig } = config.configurable;
|
|
6688
6809
|
const stateAndStore = {
|
|
@@ -6721,7 +6842,7 @@ function createWriteFileTool(backend, options) {
|
|
|
6721
6842
|
}
|
|
6722
6843
|
function createEditFileTool(backend, options) {
|
|
6723
6844
|
const { customDescription } = options;
|
|
6724
|
-
return
|
|
6845
|
+
return tool42(
|
|
6725
6846
|
async (input, config) => {
|
|
6726
6847
|
const { runConfig } = config.configurable;
|
|
6727
6848
|
const stateAndStore = {
|
|
@@ -6767,7 +6888,7 @@ function createEditFileTool(backend, options) {
|
|
|
6767
6888
|
}
|
|
6768
6889
|
function createGlobTool(backend, options) {
|
|
6769
6890
|
const { customDescription } = options;
|
|
6770
|
-
return
|
|
6891
|
+
return tool42(
|
|
6771
6892
|
async (input, config) => {
|
|
6772
6893
|
const { runConfig } = config.configurable;
|
|
6773
6894
|
const stateAndStore = {
|
|
@@ -6795,7 +6916,7 @@ function createGlobTool(backend, options) {
|
|
|
6795
6916
|
}
|
|
6796
6917
|
function createGrepTool(backend, options) {
|
|
6797
6918
|
const { customDescription } = options;
|
|
6798
|
-
return
|
|
6919
|
+
return tool42(
|
|
6799
6920
|
async (input, config) => {
|
|
6800
6921
|
const { runConfig } = config.configurable;
|
|
6801
6922
|
const stateAndStore = {
|
|
@@ -6977,7 +7098,10 @@ function createMetricsMiddleware(params) {
|
|
|
6977
7098
|
createListMetricsDataSourcesTool(toolParams),
|
|
6978
7099
|
createQueryMetricsListTool(toolParams),
|
|
6979
7100
|
createQueryMetricDefinitionTool(toolParams),
|
|
6980
|
-
createQuerySemanticMetricDataTool(toolParams)
|
|
7101
|
+
createQuerySemanticMetricDataTool(toolParams),
|
|
7102
|
+
createQueryTablesListTool(toolParams),
|
|
7103
|
+
createQueryTableDefinitionTool(toolParams),
|
|
7104
|
+
createExecuteSqlQueryTool(toolParams)
|
|
6981
7105
|
]
|
|
6982
7106
|
});
|
|
6983
7107
|
}
|
|
@@ -7071,9 +7195,9 @@ var ReActAgentGraphBuilder = class {
|
|
|
7071
7195
|
*/
|
|
7072
7196
|
build(agentLattice, params) {
|
|
7073
7197
|
const tools = params.tools.map((t) => {
|
|
7074
|
-
const
|
|
7075
|
-
return
|
|
7076
|
-
}).filter((
|
|
7198
|
+
const tool47 = getToolClient(t.key);
|
|
7199
|
+
return tool47;
|
|
7200
|
+
}).filter((tool47) => tool47 !== void 0);
|
|
7077
7201
|
const stateSchema2 = createReactAgentSchema(params.stateSchema);
|
|
7078
7202
|
const middlewareConfigs = params.middleware || [];
|
|
7079
7203
|
const filesystemBackend = this.createFilesystemBackendFactory(middlewareConfigs);
|
|
@@ -7099,11 +7223,11 @@ import {
|
|
|
7099
7223
|
} from "langchain";
|
|
7100
7224
|
|
|
7101
7225
|
// src/deep_agent_new/middleware/subagents.ts
|
|
7102
|
-
import { z as
|
|
7226
|
+
import { z as z43 } from "zod/v3";
|
|
7103
7227
|
import {
|
|
7104
7228
|
createMiddleware as createMiddleware7,
|
|
7105
7229
|
createAgent as createAgent2,
|
|
7106
|
-
tool as
|
|
7230
|
+
tool as tool43,
|
|
7107
7231
|
ToolMessage as ToolMessage2,
|
|
7108
7232
|
humanInTheLoopMiddleware
|
|
7109
7233
|
} from "langchain";
|
|
@@ -7747,7 +7871,7 @@ function createTaskTool(options) {
|
|
|
7747
7871
|
generalPurposeAgent
|
|
7748
7872
|
});
|
|
7749
7873
|
const finalTaskDescription = taskDescription ? taskDescription : getTaskToolDescription(subagentDescriptions);
|
|
7750
|
-
return
|
|
7874
|
+
return tool43(
|
|
7751
7875
|
async (input, config) => {
|
|
7752
7876
|
const { description, subagent_type } = input;
|
|
7753
7877
|
try {
|
|
@@ -7790,9 +7914,9 @@ function createTaskTool(options) {
|
|
|
7790
7914
|
{
|
|
7791
7915
|
name: "task",
|
|
7792
7916
|
description: finalTaskDescription,
|
|
7793
|
-
schema:
|
|
7794
|
-
description:
|
|
7795
|
-
subagent_type:
|
|
7917
|
+
schema: z43.object({
|
|
7918
|
+
description: z43.string().describe("The task to execute with the selected agent"),
|
|
7919
|
+
subagent_type: z43.string().describe(
|
|
7796
7920
|
`Name of the agent to use. Available: ${Object.keys(
|
|
7797
7921
|
subagentGraphs
|
|
7798
7922
|
).join(", ")}`
|
|
@@ -8981,8 +9105,8 @@ var MemoryBackend = class {
|
|
|
8981
9105
|
|
|
8982
9106
|
// src/deep_agent_new/middleware/todos.ts
|
|
8983
9107
|
import { Command as Command3 } from "@langchain/langgraph";
|
|
8984
|
-
import { z as
|
|
8985
|
-
import { createMiddleware as createMiddleware9, tool as
|
|
9108
|
+
import { z as z44 } from "zod";
|
|
9109
|
+
import { createMiddleware as createMiddleware9, tool as tool44, ToolMessage as ToolMessage4 } from "langchain";
|
|
8986
9110
|
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.
|
|
8987
9111
|
It also helps the user understand the progress of the task and overall progress of their requests.
|
|
8988
9112
|
Only use this tool if you think it will be helpful in staying organized. If the user's request is trivial and takes less than 3 steps, it is better to NOT use this tool and just do the taks directly.
|
|
@@ -9209,14 +9333,14 @@ Writing todos takes time and tokens, use it when it is helpful for managing comp
|
|
|
9209
9333
|
## Important To-Do List Usage Notes to Remember
|
|
9210
9334
|
- The \`write_todos\` tool should never be called multiple times in parallel.
|
|
9211
9335
|
- 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.`;
|
|
9212
|
-
var TodoStatus =
|
|
9213
|
-
var TodoSchema =
|
|
9214
|
-
content:
|
|
9336
|
+
var TodoStatus = z44.enum(["pending", "in_progress", "completed"]).describe("Status of the todo");
|
|
9337
|
+
var TodoSchema = z44.object({
|
|
9338
|
+
content: z44.string().describe("Content of the todo item"),
|
|
9215
9339
|
status: TodoStatus
|
|
9216
9340
|
});
|
|
9217
|
-
var stateSchema =
|
|
9341
|
+
var stateSchema = z44.object({ todos: z44.array(TodoSchema).default([]) });
|
|
9218
9342
|
function todoListMiddleware(options) {
|
|
9219
|
-
const writeTodos =
|
|
9343
|
+
const writeTodos = tool44(
|
|
9220
9344
|
({ todos }, config) => {
|
|
9221
9345
|
return new Command3({
|
|
9222
9346
|
update: {
|
|
@@ -9233,8 +9357,8 @@ function todoListMiddleware(options) {
|
|
|
9233
9357
|
{
|
|
9234
9358
|
name: "write_todos",
|
|
9235
9359
|
description: options?.toolDescription ?? WRITE_TODOS_DESCRIPTION,
|
|
9236
|
-
schema:
|
|
9237
|
-
todos:
|
|
9360
|
+
schema: z44.object({
|
|
9361
|
+
todos: z44.array(TodoSchema).describe("List of todo items to update")
|
|
9238
9362
|
})
|
|
9239
9363
|
}
|
|
9240
9364
|
);
|
|
@@ -9381,7 +9505,7 @@ var DeepAgentGraphBuilder = class {
|
|
|
9381
9505
|
const tools = params.tools.map((t) => {
|
|
9382
9506
|
const toolClient = getToolClient(t.key);
|
|
9383
9507
|
return toolClient;
|
|
9384
|
-
}).filter((
|
|
9508
|
+
}).filter((tool47) => tool47 !== void 0);
|
|
9385
9509
|
const subagents = params.subAgents.map((sa) => {
|
|
9386
9510
|
if (sa.client) {
|
|
9387
9511
|
return {
|
|
@@ -9419,7 +9543,7 @@ var DeepAgentGraphBuilder = class {
|
|
|
9419
9543
|
};
|
|
9420
9544
|
|
|
9421
9545
|
// src/agent_team/agent_team.ts
|
|
9422
|
-
import { z as
|
|
9546
|
+
import { z as z47 } from "zod/v3";
|
|
9423
9547
|
import { createAgent as createAgent5 } from "langchain";
|
|
9424
9548
|
|
|
9425
9549
|
// src/agent_team/types.ts
|
|
@@ -9855,14 +9979,14 @@ var InMemoryMailboxStore = class {
|
|
|
9855
9979
|
};
|
|
9856
9980
|
|
|
9857
9981
|
// src/agent_team/middleware/team.ts
|
|
9858
|
-
import { z as
|
|
9859
|
-
import { createMiddleware as createMiddleware10, createAgent as createAgent4, tool as
|
|
9982
|
+
import { z as z46 } from "zod/v3";
|
|
9983
|
+
import { createMiddleware as createMiddleware10, createAgent as createAgent4, tool as tool46, ToolMessage as ToolMessage6 } from "langchain";
|
|
9860
9984
|
import { Command as Command5, getCurrentTaskInput as getCurrentTaskInput3 } from "@langchain/langgraph";
|
|
9861
9985
|
import { v4 as uuidv4 } from "uuid";
|
|
9862
9986
|
|
|
9863
9987
|
// src/agent_team/middleware/teammate_tools.ts
|
|
9864
|
-
import { z as
|
|
9865
|
-
import { tool as
|
|
9988
|
+
import { z as z45 } from "zod/v3";
|
|
9989
|
+
import { tool as tool45, ToolMessage as ToolMessage5 } from "langchain";
|
|
9866
9990
|
import { Command as Command4 } from "@langchain/langgraph";
|
|
9867
9991
|
|
|
9868
9992
|
// src/agent_team/middleware/formatMessages.ts
|
|
@@ -9887,7 +10011,7 @@ ${meta}${body}`;
|
|
|
9887
10011
|
// src/agent_team/middleware/teammate_tools.ts
|
|
9888
10012
|
function createTeammateTools(options) {
|
|
9889
10013
|
const { teamId, agentId, taskListStore, mailboxStore } = options;
|
|
9890
|
-
const claimTaskTool =
|
|
10014
|
+
const claimTaskTool = tool45(
|
|
9891
10015
|
async (input) => {
|
|
9892
10016
|
const task = await taskListStore.claimTaskById(
|
|
9893
10017
|
teamId,
|
|
@@ -9912,12 +10036,12 @@ function createTeammateTools(options) {
|
|
|
9912
10036
|
{
|
|
9913
10037
|
name: "claim_task",
|
|
9914
10038
|
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.",
|
|
9915
|
-
schema:
|
|
9916
|
-
task_id:
|
|
10039
|
+
schema: z45.object({
|
|
10040
|
+
task_id: z45.string().describe("ID of the task to claim (e.g. task-01). Use check_tasks to see IDs.")
|
|
9917
10041
|
})
|
|
9918
10042
|
}
|
|
9919
10043
|
);
|
|
9920
|
-
const completeTaskTool =
|
|
10044
|
+
const completeTaskTool = tool45(
|
|
9921
10045
|
async (input) => {
|
|
9922
10046
|
const task = await taskListStore.completeTask(
|
|
9923
10047
|
teamId,
|
|
@@ -9938,13 +10062,13 @@ function createTeammateTools(options) {
|
|
|
9938
10062
|
{
|
|
9939
10063
|
name: "complete_task",
|
|
9940
10064
|
description: "Mark a claimed task as completed with a result summary. Call this after you have finished working on a task.",
|
|
9941
|
-
schema:
|
|
9942
|
-
task_id:
|
|
9943
|
-
result:
|
|
10065
|
+
schema: z45.object({
|
|
10066
|
+
task_id: z45.string().describe("ID of the task to complete"),
|
|
10067
|
+
result: z45.string().describe("Summary of the task result")
|
|
9944
10068
|
})
|
|
9945
10069
|
}
|
|
9946
10070
|
);
|
|
9947
|
-
const failTaskTool =
|
|
10071
|
+
const failTaskTool = tool45(
|
|
9948
10072
|
async (input) => {
|
|
9949
10073
|
const task = await taskListStore.failTask(
|
|
9950
10074
|
teamId,
|
|
@@ -9965,13 +10089,13 @@ function createTeammateTools(options) {
|
|
|
9965
10089
|
{
|
|
9966
10090
|
name: "fail_task",
|
|
9967
10091
|
description: "Mark a claimed task as failed with an error description. Call this if you cannot complete the task.",
|
|
9968
|
-
schema:
|
|
9969
|
-
task_id:
|
|
9970
|
-
error:
|
|
10092
|
+
schema: z45.object({
|
|
10093
|
+
task_id: z45.string().describe("ID of the task to fail"),
|
|
10094
|
+
error: z45.string().describe("Description of why the task failed")
|
|
9971
10095
|
})
|
|
9972
10096
|
}
|
|
9973
10097
|
);
|
|
9974
|
-
const sendMessageTool =
|
|
10098
|
+
const sendMessageTool = tool45(
|
|
9975
10099
|
async (input) => {
|
|
9976
10100
|
await mailboxStore.sendMessage(
|
|
9977
10101
|
teamId,
|
|
@@ -9985,11 +10109,11 @@ function createTeammateTools(options) {
|
|
|
9985
10109
|
{
|
|
9986
10110
|
name: "send_message",
|
|
9987
10111
|
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.',
|
|
9988
|
-
schema:
|
|
9989
|
-
to:
|
|
10112
|
+
schema: z45.object({
|
|
10113
|
+
to: z45.string().describe(
|
|
9990
10114
|
'Recipient agent name (e.g. "team_lead" or a teammate name)'
|
|
9991
10115
|
),
|
|
9992
|
-
content:
|
|
10116
|
+
content: z45.string().describe("Message content")
|
|
9993
10117
|
})
|
|
9994
10118
|
}
|
|
9995
10119
|
);
|
|
@@ -10009,7 +10133,7 @@ function createTeammateTools(options) {
|
|
|
10009
10133
|
read: msg.read
|
|
10010
10134
|
}));
|
|
10011
10135
|
};
|
|
10012
|
-
const readMessagesTool =
|
|
10136
|
+
const readMessagesTool = tool45(
|
|
10013
10137
|
async (input, config) => {
|
|
10014
10138
|
const formatAndMarkAsRead = async (msgs2) => {
|
|
10015
10139
|
for (const msg of msgs2) {
|
|
@@ -10068,10 +10192,10 @@ function createTeammateTools(options) {
|
|
|
10068
10192
|
{
|
|
10069
10193
|
name: "read_messages",
|
|
10070
10194
|
description: "Read unread messages from the mailbox. Returns immediately if messages exist, otherwise waits for up to 3 minutes for new messages.",
|
|
10071
|
-
schema:
|
|
10195
|
+
schema: z45.object({})
|
|
10072
10196
|
}
|
|
10073
10197
|
);
|
|
10074
|
-
const checkTasksTool =
|
|
10198
|
+
const checkTasksTool = tool45(
|
|
10075
10199
|
async () => {
|
|
10076
10200
|
const tasks = await taskListStore.getAllTasks(teamId);
|
|
10077
10201
|
return formatTaskSummary(tasks);
|
|
@@ -10079,10 +10203,10 @@ function createTeammateTools(options) {
|
|
|
10079
10203
|
{
|
|
10080
10204
|
name: "check_tasks",
|
|
10081
10205
|
description: "Use this tool to get the current status of all tasks in a team. This is your primary way to monitor task progress.",
|
|
10082
|
-
schema:
|
|
10206
|
+
schema: z45.object({})
|
|
10083
10207
|
}
|
|
10084
10208
|
);
|
|
10085
|
-
const broadcastMessageTool =
|
|
10209
|
+
const broadcastMessageTool = tool45(
|
|
10086
10210
|
async (input) => {
|
|
10087
10211
|
const allAgents = await mailboxStore.getRegisteredAgents(teamId);
|
|
10088
10212
|
const recipients = allAgents.filter((a) => a !== agentId);
|
|
@@ -10101,8 +10225,8 @@ function createTeammateTools(options) {
|
|
|
10101
10225
|
{
|
|
10102
10226
|
name: "broadcast_message",
|
|
10103
10227
|
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.",
|
|
10104
|
-
schema:
|
|
10105
|
-
content:
|
|
10228
|
+
schema: z45.object({
|
|
10229
|
+
content: z45.string().describe("Message content to broadcast to others")
|
|
10106
10230
|
})
|
|
10107
10231
|
}
|
|
10108
10232
|
);
|
|
@@ -10325,7 +10449,7 @@ async function spawnTeammate(options) {
|
|
|
10325
10449
|
function createTeamMiddleware(options) {
|
|
10326
10450
|
const { teamConfig, taskListStore, mailboxStore } = options;
|
|
10327
10451
|
const defaultModel = teamConfig.model ?? "claude-sonnet-4-5-20250929";
|
|
10328
|
-
const createTeamTool =
|
|
10452
|
+
const createTeamTool = tool46(
|
|
10329
10453
|
async (input, config) => {
|
|
10330
10454
|
const state = getCurrentTaskInput3();
|
|
10331
10455
|
if (state?.team?.teamId) {
|
|
@@ -10476,20 +10600,20 @@ After calling create_team, you MUST:
|
|
|
10476
10600
|
2. When messages indicate task changes, call check_tasks to get full task status
|
|
10477
10601
|
3. Continue until all tasks show "completed" or "failed"
|
|
10478
10602
|
4. Do NOT assume tasks are done - always verify with check_tasks`,
|
|
10479
|
-
schema:
|
|
10480
|
-
tasks:
|
|
10481
|
-
|
|
10482
|
-
id:
|
|
10483
|
-
title:
|
|
10484
|
-
description:
|
|
10485
|
-
dependencies:
|
|
10603
|
+
schema: z46.object({
|
|
10604
|
+
tasks: z46.array(
|
|
10605
|
+
z46.object({
|
|
10606
|
+
id: z46.string().describe("Task ID in format task-01, task-02, etc."),
|
|
10607
|
+
title: z46.string().describe("Short task title"),
|
|
10608
|
+
description: z46.string().describe("Detailed task description - what exactly needs to be done"),
|
|
10609
|
+
dependencies: z46.array(z46.string()).optional().default([]).describe('Array of task IDs that must complete before this task (e.g. ["task-01"])')
|
|
10486
10610
|
})
|
|
10487
10611
|
).describe("List of tasks for teammates to work on. Each task needs unique ID (task-01, task-02, etc.)."),
|
|
10488
|
-
teammates:
|
|
10489
|
-
|
|
10490
|
-
name:
|
|
10491
|
-
role:
|
|
10492
|
-
description:
|
|
10612
|
+
teammates: z46.array(
|
|
10613
|
+
z46.object({
|
|
10614
|
+
name: z46.string().describe("Teammate name (must match a pre-configured teammate type)"),
|
|
10615
|
+
role: z46.string().describe("Role category (e.g. researcher, writer, coder, reviewer)"),
|
|
10616
|
+
description: z46.string().describe("What this teammate will focus on - specific instructions for their work")
|
|
10493
10617
|
})
|
|
10494
10618
|
).describe("Teammate agents to create. Each should have a clear role and focus.")
|
|
10495
10619
|
})
|
|
@@ -10500,7 +10624,7 @@ After calling create_team, you MUST:
|
|
|
10500
10624
|
if (state?.team?.teamId) return state.team.teamId;
|
|
10501
10625
|
throw new Error("No team_id provided and no team in state. Call create_team first.");
|
|
10502
10626
|
};
|
|
10503
|
-
const addTasksTool =
|
|
10627
|
+
const addTasksTool = tool46(
|
|
10504
10628
|
async (input, config) => {
|
|
10505
10629
|
const teamId = resolveTeamId();
|
|
10506
10630
|
const created = await taskListStore.addTasks(
|
|
@@ -10552,20 +10676,20 @@ IMPORTANT: Dependencies
|
|
|
10552
10676
|
|
|
10553
10677
|
IMPORTANT: Assigning to a specific teammate
|
|
10554
10678
|
- 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.`,
|
|
10555
|
-
schema:
|
|
10556
|
-
tasks:
|
|
10557
|
-
|
|
10558
|
-
id:
|
|
10559
|
-
title:
|
|
10560
|
-
description:
|
|
10561
|
-
assignee:
|
|
10562
|
-
dependencies:
|
|
10679
|
+
schema: z46.object({
|
|
10680
|
+
tasks: z46.array(
|
|
10681
|
+
z46.object({
|
|
10682
|
+
id: z46.string().describe("Task ID in format task-01, task-02, etc. Must be unique."),
|
|
10683
|
+
title: z46.string().describe("Short task title"),
|
|
10684
|
+
description: z46.string().describe("Detailed task description - what needs to be done"),
|
|
10685
|
+
assignee: z46.string().optional().describe("Teammate name to assign this task to (use when you need that person to do the work)"),
|
|
10686
|
+
dependencies: z46.array(z46.string()).optional().default([]).describe("Array of task IDs that must complete before this task")
|
|
10563
10687
|
})
|
|
10564
10688
|
).describe("New tasks to add to the team")
|
|
10565
10689
|
})
|
|
10566
10690
|
}
|
|
10567
10691
|
);
|
|
10568
|
-
const assignTaskTool =
|
|
10692
|
+
const assignTaskTool = tool46(
|
|
10569
10693
|
async (input, config) => {
|
|
10570
10694
|
const teamId = resolveTeamId();
|
|
10571
10695
|
const task = await taskListStore.updateTask(teamId, input.task_id, {
|
|
@@ -10587,13 +10711,13 @@ IMPORTANT: Assigning to a specific teammate
|
|
|
10587
10711
|
{
|
|
10588
10712
|
name: "assign_task",
|
|
10589
10713
|
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.",
|
|
10590
|
-
schema:
|
|
10591
|
-
task_id:
|
|
10592
|
-
assignee:
|
|
10714
|
+
schema: z46.object({
|
|
10715
|
+
task_id: z46.string().describe("Task ID to assign"),
|
|
10716
|
+
assignee: z46.string().describe("Teammate name to assign this task to")
|
|
10593
10717
|
})
|
|
10594
10718
|
}
|
|
10595
10719
|
);
|
|
10596
|
-
const setTaskStatusTool =
|
|
10720
|
+
const setTaskStatusTool = tool46(
|
|
10597
10721
|
async (input, config) => {
|
|
10598
10722
|
const teamId = resolveTeamId();
|
|
10599
10723
|
const task = await taskListStore.updateTask(teamId, input.task_id, {
|
|
@@ -10615,13 +10739,13 @@ IMPORTANT: Assigning to a specific teammate
|
|
|
10615
10739
|
{
|
|
10616
10740
|
name: "set_task_status",
|
|
10617
10741
|
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.",
|
|
10618
|
-
schema:
|
|
10619
|
-
task_id:
|
|
10620
|
-
status:
|
|
10742
|
+
schema: z46.object({
|
|
10743
|
+
task_id: z46.string().describe("Task ID to update"),
|
|
10744
|
+
status: z46.enum(["pending", "claimed", "in_progress", "completed", "failed"]).describe("New status for the task")
|
|
10621
10745
|
})
|
|
10622
10746
|
}
|
|
10623
10747
|
);
|
|
10624
|
-
const setTaskDependenciesTool =
|
|
10748
|
+
const setTaskDependenciesTool = tool46(
|
|
10625
10749
|
async (input, config) => {
|
|
10626
10750
|
const teamId = resolveTeamId();
|
|
10627
10751
|
const task = await taskListStore.updateTask(teamId, input.task_id, {
|
|
@@ -10643,13 +10767,13 @@ IMPORTANT: Assigning to a specific teammate
|
|
|
10643
10767
|
{
|
|
10644
10768
|
name: "set_task_dependencies",
|
|
10645
10769
|
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.',
|
|
10646
|
-
schema:
|
|
10647
|
-
task_id:
|
|
10648
|
-
dependencies:
|
|
10770
|
+
schema: z46.object({
|
|
10771
|
+
task_id: z46.string().describe("Task ID to update"),
|
|
10772
|
+
dependencies: z46.array(z46.string()).describe("Task IDs that must complete before this task can be claimed")
|
|
10649
10773
|
})
|
|
10650
10774
|
}
|
|
10651
10775
|
);
|
|
10652
|
-
const checkTasksTool =
|
|
10776
|
+
const checkTasksTool = tool46(
|
|
10653
10777
|
async (input, config) => {
|
|
10654
10778
|
const teamId = resolveTeamId();
|
|
10655
10779
|
const tasks = await taskListStore.getAllTasks(teamId);
|
|
@@ -10689,12 +10813,12 @@ Task Status Values:
|
|
|
10689
10813
|
- in_progress: Teammate is actively working on this task
|
|
10690
10814
|
- completed: Task finished successfully
|
|
10691
10815
|
- failed: Task encountered an error`,
|
|
10692
|
-
schema:
|
|
10693
|
-
team_id:
|
|
10816
|
+
schema: z46.object({
|
|
10817
|
+
team_id: z46.string().optional().describe("Team ID (omit to use active team)")
|
|
10694
10818
|
})
|
|
10695
10819
|
}
|
|
10696
10820
|
);
|
|
10697
|
-
const sendMessageTool =
|
|
10821
|
+
const sendMessageTool = tool46(
|
|
10698
10822
|
async (input, config) => {
|
|
10699
10823
|
const teamId = resolveTeamId();
|
|
10700
10824
|
await mailboxStore.sendMessage(
|
|
@@ -10713,13 +10837,13 @@ Task Status Values:
|
|
|
10713
10837
|
{
|
|
10714
10838
|
name: "send_message",
|
|
10715
10839
|
description: "Send a message to a specific teammate in the team. Omit team_id to use the active team from state.",
|
|
10716
|
-
schema:
|
|
10717
|
-
to:
|
|
10718
|
-
content:
|
|
10840
|
+
schema: z46.object({
|
|
10841
|
+
to: z46.string().describe("Recipient teammate name"),
|
|
10842
|
+
content: z46.string().describe("Message content")
|
|
10719
10843
|
})
|
|
10720
10844
|
}
|
|
10721
10845
|
);
|
|
10722
|
-
const readMessagesTool =
|
|
10846
|
+
const readMessagesTool = tool46(
|
|
10723
10847
|
async (input, config) => {
|
|
10724
10848
|
const teamId = resolveTeamId();
|
|
10725
10849
|
const formatAndMarkAsRead = async (msgs2) => {
|
|
@@ -10801,12 +10925,12 @@ Task Status Values:
|
|
|
10801
10925
|
{
|
|
10802
10926
|
name: "read_messages",
|
|
10803
10927
|
description: "Read unread messages from teammates. Returns immediately if messages exist, otherwise waits for up to 3 minutes for new messages.",
|
|
10804
|
-
schema:
|
|
10805
|
-
team_id:
|
|
10928
|
+
schema: z46.object({
|
|
10929
|
+
team_id: z46.string().optional().describe("Team ID (omit to use active team)")
|
|
10806
10930
|
})
|
|
10807
10931
|
}
|
|
10808
10932
|
);
|
|
10809
|
-
const disbandTeamTool =
|
|
10933
|
+
const disbandTeamTool = tool46(
|
|
10810
10934
|
async (input, config) => {
|
|
10811
10935
|
const teamId = resolveTeamId();
|
|
10812
10936
|
await mailboxStore.broadcastMessage(
|
|
@@ -10827,7 +10951,7 @@ Task Status Values:
|
|
|
10827
10951
|
description: "Disband a team when all work is done. Before calling: (1) Call check_tasks to verify no tasks are still pending/in_progress; (2) if any are, discuss with the team via read_messages and broadcast_message/send_message whether to continue or stop/cancel them; (3) only after alignment (all tasks completed/failed or explicitly stopped), then call this tool. This will: 1) Send a shutdown message to all teammates, 2) Wait briefly for them to clean up, 3) Clear all tasks and messages. Omit team_id to use the active team from state."
|
|
10828
10952
|
}
|
|
10829
10953
|
);
|
|
10830
|
-
const broadcastMessageTool =
|
|
10954
|
+
const broadcastMessageTool = tool46(
|
|
10831
10955
|
async (input, config) => {
|
|
10832
10956
|
const teamId = resolveTeamId();
|
|
10833
10957
|
await mailboxStore.broadcastMessage(
|
|
@@ -10845,8 +10969,8 @@ Task Status Values:
|
|
|
10845
10969
|
{
|
|
10846
10970
|
name: "broadcast_message",
|
|
10847
10971
|
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.",
|
|
10848
|
-
schema:
|
|
10849
|
-
content:
|
|
10972
|
+
schema: z46.object({
|
|
10973
|
+
content: z46.string().describe("Message content to broadcast to all teammates")
|
|
10850
10974
|
})
|
|
10851
10975
|
}
|
|
10852
10976
|
);
|
|
@@ -10878,37 +11002,37 @@ ${TEAM_SYSTEM_PROMPT}` : TEAM_SYSTEM_PROMPT;
|
|
|
10878
11002
|
}
|
|
10879
11003
|
|
|
10880
11004
|
// src/agent_team/agent_team.ts
|
|
10881
|
-
var TeammateInfoSchema =
|
|
10882
|
-
name:
|
|
10883
|
-
role:
|
|
10884
|
-
description:
|
|
11005
|
+
var TeammateInfoSchema = z47.object({
|
|
11006
|
+
name: z47.string().describe("Teammate name"),
|
|
11007
|
+
role: z47.string().describe("Role category (e.g. research, writing, review)"),
|
|
11008
|
+
description: z47.string().describe("What this teammate focuses on")
|
|
10885
11009
|
});
|
|
10886
|
-
var TeamTaskInfoSchema =
|
|
10887
|
-
id:
|
|
10888
|
-
title:
|
|
10889
|
-
description:
|
|
10890
|
-
status:
|
|
11010
|
+
var TeamTaskInfoSchema = z47.object({
|
|
11011
|
+
id: z47.string(),
|
|
11012
|
+
title: z47.string(),
|
|
11013
|
+
description: z47.string(),
|
|
11014
|
+
status: z47.string().optional()
|
|
10891
11015
|
});
|
|
10892
|
-
var MailboxMessageSchema =
|
|
10893
|
-
id:
|
|
10894
|
-
from:
|
|
10895
|
-
to:
|
|
10896
|
-
content:
|
|
10897
|
-
timestamp:
|
|
10898
|
-
type:
|
|
10899
|
-
read:
|
|
11016
|
+
var MailboxMessageSchema = z47.object({
|
|
11017
|
+
id: z47.string().describe("Unique message identifier"),
|
|
11018
|
+
from: z47.string().describe("Sender agent name"),
|
|
11019
|
+
to: z47.string().describe("Recipient agent name"),
|
|
11020
|
+
content: z47.string().describe("Message content"),
|
|
11021
|
+
timestamp: z47.string().describe("ISO timestamp when the message was sent"),
|
|
11022
|
+
type: z47.nativeEnum(MessageType).describe("Message type"),
|
|
11023
|
+
read: z47.boolean().describe("Whether the recipient has read this message")
|
|
10900
11024
|
});
|
|
10901
|
-
var TeamInfoSchema =
|
|
10902
|
-
teamId:
|
|
10903
|
-
teamLeadId:
|
|
10904
|
-
teammates:
|
|
10905
|
-
tasks:
|
|
10906
|
-
createdAt:
|
|
11025
|
+
var TeamInfoSchema = z47.object({
|
|
11026
|
+
teamId: z47.string().describe("Unique team identifier"),
|
|
11027
|
+
teamLeadId: z47.string().default("team_lead").describe("Team lead agent ID"),
|
|
11028
|
+
teammates: z47.array(TeammateInfoSchema).describe("Active teammates in this team"),
|
|
11029
|
+
tasks: z47.array(TeamTaskInfoSchema).optional().describe("Initial tasks snapshot"),
|
|
11030
|
+
createdAt: z47.string().optional().describe("ISO timestamp when team was created")
|
|
10907
11031
|
});
|
|
10908
|
-
var TEAM_STATE_SCHEMA =
|
|
11032
|
+
var TEAM_STATE_SCHEMA = z47.object({
|
|
10909
11033
|
team: TeamInfoSchema.optional().describe("Team info: teamId, teamLeadId, teammates, tasks. Set when create_team succeeds."),
|
|
10910
|
-
tasks:
|
|
10911
|
-
team_mailbox:
|
|
11034
|
+
tasks: z47.array(TeamTaskInfoSchema).optional().describe("Current tasks snapshot from check_tasks. Updated on each check."),
|
|
11035
|
+
team_mailbox: z47.array(MailboxMessageSchema).optional().describe("All team mailbox messages for display")
|
|
10912
11036
|
});
|
|
10913
11037
|
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:
|
|
10914
11038
|
|
|
@@ -10988,7 +11112,7 @@ var TeamAgentGraphBuilder = class {
|
|
|
10988
11112
|
const tools = params.tools.map((t) => {
|
|
10989
11113
|
const toolClient = getToolClient(t.key);
|
|
10990
11114
|
return toolClient;
|
|
10991
|
-
}).filter((
|
|
11115
|
+
}).filter((tool47) => tool47 !== void 0);
|
|
10992
11116
|
const teammates = params.subAgents.map((sa) => {
|
|
10993
11117
|
const baseConfig = sa.config;
|
|
10994
11118
|
return {
|
|
@@ -13665,10 +13789,10 @@ var McpLatticeManager = class _McpLatticeManager extends BaseLatticeManager {
|
|
|
13665
13789
|
}
|
|
13666
13790
|
const tools = await this.getAllTools();
|
|
13667
13791
|
console.log(`[MCP] Registering ${tools.length} tools to Tool Lattice...`);
|
|
13668
|
-
for (const
|
|
13669
|
-
const toolKey = prefix ? `${prefix}_${
|
|
13670
|
-
|
|
13671
|
-
toolLatticeManager.registerExistingTool(toolKey,
|
|
13792
|
+
for (const tool47 of tools) {
|
|
13793
|
+
const toolKey = prefix ? `${prefix}_${tool47.name}` : tool47.name;
|
|
13794
|
+
tool47.name = toolKey;
|
|
13795
|
+
toolLatticeManager.registerExistingTool(toolKey, tool47);
|
|
13672
13796
|
console.log(`[MCP] Registered tool: ${toolKey}`);
|
|
13673
13797
|
}
|
|
13674
13798
|
console.log(`[MCP] Successfully registered ${tools.length} tools to Tool Lattice`);
|
|
@@ -13806,6 +13930,7 @@ export {
|
|
|
13806
13930
|
checkEmptyContent,
|
|
13807
13931
|
clearEncryptionKeyCache,
|
|
13808
13932
|
createAgentTeam,
|
|
13933
|
+
createExecuteSqlQueryTool,
|
|
13809
13934
|
createFileData,
|
|
13810
13935
|
createInfoSqlTool,
|
|
13811
13936
|
createListMetricsDataSourcesTool,
|