@cortexkit/opencode-anthropic-auth 2.1.2 → 2.2.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/dist/cli.js +36 -36
- package/dist/{index-x325vp4e.js → index-ccrq4mra.js} +13 -13
- package/dist/{index-53nnxq39.js → index-czyrqpxc.js} +1 -1
- package/dist/index-pden7a7y.js +2 -0
- package/dist/index.js +1 -1
- package/dist/sidebar-state.d.ts +1 -1
- package/dist/sidebar-state.js +1 -1
- package/dist/transform.d.ts +4 -0
- package/dist/tui/claude-sidebar.d.ts +94 -0
- package/dist/v2/menu-contract.d.ts +3 -0
- package/dist/v2/rpc.d.ts +9 -0
- package/dist/v2/server.js +4 -4
- package/dist/v2/sidebar.d.ts +13 -0
- package/dist/v2/source.d.ts +2 -0
- package/dist/v2/tui.d.ts +9 -1
- package/dist/v2/tui.js +2 -2
- package/dist/v2/wire.d.ts +4 -0
- package/package.json +5 -5
- package/src/sidebar-state.ts +8 -3
- package/src/tui/claude-sidebar.tsx +1075 -0
- package/src/tui/entry.mjs +15 -1
- package/src/tui-compiled/sidebar-state.ts +8 -3
- package/src/tui-compiled/tui/claude-sidebar.tsx +1253 -0
- package/src/tui-compiled/tui.tsx +46 -1137
- package/src/tui.tsx +15 -886
- package/dist/index-jexctf5w.js +0 -2
package/src/tui/entry.mjs
CHANGED
|
@@ -37,6 +37,17 @@ async function loadLegacyTui() {
|
|
|
37
37
|
return mod.default
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
// The quota sidebar renderer shared with OpenCode 1, loaded the same way.
|
|
41
|
+
async function loadSidebar() {
|
|
42
|
+
try {
|
|
43
|
+
await import(runtimeProbe)
|
|
44
|
+
} catch (error) {
|
|
45
|
+
if (!isMissingRuntimeRegistry(error)) throw error
|
|
46
|
+
return import('./claude-sidebar.tsx')
|
|
47
|
+
}
|
|
48
|
+
return import('../tui-compiled/tui/claude-sidebar.tsx')
|
|
49
|
+
}
|
|
50
|
+
|
|
40
51
|
let legacyModule
|
|
41
52
|
|
|
42
53
|
// OpenCode 1 reads id and tui from the default definition; OpenCode 2 reads
|
|
@@ -57,7 +68,10 @@ export const setup = async (context) => {
|
|
|
57
68
|
// TUI must not load the OpenCode 1 renderer or start that renderer's separate
|
|
58
69
|
// loopback notification poller.
|
|
59
70
|
const { setupAnthropicTui } = await import('../../dist/v2/tui.js')
|
|
60
|
-
return setupAnthropicTui(context
|
|
71
|
+
return setupAnthropicTui(context, {
|
|
72
|
+
mountSidebar: async (ctx, read) =>
|
|
73
|
+
(await loadSidebar()).mountClaudeSidebar(ctx, read),
|
|
74
|
+
})
|
|
61
75
|
}
|
|
62
76
|
|
|
63
77
|
export default { id, tui, setup }
|
|
@@ -888,7 +888,10 @@ export function formatPrimeCost(value: number): string {
|
|
|
888
888
|
return value.toFixed(Math.min(6, Math.max(0, 4)))
|
|
889
889
|
}
|
|
890
890
|
|
|
891
|
-
export function formatPrimeAccountValue(
|
|
891
|
+
export function formatPrimeAccountValue(
|
|
892
|
+
account: PrimeSidebarAccountState,
|
|
893
|
+
now = Date.now(),
|
|
894
|
+
): {
|
|
892
895
|
text: string
|
|
893
896
|
hasError: boolean
|
|
894
897
|
} {
|
|
@@ -898,7 +901,7 @@ export function formatPrimeAccountValue(account: PrimeSidebarAccountState): {
|
|
|
898
901
|
if (account.lastResult === 'skipped') {
|
|
899
902
|
return { text: 'skip', hasError: false }
|
|
900
903
|
}
|
|
901
|
-
if (account.nextDueAt && account.nextDueAt >
|
|
904
|
+
if (account.nextDueAt && account.nextDueAt > now) {
|
|
902
905
|
return { text: formatPrimeTime(account.nextDueAt), hasError: false }
|
|
903
906
|
}
|
|
904
907
|
if (account.lastPrimedAt) {
|
|
@@ -994,7 +997,9 @@ export function getCollapsedAccounts(
|
|
|
994
997
|
state: SidebarState,
|
|
995
998
|
showFallbacks = true,
|
|
996
999
|
) {
|
|
997
|
-
|
|
1000
|
+
// Before any request no account is active; do not mark main as serving.
|
|
1001
|
+
const activeId =
|
|
1002
|
+
state.activeId === undefined ? undefined : resolveActiveAccount(state).id
|
|
998
1003
|
return [
|
|
999
1004
|
{
|
|
1000
1005
|
id: 'main',
|