omnigateway 0.12.4 → 0.12.5

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.
Files changed (3) hide show
  1. package/bin/omni.js +22 -5
  2. package/gateway.js +22 -5
  3. package/package.json +1 -1
package/bin/omni.js CHANGED
@@ -27741,12 +27741,29 @@ function closingTurn(contents, note2) {
27741
27741
  var hasCacheControl = (block) => ("cacheControl" in block) && block.cacheControl !== undefined;
27742
27742
  var PRUNED = "antigravity:tool-schema-pruned";
27743
27743
  var AGENT_PREAMBLE_DROPPED = "antigravity:agent-preamble-dropped";
27744
- function dropAgentPreamble(system, note2) {
27744
+ var BILLING_HEADER_DROPPED = "antigravity:billing-header-dropped";
27745
+ function dropFingerprints(system, note2) {
27745
27746
  const paragraphs = system.split(/(?:\r?\n){2,}/);
27746
- const kept = paragraphs.filter((p) => p.trim() !== AGENT_PREAMBLE);
27747
+ let preamble = false;
27748
+ let billing = false;
27749
+ const kept = paragraphs.filter((p) => {
27750
+ const trimmed = p.trim();
27751
+ if (trimmed === AGENT_PREAMBLE) {
27752
+ preamble = true;
27753
+ return false;
27754
+ }
27755
+ if (trimmed.startsWith(BILLING_PREFIX)) {
27756
+ billing = true;
27757
+ return false;
27758
+ }
27759
+ return true;
27760
+ });
27747
27761
  if (kept.length === paragraphs.length)
27748
27762
  return system;
27749
- note2(AGENT_PREAMBLE_DROPPED);
27763
+ if (preamble)
27764
+ note2(AGENT_PREAMBLE_DROPPED);
27765
+ if (billing)
27766
+ note2(BILLING_HEADER_DROPPED);
27750
27767
  return kept.join(`
27751
27768
 
27752
27769
  `);
@@ -28044,7 +28061,7 @@ function toAntigravityWire(req, model, identity) {
28044
28061
  contents: closingTurn(openingTurn(mergeSameRole(contents), note2), note2)
28045
28062
  };
28046
28063
  const joined = systemText(req.system, "antigravity", note2);
28047
- const system = joined === undefined ? undefined : dropAgentPreamble(joined, note2);
28064
+ const system = joined === undefined ? undefined : dropFingerprints(joined, note2);
28048
28065
  if (system !== undefined && system.trim().length > 0) {
28049
28066
  request2.systemInstruction = { parts: [{ text: system }] };
28050
28067
  }
@@ -37508,7 +37525,7 @@ function createServiceDeps(input2) {
37508
37525
  }
37509
37526
 
37510
37527
  // apps/cli/src/version.ts
37511
- var VERSION = "0.12.4";
37528
+ var VERSION = "0.12.5";
37512
37529
 
37513
37530
  // apps/cli/src/commands/service.ts
37514
37531
  function gatewayArgv(root) {
package/gateway.js CHANGED
@@ -33303,12 +33303,29 @@ function closingTurn(contents, note) {
33303
33303
  var hasCacheControl = (block) => ("cacheControl" in block) && block.cacheControl !== undefined;
33304
33304
  var PRUNED = "antigravity:tool-schema-pruned";
33305
33305
  var AGENT_PREAMBLE_DROPPED = "antigravity:agent-preamble-dropped";
33306
- function dropAgentPreamble(system, note) {
33306
+ var BILLING_HEADER_DROPPED = "antigravity:billing-header-dropped";
33307
+ function dropFingerprints(system, note) {
33307
33308
  const paragraphs = system.split(/(?:\r?\n){2,}/);
33308
- const kept = paragraphs.filter((p) => p.trim() !== AGENT_PREAMBLE);
33309
+ let preamble = false;
33310
+ let billing = false;
33311
+ const kept = paragraphs.filter((p) => {
33312
+ const trimmed = p.trim();
33313
+ if (trimmed === AGENT_PREAMBLE) {
33314
+ preamble = true;
33315
+ return false;
33316
+ }
33317
+ if (trimmed.startsWith(BILLING_PREFIX)) {
33318
+ billing = true;
33319
+ return false;
33320
+ }
33321
+ return true;
33322
+ });
33309
33323
  if (kept.length === paragraphs.length)
33310
33324
  return system;
33311
- note(AGENT_PREAMBLE_DROPPED);
33325
+ if (preamble)
33326
+ note(AGENT_PREAMBLE_DROPPED);
33327
+ if (billing)
33328
+ note(BILLING_HEADER_DROPPED);
33312
33329
  return kept.join(`
33313
33330
 
33314
33331
  `);
@@ -33606,7 +33623,7 @@ function toAntigravityWire(req, model, identity) {
33606
33623
  contents: closingTurn(openingTurn(mergeSameRole(contents), note), note)
33607
33624
  };
33608
33625
  const joined = systemText(req.system, "antigravity", note);
33609
- const system = joined === undefined ? undefined : dropAgentPreamble(joined, note);
33626
+ const system = joined === undefined ? undefined : dropFingerprints(joined, note);
33610
33627
  if (system !== undefined && system.trim().length > 0) {
33611
33628
  request2.systemInstruction = { parts: [{ text: system }] };
33612
33629
  }
@@ -62368,7 +62385,7 @@ function createRing(limits = DEFAULT_RING_LIMITS) {
62368
62385
  }
62369
62386
 
62370
62387
  // apps/gateway/src/version.ts
62371
- var VERSION = "0.12.4";
62388
+ var VERSION = "0.12.5";
62372
62389
 
62373
62390
  // apps/gateway/src/app.ts
62374
62391
  var ADMIN_SESSION_TTL_MS = 12 * 60 * 60 * 1000;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omnigateway",
3
- "version": "0.12.4",
3
+ "version": "0.12.5",
4
4
  "description": "Self-hosted AI gateway with Anthropic- and OpenAI-compatible APIs, an admin console, and a CLI",
5
5
  "license": "MIT",
6
6
  "author": "Harismawan <mail@harismawan.com>",