@raindrop-ai/opencode-plugin 0.1.2 → 0.1.3
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/index.cjs +31 -59
- package/dist/index.js +31 -59
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -24,7 +24,7 @@ __export(index_exports, {
|
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(index_exports);
|
|
26
26
|
|
|
27
|
-
// ../core/dist/chunk-
|
|
27
|
+
// ../core/dist/chunk-3V4MIA75.js
|
|
28
28
|
function getCrypto() {
|
|
29
29
|
const c = globalThis.crypto;
|
|
30
30
|
return c;
|
|
@@ -293,6 +293,11 @@ function attrInt(key, value) {
|
|
|
293
293
|
if (!Number.isFinite(value)) return void 0;
|
|
294
294
|
return { key, value: { intValue: String(Math.trunc(value)) } };
|
|
295
295
|
}
|
|
296
|
+
function attrDouble(key, value) {
|
|
297
|
+
if (value === void 0) return void 0;
|
|
298
|
+
if (!Number.isFinite(value)) return void 0;
|
|
299
|
+
return { key, value: { doubleValue: value } };
|
|
300
|
+
}
|
|
296
301
|
function buildOtlpSpan(args) {
|
|
297
302
|
const attrs = args.attributes.filter((x) => x !== void 0);
|
|
298
303
|
const span = {
|
|
@@ -815,6 +820,7 @@ var EventShipper = class {
|
|
|
815
820
|
}
|
|
816
821
|
};
|
|
817
822
|
var MODEL_USAGE_ATTRIBUTES = {
|
|
823
|
+
usageSource: "raindrop.usage.source",
|
|
818
824
|
providerName: "gen_ai.provider.name",
|
|
819
825
|
requestModel: "gen_ai.request.model",
|
|
820
826
|
responseModel: "gen_ai.response.model",
|
|
@@ -823,6 +829,7 @@ var MODEL_USAGE_ATTRIBUTES = {
|
|
|
823
829
|
reasoningTokens: "gen_ai.usage.reasoning_tokens",
|
|
824
830
|
cacheReadInputTokens: "gen_ai.usage.cache_read_input_tokens",
|
|
825
831
|
cacheWriteInputTokens: "gen_ai.usage.cache_write_input_tokens",
|
|
832
|
+
providerReportedCost: "gen_ai.usage.provider_reported_cost",
|
|
826
833
|
nonCachedInputTokens: "raindrop.usage.input_tokens.non_cached",
|
|
827
834
|
nonReasoningOutputTokens: "raindrop.usage.output_tokens.non_reasoning",
|
|
828
835
|
totalOutputTokens: "raindrop.usage.output_tokens.total",
|
|
@@ -831,13 +838,20 @@ var MODEL_USAGE_ATTRIBUTES = {
|
|
|
831
838
|
cacheWriteTokens: "raindrop.usage.input_tokens.cache_write"
|
|
832
839
|
};
|
|
833
840
|
var MODEL_PROVIDER_NAMES = [
|
|
841
|
+
["google.vertex.anthropic", "google-vertex"],
|
|
842
|
+
["google.vertex_ai", "google-vertex"],
|
|
834
843
|
["google.vertex", "google-vertex"],
|
|
844
|
+
["gcp.vertex_ai", "google-vertex"],
|
|
845
|
+
["gcp.gemini", "google"],
|
|
846
|
+
["google_vertexai", "google-vertex"],
|
|
835
847
|
["vertex.anthropic", "google-vertex"],
|
|
836
848
|
["amazon-bedrock", "amazon-bedrock"],
|
|
849
|
+
["aws.bedrock", "amazon-bedrock"],
|
|
837
850
|
["bedrock", "amazon-bedrock"],
|
|
838
851
|
["anthropic", "anthropic"],
|
|
839
852
|
["openai", "openai"],
|
|
840
853
|
["google", "google"],
|
|
854
|
+
["az.ai.openai", "azure"],
|
|
841
855
|
["azure", "azure"],
|
|
842
856
|
["openrouter", "openrouter"]
|
|
843
857
|
];
|
|
@@ -848,60 +862,20 @@ function canonicalModelProvider(provider) {
|
|
|
848
862
|
const match = MODEL_PROVIDER_NAMES.find(
|
|
849
863
|
([family]) => normalizedProvider === family || normalizedProvider.startsWith(`${family}.`)
|
|
850
864
|
);
|
|
851
|
-
return (_a = match == null ? void 0 : match[1]) != null ? _a :
|
|
865
|
+
return (_a = match == null ? void 0 : match[1]) != null ? _a : normalizedProvider;
|
|
852
866
|
}
|
|
853
867
|
function tokenCount(value) {
|
|
854
868
|
return typeof value === "number" && Number.isSafeInteger(value) && value >= 0 ? value : void 0;
|
|
855
869
|
}
|
|
856
|
-
function
|
|
857
|
-
|
|
858
|
-
total,
|
|
859
|
-
parts,
|
|
860
|
-
semantics
|
|
861
|
-
}) {
|
|
862
|
-
if (explicit !== void 0) return explicit;
|
|
863
|
-
if (total === void 0) return void 0;
|
|
864
|
-
if (semantics === "exclusive") return total;
|
|
865
|
-
const observedParts = parts.filter((part) => part !== void 0 && part > 0);
|
|
866
|
-
if (semantics === void 0 && observedParts.length > 0) return void 0;
|
|
867
|
-
const exclusive = total - observedParts.reduce((sum, part) => sum + part, 0);
|
|
868
|
-
return exclusive >= 0 ? exclusive : void 0;
|
|
869
|
-
}
|
|
870
|
-
function buildModelUsageAttributes(usage) {
|
|
871
|
-
const inputTokens = tokenCount(usage.inputTokens);
|
|
872
|
-
const outputTokens = tokenCount(usage.outputTokens);
|
|
873
|
-
const explicitNonCachedInputTokens = tokenCount(usage.nonCachedInputTokens);
|
|
874
|
-
const explicitNonReasoningOutputTokens = tokenCount(usage.nonReasoningOutputTokens);
|
|
875
|
-
const reasoningTokens = tokenCount(usage.reasoningTokens);
|
|
876
|
-
const cacheReadInputTokens = tokenCount(usage.cacheReadInputTokens);
|
|
877
|
-
const cacheWriteInputTokens = tokenCount(usage.cacheWriteInputTokens);
|
|
878
|
-
const nonCachedInputTokens = exclusiveTokens({
|
|
879
|
-
explicit: explicitNonCachedInputTokens,
|
|
880
|
-
total: inputTokens,
|
|
881
|
-
parts: [cacheReadInputTokens, cacheWriteInputTokens],
|
|
882
|
-
semantics: usage.inputTokenSemantics
|
|
883
|
-
});
|
|
884
|
-
const nonReasoningOutputTokens = exclusiveTokens({
|
|
885
|
-
explicit: explicitNonReasoningOutputTokens,
|
|
886
|
-
total: outputTokens,
|
|
887
|
-
parts: [reasoningTokens],
|
|
888
|
-
semantics: usage.outputTokenSemantics
|
|
889
|
-
});
|
|
890
|
-
const exclusivePoolAttributes = nonCachedInputTokens !== void 0 && nonReasoningOutputTokens !== void 0 ? [
|
|
891
|
-
// backend consumes this complete raindrop.* set as one atomic billing-pool contract.
|
|
892
|
-
attrInt(MODEL_USAGE_ATTRIBUTES.nonCachedInputTokens, nonCachedInputTokens),
|
|
893
|
-
attrInt(MODEL_USAGE_ATTRIBUTES.nonReasoningOutputTokens, nonReasoningOutputTokens),
|
|
894
|
-
attrInt(MODEL_USAGE_ATTRIBUTES.reasoningOutputTokens, reasoningTokens),
|
|
895
|
-
attrInt(MODEL_USAGE_ATTRIBUTES.cacheReadTokens, cacheReadInputTokens),
|
|
896
|
-
attrInt(MODEL_USAGE_ATTRIBUTES.cacheWriteTokens, cacheWriteInputTokens)
|
|
897
|
-
] : [];
|
|
870
|
+
function buildRawModelUsageAttributes(usage) {
|
|
871
|
+
const providerReportedCost = typeof usage.providerReportedCost === "number" && Number.isFinite(usage.providerReportedCost) && usage.providerReportedCost >= 0 ? usage.providerReportedCost : void 0;
|
|
898
872
|
return [
|
|
899
|
-
attrInt(MODEL_USAGE_ATTRIBUTES.inputTokens, inputTokens),
|
|
900
|
-
attrInt(MODEL_USAGE_ATTRIBUTES.outputTokens, outputTokens),
|
|
901
|
-
attrInt(MODEL_USAGE_ATTRIBUTES.reasoningTokens, reasoningTokens),
|
|
902
|
-
attrInt(MODEL_USAGE_ATTRIBUTES.cacheReadInputTokens, cacheReadInputTokens),
|
|
903
|
-
attrInt(MODEL_USAGE_ATTRIBUTES.cacheWriteInputTokens, cacheWriteInputTokens),
|
|
904
|
-
|
|
873
|
+
attrInt(MODEL_USAGE_ATTRIBUTES.inputTokens, tokenCount(usage.inputTokens)),
|
|
874
|
+
attrInt(MODEL_USAGE_ATTRIBUTES.outputTokens, tokenCount(usage.outputTokens)),
|
|
875
|
+
attrInt(MODEL_USAGE_ATTRIBUTES.reasoningTokens, tokenCount(usage.reasoningTokens)),
|
|
876
|
+
attrInt(MODEL_USAGE_ATTRIBUTES.cacheReadInputTokens, tokenCount(usage.cacheReadInputTokens)),
|
|
877
|
+
attrInt(MODEL_USAGE_ATTRIBUTES.cacheWriteInputTokens, tokenCount(usage.cacheWriteInputTokens)),
|
|
878
|
+
attrDouble(MODEL_USAGE_ATTRIBUTES.providerReportedCost, providerReportedCost)
|
|
905
879
|
].filter((attribute) => attribute !== void 0);
|
|
906
880
|
}
|
|
907
881
|
var STRING_ALIASES = {
|
|
@@ -1502,7 +1476,7 @@ function resolveLocalWorkshopUrl(fileValue) {
|
|
|
1502
1476
|
// package.json
|
|
1503
1477
|
var package_default = {
|
|
1504
1478
|
name: "@raindrop-ai/opencode-plugin",
|
|
1505
|
-
version: "0.1.
|
|
1479
|
+
version: "0.1.3",
|
|
1506
1480
|
description: "Raindrop observability plugin for OpenCode \u2014 automatic session/event/span tracing",
|
|
1507
1481
|
type: "module",
|
|
1508
1482
|
main: "dist/index.js",
|
|
@@ -1707,18 +1681,13 @@ function parseOpenCodeAssistantTokens(tokens) {
|
|
|
1707
1681
|
};
|
|
1708
1682
|
}
|
|
1709
1683
|
function modelSpendSpanAttributes(input) {
|
|
1710
|
-
const providerAttr = attrString(
|
|
1711
|
-
|
|
1712
|
-
canonicalModelProvider(input.providerID)
|
|
1713
|
-
);
|
|
1714
|
-
const usageAttrs = buildModelUsageAttributes({
|
|
1684
|
+
const providerAttr = attrString("gen_ai.provider.name", canonicalModelProvider(input.providerID));
|
|
1685
|
+
const usageAttrs = buildRawModelUsageAttributes({
|
|
1715
1686
|
inputTokens: input.tokens.input,
|
|
1716
1687
|
outputTokens: input.tokens.output,
|
|
1717
1688
|
reasoningTokens: input.tokens.reasoning,
|
|
1718
1689
|
cacheReadInputTokens: input.tokens.cacheRead,
|
|
1719
|
-
cacheWriteInputTokens: input.tokens.cacheWrite
|
|
1720
|
-
inputTokenSemantics: "exclusive",
|
|
1721
|
-
outputTokenSemantics: "exclusive"
|
|
1690
|
+
cacheWriteInputTokens: input.tokens.cacheWrite
|
|
1722
1691
|
});
|
|
1723
1692
|
return providerAttr ? [providerAttr, ...usageAttrs] : usageAttrs;
|
|
1724
1693
|
}
|
|
@@ -1726,6 +1695,9 @@ function buildLlmGenAiAttributes(input) {
|
|
|
1726
1695
|
const parsed = parseOpenCodeAssistantTokens(input.tokens);
|
|
1727
1696
|
if (!parsed) return [];
|
|
1728
1697
|
return [
|
|
1698
|
+
// OpenCode has already normalized both token axes. Provenance lets Dawn
|
|
1699
|
+
// select that contract without the SDK or customer declaring semantics.
|
|
1700
|
+
attrString(MODEL_USAGE_ATTRIBUTES.usageSource, "opencode"),
|
|
1729
1701
|
attrString("gen_ai.system", input.providerID),
|
|
1730
1702
|
attrString("gen_ai.request.model", input.modelID),
|
|
1731
1703
|
attrString("gen_ai.response.model", input.modelID),
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// ../core/dist/chunk-
|
|
1
|
+
// ../core/dist/chunk-3V4MIA75.js
|
|
2
2
|
function getCrypto() {
|
|
3
3
|
const c = globalThis.crypto;
|
|
4
4
|
return c;
|
|
@@ -267,6 +267,11 @@ function attrInt(key, value) {
|
|
|
267
267
|
if (!Number.isFinite(value)) return void 0;
|
|
268
268
|
return { key, value: { intValue: String(Math.trunc(value)) } };
|
|
269
269
|
}
|
|
270
|
+
function attrDouble(key, value) {
|
|
271
|
+
if (value === void 0) return void 0;
|
|
272
|
+
if (!Number.isFinite(value)) return void 0;
|
|
273
|
+
return { key, value: { doubleValue: value } };
|
|
274
|
+
}
|
|
270
275
|
function buildOtlpSpan(args) {
|
|
271
276
|
const attrs = args.attributes.filter((x) => x !== void 0);
|
|
272
277
|
const span = {
|
|
@@ -789,6 +794,7 @@ var EventShipper = class {
|
|
|
789
794
|
}
|
|
790
795
|
};
|
|
791
796
|
var MODEL_USAGE_ATTRIBUTES = {
|
|
797
|
+
usageSource: "raindrop.usage.source",
|
|
792
798
|
providerName: "gen_ai.provider.name",
|
|
793
799
|
requestModel: "gen_ai.request.model",
|
|
794
800
|
responseModel: "gen_ai.response.model",
|
|
@@ -797,6 +803,7 @@ var MODEL_USAGE_ATTRIBUTES = {
|
|
|
797
803
|
reasoningTokens: "gen_ai.usage.reasoning_tokens",
|
|
798
804
|
cacheReadInputTokens: "gen_ai.usage.cache_read_input_tokens",
|
|
799
805
|
cacheWriteInputTokens: "gen_ai.usage.cache_write_input_tokens",
|
|
806
|
+
providerReportedCost: "gen_ai.usage.provider_reported_cost",
|
|
800
807
|
nonCachedInputTokens: "raindrop.usage.input_tokens.non_cached",
|
|
801
808
|
nonReasoningOutputTokens: "raindrop.usage.output_tokens.non_reasoning",
|
|
802
809
|
totalOutputTokens: "raindrop.usage.output_tokens.total",
|
|
@@ -805,13 +812,20 @@ var MODEL_USAGE_ATTRIBUTES = {
|
|
|
805
812
|
cacheWriteTokens: "raindrop.usage.input_tokens.cache_write"
|
|
806
813
|
};
|
|
807
814
|
var MODEL_PROVIDER_NAMES = [
|
|
815
|
+
["google.vertex.anthropic", "google-vertex"],
|
|
816
|
+
["google.vertex_ai", "google-vertex"],
|
|
808
817
|
["google.vertex", "google-vertex"],
|
|
818
|
+
["gcp.vertex_ai", "google-vertex"],
|
|
819
|
+
["gcp.gemini", "google"],
|
|
820
|
+
["google_vertexai", "google-vertex"],
|
|
809
821
|
["vertex.anthropic", "google-vertex"],
|
|
810
822
|
["amazon-bedrock", "amazon-bedrock"],
|
|
823
|
+
["aws.bedrock", "amazon-bedrock"],
|
|
811
824
|
["bedrock", "amazon-bedrock"],
|
|
812
825
|
["anthropic", "anthropic"],
|
|
813
826
|
["openai", "openai"],
|
|
814
827
|
["google", "google"],
|
|
828
|
+
["az.ai.openai", "azure"],
|
|
815
829
|
["azure", "azure"],
|
|
816
830
|
["openrouter", "openrouter"]
|
|
817
831
|
];
|
|
@@ -822,60 +836,20 @@ function canonicalModelProvider(provider) {
|
|
|
822
836
|
const match = MODEL_PROVIDER_NAMES.find(
|
|
823
837
|
([family]) => normalizedProvider === family || normalizedProvider.startsWith(`${family}.`)
|
|
824
838
|
);
|
|
825
|
-
return (_a = match == null ? void 0 : match[1]) != null ? _a :
|
|
839
|
+
return (_a = match == null ? void 0 : match[1]) != null ? _a : normalizedProvider;
|
|
826
840
|
}
|
|
827
841
|
function tokenCount(value) {
|
|
828
842
|
return typeof value === "number" && Number.isSafeInteger(value) && value >= 0 ? value : void 0;
|
|
829
843
|
}
|
|
830
|
-
function
|
|
831
|
-
|
|
832
|
-
total,
|
|
833
|
-
parts,
|
|
834
|
-
semantics
|
|
835
|
-
}) {
|
|
836
|
-
if (explicit !== void 0) return explicit;
|
|
837
|
-
if (total === void 0) return void 0;
|
|
838
|
-
if (semantics === "exclusive") return total;
|
|
839
|
-
const observedParts = parts.filter((part) => part !== void 0 && part > 0);
|
|
840
|
-
if (semantics === void 0 && observedParts.length > 0) return void 0;
|
|
841
|
-
const exclusive = total - observedParts.reduce((sum, part) => sum + part, 0);
|
|
842
|
-
return exclusive >= 0 ? exclusive : void 0;
|
|
843
|
-
}
|
|
844
|
-
function buildModelUsageAttributes(usage) {
|
|
845
|
-
const inputTokens = tokenCount(usage.inputTokens);
|
|
846
|
-
const outputTokens = tokenCount(usage.outputTokens);
|
|
847
|
-
const explicitNonCachedInputTokens = tokenCount(usage.nonCachedInputTokens);
|
|
848
|
-
const explicitNonReasoningOutputTokens = tokenCount(usage.nonReasoningOutputTokens);
|
|
849
|
-
const reasoningTokens = tokenCount(usage.reasoningTokens);
|
|
850
|
-
const cacheReadInputTokens = tokenCount(usage.cacheReadInputTokens);
|
|
851
|
-
const cacheWriteInputTokens = tokenCount(usage.cacheWriteInputTokens);
|
|
852
|
-
const nonCachedInputTokens = exclusiveTokens({
|
|
853
|
-
explicit: explicitNonCachedInputTokens,
|
|
854
|
-
total: inputTokens,
|
|
855
|
-
parts: [cacheReadInputTokens, cacheWriteInputTokens],
|
|
856
|
-
semantics: usage.inputTokenSemantics
|
|
857
|
-
});
|
|
858
|
-
const nonReasoningOutputTokens = exclusiveTokens({
|
|
859
|
-
explicit: explicitNonReasoningOutputTokens,
|
|
860
|
-
total: outputTokens,
|
|
861
|
-
parts: [reasoningTokens],
|
|
862
|
-
semantics: usage.outputTokenSemantics
|
|
863
|
-
});
|
|
864
|
-
const exclusivePoolAttributes = nonCachedInputTokens !== void 0 && nonReasoningOutputTokens !== void 0 ? [
|
|
865
|
-
// backend consumes this complete raindrop.* set as one atomic billing-pool contract.
|
|
866
|
-
attrInt(MODEL_USAGE_ATTRIBUTES.nonCachedInputTokens, nonCachedInputTokens),
|
|
867
|
-
attrInt(MODEL_USAGE_ATTRIBUTES.nonReasoningOutputTokens, nonReasoningOutputTokens),
|
|
868
|
-
attrInt(MODEL_USAGE_ATTRIBUTES.reasoningOutputTokens, reasoningTokens),
|
|
869
|
-
attrInt(MODEL_USAGE_ATTRIBUTES.cacheReadTokens, cacheReadInputTokens),
|
|
870
|
-
attrInt(MODEL_USAGE_ATTRIBUTES.cacheWriteTokens, cacheWriteInputTokens)
|
|
871
|
-
] : [];
|
|
844
|
+
function buildRawModelUsageAttributes(usage) {
|
|
845
|
+
const providerReportedCost = typeof usage.providerReportedCost === "number" && Number.isFinite(usage.providerReportedCost) && usage.providerReportedCost >= 0 ? usage.providerReportedCost : void 0;
|
|
872
846
|
return [
|
|
873
|
-
attrInt(MODEL_USAGE_ATTRIBUTES.inputTokens, inputTokens),
|
|
874
|
-
attrInt(MODEL_USAGE_ATTRIBUTES.outputTokens, outputTokens),
|
|
875
|
-
attrInt(MODEL_USAGE_ATTRIBUTES.reasoningTokens, reasoningTokens),
|
|
876
|
-
attrInt(MODEL_USAGE_ATTRIBUTES.cacheReadInputTokens, cacheReadInputTokens),
|
|
877
|
-
attrInt(MODEL_USAGE_ATTRIBUTES.cacheWriteInputTokens, cacheWriteInputTokens),
|
|
878
|
-
|
|
847
|
+
attrInt(MODEL_USAGE_ATTRIBUTES.inputTokens, tokenCount(usage.inputTokens)),
|
|
848
|
+
attrInt(MODEL_USAGE_ATTRIBUTES.outputTokens, tokenCount(usage.outputTokens)),
|
|
849
|
+
attrInt(MODEL_USAGE_ATTRIBUTES.reasoningTokens, tokenCount(usage.reasoningTokens)),
|
|
850
|
+
attrInt(MODEL_USAGE_ATTRIBUTES.cacheReadInputTokens, tokenCount(usage.cacheReadInputTokens)),
|
|
851
|
+
attrInt(MODEL_USAGE_ATTRIBUTES.cacheWriteInputTokens, tokenCount(usage.cacheWriteInputTokens)),
|
|
852
|
+
attrDouble(MODEL_USAGE_ATTRIBUTES.providerReportedCost, providerReportedCost)
|
|
879
853
|
].filter((attribute) => attribute !== void 0);
|
|
880
854
|
}
|
|
881
855
|
var STRING_ALIASES = {
|
|
@@ -1476,7 +1450,7 @@ function resolveLocalWorkshopUrl(fileValue) {
|
|
|
1476
1450
|
// package.json
|
|
1477
1451
|
var package_default = {
|
|
1478
1452
|
name: "@raindrop-ai/opencode-plugin",
|
|
1479
|
-
version: "0.1.
|
|
1453
|
+
version: "0.1.3",
|
|
1480
1454
|
description: "Raindrop observability plugin for OpenCode \u2014 automatic session/event/span tracing",
|
|
1481
1455
|
type: "module",
|
|
1482
1456
|
main: "dist/index.js",
|
|
@@ -1681,18 +1655,13 @@ function parseOpenCodeAssistantTokens(tokens) {
|
|
|
1681
1655
|
};
|
|
1682
1656
|
}
|
|
1683
1657
|
function modelSpendSpanAttributes(input) {
|
|
1684
|
-
const providerAttr = attrString(
|
|
1685
|
-
|
|
1686
|
-
canonicalModelProvider(input.providerID)
|
|
1687
|
-
);
|
|
1688
|
-
const usageAttrs = buildModelUsageAttributes({
|
|
1658
|
+
const providerAttr = attrString("gen_ai.provider.name", canonicalModelProvider(input.providerID));
|
|
1659
|
+
const usageAttrs = buildRawModelUsageAttributes({
|
|
1689
1660
|
inputTokens: input.tokens.input,
|
|
1690
1661
|
outputTokens: input.tokens.output,
|
|
1691
1662
|
reasoningTokens: input.tokens.reasoning,
|
|
1692
1663
|
cacheReadInputTokens: input.tokens.cacheRead,
|
|
1693
|
-
cacheWriteInputTokens: input.tokens.cacheWrite
|
|
1694
|
-
inputTokenSemantics: "exclusive",
|
|
1695
|
-
outputTokenSemantics: "exclusive"
|
|
1664
|
+
cacheWriteInputTokens: input.tokens.cacheWrite
|
|
1696
1665
|
});
|
|
1697
1666
|
return providerAttr ? [providerAttr, ...usageAttrs] : usageAttrs;
|
|
1698
1667
|
}
|
|
@@ -1700,6 +1669,9 @@ function buildLlmGenAiAttributes(input) {
|
|
|
1700
1669
|
const parsed = parseOpenCodeAssistantTokens(input.tokens);
|
|
1701
1670
|
if (!parsed) return [];
|
|
1702
1671
|
return [
|
|
1672
|
+
// OpenCode has already normalized both token axes. Provenance lets Dawn
|
|
1673
|
+
// select that contract without the SDK or customer declaring semantics.
|
|
1674
|
+
attrString(MODEL_USAGE_ATTRIBUTES.usageSource, "opencode"),
|
|
1703
1675
|
attrString("gen_ai.system", input.providerID),
|
|
1704
1676
|
attrString("gen_ai.request.model", input.modelID),
|
|
1705
1677
|
attrString("gen_ai.response.model", input.modelID),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@raindrop-ai/opencode-plugin",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Raindrop observability plugin for OpenCode — automatic session/event/span tracing",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@types/node": "^20.11.17",
|
|
38
38
|
"tsup": "^8.4.0",
|
|
39
39
|
"typescript": "^5.3.3",
|
|
40
|
-
"@raindrop-ai/core": "0.2.
|
|
40
|
+
"@raindrop-ai/core": "0.2.1"
|
|
41
41
|
},
|
|
42
42
|
"tsup": {
|
|
43
43
|
"entry": [
|