@cortexkit/opencode-anthropic-auth 2.4.1 → 2.4.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/cli.js +44 -44
- package/dist/index-42r4bnpm.js +45 -0
- package/dist/{index-a1k6z503.js → index-hbk67489.js} +1 -1
- package/dist/{index-12km9x91.js → index-t4aky73k.js} +1 -1
- package/dist/index.js +1 -1
- package/dist/setup/command.d.ts +3 -1
- package/dist/sidebar-state.d.ts +1 -0
- package/dist/sidebar-state.js +1 -1
- package/dist/v2/adapter.d.ts +4 -2
- package/dist/v2/cachekeep.d.ts +6 -1
- package/dist/v2/server.js +11 -10
- package/dist/v2/setup.d.ts +14 -0
- package/dist/v2/tui.js +1 -1
- package/package.json +6 -6
- package/src/sidebar-state.ts +9 -0
- package/src/tui/claude-sidebar.tsx +22 -32
- package/src/tui-compiled/sidebar-state.ts +9 -0
- package/src/tui-compiled/tui/claude-sidebar.tsx +155 -184
- package/dist/index-xarkyfqd.js +0 -45
package/dist/v2/tui.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{u as q}from"../index-
|
|
1
|
+
import{u as q}from"../index-hbk67489.js";import"../index-t4aky73k.js";import"../index-71temqvq.js";var N="Open this link in your browser and sign in. Then choose Finish OAuth sign-in in the Accounts menu and paste the code Claude shows you.";async function g(D,M={}){let B=D.client.rpc(q),Z=!0,V=!1,Y=new AbortController,$=()=>{let j=D.ui.router.current();return j.type==="session"?j.sessionID:void 0};function C(j){return new Promise((Q)=>{let z="",J=!1,G=D.keymap.mode.push("cortexkit-protected-entry"),X=(H,W=!0)=>{if(J)return;J=!0,D.renderer.keyInput.off("keypress",O),D.renderer.keyInput.off("paste",P),Y.signal.removeEventListener("abort",K),G();let F=H?z:void 0;if(z="",W)D.ui.dialog.clear();Q(F)},K=()=>X(!1),O=(H)=>{if(H.preventDefault(),H.stopPropagation(),H.name==="escape"||H.ctrl&&H.name==="c")return X(!1);if(H.name==="return"||H.name==="enter")return X(!0);if(H.name==="backspace"){z=Array.from(z).slice(0,-1).join("");return}if(!H.ctrl&&!H.meta&&!H.option&&Array.from(H.sequence).every((W)=>W.charCodeAt(0)>=32&&W.charCodeAt(0)!==127))z=(z+H.sequence).slice(0,4096)},P=(H)=>{H.preventDefault(),H.stopPropagation(),z=(z+Array.from(new TextDecoder().decode(H.bytes)).filter((W)=>W.charCodeAt(0)>=32&&W.charCodeAt(0)!==127).join("")).slice(0,4096)};if(D.renderer.keyInput.prependListener("keypress",O),D.renderer.keyInput.prependListener("paste",P),Y.signal.addEventListener("abort",K,{once:!0}),D.ui.dialog.alert({title:j,message:"Type or paste the value. Input is hidden. Enter accepts; Escape cancels."}).then(()=>X(!1,!1),()=>X(!1,!1)),Y.signal.aborted)K()})}async function E(j){let Q={};for(let z of j.knobs){if(!Z)return;if(z.kind==="choice"){let J=await D.ui.dialog.select({title:z.label,options:z.choices.map((G)=>({title:G.label,value:G.value})),current:z.value});if(J===void 0)return;Q[z.id]=J}else if(z.kind==="toggle"){let J=await D.ui.dialog.select({title:z.label,options:[{title:"On",value:!0},{title:"Off",value:!1}],current:z.value});if(J===void 0)return;Q[z.id]=J}else{let J=z.kind==="text"&&z.masked?await C(z.label):await D.ui.dialog.prompt({title:z.label,value:z.value===void 0?void 0:String(z.value),placeholder:z.kind==="text"?z.placeholder:void 0});if(J===void 0)return;Q[z.id]=J===""&&!z.required?null:z.kind==="number"?Number(J):J}}return Q}async function A(j){if(M.showSignInLink)try{await M.showSignInLink(D,j,Y.signal);return}catch{}await D.ui.dialog.alert({title:"Claude sign-in",message:`${N}
|
|
2
2
|
|
|
3
3
|
${j}
|
|
4
4
|
`})}async function T(j,Q){let z=`${Q.title} status`;if(M.showStatus)try{await M.showStatus(D,{title:z,lines:Q.lines,...Q.slot==="quota"&&{readQuota:(J)=>B.sidebar({sessionId:j},{signal:J,location:D.location})}},Y.signal);return}catch{}await D.ui.dialog.alert({title:z,message:Q.lines.join(`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cortexkit/opencode-anthropic-auth",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -77,10 +77,10 @@
|
|
|
77
77
|
},
|
|
78
78
|
"dependencies": {
|
|
79
79
|
"@clack/prompts": "^1.6.0",
|
|
80
|
-
"@cortexkit/anthropic-auth-core": "2.4.
|
|
81
|
-
"@cortexkit/claustrum-client": "0.
|
|
82
|
-
"@cortexkit/private-files": "0.2.
|
|
83
|
-
"@cortexkit/subc-client": "^0.22.
|
|
80
|
+
"@cortexkit/anthropic-auth-core": "2.4.3",
|
|
81
|
+
"@cortexkit/claustrum-client": "0.13.0",
|
|
82
|
+
"@cortexkit/private-files": "0.2.2",
|
|
83
|
+
"@cortexkit/subc-client": "^0.22.10",
|
|
84
84
|
"@opentui/core": "0.7.0",
|
|
85
85
|
"@opentui/solid": "0.7.0",
|
|
86
86
|
"jsonc-parser": "^3.3.1",
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"xxhash-wasm": "^1.1.0"
|
|
89
89
|
},
|
|
90
90
|
"devDependencies": {
|
|
91
|
-
"@ai-sdk/anthropic": "4.0.
|
|
91
|
+
"@ai-sdk/anthropic": "4.0.88",
|
|
92
92
|
"@opencode/plugin": "2.2.0"
|
|
93
93
|
}
|
|
94
94
|
}
|
package/src/sidebar-state.ts
CHANGED
|
@@ -1149,6 +1149,7 @@ export function getCollapsedAccounts(
|
|
|
1149
1149
|
quota: state.main?.quota ?? null,
|
|
1150
1150
|
quotaDated: state.main?.quotaDated,
|
|
1151
1151
|
active: activeId === 'main',
|
|
1152
|
+
blocked: state.main?.enabled === false || Boolean(state.main?.stateLine),
|
|
1152
1153
|
},
|
|
1153
1154
|
...(showFallbacks
|
|
1154
1155
|
? (state.fallbacks ?? [])
|
|
@@ -1163,6 +1164,14 @@ export function getCollapsedAccounts(
|
|
|
1163
1164
|
quota: account.quota,
|
|
1164
1165
|
quotaDated: account.quotaDated,
|
|
1165
1166
|
active: activeId === account.id,
|
|
1167
|
+
blocked:
|
|
1168
|
+
!account.enabled ||
|
|
1169
|
+
Boolean(account.stateLine) ||
|
|
1170
|
+
account.needsReauth ||
|
|
1171
|
+
account.vaultReauth === true ||
|
|
1172
|
+
(account.custodyState != null &&
|
|
1173
|
+
account.custodyState !== 'off' &&
|
|
1174
|
+
account.custodyState !== 'on-vault-served'),
|
|
1166
1175
|
}))
|
|
1167
1176
|
: []),
|
|
1168
1177
|
]
|
|
@@ -73,9 +73,6 @@ const PLUGIN_VERSION: string = (() => {
|
|
|
73
73
|
return ''
|
|
74
74
|
})()
|
|
75
75
|
|
|
76
|
-
// biome-ignore lint/suspicious/noExplicitAny: opentui border prop not typed in plugin tui surface
|
|
77
|
-
const SINGLE_BORDER = { type: 'single' } as any
|
|
78
|
-
|
|
79
76
|
export type SidebarColor = RGBA | string
|
|
80
77
|
|
|
81
78
|
/** The flat theme tokens the sidebar draws with; OpenCode 1's `theme.current` has them all. */
|
|
@@ -255,7 +252,9 @@ function CollapsedAccountRow(props: {
|
|
|
255
252
|
let row: BoxRenderable | undefined
|
|
256
253
|
const summary = () => getCollapsedQuotaSummary(props.account.quota, props.now)
|
|
257
254
|
const value = () => summary().text ?? '—'
|
|
258
|
-
|
|
255
|
+
// Keep the quota and its two-cell status suffix intact; only the label shrinks.
|
|
256
|
+
const labelWidth = () =>
|
|
257
|
+
Math.max(0, width() - 1 - Bun.stringWidth(value()) - 2)
|
|
259
258
|
const dim = () =>
|
|
260
259
|
!props.account.active || props.account.quotaDated || summary().stale
|
|
261
260
|
const attributes = () => (dim() ? TextAttributes.DIM : TextAttributes.BOLD)
|
|
@@ -295,6 +294,21 @@ function CollapsedAccountRow(props: {
|
|
|
295
294
|
>
|
|
296
295
|
{value()}
|
|
297
296
|
</text>
|
|
297
|
+
<text
|
|
298
|
+
width={2}
|
|
299
|
+
flexShrink={0}
|
|
300
|
+
fg={toneColor(
|
|
301
|
+
props.theme,
|
|
302
|
+
props.account.blocked
|
|
303
|
+
? 'warn'
|
|
304
|
+
: props.account.active
|
|
305
|
+
? 'ok'
|
|
306
|
+
: 'muted',
|
|
307
|
+
)}
|
|
308
|
+
attributes={attributes()}
|
|
309
|
+
>
|
|
310
|
+
{props.account.blocked ? ' ⊘' : ' ●'}
|
|
311
|
+
</text>
|
|
298
312
|
</box>
|
|
299
313
|
)
|
|
300
314
|
}
|
|
@@ -795,17 +809,8 @@ export function ClaudeSidebar(props: {
|
|
|
795
809
|
}
|
|
796
810
|
|
|
797
811
|
return (
|
|
798
|
-
<box
|
|
799
|
-
|
|
800
|
-
flexDirection='column'
|
|
801
|
-
border={SINGLE_BORDER}
|
|
802
|
-
borderColor={theme().borderActive}
|
|
803
|
-
paddingTop={1}
|
|
804
|
-
paddingBottom={1}
|
|
805
|
-
paddingLeft={1}
|
|
806
|
-
paddingRight={1}
|
|
807
|
-
>
|
|
808
|
-
{/* Header: ▼/▶ CLAUDE badge (click to collapse) + version, or LIMITED badge */}
|
|
812
|
+
<box width='100%' flexDirection='column'>
|
|
813
|
+
{/* The collapse control stays on the left; the version stays on the right. */}
|
|
809
814
|
{/* biome-ignore lint/a11y/noStaticElementInteractions: opentui renders to a terminal, not the DOM — ARIA roles do not apply */}
|
|
810
815
|
<box
|
|
811
816
|
width='100%'
|
|
@@ -821,23 +826,8 @@ export function ClaudeSidebar(props: {
|
|
|
821
826
|
<b>{headerLabel()}</b>
|
|
822
827
|
</text>
|
|
823
828
|
</box>
|
|
824
|
-
<Show
|
|
825
|
-
|
|
826
|
-
fallback={
|
|
827
|
-
<Show when={prefs().header.showVersion && PLUGIN_VERSION !== ''}>
|
|
828
|
-
<text fg={theme().textMuted}>{`v${PLUGIN_VERSION}`}</text>
|
|
829
|
-
</Show>
|
|
830
|
-
}
|
|
831
|
-
>
|
|
832
|
-
<box
|
|
833
|
-
paddingLeft={1}
|
|
834
|
-
paddingRight={1}
|
|
835
|
-
backgroundColor={theme().warning}
|
|
836
|
-
>
|
|
837
|
-
<text fg={theme().background}>
|
|
838
|
-
<b>{'LIMITED'}</b>
|
|
839
|
-
</text>
|
|
840
|
-
</box>
|
|
829
|
+
<Show when={prefs().header.showVersion && PLUGIN_VERSION !== ''}>
|
|
830
|
+
<text fg={theme().textMuted}>{`v${PLUGIN_VERSION}`}</text>
|
|
841
831
|
</Show>
|
|
842
832
|
</box>
|
|
843
833
|
|
|
@@ -1149,6 +1149,7 @@ export function getCollapsedAccounts(
|
|
|
1149
1149
|
quota: state.main?.quota ?? null,
|
|
1150
1150
|
quotaDated: state.main?.quotaDated,
|
|
1151
1151
|
active: activeId === 'main',
|
|
1152
|
+
blocked: state.main?.enabled === false || Boolean(state.main?.stateLine),
|
|
1152
1153
|
},
|
|
1153
1154
|
...(showFallbacks
|
|
1154
1155
|
? (state.fallbacks ?? [])
|
|
@@ -1163,6 +1164,14 @@ export function getCollapsedAccounts(
|
|
|
1163
1164
|
quota: account.quota,
|
|
1164
1165
|
quotaDated: account.quotaDated,
|
|
1165
1166
|
active: activeId === account.id,
|
|
1167
|
+
blocked:
|
|
1168
|
+
!account.enabled ||
|
|
1169
|
+
Boolean(account.stateLine) ||
|
|
1170
|
+
account.needsReauth ||
|
|
1171
|
+
account.vaultReauth === true ||
|
|
1172
|
+
(account.custodyState != null &&
|
|
1173
|
+
account.custodyState !== 'off' &&
|
|
1174
|
+
account.custodyState !== 'on-vault-served'),
|
|
1166
1175
|
}))
|
|
1167
1176
|
: []),
|
|
1168
1177
|
]
|