@broberg/ai-sdk 0.30.0 → 0.30.1

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/index.d.ts CHANGED
@@ -121,7 +121,14 @@ interface ChatRequest {
121
121
  * conversation" (a conversation id, a session id). Requests sharing a prefix AND
122
122
  * this key reuse the cached prefix at 10% of the input rate. Not auto-generated:
123
123
  * only the caller knows what "the same conversation" means, and an SDK-invented
124
- * key would either collide across tenants or never hit. */
124
+ * key would either collide across tenants or never hit.
125
+ *
126
+ * BIND IT TO THE TENANT, not only to the conversation. This key IS a shared-prefix
127
+ * identity: two callers passing the same key can be served each other's cached
128
+ * prefix. So two tenants with identical transcripts must still get DIFFERENT keys
129
+ * — derive it from (tenant, conversation), never from the conversation alone.
130
+ * (components' requirement while building @broberg/chat, 2026-08-27, where two
131
+ * knowledge bases are written for readers with different permissions.) */
125
132
  promptCacheKey?: string;
126
133
  temperature?: number;
127
134
  /** "json" → request JSON-object output where the provider supports it (F009). */
@@ -602,7 +609,9 @@ declare const chatInputSchema: z.ZodObject<{
602
609
  purpose: z.ZodOptional<z.ZodString>;
603
610
  labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
604
611
  /** F039 — reuse a cached prompt prefix on Mistral at 10% of the input rate.
605
- * A stable id for "the same conversation" (conversation id, session id). */
612
+ * A stable id for "the same conversation" (conversation id, session id).
613
+ * Derive it from (tenant, conversation): the key is a shared-prefix identity,
614
+ * so two tenants with identical transcripts must get different keys. */
606
615
  promptCacheKey: z.ZodOptional<z.ZodString>;
607
616
  prompt: z.ZodOptional<z.ZodString>;
608
617
  messages: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -2072,8 +2081,8 @@ declare const falStubAdapter: ProviderAdapter;
2072
2081
  * wires the live adapters. */
2073
2082
  declare const stubProviders: Record<string, ProviderAdapter>;
2074
2083
 
2075
- declare const VERSION: "0.30.0";
2076
- declare const SDK_TAG: "@broberg/ai-sdk@0.30.0";
2084
+ declare const VERSION: "0.30.1";
2085
+ declare const SDK_TAG: "@broberg/ai-sdk@0.30.1";
2077
2086
 
2078
2087
  /** Built-in defaults. Every entry is overridable via AiConfig.defaults or a
2079
2088
  * per-call override.
package/dist/index.js CHANGED
@@ -2627,7 +2627,9 @@ var callOptions = {
2627
2627
  };
2628
2628
  var chatInputSchema = z.object({
2629
2629
  /** F039 — reuse a cached prompt prefix on Mistral at 10% of the input rate.
2630
- * A stable id for "the same conversation" (conversation id, session id). */
2630
+ * A stable id for "the same conversation" (conversation id, session id).
2631
+ * Derive it from (tenant, conversation): the key is a shared-prefix identity,
2632
+ * so two tenants with identical transcripts must get different keys. */
2631
2633
  promptCacheKey: z.string().optional(),
2632
2634
  prompt: z.string().optional(),
2633
2635
  messages: z.array(messageSchema).optional(),
@@ -2790,8 +2792,8 @@ var aiConfigSchema = z.object({
2790
2792
  });
2791
2793
 
2792
2794
  // src/version.ts
2793
- var VERSION = "0.30.0";
2794
- var SDK_TAG = "@broberg/ai-sdk@0.30.0";
2795
+ var VERSION = "0.30.1";
2796
+ var SDK_TAG = "@broberg/ai-sdk@0.30.1";
2795
2797
 
2796
2798
  // src/cost/sinks/upmetrics.ts
2797
2799
  function upmetricsSink(config) {