kibi-opencode 0.10.0 → 0.12.0
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.md +16 -6
- package/dist/brief-delivery-reasons.d.ts +12 -0
- package/dist/brief-delivery-reasons.js +132 -0
- package/dist/brief-intent.js +17 -2
- package/dist/file-filter.js +6 -0
- package/dist/idle-brief-reader.d.ts +12 -0
- package/dist/idle-brief-reader.js +31 -10
- package/dist/idle-brief-runtime.js +44 -9
- package/dist/idle-brief-store.d.ts +17 -0
- package/dist/idle-brief-store.js +54 -1
- package/dist/index.d.ts +2 -52
- package/dist/index.js +1 -1068
- package/dist/logger.d.ts +1 -0
- package/dist/logger.js +8 -1
- package/dist/plugin.d.ts +52 -0
- package/dist/plugin.js +1068 -0
- package/dist/prompt.js +3 -3
- package/dist/scheduler.d.ts +12 -2
- package/dist/scheduler.js +49 -6
- package/dist/toast.d.ts +2 -0
- package/dist/tui-brief-delivery.d.ts +20 -0
- package/dist/tui-brief-delivery.js +154 -13
- package/dist/tui-brief-view-model.d.ts +63 -0
- package/dist/tui-brief-view-model.js +209 -0
- package/dist/tui.d.ts +8 -0
- package/dist/tui.js +413 -0
- package/dist/tui.jsx +120 -0
- package/package.json +12 -4
package/dist/logger.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export interface PluginClient {
|
|
|
4
4
|
};
|
|
5
5
|
}
|
|
6
6
|
export type LogMetadata = Record<string, unknown>;
|
|
7
|
+
export declare function _setConsoleError(fn: typeof console.error | null): void;
|
|
7
8
|
export declare function setClient(c: PluginClient): void;
|
|
8
9
|
export declare function resetClient(): void;
|
|
9
10
|
export declare function info(msg: string, metadata?: LogMetadata): void;
|
package/dist/logger.js
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
// implements REQ-opencode-kibi-plugin-v1
|
|
2
2
|
let client = null;
|
|
3
|
+
// Test-only injection point to avoid global console.error spy pollution
|
|
4
|
+
// in parallel test runs. Defaults to null (uses real console.error in production).
|
|
5
|
+
let _consoleError = null;
|
|
6
|
+
// implements REQ-opencode-kibi-plugin-v1
|
|
7
|
+
export function _setConsoleError(fn) {
|
|
8
|
+
_consoleError = fn;
|
|
9
|
+
}
|
|
3
10
|
// implements REQ-opencode-kibi-plugin-v1
|
|
4
11
|
export function setClient(c) {
|
|
5
12
|
client = c;
|
|
@@ -63,7 +70,7 @@ export function errorStructuredOnly(msg, metadata) {
|
|
|
63
70
|
// implements REQ-opencode-kibi-plugin-v1
|
|
64
71
|
export function error(msg, metadata) {
|
|
65
72
|
// Always emit to console for user visibility (operational failures)
|
|
66
|
-
console.error("[kibi-opencode]", msg);
|
|
73
|
+
(_consoleError ?? console.error)("[kibi-opencode]", msg);
|
|
67
74
|
// Also emit to structured logs if client is available
|
|
68
75
|
if (client) {
|
|
69
76
|
void client.app
|
package/dist/plugin.d.ts
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { type OpenCodeConfigHookInput } from "./init-kibi-capability.js";
|
|
2
|
+
export interface PluginInput {
|
|
3
|
+
worktree: string;
|
|
4
|
+
directory: string;
|
|
5
|
+
sessionId?: string;
|
|
6
|
+
serverUrl?: unknown;
|
|
7
|
+
workspace?: string;
|
|
8
|
+
project?: unknown;
|
|
9
|
+
$?: unknown;
|
|
10
|
+
client?: {
|
|
11
|
+
tui?: {
|
|
12
|
+
toast?: (payload: {
|
|
13
|
+
variant?: "info" | "success" | "warning" | "error";
|
|
14
|
+
title?: string;
|
|
15
|
+
message: string;
|
|
16
|
+
duration?: number;
|
|
17
|
+
}) => void | Promise<void>;
|
|
18
|
+
showToast?: (payload: {
|
|
19
|
+
body: {
|
|
20
|
+
variant?: "info" | "success" | "warning" | "error";
|
|
21
|
+
title?: string;
|
|
22
|
+
message: string;
|
|
23
|
+
duration?: number;
|
|
24
|
+
};
|
|
25
|
+
}) => void | Promise<void>;
|
|
26
|
+
clearPrompt?: () => void | Promise<void>;
|
|
27
|
+
submitPrompt?: () => void | Promise<void>;
|
|
28
|
+
};
|
|
29
|
+
app: {
|
|
30
|
+
log: (payload: Record<string, unknown>) => Promise<void>;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
interface OpencodeEventPayload {
|
|
35
|
+
type: string;
|
|
36
|
+
properties?: Record<string, unknown>;
|
|
37
|
+
}
|
|
38
|
+
interface EventHookInput {
|
|
39
|
+
event: OpencodeEventPayload;
|
|
40
|
+
}
|
|
41
|
+
interface SystemTransformOutput {
|
|
42
|
+
system: string[];
|
|
43
|
+
}
|
|
44
|
+
export interface Hooks {
|
|
45
|
+
event?: (input: EventHookInput) => void | Promise<void>;
|
|
46
|
+
config?: (input: OpenCodeConfigHookInput) => void | Promise<void>;
|
|
47
|
+
"experimental.chat.system.transform"?: (input: unknown, output: SystemTransformOutput) => void | Promise<void>;
|
|
48
|
+
"chat.params"?: (input: unknown, output: unknown) => void | Promise<void>;
|
|
49
|
+
}
|
|
50
|
+
export type Plugin = (input: PluginInput) => Hooks | Promise<Hooks>;
|
|
51
|
+
declare const kibiOpencodePlugin: Plugin;
|
|
52
|
+
export default kibiOpencodePlugin;
|