From 324ecd872ea9befe41fd190681b8fcc4fd1d35ff Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Mon, 5 Jan 2026 13:52:11 +0900 Subject: [PATCH] feat(hook-message-injector): add ToolPermission type support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add ToolPermission type union: boolean | 'allow' | 'deny' | 'ask' Update StoredMessage and related interfaces for new permission format. 🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode) --- src/features/hook-message-injector/injector.ts | 4 ++-- src/features/hook-message-injector/types.ts | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/features/hook-message-injector/injector.ts b/src/features/hook-message-injector/injector.ts index e2fdafbc..9567a11a 100644 --- a/src/features/hook-message-injector/injector.ts +++ b/src/features/hook-message-injector/injector.ts @@ -1,12 +1,12 @@ import { existsSync, mkdirSync, readFileSync, readdirSync, writeFileSync } from "node:fs" import { join } from "node:path" import { MESSAGE_STORAGE, PART_STORAGE } from "./constants" -import type { MessageMeta, OriginalMessageContext, TextPart } from "./types" +import type { MessageMeta, OriginalMessageContext, TextPart, ToolPermission } from "./types" export interface StoredMessage { agent?: string model?: { providerID?: string; modelID?: string } - tools?: Record + tools?: Record } export function findNearestMessageWithFields(messageDir: string): StoredMessage | null { diff --git a/src/features/hook-message-injector/types.ts b/src/features/hook-message-injector/types.ts index 165a83df..47caaf93 100644 --- a/src/features/hook-message-injector/types.ts +++ b/src/features/hook-message-injector/types.ts @@ -1,3 +1,5 @@ +export type ToolPermission = boolean | "allow" | "deny" | "ask" + export interface MessageMeta { id: string sessionID: string @@ -15,7 +17,7 @@ export interface MessageMeta { cwd: string root: string } - tools?: Record + tools?: Record } export interface OriginalMessageContext { @@ -28,7 +30,7 @@ export interface OriginalMessageContext { cwd?: string root?: string } - tools?: Record + tools?: Record } export interface TextPart {