rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:tako-dev/dsh-tako
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
让官方 DeepSeek Harness CLI(@deepseek-ai/dsh)直接使用 Tako 的模型,并带上正确的上下文窗口和图片输入能力。装一个插件即可,不需要手写 provider 配置。
Issue 由机器人处理。 它用维护者账号回复,评论带
bot标记。收到后会说「收到,会改。」,能修的会改并发版。不要贴 API key。桌面应用的问题请开到 dsh-tako-desktop。开一个 issue。
GET https://tako.shiroha.tech/api/pricing(不需要 API key),之后按间隔刷新(默认 30 分钟)。jev-*,以及 Tako 限定只能在 Claude Code 里用的模型。272K、1M、1.05M 这类精确的容量标签(31B 这种参数量标签会被忽略);都没有就用 defaultContextWindow。例外:gpt-6 / gpt-6.1 系列目录标签标的 1.05M 与实际不符,插件按 272k 修正(结构化字段仍优先)。带 Vision 标签的模型声明支持图片输入。llm-pi-ai 插件配置里的 providers.tako。之后请求、流式输出、重试、凭据都走 dsh 官方代码路径,插件本身不实现任何模型适配器。model 时使用公开目录中的 gpt-image-2.5-sunburst,显式传入其他模型时保留调用者选择。需要 Node.js 22+。
npm i -g @deepseek-ai/dsh
# 装进 web profile(浏览器界面)
dsh plugin --profile web add dsh-tako
dsh plugin 会调用 pnpm,需要 pnpm 在 PATH 上。
上面的 dsh plugin --profile web add dsh-tako 从 npm 安装;要锁定版本写成 dsh-tako@0.2.0。每个版本的 GitHub Release 也附带打包好的 .tgz,可以直接按 URL 安装(端到端测试验证过 http URL 安装方式):
dsh plugin --profile web add https://github.com/tako-dev/dsh-tako/releases/download/v0.2.0/dsh-tako-0.2.0.tgz
从源码安装:
git clone https://github.com/tako-dev/dsh-tako && cd dsh-tako
npm ci && npm run build && npm pack
dsh plugin --profile web add ./dsh-tako-0.2.0.tgz
不要用 dsh plugin add github:tako-dev/dsh-tako:git 安装拿到的是源码,没有构建好的 lib/。
安装时 pnpm 可能提示 missing peer @deepseek-ai/schemastery,这是预期的:运行时这个 peer 由 dsh 安装本身提供。
然后配置 Tako API key,三种方式任选:
npx dsh-tako login,详见下面的一键登录;$DSH_HOME/.credentials.yaml,引用名 TAKO_API_KEY);TAKO_API_KEY。启动:
dsh web
在输入框的模型选择器里会出现 Tako 分组。没有配置 key 时选择器里看不到 Tako 的模型(「设置 → 模型」里仍会列出 Tako,显示密钥缺失)。
dsh plugin --profile <名字> add dsh-tako 对任何 profile 都能装;但只装了 dsh-base 的自建 profile 没有界面,要用浏览器界面请装进 web。headless 等其他内置 profile 用同样的命令安装(未逐一验证)。
插件装进 profile 后由 pnpm 管理。启用 profile 配置/清单 HMR 时,新增组合包可以热加载;这只说明插件已挂载,不代表模型目录同步完成。更新已加载插件的代码不保证重新 import,更新完成后重启 dsh 才加载新版本;未启用 HMR 时,新增插件也需重启。
如果新版 Client 在旧 Host 模块退出前先被热加载,控制台会读取轻量的 /api/tako.catalog 协议版本:版本缺失或不匹配时保留旧版概览,停止请求新版 key/logs/usage/notice/config/sync 路由,并明确提示重启,而不是让整页出现 404。重启后才启用完整六标签控制台。
npx dsh-tako update [--profile web],同样会安装并打印重启提示。dsh plugin --profile web add dsh-tako(锁版本写 dsh-tako@0.4.0;用 GitHub Release 的 tgz URL 安装的,换成新版本的 URL 即可)。检查固定走 registry.npmjs.org(发布走官方源,不读本机 npm 配置,避免镜像同步延迟造成误报),结果在插件内存里缓存 1 小时;检查失败只显示灰字提示,不影响其他卡片。启动时不会静默自升。
在浏览器里登录 Tako 并确认授权,插件拿到一个新的 cr_ key,通过 dsh 官方的凭据服务(ctx.credentials.set,和「设置 → 模型」保存密钥是同一条路径)写进 $DSH_HOME/.credentials.yaml,凭据名就是插件配置的 apiKeyEnv(默认 TAKO_API_KEY)。正在运行的 dsh 下一次请求就会用上,不用重启。key 不会出现在终端或页面上,只显示 cr_**** 加末 4 位。
Web 界面:「设置 → 模型」→ Tako 卡片 →「通过浏览器登录 Tako」。会打开 Tako 授权页,确认后自动跳回,卡片显示「已登录,API key 已保存」,Tako 的状态点变绿。已有 key 时按钮变成「重新登录 Tako」。
命令行(不需要先启动 dsh,也适合 acp / headless 等没有界面的 profile):
npx dsh-tako login # 打开浏览器登录,key 存进 dsh 凭据
npx dsh-tako login --profile acp # 读取 acp profile 里 dsh-tako 的 baseURL / apiKeyEnv(默认 web)
npx dsh-tako login --no-open # 不自动开浏览器,只打印授权链接
npx dsh-tako whoami # 查看当前 key 对应的 Tako 账号和套餐
npx dsh-tako logout # 在 Tako 吊销这个 key,并从 dsh 凭据里删除
npx dsh-tako update # 把最新 dsh-tako 装进 profile,装完需重启 dsh
login 的其他参数:--port <端口> 固定回调端口(1024–65535,默认随机)、--device-name <名字> 授权页和 Tako 令牌列表里显示的设备名(默认 dsh-tako@<主机名>:取 hostname 的第一段,去掉 .local 等域后缀,其他字符换成 -,整体不超过 32 个字符;取不到主机名时用 dsh-tako@<平台>)、--base-url、--api-key-env、--dsh <路径>(dsh 安装位置,默认找 PATH 上的 dsh,再找 npm 全局目录;也可用环境变量 DSH_TAKO_DSH)。CLI 用的是你本机 dsh 安装里的官方凭据模块(@deepseek-ai/dsh-credentials-local),所以必须能找到 dsh;DSH_HOME 照常生效。
流程细节:CLI 或 dsh 进程在 127.0.0.1 上开一个一次性回调端口(只监听本机回环地址),用 PKCE(S256)和随机 state 发起授权,等待 5 分钟(与 Tako 授权码有效期一致),收到 state 不匹配的回调会忽略并继续等待。拒绝授权、超时、换 key 失败时不写任何凭据。
注意:
tako-connect@<设备名>」命名签发的令牌,同名的旧令牌会被替换(吊销)。默认设备名带主机名,所以不同机器互不影响;同一台机器重新登录(CLI 或 Web 按钮都一样)会替换这台机器之前的 key,这是预期行为。主机名相同(或截断到 32 字符后相同)的两台机器仍会互相替换,这时给其中一台加 --device-name(例如 --device-name dsh-tako@work-mac)。Web 按钮固定使用默认设备名。dsh-tako logout 或在「设置 → 模型」里清空。dsh-tako logout 只处理凭据文件里的 key;key 来自环境变量或 .env 时它不会去吊销。web profile 左侧栏是带触手的小章鱼(「Tako 控制台」),底部 footer 显示额度。点开控制台:
页头是当前账号(章鱼标 + 用户名 + 套餐徽标 + key 掩码 + 「复制诊断」,一键把端点/账号/同步状态/最近错误拼进剪贴板),下面六个 Tab 懒加载:
GET /api/tako.notice 透传 /api/status,每条按类型着色 + 预览行 + 日期 + 点击展开渲染 markdown)+ 账号/登录卡 + 套餐/钱包额度(5h/周剩余百分比 + 钱包美元)+ Tako 服务链接 + 版本更新行。GET /api/tako.logs 代理 /api/log/token,字段按 camelCase 白名单透传、other/user_* 字段不下发):时间、模型、in/out tokens、花费(点数/500000=USD)、耗时、stream、request_id、IP;顶部可按模型过滤并刷新。GET /api/tako.usage:今日总花费大数字 + 本 key 的额度/白名单/到期明细 + 按模型用量排行(user-model-stats);token/stats/modelStats 三条腿各自降级,各自挂错不影响其它。api/tako.catalog 新返回 cards,数据来自 /api/pricing 每张卡的 description/端点/渠道/价格),支持搜索/过滤/预览/展开/每行 ★ 置顶(写回 pinned)/「立即同步」(POST /api/tako.sync)+ 同步状态行;cards 为空时退回模型 id 行。同步阶段、尝试次数与安全错误原因照常展示,失败不清空已写入模型。cordis.patch.yml 里本插件的 tako 段(GET/POST /api/tako.config):refreshIntervalMs、syncRetryDelaysMs、defaultContextWindow、includeClaudeCodeOnly、include/exclude/pinned、webSearchProvider(联网搜索 pin 到 web 段)可编辑,overrides 只读展示;profile 只读时整个表单 disabled。保存即生效(mutate 触发插件重载并重同步)。账号与额度状态缓存在 Host 内按完整凭据的 SHA-256 指纹区分,脱敏文本只用于显示;两把密钥末四位相同也不会共用账号缓存。明文密钥和指纹均不下发到页面,不写入缓存文件。
面板数据来自插件注册的 11 条路由:GET /api/tako.status、POST /api/tako.logout、POST /api/tako.key、GET /api/tako.catalog、GET /api/tako.update(POST 装最新)、GET /api/tako.logs、GET /api/tako.usage、GET /api/tako.notice、GET/POST /api/tako.config、POST /api/tako.sync,与 Web 界面同源、走 dsh 的浏览器登录围栏。目录尚未同步时模型卡显示空态而不是报错。
界面语言跟随 dsh 客户端的语言设置:控制台全部文案、「设置 → 模型」登录卡片和侧栏名称走 dsh 官方的 i18n 体系,在「设置 → 通用 → 语言」切换时即时变化。插件的词典注册在自己的 dsh-tako 命名空间;宿主还没有这套体系时(更老的 dsh),自动回退为按页面语言取中英文案,行为与旧版本一致。
Tako 授权后会把浏览器跳回 http://127.0.0.1:<端口>/tako/callback,也就是运行浏览器的那台机器的回环地址。dsh 在远程机器上、浏览器在本地时这一步到不了。可选做法:
直接粘贴 key:在 Tako 网站的控制台创建 key,填进「设置 → 模型」或设置 TAKO_API_KEY。
SSH 端口转发:在远程机器上固定端口登录,本地把同一端口转发过去:
# 本地另开一个终端
ssh -L 53682:127.0.0.1:53682 user@remote
# 远程机器上
npx dsh-tako login --no-open --port 53682
把打印出的链接粘贴到本地浏览器打开,授权后回调经 SSH 隧道回到远程的 CLI。CLI 检测到 SSH 会话(SSH_CONNECTION / SSH_TTY)时也会打印这段提示。
Web 界面按钮同理:回调端口开在 dsh 主机上,只有从 dsh 主机本机打开的页面才能直接完成;通过远程地址访问 Web 界面时卡片上会提示改用以上两种方式(按钮用随机端口,需要转发时请用 CLI 的 --port)。
插件启动时如果 apiKeyEnv 在 dsh 凭据里查不到值,会记一条警告日志,提示运行 npx dsh-tako login(dsh 0.2.1-rc.2 的 web 不把插件日志打到终端,所以界面上以「设置 → 模型」的密钥缺失状态和登录按钮为准)。
插件配置写在 profile 的 cordis.patch.yml 里 id: tako 这一行的 config 下(例如 ~/.dsh/profiles/web/cordis.patch.yml):
- id: tako
name: dsh-tako
config:
pinned: [deepseek-v4.1-flash, gpt-5.6]
exclude: ['grok-*']
overrides:
gemma-4-31b-it:
contextWindow: 262144
| 配置项 | 默认值 | 说明 |
|---|---|---|
baseURL |
https://tako.shiroha.tech |
Tako 地址;聊天请求走 <baseURL>/v1,写成带 /v1 的也可以 |
apiKeyEnv |
TAKO_API_KEY |
存放 Tako API key 的凭据名(环境变量或「设置 → 模型」里保存的密钥) |
defaultContextWindow |
128000 |
目录没有标注上下文的模型用这个值 |
refreshIntervalMs |
1800000 |
常规目录刷新间隔(毫秒);0 禁用常规刷新,首次同步和有界恢复仍执行 |
syncRetryDelaysMs |
[1000, 5000, 30000] |
目录拉取/设置写入失败后的快速重试延迟(毫秒),按顺序最多各试一次;[] 禁用快速重试 |
pinned |
[deepseek-v4.1-flash, deepseek-v4-pro, tako-auto] |
在选择器里排在最前的模型,按列出顺序;其余按字母排序 |
include |
[] |
非空时只保留匹配的模型 id,支持 * 通配 |
exclude |
[] |
去掉匹配的模型 id,支持 * 通配,在 include 之后生效 |
includeClaudeCodeOnly |
false |
保留 Tako 限定 Claude Code 客户端的模型(在 dsh 中调用会被 Tako 拒绝) |
overrides |
{} |
按模型 id 修正 name、contextWindow、maxTokens、input(text / image)和 reasoningEfforts |
reasoningEfforts 是经过人工核实的“选择器等级 → 服务端值”映射,仅接受 off / minimal / low / medium / high / xhigh / max 为键、字符串或 null 为值;null 表示不发送该字段,false 表示明确禁用推理配置。每个模型的覆盖独立,配置时拒绝无效等级和值。现有目录未提供能力信息的模型仍沿用旧配置默认值,不能把这些默认值当作已确认支持;此处不凭模型名猜测能力,也不自动覆盖已有选择。
维护者可先构建,再运行 node scripts/reasoning-report.mjs <pricing.json> [catalog-options.json]。报告与目录使用相同过滤和排序;明确人工覆盖标记为 override,其余标记为 unknown,不把旧默认值包装成能力统计。脚本只读本地 JSON,不读取凭据或请求模型。服务端提供可信能力字段前,完整自动模型能力列表仍待接入。
插件只做一件事:维护 llm-pi-ai 设置里的 providers.tako,也就是「设置 → 模型」页面添加自定义 provider 时写的同一个位置。写入落在 profile 的 cordis.patch.yml 里,形如:
- id: llm-pi-ai
name: "@deepseek-ai/dsh-llm-pi-ai"
config:
providers:
tako:
displayName: Tako
api: openai-completions
baseURL: https://tako.shiroha.tech/v1
apiKeyEnv: TAKO_API_KEY
defaultContextWindow: 128000
models:
- id: deepseek-v4.1-flash
name: deepseek-v4.1-flash
contextWindow: 1000000
input: [text, image]
# ...
providers.tako 从未存在过时才写入两个兜底模型,保证 Tako 能出现在列表里。providers.tako 归插件所有。 在「设置 → 模型」里改 Tako 的自定义设置、删除 Tako,或者手改 cordis.patch.yml 里的这一段,都会在下次刷新或重启时被覆盖回来。要定制请改上面的插件配置。API key 不受影响,它存在凭据里,不在这一段。
移除插件:
dsh plugin --profile web remove dsh-tako
删除插件写入的 provider:打开 profile 的 cordis.patch.yml,删掉 llm-pi-ai 行下的 providers.tako(如果 providers 下没有其他内容,可以把整个 id: llm-pi-ai 条目删掉)。如果写过插件配置,id: tako 那一条也一并删掉(不删也不影响启动,只是不再起作用)。插件移除后,也可以在「设置 → 模型」里删除 Tako。
如果用一键登录保存过 key,先运行 npx dsh-tako logout(在 Tako 吊销并删除本地凭据);手动保存的 key 可以在「设置 → 模型」里清空,或从 $DSH_HOME/.credentials.yaml 删掉 TAKO_API_KEY。
只做第 1 步的话,Tako 会作为一个普通的自定义 provider 留在 profile 里,但模型列表不再更新。
reasoning_levels。目录声明了推理等级就照声明写(如 swe-2 的 medium / high / max);目录没声明时,插件仍给每个聊天模型加上旧默认 off / low / high / max(off 不发 reasoning_effort,避免部分路由拒收)。最大输出 token 仍用 dsh 默认值,需要时用 overrides 修正。openai-completions 协议。@deepseek-ai/dsh-llm-pi-ai 的设置结构,在 dsh 0.2.1-rc.2 上验证过;dsh 改动该结构时可能需要更新本插件。settings.models.provider-card 插槽,Tako 控制台依赖 main(keyed)与 sidebar.panellist(list)插槽及 --dsw-alias-* 主题变量(键为 llm-pi-ai;该插槽每个键只渲染一个注册者,其他插件也注册同一个键时会互相替换),以及 ctx.connection.fetch 路由;CLI 依赖本机 dsh 安装里的 @deepseek-ai/dsh-credentials-local。都只在 0.2.1-rc.2 上验证过。npm ci
npm run typecheck
npm test # 单元测试(离线)
npm run e2e # 端到端:装干净的官方 dsh,起 mock Tako,真机安装并启动 web / acp profile,跑一键登录
npm run e2e(scripts/e2e/run.mjs)在临时目录里装 @deepseek-ai/dsh(版本用 DSH_VERSION 指定,默认 0.2.1-rc.2),每个场景用全新的 DSH_HOME 和 HOME,不碰 ~/.dsh,也不需要真实 key。它用 npm pack 出的 tgz 执行 dsh plugin --profile web add,覆盖:路由写入与模型列表、重启不重写、带假 key 时 dsh 列出 Tako 模型、经 dsh acp 走官方链路完成一次真实对话(断言 mock 收到 Authorization: Bearer test-key 和正确的 model)、目录不可达时的兜底、exclude / pinned、删除路由后重启、dsh plugin remove、按 http URL 安装;以及一键登录:mock 的 /app/authorize 模拟用户已确认(302 回 redirect_uri 带 code),/api/desktop/token 校验 PKCE verifier,dsh-tako login --no-open 写入凭据后 dsh acp 不带环境变量完成一轮对话(断言 mock 收到 Bearer <新 key>)、whoami / logout(吊销并删除凭据)、拒绝授权不写凭据、Web 路由 /api/tako.login 走同一流程并检查客户端插件包已下发、控制台路由(/api/tako.status 未登录态、/api/tako.catalog 同步数据与缓存、/api/tako.update 应答形状(读的是真实 npm 源;已是最新时 POST 断言 skip,检查失败时 POST 不 500,落后时不真正装包)、登录→退出后凭据被清且 mock 收到 revoke)。需要 pnpm 在 PATH 上。其他环境变量:E2E_TGZ(用现成的 tgz)、E2E_DSH_DIR(复用已装好的 dsh)、E2E_ONLY=a,d(只跑部分用例)、E2E_KEEP=1(保留 dsh 安装目录)。结束时打印临时目录和 e2e-report.json 路径。
CI(.github/workflows/ci.yml)在 push 到 main 和 PR 时用 Node 22 / 24 跑 npm ci → typecheck → test → build → npm pack → e2e。
npm version 0.1.1 --no-git-tag-version(或手改 package.json 的 version,同步 package-lock.json)。main:git commit -am "chore: release 0.1.1" && git push origin main,等 CI 变绿。git tag v0.1.1 && git push origin v0.1.1。.github/workflows/release.yml 自动执行:校验 tag 与 package.json 版本一致 → 用 npm view 查该版本是否已在 npm → typecheck / test / build / pack / e2e → 发布 → 建 GitHub Release 并附上 tgz。npm publish --provenance --access public,发布的就是 e2e 测过的那个 tgz;带 - 的预发布版本发到 next dist-tag。dist.integrity 与本次 npm pack 出的 tgz 的 sha512。一致就跳过 publish,继续建 Release;不一致就失败,这时要升版本重新打 tag。同一提交的 npm pack 是可复现的(0.1.0 本地重新打包与 npm 上的 integrity 一致)。gh release upload --clobber 覆盖附件,不会失败。发布用 npm 的 Trusted Publishing(GitHub Actions OIDC),不需要 NPM_TOKEN,也不要配置任何 npm token secret。npm 包设置里的 Trusted Publisher 是:GitHub Actions,org tako-dev,repo dsh-tako,workflow release.yml,environment 留空;改工作流文件名或加 environment 时要同步改那里。工作流在发布前把 npm 升级到 11.5.1 以上(Node 22 自带的 npm 10 不支持 Trusted Publishing),provenance 由 OIDC 发布自动生成。GitHub Release 用工作流自带的 GITHUB_TOKEN。
dsh-tako adds Tako models to the official DeepSeek Harness CLI (@deepseek-ai/dsh) with correct context windows and image input.
Issues are handled by a bot. It replies as the maintainer, with a
botmark, then tries to fix and release. Desktop app bugs belong in dsh-tako-desktop. Do not paste API keys. Open an issue.
It reads Tako's public model directory (GET /api/pricing, no key needed), keeps chat models only (drops image/speech/search models, jev-*, and Claude-Code-only models), sizes each model from structured fields or exact size tags (272K, 1M, 1.05M) — except the gpt-6 / gpt-6.1 family, whose stale 1.05M labels the plugin corrects to 272k — and writes the result as an OpenAI-compatible provider at providers.tako in the official llm-pi-ai plugin's settings. Requests, streaming, retries and credentials all stay on dsh's own code path. It writes only when the value changes, and refreshes every 30 minutes by default. The sidebar octopus opens the Tako console; the footer shows remaining 5h/weekly bars plus wallet. Tako's image generation/editing tools default to the public-directory model gpt-image-2.5-sunburst when model is omitted, while retaining an explicit caller-selected model.
npm i -g @deepseek-ai/dsh
dsh plugin --profile web add dsh-tako # or the .tgz URL attached to a GitHub Release
dsh web
Set the key in Settings → Models → Tako (stored as TAKO_API_KEY in $DSH_HOME/.credentials.yaml) or export TAKO_API_KEY before starting. Without a key the model picker shows no Tako models.
The plugin is installed into the profile by pnpm. With profile configuration/manifest HMR enabled, adding a new bundle can hot-load it; activation does not mean the model catalog has synced. Updating already-loaded plugin code does not guarantee a fresh import: restart dsh after updating. Without HMR, restart after adding a plugin too. There is no silent self-upgrade on startup.
If a new Client hot-loads before the previous Host module exits, the console reads the protocol version from the lightweight /api/tako.catalog response. A missing or mismatched version keeps the legacy overview available, suppresses requests to the new key, logs, usage, notice, config, and sync routes, and asks for a restart instead of rendering a page of 404 errors. The complete six-tab console activates after the restart.
Catalog fetch/write failures use bounded recovery delays (syncRetryDelaysMs, default [1000, 5000, 30000]) before the regular refreshIntervalMs schedule. The console catalog response exposes phase, attempts, configured interval and a safe stage-specific lastError; failures retain prior successful models. Legacy HMR's nested-transaction rejection is labelled runtime-transaction, with a restart action if recovery keeps failing; the plugin cannot repair its host's transaction implementation. The mounted panel reads pending state every two seconds, at most30times, then retains any advertised future refresh deadline and offers explicit status refresh. Overdue deadlines are checked at least one minute apart. After success it reads near the next scheduled refresh; unmount cancels pending reads. refreshIntervalMs: 0 disables regular refresh, not the initial attempt or bounded recovery.
npx dsh-tako update [--profile web].dsh plugin --profile web add dsh-tako by hand.The check always reads registry.npmjs.org — the registry the plugin is published to, regardless of local npm configuration — and caches the answer in memory for an hour; a failed check only shows a gray note and never breaks the other cards.
Instead of pasting a key, sign in to Tako in the browser:
Web UI: Settings → Models → Tako card → 通过浏览器登录 Tako / Sign in to Tako with the browser.
CLI (works for any profile, dsh need not be running):
npx dsh-tako login [--profile web] [--no-open] [--port <1024-65535>] [--device-name <name>] [--base-url <url>] [--api-key-env <name>] [--dsh <path>]
npx dsh-tako whoami # account and plan behind the configured key
npx dsh-tako logout # revoke the key on Tako and delete it from dsh credentials
npx dsh-tako update # install the latest dsh-tako into the profile; restart dsh to load it
Both run a PKCE (S256) authorization-code flow with a one-shot listener on 127.0.0.1 (5-minute wait, state checked), and store the issued cr_ key through dsh's own credential service (ctx.credentials.set, the same path the Models page uses) under the plugin's apiKeyEnv. Running dsh processes use it on the next request. The key is never printed; only cr_**** plus the last four characters. The CLI loads @deepseek-ai/dsh-credentials-local from your dsh installation (found via dsh on PATH, the global npm root, --dsh, or DSH_TAKO_DSH), and reads baseURL / apiKeyEnv from the profile's dsh-tako config (default profile web).
Tako names the token tako-connect@<device name> and replaces an older token with the same name. The default device name is dsh-tako@<hostname> (first label of the host name, other characters replaced by -, at most 32 characters; dsh-tako@<platform> when there is no usable host name), so signing in again on the same machine replaces that machine's previous key while other machines keep theirs. Two hosts with the same (or same-after-truncation) name still replace each other; pass --device-name on one of them.
The web profile's sidebar uses the tentacled octopus icon ("Tako Console"). The footer shows quota. The console page is a tabbed admin panel: a hero header (octopus, user name, plan badge, masked key, "Copy diagnostics") and six lazily-mounted tabs:
GET /api/tako.notice passes /api/status through; each row colored by type with a preview line, date, and a click-to-expand markdown body) plus the account/sign-in card, plan/wallet quota (remaining 5h/weekly percentages plus the USD wallet), Tako service links, and the update row.GET /api/tako.logs proxies /api/log/token; fields pass a camelCase whitelist — other/user_* never leave the host): time, model, in/out tokens, cost (points / 500000 = USD), elapsed, stream, request_id, IP; filterable by model.GET /api/tako.usage — today's spend, this key's grant/whitelist/expiry, and per-model usage; each leg degrades independently.api/tako.catalog returns cards built from /api/pricing's description/endpoints/channels/pricing), with search/filters, per-card ★ pinning (writes pinned), an "Sync now" button (POST /api/tako.sync), and the sync status line; falls back to plain rows when cards is empty.tako section in cordis.patch.yml (GET/POST /api/tako.config): refreshIntervalMs, syncRetryDelaysMs, defaultContextWindow, includeClaudeCodeOnly, include/exclude/pinned, and webSearchProvider are editable, overrides read-only; the form is disabled on a read-only profile. Saving takes effect immediately (the mutation reloads the plugin and resyncs).The panel reads 11 routes the plugin registers on the Web connection: GET /api/tako.status, POST /api/tako.logout, POST /api/tako.key, GET /api/tako.catalog, GET /api/tako.update (POST installs the latest), GET /api/tako.logs, GET /api/tako.usage, GET /api/tako.notice, GET/POST /api/tako.config, POST /api/tako.sync — same origin, behind dsh's browser authentication fence. Before the first sync the models tab shows an empty state instead of an error.
The UI language follows the dsh client's language setting: every console text, the Settings → Models sign-in card, and the sidebar entry go through dsh's official i18n and switch live with Settings → General → Language. The plugin's dictionaries are registered under its own dsh-tako namespace; on hosts without that system (older dsh) the texts fall back to picking Chinese or English from the page language, exactly as before.
Remote dsh: Tako redirects the browser to 127.0.0.1:<port> on the machine running the browser. When dsh runs on a remote host, either paste a key (Settings → Models or TAKO_API_KEY), or forward a fixed port: ssh -L 53682:127.0.0.1:53682 user@remote, then on the remote host npx dsh-tako login --no-open --port 53682 and open the printed URL locally. The Web button only completes when the page is opened on the dsh host itself; on a remote address the card says so.
The plugin owns providers.tako: edits made to it in the Models page or by hand are overwritten on the next refresh. Customize through the plugin config instead (baseURL, apiKeyEnv, defaultContextWindow, refreshIntervalMs, pinned, include, exclude, includeClaudeCodeOnly, overrides; see the table above).
To uninstall, run dsh plugin --profile web remove dsh-tako and then delete providers.tako under the llm-pi-ai entry in the profile's cordis.patch.yml.
Tested against @deepseek-ai/dsh 0.2.1-rc.2. dsh plugin needs pnpm on PATH.
Development: npm ci, npm run typecheck, npm test, and npm run e2e (installs a clean official dsh into a temp dir with a fresh DSH_HOME, starts a mock Tako, installs the packed tarball, and drives real web and acp profiles, including one chat turn, dsh-tako login / whoami / logout against the mock's /app/authorize and /api/desktop/*, the Web sign-in route, and the console routes /api/tako.status / /api/tako.logout / /api/tako.catalog with their cache and logout flow, plus the /api/tako.update answer shape against the real npm registry — POST skip when already latest, JSON rather than HTTP 500 when the check failed, and no real upgrade when behind). Releasing: bump version, commit and push to main, then push a vX.Y.Z tag; the Release workflow checks the tag, runs everything including e2e, publishes with npm Trusted Publishing (GitHub Actions OIDC, provenance included; no NPM_TOKEN secret), and creates or updates a GitHub Release with the tarball. Re-running it is safe: an already-published version is skipped when its dist.integrity equals the freshly packed tarball, and fails otherwise.
MIT
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: model、models、deepseek。