@cliangdev/flux-plugin 0.3.1-dev.8c219d5 → 0.3.1-dev.bc52ef7
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/package.json +1 -1
- package/src/server/adapters/github/__tests__/criteria-deps.test.ts +1 -1
- package/src/server/adapters/github/__tests__/prd-crud.test.ts +8 -8
- package/src/server/adapters/github/adapter.ts +110 -88
- package/src/server/adapters/github/client.ts +4 -3
- package/src/server/adapters/github/helpers/index-store.ts +11 -7
- package/src/server/adapters/linear/adapter.ts +121 -105
- package/src/server/adapters/linear/client.ts +21 -14
- package/src/server/tools/__tests__/z-configure-github.test.ts +14 -10
- package/src/server/tools/__tests__/z-get-linear-url.test.ts +2 -2
- package/src/server/tools/configure-github.ts +20 -9
|
@@ -49,7 +49,7 @@ describe("get_linear_url MCP Tool", () => {
|
|
|
49
49
|
test("returns URL for project ref", async () => {
|
|
50
50
|
// Get the adapter and mock its getLinearUrl method
|
|
51
51
|
const adapter = getAdapter() as any;
|
|
52
|
-
adapter.getLinearUrl = mock(async (
|
|
52
|
+
adapter.getLinearUrl = mock(async (_ref: string) => ({
|
|
53
53
|
url: "https://linear.app/myteam/project/my-project-abc123",
|
|
54
54
|
type: "project",
|
|
55
55
|
name: "My Project",
|
|
@@ -69,7 +69,7 @@ describe("get_linear_url MCP Tool", () => {
|
|
|
69
69
|
test("returns URL for issue identifier", async () => {
|
|
70
70
|
// Get the adapter and mock its getLinearUrl method
|
|
71
71
|
const adapter = getAdapter() as any;
|
|
72
|
-
adapter.getLinearUrl = mock(async (
|
|
72
|
+
adapter.getLinearUrl = mock(async (_ref: string) => ({
|
|
73
73
|
url: "https://linear.app/myteam/issue/ENG-42",
|
|
74
74
|
type: "issue",
|
|
75
75
|
identifier: "ENG-42",
|
|
@@ -51,7 +51,8 @@ async function validateToken(octokit: Octokit): Promise<string> {
|
|
|
51
51
|
try {
|
|
52
52
|
const { data } = await octokit.users.getAuthenticated();
|
|
53
53
|
return data.login;
|
|
54
|
-
} catch (
|
|
54
|
+
} catch (error: unknown) {
|
|
55
|
+
const err = error as { status?: number; message?: string };
|
|
55
56
|
const status = err.status ?? 0;
|
|
56
57
|
throw new Error(
|
|
57
58
|
`GitHub token validation failed (HTTP ${status}): ${err.message}. Ensure the token has 'repo' scope.`,
|
|
@@ -90,11 +91,12 @@ async function fetchRemoteConfig(
|
|
|
90
91
|
const data = response.data as { content: string; encoding: string };
|
|
91
92
|
const decoded = Buffer.from(data.content, "base64").toString("utf-8");
|
|
92
93
|
return JSON.parse(decoded) as SharedConfig;
|
|
93
|
-
} catch (
|
|
94
|
-
|
|
94
|
+
} catch (error: unknown) {
|
|
95
|
+
const status = (error as { status?: number }).status;
|
|
96
|
+
if (status === 404 || status === 403) {
|
|
95
97
|
return null;
|
|
96
98
|
}
|
|
97
|
-
throw
|
|
99
|
+
throw error;
|
|
98
100
|
}
|
|
99
101
|
}
|
|
100
102
|
|
|
@@ -124,8 +126,8 @@ async function ensureRepo(
|
|
|
124
126
|
try {
|
|
125
127
|
const { data } = await octokit.repos.get({ owner, repo });
|
|
126
128
|
return data.html_url;
|
|
127
|
-
} catch (
|
|
128
|
-
if (
|
|
129
|
+
} catch (error: unknown) {
|
|
130
|
+
if ((error as { status?: number }).status !== 404) throw error;
|
|
129
131
|
}
|
|
130
132
|
|
|
131
133
|
const { data } = await octokit.repos.createForAuthenticatedUser({
|
|
@@ -163,7 +165,10 @@ async function ensureLabels(
|
|
|
163
165
|
}
|
|
164
166
|
|
|
165
167
|
async function createProjectsBoard(
|
|
166
|
-
gql: (
|
|
168
|
+
gql: (
|
|
169
|
+
query: string,
|
|
170
|
+
vars: Record<string, unknown>,
|
|
171
|
+
) => Promise<Record<string, Record<string, unknown>>>,
|
|
167
172
|
ownerLogin: string,
|
|
168
173
|
title: string,
|
|
169
174
|
): Promise<{ id: string; url: string }> {
|
|
@@ -182,7 +187,10 @@ async function createProjectsBoard(
|
|
|
182
187
|
{ ownerId, title },
|
|
183
188
|
);
|
|
184
189
|
|
|
185
|
-
return projectResult.createProjectV2.projectV2
|
|
190
|
+
return projectResult.createProjectV2.projectV2 as unknown as {
|
|
191
|
+
id: string;
|
|
192
|
+
url: string;
|
|
193
|
+
};
|
|
186
194
|
}
|
|
187
195
|
|
|
188
196
|
async function commitSharedConfig(
|
|
@@ -231,7 +239,10 @@ function writeProjectJson(params: {
|
|
|
231
239
|
|
|
232
240
|
async function runSetup(params: {
|
|
233
241
|
octokit: Octokit;
|
|
234
|
-
gql: (
|
|
242
|
+
gql: (
|
|
243
|
+
query: string,
|
|
244
|
+
vars: Record<string, unknown>,
|
|
245
|
+
) => Promise<Record<string, Record<string, unknown>>>;
|
|
235
246
|
ownerLogin: string;
|
|
236
247
|
owner: string;
|
|
237
248
|
repo: string;
|