@valbuild/shared 0.117.0 → 0.118.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/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @valbuild/shared
2
2
 
3
+ ## 0.118.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#574](https://github.com/valbuild/val/pull/574) [`198ba8b`](https://github.com/valbuild/val/commit/198ba8bd8e6c921660e97f5cd26fb17f2d5f3f95) Thanks [@freekh](https://github.com/freekh)! - The assistant lets you pick which model answers, from the models your key can
8
+ actually reach.
9
+
10
+ The content server now asks each provider what a key may use and reports the
11
+ answer; the Studio offers exactly that, beside the composer. Which model to use
12
+ is a per-message decision — something cheap for a typo, something strong for a
13
+ hard question — so the control sits where the message is written rather than in
14
+ a settings panel.
15
+
16
+ The choice is remembered per browser and re-checked against what is on offer
17
+ each time the assistant starts, so a model an account has lost access to is
18
+ quietly replaced instead of being sent and refused.
19
+
20
+ A content server that does not report models, or could not reach a provider,
21
+ leaves the built-in catalog as the fallback, filtered to reachable providers.
22
+
3
23
  ## 0.117.0
4
24
 
5
25
  ### Patch Changes
@@ -1035,6 +1035,12 @@ export declare const Api: {
1035
1035
  nonce: z.ZodString;
1036
1036
  wsUrl: z.ZodString;
1037
1037
  providers: z.ZodOptional<z.ZodArray<z.ZodString>>;
1038
+ models: z.ZodOptional<z.ZodArray<z.ZodObject<{
1039
+ provider: z.ZodString;
1040
+ model: z.ZodString;
1041
+ label: z.ZodString;
1042
+ contextWindow: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1043
+ }, z.core.$strip>>>;
1038
1044
  }, z.core.$strip>;
1039
1045
  }, z.core.$strip>, z.ZodObject<{
1040
1046
  status: z.ZodLiteral<500>;
@@ -2203,7 +2203,28 @@ var Api = {
2203
2203
  * reject the whole response over a name this version has not heard
2204
2204
  * of. Unknown entries are simply ignored.
2205
2205
  */
2206
- providers: zod.z.array(zod.z.string()).optional()
2206
+ providers: zod.z.array(zod.z.string()).optional(),
2207
+ /**
2208
+ * The models those keys can actually use, as the providers report
2209
+ * them.
2210
+ *
2211
+ * Which models *exist* is something only the provider knows: it
2212
+ * depends on the account, its tier, and what has shipped since this
2213
+ * Studio was built. So the server asks and passes the answer on,
2214
+ * and the picker offers exactly this.
2215
+ *
2216
+ * Optional and loosely typed for the same reason as `providers`: a
2217
+ * content server that does not report them, or reports a provider
2218
+ * this version has not heard of, must not invalidate the whole
2219
+ * response. Absent or empty means fall back to the built-in
2220
+ * catalog.
2221
+ */
2222
+ models: zod.z.array(zod.z.object({
2223
+ provider: zod.z.string(),
2224
+ model: zod.z.string(),
2225
+ label: zod.z.string(),
2226
+ contextWindow: zod.z.number().nullable().optional()
2227
+ })).optional()
2207
2228
  })
2208
2229
  }), zod.z.object({
2209
2230
  status: zod.z.literal(500),
@@ -2203,7 +2203,28 @@ var Api = {
2203
2203
  * reject the whole response over a name this version has not heard
2204
2204
  * of. Unknown entries are simply ignored.
2205
2205
  */
2206
- providers: zod.z.array(zod.z.string()).optional()
2206
+ providers: zod.z.array(zod.z.string()).optional(),
2207
+ /**
2208
+ * The models those keys can actually use, as the providers report
2209
+ * them.
2210
+ *
2211
+ * Which models *exist* is something only the provider knows: it
2212
+ * depends on the account, its tier, and what has shipped since this
2213
+ * Studio was built. So the server asks and passes the answer on,
2214
+ * and the picker offers exactly this.
2215
+ *
2216
+ * Optional and loosely typed for the same reason as `providers`: a
2217
+ * content server that does not report them, or reports a provider
2218
+ * this version has not heard of, must not invalidate the whole
2219
+ * response. Absent or empty means fall back to the built-in
2220
+ * catalog.
2221
+ */
2222
+ models: zod.z.array(zod.z.object({
2223
+ provider: zod.z.string(),
2224
+ model: zod.z.string(),
2225
+ label: zod.z.string(),
2226
+ contextWindow: zod.z.number().nullable().optional()
2227
+ })).optional()
2207
2228
  })
2208
2229
  }), zod.z.object({
2209
2230
  status: zod.z.literal(500),
@@ -2199,7 +2199,28 @@ var Api = {
2199
2199
  * reject the whole response over a name this version has not heard
2200
2200
  * of. Unknown entries are simply ignored.
2201
2201
  */
2202
- providers: z.array(z.string()).optional()
2202
+ providers: z.array(z.string()).optional(),
2203
+ /**
2204
+ * The models those keys can actually use, as the providers report
2205
+ * them.
2206
+ *
2207
+ * Which models *exist* is something only the provider knows: it
2208
+ * depends on the account, its tier, and what has shipped since this
2209
+ * Studio was built. So the server asks and passes the answer on,
2210
+ * and the picker offers exactly this.
2211
+ *
2212
+ * Optional and loosely typed for the same reason as `providers`: a
2213
+ * content server that does not report them, or reports a provider
2214
+ * this version has not heard of, must not invalidate the whole
2215
+ * response. Absent or empty means fall back to the built-in
2216
+ * catalog.
2217
+ */
2218
+ models: z.array(z.object({
2219
+ provider: z.string(),
2220
+ model: z.string(),
2221
+ label: z.string(),
2222
+ contextWindow: z.number().nullable().optional()
2223
+ })).optional()
2203
2224
  })
2204
2225
  }), z.object({
2205
2226
  status: z.literal(500),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@valbuild/shared",
3
- "version": "0.117.0",
3
+ "version": "0.118.0",
4
4
  "private": false,
5
5
  "description": "Val shared types and utilities",
6
6
  "repository": {