@hue-run/sdk 0.16.0 → 0.18.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/CLI.md +18 -11
- package/EVALUATIONS.md +53 -2
- package/README.md +295 -45
- package/dist/attachment.d.ts +82 -0
- package/dist/attachment.js +225 -0
- package/dist/blobs.d.ts +73 -17
- package/dist/blobs.js +247 -96
- package/dist/cli/eval-direct.d.ts +3 -2
- package/dist/cli/eval-direct.js +49 -6
- package/dist/client.d.ts +21 -1
- package/dist/client.js +217 -32
- package/dist/evals/client.d.ts +14 -1
- package/dist/evals/client.js +73 -9
- package/dist/evals/files.d.ts +11 -1
- package/dist/evals/files.js +172 -20
- package/dist/evals/media.d.ts +217 -0
- package/dist/evals/media.js +907 -0
- package/dist/evals/runner.js +130 -106
- package/dist/evals/types.d.ts +48 -0
- package/dist/evals.d.ts +2 -0
- package/dist/evals.js +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/inline-files.d.ts +160 -28
- package/dist/inline-files.js +809 -86
- package/dist/json-edits.d.ts +24 -0
- package/dist/json-edits.js +187 -0
- package/dist/privacy.d.ts +14 -1
- package/dist/privacy.js +86 -25
- package/dist/safety.d.ts +7 -2
- package/dist/safety.js +22 -4
- package/dist/snapshot.d.ts +7 -4
- package/dist/snapshot.js +177 -38
- package/dist/transport.d.ts +18 -0
- package/dist/transport.js +544 -38
- package/dist/types.d.ts +28 -7
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -2
package/dist/types.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { Attributes, Context, Span, SpanKind, Tracer, TracerProvider } from "@opentelemetry/api";
|
|
2
|
+
import type { AttributeValue } from "@opentelemetry/api";
|
|
2
3
|
import type { LoggerProvider } from "@opentelemetry/api-logs";
|
|
4
|
+
import type { Attachment } from "./attachment.js";
|
|
3
5
|
/**
|
|
4
6
|
* JSON-compatible data: the shape content has on the wire after the helpers encode it. Helpers
|
|
5
7
|
* accept `unknown` and validate at runtime; values that are not plain JSON are omitted with an
|
|
@@ -8,6 +10,14 @@ import type { LoggerProvider } from "@opentelemetry/api-logs";
|
|
|
8
10
|
export type JsonValue = null | boolean | number | string | JsonValue[] | {
|
|
9
11
|
[key: string]: JsonValue;
|
|
10
12
|
};
|
|
13
|
+
/**
|
|
14
|
+
* JSON data that may hold an {@link Attachment} anywhere: what a span attribute passed to a helper
|
|
15
|
+
* may be besides an OpenTelemetry attribute value. Such a value is recorded as JSON text with each
|
|
16
|
+
* attachment as its digest part.
|
|
17
|
+
*/
|
|
18
|
+
export type AttachmentJson = Attachment | JsonValue | AttachmentJson[] | {
|
|
19
|
+
[key: string]: AttachmentJson;
|
|
20
|
+
};
|
|
11
21
|
/** Telemetry signal named by export reports, issues and processors. */
|
|
12
22
|
export type Signal = "traces" | "logs";
|
|
13
23
|
/** Options accepted by every Hue client and transport, whether enabled or disabled. */
|
|
@@ -124,11 +134,13 @@ export interface ExportReport {
|
|
|
124
134
|
pendingBytes: number;
|
|
125
135
|
/** Helper capture or instrumentation failures that omitted telemetry while preserving application results. */
|
|
126
136
|
instrumentationFailures: number;
|
|
127
|
-
/**
|
|
128
|
-
* Hue), each listed under the
|
|
137
|
+
/** Whole span attributes, inline media, attachments and opted-in file helper uploads stored
|
|
138
|
+
* apart from their records (or already held by Hue), each listed under the record's
|
|
139
|
+
* `hue.blobs`. */
|
|
129
140
|
uploadedValues: number;
|
|
130
|
-
/**
|
|
131
|
-
*
|
|
141
|
+
/** Whole-attribute, inline-media, attachment and opted-in file helper uploads that could not be
|
|
142
|
+
* attached. Content falls back to truncation, media digests, or file metadata, with a warning
|
|
143
|
+
* issue. */
|
|
132
144
|
uploadFallbacks: number;
|
|
133
145
|
}
|
|
134
146
|
/** Caller budget for {@link HueClient.flushSafe} and {@link HueClient.shutdownSafe}. */
|
|
@@ -149,8 +161,15 @@ export interface SafeLifecycleResult {
|
|
|
149
161
|
export interface SpanOptions {
|
|
150
162
|
/** OpenTelemetry span kind; `INTERNAL` by default. */
|
|
151
163
|
kind?: SpanKind;
|
|
152
|
-
/**
|
|
153
|
-
|
|
164
|
+
/**
|
|
165
|
+
* Attributes set when the span starts. A value that is a JSON object, an array OpenTelemetry
|
|
166
|
+
* cannot hold (not of one primitive type) or an {@link Attachment} is recorded as JSON text, with
|
|
167
|
+
* each attachment as its digest part and its bytes uploaded; put files under `metadata` for Hue to
|
|
168
|
+
* list them as the span's metadata files.
|
|
169
|
+
*/
|
|
170
|
+
attributes?: {
|
|
171
|
+
[key: string]: AttributeValue | AttachmentJson | undefined;
|
|
172
|
+
};
|
|
154
173
|
/** Recorded as `gen_ai.conversation.id` on this span and inherited by nested helper spans. */
|
|
155
174
|
sessionId?: string;
|
|
156
175
|
/** Recorded as `user.id` on this span and inherited by nested helper spans. */
|
|
@@ -237,7 +256,9 @@ export interface FileRecord {
|
|
|
237
256
|
mediaType: string;
|
|
238
257
|
/** Hex SHA-256 of the file's bytes; computed from `data` when omitted. */
|
|
239
258
|
sha256?: string;
|
|
240
|
-
/**
|
|
259
|
+
/** Upload supplied bytes on this span when content capture is enabled. Defaults to false. */
|
|
260
|
+
upload?: boolean;
|
|
261
|
+
/** The file's bytes, hashed and measured locally by default; a string is hashed as UTF-8.
|
|
241
262
|
* Data larger than 25 MiB is omitted and counted as an instrumentation failure. */
|
|
242
263
|
data?: Uint8Array | string;
|
|
243
264
|
/** Size in bytes; computed from `data` when omitted. */
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** Package version shared by the instrumentation scope and the export User-Agent. */
|
|
2
|
-
export declare const sdkVersion = "0.
|
|
2
|
+
export declare const sdkVersion = "0.18.0";
|
package/dist/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hue-run/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
"@opentelemetry/api": "1.9.1",
|
|
100
100
|
"@opentelemetry/context-async-hooks": "2.11.0",
|
|
101
101
|
"@types/bun": "1.4.2",
|
|
102
|
-
"@types/node": "26.
|
|
102
|
+
"@types/node": "26.6.4",
|
|
103
103
|
"ai": "7.0.99",
|
|
104
104
|
"ajv": "8.20.0",
|
|
105
105
|
"protobufjs": "8.8.0",
|