opencode-ultra 0.3.0 → 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.
- package/README.md +152 -264
- package/dist/config.d.ts +13 -0
- package/dist/hooks/fragment-injector.d.ts +9 -0
- package/dist/hooks/prompt-renderer.d.ts +14 -0
- package/dist/hooks/session-compaction.d.ts +1 -1
- package/dist/index.js +436 -21
- package/dist/shared/index.d.ts +2 -0
- package/dist/shared/ttl-map.d.ts +19 -0
- package/dist/shared/types.d.ts +93 -0
- package/dist/tools/ast-search.d.ts +3 -0
- package/dist/tools/batch-read.d.ts +2 -0
- package/dist/tools/continuity-ledger.d.ts +4 -0
- package/package.json +1 -1
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extended type definitions for OpenCode client APIs that are not (yet) in @opencode-ai/sdk types.
|
|
3
|
+
* These describe the actual runtime shape observed in OpenCode 1.2.x.
|
|
4
|
+
*/
|
|
5
|
+
/** Model identifier as passed through hook input */
|
|
6
|
+
export interface ModelRef {
|
|
7
|
+
providerID?: string;
|
|
8
|
+
modelID?: string;
|
|
9
|
+
}
|
|
10
|
+
/** Toast notification (TUI-only, non-standard) */
|
|
11
|
+
export interface ToastOptions {
|
|
12
|
+
body: {
|
|
13
|
+
title: string;
|
|
14
|
+
message: string;
|
|
15
|
+
variant?: "info" | "success" | "warning" | "error";
|
|
16
|
+
duration?: number;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
/** Extended OpenCode client with optional TUI and MCP methods */
|
|
20
|
+
export interface ExtendedClient {
|
|
21
|
+
session: {
|
|
22
|
+
create: (opts: {
|
|
23
|
+
body: Record<string, unknown>;
|
|
24
|
+
query?: {
|
|
25
|
+
directory?: string;
|
|
26
|
+
};
|
|
27
|
+
}) => Promise<{
|
|
28
|
+
data?: {
|
|
29
|
+
id?: string;
|
|
30
|
+
};
|
|
31
|
+
}>;
|
|
32
|
+
prompt: (opts: {
|
|
33
|
+
path: {
|
|
34
|
+
id: string;
|
|
35
|
+
};
|
|
36
|
+
body: {
|
|
37
|
+
parts: Array<{
|
|
38
|
+
type: string;
|
|
39
|
+
text: string;
|
|
40
|
+
}>;
|
|
41
|
+
agent?: string;
|
|
42
|
+
};
|
|
43
|
+
query?: {
|
|
44
|
+
directory?: string;
|
|
45
|
+
};
|
|
46
|
+
}) => Promise<unknown>;
|
|
47
|
+
messages: (opts: {
|
|
48
|
+
path: {
|
|
49
|
+
id: string;
|
|
50
|
+
};
|
|
51
|
+
query?: {
|
|
52
|
+
directory?: string;
|
|
53
|
+
};
|
|
54
|
+
}) => Promise<{
|
|
55
|
+
data?: Array<{
|
|
56
|
+
info?: {
|
|
57
|
+
role?: string;
|
|
58
|
+
};
|
|
59
|
+
parts?: Array<{
|
|
60
|
+
type: string;
|
|
61
|
+
text?: string;
|
|
62
|
+
}>;
|
|
63
|
+
}>;
|
|
64
|
+
}>;
|
|
65
|
+
delete: (opts: {
|
|
66
|
+
path: {
|
|
67
|
+
id: string;
|
|
68
|
+
};
|
|
69
|
+
query?: {
|
|
70
|
+
directory?: string;
|
|
71
|
+
};
|
|
72
|
+
}) => Promise<unknown>;
|
|
73
|
+
listMessages?: (opts: {
|
|
74
|
+
id: string;
|
|
75
|
+
}) => Promise<{
|
|
76
|
+
messages?: unknown[];
|
|
77
|
+
} | unknown[]>;
|
|
78
|
+
};
|
|
79
|
+
tui?: {
|
|
80
|
+
showToast?: (opts: ToastOptions) => Promise<void>;
|
|
81
|
+
};
|
|
82
|
+
mcp?: {
|
|
83
|
+
add?: (opts: {
|
|
84
|
+
body: Record<string, unknown>;
|
|
85
|
+
}) => Promise<void>;
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
/** System transform hook input */
|
|
89
|
+
export interface SystemTransformInput {
|
|
90
|
+
sessionID?: string;
|
|
91
|
+
model?: ModelRef;
|
|
92
|
+
agent?: string;
|
|
93
|
+
}
|
package/package.json
CHANGED