feat(deepseek): add DeepSeek browser adapter#1088
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new DeepSeek (chat.deepseek.com) browser-based adapter to OpenCLI to enable prompting, conversation management, and basic status/reading functionality via the existing browser automation strategy.
Changes:
- Introduces a shared DeepSeek browser utility module (navigation checks, toggles, send/read/poll helpers, history extraction, retry helper).
- Adds 5 DeepSeek CLI commands:
ask,new,status,read, andhistory. - Implements feature toggles for DeepThink and Search modes within the
askflow.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| clis/deepseek/utils.js | Core DOM selectors + browser automation helpers (send, wait for response, read messages, list history, retry). |
| clis/deepseek/ask.js | deepseek ask command wiring (navigation, flags, send + poll response). |
| clis/deepseek/new.js | deepseek new command to start a fresh session via navigation. |
| clis/deepseek/status.js | deepseek status command to report page readiness + login inference. |
| clis/deepseek/read.js | deepseek read command to extract visible conversation messages. |
| clis/deepseek/history.js | deepseek history command to scrape sidebar conversations with a limit. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const conversations = await getConversationList(page); | ||
| if (conversations.length === 0) { | ||
| return [{ Index: 0, Title: 'No conversation history found.', Url: '' }]; | ||
| } | ||
| return conversations.slice(0, limit); |
| import { cli, Strategy } from '@jackwener/opencli/registry'; | ||
| import { DEEPSEEK_DOMAIN, ensureOnDeepSeek, getPageState } from './utils.js'; | ||
|
|
||
| export const statusCommand = cli({ | ||
| site: 'deepseek', |
| export const askCommand = cli({ | ||
| site: 'deepseek', | ||
| name: 'ask', | ||
| description: 'Send a prompt to DeepSeek and get the response', | ||
| domain: DEEPSEEK_DOMAIN, |
| const url = await page.evaluate('window.location.href').catch(() => ''); | ||
| if (typeof url !== 'string' || !url) return false; | ||
| try { | ||
| return new URL(url).hostname.endsWith('deepseek.com'); |
| const isActive = btn.classList.length > 1; | ||
| if (!isActive) btn.click(); | ||
| return { enabled: true, wasAlreadyActive: isActive }; | ||
| } | ||
| } |
| Role: isUser ? 'user' : 'assistant', | ||
| Text: (m.innerText || '').trim(), | ||
| }; |
50e593d to
6108a6e
Compare
|
Hi @Benjamin-eecs — thanks for this adapter. Review concluded blocked at head 1.
|
0c1f5c6 to
89e67b1
Compare
…ead, history Closes jackwener#548
89e67b1 to
04dddfc
Compare
Summary
Closes #548.
Adds a full DeepSeek (chat.deepseek.com) browser adapter with 5 commands:
deepseek ask <prompt>--model,--think,--searchdeepseek newdeepseek statusdeepseek readdeepseek historyFeatures
--model instant/expert(default: instant)--think--search--newflag to start fresh conversations--timeoutCommandExecutionErrorwhen mode toggle or send failshistorycommandAddressed review feedback
cli-manifest.jsonregenerated with all 5 deepseek entries--model/--think/--searchnow fail-fast withCommandExecutionErrorinstead of silently degradingds-toggle-button--selectedclassTest plan
npx tsc --noEmitpassesopencli deepseek ask "hello" --newreturns responseopencli deepseek ask "..." --model expertswitches to Expert modelopencli deepseek ask "..." --thinkenables DeepThink modeopencli deepseek ask "..." --searchenables web search--thinkthen no flag correctly disables DeepThink--model expertthen no flag correctly reverts to Instantopencli deepseek statusshows login stateopencli deepseek newstarts new conversationopencli deepseek history --limit 5lists conversations (works with collapsed sidebar)opencli deepseek readreads current conversation