dsh-custom-provider
界面增强 活跃维护

dsh-custom-provider

ComeCaramelos/dsh-custom-provider

在自定义提供商配置中新增“无需 API Key”开关,开启后保存配置无需填写密钥,兼容现有提供商表单与校验流程,配置更省事。

0
Stars 标星
0
Forks 分支
0
Watchers 关注
0
Open Issues
TypeScript
主要语言
MIT
开源协议
60 KB
仓库大小
2 个月前
最后推送
一键安装扩展 / 插件指令
dsh plugin --profile web add github:ComeCaramelos/dsh-custom-provider
git clone https://github.com/ComeCaramelos/dsh-custom-provider.git
git clone git@github.com:ComeCaramelos/dsh-custom-provider.git
README.md main

@comecaramelos/dsh-custom-provider

DSH plugin that adds a "No API key required" toggle to saved hand-declared
provider cards in Settings → Models, and lights a green status dot on
hand-declared rows whose profile authenticates through a non-empty
Authorization header (the toggle's placeholder or one you wrote yourself).

Installation

dsh plugin add @comecaramelos/dsh-custom-provider

For development, link this checkout into your web profile (after
building the bundle once). The checkout is mounted from the source tree, never
from a published npm copy — if the same package is installed system-wide, keep
the link in the web profile and make sure it wins (see the guidance
in ~/.dsh/profiles/web/README.md):

npm install
npm run build
dsh plugin --profile web add link:/path/to/dsh-custom-provider

Usage

  1. Open Settings → Models and save your custom provider (the create form
    itself has no toggle).
  2. Open the saved provider's card so its editor expands — the toggle lives
    inside that editor (it is invisible while the card is closed).
  3. Tick No API key required for endpoints that ignore authentication.
  4. The row lights a green dot whenever its profile authenticates through a
    non-empty Authorization header — via the toggle, by inheritance, or one
    you typed yourself. The dot never touches the profile and never shows on
    top of the page's own credential dot (never two indicators).

Development

npm install          # typescript + esbuild devDependencies
npm run build        # src/**/*.ts → lib/ (host: tsc; browser: tsc typecheck + esbuild bundle)
npm test             # builds, then node --test (pure logic through stubbed loader + React)
npm run dev          # tsc --watch

The tests drive the emitted lib/client.js through a stubbed module
loader, so the shipped artifact is what is verified.


CONTRIBUTING | LICENSE