@miniaxolotl/grove 1.11.6 → 1.11.13

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/hook.js CHANGED
@@ -1,8 +1,13 @@
1
1
  import { createRequire as __groveCreateRequire } from "node:module"; const require = __groveCreateRequire(import.meta.url);
2
2
  var __defProp = Object.defineProperty;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __esm = (fn, res) => function __init() {
5
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
4
+ var __esm = (fn, res, err) => function __init() {
5
+ if (err) throw err[0];
6
+ try {
7
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
8
+ } catch (e) {
9
+ throw err = [e], e;
10
+ }
6
11
  };
7
12
  var __export = (target, all) => {
8
13
  for (var name in all)
@@ -13,7 +18,7 @@ var __export = (target, all) => {
13
18
  var define_GROVE_TELEMETRY_default;
14
19
  var init_define_GROVE_TELEMETRY = __esm({
15
20
  "<define:__GROVE_TELEMETRY__>"() {
16
- define_GROVE_TELEMETRY_default = { enabled: true, revision: "1b6af4e6f4a611824fc080e0025685a008cd73fb", version: "1.11.6", component: "cli", key: "phc_AqVrjhk7W2X2pFjyngY7uWxcSSRREfJhgr8mBmKbXYEh", cliDsn: "https://3f6d0711b5890dea4ce8e6ccf2a1a7fd@o4511632209346560.ingest.us.sentry.io/4512290791620608", apiDsn: "https://4524e8910e318110277babdfe818999b@o4511632209346560.ingest.us.sentry.io/4512290791489536" };
21
+ define_GROVE_TELEMETRY_default = { enabled: true, revision: "e72bd842c6b37fcb0ece8087b3673fbdb3a59ec5", version: "1.11.13", component: "cli", key: "phc_AqVrjhk7W2X2pFjyngY7uWxcSSRREfJhgr8mBmKbXYEh", cliDsn: "https://3f6d0711b5890dea4ce8e6ccf2a1a7fd@o4511632209346560.ingest.us.sentry.io/4512290791620608", apiDsn: "https://4524e8910e318110277babdfe818999b@o4511632209346560.ingest.us.sentry.io/4512290791489536" };
17
22
  }
18
23
  });
19
24
 
@@ -30010,11 +30015,64 @@ var events = [
30010
30015
  "memory_created",
30011
30016
  "memory_recalled",
30012
30017
  "chat_completed",
30013
- "$ai_generation"
30018
+ "$ai_generation",
30019
+ "ai_cache"
30014
30020
  ];
30015
30021
  function projectProperties(input2 = {}) {
30016
30022
  const output = {};
30017
30023
  const enums = {
30024
+ failure_code: [
30025
+ "auth_unavailable",
30026
+ "provider_authentication",
30027
+ "provider_rate_limited",
30028
+ "provider_unavailable",
30029
+ "provider_timeout",
30030
+ "provider_invalid_response",
30031
+ "provider_empty_response",
30032
+ "provider_response_too_large",
30033
+ "inference_budget",
30034
+ "generation_invalid_response",
30035
+ "generation_incomplete",
30036
+ "generation_invalid_citation",
30037
+ "generation_invalid_reference",
30038
+ "generation_invalid_proposal",
30039
+ "generation_invalid_organization",
30040
+ "generation_invalid_lifecycle",
30041
+ "generation_invalid_web_citation",
30042
+ "generation_invalid_cursor",
30043
+ "generation_missing_document_evidence",
30044
+ "embedding_invalid_response",
30045
+ "embedding_profile_mismatch",
30046
+ "invalid_embedding",
30047
+ "decision_invalid_response"
30048
+ ],
30049
+ failure_stage: ["response_json", "response_schema"],
30050
+ validation_field: [
30051
+ "message",
30052
+ "statements",
30053
+ "proposals",
30054
+ "organization",
30055
+ "lifecycle",
30056
+ "webStatements",
30057
+ "documentStatements",
30058
+ "title",
30059
+ "tags",
30060
+ "query",
30061
+ "intent",
30062
+ "references",
30063
+ "research",
30064
+ "organizeAfter"
30065
+ ],
30066
+ cache_feature: [
30067
+ "query_embedding",
30068
+ "document_embedding",
30069
+ "organization",
30070
+ "classification",
30071
+ "planning",
30072
+ "answer",
30073
+ "research"
30074
+ ],
30075
+ cache_status: ["fresh", "cached", "coalesced"],
30018
30076
  operation: operations,
30019
30077
  outcome: ["success", "unavailable", "error", "cancelled"],
30020
30078
  command: [
@@ -30039,6 +30097,7 @@ function projectProperties(input2 = {}) {
30039
30097
  output[key] = input2[key];
30040
30098
  for (const key of [
30041
30099
  "duration_ms",
30100
+ "requests_avoided",
30042
30101
  "result_count",
30043
30102
  "input_tokens",
30044
30103
  "output_tokens"
@@ -30449,11 +30508,22 @@ var Reporter = class {
30449
30508
  operation(operation, started, outcome, properties = {}, cause, identity = this.config.identity) {
30450
30509
  if (!operations.includes(operation) || !Number.isFinite(started) || !opaqueIdentity(identity))
30451
30510
  return;
30511
+ let diagnostics = {};
30512
+ try {
30513
+ if (cause && typeof cause === "object")
30514
+ diagnostics = projectProperties({
30515
+ failure_code: "code" in cause ? cause.code : void 0,
30516
+ failure_stage: "stage" in cause ? cause.stage : void 0,
30517
+ validation_field: "field" in cause ? cause.field : void 0
30518
+ });
30519
+ } catch {
30520
+ }
30452
30521
  const ended = performance2.now();
30453
30522
  this.enqueue({
30454
30523
  event: "operation_completed",
30455
30524
  properties: projectProperties({
30456
30525
  ...properties,
30526
+ ...diagnostics,
30457
30527
  operation,
30458
30528
  outcome,
30459
30529
  duration_ms: ended - started
@@ -30464,7 +30534,7 @@ var Reporter = class {
30464
30534
  error: outcome === "error" ? safeError(
30465
30535
  {
30466
30536
  type: void 0,
30467
- tags: { operation, outcome },
30537
+ tags: { ...diagnostics, operation, outcome },
30468
30538
  exception: {
30469
30539
  values: [
30470
30540
  {