dsh-devdock-review 0.0.0-stage → 3.0.0

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.
@@ -0,0 +1,11 @@
1
+ # dsh-devdock-review bundle patch.
2
+ #
3
+ # 本行插入「发布前审查」插件。它在 inject 里声明 `devdock`,所以必须先安装
4
+ # dsh-devdock-core;只装本插件时该行保持 INACTIVE(不报错、不崩),装上内核
5
+ # 后自动激活。
6
+ #
7
+ # 与 dsh-devdock-github / dsh-devdock-npm 是并列关系:那两个插件会探测本插件
8
+ # 是否在场,在场就显示可用的审查入口,不在场就显示灰色入口并提示安装。
9
+ - insert:
10
+ - id: push-review
11
+ name: dsh-devdock-review
package/icon.svg ADDED
@@ -0,0 +1,9 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 64 64" role="img" aria-label="DevDock Review">
2
+ <rect width="64" height="64" rx="14" fill="#0F172A"/>
3
+ <!-- 放大镜:审查 = 找问题 -->
4
+ <circle cx="28" cy="27" r="12" fill="none" stroke="#F8FAFC" stroke-width="4.5"/>
5
+ <line x1="37" y1="36" x2="47" y2="46" stroke="#F8FAFC" stroke-width="4.5" stroke-linecap="round"/>
6
+ <!-- 镜片里的对勾:确认通过 -->
7
+ <path d="M22.5 27 L26.5 31 L34 23" fill="none" stroke="#2F7BF6" stroke-width="3.6"
8
+ stroke-linecap="round" stroke-linejoin="round"/>
9
+ </svg>
package/index.js ADDED
@@ -0,0 +1,62 @@
1
+ /**
2
+ * DevDock · 发布前审查 · 加载器入口。
3
+ *
4
+ * 与内核同样的字节稳定 shim:本文件不得随版本变化,靠内容哈希导入实现。
5
+ *
6
+ * 本插件**依赖内核**(`inject: ['webServer', 'devdock']`)。内核不存在时
7
+ * 本行保持 INACTIVE,不会让组合启动失败——安静的未激活比「启动了但注册
8
+ * 失败」更容易诊断。
9
+ *
10
+ * 注意它与 GitHub / npm 插件的关系是**并列**,不是被它们依赖:两边都能独
11
+ * 立安装。装了审查插件,那两个平台就显示可用的审查入口;没装就是灰色入口。
12
+ *
13
+ * @module index.js
14
+ */
15
+
16
+ import { createHash } from 'node:crypto';
17
+ import { readFile } from 'node:fs/promises';
18
+
19
+ /** 实现模块。 */
20
+ const IMPL_URL = new URL('./src/host/platform.js', import.meta.url);
21
+
22
+ /**
23
+ * 按内容哈希导入实现模块。
24
+ * @returns {Promise<typeof import('./src/host/platform.js')>}
25
+ */
26
+ async function loadImpl() {
27
+ let href = IMPL_URL.href;
28
+ try {
29
+ const bytes = await readFile(IMPL_URL);
30
+ const hash = createHash('sha256').update(bytes).digest('hex').slice(0, 16);
31
+ href = `${IMPL_URL.href}?v=${hash}`;
32
+ } catch {
33
+ // 读不到就让 import 报出真正的原因。
34
+ }
35
+ return await import(/* @vite-ignore */ href);
36
+ }
37
+
38
+ /**
39
+ * 必须先就绪的宿主服务:内核 + HTTP 服务器。
40
+ * @type {string[]}
41
+ */
42
+ export const inject = ['webServer', 'devdock'];
43
+
44
+ /**
45
+ * 挂载:向内核注册 review 平台。
46
+ * @param {import('@deepseek-ai/cordis').Context} ctx
47
+ * @returns {Promise<void>}
48
+ */
49
+ export async function apply(ctx) {
50
+ const mod = await loadImpl();
51
+ const core = typeof ctx.get === 'function' ? ctx.get('devdock') : ctx.devdock;
52
+ if (!core || typeof core.registerPlatform !== 'function') {
53
+ throw new Error('dsh-devdock-review: 内核服务不可用,请先安装 dsh-devdock-core。');
54
+ }
55
+ const definition = mod.reviewPlatform(core.platformContext());
56
+ const unregister = core.registerPlatform(definition);
57
+ if (typeof ctx.effect === 'function') {
58
+ ctx.effect(() => unregister, 'devdock: review platform');
59
+ } else {
60
+ ctx.on?.('dispose', () => { try { unregister(); } catch { /* 已注销 */ } });
61
+ }
62
+ }
package/locale/en.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "DevDock · Review",
4
+ "description": "Pre-release review: rule scanning and model review for outgoing git changes, npm package contents and whole projects, with custom review presets and model selection."
5
+ }
6
+ }
package/locale/zh.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "DevDock · 审查",
4
+ "description": "发布前审查:对 git 待推送改动、npm 发布包内容和整个项目做规则扫描与模型审查,支持自定义审查项与模型选择。"
5
+ }
6
+ }
package/package.json CHANGED
@@ -1,6 +1,124 @@
1
1
  {
2
2
  "name": "dsh-devdock-review",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "3.0.0",
4
+ "description": "DevDock · 发布前审查插件:对 git 待推送改动、npm 发布包内容和整个项目做规则扫描与模型审查,支持自定义审查项、模型与思考强度选择。可独立安装,被 GitHub / npm 平台插件作为入口调用。",
5
+ "type": "module",
6
+ "main": "index.js",
7
+ "exports": {
8
+ ".": "./index.js",
9
+ "./client": "./client.js",
10
+ "./locale/*.json": "./locale/*.json",
11
+ "./icon": "./icon.svg",
12
+ "./cordis.patch.yml": "./cordis.patch.yml",
13
+ "./package.json": "./package.json",
14
+ "./src/host/platform.js": "./src/host/platform.js",
15
+ "./src/host/npmcli.js": "./src/host/npmcli.js"
16
+ },
17
+ "files": [
18
+ "index.js",
19
+ "client.js",
20
+ "cordis.patch.yml",
21
+ "src",
22
+ "locale/*.json",
23
+ "icon.svg",
24
+ "README.md",
25
+ "CHANGELOG.md",
26
+ "LICENSE"
27
+ ],
28
+ "engines": {
29
+ "node": ">=20"
30
+ },
31
+ "keywords": [
32
+ "dsh",
33
+ "dsh-plugin",
34
+ "deepseek-harness",
35
+ "devdock",
36
+ "review",
37
+ "code-review",
38
+ "npm",
39
+ "secrets-scan"
40
+ ],
41
+ "repository": {
42
+ "type": "git",
43
+ "url": "https://github.com/QingJing5906/dsh-DevDock.git"
44
+ },
45
+ "homepage": "https://github.com/QingJing5906/dsh-DevDock#readme",
46
+ "bugs": {
47
+ "url": "https://github.com/QingJing5906/dsh-DevDock/issues"
48
+ },
49
+ "author": "QingJing5906",
50
+ "license": "MIT",
51
+ "publishConfig": {
52
+ "access": "public"
53
+ },
54
+ "peerDependencies": {
55
+ "dsh-devdock-core": "^3.0.0"
56
+ },
57
+ "scripts": {
58
+ "test": "node tests/verify-platform.mjs && node tests/verify-client.mjs && node tests/verify-externals.mjs && node tests/verify-standalone.mjs && node tests/verify-class-styles.mjs && node tests/verify-review-running.mjs && node tests/verify-npm-review.mjs && node tests/verify-project-review.mjs"
59
+ },
60
+ "dsh": {
61
+ "bundle": {
62
+ "patch": "./cordis.patch.yml"
63
+ },
64
+ "client": {
65
+ "platform": "web",
66
+ "inject": [
67
+ "@deepseek-ai/dsh-client-ui-conversation"
68
+ ],
69
+ "external": [
70
+ "dsh-devdock-core/client"
71
+ ]
72
+ },
73
+ "surfaces": {
74
+ "settings": {
75
+ "id": "devdock-review",
76
+ "label": "DevDock · 审查",
77
+ "pages": [
78
+ {
79
+ "platform": "review",
80
+ "title": "发布前审查",
81
+ "content": [
82
+ "内置与自定义审查项",
83
+ "模型与思考强度",
84
+ "审查范围设置"
85
+ ]
86
+ }
87
+ ]
88
+ },
89
+ "sidebar": {
90
+ "id": "devdock-review",
91
+ "label": "DevDock · 审查",
92
+ "icon": "ReviewMark",
93
+ "platforms": [
94
+ {
95
+ "id": "review",
96
+ "title": "审查",
97
+ "content": [
98
+ "审查项管理",
99
+ "最近的审查结果"
100
+ ]
101
+ }
102
+ ]
103
+ },
104
+ "workspaceTab": {
105
+ "id": "devdock-review",
106
+ "label": "DevDock · 审查",
107
+ "icon": "ReviewMark",
108
+ "requires": "betterSidebar",
109
+ "fallback": "conversation.session.header.utilities",
110
+ "platforms": [
111
+ {
112
+ "id": "review",
113
+ "title": "工作区审查",
114
+ "content": [
115
+ "待推送改动审查",
116
+ "npm 发布包审查",
117
+ "整个项目审查"
118
+ ]
119
+ }
120
+ ]
121
+ }
122
+ }
123
+ }
124
+ }