titan-agent 2026.6.2 → 2026.6.4
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 +24 -16
- package/dist/agent/agent.js.map +1 -1
- package/dist/agent/generator.js +1 -1
- package/dist/agent/generator.js.map +1 -1
- package/dist/agent/sandbox.js +1 -1
- package/dist/agent/sandbox.js.map +1 -1
- package/dist/cli/index.js +24 -16
- package/dist/cli/index.js.map +1 -1
- package/dist/gateway/server.js +24 -16
- package/dist/gateway/server.js.map +1 -1
- package/dist/skills/builtin/apply_patch.js +1 -1
- package/dist/skills/builtin/apply_patch.js.map +1 -1
- package/dist/skills/builtin/auto_generate.js +1 -1
- package/dist/skills/builtin/auto_generate.js.map +1 -1
- package/dist/skills/builtin/browser.js +1 -1
- package/dist/skills/builtin/browser.js.map +1 -1
- package/dist/skills/builtin/calendar.js +1 -1
- package/dist/skills/builtin/calendar.js.map +1 -1
- package/dist/skills/builtin/code_exec.js +1 -1
- package/dist/skills/builtin/code_exec.js.map +1 -1
- package/dist/skills/builtin/computer_use.js +1 -1
- package/dist/skills/builtin/computer_use.js.map +1 -1
- package/dist/skills/builtin/content_publisher.js +1 -1
- package/dist/skills/builtin/content_publisher.js.map +1 -1
- package/dist/skills/builtin/cron.js +1 -1
- 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/email.js +1 -1
- package/dist/skills/builtin/email.js.map +1 -1
- package/dist/skills/builtin/filesystem.js +1 -1
- package/dist/skills/builtin/filesystem.js.map +1 -1
- package/dist/skills/builtin/freelance_monitor.js +1 -1
- package/dist/skills/builtin/freelance_monitor.js.map +1 -1
- package/dist/skills/builtin/github.js +1 -1
- package/dist/skills/builtin/github.js.map +1 -1
- package/dist/skills/builtin/image_gen.js +1 -1
- package/dist/skills/builtin/image_gen.js.map +1 -1
- package/dist/skills/builtin/income_tracker.js +1 -1
- package/dist/skills/builtin/income_tracker.js.map +1 -1
- package/dist/skills/builtin/lead_scorer.js +1 -1
- package/dist/skills/builtin/lead_scorer.js.map +1 -1
- package/dist/skills/builtin/memory_skill.js +1 -1
- package/dist/skills/builtin/memory_skill.js.map +1 -1
- package/dist/skills/builtin/pdf.js +1 -1
- package/dist/skills/builtin/pdf.js.map +1 -1
- package/dist/skills/builtin/process.js +1 -1
- package/dist/skills/builtin/process.js.map +1 -1
- package/dist/skills/builtin/sessions.js +24 -16
- package/dist/skills/builtin/sessions.js.map +1 -1
- package/dist/skills/builtin/shell.js +1 -1
- package/dist/skills/builtin/shell.js.map +1 -1
- package/dist/skills/builtin/skyvern.js +1 -1
- package/dist/skills/builtin/skyvern.js.map +1 -1
- package/dist/skills/builtin/smart_home.js +1 -1
- package/dist/skills/builtin/smart_home.js.map +1 -1
- package/dist/skills/builtin/vision.js +1 -1
- package/dist/skills/builtin/vision.js.map +1 -1
- package/dist/skills/builtin/voice.js +1 -1
- package/dist/skills/builtin/voice.js.map +1 -1
- package/dist/skills/builtin/web_browse_llm.js +1 -1
- package/dist/skills/builtin/web_browse_llm.js.map +1 -1
- package/dist/skills/builtin/web_fetch.js +1 -1
- package/dist/skills/builtin/web_fetch.js.map +1 -1
- package/dist/skills/builtin/web_search.js +1 -1
- package/dist/skills/builtin/web_search.js.map +1 -1
- package/dist/skills/builtin/webhook.js +1 -1
- package/dist/skills/builtin/webhook.js.map +1 -1
- package/dist/skills/registry.js +24 -16
- package/dist/skills/registry.js.map +1 -1
- package/package.json +1 -1
package/dist/agent/agent.js
CHANGED
|
@@ -34,7 +34,7 @@ var TITAN_VERSION, TITAN_NAME, TITAN_ASCII_LOGO, TITAN_HOME, TITAN_CONFIG_PATH,
|
|
|
34
34
|
var init_constants = __esm({
|
|
35
35
|
"src/utils/constants.ts"() {
|
|
36
36
|
"use strict";
|
|
37
|
-
TITAN_VERSION = "2026.
|
|
37
|
+
TITAN_VERSION = "2026.6.4";
|
|
38
38
|
TITAN_NAME = "TITAN";
|
|
39
39
|
TITAN_ASCII_LOGO = `
|
|
40
40
|
\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557
|
|
@@ -3499,8 +3499,8 @@ function getNudgeMessage(event) {
|
|
|
3499
3499
|
"I seem to be going in circles. Let me step back and rethink this from scratch."
|
|
3500
3500
|
],
|
|
3501
3501
|
empty_response: [
|
|
3502
|
-
"
|
|
3503
|
-
"
|
|
3502
|
+
"You already have information from the tools you called. Summarize what you found and respond to the user directly NOW. Do NOT call any more tools \u2014 use the data you already have.",
|
|
3503
|
+
"STOP calling tools. You have enough information. Respond to the user with what you already know. Provide a clear, direct answer based on the tool results you received."
|
|
3504
3504
|
],
|
|
3505
3505
|
max_rounds: [
|
|
3506
3506
|
"I've taken many steps on this task. Let me summarize what I've done so far and ask if you'd like me to continue.",
|
|
@@ -3571,16 +3571,13 @@ function checkForLoop(sessionId, toolName, args, output, config = {}) {
|
|
|
3571
3571
|
if (history.length > cfg.historySize) {
|
|
3572
3572
|
history.splice(0, history.length - cfg.historySize);
|
|
3573
3573
|
}
|
|
3574
|
-
|
|
3575
|
-
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
globalCallCount++;
|
|
3579
|
-
if (globalCallCount > cfg.globalCircuitBreakerThreshold) {
|
|
3580
|
-
logger_default.error(COMPONENT17, `Global circuit breaker tripped: ${globalCallCount} calls`);
|
|
3574
|
+
const sessionCalls = (sessionCallCounts.get(sessionId) || 0) + 1;
|
|
3575
|
+
sessionCallCounts.set(sessionId, sessionCalls);
|
|
3576
|
+
if (sessionCalls > cfg.globalCircuitBreakerThreshold) {
|
|
3577
|
+
logger_default.error(COMPONENT17, `Session circuit breaker tripped: ${sessionCalls} calls in session ${sessionId}`);
|
|
3581
3578
|
return {
|
|
3582
3579
|
allowed: false,
|
|
3583
|
-
reason: `
|
|
3580
|
+
reason: `Session circuit breaker: ${sessionCalls} tool calls in this session. Stopping to prevent runaway execution.`,
|
|
3584
3581
|
level: "circuit_breaker"
|
|
3585
3582
|
};
|
|
3586
3583
|
}
|
|
@@ -3660,8 +3657,9 @@ function detectPingPong(history) {
|
|
|
3660
3657
|
}
|
|
3661
3658
|
function resetLoopDetection(sessionId) {
|
|
3662
3659
|
sessionHistory.delete(sessionId);
|
|
3660
|
+
sessionCallCounts.delete(sessionId);
|
|
3663
3661
|
}
|
|
3664
|
-
var COMPONENT17, DEFAULT_CONFIG, sessionHistory,
|
|
3662
|
+
var COMPONENT17, DEFAULT_CONFIG, sessionHistory, sessionCallCounts;
|
|
3665
3663
|
var init_loopDetection = __esm({
|
|
3666
3664
|
"src/agent/loopDetection.ts"() {
|
|
3667
3665
|
"use strict";
|
|
@@ -3675,8 +3673,7 @@ var init_loopDetection = __esm({
|
|
|
3675
3673
|
historySize: 30
|
|
3676
3674
|
};
|
|
3677
3675
|
sessionHistory = /* @__PURE__ */ new Map();
|
|
3678
|
-
|
|
3679
|
-
globalCallCountResetAt = Date.now();
|
|
3676
|
+
sessionCallCounts = /* @__PURE__ */ new Map();
|
|
3680
3677
|
}
|
|
3681
3678
|
});
|
|
3682
3679
|
|
|
@@ -4873,7 +4870,8 @@ Category:`;
|
|
|
4873
4870
|
logger_default.warn(COMPONENT25, `Unknown category: "${category}" (raw: "${result}"), using all tools`);
|
|
4874
4871
|
return allTools;
|
|
4875
4872
|
}
|
|
4876
|
-
const
|
|
4873
|
+
const ALWAYS_INCLUDE = ["web_search", "web_fetch", "tool_search", "memory"];
|
|
4874
|
+
const selectedSet = /* @__PURE__ */ new Set([...toolNames, ...ALWAYS_INCLUDE]);
|
|
4877
4875
|
const filtered = allTools.filter((t) => selectedSet.has(t.function.name));
|
|
4878
4876
|
if (filtered.length === 0) return allTools;
|
|
4879
4877
|
inferenceCount++;
|
|
@@ -5003,6 +5001,7 @@ var init_toolSearch = __esm({
|
|
|
5003
5001
|
"edit_file",
|
|
5004
5002
|
"list_dir",
|
|
5005
5003
|
"web_search",
|
|
5004
|
+
"web_fetch",
|
|
5006
5005
|
"memory",
|
|
5007
5006
|
"tool_search"
|
|
5008
5007
|
];
|
|
@@ -5082,9 +5081,11 @@ You are ${TITAN_NAME}, The Intelligent Task Automation Network \u2014 a powerful
|
|
|
5082
5081
|
- Be concise but thorough in responses
|
|
5083
5082
|
- When executing commands, always explain what you're doing and why
|
|
5084
5083
|
- If a task could be destructive (deleting files, etc.), confirm with the user first
|
|
5085
|
-
-
|
|
5084
|
+
- **ALWAYS use your tools to complete tasks \u2014 NEVER just describe what could be done or suggest URLs for the user to visit. Execute the task yourself.**
|
|
5085
|
+
- When the user asks for information (weather, prices, news, etc.), use web_search to find it, then use web_fetch to read the full page content and extract the actual data. Return the data directly \u2014 do NOT tell the user to go check a website.
|
|
5086
5086
|
- Remember important information about the user for future conversations
|
|
5087
5087
|
- If you encounter an error, try alternative approaches before reporting failure
|
|
5088
|
+
- If web_search results don't contain enough detail, follow up with web_fetch on the most relevant URL to get the full content
|
|
5088
5089
|
|
|
5089
5090
|
## Security
|
|
5090
5091
|
- Never expose API keys, passwords, or other secrets
|
|
@@ -5212,6 +5213,13 @@ async function processMessage(message, channel = "cli", userId = "default", over
|
|
|
5212
5213
|
heartbeat(session.id);
|
|
5213
5214
|
for (let round = 0; round < MAX_TOOL_ROUNDS; round++) {
|
|
5214
5215
|
logger_default.debug(COMPONENT26, `Round ${round + 1}: ${messages.length} messages, ${activeTools.length} tools`);
|
|
5216
|
+
if (round >= 5) {
|
|
5217
|
+
messages.push({
|
|
5218
|
+
role: "user",
|
|
5219
|
+
content: "IMPORTANT: You have already used enough tools. Do NOT call any more tools. Summarize the information you have gathered and respond to the user directly with a clear answer NOW."
|
|
5220
|
+
});
|
|
5221
|
+
logger_default.info(COMPONENT26, `[Round ${round + 1}] Injecting forced summarization prompt`);
|
|
5222
|
+
}
|
|
5215
5223
|
const { messages: compressedMessages, didCompress, savedTokens } = maybeCompressContext(
|
|
5216
5224
|
messages.filter((m) => m.role !== "tool" || round < 3)
|
|
5217
5225
|
// keep recent tool results
|