@automagik/omni 2.260717.5 → 2.260717.6
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/index.js +1 -1
- package/dist/server/index.js +29 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -125164,7 +125164,7 @@ import { fileURLToPath } from "url";
|
|
|
125164
125164
|
// package.json
|
|
125165
125165
|
var package_default = {
|
|
125166
125166
|
name: "@automagik/omni",
|
|
125167
|
-
version: "2.260717.
|
|
125167
|
+
version: "2.260717.6",
|
|
125168
125168
|
description: "LLM-optimized CLI for Omni",
|
|
125169
125169
|
type: "module",
|
|
125170
125170
|
bin: {
|
package/dist/server/index.js
CHANGED
|
@@ -225883,7 +225883,7 @@ var init_sentry_scrub = __esm(() => {
|
|
|
225883
225883
|
var require_package7 = __commonJS((exports, module) => {
|
|
225884
225884
|
module.exports = {
|
|
225885
225885
|
name: "@omni/api",
|
|
225886
|
-
version: "2.260717.
|
|
225886
|
+
version: "2.260717.6",
|
|
225887
225887
|
type: "module",
|
|
225888
225888
|
exports: {
|
|
225889
225889
|
".": {
|
|
@@ -284984,16 +284984,26 @@ var init_genie_signature = __esm(() => {
|
|
|
284984
284984
|
log59 = createLogger("api:genie-signature");
|
|
284985
284985
|
ED25519_SPKI_PREFIX = Buffer.from("302a300506032b6570032100", "hex");
|
|
284986
284986
|
genieSignatureMiddleware = createMiddleware(async (c, next) => {
|
|
284987
|
-
const services = c.get("services");
|
|
284988
|
-
if (!services?.genieHosts) {
|
|
284989
|
-
return next();
|
|
284990
|
-
}
|
|
284991
284987
|
const hostIdHeader = c.req.header(HEADER_HOST_ID);
|
|
284992
284988
|
const timestampHeader = c.req.header(HEADER_TIMESTAMP);
|
|
284993
284989
|
const signatureHeader = c.req.header(HEADER_SIGNATURE);
|
|
284994
284990
|
if (!hostIdHeader && !timestampHeader && !signatureHeader) {
|
|
284995
284991
|
return next();
|
|
284996
284992
|
}
|
|
284993
|
+
const services = c.get("services");
|
|
284994
|
+
if (!services?.genieHosts) {
|
|
284995
|
+
log59.warn("genie signature verification service unavailable", {
|
|
284996
|
+
hostId: hostIdHeader,
|
|
284997
|
+
method: c.req.method,
|
|
284998
|
+
path: new URL(c.req.url).pathname
|
|
284999
|
+
});
|
|
285000
|
+
return c.json({
|
|
285001
|
+
error: {
|
|
285002
|
+
code: "GENIE_SIGNATURE_SERVICE_UNAVAILABLE",
|
|
285003
|
+
message: "Genie host signature verification is temporarily unavailable."
|
|
285004
|
+
}
|
|
285005
|
+
}, 503);
|
|
285006
|
+
}
|
|
284997
285007
|
let body = "";
|
|
284998
285008
|
if (c.req.method !== "GET" && c.req.method !== "HEAD") {
|
|
284999
285009
|
body = await c.req.text();
|
|
@@ -285684,16 +285694,27 @@ var init_scopes = __esm(() => {
|
|
|
285684
285694
|
});
|
|
285685
285695
|
|
|
285686
285696
|
// ../api/src/lib/signed-host-scope-context.ts
|
|
285697
|
+
function hasAnyGenieSignatureHeader(c) {
|
|
285698
|
+
return GENIE_SIGNATURE_HEADERS.some((header) => c.req.header(header) !== undefined);
|
|
285699
|
+
}
|
|
285687
285700
|
function readSignedHostScopeContext(c) {
|
|
285688
285701
|
const hostId = c.get("signedBy");
|
|
285689
|
-
if (!hostId)
|
|
285702
|
+
if (!hostId) {
|
|
285703
|
+
if (hasAnyGenieSignatureHeader(c)) {
|
|
285704
|
+
return { kind: "invalid", hostId: c.req.header("x-genie-host-id") ?? "unknown" };
|
|
285705
|
+
}
|
|
285690
285706
|
return { kind: "unsigned" };
|
|
285707
|
+
}
|
|
285691
285708
|
const scopes = c.get("signedByScopes");
|
|
285692
285709
|
if (!Array.isArray(scopes) || !scopes.every((scope) => typeof scope === "string")) {
|
|
285693
285710
|
return { kind: "invalid", hostId };
|
|
285694
285711
|
}
|
|
285695
285712
|
return { kind: "valid", hostId, scopes };
|
|
285696
285713
|
}
|
|
285714
|
+
var GENIE_SIGNATURE_HEADERS;
|
|
285715
|
+
var init_signed_host_scope_context = __esm(() => {
|
|
285716
|
+
GENIE_SIGNATURE_HEADERS = ["x-genie-host-id", "x-genie-timestamp", "x-genie-signature"];
|
|
285717
|
+
});
|
|
285697
285718
|
|
|
285698
285719
|
// ../api/src/middleware/scope-enforcer.ts
|
|
285699
285720
|
function buildSegmentRegex(patternPath) {
|
|
@@ -285878,6 +285899,7 @@ var init_scope_enforcer = __esm(() => {
|
|
|
285878
285899
|
init_factory2();
|
|
285879
285900
|
init_profiles();
|
|
285880
285901
|
init_scopes();
|
|
285902
|
+
init_signed_host_scope_context();
|
|
285881
285903
|
init_api_keys();
|
|
285882
285904
|
log61 = createLogger("api:scope-enforcer");
|
|
285883
285905
|
OUTBOUND_SEND_PREFIXES = ["/messages/send"];
|
|
@@ -356909,6 +356931,7 @@ var init_keys = __esm(() => {
|
|
|
356909
356931
|
init_dist2();
|
|
356910
356932
|
init_zod();
|
|
356911
356933
|
init_resolve_profile();
|
|
356934
|
+
init_signed_host_scope_context();
|
|
356912
356935
|
init_date_query();
|
|
356913
356936
|
init_api_keys();
|
|
356914
356937
|
keysRoutes = new Hono2;
|