@miniaxolotl/grove-opencode-plugin 1.7.0 → 1.7.1
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/dist/index.js +37 -2
- package/dist/index.js.map +2 -2
- package/dist/telemetry-build.json +1 -1
- package/package.json +1 -1
package/dist/hook.js
CHANGED
|
@@ -13,7 +13,7 @@ var __export = (target, all) => {
|
|
|
13
13
|
var define_GROVE_TELEMETRY_default;
|
|
14
14
|
var init_define_GROVE_TELEMETRY = __esm({
|
|
15
15
|
"<define:__GROVE_TELEMETRY__>"() {
|
|
16
|
-
define_GROVE_TELEMETRY_default = { enabled: true, revision: "
|
|
16
|
+
define_GROVE_TELEMETRY_default = { enabled: true, revision: "d22d90bc2b2968ed3c296249297f732e7e17d358", version: "1.7.1", component: "cli", key: "phc_AqVrjhk7W2X2pFjyngY7uWxcSSRREfJhgr8mBmKbXYEh", cliDsn: "https://3f6d0711b5890dea4ce8e6ccf2a1a7fd@o4511632209346560.ingest.us.sentry.io/4512290791620608", apiDsn: "https://4524e8910e318110277babdfe818999b@o4511632209346560.ingest.us.sentry.io/4512290791489536" };
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
19
|
|
|
@@ -17310,6 +17310,31 @@ var dataCollection = {
|
|
|
17310
17310
|
stackFrameVariables: false,
|
|
17311
17311
|
frameContextLines: 0
|
|
17312
17312
|
};
|
|
17313
|
+
function safeSpanEnvelope(envelope, identity, dsn, sampleRate) {
|
|
17314
|
+
const spanItems = envelope[1].filter(([header]) => header.type === "span");
|
|
17315
|
+
if (!spanItems.length) return envelope;
|
|
17316
|
+
const payload = spanItems[0][1];
|
|
17317
|
+
const traceId = payload.items?.[0]?.trace_id;
|
|
17318
|
+
const publicKey = dsnFromString(dsn)?.publicKey;
|
|
17319
|
+
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)
|
|
17320
|
+
return null;
|
|
17321
|
+
const operation = payload.items[0].name;
|
|
17322
|
+
return [
|
|
17323
|
+
{
|
|
17324
|
+
...envelope[0],
|
|
17325
|
+
trace: {
|
|
17326
|
+
trace_id: traceId,
|
|
17327
|
+
public_key: publicKey,
|
|
17328
|
+
release: identity.release,
|
|
17329
|
+
environment: "production",
|
|
17330
|
+
sampled: "true",
|
|
17331
|
+
sample_rate: String(sampleRate),
|
|
17332
|
+
transaction: operations.includes(operation) ? operation : "command_run"
|
|
17333
|
+
}
|
|
17334
|
+
},
|
|
17335
|
+
envelope[1]
|
|
17336
|
+
];
|
|
17337
|
+
}
|
|
17313
17338
|
var attributes = (identity, raw = {}) => ({
|
|
17314
17339
|
...projectProperties(raw),
|
|
17315
17340
|
product: "grove",
|
|
@@ -17613,7 +17638,17 @@ var Reporter = class {
|
|
|
17613
17638
|
);
|
|
17614
17639
|
return {
|
|
17615
17640
|
...transport,
|
|
17616
|
-
send: (envelope) =>
|
|
17641
|
+
send: (envelope) => {
|
|
17642
|
+
if (!this.allowed())
|
|
17643
|
+
return Promise.resolve({ statusCode: 200 });
|
|
17644
|
+
const projected = safeSpanEnvelope(
|
|
17645
|
+
envelope,
|
|
17646
|
+
this.identity,
|
|
17647
|
+
config2.dsn,
|
|
17648
|
+
config2.sampleRate ?? 0.1
|
|
17649
|
+
);
|
|
17650
|
+
return projected ? transport.send(projected) : Promise.resolve({ statusCode: 200 });
|
|
17651
|
+
}
|
|
17617
17652
|
};
|
|
17618
17653
|
}
|
|
17619
17654
|
});
|