edgegate-mcp 0.4.1 → 0.8.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 +27 -3
- package/dist/client.d.ts +43 -1
- package/dist/client.js +83 -0
- package/dist/client.js.map +1 -1
- package/dist/server.js +178 -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/check_byo_bucket.d.ts +12 -0
- package/dist/tools/check_byo_bucket.js +89 -0
- package/dist/tools/check_byo_bucket.js.map +1 -0
- package/dist/tools/check_status.d.ts +2 -2
- package/dist/tools/compare_runs.d.ts +2 -2
- 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 +34 -4
- 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_byo_bucket.d.ts +12 -0
- package/dist/tools/disconnect_byo_bucket.js +90 -0
- package/dist/tools/disconnect_byo_bucket.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/export_run_report.d.ts +2 -2
- package/dist/tools/get_audit_report.d.ts +2 -2
- package/dist/tools/get_byo_audit.d.ts +27 -0
- package/dist/tools/get_byo_audit.js +125 -0
- package/dist/tools/get_byo_audit.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/get_report.d.ts +1 -1
- 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/register_byo_artifact.d.ts +27 -0
- package/dist/tools/register_byo_artifact.js +122 -0
- package/dist/tools/register_byo_artifact.js.map +1 -0
- package/dist/tools/register_byo_bucket.d.ts +24 -0
- package/dist/tools/register_byo_bucket.js +143 -0
- package/dist/tools/register_byo_bucket.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 +169 -0
- package/dist/version.d.ts +2 -2
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/plugin.json +7 -2
- package/skills/edgegate-byo-storage.md +148 -0
- 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-workspace-setup.md +74 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { EdgeGateError } from "../client.js";
|
|
3
|
+
export const disconnectByoBucketInputSchema = z.object({
|
|
4
|
+
workspace_id: z.string().uuid(),
|
|
5
|
+
});
|
|
6
|
+
export async function disconnectByoBucketHandler(client, input) {
|
|
7
|
+
try {
|
|
8
|
+
await client.deleteByoGrant(input.workspace_id);
|
|
9
|
+
return {
|
|
10
|
+
content: [
|
|
11
|
+
{
|
|
12
|
+
type: "text",
|
|
13
|
+
text: [
|
|
14
|
+
`Removed the BYO storage grant for this workspace.`,
|
|
15
|
+
``,
|
|
16
|
+
`EdgeGate will no longer attempt to AssumeRole into your AWS account. ` +
|
|
17
|
+
`New artifact registrations via \`edgegate_register_byo_artifact\` will ` +
|
|
18
|
+
`fail until a fresh grant is registered.`,
|
|
19
|
+
``,
|
|
20
|
+
`Existing artifacts that pointed at the bucket are also invalidated — any ` +
|
|
21
|
+
`attempt to read them during a run will surface BYO_NO_GRANT. If you want ` +
|
|
22
|
+
`to keep using the same bucket, re-register with ` +
|
|
23
|
+
`\`edgegate_register_byo_bucket\` and the artifacts will be re-resolvable.`,
|
|
24
|
+
].join("\n"),
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
catch (err) {
|
|
30
|
+
if (err instanceof EdgeGateError) {
|
|
31
|
+
if (err.status === 402) {
|
|
32
|
+
return {
|
|
33
|
+
isError: true,
|
|
34
|
+
content: [
|
|
35
|
+
{
|
|
36
|
+
type: "text",
|
|
37
|
+
text: `BYO storage requires the Enterprise plan. ` +
|
|
38
|
+
`Contact sales: https://edgegate.frozo.ai/enterprise.`,
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
if (err.status === 404) {
|
|
44
|
+
return {
|
|
45
|
+
content: [
|
|
46
|
+
{
|
|
47
|
+
type: "text",
|
|
48
|
+
text: `No BYO storage grant is registered for this workspace — nothing to disconnect.`,
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
if (err.status === 409) {
|
|
54
|
+
return {
|
|
55
|
+
isError: true,
|
|
56
|
+
content: [
|
|
57
|
+
{
|
|
58
|
+
type: "text",
|
|
59
|
+
text: [
|
|
60
|
+
`Cannot disconnect — artifacts still reference this BYO grant.`,
|
|
61
|
+
``,
|
|
62
|
+
`EdgeGate refuses to orphan artifact rows whose \`storage_url\` ` +
|
|
63
|
+
`points at your bucket. Two safe paths forward:`,
|
|
64
|
+
``,
|
|
65
|
+
`1. **Keep the artifacts.** Leave the grant in place. If you only ` +
|
|
66
|
+
`wanted to rotate the External ID, use the dashboard ` +
|
|
67
|
+
`(\`https://edgegate.frozo.ai/workspace/${input.workspace_id}/settings#byo-storage\`) ` +
|
|
68
|
+
`to rotate without deleting.`,
|
|
69
|
+
`2. **Drop the artifacts first.** Use the dashboard's artifact list to ` +
|
|
70
|
+
`delete each BYO artifact, then re-run ` +
|
|
71
|
+
`\`edgegate_disconnect_byo_bucket\`. Runs that referenced the deleted ` +
|
|
72
|
+
`artifacts will keep their evidence bundles — only the pointer is gone.`,
|
|
73
|
+
``,
|
|
74
|
+
`Detail from EdgeGate: \`${err.detail}\``,
|
|
75
|
+
].join("\n"),
|
|
76
|
+
},
|
|
77
|
+
],
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
return {
|
|
81
|
+
isError: true,
|
|
82
|
+
content: [
|
|
83
|
+
{ type: "text", text: `EdgeGate returned ${err.status}: ${err.detail}` },
|
|
84
|
+
],
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
throw err;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=disconnect_byo_bucket.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"disconnect_byo_bucket.js","sourceRoot":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,MAAM,KAAK,GAAG,EAAE,CAAC;gBACvB,OAAO;oBACL,OAAO,EAAE,IAAI;oBACb,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,MAAM;4BACZ,IAAI,EAAE;gCACJ,+DAA+D;gCAC/D,EAAE;gCACF,iEAAiE;oCAC/D,gDAAgD;gCAClD,EAAE;gCACF,mEAAmE;oCACjE,sDAAsD;oCACtD,0CAA0C,KAAK,CAAC,YAAY,2BAA2B;oCACvF,6BAA6B;gCAC/B,wEAAwE;oCACtE,wCAAwC;oCACxC,uEAAuE;oCACvE,wEAAwE;gCAC1E,EAAE;gCACF,2BAA2B,GAAG,CAAC,MAAM,IAAI;6BAC1C,CAAC,IAAI,CAAC,IAAI,CAAC;yBACb;qBACF;iBACF,CAAC;YACJ,CAAC;YACD,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,OAAO,EAAE;oBACP,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,qBAAqB,GAAG,CAAC,MAAM,KAAK,GAAG,CAAC,MAAM,EAAE,EAAE;iBACzE;aACF,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 disconnectHuggingfaceInputSchema: z.ZodObject<{
|
|
5
|
+
workspace_id: z.ZodString;
|
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
|
7
|
+
workspace_id: string;
|
|
8
|
+
}, {
|
|
9
|
+
workspace_id: string;
|
|
10
|
+
}>;
|
|
11
|
+
export type DisconnectHuggingfaceInput = z.infer<typeof disconnectHuggingfaceInputSchema>;
|
|
12
|
+
export declare function disconnectHuggingfaceHandler(client: EdgeGateClient, input: DisconnectHuggingfaceInput): Promise<ToolResult>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { EdgeGateError } from "../client.js";
|
|
3
|
+
export const disconnectHuggingfaceInputSchema = z.object({
|
|
4
|
+
workspace_id: z.string().uuid(),
|
|
5
|
+
});
|
|
6
|
+
export async function disconnectHuggingfaceHandler(client, input) {
|
|
7
|
+
try {
|
|
8
|
+
await client.deleteHuggingFaceIntegration(input.workspace_id);
|
|
9
|
+
return {
|
|
10
|
+
content: [
|
|
11
|
+
{
|
|
12
|
+
type: "text",
|
|
13
|
+
text: [
|
|
14
|
+
`Removed the HuggingFace integration for this workspace.`,
|
|
15
|
+
``,
|
|
16
|
+
`The encrypted token has been deleted. Future \`edgegate_import_huggingface_model\` calls will use anonymous access — only repos with truly public ONNX files will work.`,
|
|
17
|
+
``,
|
|
18
|
+
`Reconnect any time with \`edgegate_connect_huggingface\`.`,
|
|
19
|
+
].join("\n"),
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
catch (err) {
|
|
25
|
+
if (err instanceof EdgeGateError) {
|
|
26
|
+
if (err.status === 404) {
|
|
27
|
+
return {
|
|
28
|
+
content: [
|
|
29
|
+
{
|
|
30
|
+
type: "text",
|
|
31
|
+
text: "No HuggingFace integration is currently connected to this workspace — nothing to remove.",
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
return {
|
|
37
|
+
isError: true,
|
|
38
|
+
content: [{ type: "text", text: `EdgeGate returned ${err.status}: ${err.detail}` }],
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
throw err;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=disconnect_huggingface.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"disconnect_huggingface.js","sourceRoot":"","sources":["../../src/tools/disconnect_huggingface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAkB,aAAa,EAAE,MAAM,cAAc,CAAC;AAG7D,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC,CAAC,MAAM,CAAC;IACvD,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;CAChC,CAAC,CAAC;AAIH,MAAM,CAAC,KAAK,UAAU,4BAA4B,CAChD,MAAsB,EACtB,KAAiC;IAEjC,IAAI,CAAC;QACH,MAAM,MAAM,CAAC,4BAA4B,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;QAC9D,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE;wBACJ,yDAAyD;wBACzD,EAAE;wBACF,yKAAyK;wBACzK,EAAE;wBACF,2DAA2D;qBAC5D,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;wBACP;4BACE,IAAI,EAAE,MAAM;4BACZ,IAAI,EACF,0FAA0F;yBAC7F;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"}
|
|
@@ -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 disconnectQaihubInputSchema: z.ZodObject<{
|
|
5
|
+
workspace_id: z.ZodString;
|
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
|
7
|
+
workspace_id: string;
|
|
8
|
+
}, {
|
|
9
|
+
workspace_id: string;
|
|
10
|
+
}>;
|
|
11
|
+
export type DisconnectQaihubInput = z.infer<typeof disconnectQaihubInputSchema>;
|
|
12
|
+
export declare function disconnectQaihubHandler(client: EdgeGateClient, input: DisconnectQaihubInput): Promise<ToolResult>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { EdgeGateError } from "../client.js";
|
|
3
|
+
export const disconnectQaihubInputSchema = z.object({
|
|
4
|
+
workspace_id: z.string().uuid(),
|
|
5
|
+
});
|
|
6
|
+
export async function disconnectQaihubHandler(client, input) {
|
|
7
|
+
try {
|
|
8
|
+
await client.deleteQaihubIntegration(input.workspace_id);
|
|
9
|
+
return {
|
|
10
|
+
content: [
|
|
11
|
+
{
|
|
12
|
+
type: "text",
|
|
13
|
+
text: [
|
|
14
|
+
`Removed the Qualcomm AI Hub integration for this workspace.`,
|
|
15
|
+
``,
|
|
16
|
+
`The encrypted token has been deleted. Any new EdgeGate runs in this workspace will fail with \`NO_AIHUB_TOKEN\` until a fresh token is connected via \`edgegate_connect_qaihub\`.`,
|
|
17
|
+
].join("\n"),
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
catch (err) {
|
|
23
|
+
if (err instanceof EdgeGateError) {
|
|
24
|
+
if (err.status === 404) {
|
|
25
|
+
return {
|
|
26
|
+
content: [
|
|
27
|
+
{
|
|
28
|
+
type: "text",
|
|
29
|
+
text: "No Qualcomm AI Hub integration is currently connected to this workspace — nothing to remove.",
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
return {
|
|
35
|
+
isError: true,
|
|
36
|
+
content: [{ type: "text", text: `EdgeGate returned ${err.status}: ${err.detail}` }],
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
throw err;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=disconnect_qaihub.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"disconnect_qaihub.js","sourceRoot":"","sources":["../../src/tools/disconnect_qaihub.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAkB,aAAa,EAAE,MAAM,cAAc,CAAC;AAG7D,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,MAAM,CAAC;IAClD,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;CAChC,CAAC,CAAC;AAIH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,MAAsB,EACtB,KAA4B;IAE5B,IAAI,CAAC;QACH,MAAM,MAAM,CAAC,uBAAuB,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;QACzD,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE;wBACJ,6DAA6D;wBAC7D,EAAE;wBACF,mLAAmL;qBACpL,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;wBACP;4BACE,IAAI,EAAE,MAAM;4BACZ,IAAI,EAAE,8FAA8F;yBACrG;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"}
|
|
@@ -20,13 +20,13 @@ export declare const exportRunReportInputSchema: z.ZodObject<{
|
|
|
20
20
|
output_path: z.ZodOptional<z.ZodString>;
|
|
21
21
|
include_diff: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
22
22
|
}, "strip", z.ZodTypeAny, {
|
|
23
|
-
workspace_id: string;
|
|
24
23
|
run_id: string;
|
|
24
|
+
workspace_id: string;
|
|
25
25
|
include_diff: boolean;
|
|
26
26
|
output_path?: string | undefined;
|
|
27
27
|
}, {
|
|
28
|
-
workspace_id: string;
|
|
29
28
|
run_id: string;
|
|
29
|
+
workspace_id: string;
|
|
30
30
|
output_path?: string | undefined;
|
|
31
31
|
include_diff?: boolean | undefined;
|
|
32
32
|
}>;
|
|
@@ -5,11 +5,11 @@ export declare const getAuditReportInputSchema: z.ZodObject<{
|
|
|
5
5
|
workspace_id: z.ZodString;
|
|
6
6
|
run_id: z.ZodString;
|
|
7
7
|
}, "strip", z.ZodTypeAny, {
|
|
8
|
-
workspace_id: string;
|
|
9
8
|
run_id: string;
|
|
10
|
-
}, {
|
|
11
9
|
workspace_id: string;
|
|
10
|
+
}, {
|
|
12
11
|
run_id: string;
|
|
12
|
+
workspace_id: string;
|
|
13
13
|
}>;
|
|
14
14
|
export type GetAuditReportInput = z.infer<typeof getAuditReportInputSchema>;
|
|
15
15
|
export declare function getAuditReportHandler(client: EdgeGateClient, input: GetAuditReportInput): Promise<ToolResult>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { EdgeGateClient } from "../client.js";
|
|
3
|
+
import type { ToolResult } from "./setup_workspace.js";
|
|
4
|
+
export declare const getByoAuditInputSchema: z.ZodObject<{
|
|
5
|
+
workspace_id: z.ZodString;
|
|
6
|
+
artifact_id: z.ZodOptional<z.ZodString>;
|
|
7
|
+
run_id: z.ZodOptional<z.ZodString>;
|
|
8
|
+
since: z.ZodOptional<z.ZodString>;
|
|
9
|
+
cursor: z.ZodOptional<z.ZodNumber>;
|
|
10
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
11
|
+
}, "strip", z.ZodTypeAny, {
|
|
12
|
+
workspace_id: string;
|
|
13
|
+
artifact_id?: string | undefined;
|
|
14
|
+
run_id?: string | undefined;
|
|
15
|
+
since?: string | undefined;
|
|
16
|
+
cursor?: number | undefined;
|
|
17
|
+
limit?: number | undefined;
|
|
18
|
+
}, {
|
|
19
|
+
workspace_id: string;
|
|
20
|
+
artifact_id?: string | undefined;
|
|
21
|
+
run_id?: string | undefined;
|
|
22
|
+
since?: string | undefined;
|
|
23
|
+
cursor?: number | undefined;
|
|
24
|
+
limit?: number | undefined;
|
|
25
|
+
}>;
|
|
26
|
+
export type GetByoAuditInput = z.infer<typeof getByoAuditInputSchema>;
|
|
27
|
+
export declare function getByoAuditHandler(client: EdgeGateClient, input: GetByoAuditInput): Promise<ToolResult>;
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { EdgeGateError } from "../client.js";
|
|
3
|
+
export const getByoAuditInputSchema = z.object({
|
|
4
|
+
workspace_id: z.string().uuid(),
|
|
5
|
+
artifact_id: z
|
|
6
|
+
.string()
|
|
7
|
+
.uuid()
|
|
8
|
+
.optional()
|
|
9
|
+
.describe("Filter to events referencing this artifact."),
|
|
10
|
+
run_id: z
|
|
11
|
+
.string()
|
|
12
|
+
.uuid()
|
|
13
|
+
.optional()
|
|
14
|
+
.describe("Filter to events from this run."),
|
|
15
|
+
since: z
|
|
16
|
+
.string()
|
|
17
|
+
.datetime()
|
|
18
|
+
.optional()
|
|
19
|
+
.describe("ISO-8601 timestamp; only include events newer than this."),
|
|
20
|
+
cursor: z
|
|
21
|
+
.number()
|
|
22
|
+
.int()
|
|
23
|
+
.optional()
|
|
24
|
+
.describe("Opaque cursor returned by a previous call. Pass it back verbatim to " +
|
|
25
|
+
"fetch the next page; omit on the first call."),
|
|
26
|
+
limit: z
|
|
27
|
+
.number()
|
|
28
|
+
.int()
|
|
29
|
+
.min(1)
|
|
30
|
+
.max(500)
|
|
31
|
+
.optional()
|
|
32
|
+
.describe("Page size (1–500, default 100)."),
|
|
33
|
+
});
|
|
34
|
+
export async function getByoAuditHandler(client, input) {
|
|
35
|
+
try {
|
|
36
|
+
const page = await client.getByoAudit(input.workspace_id, {
|
|
37
|
+
artifact_id: input.artifact_id,
|
|
38
|
+
run_id: input.run_id,
|
|
39
|
+
since: input.since,
|
|
40
|
+
cursor: input.cursor,
|
|
41
|
+
limit: input.limit,
|
|
42
|
+
});
|
|
43
|
+
return renderAuditPage(page);
|
|
44
|
+
}
|
|
45
|
+
catch (err) {
|
|
46
|
+
if (err instanceof EdgeGateError) {
|
|
47
|
+
if (err.status === 402) {
|
|
48
|
+
return {
|
|
49
|
+
isError: true,
|
|
50
|
+
content: [
|
|
51
|
+
{
|
|
52
|
+
type: "text",
|
|
53
|
+
text: `BYO storage requires the Enterprise plan. ` +
|
|
54
|
+
`Contact sales: https://edgegate.frozo.ai/enterprise.`,
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
return {
|
|
60
|
+
isError: true,
|
|
61
|
+
content: [
|
|
62
|
+
{ type: "text", text: `EdgeGate returned ${err.status}: ${err.detail}` },
|
|
63
|
+
],
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
throw err;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
function truncate(value, max) {
|
|
70
|
+
if (value.length <= max)
|
|
71
|
+
return value;
|
|
72
|
+
return `${value.slice(0, max - 1)}…`;
|
|
73
|
+
}
|
|
74
|
+
function fmt(entry) {
|
|
75
|
+
const cells = [
|
|
76
|
+
entry.ts,
|
|
77
|
+
entry.event_type,
|
|
78
|
+
entry.outcome,
|
|
79
|
+
entry.error_code ?? "—",
|
|
80
|
+
truncate(entry.aws_request_id, 36),
|
|
81
|
+
truncate(entry.s3_key ?? "—", 48),
|
|
82
|
+
entry.bytes_read?.toLocaleString() ?? "—",
|
|
83
|
+
entry.run_id ? truncate(entry.run_id, 8) : "—",
|
|
84
|
+
];
|
|
85
|
+
return `| ${cells.join(" | ")} |`;
|
|
86
|
+
}
|
|
87
|
+
function renderAuditPage(page) {
|
|
88
|
+
if (page.entries.length === 0) {
|
|
89
|
+
return {
|
|
90
|
+
content: [
|
|
91
|
+
{
|
|
92
|
+
type: "text",
|
|
93
|
+
text: [
|
|
94
|
+
`No BYO storage audit events match these filters.`,
|
|
95
|
+
``,
|
|
96
|
+
`If you expected results, check that:`,
|
|
97
|
+
`- The workspace actually has BYO storage enabled (Enterprise plan).`,
|
|
98
|
+
`- The \`run_id\` / \`artifact_id\` / \`since\` filters aren't too narrow.`,
|
|
99
|
+
`- A run that consumed BYO artifacts has actually executed (verify probes ` +
|
|
100
|
+
`also appear here, every 6 hours).`,
|
|
101
|
+
].join("\n"),
|
|
102
|
+
},
|
|
103
|
+
],
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
const header = `| ts | event_type | outcome | error_code | aws_request_id | s3_key | bytes_read | run_id |`;
|
|
107
|
+
const sep = `|---|---|---|---|---|---|---|---|`;
|
|
108
|
+
const rows = page.entries.map(fmt).join("\n");
|
|
109
|
+
const lines = [
|
|
110
|
+
`BYO storage audit — ${page.entries.length} event(s)`,
|
|
111
|
+
``,
|
|
112
|
+
header,
|
|
113
|
+
sep,
|
|
114
|
+
rows,
|
|
115
|
+
``,
|
|
116
|
+
page.next_cursor === null
|
|
117
|
+
? `End of log.`
|
|
118
|
+
: `Call again with \`cursor: ${page.next_cursor}\` to fetch the next page.`,
|
|
119
|
+
``,
|
|
120
|
+
`Cross-reference \`aws_request_id\` against your own CloudTrail to confirm ` +
|
|
121
|
+
`EdgeGate's view of each S3 call matches yours.`,
|
|
122
|
+
];
|
|
123
|
+
return { content: [{ type: "text", text: lines.join("\n") }] };
|
|
124
|
+
}
|
|
125
|
+
//# sourceMappingURL=get_byo_audit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get_byo_audit.js","sourceRoot":"","sources":["../../src/tools/get_byo_audit.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;IAC/B,WAAW,EAAE,CAAC;SACX,MAAM,EAAE;SACR,IAAI,EAAE;SACN,QAAQ,EAAE;SACV,QAAQ,CAAC,6CAA6C,CAAC;IAC1D,MAAM,EAAE,CAAC;SACN,MAAM,EAAE;SACR,IAAI,EAAE;SACN,QAAQ,EAAE;SACV,QAAQ,CAAC,iCAAiC,CAAC;IAC9C,KAAK,EAAE,CAAC;SACL,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,EAAE;SACV,QAAQ,CAAC,0DAA0D,CAAC;IACvE,MAAM,EAAE,CAAC;SACN,MAAM,EAAE;SACR,GAAG,EAAE;SACL,QAAQ,EAAE;SACV,QAAQ,CACP,sEAAsE;QACpE,8CAA8C,CACjD;IACH,KAAK,EAAE,CAAC;SACL,MAAM,EAAE;SACR,GAAG,EAAE;SACL,GAAG,CAAC,CAAC,CAAC;SACN,GAAG,CAAC,GAAG,CAAC;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,iCAAiC,CAAC;CAC/C,CAAC,CAAC;AAIH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,MAAsB,EACtB,KAAuB;IAEvB,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,YAAY,EAAE;YACxD,WAAW,EAAE,KAAK,CAAC,WAAW;YAC9B,MAAM,EAAE,K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AAC"}
|
|
@@ -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 getHuggingfaceIntegrationInputSchema: z.ZodObject<{
|
|
5
|
+
workspace_id: z.ZodString;
|
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
|
7
|
+
workspace_id: string;
|
|
8
|
+
}, {
|
|
9
|
+
workspace_id: string;
|
|
10
|
+
}>;
|
|
11
|
+
export type GetHuggingfaceIntegrationInput = z.infer<typeof getHuggingfaceIntegrationInputSchema>;
|
|
12
|
+
export declare function getHuggingfaceIntegrationHandler(client: EdgeGateClient, input: GetHuggingfaceIntegrationInput): Promise<ToolResult>;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { EdgeGateError } from "../client.js";
|
|
3
|
+
export const getHuggingfaceIntegrationInputSchema = z.object({
|
|
4
|
+
workspace_id: z.string().uuid(),
|
|
5
|
+
});
|
|
6
|
+
export async function getHuggingfaceIntegrationHandler(client, input) {
|
|
7
|
+
try {
|
|
8
|
+
const status = await client.getHuggingFaceIntegration(input.workspace_id);
|
|
9
|
+
return {
|
|
10
|
+
content: [
|
|
11
|
+
{
|
|
12
|
+
type: "text",
|
|
13
|
+
text: [
|
|
14
|
+
`HuggingFace integration: **${status.status}**`,
|
|
15
|
+
``,
|
|
16
|
+
`- token: \`****${status.token_last4}\` (encrypted at rest)`,
|
|
17
|
+
`- connected: ${status.created_at}`,
|
|
18
|
+
`- last updated: ${status.updated_at}`,
|
|
19
|
+
``,
|
|
20
|
+
status.status === "disabled"
|
|
21
|
+
? `The integration is paused. Re-enable via the dashboard or rotate to refresh.`
|
|
22
|
+
: `The token is being used for HuggingFace import calls in this workspace.`,
|
|
23
|
+
].join("\n"),
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
catch (err) {
|
|
29
|
+
if (err instanceof EdgeGateError) {
|
|
30
|
+
if (err.status === 404) {
|
|
31
|
+
return {
|
|
32
|
+
content: [
|
|
33
|
+
{
|
|
34
|
+
type: "text",
|
|
35
|
+
text: [
|
|
36
|
+
`No HuggingFace integration connected to this workspace.`,
|
|
37
|
+
``,
|
|
38
|
+
`Imports currently use anonymous access — only repos with truly public ONNX files work. To unlock private / gated / Qualcomm-org repos, call \`edgegate_connect_huggingface\` with a personal token from https://huggingface.co/settings/tokens.`,
|
|
39
|
+
].join("\n"),
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
return {
|
|
45
|
+
isError: true,
|
|
46
|
+
content: [{ type: "text", text: `EdgeGate returned ${err.status}: ${err.detail}` }],
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
throw err;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=get_huggingface_integration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get_huggingface_integration.js","sourceRoot":"","sources":["../../src/tools/get_huggingface_integration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAkB,aAAa,EAAE,MAAM,cAAc,CAAC;AAG7D,MAAM,CAAC,MAAM,oCAAoC,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3D,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;CAChC,CAAC,CAAC;AAMH,MAAM,CAAC,KAAK,UAAU,gCAAgC,CACpD,MAAsB,EACtB,KAAqC;IAErC,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,yBAAyB,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;QAC1E,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE;wBACJ,8BAA8B,MAAM,CAAC,MAAM,IAAI;wBAC/C,EAAE;wBACF,kBAAkB,MAAM,CAAC,WAAW,wBAAwB;wBAC5D,gBAAgB,MAAM,CAAC,UAAU,EAAE;wBACnC,mBAAmB,MAAM,CAAC,UAAU,EAAE;wBACtC,EAAE;wBACF,MAAM,CAAC,MAAM,KAAK,UAAU;4BAC1B,CAAC,CAAC,8EAA8E;4BAChF,CAAC,CAAC,yEAAyE;qBAC9E,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;wBACP;4BACE,IAAI,EAAE,MAAM;4BACZ,IAAI,EAAE;gCACJ,yDAAyD;gCACzD,EAAE;gCACF,iPAAiP;6BAClP,CAAC,IAAI,CAAC,IAAI,CAAC;yBACb;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"}
|
|
@@ -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 getQaihubIntegrationInputSchema: z.ZodObject<{
|
|
5
|
+
workspace_id: z.ZodString;
|
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
|
7
|
+
workspace_id: string;
|
|
8
|
+
}, {
|
|
9
|
+
workspace_id: string;
|
|
10
|
+
}>;
|
|
11
|
+
export type GetQaihubIntegrationInput = z.infer<typeof getQaihubIntegrationInputSchema>;
|
|
12
|
+
export declare function getQaihubIntegrationHandler(client: EdgeGateClient, input: GetQaihubIntegrationInput): Promise<ToolResult>;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { EdgeGateError } from "../client.js";
|
|
3
|
+
export const getQaihubIntegrationInputSchema = z.object({
|
|
4
|
+
workspace_id: z.string().uuid(),
|
|
5
|
+
});
|
|
6
|
+
export async function getQaihubIntegrationHandler(client, input) {
|
|
7
|
+
try {
|
|
8
|
+
const status = await client.getQaihubIntegration(input.workspace_id);
|
|
9
|
+
return {
|
|
10
|
+
content: [
|
|
11
|
+
{
|
|
12
|
+
type: "text",
|
|
13
|
+
text: [
|
|
14
|
+
`Qualcomm AI Hub integration: **${status.status}**`,
|
|
15
|
+
``,
|
|
16
|
+
`- token: \`****${status.token_last4}\` (encrypted at rest)`,
|
|
17
|
+
`- connected: ${status.created_at}`,
|
|
18
|
+
`- last updated: ${status.updated_at}`,
|
|
19
|
+
``,
|
|
20
|
+
status.status === "disabled"
|
|
21
|
+
? `The integration is paused — runs in this workspace will error with NO_AIHUB_TOKEN until it's re-enabled or rotated with a fresh token.`
|
|
22
|
+
: `The token is being used for all compile + profile jobs against Qualcomm AI Hub.`,
|
|
23
|
+
].join("\n"),
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
catch (err) {
|
|
29
|
+
if (err instanceof EdgeGateError) {
|
|
30
|
+
if (err.status === 404) {
|
|
31
|
+
return {
|
|
32
|
+
content: [
|
|
33
|
+
{
|
|
34
|
+
type: "text",
|
|
35
|
+
text: [
|
|
36
|
+
`No Qualcomm AI Hub integration connected to this workspace.`,
|
|
37
|
+
``,
|
|
38
|
+
`EdgeGate runs will error with \`NO_AIHUB_TOKEN\` until you connect a token. Get one at https://app.aihub.qualcomm.com/account/api-token and connect it via \`edgegate_connect_qaihub\`.`,
|
|
39
|
+
].join("\n"),
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
return {
|
|
45
|
+
isError: true,
|
|
46
|
+
content: [{ type: "text", text: `EdgeGate returned ${err.status}: ${err.detail}` }],
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
throw err;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=get_qaihub_integration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get_qaihub_integration.js","sourceRoot":"","sources":["../../src/tools/get_qaihub_integration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAkB,aAAa,EAAE,MAAM,cAAc,CAAC;AAG7D,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,CAAC,MAAM,CAAC;IACtD,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;CAChC,CAAC,CAAC;AAIH,MAAM,CAAC,KAAK,UAAU,2BAA2B,CAC/C,MAAsB,EACtB,KAAgC;IAEhC,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,oBAAoB,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;QACrE,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE;wBACJ,kCAAkC,MAAM,CAAC,MAAM,IAAI;wBACnD,EAAE;wBACF,kBAAkB,MAAM,CAAC,WAAW,wBAAwB;wBAC5D,gBAAgB,MAAM,CAAC,UAAU,EAAE;wBACnC,mBAAmB,MAAM,CAAC,UAAU,EAAE;wBACtC,EAAE;wBACF,MAAM,CAAC,MAAM,KAAK,UAAU;4BAC1B,CAAC,CAAC,wIAAwI;4BAC1I,CAAC,CAAC,iFAAiF;qBACtF,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;wBACP;4BACE,IAAI,EAAE,MAAM;4BACZ,IAAI,EAAE;gCACJ,6DAA6D;gCAC7D,EAAE;gCACF,yLAAyL;6BAC1L,CAAC,IAAI,CAAC,IAAI,CAAC;yBACb;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"}
|
|
@@ -5,8 +5,8 @@ export declare const getReportInputSchema: z.ZodObject<{
|
|
|
5
5
|
workspace_id: z.ZodString;
|
|
6
6
|
limit: z.ZodDefault<z.ZodNumber>;
|
|
7
7
|
}, "strip", z.ZodTypeAny, {
|
|
8
|
-
workspace_id: string;
|
|
9
8
|
limit: number;
|
|
9
|
+
workspace_id: string;
|
|
10
10
|
}, {
|
|
11
11
|
workspace_id: string;
|
|
12
12
|
limit?: number | undefined;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { EdgeGateClient } from "../client.js";
|
|
3
|
+
import type { ToolResult } from "./setup_workspace.js";
|
|
4
|
+
export declare const inviteMemberInputSchema: z.ZodObject<{
|
|
5
|
+
workspace_id: z.ZodString;
|
|
6
|
+
user_email: z.ZodString;
|
|
7
|
+
role: z.ZodEnum<["owner", "admin", "viewer"]>;
|
|
8
|
+
}, "strip", z.ZodTypeAny, {
|
|
9
|
+
workspace_id: string;
|
|
10
|
+
user_email: string;
|
|
11
|
+
role: "owner" | "admin" | "viewer";
|
|
12
|
+
}, {
|
|
13
|
+
workspace_id: string;
|
|
14
|
+
user_email: string;
|
|
15
|
+
role: "owner" | "admin" | "viewer";
|
|
16
|
+
}>;
|
|
17
|
+
export type InviteMemberInput = z.infer<typeof inviteMemberInputSchema>;
|
|
18
|
+
export declare function inviteMemberHandler(client: EdgeGateClient, input: InviteMemberInput): Promise<ToolResult>;
|