-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathindex.ts
More file actions
43 lines (37 loc) · 1.13 KB
/
index.ts
File metadata and controls
43 lines (37 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/**
* OpenCode Quota Plugin
*
* Shows quota status in OpenCode without LLM invocation.
*
* @packageDocumentation
*/
import { QuotaToastPlugin } from "./plugin.js";
type V1PluginModule = {
id: string;
server: typeof QuotaToastPlugin;
};
// V1 plugin format: default export with id + server.
// This avoids the legacy getLegacyPlugins fallback path in OpenCode's plugin
// loader, which iterates Object.values(mod) and can conflict with other
// plugins that also use the legacy path.
const pluginModule = {
id: "@slkiser/opencode-quota",
server: QuotaToastPlugin,
} satisfies V1PluginModule;
export default pluginModule;
// Keep the named export for backward compatibility with consumers that import
// { QuotaToastPlugin } directly.
export { QuotaToastPlugin } from "./plugin.js";
// Re-export types for consumers (types are erased at runtime, so safe to export)
export type {
QuotaToastConfig,
GoogleModelId,
PricingSnapshotSource,
CopilotEnterpriseUsageResult,
CopilotOrganizationUsageResult,
CopilotQuotaResult,
GoogleQuotaResult,
GoogleModelQuota,
MiniMaxResult,
MiniMaxResultEntry,
} from "./lib/types.js";