oh-my-opencode 2.3.1 → 2.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.
- package/README.ja.md +67 -23
- package/README.ko.md +69 -25
- package/README.md +67 -23
- package/README.zh-cn.md +66 -22
- package/dist/agents/oracle.d.ts +1 -0
- package/dist/agents/sisyphus.d.ts +1 -0
- package/dist/agents/types.d.ts +2 -0
- package/dist/agents/utils.test.d.ts +1 -0
- package/dist/config/schema.d.ts +26 -23
- package/dist/hooks/anthropic-auto-compact/types.d.ts +1 -0
- package/dist/hooks/auto-update-checker/checker.d.ts +7 -0
- package/dist/hooks/auto-update-checker/index.d.ts +1 -1
- package/dist/hooks/auto-update-checker/types.d.ts +1 -0
- package/dist/hooks/compaction-context-injector/index.d.ts +2 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/preemptive-compaction/constants.d.ts +3 -0
- package/dist/hooks/preemptive-compaction/index.d.ts +24 -0
- package/dist/hooks/preemptive-compaction/types.d.ts +17 -0
- package/dist/index.js +1115 -511
- package/dist/shared/config-path.d.ts +4 -1
- package/dist/tools/ast-grep/index.d.ts +22 -22
- package/dist/tools/ast-grep/tools.d.ts +22 -22
- package/dist/tools/index.d.ts +22 -22
- package/package.json +3 -2
- package/dist/agents/build.d.ts +0 -1
package/dist/config/schema.d.ts
CHANGED
|
@@ -61,8 +61,8 @@ export declare const AgentOverrideConfigSchema: z.ZodObject<{
|
|
|
61
61
|
disable: z.ZodOptional<z.ZodBoolean>;
|
|
62
62
|
description: z.ZodOptional<z.ZodString>;
|
|
63
63
|
mode: z.ZodOptional<z.ZodEnum<{
|
|
64
|
-
subagent: "subagent";
|
|
65
64
|
primary: "primary";
|
|
65
|
+
subagent: "subagent";
|
|
66
66
|
all: "all";
|
|
67
67
|
}>>;
|
|
68
68
|
color: z.ZodOptional<z.ZodString>;
|
|
@@ -108,8 +108,8 @@ export declare const AgentOverridesSchema: z.ZodObject<{
|
|
|
108
108
|
disable: z.ZodOptional<z.ZodBoolean>;
|
|
109
109
|
description: z.ZodOptional<z.ZodString>;
|
|
110
110
|
mode: z.ZodOptional<z.ZodEnum<{
|
|
111
|
-
subagent: "subagent";
|
|
112
111
|
primary: "primary";
|
|
112
|
+
subagent: "subagent";
|
|
113
113
|
all: "all";
|
|
114
114
|
}>>;
|
|
115
115
|
color: z.ZodOptional<z.ZodString>;
|
|
@@ -154,8 +154,8 @@ export declare const AgentOverridesSchema: z.ZodObject<{
|
|
|
154
154
|
disable: z.ZodOptional<z.ZodBoolean>;
|
|
155
155
|
description: z.ZodOptional<z.ZodString>;
|
|
156
156
|
mode: z.ZodOptional<z.ZodEnum<{
|
|
157
|
-
subagent: "subagent";
|
|
158
157
|
primary: "primary";
|
|
158
|
+
subagent: "subagent";
|
|
159
159
|
all: "all";
|
|
160
160
|
}>>;
|
|
161
161
|
color: z.ZodOptional<z.ZodString>;
|
|
@@ -200,8 +200,8 @@ export declare const AgentOverridesSchema: z.ZodObject<{
|
|
|
200
200
|
disable: z.ZodOptional<z.ZodBoolean>;
|
|
201
201
|
description: z.ZodOptional<z.ZodString>;
|
|
202
202
|
mode: z.ZodOptional<z.ZodEnum<{
|
|
203
|
-
subagent: "subagent";
|
|
204
203
|
primary: "primary";
|
|
204
|
+
subagent: "subagent";
|
|
205
205
|
all: "all";
|
|
206
206
|
}>>;
|
|
207
207
|
color: z.ZodOptional<z.ZodString>;
|
|
@@ -246,8 +246,8 @@ export declare const AgentOverridesSchema: z.ZodObject<{
|
|
|
246
246
|
disable: z.ZodOptional<z.ZodBoolean>;
|
|
247
247
|
description: z.ZodOptional<z.ZodString>;
|
|
248
248
|
mode: z.ZodOptional<z.ZodEnum<{
|
|
249
|
-
subagent: "subagent";
|
|
250
249
|
primary: "primary";
|
|
250
|
+
subagent: "subagent";
|
|
251
251
|
all: "all";
|
|
252
252
|
}>>;
|
|
253
253
|
color: z.ZodOptional<z.ZodString>;
|
|
@@ -292,8 +292,8 @@ export declare const AgentOverridesSchema: z.ZodObject<{
|
|
|
292
292
|
disable: z.ZodOptional<z.ZodBoolean>;
|
|
293
293
|
description: z.ZodOptional<z.ZodString>;
|
|
294
294
|
mode: z.ZodOptional<z.ZodEnum<{
|
|
295
|
-
subagent: "subagent";
|
|
296
295
|
primary: "primary";
|
|
296
|
+
subagent: "subagent";
|
|
297
297
|
all: "all";
|
|
298
298
|
}>>;
|
|
299
299
|
color: z.ZodOptional<z.ZodString>;
|
|
@@ -338,8 +338,8 @@ export declare const AgentOverridesSchema: z.ZodObject<{
|
|
|
338
338
|
disable: z.ZodOptional<z.ZodBoolean>;
|
|
339
339
|
description: z.ZodOptional<z.ZodString>;
|
|
340
340
|
mode: z.ZodOptional<z.ZodEnum<{
|
|
341
|
-
subagent: "subagent";
|
|
342
341
|
primary: "primary";
|
|
342
|
+
subagent: "subagent";
|
|
343
343
|
all: "all";
|
|
344
344
|
}>>;
|
|
345
345
|
color: z.ZodOptional<z.ZodString>;
|
|
@@ -384,8 +384,8 @@ export declare const AgentOverridesSchema: z.ZodObject<{
|
|
|
384
384
|
disable: z.ZodOptional<z.ZodBoolean>;
|
|
385
385
|
description: z.ZodOptional<z.ZodString>;
|
|
386
386
|
mode: z.ZodOptional<z.ZodEnum<{
|
|
387
|
-
subagent: "subagent";
|
|
388
387
|
primary: "primary";
|
|
388
|
+
subagent: "subagent";
|
|
389
389
|
all: "all";
|
|
390
390
|
}>>;
|
|
391
391
|
color: z.ZodOptional<z.ZodString>;
|
|
@@ -430,8 +430,8 @@ export declare const AgentOverridesSchema: z.ZodObject<{
|
|
|
430
430
|
disable: z.ZodOptional<z.ZodBoolean>;
|
|
431
431
|
description: z.ZodOptional<z.ZodString>;
|
|
432
432
|
mode: z.ZodOptional<z.ZodEnum<{
|
|
433
|
-
subagent: "subagent";
|
|
434
433
|
primary: "primary";
|
|
434
|
+
subagent: "subagent";
|
|
435
435
|
all: "all";
|
|
436
436
|
}>>;
|
|
437
437
|
color: z.ZodOptional<z.ZodString>;
|
|
@@ -476,8 +476,8 @@ export declare const AgentOverridesSchema: z.ZodObject<{
|
|
|
476
476
|
disable: z.ZodOptional<z.ZodBoolean>;
|
|
477
477
|
description: z.ZodOptional<z.ZodString>;
|
|
478
478
|
mode: z.ZodOptional<z.ZodEnum<{
|
|
479
|
-
subagent: "subagent";
|
|
480
479
|
primary: "primary";
|
|
480
|
+
subagent: "subagent";
|
|
481
481
|
all: "all";
|
|
482
482
|
}>>;
|
|
483
483
|
color: z.ZodOptional<z.ZodString>;
|
|
@@ -522,8 +522,8 @@ export declare const AgentOverridesSchema: z.ZodObject<{
|
|
|
522
522
|
disable: z.ZodOptional<z.ZodBoolean>;
|
|
523
523
|
description: z.ZodOptional<z.ZodString>;
|
|
524
524
|
mode: z.ZodOptional<z.ZodEnum<{
|
|
525
|
-
subagent: "subagent";
|
|
526
525
|
primary: "primary";
|
|
526
|
+
subagent: "subagent";
|
|
527
527
|
all: "all";
|
|
528
528
|
}>>;
|
|
529
529
|
color: z.ZodOptional<z.ZodString>;
|
|
@@ -572,8 +572,9 @@ export declare const SisyphusAgentConfigSchema: z.ZodObject<{
|
|
|
572
572
|
}, z.core.$strip>;
|
|
573
573
|
export declare const ExperimentalConfigSchema: z.ZodObject<{
|
|
574
574
|
aggressive_truncation: z.ZodOptional<z.ZodBoolean>;
|
|
575
|
-
empty_message_recovery: z.ZodOptional<z.ZodBoolean>;
|
|
576
575
|
auto_resume: z.ZodOptional<z.ZodBoolean>;
|
|
576
|
+
preemptive_compaction: z.ZodOptional<z.ZodBoolean>;
|
|
577
|
+
preemptive_compaction_threshold: z.ZodOptional<z.ZodNumber>;
|
|
577
578
|
}, z.core.$strip>;
|
|
578
579
|
export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
|
|
579
580
|
$schema: z.ZodOptional<z.ZodString>;
|
|
@@ -624,8 +625,8 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
|
|
|
624
625
|
disable: z.ZodOptional<z.ZodBoolean>;
|
|
625
626
|
description: z.ZodOptional<z.ZodString>;
|
|
626
627
|
mode: z.ZodOptional<z.ZodEnum<{
|
|
627
|
-
subagent: "subagent";
|
|
628
628
|
primary: "primary";
|
|
629
|
+
subagent: "subagent";
|
|
629
630
|
all: "all";
|
|
630
631
|
}>>;
|
|
631
632
|
color: z.ZodOptional<z.ZodString>;
|
|
@@ -670,8 +671,8 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
|
|
|
670
671
|
disable: z.ZodOptional<z.ZodBoolean>;
|
|
671
672
|
description: z.ZodOptional<z.ZodString>;
|
|
672
673
|
mode: z.ZodOptional<z.ZodEnum<{
|
|
673
|
-
subagent: "subagent";
|
|
674
674
|
primary: "primary";
|
|
675
|
+
subagent: "subagent";
|
|
675
676
|
all: "all";
|
|
676
677
|
}>>;
|
|
677
678
|
color: z.ZodOptional<z.ZodString>;
|
|
@@ -716,8 +717,8 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
|
|
|
716
717
|
disable: z.ZodOptional<z.ZodBoolean>;
|
|
717
718
|
description: z.ZodOptional<z.ZodString>;
|
|
718
719
|
mode: z.ZodOptional<z.ZodEnum<{
|
|
719
|
-
subagent: "subagent";
|
|
720
720
|
primary: "primary";
|
|
721
|
+
subagent: "subagent";
|
|
721
722
|
all: "all";
|
|
722
723
|
}>>;
|
|
723
724
|
color: z.ZodOptional<z.ZodString>;
|
|
@@ -762,8 +763,8 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
|
|
|
762
763
|
disable: z.ZodOptional<z.ZodBoolean>;
|
|
763
764
|
description: z.ZodOptional<z.ZodString>;
|
|
764
765
|
mode: z.ZodOptional<z.ZodEnum<{
|
|
765
|
-
subagent: "subagent";
|
|
766
766
|
primary: "primary";
|
|
767
|
+
subagent: "subagent";
|
|
767
768
|
all: "all";
|
|
768
769
|
}>>;
|
|
769
770
|
color: z.ZodOptional<z.ZodString>;
|
|
@@ -808,8 +809,8 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
|
|
|
808
809
|
disable: z.ZodOptional<z.ZodBoolean>;
|
|
809
810
|
description: z.ZodOptional<z.ZodString>;
|
|
810
811
|
mode: z.ZodOptional<z.ZodEnum<{
|
|
811
|
-
subagent: "subagent";
|
|
812
812
|
primary: "primary";
|
|
813
|
+
subagent: "subagent";
|
|
813
814
|
all: "all";
|
|
814
815
|
}>>;
|
|
815
816
|
color: z.ZodOptional<z.ZodString>;
|
|
@@ -854,8 +855,8 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
|
|
|
854
855
|
disable: z.ZodOptional<z.ZodBoolean>;
|
|
855
856
|
description: z.ZodOptional<z.ZodString>;
|
|
856
857
|
mode: z.ZodOptional<z.ZodEnum<{
|
|
857
|
-
subagent: "subagent";
|
|
858
858
|
primary: "primary";
|
|
859
|
+
subagent: "subagent";
|
|
859
860
|
all: "all";
|
|
860
861
|
}>>;
|
|
861
862
|
color: z.ZodOptional<z.ZodString>;
|
|
@@ -900,8 +901,8 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
|
|
|
900
901
|
disable: z.ZodOptional<z.ZodBoolean>;
|
|
901
902
|
description: z.ZodOptional<z.ZodString>;
|
|
902
903
|
mode: z.ZodOptional<z.ZodEnum<{
|
|
903
|
-
subagent: "subagent";
|
|
904
904
|
primary: "primary";
|
|
905
|
+
subagent: "subagent";
|
|
905
906
|
all: "all";
|
|
906
907
|
}>>;
|
|
907
908
|
color: z.ZodOptional<z.ZodString>;
|
|
@@ -946,8 +947,8 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
|
|
|
946
947
|
disable: z.ZodOptional<z.ZodBoolean>;
|
|
947
948
|
description: z.ZodOptional<z.ZodString>;
|
|
948
949
|
mode: z.ZodOptional<z.ZodEnum<{
|
|
949
|
-
subagent: "subagent";
|
|
950
950
|
primary: "primary";
|
|
951
|
+
subagent: "subagent";
|
|
951
952
|
all: "all";
|
|
952
953
|
}>>;
|
|
953
954
|
color: z.ZodOptional<z.ZodString>;
|
|
@@ -992,8 +993,8 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
|
|
|
992
993
|
disable: z.ZodOptional<z.ZodBoolean>;
|
|
993
994
|
description: z.ZodOptional<z.ZodString>;
|
|
994
995
|
mode: z.ZodOptional<z.ZodEnum<{
|
|
995
|
-
subagent: "subagent";
|
|
996
996
|
primary: "primary";
|
|
997
|
+
subagent: "subagent";
|
|
997
998
|
all: "all";
|
|
998
999
|
}>>;
|
|
999
1000
|
color: z.ZodOptional<z.ZodString>;
|
|
@@ -1038,8 +1039,8 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
|
|
|
1038
1039
|
disable: z.ZodOptional<z.ZodBoolean>;
|
|
1039
1040
|
description: z.ZodOptional<z.ZodString>;
|
|
1040
1041
|
mode: z.ZodOptional<z.ZodEnum<{
|
|
1041
|
-
subagent: "subagent";
|
|
1042
1042
|
primary: "primary";
|
|
1043
|
+
subagent: "subagent";
|
|
1043
1044
|
all: "all";
|
|
1044
1045
|
}>>;
|
|
1045
1046
|
color: z.ZodOptional<z.ZodString>;
|
|
@@ -1089,9 +1090,11 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
|
|
|
1089
1090
|
}, z.core.$strip>>;
|
|
1090
1091
|
experimental: z.ZodOptional<z.ZodObject<{
|
|
1091
1092
|
aggressive_truncation: z.ZodOptional<z.ZodBoolean>;
|
|
1092
|
-
empty_message_recovery: z.ZodOptional<z.ZodBoolean>;
|
|
1093
1093
|
auto_resume: z.ZodOptional<z.ZodBoolean>;
|
|
1094
|
+
preemptive_compaction: z.ZodOptional<z.ZodBoolean>;
|
|
1095
|
+
preemptive_compaction_threshold: z.ZodOptional<z.ZodNumber>;
|
|
1094
1096
|
}, z.core.$strip>>;
|
|
1097
|
+
auto_update: z.ZodOptional<z.ZodBoolean>;
|
|
1095
1098
|
}, z.core.$strip>;
|
|
1096
1099
|
export type OhMyOpenCodeConfig = z.infer<typeof OhMyOpenCodeConfigSchema>;
|
|
1097
1100
|
export type AgentOverrideConfig = z.infer<typeof AgentOverrideConfigSchema>;
|
|
@@ -6,8 +6,15 @@ export interface PluginEntryInfo {
|
|
|
6
6
|
entry: string;
|
|
7
7
|
isPinned: boolean;
|
|
8
8
|
pinnedVersion: string | null;
|
|
9
|
+
configPath: string;
|
|
9
10
|
}
|
|
10
11
|
export declare function findPluginEntry(directory: string): PluginEntryInfo | null;
|
|
11
12
|
export declare function getCachedVersion(): string | null;
|
|
13
|
+
/**
|
|
14
|
+
* Updates a pinned version entry in the config file.
|
|
15
|
+
* Only replaces within the "plugin" array to avoid unintended edits.
|
|
16
|
+
* Preserves JSONC comments and formatting via string replacement.
|
|
17
|
+
*/
|
|
18
|
+
export declare function updatePinnedVersion(configPath: string, oldEntry: string, newVersion: string): boolean;
|
|
12
19
|
export declare function getLatestVersion(): Promise<string | null>;
|
|
13
20
|
export declare function checkForUpdate(directory: string): Promise<UpdateCheckResult>;
|
|
@@ -6,7 +6,7 @@ export declare function createAutoUpdateCheckerHook(ctx: PluginInput, options?:
|
|
|
6
6
|
type: string;
|
|
7
7
|
properties?: unknown;
|
|
8
8
|
};
|
|
9
|
-
}) =>
|
|
9
|
+
}) => void;
|
|
10
10
|
};
|
|
11
11
|
export type { UpdateCheckResult, AutoUpdateCheckerOptions } from "./types";
|
|
12
12
|
export { checkForUpdate } from "./checker";
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -8,6 +8,8 @@ export { createDirectoryAgentsInjectorHook } from "./directory-agents-injector";
|
|
|
8
8
|
export { createDirectoryReadmeInjectorHook } from "./directory-readme-injector";
|
|
9
9
|
export { createEmptyTaskResponseDetectorHook } from "./empty-task-response-detector";
|
|
10
10
|
export { createAnthropicAutoCompactHook, type AnthropicAutoCompactOptions } from "./anthropic-auto-compact";
|
|
11
|
+
export { createPreemptiveCompactionHook, type PreemptiveCompactionOptions, type SummarizeContext, type BeforeSummarizeCallback } from "./preemptive-compaction";
|
|
12
|
+
export { createCompactionContextInjector } from "./compaction-context-injector";
|
|
11
13
|
export { createThinkModeHook } from "./think-mode";
|
|
12
14
|
export { createClaudeCodeHooksHook } from "./claude-code-hooks";
|
|
13
15
|
export { createRulesInjectorHook } from "./rules-injector";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { PluginInput } from "@opencode-ai/plugin";
|
|
2
|
+
import type { ExperimentalConfig } from "../../config";
|
|
3
|
+
export interface SummarizeContext {
|
|
4
|
+
sessionID: string;
|
|
5
|
+
providerID: string;
|
|
6
|
+
modelID: string;
|
|
7
|
+
usageRatio: number;
|
|
8
|
+
directory: string;
|
|
9
|
+
}
|
|
10
|
+
export type BeforeSummarizeCallback = (ctx: SummarizeContext) => Promise<void> | void;
|
|
11
|
+
export type GetModelLimitCallback = (providerID: string, modelID: string) => number | undefined;
|
|
12
|
+
export interface PreemptiveCompactionOptions {
|
|
13
|
+
experimental?: ExperimentalConfig;
|
|
14
|
+
onBeforeSummarize?: BeforeSummarizeCallback;
|
|
15
|
+
getModelLimit?: GetModelLimitCallback;
|
|
16
|
+
}
|
|
17
|
+
export declare function createPreemptiveCompactionHook(ctx: PluginInput, options?: PreemptiveCompactionOptions): {
|
|
18
|
+
event: ({ event }: {
|
|
19
|
+
event: {
|
|
20
|
+
type: string;
|
|
21
|
+
properties?: unknown;
|
|
22
|
+
};
|
|
23
|
+
}) => Promise<void>;
|
|
24
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface PreemptiveCompactionState {
|
|
2
|
+
lastCompactionTime: Map<string, number>;
|
|
3
|
+
compactionInProgress: Set<string>;
|
|
4
|
+
}
|
|
5
|
+
export interface TokenInfo {
|
|
6
|
+
input: number;
|
|
7
|
+
output: number;
|
|
8
|
+
reasoning: number;
|
|
9
|
+
cache: {
|
|
10
|
+
read: number;
|
|
11
|
+
write: number;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export interface ModelLimits {
|
|
15
|
+
context: number;
|
|
16
|
+
output: number;
|
|
17
|
+
}
|