@stll/agent-input 0.4.3 → 0.4.4
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/country.d.ts +28 -0
- package/dist/locale.d.ts +10 -0
- package/dist/string-list.d.ts +10 -0
- package/package.json +4 -4
package/dist/country.d.ts
CHANGED
|
@@ -1,3 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Countries on the agent wire.
|
|
3
|
+
*
|
|
4
|
+
* A corpus country is canonically ISO 3166-1 alpha-3 (`CZE`), but that is the
|
|
5
|
+
* spelling a database column chose, not the one a model reaches for. Asked in
|
|
6
|
+
* Czech for Czech case law, a model writes `CZ`, `Česko`, `Česká republika` or
|
|
7
|
+
* `Czech Republic`, and every one of those carries exactly one meaning, so
|
|
8
|
+
* every one of them is read.
|
|
9
|
+
*
|
|
10
|
+
* The names come from CLDR through `Intl.DisplayNames` rather than from a list
|
|
11
|
+
* maintained here: the corpus serves several languages, and a hand-kept table
|
|
12
|
+
* would hold whichever spellings someone thought of. CLDR holds every region's
|
|
13
|
+
* name in every locale, which is why `Rakousko`, `Poľsko` and `Tschechien`
|
|
14
|
+
* need no entry of their own. Only the official long forms CLDR omits
|
|
15
|
+
* (`Česká republika` against its `Česko`) are declared below.
|
|
16
|
+
*
|
|
17
|
+
* What is NOT read: a token that carries two country readings. `CS` is the
|
|
18
|
+
* ISO 639-1 code for the Czech language and was ISO 3166-1's code for
|
|
19
|
+
* Czechoslovakia, whose law two of this corpus's jurisdictions inherited, so it
|
|
20
|
+
* is asked about with both readings named. A token that is itself a valid
|
|
21
|
+
* alpha-2 country code is not in that class: on a field whose name is
|
|
22
|
+
* `country`, `SL` is Sierra Leone, and reading it as the Slovenian language tag
|
|
23
|
+
* would be inventing an intent the field does not carry.
|
|
24
|
+
*
|
|
25
|
+
* Admission is a separate question and stays with the caller. This reader says
|
|
26
|
+
* which country a spelling names; whether that country has a corpus is the
|
|
27
|
+
* handler's `not_found`.
|
|
28
|
+
*/
|
|
1
29
|
import { CountryAlpha3Code, CountryCode } from "@stll/country-codes";
|
|
2
30
|
import { t as Normalized } from "./normalized-ytQiZGcH.js";
|
|
3
31
|
/**
|
package/dist/locale.d.ts
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Locale tags on the agent wire.
|
|
3
|
+
*
|
|
4
|
+
* `Intl` is the authority on both halves: it refuses a structurally malformed
|
|
5
|
+
* tag (a well-formed but unknown one passes and merely falls back at format
|
|
6
|
+
* time) and it spells the canonical form. Underscores are the ICU/POSIX
|
|
7
|
+
* spelling of the same tag, and case carries no meaning, so `cs_cz` and
|
|
8
|
+
* `cs-CZ` are one locale — but only the canonical spelling may be stored,
|
|
9
|
+
* because `new Intl.DateTimeFormat("cs_CZ")` throws.
|
|
10
|
+
*/
|
|
1
11
|
import { t as Normalized } from "./normalized-ytQiZGcH.js";
|
|
2
12
|
/**
|
|
3
13
|
* Whether a tag is already the spelling `Intl` accepts. This is the check a
|
package/dist/string-list.d.ts
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lists of strings on the agent wire.
|
|
3
|
+
*
|
|
4
|
+
* A model asked for an array often sends the array's JSON as a string
|
|
5
|
+
* (`"[\"a\", \"b\"]"`), or one bare string where the schema wanted a list of
|
|
6
|
+
* one. Both carry one meaning and are read. A comma-separated string carries
|
|
7
|
+
* one meaning only where an item cannot itself hold a comma: a list of court
|
|
8
|
+
* ids can be split, a list of search phrases cannot (`"Smith, J."` is one
|
|
9
|
+
* phrase), so the caller says which by `split`.
|
|
10
|
+
*/
|
|
1
11
|
import { t as Normalized } from "./normalized-ytQiZGcH.js";
|
|
2
12
|
export type StringListOptions = {
|
|
3
13
|
/** `"delimiters"` splits a scalar on commas, semicolons and newlines, for
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stll/agent-input",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.4",
|
|
4
4
|
"description": "Lenient readers for values agents write: dates, date bounds, date-format specs, numbers, booleans, locales, countries, enum and vocabulary values, ids, ELIs, string lists",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agent",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"dependencies": {
|
|
71
71
|
"@stll/country-codes": "^0.2.0",
|
|
72
72
|
"@stll/fuzzy-search": "1.4.2",
|
|
73
|
-
"@stll/template-conditions": "^0.6.
|
|
73
|
+
"@stll/template-conditions": "^0.6.6",
|
|
74
74
|
"@stll/text-normalize": "^0.8.0",
|
|
75
75
|
"@stll/time": "0.4.2",
|
|
76
76
|
"better-result": "3.0.1"
|
|
@@ -80,8 +80,8 @@
|
|
|
80
80
|
"@stll/typescript-config": "0.0.0",
|
|
81
81
|
"bun-types": "1.4.4",
|
|
82
82
|
"fast-check": "^4.10.2",
|
|
83
|
-
"tsdown": "0.23.
|
|
84
|
-
"tsrs": "0.
|
|
83
|
+
"tsdown": "0.23.7",
|
|
84
|
+
"tsrs": "0.23.0-ts7.1.0-beta"
|
|
85
85
|
},
|
|
86
86
|
"main": "./dist/index.js",
|
|
87
87
|
"types": "./dist/index.d.ts"
|