Add onCompleted callback system for guaranteed console log delivery

- Add onCompleted() callback registration in RuntimeMessageBridge
- Modify wrapperFunction to call completion callbacks before returning
- Update ConsoleRuntimeProvider to immediate send + completion batch pattern
- Extract DOWNLOADABLE_FILE_RUNTIME_DESCRIPTION from ATTACHMENTS_RUNTIME_DESCRIPTION
- Logs sent immediately (fire-and-forget), unsent logs batched at completion
- Ensures all console logs arrive before tool execution completes
This commit is contained in:
Mario Zechner 2025-10-09 20:03:51 +02:00
parent b288cd9448
commit af0297cd16
4 changed files with 70 additions and 20 deletions

View file

@ -54,7 +54,10 @@ export { PersistentStorageDialog } from "./dialogs/PersistentStorageDialog.js";
export { SessionListDialog } from "./dialogs/SessionListDialog.js";
export { ApiKeysTab, ProxyTab, SettingsDialog, SettingsTab } from "./dialogs/SettingsDialog.js";
// Prompts
export { ARTIFACTS_RUNTIME_PROVIDER_DESCRIPTION } from "./prompts/tool-prompts.js";
export {
ARTIFACTS_RUNTIME_PROVIDER_DESCRIPTION,
DOWNLOADABLE_FILE_RUNTIME_DESCRIPTION,
} from "./prompts/tool-prompts.js";
// Storage
export { AppStorage, getAppStorage, setAppStorage } from "./storage/app-storage.js";
export { IndexedDBStorageBackend } from "./storage/backends/indexeddb-storage-backend.js";