@automagik/omni 2.260719.2 → 2.260719.4

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 CHANGED
@@ -125191,7 +125191,7 @@ import { fileURLToPath } from "url";
125191
125191
  // package.json
125192
125192
  var package_default = {
125193
125193
  name: "@automagik/omni",
125194
- version: "2.260719.2",
125194
+ version: "2.260719.4",
125195
125195
  description: "LLM-optimized CLI for Omni",
125196
125196
  type: "module",
125197
125197
  bin: {
@@ -227026,7 +227026,7 @@ var init_sentry_scrub = __esm(() => {
227026
227026
  var require_package7 = __commonJS((exports, module) => {
227027
227027
  module.exports = {
227028
227028
  name: "@omni/api",
227029
- version: "2.260719.2",
227029
+ version: "2.260719.4",
227030
227030
  type: "module",
227031
227031
  exports: {
227032
227032
  ".": {
@@ -358055,7 +358055,7 @@ function isAuthoritySubset(requested, allowed) {
358055
358055
  }
358056
358056
  function enforceInstanceCeiling(c, requestedAuthority) {
358057
358057
  const apiKey = c.get("apiKey");
358058
- if (!apiKey) {
358058
+ if (!apiKey || apiKey.profile === undefined || !isStringArray(apiKey.instanceAllowlist)) {
358059
358059
  return c.json({
358060
358060
  error: {
358061
358061
  code: "FORBIDDEN",
@@ -358271,32 +358271,25 @@ var init_keys = __esm(() => {
358271
358271
  expiresAt: data.expiresAt === null ? null : data.expiresAt ? new Date(data.expiresAt) : undefined
358272
358272
  };
358273
358273
  try {
358274
- if (data.instanceIds !== undefined || data.scopes !== undefined) {
358275
- let authorityDenied;
358276
- const result = await services.apiKeys.updateWithAuthorityGuard(id, updateOptions, (_current, next) => {
358277
- authorityDenied = enforceScopeCeiling(c, next.scopes);
358278
- if (authorityDenied)
358279
- return false;
358280
- authorityDenied = enforceInstanceCeiling(c, {
358281
- instanceIds: next.instanceIds,
358282
- profile: next.profile,
358283
- instanceAllowlist: next.instanceAllowlist
358284
- });
358285
- return authorityDenied == null;
358274
+ let authorityDenied;
358275
+ const result = await services.apiKeys.updateWithAuthorityGuard(id, updateOptions, (_current, next) => {
358276
+ authorityDenied = enforceScopeCeiling(c, next.scopes);
358277
+ if (authorityDenied)
358278
+ return false;
358279
+ authorityDenied = enforceInstanceCeiling(c, {
358280
+ instanceIds: next.instanceIds,
358281
+ profile: next.profile,
358282
+ instanceAllowlist: next.instanceAllowlist
358286
358283
  });
358287
- if (result.status === "denied") {
358288
- return authorityDenied ?? c.json({ error: { code: "FORBIDDEN", message: "API key authority exceeds caller authority" } }, 403);
358289
- }
358290
- if (result.status === "not_found") {
358291
- return c.json({ error: { code: "NOT_FOUND", message: "API key not found" } }, 404);
358292
- }
358293
- return c.json({ data: result.key });
358284
+ return authorityDenied == null;
358285
+ });
358286
+ if (result.status === "denied") {
358287
+ return authorityDenied ?? c.json({ error: { code: "FORBIDDEN", message: "API key authority exceeds caller authority" } }, 403);
358294
358288
  }
358295
- const updated = await services.apiKeys.update(id, updateOptions);
358296
- if (!updated) {
358289
+ if (result.status === "not_found") {
358297
358290
  return c.json({ error: { code: "NOT_FOUND", message: "API key not found" } }, 404);
358298
358291
  }
358299
- return c.json({ data: updated });
358292
+ return c.json({ data: result.key });
358300
358293
  } catch (error3) {
358301
358294
  const message2 = error3 instanceof Error ? error3.message : "Unknown error";
358302
358295
  if (message2.includes("Cannot rename primary")) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automagik/omni",
3
- "version": "2.260719.2",
3
+ "version": "2.260719.4",
4
4
  "description": "LLM-optimized CLI for Omni",
5
5
  "type": "module",
6
6
  "bin": {