@miniaxolotl/grove-codex-plugin 1.7.0 → 1.8.0
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/bridge.js +37 -2
- package/dist/bridge.js.map +2 -2
- package/dist/cli.js +39 -4
- package/dist/cli.js.map +2 -2
- package/dist/hook.js +37 -2
- package/dist/hook.js.map +2 -2
- package/package.json +1 -1
- package/plugin.json +1 -1
package/dist/bridge.js
CHANGED
|
@@ -36,7 +36,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
36
36
|
var define_GROVE_TELEMETRY_default;
|
|
37
37
|
var init_define_GROVE_TELEMETRY = __esm({
|
|
38
38
|
"<define:__GROVE_TELEMETRY__>"() {
|
|
39
|
-
define_GROVE_TELEMETRY_default = { enabled: true, revision: "
|
|
39
|
+
define_GROVE_TELEMETRY_default = { enabled: true, revision: "c2d8d32e50f3cb197b6b83abdec64ef4423fbc11", version: "1.8.0", component: "cli", key: "phc_AqVrjhk7W2X2pFjyngY7uWxcSSRREfJhgr8mBmKbXYEh", cliDsn: "https://3f6d0711b5890dea4ce8e6ccf2a1a7fd@o4511632209346560.ingest.us.sentry.io/4512290791620608", apiDsn: "https://4524e8910e318110277babdfe818999b@o4511632209346560.ingest.us.sentry.io/4512290791489536" };
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
42
|
|
|
@@ -46923,6 +46923,31 @@ var dataCollection = {
|
|
|
46923
46923
|
stackFrameVariables: false,
|
|
46924
46924
|
frameContextLines: 0
|
|
46925
46925
|
};
|
|
46926
|
+
function safeSpanEnvelope(envelope, identity, dsn, sampleRate) {
|
|
46927
|
+
const spanItems = envelope[1].filter(([header]) => header.type === "span");
|
|
46928
|
+
if (!spanItems.length) return envelope;
|
|
46929
|
+
const payload = spanItems[0][1];
|
|
46930
|
+
const traceId = payload.items?.[0]?.trace_id;
|
|
46931
|
+
const publicKey = dsnFromString(dsn)?.publicKey;
|
|
46932
|
+
if (spanItems.length !== 1 || !traceId || !/^[a-f0-9]{32}$/.test(traceId) || !payload.items.every((span) => span.trace_id === traceId) || !publicKey || !Number.isFinite(sampleRate) || sampleRate <= 0 || sampleRate > 1)
|
|
46933
|
+
return null;
|
|
46934
|
+
const operation = payload.items[0].name;
|
|
46935
|
+
return [
|
|
46936
|
+
{
|
|
46937
|
+
...envelope[0],
|
|
46938
|
+
trace: {
|
|
46939
|
+
trace_id: traceId,
|
|
46940
|
+
public_key: publicKey,
|
|
46941
|
+
release: identity.release,
|
|
46942
|
+
environment: "production",
|
|
46943
|
+
sampled: "true",
|
|
46944
|
+
sample_rate: String(sampleRate),
|
|
46945
|
+
transaction: operations.includes(operation) ? operation : "command_run"
|
|
46946
|
+
}
|
|
46947
|
+
},
|
|
46948
|
+
envelope[1]
|
|
46949
|
+
];
|
|
46950
|
+
}
|
|
46926
46951
|
var attributes = (identity, raw = {}) => ({
|
|
46927
46952
|
...projectProperties(raw),
|
|
46928
46953
|
product: "grove",
|
|
@@ -47226,7 +47251,17 @@ var Reporter = class {
|
|
|
47226
47251
|
);
|
|
47227
47252
|
return {
|
|
47228
47253
|
...transport,
|
|
47229
|
-
send: (envelope) =>
|
|
47254
|
+
send: (envelope) => {
|
|
47255
|
+
if (!this.allowed())
|
|
47256
|
+
return Promise.resolve({ statusCode: 200 });
|
|
47257
|
+
const projected = safeSpanEnvelope(
|
|
47258
|
+
envelope,
|
|
47259
|
+
this.identity,
|
|
47260
|
+
config2.dsn,
|
|
47261
|
+
config2.sampleRate ?? 0.1
|
|
47262
|
+
);
|
|
47263
|
+
return projected ? transport.send(projected) : Promise.resolve({ statusCode: 200 });
|
|
47264
|
+
}
|
|
47230
47265
|
};
|
|
47231
47266
|
}
|
|
47232
47267
|
});
|