briyah 2.0.7 → 2.0.9

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 CHANGED
@@ -1275,6 +1275,36 @@ Put what a result silently excludes, and which of two plausible definitions a me
1275
1275
  `notes`: they are rendered into the guide verbatim, and an answer that ignores them is wrong in a
1276
1276
  way nobody notices.
1277
1277
 
1278
+ A query can also keep groups by their numbers — `having`, conditions on its own metrics by their
1279
+ `as` — and count a field's different values with `countDistinct`. A field of type `list` holds
1280
+ several strings on one row (the states a market is licensed in) and is filtered with `has`,
1281
+ `hasAny`, `contains`, `isEmpty` and `notEmpty`; it can be neither grouped nor aggregated, and its
1282
+ `enumValues`, when declared, are checked against every member a filter names.
1283
+
1284
+ ```json
1285
+ {"dataset": "markets", "groupBy": ["mga"],
1286
+ "metrics": [{"fn": "count", "as": "markets"}, {"fn": "countDistinct", "field": "carrier", "as": "carriers"}],
1287
+ "having": [{"field": "markets", "op": "gt", "value": 5}]}
1288
+ ```
1289
+
1290
+ Some datasets are better served from memory than from a statement — data assembled from several
1291
+ tables or a code registry, per-row facts a database makes awkward (a count of related records, a
1292
+ list of names), or a set small enough not to need SQL. Build the rows and let Briyah apply the
1293
+ query, with the same semantics every host gets:
1294
+
1295
+ ```typescript
1296
+ import { queryRows } from 'briyah';
1297
+
1298
+ execute: async (query, context) => {
1299
+ const set = datasets.find((d) => d.name === query.dataset);
1300
+ const rows = await buildRows(set.name, context); // one plain object per record, keyed by field name
1301
+ return queryRows(query, set, rows); // filters, groupBy, metrics, having, orderBy, limit
1302
+ },
1303
+ ```
1304
+
1305
+ `queryRows` reads a missing value as `null` (it fails every comparison but `isNull`), compares text
1306
+ without regard to case, treats a `null` list as empty, and sorts missing values last.
1307
+
1278
1308
  ### Example 13: A searchable document library
1279
1309
 
1280
1310
  Register a `DocumentSource` that can list, search, read and return your documents, and five core
@@ -0,0 +1,12 @@
1
+ {
2
+ "claude-opus-4-6": { "supports_web_search_filtering": true },
3
+ "claude-opus-4-6-20260205": { "supports_web_search_filtering": true },
4
+ "claude-opus-4-7": { "supports_web_search_filtering": true },
5
+ "claude-opus-4-7-20260416": { "supports_web_search_filtering": true },
6
+ "claude-opus-4-8": { "supports_web_search_filtering": true },
7
+ "claude-opus-5": { "supports_web_search_filtering": true },
8
+ "claude-opus-5-5": { "supports_web_search_filtering": true },
9
+ "claude-sonnet-4-6": { "supports_web_search_filtering": true },
10
+ "claude-sonnet-5": { "supports_web_search_filtering": true },
11
+ "claude-sonnet-5-5": { "supports_web_search_filtering": true }
12
+ }