agent-first-data 0.15.0 → 0.16.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/dist/cli.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * AFDATA CLI helpers — output format parsing, log filter normalization, error building.
3
3
  */
4
- import { JsonValue, type OutputOptions } from "./format.js";
4
+ import { JsonValue, type OutputOptions, Event } from "./format.js";
5
5
  /** Output format for CLI and pipe/MCP modes. */
6
6
  export type OutputFormat = "json" | "yaml" | "plain";
7
7
  /**
@@ -13,29 +13,63 @@ export type OutputFormat = "json" | "yaml" | "plain";
13
13
  * cliParseOutput("xml") // throws Error
14
14
  */
15
15
  export declare function cliParseOutput(s: string): OutputFormat;
16
+ /**
17
+ * Normalized log filter result with enabled() matching and readonly filters property.
18
+ */
19
+ export declare class LogFilters {
20
+ readonly filters: readonly string[];
21
+ constructor(entries: readonly string[]);
22
+ /**
23
+ * Check if an event matches the filter set.
24
+ * Returns false for empty filters, true if "all" or "*" is present,
25
+ * otherwise checks if event.toLowerCase() starts with any filter.
26
+ *
27
+ * @example
28
+ * const lf = new LogFilters(["query", "error"]);
29
+ * lf.enabled("QueryStarted") // → true (starts with "query")
30
+ * lf.enabled("debug") // → false
31
+ *
32
+ * const all = new LogFilters([]);
33
+ * all.enabled("anything") // → false (empty)
34
+ *
35
+ * const wild = new LogFilters(["*"]);
36
+ * wild.enabled("anything") // → true
37
+ */
38
+ enabled(event: string): boolean;
39
+ }
16
40
  /**
17
41
  * Normalize --output flag entries: trim, lowercase, deduplicate, remove empty.
18
42
  * Accepts pre-split entries (e.g. after splitting on comma).
19
43
  *
20
44
  * @example
21
- * cliParseLogFilters(["Query", " error ", "query"]) // → ["query", "error"]
45
+ * const lf = cliParseLogFilters(["Query", " error ", "query"]);
46
+ * lf.enabled("QueryStarted") // → true
47
+ * lf.filters // → ["query", "error"]
22
48
  */
23
- export declare function cliParseLogFilters(entries: string[]): string[];
49
+ export declare function cliParseLogFilters(entries: string[]): LogFilters;
24
50
  /**
25
- * Dispatch output formatting by OutputFormat.
26
- * Equivalent to calling outputJson, outputYaml, or outputPlain directly.
51
+ * Dispatch output formatting by OutputFormat, with optional explicit redaction and style.
52
+ * JSON ignores OutputStyle and preserves original keys and values after redaction.
27
53
  *
28
54
  * @example
29
- * cliOutput({ code: "ok" }, "plain") // → "code=ok"
30
- */
31
- export declare function cliOutput(value: JsonValue, format: OutputFormat): string;
32
- /**
33
- * Dispatch output formatting with explicit redaction and style.
34
- * JSON ignores OutputStyle and preserves original keys and values after redaction.
55
+ * cliOutput(jsonResult({ ok: true }).build(), "plain") // → "kind=result result.ok=true"
35
56
  */
36
- export declare function cliOutputWithOptions(value: JsonValue, format: OutputFormat, outputOptions: OutputOptions): string;
57
+ export declare function cliOutput(value: JsonValue | Event, format: OutputFormat, options?: OutputOptions): string;
58
+ export type CliEventWriter = (line: string) => void;
59
+ /** Stateful emitter for finite structured CLI executions. */
60
+ export declare class CliEmitter {
61
+ private readonly writer;
62
+ private readonly format;
63
+ private readonly outputOptions;
64
+ private terminalEmitted;
65
+ private logFieldsProvider?;
66
+ constructor(writer: CliEventWriter, format: OutputFormat, outputOptions?: OutputOptions);
67
+ withLogFields(provider: () => Record<string, JsonValue>): this;
68
+ emit(event: Event): void;
69
+ emitValidatedValue(value: JsonValue): void;
70
+ }
37
71
  /** Build a standard CLI version value. */
38
- export declare function buildCliVersion(version: string): JsonValue;
72
+ export declare function buildCliVersion(version: string): Event;
39
73
  /**
40
74
  * Render CLI version output.
41
75
  * Pass an OutputFormat for AFDATA JSON/YAML/plain. Pass null to preserve
@@ -57,4 +91,4 @@ export declare function cliHandleVersionOrContinue(rawArgs: string[], name: stri
57
91
  * console.log(outputJson(err));
58
92
  * process.exit(2);
59
93
  */
60
- export declare function buildCliError(message: string, hint?: string): JsonValue;
94
+ export declare function buildCliError(message: string, hint?: string): Event;
package/dist/cli.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * AFDATA CLI helpers — output format parsing, log filter normalization, error building.
3
3
  */
4
- import { buildJson, outputJson, outputJsonWithOptions, outputYaml, outputYamlWithOptions, outputPlain, outputPlainWithOptions, } from "./format.js";
4
+ import { Event, jsonError, jsonResult, outputJson, outputYaml, outputPlain, validateProtocolEvent, } from "./format.js";
5
5
  /**
6
6
  * Parse the --output flag value into an OutputFormat.
7
7
  * Throws on unknown values; catch and pass message to buildCliError.
@@ -17,50 +17,138 @@ export function cliParseOutput(s) {
17
17
  throw new Error(`invalid --output format '${s}': expected json, yaml, or plain`);
18
18
  }
19
19
  /**
20
- * Normalize --output flag entries: trim, lowercase, deduplicate, remove empty.
21
- * Accepts pre-split entries (e.g. after splitting on comma).
22
- *
23
- * @example
24
- * cliParseLogFilters(["Query", " error ", "query"]) // → ["query", "error"]
20
+ * Normalized log filter result with enabled() matching and readonly filters property.
25
21
  */
26
- export function cliParseLogFilters(entries) {
27
- const out = [];
28
- for (const entry of entries) {
29
- const s = entry.trim().toLowerCase();
30
- if (s && !out.includes(s)) {
31
- out.push(s);
22
+ export class LogFilters {
23
+ filters;
24
+ constructor(entries) {
25
+ const out = [];
26
+ for (const entry of entries) {
27
+ const s = entry.trim().toLowerCase();
28
+ if (s && !out.includes(s)) {
29
+ out.push(s);
30
+ }
32
31
  }
32
+ this.filters = Object.freeze([...out]);
33
+ }
34
+ /**
35
+ * Check if an event matches the filter set.
36
+ * Returns false for empty filters, true if "all" or "*" is present,
37
+ * otherwise checks if event.toLowerCase() starts with any filter.
38
+ *
39
+ * @example
40
+ * const lf = new LogFilters(["query", "error"]);
41
+ * lf.enabled("QueryStarted") // → true (starts with "query")
42
+ * lf.enabled("debug") // → false
43
+ *
44
+ * const all = new LogFilters([]);
45
+ * all.enabled("anything") // → false (empty)
46
+ *
47
+ * const wild = new LogFilters(["*"]);
48
+ * wild.enabled("anything") // → true
49
+ */
50
+ enabled(event) {
51
+ if (this.filters.length === 0)
52
+ return false;
53
+ if (this.filters.includes("all") || this.filters.includes("*"))
54
+ return true;
55
+ const eventLower = event.toLowerCase();
56
+ for (const filter of this.filters) {
57
+ if (eventLower.startsWith(filter)) {
58
+ return true;
59
+ }
60
+ }
61
+ return false;
33
62
  }
34
- return out;
35
63
  }
36
64
  /**
37
- * Dispatch output formatting by OutputFormat.
38
- * Equivalent to calling outputJson, outputYaml, or outputPlain directly.
65
+ * Normalize --output flag entries: trim, lowercase, deduplicate, remove empty.
66
+ * Accepts pre-split entries (e.g. after splitting on comma).
39
67
  *
40
68
  * @example
41
- * cliOutput({ code: "ok" }, "plain") // → "code=ok"
69
+ * const lf = cliParseLogFilters(["Query", " error ", "query"]);
70
+ * lf.enabled("QueryStarted") // → true
71
+ * lf.filters // → ["query", "error"]
42
72
  */
43
- export function cliOutput(value, format) {
44
- if (format === "yaml")
45
- return outputYaml(value);
46
- if (format === "plain")
47
- return outputPlain(value);
48
- return outputJson(value);
73
+ export function cliParseLogFilters(entries) {
74
+ return new LogFilters(entries);
49
75
  }
50
76
  /**
51
- * Dispatch output formatting with explicit redaction and style.
77
+ * Dispatch output formatting by OutputFormat, with optional explicit redaction and style.
52
78
  * JSON ignores OutputStyle and preserves original keys and values after redaction.
79
+ *
80
+ * @example
81
+ * cliOutput(jsonResult({ ok: true }).build(), "plain") // → "kind=result result.ok=true"
53
82
  */
54
- export function cliOutputWithOptions(value, format, outputOptions) {
83
+ export function cliOutput(value, format, options = {}) {
84
+ const jsonValue = value instanceof Event ? value.toJSON() : value;
55
85
  if (format === "yaml")
56
- return outputYamlWithOptions(value, outputOptions);
86
+ return outputYaml(jsonValue, options);
57
87
  if (format === "plain")
58
- return outputPlainWithOptions(value, outputOptions);
59
- return outputJsonWithOptions(value, outputOptions);
88
+ return outputPlain(jsonValue, options);
89
+ return outputJson(jsonValue, options);
90
+ }
91
+ /** Stateful emitter for finite structured CLI executions. */
92
+ export class CliEmitter {
93
+ writer;
94
+ format;
95
+ outputOptions;
96
+ terminalEmitted = false;
97
+ logFieldsProvider;
98
+ constructor(writer, format, outputOptions = {}) {
99
+ this.writer = writer;
100
+ this.format = format;
101
+ this.outputOptions = outputOptions;
102
+ }
103
+ withLogFields(provider) {
104
+ this.logFieldsProvider = provider;
105
+ return this;
106
+ }
107
+ emit(event) {
108
+ const jsonValue = event.toJSON();
109
+ validateProtocolEvent(jsonValue);
110
+ const kind = jsonValue.kind;
111
+ if (kind === "log" || kind === "progress") {
112
+ if (this.terminalEmitted) {
113
+ throw new Error("cannot emit non-terminal event after terminal event");
114
+ }
115
+ }
116
+ else if (kind === "result" || kind === "error") {
117
+ if (this.terminalEmitted) {
118
+ throw new Error("cannot emit duplicate terminal event");
119
+ }
120
+ }
121
+ else {
122
+ throw new Error(`unsupported event kind ${JSON.stringify(kind)}`);
123
+ }
124
+ this.writer(`${cliOutput(jsonValue, this.format, this.outputOptions)}\n`);
125
+ if (kind === "result" || kind === "error")
126
+ this.terminalEmitted = true;
127
+ }
128
+ emitValidatedValue(value) {
129
+ validateProtocolEvent(value);
130
+ const kind = value.kind;
131
+ if (kind === "log" || kind === "progress") {
132
+ if (this.terminalEmitted) {
133
+ throw new Error("cannot emit non-terminal event after terminal event");
134
+ }
135
+ }
136
+ else if (kind === "result" || kind === "error") {
137
+ if (this.terminalEmitted) {
138
+ throw new Error("cannot emit duplicate terminal event");
139
+ }
140
+ }
141
+ else {
142
+ throw new Error(`unsupported event kind ${JSON.stringify(kind)}`);
143
+ }
144
+ this.writer(`${cliOutput(value, this.format, this.outputOptions)}\n`);
145
+ if (kind === "result" || kind === "error")
146
+ this.terminalEmitted = true;
147
+ }
60
148
  }
61
149
  /** Build a standard CLI version value. */
62
150
  export function buildCliVersion(version) {
63
- return buildJson("version", { version });
151
+ return jsonResult({ version }).build();
64
152
  }
65
153
  /**
66
154
  * Render CLI version output.
@@ -88,6 +176,16 @@ export function cliHandleVersionOrContinue(rawArgs, name, version, defaultOutput
88
176
  i += 1;
89
177
  continue;
90
178
  }
179
+ if (allowOutputFormat && arg === "--json") {
180
+ if (outputFormat !== undefined && outputFormat !== "json") {
181
+ outputError = new Error("conflicting output formats: --json conflicts with previous output format");
182
+ }
183
+ else {
184
+ outputFormat = "json";
185
+ }
186
+ i += 1;
187
+ continue;
188
+ }
91
189
  if (allowOutputFormat && (arg === outputFlag || arg.startsWith(`${outputFlag}=`))) {
92
190
  let value;
93
191
  let step = 1;
@@ -103,7 +201,13 @@ export function cliHandleVersionOrContinue(rawArgs, name, version, defaultOutput
103
201
  }
104
202
  else {
105
203
  try {
106
- outputFormat = cliParseOutput(value);
204
+ const parsedOutput = cliParseOutput(value);
205
+ if (outputFormat !== undefined && outputFormat !== parsedOutput) {
206
+ outputError = new Error(`conflicting output formats: ${outputFlag} ${value} conflicts with previous output format`);
207
+ }
208
+ else {
209
+ outputFormat = parsedOutput;
210
+ }
107
211
  }
108
212
  catch (e) {
109
213
  outputError = e;
@@ -131,11 +235,5 @@ export function cliHandleVersionOrContinue(rawArgs, name, version, defaultOutput
131
235
  * process.exit(2);
132
236
  */
133
237
  export function buildCliError(message, hint) {
134
- const m = {
135
- code: "error",
136
- error: message,
137
- };
138
- if (hint !== undefined)
139
- m.hint = hint;
140
- return m;
238
+ return jsonError("cli_error", message).hintIfSome(hint).build();
141
239
  }
package/dist/format.d.ts CHANGED
@@ -1,77 +1,171 @@
1
1
  /**
2
2
  * AFDATA output formatting and protocol templates.
3
3
  *
4
- * 21 public APIs and 4 types: protocol builders, value redactors (copy and
5
- * in-place; cover _secret and _url fields), output formatters, URL-string
6
- * redactors (redactUrlSecrets / WithOptions), parseSize, normalizeUtcOffset,
7
- * isValidRfc3339Date, isValidRfc3339Time, RedactionPolicy, RedactionOptions,
8
- * OutputStyle, and OutputOptions.
4
+ * Public APIs include protocol event builders, redactedValue (covers _secret
5
+ * and _url fields), output formatters, redactUrlSecrets, parseSize,
6
+ * normalizeUtcOffset, isValidRfc3339Date, isValidRfc3339Time,
7
+ * RedactionPolicy, OutputStyle, and OutputOptions.
9
8
  */
10
9
  export type JsonValue = string | number | boolean | null | JsonValue[] | {
11
10
  [key: string]: JsonValue;
12
11
  };
13
- /** Build {code: "ok", result, trace?}. */
14
- export declare function buildJsonOk(result: JsonValue, trace?: JsonValue): JsonValue;
15
- /** Build {code: "error", error: message, hint?, trace?}. */
16
- export declare function buildJsonError(message: string, hint?: string, trace?: JsonValue): JsonValue;
17
- /** Build {code: "<custom>", ...fields, trace?}. */
18
- export declare function buildJson(code: string, fields: JsonValue, trace?: JsonValue): JsonValue;
12
+ export type LogLevel = "debug" | "info" | "warn" | "error";
13
+ /**
14
+ * Event is an opaque type wrapping a protocol event envelope.
15
+ * Guaranteed to be strict-valid by construction.
16
+ */
17
+ export declare class Event {
18
+ private readonly value;
19
+ private readonly __brand;
20
+ constructor(value: JsonValue);
21
+ toJSON(): JsonValue;
22
+ valueOf(): JsonValue;
23
+ }
24
+ export declare class EventBuildError extends Error {
25
+ readonly issues: string[];
26
+ constructor(message: string, issues: string[]);
27
+ }
28
+ export declare class JsonResultBuilder {
29
+ private readonly payload;
30
+ private traceValue;
31
+ private issues;
32
+ constructor(payload: JsonValue);
33
+ trace(value: Record<string, JsonValue> | undefined): this;
34
+ build(): Event;
35
+ }
36
+ export declare class JsonErrorBuilder {
37
+ private readonly code;
38
+ private readonly message;
39
+ private retryableValue;
40
+ private hintValue;
41
+ private extensionFields;
42
+ private traceValue;
43
+ private issues;
44
+ constructor(code: string, message: string);
45
+ retryable(): this;
46
+ retryableIf(flag: boolean): this;
47
+ hint(value: string): this;
48
+ hintIfSome(value: string | undefined | null): this;
49
+ field(name: string, value: JsonValue): this;
50
+ fields(obj: unknown): this;
51
+ extend(obj: unknown): this;
52
+ trace(value: Record<string, JsonValue> | undefined): this;
53
+ private isReservedErrorField;
54
+ build(): Event;
55
+ }
56
+ export declare class JsonProgressBuilder {
57
+ private readonly message;
58
+ private extensionFields;
59
+ private traceValue;
60
+ private issues;
61
+ constructor(message: string);
62
+ field(name: string, value: JsonValue): this;
63
+ fields(obj: unknown): this;
64
+ extend(obj: unknown): this;
65
+ trace(value: Record<string, JsonValue> | undefined): this;
66
+ private isReservedProgressField;
67
+ build(): Event;
68
+ }
69
+ export declare class JsonLogBuilder {
70
+ private readonly level;
71
+ private readonly message;
72
+ private extensionFields;
73
+ private traceValue;
74
+ private issues;
75
+ constructor(level: LogLevel, message: string);
76
+ field(name: string, value: JsonValue): this;
77
+ fields(obj: unknown): this;
78
+ extend(obj: unknown): this;
79
+ trace(value: Record<string, JsonValue> | undefined): this;
80
+ private isReservedLogField;
81
+ build(): Event;
82
+ }
83
+ /** Fluent builder for result events. */
84
+ export declare function jsonResult(payload: JsonValue): JsonResultBuilder;
85
+ /** Fluent builder for error events. */
86
+ export declare function jsonError(code: string, message: string): JsonErrorBuilder;
87
+ /** Fluent builder for progress events. */
88
+ export declare function jsonProgress(message: string): JsonProgressBuilder;
89
+ /** Fluent builder for log events. */
90
+ export declare function jsonLog(level: LogLevel, message: string): JsonLogBuilder;
91
+ /** Validate one protocol event envelope. `strict` also enforces the recommended strict protocol profile (default true). */
92
+ export declare function validateProtocolEvent(event: unknown, strict?: boolean): void;
93
+ /** Validate finite CLI lifecycle: (log | progress)* -> exactly one terminal. `strict` also enforces the recommended strict protocol profile (default true). */
94
+ export declare function validateProtocolStream(events: readonly unknown[], strict?: boolean): void;
95
+ export type DecodedResult = {
96
+ kind: "result";
97
+ result: JsonValue;
98
+ trace?: Record<string, JsonValue>;
99
+ };
100
+ export type DecodedError = {
101
+ kind: "error";
102
+ code: string;
103
+ message: string;
104
+ retryable: boolean;
105
+ hint?: string;
106
+ fields: Record<string, JsonValue>;
107
+ trace?: Record<string, JsonValue>;
108
+ };
109
+ export type DecodedProgress = {
110
+ kind: "progress";
111
+ message: string;
112
+ fields: Record<string, JsonValue>;
113
+ trace?: Record<string, JsonValue>;
114
+ };
115
+ export type DecodedLog = {
116
+ kind: "log";
117
+ level: LogLevel;
118
+ message: string;
119
+ fields: Record<string, JsonValue>;
120
+ trace?: Record<string, JsonValue>;
121
+ };
122
+ /** Discriminated union of decoded protocol events, narrow on `kind`. */
123
+ export type DecodedEvent = DecodedResult | DecodedError | DecodedProgress | DecodedLog;
124
+ /** Thrown by decodeProtocolEvent for malformed JSON or a strict-invalid event. */
125
+ export declare class EventDecodeError extends Error {
126
+ constructor(message: string);
127
+ }
128
+ /**
129
+ * Parse one protocol line (a single JSON text value), strict-validate it, and
130
+ * return a typed decoded event. Extension fields are every payload key beyond
131
+ * the required ones, collected into `fields`.
132
+ */
133
+ export declare function decodeProtocolEvent(text: string): DecodedEvent;
19
134
  export declare enum RedactionPolicy {
20
135
  RedactionTraceOnly = "RedactionTraceOnly",
21
136
  RedactionNone = "RedactionNone"
22
137
  }
23
- export type RedactionOptions = {
24
- /** Optional scoped policy. Omitted means default full redaction. */
25
- policy?: RedactionPolicy;
26
- /**
27
- * Field names to treat as secrets in addition to _secret suffixes.
28
- * Matching is exact field-name equality at any nesting level. The same
29
- * list also matches URL query-parameter names inside _url fields (see
30
- * redactUrlSecrets).
31
- */
32
- secretNames?: readonly string[];
33
- };
34
138
  export declare enum OutputStyle {
35
139
  Readable = "Readable",
36
140
  Raw = "Raw"
37
141
  }
38
142
  export type OutputOptions = {
39
- /** Redaction options applied before rendering. */
40
- redaction?: RedactionOptions;
143
+ /** Redaction policy. Omitted means default full redaction. */
144
+ redaction?: {
145
+ /** Optional scoped policy. Omitted means default full redaction. */
146
+ policy?: RedactionPolicy;
147
+ /**
148
+ * Field names to treat as secrets in addition to _secret suffixes.
149
+ * Matching is exact field-name equality at any nesting level.
150
+ */
151
+ secretNames?: readonly string[];
152
+ };
41
153
  /** Rendering style for YAML/plain output. Omitted means readable. */
42
154
  style?: OutputStyle;
43
155
  };
156
+ /** Convenience: build OutputOptions scoped to a RedactionPolicy. */
157
+ export declare function outputOptionsForPolicy(policy: RedactionPolicy): OutputOptions;
44
158
  /** Format as single-line JSON. Secrets redacted, original keys, raw values. */
45
- export declare function outputJson(value: JsonValue): string;
46
- /** Format as single-line JSON with explicit redaction policy. */
47
- export declare function outputJsonWith(value: JsonValue, redactionPolicy: RedactionPolicy): string;
48
- /** Format as single-line JSON with explicit output options. */
49
- export declare function outputJsonWithOptions(value: JsonValue, outputOptions: OutputOptions): string;
159
+ export declare function outputJson(value: JsonValue | Event, options?: OutputOptions): string;
50
160
  /** Format as multi-line YAML. Keys stripped, values formatted, secrets redacted. */
51
- export declare function outputYaml(value: JsonValue): string;
52
- /** Format as multi-line YAML with explicit output options. */
53
- export declare function outputYamlWithOptions(value: JsonValue, outputOptions: OutputOptions): string;
161
+ export declare function outputYaml(value: JsonValue | Event, options?: OutputOptions): string;
54
162
  /** Format as single-line logfmt. Keys stripped, values formatted, secrets redacted. */
55
- export declare function outputPlain(value: JsonValue): string;
56
- /** Format as single-line logfmt with explicit output options. */
57
- export declare function outputPlainWithOptions(value: JsonValue, outputOptions: OutputOptions): string;
58
- /** Redact _secret fields in-place. */
59
- export declare function redactSecretsInPlace(value: JsonValue): void;
60
- /** Redact secret fields in-place using explicit redaction options. */
61
- export declare function redactSecretsInPlaceWithOptions(value: JsonValue, redactionOptions: RedactionOptions): void;
62
- /** Return a JSON-safe copy with default _secret redaction applied. */
63
- export declare function redactedValue(value: unknown): JsonValue;
64
- /** Return a JSON-safe copy with an explicit redaction policy applied. */
65
- export declare function redactedValueWith(value: unknown, redactionPolicy: RedactionPolicy): JsonValue;
66
- /** Return a JSON-safe copy with explicit redaction options applied. */
67
- export declare function redactedValueWithOptions(value: unknown, redactionOptions: RedactionOptions): JsonValue;
68
- /**
69
- * Redact secret components of a single URL string, using default options.
70
- *
71
- * Returns url with its userinfo password and any _secret-suffixed query
72
- * parameter values replaced by "***". See redactUrlSecretsWithOptions.
73
- */
74
- export declare function redactUrlSecrets(url: string): string;
163
+ export declare function outputPlain(value: JsonValue | Event, options?: OutputOptions): string;
164
+ /** Return a JSON-safe copy with redaction options applied (default: full _secret redaction). */
165
+ export declare function redactedValue(value: unknown, options?: {
166
+ policy?: RedactionPolicy;
167
+ secretNames?: readonly string[];
168
+ }): JsonValue;
75
169
  /**
76
170
  * Redact secret components of a single URL string.
77
171
  *
@@ -82,11 +176,14 @@ export declare function redactUrlSecrets(url: string): string;
82
176
  * A string that is not a single, whitespace-free, scheme-prefixed URL
83
177
  * (including a URL embedded in surrounding prose) is returned unchanged.
84
178
  */
85
- export declare function redactUrlSecretsWithOptions(url: string, redactionOptions: RedactionOptions): string;
179
+ export declare function redactUrlSecrets(url: string, options?: {
180
+ secretNames?: readonly string[];
181
+ }): string;
86
182
  /**
87
183
  * Parse a human-readable size string into bytes.
88
- * Accepts bare numbers or numbers followed by a unit letter (B/K/M/G/T).
89
- * Case-insensitive. Trims whitespace. Returns null for invalid input.
184
+ * Accepts numbers followed by explicit units. Decimal units are
185
+ * B/kB/MB/GB/TB; binary units are KiB/MiB/GiB/TiB.
186
+ * Trims whitespace and rejects ambiguous K/M/G/T units.
90
187
  */
91
188
  export declare function parseSize(s: string): number | null;
92
189
  /**