oh-my-opencode 0.3.4 → 0.4.1

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 (56) hide show
  1. package/README.ko.md +136 -37
  2. package/README.md +134 -35
  3. package/dist/auth/antigravity/constants.d.ts +36 -0
  4. package/dist/auth/antigravity/fetch.d.ts +68 -0
  5. package/dist/auth/antigravity/index.d.ts +13 -0
  6. package/dist/auth/antigravity/message-converter.d.ts +54 -0
  7. package/dist/auth/antigravity/oauth.d.ts +85 -0
  8. package/dist/auth/antigravity/plugin.d.ts +54 -0
  9. package/dist/auth/antigravity/project.d.ts +20 -0
  10. package/dist/auth/antigravity/request.d.ts +104 -0
  11. package/dist/auth/antigravity/response.d.ts +137 -0
  12. package/dist/auth/antigravity/thinking.d.ts +234 -0
  13. package/dist/auth/antigravity/thought-signature-store.d.ts +52 -0
  14. package/dist/auth/antigravity/token.d.ts +41 -0
  15. package/dist/auth/antigravity/tools.d.ts +119 -0
  16. package/dist/auth/antigravity/types.d.ts +173 -0
  17. package/dist/config/schema.d.ts +66 -66
  18. package/dist/features/background-agent/index.d.ts +2 -0
  19. package/dist/features/background-agent/manager.d.ts +37 -0
  20. package/dist/features/background-agent/types.d.ts +27 -0
  21. package/dist/google-auth.d.ts +3 -0
  22. package/dist/hooks/anthropic-auto-compact/types.d.ts +11 -0
  23. package/dist/hooks/auto-update-checker/cache.d.ts +1 -0
  24. package/dist/hooks/auto-update-checker/checker.d.ts +6 -0
  25. package/dist/hooks/auto-update-checker/constants.d.ts +8 -0
  26. package/dist/hooks/auto-update-checker/index.d.ts +12 -0
  27. package/dist/hooks/auto-update-checker/types.d.ts +19 -0
  28. package/dist/hooks/background-notification/index.d.ts +12 -0
  29. package/dist/hooks/background-notification/types.d.ts +4 -0
  30. package/dist/hooks/index.d.ts +5 -2
  31. package/dist/hooks/rules-injector/constants.d.ts +6 -0
  32. package/dist/hooks/rules-injector/finder.d.ts +45 -0
  33. package/dist/hooks/rules-injector/index.d.ts +22 -0
  34. package/dist/hooks/rules-injector/matcher.d.ts +21 -0
  35. package/dist/hooks/rules-injector/parser.d.ts +18 -0
  36. package/dist/hooks/rules-injector/storage.d.ts +9 -0
  37. package/dist/hooks/rules-injector/types.d.ts +41 -0
  38. package/dist/hooks/session-recovery/index.d.ts +4 -2
  39. package/dist/hooks/session-recovery/storage.d.ts +1 -0
  40. package/dist/hooks/todo-continuation-enforcer.d.ts +11 -6
  41. package/dist/index.js +4490 -1584
  42. package/dist/shared/deep-merge.d.ts +12 -0
  43. package/dist/shared/index.d.ts +1 -0
  44. package/dist/tools/ast-grep/index.d.ts +4 -4
  45. package/dist/tools/ast-grep/tools.d.ts +4 -4
  46. package/dist/tools/background-task/constants.d.ts +3 -0
  47. package/dist/tools/background-task/index.d.ts +3 -0
  48. package/dist/tools/background-task/tools.d.ts +39 -0
  49. package/dist/tools/background-task/types.d.ts +13 -0
  50. package/dist/tools/call-omo-agent/constants.d.ts +2 -0
  51. package/dist/tools/call-omo-agent/index.d.ts +3 -0
  52. package/dist/tools/call-omo-agent/tools.d.ts +22 -0
  53. package/dist/tools/call-omo-agent/types.d.ts +24 -0
  54. package/dist/tools/index.d.ts +47 -6
  55. package/dist/tools/lsp/tools.d.ts +2 -2
  56. package/package.json +11 -3
@@ -0,0 +1,22 @@
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 createRulesInjectorHook(ctx: PluginInput): {
19
+ "tool.execute.after": (input: ToolExecuteInput, output: ToolExecuteOutput) => Promise<void>;
20
+ event: ({ event }: EventInput) => Promise<void>;
21
+ };
22
+ export {};
@@ -0,0 +1,21 @@
1
+ import type { RuleMetadata } from "./types";
2
+ export interface MatchResult {
3
+ applies: boolean;
4
+ reason?: string;
5
+ }
6
+ /**
7
+ * Check if a rule should apply to the current file based on metadata
8
+ */
9
+ export declare function shouldApplyRule(metadata: RuleMetadata, currentFilePath: string, projectRoot: string | null): MatchResult;
10
+ /**
11
+ * Check if realPath already exists in cache (symlink deduplication)
12
+ */
13
+ export declare function isDuplicateByRealPath(realPath: string, cache: Set<string>): boolean;
14
+ /**
15
+ * Create SHA-256 hash of content, truncated to 16 chars
16
+ */
17
+ export declare function createContentHash(content: string): string;
18
+ /**
19
+ * Check if content hash already exists in cache
20
+ */
21
+ export declare function isDuplicateByContentHash(hash: string, cache: Set<string>): boolean;
@@ -0,0 +1,18 @@
1
+ import type { RuleMetadata } from "./types";
2
+ export interface RuleFrontmatterResult {
3
+ metadata: RuleMetadata;
4
+ body: string;
5
+ }
6
+ /**
7
+ * Parse YAML frontmatter from rule file content
8
+ * Supports:
9
+ * - Single string: globs: "**\/*.py"
10
+ * - Inline array: globs: ["**\/*.py", "src/**\/*.ts"]
11
+ * - Multi-line array:
12
+ * globs:
13
+ * - "**\/*.py"
14
+ * - "src/**\/*.ts"
15
+ * - Comma-separated: globs: "**\/*.py, src/**\/*.ts"
16
+ * - Claude Code 'paths' field (alias for globs)
17
+ */
18
+ export declare function parseRuleFrontmatter(content: string): RuleFrontmatterResult;
@@ -0,0 +1,9 @@
1
+ export declare function loadInjectedRules(sessionID: string): {
2
+ contentHashes: Set<string>;
3
+ realPaths: Set<string>;
4
+ };
5
+ export declare function saveInjectedRules(sessionID: string, data: {
6
+ contentHashes: Set<string>;
7
+ realPaths: Set<string>;
8
+ }): void;
9
+ export declare function clearInjectedRules(sessionID: string): void;
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Rule file metadata (Claude Code style frontmatter)
3
+ * @see https://docs.anthropic.com/en/docs/claude-code/settings#rule-files
4
+ */
5
+ export interface RuleMetadata {
6
+ description?: string;
7
+ globs?: string | string[];
8
+ alwaysApply?: boolean;
9
+ }
10
+ /**
11
+ * Rule information with path context and content
12
+ */
13
+ export interface RuleInfo {
14
+ /** Absolute path to the rule file */
15
+ path: string;
16
+ /** Path relative to project root */
17
+ relativePath: string;
18
+ /** Directory distance from target file (0 = same dir) */
19
+ distance: number;
20
+ /** Rule file content (without frontmatter) */
21
+ content: string;
22
+ /** SHA-256 hash of content for deduplication */
23
+ contentHash: string;
24
+ /** Parsed frontmatter metadata */
25
+ metadata: RuleMetadata;
26
+ /** Why this rule matched (e.g., "alwaysApply", "glob: *.ts", "path match") */
27
+ matchReason: string;
28
+ /** Real path after symlink resolution (for duplicate detection) */
29
+ realPath: string;
30
+ }
31
+ /**
32
+ * Session storage for injected rules tracking
33
+ */
34
+ export interface InjectedRulesData {
35
+ sessionID: string;
36
+ /** Content hashes of already injected rules */
37
+ injectedHashes: string[];
38
+ /** Real paths of already injected rules (for symlink deduplication) */
39
+ injectedRealPaths: string[];
40
+ updatedAt: number;
41
+ }
@@ -6,9 +6,11 @@ interface MessageInfo {
6
6
  parentID?: string;
7
7
  error?: unknown;
8
8
  }
9
- export declare function createSessionRecoveryHook(ctx: PluginInput): {
9
+ export interface SessionRecoveryHook {
10
10
  handleSessionRecovery: (info: MessageInfo) => Promise<boolean>;
11
11
  isRecoverableError: (error: unknown) => boolean;
12
12
  setOnAbortCallback: (callback: (sessionID: string) => void) => void;
13
- };
13
+ setOnRecoveryCompleteCallback: (callback: (sessionID: string) => void) => void;
14
+ }
15
+ export declare function createSessionRecoveryHook(ctx: PluginInput): SessionRecoveryHook;
14
16
  export {};
@@ -13,3 +13,4 @@ export declare function findMessagesWithThinkingBlocks(sessionID: string): strin
13
13
  export declare function findMessagesWithOrphanThinking(sessionID: string): string[];
14
14
  export declare function prependThinkingPart(sessionID: string, messageID: string): boolean;
15
15
  export declare function stripThinkingParts(messageID: string): boolean;
16
+ export declare function findMessageByIndexNeedingThinking(sessionID: string, targetIndex: number): string | null;
@@ -1,7 +1,12 @@
1
1
  import type { PluginInput } from "@opencode-ai/plugin";
2
- export declare function createTodoContinuationEnforcer(ctx: PluginInput): ({ event }: {
3
- event: {
4
- type: string;
5
- properties?: unknown;
6
- };
7
- }) => Promise<void>;
2
+ export interface TodoContinuationEnforcer {
3
+ handler: (input: {
4
+ event: {
5
+ type: string;
6
+ properties?: unknown;
7
+ };
8
+ }) => Promise<void>;
9
+ markRecovering: (sessionID: string) => void;
10
+ markRecoveryComplete: (sessionID: string) => void;
11
+ }
12
+ export declare function createTodoContinuationEnforcer(ctx: PluginInput): TodoContinuationEnforcer;