Skip to content

Commit 5334319

Browse files
committed
export getUserInfoFromApiKey
1 parent ac8b8a1 commit 5334319

File tree

3 files changed

+31
-3
lines changed

3 files changed

+31
-3
lines changed

common/src/types/agent-template.ts

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,37 @@ import type {
1515
} from '../templates/initial-agents-dir/types/agent-definition'
1616
import type { Logger } from '../templates/initial-agents-dir/types/util-types'
1717
import type { ToolName } from '../tools/constants'
18-
import type { OpenRouterProviderOptions } from '@codebuff/internal/openrouter-ai-sdk'
1918
import type { z } from 'zod/v4'
2019

2120
export type AgentId = `${string}/${string}@${number}.${number}.${number}`
2221

22+
export type OpenRouterProviderOptions = {
23+
models?: string[]
24+
25+
/**
26+
* https://openrouter.ai/docs/use-cases/reasoning-tokens
27+
* One of `max_tokens` or `effort` is required.
28+
* If `exclude` is true, reasoning will be removed from the response. Default is false.
29+
*/
30+
reasoning?: {
31+
enabled?: boolean
32+
exclude?: boolean
33+
} & (
34+
| {
35+
max_tokens: number
36+
}
37+
| {
38+
effort: 'high' | 'medium' | 'low'
39+
}
40+
)
41+
42+
/**
43+
* A unique identifier representing your end-user, which can
44+
* help OpenRouter to monitor and detect abuse.
45+
*/
46+
user?: string
47+
}
48+
2349
/**
2450
* Backend agent template with strict validation and Zod schemas
2551
* Extends the user-facing AgentDefinition but with backend-specific requirements

common/src/types/contracts/database.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import type { AgentTemplate } from '../agent-template'
2-
import type { Logger } from './logger'
1+
import type { AgentTemplate } from '@codebuff/common/types/agent-template'
2+
import type { Logger } from '@codebuff/common/types/contracts/logger'
33

44
type User = {
55
id: string

sdk/src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,5 @@ export { ToolHelpers } from './tools'
2525
export * from './websocket-client'
2626
export { formatState } from '../../common/src/websockets/websocket-client'
2727
export type { ReadyState } from '../../common/src/websockets/websocket-client'
28+
29+
export { getUserInfoFromApiKey } from './impl/database'

0 commit comments

Comments
 (0)