将 TypeScript 项目源码类型转换为 FaceModel 和 TypeGraph,生成包含 Zod schema 的 Typert 工件,供 Cordis 服务使用
ⓘ 此插件是大仓库 deepseek-ai/deepseek-harness 的子包,星数与活跃度统计的是整个仓库。
- 语言
- TypeScript
- License
- MIT
- 分支
- master
安装
$ dsh plugin --profile web add npm:@deepseek-ai/dsh-typert-generator在终端中运行以上命令,通过 dsh CLI 安装此插件。可在右上角切换 Profile。 第一次用 dsh?看这篇新手教程
对话式安装
帮我安装 DeepSeek Harness 插件 deepseek-ai/deepseek-harness/packages/typert/generator:先查看仓库 https://github.com/deepseek-ai/deepseek-harness 确认安全性,然后执行安装命令并验证插件加载成功。
把这段指令粘贴给 DSH Web GUI 里的助手,由它代你完成安装与验证。
English | 中文
TypeScript project analyzer and model-driven Typert generator. It converts the developer-authored source type tree into compiler-independent FaceModel and TypeGraph data before any artifact is rendered. Static analysis can consume that model without Cordis; emitters never receive TypeScript AST or checker objects.
The analyzer can use independent ts.Program instances seeded from tsconfig.host.json or tsconfig.client.json. Direct project references establish compiler-face membership, while package subpaths establish Typert runtime-face contributions: an ordinary single-project package declaring dsh.client may contribute both Host and Client runtime models, and only a split project explicitly referenced through tsconfig.host.json or tsconfig.client.json is restricted to that corresponding face. package.json#exports establishes every cross-package public boundary, and source imports or re-exports are the only allowed cross-face edges. Types owned by NPM dependencies, including global declarations from @types packages, remain external references instead of being expanded.
Analysis Model
Each face contains package exports, Cordis services and events, explicitly tagged objects and schemas, and a type graph for their reachable declarations. The graph preserves declaration identity, generic parameters and applications, explicit inheritance, conditional and mapped types, import attributes, abstract modifiers, and source JSDoc. Service and @typert object APIs expose public instance members only; constructors, static members, and non-public members are excluded.
WorkspaceAnalyzer defaults to check mode and fails on TypeScript syntax or semantic diagnostics, missing reachable public annotations, private cross-package references, and reachable declaration merges that the model cannot retain losslessly. write mode inserts checker-derived annotations, rebuilds the program, and returns a clean check-mode model.
Emission and Opt-in Publication
FaceModelEmitter consumes only the model. It emits executable JavaScript containing supported Zod schemas and a TYPERT contribution, plus a declaration file whose schemas are typed as z.ZodType<SourceType> through the package's public export. Unsupported Zod projections fail instead of flattening or weakening the source type.
WorkspaceTypertGenerator discovers contributors by walking package public exports reachable from Cordis Context or Events augmentations and explicit @typert declarations. When invoked for artifact publication, it requires host artifacts at lib/typert.host.{js,d.ts} exposed as package/typert, and client artifacts at lib/typert.client.{js,d.ts} exposed as package/client/typert. Generated declarations expose TYPERT as unknown, so contributing business packages do not depend on the runtime registry.
Publication is package opt-in, and business packages without the corresponding public entry do not need Typert artifacts. The repository's Host tsdown runs workspace Typert generation with tsconfig.host.json as its only program seed; it produces both Host reflection artifacts and the typert.remote-client.* projection of Host Remote contracts for the Client. The subsequent Client tsdown neither starts Typert nor analyzes tsconfig.client.json. Static consumers can still call WorkspaceAnalyzer directly, explicitly select a face and package subset, and process packages in batches without publishing or loading runtime artifacts.
Repository-specific Cordis projection
The root package export includes the model-driven extraction, completeness checks, and deterministic text renderers used by this repository's Cordis catalogs. They accept a CordisCatalogPolicy; repository-owned type links, foundation/exemption classifications, and inherited Cordis entries remain in scripts/gen-cordis-catalog.ts and are passed in explicitly. The generator package therefore contains projection mechanics, not a hidden copy of this repository's documentation taxonomy.
Model Experience
None, as this package runs at build or test time and never contributes to a model request.
KV Cache effect
None.
Known Limitations and Deferred Work
- Package export patterns are skipped; contributing packages need concrete export targets.
- Cross-face named and star re-exports produce links; namespace re-exports fail until
TypeTargetModelcan represent a module namespace without flattening it. - The Zod emitter supports a deliberate subset of the modeled TypeScript graph. Generic schema declarations and computed constructs such as conditional or mapped schema roots fail until a concrete schema-factory policy exists.
- Cross-face links are represented for analysis, but no generated schema currently requires a runtime cross-face Zod import.
- Discovery follows source files reachable from concrete public exports; declarations that are neither exported nor imported by that graph are intentionally outside the package model.
查看使用指南 →
该插件的安装步骤、关键要点、FAQ 与兼容性说明(基于已收录字段派生)。
收录徽章
[](https://deepseek-plugin.org/plugins/deepseek-ai/deepseek-harness/packages/typert/generator)把这段 markdown 粘贴到你的 GitHub README,链接回本插件详情页。徽章只声明已被本站收录,不代表安全认证。