@drawbridge/drawbridge-utils 0.0.76 → 0.0.78
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/ai.cjs +9 -1
- package/dist/ai.d.cts +6 -1
- package/dist/ai.d.ts +6 -1
- package/dist/ai.js +9 -1
- package/dist/billing.cjs +8 -0
- package/dist/billing.d.cts +8 -0
- package/dist/billing.d.ts +8 -0
- package/dist/billing.js +8 -0
- package/dist/sanitize.cjs +12 -9
- package/dist/sanitize.d.cts +9 -8
- package/dist/sanitize.d.ts +9 -8
- package/dist/sanitize.js +1 -2
- package/package.json +1 -1
package/dist/ai.cjs
CHANGED
|
@@ -154,6 +154,14 @@ var import_drawbridge_telemetry2 = require("@drawbridge/drawbridge-telemetry");
|
|
|
154
154
|
var logger = (0, import_drawbridge_telemetry2.createLogger)();
|
|
155
155
|
var MARKUP = 1.3;
|
|
156
156
|
var cost = {
|
|
157
|
+
// gemini-3.5-flash — verified against Google's pricing page 2026-07-09:
|
|
158
|
+
// $0.15 cached / $1.50 input / $9.00 output per 1M tokens (thinking billed at
|
|
159
|
+
// output). ~3.6x the retired 2.5-flash output rate.
|
|
160
|
+
"gemini-3.5-flash": {
|
|
161
|
+
cached: 15,
|
|
162
|
+
input: 150,
|
|
163
|
+
output: 900
|
|
164
|
+
},
|
|
157
165
|
"gemini-2.5-flash": {
|
|
158
166
|
cached: 3,
|
|
159
167
|
input: 30,
|
|
@@ -254,7 +262,7 @@ var googleCircuit = circuit({
|
|
|
254
262
|
});
|
|
255
263
|
var models = {
|
|
256
264
|
image: "gemini-2.5-flash-image",
|
|
257
|
-
text: "gemini-
|
|
265
|
+
text: "gemini-3.5-flash"
|
|
258
266
|
};
|
|
259
267
|
var tokensFromMetadata = (metadata) => ({
|
|
260
268
|
cached: Number(metadata == null ? void 0 : metadata.cachedContentTokenCount) || 0,
|
package/dist/ai.d.cts
CHANGED
|
@@ -35,9 +35,14 @@ const googleCircuit = circuit({
|
|
|
35
35
|
timeout : 60000
|
|
36
36
|
});
|
|
37
37
|
|
|
38
|
+
// gemini-2.5-flash was retired by Google (generateContent → 404 "no longer
|
|
39
|
+
// available"), taking down every generation. gemini-3.5-flash is the current
|
|
40
|
+
// stable flash successor. The image model is a distinct model and still live,
|
|
41
|
+
// but is the same retired generation — expect it to follow, and bump it here
|
|
42
|
+
// (plus a billing entry) the moment it starts 404ing.
|
|
38
43
|
const models = {
|
|
39
44
|
image : 'gemini-2.5-flash-image',
|
|
40
|
-
text : 'gemini-
|
|
45
|
+
text : 'gemini-3.5-flash'
|
|
41
46
|
};
|
|
42
47
|
|
|
43
48
|
// Map Google's usageMetadata shape into the pricing.tokens shape.
|
package/dist/ai.d.ts
CHANGED
|
@@ -35,9 +35,14 @@ const googleCircuit = circuit({
|
|
|
35
35
|
timeout : 60000
|
|
36
36
|
});
|
|
37
37
|
|
|
38
|
+
// gemini-2.5-flash was retired by Google (generateContent → 404 "no longer
|
|
39
|
+
// available"), taking down every generation. gemini-3.5-flash is the current
|
|
40
|
+
// stable flash successor. The image model is a distinct model and still live,
|
|
41
|
+
// but is the same retired generation — expect it to follow, and bump it here
|
|
42
|
+
// (plus a billing entry) the moment it starts 404ing.
|
|
38
43
|
const models = {
|
|
39
44
|
image : 'gemini-2.5-flash-image',
|
|
40
|
-
text : 'gemini-
|
|
45
|
+
text : 'gemini-3.5-flash'
|
|
41
46
|
};
|
|
42
47
|
|
|
43
48
|
// Map Google's usageMetadata shape into the pricing.tokens shape.
|
package/dist/ai.js
CHANGED
|
@@ -130,6 +130,14 @@ import { createLogger } from "@drawbridge/drawbridge-telemetry";
|
|
|
130
130
|
var logger = createLogger();
|
|
131
131
|
var MARKUP = 1.3;
|
|
132
132
|
var cost = {
|
|
133
|
+
// gemini-3.5-flash — verified against Google's pricing page 2026-07-09:
|
|
134
|
+
// $0.15 cached / $1.50 input / $9.00 output per 1M tokens (thinking billed at
|
|
135
|
+
// output). ~3.6x the retired 2.5-flash output rate.
|
|
136
|
+
"gemini-3.5-flash": {
|
|
137
|
+
cached: 15,
|
|
138
|
+
input: 150,
|
|
139
|
+
output: 900
|
|
140
|
+
},
|
|
133
141
|
"gemini-2.5-flash": {
|
|
134
142
|
cached: 3,
|
|
135
143
|
input: 30,
|
|
@@ -230,7 +238,7 @@ var googleCircuit = circuit({
|
|
|
230
238
|
});
|
|
231
239
|
var models = {
|
|
232
240
|
image: "gemini-2.5-flash-image",
|
|
233
|
-
text: "gemini-
|
|
241
|
+
text: "gemini-3.5-flash"
|
|
234
242
|
};
|
|
235
243
|
var tokensFromMetadata = (metadata) => ({
|
|
236
244
|
cached: Number(metadata == null ? void 0 : metadata.cachedContentTokenCount) || 0,
|
package/dist/billing.cjs
CHANGED
|
@@ -163,6 +163,14 @@ var import_drawbridge_telemetry2 = require("@drawbridge/drawbridge-telemetry");
|
|
|
163
163
|
var logger = (0, import_drawbridge_telemetry2.createLogger)();
|
|
164
164
|
var MARKUP = 1.3;
|
|
165
165
|
var cost = {
|
|
166
|
+
// gemini-3.5-flash — verified against Google's pricing page 2026-07-09:
|
|
167
|
+
// $0.15 cached / $1.50 input / $9.00 output per 1M tokens (thinking billed at
|
|
168
|
+
// output). ~3.6x the retired 2.5-flash output rate.
|
|
169
|
+
"gemini-3.5-flash": {
|
|
170
|
+
cached: 15,
|
|
171
|
+
input: 150,
|
|
172
|
+
output: 900
|
|
173
|
+
},
|
|
166
174
|
"gemini-2.5-flash": {
|
|
167
175
|
cached: 3,
|
|
168
176
|
input: 30,
|
package/dist/billing.d.cts
CHANGED
|
@@ -31,6 +31,14 @@ const MARKUP = 1.3;
|
|
|
31
31
|
// Raw per-model provider rates in cents per 1,000,000 tokens — the wholesale
|
|
32
32
|
// cost. Sync from LiteLLM. Never apply markup here; `pricing` derives retail.
|
|
33
33
|
const cost = {
|
|
34
|
+
// gemini-3.5-flash — verified against Google's pricing page 2026-07-09:
|
|
35
|
+
// $0.15 cached / $1.50 input / $9.00 output per 1M tokens (thinking billed at
|
|
36
|
+
// output). ~3.6x the retired 2.5-flash output rate.
|
|
37
|
+
'gemini-3.5-flash' : {
|
|
38
|
+
cached : 15,
|
|
39
|
+
input : 150,
|
|
40
|
+
output : 900
|
|
41
|
+
},
|
|
34
42
|
'gemini-2.5-flash' : {
|
|
35
43
|
cached : 3,
|
|
36
44
|
input : 30,
|
package/dist/billing.d.ts
CHANGED
|
@@ -31,6 +31,14 @@ const MARKUP = 1.3;
|
|
|
31
31
|
// Raw per-model provider rates in cents per 1,000,000 tokens — the wholesale
|
|
32
32
|
// cost. Sync from LiteLLM. Never apply markup here; `pricing` derives retail.
|
|
33
33
|
const cost = {
|
|
34
|
+
// gemini-3.5-flash — verified against Google's pricing page 2026-07-09:
|
|
35
|
+
// $0.15 cached / $1.50 input / $9.00 output per 1M tokens (thinking billed at
|
|
36
|
+
// output). ~3.6x the retired 2.5-flash output rate.
|
|
37
|
+
'gemini-3.5-flash' : {
|
|
38
|
+
cached : 15,
|
|
39
|
+
input : 150,
|
|
40
|
+
output : 900
|
|
41
|
+
},
|
|
34
42
|
'gemini-2.5-flash' : {
|
|
35
43
|
cached : 3,
|
|
36
44
|
input : 30,
|
package/dist/billing.js
CHANGED
|
@@ -134,6 +134,14 @@ import { createLogger } from "@drawbridge/drawbridge-telemetry";
|
|
|
134
134
|
var logger = createLogger();
|
|
135
135
|
var MARKUP = 1.3;
|
|
136
136
|
var cost = {
|
|
137
|
+
// gemini-3.5-flash — verified against Google's pricing page 2026-07-09:
|
|
138
|
+
// $0.15 cached / $1.50 input / $9.00 output per 1M tokens (thinking billed at
|
|
139
|
+
// output). ~3.6x the retired 2.5-flash output rate.
|
|
140
|
+
"gemini-3.5-flash": {
|
|
141
|
+
cached: 15,
|
|
142
|
+
input: 150,
|
|
143
|
+
output: 900
|
|
144
|
+
},
|
|
137
145
|
"gemini-2.5-flash": {
|
|
138
146
|
cached: 3,
|
|
139
147
|
input: 30,
|
package/dist/sanitize.cjs
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
1
2
|
var __defProp = Object.defineProperty;
|
|
2
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
4
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
7
|
var __export = (target, all) => {
|
|
6
8
|
for (var name in all)
|
|
@@ -14,6 +16,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
14
16
|
}
|
|
15
17
|
return to;
|
|
16
18
|
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
17
27
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
28
|
|
|
19
29
|
// lib/sanitize.js
|
|
@@ -27,17 +37,10 @@ __export(sanitize_exports, {
|
|
|
27
37
|
sanitizeUrl: () => sanitizeUrl
|
|
28
38
|
});
|
|
29
39
|
module.exports = __toCommonJS(sanitize_exports);
|
|
30
|
-
|
|
31
|
-
// node_modules/tsup/assets/cjs_shims.js
|
|
32
|
-
var getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.tagName.toUpperCase() === "SCRIPT" ? document.currentScript.src : new URL("main.js", document.baseURI).href;
|
|
33
|
-
var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
|
|
34
|
-
|
|
35
|
-
// lib/sanitize.js
|
|
36
|
-
var import_node_module = require("module");
|
|
37
|
-
var disposableDomains = (0, import_node_module.createRequire)(importMetaUrl)("disposable-email-domains");
|
|
40
|
+
var import_disposable_email_domains = __toESM(require("disposable-email-domains/index.js"), 1);
|
|
38
41
|
var SCOPE_KEYS = ["organization", "account", "user", "owner"];
|
|
39
42
|
var DANGEROUS_OPERATORS = ["$where", "$function", "$accumulator"];
|
|
40
|
-
var disposableBlacklist = new Set(
|
|
43
|
+
var disposableBlacklist = new Set(import_disposable_email_domains.default.map((d) => d.toLowerCase()));
|
|
41
44
|
var stripDangerousOperators = (value) => {
|
|
42
45
|
if (Array.isArray(value)) {
|
|
43
46
|
return value.map(stripDangerousOperators);
|
package/dist/sanitize.d.cts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
//
|
|
4
|
-
// JSON import attribute
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
|
|
1
|
+
import disposableDomains from 'disposable-email-domains/index.js';
|
|
2
|
+
|
|
3
|
+
// disposable-email-domains' package `main` is a bare index.json, which under
|
|
4
|
+
// plain-Node ESM needs a JSON import attribute (Node <20.10) — hence this was
|
|
5
|
+
// previously loaded via createRequire. But createRequire pulls the `node:module`
|
|
6
|
+
// builtin, which browser bundlers (app-web/share via Turbopack) can't resolve,
|
|
7
|
+
// breaking the client build. The package also ships index.js — a plain-CJS
|
|
8
|
+
// re-export of the same list — so importing that entry works under Node
|
|
9
|
+
// (ESM + CJS) and in bundlers alike, with no node:module/createRequire.
|
|
9
10
|
|
|
10
11
|
const SCOPE_KEYS = [ 'organization', 'account', 'user', 'owner' ];
|
|
11
12
|
const DANGEROUS_OPERATORS = [ '$where', '$function', '$accumulator' ];
|
package/dist/sanitize.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
//
|
|
4
|
-
// JSON import attribute
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
|
|
1
|
+
import disposableDomains from 'disposable-email-domains/index.js';
|
|
2
|
+
|
|
3
|
+
// disposable-email-domains' package `main` is a bare index.json, which under
|
|
4
|
+
// plain-Node ESM needs a JSON import attribute (Node <20.10) — hence this was
|
|
5
|
+
// previously loaded via createRequire. But createRequire pulls the `node:module`
|
|
6
|
+
// builtin, which browser bundlers (app-web/share via Turbopack) can't resolve,
|
|
7
|
+
// breaking the client build. The package also ships index.js — a plain-CJS
|
|
8
|
+
// re-export of the same list — so importing that entry works under Node
|
|
9
|
+
// (ESM + CJS) and in bundlers alike, with no node:module/createRequire.
|
|
9
10
|
|
|
10
11
|
const SCOPE_KEYS = [ 'organization', 'account', 'user', 'owner' ];
|
|
11
12
|
const DANGEROUS_OPERATORS = [ '$where', '$function', '$accumulator' ];
|
package/dist/sanitize.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// lib/sanitize.js
|
|
2
|
-
import
|
|
3
|
-
var disposableDomains = createRequire(import.meta.url)("disposable-email-domains");
|
|
2
|
+
import disposableDomains from "disposable-email-domains/index.js";
|
|
4
3
|
var SCOPE_KEYS = ["organization", "account", "user", "owner"];
|
|
5
4
|
var DANGEROUS_OPERATORS = ["$where", "$function", "$accumulator"];
|
|
6
5
|
var disposableBlacklist = new Set(disposableDomains.map((d) => d.toLowerCase()));
|
package/package.json
CHANGED