agent-first-data 0.16.1 → 0.17.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/README.md +1 -1
- package/assets/registry.json +2 -11
- package/assets/skills/agent-first-data/references/registry.json +2 -11
- package/assets/skills/agent-first-data/references/rules.md +10 -9
- package/dist/format.d.ts +21 -9
- package/dist/format.js +67 -38
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@ console.log(outputJson(event.toJSON()));
|
|
|
17
17
|
console.log(outputPlain(event.toJSON()));
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
-
Useful names use TypeScript casing: `outputJson`, `outputYaml`, `outputPlain`, `outputOptionsForPolicy`, `redactedValue`, `redactUrlSecrets`, `
|
|
20
|
+
Useful names use TypeScript casing: `outputJson`, `outputYaml`, `outputPlain`, `outputOptionsForPolicy`, `redactedValue`, `redactUrlSecrets`, `normalizeUtcOffset`, `isValidRfc3339Date`, `isValidRfc3339Time`, `isValidRfc3339`, `isValidBcp47`, `decodeProtocolEvent`, `cliParseOutput`, `cliParseLogFilters`, `cliOutput`, `buildCliError`, `buildCliVersion`, and `cliHandleVersionOrContinue`.
|
|
21
21
|
|
|
22
22
|
Skill admin and stream redirection are not re-exported from the package root; import them from their own subpaths:
|
|
23
23
|
|
package/assets/registry.json
CHANGED
|
@@ -132,7 +132,7 @@
|
|
|
132
132
|
"unit": "bcp47_language_tag",
|
|
133
133
|
"formatting": {"strip_key": false, "plain_yaml": "pass_through"},
|
|
134
134
|
"redaction": {"mode": "none"},
|
|
135
|
-
"constraints": {"
|
|
135
|
+
"constraints": {"bcp47": true}
|
|
136
136
|
},
|
|
137
137
|
{
|
|
138
138
|
"suffix": "_utc_offset",
|
|
@@ -152,18 +152,9 @@
|
|
|
152
152
|
"redaction": {"mode": "none"},
|
|
153
153
|
"constraints": {"integer": true, "minimum": 0}
|
|
154
154
|
},
|
|
155
|
-
{
|
|
156
|
-
"suffix": "_size",
|
|
157
|
-
"category": "size",
|
|
158
|
-
"json_types": ["string"],
|
|
159
|
-
"unit": "byte_size_input",
|
|
160
|
-
"formatting": {"strip_key": false, "plain_yaml": "pass_through"},
|
|
161
|
-
"redaction": {"mode": "none"},
|
|
162
|
-
"constraints": {"parse_size_units": ["B", "kB", "MB", "GB", "TB", "KiB", "MiB", "GiB", "TiB"]}
|
|
163
|
-
},
|
|
164
155
|
{
|
|
165
156
|
"suffix": "_percent",
|
|
166
|
-
"category": "
|
|
157
|
+
"category": "percentage",
|
|
167
158
|
"json_types": ["number"],
|
|
168
159
|
"unit": "percent",
|
|
169
160
|
"formatting": {"strip_key": true, "plain_yaml": "append_percent"},
|
|
@@ -132,7 +132,7 @@
|
|
|
132
132
|
"unit": "bcp47_language_tag",
|
|
133
133
|
"formatting": {"strip_key": false, "plain_yaml": "pass_through"},
|
|
134
134
|
"redaction": {"mode": "none"},
|
|
135
|
-
"constraints": {"
|
|
135
|
+
"constraints": {"bcp47": true}
|
|
136
136
|
},
|
|
137
137
|
{
|
|
138
138
|
"suffix": "_utc_offset",
|
|
@@ -152,18 +152,9 @@
|
|
|
152
152
|
"redaction": {"mode": "none"},
|
|
153
153
|
"constraints": {"integer": true, "minimum": 0}
|
|
154
154
|
},
|
|
155
|
-
{
|
|
156
|
-
"suffix": "_size",
|
|
157
|
-
"category": "size",
|
|
158
|
-
"json_types": ["string"],
|
|
159
|
-
"unit": "byte_size_input",
|
|
160
|
-
"formatting": {"strip_key": false, "plain_yaml": "pass_through"},
|
|
161
|
-
"redaction": {"mode": "none"},
|
|
162
|
-
"constraints": {"parse_size_units": ["B", "kB", "MB", "GB", "TB", "KiB", "MiB", "GiB", "TiB"]}
|
|
163
|
-
},
|
|
164
155
|
{
|
|
165
156
|
"suffix": "_percent",
|
|
166
|
-
"category": "
|
|
157
|
+
"category": "percentage",
|
|
167
158
|
"json_types": ["number"],
|
|
168
159
|
"unit": "percent",
|
|
169
160
|
"formatting": {"strip_key": true, "plain_yaml": "append_percent"},
|
|
@@ -37,6 +37,10 @@ The field name is the schema. Always encode units and semantics in the field nam
|
|
|
37
37
|
| `_epoch_ns` | nanoseconds since Unix epoch as a decimal string | `created_epoch_ns: "1707868800000000000"` |
|
|
38
38
|
| `_rfc3339` | RFC 3339 date-time string | `expires_rfc3339: "2026-02-14T10:30:00Z"` |
|
|
39
39
|
|
|
40
|
+
Integer vs string is not uniform across siblings: `_epoch_s` and `_epoch_ms` are JSON integers, but `_epoch_ns` is a decimal **string** because nanoseconds exceed the 2⁵³−1 safe-integer range. The same rule applies to large `_sats`/`_msats` (integer when safe, decimal string when not). Writing `_epoch_ns` as a bare JSON number silently loses precision — `afdata lint` rejects it (`suffix_type_mismatch`).
|
|
41
|
+
|
|
42
|
+
`_rfc3339` needs a **mandatory** offset: `YYYY-MM-DDThh:mm:ss[.fff]` followed by `Z` or `±HH:MM`. A bare `2026-02-14T10:30:00` (no offset), a space instead of `T`, or a trailing IANA name (`...Asia/Shanghai`) is rejected by `afdata lint`. `afdata lint` also type-checks the numeric suffixes (durations `_s`/`_ms`/…, currency `_cents`/`_micro`/`_jpy`) and rejects a `_url` with internal whitespace or bare `user:pass@host` credentials.
|
|
43
|
+
|
|
40
44
|
### Strict string formats
|
|
41
45
|
|
|
42
46
|
| Suffix | Format | Example |
|
|
@@ -46,7 +50,7 @@ The field name is the schema. Always encode units and semantics in the field nam
|
|
|
46
50
|
| `_rfc3339_date` | RFC 3339 full-date string | `invoice_due_rfc3339_date: "2026-06-13"` |
|
|
47
51
|
| `_rfc3339_time` | RFC 3339 partial-time string | `market_open_rfc3339_time: "09:30:00"` |
|
|
48
52
|
|
|
49
|
-
`*_bcp47` identifies a BCP-47 language tag string. AFDATA does not
|
|
53
|
+
`*_bcp47` identifies a BCP-47 language tag string. AFDATA validates structure (hyphen-separated subtags, 2–3 letter primary language), so the POSIX form `zh_CN` and an over-long primary like `chinese` are rejected; use `zh-CN`. It does not check the IANA registry, so a well-formed-but-unregistered tag like `zz-ZZ` still passes. `is_valid_bcp47` and `afdata lint` apply this check.
|
|
50
54
|
|
|
51
55
|
`*_utc_offset` identifies a fixed UTC offset. Canonical persisted and structured output values are `"UTC"` or `±HH:MM`, with `HH` in `00..23` and `MM` in `00..59`; zero offsets normalize to `"UTC"`. This is not an IANA timezone name, DST rule, or timezone database field.
|
|
52
56
|
|
|
@@ -63,11 +67,8 @@ Avoid magic string sentinels such as `"auto"` inside strict-format fields. If a
|
|
|
63
67
|
| Suffix | Example |
|
|
64
68
|
|:-------|:--------|
|
|
65
69
|
| `_bytes` | `payload_bytes: 456789` (non-negative integer) |
|
|
66
|
-
| `_size` | `buffer_size: "10MiB"` or `"10MB"` (config files only, human-readable) |
|
|
67
70
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
`parse_size("10MiB")` → `10485760`; `parse_size("10MB")` → `10000000`. Returns null for invalid or negative input.
|
|
71
|
+
Byte sizes are always integer `_bytes`, in config and output alike. There is no unit-in-value size string: never write `buffer_size: "10MiB"`. Encode the unit in the key (`buffer_bytes: 10485760`), the same way durations use `timeout_s: 30`.
|
|
71
72
|
|
|
72
73
|
### Percentage
|
|
73
74
|
|
|
@@ -75,6 +76,8 @@ Avoid magic string sentinels such as `"auto"` inside strict-format fields. If a
|
|
|
75
76
|
|:-------|:--------|
|
|
76
77
|
| `_percent` | `cpu_percent: 85` |
|
|
77
78
|
|
|
79
|
+
Value is in units of percent: `1` = 1%, `0.2` = 0.2%, `85` = 85%. Decimals, negatives, and values >100 are all valid; no fixed range. `%` is exactly 0.01, so `_percent` is never a 0–1 fraction — if the underlying ratio is `0.999`, multiply by 100 and write `success_percent: 99.9`. Writing `0.85` for 85% is a producer-side conversion bug, not a convention ambiguity.
|
|
80
|
+
|
|
78
81
|
### Currency
|
|
79
82
|
|
|
80
83
|
Bitcoin:
|
|
@@ -150,7 +153,6 @@ ORM struct fields preserve the suffix: `duration_ms: i64`, not `duration: i64`.
|
|
|
150
153
|
| `latency: 142` | `latency_ms: 142` | seconds? milliseconds? |
|
|
151
154
|
| `api_key: "sk-..."` | `api_key_secret: "sk-..."` | won't be auto-redacted |
|
|
152
155
|
| `cpu: 85` | `cpu_percent: 85` | 85 what? |
|
|
153
|
-
| `buffer: "10MiB"` | `buffer_size: "10MiB"` | only `_size` gets parsed |
|
|
154
156
|
|
|
155
157
|
---
|
|
156
158
|
|
|
@@ -174,7 +176,7 @@ Remove recognized formatting suffix from key. Longest match first, exact lowerca
|
|
|
174
176
|
4. `_msats`, `_sats`, `_bytes`, `_percent`, `_secret`
|
|
175
177
|
5. `_jpy`, `_ns`, `_us`, `_ms`, `_s`
|
|
176
178
|
|
|
177
|
-
`
|
|
179
|
+
`_bcp47`, `_utc_offset`, `_rfc3339_date`, and `_rfc3339_time` are NOT stripped (pass through). If two keys collide after stripping, both revert to original key AND raw value (no formatting). Redaction runs before collision handling, so fallback never restores a secret.
|
|
178
180
|
|
|
179
181
|
### Value formatting (YAML and Plain)
|
|
180
182
|
|
|
@@ -184,7 +186,6 @@ Remove recognized formatting suffix from key. Longest match first, exact lowerca
|
|
|
184
186
|
- `_epoch_ms`/`_epoch_s`/decimal-string `_epoch_ns` → RFC 3339 (negative = pre-1970)
|
|
185
187
|
- `_rfc3339` → pass through
|
|
186
188
|
- `_bytes` → human-readable (`456789` → `446.1KiB`); negative and fractional byte values fall through raw
|
|
187
|
-
- `_size` → pass through
|
|
188
189
|
- `_percent` → append `%`
|
|
189
190
|
- `_msats` → `{n}msats`, `_sats` → `{n}sats`
|
|
190
191
|
- `_usd_cents` → `$X.XX`, `_eur_cents` → `€X.XX`, `_jpy` → `¥X,XXX`, `_{code}_cents` → `X.XX CODE`, `_{code}_micro` → `X.XXXXXX CODE` where `code` is 3-4 ASCII letters
|
|
@@ -340,7 +341,7 @@ Use this checklist when the skill is evaluating a change, not just documenting c
|
|
|
340
341
|
3. Require secret-bearing values to be named with `_secret` or configured exact secret names before serialization. Do not rely on arbitrary free-text scanning or `Debug`/string-rendered objects.
|
|
341
342
|
4. Run `afdata lint` for JSON/JSONL samples, JSON Schema, MCP schemas, or serialized outputs when available; run `afdata validate` for finite protocol events/streams. If unavailable, report the skipped check.
|
|
342
343
|
5. Before changing an external project's public API, wire format, database schema, or persisted field names, report the compatibility impact and request approval before editing.
|
|
343
|
-
6.
|
|
344
|
+
6. Byte sizes use integer `_bytes` everywhere, config included (`buffer_bytes: 10485760`, never `buffer_size: "10MiB"`)
|
|
344
345
|
7. Environment variables follow `UPPER_SNAKE_CASE` with the same suffixes
|
|
345
346
|
8. One-time CLI output uses `json_log()`/`CliEmitter` + output helpers; long-running services use `afdata_tracing::try_init()` (Rust) to capture via tracing; other languages emit log events explicitly via builders
|
|
346
347
|
9. Database columns use AFDATA suffixes on generic types (`duration_ms INTEGER`, not `duration INTEGER`); native types like `TIMESTAMPTZ` don't need suffixes
|
package/dist/format.d.ts
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* AFDATA output formatting and protocol templates.
|
|
3
3
|
*
|
|
4
4
|
* Public APIs include protocol event builders, redactedValue (covers _secret
|
|
5
|
-
* and _url fields), output formatters, redactUrlSecrets,
|
|
6
|
-
* normalizeUtcOffset, isValidRfc3339Date, isValidRfc3339Time,
|
|
5
|
+
* and _url fields), output formatters, redactUrlSecrets,
|
|
6
|
+
* normalizeUtcOffset, isValidRfc3339Date, isValidRfc3339Time, isValidRfc3339, isValidBcp47,
|
|
7
7
|
* RedactionPolicy, OutputStyle, and OutputOptions.
|
|
8
8
|
*/
|
|
9
9
|
export type JsonValue = string | number | boolean | null | JsonValue[] | {
|
|
@@ -164,13 +164,6 @@ export declare function redactedValue(value: unknown, options?: {
|
|
|
164
164
|
export declare function redactUrlSecrets(url: string, options?: {
|
|
165
165
|
secretNames?: readonly string[];
|
|
166
166
|
}): string;
|
|
167
|
-
/**
|
|
168
|
-
* Parse a human-readable size string into bytes.
|
|
169
|
-
* Accepts numbers followed by explicit units. Decimal units are
|
|
170
|
-
* B/kB/MB/GB/TB; binary units are KiB/MiB/GiB/TiB.
|
|
171
|
-
* Trims whitespace and rejects ambiguous K/M/G/T units.
|
|
172
|
-
*/
|
|
173
|
-
export declare function parseSize(s: string): number | null;
|
|
174
167
|
/**
|
|
175
168
|
* Normalize a fixed UTC offset string to "UTC" or ±HH:MM.
|
|
176
169
|
* This helper handles fixed offsets only; IANA timezone names and DST rules
|
|
@@ -181,3 +174,22 @@ export declare function normalizeUtcOffset(value: string): string | null;
|
|
|
181
174
|
export declare function isValidRfc3339Date(value: string): boolean;
|
|
182
175
|
/** Return true when value is an RFC 3339 partial-time (HH:MM:SS[.fraction]). */
|
|
183
176
|
export declare function isValidRfc3339Time(value: string): boolean;
|
|
177
|
+
/**
|
|
178
|
+
* Return true when value is a complete RFC 3339 date-time, such as
|
|
179
|
+
* 2026-02-14T10:30:00Z or 2026-02-14T10:30:00.5+08:00. Composed from
|
|
180
|
+
* isValidRfc3339Date and isValidRfc3339Time: a full-date, a T/t separator, a
|
|
181
|
+
* partial-time (with optional fractional seconds), and a mandatory time-offset
|
|
182
|
+
* (Z/z or ±HH:MM with HH in 00..23 and MM in 00..59). The offset is required, so
|
|
183
|
+
* a bare 2026-02-14T10:30:00 is rejected; a space separator is rejected; and a
|
|
184
|
+
* leap second (:60) is rejected, matching isValidRfc3339Time. Non-ASCII is rejected.
|
|
185
|
+
*/
|
|
186
|
+
export declare function isValidRfc3339(value: string): boolean;
|
|
187
|
+
/**
|
|
188
|
+
* Return true when value is a structurally well-formed BCP 47 (RFC 5646) language tag.
|
|
189
|
+
* A grammar-level check, not a registry lookup: hyphen-separated ASCII-alphanumeric
|
|
190
|
+
* subtags (each 1-8 chars) whose primary subtag is a 2-3 letter language code or the
|
|
191
|
+
* x/i privateuse/grandfathered lead. Rejects the POSIX underscore form (zh_CN), empty
|
|
192
|
+
* or misplaced hyphens, non-ASCII, and out-of-range primaries such as chinese. Does not
|
|
193
|
+
* verify that subtags are registered with IANA.
|
|
194
|
+
*/
|
|
195
|
+
export declare function isValidBcp47(value: string): boolean;
|
package/dist/format.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* AFDATA output formatting and protocol templates.
|
|
3
3
|
*
|
|
4
4
|
* Public APIs include protocol event builders, redactedValue (covers _secret
|
|
5
|
-
* and _url fields), output formatters, redactUrlSecrets,
|
|
6
|
-
* normalizeUtcOffset, isValidRfc3339Date, isValidRfc3339Time,
|
|
5
|
+
* and _url fields), output formatters, redactUrlSecrets,
|
|
6
|
+
* normalizeUtcOffset, isValidRfc3339Date, isValidRfc3339Time, isValidRfc3339, isValidBcp47,
|
|
7
7
|
* RedactionPolicy, OutputStyle, and OutputOptions.
|
|
8
8
|
*/
|
|
9
9
|
// ═══════════════════════════════════════════
|
|
@@ -461,42 +461,6 @@ export function redactUrlSecrets(url, options) {
|
|
|
461
461
|
const redacted = redactUrlInStr(url, secretNameSet(options ?? {}));
|
|
462
462
|
return redacted ?? url;
|
|
463
463
|
}
|
|
464
|
-
/**
|
|
465
|
-
* Parse a human-readable size string into bytes.
|
|
466
|
-
* Accepts numbers followed by explicit units. Decimal units are
|
|
467
|
-
* B/kB/MB/GB/TB; binary units are KiB/MiB/GiB/TiB.
|
|
468
|
-
* Trims whitespace and rejects ambiguous K/M/G/T units.
|
|
469
|
-
*/
|
|
470
|
-
export function parseSize(s) {
|
|
471
|
-
s = s.trim();
|
|
472
|
-
if (!s)
|
|
473
|
-
return null;
|
|
474
|
-
const multipliers = {
|
|
475
|
-
KiB: 1024,
|
|
476
|
-
MiB: 1024 ** 2,
|
|
477
|
-
GiB: 1024 ** 3,
|
|
478
|
-
TiB: 1024 ** 4,
|
|
479
|
-
kB: 1000,
|
|
480
|
-
MB: 1000 ** 2,
|
|
481
|
-
GB: 1000 ** 3,
|
|
482
|
-
TB: 1000 ** 4,
|
|
483
|
-
B: 1,
|
|
484
|
-
};
|
|
485
|
-
const unit = Object.keys(multipliers).find((candidate) => s.endsWith(candidate));
|
|
486
|
-
if (unit === undefined)
|
|
487
|
-
return null;
|
|
488
|
-
const numStr = s.slice(0, -unit.length);
|
|
489
|
-
const mult = multipliers[unit];
|
|
490
|
-
if (!numStr || !/^(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?$/.test(numStr))
|
|
491
|
-
return null;
|
|
492
|
-
const n = Number(numStr);
|
|
493
|
-
if (isNaN(n) || n < 0 || !isFinite(n))
|
|
494
|
-
return null;
|
|
495
|
-
const result = Math.trunc(n * mult);
|
|
496
|
-
if (!Number.isSafeInteger(result))
|
|
497
|
-
return null;
|
|
498
|
-
return result;
|
|
499
|
-
}
|
|
500
464
|
/**
|
|
501
465
|
* Normalize a fixed UTC offset string to "UTC" or ±HH:MM.
|
|
502
466
|
* This helper handles fixed offsets only; IANA timezone names and DST rules
|
|
@@ -544,6 +508,71 @@ export function isValidRfc3339Time(value) {
|
|
|
544
508
|
return true;
|
|
545
509
|
return value[8] === "." && value.length > 9 && /^[0-9]+$/.test(value.slice(9));
|
|
546
510
|
}
|
|
511
|
+
/**
|
|
512
|
+
* Return true when value is a complete RFC 3339 date-time, such as
|
|
513
|
+
* 2026-02-14T10:30:00Z or 2026-02-14T10:30:00.5+08:00. Composed from
|
|
514
|
+
* isValidRfc3339Date and isValidRfc3339Time: a full-date, a T/t separator, a
|
|
515
|
+
* partial-time (with optional fractional seconds), and a mandatory time-offset
|
|
516
|
+
* (Z/z or ±HH:MM with HH in 00..23 and MM in 00..59). The offset is required, so
|
|
517
|
+
* a bare 2026-02-14T10:30:00 is rejected; a space separator is rejected; and a
|
|
518
|
+
* leap second (:60) is rejected, matching isValidRfc3339Time. Non-ASCII is rejected.
|
|
519
|
+
*/
|
|
520
|
+
export function isValidRfc3339(value) {
|
|
521
|
+
if (value.length < 20 || !/^[\x00-\x7F]*$/.test(value))
|
|
522
|
+
return false;
|
|
523
|
+
if (!isValidRfc3339Date(value.slice(0, 10)))
|
|
524
|
+
return false;
|
|
525
|
+
if (value[10] !== "T" && value[10] !== "t")
|
|
526
|
+
return false;
|
|
527
|
+
const rest = value.slice(11);
|
|
528
|
+
const last = rest[rest.length - 1];
|
|
529
|
+
let partial;
|
|
530
|
+
if (last === "Z" || last === "z") {
|
|
531
|
+
partial = rest.slice(0, -1);
|
|
532
|
+
}
|
|
533
|
+
else {
|
|
534
|
+
if (rest.length < 6 || !isRfc3339NumOffset(rest.slice(-6)))
|
|
535
|
+
return false;
|
|
536
|
+
partial = rest.slice(0, -6);
|
|
537
|
+
}
|
|
538
|
+
return isValidRfc3339Time(partial);
|
|
539
|
+
}
|
|
540
|
+
function isRfc3339NumOffset(offset) {
|
|
541
|
+
if (offset.length !== 6 || (offset[0] !== "+" && offset[0] !== "-") || offset[3] !== ":") {
|
|
542
|
+
return false;
|
|
543
|
+
}
|
|
544
|
+
const hours = parseFixedDigits(offset.slice(1, 3));
|
|
545
|
+
const minutes = parseFixedDigits(offset.slice(4, 6));
|
|
546
|
+
if (hours === null || minutes === null)
|
|
547
|
+
return false;
|
|
548
|
+
return hours <= 23 && minutes <= 59;
|
|
549
|
+
}
|
|
550
|
+
/**
|
|
551
|
+
* Return true when value is a structurally well-formed BCP 47 (RFC 5646) language tag.
|
|
552
|
+
* A grammar-level check, not a registry lookup: hyphen-separated ASCII-alphanumeric
|
|
553
|
+
* subtags (each 1-8 chars) whose primary subtag is a 2-3 letter language code or the
|
|
554
|
+
* x/i privateuse/grandfathered lead. Rejects the POSIX underscore form (zh_CN), empty
|
|
555
|
+
* or misplaced hyphens, non-ASCII, and out-of-range primaries such as chinese. Does not
|
|
556
|
+
* verify that subtags are registered with IANA.
|
|
557
|
+
*/
|
|
558
|
+
export function isValidBcp47(value) {
|
|
559
|
+
if (!value)
|
|
560
|
+
return false;
|
|
561
|
+
const subtags = value.split("-");
|
|
562
|
+
for (let index = 0; index < subtags.length; index++) {
|
|
563
|
+
const subtag = subtags[index];
|
|
564
|
+
if (subtag.length < 1 || subtag.length > 8 || !/^[A-Za-z0-9]+$/.test(subtag)) {
|
|
565
|
+
return false;
|
|
566
|
+
}
|
|
567
|
+
if (index === 0) {
|
|
568
|
+
const isLanguage = subtag.length >= 2 && subtag.length <= 3 && /^[A-Za-z]+$/.test(subtag);
|
|
569
|
+
const isSpecial = subtag === "x" || subtag === "i";
|
|
570
|
+
if (!isLanguage && !isSpecial)
|
|
571
|
+
return false;
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
return true;
|
|
575
|
+
}
|
|
547
576
|
function parseUtcOffsetBody(body) {
|
|
548
577
|
if (!body)
|
|
549
578
|
return null;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Agent-First Data (AFDATA) — suffix-driven output formatting and protocol templates.
|
|
3
3
|
*/
|
|
4
|
-
export { jsonResult, jsonError, jsonProgress, jsonLog, Event, EventBuildError, JsonResultBuilder, JsonErrorBuilder, JsonProgressBuilder, JsonLogBuilder, type LogLevel, validateProtocolEvent, validateProtocolStream, decodeProtocolEvent, type DecodedEvent, type DecodedResult, type DecodedError, type DecodedProgress, type DecodedLog, EventDecodeError, type JsonValue, RedactionPolicy, OutputStyle, type OutputOptions, outputOptionsForPolicy, outputJson, outputYaml, outputPlain, redactedValue, redactUrlSecrets,
|
|
4
|
+
export { jsonResult, jsonError, jsonProgress, jsonLog, Event, EventBuildError, JsonResultBuilder, JsonErrorBuilder, JsonProgressBuilder, JsonLogBuilder, type LogLevel, validateProtocolEvent, validateProtocolStream, decodeProtocolEvent, type DecodedEvent, type DecodedResult, type DecodedError, type DecodedProgress, type DecodedLog, EventDecodeError, type JsonValue, RedactionPolicy, OutputStyle, type OutputOptions, outputOptionsForPolicy, outputJson, outputYaml, outputPlain, redactedValue, redactUrlSecrets, normalizeUtcOffset, isValidRfc3339Date, isValidRfc3339Time, isValidRfc3339, isValidBcp47, } from "./format.js";
|
|
5
5
|
export { type OutputFormat, type CliEventWriter, CliEmitter, LogFilters, cliParseOutput, cliParseLogFilters, cliOutput, buildCliError, buildCliVersion, cliRenderVersion, cliHandleVersionOrContinue, } from "./cli.js";
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Agent-First Data (AFDATA) — suffix-driven output formatting and protocol templates.
|
|
3
3
|
*/
|
|
4
|
-
export { jsonResult, jsonError, jsonProgress, jsonLog, Event, EventBuildError, JsonResultBuilder, JsonErrorBuilder, JsonProgressBuilder, JsonLogBuilder, validateProtocolEvent, validateProtocolStream, decodeProtocolEvent, EventDecodeError, RedactionPolicy, OutputStyle, outputOptionsForPolicy, outputJson, outputYaml, outputPlain, redactedValue, redactUrlSecrets,
|
|
4
|
+
export { jsonResult, jsonError, jsonProgress, jsonLog, Event, EventBuildError, JsonResultBuilder, JsonErrorBuilder, JsonProgressBuilder, JsonLogBuilder, validateProtocolEvent, validateProtocolStream, decodeProtocolEvent, EventDecodeError, RedactionPolicy, OutputStyle, outputOptionsForPolicy, outputJson, outputYaml, outputPlain, redactedValue, redactUrlSecrets, normalizeUtcOffset, isValidRfc3339Date, isValidRfc3339Time, isValidRfc3339, isValidBcp47, } from "./format.js";
|
|
5
5
|
export { CliEmitter, LogFilters, cliParseOutput, cliParseLogFilters, cliOutput, buildCliError, buildCliVersion, cliRenderVersion, cliHandleVersionOrContinue, } from "./cli.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-first-data",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.1",
|
|
4
4
|
"description": "A naming convention that lets AI agents understand your data without being told what it means.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@types/node": "^26.1.1",
|
|
39
|
-
"tsx": "^4.23.
|
|
39
|
+
"tsx": "^4.23.1",
|
|
40
40
|
"typescript": "^7.0.2"
|
|
41
41
|
}
|
|
42
42
|
}
|