Skip to content
1 change: 1 addition & 0 deletions packages/opencode/src/auth/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export namespace Auth {
refresh: z.string(),
access: z.string(),
expires: z.number(),
has1MContext: z.boolean().optional(),
enterpriseUrl: z.string().optional(),
})
.meta({ ref: "OAuth" })
Expand Down
6 changes: 4 additions & 2 deletions packages/opencode/src/cli/cmd/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,12 +204,13 @@ export const AuthLoginCommand = cmd({
if (result.type === "success") {
const saveProvider = result.provider ?? provider
if ("refresh" in result) {
const { type: _, provider: __, refresh, access, expires, ...extraFields } = result
const { type: _, provider: __, refresh, access, expires, has1MContext, ...extraFields } = result
await Auth.set(saveProvider, {
type: "oauth",
refresh,
access,
expires,
has1MContext,
...extraFields,
})
}
Expand All @@ -236,12 +237,13 @@ export const AuthLoginCommand = cmd({
if (result.type === "success") {
const saveProvider = result.provider ?? provider
if ("refresh" in result) {
const { type: _, provider: __, refresh, access, expires, ...extraFields } = result
const { type: _, provider: __, refresh, access, expires, has1MContext, ...extraFields } = result
await Auth.set(saveProvider, {
type: "oauth",
refresh,
access,
expires,
has1MContext,
...extraFields,
})
}
Expand Down
2 changes: 2 additions & 0 deletions packages/plugin/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ export interface Hooks {
refresh: string
access: string
expires: number
has1MContext?: boolean
}
| { key: string }
))
Expand All @@ -92,6 +93,7 @@ export interface Hooks {
refresh: string
access: string
expires: number
has1MContext?: boolean
}
| { key: string }
))
Expand Down