@lornatang/dsh-atlassian 0.0.0-stage → 0.1.5
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 +46 -0
- package/LICENSE +202 -0
- package/NOTICE +2 -0
- package/README.md +183 -2
- package/cordis.patch.yml +9 -0
- package/lib/board.js +135 -0
- package/lib/bridge.js +284 -0
- package/lib/client.js +264 -0
- package/lib/config.js +67 -0
- package/lib/index.js +50 -0
- package/lib/oauth.js +223 -0
- package/lib/open-url.js +26 -0
- package/lib/routes.js +107 -0
- package/lib/server-bridge.js +285 -0
- package/lib/server-http.js +111 -0
- package/lib/store.js +141 -0
- package/lib/types/board.d.ts +73 -0
- package/lib/types/bridge.d.ts +47 -0
- package/lib/types/client/index.d.ts +15 -0
- package/lib/types/config.d.ts +96 -0
- package/lib/types/index.d.ts +6 -0
- package/lib/types/oauth.d.ts +47 -0
- package/lib/types/open-url.d.ts +2 -0
- package/lib/types/routes.d.ts +39 -0
- package/lib/types/server-bridge.d.ts +23 -0
- package/lib/types/server-http.d.ts +8 -0
- package/lib/types/store.d.ts +31 -0
- package/package.json +92 -4
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.1.5
|
|
4
|
+
|
|
5
|
+
- Rename the package to `@lornatang/dsh-atlassian`, retaining existing profile
|
|
6
|
+
settings and stored credentials when migrating from the previous package.
|
|
7
|
+
- Limit Cloud response bodies and individual streaming events to prevent
|
|
8
|
+
excessive memory use from oversized responses.
|
|
9
|
+
|
|
10
|
+
## 0.1.4
|
|
11
|
+
|
|
12
|
+
- Keep the README focused on installation and everyday use, and remove an
|
|
13
|
+
unavailable release download link.
|
|
14
|
+
|
|
15
|
+
## 0.1.3
|
|
16
|
+
|
|
17
|
+
- Support explicitly trusted self-signed server certificates in DSH Desktop
|
|
18
|
+
while retaining certificate and hostname verification.
|
|
19
|
+
- Let users edit service URLs in Settings, with Atlassian Cloud selected when
|
|
20
|
+
both URLs are blank.
|
|
21
|
+
- Refresh the English settings and Jira board interfaces for light and dark
|
|
22
|
+
themes.
|
|
23
|
+
|
|
24
|
+
## 0.1.2
|
|
25
|
+
|
|
26
|
+
- Align the English README structure and configuration reference with the
|
|
27
|
+
other DSH plugins.
|
|
28
|
+
|
|
29
|
+
## 0.1.1
|
|
30
|
+
|
|
31
|
+
- Add self-hosted Jira Server and Confluence Server/Data Center REST mode,
|
|
32
|
+
with Basic or personal access token authentication and a Jira board.
|
|
33
|
+
- Verify TLS by default, allow a configured CA file, and require an explicit
|
|
34
|
+
opt-in for HTTP endpoints.
|
|
35
|
+
- Restrict Cloud OAuth network requests to HTTPS and harden local credential
|
|
36
|
+
file access.
|
|
37
|
+
- Provide an English interface and documentation.
|
|
38
|
+
|
|
39
|
+
## 0.1.0
|
|
40
|
+
|
|
41
|
+
- Connect DSH to the Atlassian remote MCP server with OAuth 2.1 and PKCE.
|
|
42
|
+
- Expose discovered tools to agents and provide a Jira board with issue details,
|
|
43
|
+
filters, transitions and handoff to agent sessions.
|
|
44
|
+
- Isolate OAuth sessions by DSH profile, restrict local credential files, and
|
|
45
|
+
require the DSH request fence for plugin endpoints.
|
|
46
|
+
- Provide prebuilt npm packaging and integration tests against DSH 0.2.2-rc.2.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/NOTICE
ADDED
package/README.md
CHANGED
|
@@ -1,3 +1,184 @@
|
|
|
1
|
-
#
|
|
1
|
+
# dsh-atlassian
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Connect Atlassian Cloud or self-hosted Jira and Confluence to DeepSeek Harness
|
|
4
|
+
(DSH). The plugin exposes Atlassian tools to agent sessions and adds a Jira
|
|
5
|
+
board to the Web interface.
|
|
6
|
+
|
|
7
|
+
**Requires:** Node.js 22.19+, DSH 0.2.2-rc.2+, and a Web-compatible profile.
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
dsh plugin --profile web add @lornatang/dsh-atlassian
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Restart DSH, or start the default Web profile with `dsh web --no-open`. For a
|
|
16
|
+
profile with another name, replace `web` in the install command. Use the same
|
|
17
|
+
command to update the plugin, then restart DSH; profile configuration is kept.
|
|
18
|
+
|
|
19
|
+
To migrate from `@lornatang/dsh-atlassian-bridge`, stop DSH, install the new
|
|
20
|
+
package, remove the old package from the same profile, then restart DSH:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
dsh plugin --profile web add @lornatang/dsh-atlassian
|
|
24
|
+
dsh plugin --profile web remove @lornatang/dsh-atlassian-bridge
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Existing connection settings and stored credentials are retained. Replace
|
|
28
|
+
`web` with the profile you use, such as `desktop` for DSH Desktop.
|
|
29
|
+
|
|
30
|
+
Avoid loading another integration that uses the same settings, routes or tool
|
|
31
|
+
names in the same profile. This community plugin is not an Atlassian or
|
|
32
|
+
DeepSeek product.
|
|
33
|
+
|
|
34
|
+
## Connect
|
|
35
|
+
|
|
36
|
+
Open **Settings → Atlassian**. Leave both service URLs blank to use the
|
|
37
|
+
official Atlassian Cloud endpoint, or enter the base URL of each self-hosted
|
|
38
|
+
service you want to use and select **Save URLs**. Then select **Connect**.
|
|
39
|
+
For Atlassian Cloud, sign in and approve the requested access. If a browser
|
|
40
|
+
does not open, use the connection link shown in Settings. Available tools appear as
|
|
41
|
+
`mcp__atlassian__…`; their permissions depend on the authorized account.
|
|
42
|
+
|
|
43
|
+
Open **Jira** in the sidebar to browse issues, search with JQL, inspect details
|
|
44
|
+
and transitions, or select issues to send to an agent session. The Cloud MCP
|
|
45
|
+
service may expose additional products, depending on Atlassian's service and
|
|
46
|
+
your account access.
|
|
47
|
+
|
|
48
|
+
The OAuth callback listens on `127.0.0.1` on the DSH host. If DSH runs on a
|
|
49
|
+
remote machine, forward the callback port so the browser can reach it. Keep the
|
|
50
|
+
port stable: changing it may require a new authorization.
|
|
51
|
+
|
|
52
|
+
## Configuration
|
|
53
|
+
|
|
54
|
+
Edit `~/.dsh/profiles/web/cordis.patch.yml` (or use `$DSH_HOME` in place of
|
|
55
|
+
`~/.dsh`) and add or edit the `atlassian` entry. Restart DSH after changes.
|
|
56
|
+
The default Cloud configuration is:
|
|
57
|
+
|
|
58
|
+
```yaml
|
|
59
|
+
- id: atlassian
|
|
60
|
+
config:
|
|
61
|
+
mode: cloud
|
|
62
|
+
serverName: atlassian
|
|
63
|
+
url: 'https://mcp.atlassian.com/v1/mcp'
|
|
64
|
+
redirectPort: 3334
|
|
65
|
+
expectedSite: ''
|
|
66
|
+
toolCallTimeoutMs: 60000
|
|
67
|
+
authorizationTimeoutMs: 300000
|
|
68
|
+
autoOpenBrowser: true
|
|
69
|
+
board:
|
|
70
|
+
jql: ''
|
|
71
|
+
limit: 50
|
|
72
|
+
timeoutMs: 90000
|
|
73
|
+
promptTemplate: ''
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
| Option | Default | Purpose |
|
|
77
|
+
| --- | --- | --- |
|
|
78
|
+
| `mode` | `cloud` | Select `cloud` or self-hosted `server` mode. |
|
|
79
|
+
| `serverName` | `atlassian` | Tool namespace and local credential-store identity. |
|
|
80
|
+
| `url` | Atlassian MCP URL | Cloud MCP endpoint; remote endpoints must use HTTPS. |
|
|
81
|
+
| `redirectPort` | `3334` | Loopback OAuth callback port; an occupied port falls back to a free port. |
|
|
82
|
+
| `expectedSite` | empty | Display a warning when the authorized Cloud site differs. |
|
|
83
|
+
| `toolCallTimeoutMs` | `60000` | Tool request timeout in milliseconds. |
|
|
84
|
+
| `authorizationTimeoutMs` | `300000` | Time allowed to complete OAuth authorization. |
|
|
85
|
+
| `autoOpenBrowser` | `true` | Open the Cloud authorization page automatically. |
|
|
86
|
+
| `board.jql` / `board.limit` | empty / `50` | Initial query and maximum issues per refresh; limit is 1–100. |
|
|
87
|
+
| `board.timeoutMs` | `90000` | Board request timeout in milliseconds. |
|
|
88
|
+
| `board.promptTemplate` | empty | Handoff text; supports `{{key}}` and `{{summary}}`. |
|
|
89
|
+
|
|
90
|
+
`expectedSite` is a warning, not an access restriction. An empty board query
|
|
91
|
+
uses the built-in view. An empty prompt template uses the default handoff text.
|
|
92
|
+
Cloud MCP and discovered OAuth endpoints require HTTPS; plain HTTP is allowed
|
|
93
|
+
only when the configured MCP server is on loopback.
|
|
94
|
+
|
|
95
|
+
## Self-hosted Jira and Confluence
|
|
96
|
+
|
|
97
|
+
Enter one or both service base URLs in **Settings → Atlassian** and save them.
|
|
98
|
+
Include any context path used by your installation. A blank URL disables that
|
|
99
|
+
product when the other URL is filled; leaving both blank selects Cloud.
|
|
100
|
+
|
|
101
|
+
Alternatively, set `mode: server` and configure the profile patch directly:
|
|
102
|
+
|
|
103
|
+
```yaml
|
|
104
|
+
- id: atlassian
|
|
105
|
+
config:
|
|
106
|
+
mode: server
|
|
107
|
+
server:
|
|
108
|
+
jiraUrl: 'https://jira.example.com'
|
|
109
|
+
confluenceUrl: 'https://confluence.example.com'
|
|
110
|
+
jiraCaFile: ''
|
|
111
|
+
confluenceCaFile: '/path/to/trusted-confluence-ca.pem'
|
|
112
|
+
allowInsecureHttp: false
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
| Option | Default | Purpose |
|
|
116
|
+
| --- | --- | --- |
|
|
117
|
+
| `server.jiraUrl` / `server.confluenceUrl` | empty | Jira and Confluence base URLs; an empty value disables that product. |
|
|
118
|
+
| `server.jiraCaFile` / `server.confluenceCaFile` | empty | PEM trust file for a private or self-signed certificate. |
|
|
119
|
+
| `server.allowInsecureHttp` | `false` | Allow HTTP service URLs after explicitly accepting plaintext transport. |
|
|
120
|
+
|
|
121
|
+
Restart DSH and open **Settings → Atlassian**. Enter a username and password
|
|
122
|
+
for Basic authentication, or leave the username empty and enter a personal
|
|
123
|
+
access token for Bearer authentication. When both URLs are configured, provide
|
|
124
|
+
credentials for both services. Do not put passwords or tokens in the profile
|
|
125
|
+
patch or repository.
|
|
126
|
+
|
|
127
|
+
Jira Server versions before 8.14 do not include Atlassian's native personal
|
|
128
|
+
access tokens. They need an account and password or a separately installed
|
|
129
|
+
token mechanism. Confluence Server 7.9+ supports native personal access tokens
|
|
130
|
+
when enabled by its administrator.
|
|
131
|
+
|
|
132
|
+
Self-hosted mode supports Jira search, issue read/create/edit, comments,
|
|
133
|
+
projects and transitions; it also supports Confluence space listing, CQL
|
|
134
|
+
search, and page read/create/update. It does not expose every Cloud MCP tool.
|
|
135
|
+
Confluence page updates use storage-format XHTML and the current page version.
|
|
136
|
+
|
|
137
|
+
HTTPS certificates and hostnames are verified. For a private CA or self-signed
|
|
138
|
+
certificate, set the matching CA file under **Advanced connection options**
|
|
139
|
+
after checking its identity through a trusted channel. HTTP sends credentials and data in plaintext; use HTTPS or an
|
|
140
|
+
encrypted tunnel whenever possible. The Settings page also sends credentials
|
|
141
|
+
to the DSH host, so open it locally or over HTTPS.
|
|
142
|
+
|
|
143
|
+
## Permissions and data
|
|
144
|
+
|
|
145
|
+
The plugin uses the permissions of the Atlassian account you connect. Some
|
|
146
|
+
tools can change Jira or Confluence content; DSH's normal tool permissions
|
|
147
|
+
still apply. Cloud MCP resources and prompts are not bridged, and image results
|
|
148
|
+
are shown as text placeholders.
|
|
149
|
+
|
|
150
|
+
OAuth details and self-hosted credentials are stored as unencrypted JSON under
|
|
151
|
+
`~/.dsh/profiles/<name>/data/atlassian-bridge-*.json`. On POSIX systems the
|
|
152
|
+
file is restricted to its owner. On Windows, restrict the profile directory
|
|
153
|
+
with ACLs. Protect backups of these files and run only one DSH process per
|
|
154
|
+
profile to avoid concurrent session changes.
|
|
155
|
+
|
|
156
|
+
Disconnecting in Settings removes the local credentials and registered tools.
|
|
157
|
+
It does not revoke an Atlassian grant; revoke that separately in Atlassian when
|
|
158
|
+
needed.
|
|
159
|
+
|
|
160
|
+
## Troubleshooting
|
|
161
|
+
|
|
162
|
+
- **Cannot connect:** Check the configured service URL, account permissions,
|
|
163
|
+
credentials and DSH log. Configure credentials for each enabled service.
|
|
164
|
+
- **Certificate verification fails:** Confirm the hostname and configure the
|
|
165
|
+
appropriate trusted PEM file for a private certificate.
|
|
166
|
+
- **HTTP service is rejected:** Switch to HTTPS, or explicitly set
|
|
167
|
+
`server.allowInsecureHttp: true` after accepting plaintext transport.
|
|
168
|
+
- **Cloud sign-in does not return to DSH:** Check the callback port and, for a
|
|
169
|
+
remote DSH host, its SSH port forwarding. A changed port may require a new
|
|
170
|
+
authorization.
|
|
171
|
+
- **Jira board is empty:** Check the connection and account permissions, then
|
|
172
|
+
try a narrower JQL query or increase `board.limit` within its supported range.
|
|
173
|
+
|
|
174
|
+
## Uninstall
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
dsh plugin --profile web remove @lornatang/dsh-atlassian
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
Disconnect first to remove local credentials, then restart DSH after uninstall.
|
|
181
|
+
Otherwise, remove the corresponding `data/atlassian-bridge-*.json` file from
|
|
182
|
+
the stopped profile manually.
|
|
183
|
+
|
|
184
|
+
[Apache-2.0](LICENSE)
|
package/cordis.patch.yml
ADDED
package/lib/board.js
ADDED
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
export class BoardError extends Error {
|
|
2
|
+
code;
|
|
3
|
+
constructor(code, message) {
|
|
4
|
+
super(message);
|
|
5
|
+
this.code = code;
|
|
6
|
+
this.name = 'BoardError';
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
function obj(value) { return value && typeof value === 'object' && !Array.isArray(value) ? value : {}; }
|
|
10
|
+
function val(value) { return typeof value === 'string' && value.trim() ? value : undefined; }
|
|
11
|
+
function issue(value, base) {
|
|
12
|
+
const row = obj(value);
|
|
13
|
+
const fields = obj(row['fields']);
|
|
14
|
+
const state = obj(fields['status']);
|
|
15
|
+
const category = obj(state['statusCategory']);
|
|
16
|
+
const project = obj(fields['project']);
|
|
17
|
+
const key = val(row['key']);
|
|
18
|
+
if (!key)
|
|
19
|
+
return undefined;
|
|
20
|
+
return {
|
|
21
|
+
key, id: val(row['id']) ?? key, summary: val(fields['summary']) ?? '(Untitled)',
|
|
22
|
+
status: { name: val(state['name']) ?? 'Unknown', categoryKey: val(category['key']) ?? 'undefined', categoryName: val(category['name']) ?? 'Uncategorized', colorName: val(category['colorName']) ?? '' },
|
|
23
|
+
type: val(obj(fields['issuetype'])['name']) ?? '', priority: val(obj(fields['priority'])['name']),
|
|
24
|
+
assignee: val(obj(fields['assignee'])['displayName']), reporter: val(obj(fields['reporter'])['displayName']),
|
|
25
|
+
updated: val(fields['updated']), projectKey: val(project['key']), projectName: val(project['name']),
|
|
26
|
+
url: base ? `${base.replace(/\/$/, '')}/browse/${encodeURIComponent(key)}` : undefined,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export class JiraBoard {
|
|
30
|
+
#bridge;
|
|
31
|
+
#resource;
|
|
32
|
+
constructor(bridge) { this.#bridge = bridge; }
|
|
33
|
+
available() { return !!this.#bridge.rawNameMatching(/searchJiraIssuesUsingJql/i); }
|
|
34
|
+
get site() { return this.#resource?.site; }
|
|
35
|
+
async #call(pattern, args, timeoutMs) {
|
|
36
|
+
const name = this.#bridge.rawNameMatching(pattern);
|
|
37
|
+
if (!name) {
|
|
38
|
+
const state = this.#bridge.snapshot?.();
|
|
39
|
+
if (state && state.status !== 'ready')
|
|
40
|
+
throw new BoardError('not-connected', state.error || `Atlassian is not connected(${state.status})`);
|
|
41
|
+
throw new BoardError('missing-tool', `Missing Jira tool: ${pattern.source}`);
|
|
42
|
+
}
|
|
43
|
+
let blocks;
|
|
44
|
+
try {
|
|
45
|
+
blocks = await this.#bridge.callTool(name, args, timeoutMs);
|
|
46
|
+
}
|
|
47
|
+
catch (error) {
|
|
48
|
+
throw new BoardError('tool-failed', error instanceof Error ? error.message : String(error));
|
|
49
|
+
}
|
|
50
|
+
const raw = blocks.map((entry) => val(obj(entry)['text']) ?? '').join('\n').trim().replace(/^```[a-z]*\s*/i, '').replace(/```\s*$/, '');
|
|
51
|
+
try {
|
|
52
|
+
return JSON.parse(raw);
|
|
53
|
+
}
|
|
54
|
+
catch {
|
|
55
|
+
throw new BoardError('unparsable', 'Jira response is not valid JSON');
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
async cloudId() {
|
|
59
|
+
if (this.#resource)
|
|
60
|
+
return this.#resource.id;
|
|
61
|
+
const data = await this.#call(/accessibleatlassianresources/i, {}, 20000);
|
|
62
|
+
const list = Array.isArray(data) ? data : [data];
|
|
63
|
+
for (const item of list) {
|
|
64
|
+
const entry = obj(item);
|
|
65
|
+
const id = val(entry['id']);
|
|
66
|
+
const url = val(entry['url']);
|
|
67
|
+
if (!id || !url)
|
|
68
|
+
continue;
|
|
69
|
+
try {
|
|
70
|
+
const parsed = new URL(url);
|
|
71
|
+
if (!['http:', 'https:'].includes(parsed.protocol) || parsed.username || parsed.password)
|
|
72
|
+
continue;
|
|
73
|
+
this.#resource = { id, base: `${parsed.origin}${parsed.pathname.replace(/\/$/, '')}`, site: parsed.host };
|
|
74
|
+
return id;
|
|
75
|
+
}
|
|
76
|
+
catch {
|
|
77
|
+
continue;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
throw new BoardError('no-site', 'No accessible Jira site was found');
|
|
81
|
+
}
|
|
82
|
+
async load(query) {
|
|
83
|
+
const id = await this.cloudId();
|
|
84
|
+
const fallback = 'updated >= -180d ORDER BY updated DESC';
|
|
85
|
+
let jql = query.jql?.trim() || fallback;
|
|
86
|
+
let retried = false;
|
|
87
|
+
let result;
|
|
88
|
+
for (;;) {
|
|
89
|
+
try {
|
|
90
|
+
result = obj(await this.#call(/searchJiraIssuesUsingJql/i, { cloudId: id, jql, maxResults: query.limit, fields: ['summary', 'status', 'issuetype', 'priority', 'assignee', 'reporter', 'updated', 'project'] }, query.timeoutMs));
|
|
91
|
+
break;
|
|
92
|
+
}
|
|
93
|
+
catch (error) {
|
|
94
|
+
if (!retried && jql !== fallback && /unbounded|unrestricted|add a search restriction/i.test(String(error))) {
|
|
95
|
+
retried = true;
|
|
96
|
+
jql = fallback;
|
|
97
|
+
continue;
|
|
98
|
+
}
|
|
99
|
+
throw error;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
const rows = Array.isArray(result['issues']) ? result['issues'] : [];
|
|
103
|
+
const issues = rows.map((value) => issue(value, this.#resource?.base)).filter((value) => !!value);
|
|
104
|
+
return { issues, constrained: retried, jql, site: this.#resource?.site, cloudId: id, truncated: result['isLast'] === false, limit: query.limit };
|
|
105
|
+
}
|
|
106
|
+
async detail(key, timeoutMs) {
|
|
107
|
+
const id = await this.cloudId();
|
|
108
|
+
const data = obj(await this.#call(/^getJiraIssue$/i, { cloudId: id, issueIdOrKey: key, responseContentFormat: 'markdown' }, timeoutMs));
|
|
109
|
+
const row = Array.isArray(data['issues']) ? data['issues'][0] : data;
|
|
110
|
+
const found = issue(row, this.#resource?.base);
|
|
111
|
+
if (!found)
|
|
112
|
+
throw new BoardError('not-found', `Issue ${key} was not found`);
|
|
113
|
+
return { issue: found, description: val(obj(obj(row)['fields'])['description']) ?? '' };
|
|
114
|
+
}
|
|
115
|
+
async transitions(key, timeoutMs) {
|
|
116
|
+
const id = await this.cloudId();
|
|
117
|
+
const data = obj(await this.#call(/getTransitionsForJiraIssue/i, { cloudId: id, issueIdOrKey: key }, timeoutMs));
|
|
118
|
+
const rows = Array.isArray(data['transitions']) ? data['transitions'] : [];
|
|
119
|
+
return rows.map((raw) => {
|
|
120
|
+
const row = obj(raw);
|
|
121
|
+
const target = obj(row['to']);
|
|
122
|
+
const category = obj(target['statusCategory']);
|
|
123
|
+
return { id: val(row['id']) ?? '', name: val(row['name']) ?? '', toName: val(target['name']) ?? val(row['name']) ?? '', toCategoryKey: val(category['key']) ?? 'undefined' };
|
|
124
|
+
}).filter((row) => row.id && row.name);
|
|
125
|
+
}
|
|
126
|
+
async transition(key, transitionId, timeoutMs) {
|
|
127
|
+
await this.#call(/^transitionJiraIssue$/i, { cloudId: await this.cloudId(), issueIdOrKey: key, transition: { id: transitionId } }, timeoutMs);
|
|
128
|
+
}
|
|
129
|
+
async projects(timeoutMs) {
|
|
130
|
+
const data = await this.#call(/getVisibleJiraProjects/i, { cloudId: await this.cloudId() }, timeoutMs);
|
|
131
|
+
const rows = Array.isArray(data) ? data : Array.isArray(obj(data)['values']) ? obj(data)['values'] : [];
|
|
132
|
+
return rows.map((raw) => { const row = obj(raw); return { key: val(row['key']) ?? '', name: val(row['name']) ?? val(row['key']) ?? '' }; }).filter((row) => row.key).sort((a, b) => a.key.localeCompare(b.key));
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
export function createBoard(bridge) { return new JiraBoard(bridge); }
|