@thelioo/opencode-balancer 0.1.3 → 0.1.5
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/INSTALL.txt +16 -7
- package/README.md +24 -45
- package/dist/core/accounts.d.ts +14 -0
- package/dist/core/accounts.js +260 -0
- package/dist/core/accounts.js.map +1 -0
- package/dist/core/database.d.ts +4 -0
- package/dist/core/database.js +69 -0
- package/dist/core/database.js.map +1 -0
- package/dist/core/events.d.ts +18 -0
- package/dist/core/events.js +39 -0
- package/dist/core/events.js.map +1 -0
- package/dist/core/native-auth-suppression.d.ts +3 -0
- package/dist/core/native-auth-suppression.js +19 -0
- package/dist/core/native-auth-suppression.js.map +1 -0
- package/dist/core/native-connect.d.ts +4 -0
- package/dist/core/native-connect.js +19 -0
- package/dist/core/native-connect.js.map +1 -0
- package/dist/core/path.d.ts +4 -0
- package/dist/core/path.js +26 -0
- package/dist/core/path.js.map +1 -0
- package/dist/core/pending.d.ts +9 -0
- package/dist/core/pending.js +237 -0
- package/dist/core/pending.js.map +1 -0
- package/dist/core/priority.d.ts +20 -0
- package/dist/core/priority.js +120 -0
- package/dist/core/priority.js.map +1 -0
- package/dist/core/schema.d.ts +2 -0
- package/dist/core/schema.js +265 -0
- package/dist/core/schema.js.map +1 -0
- package/dist/core/time.d.ts +1 -0
- package/dist/core/time.js +4 -0
- package/dist/core/time.js.map +1 -0
- package/dist/core/types.d.ts +59 -0
- package/dist/core/types.js +2 -0
- package/dist/core/types.js.map +1 -0
- package/dist/core/usage/index.d.ts +4 -0
- package/dist/core/usage/index.js +16 -0
- package/dist/core/usage/index.js.map +1 -0
- package/dist/core/usage/providers/copilot.d.ts +2 -0
- package/dist/core/usage/providers/copilot.js +169 -0
- package/dist/core/usage/providers/copilot.js.map +1 -0
- package/dist/core/usage/providers/openai.d.ts +2 -0
- package/dist/core/usage/providers/openai.js +133 -0
- package/dist/core/usage/providers/openai.js.map +1 -0
- package/dist/core/usage/redact.d.ts +3 -0
- package/dist/core/usage/redact.js +67 -0
- package/dist/core/usage/redact.js.map +1 -0
- package/dist/core/usage/store.d.ts +4 -0
- package/dist/core/usage/store.js +31 -0
- package/dist/core/usage/store.js.map +1 -0
- package/dist/core/usage/types.d.ts +21 -0
- package/dist/core/usage/types.js +2 -0
- package/dist/core/usage/types.js.map +1 -0
- package/dist/index.d.ts +4 -36
- package/dist/index.js +3 -60
- package/dist/index.js.map +1 -1
- package/dist/server/auth-watcher.d.ts +31 -0
- package/dist/server/auth-watcher.js +227 -0
- package/dist/server/auth-watcher.js.map +1 -0
- package/dist/server/commands.d.ts +2 -0
- package/dist/server/commands.js +46 -0
- package/dist/server/commands.js.map +1 -0
- package/dist/server/fetch-patch.d.ts +3 -0
- package/dist/server/fetch-patch.js +118 -0
- package/dist/server/fetch-patch.js.map +1 -0
- package/dist/server/index.d.ts +8 -0
- package/dist/server/index.js +94 -0
- package/dist/server/index.js.map +1 -0
- package/dist/server/native.d.ts +6 -0
- package/dist/server/native.js +35 -0
- package/dist/server/native.js.map +1 -0
- package/dist/server/request-balancer.d.ts +16 -0
- package/dist/server/request-balancer.js +43 -0
- package/dist/server/request-balancer.js.map +1 -0
- package/dist/tui/actions.d.ts +41 -0
- package/dist/tui/actions.js +88 -0
- package/dist/tui/actions.js.map +1 -0
- package/dist/tui/actions.ts +140 -0
- package/dist/tui/balancer-bar-sync.d.ts +19 -0
- package/dist/tui/balancer-bar-sync.js +45 -0
- package/dist/tui/balancer-bar-sync.js.map +1 -0
- package/dist/tui/balancer-bar-sync.ts +56 -0
- package/dist/tui/components/alias-dialog.d.ts +4 -0
- package/dist/tui/components/alias-dialog.js +57 -0
- package/dist/tui/components/alias-dialog.js.map +1 -0
- package/dist/tui/components/alias-dialog.tsx +72 -0
- package/dist/tui/components/dashboard.d.ts +12 -0
- package/dist/tui/components/dashboard.js +201 -0
- package/dist/tui/components/dashboard.js.map +1 -0
- package/dist/tui/components/dashboard.tsx +393 -0
- package/dist/tui/components/priority-screen.d.ts +9 -0
- package/dist/tui/components/priority-screen.js +120 -0
- package/dist/tui/components/priority-screen.js.map +1 -0
- package/dist/tui/components/priority-screen.tsx +302 -0
- package/dist/tui/components/provider-model-dialog.d.ts +13 -0
- package/dist/tui/components/provider-model-dialog.js +45 -0
- package/dist/tui/components/provider-model-dialog.js.map +1 -0
- package/dist/tui/components/provider-model-dialog.tsx +71 -0
- package/dist/tui/components/rename-dialog.d.ts +4 -0
- package/dist/tui/components/rename-dialog.js +24 -0
- package/dist/tui/components/rename-dialog.js.map +1 -0
- package/dist/tui/components/rename-dialog.tsx +40 -0
- package/dist/tui/components/sidebar.d.ts +10 -0
- package/dist/tui/components/sidebar.js +27 -0
- package/dist/tui/components/sidebar.js.map +1 -0
- package/dist/tui/components/sidebar.tsx +97 -0
- package/dist/tui/components/status-indicator.d.ts +9 -0
- package/dist/tui/components/status-indicator.js +59 -0
- package/dist/tui/components/status-indicator.js.map +1 -0
- package/dist/tui/components/status-indicator.tsx +78 -0
- package/dist/tui/components/usage-bar.d.ts +8 -0
- package/dist/tui/components/usage-bar.js +7 -0
- package/dist/tui/components/usage-bar.js.map +1 -0
- package/dist/tui/components/usage-bar.tsx +13 -0
- package/dist/tui/components/usage-display.d.ts +10 -0
- package/dist/tui/components/usage-display.js +32 -0
- package/dist/tui/components/usage-display.js.map +1 -0
- package/dist/tui/components/usage-display.tsx +29 -0
- package/dist/tui/connect.d.ts +30 -0
- package/dist/tui/connect.js +73 -0
- package/dist/tui/connect.js.map +1 -0
- package/dist/tui/connect.ts +100 -0
- package/dist/tui/dashboard-keys.d.ts +45 -0
- package/dist/tui/dashboard-keys.js +44 -0
- package/dist/tui/dashboard-keys.js.map +1 -0
- package/dist/tui/dashboard-keys.ts +60 -0
- package/dist/tui/native-model-apply.d.ts +21 -0
- package/dist/tui/native-model-apply.js +53 -0
- package/dist/tui/native-model-apply.js.map +1 -0
- package/dist/tui/native-model-apply.ts +73 -0
- package/dist/tui/priority-keys.d.ts +40 -0
- package/dist/tui/priority-keys.js +38 -0
- package/dist/tui/priority-keys.js.map +1 -0
- package/dist/tui/priority-keys.ts +59 -0
- package/dist/tui/provider-models.d.ts +19 -0
- package/dist/tui/provider-models.js +17 -0
- package/dist/tui/provider-models.js.map +1 -0
- package/dist/tui/provider-models.ts +36 -0
- package/dist/tui/responsive.d.ts +9 -0
- package/dist/tui/responsive.js +13 -0
- package/dist/tui/responsive.js.map +1 -0
- package/dist/tui/responsive.ts +16 -0
- package/dist/tui/selection-colors.d.ts +10 -0
- package/dist/tui/selection-colors.js +38 -0
- package/dist/tui/selection-colors.js.map +1 -0
- package/dist/tui/selection-colors.ts +45 -0
- package/dist/tui/state.d.ts +14 -0
- package/dist/tui/state.js +46 -0
- package/dist/tui/state.js.map +1 -0
- package/dist/tui/state.ts +65 -0
- package/dist/tui/status-format.d.ts +15 -0
- package/dist/tui/status-format.js +17 -0
- package/dist/tui/status-format.js.map +1 -0
- package/dist/tui/status-format.ts +29 -0
- package/dist/tui/tui.d.ts +7 -0
- package/dist/tui/tui.js +120 -0
- package/dist/tui/tui.js.map +1 -0
- package/dist/tui/tui.tsx +142 -0
- package/dist/tui/usage-auto-refresh.d.ts +16 -0
- package/dist/tui/usage-auto-refresh.js +46 -0
- package/dist/tui/usage-auto-refresh.js.map +1 -0
- package/dist/tui/usage-auto-refresh.ts +64 -0
- package/dist/tui/usage-format.d.ts +2 -0
- package/dist/tui/usage-format.js +17 -0
- package/dist/tui/usage-format.js.map +1 -0
- package/dist/tui/usage-format.ts +14 -0
- package/package.json +10 -3
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { listAccounts } from "../core/accounts";
|
|
2
|
+
import { refreshUsageForAccount } from "./actions";
|
|
3
|
+
export function createUsageAutoRefresh(api, state, options = {}) {
|
|
4
|
+
const intervalMs = options.intervalMs ?? 60_000;
|
|
5
|
+
const promptDebounceMs = options.promptDebounceMs ?? 30_000;
|
|
6
|
+
const now = options.now ?? Date.now;
|
|
7
|
+
const inFlight = new Set();
|
|
8
|
+
let lastPromptRefreshAt = 0;
|
|
9
|
+
const refreshOne = async (providerID, alias) => {
|
|
10
|
+
const key = `${providerID}/${alias}`;
|
|
11
|
+
if (inFlight.has(key))
|
|
12
|
+
return;
|
|
13
|
+
inFlight.add(key);
|
|
14
|
+
try {
|
|
15
|
+
await refreshUsageForAccount(api, state, providerID, alias, {
|
|
16
|
+
refreshUsage: options.refreshUsage,
|
|
17
|
+
silent: true,
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
finally {
|
|
21
|
+
inFlight.delete(key);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
const refreshNow = async () => {
|
|
25
|
+
const accounts = listAccounts(state.db).filter((account) => !account.disabled);
|
|
26
|
+
await Promise.all(accounts.map((account) => refreshOne(account.providerID, account.alias)));
|
|
27
|
+
};
|
|
28
|
+
const refreshForPrompt = async () => {
|
|
29
|
+
const current = now();
|
|
30
|
+
if (current - lastPromptRefreshAt < promptDebounceMs)
|
|
31
|
+
return;
|
|
32
|
+
lastPromptRefreshAt = current;
|
|
33
|
+
await refreshNow();
|
|
34
|
+
};
|
|
35
|
+
const timer = intervalMs > 0 ? setInterval(() => void refreshNow(), intervalMs) : undefined;
|
|
36
|
+
void refreshNow();
|
|
37
|
+
return {
|
|
38
|
+
refreshNow,
|
|
39
|
+
refreshForPrompt,
|
|
40
|
+
dispose() {
|
|
41
|
+
if (timer)
|
|
42
|
+
clearInterval(timer);
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=usage-auto-refresh.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usage-auto-refresh.js","sourceRoot":"","sources":["../../src/tui/usage-auto-refresh.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD,OAAO,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AAYnD,MAAM,UAAU,sBAAsB,CAClC,GAAa,EACb,KAAuB,EACvB,UAAmC,EAAE;IAErC,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,MAAM,CAAC;IAChD,MAAM,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,IAAI,MAAM,CAAC;IAC5D,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC;IACpC,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAU,CAAC;IACnC,IAAI,mBAAmB,GAAG,CAAC,CAAC;IAE5B,MAAM,UAAU,GAAG,KAAK,EAAE,UAAkB,EAAE,KAAa,EAAE,EAAE;QAC3D,MAAM,GAAG,GAAG,GAAG,UAAU,IAAI,KAAK,EAAE,CAAC;QACrC,IAAI,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC;YAAE,OAAO;QAE9B,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAClB,IAAI,CAAC;YACD,MAAM,sBAAsB,CAAC,GAAG,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE;gBACxD,YAAY,EAAE,OAAO,CAAC,YAAY;gBAClC,MAAM,EAAE,IAAI;aACf,CAAC,CAAC;QACP,CAAC;gBAAS,CAAC;YACP,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACzB,CAAC;IACL,CAAC,CAAC;IAEF,MAAM,UAAU,GAAG,KAAK,IAAI,EAAE;QAC1B,MAAM,QAAQ,GAAG,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QAC/E,MAAM,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAChG,CAAC,CAAC;IAEF,MAAM,gBAAgB,GAAG,KAAK,IAAI,EAAE;QAChC,MAAM,OAAO,GAAG,GAAG,EAAE,CAAC;QACtB,IAAI,OAAO,GAAG,mBAAmB,GAAG,gBAAgB;YAAE,OAAO;QAE7D,mBAAmB,GAAG,OAAO,CAAC;QAC9B,MAAM,UAAU,EAAE,CAAC;IACvB,CAAC,CAAC;IAEF,MAAM,KAAK,GAAG,UAAU,GAAG,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,GAAG,EAAE,CAAC,KAAK,UAAU,EAAE,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC5F,KAAK,UAAU,EAAE,CAAC;IAElB,OAAO;QACH,UAAU;QACV,gBAAgB;QAChB,OAAO;YACH,IAAI,KAAK;gBAAE,aAAa,CAAC,KAAK,CAAC,CAAC;QACpC,CAAC;KACJ,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { listAccounts } from "../core/accounts";
|
|
2
|
+
import { refreshAccountUsage } from "../core/usage";
|
|
3
|
+
import { refreshUsageForAccount } from "./actions";
|
|
4
|
+
import type { BalancerTuiState } from "./state";
|
|
5
|
+
|
|
6
|
+
type ToastApi = Parameters<typeof refreshUsageForAccount>[0];
|
|
7
|
+
|
|
8
|
+
type UsageAutoRefreshOptions = {
|
|
9
|
+
intervalMs?: number;
|
|
10
|
+
promptDebounceMs?: number;
|
|
11
|
+
refreshUsage?: typeof refreshAccountUsage;
|
|
12
|
+
now?: () => number;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export function createUsageAutoRefresh(
|
|
16
|
+
api: ToastApi,
|
|
17
|
+
state: BalancerTuiState,
|
|
18
|
+
options: UsageAutoRefreshOptions = {},
|
|
19
|
+
) {
|
|
20
|
+
const intervalMs = options.intervalMs ?? 60_000;
|
|
21
|
+
const promptDebounceMs = options.promptDebounceMs ?? 30_000;
|
|
22
|
+
const now = options.now ?? Date.now;
|
|
23
|
+
const inFlight = new Set<string>();
|
|
24
|
+
let lastPromptRefreshAt = 0;
|
|
25
|
+
|
|
26
|
+
const refreshOne = async (providerID: string, alias: string) => {
|
|
27
|
+
const key = `${providerID}/${alias}`;
|
|
28
|
+
if (inFlight.has(key)) return;
|
|
29
|
+
|
|
30
|
+
inFlight.add(key);
|
|
31
|
+
try {
|
|
32
|
+
await refreshUsageForAccount(api, state, providerID, alias, {
|
|
33
|
+
refreshUsage: options.refreshUsage,
|
|
34
|
+
silent: true,
|
|
35
|
+
});
|
|
36
|
+
} finally {
|
|
37
|
+
inFlight.delete(key);
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const refreshNow = async () => {
|
|
42
|
+
const accounts = listAccounts(state.db).filter((account) => !account.disabled);
|
|
43
|
+
await Promise.all(accounts.map((account) => refreshOne(account.providerID, account.alias)));
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const refreshForPrompt = async () => {
|
|
47
|
+
const current = now();
|
|
48
|
+
if (current - lastPromptRefreshAt < promptDebounceMs) return;
|
|
49
|
+
|
|
50
|
+
lastPromptRefreshAt = current;
|
|
51
|
+
await refreshNow();
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const timer = intervalMs > 0 ? setInterval(() => void refreshNow(), intervalMs) : undefined;
|
|
55
|
+
void refreshNow();
|
|
56
|
+
|
|
57
|
+
return {
|
|
58
|
+
refreshNow,
|
|
59
|
+
refreshForPrompt,
|
|
60
|
+
dispose() {
|
|
61
|
+
if (timer) clearInterval(timer);
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export function formatUsageBar(percent, width = 8) {
|
|
2
|
+
if (percent === undefined)
|
|
3
|
+
return `${"─".repeat(width)} --`;
|
|
4
|
+
const value = Math.max(0, Math.min(100, Math.round(percent)));
|
|
5
|
+
const filled = Math.max(0, Math.min(width, Math.ceil((value / 100) * width)));
|
|
6
|
+
return `${"█".repeat(filled)}${"░".repeat(width - filled)} ${value}%`;
|
|
7
|
+
}
|
|
8
|
+
export function truncateMiddle(value, maxLength) {
|
|
9
|
+
if (value.length <= maxLength)
|
|
10
|
+
return value;
|
|
11
|
+
if (maxLength <= 1)
|
|
12
|
+
return "…";
|
|
13
|
+
const left = Math.ceil((maxLength - 1) / 2);
|
|
14
|
+
const right = Math.floor((maxLength - 1) / 2);
|
|
15
|
+
return `${value.slice(0, left)}…${value.slice(value.length - right)}`;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=usage-format.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usage-format.js","sourceRoot":"","sources":["../../src/tui/usage-format.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,cAAc,CAAC,OAA2B,EAAE,KAAK,GAAG,CAAC;IACjE,IAAI,OAAO,KAAK,SAAS;QAAE,OAAO,GAAG,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC;IAC5D,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC9D,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,KAAK,GAAG,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IAC9E,OAAO,GAAG,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC,KAAK,GAAG,MAAM,CAAC,IAAI,KAAK,GAAG,CAAC;AAC1E,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,KAAa,EAAE,SAAiB;IAC3D,IAAI,KAAK,CAAC,MAAM,IAAI,SAAS;QAAE,OAAO,KAAK,CAAC;IAC5C,IAAI,SAAS,IAAI,CAAC;QAAE,OAAO,GAAG,CAAC;IAC/B,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAC5C,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAC9C,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC,EAAE,CAAC;AAC1E,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export function formatUsageBar(percent: number | undefined, width = 8) {
|
|
2
|
+
if (percent === undefined) return `${"─".repeat(width)} --`;
|
|
3
|
+
const value = Math.max(0, Math.min(100, Math.round(percent)));
|
|
4
|
+
const filled = Math.max(0, Math.min(width, Math.ceil((value / 100) * width)));
|
|
5
|
+
return `${"█".repeat(filled)}${"░".repeat(width - filled)} ${value}%`;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export function truncateMiddle(value: string, maxLength: number) {
|
|
9
|
+
if (value.length <= maxLength) return value;
|
|
10
|
+
if (maxLength <= 1) return "…";
|
|
11
|
+
const left = Math.ceil((maxLength - 1) / 2);
|
|
12
|
+
const right = Math.floor((maxLength - 1) / 2);
|
|
13
|
+
return `${value.slice(0, left)}…${value.slice(value.length - right)}`;
|
|
14
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thelioo/opencode-balancer",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "Account balancer plugin for opencode.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -9,6 +9,10 @@
|
|
|
9
9
|
".": {
|
|
10
10
|
"types": "./dist/index.d.ts",
|
|
11
11
|
"default": "./dist/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./tui": {
|
|
14
|
+
"types": "./dist/tui/tui.d.ts",
|
|
15
|
+
"default": "./dist/tui/tui.tsx"
|
|
12
16
|
}
|
|
13
17
|
},
|
|
14
18
|
"files": [
|
|
@@ -18,8 +22,9 @@
|
|
|
18
22
|
"LICENSE"
|
|
19
23
|
],
|
|
20
24
|
"scripts": {
|
|
21
|
-
"build": "tsc --project tsconfig.json",
|
|
25
|
+
"build": "tsc --project tsconfig.json && node scripts/copy-tui-source.mjs",
|
|
22
26
|
"check": "tsc --noEmit --project tsconfig.json",
|
|
27
|
+
"test": "bun test",
|
|
23
28
|
"prepublishOnly": "npm run build"
|
|
24
29
|
},
|
|
25
30
|
"keywords": [
|
|
@@ -38,7 +43,9 @@
|
|
|
38
43
|
"homepage": "https://github.com/thelioo/opencode-balancer#readme",
|
|
39
44
|
"license": "MIT",
|
|
40
45
|
"dependencies": {
|
|
41
|
-
"@opencode-ai/plugin": "^1.14.51"
|
|
46
|
+
"@opencode-ai/plugin": "^1.14.51",
|
|
47
|
+
"@opentui/solid": "^0.2.16",
|
|
48
|
+
"solid-js": "^1.9.12"
|
|
42
49
|
},
|
|
43
50
|
"devDependencies": {
|
|
44
51
|
"@types/bun": "^1.3.14",
|