@lornatang/dsh-atlassian 0.1.6 → 0.1.11
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 +31 -0
- package/README.md +153 -156
- package/README.zh.md +181 -0
- package/lib/board.js +21 -4
- package/lib/bridge.js +232 -32
- package/lib/client.js +57 -12
- package/lib/index.js +9 -2
- package/lib/oauth.js +96 -27
- package/lib/routes.js +36 -8
- package/lib/server-bridge.js +43 -25
- package/lib/server-http.js +10 -4
- package/lib/store.js +203 -34
- package/lib/types/board.d.ts +2 -0
- package/lib/types/bridge.d.ts +2 -1
- package/lib/types/oauth.d.ts +11 -1
- package/lib/types/server-bridge.d.ts +1 -0
- package/lib/types/server-http.d.ts +2 -0
- package/lib/types/store.d.ts +18 -2
- package/package.json +3 -1
package/lib/types/board.d.ts
CHANGED
package/lib/types/bridge.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ToolDefinition } from '@deepseek-ai/dsh-tools';
|
|
2
2
|
import { type Logger } from './oauth.js';
|
|
3
|
-
import type
|
|
3
|
+
import { type SessionStore } from './store.js';
|
|
4
4
|
export interface BridgeHost {
|
|
5
5
|
register(definition: ToolDefinition): () => void;
|
|
6
6
|
logger: Logger;
|
|
@@ -36,6 +36,7 @@ export declare function publicToolName(server: string, tool: string): string;
|
|
|
36
36
|
export declare class AtlassianBridge {
|
|
37
37
|
#private;
|
|
38
38
|
constructor(host: BridgeHost, options: BridgeOptions);
|
|
39
|
+
epoch(): number;
|
|
39
40
|
snapshot(): BridgeSnapshot;
|
|
40
41
|
rawNames(): readonly string[];
|
|
41
42
|
rawNameMatching(pattern: RegExp): string | undefined;
|
package/lib/types/oauth.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { OAuthClientProvider } from '@modelcontextprotocol/sdk/client/auth.js';
|
|
2
2
|
import type { FetchLike } from '@modelcontextprotocol/sdk/shared/transport.js';
|
|
3
3
|
import type { OAuthClientInformationMixed, OAuthClientMetadata, OAuthTokens } from '@modelcontextprotocol/sdk/shared/auth.js';
|
|
4
|
-
import type { SessionStore } from './store.js';
|
|
4
|
+
import type { SessionLease, SessionStore } from './store.js';
|
|
5
5
|
export interface Logger {
|
|
6
6
|
info(message: string): void;
|
|
7
7
|
warn(message: string): void;
|
|
@@ -11,6 +11,9 @@ export interface AuthorizationCallback {
|
|
|
11
11
|
code: string;
|
|
12
12
|
state: string | undefined;
|
|
13
13
|
}
|
|
14
|
+
export declare class RedirectRegistrationChanged extends Error {
|
|
15
|
+
}
|
|
16
|
+
export declare function secureUrl(url: URL, allowLoopbackHttp: boolean): void;
|
|
14
17
|
/** Restrict every discovered OAuth and MCP endpoint, including redirect targets. */
|
|
15
18
|
export declare function createCloudFetch(serverUrl: URL): {
|
|
16
19
|
fetch: FetchLike;
|
|
@@ -32,6 +35,13 @@ export declare class AtlassianOAuthProvider implements OAuthClientProvider {
|
|
|
32
35
|
onAuthorizationUrl: (url: string) => void;
|
|
33
36
|
allowLoopbackHttp: boolean;
|
|
34
37
|
logger: Logger;
|
|
38
|
+
active?: () => boolean;
|
|
39
|
+
tokenRead?: (tokens: OAuthTokens | undefined) => void;
|
|
40
|
+
refreshExpected?: () => OAuthTokens | undefined;
|
|
41
|
+
authFinished?: () => void;
|
|
42
|
+
lease?: () => SessionLease | undefined;
|
|
43
|
+
observedTokens?: () => OAuthTokens | undefined;
|
|
44
|
+
signal?: () => AbortSignal | undefined;
|
|
35
45
|
});
|
|
36
46
|
get redirectUrl(): string;
|
|
37
47
|
get clientMetadata(): OAuthClientMetadata;
|
|
@@ -14,6 +14,7 @@ export declare class ServerBridge {
|
|
|
14
14
|
snapshot(): BridgeSnapshot;
|
|
15
15
|
rawNames(): readonly string[];
|
|
16
16
|
rawNameMatching(pattern: RegExp): string | undefined;
|
|
17
|
+
epoch(): number;
|
|
17
18
|
start(): Promise<void>;
|
|
18
19
|
authorize(input?: Args): Promise<BridgeSnapshot>;
|
|
19
20
|
disconnect(): Promise<BridgeSnapshot>;
|
|
@@ -3,6 +3,8 @@ import type { ServerCredential } from './store.js';
|
|
|
3
3
|
export declare class ServerHttp {
|
|
4
4
|
#private;
|
|
5
5
|
constructor(base: string, credential: ServerCredential, caFile: string, allowInsecureHttp: boolean);
|
|
6
|
+
/** Release pooled sockets when the connection is replaced or torn down. */
|
|
7
|
+
close(): void;
|
|
6
8
|
get baseUrl(): string;
|
|
7
9
|
request(method: 'GET' | 'POST' | 'PUT', path: string, query?: Record<string, string | number | undefined>, body?: unknown, timeoutMs?: number, signal?: AbortSignal): Promise<unknown>;
|
|
8
10
|
}
|
package/lib/types/store.d.ts
CHANGED
|
@@ -16,6 +16,14 @@ export interface ServerCredentials {
|
|
|
16
16
|
jira?: ServerCredential;
|
|
17
17
|
confluence?: ServerCredential;
|
|
18
18
|
}
|
|
19
|
+
/** Compare the bearer and refresh credentials, not object identity across reloads. */
|
|
20
|
+
export declare function sameTokens(left: OAuthTokens | undefined, right: OAuthTokens | undefined): boolean;
|
|
21
|
+
export interface SessionLease {
|
|
22
|
+
readonly owner: SessionStore;
|
|
23
|
+
readonly active: boolean;
|
|
24
|
+
run<T>(work: () => Promise<T>): Promise<T>;
|
|
25
|
+
release(): void;
|
|
26
|
+
}
|
|
19
27
|
/** Keep credentials separate for each DSH profile and server. */
|
|
20
28
|
export declare function sessionFileFor(serverName: string, url: string, patchPath?: string): string;
|
|
21
29
|
/** Serialize state changes and replace the file only after a complete write. */
|
|
@@ -24,8 +32,16 @@ export declare class SessionStore {
|
|
|
24
32
|
constructor(file: string);
|
|
25
33
|
get file(): string;
|
|
26
34
|
get current(): StoredSession;
|
|
27
|
-
|
|
28
|
-
|
|
35
|
+
/** Hold an OS-backed lock across the complete OAuth refresh exchange. */
|
|
36
|
+
acquire(signal?: AbortSignal): Promise<SessionLease>;
|
|
37
|
+
load(signal?: AbortSignal): Promise<StoredSession>;
|
|
38
|
+
patch(patch: Partial<StoredSession>, active?: () => boolean, lease?: SessionLease, expected?: OAuthTokens, signal?: AbortSignal, guard?: boolean): Promise<void>;
|
|
39
|
+
/** A secondary process must not discard credentials merely because its callback port is busy. */
|
|
40
|
+
prepareRedirect(actual: string, signal?: AbortSignal): Promise<void>;
|
|
41
|
+
/** Re-register only when a new interactive flow needs a different callback. */
|
|
42
|
+
rebindRedirect(actual: string, expected: OAuthTokens | undefined, active: () => boolean, lease?: SessionLease, signal?: AbortSignal): Promise<void>;
|
|
43
|
+
saveTokens(tokens: OAuthTokens, active: () => boolean, expected?: OAuthTokens, lease?: SessionLease, signal?: AbortSignal, guard?: boolean): Promise<void>;
|
|
44
|
+
clearCredentialsIf(active: () => boolean, expected: OAuthTokens | undefined, lease: SessionLease | undefined, signal: AbortSignal | undefined, guard: boolean, ...fields: readonly (keyof StoredSession)[]): Promise<void>;
|
|
29
45
|
clear(...fields: readonly (keyof StoredSession)[]): Promise<void>;
|
|
30
46
|
destroy(): Promise<void>;
|
|
31
47
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lornatang/dsh-atlassian",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.11",
|
|
4
4
|
"description": "Connect Atlassian Cloud or self-hosted Jira and Confluence to DeepSeek Harness with tools and a Jira board.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"deepseek-harness",
|
|
@@ -31,12 +31,14 @@
|
|
|
31
31
|
"types": "./lib/types/client/index.d.ts",
|
|
32
32
|
"default": "./lib/client.js"
|
|
33
33
|
},
|
|
34
|
+
"./cordis.patch.yml": "./cordis.patch.yml",
|
|
34
35
|
"./package.json": "./package.json"
|
|
35
36
|
},
|
|
36
37
|
"files": [
|
|
37
38
|
"lib",
|
|
38
39
|
"cordis.patch.yml",
|
|
39
40
|
"README.md",
|
|
41
|
+
"README.zh.md",
|
|
40
42
|
"CHANGELOG.md",
|
|
41
43
|
"LICENSE",
|
|
42
44
|
"NOTICE"
|