@utilix-tech/sdk 0.42.0 → 0.44.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.
@@ -19,6 +19,7 @@
19
19
  * - email-header-analyzer: analyzeEmailHeaders
20
20
  * - http-range-header-builder: buildRangeHeader, parseContentRangeHeader
21
21
  * - vary-header-builder: buildVaryHeader, parseVaryHeader
22
+ * - permissions-policy-builder: buildPermissionsPolicy, parsePermissionsPolicy
22
23
  */
23
24
  declare const DNS_RECORD_TYPES: readonly ["A", "AAAA", "CNAME", "MX", "TXT", "NS", "SOA", "PTR", "SRV", "CAA"];
24
25
  type DnsRecordType = typeof DNS_RECORD_TYPES[number];
@@ -525,6 +526,73 @@ declare function buildVaryHeader(headers: string[]): VaryHeaderResult | {
525
526
  declare function parseVaryHeader(raw: string): VaryHeaderResult | {
526
527
  error: string;
527
528
  };
529
+ interface ManifestIssue {
530
+ severity: 'error' | 'warning';
531
+ path: string;
532
+ message: string;
533
+ }
534
+ interface ManifestIconInfo {
535
+ src: string;
536
+ sizes?: string;
537
+ type?: string;
538
+ purpose?: string;
539
+ }
540
+ interface ManifestValidationResult {
541
+ issues: ManifestIssue[];
542
+ valid: boolean;
543
+ summary: {
544
+ name?: string;
545
+ shortName?: string;
546
+ startUrl?: string;
547
+ display?: string;
548
+ icons: ManifestIconInfo[];
549
+ hasMaskableIcon: boolean;
550
+ has512Icon: boolean;
551
+ };
552
+ }
553
+ /**
554
+ * Validate a web app manifest.json against the W3C Web App Manifest spec's
555
+ * installability requirements: name/short_name, start_url, display mode, and
556
+ * an icons array covering a 512x512 and a maskable icon, plus recommended
557
+ * theme_color/background_color fields.
558
+ */
559
+ declare function validateManifest(jsonText: string): ManifestValidationResult | {
560
+ error: string;
561
+ };
562
+ interface PermissionsPolicyFeatureInput {
563
+ feature: string;
564
+ allowlist: string[];
565
+ }
566
+ interface PermissionsPolicyDirective {
567
+ feature: string;
568
+ value: string;
569
+ note: string;
570
+ }
571
+ interface PermissionsPolicyResult {
572
+ header: string;
573
+ headerValue: string;
574
+ directives: PermissionsPolicyDirective[];
575
+ warnings: string[];
576
+ }
577
+ declare const PERMISSIONS_POLICY_FEATURES: string[];
578
+ /**
579
+ * Build a `Permissions-Policy` response-header value from a list of browser
580
+ * features and their per-feature allowlist (`self`, specific origins, `*`
581
+ * for all origins, or an empty allowlist to disable the feature entirely),
582
+ * attaching a plain-English note on what each feature restricts.
583
+ */
584
+ declare function buildPermissionsPolicy(features: PermissionsPolicyFeatureInput[]): PermissionsPolicyResult | {
585
+ error: string;
586
+ };
587
+ /**
588
+ * Parse an existing `Permissions-Policy` header value (with or without a
589
+ * leading `Permissions-Policy:` label) into the same shape
590
+ * `buildPermissionsPolicy` returns, for explaining a header you found on a
591
+ * real response rather than building one from scratch.
592
+ */
593
+ declare function parsePermissionsPolicy(raw: string): PermissionsPolicyResult | {
594
+ error: string;
595
+ };
528
596
 
529
597
  type network_AuthResultEntry = AuthResultEntry;
530
598
  type network_BuildRangeHeaderOptions = BuildRangeHeaderOptions;
@@ -554,8 +622,15 @@ type network_LinkHeaderEntry = LinkHeaderEntry;
554
622
  type network_LinkHeaderEntryInput = LinkHeaderEntryInput;
555
623
  type network_LinkHeaderResult = LinkHeaderResult;
556
624
  type network_LinkRel = LinkRel;
625
+ type network_ManifestIconInfo = ManifestIconInfo;
626
+ type network_ManifestIssue = ManifestIssue;
627
+ type network_ManifestValidationResult = ManifestValidationResult;
628
+ declare const network_PERMISSIONS_POLICY_FEATURES: typeof PERMISSIONS_POLICY_FEATURES;
557
629
  type network_ParsedDnsResult = ParsedDnsResult;
558
630
  type network_ParsedGeoResult = ParsedGeoResult;
631
+ type network_PermissionsPolicyDirective = PermissionsPolicyDirective;
632
+ type network_PermissionsPolicyFeatureInput = PermissionsPolicyFeatureInput;
633
+ type network_PermissionsPolicyResult = PermissionsPolicyResult;
559
634
  declare const network_REFERRER_POLICY_VALUES: typeof REFERRER_POLICY_VALUES;
560
635
  type network_RangeEntry = RangeEntry;
561
636
  type network_RangeEntryInput = RangeEntryInput;
@@ -585,6 +660,7 @@ declare const network_buildDnsQueryUrl: typeof buildDnsQueryUrl;
585
660
  declare const network_buildGeoUrl: typeof buildGeoUrl;
586
661
  declare const network_buildLinkHeader: typeof buildLinkHeader;
587
662
  declare const network_buildMapUrl: typeof buildMapUrl;
663
+ declare const network_buildPermissionsPolicy: typeof buildPermissionsPolicy;
588
664
  declare const network_buildRangeHeader: typeof buildRangeHeader;
589
665
  declare const network_buildReferrerPolicy: typeof buildReferrerPolicy;
590
666
  declare const network_buildVaryHeader: typeof buildVaryHeader;
@@ -608,6 +684,7 @@ declare const network_parseDnsResponse: typeof parseDnsResponse;
608
684
  declare const network_parseGeoResponse: typeof parseGeoResponse;
609
685
  declare const network_parseHar: typeof parseHar;
610
686
  declare const network_parseIpv6Address: typeof parseIpv6Address;
687
+ declare const network_parsePermissionsPolicy: typeof parsePermissionsPolicy;
611
688
  declare const network_parseUserAgent: typeof parseUserAgent;
612
689
  declare const network_parseVaryHeader: typeof parseVaryHeader;
613
690
  declare const network_searchHeaders: typeof searchHeaders;
@@ -617,10 +694,11 @@ declare const network_typeNumberToLabel: typeof typeNumberToLabel;
617
694
  declare const network_validateDomain: typeof validateDomain;
618
695
  declare const network_validateHeaderName: typeof validateHeaderName;
619
696
  declare const network_validateHeaderValue: typeof validateHeaderValue;
697
+ declare const network_validateManifest: typeof validateManifest;
620
698
  declare const network_validateRobotsTxt: typeof validateRobotsTxt;
621
699
  declare const network_validateSitemap: typeof validateSitemap;
622
700
  declare namespace network {
623
- export { type network_AuthResultEntry as AuthResultEntry, type network_BuildRangeHeaderOptions as BuildRangeHeaderOptions, type network_CacheControlDirective as CacheControlDirective, type network_CacheControlOptions as CacheControlOptions, type network_CacheControlResult as CacheControlResult, type network_ContentRangeResult as ContentRangeResult, type network_CookieAttributes as CookieAttributes, type network_CookieCheckResult as CookieCheckResult, network_DNS_RECORD_TYPES as DNS_RECORD_TYPES, type network_DnsRecord as DnsRecord, type network_DnsRecordType as DnsRecordType, type network_DnsResponse as DnsResponse, type network_EmailHeaderAnalysis as EmailHeaderAnalysis, type network_EmailHeaderField as EmailHeaderField, type network_GeoResult as GeoResult, network_HTTP_HEADERS as HTTP_HEADERS, type network_HarEntry as HarEntry, type network_HarParseResult as HarParseResult, type network_HarSummary as HarSummary, type network_HeaderCategory as HeaderCategory, type network_HttpHeader as HttpHeader, type network_Ipv6AddressType as Ipv6AddressType, type network_Ipv6ParseResult as Ipv6ParseResult, network_LINK_REL_VALUES as LINK_REL_VALUES, type network_LinkHeaderEntry as LinkHeaderEntry, type network_LinkHeaderEntryInput as LinkHeaderEntryInput, type network_LinkHeaderResult as LinkHeaderResult, type network_LinkRel as LinkRel, type network_ParsedDnsResult as ParsedDnsResult, type network_ParsedGeoResult as ParsedGeoResult, network_REFERRER_POLICY_VALUES as REFERRER_POLICY_VALUES, type network_RangeEntry as RangeEntry, type network_RangeEntryInput as RangeEntryInput, type network_RangeHeaderResult as RangeHeaderResult, type network_ReceivedHop as ReceivedHop, type network_ReferrerPolicyEntry as ReferrerPolicyEntry, type network_ReferrerPolicyResult as ReferrerPolicyResult, type network_ReferrerPolicyValue as ReferrerPolicyValue, type network_RobotsGroup as RobotsGroup, type network_RobotsIssue as RobotsIssue, type network_RobotsRule as RobotsRule, type network_RobotsValidationResult as RobotsValidationResult, network_STATUS_CODES as STATUS_CODES, type network_SameSiteValue as SameSiteValue, type network_SitemapIndexEntry as SitemapIndexEntry, type network_SitemapIssue as SitemapIssue, type network_SitemapUrlEntry as SitemapUrlEntry, type network_SitemapValidationResult as SitemapValidationResult, type network_StatusCode as StatusCode, type network_UaDeviceType as UaDeviceType, type network_UserAgentInfo as UserAgentInfo, type network_VaryHeaderEntry as VaryHeaderEntry, type network_VaryHeaderResult as VaryHeaderResult, network_analyzeEmailHeaders as analyzeEmailHeaders, network_buildCacheControl as buildCacheControl, network_buildDnsQueryUrl as buildDnsQueryUrl, network_buildGeoUrl as buildGeoUrl, network_buildLinkHeader as buildLinkHeader, network_buildMapUrl as buildMapUrl, network_buildRangeHeader as buildRangeHeader, network_buildReferrerPolicy as buildReferrerPolicy, network_buildVaryHeader as buildVaryHeader, network_checkSetCookieHeader as checkSetCookieHeader, network_countryCodeToFlag as countryCodeToFlag, network_formatCoordinates as formatCoordinates, network_formatTtl as formatTtl, network_getByCategory as getByCategory, network_getHeader as getHeader, network_getHeadersByCategory as getHeadersByCategory, network_getStatusByCategory as getStatusByCategory, network_getStatusCode as getStatusCode, network_isClientError as isClientError, network_isServerError as isServerError, network_isSuccess as isSuccess, network_isValidIp as isValidIp, network_isValidIpv4 as isValidIpv4, network_isValidIpv6 as isValidIpv6, network_parseContentRangeHeader as parseContentRangeHeader, network_parseDnsResponse as parseDnsResponse, network_parseGeoResponse as parseGeoResponse, network_parseHar as parseHar, network_parseIpv6Address as parseIpv6Address, network_parseUserAgent as parseUserAgent, network_parseVaryHeader as parseVaryHeader, network_searchHeaders as searchHeaders, network_searchStatusCodes as searchStatusCodes, network_statusCodeToText as statusCodeToText, network_typeNumberToLabel as typeNumberToLabel, network_validateDomain as validateDomain, network_validateHeaderName as validateHeaderName, network_validateHeaderValue as validateHeaderValue, network_validateRobotsTxt as validateRobotsTxt, network_validateSitemap as validateSitemap };
701
+ export { type network_AuthResultEntry as AuthResultEntry, type network_BuildRangeHeaderOptions as BuildRangeHeaderOptions, type network_CacheControlDirective as CacheControlDirective, type network_CacheControlOptions as CacheControlOptions, type network_CacheControlResult as CacheControlResult, type network_ContentRangeResult as ContentRangeResult, type network_CookieAttributes as CookieAttributes, type network_CookieCheckResult as CookieCheckResult, network_DNS_RECORD_TYPES as DNS_RECORD_TYPES, type network_DnsRecord as DnsRecord, type network_DnsRecordType as DnsRecordType, type network_DnsResponse as DnsResponse, type network_EmailHeaderAnalysis as EmailHeaderAnalysis, type network_EmailHeaderField as EmailHeaderField, type network_GeoResult as GeoResult, network_HTTP_HEADERS as HTTP_HEADERS, type network_HarEntry as HarEntry, type network_HarParseResult as HarParseResult, type network_HarSummary as HarSummary, type network_HeaderCategory as HeaderCategory, type network_HttpHeader as HttpHeader, type network_Ipv6AddressType as Ipv6AddressType, type network_Ipv6ParseResult as Ipv6ParseResult, network_LINK_REL_VALUES as LINK_REL_VALUES, type network_LinkHeaderEntry as LinkHeaderEntry, type network_LinkHeaderEntryInput as LinkHeaderEntryInput, type network_LinkHeaderResult as LinkHeaderResult, type network_LinkRel as LinkRel, type network_ManifestIconInfo as ManifestIconInfo, type network_ManifestIssue as ManifestIssue, type network_ManifestValidationResult as ManifestValidationResult, network_PERMISSIONS_POLICY_FEATURES as PERMISSIONS_POLICY_FEATURES, type network_ParsedDnsResult as ParsedDnsResult, type network_ParsedGeoResult as ParsedGeoResult, type network_PermissionsPolicyDirective as PermissionsPolicyDirective, type network_PermissionsPolicyFeatureInput as PermissionsPolicyFeatureInput, type network_PermissionsPolicyResult as PermissionsPolicyResult, network_REFERRER_POLICY_VALUES as REFERRER_POLICY_VALUES, type network_RangeEntry as RangeEntry, type network_RangeEntryInput as RangeEntryInput, type network_RangeHeaderResult as RangeHeaderResult, type network_ReceivedHop as ReceivedHop, type network_ReferrerPolicyEntry as ReferrerPolicyEntry, type network_ReferrerPolicyResult as ReferrerPolicyResult, type network_ReferrerPolicyValue as ReferrerPolicyValue, type network_RobotsGroup as RobotsGroup, type network_RobotsIssue as RobotsIssue, type network_RobotsRule as RobotsRule, type network_RobotsValidationResult as RobotsValidationResult, network_STATUS_CODES as STATUS_CODES, type network_SameSiteValue as SameSiteValue, type network_SitemapIndexEntry as SitemapIndexEntry, type network_SitemapIssue as SitemapIssue, type network_SitemapUrlEntry as SitemapUrlEntry, type network_SitemapValidationResult as SitemapValidationResult, type network_StatusCode as StatusCode, type network_UaDeviceType as UaDeviceType, type network_UserAgentInfo as UserAgentInfo, type network_VaryHeaderEntry as VaryHeaderEntry, type network_VaryHeaderResult as VaryHeaderResult, network_analyzeEmailHeaders as analyzeEmailHeaders, network_buildCacheControl as buildCacheControl, network_buildDnsQueryUrl as buildDnsQueryUrl, network_buildGeoUrl as buildGeoUrl, network_buildLinkHeader as buildLinkHeader, network_buildMapUrl as buildMapUrl, network_buildPermissionsPolicy as buildPermissionsPolicy, network_buildRangeHeader as buildRangeHeader, network_buildReferrerPolicy as buildReferrerPolicy, network_buildVaryHeader as buildVaryHeader, network_checkSetCookieHeader as checkSetCookieHeader, network_countryCodeToFlag as countryCodeToFlag, network_formatCoordinates as formatCoordinates, network_formatTtl as formatTtl, network_getByCategory as getByCategory, network_getHeader as getHeader, network_getHeadersByCategory as getHeadersByCategory, network_getStatusByCategory as getStatusByCategory, network_getStatusCode as getStatusCode, network_isClientError as isClientError, network_isServerError as isServerError, network_isSuccess as isSuccess, network_isValidIp as isValidIp, network_isValidIpv4 as isValidIpv4, network_isValidIpv6 as isValidIpv6, network_parseContentRangeHeader as parseContentRangeHeader, network_parseDnsResponse as parseDnsResponse, network_parseGeoResponse as parseGeoResponse, network_parseHar as parseHar, network_parseIpv6Address as parseIpv6Address, network_parsePermissionsPolicy as parsePermissionsPolicy, network_parseUserAgent as parseUserAgent, network_parseVaryHeader as parseVaryHeader, network_searchHeaders as searchHeaders, network_searchStatusCodes as searchStatusCodes, network_statusCodeToText as statusCodeToText, network_typeNumberToLabel as typeNumberToLabel, network_validateDomain as validateDomain, network_validateHeaderName as validateHeaderName, network_validateHeaderValue as validateHeaderValue, network_validateManifest as validateManifest, network_validateRobotsTxt as validateRobotsTxt, network_validateSitemap as validateSitemap };
624
702
  }
625
703
 
626
- export { type VaryHeaderResult as $, type AuthResultEntry as A, type BuildRangeHeaderOptions as B, type CacheControlDirective as C, DNS_RECORD_TYPES as D, type EmailHeaderAnalysis as E, type ReferrerPolicyResult as F, type GeoResult as G, HTTP_HEADERS as H, type Ipv6AddressType as I, type ReferrerPolicyValue as J, type RobotsGroup as K, LINK_REL_VALUES as L, type RobotsIssue as M, type RobotsRule as N, type RobotsValidationResult as O, type ParsedDnsResult as P, type SameSiteValue as Q, REFERRER_POLICY_VALUES as R, STATUS_CODES as S, type SitemapIndexEntry as T, type SitemapIssue as U, type SitemapUrlEntry as V, type SitemapValidationResult as W, type StatusCode as X, type UaDeviceType as Y, type UserAgentInfo as Z, type VaryHeaderEntry as _, type CacheControlOptions as a, analyzeEmailHeaders as a0, buildCacheControl as a1, buildDnsQueryUrl as a2, buildGeoUrl as a3, buildLinkHeader as a4, buildMapUrl as a5, buildRangeHeader as a6, buildReferrerPolicy as a7, buildVaryHeader as a8, checkSetCookieHeader as a9, validateHeaderName as aA, validateHeaderValue as aB, validateRobotsTxt as aC, validateSitemap as aD, countryCodeToFlag as aa, formatCoordinates as ab, formatTtl as ac, getByCategory as ad, getHeader as ae, getHeadersByCategory as af, getStatusByCategory as ag, getStatusCode as ah, isClientError as ai, isServerError as aj, isSuccess as ak, isValidIp as al, isValidIpv4 as am, isValidIpv6 as an, parseContentRangeHeader as ao, parseDnsResponse as ap, parseGeoResponse as aq, parseHar as ar, parseIpv6Address as as, parseUserAgent as at, parseVaryHeader as au, searchHeaders as av, searchStatusCodes as aw, statusCodeToText as ax, typeNumberToLabel as ay, validateDomain as az, type CacheControlResult as b, type ContentRangeResult as c, type CookieAttributes as d, type CookieCheckResult as e, type DnsRecord as f, type DnsRecordType as g, type DnsResponse as h, type EmailHeaderField as i, type HarEntry as j, type HarParseResult as k, type HarSummary as l, type HeaderCategory as m, network as n, type HttpHeader as o, type Ipv6ParseResult as p, type LinkHeaderEntry as q, type LinkHeaderEntryInput as r, type LinkHeaderResult as s, type LinkRel as t, type ParsedGeoResult as u, type RangeEntry as v, type RangeEntryInput as w, type RangeHeaderResult as x, type ReceivedHop as y, type ReferrerPolicyEntry as z };
704
+ export { type SitemapIssue as $, type AuthResultEntry as A, type BuildRangeHeaderOptions as B, type CacheControlDirective as C, DNS_RECORD_TYPES as D, type EmailHeaderAnalysis as E, type PermissionsPolicyResult as F, type GeoResult as G, HTTP_HEADERS as H, type Ipv6AddressType as I, type RangeEntry as J, type RangeEntryInput as K, LINK_REL_VALUES as L, type ManifestIconInfo as M, type RangeHeaderResult as N, type ReceivedHop as O, PERMISSIONS_POLICY_FEATURES as P, type ReferrerPolicyEntry as Q, REFERRER_POLICY_VALUES as R, type ReferrerPolicyResult as S, type ReferrerPolicyValue as T, type RobotsGroup as U, type RobotsIssue as V, type RobotsRule as W, type RobotsValidationResult as X, STATUS_CODES as Y, type SameSiteValue as Z, type SitemapIndexEntry as _, type CacheControlOptions as a, type SitemapUrlEntry as a0, type SitemapValidationResult as a1, type StatusCode as a2, type UaDeviceType as a3, type UserAgentInfo as a4, type VaryHeaderEntry as a5, type VaryHeaderResult as a6, analyzeEmailHeaders as a7, buildCacheControl as a8, buildDnsQueryUrl as a9, parseIpv6Address as aA, parsePermissionsPolicy as aB, parseUserAgent as aC, parseVaryHeader as aD, searchHeaders as aE, searchStatusCodes as aF, statusCodeToText as aG, typeNumberToLabel as aH, validateDomain as aI, validateHeaderName as aJ, validateHeaderValue as aK, validateManifest as aL, validateRobotsTxt as aM, validateSitemap as aN, buildGeoUrl as aa, buildLinkHeader as ab, buildMapUrl as ac, buildPermissionsPolicy as ad, buildRangeHeader as ae, buildReferrerPolicy as af, buildVaryHeader as ag, checkSetCookieHeader as ah, countryCodeToFlag as ai, formatCoordinates as aj, formatTtl as ak, getByCategory as al, getHeader as am, getHeadersByCategory as an, getStatusByCategory as ao, getStatusCode as ap, isClientError as aq, isServerError as ar, isSuccess as as, isValidIp as at, isValidIpv4 as au, isValidIpv6 as av, parseContentRangeHeader as aw, parseDnsResponse as ax, parseGeoResponse as ay, parseHar as az, type CacheControlResult as b, type ContentRangeResult as c, type CookieAttributes as d, type CookieCheckResult as e, type DnsRecord as f, type DnsRecordType as g, type DnsResponse as h, type EmailHeaderField as i, type HarEntry as j, type HarParseResult as k, type HarSummary as l, type HeaderCategory as m, network as n, type HttpHeader as o, type Ipv6ParseResult as p, type LinkHeaderEntry as q, type LinkHeaderEntryInput as r, type LinkHeaderResult as s, type LinkRel as t, type ManifestIssue as u, type ManifestValidationResult as v, type ParsedDnsResult as w, type ParsedGeoResult as x, type PermissionsPolicyDirective as y, type PermissionsPolicyFeatureInput as z };
@@ -19,6 +19,7 @@
19
19
  * - email-header-analyzer: analyzeEmailHeaders
20
20
  * - http-range-header-builder: buildRangeHeader, parseContentRangeHeader
21
21
  * - vary-header-builder: buildVaryHeader, parseVaryHeader
22
+ * - permissions-policy-builder: buildPermissionsPolicy, parsePermissionsPolicy
22
23
  */
23
24
  declare const DNS_RECORD_TYPES: readonly ["A", "AAAA", "CNAME", "MX", "TXT", "NS", "SOA", "PTR", "SRV", "CAA"];
24
25
  type DnsRecordType = typeof DNS_RECORD_TYPES[number];
@@ -525,6 +526,73 @@ declare function buildVaryHeader(headers: string[]): VaryHeaderResult | {
525
526
  declare function parseVaryHeader(raw: string): VaryHeaderResult | {
526
527
  error: string;
527
528
  };
529
+ interface ManifestIssue {
530
+ severity: 'error' | 'warning';
531
+ path: string;
532
+ message: string;
533
+ }
534
+ interface ManifestIconInfo {
535
+ src: string;
536
+ sizes?: string;
537
+ type?: string;
538
+ purpose?: string;
539
+ }
540
+ interface ManifestValidationResult {
541
+ issues: ManifestIssue[];
542
+ valid: boolean;
543
+ summary: {
544
+ name?: string;
545
+ shortName?: string;
546
+ startUrl?: string;
547
+ display?: string;
548
+ icons: ManifestIconInfo[];
549
+ hasMaskableIcon: boolean;
550
+ has512Icon: boolean;
551
+ };
552
+ }
553
+ /**
554
+ * Validate a web app manifest.json against the W3C Web App Manifest spec's
555
+ * installability requirements: name/short_name, start_url, display mode, and
556
+ * an icons array covering a 512x512 and a maskable icon, plus recommended
557
+ * theme_color/background_color fields.
558
+ */
559
+ declare function validateManifest(jsonText: string): ManifestValidationResult | {
560
+ error: string;
561
+ };
562
+ interface PermissionsPolicyFeatureInput {
563
+ feature: string;
564
+ allowlist: string[];
565
+ }
566
+ interface PermissionsPolicyDirective {
567
+ feature: string;
568
+ value: string;
569
+ note: string;
570
+ }
571
+ interface PermissionsPolicyResult {
572
+ header: string;
573
+ headerValue: string;
574
+ directives: PermissionsPolicyDirective[];
575
+ warnings: string[];
576
+ }
577
+ declare const PERMISSIONS_POLICY_FEATURES: string[];
578
+ /**
579
+ * Build a `Permissions-Policy` response-header value from a list of browser
580
+ * features and their per-feature allowlist (`self`, specific origins, `*`
581
+ * for all origins, or an empty allowlist to disable the feature entirely),
582
+ * attaching a plain-English note on what each feature restricts.
583
+ */
584
+ declare function buildPermissionsPolicy(features: PermissionsPolicyFeatureInput[]): PermissionsPolicyResult | {
585
+ error: string;
586
+ };
587
+ /**
588
+ * Parse an existing `Permissions-Policy` header value (with or without a
589
+ * leading `Permissions-Policy:` label) into the same shape
590
+ * `buildPermissionsPolicy` returns, for explaining a header you found on a
591
+ * real response rather than building one from scratch.
592
+ */
593
+ declare function parsePermissionsPolicy(raw: string): PermissionsPolicyResult | {
594
+ error: string;
595
+ };
528
596
 
529
597
  type network_AuthResultEntry = AuthResultEntry;
530
598
  type network_BuildRangeHeaderOptions = BuildRangeHeaderOptions;
@@ -554,8 +622,15 @@ type network_LinkHeaderEntry = LinkHeaderEntry;
554
622
  type network_LinkHeaderEntryInput = LinkHeaderEntryInput;
555
623
  type network_LinkHeaderResult = LinkHeaderResult;
556
624
  type network_LinkRel = LinkRel;
625
+ type network_ManifestIconInfo = ManifestIconInfo;
626
+ type network_ManifestIssue = ManifestIssue;
627
+ type network_ManifestValidationResult = ManifestValidationResult;
628
+ declare const network_PERMISSIONS_POLICY_FEATURES: typeof PERMISSIONS_POLICY_FEATURES;
557
629
  type network_ParsedDnsResult = ParsedDnsResult;
558
630
  type network_ParsedGeoResult = ParsedGeoResult;
631
+ type network_PermissionsPolicyDirective = PermissionsPolicyDirective;
632
+ type network_PermissionsPolicyFeatureInput = PermissionsPolicyFeatureInput;
633
+ type network_PermissionsPolicyResult = PermissionsPolicyResult;
559
634
  declare const network_REFERRER_POLICY_VALUES: typeof REFERRER_POLICY_VALUES;
560
635
  type network_RangeEntry = RangeEntry;
561
636
  type network_RangeEntryInput = RangeEntryInput;
@@ -585,6 +660,7 @@ declare const network_buildDnsQueryUrl: typeof buildDnsQueryUrl;
585
660
  declare const network_buildGeoUrl: typeof buildGeoUrl;
586
661
  declare const network_buildLinkHeader: typeof buildLinkHeader;
587
662
  declare const network_buildMapUrl: typeof buildMapUrl;
663
+ declare const network_buildPermissionsPolicy: typeof buildPermissionsPolicy;
588
664
  declare const network_buildRangeHeader: typeof buildRangeHeader;
589
665
  declare const network_buildReferrerPolicy: typeof buildReferrerPolicy;
590
666
  declare const network_buildVaryHeader: typeof buildVaryHeader;
@@ -608,6 +684,7 @@ declare const network_parseDnsResponse: typeof parseDnsResponse;
608
684
  declare const network_parseGeoResponse: typeof parseGeoResponse;
609
685
  declare const network_parseHar: typeof parseHar;
610
686
  declare const network_parseIpv6Address: typeof parseIpv6Address;
687
+ declare const network_parsePermissionsPolicy: typeof parsePermissionsPolicy;
611
688
  declare const network_parseUserAgent: typeof parseUserAgent;
612
689
  declare const network_parseVaryHeader: typeof parseVaryHeader;
613
690
  declare const network_searchHeaders: typeof searchHeaders;
@@ -617,10 +694,11 @@ declare const network_typeNumberToLabel: typeof typeNumberToLabel;
617
694
  declare const network_validateDomain: typeof validateDomain;
618
695
  declare const network_validateHeaderName: typeof validateHeaderName;
619
696
  declare const network_validateHeaderValue: typeof validateHeaderValue;
697
+ declare const network_validateManifest: typeof validateManifest;
620
698
  declare const network_validateRobotsTxt: typeof validateRobotsTxt;
621
699
  declare const network_validateSitemap: typeof validateSitemap;
622
700
  declare namespace network {
623
- export { type network_AuthResultEntry as AuthResultEntry, type network_BuildRangeHeaderOptions as BuildRangeHeaderOptions, type network_CacheControlDirective as CacheControlDirective, type network_CacheControlOptions as CacheControlOptions, type network_CacheControlResult as CacheControlResult, type network_ContentRangeResult as ContentRangeResult, type network_CookieAttributes as CookieAttributes, type network_CookieCheckResult as CookieCheckResult, network_DNS_RECORD_TYPES as DNS_RECORD_TYPES, type network_DnsRecord as DnsRecord, type network_DnsRecordType as DnsRecordType, type network_DnsResponse as DnsResponse, type network_EmailHeaderAnalysis as EmailHeaderAnalysis, type network_EmailHeaderField as EmailHeaderField, type network_GeoResult as GeoResult, network_HTTP_HEADERS as HTTP_HEADERS, type network_HarEntry as HarEntry, type network_HarParseResult as HarParseResult, type network_HarSummary as HarSummary, type network_HeaderCategory as HeaderCategory, type network_HttpHeader as HttpHeader, type network_Ipv6AddressType as Ipv6AddressType, type network_Ipv6ParseResult as Ipv6ParseResult, network_LINK_REL_VALUES as LINK_REL_VALUES, type network_LinkHeaderEntry as LinkHeaderEntry, type network_LinkHeaderEntryInput as LinkHeaderEntryInput, type network_LinkHeaderResult as LinkHeaderResult, type network_LinkRel as LinkRel, type network_ParsedDnsResult as ParsedDnsResult, type network_ParsedGeoResult as ParsedGeoResult, network_REFERRER_POLICY_VALUES as REFERRER_POLICY_VALUES, type network_RangeEntry as RangeEntry, type network_RangeEntryInput as RangeEntryInput, type network_RangeHeaderResult as RangeHeaderResult, type network_ReceivedHop as ReceivedHop, type network_ReferrerPolicyEntry as ReferrerPolicyEntry, type network_ReferrerPolicyResult as ReferrerPolicyResult, type network_ReferrerPolicyValue as ReferrerPolicyValue, type network_RobotsGroup as RobotsGroup, type network_RobotsIssue as RobotsIssue, type network_RobotsRule as RobotsRule, type network_RobotsValidationResult as RobotsValidationResult, network_STATUS_CODES as STATUS_CODES, type network_SameSiteValue as SameSiteValue, type network_SitemapIndexEntry as SitemapIndexEntry, type network_SitemapIssue as SitemapIssue, type network_SitemapUrlEntry as SitemapUrlEntry, type network_SitemapValidationResult as SitemapValidationResult, type network_StatusCode as StatusCode, type network_UaDeviceType as UaDeviceType, type network_UserAgentInfo as UserAgentInfo, type network_VaryHeaderEntry as VaryHeaderEntry, type network_VaryHeaderResult as VaryHeaderResult, network_analyzeEmailHeaders as analyzeEmailHeaders, network_buildCacheControl as buildCacheControl, network_buildDnsQueryUrl as buildDnsQueryUrl, network_buildGeoUrl as buildGeoUrl, network_buildLinkHeader as buildLinkHeader, network_buildMapUrl as buildMapUrl, network_buildRangeHeader as buildRangeHeader, network_buildReferrerPolicy as buildReferrerPolicy, network_buildVaryHeader as buildVaryHeader, network_checkSetCookieHeader as checkSetCookieHeader, network_countryCodeToFlag as countryCodeToFlag, network_formatCoordinates as formatCoordinates, network_formatTtl as formatTtl, network_getByCategory as getByCategory, network_getHeader as getHeader, network_getHeadersByCategory as getHeadersByCategory, network_getStatusByCategory as getStatusByCategory, network_getStatusCode as getStatusCode, network_isClientError as isClientError, network_isServerError as isServerError, network_isSuccess as isSuccess, network_isValidIp as isValidIp, network_isValidIpv4 as isValidIpv4, network_isValidIpv6 as isValidIpv6, network_parseContentRangeHeader as parseContentRangeHeader, network_parseDnsResponse as parseDnsResponse, network_parseGeoResponse as parseGeoResponse, network_parseHar as parseHar, network_parseIpv6Address as parseIpv6Address, network_parseUserAgent as parseUserAgent, network_parseVaryHeader as parseVaryHeader, network_searchHeaders as searchHeaders, network_searchStatusCodes as searchStatusCodes, network_statusCodeToText as statusCodeToText, network_typeNumberToLabel as typeNumberToLabel, network_validateDomain as validateDomain, network_validateHeaderName as validateHeaderName, network_validateHeaderValue as validateHeaderValue, network_validateRobotsTxt as validateRobotsTxt, network_validateSitemap as validateSitemap };
701
+ export { type network_AuthResultEntry as AuthResultEntry, type network_BuildRangeHeaderOptions as BuildRangeHeaderOptions, type network_CacheControlDirective as CacheControlDirective, type network_CacheControlOptions as CacheControlOptions, type network_CacheControlResult as CacheControlResult, type network_ContentRangeResult as ContentRangeResult, type network_CookieAttributes as CookieAttributes, type network_CookieCheckResult as CookieCheckResult, network_DNS_RECORD_TYPES as DNS_RECORD_TYPES, type network_DnsRecord as DnsRecord, type network_DnsRecordType as DnsRecordType, type network_DnsResponse as DnsResponse, type network_EmailHeaderAnalysis as EmailHeaderAnalysis, type network_EmailHeaderField as EmailHeaderField, type network_GeoResult as GeoResult, network_HTTP_HEADERS as HTTP_HEADERS, type network_HarEntry as HarEntry, type network_HarParseResult as HarParseResult, type network_HarSummary as HarSummary, type network_HeaderCategory as HeaderCategory, type network_HttpHeader as HttpHeader, type network_Ipv6AddressType as Ipv6AddressType, type network_Ipv6ParseResult as Ipv6ParseResult, network_LINK_REL_VALUES as LINK_REL_VALUES, type network_LinkHeaderEntry as LinkHeaderEntry, type network_LinkHeaderEntryInput as LinkHeaderEntryInput, type network_LinkHeaderResult as LinkHeaderResult, type network_LinkRel as LinkRel, type network_ManifestIconInfo as ManifestIconInfo, type network_ManifestIssue as ManifestIssue, type network_ManifestValidationResult as ManifestValidationResult, network_PERMISSIONS_POLICY_FEATURES as PERMISSIONS_POLICY_FEATURES, type network_ParsedDnsResult as ParsedDnsResult, type network_ParsedGeoResult as ParsedGeoResult, type network_PermissionsPolicyDirective as PermissionsPolicyDirective, type network_PermissionsPolicyFeatureInput as PermissionsPolicyFeatureInput, type network_PermissionsPolicyResult as PermissionsPolicyResult, network_REFERRER_POLICY_VALUES as REFERRER_POLICY_VALUES, type network_RangeEntry as RangeEntry, type network_RangeEntryInput as RangeEntryInput, type network_RangeHeaderResult as RangeHeaderResult, type network_ReceivedHop as ReceivedHop, type network_ReferrerPolicyEntry as ReferrerPolicyEntry, type network_ReferrerPolicyResult as ReferrerPolicyResult, type network_ReferrerPolicyValue as ReferrerPolicyValue, type network_RobotsGroup as RobotsGroup, type network_RobotsIssue as RobotsIssue, type network_RobotsRule as RobotsRule, type network_RobotsValidationResult as RobotsValidationResult, network_STATUS_CODES as STATUS_CODES, type network_SameSiteValue as SameSiteValue, type network_SitemapIndexEntry as SitemapIndexEntry, type network_SitemapIssue as SitemapIssue, type network_SitemapUrlEntry as SitemapUrlEntry, type network_SitemapValidationResult as SitemapValidationResult, type network_StatusCode as StatusCode, type network_UaDeviceType as UaDeviceType, type network_UserAgentInfo as UserAgentInfo, type network_VaryHeaderEntry as VaryHeaderEntry, type network_VaryHeaderResult as VaryHeaderResult, network_analyzeEmailHeaders as analyzeEmailHeaders, network_buildCacheControl as buildCacheControl, network_buildDnsQueryUrl as buildDnsQueryUrl, network_buildGeoUrl as buildGeoUrl, network_buildLinkHeader as buildLinkHeader, network_buildMapUrl as buildMapUrl, network_buildPermissionsPolicy as buildPermissionsPolicy, network_buildRangeHeader as buildRangeHeader, network_buildReferrerPolicy as buildReferrerPolicy, network_buildVaryHeader as buildVaryHeader, network_checkSetCookieHeader as checkSetCookieHeader, network_countryCodeToFlag as countryCodeToFlag, network_formatCoordinates as formatCoordinates, network_formatTtl as formatTtl, network_getByCategory as getByCategory, network_getHeader as getHeader, network_getHeadersByCategory as getHeadersByCategory, network_getStatusByCategory as getStatusByCategory, network_getStatusCode as getStatusCode, network_isClientError as isClientError, network_isServerError as isServerError, network_isSuccess as isSuccess, network_isValidIp as isValidIp, network_isValidIpv4 as isValidIpv4, network_isValidIpv6 as isValidIpv6, network_parseContentRangeHeader as parseContentRangeHeader, network_parseDnsResponse as parseDnsResponse, network_parseGeoResponse as parseGeoResponse, network_parseHar as parseHar, network_parseIpv6Address as parseIpv6Address, network_parsePermissionsPolicy as parsePermissionsPolicy, network_parseUserAgent as parseUserAgent, network_parseVaryHeader as parseVaryHeader, network_searchHeaders as searchHeaders, network_searchStatusCodes as searchStatusCodes, network_statusCodeToText as statusCodeToText, network_typeNumberToLabel as typeNumberToLabel, network_validateDomain as validateDomain, network_validateHeaderName as validateHeaderName, network_validateHeaderValue as validateHeaderValue, network_validateManifest as validateManifest, network_validateRobotsTxt as validateRobotsTxt, network_validateSitemap as validateSitemap };
624
702
  }
625
703
 
626
- export { type VaryHeaderResult as $, type AuthResultEntry as A, type BuildRangeHeaderOptions as B, type CacheControlDirective as C, DNS_RECORD_TYPES as D, type EmailHeaderAnalysis as E, type ReferrerPolicyResult as F, type GeoResult as G, HTTP_HEADERS as H, type Ipv6AddressType as I, type ReferrerPolicyValue as J, type RobotsGroup as K, LINK_REL_VALUES as L, type RobotsIssue as M, type RobotsRule as N, type RobotsValidationResult as O, type ParsedDnsResult as P, type SameSiteValue as Q, REFERRER_POLICY_VALUES as R, STATUS_CODES as S, type SitemapIndexEntry as T, type SitemapIssue as U, type SitemapUrlEntry as V, type SitemapValidationResult as W, type StatusCode as X, type UaDeviceType as Y, type UserAgentInfo as Z, type VaryHeaderEntry as _, type CacheControlOptions as a, analyzeEmailHeaders as a0, buildCacheControl as a1, buildDnsQueryUrl as a2, buildGeoUrl as a3, buildLinkHeader as a4, buildMapUrl as a5, buildRangeHeader as a6, buildReferrerPolicy as a7, buildVaryHeader as a8, checkSetCookieHeader as a9, validateHeaderName as aA, validateHeaderValue as aB, validateRobotsTxt as aC, validateSitemap as aD, countryCodeToFlag as aa, formatCoordinates as ab, formatTtl as ac, getByCategory as ad, getHeader as ae, getHeadersByCategory as af, getStatusByCategory as ag, getStatusCode as ah, isClientError as ai, isServerError as aj, isSuccess as ak, isValidIp as al, isValidIpv4 as am, isValidIpv6 as an, parseContentRangeHeader as ao, parseDnsResponse as ap, parseGeoResponse as aq, parseHar as ar, parseIpv6Address as as, parseUserAgent as at, parseVaryHeader as au, searchHeaders as av, searchStatusCodes as aw, statusCodeToText as ax, typeNumberToLabel as ay, validateDomain as az, type CacheControlResult as b, type ContentRangeResult as c, type CookieAttributes as d, type CookieCheckResult as e, type DnsRecord as f, type DnsRecordType as g, type DnsResponse as h, type EmailHeaderField as i, type HarEntry as j, type HarParseResult as k, type HarSummary as l, type HeaderCategory as m, network as n, type HttpHeader as o, type Ipv6ParseResult as p, type LinkHeaderEntry as q, type LinkHeaderEntryInput as r, type LinkHeaderResult as s, type LinkRel as t, type ParsedGeoResult as u, type RangeEntry as v, type RangeEntryInput as w, type RangeHeaderResult as x, type ReceivedHop as y, type ReferrerPolicyEntry as z };
704
+ export { type SitemapIssue as $, type AuthResultEntry as A, type BuildRangeHeaderOptions as B, type CacheControlDirective as C, DNS_RECORD_TYPES as D, type EmailHeaderAnalysis as E, type PermissionsPolicyResult as F, type GeoResult as G, HTTP_HEADERS as H, type Ipv6AddressType as I, type RangeEntry as J, type RangeEntryInput as K, LINK_REL_VALUES as L, type ManifestIconInfo as M, type RangeHeaderResult as N, type ReceivedHop as O, PERMISSIONS_POLICY_FEATURES as P, type ReferrerPolicyEntry as Q, REFERRER_POLICY_VALUES as R, type ReferrerPolicyResult as S, type ReferrerPolicyValue as T, type RobotsGroup as U, type RobotsIssue as V, type RobotsRule as W, type RobotsValidationResult as X, STATUS_CODES as Y, type SameSiteValue as Z, type SitemapIndexEntry as _, type CacheControlOptions as a, type SitemapUrlEntry as a0, type SitemapValidationResult as a1, type StatusCode as a2, type UaDeviceType as a3, type UserAgentInfo as a4, type VaryHeaderEntry as a5, type VaryHeaderResult as a6, analyzeEmailHeaders as a7, buildCacheControl as a8, buildDnsQueryUrl as a9, parseIpv6Address as aA, parsePermissionsPolicy as aB, parseUserAgent as aC, parseVaryHeader as aD, searchHeaders as aE, searchStatusCodes as aF, statusCodeToText as aG, typeNumberToLabel as aH, validateDomain as aI, validateHeaderName as aJ, validateHeaderValue as aK, validateManifest as aL, validateRobotsTxt as aM, validateSitemap as aN, buildGeoUrl as aa, buildLinkHeader as ab, buildMapUrl as ac, buildPermissionsPolicy as ad, buildRangeHeader as ae, buildReferrerPolicy as af, buildVaryHeader as ag, checkSetCookieHeader as ah, countryCodeToFlag as ai, formatCoordinates as aj, formatTtl as ak, getByCategory as al, getHeader as am, getHeadersByCategory as an, getStatusByCategory as ao, getStatusCode as ap, isClientError as aq, isServerError as ar, isSuccess as as, isValidIp as at, isValidIpv4 as au, isValidIpv6 as av, parseContentRangeHeader as aw, parseDnsResponse as ax, parseGeoResponse as ay, parseHar as az, type CacheControlResult as b, type ContentRangeResult as c, type CookieAttributes as d, type CookieCheckResult as e, type DnsRecord as f, type DnsRecordType as g, type DnsResponse as h, type EmailHeaderField as i, type HarEntry as j, type HarParseResult as k, type HarSummary as l, type HeaderCategory as m, network as n, type HttpHeader as o, type Ipv6ParseResult as p, type LinkHeaderEntry as q, type LinkHeaderEntryInput as r, type LinkHeaderResult as s, type LinkRel as t, type ManifestIssue as u, type ManifestValidationResult as v, type ParsedDnsResult as w, type ParsedGeoResult as x, type PermissionsPolicyDirective as y, type PermissionsPolicyFeatureInput as z };
@@ -969,6 +969,118 @@ Output: ${e.output.trim()}`).join("\n\n");
969
969
  }
970
970
  return { formatted, exampleCount: valid.length, format };
971
971
  }
972
+ var TOOL_NAME_RE = /^[a-zA-Z0-9_-]{1,64}$/;
973
+ function normalizeToolDefs(data) {
974
+ let rawList;
975
+ if (Array.isArray(data)) {
976
+ rawList = data;
977
+ } else if (data && typeof data === "object" && Array.isArray(data.tools)) {
978
+ rawList = data.tools;
979
+ } else {
980
+ rawList = [data];
981
+ }
982
+ const out = [];
983
+ for (const item of rawList) {
984
+ if (!item || typeof item !== "object") {
985
+ return { error: "Each tool definition must be a JSON object" };
986
+ }
987
+ const obj = item;
988
+ if (obj.type === "function" && obj.function && typeof obj.function === "object") {
989
+ const fn = obj.function;
990
+ out.push({ name: String(fn.name ?? ""), description: typeof fn.description === "string" ? fn.description : void 0, schema: fn.parameters, format: "openai" });
991
+ } else if ("input_schema" in obj) {
992
+ out.push({ name: String(obj.name ?? ""), description: typeof obj.description === "string" ? obj.description : void 0, schema: obj.input_schema, format: "anthropic" });
993
+ } else if ("inputSchema" in obj) {
994
+ out.push({ name: String(obj.name ?? ""), description: typeof obj.description === "string" ? obj.description : void 0, schema: obj.inputSchema, format: "mcp" });
995
+ } else if ("parameters" in obj || "name" in obj) {
996
+ out.push({ name: String(obj.name ?? ""), description: typeof obj.description === "string" ? obj.description : void 0, schema: obj.parameters, format: "bare" });
997
+ } else {
998
+ return { error: 'Unrecognized tool-definition format: expected an OpenAI ({type:"function",function:{...}}), Anthropic ({name,input_schema}), or MCP ({name,inputSchema}) shape' };
999
+ }
1000
+ }
1001
+ return out;
1002
+ }
1003
+ function lintToolSchema(jsonText) {
1004
+ if (!jsonText || !jsonText.trim()) return { error: "Input is empty" };
1005
+ let data;
1006
+ try {
1007
+ data = JSON.parse(jsonText);
1008
+ } catch (e) {
1009
+ return { error: `Invalid JSON: ${e.message}` };
1010
+ }
1011
+ const normalized = normalizeToolDefs(data);
1012
+ if ("error" in normalized) return normalized;
1013
+ if (normalized.length === 0) return { error: "No tool definitions found" };
1014
+ const issues = [];
1015
+ const seenNames = /* @__PURE__ */ new Map();
1016
+ for (const tool of normalized) {
1017
+ const label = tool.name || "(unnamed)";
1018
+ seenNames.set(label, (seenNames.get(label) ?? 0) + 1);
1019
+ if (!tool.name) {
1020
+ issues.push({ severity: "error", tool: label, path: "name", message: 'Tool is missing a "name"' });
1021
+ } else if (!TOOL_NAME_RE.test(tool.name)) {
1022
+ issues.push({ severity: "error", tool: label, path: "name", message: `Tool name "${tool.name}" must match ^[a-zA-Z0-9_-]{1,64}$ (letters, digits, underscores, hyphens, max 64 chars) to be accepted by OpenAI/Anthropic function calling` });
1023
+ }
1024
+ if (!tool.description || !tool.description.trim()) {
1025
+ issues.push({ severity: "error", tool: label, path: "description", message: 'Tool is missing a "description" \u2014 the model relies entirely on this text to decide when to call it' });
1026
+ } else {
1027
+ if (tool.description.trim().length < 10) {
1028
+ issues.push({ severity: "warning", tool: label, path: "description", message: "Description is very short; a vague description measurably hurts the model's ability to pick the right tool" });
1029
+ }
1030
+ if (tool.description.length > 1024) {
1031
+ issues.push({ severity: "warning", tool: label, path: "description", message: `Description is ${tool.description.length} characters; long descriptions cost tokens on every request that includes this tool` });
1032
+ }
1033
+ }
1034
+ if (tool.schema === void 0 || tool.schema === null) {
1035
+ issues.push({ severity: "warning", tool: label, path: "parameters", message: "Tool has no parameter schema; only correct if the tool genuinely takes no arguments" });
1036
+ continue;
1037
+ }
1038
+ if (typeof tool.schema !== "object" || Array.isArray(tool.schema)) {
1039
+ issues.push({ severity: "error", tool: label, path: "parameters", message: "Parameter schema must be a JSON Schema object" });
1040
+ continue;
1041
+ }
1042
+ const schema = tool.schema;
1043
+ if (schema.type !== void 0 && schema.type !== "object") {
1044
+ issues.push({ severity: "error", tool: label, path: "parameters.type", message: `Top-level parameter schema type is "${String(schema.type)}"; OpenAI and Anthropic both require "object" at the top level` });
1045
+ }
1046
+ const properties = schema.properties;
1047
+ if (properties !== void 0 && (typeof properties !== "object" || properties === null || Array.isArray(properties))) {
1048
+ issues.push({ severity: "error", tool: label, path: "parameters.properties", message: '"properties" must be an object' });
1049
+ } else if (properties && typeof properties === "object") {
1050
+ const propsObj = properties;
1051
+ const propNames = Object.keys(propsObj);
1052
+ for (const propName of propNames) {
1053
+ const prop = propsObj[propName];
1054
+ const propPath = `parameters.properties.${propName}`;
1055
+ if (!prop || typeof prop !== "object") {
1056
+ issues.push({ severity: "error", tool: label, path: propPath, message: "Property schema must be an object" });
1057
+ continue;
1058
+ }
1059
+ const propObj = prop;
1060
+ if (!propObj.description) {
1061
+ issues.push({ severity: "warning", tool: label, path: propPath, message: `Property "${propName}" has no description; missing per-parameter descriptions measurably hurt model accuracy on which value to pass` });
1062
+ }
1063
+ if (Array.isArray(propObj.enum) && propObj.enum.length === 0) {
1064
+ issues.push({ severity: "error", tool: label, path: propPath, message: `Property "${propName}" has an empty "enum" array` });
1065
+ }
1066
+ }
1067
+ if (Array.isArray(schema.required)) {
1068
+ for (const req of schema.required) {
1069
+ if (typeof req === "string" && !propNames.includes(req)) {
1070
+ issues.push({ severity: "error", tool: label, path: "parameters.required", message: `"required" lists "${req}", which isn't defined in "properties"` });
1071
+ }
1072
+ }
1073
+ }
1074
+ }
1075
+ }
1076
+ for (const [name, count] of seenNames) {
1077
+ if (count > 1 && name !== "(unnamed)") {
1078
+ issues.push({ severity: "error", tool: name, path: "name", message: `Tool name "${name}" is used ${count} times; tool names must be unique within a single request` });
1079
+ }
1080
+ }
1081
+ const valid = !issues.some((i) => i.severity === "error");
1082
+ return { toolCount: normalized.length, issues, valid };
1083
+ }
972
1084
 
973
1085
  exports.MODEL_PRICING = MODEL_PRICING;
974
1086
  exports.chunkText = chunkText;
@@ -990,6 +1102,7 @@ exports.extractTables = extractTables;
990
1102
  exports.extractUrls = extractUrls;
991
1103
  exports.flattenJson = flattenJson;
992
1104
  exports.formatFewShotExamples = formatFewShotExamples;
1105
+ exports.lintToolSchema = lintToolSchema;
993
1106
  exports.mergeJson = mergeJson;
994
1107
  exports.redactPii = redactPii;
995
1108
  exports.repairJson = repairJson;
@@ -1 +1 @@
1
- export { C as ChunkStrategy, b as CompressHtmlResult, c as CompressJsonResult, d as CompressMarkdownResult, e as CostEstimate, D as DedupeResult, f as DedupeStrategy, g as DiffEntry2, h as DiffOp2, i as DiffResult2, E as Entity2, j as EntityType2, k as ExtractJsonResult, l as ExtractKeywordsResult, m as ExtractUrlsResult, F as FewShotExample, n as FewShotFormat, o as FewShotFormatResult, I as InjectionDetectResult, p as InjectionFinding, J as JsonBlock, q as JsonRepairResult, K as Keyword, M as MODEL_PRICING, r as MergeResult, s as MergeStrategy, t as ModelPricing, P as PiiDetectResult, u as PiiFinding, v as PiiType, R as RankedChunk, w as RelevanceResult, S as SanitizeResult, x as SecretDetectResult, y as SecretFinding, z as SecretType, A as SummaryResult, T as TableResult2, B as TextChunk, G as TokenEstimate, H as TokenEstimateResult, L as TrimResult, N as TrimStrategy, U as UrlMatch, V as ValidationError, O as ValidationResult, Q as VectorSimilarityResult, W as chunkText, X as compressHtml, Y as compressJson, Z as compressMarkdown, _ as deduplicateLines, $ as detectPii, a0 as detectPromptInjection, a1 as detectSecrets, a2 as diffJson, a3 as estimateCost, a4 as estimateTokens, a5 as expandQuery, a6 as extractEntities, a7 as extractJson, a8 as extractKeywords, a9 as extractTables, aa as extractUrls, ab as flattenJson, ac as formatFewShotExamples, ad as mergeJson, ae as redactPii, af as repairJson, ag as rerankChunks, ah as sanitizeHtml, ai as scoreRelevance, aj as summarizeForLlm, ak as trimToTokens, al as unflattenJson, am as validateJsonSchema, an as vectorSimilarity } from '../ai_agent-C1zudGgT.cjs';
1
+ export { C as ChunkStrategy, b as CompressHtmlResult, c as CompressJsonResult, d as CompressMarkdownResult, e as CostEstimate, D as DedupeResult, f as DedupeStrategy, g as DiffEntry2, h as DiffOp2, i as DiffResult2, E as Entity2, j as EntityType2, k as ExtractJsonResult, l as ExtractKeywordsResult, m as ExtractUrlsResult, F as FewShotExample, n as FewShotFormat, o as FewShotFormatResult, I as InjectionDetectResult, p as InjectionFinding, J as JsonBlock, q as JsonRepairResult, K as Keyword, M as MODEL_PRICING, r as MergeResult, s as MergeStrategy, t as ModelPricing, P as PiiDetectResult, u as PiiFinding, v as PiiType, R as RankedChunk, w as RelevanceResult, S as SanitizeResult, x as SecretDetectResult, y as SecretFinding, z as SecretType, A as SummaryResult, T as TableResult2, B as TextChunk, G as TokenEstimate, H as TokenEstimateResult, L as ToolSchemaIssue, N as ToolSchemaLintResult, O as TrimResult, Q as TrimStrategy, U as UrlMatch, V as ValidationError, W as ValidationResult, X as VectorSimilarityResult, Y as chunkText, Z as compressHtml, _ as compressJson, $ as compressMarkdown, a0 as deduplicateLines, a1 as detectPii, a2 as detectPromptInjection, a3 as detectSecrets, a4 as diffJson, a5 as estimateCost, a6 as estimateTokens, a7 as expandQuery, a8 as extractEntities, a9 as extractJson, aa as extractKeywords, ab as extractTables, ac as extractUrls, ad as flattenJson, ae as formatFewShotExamples, af as lintToolSchema, ag as mergeJson, ah as redactPii, ai as repairJson, aj as rerankChunks, ak as sanitizeHtml, al as scoreRelevance, am as summarizeForLlm, an as trimToTokens, ao as unflattenJson, ap as validateJsonSchema, aq as vectorSimilarity } from '../ai_agent-CmrVjvYH.cjs';
@@ -1 +1 @@
1
- export { C as ChunkStrategy, b as CompressHtmlResult, c as CompressJsonResult, d as CompressMarkdownResult, e as CostEstimate, D as DedupeResult, f as DedupeStrategy, g as DiffEntry2, h as DiffOp2, i as DiffResult2, E as Entity2, j as EntityType2, k as ExtractJsonResult, l as ExtractKeywordsResult, m as ExtractUrlsResult, F as FewShotExample, n as FewShotFormat, o as FewShotFormatResult, I as InjectionDetectResult, p as InjectionFinding, J as JsonBlock, q as JsonRepairResult, K as Keyword, M as MODEL_PRICING, r as MergeResult, s as MergeStrategy, t as ModelPricing, P as PiiDetectResult, u as PiiFinding, v as PiiType, R as RankedChunk, w as RelevanceResult, S as SanitizeResult, x as SecretDetectResult, y as SecretFinding, z as SecretType, A as SummaryResult, T as TableResult2, B as TextChunk, G as TokenEstimate, H as TokenEstimateResult, L as TrimResult, N as TrimStrategy, U as UrlMatch, V as ValidationError, O as ValidationResult, Q as VectorSimilarityResult, W as chunkText, X as compressHtml, Y as compressJson, Z as compressMarkdown, _ as deduplicateLines, $ as detectPii, a0 as detectPromptInjection, a1 as detectSecrets, a2 as diffJson, a3 as estimateCost, a4 as estimateTokens, a5 as expandQuery, a6 as extractEntities, a7 as extractJson, a8 as extractKeywords, a9 as extractTables, aa as extractUrls, ab as flattenJson, ac as formatFewShotExamples, ad as mergeJson, ae as redactPii, af as repairJson, ag as rerankChunks, ah as sanitizeHtml, ai as scoreRelevance, aj as summarizeForLlm, ak as trimToTokens, al as unflattenJson, am as validateJsonSchema, an as vectorSimilarity } from '../ai_agent-C1zudGgT.js';
1
+ export { C as ChunkStrategy, b as CompressHtmlResult, c as CompressJsonResult, d as CompressMarkdownResult, e as CostEstimate, D as DedupeResult, f as DedupeStrategy, g as DiffEntry2, h as DiffOp2, i as DiffResult2, E as Entity2, j as EntityType2, k as ExtractJsonResult, l as ExtractKeywordsResult, m as ExtractUrlsResult, F as FewShotExample, n as FewShotFormat, o as FewShotFormatResult, I as InjectionDetectResult, p as InjectionFinding, J as JsonBlock, q as JsonRepairResult, K as Keyword, M as MODEL_PRICING, r as MergeResult, s as MergeStrategy, t as ModelPricing, P as PiiDetectResult, u as PiiFinding, v as PiiType, R as RankedChunk, w as RelevanceResult, S as SanitizeResult, x as SecretDetectResult, y as SecretFinding, z as SecretType, A as SummaryResult, T as TableResult2, B as TextChunk, G as TokenEstimate, H as TokenEstimateResult, L as ToolSchemaIssue, N as ToolSchemaLintResult, O as TrimResult, Q as TrimStrategy, U as UrlMatch, V as ValidationError, W as ValidationResult, X as VectorSimilarityResult, Y as chunkText, Z as compressHtml, _ as compressJson, $ as compressMarkdown, a0 as deduplicateLines, a1 as detectPii, a2 as detectPromptInjection, a3 as detectSecrets, a4 as diffJson, a5 as estimateCost, a6 as estimateTokens, a7 as expandQuery, a8 as extractEntities, a9 as extractJson, aa as extractKeywords, ab as extractTables, ac as extractUrls, ad as flattenJson, ae as formatFewShotExamples, af as lintToolSchema, ag as mergeJson, ah as redactPii, ai as repairJson, aj as rerankChunks, ak as sanitizeHtml, al as scoreRelevance, am as summarizeForLlm, an as trimToTokens, ao as unflattenJson, ap as validateJsonSchema, aq as vectorSimilarity } from '../ai_agent-CmrVjvYH.js';
@@ -1,2 +1,2 @@
1
- export { MODEL_PRICING, chunkText, compressHtml, compressJson, compressMarkdown, deduplicateLines, detectPii, detectPromptInjection, detectSecrets, diffJson, estimateCost, estimateTokens, expandQuery, extractEntities, extractJson, extractKeywords, extractTables, extractUrls, flattenJson, formatFewShotExamples, mergeJson, redactPii, repairJson, rerankChunks, sanitizeHtml, scoreRelevance, summarizeForLlm, trimToTokens, unflattenJson, validateJsonSchema, vectorSimilarity } from '../chunk-W3J7GZVQ.js';
1
+ export { MODEL_PRICING, chunkText, compressHtml, compressJson, compressMarkdown, deduplicateLines, detectPii, detectPromptInjection, detectSecrets, diffJson, estimateCost, estimateTokens, expandQuery, extractEntities, extractJson, extractKeywords, extractTables, extractUrls, flattenJson, formatFewShotExamples, lintToolSchema, mergeJson, redactPii, repairJson, rerankChunks, sanitizeHtml, scoreRelevance, summarizeForLlm, trimToTokens, unflattenJson, validateJsonSchema, vectorSimilarity } from '../chunk-EKIXOA7B.js';
2
2
  import '../chunk-MLKGABMK.js';