feat: AK optional

This commit is contained in:
Simon
2026-03-19 19:50:05 +08:00
parent bdf79b7c10
commit fe82b11285
14 changed files with 30 additions and 102 deletions

View File

@@ -187,39 +187,7 @@ localStorage.setItem('PageAgentExtUserAuthToken', '<your-token-from-extension>')
</p>
<CodeEditor
code={
isZh
? `import type {
AgentActivity,
AgentStatus,
ExecutionResult,
HistoricalEvent
} from '@page-agent/core'
interface ExecuteConfig {
baseURL: string // LLM API 端点
apiKey: string // API 密钥
model: string // 模型名称
includeInitialTab?: boolean
onStatusChange?: (status: AgentStatus) => void
onActivity?: (activity: AgentActivity) => void
onHistoryUpdate?: (history: HistoricalEvent[]) => void
}
type Execute = (task: string, config: ExecuteConfig) => Promise<ExecutionResult>
declare global {
interface Window {
PAGE_AGENT_EXT_VERSION?: string
PAGE_AGENT_EXT?: {
version: string
execute: Execute
stop: () => void
}
}
}`
: `import type {
code={`import type {
AgentActivity,
AgentStatus,
ExecutionResult,
@@ -228,8 +196,8 @@ declare global {
interface ExecuteConfig {
baseURL: string // LLM API endpoint
apiKey: string // API key
model: string // Model name
apiKey?: string // LLM AK
includeInitialTab?: boolean
onStatusChange?: (status: AgentStatus) => void
@@ -248,8 +216,7 @@ declare global {
stop: () => void
}
}
}`
}
}`}
language="typescript"
/>