dsh-plugin-github-issues 0.0.0-stage → 0.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.
Files changed (58) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +153 -2
  3. package/assets/panel.png +0 -0
  4. package/cordis.patch.yml +20 -0
  5. package/docs/README.zh.md +138 -0
  6. package/icon.svg +9 -0
  7. package/lib/client.js +3348 -0
  8. package/lib/controller.js +296 -0
  9. package/lib/controller.js.map +1 -0
  10. package/lib/github/auth.js +249 -0
  11. package/lib/github/auth.js.map +1 -0
  12. package/lib/github/client.js +797 -0
  13. package/lib/github/client.js.map +1 -0
  14. package/lib/github/queries.js +508 -0
  15. package/lib/github/queries.js.map +1 -0
  16. package/lib/github/state.js +190 -0
  17. package/lib/github/state.js.map +1 -0
  18. package/lib/github/types.js +29 -0
  19. package/lib/github/types.js.map +1 -0
  20. package/lib/github/vm.js +362 -0
  21. package/lib/github/vm.js.map +1 -0
  22. package/lib/index.js +65 -0
  23. package/lib/index.js.map +1 -0
  24. package/lib/prompt.js +87 -0
  25. package/lib/prompt.js.map +1 -0
  26. package/lib/remote-methods.js +33 -0
  27. package/lib/remote-methods.js.map +1 -0
  28. package/lib/types/controller.d.ts +109 -0
  29. package/lib/types/controller.d.ts.map +1 -0
  30. package/lib/types/github/auth.d.ts +52 -0
  31. package/lib/types/github/auth.d.ts.map +1 -0
  32. package/lib/types/github/client.d.ts +40 -0
  33. package/lib/types/github/client.d.ts.map +1 -0
  34. package/lib/types/github/queries.d.ts +181 -0
  35. package/lib/types/github/queries.d.ts.map +1 -0
  36. package/lib/types/github/state.d.ts +51 -0
  37. package/lib/types/github/state.d.ts.map +1 -0
  38. package/lib/types/github/types.d.ts +83 -0
  39. package/lib/types/github/types.d.ts.map +1 -0
  40. package/lib/types/github/vm.d.ts +260 -0
  41. package/lib/types/github/vm.d.ts.map +1 -0
  42. package/lib/types/index.d.ts +46 -0
  43. package/lib/types/index.d.ts.map +1 -0
  44. package/lib/types/prompt.d.ts +30 -0
  45. package/lib/types/prompt.d.ts.map +1 -0
  46. package/lib/types/remote-methods.d.ts +32 -0
  47. package/lib/types/remote-methods.d.ts.map +1 -0
  48. package/lib/types/vm.d.ts +268 -0
  49. package/lib/types/vm.d.ts.map +1 -0
  50. package/lib/types/workspace.d.ts +43 -0
  51. package/lib/types/workspace.d.ts.map +1 -0
  52. package/lib/vm.js +43 -0
  53. package/lib/vm.js.map +1 -0
  54. package/lib/workspace.js +57 -0
  55. package/lib/workspace.js.map +1 -0
  56. package/locale/en.json +6 -0
  57. package/locale/zh.json +6 -0
  58. package/package.json +99 -4
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Kanner
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,154 @@
1
- # Temporary Holding Version
1
+ # dsh-plugin-github-issues
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
+ English | [中文](docs/README.zh.md)
4
+
5
+ [![ci](https://github.com/ckanner/dsh-plugin-github-issues/actions/workflows/ci.yml/badge.svg)](https://github.com/ckanner/dsh-plugin-github-issues/actions/workflows/ci.yml)
6
+ [![release](https://github.com/ckanner/dsh-plugin-github-issues/actions/workflows/release.yml/badge.svg)](https://github.com/ckanner/dsh-plugin-github-issues/actions/workflows/release.yml)
7
+ [![npm](https://img.shields.io/npm/v/dsh-plugin-github-issues.svg)](https://www.npmjs.com/package/dsh-plugin-github-issues)
8
+ [![license](https://img.shields.io/npm/l/dsh-plugin-github-issues.svg)](LICENSE)
9
+
10
+ Adds a GitHub Issues work surface to [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness):
11
+ browse issues from your repositories and Projects v2 boards, read their details, and hand one to the
12
+ agent. A handoff opens a new Session in the matching Workspace and stages the issue as an
13
+ attachment-style card inside the composer; sending turns that card into the issue's task prompt.
14
+ Handed-over issues show which Sessions own them, can be entered, and can be unlinked; one issue may be
15
+ worked in several Sessions.
16
+
17
+ ![The GitHub panel with the fixed cascade toolbar and the detail pane](assets/panel.png)
18
+
19
+ It is **read-only**: the plugin never writes to GitHub.
20
+
21
+ ## Install
22
+
23
+ From the npm registry (recommended — the package ships the built Host half and browser bundle):
24
+
25
+ ```sh
26
+ dsh plugin --profile <name> add dsh-plugin-github-issues
27
+ ```
28
+
29
+ Pin a version when you want reproducible profiles:
30
+
31
+ ```sh
32
+ dsh plugin --profile <name> add dsh-plugin-github-issues@0.4.7
33
+ ```
34
+
35
+ Restart the harness afterwards: a profile is composed at startup. Remove it with:
36
+
37
+ ```sh
38
+ dsh plugin --profile <name> remove dsh-plugin-github-issues
39
+ ```
40
+
41
+ From a checkout (a linked install: rebuild and restart after edits):
42
+
43
+ ```sh
44
+ npm install
45
+ npm run build
46
+ dsh plugin --profile <name> add /path/to/dsh-plugin-github-issues
47
+ ```
48
+
49
+ Every [release](https://github.com/ckanner/dsh-plugin-github-issues/releases) also carries a packed
50
+ tarball (`dsh-plugin-github-issues.tgz`), installable by path.
51
+
52
+ ## Requirements
53
+
54
+ - DSH Desktop with a Web GUI (developed and verified against `0.2.1-rc.3`).
55
+ - A [`gh`](https://cli.github.com/) CLI logged in for the GitHub host you use:
56
+ `gh auth login`. The token stays in the OS keychain and is never written into this package's config.
57
+ - Projects v2 support additionally needs the `read:project` scope, once:
58
+
59
+ ```sh
60
+ gh auth refresh -h github.com -s read:project
61
+ ```
62
+
63
+ Without it the panel still works; the project picker explains what is missing.
64
+
65
+ ## What you get
66
+
67
+ | Surface | Where | What |
68
+ |---|---|---|
69
+ | GitHub panel | left rail icon → main panel | organization → project/repository → **milestone** → assignee → state cascade (remembered across restarts) in one fixed toolbar; only the list scrolls, search sits above it, and the detail pane scrolls independently (body, milestone progress, labels, priority, assignees, linked/mentioned PRs with checks and review state) |
70
+ | Issues right column | right sidebar tab | the same filtered issue list beside the Conversation, for drag-and-drop handoff |
71
+ | Composer card | inside the input box | the staged issue: `[GitHub] owner/repo#number ×`. Type extra instructions or nothing; send converts the card into the issue prompt |
72
+ | Linked chip | composer dock under the input | the Session's linked issue: state dot (green open / red closed) + `owner/repo#number`; click for a detail popover, remove to unlink |
73
+ | Handoff actions | issue detail | one-click **enter Session** (latest link), **new Session for this issue**, plus a linked-Session list with per-Session enter/unlink |
74
+ | GitHub settings | Settings → GitHub | `gh` auth status and scopes, handoff behavior, prompt template |
75
+
76
+ ## Use
77
+
78
+ 1. Click the **GitHub** icon in the left rail.
79
+ 2. Pick an organization, a Projects v2 board or a repository, then a milestone (when the scope is a
80
+ repository) and an assignee/state filter. The selection is remembered in the profile's UI state
81
+ (not in the plugin config).
82
+ 3. Click a row for the detail pane. `owner/repo#number` opens GitHub in the browser.
83
+ 4. Hand an issue over:
84
+ - **One-click** in the detail: **Hand to agent** / **New session for this issue** opens a new
85
+ Session in the matching Workspace with the issue staged inside the composer.
86
+ - **Drag** a row from the right-column **Issues** tab into the composer: it stages into the current
87
+ Session.
88
+ - Type whatever context you want, then send. The card is converted into the issue's task prompt
89
+ (the template from Settings) plus your text; the issue ↔ Session link is recorded at that moment.
90
+ 5. The linked chip appears under the composer. Reopen the issue later to enter that Session, start
91
+ another one, or unlink it. Unlinking never deletes the Session.
92
+ 6. Open the right column from the panel header (**Right column**) or from the right sidebar's own add
93
+ menu (page type **Issues**).
94
+
95
+ ### Which Session does a handoff use?
96
+
97
+ - If the issue is already linked: **enter Session** opens the most recent link; the linked-Session list
98
+ lets you enter any of them.
99
+ - A new handoff picks a Workspace by this priority: the Workspace of the current Session → the
100
+ Workspace of a Session already linked to the same repository → a Workspace whose directory/title
101
+ matches the repository name → the Host's current/most-recent Workspace.
102
+
103
+ ### Prompt template
104
+
105
+ Settings → GitHub → Prompt template. Variables: `{{repo}}`, `{{number}}`, `{{title}}`, `{{url}}`,
106
+ `{{state}}`, `{{milestone}}`, `{{priority}}`, `{{assignees}}`, `{{labels}}`, `{{prs}}`.
107
+
108
+ ## Privacy and tokens
109
+
110
+ - The token is resolved by the Host process from `gh` and lives only in memory. It never reaches the
111
+ page, the plugin config, or logs.
112
+ - GitHub requests are made by the Host; the browser only receives view models.
113
+ - Persisted UI state is limited to filter preferences, the prompt template, and issue ↔ Session links,
114
+ stored at `$DSH_HOME/github-issues/state.json` (mode `0600`).
115
+ - The plugin is read-only toward GitHub.
116
+
117
+ ## Limitations
118
+
119
+ - Read-only: no comments, label/assignee/state writes.
120
+ - Projects v2 needs `read:project`; priority falls back project field → organization Issue Field →
121
+ `P0`–`P4` labels. The milestone filter is disabled on a board because Projects v2 item filters have
122
+ no milestone equivalent.
123
+ - Milestone choices come from the selected repository's full milestone list; in an all-repositories
124
+ scope they are accumulated from the issues already loaded.
125
+ - The list polls every 60–120 s while visible; use **Refresh** for an immediate update.
126
+ - The detail pane first asks for the body only and lazily loads cross-referenced PRs, so the slow
127
+ timeline never blocks the pane.
128
+ - Converting the composer card into the prompt intercepts the native send button / Enter, which relies
129
+ on the composer DOM of the verified DSH version; re-check after a DSH upgrade.
130
+ - Workspace matching for a new handoff is the heuristic priority above, not a fixed mapping.
131
+
132
+ ## Development
133
+
134
+ ```sh
135
+ npm install
136
+ npm run typecheck # Host + browser halves
137
+ npm test # node --test (queries, VM mapping, prompt, state, workspace rules)
138
+ npm run test:render # offline react-dom/server smoke of the panel, dock, sidebar, drop target
139
+ npm run build # Host (tsc) + browser bundle (esbuild)
140
+ npm run verify:client # loader contract + slot/Remote registration of the browser bundle
141
+ npm run verify:package # what npm publish would ship (host, client, bundle patch, locale, icon)
142
+ npm run check # all of the above, in order
143
+ ```
144
+
145
+ ## Releases
146
+
147
+ `ci.yml` runs on every push and pull request. `release.yml` runs on a `v*` tag (or by hand): it repeats
148
+ every CI check, publishes the new version to npm (a repository `NPM_TOKEN` secret, or npm trusted
149
+ publishing), and records a GitHub Release carrying `dsh-plugin-github-issues.tgz`. Maintainer notes:
150
+ [docs/RELEASING.md](https://github.com/ckanner/dsh-plugin-github-issues/blob/main/docs/RELEASING.md).
151
+
152
+ ## License
153
+
154
+ MIT © Kanner
Binary file
@@ -0,0 +1,20 @@
1
+ # The dsh-plugin-github-issues bundle patch.
2
+ #
3
+ # One row: the plugin that owns the GitHub Issues panel, the composer dock
4
+ # handoff strip, and the GitHub settings page. `authMode: gh` reuses the
5
+ # already-authenticated `gh` CLI (the token never leaves the Host process and
6
+ # is never written to this file). `stateDir` holds only non-secret UI state.
7
+ #
8
+ # Projects v2 additionally needs `read:project` on the token — the settings page
9
+ # shows the exact one-line command (`gh auth refresh -h github.com -s read:project`)
10
+ # instead of the plugin escalating auth itself.
11
+
12
+ - insert:
13
+ - id: github-issues
14
+ name: 'dsh-plugin-github-issues'
15
+ config:
16
+ authMode: gh
17
+ host: github.com
18
+ handoffMode: draft
19
+ pollSeconds: 90
20
+ stateDir: !!js (process.env.DSH_HOME ?? process.env.HOME + '/.dsh') + '/github-issues'
@@ -0,0 +1,138 @@
1
+ # dsh-plugin-github-issues
2
+
3
+ [English](../README.md) | 中文
4
+
5
+ [![ci](https://github.com/ckanner/dsh-plugin-github-issues/actions/workflows/ci.yml/badge.svg)](https://github.com/ckanner/dsh-plugin-github-issues/actions/workflows/ci.yml)
6
+ [![npm](https://img.shields.io/npm/v/dsh-plugin-github-issues.svg)](https://www.npmjs.com/package/dsh-plugin-github-issues)
7
+
8
+ 给 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) 增加一个 GitHub Issue 工作区:
9
+ 按组织 / Projects v2 项目 / 仓库浏览 Issue,查看详情,并把 Issue 交给 Agent。交办会在匹配的
10
+ Workspace 里新开一个 Session,并在输入框内以"附件卡片"的形式暂存这个 Issue;点击发送时卡片会
11
+ 转成 Issue 的提示词。已交办的 Issue 会显示处理它的 Session,可以进入,也可以解除关联;同一个
12
+ Issue 可以关联多个 Session。
13
+
14
+ ![GitHub 面板:固定筛选栏 + 独立滚动的详情栏](../assets/panel.png)
15
+
16
+ 插件对 GitHub **只读**,不会写入任何内容。
17
+
18
+ ## 安装
19
+
20
+ 从 npm 安装(推荐,包内已带构建好的 Host 半和浏览器 bundle):
21
+
22
+ ```sh
23
+ dsh plugin --profile <name> add dsh-plugin-github-issues
24
+ ```
25
+
26
+ 锁定版本:
27
+
28
+ ```sh
29
+ dsh plugin --profile <name> add dsh-plugin-github-issues@0.4.7
30
+ ```
31
+
32
+ 安装后重启 DSH(profile 在启动时组装)。卸载:
33
+
34
+ ```sh
35
+ dsh plugin --profile <name> remove dsh-plugin-github-issues
36
+ ```
37
+
38
+ 从源码目录安装(link 方式,改代码后需要重新 build 并重启):
39
+
40
+ ```sh
41
+ npm install
42
+ npm run build
43
+ dsh plugin --profile <name> add /path/to/dsh-plugin-github-issues
44
+ ```
45
+
46
+ 每个 [Release](https://github.com/ckanner/dsh-plugin-github-issues/releases) 也附带打包好的
47
+ `dsh-plugin-github-issues.tgz`,可以通过路径安装。
48
+
49
+ ## 前置条件
50
+
51
+ - DSH Desktop(Web GUI;开发与验证于 `0.2.1-rc.3`)。
52
+ - 已登录的 `gh` CLI:`gh auth login`。token 留在系统钥匙串,不会写进插件配置。
53
+ - 需要 Projects v2 时一次性补权限:
54
+
55
+ ```sh
56
+ gh auth refresh -h github.com -s read:project
57
+ ```
58
+
59
+ 没有该权限时面板照常工作,项目选择器会说明缺什么。
60
+
61
+ ## 功能
62
+
63
+ | 界面 | 位置 | 内容 |
64
+ |---|---|---|
65
+ | GitHub 面板 | 左侧栏图标 → 主面板 | 组织 → 项目/仓库 → **里程碑** → assignee → 状态 级联筛选(记住上次选择)固定在一行;只有列表滚动,搜索在列表上方固定;详情栏独立滚动(正文、Milestone 进度、标签、优先级、assignee、关联/提及 PR 的 checks 与 review) |
66
+ | Issues 右栏 | 右侧栏页签 | 与对话同屏的同一份筛选列表,用于拖拽交办 |
67
+ | 输入框卡片 | 输入框内部 | 暂存的 Issue:`[GitHub] owner/repo#number ×`。可以补充自己的文字,也可以不写;发送时卡片转成提示词 |
68
+ | 已关联 chip | 输入框下方 dock | 当前 Session 关联的 Issue:状态圆点(open 绿 / closed 红)+ `owner/repo#number`;点击看详情,× 解除关联 |
69
+ | 交办操作 | Issue 详情 | 一键「进入 Session」(最新关联)、「再开一个 Session」;处理中的 Session 列表里每一项都能进入或解除 |
70
+ | GitHub 设置 | 设置 → GitHub | `gh` 登录状态与权限、交办行为、Prompt 模板 |
71
+
72
+ ## 使用
73
+
74
+ 1. 点击左侧栏 **GitHub** 图标。
75
+ 2. 选择组织、Projects v2 板或仓库,再选里程碑(仓库范围时)和 assignee/状态。选择会记在 profile
76
+ 的 UI 状态里(不在插件配置中)。
77
+ 3. 点一行查看详情;点 `owner/repo#number` 在浏览器打开 GitHub。
78
+ 4. 交办:
79
+ - 详情里点「交给 Agent」/「再开一个 Session」:在匹配的 Workspace 新开 Session,输入框内出现
80
+ Issue 卡片;
81
+ - 从右栏 **Issues** 页签拖一行到输入框:暂存到**当前** Session;
82
+ - 输入想补充的内容(可不填)后发送:卡片转成 Issue 提示词(模板来自设置)+ 你输入的内容,
83
+ 同时记录 Issue ↔ Session 关联;
84
+ 5. 输入框下方出现已关联 chip。之后可以进入那个 Session、再开一个,或解除关联(解除不会删除
85
+ Session)。
86
+ 6. 右栏可以从面板右上角「右栏」按钮打开,也可以在右侧栏自己的添加菜单里选 **Issues** 页签。
87
+
88
+ ### 交办会去哪个 Session?
89
+
90
+ - 已关联:主按钮进入最新关联的那个;下方 Session 列表可以逐个进入;
91
+ - 新交办选择 Workspace 的优先级:当前 Session 的 Workspace → 已关联同仓库 Session 的 Workspace →
92
+ 目录名/标题与仓库名匹配的 Workspace → Host 当前/最近 Workspace。
93
+
94
+ ### Prompt 模板
95
+
96
+ 设置 → GitHub → Prompt 模板。变量:`{{repo}}`、`{{number}}`、`{{title}}`、`{{url}}`、`{{state}}`、
97
+ `{{milestone}}`、`{{priority}}`、`{{assignees}}`、`{{labels}}`、`{{prs}}`。
98
+
99
+ ## 隐私与 token
100
+
101
+ - token 由 Host 进程从 `gh` 读取,只在内存中复用;不进页面、不进插件配置、不进日志。
102
+ - GitHub 请求都在 Host 完成,浏览器只拿到视图模型。
103
+ - 落盘的只有筛选偏好、Prompt 模板和 Issue ↔ Session 关联,位于
104
+ `$DSH_HOME/github-issues/state.json`(权限 `0600`)。
105
+
106
+ ## 限制
107
+
108
+ - 只读:不发评论、不改标签/指派/状态。
109
+ - Projects v2 需要 `read:project`;优先级回退顺序:项目字段 → 组织 Issue Field → `P0`–`P4` 标签。
110
+ Projects v2 的条目筛选没有里程碑等价物,因此选中项目板时里程碑筛选会禁用。
111
+ - 里程碑的可选项:选中仓库时取该仓库的完整里程碑列表;全部仓库范围时从已加载的 Issue 中累积。
112
+ - 列表可见时每 60–120 秒轮询一次;需要立刻更新点「刷新」。
113
+ - 详情先请求正文,交叉引用 PR 懒加载,慢的 timeline 不阻塞面板。
114
+ - "发送时卡片转提示词"依赖 composer 的 DOM(原生发送按钮 / 回车),DSH 升级后需要重新核对。
115
+ - 新交办的 Workspace 匹配是上面的启发式优先级,不是固定映射。
116
+
117
+ ## 开发
118
+
119
+ ```sh
120
+ npm install
121
+ npm run typecheck
122
+ npm test # node --test(查询、VM 映射、prompt、状态、workspace 规则)
123
+ npm run test:render # 离线 react-dom/server 渲染烟测
124
+ npm run build # Host (tsc) + 浏览器 bundle (esbuild)
125
+ npm run verify:client # bundle 的加载契约与槽位/Remote 注册
126
+ npm run verify:package # npm publish 实际会带上的文件
127
+ npm run check # 以上全部
128
+ ```
129
+
130
+ ## 发布
131
+
132
+ `ci.yml` 在 push / PR 时运行;`release.yml` 在 `v*` tag(或手动)时运行:重复所有检查、发布 npm
133
+ (仓库 `NPM_TOKEN` secret 或 npm trusted publishing),并创建携带 `dsh-plugin-github-issues.tgz`
134
+ 的 GitHub Release。维护者说明见 [RELEASING.md](https://github.com/ckanner/dsh-plugin-github-issues/blob/main/docs/RELEASING.md)。
135
+
136
+ ## License
137
+
138
+ MIT © Kanner
package/icon.svg ADDED
@@ -0,0 +1,9 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="64" height="64" role="img" aria-label="GitHub Issues">
2
+ <rect x="2" y="2" width="60" height="60" rx="14" fill="#1f6feb"/>
3
+ <circle cx="24" cy="22" r="7" fill="none" stroke="#ffffff" stroke-width="4"/>
4
+ <circle cx="24" cy="22" r="2.5" fill="#ffffff"/>
5
+ <path d="M24 29v13a6 6 0 0 0 6 6h9" fill="none" stroke="#ffffff" stroke-width="4" stroke-linecap="round"/>
6
+ <circle cx="44" cy="48" r="4.5" fill="#ffffff"/>
7
+ <path d="M44 34v9" fill="none" stroke="#ffffff" stroke-width="4" stroke-linecap="round"/>
8
+ <circle cx="44" cy="31" r="4" fill="none" stroke="#ffffff" stroke-width="3.5"/>
9
+ </svg>