@prooflane/inspector-beta 0.1.0-beta.12 → 0.1.0-beta.14
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/server.mjs
CHANGED
|
@@ -16201,11 +16201,21 @@ function buildApp() {
|
|
|
16201
16201
|
if (capabilities)
|
|
16202
16202
|
return proxyControlPlane(req, reply, `${hostedSammyPath}/generations/${encodeURIComponent(req.params.id)}/approve`, { ...selectedBody(req.body, ["gateId", "name", "policyVersion", "expectedRevisionNumber"]), capabilities });
|
|
16203
16203
|
}), app.post("/api/intelligence/generations/:id/compile-suite", async (req, reply) => proxyControlPlane(req, reply, `${hostedSammyPath}/generations/${encodeURIComponent(req.params.id)}/compile-suite`, {})), app.get("/api/intelligence/usage", async (req, reply) => proxyControlPlane(req, reply, `${hostedSammyPath}/usage`, void 0, "GET")), app.get("/api/intelligence/datasets", async (req, reply) => proxyControlPlane(req, reply, `${hostedSammyPath}/datasets`, void 0, "GET")), app.post("/api/intelligence/datasets", async (req, reply) => proxyControlPlane(req, reply, `${hostedSammyPath}/datasets`, selectedBody(req.body, ["name", "format", "content"]))), app.get("/api/intelligence/native-artifacts", async (req, reply) => {
|
|
16204
|
+
reply.header("cache-control", "no-store");
|
|
16204
16205
|
let capabilities = hostedCapabilities(reply);
|
|
16205
|
-
if (
|
|
16206
|
-
|
|
16207
|
-
|
|
16208
|
-
|
|
16206
|
+
if (capabilities)
|
|
16207
|
+
try {
|
|
16208
|
+
let surface = await requestControlPlaneJson(req, "/v1/intelligence/surface", "POST", { capabilities });
|
|
16209
|
+
if (surface.connected !== !0 || typeof surface.fingerprint != "string" || !/^target-fp-[a-f0-9]{12}$/.test(surface.fingerprint))
|
|
16210
|
+
throw new ControlPlaneRequestError(502, "Prooflane could not bind native drafts to the connected target surface.");
|
|
16211
|
+
let query = new URLSearchParams();
|
|
16212
|
+
return req.query.pillar && query.set("pillar", req.query.pillar), req.query.generationId && query.set("generationId", req.query.generationId), query.set("targetFingerprint", surface.fingerprint), proxyControlPlane(req, reply, `${hostedSammyPath}/native-artifacts?${query.toString()}`, void 0, "GET");
|
|
16213
|
+
} catch (error) {
|
|
16214
|
+
let status = error instanceof ControlPlaneRequestError ? error.status : 502;
|
|
16215
|
+
return reply.code(status).send({
|
|
16216
|
+
error: (error instanceof Error ? error.message : "Native Contract handoff could not resolve the connected target.").slice(0, 300)
|
|
16217
|
+
});
|
|
16218
|
+
}
|
|
16209
16219
|
}), app.post("/api/intelligence/native-artifacts/:generationId/:testId/review", async (req, reply) => proxyControlPlane(req, reply, `${hostedSammyPath}/native-artifacts/${encodeURIComponent(req.params.generationId)}/${encodeURIComponent(req.params.testId)}/review`, selectedBody(req.body, ["action", "replacement", "trustedGolden", "expectedRevisionNumber", "comment"]))), app.post("/api/intelligence/generations/:id/items/manual", async (req, reply) => proxyControlPlane(req, reply, `${hostedSammyPath}/generations/${encodeURIComponent(req.params.id)}/items/manual`, selectedBody(req.body, ["test", "expectedRevisionNumber", "comment"]))), app.post("/api/intelligence/generations/:id/items/:itemId/review", async (req, reply) => proxyControlPlane(req, reply, `${hostedSammyPath}/generations/${encodeURIComponent(req.params.id)}/items/${encodeURIComponent(req.params.itemId)}/review`, selectedBody(req.body, ["action", "replacement", "expectedRevisionNumber", "comment"]))), app.post("/api/annotations", async (req, reply) => proxyControlPlane(req, reply, `${hostedSammyPath}/annotations`, selectedBody(req.body, ["targetType", "targetId", "labels", "text", "resolution"]))), app.get("/api/annotations/context", async (req, reply) => proxyControlPlane(req, reply, `${hostedSammyPath}/annotations${req.query.targetId ? `?targetId=${encodeURIComponent(req.query.targetId)}` : ""}`, void 0, "GET"));
|
|
16210
16220
|
}
|
|
16211
16221
|
app.get("/api/intelligence/evaluation-session", async (_req, reply) => {
|