@lornatang/dsh-atlassian 0.1.5 → 0.1.10
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 +22 -0
- package/README.md +153 -156
- package/README.zh.md +181 -0
- package/lib/bridge.js +193 -16
- package/lib/oauth.js +63 -16
- package/lib/store.js +203 -34
- package/lib/types/bridge.d.ts +1 -1
- package/lib/types/oauth.d.ts +11 -1
- package/lib/types/store.d.ts +18 -2
- package/package.json +4 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.10 - 2026-11-15
|
|
4
|
+
|
|
5
|
+
- Coordinate OAuth token rotation across processes sharing a profile, including delayed responses, shutdown, callback-port changes, and concurrent session updates.
|
|
6
|
+
- Include a GitHub release archive; npm is not published for this release.
|
|
7
|
+
|
|
8
|
+
## 0.1.8 - 2026-11-15
|
|
9
|
+
|
|
10
|
+
- Serialize rotating OAuth refreshes across concurrent MCP requests, preserve newer credentials after delayed responses, and cancel refreshes on disconnect.
|
|
11
|
+
- Include a GitHub release archive; npm is not published for this release.
|
|
12
|
+
|
|
13
|
+
## 0.1.7 - 2026-11-15
|
|
14
|
+
|
|
15
|
+
- Rewrite the README to the package-bundle documentation convention and add a
|
|
16
|
+
Chinese translation; the package now ships `README.md` and `README.zh.md`.
|
|
17
|
+
- Publish `cordis.patch.yml` through the package `exports` map and include the
|
|
18
|
+
Chinese README in the published files.
|
|
19
|
+
- Accept the bilingual language switcher in the documentation language check.
|
|
20
|
+
|
|
21
|
+
## 0.1.6
|
|
22
|
+
|
|
23
|
+
- Allow any DSH version in the package metadata and run integration checks against the selected host.
|
|
24
|
+
|
|
3
25
|
## 0.1.5
|
|
4
26
|
|
|
5
27
|
- Rename the package to `@lornatang/dsh-atlassian`, retaining existing profile
|
package/README.md
CHANGED
|
@@ -1,184 +1,181 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
description: "Atlassian Cloud OAuth and self-hosted Jira and Confluence REST inside a dsh profile: registered tools, an Atlassian settings section, and a Jira board panel."
|
|
3
|
+
kind: "package-bundle"
|
|
4
|
+
---
|
|
2
5
|
|
|
3
|
-
|
|
4
|
-
(DSH). The plugin exposes Atlassian tools to agent sessions and adds a Jira
|
|
5
|
-
board to the Web interface.
|
|
6
|
+
# @lornatang/dsh-atlassian
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
English | [中文](README.zh.md)
|
|
8
9
|
|
|
9
|
-
##
|
|
10
|
+
## Summary
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
`dsh-atlassian` connects a dsh profile to Atlassian Cloud or a self-hosted Jira and Confluence pair. Cloud mode holds an OAuth 2.1 session with the Atlassian remote MCP server and registers the tools it advertises for agent sessions; server mode registers a fixed REST tool set. It adds an Atlassian settings section and a Jira board panel to the Web client. Add or remove it with `dsh plugin --profile <name> add|remove @lornatang/dsh-atlassian`. The boundary: one connection per row, unencrypted credentials under the profile data directory, and a loopback OAuth callback.
|
|
13
|
+
|
|
14
|
+
## Table of Contents
|
|
15
|
+
|
|
16
|
+
- [Use this package](#use-this-package)
|
|
17
|
+
- [Understand the implementation](#understand-the-implementation)
|
|
18
|
+
- [Further Exploration](#further-exploration)
|
|
19
|
+
- [Model Experience](#model-experience)
|
|
20
|
+
- [Known Limitations and Deferred Work](#known-limitations-and-deferred-work)
|
|
21
|
+
- [Dev Note](#dev-note)
|
|
22
|
+
|
|
23
|
+
-----
|
|
24
|
+
|
|
25
|
+
<a id="use-this-package"></a>
|
|
26
|
+
## Use this package
|
|
14
27
|
|
|
15
|
-
|
|
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.
|
|
28
|
+
The layer owns the Atlassian half of a profile: the Cloud OAuth session or the self-hosted REST clients, the credentials behind them, the tools they register, and the settings and board surfaces that drive them. The dsh host keeps the tool registry, the Web server and the client slot system; this package registers into them.
|
|
18
29
|
|
|
19
|
-
|
|
20
|
-
package, remove the old package from the same profile, then restart DSH:
|
|
30
|
+
### Install into a profile
|
|
21
31
|
|
|
22
|
-
```
|
|
23
|
-
dsh plugin --profile
|
|
24
|
-
dsh plugin --profile
|
|
32
|
+
```text
|
|
33
|
+
dsh plugin --profile <name> add @lornatang/dsh-atlassian
|
|
34
|
+
dsh plugin --profile <name> remove @lornatang/dsh-atlassian
|
|
25
35
|
```
|
|
26
36
|
|
|
27
|
-
|
|
28
|
-
|
|
37
|
+
For the GitHub-only 0.1.10 release, use `dsh plugin --profile <name> add https://github.com/Lornatang/dsh-atlassian/releases/download/v0.1.10/lornatang-dsh-atlassian-0.1.10.tgz`. The npm registry version may be older.
|
|
38
|
+
|
|
39
|
+
`add` composes the layer into the profile: the profile's `cordis.patch.yml` gains an insert entry with row id `atlassian`, package `@lornatang/dsh-atlassian`, and the five values the shipped patch carries — `mode: cloud`, `serverName: atlassian`, `url: https://mcp.atlassian.com/v1/mcp`, `redirectPort: 3334` and `autoOpenBrowser: true`. The manifest declares `dsh.bundle.patch: ./cordis.patch.yml`, which is the declaration the reconcile step reads; `remove` deletes the entry again. Restart DSH after either command, because the profile composes its rows and its client half only at startup, then open Settings → Atlassian. Releases before 0.1.5 published this package as `@lornatang/dsh-atlassian-bridge`; add the scoped name, remove the old package from the same profile and restart once — the row, its settings and the stored credentials survive.
|
|
40
|
+
|
|
41
|
+
Cloud mode starts connecting as soon as the plugin loads. With no saved session the MCP client returns an authorization error, the callback server binds `127.0.0.1:3334`, and the Settings section shows `Authorization required` with the authorization URL as a link; the wait is bounded by `authorizationTimeoutMs` (300000 ms by default). Approving in the browser completes the exchange, the tools register and the status becomes `Connected`. If the wait expires the status becomes `Connection failed` with `authorization timed out`, and Connect starts a new attempt and opens the browser when `autoOpenBrowser` is true. A busy callback port falls back to a free one without discarding usable saved tokens; a new client registration is made if interactive authorization is later needed.
|
|
42
|
+
|
|
43
|
+
Processes sharing a profile coordinate credential updates using a persistent SQLite lock beside the credential file. Keep this lock file in place while any process is running, and use a filesystem with reliable SQLite locking. If a process crashes after the authorization server rotates a token but before the response is saved, a new authorization may be required.
|
|
44
|
+
|
|
45
|
+
Self-hosted mode starts connecting only when the store already holds credentials; otherwise the section shows the configured service URLs and one credential form per service and stays `Not connected`. Connect sends the username and password or token to the plugin, which checks `GET /rest/api/2/myself` on Jira and `GET /rest/api/user/current` on Confluence, saves the credentials to the profile store and registers the REST tools. Leave the username blank for a personal access token: the request then uses `Bearer <token>` instead of Basic authentication.
|
|
46
|
+
|
|
47
|
+
### What you get
|
|
29
48
|
|
|
30
|
-
|
|
31
|
-
names in the same profile. This community plugin is not an Atlassian or
|
|
32
|
-
DeepSeek product.
|
|
49
|
+
In Cloud mode the tool surface is the remote server's catalog: every tool returned by the MCP `tools/list` call is registered as `mcp__<serverName>__<name>`, so with the default `serverName` the names read `mcp__atlassian__getJiraIssue`, `mcp__atlassian__searchJiraIssuesUsingJql` and so on — this package does not define that list, and the Atlassian MCP server owns the definitions. `publicToolName` replaces characters outside `[A-Za-z0-9_-]` with `_`; a name that changed or exceeds 64 characters is cut to 51 characters and suffixed with `_` plus twelve hex characters of the SHA-256 hash of the original name. The layer owns registration, the `toolCallTimeoutMs` deadline and rendering: text blocks are joined, and any other content block becomes `[<type> content]`.
|
|
33
50
|
|
|
34
|
-
|
|
51
|
+
In self-hosted mode `src/server-bridge.ts` registers fourteen fixed operations under the same `mcp__atlassian__<name>` convention: `getAccessibleAtlassianResources`, `searchJiraIssuesUsingJql`, `getJiraIssue`, `getVisibleJiraProjects`, `getTransitionsForJiraIssue`, `transitionJiraIssue`, `createJiraIssue`, `editJiraIssue`, `addCommentToJiraIssue`, `searchConfluenceUsingCql`, `getConfluencePage`, `getConfluenceSpaces`, `createConfluencePage` and `updateConfluencePage`.
|
|
35
52
|
|
|
36
|
-
|
|
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.
|
|
53
|
+
The client half adds three rows, all owned and rendered by this package inside slots that the host supplies (`dsh.client.inject` names `@deepseek-ai/dsh-client-ui-slots` and `@deepseek-ai/dsh-client-ui-settings`):
|
|
42
54
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
your account access.
|
|
55
|
+
- `settings.section`, id `atlassian`, order 30, label `Atlassian` — connection status, tool count, service URLs, credential forms, Connect and Disconnect.
|
|
56
|
+
- `sidebar.panellist`, id `jira-board`, order 40, label `Jira` — the sidebar icon that opens the board.
|
|
57
|
+
- `main`, key `jira-board` — the board itself: search, project filter, JQL form, one column per issue status, issue detail with transition buttons, and Send to current session / Send to new session / Copy prompt.
|
|
47
58
|
|
|
48
|
-
The
|
|
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.
|
|
59
|
+
The routes behind those rows live at the fixed prefix `/plugins/atlassian` (`status`, `configure`, `connect`, `disconnect`, `debug-tools`, `board`, `projects`, `transition`, `issue/<key>`, `issue/<key>/transitions`). They answer only when the DSH `connection` service is present and its request fence admits the request; without the service the routes return 503.
|
|
51
60
|
|
|
52
|
-
|
|
61
|
+
### Configuration
|
|
53
62
|
|
|
54
|
-
|
|
55
|
-
`~/.dsh`) and add or edit the `atlassian` entry. Restart DSH after changes.
|
|
56
|
-
The default Cloud configuration is:
|
|
63
|
+
The profile patch carries an `atlassian` row. The shipped layer inserts it with Cloud defaults, so a profile only writes the values it changes:
|
|
57
64
|
|
|
58
65
|
```yaml
|
|
66
|
+
# $DSH_HOME/profiles/<name>/cordis.patch.yml
|
|
59
67
|
- id: atlassian
|
|
60
68
|
config:
|
|
61
|
-
|
|
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
|
+
expectedSite: example.atlassian.net
|
|
69
70
|
board:
|
|
70
|
-
jql: ''
|
|
71
|
-
limit:
|
|
72
|
-
|
|
73
|
-
promptTemplate: ''
|
|
71
|
+
jql: 'project = DEMO ORDER BY updated DESC'
|
|
72
|
+
limit: 25
|
|
73
|
+
promptTemplate: 'Work on Jira issue {{key}}: {{summary}}'
|
|
74
74
|
```
|
|
75
75
|
|
|
76
|
-
|
|
76
|
+
`Config` is a schemastery schema defined in `src/config.ts` and exported from `src/index.ts`, so the defaults and ranges below are schema constraints; the `serverName` pattern is checked when the credential file name is built. Every accepted field:
|
|
77
|
+
|
|
78
|
+
| Field | Default | Meaning |
|
|
77
79
|
| --- | --- | --- |
|
|
78
|
-
| `mode` | `cloud` |
|
|
79
|
-
| `serverName` | `atlassian` | Tool
|
|
80
|
-
| `url` |
|
|
81
|
-
| `redirectPort` | `3334` | Loopback OAuth callback port;
|
|
82
|
-
| `
|
|
83
|
-
| `
|
|
84
|
-
| `authorizationTimeoutMs` | `300000` |
|
|
85
|
-
| `autoOpenBrowser` | `true` | Open the
|
|
86
|
-
| `
|
|
87
|
-
| `
|
|
88
|
-
| `
|
|
89
|
-
|
|
90
|
-
`
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
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:
|
|
80
|
+
| `mode` | `cloud` | `cloud` connects to the Atlassian remote MCP server; `server` uses the self-hosted REST bridge. Saving service URLs in Settings derives this value. |
|
|
81
|
+
| `serverName` | `atlassian` | Tool-name prefix (`mcp__<serverName>__…`) and the identity inside the credential file name; `[A-Za-z0-9_-]`, 1–64 characters. |
|
|
82
|
+
| `url` | `https://mcp.atlassian.com/v1/mcp` | Cloud MCP endpoint. HTTPS is required unless the URL is loopback HTTP. |
|
|
83
|
+
| `redirectPort` | `3334` | Loopback OAuth callback port, 0–65535; `0` binds a free port. |
|
|
84
|
+
| `toolCallTimeoutMs` | `60000` | Deadline for one tool call, minimum 1. |
|
|
85
|
+
| `expectedSite` | empty | When set, the settings section warns if the authorized site host differs. |
|
|
86
|
+
| `authorizationTimeoutMs` | `300000` | How long the layer waits for the OAuth callback, minimum 1000. |
|
|
87
|
+
| `autoOpenBrowser` | `true` | Open the authorization page in the browser when an authorization is required. |
|
|
88
|
+
| `server.jiraUrl` | empty | Self-hosted Jira base URL; an empty value disables Jira. |
|
|
89
|
+
| `server.confluenceUrl` | empty | Self-hosted Confluence base URL; an empty value disables Confluence. |
|
|
90
|
+
| `server.jiraCaFile` | empty | Optional PEM trust file added to the Node.js root certificates for Jira. |
|
|
91
|
+
| `server.confluenceCaFile` | empty | Optional PEM trust file added to the Node.js root certificates for Confluence. |
|
|
92
|
+
| `server.allowInsecureHttp` | `false` | Permit plain `http:` service URLs; credentials then travel in plaintext. |
|
|
93
|
+
| `board.jql` | empty | Initial JQL; an empty value uses `updated >= -180d ORDER BY updated DESC`. |
|
|
94
|
+
| `board.limit` | `50` | Issues per board load, 1–100. |
|
|
95
|
+
| `board.timeoutMs` | `90000` | Deadline for one board request, minimum 1000. |
|
|
96
|
+
| `board.promptTemplate` | empty | Handoff text where `{{key}}` and `{{summary}}` are replaced; an empty value uses the built-in prompt. |
|
|
102
97
|
|
|
103
|
-
|
|
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
|
-
```
|
|
98
|
+
Service URLs go through the same validation when they are saved in Settings: the value must be an HTTP(S) base URL without credentials, query or fragment, the trailing slash is dropped, and the row's `mode` becomes `server` as soon as either URL is non-empty — clearing both returns it to `cloud` and restores the official endpoint. Credentials never come from the patch; self-hosted usernames and secrets are entered in Settings and stored by the profile store.
|
|
114
99
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
100
|
+
-----
|
|
101
|
+
|
|
102
|
+
<a id="understand-the-implementation"></a>
|
|
103
|
+
## Understand the implementation
|
|
104
|
+
|
|
105
|
+
<details>
|
|
106
|
+
<summary>Implementation internals — click to expand</summary>
|
|
107
|
+
|
|
108
|
+
The layer is a single patch row: an `insert` of `atlassian` carrying the Cloud defaults. The patch has no platform gate; the client half is declared in `package.json` (`dsh.client.platform: web`, with the two slot packages injected), so a headless profile loads the host half only and the settings and board rows appear in a Web profile.
|
|
109
|
+
|
|
110
|
+
`apply` selects the bridge from `mode` — `AtlassianBridge` for Cloud, `ServerBridge` for self-hosted — derives the credential identity (the configured URL for Cloud, `server:<jiraUrl>` and `<confluenceUrl>` joined by a NUL for self-hosted), builds a `SessionStore` for `sessionFileFor(serverName, identity, patchPath)`, creates the board, and registers the routes against `webServer` or `httpServer`. Every route sits behind the `connection` service's request fence; when the service appears after the plugin, an `internal/service` listener re-binds the routes. `void bridge.start()` runs in the background and logs failures.
|
|
111
|
+
|
|
112
|
+
The Cloud path uses OAuth 2.1 with PKCE through the MCP SDK: a callback server on `127.0.0.1:<redirectPort>` receives `/callback`, `createCloudFetch` rejects every non-HTTPS endpoint (loopback HTTP excepted) and caps response bodies and SSE events at 10 MiB, and after `connect` the bridge paginates `tools/list` (at most 100 pages and 1000 tools) and registers each definition. The site label comes from `getAccessibleAtlassianResources`.
|
|
113
|
+
|
|
114
|
+
The self-hosted path talks to one or two explicit REST endpoints over `node:https`: Basic authentication when a username exists, `Bearer` when only a secret is stored, and an optional additional CA with hostname and TLS verification still enabled. Responses are capped at 10 MiB, redirects and server error bodies are not followed or echoed, and the Jira and Confluence operations are fixed in `src/server-bridge.ts` — no discovery, resources or prompts.
|
|
115
|
+
|
|
116
|
+
The client half registers into `settings.section`, `sidebar.panellist` and `main`, polls `GET /status` every five seconds, and talks to the host only through `/plugins/atlassian`. Handoff reuses the client `sessions` service: the selected issues are rendered through `promptFor` (template with `{{key}}` and `{{summary}}`, or the built-in prompt) and queued into the current session or a newly connected workspace.
|
|
117
|
+
|
|
118
|
+
| Source | Contents |
|
|
119
|
+
| --- | --- |
|
|
120
|
+
| `cordis.patch.yml` | The layer itself: one insert entry, row id `atlassian`, Cloud defaults. |
|
|
121
|
+
| `src/index.ts` | `apply`: bridge selection, credential identity, tool host, route registration, background start. |
|
|
122
|
+
| `src/config.ts` | `Config` schema, defaults and `configureEndpoints` URL validation with mode derivation. |
|
|
123
|
+
| `src/bridge.ts` | Cloud MCP client, OAuth retry, tool naming, registration, calls and disconnect. |
|
|
124
|
+
| `src/server-bridge.ts` | Self-hosted bridge: credential checks, the fourteen REST operations and their tool definitions. |
|
|
125
|
+
| `src/server-http.ts` | One Jira or Confluence endpoint: Basic/Bearer headers, extra CA, timeouts, byte cap. |
|
|
126
|
+
| `src/oauth.ts` | PKCE provider, loopback callback server, HTTPS-only fetch wrapper, response size limits. |
|
|
127
|
+
| `src/store.ts` | Profile-scoped credential file: naming, ownership and symlink checks, atomic `0600` writes. |
|
|
128
|
+
| `src/board.ts` | `JiraBoard`: JQL search, site resolution, issue detail, transitions, projects. |
|
|
129
|
+
| `src/routes.ts` | `/plugins/atlassian` handlers behind the DSH request fence. |
|
|
130
|
+
| `src/open-url.ts` | Browser launch for the authorization page, HTTPS or loopback HTTP only. |
|
|
131
|
+
| `src/client/index.tsx` | Settings section, sidebar entry and board panel; calls the routes above. |
|
|
132
|
+
| `tests/*.test.mjs` | Bridge, configuration, security, server and browser suites. |
|
|
133
|
+
|
|
134
|
+
</details>
|
|
135
|
+
|
|
136
|
+
-----
|
|
137
|
+
|
|
138
|
+
<a id="further-exploration"></a>
|
|
139
|
+
## Further Exploration
|
|
140
|
+
|
|
141
|
+
- [CHANGELOG.md](CHANGELOG.md) — release history, including the 0.1.5 rename and the 0.1.6 DSH version range.
|
|
142
|
+
- [LICENSE](LICENSE) — Apache-2.0.
|
|
143
|
+
- [NOTICE](NOTICE) — attribution notice shipped with the package.
|
|
144
|
+
- [DeepSeek Harness configuration catalog](https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/config-catalog.md) — the deployment reference this row's `config` block follows.
|
|
145
|
+
|
|
146
|
+
-----
|
|
147
|
+
|
|
148
|
+
<a id="model-experience"></a>
|
|
149
|
+
## Model Experience
|
|
150
|
+
|
|
151
|
+
Indirectly, through the tool registry: once a connection is established the layer registers each Atlassian tool definition, so the tool's name, description and input schema reach the model as part of the request's tool list.
|
|
152
|
+
|
|
153
|
+
#### KV Cache effect
|
|
154
|
+
|
|
155
|
+
The tool list is part of the cached request prefix, so activation changes it: a disconnected profile sends no Atlassian tools, and a connected one sends every registered definition. In Cloud mode those definitions come from the remote `tools/list` response, so a catalog change on Atlassian's side changes the prefix at the next connection; the self-hosted set is fixed. The settings section and the board run over HTTP routes and add nothing to the request.
|
|
156
|
+
|
|
157
|
+
<a id="known-limitations-and-deferred-work"></a>
|
|
158
|
+
## Known Limitations and Deferred Work
|
|
159
|
+
|
|
160
|
+
These constraints describe what the layer does not bridge and where a profile has to work around it.
|
|
161
|
+
|
|
162
|
+
- **One connection per row** — one bridge instance and the fixed `/plugins/atlassian` route prefix mean the layer assumes one Cloud site or one self-hosted Jira/Confluence pair per profile; a second site needs a separate profile. The board additionally binds the first accessible resource and caches it for the process lifetime.
|
|
163
|
+
- **Self-hosted mode is a fixed subset** — it exposes the fourteen REST operations above instead of the Cloud MCP catalog, Confluence pages are storage-format XHTML, and an update must carry the current page version, which the layer reads immediately before writing.
|
|
164
|
+
- **Credentials are stored unencrypted** — one JSON file per profile and connection under `profiles/<name>/data/`, mode `0600` on POSIX with symlink and ownership checks; on Windows the profile directory ACL is the only protection, and a backup of that directory exposes the tokens.
|
|
165
|
+
- **The OAuth callback must stay reachable** — the browser and DSH must share the loopback host, and a DSH on another machine needs `redirectPort` forwarded to it. A busy port falls back to an ephemeral one, which clears the saved client registration, tokens and verifier and forces a new authorization.
|
|
166
|
+
- **Cloud endpoints must be HTTPS** — `createCloudFetch` rejects any non-HTTPS URL, including redirect targets, except a loopback `http:` MCP URL, so a plain-http endpoint on a remote host is refused.
|
|
167
|
+
- **Non-text tool output becomes placeholders** — content blocks other than text render as `[<type> content]`, and MCP resources and prompts are not bridged, so an attachment or image result reaches the model as a placeholder string.
|
|
168
|
+
- **Board loading is demand-driven** — the settings section polls `/status` every five seconds, but the board runs one JQL search per load (connect, search, refresh or transition), returns at most `board.limit` issues (1–100), and retries an unrestricted query once as `updated >= -180d ORDER BY updated DESC`.
|
|
169
|
+
- **Disconnect is local** — it deletes the stored credentials and unregisters the tools, but it does not revoke the grant at Atlassian; revoke that in the Atlassian account settings.
|
|
170
|
+
|
|
171
|
+
<a id="dev-note"></a>
|
|
172
|
+
### Dev Note
|
|
173
|
+
|
|
174
|
+
<details>
|
|
175
|
+
<summary>Working context for maintainers — click to expand</summary>
|
|
176
|
+
|
|
177
|
+
`npm run build` cleans `lib/`, compiles the host and client trees with `tsc`, then bundles `src/client/index.tsx` into `lib/client.js` with `scripts/bundle-client.mjs`. `npm test` runs that build and then `node --test tests/*.test.mjs`, which includes the Chrome-backed browser suite; `npm run typecheck` runs both `tsc --noEmit` passes. `npm run test:dsh` runs `scripts/verify-dsh.mjs`, which packs the plugin with `npm pack` and drives a real `dsh` binary (default `dsh`, overridable with `DSH_TEST_BINARY`) through profile creation, `plugin add`, the authenticated Web route, a self-hosted connect, a board load and `plugin remove`, then runs the browser check. The environment variables the script reads are `DSH_TEST_BINARY`, `DSH_TEST_MODE=server`, `DSH_TEST_UPGRADE_FROM=legacy-fixture`, `DSH_TEST_LANGUAGE` and `CHROME_PATH`.
|
|
179
178
|
|
|
180
|
-
|
|
181
|
-
Otherwise, remove the corresponding `data/atlassian-bridge-*.json` file from
|
|
182
|
-
the stopped profile manually.
|
|
179
|
+
`lib/` is committed and CI runs `git diff --exit-code -- lib`, so rebuild and include `lib/` with any source change. Node.js 22.19 or newer is required (`engines.node`), the peer dependency is `@deepseek-ai/cordis ~4.1.0`, and the optional `dsh-tools`/`dsh-llm` development dependencies track the `0.2.2-rc.2` DSH line. The stored file is `data/atlassian-bridge-<serverName>-<first 12 hex of sha256(identity)>.json` with `version: 1`; changing the identity computation or the file naming orphans saved credentials. `tests/language.test.mjs` scans `README.md`, `CHANGELOG.md`, `NOTICE`, `src/` and `lib/` for CJK characters, so English text belongs in `README.md` and Chinese only in `README.zh.md`.
|
|
183
180
|
|
|
184
|
-
|
|
181
|
+
</details>
|
package/README.zh.md
ADDED
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "在 dsh profile 中接入 Atlassian Cloud OAuth 与自建 Jira、Confluence REST:注册工具、Atlassian 设置区与 Jira 看板面板。"
|
|
3
|
+
kind: "package-bundle"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# @lornatang/dsh-atlassian
|
|
7
|
+
|
|
8
|
+
[English](README.md) | 中文
|
|
9
|
+
|
|
10
|
+
## 概要
|
|
11
|
+
|
|
12
|
+
`dsh-atlassian` 将 dsh profile 连接到 Atlassian Cloud,或连接到一对自建 Jira、Confluence 服务。Cloud 模式与 Atlassian 远程 MCP 服务器保持 OAuth 2.1 会话,并把它向 agent 会话公布的每个工具注册进来;server 模式注册一组固定的 REST 工具。它会在 Web 客户端中加入 Atlassian 设置区与 Jira 看板面板。安装或移除使用 `dsh plugin --profile <name> add|remove @lornatang/dsh-atlassian`。边界:每行一个连接,凭据以未加密形式存放在 profile 数据目录下,OAuth 回调走回环地址。
|
|
13
|
+
|
|
14
|
+
## 目录
|
|
15
|
+
|
|
16
|
+
- [使用本包](#use-this-package)
|
|
17
|
+
- [理解实现](#understand-the-implementation)
|
|
18
|
+
- [延伸阅读](#further-exploration)
|
|
19
|
+
- [模型体验](#model-experience)
|
|
20
|
+
- [已知限制与后续工作](#known-limitations-and-deferred-work)
|
|
21
|
+
- [开发者注记](#dev-note)
|
|
22
|
+
|
|
23
|
+
-----
|
|
24
|
+
|
|
25
|
+
<a id="use-this-package"></a>
|
|
26
|
+
## 使用本包
|
|
27
|
+
|
|
28
|
+
本层负责 profile 中属于 Atlassian 的那一半:Cloud 的 OAuth 会话或自建服务的 REST 客户端、其背后的凭据、它们注册的工具,以及驱动这些能力的设置区与看板。工具注册表、Web 服务器与客户端 slot 系统仍由 dsh 宿主提供,本包只是注册进去。
|
|
29
|
+
|
|
30
|
+
### 安装到 profile
|
|
31
|
+
|
|
32
|
+
```text
|
|
33
|
+
dsh plugin --profile <name> add @lornatang/dsh-atlassian
|
|
34
|
+
dsh plugin --profile <name> remove @lornatang/dsh-atlassian
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
安装仅发布到 GitHub 的 0.1.10 版本,请运行 `dsh plugin --profile <name> add https://github.com/Lornatang/dsh-atlassian/releases/download/v0.1.10/lornatang-dsh-atlassian-0.1.10.tgz`。npm 仓库中的版本可能较旧。
|
|
38
|
+
|
|
39
|
+
`add` 会把本层组合进 profile:profile 的 `cordis.patch.yml` 会增加一条 insert 记录,行 id 为 `atlassian`,包名为 `@lornatang/dsh-atlassian`,并带上随包提供的补丁中的五个值——`mode: cloud`、`serverName: atlassian`、`url: https://mcp.atlassian.com/v1/mcp`、`redirectPort: 3334` 与 `autoOpenBrowser: true`。包的 manifest 声明了 `dsh.bundle.patch: ./cordis.patch.yml`,reconcile 步骤读取的正是这条声明;`remove` 会再次删除该记录。两条命令执行后都要重启 DSH,因为 profile 只在启动时组合自己的行与客户端部分,随后打开 Settings → Atlassian。0.1.5 之前的版本以 `@lornatang/dsh-atlassian-bridge` 发布;添加带作用域的新名称、从同一 profile 删除旧包、重启一次即可——行、其设置与已保存的凭据都会保留。
|
|
40
|
+
|
|
41
|
+
Cloud 模式在插件加载后立即开始连接。没有已保存会话时,MCP 客户端会返回授权错误,回调服务器绑定 `127.0.0.1:3334`,设置区显示 `Authorization required` 并给出授权链接;等待时间由 `authorizationTimeoutMs` 限制(默认 300000 毫秒)。在浏览器中批准后完成交换,工具完成注册,状态变为 `Connected`。若等待超时,状态变为 `Connection failed` 并带有 `authorization timed out`,此时点击 Connect 会重新尝试,并在 `autoOpenBrowser` 为 true 时打开浏览器。回调端口被占用时会回退到空闲端口并保留可用令牌,之后需要交互式授权时会重新注册客户端。
|
|
42
|
+
|
|
43
|
+
共享同一 profile 的进程使用凭据文件旁的持久 SQLite 锁协调更新。进程运行时请保留该锁文件,并使用支持可靠 SQLite 锁的文件系统。如果进程在授权服务器轮换令牌后、保存响应前退出,可能需要重新授权。
|
|
44
|
+
|
|
45
|
+
自建模式只在存储中已有凭据时才主动连接;否则设置区显示已配置的服务 URL 与每个服务一张凭据表单,状态保持 `Not connected`。Connect 会把用户名和密码或令牌交给插件,插件用 Jira 的 `GET /rest/api/2/myself` 与 Confluence 的 `GET /rest/api/user/current` 校验,将凭据写入 profile 存储并注册 REST 工具。使用个人访问令牌时把用户名留空:请求改用 `Bearer <token>` 而不是 Basic 认证。
|
|
46
|
+
|
|
47
|
+
### 你将获得
|
|
48
|
+
|
|
49
|
+
Cloud 模式下工具面来自远程服务器的目录:MCP `tools/list` 返回的每个工具都以 `mcp__<serverName>__<name>` 注册,因此在默认 `serverName` 下名称形如 `mcp__atlassian__getJiraIssue`、`mcp__atlassian__searchJiraIssuesUsingJql`;该清单由本包之外的 Atlassian MCP 服务器定义。`publicToolName` 会把 `[A-Za-z0-9_-]` 之外的字符替换为 `_`;名称发生变化或超过 64 个字符时,会截到 51 个字符并追加 `_` 与原始名称 SHA-256 哈希的十二个十六进制字符。本层负责注册、`toolCallTimeoutMs` 时限与渲染:文本块会被拼接,其余内容块渲染为 `[<type> content]`。
|
|
50
|
+
|
|
51
|
+
自建模式下 `src/server-bridge.ts` 以同样的 `mcp__atlassian__<name>` 约定注册十四个固定操作:`getAccessibleAtlassianResources`、`searchJiraIssuesUsingJql`、`getJiraIssue`、`getVisibleJiraProjects`、`getTransitionsForJiraIssue`、`transitionJiraIssue`、`createJiraIssue`、`editJiraIssue`、`addCommentToJiraIssue`、`searchConfluenceUsingCql`、`getConfluencePage`、`getConfluenceSpaces`、`createConfluencePage` 与 `updateConfluencePage`。
|
|
52
|
+
|
|
53
|
+
客户端部分增加三行,均由本包实现并渲染,挂载到宿主提供的 slot 中(`dsh.client.inject` 指定 `@deepseek-ai/dsh-client-ui-slots` 与 `@deepseek-ai/dsh-client-ui-settings`):
|
|
54
|
+
|
|
55
|
+
- `settings.section`,id `atlassian`,order 30,label `Atlassian`——连接状态、工具数量、服务 URL、凭据表单、Connect 与 Disconnect。
|
|
56
|
+
- `sidebar.panellist`,id `jira-board`,order 40,label `Jira`——打开看板的侧边栏图标。
|
|
57
|
+
- `main`,key `jira-board`——看板本身:搜索、项目过滤、JQL 表单、按 issue 状态分列、带流转按钮的 issue 详情,以及 Send to current session / Send to new session / Copy prompt。
|
|
58
|
+
|
|
59
|
+
这些行背后的路由位于固定前缀 `/plugins/atlassian`(`status`、`configure`、`connect`、`disconnect`、`debug-tools`、`board`、`projects`、`transition`、`issue/<key>`、`issue/<key>/transitions`)。只有在 DSH `connection` 服务存在且其请求栅栏放行时它们才响应;没有该服务时路由返回 503。
|
|
60
|
+
|
|
61
|
+
### 配置
|
|
62
|
+
|
|
63
|
+
profile 补丁中有一条 `atlassian` 记录。随包提供的层以 Cloud 默认值插入该记录,因此 profile 只需写出要改的值:
|
|
64
|
+
|
|
65
|
+
```yaml
|
|
66
|
+
# $DSH_HOME/profiles/<name>/cordis.patch.yml
|
|
67
|
+
- id: atlassian
|
|
68
|
+
config:
|
|
69
|
+
expectedSite: example.atlassian.net
|
|
70
|
+
board:
|
|
71
|
+
jql: 'project = DEMO ORDER BY updated DESC'
|
|
72
|
+
limit: 25
|
|
73
|
+
promptTemplate: 'Work on Jira issue {{key}}: {{summary}}'
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
`Config` 是定义在 `src/config.ts`、由 `src/index.ts` 导出的 schemastery schema,因此下表中的默认值与范围是 schema 约束;`serverName` 的字符模式在构造凭据文件名时校验。全部可用字段:
|
|
77
|
+
|
|
78
|
+
| 字段 | 默认值 | 含义 |
|
|
79
|
+
| --- | --- | --- |
|
|
80
|
+
| `mode` | `cloud` | `cloud` 连接 Atlassian 远程 MCP 服务器;`server` 使用自建 REST 桥接。在 Settings 中保存服务 URL 会推导该值。 |
|
|
81
|
+
| `serverName` | `atlassian` | 工具名前缀(`mcp__<serverName>__…`)与凭据文件名中的身份标识;`[A-Za-z0-9_-]`,1–64 个字符。 |
|
|
82
|
+
| `url` | `https://mcp.atlassian.com/v1/mcp` | Cloud MCP 端点。除回环 HTTP 外必须使用 HTTPS。 |
|
|
83
|
+
| `redirectPort` | `3334` | 回环 OAuth 回调端口,0–65535;`0` 表示绑定空闲端口。 |
|
|
84
|
+
| `toolCallTimeoutMs` | `60000` | 单次工具调用的时限,最小 1。 |
|
|
85
|
+
| `expectedSite` | 空 | 设置后,若授权的站点主机与之不符,设置区给出警告。 |
|
|
86
|
+
| `authorizationTimeoutMs` | `300000` | 等待 OAuth 回调的时长,最小 1000。 |
|
|
87
|
+
| `autoOpenBrowser` | `true` | 需要授权时在浏览器中打开授权页面。 |
|
|
88
|
+
| `server.jiraUrl` | 空 | 自建 Jira 基础 URL;为空表示不启用 Jira。 |
|
|
89
|
+
| `server.confluenceUrl` | 空 | 自建 Confluence 基础 URL;为空表示不启用 Confluence。 |
|
|
90
|
+
| `server.jiraCaFile` | 空 | 可选的 PEM 信任文件,追加到 Jira 使用的 Node.js 根证书中。 |
|
|
91
|
+
| `server.confluenceCaFile` | 空 | 可选的 PEM 信任文件,追加到 Confluence 使用的 Node.js 根证书中。 |
|
|
92
|
+
| `server.allowInsecureHttp` | `false` | 允许明文 `http:` 服务 URL;凭据会以明文传输。 |
|
|
93
|
+
| `board.jql` | 空 | 初始 JQL;为空时使用 `updated >= -180d ORDER BY updated DESC`。 |
|
|
94
|
+
| `board.limit` | `50` | 每次加载看板的 issue 数量,1–100。 |
|
|
95
|
+
| `board.timeoutMs` | `90000` | 单次看板请求的时限,最小 1000。 |
|
|
96
|
+
| `board.promptTemplate` | 空 | 交接文本,其中 `{{key}}` 与 `{{summary}}` 会被替换;为空时使用内置提示。 |
|
|
97
|
+
|
|
98
|
+
在 Settings 中保存服务 URL 时会经过同样的校验:值必须是不含凭据、query 或 fragment 的 HTTP(S) 基础 URL,末尾斜杠会被去掉,只要任一 URL 非空,该行的 `mode` 就变为 `server`——两者都清空则回到 `cloud` 并恢复官方端点。凭据从不来自补丁;自建服务的用户名与密钥在 Settings 中输入并由 profile 存储保管。
|
|
99
|
+
|
|
100
|
+
-----
|
|
101
|
+
|
|
102
|
+
<a id="understand-the-implementation"></a>
|
|
103
|
+
## 理解实现
|
|
104
|
+
|
|
105
|
+
<details>
|
|
106
|
+
<summary>实现内幕 — 点击展开</summary>
|
|
107
|
+
|
|
108
|
+
本层只有一条补丁记录:一个插入 `atlassian` 的 `insert`,并带上 Cloud 默认值。补丁没有平台门控;客户端部分在 `package.json` 中声明(`dsh.client.platform: web`,并注入两个 slot 包),因此无界面 profile 只加载宿主部分,设置区与看板行只出现在 Web profile 中。
|
|
109
|
+
|
|
110
|
+
`apply` 按 `mode` 选择桥接——Cloud 用 `AtlassianBridge`,自建用 `ServerBridge`——推导凭据身份(Cloud 为配置的 URL,自建为 `server:<jiraUrl>` 与 `<confluenceUrl>` 用 NUL 连接),用 `sessionFileFor(serverName, identity, patchPath)` 构造 `SessionStore`,创建看板,并把路由注册到 `webServer` 或 `httpServer`。所有路由都在 `connection` 服务的请求栅栏之后;若该服务在插件之后出现,`internal/service` 监听器会重新绑定路由。`void bridge.start()` 在后台运行并记录失败。
|
|
111
|
+
|
|
112
|
+
Cloud 路径通过 MCP SDK 使用带 PKCE 的 OAuth 2.1:`127.0.0.1:<redirectPort>` 上的回调服务器接收 `/callback`,`createCloudFetch` 拒绝所有非 HTTPS 端点(回环 HTTP 除外),并把响应体与 SSE 事件限制在 10 MiB;`connect` 之后桥接会分页读取 `tools/list`(最多 100 页、1000 个工具)并注册每个定义。站点标签来自 `getAccessibleAtlassianResources`。
|
|
113
|
+
|
|
114
|
+
自建路径通过 `node:https` 与一两个显式 REST 端点通信:有用户名时使用 Basic 认证,只存了密钥时使用 `Bearer`,可选追加 CA,同时保留主机名与 TLS 校验。响应上限 10 MiB,不跟随重定向、不回显服务器错误体,Jira 与 Confluence 的操作固定在 `src/server-bridge.ts` 中——没有发现、资源或提示词桥接。
|
|
115
|
+
|
|
116
|
+
客户端部分注册进 `settings.section`、`sidebar.panellist` 与 `main`,每五秒轮询 `GET /status`,并且只通过 `/plugins/atlassian` 与宿主通信。交接复用客户端的 `sessions` 服务:选中的 issue 经 `promptFor` 渲染(有 `{{key}}` 与 `{{summary}}` 的模板,或内置提示),再排入当前会话或新连接的工作区。
|
|
117
|
+
|
|
118
|
+
| 源文件 | 内容 |
|
|
119
|
+
| --- | --- |
|
|
120
|
+
| `cordis.patch.yml` | 本层本身:一条 insert 记录,行 id `atlassian`,Cloud 默认值。 |
|
|
121
|
+
| `src/index.ts` | `apply`:选择桥接、凭据身份、工具宿主、路由注册、后台启动。 |
|
|
122
|
+
| `src/config.ts` | `Config` schema、默认值与 `configureEndpoints` 的 URL 校验和模式推导。 |
|
|
123
|
+
| `src/bridge.ts` | Cloud MCP 客户端、OAuth 重试、工具命名、注册、调用与断开。 |
|
|
124
|
+
| `src/server-bridge.ts` | 自建桥接:凭据校验、十四个 REST 操作及其工具定义。 |
|
|
125
|
+
| `src/server-http.ts` | 单个 Jira 或 Confluence 端点:Basic/Bearer 头、附加 CA、超时、字节上限。 |
|
|
126
|
+
| `src/oauth.ts` | PKCE provider、回环回调服务器、仅 HTTPS 的 fetch 包装、响应大小限制。 |
|
|
127
|
+
| `src/store.ts` | profile 范围的凭据文件:命名、属主与符号链接检查、原子 `0600` 写入。 |
|
|
128
|
+
| `src/board.ts` | `JiraBoard`:JQL 搜索、站点解析、issue 详情、流转、项目。 |
|
|
129
|
+
| `src/routes.ts` | DSH 请求栅栏之后的 `/plugins/atlassian` 处理器。 |
|
|
130
|
+
| `src/open-url.ts` | 授权页面的浏览器启动,仅 HTTPS 或回环 HTTP。 |
|
|
131
|
+
| `src/client/index.tsx` | 设置区、侧边栏入口与看板面板;调用上面的路由。 |
|
|
132
|
+
| `tests/*.test.mjs` | 桥接、配置、安全、服务端与浏览器测试套件。 |
|
|
133
|
+
|
|
134
|
+
</details>
|
|
135
|
+
|
|
136
|
+
-----
|
|
137
|
+
|
|
138
|
+
<a id="further-exploration"></a>
|
|
139
|
+
## 延伸阅读
|
|
140
|
+
|
|
141
|
+
- [CHANGELOG.md](CHANGELOG.md)——发布历史,包括 0.1.5 的改名与 0.1.6 的 DSH 版本范围。
|
|
142
|
+
- [LICENSE](LICENSE)——Apache-2.0。
|
|
143
|
+
- [NOTICE](NOTICE)——随包分发的归属声明。
|
|
144
|
+
- [DeepSeek Harness 配置目录](https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/config-catalog.md)——本行 `config` 块遵循的部署参考。
|
|
145
|
+
|
|
146
|
+
-----
|
|
147
|
+
|
|
148
|
+
<a id="model-experience"></a>
|
|
149
|
+
## 模型体验
|
|
150
|
+
|
|
151
|
+
间接地,通过工具注册表:连接建立后,本层注册每个 Atlassian 工具定义,因此工具的名称、描述与输入 schema 作为请求工具列表的一部分到达模型。
|
|
152
|
+
|
|
153
|
+
#### KV 缓存影响
|
|
154
|
+
|
|
155
|
+
工具列表是请求缓存前缀的一部分,因此激活会改变它:未连接的 profile 不发送 Atlassian 工具,已连接则发送所有已注册定义。Cloud 模式下这些定义来自远程 `tools/list` 响应,因此 Atlassian 一侧的目录变化会在下次连接时改变前缀;自建模式的定义固定。设置区与看板通过 HTTP 路由工作,不向请求添加任何内容。
|
|
156
|
+
|
|
157
|
+
<a id="known-limitations-and-deferred-work"></a>
|
|
158
|
+
## 已知限制与后续工作
|
|
159
|
+
|
|
160
|
+
以下约束说明本层没有桥接什么,以及 profile 需要在哪些地方绕行。
|
|
161
|
+
|
|
162
|
+
- **每行一个连接**——一个桥接实例加上固定的 `/plugins/atlassian` 路由前缀,意味着本层假定每个 profile 只有一个 Cloud 站点或一对自建 Jira/Confluence 服务;第二个站点需要单独的 profile。看板还会绑定第一个可访问资源,并在进程生命周期内缓存它。
|
|
163
|
+
- **自建模式是固定子集**——它提供上面十四个 REST 操作而不是 Cloud 的 MCP 目录,Confluence 页面是 storage 格式 XHTML,更新必须带上当前页面版本,本层会在写入前立即读取该版本。
|
|
164
|
+
- **凭据以未加密形式存储**——每个 profile 与连接一个 JSON 文件,位于 `profiles/<name>/data/` 下,POSIX 上权限为 `0600` 并做符号链接与属主检查;Windows 上只依赖 profile 目录的 ACL,备份该目录即泄露令牌。
|
|
165
|
+
- **OAuth 回调必须可达**——浏览器与 DSH 必须共享回环主机,另一台机器上的 DSH 需要把 `redirectPort` 转发过去。端口被占用时会回退到临时端口,这会清除已保存的客户端注册、令牌与 verifier,并强制重新授权。
|
|
166
|
+
- **Cloud 端点必须是 HTTPS**——`createCloudFetch` 拒绝任何非 HTTPS URL(包括重定向目标),只有回环 `http:` MCP URL 例外,因此远程主机上的明文端点会被拒绝。
|
|
167
|
+
- **非文本工具输出变成占位符**——文本之外的内容块渲染为 `[<type> content]`,MCP 资源与提示词没有桥接,因此附件或图片结果以占位字符串到达模型。
|
|
168
|
+
- **看板加载按需触发**——设置区每五秒轮询 `/status`,但看板每次加载只执行一次 JQL 搜索(连接、搜索、刷新或流转),最多返回 `board.limit` 个 issue(1–100),无限制查询会以 `updated >= -180d ORDER BY updated DESC` 重试一次。
|
|
169
|
+
- **Disconnect 只在本地生效**——它会删除已保存的凭据并注销工具,但不会在 Atlassian 侧撤销授权;请到 Atlassian 账户设置中撤销。
|
|
170
|
+
|
|
171
|
+
<a id="dev-note"></a>
|
|
172
|
+
### 开发者注记
|
|
173
|
+
|
|
174
|
+
<details>
|
|
175
|
+
<summary>维护者工作上下文 — 点击展开</summary>
|
|
176
|
+
|
|
177
|
+
`npm run build` 清理 `lib/`,用 `tsc` 编译宿主与客户端两个树,再用 `scripts/bundle-client.mjs` 把 `src/client/index.tsx` 打包成 `lib/client.js`。`npm test` 先执行该构建,再执行 `node --test tests/*.test.mjs`,其中包含依赖 Chrome 的浏览器套件;`npm run typecheck` 执行两次 `tsc --noEmit`。`npm run test:dsh` 执行 `scripts/verify-dsh.mjs`:用 `npm pack` 打包插件,并驱动真实的 `dsh` 二进制(默认 `dsh`,可用 `DSH_TEST_BINARY` 覆盖)依次完成创建 profile、`plugin add`、带认证的 Web 路由请求、自建连接、看板加载与 `plugin remove`,最后执行浏览器检查。脚本读取的环境变量是 `DSH_TEST_BINARY`、`DSH_TEST_MODE=server`、`DSH_TEST_UPGRADE_FROM=legacy-fixture`、`DSH_TEST_LANGUAGE` 与 `CHROME_PATH`。
|
|
178
|
+
|
|
179
|
+
`lib/` 已提交,CI 会执行 `git diff --exit-code -- lib`,因此任何源码改动都要重新构建并一并提交 `lib/`。需要 Node.js 22.19 或更新版本(`engines.node`),peer 依赖是 `@deepseek-ai/cordis ~4.1.0`,可选的 `dsh-tools`/`dsh-llm` 开发依赖跟随 `0.2.2-rc.2` 的 DSH 版本线。存储文件为 `data/atlassian-bridge-<serverName>-<sha256(identity) 前 12 个十六进制字符>.json`,内容带 `version: 1`;修改身份计算或文件命名会让已保存的凭据失配。`tests/language.test.mjs` 会扫描 `README.md`、`CHANGELOG.md`、`NOTICE`、`src/` 与 `lib/` 中的 CJK 字符,因此英文写在 `README.md`,中文只能放在 `README.zh.md`。
|
|
180
|
+
|
|
181
|
+
</details>
|