fix(build): import tool-display.json instead of fs.readFileSync (#312)
This commit is contained in:
committed by
GitHub
parent
967cef80bc
commit
4bb53e19f9
@@ -16,6 +16,7 @@
|
|||||||
- Groups: `whatsapp.groups`, `telegram.groups`, and `imessage.groups` now act as allowlists when set. Add `"*"` to keep allow-all behavior.
|
- Groups: `whatsapp.groups`, `telegram.groups`, and `imessage.groups` now act as allowlists when set. Add `"*"` to keep allow-all behavior.
|
||||||
|
|
||||||
### Fixes
|
### Fixes
|
||||||
|
- Build: import tool-display JSON as a module instead of runtime file reads. Thanks @mukhtharcm for PR #312.
|
||||||
- Messages: stop defaulting ack reactions to 👀 when identity emoji is missing.
|
- Messages: stop defaulting ack reactions to 👀 when identity emoji is missing.
|
||||||
- Auto-reply: require slash for control commands to avoid false triggers in normal text.
|
- Auto-reply: require slash for control commands to avoid false triggers in normal text.
|
||||||
- Auto-reply: treat steer during compaction as a follow-up, queued until compaction completes.
|
- Auto-reply: treat steer during compaction as a follow-up, queued until compaction completes.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import fs from "node:fs";
|
|
||||||
import { redactToolDetail } from "../logging/redact.js";
|
import { redactToolDetail } from "../logging/redact.js";
|
||||||
import { shortenHomeInString } from "../utils.js";
|
import { shortenHomeInString } from "../utils.js";
|
||||||
|
import TOOL_DISPLAY_JSON from "./tool-display.json" with { type: "json" };
|
||||||
|
|
||||||
type ToolDisplayActionSpec = {
|
type ToolDisplayActionSpec = {
|
||||||
label?: string;
|
label?: string;
|
||||||
@@ -30,17 +30,7 @@ export type ToolDisplay = {
|
|||||||
detail?: string;
|
detail?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
const TOOL_DISPLAY_CONFIG: ToolDisplayConfig = (() => {
|
const TOOL_DISPLAY_CONFIG = TOOL_DISPLAY_JSON as ToolDisplayConfig;
|
||||||
try {
|
|
||||||
const raw = fs.readFileSync(
|
|
||||||
new URL("./tool-display.json", import.meta.url),
|
|
||||||
"utf8",
|
|
||||||
);
|
|
||||||
return JSON.parse(raw) as ToolDisplayConfig;
|
|
||||||
} catch {
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
})();
|
|
||||||
const FALLBACK = TOOL_DISPLAY_CONFIG.fallback ?? { emoji: "🧩" };
|
const FALLBACK = TOOL_DISPLAY_CONFIG.fallback ?? { emoji: "🧩" };
|
||||||
const TOOL_MAP = TOOL_DISPLAY_CONFIG.tools ?? {};
|
const TOOL_MAP = TOOL_DISPLAY_CONFIG.tools ?? {};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user