dsh-devdock 0.0.0-stage → 2.5.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.
- package/CHANGELOG.md +190 -0
- package/CONTRACT.md +639 -0
- package/LICENSE +21 -0
- package/PUBLISHING.md +175 -0
- package/README.md +272 -2
- package/assets/devdock-256.png +0 -0
- package/assets/devdock-32.png +0 -0
- package/assets/devdock-512.png +0 -0
- package/assets/devdock-64.png +0 -0
- package/assets/icon-256.png +0 -0
- package/assets/screenshots/account-card.png +0 -0
- package/assets/screenshots/cards.png +0 -0
- package/assets/screenshots/manage.png +0 -0
- package/assets/screenshots/push-tab.png +0 -0
- package/assets/screenshots/review.png +0 -0
- package/assets/screenshots/settings.png +0 -0
- package/client.js +12312 -0
- package/cordis.patch.yml +7 -0
- package/icon.svg +6 -0
- package/index.js +95 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +180 -4
- package/src/host/cloudflare.js +1027 -0
- package/src/host/git.js +1664 -0
- package/src/host/github.js +1922 -0
- package/src/host/index.js +4716 -0
- package/src/host/npm.js +424 -0
- package/src/host/npmcli.js +288 -0
- package/src/host/review.js +627 -0
- package/src/host/store.js +1063 -0
package/cordis.patch.yml
ADDED
package/icon.svg
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="32" height="32" role="img" aria-label="DevDock">
|
|
2
|
+
<rect width="24" height="24" rx="5.2" fill="#0D1117"/>
|
|
3
|
+
<path d="M6.2 20 V4.6 H11.2 A7.7 7.7 0 0 1 11.2 20 Z" fill="none" stroke="#FFFFFF" stroke-width="3.2"
|
|
4
|
+
stroke-linecap="round" stroke-linejoin="round"/>
|
|
5
|
+
<circle cx="20.9" cy="20.3" r="2.2" fill="#2F7BF6"/>
|
|
6
|
+
</svg>
|
package/index.js
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
import { readFile } from 'node:fs/promises';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Node half of the dsh-push bundle — a BYTE-STABLE loader shim.
|
|
6
|
+
*
|
|
7
|
+
* Mounted by the loader row `push` (see cordis.patch.yml) in the host
|
|
8
|
+
* plane of the profile process. All real logic lives in ./src/host/index.js
|
|
9
|
+
* ("the impl"); this file only loads it.
|
|
10
|
+
*
|
|
11
|
+
* WHY THE IMPL IS IMPORTED THROUGH A CONTENT-HASHED URL:
|
|
12
|
+
*
|
|
13
|
+
* Every in-process activation path — the market's hot mount (uninstall →
|
|
14
|
+
* install), a loader entry update, a disable → enable cycle — imports the
|
|
15
|
+
* package by the same module URL, so Node's ESM cache keeps returning the
|
|
16
|
+
* FIRST module object this process ever loaded. A new version installed over a
|
|
17
|
+
* running `dsh web` would therefore keep executing the OLD code, and one class
|
|
18
|
+
* of bugs (stale routes, stale settings reads) would look like a live-reload
|
|
19
|
+
* failure that only a restart fixes.
|
|
20
|
+
*
|
|
21
|
+
* - This file MUST NEVER CHANGE across versions. A cached old shim is
|
|
22
|
+
* harmless: its only job is to load the CURRENT impl from disk. Any change
|
|
23
|
+
* to this file itself needs a process restart to apply.
|
|
24
|
+
* - apply() imports the impl through `?v=<sha256-of-file>`, so identical
|
|
25
|
+
* content reuses the cached module and changed content gets a fresh URL —
|
|
26
|
+
* and therefore fresh code — in-process.
|
|
27
|
+
*
|
|
28
|
+
* The impl module itself is re-imported on every mount; the routes and the
|
|
29
|
+
* agent tool it registers are bound to the mounting fiber, so an unload
|
|
30
|
+
* disposes them before the next mount registers them again.
|
|
31
|
+
*
|
|
32
|
+
* IMPORTANT — no `export default`. The loader's `unwrapExports` collapses
|
|
33
|
+
* `exports.default ?? exports`, so a default export would discard the module
|
|
34
|
+
* namespace and with it the named `inject` export, leaving the plugin mounted
|
|
35
|
+
* with no dependencies: `apply()` would run before the host services exist and
|
|
36
|
+
* the plugin would silently no-op. With the namespace preserved, cordis sees
|
|
37
|
+
* `{ apply, inject }` and waits for `webServer` exactly like a published bundle.
|
|
38
|
+
*/
|
|
39
|
+
|
|
40
|
+
/** Implementation module, resolved next to this (possibly cached) shim. */
|
|
41
|
+
const IMPL_URL = new URL('./src/host/index.js', import.meta.url);
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Import the impl, cache-busted by its own content hash.
|
|
45
|
+
*
|
|
46
|
+
* Falls back to the plain URL when the file cannot be read, so the import
|
|
47
|
+
* itself surfaces the real error instead of hiding it behind a stale cached
|
|
48
|
+
* module. Import failures are never swallowed here: silently reusing old code
|
|
49
|
+
* is the exact failure mode this shim exists to prevent.
|
|
50
|
+
*
|
|
51
|
+
* @returns {Promise<typeof import('./src/host/index.js')>}
|
|
52
|
+
*/
|
|
53
|
+
async function loadImpl() {
|
|
54
|
+
let href = IMPL_URL.href;
|
|
55
|
+
try {
|
|
56
|
+
const bytes = await readFile(IMPL_URL);
|
|
57
|
+
const hash = createHash('sha256').update(bytes).digest('hex').slice(0, 16);
|
|
58
|
+
href = `${IMPL_URL.href}?v=${hash}`;
|
|
59
|
+
} catch {
|
|
60
|
+
// Unreadable impl: fall back to the plain URL so the import can report it.
|
|
61
|
+
}
|
|
62
|
+
return await import(/* @vite-ignore */ href);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Host services that must exist before `apply` runs.
|
|
67
|
+
*
|
|
68
|
+
* `webServer` is the only hard one: without it there is no HTTP API and no
|
|
69
|
+
* plugin. `tools` is deliberately NOT listed — the agent tool is an optional
|
|
70
|
+
* surface, so the impl acquires it through a nested `ctx.inject(['tools'])`
|
|
71
|
+
* fiber, which keeps a composition without the tools service serving the panel
|
|
72
|
+
* instead of never mounting at all.
|
|
73
|
+
*
|
|
74
|
+
* @type {string[]}
|
|
75
|
+
*/
|
|
76
|
+
export const inject = ['webServer'];
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Mount the host service. Runs only after the injected services are up.
|
|
80
|
+
*
|
|
81
|
+
* @param {import('@deepseek-ai/cordis').Context} ctx
|
|
82
|
+
* @returns {Promise<void>}
|
|
83
|
+
*/
|
|
84
|
+
export async function apply(ctx) {
|
|
85
|
+
// Guard against a double mount: `githubLink` is this plugin's own service, so
|
|
86
|
+
// it cannot be declared in `inject`; ctx.get() is the non-throwing lookup.
|
|
87
|
+
if (ctx.get('githubLink')) return;
|
|
88
|
+
const mod = await loadImpl();
|
|
89
|
+
// Re-check after the await: a concurrent apply may have mounted meanwhile.
|
|
90
|
+
if (ctx.get('githubLink')) return;
|
|
91
|
+
// NOTE: deliberately NOT returned. A returned fiber is a thenable whose
|
|
92
|
+
// resolved value is the fiber object itself, which cordis's effect collector
|
|
93
|
+
// rejects with "Invalid effect" at boot.
|
|
94
|
+
ctx.plugin(mod.GithubLinkHost);
|
|
95
|
+
}
|
package/locale/en.json
ADDED
package/locale/zh.json
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,182 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-devdock",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "2.5.0",
|
|
4
|
+
"description": "DevDock · 在 DeepSeek Harness 里管理研发账号与服务。GitHub:多账号、仓库管理、工作区版本树、一键推送、推送前 Agent 审查。npm:账号、包的列表/卡片、打包审查、发布前审查、发布与自检。Cloudflare:API Token / Global API Key 登录、项目概览、Pages/Workers/Zones 仪表盘、一键部署静态站点或 Worker、部署前审查。",
|
|
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
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"index.js",
|
|
17
|
+
"client.js",
|
|
18
|
+
"cordis.patch.yml",
|
|
19
|
+
"src",
|
|
20
|
+
"locale/*.json",
|
|
21
|
+
"icon.svg",
|
|
22
|
+
"README.md",
|
|
23
|
+
"CHANGELOG.md",
|
|
24
|
+
"LICENSE",
|
|
25
|
+
"CONTRACT.md",
|
|
26
|
+
"PUBLISHING.md",
|
|
27
|
+
"assets"
|
|
28
|
+
],
|
|
29
|
+
"engines": {
|
|
30
|
+
"node": ">=20"
|
|
31
|
+
},
|
|
32
|
+
"keywords": [
|
|
33
|
+
"dsh",
|
|
34
|
+
"dsh-plugin",
|
|
35
|
+
"deepseek-harness",
|
|
36
|
+
"devdock",
|
|
37
|
+
"github",
|
|
38
|
+
"git",
|
|
39
|
+
"push",
|
|
40
|
+
"version-control",
|
|
41
|
+
"code-review",
|
|
42
|
+
"agent",
|
|
43
|
+
"release",
|
|
44
|
+
"npm",
|
|
45
|
+
"pack",
|
|
46
|
+
"publish",
|
|
47
|
+
"cloudflare",
|
|
48
|
+
"dashboard",
|
|
49
|
+
"account-management"
|
|
50
|
+
],
|
|
51
|
+
"repository": {
|
|
52
|
+
"type": "git",
|
|
53
|
+
"url": "https://github.com/QingJing5906/dsh-DevDock.git"
|
|
54
|
+
},
|
|
55
|
+
"homepage": "https://github.com/QingJing5906/dsh-DevDock#readme",
|
|
56
|
+
"bugs": {
|
|
57
|
+
"url": "https://github.com/QingJing5906/dsh-DevDock/issues"
|
|
58
|
+
},
|
|
59
|
+
"author": "QingJing5906",
|
|
60
|
+
"license": "MIT",
|
|
61
|
+
"publishConfig": {
|
|
62
|
+
"access": "public"
|
|
63
|
+
},
|
|
64
|
+
"scripts": {
|
|
65
|
+
"test": "node tests/verify-client.mjs && node tests/verify-cards.mjs && node tests/verify-tool-surface.mjs && node tests/verify-errors.mjs && node tests/verify-push-memory.mjs && node tests/verify-delete-semantics.mjs && node tests/verify-review-rules.mjs && node tests/verify-review-store.mjs && node tests/verify-review-scope.mjs && node tests/verify-contract.mjs && node tests/verify-render.mjs && node tests/verify-style-inject.mjs && node tests/verify-npm-account-ui.mjs && node tests/verify-density.mjs && node tests/verify-css.mjs && node tests/verify-class-styles.mjs && node tests/verify-spacing.mjs && node tests/verify-tab-spacing.mjs && node tests/verify-header-modal.mjs && node tests/verify-header-entry.mjs && node tests/verify-pick-guide.mjs && node tests/verify-platform.mjs && node tests/verify-surfaces.mjs && node tests/verify-npm-client.mjs && node tests/verify-npm-store.mjs && node tests/verify-npm-deps.mjs && node tests/verify-npm-review.mjs && node tests/verify-npm-review-entry.mjs && node tests/verify-review-running.mjs && node tests/verify-project-review.mjs && node tests/verify-injection.mjs && node tests/verify-fixture-noise.mjs && node tests/verify-review-gate.mjs && node tests/verify-cloudflare.mjs && node tests/verify-cloudflare-store.mjs && node tests/verify-cloudflare-tool.mjs && node tests/verify-cloudflare-render.mjs && node tests/verify-git-dir-picker.mjs && node tests/verify-package.mjs && node tests/audit-reachability.mjs",
|
|
66
|
+
"test:refspec": "powershell -ExecutionPolicy Bypass -File tests/run-refspec.ps1",
|
|
67
|
+
"prepublishOnly": "npm test",
|
|
68
|
+
"pack:check": "node tests/verify-package.mjs"
|
|
69
|
+
},
|
|
70
|
+
"dsh": {
|
|
71
|
+
"bundle": {
|
|
72
|
+
"patch": "./cordis.patch.yml"
|
|
73
|
+
},
|
|
74
|
+
"client": {
|
|
75
|
+
"platform": "web",
|
|
76
|
+
"inject": [
|
|
77
|
+
"@deepseek-ai/dsh-client-ui-conversation"
|
|
78
|
+
]
|
|
79
|
+
},
|
|
80
|
+
"surfaces": {
|
|
81
|
+
"settings": {
|
|
82
|
+
"id": "push",
|
|
83
|
+
"label": "DevDock",
|
|
84
|
+
"pages": [
|
|
85
|
+
{
|
|
86
|
+
"platform": "github",
|
|
87
|
+
"title": "GitHub",
|
|
88
|
+
"content": [
|
|
89
|
+
"账号卡片",
|
|
90
|
+
"贡献图",
|
|
91
|
+
"最近消息",
|
|
92
|
+
"仓库管理"
|
|
93
|
+
]
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"platform": "npm",
|
|
97
|
+
"title": "npm",
|
|
98
|
+
"content": [
|
|
99
|
+
"npm 账号卡片",
|
|
100
|
+
"我的包(列表/卡片)",
|
|
101
|
+
"包管理弹窗"
|
|
102
|
+
]
|
|
103
|
+
}
|
|
104
|
+
],
|
|
105
|
+
"options": [
|
|
106
|
+
"信息密度",
|
|
107
|
+
"OAuth Client ID",
|
|
108
|
+
"git 路径",
|
|
109
|
+
"默认远端",
|
|
110
|
+
"显示私有仓库"
|
|
111
|
+
]
|
|
112
|
+
},
|
|
113
|
+
"sidebar": {
|
|
114
|
+
"id": "push",
|
|
115
|
+
"label": "DevDock",
|
|
116
|
+
"icon": "DevDockMark",
|
|
117
|
+
"platforms": [
|
|
118
|
+
{
|
|
119
|
+
"id": "github",
|
|
120
|
+
"title": "GitHub 仓库",
|
|
121
|
+
"content": [
|
|
122
|
+
"仓库搜索",
|
|
123
|
+
"列表/卡片视图",
|
|
124
|
+
"仓库管理弹窗",
|
|
125
|
+
"新建仓库"
|
|
126
|
+
]
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"id": "npm",
|
|
130
|
+
"title": "npm 包",
|
|
131
|
+
"content": [
|
|
132
|
+
"包搜索",
|
|
133
|
+
"我的包",
|
|
134
|
+
"列表/卡片视图",
|
|
135
|
+
"包管理弹窗"
|
|
136
|
+
]
|
|
137
|
+
}
|
|
138
|
+
],
|
|
139
|
+
"accountPicker": [
|
|
140
|
+
"GitHub 账号下拉",
|
|
141
|
+
"npm 账号下拉"
|
|
142
|
+
]
|
|
143
|
+
},
|
|
144
|
+
"workspaceTab": {
|
|
145
|
+
"id": "push",
|
|
146
|
+
"label": "DevDock",
|
|
147
|
+
"icon": "DevDockMark",
|
|
148
|
+
"requires": "betterSidebar",
|
|
149
|
+
"fallback": "conversation.session.header.utilities",
|
|
150
|
+
"platforms": [
|
|
151
|
+
{
|
|
152
|
+
"id": "github",
|
|
153
|
+
"title": "工作区 Git",
|
|
154
|
+
"content": [
|
|
155
|
+
"提交/推送/拉取",
|
|
156
|
+
"推送目标与分支",
|
|
157
|
+
"Agent 审查",
|
|
158
|
+
"版本树",
|
|
159
|
+
"发布 Release"
|
|
160
|
+
]
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
"id": "npm",
|
|
164
|
+
"title": "项目 npm",
|
|
165
|
+
"content": [
|
|
166
|
+
"创建 package.json",
|
|
167
|
+
"打包审查",
|
|
168
|
+
"生成压缩包",
|
|
169
|
+
"发布到 npm(含 2FA)",
|
|
170
|
+
"发布前自检",
|
|
171
|
+
"依赖检查"
|
|
172
|
+
]
|
|
173
|
+
}
|
|
174
|
+
]
|
|
175
|
+
},
|
|
176
|
+
"tool": {
|
|
177
|
+
"name": "github_link",
|
|
178
|
+
"note": "同一套能力同时暴露给模型,界面操作与智能体调用行为一致"
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|