@makefinks/daemon 0.6.0 → 0.7.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 +4 -0
- package/package.json +6 -4
- package/src/ai/daemon-ai.ts +48 -8
- package/src/ai/memory/index.ts +6 -0
- package/src/ai/memory/memory-injection.ts +80 -0
- package/src/ai/memory/memory-manager.ts +320 -0
- package/src/ai/model-config.ts +13 -0
- package/src/ai/system-prompt.ts +29 -5
- package/src/app/components/AppOverlays.tsx +3 -0
- package/src/avatar/DaemonAvatarRenderable.ts +0 -22
- package/src/components/HotkeysPane.tsx +1 -0
- package/src/components/MemoryMenu.tsx +338 -0
- package/src/hooks/use-app-context-builder.ts +2 -0
- package/src/hooks/use-app-controller.ts +8 -0
- package/src/hooks/use-app-menus.ts +6 -0
- package/src/hooks/use-daemon-keyboard.ts +17 -1
- package/src/hooks/use-overlay-controller.ts +6 -0
- package/src/state/app-context.tsx +2 -0
- package/src/state/daemon-state.ts +9 -1
- package/src/types/index.ts +36 -0
- package/src/utils/config.ts +65 -0
- package/src/utils/debug-logger.ts +3 -0
- package/src/utils/markdown.ts +14 -0
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
* Then run `tail -f ~/.config/daemon/logs/debug.log` in a separate terminal.
|
|
10
10
|
* Tool-specific logging uses `~/.config/daemon/logs/tools.log`.
|
|
11
11
|
* Message logging uses `~/.config/daemon/logs/messages.log`.
|
|
12
|
+
* Memory logging uses `~/.config/daemon/logs/memory.log`.
|
|
12
13
|
*/
|
|
13
14
|
|
|
14
15
|
import fs from "node:fs";
|
|
@@ -19,6 +20,7 @@ const LOG_DIR = path.join(getAppConfigDir(), "logs");
|
|
|
19
20
|
const LOG_FILE = path.join(LOG_DIR, "debug.log");
|
|
20
21
|
const TOOLS_LOG_FILE = path.join(LOG_DIR, "tools.log");
|
|
21
22
|
const MESSAGES_LOG_FILE = path.join(LOG_DIR, "messages.log");
|
|
23
|
+
const MEMORY_LOG_FILE = path.join(LOG_DIR, "memory.log");
|
|
22
24
|
const ENABLED = process.env.DEBUG_LOG === "1" || process.env.DEBUG_LOG === "true";
|
|
23
25
|
|
|
24
26
|
function ensureLogDir(logDir: string): void {
|
|
@@ -78,3 +80,4 @@ function createDebugLogger(logFile: string) {
|
|
|
78
80
|
export const debug = createDebugLogger(LOG_FILE);
|
|
79
81
|
export const toolDebug = createDebugLogger(TOOLS_LOG_FILE);
|
|
80
82
|
export const messageDebug = createDebugLogger(MESSAGES_LOG_FILE);
|
|
83
|
+
export const memoryDebug = createDebugLogger(MEMORY_LOG_FILE);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { formatMarkdownTables } from "./markdown-tables";
|
|
2
|
+
|
|
3
|
+
export interface MarkdownRenderOptions {
|
|
4
|
+
maxWidth?: number;
|
|
5
|
+
streaming?: boolean;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export async function renderMarkdown(text: string, options: MarkdownRenderOptions = {}): Promise<string> {
|
|
9
|
+
const trimmed = options.streaming ? text : text.trimEnd();
|
|
10
|
+
if (options.streaming) {
|
|
11
|
+
return trimmed;
|
|
12
|
+
}
|
|
13
|
+
return formatMarkdownTables(trimmed, { maxWidth: options.maxWidth });
|
|
14
|
+
}
|