@sentrial/sdk 0.5.0 → 0.6.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/README.md +26 -0
- package/dist/cli.cjs +6185 -101
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +6247 -158
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +27 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +27 -19
- package/dist/index.d.ts +27 -19
- package/dist/index.js +27 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -409,7 +409,7 @@ function createContextVar(defaultValue) {
|
|
|
409
409
|
|
|
410
410
|
// src/pricing.json
|
|
411
411
|
var pricing_default = {
|
|
412
|
-
_comment: "Canonical LLM pricing table, per 1,000,000 tokens (USD). Single source of truth for @sentrial/sdk (src/cost.ts imports this file directly) and the Python sentrial SDK (sentrial/pricing.py holds a per-1K mirror guarded by tests/test_pricing_sync.py). Update prices HERE; the Python drift test fails CI if the mirror falls out of sync.
|
|
412
|
+
_comment: "Canonical LLM pricing table, per 1,000,000 tokens (USD). Single source of truth for @sentrial/sdk (src/cost.ts imports this file directly) and the Python sentrial SDK (sentrial/pricing.py holds a per-1K mirror guarded by tests/test_pricing_sync.py). Update prices HERE; the Python drift test fails CI if the mirror falls out of sync. Base table Jan 2026; Claude 4.5 canonical model IDs and standard first-party rates verified Nov 1, 2026 at https://platform.claude.com/docs/en/about-claude/pricing. Estimates exclude batch and regional adjustments.",
|
|
413
413
|
openai: {
|
|
414
414
|
"gpt-5.2": {
|
|
415
415
|
input: 5,
|
|
@@ -481,6 +481,18 @@ var pricing_default = {
|
|
|
481
481
|
}
|
|
482
482
|
},
|
|
483
483
|
anthropic: {
|
|
484
|
+
"claude-haiku-4-5": {
|
|
485
|
+
input: 1,
|
|
486
|
+
output: 5
|
|
487
|
+
},
|
|
488
|
+
"claude-sonnet-4-5": {
|
|
489
|
+
input: 3,
|
|
490
|
+
output: 15
|
|
491
|
+
},
|
|
492
|
+
"claude-opus-4-5": {
|
|
493
|
+
input: 5,
|
|
494
|
+
output: 25
|
|
495
|
+
},
|
|
484
496
|
"claude-opus-4": {
|
|
485
497
|
input: 15,
|
|
486
498
|
output: 75
|
|
@@ -2686,7 +2698,7 @@ function buildTrace(spans, resourceAttrs) {
|
|
|
2686
2698
|
}
|
|
2687
2699
|
|
|
2688
2700
|
// package.json
|
|
2689
|
-
var version = "0.
|
|
2701
|
+
var version = "0.6.0";
|
|
2690
2702
|
|
|
2691
2703
|
// src/evict.ts
|
|
2692
2704
|
function evictStaleEntries(map, opts) {
|
|
@@ -4430,6 +4442,13 @@ function safeStringify2(value) {
|
|
|
4430
4442
|
return safeString3(value);
|
|
4431
4443
|
}
|
|
4432
4444
|
}
|
|
4445
|
+
function copyWrapperMetadata(value) {
|
|
4446
|
+
try {
|
|
4447
|
+
return { ...value };
|
|
4448
|
+
} catch {
|
|
4449
|
+
return { _unserializable: true };
|
|
4450
|
+
}
|
|
4451
|
+
}
|
|
4433
4452
|
var _defaultClient2 = null;
|
|
4434
4453
|
var _globalConfig = {};
|
|
4435
4454
|
function configureVercel(config) {
|
|
@@ -4597,6 +4616,7 @@ function wrapGenerateText(originalFn, client, config) {
|
|
|
4597
4616
|
userId: resolveStringOrFn(config.userId, "anonymous"),
|
|
4598
4617
|
convoId: resolveStringOrFn(config.convoId),
|
|
4599
4618
|
metadata: {
|
|
4619
|
+
...config.metadata,
|
|
4600
4620
|
model: modelId,
|
|
4601
4621
|
provider,
|
|
4602
4622
|
function: "generateText",
|
|
@@ -4719,6 +4739,7 @@ function wrapStreamText(originalFn, client, config) {
|
|
|
4719
4739
|
userId: resolveStringOrFn(config.userId, "anonymous"),
|
|
4720
4740
|
convoId: resolveStringOrFn(config.convoId),
|
|
4721
4741
|
metadata: {
|
|
4742
|
+
...config.metadata,
|
|
4722
4743
|
model: modelId,
|
|
4723
4744
|
provider,
|
|
4724
4745
|
function: "streamText"
|
|
@@ -4912,6 +4933,7 @@ function wrapGenerateObject(originalFn, client, config) {
|
|
|
4912
4933
|
userId: resolveStringOrFn(config.userId, "anonymous"),
|
|
4913
4934
|
convoId: resolveStringOrFn(config.convoId),
|
|
4914
4935
|
metadata: {
|
|
4936
|
+
...config.metadata,
|
|
4915
4937
|
model: modelId,
|
|
4916
4938
|
provider,
|
|
4917
4939
|
function: "generateObject"
|
|
@@ -4987,6 +5009,7 @@ function wrapStreamObject(originalFn, client, config) {
|
|
|
4987
5009
|
userId: resolveStringOrFn(config.userId, "anonymous"),
|
|
4988
5010
|
convoId: resolveStringOrFn(config.convoId),
|
|
4989
5011
|
metadata: {
|
|
5012
|
+
...config.metadata,
|
|
4990
5013
|
model: modelId,
|
|
4991
5014
|
provider,
|
|
4992
5015
|
function: "streamObject"
|
|
@@ -5139,7 +5162,8 @@ function wrapAISDK(ai, options) {
|
|
|
5139
5162
|
const config = {
|
|
5140
5163
|
defaultAgent: options?.defaultAgent ?? _globalConfig.defaultAgent,
|
|
5141
5164
|
userId: options?.userId ?? _globalConfig.userId,
|
|
5142
|
-
convoId: options?.convoId ?? _globalConfig.convoId
|
|
5165
|
+
convoId: options?.convoId ?? _globalConfig.convoId,
|
|
5166
|
+
metadata: copyWrapperMetadata(options?.metadata)
|
|
5143
5167
|
};
|
|
5144
5168
|
const generateTextFn = ai.generateText ?? ai.experimental_generateText;
|
|
5145
5169
|
const streamTextFn = ai.streamText ?? ai.experimental_streamText;
|