dsh-postapi 0.0.0-stage → 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +139 -2
  3. package/cordis.patch.yml +3 -0
  4. package/dist/client.js +5651 -0
  5. package/docs/DETAIL.md +27 -0
  6. package/docs/apifox-design-spec.md +101 -0
  7. package/docs/apifox-research/analysis.md +254 -0
  8. package/docs/apifox-ui-delivery.md +150 -0
  9. package/docs/apifox-visual-parity-spec.md +353 -0
  10. package/docs/feature-matrix.md +112 -0
  11. package/docs/flow-reference/sequence-reference.html +163 -0
  12. package/docs/interface-contract-v2.md +175 -0
  13. package/docs/interface-contract.md +105 -0
  14. package/docs/nav-layout-v2-spec.md +107 -0
  15. package/docs/preview.svg +9 -0
  16. package/docs/probe-client.legacy.js +31 -0
  17. package/docs/rootcause-sidebar-vanish.md +95 -0
  18. package/docs/rootcause.md +86 -0
  19. package/docs/sidebar-notes.md +153 -0
  20. package/docs/ui-audit.md +197 -0
  21. package/docs/ui-notes.md +98 -0
  22. package/docs/v2-delivery.md +99 -0
  23. package/icon.svg +4 -0
  24. package/index.js +5 -0
  25. package/locale/en.json +7 -0
  26. package/locale/zh.json +7 -0
  27. package/package.json +73 -4
  28. package/src/client/index.js +132 -0
  29. package/src/client/jsx-shim.js +9 -0
  30. package/src/client/pages/__tests__/heights.test.js +135 -0
  31. package/src/client/pages/components/AssertTable.jsx +122 -0
  32. package/src/client/pages/components/BodyEditor.jsx +91 -0
  33. package/src/client/pages/components/EmptyState.jsx +52 -0
  34. package/src/client/pages/components/FolderTree.jsx +109 -0
  35. package/src/client/pages/components/JsonEditor.jsx +45 -0
  36. package/src/client/pages/components/ParamTable.jsx +226 -0
  37. package/src/client/pages/components/ResponsePanel.jsx +278 -0
  38. package/src/client/pages/components/ScriptPanel.jsx +99 -0
  39. package/src/client/pages/components/StatusPill.jsx +35 -0
  40. package/src/client/pages/components/__tests__/apifox-ui.test.js +291 -0
  41. package/src/client/pages/components/__tests__/pages-a.test.js +392 -0
  42. package/src/client/pages/components/__tests__/tree.test.js +379 -0
  43. package/src/client/pages/components/headerPresets.js +63 -0
  44. package/src/client/pages/debug.jsx +576 -0
  45. package/src/client/pages/design-tokens.css +2604 -0
  46. package/src/client/pages/doc.jsx +552 -0
  47. package/src/client/pages/env.jsx +378 -0
  48. package/src/client/pages/flow.jsx +349 -0
  49. package/src/client/pages/history.jsx +238 -0
  50. package/src/client/pages/import.jsx +396 -0
  51. package/src/client/pages/mock.jsx +316 -0
  52. package/src/client/pages/overview.jsx +348 -0
  53. package/src/client/pages/schema.jsx +317 -0
  54. package/src/client/pages/search.jsx +216 -0
  55. package/src/client/pages/sequence.jsx +344 -0
  56. package/src/client/pages/settings.jsx +205 -0
  57. package/src/client/pages/test.jsx +470 -0
  58. package/src/client/pages/theme.js +27 -0
  59. package/src/client/pages-entry.js +20 -0
  60. package/src/client/shell/ApiTitle.js +19 -0
  61. package/src/client/shell/Body.js +492 -0
  62. package/src/client/shell/definition.js +57 -0
  63. package/src/client/shell/locales.js +185 -0
  64. package/src/client/shell/menu.js +174 -0
  65. package/src/client/shell/registry.js +530 -0
  66. package/src/host/bridge.js +407 -0
  67. package/src/host/codegen.js +356 -0
  68. package/src/host/import-export.js +1044 -0
  69. package/src/host/index.js +102 -0
  70. package/src/host/mock-server.js +303 -0
  71. package/src/host/request.js +336 -0
  72. package/src/host/script-sandbox.js +272 -0
  73. package/src/host/storage.js +803 -0
  74. package/src/host/test-runner.js +126 -0
  75. package/src/host/variables.js +108 -0
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including the
49
+ original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 mengqi1436
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md CHANGED
@@ -1,3 +1,140 @@
1
- # Temporary Holding Version
1
+ # dsh-postapi
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ DeepSeek Harness 插件:在官方右侧栏内提供一套 Apifox 风格的接口工作区 —— 接口文档、调试发送、Mock、数据模型、环境变量、请求历史、自动化测试、导入导出、流程图、全局搜索,共 12 个页面。数据以 JSON 落盘本地,不需要云端账号。
4
+
5
+ [![npm](https://img.shields.io/npm/v/dsh-postapi.svg)](https://www.npmjs.com/package/dsh-postapi)
6
+ [![license](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](./LICENSE)
7
+
8
+ 当前版本 **0.0.1(Demo)**:功能面已完整可跑,边界见文末「已知边界」。
9
+
10
+ ![PostAPI 预览](docs/preview.svg)
11
+
12
+ ## 安装
13
+
14
+ DSH 桌面端(Electron)管理 profile,插件必须装进 profile 由宿主加载:
15
+
16
+ ```bash
17
+ # 1) 官方右侧栏页签组件(0.2.2-rc.3 起提供 sidebarRightTabs)
18
+ dsh plugin --profile desktop add @deepseek-ai/dsh-client-ui-sidebar-right@0.2.2-rc.3 --registry=https://registry.npmjs.org/
19
+
20
+ # 2) 本插件
21
+ dsh plugin --profile desktop add dsh-postapi@0.0.1 --registry=https://registry.npmjs.org/
22
+ ```
23
+
24
+ `dsh` 是桌面端自带的 CLI,Windows 路径:
25
+
26
+ ```powershell
27
+ & "C:\Users\<你>\AppData\Local\Programs\DeepSeek Harness\resources\runtime\cli\bin\dsh.cmd" `
28
+ plugin --profile desktop add dsh-postapi@0.0.1 --registry=https://registry.npmjs.org/
29
+ ```
30
+
31
+ 装完重启桌面端,右侧栏空态会出现「打开 PostAPI」入口。
32
+
33
+ ### 装完核查
34
+
35
+ profile 的 `package.json` 里 `dsh.profile.bundles` 必须同时含:
36
+
37
+ ```json
38
+ "dsh.profile.bundles": [
39
+ "@deepseek-ai/dsh-client-ui-sidebar-right",
40
+ "dsh-postapi"
41
+ ]
42
+ ```
43
+
44
+ `dsh plugin add` 偶发只写 `dependencies` 不写 `bundles`(后者缺失=不加载),缺则手工补进 `package.json` 再重启。
45
+
46
+ ## 功能面(12 页)
47
+
48
+ | 路由 | 页面 | 能力 |
49
+ |---|---|---|
50
+ | `#/overview` | 项目总览 | 项目卡片网格、新建/重命名/删除(两段式确认)、最近接口表、快捷入口 |
51
+ | `#/doc/:endpointId` | 接口文档 | 左树(目录折叠 + 未归类分组)、Markdown 描述、Path/Query/Headers/Cookies 四组参数表、请求体、认证、多响应页签、右侧 TOC、复制为 cURL |
52
+ | `#/debug` | 调试发送 | 接口列表、环境选择与 baseUrl 拼接、`{{var}}` 引用标注与未定义提示、Params/Headers/Body/Auth 四页签(Body 七类型)、发送/取消、响应面板(状态胶囊/耗时/大小/响应头/原文↔美化/断言结果/脚本日志/截断标记)、保存为接口 |
53
+ | `#/mock` | Mock | 字段规则表(fixed/regex/increment/random/template)、延迟与启用、本地 Mock 服务启停、命中地址 |
54
+ | `#/schema` | 数据模型 | JSON Schema 列表与编辑、校验、生成示例 |
55
+ | `#/env` | 环境与变量 | 环境增删改、baseUrl、变量表(key/value/enabled/secret)、全局变量、变量优先级说明 |
56
+ | `#/history` | 请求历史 | 时间/方法/URL/状态/耗时/大小、详情、回放到调试页、清空(两段式确认) |
57
+ | `#/test` | 自动化测试 | 用例(断言 + 提取器)、场景(多步骤 + 变量传递)、运行与结果明细 |
58
+ | `#/import` | 导入导出 | 导入 OpenAPI / Postman / HAR / cURL;导出 OpenAPI / Postman / HAR / Markdown;代码生成 8 语言 |
59
+ | `#/flow` | 流程图 | sequence 渲染 + SVG 导出 + 步骤编排落盘 |
60
+ | `#/search` | 全局搜索 | 跨接口/模型/目录关键字搜索与分组跳转 |
61
+ | `#/settings` | 设置 | 存储路径(只读展示 host 注入值)、主题、语言、Mock 端口、代理、超时、历史条数 |
62
+
63
+ ## 架构
64
+
65
+ - **侧边栏**:全部使用 DSH 官方组件 —— 右栏 `@deepseek-ai/dsh-client-ui-sidebar-right`(`sidebarRightTabs` 两段式注册,`keepMounted` + guide 单入口);左栏走桌面端原生(官方 sidebar 包 SlotMap 无插件可用席位,不自制侧边栏);会话输入框 `conversation.composer.dock` 徽章保留。
66
+ - **client ↔ host 通信**:DSH 官方 webServer prefix 桥 —— host 挂 `/dsh-postapi/api`(handler 首行 `connection.requestRejection` 鉴权栅栏,401/403 兜底写 JSON),client 同源 `fetch`;桥不可达时 client 自动降级内存桩(签名不变,页面不白屏)。
67
+ - **路由**:48 条唯一路由(`GET|POST /<domain>/<method>`),覆盖 storage CRUD、`request/send|preview`、`script/run`、`mock/start|stop|status`、`schema/validate|example`、`test/runCase|runScenario`、`import/*`、`export/*`、`codegen/run`、`storage/search|getHistory|appendHistory|clearHistory`。`/db/query|test|close` 三条固定返回 `501 NOT_IMPLEMENTED`(P2 占位)。
68
+ - **存储 v2**:`index.json`(`version`)+ `<projectId>/project.json`(folders/endpoints/schemas/environments/globals/mocks/testCases/testScenarios/flow/settings)+ `<projectId>/history.json`;tmp+rename 原子写、写操作串行队列、损坏隔离 `.corrupt-<ts>`、删项目 `.trash` 备份;v1 数据读入自动升级 v2。
69
+ - **请求管线**:`{{var}}` 与 11 个 `{{$dynamic}}`(`$timestamp`/`$isoTimestamp`/`$randomInt`/`$randomString`/`$uuid`/`$randomEmail`/`$randomPhone`/`$randomBoolean`/`$randomFloat`/`$datetime`/`$date`),优先级 局部 > 环境 > 全局 → 前置脚本(`node:vm` 沙箱,`pm.*` 兼容面)→ `fetch` + AbortController(默认 30s)→ 后置脚本 → 断言(status/body/header/time × 9 种 op:`eq`/`neq`/`gt`/`lt`/`contains`/`notContains`/`exists`/`notExists`/`regex`)→ 历史落盘;响应 >2MB 截断标注。
70
+ - **Mock 服务**:`node:http` 独立端口(默认 4010),两种命中路径,规则优先、默认响应回落。
71
+ - **测试运行器**:`runCase` / `runScenario`,场景步骤间用 extractor 提取的变量传递。
72
+
73
+ ## 数据存放位置
74
+
75
+ 默认 `~/.dsh/postapi`(跨平台可移植)。可用下列任一方式覆盖:
76
+
77
+ | 方式 | 写法 |
78
+ |---|---|
79
+ | 环境变量 | `POSTAPI_DATA_DIR=D:/my-api-data` |
80
+ | 宿主 config | `config.basePath` 或 `config.storage.basePath` |
81
+
82
+ 调试日志默认**不落盘**;需要时设 `POSTAPI_DEBUG_LOG=<文件路径>` 才写。
83
+
84
+ ## 目录结构
85
+
86
+ ```
87
+ index.js host 入口(re-export src/host/index.js)
88
+ cordis.patch.yml bundle 补丁(插入 id: dsh-postapi)
89
+ src/host/ storage / request / variables / script-sandbox /
90
+ mock-server / test-runner / import-export / codegen / bridge
91
+ src/client/index.js client 入口(右侧栏接线 + 样式注入 + 桥)
92
+ src/client/shell/ definition / Body 路由 / registry 桥 api + 桩 / locales / menu
93
+ src/client/pages/ 12 个页面 + components + sequence + design-tokens.css
94
+ locale/ zh.json / en.json
95
+ dist/client.js 构建产物(esbuild 打包,随包发布)
96
+ tests/ 16 套件 328 用例(node 直跑,无测试框架依赖)
97
+ scripts/smoke-host.mjs 宿主端到端冒烟 27 项
98
+ docs/ 契约、视觉规格、功能矩阵、排查报告
99
+ ```
100
+
101
+ ## 构建与验证
102
+
103
+ ```bash
104
+ npm install # 只装 esbuild(唯一的 devDependency)
105
+ npm run build # esbuild 打包 src/client → dist/client.js,附 vm smoke
106
+ npm test # 16 套件 / 328 用例
107
+ npm run smoke # 宿主端到端冒烟 27 项(临时基路径 + 真实基路径)
108
+ npm run verify # 上面三步串跑
109
+ ```
110
+
111
+ 发布前 `prepublishOnly` 会自动跑 `build + test`,构建失败即中止发布。
112
+
113
+ ## 已知边界(0.0.1 Demo)
114
+
115
+ - gRPC / Dubbo / Tars:只有协议字段与 UI 提示,未做真实收发。
116
+ - 数据库操作:`/db/query|test|close` 三条路由固定 `501 NOT_IMPLEMENTED`,UI 保留占位。
117
+ - 无云端账号、团队协作、在线分享;无 AI 生成用例。
118
+ - 自动化测试运行器在宿主侧串行执行,无并发/重试策略。
119
+ - 只支持 `platform: web`(桌面端与 web 端共用右侧栏组件);无原生客户端实现。
120
+ - `src/client/pages/__tests__/heights.test.js` 是设计纪律静态检查,未纳入 `npm test`(有历史遗留告警)。
121
+
122
+ ## 开发约定
123
+
124
+ - client 经 `window.__postapiApi`(同源桥 + stub 兜底)取数;页面自注册 `window.__postapiQueue`(`ensureGlobals` 统一重放,模块求值顺序无关)。
125
+ - 尺寸一律引用 `design-tokens.css` 的 token(`--ctl-h`/`--row-h`/`--pill-h`),禁止控件各自撑高。
126
+ - JSX 一律编译为 `createElement`(build.mjs 显式 `jsxFactory` + inject jsx-shim);产物出现裸 `React.createElement` 即构建失败(宿主无 React 全局)。
127
+ - `ctx.effect` 的 body **只能**返回 disposer 函数 / null / Promise / 迭代器。返回业务对象会让 cordis 抛 `Invalid effect`,整个 apply 回滚、页签静默消失;统一走 `safeEffect` 包装,build.mjs 的 vm smoke 会断言该形态。
128
+ - client 产物只 `require('react')` 与宿主内置 `@deepseek-ai/*`,不引其他运行时依赖。
129
+ - 契约偏离必须标注进 `docs/interface-contract-v2.md` 或对应 docs。
130
+
131
+ ## 文档
132
+
133
+ - [功能矩阵](docs/feature-matrix.md):Apifox 功能全表 → 本插件实现矩阵
134
+ - [v2 契约](docs/interface-contract-v2.md):schema / host face / 桥路由 / 页面约定 / 测试要求
135
+ - [Apifox 视觉规格](docs/apifox-visual-parity-spec.md):从 Apifox 2.8.55 渲染器 CSS 实测的尺寸与色板
136
+ - [侧边栏消失根因](docs/rootcause-sidebar-vanish.md):`ctx.effect` 返回值形态的一次真实事故复盘
137
+
138
+ ## 许可
139
+
140
+ [Apache-2.0](./LICENSE) © 2026 mengqi1436
@@ -0,0 +1,3 @@
1
+ - insert:
2
+ - id: dsh-postapi
3
+ name: 'dsh-postapi'