@respan/respan-sdk 1.1.2 → 1.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/README.md +27 -2
- package/dist/constants/logConstants.d.ts +1 -0
- package/dist/constants/logConstants.js +1 -0
- package/dist/constants/logConstants.js.map +1 -1
- package/dist/types/baseTypes.d.ts +3 -0
- package/dist/types/spanTypes.d.ts +17 -1
- package/dist/types/spanTypes.js +25 -1
- package/dist/types/spanTypes.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @respan/respan-sdk
|
|
2
2
|
|
|
3
3
|
**[respan.ai](https://respan.ai)** | **[Documentation](https://docs.respan.ai)**
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Core types, constants, and utilities for the Respan SDK ecosystem.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @respan/respan-sdk
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## What's included
|
|
14
|
+
|
|
15
|
+
- **Types** — TypeScript definitions for spans, traces, logs, datasets, evaluators, experiments, and prompts
|
|
16
|
+
- **Constants** — Span attribute keys, log type enums, and OTLP wire format constants
|
|
17
|
+
- **Utilities** — Retry helpers and shared tooling used across Respan packages
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
This package is a dependency of `@respan/tracing` and `@respan/respan`. You typically don't need to install it directly unless you're building a custom exporter or instrumentation plugin.
|
|
22
|
+
|
|
23
|
+
```typescript
|
|
24
|
+
import { RespanSpanAttributes, RespanLogType } from "@respan/respan-sdk";
|
|
25
|
+
import type { RespanParams } from "@respan/respan-sdk";
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## License
|
|
29
|
+
|
|
30
|
+
Apache-2.0
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logConstants.js","sourceRoot":"","sources":["../../src/constants/logConstants.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,8BAA8B;AAC9B,MAAM,CAAN,IAAY,
|
|
1
|
+
{"version":3,"file":"logConstants.js","sourceRoot":"","sources":["../../src/constants/logConstants.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,8BAA8B;AAC9B,MAAM,CAAN,IAAY,aAiBX;AAjBD,WAAY,aAAa;IACvB,8BAAa,CAAA;IACb,8BAAa,CAAA;IACb,sCAAqB,CAAA;IACrB,wCAAuB,CAAA;IACvB,gDAA+B,CAAA;IAC/B,kCAAiB,CAAA;IACjB,sCAAqB,CAAA;IACrB,8BAAa,CAAA;IACb,8BAAa,CAAA;IACb,gCAAe,CAAA;IACf,oCAAmB,CAAA;IACnB,wCAAuB,CAAA;IACvB,sCAAqB,CAAA;IACrB,kCAAiB,CAAA;IACjB,0CAAyB,CAAA;IACzB,oCAAmB,CAAA;AACrB,CAAC,EAjBW,aAAa,KAAb,aAAa,QAiBxB"}
|
|
@@ -6,5 +6,8 @@ export type RespanParams = {
|
|
|
6
6
|
evaluation_identifier?: string | number;
|
|
7
7
|
thread_identifier?: string | number;
|
|
8
8
|
trace_group_identifier?: string | number;
|
|
9
|
+
group_identifier?: string | number;
|
|
9
10
|
metadata?: Record<string, any>;
|
|
11
|
+
prompt?: Record<string, any> | string;
|
|
12
|
+
environment?: string;
|
|
10
13
|
};
|
|
@@ -6,7 +6,23 @@ export declare enum RespanSpanAttributes {
|
|
|
6
6
|
RESPAN_EVALUATION_PARAMS_ID = "respan.evaluation_params.evaluation_identifier",
|
|
7
7
|
RESPAN_THREADS_ID = "respan.threads.thread_identifier",
|
|
8
8
|
RESPAN_TRACE_GROUP_ID = "respan.trace.trace_group_identifier",
|
|
9
|
-
RESPAN_METADATA = "respan.metadata"
|
|
9
|
+
RESPAN_METADATA = "respan.metadata",
|
|
10
|
+
RESPAN_PROMPT = "respan.prompt",
|
|
11
|
+
RESPAN_ENVIRONMENT = "respan.environment",
|
|
12
|
+
RESPAN_LINK_TIMESTAMP = "respan.link.timestamp",
|
|
13
|
+
RESPAN_LOG_METHOD = "respan.entity.log_method",
|
|
14
|
+
RESPAN_LOG_TYPE = "respan.entity.log_type",
|
|
15
|
+
RESPAN_LOG_ID = "respan.entity.log_id",
|
|
16
|
+
RESPAN_LOG_PARENT_ID = "respan.entity.log_parent_id",
|
|
17
|
+
RESPAN_LOG_ROOT_ID = "respan.entity.log_root_id",
|
|
18
|
+
RESPAN_LOG_SOURCE = "respan.entity.log_source",
|
|
19
|
+
OPENINFERENCE_SPAN_KIND = "openinference.span.kind",
|
|
20
|
+
GEN_AI_SYSTEM = "gen_ai.system",
|
|
21
|
+
GEN_AI_REQUEST_MODEL = "gen_ai.request.model",
|
|
22
|
+
GEN_AI_USAGE_PROMPT_TOKENS = "gen_ai.usage.prompt_tokens",
|
|
23
|
+
GEN_AI_USAGE_COMPLETION_TOKENS = "gen_ai.usage.completion_tokens",
|
|
24
|
+
LLM_REQUEST_TYPE = "llm.request.type",
|
|
25
|
+
LLM_SYSTEM = "llm.system"
|
|
10
26
|
}
|
|
11
27
|
export declare const RESPAN_SPAN_ATTRIBUTES_MAP: {
|
|
12
28
|
[key: string]: string;
|
package/dist/types/spanTypes.js
CHANGED
|
@@ -14,6 +14,27 @@ export var RespanSpanAttributes;
|
|
|
14
14
|
RespanSpanAttributes["RESPAN_TRACE_GROUP_ID"] = "respan.trace.trace_group_identifier";
|
|
15
15
|
// Metadata
|
|
16
16
|
RespanSpanAttributes["RESPAN_METADATA"] = "respan.metadata";
|
|
17
|
+
// Prompt & environment
|
|
18
|
+
RespanSpanAttributes["RESPAN_PROMPT"] = "respan.prompt";
|
|
19
|
+
RespanSpanAttributes["RESPAN_ENVIRONMENT"] = "respan.environment";
|
|
20
|
+
// Span links
|
|
21
|
+
RespanSpanAttributes["RESPAN_LINK_TIMESTAMP"] = "respan.link.timestamp";
|
|
22
|
+
// Logging
|
|
23
|
+
RespanSpanAttributes["RESPAN_LOG_METHOD"] = "respan.entity.log_method";
|
|
24
|
+
RespanSpanAttributes["RESPAN_LOG_TYPE"] = "respan.entity.log_type";
|
|
25
|
+
RespanSpanAttributes["RESPAN_LOG_ID"] = "respan.entity.log_id";
|
|
26
|
+
RespanSpanAttributes["RESPAN_LOG_PARENT_ID"] = "respan.entity.log_parent_id";
|
|
27
|
+
RespanSpanAttributes["RESPAN_LOG_ROOT_ID"] = "respan.entity.log_root_id";
|
|
28
|
+
RespanSpanAttributes["RESPAN_LOG_SOURCE"] = "respan.entity.log_source";
|
|
29
|
+
// OpenInference
|
|
30
|
+
RespanSpanAttributes["OPENINFERENCE_SPAN_KIND"] = "openinference.span.kind";
|
|
31
|
+
// GenAI / LLM semantic conventions (for packages that don't depend on @traceloop/ai-semantic-conventions)
|
|
32
|
+
RespanSpanAttributes["GEN_AI_SYSTEM"] = "gen_ai.system";
|
|
33
|
+
RespanSpanAttributes["GEN_AI_REQUEST_MODEL"] = "gen_ai.request.model";
|
|
34
|
+
RespanSpanAttributes["GEN_AI_USAGE_PROMPT_TOKENS"] = "gen_ai.usage.prompt_tokens";
|
|
35
|
+
RespanSpanAttributes["GEN_AI_USAGE_COMPLETION_TOKENS"] = "gen_ai.usage.completion_tokens";
|
|
36
|
+
RespanSpanAttributes["LLM_REQUEST_TYPE"] = "llm.request.type";
|
|
37
|
+
RespanSpanAttributes["LLM_SYSTEM"] = "llm.system";
|
|
17
38
|
})(RespanSpanAttributes || (RespanSpanAttributes = {}));
|
|
18
39
|
export const RESPAN_SPAN_ATTRIBUTES_MAP = {
|
|
19
40
|
customer_identifier: RespanSpanAttributes.RESPAN_CUSTOMER_PARAMS_ID,
|
|
@@ -23,6 +44,9 @@ export const RESPAN_SPAN_ATTRIBUTES_MAP = {
|
|
|
23
44
|
thread_identifier: RespanSpanAttributes.RESPAN_THREADS_ID,
|
|
24
45
|
custom_identifier: RespanSpanAttributes.RESPAN_SPAN_CUSTOM_ID,
|
|
25
46
|
trace_group_identifier: RespanSpanAttributes.RESPAN_TRACE_GROUP_ID,
|
|
26
|
-
|
|
47
|
+
group_identifier: RespanSpanAttributes.RESPAN_TRACE_GROUP_ID,
|
|
48
|
+
metadata: RespanSpanAttributes.RESPAN_METADATA,
|
|
49
|
+
prompt: RespanSpanAttributes.RESPAN_PROMPT,
|
|
50
|
+
environment: RespanSpanAttributes.RESPAN_ENVIRONMENT,
|
|
27
51
|
};
|
|
28
52
|
//# sourceMappingURL=spanTypes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spanTypes.js","sourceRoot":"","sources":["../../src/types/spanTypes.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,
|
|
1
|
+
{"version":3,"file":"spanTypes.js","sourceRoot":"","sources":["../../src/types/spanTypes.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,oBA8CX;AA9CD,WAAY,oBAAoB;IAC5B,kBAAkB;IAClB,sFAA8D,CAAA;IAE9D,kBAAkB;IAClB,gGAAwE,CAAA;IACxE,qFAA6D,CAAA;IAC7D,mFAA2D,CAAA;IAE3D,oBAAoB;IACpB,sGAA8E,CAAA;IAE9E,UAAU;IACV,8EAAsD,CAAA;IAEtD,QAAQ;IACR,qFAA6D,CAAA;IAE7D,WAAW;IACX,2DAAmC,CAAA;IAEnC,uBAAuB;IACvB,uDAA+B,CAAA;IAC/B,iEAAyC,CAAA;IAEzC,aAAa;IACb,uEAA+C,CAAA;IAE/C,UAAU;IACV,sEAA8C,CAAA;IAC9C,kEAA0C,CAAA;IAC1C,8DAAsC,CAAA;IACtC,4EAAoD,CAAA;IACpD,wEAAgD,CAAA;IAChD,sEAA8C,CAAA;IAE9C,gBAAgB;IAChB,2EAAmD,CAAA;IAEnD,0GAA0G;IAC1G,uDAA+B,CAAA;IAC/B,qEAA6C,CAAA;IAC7C,iFAAyD,CAAA;IACzD,yFAAiE,CAAA;IACjE,6DAAqC,CAAA;IACrC,iDAAyB,CAAA;AAC7B,CAAC,EA9CW,oBAAoB,KAApB,oBAAoB,QA8C/B;AAED,MAAM,CAAC,MAAM,0BAA0B,GAA8B;IACjE,mBAAmB,EAAE,oBAAoB,CAAC,yBAAyB;IACnE,cAAc,EAAE,oBAAoB,CAAC,4BAA4B;IACjE,aAAa,EAAE,oBAAoB,CAAC,2BAA2B;IAC/D,qBAAqB,EAAE,oBAAoB,CAAC,2BAA2B;IACvE,iBAAiB,EAAE,oBAAoB,CAAC,iBAAiB;IACzD,iBAAiB,EAAE,oBAAoB,CAAC,qBAAqB;IAC7D,sBAAsB,EAAE,oBAAoB,CAAC,qBAAqB;IAClE,gBAAgB,EAAE,oBAAoB,CAAC,qBAAqB;IAC5D,QAAQ,EAAE,oBAAoB,CAAC,eAAe;IAC9C,MAAM,EAAE,oBAAoB,CAAC,aAAa;IAC1C,WAAW,EAAE,oBAAoB,CAAC,kBAAkB;CACvD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@respan/respan-sdk",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.1.
|
|
5
|
-
"description": "Respan
|
|
4
|
+
"version": "1.1.3",
|
|
5
|
+
"description": "Core types, constants, and utilities for the Respan SDK",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
8
|
"author": "Respan <team@respan.ai>",
|