@leo000001/opencode-quota-sidebar 3.0.2 → 3.0.3
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/dist/index.js +4 -3
- package/dist/tools.d.ts +13 -8
- package/dist/tools.js +4 -2
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -186,9 +186,10 @@ export async function QuotaSidebarPlugin(input) {
|
|
|
186
186
|
startupTitleWork = runStartupRestore().catch(swallow('startup:restoreAllVisibleTitles'));
|
|
187
187
|
}
|
|
188
188
|
else {
|
|
189
|
-
startupTitleWork =
|
|
190
|
-
.
|
|
191
|
-
.catch(swallow('startup:refreshAllTouchedTitles'))
|
|
189
|
+
startupTitleWork = Promise.allSettled([
|
|
190
|
+
refreshAllVisibleTitles().catch(swallow('startup:refreshAllVisibleTitles')),
|
|
191
|
+
refreshAllTouchedTitles().catch(swallow('startup:refreshAllTouchedTitles')),
|
|
192
|
+
]).then(() => undefined);
|
|
192
193
|
}
|
|
193
194
|
const shutdown = async () => {
|
|
194
195
|
await Promise.race([
|
package/dist/tools.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
import * as z from 'zod';
|
|
1
2
|
import type { QuotaSnapshot } from './types.js';
|
|
2
3
|
import type { UsageSummary } from './usage.js';
|
|
4
|
+
type ToolContext = {
|
|
5
|
+
sessionID: string;
|
|
6
|
+
};
|
|
3
7
|
export declare function createQuotaSidebarTools(deps: {
|
|
4
8
|
getTitleEnabled: () => boolean;
|
|
5
9
|
setTitleEnabled: (enabled: boolean) => void;
|
|
@@ -50,28 +54,29 @@ export declare function createQuotaSidebarTools(deps: {
|
|
|
50
54
|
quota_summary: {
|
|
51
55
|
description: string;
|
|
52
56
|
args: {
|
|
53
|
-
period:
|
|
57
|
+
period: z.ZodOptional<z.ZodEnum<{
|
|
54
58
|
day: "day";
|
|
55
59
|
week: "week";
|
|
56
60
|
month: "month";
|
|
57
61
|
session: "session";
|
|
58
62
|
}>>;
|
|
59
|
-
toast:
|
|
60
|
-
includeChildren:
|
|
63
|
+
toast: z.ZodOptional<z.ZodBoolean>;
|
|
64
|
+
includeChildren: z.ZodOptional<z.ZodBoolean>;
|
|
61
65
|
};
|
|
62
|
-
execute(args: {
|
|
66
|
+
execute: (args: {
|
|
63
67
|
period?: "day" | "week" | "month" | "session" | undefined;
|
|
64
68
|
toast?: boolean | undefined;
|
|
65
69
|
includeChildren?: boolean | undefined;
|
|
66
|
-
}, context:
|
|
70
|
+
}, context: ToolContext) => Promise<string>;
|
|
67
71
|
};
|
|
68
72
|
quota_show: {
|
|
69
73
|
description: string;
|
|
70
74
|
args: {
|
|
71
|
-
enabled:
|
|
75
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
72
76
|
};
|
|
73
|
-
execute(args: {
|
|
77
|
+
execute: (args: {
|
|
74
78
|
enabled?: boolean | undefined;
|
|
75
|
-
}, context:
|
|
79
|
+
}, context: ToolContext) => Promise<string>;
|
|
76
80
|
};
|
|
77
81
|
};
|
|
82
|
+
export {};
|
package/dist/tools.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import * as z from 'zod';
|
|
2
|
+
function tool(input) {
|
|
3
|
+
return input;
|
|
4
|
+
}
|
|
3
5
|
export function createQuotaSidebarTools(deps) {
|
|
4
6
|
let toggleLock = Promise.resolve();
|
|
5
7
|
const waitForStartupTitleWork = async () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leo000001/opencode-quota-sidebar",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.3",
|
|
4
4
|
"description": "OpenCode plugin that shows quota and token usage in TUI sidebar panels and compact session titles",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -78,7 +78,8 @@
|
|
|
78
78
|
"dependencies": {
|
|
79
79
|
"@opentui/core": "^0.1.92",
|
|
80
80
|
"@opentui/solid": "^0.1.92",
|
|
81
|
-
"solid-js": "^1.9.10"
|
|
81
|
+
"solid-js": "^1.9.10",
|
|
82
|
+
"zod": "^4.1.8"
|
|
82
83
|
},
|
|
83
84
|
"devDependencies": {
|
|
84
85
|
"@opencode-ai/plugin": "^1.3.5",
|