@hue-run/sdk 0.20.4 → 0.20.5
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 +13 -11
- package/README.md +2 -2
- package/dist/cli/traces-import-convert.js +20 -7
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/CLI.md
CHANGED
|
@@ -42,7 +42,7 @@ project manifest are refused because managers can update ancestor locks; Python
|
|
|
42
42
|
The generated `hue.setup.mjs` or `hue_setup.py` always selects `captureContent: false` /
|
|
43
43
|
`capture_content=False`. For a supported application, setup installs the dependency and adds the
|
|
44
44
|
managed import and middleware registration to the existing entrypoint; an unreferenced helper is
|
|
45
|
-
not a completed integration. TypeScript uses `@hue-run/sdk@0.20.
|
|
45
|
+
not a completed integration. TypeScript uses `@hue-run/sdk@0.20.5`, `@opentelemetry/api@1.9.1` and
|
|
46
46
|
`@opentelemetry/context-async-hooks@2.11.0`; Python setup uses its separately tested package pin.
|
|
47
47
|
Content capture requires an ordinary account-managed key and a later explicit application decision.
|
|
48
48
|
|
|
@@ -381,8 +381,8 @@ and Hue never receives or stores them. The command is part of the `hue` executab
|
|
|
381
381
|
# LANGFUSE_PUBLIC_KEY=pk-lf-...
|
|
382
382
|
# LANGFUSE_SECRET_KEY=sk-lf-...
|
|
383
383
|
# LANGFUSE_BASE_URL=https://cloud.langfuse.com
|
|
384
|
-
npx -y @hue-run/sdk@0.20.
|
|
385
|
-
npx -y @hue-run/sdk@0.20.
|
|
384
|
+
npx -y @hue-run/sdk@0.20.5 import langfuse --env-path .env.langfuse --from 2026-01-01 --dry-run
|
|
385
|
+
npx -y @hue-run/sdk@0.20.5 import langfuse --env-path .env.langfuse --from 2026-01-01 --media
|
|
386
386
|
```
|
|
387
387
|
|
|
388
388
|
`LANGFUSE_PUBLIC_KEY` and `LANGFUSE_SECRET_KEY` come from the environment or `--env-path`
|
|
@@ -523,7 +523,9 @@ attributes Hue reads; an id that is no OpenTelemetry id is mapped as `hue import
|
|
|
523
523
|
so an export and a live import of the same trace agree. An ATIF export becomes one trace: an agent
|
|
524
524
|
span for the run, a model span per agent step with the conversation so far, a tool span per call,
|
|
525
525
|
each embedded subagent as its own agent span under the call that spawned it, and the export's
|
|
526
|
-
`extra.user_id` as the trace's `user.id
|
|
526
|
+
`extra.user_id` as the trace's `user.id`; its spans carry `hue.import.format` `atif` under the
|
|
527
|
+
instrumentation scope `hue.import.atif`, and the run's agent span is named `invoke_agent
|
|
528
|
+
<agent.name>` from the export's own agent. ATIF records instants, not durations, so model and tool
|
|
527
529
|
spans are points in time, and a tool's result is kept as text with no error status of the
|
|
528
530
|
importer's making. The same trace in two files is one trace when the copies agree and a refusal
|
|
529
531
|
when they differ; a trace with more than 100,000 spans, 64 batches or 1,000 values is refused and
|
|
@@ -687,7 +689,7 @@ node packages/sdk-typescript/scripts/verify-package.mjs --artifacts-dir .artifac
|
|
|
687
689
|
# Set project to an existing supported fixture; use the same directory on resume.
|
|
688
690
|
project=/absolute/path/to/supported-fixture
|
|
689
691
|
node packages/sdk-typescript/scripts/verify-setup-live.mjs \
|
|
690
|
-
--archive .artifacts/typescript/hue-run-sdk-0.20.
|
|
692
|
+
--archive .artifacts/typescript/hue-run-sdk-0.20.5.tgz \
|
|
691
693
|
--origin https://STAGING_ORIGIN \
|
|
692
694
|
--project "$project" --command setup \
|
|
693
695
|
--evidence .context/setup-staging-before-claim.json
|
|
@@ -698,7 +700,7 @@ the private local handoff and finish the real browser claim, then reconcile the
|
|
|
698
700
|
|
|
699
701
|
```sh
|
|
700
702
|
node packages/sdk-typescript/scripts/verify-setup-live.mjs \
|
|
701
|
-
--archive .artifacts/typescript/hue-run-sdk-0.20.
|
|
703
|
+
--archive .artifacts/typescript/hue-run-sdk-0.20.5.tgz \
|
|
702
704
|
--origin https://STAGING_ORIGIN \
|
|
703
705
|
--project "$project" --command claim \
|
|
704
706
|
--evidence .context/setup-staging-after-claim.json
|
|
@@ -740,10 +742,10 @@ otherwise. Never hand the agent Hue-native tools (`context.tools`, `context.mcp`
|
|
|
740
742
|
production agent lacks. Pin the SDK, so the agent's repository gains no dependency:
|
|
741
743
|
|
|
742
744
|
```sh
|
|
743
|
-
npx -y @hue-run/sdk@0.20.
|
|
744
|
-
npx -y @hue-run/sdk@0.20.
|
|
745
|
-
npx -y @hue-run/sdk@0.20.
|
|
746
|
-
npx -y @hue-run/sdk@0.20.
|
|
745
|
+
npx -y @hue-run/sdk@0.20.5 eval --case "Refund an eligible charge" --command "node agent.js"
|
|
746
|
+
npx -y @hue-run/sdk@0.20.5 eval --case https://app.hue.run/projects/demo/scenarios/<id> --command "python agent.py" --timeout 120 --baseline <run id>
|
|
747
|
+
npx -y @hue-run/sdk@0.20.5 eval --set "Billing regressions" --scorer-version <id> --command "node agent.js" --save-version
|
|
748
|
+
npx -y @hue-run/sdk@0.20.5 eval --worker --command "node agent.js" --agent-key support-agent --revision <new-agent-revision>
|
|
747
749
|
```
|
|
748
750
|
|
|
749
751
|
One invocation creates one run holding every selected case; it prints the run URL
|
|
@@ -781,7 +783,7 @@ export default function runMyAgent(inputs: JsonValue, context: SimulationTargetC
|
|
|
781
783
|
```
|
|
782
784
|
|
|
783
785
|
```sh
|
|
784
|
-
npx -y @hue-run/sdk@0.20.
|
|
786
|
+
npx -y @hue-run/sdk@0.20.5 eval --case "Refund an eligible charge" ./hue-agent.ts --content
|
|
785
787
|
```
|
|
786
788
|
|
|
787
789
|
`--scenario` remains an alias for `--case` for existing scripts. Pass one selection flag.
|
package/README.md
CHANGED
|
@@ -536,8 +536,8 @@ the Langfuse project's own keys (`LANGFUSE_PUBLIC_KEY`, `LANGFUSE_SECRET_KEY`, a
|
|
|
536
536
|
`HUE_API_KEY`:
|
|
537
537
|
|
|
538
538
|
```sh
|
|
539
|
-
npx -y @hue-run/sdk@0.20.
|
|
540
|
-
npx -y @hue-run/sdk@0.20.
|
|
539
|
+
npx -y @hue-run/sdk@0.20.5 import langfuse --env-path .env.langfuse --from 2026-01-01 --dry-run
|
|
540
|
+
npx -y @hue-run/sdk@0.20.5 import langfuse --env-path .env.langfuse --from 2026-01-01 --media
|
|
541
541
|
```
|
|
542
542
|
|
|
543
543
|
- It reads Langfuse Cloud and self-hosted v4 through the Observations API v2, and self-hosted v3
|
|
@@ -992,10 +992,21 @@ function convertLangfuseTrace(draft, traceId) {
|
|
|
992
992
|
/** The ATIF reader's bounds: a text export of at most 4 MiB and 2,000 spans. */
|
|
993
993
|
export const MAX_ATIF_FILE_BYTES = 4 * 1024 * 1024;
|
|
994
994
|
export const MAX_ATIF_SPANS = 2000;
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
995
|
+
/** The conversion's generation, part of every derived trace and span id: raised when the ids'
|
|
996
|
+
* seed or the spans' shape changes, so a bundle prepared by an earlier generation is prepared
|
|
997
|
+
* again rather than mixed with this one. 3 names the format generically; 2 carried one
|
|
998
|
+
* producer's name in the label, the scope and the seed. */
|
|
999
|
+
const ATIF_IMPORT_VERSION = "3";
|
|
1000
|
+
/** The format label (`hue.import.format`) and instrumentation scope of a trace converted from
|
|
1001
|
+
* ATIF, the Agent Trajectory Interchange Format: the format's own name, whoever exported it. */
|
|
1002
|
+
const ATIF_FORMAT = "atif";
|
|
1003
|
+
const ATIF_SCOPE = "hue.import.atif";
|
|
1004
|
+
/** The agent span's name, from the export's own agent: `invoke_agent <agent.name>`, or
|
|
1005
|
+
* `invoke_agent` alone when the export names none. */
|
|
1006
|
+
function agentSpanName(t) {
|
|
1007
|
+
const name = typeof t.agent.name === "string" ? t.agent.name.trim() : "";
|
|
1008
|
+
return name ? `invoke_agent ${name}` : "invoke_agent";
|
|
1009
|
+
}
|
|
999
1010
|
const optionalText = z.string().nullable().optional();
|
|
1000
1011
|
const identity = z.string().min(1).max(512);
|
|
1001
1012
|
const count = z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER).nullable().optional();
|
|
@@ -1339,8 +1350,10 @@ export function convertAtifExport(source, rawBytes) {
|
|
|
1339
1350
|
for (const sub of spawned.get(requested.tool_call_id) ?? [])
|
|
1340
1351
|
order.set(sub, sub.steps.map(() => ordinal++));
|
|
1341
1352
|
}
|
|
1353
|
+
// The trace's identity is run scoped: the scope name, the conversion's generation, the
|
|
1354
|
+
// export's session and trajectory ids. Never a path, a file digest or a producer's name.
|
|
1342
1355
|
const identityParts = [
|
|
1343
|
-
|
|
1356
|
+
ATIF_SCOPE,
|
|
1344
1357
|
ATIF_IMPORT_VERSION,
|
|
1345
1358
|
document.session_id,
|
|
1346
1359
|
document.trajectory_id ?? null,
|
|
@@ -1404,7 +1417,7 @@ export function convertAtifExport(source, rawBytes) {
|
|
|
1404
1417
|
addUsage(rootAttributes, finalUsage(document));
|
|
1405
1418
|
addSpan({
|
|
1406
1419
|
spanId: rootId,
|
|
1407
|
-
name:
|
|
1420
|
+
name: agentSpanName(document),
|
|
1408
1421
|
startTimeUnixNano: main.start,
|
|
1409
1422
|
endTimeUnixNano: lastInstant,
|
|
1410
1423
|
attributes: rootAttributes.finish(),
|
|
@@ -1543,7 +1556,7 @@ export function convertAtifExport(source, rawBytes) {
|
|
|
1543
1556
|
addSpan({
|
|
1544
1557
|
spanId: agentId,
|
|
1545
1558
|
parentSpanId,
|
|
1546
|
-
name:
|
|
1559
|
+
name: agentSpanName(sub),
|
|
1547
1560
|
startTimeUnixNano: found.checked.start,
|
|
1548
1561
|
endTimeUnixNano: found.checked.times.at(-1),
|
|
1549
1562
|
attributes: attributes.finish(),
|
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.20.
|
|
2
|
+
export declare const sdkVersion = "0.20.5";
|
package/dist/version.js
CHANGED