edgegate-mcp 0.11.0 → 0.14.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/dist/client.d.ts +16 -1
- package/dist/client.js +36 -0
- package/dist/client.js.map +1 -1
- package/dist/server.js +111 -0
- package/dist/server.js.map +1 -1
- package/dist/tools/capture_reference.d.ts +49 -0
- package/dist/tools/capture_reference.js +102 -0
- package/dist/tools/capture_reference.js.map +1 -0
- package/dist/tools/check_genie_compile_status.d.ts +15 -0
- package/dist/tools/check_genie_compile_status.js +36 -0
- package/dist/tools/check_genie_compile_status.js.map +1 -0
- package/dist/tools/check_reference_capture_status.d.ts +15 -0
- package/dist/tools/check_reference_capture_status.js +31 -0
- package/dist/tools/check_reference_capture_status.js.map +1 -0
- package/dist/tools/compile_genie.d.ts +46 -0
- package/dist/tools/compile_genie.js +101 -0
- package/dist/tools/compile_genie.js.map +1 -0
- package/dist/tools/create_bg_run.d.ts +41 -0
- package/dist/tools/create_bg_run.js +109 -0
- package/dist/tools/create_bg_run.js.map +1 -0
- package/dist/tools/create_eval_set.d.ts +89 -0
- package/dist/tools/create_eval_set.js +128 -0
- package/dist/tools/create_eval_set.js.map +1 -0
- package/dist/tools/list_eval_packs.d.ts +6 -0
- package/dist/tools/list_eval_packs.js +38 -0
- package/dist/tools/list_eval_packs.js.map +1 -0
- package/dist/tools/list_eval_sets.d.ts +12 -0
- package/dist/tools/list_eval_sets.js +38 -0
- package/dist/tools/list_eval_sets.js.map +1 -0
- package/dist/tools/new_eval_set_version.d.ts +18 -0
- package/dist/tools/new_eval_set_version.js +47 -0
- package/dist/tools/new_eval_set_version.js.map +1 -0
- package/dist/tools/publish_eval_set.d.ts +18 -0
- package/dist/tools/publish_eval_set.js +74 -0
- package/dist/tools/publish_eval_set.js.map +1 -0
- package/dist/tools/update_eval_set.d.ts +56 -0
- package/dist/tools/update_eval_set.js +60 -0
- package/dist/tools/update_eval_set.js.map +1 -0
- package/dist/types.d.ts +147 -0
- package/dist/version.d.ts +2 -2
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { EdgeGateError } from "../client.js";
|
|
3
|
+
import { formatVersion, surfaceEvalError } from "./create_eval_set.js";
|
|
4
|
+
export const newEvalSetVersionInputSchema = z
|
|
5
|
+
.object({
|
|
6
|
+
workspace_id: z.string().uuid(),
|
|
7
|
+
eval_set_id: z.string().uuid(),
|
|
8
|
+
from_version: z
|
|
9
|
+
.string()
|
|
10
|
+
.uuid()
|
|
11
|
+
.describe("The version_id of a PUBLISHED version to seed the new draft from."),
|
|
12
|
+
})
|
|
13
|
+
.strict();
|
|
14
|
+
export async function newEvalSetVersionHandler(client, input) {
|
|
15
|
+
try {
|
|
16
|
+
const version = await client.newEvalSetVersion(input.workspace_id, input.eval_set_id, input.from_version);
|
|
17
|
+
return {
|
|
18
|
+
content: [
|
|
19
|
+
{
|
|
20
|
+
type: "text",
|
|
21
|
+
text: formatVersion(version, `Forked a new draft version seeded from the published cases:`) +
|
|
22
|
+
`\n\nEdit it with \`edgegate_update_eval_set\`, then \`edgegate_publish_eval_set\` to re-publish. ` +
|
|
23
|
+
`The original published version (and any references / runs bound to its sha) is untouched.`,
|
|
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: `Unknown eval set or from_version="${input.from_version}". ` +
|
|
37
|
+
`Check the ids with \`edgegate_list_eval_sets\`.`,
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
return surfaceEvalError(err);
|
|
43
|
+
}
|
|
44
|
+
throw err;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=new_eval_set_version.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"new_eval_set_version.js","sourceRoot":"","sources":["../../src/tools/new_eval_set_version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAkB,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7D,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAEvE,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC;KAC1C,MAAM,CAAC;IACN,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;IAC/B,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;IAC9B,YAAY,EAAE,CAAC;SACZ,MAAM,EAAE;SACR,IAAI,EAAE;SACN,QAAQ,CAAC,mEAAmE,CAAC;CACjF,CAAC;KACD,MAAM,EAAE,CAAC;AAIZ,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAC5C,MAAsB,EACtB,KAA6B;IAE7B,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,iBAAiB,CAC5C,KAAK,CAAC,YAAY,EAClB,KAAK,CAAC,WAAW,EACjB,KAAK,CAAC,YAAY,CACnB,CAAC;QAEF,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EACF,aAAa,CACX,OAAO,EACP,6DAA6D,CAC9D;wBACD,mGAAmG;wBACnG,2FAA2F;iBAC9F;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,EACF,qCAAqC,KAAK,CAAC,YAAY,KAAK;gCAC5D,iDAAiD;yBACpD;qBACF;iBACF,CAAC;YACJ,CAAC;YACD,OAAO,gBAAgB,CAAC,GAAG,CAAC,CAAC;QAC/B,CAAC;QACD,MAAM,GAAG,CAAC;IACZ,CAAC;AACH,CAAC"}
|
|
@@ -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 publishEvalSetInputSchema: z.ZodObject<{
|
|
5
|
+
workspace_id: z.ZodString;
|
|
6
|
+
eval_set_id: z.ZodString;
|
|
7
|
+
version_id: z.ZodString;
|
|
8
|
+
}, "strict", z.ZodTypeAny, {
|
|
9
|
+
workspace_id: string;
|
|
10
|
+
eval_set_id: string;
|
|
11
|
+
version_id: string;
|
|
12
|
+
}, {
|
|
13
|
+
workspace_id: string;
|
|
14
|
+
eval_set_id: string;
|
|
15
|
+
version_id: string;
|
|
16
|
+
}>;
|
|
17
|
+
export type PublishEvalSetInput = z.infer<typeof publishEvalSetInputSchema>;
|
|
18
|
+
export declare function publishEvalSetHandler(client: EdgeGateClient, input: PublishEvalSetInput): Promise<ToolResult>;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { EdgeGateError } from "../client.js";
|
|
3
|
+
import { formatVersion, surfaceEvalError } from "./create_eval_set.js";
|
|
4
|
+
export const publishEvalSetInputSchema = z
|
|
5
|
+
.object({
|
|
6
|
+
workspace_id: z.string().uuid(),
|
|
7
|
+
eval_set_id: z.string().uuid(),
|
|
8
|
+
version_id: z.string().uuid(),
|
|
9
|
+
})
|
|
10
|
+
.strict();
|
|
11
|
+
export async function publishEvalSetHandler(client, input) {
|
|
12
|
+
try {
|
|
13
|
+
const version = await client.publishEvalSet(input.workspace_id, input.eval_set_id, input.version_id);
|
|
14
|
+
const next = `\n\nFeed \`artifact_id\` and \`eval_set_sha256\` into a Behavioral-Gate run ` +
|
|
15
|
+
`(3b create-bg-run) as the eval-set inputs. The runner recomputes the sha after ` +
|
|
16
|
+
`download and confirms it matches.`;
|
|
17
|
+
return {
|
|
18
|
+
content: [
|
|
19
|
+
{
|
|
20
|
+
type: "text",
|
|
21
|
+
text: formatVersion(version, `Published eval set version — validated, hashed, signed, and frozen:`) + next,
|
|
22
|
+
},
|
|
23
|
+
],
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
catch (err) {
|
|
27
|
+
if (err instanceof EdgeGateError) {
|
|
28
|
+
if (err.status === 422) {
|
|
29
|
+
const violations = extractViolations(err.detail);
|
|
30
|
+
const body = violations.length > 0
|
|
31
|
+
? `Validation failed with ${violations.length} violation(s) — the version stays a draft:\n` +
|
|
32
|
+
violations.map((v) => ` - ${v}`).join("\n")
|
|
33
|
+
: `Validation failed (422) — the version stays a draft:\n${err.detail}`;
|
|
34
|
+
return { isError: true, content: [{ type: "text", text: body }] };
|
|
35
|
+
}
|
|
36
|
+
if (err.status === 404) {
|
|
37
|
+
return {
|
|
38
|
+
isError: true,
|
|
39
|
+
content: [
|
|
40
|
+
{
|
|
41
|
+
type: "text",
|
|
42
|
+
text: "Unknown eval set or version. Check the eval_set_id / version_id " +
|
|
43
|
+
"with `edgegate_list_eval_sets`.",
|
|
44
|
+
},
|
|
45
|
+
],
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
return surfaceEvalError(err);
|
|
49
|
+
}
|
|
50
|
+
throw err;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Pull the `violations` array out of a 422 `detail`. The backend returns
|
|
55
|
+
* `422 {detail: {violations: [...]}}`; the client stringifies `detail`, so
|
|
56
|
+
* `err.detail` is the JSON-stringified `{violations: [...]}` object (or a
|
|
57
|
+
* plain string fallback).
|
|
58
|
+
*/
|
|
59
|
+
function extractViolations(detail) {
|
|
60
|
+
try {
|
|
61
|
+
const parsed = JSON.parse(detail);
|
|
62
|
+
if (parsed &&
|
|
63
|
+
typeof parsed === "object" &&
|
|
64
|
+
"violations" in parsed &&
|
|
65
|
+
Array.isArray(parsed.violations)) {
|
|
66
|
+
return parsed.violations.map((v) => String(v));
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
catch {
|
|
70
|
+
// detail was plain text — fall through
|
|
71
|
+
}
|
|
72
|
+
return [];
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=publish_eval_set.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publish_eval_set.js","sourceRoot":"","sources":["../../src/tools/publish_eval_set.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAkB,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7D,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAEvE,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC;KACvC,MAAM,CAAC;IACN,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;IAC/B,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;IAC9B,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;CAC9B,CAAC;KACD,MAAM,EAAE,CAAC;AAIZ,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,MAAsB,EACtB,KAA0B;IAE1B,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,cAAc,CACzC,KAAK,CAAC,YAAY,EAClB,KAAK,CAAC,WAAW,EACjB,KAAK,CAAC,UAAU,CACjB,CAAC;QAEF,MAAM,IAAI,GACR,8EAA8E;YAC9E,iFAAiF;YACjF,mCAAmC,CAAC;QAEtC,OAAO;YACL,OAAO,EAAE;gB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AAM,KAAK,QAAQ;YAC1B,YAAY,IAAI,MAAM;YACtB,KAAK,CAAC,OAAO,CAAE,MAAkC,CAAC,UAAU,CAAC,EAC7D,CAAC;YACD,OAAQ,MAAoC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;QAChF,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,uCAAuC;IACzC,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { EdgeGateClient } from "../client.js";
|
|
3
|
+
import type { ToolResult } from "./setup_workspace.js";
|
|
4
|
+
export declare const updateEvalSetInputSchema: z.ZodObject<{
|
|
5
|
+
workspace_id: z.ZodString;
|
|
6
|
+
eval_set_id: z.ZodString;
|
|
7
|
+
version_id: z.ZodString;
|
|
8
|
+
cases: z.ZodArray<z.ZodObject<{
|
|
9
|
+
case_id: z.ZodString;
|
|
10
|
+
prompt: z.ZodString;
|
|
11
|
+
category: z.ZodEnum<["jailbreak", "forbidden_action", "task", "format"]>;
|
|
12
|
+
forbidden_actions: z.ZodArray<z.ZodString, "many">;
|
|
13
|
+
must_refuse: z.ZodBoolean;
|
|
14
|
+
expected_task_answer: z.ZodNullable<z.ZodString>;
|
|
15
|
+
}, "strict", z.ZodTypeAny, {
|
|
16
|
+
prompt: string;
|
|
17
|
+
case_id: string;
|
|
18
|
+
category: "jailbreak" | "forbidden_action" | "task" | "format";
|
|
19
|
+
forbidden_actions: string[];
|
|
20
|
+
must_refuse: boolean;
|
|
21
|
+
expected_task_answer: string | null;
|
|
22
|
+
}, {
|
|
23
|
+
prompt: string;
|
|
24
|
+
case_id: string;
|
|
25
|
+
category: "jailbreak" | "forbidden_action" | "task" | "format";
|
|
26
|
+
forbidden_actions: string[];
|
|
27
|
+
must_refuse: boolean;
|
|
28
|
+
expected_task_answer: string | null;
|
|
29
|
+
}>, "many">;
|
|
30
|
+
}, "strict", z.ZodTypeAny, {
|
|
31
|
+
workspace_id: string;
|
|
32
|
+
cases: {
|
|
33
|
+
prompt: string;
|
|
34
|
+
case_id: string;
|
|
35
|
+
category: "jailbreak" | "forbidden_action" | "task" | "format";
|
|
36
|
+
forbidden_actions: string[];
|
|
37
|
+
must_refuse: boolean;
|
|
38
|
+
expected_task_answer: string | null;
|
|
39
|
+
}[];
|
|
40
|
+
eval_set_id: string;
|
|
41
|
+
version_id: string;
|
|
42
|
+
}, {
|
|
43
|
+
workspace_id: string;
|
|
44
|
+
cases: {
|
|
45
|
+
prompt: string;
|
|
46
|
+
case_id: string;
|
|
47
|
+
category: "jailbreak" | "forbidden_action" | "task" | "format";
|
|
48
|
+
forbidden_actions: string[];
|
|
49
|
+
must_refuse: boolean;
|
|
50
|
+
expected_task_answer: string | null;
|
|
51
|
+
}[];
|
|
52
|
+
eval_set_id: string;
|
|
53
|
+
version_id: string;
|
|
54
|
+
}>;
|
|
55
|
+
export type UpdateEvalSetInput = z.infer<typeof updateEvalSetInputSchema>;
|
|
56
|
+
export declare function updateEvalSetHandler(client: EdgeGateClient, input: UpdateEvalSetInput): Promise<ToolResult>;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { EdgeGateError } from "../client.js";
|
|
3
|
+
import { evalCaseSchema, formatVersion, surfaceEvalError, } from "./create_eval_set.js";
|
|
4
|
+
export const updateEvalSetInputSchema = z
|
|
5
|
+
.object({
|
|
6
|
+
workspace_id: z.string().uuid(),
|
|
7
|
+
eval_set_id: z.string().uuid(),
|
|
8
|
+
version_id: z.string().uuid(),
|
|
9
|
+
cases: z
|
|
10
|
+
.array(evalCaseSchema)
|
|
11
|
+
.describe("The FULL replacement list of case dicts for this draft version."),
|
|
12
|
+
})
|
|
13
|
+
.strict();
|
|
14
|
+
export async function updateEvalSetHandler(client, input) {
|
|
15
|
+
try {
|
|
16
|
+
const version = await client.updateEvalSet(input.workspace_id, input.eval_set_id, input.version_id, input.cases);
|
|
17
|
+
return {
|
|
18
|
+
content: [
|
|
19
|
+
{
|
|
20
|
+
type: "text",
|
|
21
|
+
text: formatVersion(version, `Updated draft version (cases fully replaced):`) +
|
|
22
|
+
`\n\nStill a draft — call \`edgegate_publish_eval_set\` to validate, hash, sign, and freeze it.`,
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
catch (err) {
|
|
28
|
+
if (err instanceof EdgeGateError) {
|
|
29
|
+
if (err.status === 409) {
|
|
30
|
+
return {
|
|
31
|
+
isError: true,
|
|
32
|
+
content: [
|
|
33
|
+
{
|
|
34
|
+
type: "text",
|
|
35
|
+
text: "This version is already published and is immutable. To change a " +
|
|
36
|
+
"published set, fork a fresh draft with " +
|
|
37
|
+
`\`edgegate_new_eval_set_version({ workspace_id, eval_set_id, from_version: "${input.version_id}" })\`, ` +
|
|
38
|
+
"edit that draft, then publish it.",
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
if (err.status === 404) {
|
|
44
|
+
return {
|
|
45
|
+
isError: true,
|
|
46
|
+
content: [
|
|
47
|
+
{
|
|
48
|
+
type: "text",
|
|
49
|
+
text: "Unknown eval set or version. Check the eval_set_id / version_id " +
|
|
50
|
+
"with `edgegate_list_eval_sets`.",
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
return surfaceEvalError(err);
|
|
56
|
+
}
|
|
57
|
+
throw err;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=update_eval_set.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update_eval_set.js","sourceRoot":"","sources":["../../src/tools/update_eval_set.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAk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,IAAI,GAAG,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;gBACvB,OAAO;oBACL,OAAO,EAAE,IAAI;oBACb,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,MAAM;4BACZ,IAAI,EACF,kEAAkE;gCAClE,iCAAiC;yBACpC;qBACF;iBACF,CAAC;YACJ,CAAC;YACD,OAAO,gBAAgB,CAAC,GAAG,CAAC,CAAC;QAC/B,CAAC;QACD,MAAM,GAAG,CAAC;IACZ,CAAC;AACH,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -416,6 +416,153 @@ export interface ByoAuditPage {
|
|
|
416
416
|
entries: ByoAuditEntry[];
|
|
417
417
|
next_cursor: number | null;
|
|
418
418
|
}
|
|
419
|
+
/**
|
|
420
|
+
* Balance counts returned at publish and in pack summaries. See the eval-set
|
|
421
|
+
* authoring contract §4 — the floor is ≥5 must_refuse_with_forbidden cases and
|
|
422
|
+
* ≥1 task case.
|
|
423
|
+
*/
|
|
424
|
+
export interface EvalBalance {
|
|
425
|
+
must_refuse: number;
|
|
426
|
+
must_refuse_with_forbidden: number;
|
|
427
|
+
task: number;
|
|
428
|
+
benign: number;
|
|
429
|
+
total: number;
|
|
430
|
+
}
|
|
431
|
+
/**
|
|
432
|
+
* One behavioral eval case. Byte-faithful to edgegate/bg/eval_set.py — exactly
|
|
433
|
+
* six fields. See the eval-set authoring contract §3.
|
|
434
|
+
*/
|
|
435
|
+
export interface EvalCase {
|
|
436
|
+
case_id: string;
|
|
437
|
+
prompt: string;
|
|
438
|
+
category: "jailbreak" | "forbidden_action" | "task" | "format";
|
|
439
|
+
forbidden_actions: string[];
|
|
440
|
+
must_refuse: boolean;
|
|
441
|
+
expected_task_answer: string | null;
|
|
442
|
+
}
|
|
443
|
+
/**
|
|
444
|
+
* A bundled starter pack a customer can clone from. Returned by
|
|
445
|
+
* GET /v1/eval-packs.
|
|
446
|
+
*/
|
|
447
|
+
export interface EvalPack {
|
|
448
|
+
id: string;
|
|
449
|
+
name: string;
|
|
450
|
+
case_count: number;
|
|
451
|
+
balance: EvalBalance;
|
|
452
|
+
}
|
|
453
|
+
/**
|
|
454
|
+
* An eval-set version. Returned by create / update / publish / new_version.
|
|
455
|
+
* `eval_set_sha256`, `artifact_id`, `balance`, and `published_at` are null
|
|
456
|
+
* until the version is published. See the contract §8.
|
|
457
|
+
*/
|
|
458
|
+
export interface EvalSetVersion {
|
|
459
|
+
id: UUID;
|
|
460
|
+
eval_set_id: UUID;
|
|
461
|
+
version: number;
|
|
462
|
+
status: "draft" | "published";
|
|
463
|
+
eval_set_sha256: string | null;
|
|
464
|
+
artifact_id: UUID | null;
|
|
465
|
+
balance: EvalBalance | null;
|
|
466
|
+
cases: EvalCase[];
|
|
467
|
+
created_at: string;
|
|
468
|
+
published_at: string | null;
|
|
469
|
+
}
|
|
470
|
+
/**
|
|
471
|
+
* Summary row from GET /v1/workspaces/{ws}/eval-sets. See the contract §7.3.
|
|
472
|
+
*/
|
|
473
|
+
export interface EvalSetSummary {
|
|
474
|
+
id: UUID;
|
|
475
|
+
name: string;
|
|
476
|
+
created_at: string;
|
|
477
|
+
latest_version: number;
|
|
478
|
+
}
|
|
479
|
+
/**
|
|
480
|
+
* Body for POST /v1/workspaces/{ws}/reference-captures. Mirrors the backend
|
|
481
|
+
* `ReferenceCaptureRequest` model (edgegate/api/routes/reference_capture.py).
|
|
482
|
+
* Exactly one flavor selector — `hf_repo` (auto-FP16) XOR
|
|
483
|
+
* `reference_upload_artifact_id` (golden) — must be set; else 422.
|
|
484
|
+
*/
|
|
485
|
+
export interface ReferenceCaptureBody {
|
|
486
|
+
eval_set_artifact_id: UUID;
|
|
487
|
+
system_prompt: string;
|
|
488
|
+
decode_config?: Record<string, unknown>;
|
|
489
|
+
hf_repo?: string;
|
|
490
|
+
reference_upload_artifact_id?: UUID;
|
|
491
|
+
}
|
|
492
|
+
/**
|
|
493
|
+
* Response (202) from POST /v1/workspaces/{ws}/reference-captures.
|
|
494
|
+
*/
|
|
495
|
+
export interface ReferenceCaptureJob {
|
|
496
|
+
job_id: UUID;
|
|
497
|
+
flavor: string;
|
|
498
|
+
status: string;
|
|
499
|
+
}
|
|
500
|
+
/**
|
|
501
|
+
* Response from GET /v1/workspaces/{ws}/reference-captures/{job_id}. The
|
|
502
|
+
* `reference_artifact_id` (an `ArtifactKind.REFERENCE` artifact) is populated
|
|
503
|
+
* only when `status` is "done"; feed it into edgegate_create_bg_run.
|
|
504
|
+
*/
|
|
505
|
+
export interface ReferenceCaptureStatus {
|
|
506
|
+
job_id: UUID;
|
|
507
|
+
status: string;
|
|
508
|
+
reference_artifact_id: UUID | null;
|
|
509
|
+
}
|
|
510
|
+
/**
|
|
511
|
+
* Body for POST /v1/workspaces/{ws}/genie-compile. Mirrors the backend
|
|
512
|
+
* `GenieCompileRequest` (edgegate/api/routes/compile_genie.py). Exactly one
|
|
513
|
+
* lane selector — `hf_repo` (Lane A) XOR `onnx_artifact_ids` (Lane B,
|
|
514
|
+
* genie-ready multi-part) XOR `bundle_artifact_id` (Lane C, precompiled) —
|
|
515
|
+
* decides the lane; empty/multi-selector → 422.
|
|
516
|
+
*/
|
|
517
|
+
export interface GenieCompileBody {
|
|
518
|
+
device_label: string;
|
|
519
|
+
hf_repo?: string;
|
|
520
|
+
onnx_artifact_ids?: UUID[];
|
|
521
|
+
bundle_artifact_id?: UUID;
|
|
522
|
+
}
|
|
523
|
+
/**
|
|
524
|
+
* Response (202) from POST /v1/workspaces/{ws}/genie-compile. Mirrors the
|
|
525
|
+
* backend `GenieCompileAccepted` schema.
|
|
526
|
+
*/
|
|
527
|
+
export interface GenieCompileJob {
|
|
528
|
+
job_id: UUID;
|
|
529
|
+
lane: string;
|
|
530
|
+
status: string;
|
|
531
|
+
}
|
|
532
|
+
/**
|
|
533
|
+
* Response from GET /v1/workspaces/{ws}/genie-compile/{job_id}. Mirrors the
|
|
534
|
+
* backend `GenieCompileStatus` schema. The `bundle_artifact_id` is populated
|
|
535
|
+
* only when `status` is "done"; feed it into edgegate_create_bg_run.
|
|
536
|
+
*/
|
|
537
|
+
export interface GenieCompileStatus {
|
|
538
|
+
job_id: UUID;
|
|
539
|
+
lane: string;
|
|
540
|
+
status: string;
|
|
541
|
+
bundle_artifact_id: UUID | null;
|
|
542
|
+
}
|
|
543
|
+
/**
|
|
544
|
+
* Body for POST /v1/workspaces/{ws}/bg-runs. Mirrors the backend
|
|
545
|
+
* `BgRunCreateRequest` (edgegate/api/routes/compile_genie.py). Wires a
|
|
546
|
+
* compiled bundle + eval set + reference into a Run (populates
|
|
547
|
+
* `Run.runner_config_json`).
|
|
548
|
+
*/
|
|
549
|
+
export interface BgRunCreateBody {
|
|
550
|
+
bundle_artifact_id: UUID;
|
|
551
|
+
eval_set_artifact_id: UUID;
|
|
552
|
+
reference_artifact_id: UUID;
|
|
553
|
+
vendor?: string;
|
|
554
|
+
system_prompt?: string;
|
|
555
|
+
decode_config?: Record<string, unknown>;
|
|
556
|
+
device_label?: string;
|
|
557
|
+
}
|
|
558
|
+
/**
|
|
559
|
+
* Response (201) from POST /v1/workspaces/{ws}/bg-runs. Mirrors the backend
|
|
560
|
+
* `BgRunResponse` schema.
|
|
561
|
+
*/
|
|
562
|
+
export interface BgRunResponse {
|
|
563
|
+
run_id: UUID;
|
|
564
|
+
status: string;
|
|
565
|
+
}
|
|
419
566
|
/**
|
|
420
567
|
* Returned by POST /artifacts and POST /artifacts/byo. Mirrors the
|
|
421
568
|
* backend `ArtifactResponse` schema. `storage_url` for BYO artifacts is
|
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.14.0";
|
|
2
|
+
export declare const USER_AGENT = "edgegate-mcp/0.14.0";
|
package/dist/version.js
CHANGED