@agentguard-run/spend 0.2.1 → 0.2.2
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/CHANGELOG.md +4 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -7
- package/dist/index.js.map +1 -1
- package/dist/telemetry.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.2
|
|
4
|
+
|
|
5
|
+
- Emit opt-in sdk_init beacon on package import so clean install smoke tests and adoption metrics work before constructing a guard. No data plane change.
|
|
6
|
+
|
|
3
7
|
## 0.2.1
|
|
4
8
|
|
|
5
9
|
- Beacon endpoint moved from merchantguard.ai to agentguard.run for clean positioning. No SDK behavior change.
|
package/dist/index.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export { InMemorySpendStore } from './store-memory';
|
|
|
13
13
|
export { telemetryStatus, enableTelemetry, disableTelemetry, resetTelemetryInstallId, recordTelemetryEvent, type TelemetryStatus, } from './telemetry';
|
|
14
14
|
export { SpendGuard, withSpendGuard, AgentGuardBlockedError, type SpendGuardConfig, type OpenAIBindingOptions, } from './spend-guard';
|
|
15
15
|
export { DEFAULT_LOCALE, SUPPORTED_LOCALES, TRANSLATIONS, type SupportedLocale, resolveLocale, t, formatBlockedTrace, type BlockedTraceArgs, } from './i18n';
|
|
16
|
-
export declare const AGENTGUARD_SPEND_VERSION = "0.2.
|
|
16
|
+
export declare const AGENTGUARD_SPEND_VERSION = "0.2.2";
|
|
17
17
|
/** Patent marking. 35 U.S.C. § 287 constructive notice. */
|
|
18
18
|
export declare const PATENT_NOTICE: string;
|
|
19
19
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,YAAY,EACV,WAAW,EACX,WAAW,EACX,QAAQ,EACR,eAAe,EACf,cAAc,EACd,QAAQ,EACR,UAAU,EACV,WAAW,EACX,WAAW,EACX,aAAa,EACb,sBAAsB,EACtB,UAAU,EACV,gBAAgB,GACjB,MAAM,SAAS,CAAC;AAGjB,OAAO,EACL,YAAY,EACZ,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,aAAa,EACb,KAAK,SAAS,GACf,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAGlF,OAAO,EACL,aAAa,EACb,SAAS,EACT,gBAAgB,EAChB,wBAAwB,EACxB,YAAY,EACZ,WAAW,EACX,WAAW,EACX,qBAAqB,EACrB,wBAAwB,GACzB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAGpD,OAAO,EACL,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,uBAAuB,EACvB,oBAAoB,EACpB,KAAK,eAAe,GACrB,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,UAAU,EACV,cAAc,EACd,sBAAsB,EACtB,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,GAC1B,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,KAAK,eAAe,EACpB,aAAa,EACb,CAAC,EACD,kBAAkB,EAClB,KAAK,gBAAgB,GACtB,MAAM,QAAQ,CAAC;AAEhB,eAAO,MAAM,wBAAwB,UAAU,CAAC;AAEhD,2DAA2D;AAC3D,eAAO,MAAM,aAAa,QAG8B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.PATENT_NOTICE = exports.AGENTGUARD_SPEND_VERSION = exports.formatBlockedTrace = exports.t = exports.resolveLocale = exports.TRANSLATIONS = exports.SUPPORTED_LOCALES = exports.DEFAULT_LOCALE = exports.AgentGuardBlockedError = exports.withSpendGuard = exports.SpendGuard = exports.recordTelemetryEvent = exports.resetTelemetryInstallId = exports.disableTelemetry = exports.enableTelemetry = exports.telemetryStatus = exports.InMemorySpendStore = exports.InMemoryDecisionLogStore = exports.GENESIS_PREVIOUS_HASH = exports.verifyChain = exports.verifyEntry = exports.signDecision = exports.computeSignerFingerprint = exports.computeEntryHash = exports.sha256Hex = exports.canonicalJson = exports.adjustPolicyWindowSpend = exports.buildScopeKey = exports.evaluatePolicy = exports.inferProvider = exports.computeCallCents = exports.clearCostOverrides = exports.setCostOverride = exports.getModelCost = void 0;
|
|
11
|
+
const telemetry_1 = require("./telemetry");
|
|
11
12
|
// Cost table
|
|
12
13
|
var cost_table_1 = require("./cost-table");
|
|
13
14
|
Object.defineProperty(exports, "getModelCost", { enumerable: true, get: function () { return cost_table_1.getModelCost; } });
|
|
@@ -35,12 +36,12 @@ Object.defineProperty(exports, "InMemoryDecisionLogStore", { enumerable: true, g
|
|
|
35
36
|
var store_memory_1 = require("./store-memory");
|
|
36
37
|
Object.defineProperty(exports, "InMemorySpendStore", { enumerable: true, get: function () { return store_memory_1.InMemorySpendStore; } });
|
|
37
38
|
// Telemetry controls
|
|
38
|
-
var
|
|
39
|
-
Object.defineProperty(exports, "telemetryStatus", { enumerable: true, get: function () { return
|
|
40
|
-
Object.defineProperty(exports, "enableTelemetry", { enumerable: true, get: function () { return
|
|
41
|
-
Object.defineProperty(exports, "disableTelemetry", { enumerable: true, get: function () { return
|
|
42
|
-
Object.defineProperty(exports, "resetTelemetryInstallId", { enumerable: true, get: function () { return
|
|
43
|
-
Object.defineProperty(exports, "recordTelemetryEvent", { enumerable: true, get: function () { return
|
|
39
|
+
var telemetry_2 = require("./telemetry");
|
|
40
|
+
Object.defineProperty(exports, "telemetryStatus", { enumerable: true, get: function () { return telemetry_2.telemetryStatus; } });
|
|
41
|
+
Object.defineProperty(exports, "enableTelemetry", { enumerable: true, get: function () { return telemetry_2.enableTelemetry; } });
|
|
42
|
+
Object.defineProperty(exports, "disableTelemetry", { enumerable: true, get: function () { return telemetry_2.disableTelemetry; } });
|
|
43
|
+
Object.defineProperty(exports, "resetTelemetryInstallId", { enumerable: true, get: function () { return telemetry_2.resetTelemetryInstallId; } });
|
|
44
|
+
Object.defineProperty(exports, "recordTelemetryEvent", { enumerable: true, get: function () { return telemetry_2.recordTelemetryEvent; } });
|
|
44
45
|
// Core wrapper
|
|
45
46
|
var spend_guard_1 = require("./spend-guard");
|
|
46
47
|
Object.defineProperty(exports, "SpendGuard", { enumerable: true, get: function () { return spend_guard_1.SpendGuard; } });
|
|
@@ -54,9 +55,10 @@ Object.defineProperty(exports, "TRANSLATIONS", { enumerable: true, get: function
|
|
|
54
55
|
Object.defineProperty(exports, "resolveLocale", { enumerable: true, get: function () { return i18n_1.resolveLocale; } });
|
|
55
56
|
Object.defineProperty(exports, "t", { enumerable: true, get: function () { return i18n_1.t; } });
|
|
56
57
|
Object.defineProperty(exports, "formatBlockedTrace", { enumerable: true, get: function () { return i18n_1.formatBlockedTrace; } });
|
|
57
|
-
exports.AGENTGUARD_SPEND_VERSION = '0.2.
|
|
58
|
+
exports.AGENTGUARD_SPEND_VERSION = '0.2.2';
|
|
58
59
|
/** Patent marking. 35 U.S.C. § 287 constructive notice. */
|
|
59
60
|
exports.PATENT_NOTICE = 'Protected by U.S. patent-pending technology ' +
|
|
60
61
|
'(App. Nos. 63/983,615; 63/983,621; 63/983,843; 63/984,626; ' +
|
|
61
62
|
'64/071,781; 64/071,789). Additional patents pending.';
|
|
63
|
+
(0, telemetry_1.recordTelemetryEvent)('sdk_init');
|
|
62
64
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,2CAA8E;AAmB9E,aAAa;AACb,2CAOsB;AANpB,0GAAA,YAAY,OAAA;AACZ,6GAAA,eAAe,OAAA;AACf,gHAAA,kBAAkB,OAAA;AAClB,8GAAA,gBAAgB,OAAA;AAChB,2GAAA,aAAa,OAAA;AAIf,gBAAgB;AAChB,mCAAkF;AAAzE,wGAAA,cAAc,OAAA;AAAE,uGAAA,aAAa,OAAA;AAAE,iHAAA,uBAAuB,OAAA;AAE/D,eAAe;AACf,+CAUwB;AATtB,6GAAA,aAAa,OAAA;AACb,yGAAA,SAAS,OAAA;AACT,gHAAA,gBAAgB,OAAA;AAChB,wHAAA,wBAAwB,OAAA;AACxB,4GAAA,YAAY,OAAA;AACZ,2GAAA,WAAW,OAAA;AACX,2GAAA,WAAW,OAAA;AACX,qHAAA,qBAAqB,OAAA;AACrB,wHAAA,wBAAwB,OAAA;AAG1B,wBAAwB;AACxB,+CAAoD;AAA3C,kHAAA,kBAAkB,OAAA;AAE3B,qBAAqB;AACrB,yCAOqB;AANnB,4GAAA,eAAe,OAAA;AACf,4GAAA,eAAe,OAAA;AACf,6GAAA,gBAAgB,OAAA;AAChB,oHAAA,uBAAuB,OAAA;AACvB,iHAAA,oBAAoB,OAAA;AAItB,eAAe;AACf,6CAMuB;AALrB,yGAAA,UAAU,OAAA;AACV,6GAAA,cAAc,OAAA;AACd,qHAAA,sBAAsB,OAAA;AAKxB,sCAAsC;AACtC,+BASgB;AARd,sGAAA,cAAc,OAAA;AACd,yGAAA,iBAAiB,OAAA;AACjB,oGAAA,YAAY,OAAA;AAEZ,qGAAA,aAAa,OAAA;AACb,yFAAA,CAAC,OAAA;AACD,0GAAA,kBAAkB,OAAA;AAIP,QAAA,wBAAwB,GAAG,OAAO,CAAC;AAEhD,2DAA2D;AAC9C,QAAA,aAAa,GACxB,8CAA8C;IAC9C,6DAA6D;IAC7D,sDAAsD,CAAC;AACzD,IAAA,gCAAuB,EAAC,UAAU,CAAC,CAAC"}
|
package/dist/telemetry.js
CHANGED
|
@@ -43,7 +43,7 @@ const https = __importStar(require("https"));
|
|
|
43
43
|
const os = __importStar(require("os"));
|
|
44
44
|
const path = __importStar(require("path"));
|
|
45
45
|
const crypto_1 = require("crypto");
|
|
46
|
-
const AGENTGUARD_SPEND_VERSION = '0.2.
|
|
46
|
+
const AGENTGUARD_SPEND_VERSION = '0.2.2';
|
|
47
47
|
const STATE_DIR = path.join(os.homedir(), '.agentguard');
|
|
48
48
|
const STATE_PATH = path.join(STATE_DIR, 'telemetry.json');
|
|
49
49
|
const BEACON_URL = 'https://agentguard.run/api/beacon';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentguard-run/spend",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Local-runtime spend caps and capability-gated model routing for AI agents. Prompts, API keys, and signing keys stay inside the customer runtime. Zero data plane involvement.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|