@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/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
- /** Span values over Hue's inline limit uploaded apart from their spans (or already stored by
128
- * Hue), each listed under the span's `hue.blobs` with its first 16 KiB kept inline. */
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
- /** Span values over Hue's inline limit that could not be uploaded and were exported cut to the
131
- * limit (an inline file as its digest), each reported in a warning issue. */
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
- /** Attributes set when the span starts. */
153
- attributes?: Attributes;
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
- /** The file's bytes, only hashed and measured, never exported; a string is hashed as UTF-8.
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.16.0";
2
+ export declare const sdkVersion = "0.18.0";
package/dist/version.js CHANGED
@@ -1,3 +1,3 @@
1
1
  // Generated by scripts/write-version.mjs from package.json; do not edit by hand.
2
2
  /** Package version shared by the instrumentation scope and the export User-Agent. */
3
- export const sdkVersion = "0.16.0";
3
+ export const sdkVersion = "0.18.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hue-run/sdk",
3
- "version": "0.16.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.5.1",
102
+ "@types/node": "26.6.4",
103
103
  "ai": "7.0.99",
104
104
  "ajv": "8.20.0",
105
105
  "protobufjs": "8.8.0",