raindrop-ai 0.0.39 → 0.0.41
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/chunk-ZKC66DME.mjs +221 -0
- package/dist/index.js +35 -8
- package/dist/index.mjs +3 -6
- package/dist/tracing/index.d.mts +1 -1
- package/dist/tracing/index.d.ts +1 -1
- package/dist/tracing/index.js +108030 -92
- package/dist/tracing/index.mjs +107953 -31
- package/package.json +1 -4
- package/dist/chunk-45CPPW3B.mjs +0 -137
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "raindrop-ai",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.41",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/index.mjs",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -41,9 +41,6 @@
|
|
|
41
41
|
"weakref": "^0.2.1",
|
|
42
42
|
"zod": "^3.23.8"
|
|
43
43
|
},
|
|
44
|
-
"peerDependencies": {
|
|
45
|
-
"@traceloop/node-server-sdk": "^0.12.2"
|
|
46
|
-
},
|
|
47
44
|
"optionalDependencies": {
|
|
48
45
|
"@traceloop/node-server-sdk": "^0.12.2"
|
|
49
46
|
},
|
package/dist/chunk-45CPPW3B.mjs
DELETED
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
// src/tracing/noOpSpan.ts
|
|
2
|
-
import {
|
|
3
|
-
TraceFlags
|
|
4
|
-
} from "@opentelemetry/api";
|
|
5
|
-
var INVALID_SPAN_CONTEXT = {
|
|
6
|
-
traceId: "",
|
|
7
|
-
spanId: "",
|
|
8
|
-
traceFlags: TraceFlags.NONE,
|
|
9
|
-
isRemote: false
|
|
10
|
-
};
|
|
11
|
-
var NoOpSpan = class {
|
|
12
|
-
spanContext() {
|
|
13
|
-
return INVALID_SPAN_CONTEXT;
|
|
14
|
-
}
|
|
15
|
-
setAttribute(_key, _value) {
|
|
16
|
-
return this;
|
|
17
|
-
}
|
|
18
|
-
setAttributes(_attributes) {
|
|
19
|
-
return this;
|
|
20
|
-
}
|
|
21
|
-
addEvent(_name, _attributesOrStartTime, _startTime) {
|
|
22
|
-
return this;
|
|
23
|
-
}
|
|
24
|
-
addLink(_link) {
|
|
25
|
-
return this;
|
|
26
|
-
}
|
|
27
|
-
addLinks(_links) {
|
|
28
|
-
return this;
|
|
29
|
-
}
|
|
30
|
-
setStatus(_status) {
|
|
31
|
-
return this;
|
|
32
|
-
}
|
|
33
|
-
updateName(_name) {
|
|
34
|
-
return this;
|
|
35
|
-
}
|
|
36
|
-
end(_endTime) {
|
|
37
|
-
}
|
|
38
|
-
recordException(_exception, _time) {
|
|
39
|
-
}
|
|
40
|
-
isRecording() {
|
|
41
|
-
return false;
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
var NO_OP_SPAN = new NoOpSpan();
|
|
45
|
-
|
|
46
|
-
// src/tracing/nonLiveInteraction.ts
|
|
47
|
-
var NonLiveInteraction = class {
|
|
48
|
-
constructor(context, traceId, analytics) {
|
|
49
|
-
this.context = context;
|
|
50
|
-
this.analytics = analytics;
|
|
51
|
-
}
|
|
52
|
-
withSpan(_params, fn, thisArg, ...args) {
|
|
53
|
-
try {
|
|
54
|
-
return Promise.resolve(fn.apply(thisArg, args));
|
|
55
|
-
} catch (error) {
|
|
56
|
-
return Promise.reject(error);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
startSpan(_params) {
|
|
60
|
-
return NO_OP_SPAN;
|
|
61
|
-
}
|
|
62
|
-
setProperties(_properties) {
|
|
63
|
-
var _a;
|
|
64
|
-
(_a = this.analytics) == null ? void 0 : _a._trackAiPartial({
|
|
65
|
-
eventId: this.context.eventId,
|
|
66
|
-
properties: _properties
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
setProperty(_key, _value) {
|
|
70
|
-
var _a;
|
|
71
|
-
(_a = this.analytics) == null ? void 0 : _a._trackAiPartial({
|
|
72
|
-
eventId: this.context.eventId,
|
|
73
|
-
properties: {
|
|
74
|
-
[_key]: _value
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
addAttachments(_attachments) {
|
|
79
|
-
var _a;
|
|
80
|
-
(_a = this.analytics) == null ? void 0 : _a._trackAiPartial({
|
|
81
|
-
eventId: this.context.eventId,
|
|
82
|
-
attachments: _attachments
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
setInput(_input) {
|
|
86
|
-
var _a;
|
|
87
|
-
(_a = this.analytics) == null ? void 0 : _a._trackAiPartial({
|
|
88
|
-
eventId: this.context.eventId,
|
|
89
|
-
input: _input
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
finish(resultEvent) {
|
|
93
|
-
var _a;
|
|
94
|
-
(_a = this.analytics) == null ? void 0 : _a._trackAiPartial({
|
|
95
|
-
...resultEvent,
|
|
96
|
-
eventId: this.context.eventId,
|
|
97
|
-
isPending: false
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
// src/tracing/tracer-core.ts
|
|
103
|
-
var createTracing = (analytics, _apiUrl, _writeKey, _options, isDebug = false) => ({
|
|
104
|
-
begin(traceContext) {
|
|
105
|
-
if (isDebug) {
|
|
106
|
-
console.log("not using traces");
|
|
107
|
-
}
|
|
108
|
-
if (!traceContext.eventId) {
|
|
109
|
-
traceContext.eventId = crypto.randomUUID();
|
|
110
|
-
}
|
|
111
|
-
analytics._trackAiPartial({
|
|
112
|
-
...traceContext
|
|
113
|
-
});
|
|
114
|
-
return new NonLiveInteraction(
|
|
115
|
-
traceContext,
|
|
116
|
-
void 0,
|
|
117
|
-
// No traceId in stub
|
|
118
|
-
analytics
|
|
119
|
-
);
|
|
120
|
-
},
|
|
121
|
-
getActiveInteraction(eventId) {
|
|
122
|
-
return new NonLiveInteraction({ eventId }, void 0, analytics);
|
|
123
|
-
},
|
|
124
|
-
close() {
|
|
125
|
-
}
|
|
126
|
-
});
|
|
127
|
-
var implementation = createTracing;
|
|
128
|
-
var tracing = (analytics, apiUrl, writeKey, options, isDebug = false) => implementation(analytics, apiUrl, writeKey, options, isDebug);
|
|
129
|
-
var _setImplementation = (impl) => {
|
|
130
|
-
implementation = impl;
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
export {
|
|
134
|
-
NonLiveInteraction,
|
|
135
|
-
tracing,
|
|
136
|
-
_setImplementation
|
|
137
|
-
};
|