feat(features): add hook message injector
- Port hook-message-injector from opencode-cc-plugin (4 files) - constants.ts: XDG-based path definitions (MESSAGE_STORAGE, PART_STORAGE) - types.ts: MessageMeta, OriginalMessageContext, TextPart interfaces - injector.ts: injectHookMessage() implementation with message/part storage - index.ts: Barrel export - Self-contained module with no import path changes needed - Preserves XDG_DATA_HOME environment variable support - Preserves message fallback logic for incomplete originalMessage 🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
import { join } from "node:path"
|
||||
import { homedir } from "node:os"
|
||||
|
||||
const xdgData = process.env.XDG_DATA_HOME || join(homedir(), ".local", "share")
|
||||
|
||||
export const OPENCODE_STORAGE = join(xdgData, "opencode", "storage")
|
||||
export const MESSAGE_STORAGE = join(OPENCODE_STORAGE, "message")
|
||||
export const PART_STORAGE = join(OPENCODE_STORAGE, "part")
|
||||
Reference in New Issue
Block a user