edgegate-mcp 0.4.0 → 0.7.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.
- package/README.md +22 -3
- package/dist/client.d.ts +27 -1
- package/dist/client.js +55 -0
- package/dist/client.js.map +1 -1
- package/dist/server.js +135 -0
- package/dist/server.js.map +1 -1
- package/dist/tools/change_member_role.d.ts +18 -0
- package/dist/tools/change_member_role.js +61 -0
- package/dist/tools/change_member_role.js.map +1 -0
- package/dist/tools/connect_huggingface.d.ts +15 -0
- package/dist/tools/connect_huggingface.js +83 -0
- package/dist/tools/connect_huggingface.js.map +1 -0
- package/dist/tools/connect_qaihub.d.ts +15 -0
- package/dist/tools/connect_qaihub.js +62 -0
- package/dist/tools/connect_qaihub.js.map +1 -0
- package/dist/tools/create_api_key.d.ts +18 -0
- package/dist/tools/create_api_key.js +73 -0
- package/dist/tools/create_api_key.js.map +1 -0
- package/dist/tools/create_pipeline.d.ts +30 -0
- package/dist/tools/create_pipeline.js +31 -0
- package/dist/tools/create_pipeline.js.map +1 -1
- package/dist/tools/create_workspace.d.ts +12 -0
- package/dist/tools/create_workspace.js +51 -0
- package/dist/tools/create_workspace.js.map +1 -0
- package/dist/tools/disconnect_huggingface.d.ts +12 -0
- package/dist/tools/disconnect_huggingface.js +44 -0
- package/dist/tools/disconnect_huggingface.js.map +1 -0
- package/dist/tools/disconnect_qaihub.d.ts +12 -0
- package/dist/tools/disconnect_qaihub.js +42 -0
- package/dist/tools/disconnect_qaihub.js.map +1 -0
- package/dist/tools/get_huggingface_integration.d.ts +12 -0
- package/dist/tools/get_huggingface_integration.js +52 -0
- package/dist/tools/get_huggingface_integration.js.map +1 -0
- package/dist/tools/get_qaihub_integration.d.ts +12 -0
- package/dist/tools/get_qaihub_integration.js +52 -0
- package/dist/tools/get_qaihub_integration.js.map +1 -0
- package/dist/tools/invite_member.d.ts +18 -0
- package/dist/tools/invite_member.js +85 -0
- package/dist/tools/invite_member.js.map +1 -0
- package/dist/tools/list_api_keys.d.ts +12 -0
- package/dist/tools/list_api_keys.js +51 -0
- package/dist/tools/list_api_keys.js.map +1 -0
- package/dist/tools/list_members.d.ts +12 -0
- package/dist/tools/list_members.js +43 -0
- package/dist/tools/list_members.js.map +1 -0
- package/dist/tools/publish_promptpack.d.ts +18 -0
- package/dist/tools/publish_promptpack.js +108 -0
- package/dist/tools/publish_promptpack.js.map +1 -0
- package/dist/tools/remove_member.d.ts +15 -0
- package/dist/tools/remove_member.js +64 -0
- package/dist/tools/remove_member.js.map +1 -0
- package/dist/tools/revoke_api_key.d.ts +15 -0
- package/dist/tools/revoke_api_key.js +49 -0
- package/dist/tools/revoke_api_key.js.map +1 -0
- package/dist/types.d.ts +84 -0
- package/dist/version.d.ts +2 -2
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/plugin.json +6 -2
- package/skills/edgegate-connect-huggingface.md +64 -0
- package/skills/edgegate-connect-qaihub.md +56 -0
- package/skills/edgegate-import.md +2 -2
- package/skills/edgegate-init.md +17 -0
- package/skills/edgegate-members.md +51 -0
- package/skills/edgegate-promptpacks.md +22 -5
- package/skills/edgegate-workspace-setup.md +74 -0
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { EdgeGateError } from "../client.js";
|
|
3
|
+
export const inviteMemberInputSchema = z.object({
|
|
4
|
+
workspace_id: z.string().uuid(),
|
|
5
|
+
user_email: z
|
|
6
|
+
.string()
|
|
7
|
+
.email()
|
|
8
|
+
.describe("Email of an existing EdgeGate user to add. The user must already have " +
|
|
9
|
+
"an EdgeGate account — this tool does NOT send invitation emails to " +
|
|
10
|
+
"external addresses (v1 only attaches existing users)."),
|
|
11
|
+
role: z
|
|
12
|
+
.enum(["owner", "admin", "viewer"])
|
|
13
|
+
.describe("Their role in this workspace. `owner` = full control including billing " +
|
|
14
|
+
"and member management; `admin` = can manage pipelines and runs but not " +
|
|
15
|
+
"billing or delete the workspace; `viewer` = read-only."),
|
|
16
|
+
});
|
|
17
|
+
export async function inviteMemberHandler(client, input) {
|
|
18
|
+
try {
|
|
19
|
+
const member = await client.addMember(input.workspace_id, {
|
|
20
|
+
user_email: input.user_email,
|
|
21
|
+
role: input.role,
|
|
22
|
+
});
|
|
23
|
+
return {
|
|
24
|
+
content: [
|
|
25
|
+
{
|
|
26
|
+
type: "text",
|
|
27
|
+
text: [
|
|
28
|
+
`Added **${member.email}** to this workspace as **${member.role}**.`,
|
|
29
|
+
``,
|
|
30
|
+
`- user_id: \`${member.user_id}\``,
|
|
31
|
+
``,
|
|
32
|
+
`They can now sign in and access the workspace at their permission level. Change their role with \`edgegate_change_member_role\` or remove them with \`edgegate_remove_member\`.`,
|
|
33
|
+
].join("\n"),
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
catch (err) {
|
|
39
|
+
if (err instanceof EdgeGateError) {
|
|
40
|
+
if (err.status === 404) {
|
|
41
|
+
return {
|
|
42
|
+
isError: true,
|
|
43
|
+
content: [
|
|
44
|
+
{
|
|
45
|
+
type: "text",
|
|
46
|
+
text: `No EdgeGate user with email \`${input.user_email}\` found.\n\n` +
|
|
47
|
+
`EdgeGate v1 only adds existing users — they need to register at ` +
|
|
48
|
+
`https://edgegate.frozo.ai/register first, then re-run this tool.`,
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
if (err.status === 409) {
|
|
54
|
+
return {
|
|
55
|
+
isError: true,
|
|
56
|
+
content: [
|
|
57
|
+
{
|
|
58
|
+
type: "text",
|
|
59
|
+
text: `\`${input.user_email}\` is already a member of this workspace. Use \`edgegate_change_member_role\` to update their role.`,
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
if (err.status === 403) {
|
|
65
|
+
return {
|
|
66
|
+
isError: true,
|
|
67
|
+
content: [
|
|
68
|
+
{
|
|
69
|
+
type: "text",
|
|
70
|
+
text: `Add-member blocked: ${err.detail}\n\n` +
|
|
71
|
+
`Common causes: only owners can add other owners, or the workspace seat limit is reached. ` +
|
|
72
|
+
`Upgrade at https://edgegate.frozo.ai/pricing if it's a plan limit.`,
|
|
73
|
+
},
|
|
74
|
+
],
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
return {
|
|
78
|
+
isError: true,
|
|
79
|
+
content: [{ type: "text", text: `EdgeGate returned ${err.status}: ${err.detail}` }],
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
throw err;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=invite_member.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invite_member.js","sourceRoot":"","sources":["../../src/tools/invite_member.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAkB,aAAa,EAAE,MAAM,cAAc,CAAC;AAG7D,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;IAC/B,UAAU,EAAE,CAAC;SACV,MAAM,EAAE;SACR,KAAK,EAAE;SACP,QAAQ,CACP,wEAAwE;QACtE,qEAAqE;QACrE,uDAAuD,CAC1D;IACH,IAAI,EAAE,CAAC;SACJ,IAAI,CAAC,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;SAClC,QAAQ,CACP,yEAAyE;QACvE,yEAAyE;QACzE,wDAAwD,CAC3D;CACJ,CAAC,CAAC;AAIH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,MAAsB,EACtB,KAAwB;IAExB,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,YAAY,EAAE;YACxD,UAAU,EAAE,KAAK,CAAC,UAAU;YAC5B,IAA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M,EAAE,IAAI,EAAE,qBAAqB,GAAG,CAAC,MAAM,KAAK,GAAG,CAAC,MAAM,EAAE,EAAE,CAAC;aACpF,CAAC;QACJ,CAAC;QACD,MAAM,GAAG,CAAC;IACZ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { EdgeGateClient } from "../client.js";
|
|
3
|
+
import type { ToolResult } from "./setup_workspace.js";
|
|
4
|
+
export declare const listApiKeysInputSchema: z.ZodObject<{
|
|
5
|
+
workspace_id: z.ZodString;
|
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
|
7
|
+
workspace_id: string;
|
|
8
|
+
}, {
|
|
9
|
+
workspace_id: string;
|
|
10
|
+
}>;
|
|
11
|
+
export type ListApiKeysInput = z.infer<typeof listApiKeysInputSchema>;
|
|
12
|
+
export declare function listApiKeysHandler(client: EdgeGateClient, input: ListApiKeysInput): Promise<ToolResult>;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { EdgeGateError } from "../client.js";
|
|
3
|
+
export const listApiKeysInputSchema = z.object({
|
|
4
|
+
workspace_id: z.string().uuid(),
|
|
5
|
+
});
|
|
6
|
+
export async function listApiKeysHandler(client, input) {
|
|
7
|
+
try {
|
|
8
|
+
const keys = await client.listApiKeys(input.workspace_id);
|
|
9
|
+
if (keys.length === 0) {
|
|
10
|
+
return {
|
|
11
|
+
content: [
|
|
12
|
+
{
|
|
13
|
+
type: "text",
|
|
14
|
+
text: "No API keys in this workspace yet. Create one with `edgegate_create_api_key`.",
|
|
15
|
+
},
|
|
16
|
+
],
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
return {
|
|
20
|
+
content: [{ type: "text", text: formatTable(keys) }],
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
catch (err) {
|
|
24
|
+
if (err instanceof EdgeGateError) {
|
|
25
|
+
return {
|
|
26
|
+
isError: true,
|
|
27
|
+
content: [{ type: "text", text: `EdgeGate returned ${err.status}: ${err.detail}` }],
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
throw err;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
function formatTable(keys) {
|
|
34
|
+
const lines = [
|
|
35
|
+
`Found ${keys.length} API key${keys.length === 1 ? "" : "s"} in this workspace:`,
|
|
36
|
+
``,
|
|
37
|
+
`| name | id | prefix...suffix | status | last used |`,
|
|
38
|
+
`|---|---|---|---|---|`,
|
|
39
|
+
];
|
|
40
|
+
for (const k of keys) {
|
|
41
|
+
const status = k.revoked_at
|
|
42
|
+
? "revoked"
|
|
43
|
+
: k.expires_at && new Date(k.expires_at) < new Date()
|
|
44
|
+
? "expired"
|
|
45
|
+
: "active";
|
|
46
|
+
lines.push(`| ${k.name} | \`${k.id}\` | \`${k.prefix}...${k.suffix}\` | ${status} | ${k.last_used_at ?? "never"} |`);
|
|
47
|
+
}
|
|
48
|
+
lines.push(``, `Revoke a key with \`edgegate_revoke_api_key({ workspace_id, key_id })\`. The plaintext is never recoverable — if it was lost, rotate by creating a new key and revoking the old.`);
|
|
49
|
+
return lines.join("\n");
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=list_api_keys.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list_api_keys.js","sourceRoot":"","sources":["../../src/tools/list_api_keys.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAkB,aAAa,EAAE,MAAM,cAAc,CAAC;AAI7D,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7C,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;CAChC,CAAC,CAAC;AAIH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,MAAsB,EACtB,KAAuB;IAEvB,IAAI,CAAC;QACH,MAAM,IAAI,GAAG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,CAAC,IAAI,QAAQ,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,MAAM,MAAM,CAAC,CAAC,MAAM,QAAQ,MAAM,MAAM,CAAC,CAAC,YAAY,IAAI,OAAO,IAAI,CACzG,CAAC;IACJ,CAAC;IACD,KAAK,CAAC,IAAI,CACR,EAAE,EACF,kLAAkL,CACnL,CAAC;IACF,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { EdgeGateClient } from "../client.js";
|
|
3
|
+
import type { ToolResult } from "./setup_workspace.js";
|
|
4
|
+
export declare const listMembersInputSchema: z.ZodObject<{
|
|
5
|
+
workspace_id: z.ZodString;
|
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
|
7
|
+
workspace_id: string;
|
|
8
|
+
}, {
|
|
9
|
+
workspace_id: string;
|
|
10
|
+
}>;
|
|
11
|
+
export type ListMembersInput = z.infer<typeof listMembersInputSchema>;
|
|
12
|
+
export declare function listMembersHandler(client: EdgeGateClient, input: ListMembersInput): Promise<ToolResult>;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { EdgeGateError } from "../client.js";
|
|
3
|
+
export const listMembersInputSchema = z.object({
|
|
4
|
+
workspace_id: z.string().uuid(),
|
|
5
|
+
});
|
|
6
|
+
export async function listMembersHandler(client, input) {
|
|
7
|
+
try {
|
|
8
|
+
const members = await client.listMembers(input.workspace_id);
|
|
9
|
+
if (members.length === 0) {
|
|
10
|
+
return {
|
|
11
|
+
content: [
|
|
12
|
+
{ type: "text", text: "No members in this workspace yet (which should be impossible — the owner is always a member)." },
|
|
13
|
+
],
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
return {
|
|
17
|
+
content: [{ type: "text", text: formatTable(members) }],
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
catch (err) {
|
|
21
|
+
if (err instanceof EdgeGateError) {
|
|
22
|
+
return {
|
|
23
|
+
isError: true,
|
|
24
|
+
content: [{ type: "text", text: `EdgeGate returned ${err.status}: ${err.detail}` }],
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
throw err;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
function formatTable(members) {
|
|
31
|
+
const lines = [
|
|
32
|
+
`Found ${members.length} member${members.length === 1 ? "" : "s"} in this workspace:`,
|
|
33
|
+
``,
|
|
34
|
+
`| email | role | user_id |`,
|
|
35
|
+
`|---|---|---|`,
|
|
36
|
+
];
|
|
37
|
+
for (const m of members) {
|
|
38
|
+
lines.push(`| ${m.email} | ${m.role} | \`${m.user_id}\` |`);
|
|
39
|
+
}
|
|
40
|
+
lines.push(``, `Invite with \`edgegate_invite_member\`, change role with \`edgegate_change_member_role\`, remove with \`edgegate_remove_member\`. Roles: \`owner\` (full control), \`admin\` (manage pipelines + runs, can't change billing or delete workspace), \`viewer\` (read-only).`);
|
|
41
|
+
return lines.join("\n");
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=list_members.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list_members.js","sourceRoot":"","sources":["../../src/tools/list_members.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAkB,aAAa,EAAE,MAAM,cAAc,CAAC;AAI7D,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7C,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;CAChC,CAAC,CAAC;AAIH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,MAAsB,EACtB,KAAuB;IAEvB,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;QAC7D,IAAI,OAAO,CAAC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3
|
+
import type { ToolResult } from "./setup_workspace.js";
|
|
4
|
+
export declare const publishPromptpackInputSchema: z.ZodObject<{
|
|
5
|
+
workspace_id: z.ZodString;
|
|
6
|
+
promptpack_id: z.ZodString;
|
|
7
|
+
version: z.ZodString;
|
|
8
|
+
}, "strict", z.ZodTypeAny, {
|
|
9
|
+
workspace_id: string;
|
|
10
|
+
promptpack_id: string;
|
|
11
|
+
version: string;
|
|
12
|
+
}, {
|
|
13
|
+
workspace_id: string;
|
|
14
|
+
promptpack_id: string;
|
|
15
|
+
version: string;
|
|
16
|
+
}>;
|
|
17
|
+
export type PublishPromptpackInput = z.infer<typeof publishPromptpackInputSchema>;
|
|
18
|
+
export declare function publishPromptpackHandler(client: EdgeGateClient, input: PublishPromptpackInput): Promise<ToolResult>;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { EdgeGateError } from "../client.js";
|
|
3
|
+
const promptpackIdRegex = /^[a-zA-Z0-9_-]{1,64}$/;
|
|
4
|
+
const semverRegex = /^\d+\.\d+\.\d+$/;
|
|
5
|
+
export const publishPromptpackInputSchema = z
|
|
6
|
+
.object({
|
|
7
|
+
workspace_id: z.string().uuid(),
|
|
8
|
+
promptpack_id: z
|
|
9
|
+
.string()
|
|
10
|
+
.regex(promptpackIdRegex, "promptpack_id must match ^[a-zA-Z0-9_-]{1,64}$"),
|
|
11
|
+
version: z
|
|
12
|
+
.string()
|
|
13
|
+
.regex(semverRegex, "version must be semver (e.g. 1.0.0)"),
|
|
14
|
+
})
|
|
15
|
+
.strict();
|
|
16
|
+
export async function publishPromptpackHandler(client, input) {
|
|
17
|
+
try {
|
|
18
|
+
const pack = await client.publishPromptPack(input.workspace_id, input.promptpack_id, input.version);
|
|
19
|
+
return {
|
|
20
|
+
content: [
|
|
21
|
+
{
|
|
22
|
+
type: "text",
|
|
23
|
+
text: [
|
|
24
|
+
`Published **${pack.promptpack_id}@${pack.version}**`,
|
|
25
|
+
``,
|
|
26
|
+
`- id: ${pack.id}`,
|
|
27
|
+
`- ${pack.case_count} case(s)`,
|
|
28
|
+
`- published: ${pack.published}`,
|
|
29
|
+
`- sha256: ${pack.sha256}`,
|
|
30
|
+
``,
|
|
31
|
+
`The pack is now usable as \`promptpack_id\` in edgegate_create_pipeline.`,
|
|
32
|
+
].join("\n"),
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
catch (err) {
|
|
38
|
+
if (err instanceof EdgeGateError) {
|
|
39
|
+
if (err.status === 404) {
|
|
40
|
+
return {
|
|
41
|
+
isError: true,
|
|
42
|
+
content: [
|
|
43
|
+
{
|
|
44
|
+
type: "text",
|
|
45
|
+
text: `Promptpack ${input.promptpack_id}@${input.version} not found in this workspace. ` +
|
|
46
|
+
`List your packs with edgegate_list_promptpacks.`,
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
if (err.status === 403) {
|
|
52
|
+
return {
|
|
53
|
+
isError: true,
|
|
54
|
+
content: [
|
|
55
|
+
{
|
|
56
|
+
type: "text",
|
|
57
|
+
text: "You need admin role on this workspace to publish promptpacks.",
|
|
58
|
+
},
|
|
59
|
+
],
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
// 409 or any response indicating "already published" — treat as idempotent success
|
|
63
|
+
if (err.status === 409) {
|
|
64
|
+
const lowerDetail = err.detail.toLowerCase();
|
|
65
|
+
if (lowerDetail.includes("already published") || lowerDetail.includes("already")) {
|
|
66
|
+
return {
|
|
67
|
+
content: [
|
|
68
|
+
{
|
|
69
|
+
type: "text",
|
|
70
|
+
text: [
|
|
71
|
+
`**${input.promptpack_id}@${input.version}** is already published (idempotent).`,
|
|
72
|
+
``,
|
|
73
|
+
`The pack is usable as \`promptpack_id\` in edgegate_create_pipeline.`,
|
|
74
|
+
].join("\n"),
|
|
75
|
+
},
|
|
76
|
+
],
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
return {
|
|
80
|
+
isError: true,
|
|
81
|
+
content: [
|
|
82
|
+
{ type: "text", text: `EdgeGate returned ${err.status}: ${err.detail}` },
|
|
83
|
+
],
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
if (err.status === 401) {
|
|
87
|
+
return {
|
|
88
|
+
isError: true,
|
|
89
|
+
content: [
|
|
90
|
+
{
|
|
91
|
+
type: "text",
|
|
92
|
+
text: "EDGEGATE_API_KEY is missing, expired, or revoked. Generate a fresh key at " +
|
|
93
|
+
"https://edgegate.frozo.ai/workspace/<id>/settings#api-keys and retry.",
|
|
94
|
+
},
|
|
95
|
+
],
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
return {
|
|
99
|
+
isError: true,
|
|
100
|
+
content: [
|
|
101
|
+
{ type: "text", text: `EdgeGate returned ${err.status}: ${err.detail}` },
|
|
102
|
+
],
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
throw err;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
//# sourceMappingURL=publish_promptpack.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publish_promptpack.js","sourceRoot":"","sources":["../../src/tools/publish_promptpack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAkB,aAAa,EAAE,MAAM,cAAc,CAAC;AAG7D,MAAM,iBAAiB,GAAG,uBAAuB,CAAC;AAClD,MAAM,WAAW,GAAG,iBAAiB,CAAC;AAEtC,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC;KAC1C,MAAM,CAAC;IACN,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;IAC/B,aAAa,EAAE,CAAC;SACb,MAAM,EAAE;SACR,KAAK,CACJ,iBAAiB,EACjB,gDAAgD,CACjD;IACH,OAAO,EAAE,CAAC;SACP,MAAM,EAAE;SACR,KAAK,CAAC,WAAW,EA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+
import type { ToolResult } from "./setup_workspace.js";
|
|
4
|
+
export declare const removeMemberInputSchema: z.ZodObject<{
|
|
5
|
+
workspace_id: z.ZodString;
|
|
6
|
+
user_id: z.ZodString;
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
workspace_id: string;
|
|
9
|
+
user_id: string;
|
|
10
|
+
}, {
|
|
11
|
+
workspace_id: string;
|
|
12
|
+
user_id: string;
|
|
13
|
+
}>;
|
|
14
|
+
export type RemoveMemberInput = z.infer<typeof removeMemberInputSchema>;
|
|
15
|
+
export declare function removeMemberHandler(client: EdgeGateClient, input: RemoveMemberInput): Promise<ToolResult>;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { EdgeGateError } from "../client.js";
|
|
3
|
+
export const removeMemberInputSchema = z.object({
|
|
4
|
+
workspace_id: z.string().uuid(),
|
|
5
|
+
user_id: z
|
|
6
|
+
.string()
|
|
7
|
+
.uuid()
|
|
8
|
+
.describe("Target member's user_id (from `edgegate_list_members`). The user immediately " +
|
|
9
|
+
"loses access to the workspace. Their pipelines and runs are preserved — " +
|
|
10
|
+
"this only removes the membership row."),
|
|
11
|
+
});
|
|
12
|
+
export async function removeMemberHandler(client, input) {
|
|
13
|
+
try {
|
|
14
|
+
await client.removeMember(input.workspace_id, input.user_id);
|
|
15
|
+
return {
|
|
16
|
+
content: [
|
|
17
|
+
{
|
|
18
|
+
type: "text",
|
|
19
|
+
text: [
|
|
20
|
+
`Removed user \`${input.user_id}\` from this workspace.`,
|
|
21
|
+
``,
|
|
22
|
+
`Pipelines and runs they created are preserved. Re-invite any time with \`edgegate_invite_member\` if it was a mistake.`,
|
|
23
|
+
].join("\n"),
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
catch (err) {
|
|
29
|
+
if (err instanceof EdgeGateError) {
|
|
30
|
+
if (err.status === 400) {
|
|
31
|
+
// Most likely "Cannot remove the last owner from workspace".
|
|
32
|
+
return {
|
|
33
|
+
isError: true,
|
|
34
|
+
content: [
|
|
35
|
+
{
|
|
36
|
+
type: "text",
|
|
37
|
+
text: `Member removal rejected: ${err.detail}\n\n` +
|
|
38
|
+
`If you're trying to remove the last owner, promote another member ` +
|
|
39
|
+
`to owner first via \`edgegate_change_member_role\`, then remove ` +
|
|
40
|
+
`the original owner.`,
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
if (err.status === 404) {
|
|
46
|
+
return {
|
|
47
|
+
isError: true,
|
|
48
|
+
content: [
|
|
49
|
+
{
|
|
50
|
+
type: "text",
|
|
51
|
+
text: `User \`${input.user_id}\` is not a member of this workspace.`,
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
return {
|
|
57
|
+
isError: true,
|
|
58
|
+
content: [{ type: "text", text: `EdgeGate returned ${err.status}: ${err.detail}` }],
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
throw err;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=remove_member.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remove_member.js","sourceRoot":"","sources":["../../src/tools/remove_member.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAkB,aAAa,EAAE,MAAM,cAAc,CAAC;AAG7D,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;IAC/B,OAAO,EAAE,CAAC;SACP,MAAM,EAAE;SACR,IAAI,EAAE;SACN,QAAQ,CACP,+EAA+E;QAC7E,0EAA0E;QAC1E,uCAAuC,CAC1C;CACJ,CAAC,CAAC;AAIH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,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
|
2
|
+
import { EdgeGateClient } from "../client.js";
|
|
3
|
+
import type { ToolResult } from "./setup_workspace.js";
|
|
4
|
+
export declare const revokeApiKeyInputSchema: z.ZodObject<{
|
|
5
|
+
workspace_id: z.ZodString;
|
|
6
|
+
key_id: z.ZodString;
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
workspace_id: string;
|
|
9
|
+
key_id: string;
|
|
10
|
+
}, {
|
|
11
|
+
workspace_id: string;
|
|
12
|
+
key_id: string;
|
|
13
|
+
}>;
|
|
14
|
+
export type RevokeApiKeyInput = z.infer<typeof revokeApiKeyInputSchema>;
|
|
15
|
+
export declare function revokeApiKeyHandler(client: EdgeGateClient, input: RevokeApiKeyInput): Promise<ToolResult>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { EdgeGateError } from "../client.js";
|
|
3
|
+
export const revokeApiKeyInputSchema = z.object({
|
|
4
|
+
workspace_id: z.string().uuid(),
|
|
5
|
+
key_id: z
|
|
6
|
+
.string()
|
|
7
|
+
.uuid()
|
|
8
|
+
.describe("UUID of the key to revoke (the `id` field from `edgegate_list_api_keys`). " +
|
|
9
|
+
"This is destructive and immediate — any CI job or client still using " +
|
|
10
|
+
"the plaintext will fail authentication on the next request."),
|
|
11
|
+
});
|
|
12
|
+
export async function revokeApiKeyHandler(client, input) {
|
|
13
|
+
try {
|
|
14
|
+
await client.revokeApiKey(input.workspace_id, input.key_id);
|
|
15
|
+
return {
|
|
16
|
+
content: [
|
|
17
|
+
{
|
|
18
|
+
type: "text",
|
|
19
|
+
text: [
|
|
20
|
+
`Revoked API key \`${input.key_id}\`.`,
|
|
21
|
+
``,
|
|
22
|
+
`The key is now rejected for all future requests. The audit trail (last_used_at, revoked_at) is preserved on the row — you can still see it in \`edgegate_list_api_keys\`.`,
|
|
23
|
+
].join("\n"),
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
catch (err) {
|
|
29
|
+
if (err instanceof EdgeGateError) {
|
|
30
|
+
if (err.status === 404) {
|
|
31
|
+
return {
|
|
32
|
+
isError: true,
|
|
33
|
+
content: [
|
|
34
|
+
{
|
|
35
|
+
type: "text",
|
|
36
|
+
text: `API key \`${input.key_id}\` not found in this workspace (or already revoked).`,
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
return {
|
|
42
|
+
isError: true,
|
|
43
|
+
content: [{ type: "text", text: `EdgeGate returned ${err.status}: ${err.detail}` }],
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
throw err;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=revoke_api_key.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"revoke_api_key.js","sourceRoot":"","sources":["../../src/tools/revoke_api_key.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAkB,aAAa,EAAE,MAAM,cAAc,CAAC;AAG7D,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;IAC/B,MAAM,EAAE,CAAC;SACN,MAAM,EAAE;SACR,IAAI,EAAE;SACN,QAAQ,CACP,4EAA4E;QAC1E,uEAAuE;QACvE,6DAA6D,CAChE;CACJ,CAAC,CAAC;AAIH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,MAAsB,EACtB,KAAwB;IAExB,IAAI,CAAC;QACH,MAAM,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,YAAY,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;QAC5D,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE;wBACJ,qBAAqB,KAAK,CAAC,MAAM,KAAK;wBACtC,EAAE;wBACF,2KAA2K;qBAC5K,CAAC,IAAI,CAAC,IAAI,CAAC;iBACb;aACF;SACF,CAAC;IACJ,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,GAAG,YAAY,aAAa,EAAE,CAAC;YACjC,IAAI,GAAG,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;gBACvB,OAAO;oBACL,OAAO,EAAE,IAAI;oBACb,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,MAAM;4BACZ,IAAI,EAAE,aAAa,KAAK,CAAC,MAAM,sDAAsD;yBACtF;qBACF;iBACF,CAAC;YACJ,CAAC;YACD,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,qBAAqB,GAAG,CAAC,MAAM,KAAK,GAAG,CAAC,MAAM,EAAE,EAAE,CAAC;aACpF,CAAC;QACJ,CAAC;QACD,MAAM,GAAG,CAAC;IACZ,CAAC;AACH,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,20 @@
|
|
|
1
1
|
export type UUID = string;
|
|
2
|
+
/** Supported dtypes for AI Hub compile input tensors. */
|
|
3
|
+
export type InputSpecDtype = "float32" | "float16" | "int64" | "int32" | "bool";
|
|
4
|
+
/**
|
|
5
|
+
* Explicit shape + dtype for one named model input.
|
|
6
|
+
* Passed as `input_specs` on pipeline create/update to override the default
|
|
7
|
+
* AI Hub auto-detect or PR-#40 auto-resolve behaviour.
|
|
8
|
+
*
|
|
9
|
+
* Example (BERT-family):
|
|
10
|
+
* { shape: [1, 128], dtype: "int64" }
|
|
11
|
+
*/
|
|
12
|
+
export interface InputSpec {
|
|
13
|
+
/** Tensor shape (1–8 positive integers). */
|
|
14
|
+
shape: number[];
|
|
15
|
+
/** Element dtype. Defaults to "float32" when omitted. */
|
|
16
|
+
dtype: InputSpecDtype;
|
|
17
|
+
}
|
|
2
18
|
export interface Workspace {
|
|
3
19
|
id: UUID;
|
|
4
20
|
name: string;
|
|
@@ -84,6 +100,74 @@ export interface WorkflowTemplate {
|
|
|
84
100
|
api_url: string;
|
|
85
101
|
secret_names: string[];
|
|
86
102
|
}
|
|
103
|
+
/**
|
|
104
|
+
* Returned by GET /integrations/huggingface — status without the token.
|
|
105
|
+
* The plaintext token is never echoed; only the last 4 chars + lifecycle
|
|
106
|
+
* fields are visible after the initial connect/rotate call.
|
|
107
|
+
*/
|
|
108
|
+
export interface HuggingFaceIntegrationStatus {
|
|
109
|
+
id: UUID;
|
|
110
|
+
provider: "huggingface";
|
|
111
|
+
status: "active" | "disabled";
|
|
112
|
+
token_last4: string;
|
|
113
|
+
created_at: string;
|
|
114
|
+
updated_at: string;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Returned by POST /integrations/huggingface and the rotate endpoint.
|
|
118
|
+
* Includes the whoami account name/type so the caller can confirm the
|
|
119
|
+
* right account was connected, without leaking the secret.
|
|
120
|
+
*/
|
|
121
|
+
export interface HuggingFaceConnectResponse extends HuggingFaceIntegrationStatus {
|
|
122
|
+
account_name: string;
|
|
123
|
+
account_type: string;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Returned by GET / POST / PUT on /integrations/qaihub.
|
|
127
|
+
* The plaintext token is never echoed; only token_last4 is visible.
|
|
128
|
+
*/
|
|
129
|
+
export interface QaihubIntegration {
|
|
130
|
+
id: UUID;
|
|
131
|
+
provider: "qaihub";
|
|
132
|
+
status: "active" | "disabled";
|
|
133
|
+
token_last4: string;
|
|
134
|
+
created_at: string;
|
|
135
|
+
updated_at: string;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Returned by POST /workspaces/{ws}/api-keys.
|
|
139
|
+
* `plaintext` is the only time the full key is visible — the caller must
|
|
140
|
+
* persist it immediately; the backend stores only a bcrypt hash.
|
|
141
|
+
*/
|
|
142
|
+
export interface APIKeyCreatedResponse {
|
|
143
|
+
id: UUID;
|
|
144
|
+
plaintext: string;
|
|
145
|
+
name: string;
|
|
146
|
+
prefix: string;
|
|
147
|
+
suffix: string;
|
|
148
|
+
created_at: string;
|
|
149
|
+
expires_at: string | null;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Returned by GET /workspaces/{ws}/api-keys (one row per key).
|
|
153
|
+
* Includes lifecycle fields but never the plaintext or the hash.
|
|
154
|
+
*/
|
|
155
|
+
export interface APIKeyListItem {
|
|
156
|
+
id: UUID;
|
|
157
|
+
name: string;
|
|
158
|
+
prefix: string;
|
|
159
|
+
suffix: string;
|
|
160
|
+
last_used_at: string | null;
|
|
161
|
+
expires_at: string | null;
|
|
162
|
+
revoked_at: string | null;
|
|
163
|
+
created_at: string;
|
|
164
|
+
}
|
|
165
|
+
export type WorkspaceRole = "owner" | "admin" | "viewer";
|
|
166
|
+
export interface Member {
|
|
167
|
+
user_id: UUID;
|
|
168
|
+
email: string;
|
|
169
|
+
role: WorkspaceRole;
|
|
170
|
+
}
|
|
87
171
|
/** @deprecated Not used — audit-report endpoint does not exist; use RunBundle instead. */
|
|
88
172
|
export interface AuditReport {
|
|
89
173
|
url?: string;
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
2
|
-
export declare const USER_AGENT = "edgegate-mcp/0.
|
|
1
|
+
export declare const VERSION = "0.7.0";
|
|
2
|
+
export declare const USER_AGENT = "edgegate-mcp/0.7.0";
|
package/dist/version.js
CHANGED
package/package.json
CHANGED
package/plugin.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "edgegate",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Edge-AI regression gates from Claude Code — set up CI, run benchmarks, compare runs, export reports, and fetch audit bundles from any prompt.",
|
|
5
5
|
"author": "Frozo / EdgeGate",
|
|
6
6
|
"homepage": "https://edgegate.frozo.ai",
|
|
@@ -25,6 +25,10 @@
|
|
|
25
25
|
"skills/edgegate-compare.md",
|
|
26
26
|
"skills/edgegate-export.md",
|
|
27
27
|
"skills/edgegate-import.md",
|
|
28
|
-
"skills/edgegate-promptpacks.md"
|
|
28
|
+
"skills/edgegate-promptpacks.md",
|
|
29
|
+
"skills/edgegate-connect-huggingface.md",
|
|
30
|
+
"skills/edgegate-connect-qaihub.md",
|
|
31
|
+
"skills/edgegate-workspace-setup.md",
|
|
32
|
+
"skills/edgegate-members.md"
|
|
29
33
|
]
|
|
30
34
|
}
|