From b0ab34b568397e356962879bf2d6103617849707 Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Sat, 14 Mar 2026 12:43:40 +0900 Subject: [PATCH] feat(shared): add plugin identity constants for package name migration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add centralized plugin identity constants to support migration from oh-my-opencode to oh-my-openagent. Includes both current and legacy names for backward compatibility. 🤖 Generated with assistance of OhMyOpenCode --- src/shared/index.ts | 1 + src/shared/plugin-identity.test.ts | 89 ++++++++++++++++++++++++++++++ src/shared/plugin-identity.ts | 7 +++ 3 files changed, 97 insertions(+) create mode 100644 src/shared/plugin-identity.test.ts create mode 100644 src/shared/plugin-identity.ts diff --git a/src/shared/index.ts b/src/shared/index.ts index fce869512..39fcc18ea 100644 --- a/src/shared/index.ts +++ b/src/shared/index.ts @@ -64,3 +64,4 @@ export * from "./prompt-tools" export * from "./internal-initiator-marker" export * from "./plugin-command-discovery" export { SessionCategoryRegistry } from "./session-category-registry" +export * from "./plugin-identity" diff --git a/src/shared/plugin-identity.test.ts b/src/shared/plugin-identity.test.ts new file mode 100644 index 000000000..e727d5134 --- /dev/null +++ b/src/shared/plugin-identity.test.ts @@ -0,0 +1,89 @@ +import { describe, it, expect } from "bun:test" +import { + PLUGIN_NAME, + LEGACY_PLUGIN_NAME, + CONFIG_BASENAME, + LEGACY_CONFIG_BASENAME, + LOG_FILENAME, + CACHE_DIR_NAME, + LEGACY_CACHE_DIR_NAME, +} from "./plugin-identity" + +describe("plugin-identity constants", () => { + describe("PLUGIN_NAME", () => { + it("equals oh-my-openagent", () => { + // given + + // when + + // then + expect(PLUGIN_NAME).toBe("oh-my-openagent") + }) + }) + + describe("LEGACY_PLUGIN_NAME", () => { + it("equals oh-my-opencode", () => { + // given + + // when + + // then + expect(LEGACY_PLUGIN_NAME).toBe("oh-my-opencode") + }) + }) + + describe("CONFIG_BASENAME", () => { + it("equals oh-my-openagent", () => { + // given + + // when + + // then + expect(CONFIG_BASENAME).toBe("oh-my-openagent") + }) + }) + + describe("LEGACY_CONFIG_BASENAME", () => { + it("equals oh-my-opencode", () => { + // given + + // when + + // then + expect(LEGACY_CONFIG_BASENAME).toBe("oh-my-opencode") + }) + }) + + describe("LOG_FILENAME", () => { + it("equals oh-my-openagent.log", () => { + // given + + // when + + // then + expect(LOG_FILENAME).toBe("oh-my-openagent.log") + }) + }) + + describe("CACHE_DIR_NAME", () => { + it("equals oh-my-openagent", () => { + // given + + // when + + // then + expect(CACHE_DIR_NAME).toBe("oh-my-openagent") + }) + }) + + describe("LEGACY_CACHE_DIR_NAME", () => { + it("equals oh-my-opencode", () => { + // given + + // when + + // then + expect(LEGACY_CACHE_DIR_NAME).toBe("oh-my-opencode") + }) + }) +}) diff --git a/src/shared/plugin-identity.ts b/src/shared/plugin-identity.ts new file mode 100644 index 000000000..7a87587e0 --- /dev/null +++ b/src/shared/plugin-identity.ts @@ -0,0 +1,7 @@ +export const PLUGIN_NAME = "oh-my-openagent" +export const LEGACY_PLUGIN_NAME = "oh-my-opencode" +export const CONFIG_BASENAME = "oh-my-openagent" +export const LEGACY_CONFIG_BASENAME = "oh-my-opencode" +export const LOG_FILENAME = "oh-my-openagent.log" +export const CACHE_DIR_NAME = "oh-my-openagent" +export const LEGACY_CACHE_DIR_NAME = "oh-my-opencode"