titan-agent 6.4.3 → 6.5.0
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/agent/agent.js +61 -46
- package/dist/agent/agent.js.map +1 -1
- package/dist/agent/agentLessons.js.map +1 -1
- package/dist/agent/agentLoop.js +5 -1
- package/dist/agent/agentLoop.js.map +1 -1
- package/dist/agent/orchestrator.js +5 -14
- package/dist/agent/orchestrator.js.map +1 -1
- package/dist/agent/pipeline.js +11 -6
- package/dist/agent/pipeline.js.map +1 -1
- package/dist/agent/somaInitiative.js.map +1 -1
- package/dist/agent/toolRunner.js +35 -0
- package/dist/agent/toolRunner.js.map +1 -1
- package/dist/channels/discord.js +10 -6
- package/dist/channels/discord.js.map +1 -1
- package/dist/channels/slack.js +7 -2
- package/dist/channels/slack.js.map +1 -1
- package/dist/channels/telegram.js +1 -1
- package/dist/channels/telegram.js.map +1 -1
- package/dist/config/schema.js +6 -0
- package/dist/config/schema.js.map +1 -1
- package/dist/gateway/openai-compat.js +69 -10
- package/dist/gateway/openai-compat.js.map +1 -1
- package/dist/gateway/server.js +79 -0
- package/dist/gateway/server.js.map +1 -1
- package/dist/migrations/runner.js.map +1 -1
- package/dist/migrations/safeRun.js.map +1 -1
- package/dist/providers/anthropic.js +7 -4
- package/dist/providers/anthropic.js.map +1 -1
- package/dist/providers/base.js +8 -1
- package/dist/providers/base.js.map +1 -1
- package/dist/providers/google.js +7 -4
- package/dist/providers/google.js.map +1 -1
- package/dist/providers/ollama.js +8 -7
- package/dist/providers/ollama.js.map +1 -1
- package/dist/providers/openai.js +7 -4
- package/dist/providers/openai.js.map +1 -1
- package/dist/providers/openai_compat.js +7 -4
- package/dist/providers/openai_compat.js.map +1 -1
- package/dist/providers/router.js +7 -3
- package/dist/providers/router.js.map +1 -1
- package/dist/skills/builtin/backup.js.map +1 -1
- package/dist/skills/builtin/browser.js +11 -21
- package/dist/skills/builtin/browser.js.map +1 -1
- package/dist/skills/builtin/calendar.js +6 -2
- package/dist/skills/builtin/calendar.js.map +1 -1
- package/dist/skills/builtin/canvas_spaces.js.map +1 -1
- package/dist/skills/builtin/cron.js +7 -6
- package/dist/skills/builtin/cron.js.map +1 -1
- package/dist/skills/builtin/data_analysis.js +1 -1
- package/dist/skills/builtin/data_analysis.js.map +1 -1
- package/dist/skills/builtin/jira_linear.js +6 -4
- package/dist/skills/builtin/jira_linear.js.map +1 -1
- package/dist/skills/builtin/web_browser.js +6 -0
- package/dist/skills/builtin/web_browser.js.map +1 -1
- package/dist/skills/builtin/web_fetch.js +1 -0
- package/dist/skills/builtin/web_fetch.js.map +1 -1
- package/dist/storage/starterSpaces.js.map +1 -1
- package/dist/utils/constants.js +1 -1
- package/dist/utils/constants.js.map +1 -1
- package/package.json +1 -1
- package/ui/dist/sw.js +1 -1
package/dist/agent/agent.js
CHANGED
|
@@ -1278,66 +1278,81 @@ CRITICAL: Widgets are NOT files. Do NOT use write_file, edit_file, or any file t
|
|
|
1278
1278
|
}
|
|
1279
1279
|
modelUsed = activeModel;
|
|
1280
1280
|
let activeTools = tools;
|
|
1281
|
-
|
|
1282
|
-
|
|
1281
|
+
let allToolsBackup = activeTools;
|
|
1282
|
+
let toolSearchEnabled = true;
|
|
1283
|
+
const explicitAllowList = overrides?.allowedTools;
|
|
1284
|
+
if (explicitAllowList && explicitAllowList.length > 0) {
|
|
1285
|
+
const allow = new Set(explicitAllowList);
|
|
1283
1286
|
const before = activeTools.length;
|
|
1284
|
-
activeTools =
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
+
activeTools = tools.filter((t) => allow.has(t.function.name));
|
|
1288
|
+
allToolsBackup = activeTools;
|
|
1289
|
+
logger.info(COMPONENT, `[AllowedTools] override bound ${activeTools.length}/${explicitAllowList.length} requested tools (filter chain bypassed): [${activeTools.map((t) => t.function.name).join(", ")}] from pool of ${before}`);
|
|
1290
|
+
const missing = explicitAllowList.filter((name) => !activeTools.some((t) => t.function.name === name));
|
|
1291
|
+
if (missing.length > 0) {
|
|
1292
|
+
logger.warn(COMPONENT, `[AllowedTools] caller asked for tools that aren't registered: [${missing.join(", ")}]`);
|
|
1287
1293
|
}
|
|
1288
|
-
}
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
}
|
|
1297
|
-
if (!voiceFastPath && !isSmallModel && isBrainAvailable()) {
|
|
1298
|
-
const brainFiltered = await brainSelectTools(message, activeTools);
|
|
1299
|
-
if (brainFiltered.length > 0 && brainFiltered.length < activeTools.length) {
|
|
1300
|
-
logger.info(COMPONENT, `[Brain] Filtered: ${activeTools.length} \u2192 ${brainFiltered.length} tools`);
|
|
1301
|
-
activeTools = brainFiltered;
|
|
1294
|
+
} else {
|
|
1295
|
+
if (earlyPersona) {
|
|
1296
|
+
const { applyPersonaToolFilter } = await import("./personaProfiles.js");
|
|
1297
|
+
const before = activeTools.length;
|
|
1298
|
+
activeTools = applyPersonaToolFilter(activeTools, earlyPersona);
|
|
1299
|
+
if (activeTools.length !== before) {
|
|
1300
|
+
logger.info(COMPONENT, `[Persona:${earlyPersona.id}] tools ${before} \u2192 ${activeTools.length}`);
|
|
1301
|
+
}
|
|
1302
1302
|
}
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
activeTools
|
|
1313
|
-
if (
|
|
1314
|
-
logger.info(COMPONENT, `[
|
|
1303
|
+
const SMALL_MODEL_PATTERNS = ["llama3.2", "llama3.1:8b", "phi", "gemma:2b", "qwen3.5:4b", "tinyllama", "dolphin3"];
|
|
1304
|
+
const isSmallModel = SMALL_MODEL_PATTERNS.some((p) => activeModel.toLowerCase().includes(p));
|
|
1305
|
+
if (isSmallModel) {
|
|
1306
|
+
const CORE_TOOL_NAMES = ["shell", "read_file", "write_file", "edit_file", "list_dir", "memory"];
|
|
1307
|
+
const coreTools = activeTools.filter((t) => CORE_TOOL_NAMES.includes(t.function.name));
|
|
1308
|
+
logger.info(COMPONENT, `[SmallModel] Reducing tools from ${activeTools.length} to ${coreTools.length} for ${activeModel}`);
|
|
1309
|
+
activeTools = coreTools;
|
|
1310
|
+
}
|
|
1311
|
+
if (!voiceFastPath && !isSmallModel && isBrainAvailable()) {
|
|
1312
|
+
const brainFiltered = await brainSelectTools(message, activeTools);
|
|
1313
|
+
if (brainFiltered.length > 0 && brainFiltered.length < activeTools.length) {
|
|
1314
|
+
logger.info(COMPONENT, `[Brain] Filtered: ${activeTools.length} \u2192 ${brainFiltered.length} tools`);
|
|
1315
|
+
activeTools = brainFiltered;
|
|
1315
1316
|
}
|
|
1316
1317
|
}
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
const effectiveCoreTools = configCoreTools && configCoreTools.length > 0 ? configCoreTools : DEFAULT_CORE_TOOLS;
|
|
1322
|
-
const pipelineMerged = pipelineEnsureTools.length > 0 ? [.../* @__PURE__ */ new Set([...effectiveCoreTools, ...pipelineEnsureTools])] : effectiveCoreTools;
|
|
1323
|
-
const coreNames = new Set(voiceFastPath ? VOICE_CORE_TOOLS : pipelineMerged);
|
|
1324
|
-
activeTools = activeTools.filter((t) => coreNames.has(t.function.name));
|
|
1325
|
-
if (pipelineEnsureTools.length > 0) {
|
|
1318
|
+
const toolSearchConfig = config.toolSearch;
|
|
1319
|
+
toolSearchEnabled = toolSearchConfig?.enabled ?? true;
|
|
1320
|
+
allToolsBackup = activeTools;
|
|
1321
|
+
if (pipelineEnsureTools.length > 0 && !(toolSearchEnabled && !isSmallModel && activeTools.length > 12)) {
|
|
1326
1322
|
const activeNames = new Set(activeTools.map((t) => t.function.name));
|
|
1327
1323
|
const missing = pipelineEnsureTools.filter((name) => !activeNames.has(name));
|
|
1328
1324
|
if (missing.length > 0) {
|
|
1329
1325
|
const rescued = allToolsBackup.filter((t) => missing.includes(t.function.name));
|
|
1330
1326
|
activeTools.push(...rescued);
|
|
1331
1327
|
if (rescued.length > 0) {
|
|
1332
|
-
logger.info(COMPONENT, `[Pipeline:${pipelineType}]
|
|
1328
|
+
logger.info(COMPONENT, `[Pipeline:${pipelineType}] Ensured ${rescued.length} tools (no-compact): [${rescued.map((t) => t.function.name).join(", ")}]`);
|
|
1333
1329
|
}
|
|
1334
1330
|
}
|
|
1335
1331
|
}
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1332
|
+
if (toolSearchEnabled && !isSmallModel && activeTools.length > 12) {
|
|
1333
|
+
const VOICE_CORE_TOOLS = ["shell", "web_search", "weather", "memory", "ha_control", "ha_devices", "ha_status", "ha_setup", "tool_search"];
|
|
1334
|
+
const configCoreTools = toolSearchConfig?.coreTools;
|
|
1335
|
+
const effectiveCoreTools = configCoreTools && configCoreTools.length > 0 ? configCoreTools : DEFAULT_CORE_TOOLS;
|
|
1336
|
+
const pipelineMerged = pipelineEnsureTools.length > 0 ? [.../* @__PURE__ */ new Set([...effectiveCoreTools, ...pipelineEnsureTools])] : effectiveCoreTools;
|
|
1337
|
+
const coreNames = new Set(voiceFastPath ? VOICE_CORE_TOOLS : pipelineMerged);
|
|
1338
|
+
activeTools = activeTools.filter((t) => coreNames.has(t.function.name));
|
|
1339
|
+
if (pipelineEnsureTools.length > 0) {
|
|
1340
|
+
const activeNames = new Set(activeTools.map((t) => t.function.name));
|
|
1341
|
+
const missing = pipelineEnsureTools.filter((name) => !activeNames.has(name));
|
|
1342
|
+
if (missing.length > 0) {
|
|
1343
|
+
const rescued = allToolsBackup.filter((t) => missing.includes(t.function.name));
|
|
1344
|
+
activeTools.push(...rescued);
|
|
1345
|
+
if (rescued.length > 0) {
|
|
1346
|
+
logger.info(COMPONENT, `[Pipeline:${pipelineType}] Rescued ${rescued.length} tools: [${rescued.map((t) => t.function.name).join(", ")}]`);
|
|
1347
|
+
}
|
|
1348
|
+
}
|
|
1349
|
+
}
|
|
1350
|
+
logger.info(COMPONENT, `[ToolSearch] Compact mode: ${allToolsBackup.length} \u2192 ${activeTools.length} tools (${allToolsBackup.length - activeTools.length} discoverable via tool_search)`);
|
|
1351
|
+
}
|
|
1352
|
+
if (dangerous) {
|
|
1353
|
+
activeTools = [];
|
|
1354
|
+
logger.info(COMPONENT, "[Safety] Stripped all tools \u2014 dangerous command detected");
|
|
1355
|
+
}
|
|
1341
1356
|
}
|
|
1342
1357
|
setAutonomousMode(isAutonomous);
|
|
1343
1358
|
heartbeat(session.id);
|