@prooflane/inspector-beta 0.1.0-beta.13 → 0.1.0-beta.15

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/cli.mjs CHANGED
@@ -18889,7 +18889,7 @@ var POLICY_CACHE_VERSION = "prooflane-policy-cache-v1";
18889
18889
  var HASH2 = /^sha256:[a-f0-9]{64}$/;
18890
18890
  var CACHE_SEGMENT = /^[a-f0-9]{64}$/;
18891
18891
  var ID5 = /^[A-Za-z0-9][A-Za-z0-9_.:/-]{1,159}$/;
18892
- var ORGANIZATION = /^[A-Za-z0-9][A-Za-z0-9_.:@/-]{1,159}$/;
18892
+ var ORGANIZATION = /^[A-Za-z0-9][A-Za-z0-9_.:@|/-]{1,159}$/;
18893
18893
  var PROJECT3 = /^[A-Za-z0-9][A-Za-z0-9_.:-]{1,127}$/;
18894
18894
  var SLUG2 = /^[a-z0-9][a-z0-9_-]{1,63}$/;
18895
18895
  var MAX_CACHE_FILES = 2e4;
@@ -19812,7 +19812,7 @@ var MAX_CI_TOKEN_LIFETIME_SECONDS = 90 * 24 * 60 * 60;
19812
19812
  var MAX_CLOCK_SKEW_SECONDS = 300;
19813
19813
  var MAX_TOKEN_LENGTH = 16384;
19814
19814
  var MAX_CONTEXT_LENGTH = 32768;
19815
- var principalPattern2 = /^[A-Za-z0-9][A-Za-z0-9_.:@/-]{1,159}$/;
19815
+ var principalPattern2 = /^[A-Za-z0-9][A-Za-z0-9_.:@|/-]{1,159}$/;
19816
19816
  var projectPattern4 = /^[A-Za-z0-9][A-Za-z0-9_.:-]{1,127}$/;
19817
19817
  var hashPattern5 = /^sha256:[a-f0-9]{64}$/;
19818
19818
  var base64urlPattern = /^[A-Za-z0-9_-]+$/;
@@ -20129,7 +20129,7 @@ import { createHash as createHash24, randomUUID as randomUUID11 } from "node:cry
20129
20129
  import { closeSync as closeSync5, constants as constants4, existsSync as existsSync5, fstatSync as fstatSync5, linkSync as linkSync4, lstatSync as lstatSync4, mkdirSync as mkdirSync6, openSync as openSync5, readFileSync as readFileSync7, readdirSync as readdirSync3, rmdirSync, unlinkSync as unlinkSync4, writeFileSync as writeFileSync5 } from "node:fs";
20130
20130
  import { dirname as dirname7, join as join8, resolve as resolve9 } from "node:path";
20131
20131
  var QUEUE_VERSION = "prooflane-offline-run-sync-v1";
20132
- var PRINCIPAL = /^[A-Za-z0-9][A-Za-z0-9_.:@/-]{1,159}$/;
20132
+ var PRINCIPAL = /^[A-Za-z0-9][A-Za-z0-9_.:@|/-]{1,159}$/;
20133
20133
  var PROJECT4 = /^[A-Za-z0-9][A-Za-z0-9_.:-]{1,127}$/;
20134
20134
  var RUN_ID = /^[A-Za-z0-9][A-Za-z0-9_.:/-]{1,159}$/;
20135
20135
  var QUEUE_KEY = /^(?:offline|github):[a-f0-9]{64}$/;
package/dist/server.mjs CHANGED
@@ -16203,10 +16203,19 @@ function buildApp() {
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
16204
  reply.header("cache-control", "no-store");
16205
16205
  let capabilities = hostedCapabilities(reply);
16206
- if (!capabilities)
16207
- return;
16208
- let intel = await loadLegacyIntelligence(), target = capabilities.serverName?.trim() || "connected-mcp", profiles = intel.profileSurface(capabilities, { server: target, reachable: !0 }), query = new URLSearchParams();
16209
- return req.query.pillar && query.set("pillar", req.query.pillar), req.query.generationId && query.set("generationId", req.query.generationId), query.set("targetFingerprint", intel.targetFingerprint(profiles)), proxyControlPlane(req, reply, `${hostedSammyPath}/native-artifacts?${query.toString()}`, void 0, "GET");
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
+ }
16210
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"));
16211
16220
  }
16212
16221
  app.get("/api/intelligence/evaluation-session", async (_req, reply) => {