DeepSHPlugins
dsh-openapi 项目预览
GITHUB / COMMUNITY PROJECT

dsh-openapi

工具与集成JavaScriptMIT

dsh-openapi:为 DSH 提供安全的 OpenAPI 3.x 发现与 API 调用工具——索引配置的 OpenAPI 文档,提供 openapi_list 等三个模型工具。

4 StarsDegurechaff57 更新时间 2026-08-13
访问 GitHub 仓库
dsh-openapi 项目预览

项目介绍

中文

dsh-openapi:为 DSH 提供安全的 OpenAPI 3.x 发现与 API 调用工具——索引配置的 OpenAPI 文档,提供 openapi_list 等三个模型工具。

English

Safe OpenAPI 3.x discovery and API-calling tools for DSH — indexes configured OpenAPI docs and exposes openapi_list plus two more model tools.

项目信息与收录信号

快照 2026-09-11
作者 / 组织
Degurechaff57
仓库
Degurechaff57/dsh-openapi
GitHub Stars
4
Forks
0
开发语言
JavaScript
许可证
MIT
最近推送
2026-08-13
Manifest
数据中检测到声明

公开仓库不自动等于可商用;许可证与当前兼容性以原项目文档为准。Manifest 和数据评分不构成安装安全认证。

数据评分

59/ 100
维护活跃
80
文档与实用信息
85
生态关注度
20
安装便捷信号
100
项目声明信号
100

README 含完整安装与使用说明;关注度尚低(4);标准命令一键安装。

评分来自已有数据快照的五维模型,仅作浏览参考,不是实际使用评测或安全检测结论。

安装与使用

所有项目资料与许可均以对应 GitHub 仓库为准。

dsh plugin add github:Degurechaff57/dsh-openapi

复制命令不会自动执行。请先阅读仓库文档,确认环境要求与许可证。

项目截图

仓库 README

GitHub 原文

已保存的仓库文档快照;文档抓取时间未记录,可能与上方目录介绍处于不同版本。安装前请核对当前仓库说明。

dsh-openapi

Give DeepSeek Harness a safe, structured doorway into any OpenAPI 3.x API.

中文说明 · DeepSeek Harness

dsh-openapi is a native DeepSeek Harness bundle that indexes configured OpenAPI documents and adds three model-facing tools:

  • openapi_list discovers APIs and searches operations.
  • openapi_describe returns parameters, request bodies, servers, and responses for one operation.
  • openapi_call validates and invokes an operation with bounded output.

It is plain ESM JavaScript, so installing from GitHub does not run a build or prepare script.

Why this plugin

Harness already gives an agent a shell. APIs still benefit from a narrower interface: operation discovery without reading a huge spec into the model context, declared-parameter validation, environment-backed credentials, read-only defaults, SSRF checks, and response limits. This plugin provides those controls without patching the Harness agent loop.

Install

dsh plugin --profile web add github:Degurechaff57/dsh-openapi

The bundle installs with an empty API catalog. Add API entries to your profile's cordis.patch.yml:

- id: openapi
  config:
    apis:
      - id: petstore
        source: https://petstore3.swagger.io/api/v3/openapi.json
        baseUrl: https://petstore3.swagger.io/api/v3
        allowedMethods: [GET, HEAD]

Start Harness and ask:

Use openapi_list to find the operation that lists pets, describe it, then call it.

For a source checkout, install the local directory instead:

dsh plugin --profile web add /absolute/path/to/dsh-openapi

Credentials

Keep secrets out of YAML. Map a request header to an environment variable:

- id: openapi
  config:
    apis:
      - id: internal-api
        source: ./openapi/internal.yml
        baseUrl: https://api.example.com/v1
        headers:
          Accept: application/json
        credentials:
          - header: Authorization
            env: INTERNAL_API_TOKEN
            prefix: 'Bearer '
        allowedMethods: [GET, HEAD, POST]

The credential header is applied after model-supplied header parameters, so a tool call cannot override it. Missing environment variables fail the call before network I/O.

Configuration

Top-level options:

FieldDefaultPurpose
apis[]Configured API documents
timeoutMs30000Per-call timeout
maxSpecBytes2097152Maximum local or remote spec size
maxResponseBytes262144Maximum response body returned to the model
maxRedirects3Redirect limit; every destination is rechecked
maxOperationsPerApi1000Catalog size limit per API

Each apis entry accepts:

FieldDefaultPurpose
idrequiredStable id used in tool calls
sourcerequiredHTTP(S) URL, file: URL, absolute path, or path relative to the Harness process
baseUrlspec serverExplicit API server override
headers{}Static non-secret headers
credentials[]Header/environment-variable mappings
allowedMethods[GET, HEAD]Methods the tool may invoke
allowPrivateNetworkfalseOpt in to loopback/private-network destinations

Security defaults

  • Specs are administrator-configured; the model cannot load an arbitrary spec at runtime.
  • APIs start read-only: only GET and HEAD are enabled.
  • Calls accept only parameters declared by the selected operation.
  • URL credentials, localhost names, private IP literals, and hostnames resolving to private IPs are blocked by default. Redirect destinations are checked again, and credentials are stripped on cross-origin redirects.
  • Response bodies are capped and sensitive response headers such as set-cookie are not returned.
  • Credential values come from the environment, override call-supplied values, and are never included in tool results.

allowPrivateNetwork: true is necessary for local development servers. It is an explicit trust decision, not a substitute for a network sandbox. DNS can change between validation and connection, so do not use untrusted OpenAPI documents or hostile DNS infrastructure for high-assurance isolation.

Current scope

  • OpenAPI 3.0 and 3.1 JSON/YAML
  • Local #/... references
  • Common path, query, header, and cookie serialization
  • JSON and text responses

Remote $ref documents and specialized serialization such as deepObject are intentionally not followed yet. The plugin fails loudly instead of making an ambiguous request.

DeepSeek Harness is in developer preview. This release is tested against the current source CLI (0.1.0-rc.5) and npm prerelease (0.1.0-rc.6); compatibility updates will follow upstream breaking changes.

Development

npm install
npm run check

The test suite covers parsing, references, catalog generation, request construction, credential precedence, method restrictions, private-network rejection, redirect validation, output truncation, and plugin registration.

License

MIT

使用前核对

安装步骤、兼容版本与授权范围以原项目当前文档为准。Stars 和评分是快照中的导航信号。

安装与排错 · 项目问题反馈

同类项目