dsh-github-console 0.4.1 → 0.6.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.
package/locale/en.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "meta": {
3
3
  "title": "GitHub console",
4
- "description": "Sign in with your own GitHub App, then browse repositories, read and commit files, follow issues, pull requests and workflow runs, and publish a local DSH plugin to GitHub from one sidebar panel; 19 gh_* and plugin_* tools let the agent do the same. Opening the panel first scans your workspaces for publishable plugins and runs an offline report, which needs no sign-in; publishing then asks only for the directory, the account and the repository name. Registration uses GitHub's manifest flow, so the private key is written only to the DSH credential service and installation tokens stay in memory for one hour. Publishing commits an existing plugin directory into an existing repository through the Git Data API (no git binary, no package scripts), merges the dsh-plugin topic, creates a v<version> Release, and probes npm, the repository topic, the release tag and any configured market index URLs; a failed probe reports unknown rather than absent. Limitations: the repository must already exist and be authorized for the App (the panel links to a prefilled creation page; an installation token cannot create a personal repository directly), npm publish and market submission stay manual, no webhooks are received, and a file commit goes straight to the default branch without opening a pull request."
4
+ "description": "Sign in with your own GitHub App, then browse repositories, read and commit files, follow issues, pull requests and workflow runs, and publish a local DSH plugin to GitHub from one sidebar panel; 38 gh_* and plugin_* tools let the agent do the same. Opening the panel first scans your workspaces for publishable plugins and runs an offline report, which needs no sign-in; publishing then asks only for the directory, the account and the repository name. Registration uses GitHub's manifest flow, so the private key is written only to the DSH credential service and installation tokens stay in memory for one hour. Publishing commits an existing plugin directory into an existing repository through the Git Data API (no git binary, no package scripts), merges the dsh-plugin topic, creates a v<version> Release, and probes npm, the repository topic, the release tag and any configured market index URLs; a failed probe reports unknown rather than absent. Limitations: the repository must already exist and be authorized for the App (the panel links to a prefilled creation page; an installation token cannot create a personal repository directly), npm publish and market submission stay manual, no webhooks are received, and a file commit goes straight to the default branch without opening a pull request."
5
5
  }
6
6
  }
package/locale/zh.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "meta": {
3
3
  "title": "GitHub 控制台",
4
- "description": "用你自己的 GitHub App 登录,然后在左侧栏一个面板里浏览仓库、读取与提交文件、查看 Issue / PR / Actions,并把本地 DSH 插件发布到 GitHub;同时提供 19 个 gh_* 与 plugin_* 工具让 Agent 做同样的事。打开面板会先扫描工作区列出可发布的插件并做离线体检,这一步不需要登录;发布时只问目录、账号、仓库名三件事。注册走 GitHub manifest flow,私钥只写入 DSH 凭据服务,安装令牌只在内存里、1 小时过期。发布把一个已存在的插件目录经 Git Data API 提交进一个已存在的仓库(不需要 git 命令,也不执行任何包脚本),合并 dsh-plugin topic,创建 v<版本> Release,并探测 npm、仓库 topic、Release tag 与配置里的市场索引 URL;探测失败记作「未知」,不会误判为未收录。限制:仓库必须先存在并授权给 App(面板给一键建仓链接;安装令牌无法直接新建个人仓库),npm publish 与市场提交仍需手动,不接收 webhook,面板提交文件直接写入默认分支、不自动开 PR。"
4
+ "description": "用你自己的 GitHub App 登录,然后在左侧栏一个面板里浏览仓库、读取与提交文件、查看 Issue / PR / Actions,并把本地 DSH 插件发布到 GitHub;同时提供 38 个 gh_* 与 plugin_* 工具让 Agent 做同样的事。打开面板会先扫描工作区列出可发布的插件并做离线体检,这一步不需要登录;发布时只问目录、账号、仓库名三件事。注册走 GitHub manifest flow,私钥只写入 DSH 凭据服务,安装令牌只在内存里、1 小时过期。发布把一个已存在的插件目录经 Git Data API 提交进一个已存在的仓库(不需要 git 命令,也不执行任何包脚本),合并 dsh-plugin topic,创建 v<版本> Release,并探测 npm、仓库 topic、Release tag 与配置里的市场索引 URL;探测失败记作「未知」,不会误判为未收录。限制:仓库必须先存在并授权给 App(面板给一键建仓链接;安装令牌无法直接新建个人仓库),npm publish 与市场提交仍需手动,不接收 webhook,面板提交文件直接写入默认分支、不自动开 PR。"
5
5
  }
6
6
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-github-console",
3
- "version": "0.4.1",
3
+ "version": "0.6.1",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "description": "GitHub console for DeepSeek Harness: GitHub App sign-in, repository browsing, issues/pulls/CI, plugin publishing with market checks, npm release via GitHub Actions, and a self-hosted market index",
@@ -24,7 +24,7 @@
24
24
  "./locale/*.json": "./locale/*.json",
25
25
  "./icon": "./icon.svg"
26
26
  },
27
- "files": [
27
+ "files": ["scripts", ".github",
28
28
  "index.js",
29
29
  "client.js",
30
30
  "cordis.patch.yml",
@@ -0,0 +1,79 @@
1
+ /**
2
+ * Consistency check for the bundle. Fails when the tool count in README or the
3
+ * locale files drifts from the tools actually registered in index.js, and when
4
+ * either file no longer parses.
5
+ *
6
+ * node scripts/check.mjs
7
+ */
8
+ import fs from 'node:fs'
9
+ import path from 'node:path'
10
+ import vm from 'node:vm'
11
+ import { pathToFileURL } from 'node:url'
12
+
13
+ const root = path.resolve(import.meta.dirname, '..')
14
+ const problems = []
15
+ const notes = []
16
+
17
+ function read(relative) {
18
+ return fs.readFileSync(path.join(root, relative), 'utf8')
19
+ }
20
+
21
+ const host = read('index.js')
22
+ const client = read('client.js')
23
+
24
+ // index.js is an ES module (dynamic import parses and evaluates its top level,
25
+ // which only declares functions); client.js is a classic script.
26
+ try {
27
+ await import(pathToFileURL(path.join(root, 'index.js')).href)
28
+ notes.push('index.js: parses')
29
+ } catch (error) {
30
+ problems.push(`index.js: ${error.message}`)
31
+ }
32
+ try {
33
+ new vm.Script(client, { filename: 'client.js' })
34
+ notes.push('client.js: parses')
35
+ } catch (error) {
36
+ problems.push(`client.js: ${error.message}`)
37
+ }
38
+
39
+ const tools = [...host.matchAll(/^\s{4}name: '((?:gh|plugin)_[a-z_]+)'/gm)].map((match) => match[1])
40
+ const unique = [...new Set(tools)]
41
+ if (!unique.length) problems.push('index.js: no tool registrations found')
42
+ notes.push(`tools registered: ${unique.length}`)
43
+
44
+ const pkg = JSON.parse(read('package.json'))
45
+ if (pkg.version !== host.match(/PLUGIN_VERSION = '([^']+)'/)[1]) {
46
+ problems.push(`version mismatch: package.json ${pkg.version} vs index.js`)
47
+ }
48
+
49
+ const readme = read('README.md')
50
+ if (!readme.includes(`${unique.length} 个`)) {
51
+ problems.push(`README.md: does not mention the ${unique.length} tools`)
52
+ }
53
+
54
+ for (const locale of ['locale/zh.json', 'locale/en.json']) {
55
+ const text = read(locale)
56
+ const declared = /(\d+)\s*(?:个\s*)?gh_\*/.exec(text) || /(\d+)\s+gh_\*/.exec(text)
57
+ if (!declared) {
58
+ problems.push(`${locale}: no "<n> gh_*" count in meta.description`)
59
+ } else if (Number(declared[1]) !== unique.length) {
60
+ problems.push(`${locale}: says ${declared[1]} tools, code registers ${unique.length}`)
61
+ }
62
+ }
63
+
64
+ // Guard rails from the audit: every capability gate must exist, and the token
65
+ // refresh path must not assume an App installation.
66
+ for (const marker of ['READ_ONLY', 'NO_CAPABILITY', 'appendAudit', 'isDeniedFile', 'persistLocalIndex']) {
67
+ if (!host.includes(marker)) problems.push(`index.js: missing audit marker ${marker}`)
68
+ }
69
+ if (/const token = await installationToken\(\)\n\s*\/\/ The archive/.test(host)) {
70
+ problems.push('index.js: runLog still assumes an installation token')
71
+ }
72
+
73
+ console.log(notes.join('\n'))
74
+ if (problems.length) {
75
+ console.error('\nPROBLEMS:')
76
+ for (const problem of problems) console.error(`- ${problem}`)
77
+ process.exit(1)
78
+ }
79
+ console.log('\ncheck passed')