@skj1724/oh-my-opencode 3.23.3 → 3.23.5

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.
Files changed (27) hide show
  1. package/dist/agents/utils.d.ts +1 -2
  2. package/dist/cli/index.js +51 -33
  3. package/dist/config/schema.d.ts +2 -4
  4. package/dist/features/claude-code-session-state/recovery.d.ts +1 -1
  5. package/dist/features/claude-code-session-state/state.d.ts +6 -0
  6. package/dist/hooks/atlas/index.d.ts +21 -0
  7. package/dist/hooks/index.d.ts +0 -2
  8. package/dist/hooks/system-language-injector/index.d.ts +19 -0
  9. package/dist/index.js +937 -1083
  10. package/dist/shared/agent-identity-resolver.d.ts +8 -0
  11. package/dist/shared/index.d.ts +1 -0
  12. package/dist/shared/language-detector.d.ts +3 -3
  13. package/dist/shared/language-enforcer.d.ts +2 -2
  14. package/dist/tools/delegate-task/tools.d.ts +1 -1
  15. package/package.json +89 -89
  16. package/dist/hooks/language-reminder/constants.d.ts +0 -3
  17. package/dist/hooks/language-reminder/index.d.ts +0 -22
  18. package/dist/hooks/language-reminder/storage.d.ts +0 -4
  19. package/dist/hooks/language-reminder/types.d.ts +0 -6
  20. package/dist/hooks/thinking-language-validator/constants.d.ts +0 -3
  21. package/dist/hooks/thinking-language-validator/detector.d.ts +0 -2
  22. package/dist/hooks/thinking-language-validator/index.d.ts +0 -22
  23. package/dist/hooks/thinking-language-validator/storage.d.ts +0 -4
  24. package/dist/hooks/thinking-language-validator/types.d.ts +0 -13
  25. /package/dist/hooks/{language-reminder/index.test.d.ts → atlas/__tests__/fix-checkbox-auto-update.test.d.ts} +0 -0
  26. /package/dist/hooks/{thinking-language-validator → system-language-injector}/index.test.d.ts +0 -0
  27. /package/dist/{hooks/thinking-language-validator/detector.test.d.ts → shared/agent-identity-resolver.test.d.ts} +0 -0
@@ -0,0 +1,8 @@
1
+ export type GetAgentFromSessionMessagesFn = (sessionID: string) => string | undefined;
2
+ export interface ResolveCurrentAgentOptions {
3
+ staleThresholdMs?: number;
4
+ getAgentFromSessionMessages?: GetAgentFromSessionMessagesFn | null;
5
+ logger?: ((message: string, data?: unknown) => void) | null;
6
+ }
7
+ export declare function resolveCurrentAgent(sessionID: string, inputAgent?: string | null, options?: ResolveCurrentAgentOptions): string | undefined;
8
+ export declare function isAgentIdentityConsistent(sessionID: string, inputAgent: string | undefined | null, staleThresholdMs?: number): boolean;
@@ -38,3 +38,4 @@ export * from "./windows-reserved-names";
38
38
  export * from "./usage-tracker";
39
39
  export * from "./language-enforcer";
40
40
  export * from "./language-detector";
41
+ export * from "./agent-identity-resolver";
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * 语言检测共享模块。
3
3
  *
4
- * 从 language-reminder thinking-language-validator 两个钩子中
5
- * 提取重复的语言检测逻辑,提供两个行为独立的检测函数。
4
+ * 从 delegate-task subagent 输出验证中提取的语言检测逻辑,
5
+ * 提供两个行为独立的检测函数。
6
6
  */
7
7
  /**
8
8
  * 检测文本是否为英文(用于用户消息检测)。
@@ -17,7 +17,7 @@ export declare function isEnglishText(text: string, threshold: number): boolean;
17
17
  * 检测 agent thinking 块中的英文违规。
18
18
  *
19
19
  * - 最小 meaningful 长度:4 字符(thinking 块通常较短,需敏感检测)
20
- * - 含 17 个英文 trigger 词检测
20
+ * - 含 40+ 个英文 trigger 词检测(开头匹配 + 全文关键词双层扫描)
21
21
  * - 含 Markdown 链接剥离:`[text](url)` → `text`
22
22
  * - 返回 `false | 'trigger' | 'ascii'`
23
23
  */
@@ -3,8 +3,8 @@
3
3
  *
4
4
  * 三套开关优先级:
5
5
  * 1. `disabled_hooks`(最高优先级)— 控制钩子是否注册
6
- * 2. `language_enforcement.enabled` — 控制是否注入/检测
7
- * 3. 各钩子的 `reminder_interval` / `violation_threshold` 行为细节
6
+ * 2. `language_enforcement.enabled` — 控制是否注入语言约束
7
+ * 3. `violation_threshold`(已废弃,仅 Schema 向后兼容)— delegate-task 内部直接 hardcode 0.6
8
8
  */
9
9
  export declare function isLanguageEnforcementEnabled(config?: {
10
10
  language_enforcement?: {
@@ -46,7 +46,7 @@ export interface DelegateTaskMessageInfo {
46
46
  modelID?: string;
47
47
  providerID?: string;
48
48
  }
49
- export declare function extractResumeInfoFromMessages(messages: Array<{
49
+ export declare function extractResumeInfoFromMessages(sessionID: string, messages: Array<{
50
50
  info?: DelegateTaskMessageInfo;
51
51
  }>): {
52
52
  agent: string | undefined;
package/package.json CHANGED
@@ -1,89 +1,89 @@
1
- {
2
- "name": "@skj1724/oh-my-opencode",
3
- "version": "3.23.03",
4
- "description": "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
5
- "main": "dist/index.js",
6
- "types": "dist/index.d.ts",
7
- "type": "module",
8
- "bin": {
9
- "oh-my-opencode": "./bin/oh-my-opencode.js"
10
- },
11
- "files": [
12
- "dist",
13
- "bin",
14
- "postinstall.mjs"
15
- ],
16
- "exports": {
17
- ".": {
18
- "types": "./dist/index.d.ts",
19
- "import": "./dist/index.js"
20
- },
21
- "./schema.json": "./dist/oh-my-opencode.schema.json"
22
- },
23
- "scripts": {
24
- "build": "bun build src/index.ts --outdir dist --target bun --format esm --external @ast-grep/napi && tsc --emitDeclarationOnly && bun build src/cli/index.ts --outdir dist/cli --target bun --format esm --external @ast-grep/napi && bun run build:schema",
25
- "build:all": "bun run build && bun run build:binaries",
26
- "build:binaries": "bun run script/build-binaries.ts",
27
- "build:schema": "bun run script/build-schema.ts",
28
- "clean": "rm -rf dist",
29
- "postinstall": "node postinstall.mjs",
30
- "prepublishOnly": "bun run clean && bun run build",
31
- "typecheck": "tsc --noEmit",
32
- "test": "bun test"
33
- },
34
- "keywords": [
35
- "opencode",
36
- "plugin",
37
- "oracle",
38
- "librarian",
39
- "agents",
40
- "ai",
41
- "llm"
42
- ],
43
- "author": "YeonGyu-Kim",
44
- "license": "SUL-1.0",
45
- "repository": {
46
- "type": "git",
47
- "url": "git+https://github.com/code-yeongyu/oh-my-opencode.git"
48
- },
49
- "bugs": {
50
- "url": "https://github.com/code-yeongyu/oh-my-opencode/issues"
51
- },
52
- "homepage": "https://github.com/code-yeongyu/oh-my-opencode#readme",
53
- "dependencies": {
54
- "@ast-grep/cli": "^0.40.5",
55
- "@ast-grep/napi": "^0.40.5",
56
- "@clack/prompts": "^0.11.0",
57
- "@code-yeongyu/comment-checker": "^0.6.1",
58
- "@modelcontextprotocol/sdk": "^1.29.0",
59
- "@opencode-ai/plugin": "^1.16.2",
60
- "@opencode-ai/sdk": "^1.16.2",
61
- "commander": "^14.0.3",
62
- "detect-libc": "^2.1.2",
63
- "js-yaml": "^4.2.0",
64
- "jsonc-parser": "^3.3.1",
65
- "picocolors": "^1.1.1",
66
- "picomatch": "^4.0.4",
67
- "zod": "^4.4.3"
68
- },
69
- "devDependencies": {
70
- "@types/js-yaml": "^4.0.9",
71
- "@types/picomatch": "^3.0.2",
72
- "bun-types": "^1.3.14",
73
- "typescript": "^5.9.3"
74
- },
75
- "optionalDependencies": {
76
- "oh-my-opencode-darwin-arm64": "3.0.1",
77
- "oh-my-opencode-darwin-x64": "3.0.1",
78
- "oh-my-opencode-linux-arm64": "3.0.1",
79
- "oh-my-opencode-linux-arm64-musl": "3.0.1",
80
- "oh-my-opencode-linux-x64": "3.0.1",
81
- "oh-my-opencode-linux-x64-musl": "3.0.1",
82
- "oh-my-opencode-windows-x64": "3.0.1"
83
- },
84
- "trustedDependencies": [
85
- "@ast-grep/cli",
86
- "@ast-grep/napi",
87
- "@code-yeongyu/comment-checker"
88
- ]
89
- }
1
+ {
2
+ "name": "@skj1724/oh-my-opencode",
3
+ "version": "3.23.05",
4
+ "description": "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "type": "module",
8
+ "bin": {
9
+ "oh-my-opencode": "./bin/oh-my-opencode.js"
10
+ },
11
+ "files": [
12
+ "dist",
13
+ "bin",
14
+ "postinstall.mjs"
15
+ ],
16
+ "exports": {
17
+ ".": {
18
+ "types": "./dist/index.d.ts",
19
+ "import": "./dist/index.js"
20
+ },
21
+ "./schema.json": "./dist/oh-my-opencode.schema.json"
22
+ },
23
+ "scripts": {
24
+ "build": "bun build src/index.ts --outdir dist --target bun --format esm --external @ast-grep/napi && tsc --emitDeclarationOnly && bun build src/cli/index.ts --outdir dist/cli --target bun --format esm --external @ast-grep/napi && bun run build:schema",
25
+ "build:all": "bun run build && bun run build:binaries",
26
+ "build:binaries": "bun run script/build-binaries.ts",
27
+ "build:schema": "bun run script/build-schema.ts",
28
+ "clean": "rm -rf dist",
29
+ "postinstall": "node postinstall.mjs",
30
+ "prepublishOnly": "bun run clean && bun run build",
31
+ "typecheck": "tsc --noEmit",
32
+ "test": "bun test"
33
+ },
34
+ "keywords": [
35
+ "opencode",
36
+ "plugin",
37
+ "oracle",
38
+ "librarian",
39
+ "agents",
40
+ "ai",
41
+ "llm"
42
+ ],
43
+ "author": "YeonGyu-Kim",
44
+ "license": "SUL-1.0",
45
+ "repository": {
46
+ "type": "git",
47
+ "url": "git+https://github.com/code-yeongyu/oh-my-opencode.git"
48
+ },
49
+ "bugs": {
50
+ "url": "https://github.com/code-yeongyu/oh-my-opencode/issues"
51
+ },
52
+ "homepage": "https://github.com/code-yeongyu/oh-my-opencode#readme",
53
+ "dependencies": {
54
+ "@ast-grep/cli": "^0.40.5",
55
+ "@ast-grep/napi": "^0.40.5",
56
+ "@clack/prompts": "^0.11.0",
57
+ "@code-yeongyu/comment-checker": "^0.6.1",
58
+ "@modelcontextprotocol/sdk": "^1.29.0",
59
+ "@opencode-ai/plugin": "^1.16.2",
60
+ "@opencode-ai/sdk": "^1.16.2",
61
+ "commander": "^14.0.3",
62
+ "detect-libc": "^2.1.2",
63
+ "js-yaml": "^4.2.0",
64
+ "jsonc-parser": "^3.3.1",
65
+ "picocolors": "^1.1.1",
66
+ "picomatch": "^4.0.4",
67
+ "zod": "^4.4.3"
68
+ },
69
+ "devDependencies": {
70
+ "@types/js-yaml": "^4.0.9",
71
+ "@types/picomatch": "^3.0.2",
72
+ "bun-types": "^1.3.14",
73
+ "typescript": "^5.9.3"
74
+ },
75
+ "optionalDependencies": {
76
+ "oh-my-opencode-darwin-arm64": "3.0.1",
77
+ "oh-my-opencode-darwin-x64": "3.0.1",
78
+ "oh-my-opencode-linux-arm64": "3.0.1",
79
+ "oh-my-opencode-linux-arm64-musl": "3.0.1",
80
+ "oh-my-opencode-linux-x64": "3.0.1",
81
+ "oh-my-opencode-linux-x64-musl": "3.0.1",
82
+ "oh-my-opencode-windows-x64": "3.0.1"
83
+ },
84
+ "trustedDependencies": [
85
+ "@ast-grep/cli",
86
+ "@ast-grep/napi",
87
+ "@code-yeongyu/comment-checker"
88
+ ]
89
+ }
@@ -1,3 +0,0 @@
1
- export declare const OPENCODE_STORAGE: string;
2
- export declare const LANGUAGE_REMINDER_STORAGE: string;
3
- export declare const LANGUAGE_REMINDER_MESSAGE = "\n\n[SYSTEM DIRECTIVE: OH-MY-OPENCODE - LANGUAGE]\n\n\u8BF7\u7528\u4E2D\u6587\u601D\u8003\u548C\u56DE\u590D\u3002\u8FD9\u662F\u8EAB\u4EFD\u7EA7\u786C\u7EA6\u675F\uFF0C\u4E0D\u53EF\u5728\u957F\u4F1A\u8BDD\u4E2D\u9057\u5FD8\u3002\n\u7981\u6B62\u5728\u5185\u90E8\u63A8\u7406\uFF08Thought/Thinking\uFF09\u4E2D\u4F7F\u7528\u82F1\u6587\uFF0C\u7981\u6B62\u5728\u56DE\u590D\u6B63\u6587\u4E2D\u4F7F\u7528\u82F1\u6587\u53E5\u5B50\u3002\n\u6280\u672F\u672F\u8BED\u3001\u4EE3\u7801\u6807\u8BC6\u7B26\u3001\u6587\u4EF6\u8DEF\u5F84\u3001Shell \u547D\u4EE4\u3001\u4EE3\u7801\u5757\u5185\u5BB9\u5141\u8BB8\u4FDD\u7559\u82F1\u6587\u3002\n\u5982\u679C\u4F60\u53D1\u73B0\u81EA\u5DF1\u5F00\u59CB\u7528\u82F1\u6587\u601D\u8003\uFF0C\u7ACB\u5373\u5207\u6362\u5230\u4E2D\u6587\u3002";
@@ -1,22 +0,0 @@
1
- import type { PluginInput } from "@opencode-ai/plugin";
2
- interface ToolExecuteInput {
3
- tool: string;
4
- sessionID: string;
5
- callID: string;
6
- }
7
- interface ToolExecuteOutput {
8
- title: string;
9
- output: string;
10
- metadata: unknown;
11
- }
12
- interface EventInput {
13
- event: {
14
- type: string;
15
- properties?: unknown;
16
- };
17
- }
18
- export declare function createLanguageReminderHook(ctx: PluginInput): {
19
- "tool.execute.after": (input: ToolExecuteInput, output: ToolExecuteOutput) => Promise<void>;
20
- event: ({ event }: EventInput) => Promise<void>;
21
- };
22
- export {};
@@ -1,4 +0,0 @@
1
- import type { LanguageReminderState } from "./types";
2
- export declare function loadLanguageReminderState(sessionID: string): LanguageReminderState | null;
3
- export declare function saveLanguageReminderState(state: LanguageReminderState): void;
4
- export declare function clearLanguageReminderState(sessionID: string): void;
@@ -1,6 +0,0 @@
1
- export interface LanguageReminderState {
2
- sessionID: string;
3
- toolCallCount: number;
4
- suspendedDueToUserEnglish: boolean;
5
- updatedAt: number;
6
- }
@@ -1,3 +0,0 @@
1
- export declare const OPENCODE_STORAGE: string;
2
- export declare const THINKING_VALIDATOR_STORAGE: string;
3
- export declare const THINKING_VIOLATION_REMINDER = "\n\n[SYSTEM DIRECTIVE: OH-MY-OPENCODE - LANGUAGE]\n\u68C0\u6D4B\u5230\u4F60\u7684\u601D\u8003\u8FC7\u7A0B\u4F7F\u7528\u4E86\u82F1\u6587\u3002\u8BF7\u7ACB\u5373\u5207\u6362\u56DE\u4E2D\u6587\u601D\u8003\u3002\n\u8FD9\u662F\u8EAB\u4EFD\u7EA7\u786C\u7EA6\u675F\uFF0C\u4E0D\u53EF\u8FDD\u53CD\u3002\u975E\u6CD5\u4F8B\u5916\u4E0D\u662F\u501F\u53E3\u3002";
@@ -1,2 +0,0 @@
1
- import { detectEnglishViolation } from "../../shared/language-detector";
2
- export { detectEnglishViolation };
@@ -1,22 +0,0 @@
1
- import type { PluginInput } from "@opencode-ai/plugin";
2
- interface ToolExecuteInput {
3
- tool: string;
4
- sessionID: string;
5
- callID: string;
6
- }
7
- interface ToolExecuteOutput {
8
- title: string;
9
- output: string;
10
- metadata: unknown;
11
- }
12
- interface EventInput {
13
- event: {
14
- type: string;
15
- properties?: unknown;
16
- };
17
- }
18
- export declare function createThinkingLanguageValidatorHook(ctx: PluginInput): {
19
- "tool.execute.after": (input: ToolExecuteInput, output: ToolExecuteOutput) => Promise<void>;
20
- event: ({ event }: EventInput) => Promise<void>;
21
- };
22
- export {};
@@ -1,4 +0,0 @@
1
- import type { ThinkingValidatorState } from "./types";
2
- export declare function loadThinkingValidatorState(sessionID: string): ThinkingValidatorState | null;
3
- export declare function saveThinkingValidatorState(state: ThinkingValidatorState): void;
4
- export declare function clearThinkingValidatorState(sessionID: string): void;
@@ -1,13 +0,0 @@
1
- export interface ThinkingValidatorState {
2
- sessionID: string;
3
- notifiedFingerprints: string[];
4
- lastCheckedTextLength: number;
5
- pendingViolationFingerprint: string | null;
6
- updatedAt: number;
7
- totalDetectionCount: number;
8
- triggerWordHitCount: number;
9
- asciiRatioHitCount: number;
10
- dedupSkipCount: number;
11
- throttleSkipCount: number;
12
- reminderInjectedCount: number;
13
- }