agent-world 0.11.1 → 0.12.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/README.md +17 -7
- package/dist/cli/commands.d.ts +109 -0
- package/dist/cli/commands.js +2024 -0
- package/dist/cli/display.d.ts +124 -0
- package/dist/cli/display.js +381 -0
- package/dist/cli/hitl.d.ts +33 -0
- package/dist/cli/hitl.js +81 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/stream.d.ts +41 -0
- package/dist/cli/stream.js +222 -0
- package/dist/core/activity-tracker.d.ts +16 -0
- package/dist/core/activity-tracker.d.ts.map +1 -0
- package/dist/core/activity-tracker.js +91 -0
- package/dist/core/activity-tracker.js.map +1 -0
- package/dist/core/ai-commands.d.ts +16 -0
- package/dist/core/ai-commands.d.ts.map +1 -0
- package/dist/core/ai-commands.js +24 -0
- package/dist/core/ai-commands.js.map +1 -0
- package/dist/core/ai-sdk-patch.d.ts +24 -0
- package/dist/core/ai-sdk-patch.d.ts.map +1 -0
- package/dist/core/ai-sdk-patch.js +169 -0
- package/dist/core/ai-sdk-patch.js.map +1 -0
- package/dist/core/anthropic-direct.d.ts +52 -0
- package/dist/core/anthropic-direct.d.ts.map +1 -0
- package/dist/core/anthropic-direct.js +301 -0
- package/dist/core/anthropic-direct.js.map +1 -0
- package/dist/core/approval-cache.d.ts +104 -0
- package/dist/core/approval-cache.d.ts.map +1 -0
- package/dist/core/approval-cache.js +150 -0
- package/dist/core/approval-cache.js.map +1 -0
- package/dist/core/chat-constants.d.ts +20 -0
- package/dist/core/chat-constants.d.ts.map +1 -0
- package/dist/core/chat-constants.js +22 -0
- package/dist/core/chat-constants.js.map +1 -0
- package/dist/core/create-agent-tool.d.ts +66 -0
- package/dist/core/create-agent-tool.d.ts.map +1 -0
- package/dist/core/create-agent-tool.js +212 -0
- package/dist/core/create-agent-tool.js.map +1 -0
- package/dist/core/events/approval-checker.d.ts +61 -0
- package/dist/core/events/approval-checker.d.ts.map +1 -0
- package/dist/core/events/approval-checker.js +226 -0
- package/dist/core/events/approval-checker.js.map +1 -0
- package/dist/core/events/index.d.ts +25 -0
- package/dist/core/events/index.d.ts.map +1 -0
- package/dist/core/events/index.js +30 -0
- package/dist/core/events/index.js.map +1 -0
- package/dist/core/events/memory-manager.d.ts +73 -0
- package/dist/core/events/memory-manager.d.ts.map +1 -0
- package/dist/core/events/memory-manager.js +1218 -0
- package/dist/core/events/memory-manager.js.map +1 -0
- package/dist/core/events/mention-logic.d.ts +39 -0
- package/dist/core/events/mention-logic.d.ts.map +1 -0
- package/dist/core/events/mention-logic.js +163 -0
- package/dist/core/events/mention-logic.js.map +1 -0
- package/dist/core/events/orchestrator.d.ts +69 -0
- package/dist/core/events/orchestrator.d.ts.map +1 -0
- package/dist/core/events/orchestrator.js +883 -0
- package/dist/core/events/orchestrator.js.map +1 -0
- package/dist/core/events/persistence.d.ts +41 -0
- package/dist/core/events/persistence.d.ts.map +1 -0
- package/dist/core/events/persistence.js +296 -0
- package/dist/core/events/persistence.js.map +1 -0
- package/dist/core/events/publishers.d.ts +81 -0
- package/dist/core/events/publishers.d.ts.map +1 -0
- package/dist/core/events/publishers.js +272 -0
- package/dist/core/events/publishers.js.map +1 -0
- package/dist/core/events/subscribers.d.ts +45 -0
- package/dist/core/events/subscribers.d.ts.map +1 -0
- package/dist/core/events/subscribers.js +288 -0
- package/dist/core/events/subscribers.js.map +1 -0
- package/dist/core/events/tool-bridge-logging.d.ts +28 -0
- package/dist/core/events/tool-bridge-logging.d.ts.map +1 -0
- package/dist/core/events/tool-bridge-logging.js +94 -0
- package/dist/core/events/tool-bridge-logging.js.map +1 -0
- package/dist/core/events-metadata.d.ts +72 -0
- package/dist/core/events-metadata.d.ts.map +1 -0
- package/dist/core/events-metadata.js +167 -0
- package/dist/core/events-metadata.js.map +1 -0
- package/dist/core/events.d.ts +186 -0
- package/dist/core/events.d.ts.map +1 -0
- package/dist/core/events.js +1248 -0
- package/dist/core/events.js.map +1 -0
- package/dist/core/export.d.ts +106 -0
- package/dist/core/export.d.ts.map +1 -0
- package/dist/core/export.js +705 -0
- package/dist/core/export.js.map +1 -0
- package/dist/core/file-tools.d.ts +114 -0
- package/dist/core/file-tools.d.ts.map +1 -0
- package/dist/core/file-tools.js +370 -0
- package/dist/core/file-tools.js.map +1 -0
- package/dist/core/google-direct.d.ts +58 -0
- package/dist/core/google-direct.d.ts.map +1 -0
- package/dist/core/google-direct.js +298 -0
- package/dist/core/google-direct.js.map +1 -0
- package/dist/core/hitl.d.ts +54 -0
- package/dist/core/hitl.d.ts.map +1 -0
- package/dist/core/hitl.js +153 -0
- package/dist/core/hitl.js.map +1 -0
- package/dist/core/index.d.ts +59 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +70 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/llm-config.d.ts +128 -0
- package/dist/core/llm-config.d.ts.map +1 -0
- package/dist/core/llm-config.js +164 -0
- package/dist/core/llm-config.js.map +1 -0
- package/dist/core/llm-manager.d.ts +163 -0
- package/dist/core/llm-manager.d.ts.map +1 -0
- package/dist/core/llm-manager.js +669 -0
- package/dist/core/llm-manager.js.map +1 -0
- package/dist/core/load-skill-tool.d.ts +55 -0
- package/dist/core/load-skill-tool.d.ts.map +1 -0
- package/dist/core/load-skill-tool.js +468 -0
- package/dist/core/load-skill-tool.js.map +1 -0
- package/dist/core/logger.d.ts +88 -0
- package/dist/core/logger.d.ts.map +1 -0
- package/dist/core/logger.js +358 -0
- package/dist/core/logger.js.map +1 -0
- package/dist/core/managers.d.ts +131 -0
- package/dist/core/managers.d.ts.map +1 -0
- package/dist/core/managers.js +1223 -0
- package/dist/core/managers.js.map +1 -0
- package/dist/core/mcp-server-registry.d.ts +304 -0
- package/dist/core/mcp-server-registry.d.ts.map +1 -0
- package/dist/core/mcp-server-registry.js +1769 -0
- package/dist/core/mcp-server-registry.js.map +1 -0
- package/dist/core/mcp-tools.d.ts +56 -0
- package/dist/core/mcp-tools.d.ts.map +1 -0
- package/dist/core/mcp-tools.js +186 -0
- package/dist/core/mcp-tools.js.map +1 -0
- package/dist/core/message-prep.d.ts +81 -0
- package/dist/core/message-prep.d.ts.map +1 -0
- package/dist/core/message-prep.js +223 -0
- package/dist/core/message-prep.js.map +1 -0
- package/dist/core/message-processing-control.d.ts +54 -0
- package/dist/core/message-processing-control.d.ts.map +1 -0
- package/dist/core/message-processing-control.js +139 -0
- package/dist/core/message-processing-control.js.map +1 -0
- package/dist/core/openai-direct.d.ts +80 -0
- package/dist/core/openai-direct.d.ts.map +1 -0
- package/dist/core/openai-direct.js +374 -0
- package/dist/core/openai-direct.js.map +1 -0
- package/dist/core/shell-cmd-tool.d.ts +235 -0
- package/dist/core/shell-cmd-tool.d.ts.map +1 -0
- package/dist/core/shell-cmd-tool.js +1157 -0
- package/dist/core/shell-cmd-tool.js.map +1 -0
- package/dist/core/shell-process-registry.d.ts +88 -0
- package/dist/core/shell-process-registry.d.ts.map +1 -0
- package/dist/core/shell-process-registry.js +309 -0
- package/dist/core/shell-process-registry.js.map +1 -0
- package/dist/core/skill-registry.d.ts +75 -0
- package/dist/core/skill-registry.d.ts.map +1 -0
- package/dist/core/skill-registry.js +369 -0
- package/dist/core/skill-registry.js.map +1 -0
- package/dist/core/skill-script-runner.d.ts +89 -0
- package/dist/core/skill-script-runner.d.ts.map +1 -0
- package/dist/core/skill-script-runner.js +274 -0
- package/dist/core/skill-script-runner.js.map +1 -0
- package/dist/core/skill-selector.d.ts +65 -0
- package/dist/core/skill-selector.d.ts.map +1 -0
- package/dist/core/skill-selector.js +190 -0
- package/dist/core/skill-selector.js.map +1 -0
- package/dist/core/skill-settings.d.ts +20 -0
- package/dist/core/skill-settings.d.ts.map +1 -0
- package/dist/core/skill-settings.js +40 -0
- package/dist/core/skill-settings.js.map +1 -0
- package/dist/core/storage/agent-storage.d.ts +134 -0
- package/dist/core/storage/agent-storage.d.ts.map +1 -0
- package/dist/core/storage/agent-storage.js +498 -0
- package/dist/core/storage/agent-storage.js.map +1 -0
- package/dist/core/storage/eventStorage/fileEventStorage.d.ts +100 -0
- package/dist/core/storage/eventStorage/fileEventStorage.d.ts.map +1 -0
- package/dist/core/storage/eventStorage/fileEventStorage.js +494 -0
- package/dist/core/storage/eventStorage/fileEventStorage.js.map +1 -0
- package/dist/core/storage/eventStorage/index.d.ts +31 -0
- package/dist/core/storage/eventStorage/index.d.ts.map +1 -0
- package/dist/core/storage/eventStorage/index.js +31 -0
- package/dist/core/storage/eventStorage/index.js.map +1 -0
- package/dist/core/storage/eventStorage/memoryEventStorage.d.ts +87 -0
- package/dist/core/storage/eventStorage/memoryEventStorage.d.ts.map +1 -0
- package/dist/core/storage/eventStorage/memoryEventStorage.js +244 -0
- package/dist/core/storage/eventStorage/memoryEventStorage.js.map +1 -0
- package/dist/core/storage/eventStorage/sqliteEventStorage.d.ts +45 -0
- package/dist/core/storage/eventStorage/sqliteEventStorage.d.ts.map +1 -0
- package/dist/core/storage/eventStorage/sqliteEventStorage.js +301 -0
- package/dist/core/storage/eventStorage/sqliteEventStorage.js.map +1 -0
- package/dist/core/storage/eventStorage/types.d.ts +142 -0
- package/dist/core/storage/eventStorage/types.d.ts.map +1 -0
- package/dist/core/storage/eventStorage/types.js +43 -0
- package/dist/core/storage/eventStorage/types.js.map +1 -0
- package/dist/core/storage/eventStorage/validation.d.ts +30 -0
- package/dist/core/storage/eventStorage/validation.d.ts.map +1 -0
- package/dist/core/storage/eventStorage/validation.js +68 -0
- package/dist/core/storage/eventStorage/validation.js.map +1 -0
- package/dist/core/storage/legacy-migrations.d.ts +45 -0
- package/dist/core/storage/legacy-migrations.d.ts.map +1 -0
- package/dist/core/storage/legacy-migrations.js +295 -0
- package/dist/core/storage/legacy-migrations.js.map +1 -0
- package/dist/core/storage/memory-storage.d.ts +105 -0
- package/dist/core/storage/memory-storage.d.ts.map +1 -0
- package/dist/core/storage/memory-storage.js +415 -0
- package/dist/core/storage/memory-storage.js.map +1 -0
- package/dist/core/storage/migration-runner.d.ts +96 -0
- package/dist/core/storage/migration-runner.d.ts.map +1 -0
- package/dist/core/storage/migration-runner.js +306 -0
- package/dist/core/storage/migration-runner.js.map +1 -0
- package/dist/core/storage/queue-storage.d.ts +147 -0
- package/dist/core/storage/queue-storage.d.ts.map +1 -0
- package/dist/core/storage/queue-storage.js +290 -0
- package/dist/core/storage/queue-storage.js.map +1 -0
- package/dist/core/storage/skill-storage.d.ts +136 -0
- package/dist/core/storage/skill-storage.d.ts.map +1 -0
- package/dist/core/storage/skill-storage.js +474 -0
- package/dist/core/storage/skill-storage.js.map +1 -0
- package/dist/core/storage/sqlite-schema.d.ts +95 -0
- package/dist/core/storage/sqlite-schema.d.ts.map +1 -0
- package/dist/core/storage/sqlite-schema.js +156 -0
- package/dist/core/storage/sqlite-schema.js.map +1 -0
- package/dist/core/storage/sqlite-storage.d.ts +146 -0
- package/dist/core/storage/sqlite-storage.d.ts.map +1 -0
- package/dist/core/storage/sqlite-storage.js +709 -0
- package/dist/core/storage/sqlite-storage.js.map +1 -0
- package/dist/core/storage/storage-factory.d.ts +61 -0
- package/dist/core/storage/storage-factory.d.ts.map +1 -0
- package/dist/core/storage/storage-factory.js +794 -0
- package/dist/core/storage/storage-factory.js.map +1 -0
- package/dist/core/storage/validation.d.ts +36 -0
- package/dist/core/storage/validation.d.ts.map +1 -0
- package/dist/core/storage/validation.js +79 -0
- package/dist/core/storage/validation.js.map +1 -0
- package/dist/core/storage/world-storage.d.ts +114 -0
- package/dist/core/storage/world-storage.d.ts.map +1 -0
- package/dist/core/storage/world-storage.js +378 -0
- package/dist/core/storage/world-storage.js.map +1 -0
- package/dist/core/subscription.d.ts +43 -0
- package/dist/core/subscription.d.ts.map +1 -0
- package/dist/core/subscription.js +227 -0
- package/dist/core/subscription.js.map +1 -0
- package/dist/core/tool-utils.d.ts +80 -0
- package/dist/core/tool-utils.d.ts.map +1 -0
- package/dist/core/tool-utils.js +273 -0
- package/dist/core/tool-utils.js.map +1 -0
- package/dist/core/types.d.ts +595 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +158 -0
- package/dist/core/types.js.map +1 -0
- package/dist/core/utils.d.ts +138 -0
- package/dist/core/utils.d.ts.map +1 -0
- package/dist/core/utils.js +478 -0
- package/dist/core/utils.js.map +1 -0
- package/dist/core/world-class.d.ts +43 -0
- package/dist/core/world-class.d.ts.map +1 -0
- package/dist/core/world-class.js +90 -0
- package/dist/core/world-class.js.map +1 -0
- package/dist/index.d.ts +18 -0
- package/dist/public/assets/agent-sprites-DJFgj-zP.png +0 -0
- package/dist/public/assets/border-KHK37r8y.svg +83 -0
- package/dist/public/assets/index-C9kPXL6G.css +1 -0
- package/dist/public/assets/index-DOQEHGWt.js +96 -0
- package/dist/public/index.html +21 -0
- package/dist/server/api.d.ts +2 -0
- package/dist/server/api.js +1124 -0
- package/dist/server/index.d.ts +29 -0
- package/dist/server/sse-handler.d.ts +62 -0
- package/dist/server/sse-handler.js +234 -0
- package/package.json +15 -3
- package/scripts/launch-electron.js +0 -58
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool Bridge Logging Utilities
|
|
3
|
+
*
|
|
4
|
+
* Purpose:
|
|
5
|
+
* Shared LLM↔tool debug logging helpers used by both orchestrator and
|
|
6
|
+
* memory-manager to trace request/result/error handoff payloads.
|
|
7
|
+
*
|
|
8
|
+
* Key Features:
|
|
9
|
+
* - Console-level bridge logs gated by `LOG_LLM_TOOL_BRIDGE` env var
|
|
10
|
+
* - Simplified output showing only type, tool name, and truncated content (100-200 chars)
|
|
11
|
+
* - Safe JSON serialization with fallback to `String()`
|
|
12
|
+
*
|
|
13
|
+
* Implementation Notes:
|
|
14
|
+
* - Extracted from orchestrator.ts and memory-manager.ts to eliminate duplication
|
|
15
|
+
* - Filters verbose metadata, keeps only essential debugging fields
|
|
16
|
+
*
|
|
17
|
+
* Changes:
|
|
18
|
+
* - 2026-02-16: Extracted shared tool-bridge logging utilities from orchestrator
|
|
19
|
+
* and memory-manager into a dedicated module.
|
|
20
|
+
* - 2026-02-17: Simplified logToolBridge to show only type, tool name, and truncated
|
|
21
|
+
* content/args/result (100-300 chars max) for better debugging ergonomics. Removed
|
|
22
|
+
* worldId, agentId, chatId, hopCount, retryCount and other verbose metadata.
|
|
23
|
+
*/
|
|
24
|
+
const TOOL_DEBUG_RESULT_PREVIEW_LIMIT = 200;
|
|
25
|
+
export function safeSerializeForConsole(value) {
|
|
26
|
+
try {
|
|
27
|
+
return JSON.stringify(value, null, 2);
|
|
28
|
+
}
|
|
29
|
+
catch {
|
|
30
|
+
return String(value);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
export function isToolBridgeLoggingEnabled() {
|
|
34
|
+
const rawValue = typeof process !== 'undefined' && process.env
|
|
35
|
+
? process.env.LOG_LLM_TOOL_BRIDGE
|
|
36
|
+
: undefined;
|
|
37
|
+
if (!rawValue)
|
|
38
|
+
return false;
|
|
39
|
+
const normalized = rawValue.toLowerCase().trim();
|
|
40
|
+
return normalized === '1' || normalized === 'true' || normalized === 'debug' || normalized === 'on';
|
|
41
|
+
}
|
|
42
|
+
function truncateContent(value, maxLength = TOOL_DEBUG_RESULT_PREVIEW_LIMIT) {
|
|
43
|
+
const str = typeof value === 'string'
|
|
44
|
+
? value
|
|
45
|
+
: JSON.stringify(value);
|
|
46
|
+
if (str.length <= maxLength) {
|
|
47
|
+
return str;
|
|
48
|
+
}
|
|
49
|
+
return `${str.slice(0, maxLength)}...[${str.length - maxLength} more]`;
|
|
50
|
+
}
|
|
51
|
+
export function logToolBridge(direction, payload) {
|
|
52
|
+
if (!isToolBridgeLoggingEnabled()) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
// Extract only essential fields: type and shortened content
|
|
56
|
+
if (payload && typeof payload === 'object' && !Array.isArray(payload)) {
|
|
57
|
+
const obj = payload;
|
|
58
|
+
const essential = {};
|
|
59
|
+
// Keep type fields
|
|
60
|
+
if ('type' in obj)
|
|
61
|
+
essential.type = obj.type;
|
|
62
|
+
if ('responseType' in obj)
|
|
63
|
+
essential.type = obj.responseType;
|
|
64
|
+
// Keep tool name/ID (essential for tracing)
|
|
65
|
+
if ('toolName' in obj)
|
|
66
|
+
essential.tool = obj.toolName;
|
|
67
|
+
if ('toolCallId' in obj)
|
|
68
|
+
essential.id = String(obj.toolCallId).slice(0, 8);
|
|
69
|
+
// Truncate content/result fields
|
|
70
|
+
if ('content' in obj)
|
|
71
|
+
essential.content = truncateContent(obj.content, 100);
|
|
72
|
+
if ('contentPreview' in obj)
|
|
73
|
+
essential.content = truncateContent(obj.contentPreview, 100);
|
|
74
|
+
if ('resultPreview' in obj)
|
|
75
|
+
essential.result = truncateContent(obj.resultPreview, 150);
|
|
76
|
+
if ('args' in obj)
|
|
77
|
+
essential.args = truncateContent(obj.args, 100);
|
|
78
|
+
console.log(`[LLM↔TOOLS] ${direction}`, essential);
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
// Raw responses (LLM RAW -> CONTINUE)
|
|
82
|
+
console.log(`[LLM↔TOOLS] ${direction}`, truncateContent(payload, 300));
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
export function getToolResultPreview(value) {
|
|
86
|
+
const serialized = typeof value === 'string'
|
|
87
|
+
? value
|
|
88
|
+
: safeSerializeForConsole(value);
|
|
89
|
+
if (serialized.length <= TOOL_DEBUG_RESULT_PREVIEW_LIMIT) {
|
|
90
|
+
return serialized;
|
|
91
|
+
}
|
|
92
|
+
return `${serialized.slice(0, TOOL_DEBUG_RESULT_PREVIEW_LIMIT)}... [truncated ${serialized.length - TOOL_DEBUG_RESULT_PREVIEW_LIMIT} chars]`;
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=tool-bridge-logging.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-bridge-logging.js","sourceRoot":"","sources":["../../../core/events/tool-bridge-logging.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;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GAAG,CAAC,eAAe,SAAS,EAAE,EAAE,eAAe,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC;IACzE,CAAC;AACH,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,KAAc;IACjD,MAAM,UAAU,GAAG,OAAO,KAAK,KAAK,QAAQ;QAC1C,CAAC,CAAC,KAAK;QACP,CAAC,CAAC,uBAAuB,CAAC,KAAK,CAAC,CAAC;IAEnC,IAAI,UAAU,CAAC,MAAM,IAAI,+BAA+B,EAAE,CAAC;QACzD,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,OAAO,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,+BAA+B,CAAC,kBAAkB,UAAU,CAAC,MAAM,GAAG,+BAA+B,SAAS,CAAC;AAC/I,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Event Metadata Calculation Helpers
|
|
3
|
+
*
|
|
4
|
+
* Pure functions that calculate enhanced metadata for message and tool events.
|
|
5
|
+
* These functions analyze the world state, message content, and agent configurations
|
|
6
|
+
* to determine ownership, recipients, threading, and message classification.
|
|
7
|
+
*
|
|
8
|
+
* Features:
|
|
9
|
+
* - calculateOwnerAgentIds: Determine which agents should have message in memory
|
|
10
|
+
* - calculateRecipientAgentId: Identify intended recipient from @mentions
|
|
11
|
+
* - calculateMessageDirection: Classify as outgoing/incoming/broadcast
|
|
12
|
+
* - calculateIsMemoryOnly: Detect cross-agent messages (saved but no response)
|
|
13
|
+
* - calculateIsCrossAgentMessage: Identify agent-to-agent communication
|
|
14
|
+
* - calculateThreadMetadata: Compute thread depth and root with cycle detection
|
|
15
|
+
*
|
|
16
|
+
* All functions are pure - no side effects, deterministic output, easy to test.
|
|
17
|
+
*
|
|
18
|
+
* Implementation: 2025-11-07
|
|
19
|
+
* - Clean build approach with complete metadata from creation
|
|
20
|
+
* - Supports human broadcasts, @mention targeting, and cross-agent messaging
|
|
21
|
+
* - Thread depth calculation with circular reference protection
|
|
22
|
+
*/
|
|
23
|
+
import type { World, WorldMessageEvent, AgentMessage } from './types.js';
|
|
24
|
+
/**
|
|
25
|
+
* Calculate which agents should have this message in their memory
|
|
26
|
+
*
|
|
27
|
+
* Rules:
|
|
28
|
+
* - Human messages: All agents receive (broadcast)
|
|
29
|
+
* - Agent messages with @mention: Only recipient gets it
|
|
30
|
+
* - Agent messages without @mention: All agents get it (broadcast)
|
|
31
|
+
* - Cross-agent messages: Both sender and recipient
|
|
32
|
+
*/
|
|
33
|
+
export declare function calculateOwnerAgentIds(world: World, message: WorldMessageEvent): string[];
|
|
34
|
+
/**
|
|
35
|
+
* Calculate the intended recipient from @mentions
|
|
36
|
+
* Returns agentId if found, null for broadcast
|
|
37
|
+
*/
|
|
38
|
+
export declare function calculateRecipientAgentId(world: World, message: WorldMessageEvent): string | null;
|
|
39
|
+
/**
|
|
40
|
+
* Calculate message direction from agent's perspective
|
|
41
|
+
*
|
|
42
|
+
* - outgoing: Agent is sender
|
|
43
|
+
* - incoming: Agent is recipient (has @mention)
|
|
44
|
+
* - broadcast: No specific recipient
|
|
45
|
+
*/
|
|
46
|
+
export declare function calculateMessageDirection(world: World, message: WorldMessageEvent): 'outgoing' | 'incoming' | 'broadcast';
|
|
47
|
+
/**
|
|
48
|
+
* Calculate if message is memory-only (cross-agent, no response expected)
|
|
49
|
+
*
|
|
50
|
+
* Memory-only messages:
|
|
51
|
+
* - Agent messages with @mention (cross-agent communication)
|
|
52
|
+
* - Saved to recipient's memory but doesn't trigger response
|
|
53
|
+
*/
|
|
54
|
+
export declare function calculateIsMemoryOnly(world: World, message: WorldMessageEvent): boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Calculate if message is agent-to-agent communication
|
|
57
|
+
*/
|
|
58
|
+
export declare function calculateIsCrossAgentMessage(world: World, message: WorldMessageEvent): boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Calculate thread metadata: root ID, depth, and circular reference detection
|
|
61
|
+
*
|
|
62
|
+
* Returns:
|
|
63
|
+
* - threadRootId: ID of root message (null if this is root)
|
|
64
|
+
* - threadDepth: 0 for root, 1 for reply, 2 for reply-to-reply, etc.
|
|
65
|
+
* - isReply: true if replyToMessageId is set
|
|
66
|
+
*/
|
|
67
|
+
export declare function calculateThreadMetadata(message: WorldMessageEvent, allMessages: AgentMessage[]): {
|
|
68
|
+
threadRootId: string | null;
|
|
69
|
+
threadDepth: number;
|
|
70
|
+
isReply: boolean;
|
|
71
|
+
};
|
|
72
|
+
//# sourceMappingURL=events-metadata.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events-metadata.d.ts","sourceRoot":"","sources":["../../core/events-metadata.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAmBzE;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,iBAAiB,GACzB,MAAM,EAAE,CAiBV;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,iBAAiB,GACzB,MAAM,GAAG,IAAI,CAEf;AAED;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,iBAAiB,GACzB,UAAU,GAAG,UAAU,GAAG,WAAW,CAavC;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAMT;AAED;;GAEG;AACH,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAMT;AAED;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,iBAAiB,EAC1B,WAAW,EAAE,YAAY,EAAE,GAC1B;IACD,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;CAClB,CA2DA"}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Event Metadata Calculation Helpers
|
|
3
|
+
*
|
|
4
|
+
* Pure functions that calculate enhanced metadata for message and tool events.
|
|
5
|
+
* These functions analyze the world state, message content, and agent configurations
|
|
6
|
+
* to determine ownership, recipients, threading, and message classification.
|
|
7
|
+
*
|
|
8
|
+
* Features:
|
|
9
|
+
* - calculateOwnerAgentIds: Determine which agents should have message in memory
|
|
10
|
+
* - calculateRecipientAgentId: Identify intended recipient from @mentions
|
|
11
|
+
* - calculateMessageDirection: Classify as outgoing/incoming/broadcast
|
|
12
|
+
* - calculateIsMemoryOnly: Detect cross-agent messages (saved but no response)
|
|
13
|
+
* - calculateIsCrossAgentMessage: Identify agent-to-agent communication
|
|
14
|
+
* - calculateThreadMetadata: Compute thread depth and root with cycle detection
|
|
15
|
+
*
|
|
16
|
+
* All functions are pure - no side effects, deterministic output, easy to test.
|
|
17
|
+
*
|
|
18
|
+
* Implementation: 2025-11-07
|
|
19
|
+
* - Clean build approach with complete metadata from creation
|
|
20
|
+
* - Supports human broadcasts, @mention targeting, and cross-agent messaging
|
|
21
|
+
* - Thread depth calculation with circular reference protection
|
|
22
|
+
*/
|
|
23
|
+
import { extractParagraphBeginningMentions } from './utils.js';
|
|
24
|
+
function resolveRecipientAgentId(world, message) {
|
|
25
|
+
const mentions = extractParagraphBeginningMentions(message.content || '');
|
|
26
|
+
if (mentions.length === 0) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
const targetMention = mentions[0];
|
|
30
|
+
const targetAgent = Array.from(world.agents.values()).find((agent) => agent.id.toLowerCase() === targetMention ||
|
|
31
|
+
agent.name.toLowerCase() === targetMention);
|
|
32
|
+
return targetAgent?.id ?? null;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Calculate which agents should have this message in their memory
|
|
36
|
+
*
|
|
37
|
+
* Rules:
|
|
38
|
+
* - Human messages: All agents receive (broadcast)
|
|
39
|
+
* - Agent messages with @mention: Only recipient gets it
|
|
40
|
+
* - Agent messages without @mention: All agents get it (broadcast)
|
|
41
|
+
* - Cross-agent messages: Both sender and recipient
|
|
42
|
+
*/
|
|
43
|
+
export function calculateOwnerAgentIds(world, message) {
|
|
44
|
+
const isHuman = message.sender === 'human' || message.sender === 'user';
|
|
45
|
+
// Human messages go to all agents
|
|
46
|
+
if (isHuman) {
|
|
47
|
+
return Array.from(world.agents.keys());
|
|
48
|
+
}
|
|
49
|
+
// Agent message - check for paragraph-beginning direct mention
|
|
50
|
+
const recipientAgentId = resolveRecipientAgentId(world, message);
|
|
51
|
+
if (recipientAgentId) {
|
|
52
|
+
// Cross-agent message: both sender and recipient
|
|
53
|
+
return [message.sender, recipientAgentId];
|
|
54
|
+
}
|
|
55
|
+
// Agent broadcast - all agents
|
|
56
|
+
return Array.from(world.agents.keys());
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Calculate the intended recipient from @mentions
|
|
60
|
+
* Returns agentId if found, null for broadcast
|
|
61
|
+
*/
|
|
62
|
+
export function calculateRecipientAgentId(world, message) {
|
|
63
|
+
return resolveRecipientAgentId(world, message);
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Calculate message direction from agent's perspective
|
|
67
|
+
*
|
|
68
|
+
* - outgoing: Agent is sender
|
|
69
|
+
* - incoming: Agent is recipient (has @mention)
|
|
70
|
+
* - broadcast: No specific recipient
|
|
71
|
+
*/
|
|
72
|
+
export function calculateMessageDirection(world, message) {
|
|
73
|
+
const isHuman = message.sender === 'human' || message.sender === 'user';
|
|
74
|
+
if (isHuman) {
|
|
75
|
+
return 'broadcast'; // Human messages are always broadcast
|
|
76
|
+
}
|
|
77
|
+
const recipientId = calculateRecipientAgentId(world, message);
|
|
78
|
+
if (recipientId) {
|
|
79
|
+
return 'incoming'; // Has specific recipient
|
|
80
|
+
}
|
|
81
|
+
return 'broadcast'; // Agent broadcast to all
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Calculate if message is memory-only (cross-agent, no response expected)
|
|
85
|
+
*
|
|
86
|
+
* Memory-only messages:
|
|
87
|
+
* - Agent messages with @mention (cross-agent communication)
|
|
88
|
+
* - Saved to recipient's memory but doesn't trigger response
|
|
89
|
+
*/
|
|
90
|
+
export function calculateIsMemoryOnly(world, message) {
|
|
91
|
+
const isHuman = message.sender === 'human' || message.sender === 'user';
|
|
92
|
+
if (isHuman)
|
|
93
|
+
return false; // Human messages always trigger responses
|
|
94
|
+
const recipientId = calculateRecipientAgentId(world, message);
|
|
95
|
+
return recipientId !== null; // Has @mention = memory-only
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Calculate if message is agent-to-agent communication
|
|
99
|
+
*/
|
|
100
|
+
export function calculateIsCrossAgentMessage(world, message) {
|
|
101
|
+
const isHuman = message.sender === 'human' || message.sender === 'user';
|
|
102
|
+
if (isHuman)
|
|
103
|
+
return false;
|
|
104
|
+
const recipientId = calculateRecipientAgentId(world, message);
|
|
105
|
+
return recipientId !== null;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Calculate thread metadata: root ID, depth, and circular reference detection
|
|
109
|
+
*
|
|
110
|
+
* Returns:
|
|
111
|
+
* - threadRootId: ID of root message (null if this is root)
|
|
112
|
+
* - threadDepth: 0 for root, 1 for reply, 2 for reply-to-reply, etc.
|
|
113
|
+
* - isReply: true if replyToMessageId is set
|
|
114
|
+
*/
|
|
115
|
+
export function calculateThreadMetadata(message, allMessages) {
|
|
116
|
+
const isReply = !!message.replyToMessageId;
|
|
117
|
+
if (!isReply) {
|
|
118
|
+
return {
|
|
119
|
+
threadRootId: null,
|
|
120
|
+
threadDepth: 0,
|
|
121
|
+
isReply: false
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
// Traverse up the reply chain to find root
|
|
125
|
+
const visited = new Set([message.messageId]);
|
|
126
|
+
let currentId = message.replyToMessageId;
|
|
127
|
+
let depth = 1;
|
|
128
|
+
while (currentId) {
|
|
129
|
+
// Circular reference detection
|
|
130
|
+
if (visited.has(currentId)) {
|
|
131
|
+
console.warn(`Circular thread reference detected: ${Array.from(visited).join(' -> ')} -> ${currentId}`);
|
|
132
|
+
return {
|
|
133
|
+
threadRootId: message.replyToMessageId ?? null, // Treat immediate parent as root
|
|
134
|
+
threadDepth: 1,
|
|
135
|
+
isReply: true
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
visited.add(currentId);
|
|
139
|
+
// Find parent message
|
|
140
|
+
const parent = allMessages.find(m => m.messageId === currentId);
|
|
141
|
+
if (!parent || !parent.replyToMessageId) {
|
|
142
|
+
// Found root or missing parent
|
|
143
|
+
return {
|
|
144
|
+
threadRootId: currentId,
|
|
145
|
+
threadDepth: depth,
|
|
146
|
+
isReply: true
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
currentId = parent.replyToMessageId;
|
|
150
|
+
depth++;
|
|
151
|
+
// Safety limit to prevent infinite loops
|
|
152
|
+
if (depth > 100) {
|
|
153
|
+
console.warn(`Thread depth exceeds 100 levels, stopping traversal`);
|
|
154
|
+
return {
|
|
155
|
+
threadRootId: currentId,
|
|
156
|
+
threadDepth: depth,
|
|
157
|
+
isReply: true
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
return {
|
|
162
|
+
threadRootId: currentId ?? message.replyToMessageId ?? null,
|
|
163
|
+
threadDepth: depth,
|
|
164
|
+
isReply: true
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
//# sourceMappingURL=events-metadata.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events-metadata.js","sourceRoot":"","sources":["../../core/events-metadata.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAq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,KAAK;gBAClB,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;QAED,SAAS,GAAG,MAAM,CAAC,gBAAgB,CAAC;QACpC,KAAK,EAAE,CAAC;QAER,yCAAyC;QACzC,IAAI,KAAK,GAAG,GAAG,EAAE,CAAC;YAChB,OAAO,CAAC,IAAI,CAAC,qDAAqD,CAAC,CAAC;YACpE,OAAO;gBACL,YAAY,EAAE,SAAS;gBACvB,WAAW,EAAE,KAAK;gBAClB,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC;IAED,OAAO;QACL,YAAY,EAAE,SAAS,IAAI,OAAO,CAAC,gBAAgB,IAAI,IAAI;QAC3D,WAAW,EAAE,KAAK;QAClB,OAAO,EAAE,IAAI;KACd,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unified Events Module - World and Agent Event Functions
|
|
3
|
+
*
|
|
4
|
+
* Purpose: Event-driven message publishing, agent response processing, and memory persistence
|
|
5
|
+
*
|
|
6
|
+
* Logging: Enable with LOG_EVENTS=debug or specific categories:
|
|
7
|
+
* - LOG_EVENTS_PUBLISH, LOG_EVENTS_AGENT, LOG_EVENTS_RESPONSE, LOG_EVENTS_MEMORY
|
|
8
|
+
* - LOG_EVENTS_AUTOMENTION, LOG_EVENTS_TURNLIMIT, LOG_EVENTS_CHATTITLE
|
|
9
|
+
*
|
|
10
|
+
* Core Features:
|
|
11
|
+
* - Event publishing/subscription via World.eventEmitter with type safety
|
|
12
|
+
* - Agent message filtering with mention detection and turn limits
|
|
13
|
+
* - Auto-mention logic with loop prevention and world tags (<world>STOP|TO:a,b</world>)
|
|
14
|
+
* - Message threading with replyToMessageId preservation
|
|
15
|
+
* - Event persistence with automatic chatId defaulting to world.currentChatId
|
|
16
|
+
* - Tool approval system with session/one-time approval tracking
|
|
17
|
+
* - Chat title generation on world idle events
|
|
18
|
+
*
|
|
19
|
+
* Recent Changes (2025-11):
|
|
20
|
+
* - Fixed tool event metadata validation errors: Added required ownerAgentId and
|
|
21
|
+
* triggeredByMessageId fields to toolHandler, added validation guards to reject
|
|
22
|
+
* tool events missing messageId or agentName
|
|
23
|
+
* - Removed unnecessary 'info' event emission from tool-utils.ts to prevent validation errors
|
|
24
|
+
* - Fixed approval response broadcast bug: Removed HUMAN check from shouldAutoMention to ensure
|
|
25
|
+
* agent responses to HUMAN approval messages include proper targeting mentions (@HUMAN),
|
|
26
|
+
* preventing unintended broadcast to all agents
|
|
27
|
+
* - Consolidated redundant logging and streamlined approval checking
|
|
28
|
+
* - Added tool_calls/tool_call_id persistence for approval messages
|
|
29
|
+
* - Pre-generate message IDs for agent responses
|
|
30
|
+
* - Fixed activity tracking to prevent premature idle signals
|
|
31
|
+
*/
|
|
32
|
+
import { World, Agent, WorldMessageEvent, WorldSSEEvent, WorldToolEvent, AgentMessage } from './types.js';
|
|
33
|
+
export declare function enableStreaming(): void;
|
|
34
|
+
export declare function disableStreaming(): void;
|
|
35
|
+
/**
|
|
36
|
+
* Publish CRUD event for agent, chat, or world configuration changes
|
|
37
|
+
* Allows subscribed clients to receive real-time updates for all CRUD operations
|
|
38
|
+
*/
|
|
39
|
+
export declare function publishCRUDEvent(world: World, operation: 'create' | 'update' | 'delete', entityType: 'agent' | 'chat' | 'world', entityId: string, entityData?: any): void;
|
|
40
|
+
/**
|
|
41
|
+
* Setup automatic event persistence listeners on World event emitter.
|
|
42
|
+
* Should be called once during World initialization.
|
|
43
|
+
*
|
|
44
|
+
* Events are persisted synchronously/awaitable for reliability.
|
|
45
|
+
* Failures are logged but don't block event emission.
|
|
46
|
+
* Returns a cleanup function to remove listeners.
|
|
47
|
+
*
|
|
48
|
+
* Environment variables:
|
|
49
|
+
* - DISABLE_EVENT_PERSISTENCE=true: Skip all persistence
|
|
50
|
+
*/
|
|
51
|
+
export declare function setupEventPersistence(world: World): () => void;
|
|
52
|
+
/**
|
|
53
|
+
* Publish event to a specific channel using World.eventEmitter
|
|
54
|
+
*/
|
|
55
|
+
export declare function publishEvent(world: World, type: string, content: any): void;
|
|
56
|
+
/**
|
|
57
|
+
* Message publishing using World.eventEmitter with chat session management
|
|
58
|
+
* Parses enhanced string protocol and automatically prepends @mention if agentId detected
|
|
59
|
+
* Returns the messageEvent so callers can access the generated messageId
|
|
60
|
+
*
|
|
61
|
+
* @param chatId - Optional chat ID. If not provided, uses world.currentChatId
|
|
62
|
+
* @param replyToMessageId - Optional parent message ID for threading
|
|
63
|
+
*/
|
|
64
|
+
export declare function publishMessage(world: World, content: string, sender: string, chatId?: string | null, replyToMessageId?: string): WorldMessageEvent;
|
|
65
|
+
/**
|
|
66
|
+
* Message publishing with pre-generated messageId
|
|
67
|
+
* Used when messageId needs to be known before publishing (e.g., for agent responses)
|
|
68
|
+
*
|
|
69
|
+
* @param chatId - Optional chat ID. If not provided, uses world.currentChatId
|
|
70
|
+
* @param replyToMessageId - Optional parent message ID for threading
|
|
71
|
+
*/
|
|
72
|
+
export declare function publishMessageWithId(world: World, content: string, sender: string, messageId: string, chatId?: string | null, replyToMessageId?: string): WorldMessageEvent;
|
|
73
|
+
export declare function subscribeToMessages(world: World, handler: (event: WorldMessageEvent) => void): () => void;
|
|
74
|
+
/**
|
|
75
|
+
* SSE events using World.eventEmitter (for LLM streaming)
|
|
76
|
+
*/
|
|
77
|
+
export declare function publishSSE(world: World, data: Partial<WorldSSEEvent>): void;
|
|
78
|
+
/**
|
|
79
|
+
* Tool events using World.eventEmitter (for agent behavioral events)
|
|
80
|
+
*/
|
|
81
|
+
export declare function publishToolEvent(world: World, data: Partial<WorldToolEvent>): void;
|
|
82
|
+
/**
|
|
83
|
+
* Publish approval request event
|
|
84
|
+
* Used when a tool requires approval before execution
|
|
85
|
+
* Note: This function is legacy - approval requests now use direct message events
|
|
86
|
+
* with OpenAI tool call protocol (see tool-utils.ts)
|
|
87
|
+
*/
|
|
88
|
+
export declare function publishApprovalRequest(world: World, approvalRequest: any, agentId: string, messageId: string): void;
|
|
89
|
+
/**
|
|
90
|
+
* SSE subscription using World.eventEmitter
|
|
91
|
+
*/
|
|
92
|
+
export declare function subscribeToSSE(world: World, handler: (event: WorldSSEEvent) => void): () => void;
|
|
93
|
+
export declare function hasAnyMentionAtBeginning(response: string): boolean;
|
|
94
|
+
export declare function removeMentionsFromParagraphBeginnings(text: string, specificMention?: string): string;
|
|
95
|
+
export declare function addAutoMention(response: string, sender: string): string;
|
|
96
|
+
export declare function getValidMentions(response: string, agentId: string): string[];
|
|
97
|
+
export declare function shouldAutoMention(response: string, sender: string, agentId: string): boolean;
|
|
98
|
+
export declare function removeSelfMentions(response: string, agentId: string): string; /**
|
|
99
|
+
* Agent subscription with automatic message processing
|
|
100
|
+
*/
|
|
101
|
+
export declare function subscribeAgentToMessages(world: World, agent: Agent): () => void;
|
|
102
|
+
/**
|
|
103
|
+
* Save incoming message to agent memory with auto-save
|
|
104
|
+
*/
|
|
105
|
+
export declare function saveIncomingMessageToMemory(world: World, agent: Agent, messageEvent: WorldMessageEvent): Promise<void>;
|
|
106
|
+
/**
|
|
107
|
+
* Agent message processing with LLM response generation and auto-mention logic
|
|
108
|
+
*/
|
|
109
|
+
export declare function processAgentMessage(world: World, agent: Agent, messageEvent: WorldMessageEvent): Promise<void>;
|
|
110
|
+
/**
|
|
111
|
+
* Reset LLM call count for human/world messages with persistence
|
|
112
|
+
*/
|
|
113
|
+
export declare function resetLLMCallCountIfNeeded(world: World, agent: Agent, messageEvent: WorldMessageEvent): Promise<void>;
|
|
114
|
+
/**
|
|
115
|
+
* Enhanced message filtering logic with turn limits and mention detection
|
|
116
|
+
*/
|
|
117
|
+
export declare function shouldAgentRespond(world: World, agent: Agent, messageEvent: WorldMessageEvent): Promise<boolean>;
|
|
118
|
+
/**
|
|
119
|
+
* Subscribe world to messages with cleanup function
|
|
120
|
+
*/
|
|
121
|
+
export declare function subscribeWorldToMessages(world: World): () => void;
|
|
122
|
+
/**
|
|
123
|
+
* Setup world activity listener for chat title updates
|
|
124
|
+
* Triggers title generation when world becomes idle (pendingOperations === 0)
|
|
125
|
+
*/
|
|
126
|
+
export declare function setupWorldActivityListener(world: World): () => void;
|
|
127
|
+
/**
|
|
128
|
+
* Check if a specific tool requires approval based on message history
|
|
129
|
+
* Simplified: Only checks for session-wide approval, not one-time or denials
|
|
130
|
+
*
|
|
131
|
+
* Logic:
|
|
132
|
+
* 1. Search for session approval → Execute immediately
|
|
133
|
+
* 2. No session approval → Request approval
|
|
134
|
+
*
|
|
135
|
+
* @param context - Execution context with workingDirectory (CRITICAL FIX: AR Issue #1)
|
|
136
|
+
*/
|
|
137
|
+
export declare function checkToolApproval(world: World, toolName: string, toolArgs: any, message: string, messages: AgentMessage[], context?: {
|
|
138
|
+
workingDirectory?: string;
|
|
139
|
+
[key: string]: any;
|
|
140
|
+
}): Promise<{
|
|
141
|
+
needsApproval: boolean;
|
|
142
|
+
canExecute: boolean;
|
|
143
|
+
approvalRequest?: any;
|
|
144
|
+
reason?: string;
|
|
145
|
+
}>;
|
|
146
|
+
/**
|
|
147
|
+
* Find session-wide approval for a tool in message history
|
|
148
|
+
* Supports both enhanced string protocol (JSON) and legacy text parsing
|
|
149
|
+
*
|
|
150
|
+
* Session approval matches on:
|
|
151
|
+
* - Tool name (required)
|
|
152
|
+
* - Working directory (if provided)
|
|
153
|
+
* - Parameters (exact match)
|
|
154
|
+
*
|
|
155
|
+
* Enhanced protocol format:
|
|
156
|
+
* {
|
|
157
|
+
* role: 'tool',
|
|
158
|
+
* tool_call_id: 'approval_...',
|
|
159
|
+
* content: '{"__type":"tool_result","content":"{\"decision\":\"approve\",\"scope\":\"session\",\"toolName\":\"...\",\"toolArgs\":{...},\"workingDirectory\":\"...\"}"}'
|
|
160
|
+
* }
|
|
161
|
+
*/
|
|
162
|
+
export declare function findSessionApproval(messages: AgentMessage[], toolName: string, toolArgs?: any, workingDirectory?: string): {
|
|
163
|
+
decision: 'approve';
|
|
164
|
+
scope: 'session';
|
|
165
|
+
toolName: string;
|
|
166
|
+
} | undefined;
|
|
167
|
+
/**
|
|
168
|
+
* @deprecated This function is no longer used in approval checking logic.
|
|
169
|
+
* One-time approvals are consumed after tool execution, checking for them is redundant.
|
|
170
|
+
* Kept for backwards compatibility only.
|
|
171
|
+
*/
|
|
172
|
+
export declare function findRecentApproval(messages: AgentMessage[], toolName: string): {
|
|
173
|
+
decision: 'approve' | 'deny';
|
|
174
|
+
scope: 'once';
|
|
175
|
+
toolName: string;
|
|
176
|
+
} | undefined;
|
|
177
|
+
/**
|
|
178
|
+
* @deprecated This function is no longer used in approval checking logic.
|
|
179
|
+
* Users should be allowed to change their mind about denials.
|
|
180
|
+
* Kept for backwards compatibility only.
|
|
181
|
+
*/
|
|
182
|
+
export declare function findRecentDenial(messages: AgentMessage[], toolName: string): {
|
|
183
|
+
decision: 'deny';
|
|
184
|
+
toolName: string;
|
|
185
|
+
} | undefined;
|
|
186
|
+
//# sourceMappingURL=events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../core/events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EACL,KAAK,EAAE,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,cAAc,EAC9D,YAAY,EACb,MAAM,YAAY,CAAC;AA6BpB,wBAAgB,eAAe,IAAI,IAAI,CAAmC;AAC1E,wBAAgB,gBAAgB,IAAI,IAAI,CAAoC;AAE5E;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,QAAQ,GAAG,QAAQ,GAAG,QAAQ,EACzC,UAAU,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,EACtC,QAAQ,EAAE,MAAM,EAChB,UAAU,CAAC,EAAE,GAAG,GACf,IAAI,CAkBN;AAaD;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,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