edgegate-mcp 0.2.1 → 0.3.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 +6 -2
- package/dist/client.d.ts +7 -1
- package/dist/client.js +6 -0
- package/dist/client.js.map +1 -1
- package/dist/server.js +10 -0
- package/dist/server.js.map +1 -1
- package/dist/tools/import_huggingface_model.d.ts +27 -0
- package/dist/tools/import_huggingface_model.js +141 -0
- package/dist/tools/import_huggingface_model.js.map +1 -0
- package/dist/types.d.ts +11 -0
- package/dist/version.d.ts +2 -2
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/plugin.json +6 -3
- package/skills/edgegate-compare.md +31 -0
- package/skills/edgegate-export.md +34 -0
- package/skills/edgegate-import.md +49 -0
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ MCP server for [EdgeGate](https://edgegate.frozo.ai) — set up edge-AI regressi
|
|
|
4
4
|
|
|
5
5
|
## What does it do?
|
|
6
6
|
|
|
7
|
-
EdgeGate runs AI model regression tests on real Snapdragon hardware via Qualcomm AI Hub, then produces signed evidence bundles you can attach to CI gates. This npm package exposes EdgeGate's REST API as
|
|
7
|
+
EdgeGate runs AI model regression tests on real Snapdragon hardware via Qualcomm AI Hub, then produces signed evidence bundles you can attach to CI gates. This npm package exposes EdgeGate's REST API as 10 MCP tools, plus bundled skills, so you can drive the whole flow from a prompt:
|
|
8
8
|
|
|
9
9
|
```
|
|
10
10
|
> Use the edgegate MCP to set up a CI gate for my MobileNet ONNX model.
|
|
@@ -69,6 +69,7 @@ See [docs/tools.md](./docs/tools.md) for the full tool reference. Quick list:
|
|
|
69
69
|
| `edgegate_setup_github_action` | Generate the GitHub Actions workflow + secret commands |
|
|
70
70
|
| `edgegate_compare_runs` | Diff two runs — gate flips, metric deltas, per-device breakdown, REGRESSION / IMPROVEMENT / NEUTRAL verdict |
|
|
71
71
|
| `edgegate_export_run_report` | Save a complete run report as a markdown file to disk (returns the file path + preview) |
|
|
72
|
+
| `edgegate_import_huggingface_model` | Import a public HuggingFace ONNX model — returns artifact_id ready for `edgegate_create_pipeline` |
|
|
72
73
|
|
|
73
74
|
## Skills
|
|
74
75
|
|
|
@@ -77,7 +78,10 @@ Slash commands you can invoke directly:
|
|
|
77
78
|
- `/edgegate-init` — full onboarding flow (zero → CI gate)
|
|
78
79
|
- `/edgegate-gate` — trigger a run on an existing pipeline
|
|
79
80
|
- `/edgegate-status` — check a run's status + metrics
|
|
80
|
-
- `/edgegate-audit` — fetch the
|
|
81
|
+
- `/edgegate-audit` — fetch the evidence bundle for a run
|
|
82
|
+
- `/edgegate-compare` — diff two runs (auto-baseline) with REGRESSION/IMPROVEMENT/NEUTRAL verdict
|
|
83
|
+
- `/edgegate-export` — save a run report as a markdown file (for PR comments, Slack, compliance)
|
|
84
|
+
- `/edgegate-import` — import a public Hugging Face ONNX model and get an artifact_id
|
|
81
85
|
|
|
82
86
|
## License
|
|
83
87
|
|
package/dist/client.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { APIKeyCreateResponse, Pipeline, RunBundle, RunComparison, RunDetail, RunSummary, Workspace, WorkflowTemplate } from "./types.js";
|
|
1
|
+
import type { APIKeyCreateResponse, HFImportJob, Pipeline, RunBundle, RunComparison, RunDetail, RunSummary, Workspace, WorkflowTemplate } from "./types.js";
|
|
2
2
|
export interface EdgeGateClientOptions {
|
|
3
3
|
apiUrl: string;
|
|
4
4
|
apiKey: string;
|
|
@@ -64,5 +64,11 @@ export declare class EdgeGateClient {
|
|
|
64
64
|
getRunDiff(workspaceId: string, runId: string): Promise<RunComparison>;
|
|
65
65
|
getRunBundle(workspaceId: string, runId: string): Promise<RunBundle>;
|
|
66
66
|
getWorkflowTemplate(workspaceId: string): Promise<WorkflowTemplate>;
|
|
67
|
+
startHuggingFaceImport(workspaceId: string, body: {
|
|
68
|
+
hf_repo_id: string;
|
|
69
|
+
revision?: string;
|
|
70
|
+
filename?: string;
|
|
71
|
+
}): Promise<HFImportJob>;
|
|
72
|
+
getHuggingFaceImportJob(workspaceId: string, jobId: string): Promise<HFImportJob>;
|
|
67
73
|
private request;
|
|
68
74
|
}
|
package/dist/client.js
CHANGED
|
@@ -60,6 +60,12 @@ export class EdgeGateClient {
|
|
|
60
60
|
async getWorkflowTemplate(workspaceId) {
|
|
61
61
|
return this.request("GET", `/v1/workspaces/${workspaceId}/github-action/template`);
|
|
62
62
|
}
|
|
63
|
+
async startHuggingFaceImport(workspaceId, body) {
|
|
64
|
+
return this.request("POST", `/v1/workspaces/${workspaceId}/artifacts/import-huggingface`, body);
|
|
65
|
+
}
|
|
66
|
+
async getHuggingFaceImportJob(workspaceId, jobId) {
|
|
67
|
+
return this.request("GET", `/v1/workspaces/${workspaceId}/artifacts/import-huggingface/${jobId}`);
|
|
68
|
+
}
|
|
63
69
|
async request(method, path, body) {
|
|
64
70
|
const url = `${this.apiUrl}${path}`;
|
|
65
71
|
const isIdempotent = method === "GET";
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAqB1C,MAAM,OAAO,aAAc,SAAQ,KAAK;IAEpB;IACA;IACA;IAHlB,YACkB,MAAc,EACd,MAAc,EACd,GAAW;QAE3B,KAAK,CAAC,YAAY,MAAM,OAAO,GAAG,KAAK,MAAM,EAAE,CAAC,CAAC;QAJjC,WAAM,GAAN,MAAM,CAAQ;QACd,WAAM,GAAN,MAAM,CAAQ;QACd,QAAG,GAAH,GAAG,CAAQ;QAG3B,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC;IAC9B,CAAC;CACF;AAED,MAAM,OAAO,cAAc;IACR,MAAM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,GACV,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,QAAQ,IAAI,IAAI;gBAClD,CAAC,CAAC,MAAM,CAAE,IAA4B,CAAC,MAAM,CAAC;gBAC9C,CAAC,CAAC,IAAI,IAAI,eAAe,CAAC;YAC9B,IAAI,IAAI,CAAC,MAAM,IAAI,GAAG,IAAI,YAAY,IAAI,OAAO,GAAG,QAAQ,EAAE,CAAC;gBAC7D,MAAM,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;gBAC/B,SAAS;YACX,CAAC;YACD,MAAM,IAAI,aAAa,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC;QACpD,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;IACpD,CAAC;CACF;AAED,SAAS,QAAQ,CAAC,IAAY;IAC5B,IAAI,CAAC;QAAC,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAAC,CAAC;IAAC,MAAM,CAAC;QAAC,OAAO,IAAI,CAAC;IAAC,CAAC;AACzD,CAAC;AACD,SAAS,KAAK,CAAC,EAAU;IACvB,OAAO,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;AAC/C,CAAC"}
|
package/dist/server.js
CHANGED
|
@@ -13,6 +13,7 @@ import { getAuditReportHandler, getAuditReportInputSchema } from "./tools/get_au
|
|
|
13
13
|
import { setupGithubActionHandler, setupGithubActionInputSchema, } from "./tools/setup_github_action.js";
|
|
14
14
|
import { compareRunsHandler, compareRunsInputSchema, } from "./tools/compare_runs.js";
|
|
15
15
|
import { exportRunReportHandler, exportRunReportInputSchema, } from "./tools/export_run_report.js";
|
|
16
|
+
import { importHuggingfaceModelHandler, importHuggingfaceModelInputSchema, } from "./tools/import_huggingface_model.js";
|
|
16
17
|
const TOOLS = [
|
|
17
18
|
{
|
|
18
19
|
name: "edgegate_setup_workspace",
|
|
@@ -79,6 +80,15 @@ const TOOLS = [
|
|
|
79
80
|
schema: exportRunReportInputSchema,
|
|
80
81
|
handler: exportRunReportHandler,
|
|
81
82
|
},
|
|
83
|
+
{
|
|
84
|
+
name: "edgegate_import_huggingface_model",
|
|
85
|
+
description: "Import a public Hugging Face model that contains a pre-built ONNX file. EdgeGate " +
|
|
86
|
+
"downloads the file and registers it as an Artifact. Returns the artifact_id you can " +
|
|
87
|
+
"pass directly to edgegate_create_pipeline. Polls until the import completes by default " +
|
|
88
|
+
"(poll_for_completion=true); set to false to return immediately with the job id.",
|
|
89
|
+
schema: importHuggingfaceModelInputSchema,
|
|
90
|
+
handler: importHuggingfaceModelHandler,
|
|
91
|
+
},
|
|
82
92
|
];
|
|
83
93
|
function getClient() {
|
|
84
94
|
const apiUrl = process.env.EDGEGATE_API_URL ?? "https://edgegateapi.frozo.ai";
|
package/dist/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAC9F,OAAO,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAC9F,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,sBAAs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AAG,EAAE,EAAE;IACnB,sCAAsC;IACtC,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;IAC7B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -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 importHuggingfaceModelInputSchema: z.ZodObject<{
|
|
5
|
+
workspace_id: z.ZodString;
|
|
6
|
+
hf_repo_id: z.ZodString;
|
|
7
|
+
revision: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
8
|
+
filename: z.ZodOptional<z.ZodString>;
|
|
9
|
+
poll_for_completion: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
10
|
+
max_poll_seconds: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
11
|
+
}, "strip", z.ZodTypeAny, {
|
|
12
|
+
workspace_id: string;
|
|
13
|
+
hf_repo_id: string;
|
|
14
|
+
revision: string;
|
|
15
|
+
poll_for_completion: boolean;
|
|
16
|
+
max_poll_seconds: number;
|
|
17
|
+
filename?: string | undefined;
|
|
18
|
+
}, {
|
|
19
|
+
workspace_id: string;
|
|
20
|
+
hf_repo_id: string;
|
|
21
|
+
revision?: string | undefined;
|
|
22
|
+
filename?: string | undefined;
|
|
23
|
+
poll_for_completion?: boolean | undefined;
|
|
24
|
+
max_poll_seconds?: number | undefined;
|
|
25
|
+
}>;
|
|
26
|
+
export type ImportHuggingfaceModelInput = z.infer<typeof importHuggingfaceModelInputSchema>;
|
|
27
|
+
export declare function importHuggingfaceModelHandler(client: EdgeGateClient, input: ImportHuggingfaceModelInput): Promise<ToolResult>;
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { EdgeGateError } from "../client.js";
|
|
3
|
+
export const importHuggingfaceModelInputSchema = z.object({
|
|
4
|
+
workspace_id: z.string().uuid(),
|
|
5
|
+
hf_repo_id: z
|
|
6
|
+
.string()
|
|
7
|
+
.regex(/^[^/]+\/[^/]+$/, 'hf_repo_id must be in "<owner>/<name>" format, e.g. "microsoft/resnet-50"'),
|
|
8
|
+
revision: z.string().optional().default("main"),
|
|
9
|
+
filename: z.string().optional(),
|
|
10
|
+
poll_for_completion: z.boolean().optional().default(true),
|
|
11
|
+
max_poll_seconds: z
|
|
12
|
+
.number()
|
|
13
|
+
.int()
|
|
14
|
+
.min(1)
|
|
15
|
+
.max(900)
|
|
16
|
+
.optional()
|
|
17
|
+
.default(300),
|
|
18
|
+
});
|
|
19
|
+
const POLL_INTERVAL_MS = 5_000;
|
|
20
|
+
export async function importHuggingfaceModelHandler(client, input) {
|
|
21
|
+
try {
|
|
22
|
+
const body = {
|
|
23
|
+
hf_repo_id: input.hf_repo_id,
|
|
24
|
+
revision: input.revision,
|
|
25
|
+
};
|
|
26
|
+
if (input.filename !== undefined) {
|
|
27
|
+
body.filename = input.filename;
|
|
28
|
+
}
|
|
29
|
+
const job = await client.startHuggingFaceImport(input.workspace_id, body);
|
|
30
|
+
if (!input.poll_for_completion) {
|
|
31
|
+
return {
|
|
32
|
+
content: [
|
|
33
|
+
{
|
|
34
|
+
type: "text",
|
|
35
|
+
text: [
|
|
36
|
+
`Import started for **${input.hf_repo_id}**.`,
|
|
37
|
+
``,
|
|
38
|
+
`- import_job_id: ${job.import_job_id}`,
|
|
39
|
+
`- status: ${job.status}`,
|
|
40
|
+
``,
|
|
41
|
+
`To check progress, call:`,
|
|
42
|
+
` \`edgegate_import_huggingface_model({ workspace_id: "${input.workspace_id}", hf_repo_id: "${input.hf_repo_id}", poll_for_completion: true })\``,
|
|
43
|
+
``,
|
|
44
|
+
`Or wait and re-run with the same arguments — polling will pick up where it left off.`,
|
|
45
|
+
].join("\n"),
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
// Poll until done / failed / timeout
|
|
51
|
+
const deadlineMs = Date.now() + input.max_poll_seconds * 1_000;
|
|
52
|
+
let latest = job;
|
|
53
|
+
while (latest.status !== "done" && latest.status !== "failed") {
|
|
54
|
+
if (Date.now() >= deadlineMs) {
|
|
55
|
+
return {
|
|
56
|
+
content: [
|
|
57
|
+
{
|
|
58
|
+
type: "text",
|
|
59
|
+
text: [
|
|
60
|
+
`Import of **${input.hf_repo_id}** is still running after ${input.max_poll_seconds}s.`,
|
|
61
|
+
``,
|
|
62
|
+
`- import_job_id: ${latest.import_job_id}`,
|
|
63
|
+
`- current status: ${latest.status}`,
|
|
64
|
+
``,
|
|
65
|
+
`The import is continuing in the background. Check back in a minute by calling this`,
|
|
66
|
+
`tool again with the same arguments (poll_for_completion: true).`,
|
|
67
|
+
].join("\n"),
|
|
68
|
+
},
|
|
69
|
+
],
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
await sleep(POLL_INTERVAL_MS);
|
|
73
|
+
latest = await client.getHuggingFaceImportJob(input.workspace_id, latest.import_job_id);
|
|
74
|
+
}
|
|
75
|
+
if (latest.status === "failed") {
|
|
76
|
+
return {
|
|
77
|
+
isError: true,
|
|
78
|
+
content: [
|
|
79
|
+
{
|
|
80
|
+
type: "text",
|
|
81
|
+
text: [
|
|
82
|
+
`Import of **${input.hf_repo_id}** failed.`,
|
|
83
|
+
``,
|
|
84
|
+
`- import_job_id: ${latest.import_job_id}`,
|
|
85
|
+
`- error: ${latest.error_detail ?? "unknown error"}`,
|
|
86
|
+
``,
|
|
87
|
+
`Common causes:`,
|
|
88
|
+
`- The repository does not contain an ONNX file (EdgeGate v1 requires pre-built ONNX)`,
|
|
89
|
+
`- The repository is private (only public repos are supported in v1)`,
|
|
90
|
+
`- The revision or filename you specified does not exist`,
|
|
91
|
+
].join("\n"),
|
|
92
|
+
},
|
|
93
|
+
],
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
// status === "done"
|
|
97
|
+
const sizeLabel = latest.size_bytes !== null
|
|
98
|
+
? `${(latest.size_bytes / 1_048_576).toFixed(1)} MB`
|
|
99
|
+
: "unknown size";
|
|
100
|
+
return {
|
|
101
|
+
content: [
|
|
102
|
+
{
|
|
103
|
+
type: "text",
|
|
104
|
+
text: [
|
|
105
|
+
`Import complete: **${input.hf_repo_id}**`,
|
|
106
|
+
``,
|
|
107
|
+
`- artifact_id: ${latest.artifact_id}`,
|
|
108
|
+
`- filename: ${latest.filename ?? "(unknown)"}`,
|
|
109
|
+
`- size: ${sizeLabel}`,
|
|
110
|
+
``,
|
|
111
|
+
`Use this artifact_id in \`edgegate_create_pipeline\` to gate this model:`,
|
|
112
|
+
` models: [{ name: "${input.hf_repo_id}", artifact_id: "${latest.artifact_id}" }]`,
|
|
113
|
+
].join("\n"),
|
|
114
|
+
},
|
|
115
|
+
],
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
catch (err) {
|
|
119
|
+
if (err instanceof EdgeGateError) {
|
|
120
|
+
return {
|
|
121
|
+
isError: true,
|
|
122
|
+
content: [
|
|
123
|
+
{
|
|
124
|
+
type: "text",
|
|
125
|
+
text: err.status === 402
|
|
126
|
+
? `Your plan does not allow Hugging Face imports. Upgrade at https://edgegate.frozo.ai/pricing.\n\nDetail: ${err.detail}`
|
|
127
|
+
: err.status === 401
|
|
128
|
+
? "EDGEGATE_API_KEY is missing, expired, or revoked. Generate a fresh key at " +
|
|
129
|
+
"https://edgegate.frozo.ai/workspace/<id>/settings#api-keys and retry."
|
|
130
|
+
: `EdgeGate returned ${err.status}: ${err.detail}`,
|
|
131
|
+
},
|
|
132
|
+
],
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
throw err;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
function sleep(ms) {
|
|
139
|
+
return new Promise((r) => setTimeout(r, ms));
|
|
140
|
+
}
|
|
141
|
+
//# sourceMappingURL=import_huggingface_model.js.map
|
|
@@ -0,0 +1 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AE,CAAC;YACjC,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAM;wBACZ,IAAI,EACF,GAAG,CAAC,MAAM,KAAK,GAAG;4BAChB,CAAC,CAAC,2GAA2G,GAAG,CAAC,MAAM,EAAE;4BACzH,CAAC,CAAC,GAAG,CAAC,MAAM,KAAK,GAAG;gCAClB,CAAC,CAAC,4EAA4E;oCAC5E,uEAAuE;gCACzE,CAAC,CAAC,qBAAqB,GAAG,CAAC,MAAM,KAAK,GAAG,CAAC,MAAM,EAAE;qBACzD;iBACF;aACF,CAAC;QACJ,CAAC;QACD,MAAM,GAAG,CAAC;IACZ,CAAC;AACH,CAAC;AAED,SAAS,KAAK,CAAC,EAAU;IACvB,OAAO,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;AAC/C,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -89,6 +89,17 @@ export interface AuditReport {
|
|
|
89
89
|
url?: string;
|
|
90
90
|
generated_at?: string;
|
|
91
91
|
}
|
|
92
|
+
export type HFImportStatus = "queued" | "downloading" | "uploading_to_hub" | "done" | "failed";
|
|
93
|
+
export interface HFImportJob {
|
|
94
|
+
import_job_id: string;
|
|
95
|
+
status: HFImportStatus;
|
|
96
|
+
hf_repo_id?: string;
|
|
97
|
+
revision?: string;
|
|
98
|
+
artifact_id: string | null;
|
|
99
|
+
size_bytes: number | null;
|
|
100
|
+
filename: string | null;
|
|
101
|
+
error_detail: string | null;
|
|
102
|
+
}
|
|
92
103
|
export interface MetricDelta {
|
|
93
104
|
current: number | null;
|
|
94
105
|
previous: number | null;
|
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.3.0";
|
|
2
|
+
export declare const USER_AGENT = "edgegate-mcp/0.3.0";
|
package/dist/version.js
CHANGED
package/package.json
CHANGED
package/plugin.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "edgegate",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Edge-AI regression gates from Claude Code — set up CI, run benchmarks, and fetch audit
|
|
3
|
+
"version": "0.3.0",
|
|
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",
|
|
7
7
|
"repository": "https://github.com/frozo-ai/edgegate-mcp",
|
|
@@ -21,6 +21,9 @@
|
|
|
21
21
|
"skills/edgegate-init.md",
|
|
22
22
|
"skills/edgegate-gate.md",
|
|
23
23
|
"skills/edgegate-status.md",
|
|
24
|
-
"skills/edgegate-audit.md"
|
|
24
|
+
"skills/edgegate-audit.md",
|
|
25
|
+
"skills/edgegate-compare.md",
|
|
26
|
+
"skills/edgegate-export.md",
|
|
27
|
+
"skills/edgegate-import.md"
|
|
25
28
|
]
|
|
26
29
|
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: edgegate-compare
|
|
3
|
+
description: Diff two EdgeGate runs in the same pipeline. Use when the user wants to know "what changed" between runs, "is this a regression", "compare these runs", or "show the delta vs main".
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /edgegate-compare
|
|
7
|
+
|
|
8
|
+
The user wants to compare two EdgeGate runs and understand the verdict.
|
|
9
|
+
|
|
10
|
+
## Steps
|
|
11
|
+
|
|
12
|
+
1. **Identify the candidate run.** If the user gave you a `run_id`, use it. If they said "the latest run" or didn't specify, call `edgegate_get_report` to list recent runs and ask which one they mean.
|
|
13
|
+
|
|
14
|
+
2. **Identify the baseline.**
|
|
15
|
+
- If the user provided a `baseline_run_id`, use it.
|
|
16
|
+
- Otherwise, omit the field — `edgegate_compare_runs` auto-selects the most recent PASSED run from the same pipeline (excluding the candidate). This is almost always what users want.
|
|
17
|
+
|
|
18
|
+
3. **Call `edgegate_compare_runs`** with `workspace_id`, `run_id`, and optionally `baseline_run_id`.
|
|
19
|
+
|
|
20
|
+
4. **Lead with the verdict.** The tool returns one of:
|
|
21
|
+
- **REGRESSION** — at least one gate flipped ✓→✗ OR a lower-is-better metric increased by ≥ 25%. Call this out at the top. List which gates flipped and what metric jumped.
|
|
22
|
+
- **IMPROVEMENT** — at least one ✗→✓ gate recovery with no regressions. Briefly highlight what got better.
|
|
23
|
+
- **NEUTRAL** — no significant changes. Reassure the user the run is safe to merge.
|
|
24
|
+
- **NO BASELINE** — this is the first run in the pipeline (nothing to compare against).
|
|
25
|
+
|
|
26
|
+
5. **For PR comments:** suggest the user attach the metric deltas table + verdict line. The audit trail (signed diff SHA-256) is in the response and worth including for compliance.
|
|
27
|
+
|
|
28
|
+
## Failure modes
|
|
29
|
+
|
|
30
|
+
- **404 on the candidate** — wrong `run_id`. Ask the user to double-check or call `edgegate_get_report`.
|
|
31
|
+
- **NO BASELINE on a pipeline that should have runs** — only one run exists in that pipeline OR the prior runs never completed. Check via `edgegate_get_report` and explain.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: edgegate-export
|
|
3
|
+
description: Save an EdgeGate run report as a markdown file on disk. Use when the user wants to "export", "download", "save", or "share" a run report — e.g. for a PR comment, Slack message, or compliance record.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /edgegate-export
|
|
7
|
+
|
|
8
|
+
The user wants the run report saved as a file they can share or attach.
|
|
9
|
+
|
|
10
|
+
## Steps
|
|
11
|
+
|
|
12
|
+
1. **Identify the run.** If they gave a `run_id`, use it. If not, call `edgegate_get_report` and ask which run.
|
|
13
|
+
|
|
14
|
+
2. **Pick the output path.**
|
|
15
|
+
- If the user said "save to Downloads" or similar, use `~/Downloads`.
|
|
16
|
+
- If they said "save next to my code" or didn't specify, default to the current working directory (the tool defaults to `./edgegate-run-{id-short}.md`).
|
|
17
|
+
- If they said "save as <name>", use that exact filename.
|
|
18
|
+
- The tool accepts directory paths (auto-appends a filename), file paths (used as-is), `~/` (expanded to home), and relative paths.
|
|
19
|
+
|
|
20
|
+
3. **Decide whether to include the diff.**
|
|
21
|
+
- If the user mentioned "for the PR" or "vs main" or "with the comparison", pass `include_diff: true` — adds the run-vs-baseline diff section to the report.
|
|
22
|
+
- Otherwise default `include_diff: false` — keeps the report focused on this run.
|
|
23
|
+
|
|
24
|
+
4. **Call `edgegate_export_run_report`** with the args.
|
|
25
|
+
|
|
26
|
+
5. **Confirm the file path** the tool returns and show the preview. Tell the user:
|
|
27
|
+
- The file is ready to attach to a PR comment, paste into Slack, or store with compliance records.
|
|
28
|
+
- If they want to also get a programmatic JSON version, point them at `edgegate_get_audit_report` for the bundle metadata.
|
|
29
|
+
|
|
30
|
+
## Failure modes
|
|
31
|
+
|
|
32
|
+
- **404 on the run** — wrong `run_id`. Check `edgegate_get_report`.
|
|
33
|
+
- **In-flight run** — the report omits gate results and bundle sections (they don't exist yet) but still writes a partial file noting the status. Tell the user to retry after the run completes.
|
|
34
|
+
- **Permission errors writing the file** — fall back to `/tmp/edgegate-run-{id}.md` and tell the user.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: edgegate-import
|
|
3
|
+
description: Import a public Hugging Face model (ONNX) into EdgeGate. Use when the user says "import model from huggingface", "pull this HF model", or references an "<owner>/<name>" repo they want to gate.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /edgegate-import
|
|
7
|
+
|
|
8
|
+
The user wants to import a model from Hugging Face into EdgeGate so it can be used in a regression pipeline.
|
|
9
|
+
|
|
10
|
+
## Triggers
|
|
11
|
+
|
|
12
|
+
Use this skill when the user says any of:
|
|
13
|
+
- "import the microsoft/resnet-50 model from Hugging Face"
|
|
14
|
+
- "pull this HF model: owner/name"
|
|
15
|
+
- "I have a model on HuggingFace at owner/name"
|
|
16
|
+
- "use owner/name from HF for my gate"
|
|
17
|
+
|
|
18
|
+
## Steps
|
|
19
|
+
|
|
20
|
+
1. **Confirm workspace.** If you don't have a `workspace_id`, call `edgegate_setup_workspace` with no args and ask the user which workspace to use.
|
|
21
|
+
|
|
22
|
+
2. **Identify the repo.** The repo id must be `"<owner>/<name>"` (e.g. `"microsoft/resnet-50"`). If the user gives a full URL like `https://huggingface.co/owner/name`, extract just `owner/name`. Ask if unclear.
|
|
23
|
+
|
|
24
|
+
3. **Optional: revision and filename.** If the user doesn't mention a specific branch/tag, omit `revision` (defaults to `"main"`). If they don't mention a specific file, omit `filename` (EdgeGate will autodetect the ONNX file).
|
|
25
|
+
|
|
26
|
+
4. **Call the tool.** Default to `poll_for_completion: true` so the import finishes before you continue. Use `poll_for_completion: false` only if the user explicitly says they want to kick it off and come back later.
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
edgegate_import_huggingface_model({
|
|
30
|
+
workspace_id: "<id>",
|
|
31
|
+
hf_repo_id: "microsoft/resnet-50",
|
|
32
|
+
revision: "main", // omit to use default
|
|
33
|
+
filename: "model.onnx", // omit to autodetect
|
|
34
|
+
poll_for_completion: true,
|
|
35
|
+
})
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
5. **On success.** The tool returns the `artifact_id`. Tell the user:
|
|
39
|
+
- The model has been imported and is registered as an artifact.
|
|
40
|
+
- They can now create a pipeline with it using `edgegate_create_pipeline` and pass `artifact_id` in the `models` array.
|
|
41
|
+
- Offer to set up the pipeline immediately if they give you their target devices and gates.
|
|
42
|
+
|
|
43
|
+
6. **On timeout.** The import is still running in the background. Ask the user to run `/edgegate-import` again in a minute — the tool will resume polling.
|
|
44
|
+
|
|
45
|
+
## Failure modes
|
|
46
|
+
|
|
47
|
+
- **"no ONNX file found"** — The repo doesn't contain a pre-built ONNX. EdgeGate v1 only supports repos with a pre-built ONNX file. Point the user to the dashboard upload flow for converting their own model: `https://edgegate.frozo.ai/workspace/<id>/models`.
|
|
48
|
+
- **"private repo"** — EdgeGate v1 only imports public HuggingFace repos. Ask the user to make the repo public or use the direct upload flow instead.
|
|
49
|
+
- **402 — plan limit** — Direct the user to `https://edgegate.frozo.ai/pricing` to upgrade.
|