oh-my-opencode-slim 1.0.6 → 1.0.7

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.
@@ -1,4 +1,48 @@
1
1
  import { type PluginConfig } from './schema';
2
+ /**
3
+ * Warning kinds produced during config loading.
4
+ */
5
+ export type ConfigLoadWarningKind = 'invalid-json' | 'invalid-schema' | 'read-error' | 'missing-preset';
6
+ /**
7
+ * A warning emitted while loading plugin configuration.
8
+ */
9
+ export interface ConfigLoadWarning {
10
+ path: string;
11
+ kind: ConfigLoadWarningKind;
12
+ message: string;
13
+ formatted?: unknown;
14
+ }
15
+ /**
16
+ * Options for loadPluginConfig.
17
+ */
18
+ export interface LoadPluginConfigOptions {
19
+ /**
20
+ * Called with a warning whenever config loading produces a non-fatal issue.
21
+ * The loader still falls back to defaults and continues normally.
22
+ */
23
+ onWarning?: (warning: ConfigLoadWarning) => void;
24
+ /**
25
+ * Suppress console warnings while still invoking onWarning.
26
+ */
27
+ silent?: boolean;
28
+ }
29
+ /**
30
+ * Find plugin config paths (user and project) for a given directory.
31
+ * User config uses getConfigSearchDirs() for lookup.
32
+ * Project config uses <directory>/.opencode/oh-my-opencode-slim.
33
+ *
34
+ * @param directory - Project directory to search for .opencode config
35
+ * @returns Object with userConfigPath and projectConfigPath (null if not found)
36
+ */
37
+ export declare function findPluginConfigPaths(directory: string): {
38
+ userConfigPath: string | null;
39
+ projectConfigPath: string | null;
40
+ };
41
+ /**
42
+ * Merge two plugin configs using the loader's merge rules.
43
+ * Project/override takes precedence over base.
44
+ */
45
+ export declare function mergePluginConfigs(base: PluginConfig, override: PluginConfig): PluginConfig;
2
46
  /**
3
47
  * Recursively merge two objects, with override values taking precedence.
4
48
  * For nested objects, merges recursively. For arrays and primitives, override replaces base.
@@ -21,9 +65,10 @@ export declare function deepMerge<T extends Record<string, unknown>>(base?: T, o
21
65
  * deep-merged, while top-level arrays are replaced entirely by project config.
22
66
  *
23
67
  * @param directory - Project directory to search for .opencode config
68
+ * @param options - Optional load options including onWarning callback
24
69
  * @returns Merged plugin configuration (empty object if no configs found)
25
70
  */
26
- export declare function loadPluginConfig(directory: string): PluginConfig;
71
+ export declare function loadPluginConfig(directory: string, options?: LoadPluginConfigOptions): PluginConfig;
27
72
  /**
28
73
  * Load custom prompt for an agent from the prompts directory.
29
74
  * Checks for {agent}.md (replaces default) and {agent}_append.md (appends to default).
@@ -164,6 +164,18 @@ export declare const SessionManagerConfigSchema: z.ZodObject<{
164
164
  readContextMaxFiles: z.ZodDefault<z.ZodNumber>;
165
165
  }, z.core.$strip>;
166
166
  export type SessionManagerConfig = z.infer<typeof SessionManagerConfigSchema>;
167
+ export declare const DivoomConfigSchema: z.ZodObject<{
168
+ enabled: z.ZodDefault<z.ZodBoolean>;
169
+ python: z.ZodDefault<z.ZodString>;
170
+ script: z.ZodDefault<z.ZodString>;
171
+ size: z.ZodDefault<z.ZodNumber>;
172
+ fps: z.ZodDefault<z.ZodNumber>;
173
+ speed: z.ZodDefault<z.ZodNumber>;
174
+ maxFrames: z.ZodDefault<z.ZodNumber>;
175
+ posterizeBits: z.ZodDefault<z.ZodNumber>;
176
+ gifs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
177
+ }, z.core.$strip>;
178
+ export type DivoomConfig = z.infer<typeof DivoomConfigSchema>;
167
179
  export declare const TodoContinuationConfigSchema: z.ZodObject<{
168
180
  maxContinuations: z.ZodDefault<z.ZodNumber>;
169
181
  cooldownMs: z.ZodDefault<z.ZodNumber>;
@@ -309,6 +321,17 @@ export declare const PluginConfigSchema: z.ZodObject<{
309
321
  readContextMinLines: z.ZodDefault<z.ZodNumber>;
310
322
  readContextMaxFiles: z.ZodDefault<z.ZodNumber>;
311
323
  }, z.core.$strip>>;
324
+ divoom: z.ZodOptional<z.ZodObject<{
325
+ enabled: z.ZodDefault<z.ZodBoolean>;
326
+ python: z.ZodDefault<z.ZodString>;
327
+ script: z.ZodDefault<z.ZodString>;
328
+ size: z.ZodDefault<z.ZodNumber>;
329
+ fps: z.ZodDefault<z.ZodNumber>;
330
+ speed: z.ZodDefault<z.ZodNumber>;
331
+ maxFrames: z.ZodDefault<z.ZodNumber>;
332
+ posterizeBits: z.ZodDefault<z.ZodNumber>;
333
+ gifs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
334
+ }, z.core.$strip>>;
312
335
  todoContinuation: z.ZodOptional<z.ZodObject<{
313
336
  maxContinuations: z.ZodDefault<z.ZodNumber>;
314
337
  cooldownMs: z.ZodDefault<z.ZodNumber>;
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,57 @@
1
+ import type { DivoomConfig } from '../config';
2
+ export type DivoomSenderCall = {
3
+ command: string;
4
+ args: string[];
5
+ };
6
+ export type DivoomSender = (call: DivoomSenderCall) => Promise<void> | void;
7
+ type DivoomManagerOptions = {
8
+ assetDir?: string | null;
9
+ sender?: DivoomSender;
10
+ };
11
+ export declare function getDivoomOutDir(homeDir?: string): string;
12
+ export declare class DivoomManager {
13
+ private sender;
14
+ private assetDir;
15
+ private config;
16
+ private parentStates;
17
+ private pendingUserInputs;
18
+ private orchestratorBusy;
19
+ private latestRequestedGifPath?;
20
+ private lastGifPath?;
21
+ private sendQueue;
22
+ constructor(config?: Partial<DivoomConfig>, sender?: DivoomSender, options?: DivoomManagerOptions);
23
+ onPluginLoad(): void;
24
+ onTaskStart(input: {
25
+ parentSessionId?: string;
26
+ callId?: string;
27
+ args?: unknown;
28
+ }): void;
29
+ onTaskEnd(input: {
30
+ parentSessionId?: string;
31
+ callId?: string;
32
+ }): void;
33
+ onUserInputRequired(input: {
34
+ sessionId?: string;
35
+ requestId?: string;
36
+ }): void;
37
+ onUserInputResolved(input: {
38
+ sessionId?: string;
39
+ requestId?: string;
40
+ }): void;
41
+ onOrchestratorStatus(input: {
42
+ sessionId?: string;
43
+ status?: string;
44
+ isOrchestrator?: boolean;
45
+ }): void;
46
+ onSessionDeleted(input: {
47
+ sessionId?: string;
48
+ isOrchestrator?: boolean;
49
+ }): void;
50
+ private render;
51
+ private getParentState;
52
+ private show;
53
+ flush(): Promise<void>;
54
+ private clearLatestIfCurrent;
55
+ }
56
+ export declare function createDivoomManager(config?: Partial<DivoomConfig>): DivoomManager;
57
+ export {};
Binary file
Binary file