milieu-cli 0.1.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/LICENSE +200 -0
- package/README.md +153 -0
- package/dist/bridges/index.d.ts +5 -0
- package/dist/bridges/index.d.ts.map +1 -0
- package/dist/bridges/index.js +6 -0
- package/dist/bridges/index.js.map +1 -0
- package/dist/bridges/reachability/crawler-policy.d.ts +36 -0
- package/dist/bridges/reachability/crawler-policy.d.ts.map +1 -0
- package/dist/bridges/reachability/crawler-policy.js +110 -0
- package/dist/bridges/reachability/crawler-policy.js.map +1 -0
- package/dist/bridges/reachability/http-status.d.ts +7 -0
- package/dist/bridges/reachability/http-status.d.ts.map +1 -0
- package/dist/bridges/reachability/http-status.js +74 -0
- package/dist/bridges/reachability/http-status.js.map +1 -0
- package/dist/bridges/reachability/https-check.d.ts +14 -0
- package/dist/bridges/reachability/https-check.d.ts.map +1 -0
- package/dist/bridges/reachability/https-check.js +38 -0
- package/dist/bridges/reachability/https-check.js.map +1 -0
- package/dist/bridges/reachability/index.d.ts +13 -0
- package/dist/bridges/reachability/index.d.ts.map +1 -0
- package/dist/bridges/reachability/index.js +115 -0
- package/dist/bridges/reachability/index.js.map +1 -0
- package/dist/bridges/reachability/meta-robots.d.ts +16 -0
- package/dist/bridges/reachability/meta-robots.d.ts.map +1 -0
- package/dist/bridges/reachability/meta-robots.js +119 -0
- package/dist/bridges/reachability/meta-robots.js.map +1 -0
- package/dist/bridges/reachability/robots-parser.d.ts +26 -0
- package/dist/bridges/reachability/robots-parser.d.ts.map +1 -0
- package/dist/bridges/reachability/robots-parser.js +105 -0
- package/dist/bridges/reachability/robots-parser.js.map +1 -0
- package/dist/bridges/reachability/robots-txt.d.ts +14 -0
- package/dist/bridges/reachability/robots-txt.d.ts.map +1 -0
- package/dist/bridges/reachability/robots-txt.js +80 -0
- package/dist/bridges/reachability/robots-txt.js.map +1 -0
- package/dist/bridges/separation/api-presence.d.ts +14 -0
- package/dist/bridges/separation/api-presence.d.ts.map +1 -0
- package/dist/bridges/separation/api-presence.js +96 -0
- package/dist/bridges/separation/api-presence.js.map +1 -0
- package/dist/bridges/separation/developer-docs.d.ts +21 -0
- package/dist/bridges/separation/developer-docs.d.ts.map +1 -0
- package/dist/bridges/separation/developer-docs.js +81 -0
- package/dist/bridges/separation/developer-docs.js.map +1 -0
- package/dist/bridges/separation/index.d.ts +20 -0
- package/dist/bridges/separation/index.d.ts.map +1 -0
- package/dist/bridges/separation/index.js +63 -0
- package/dist/bridges/separation/index.js.map +1 -0
- package/dist/bridges/separation/sdk-references.d.ts +12 -0
- package/dist/bridges/separation/sdk-references.d.ts.map +1 -0
- package/dist/bridges/separation/sdk-references.js +93 -0
- package/dist/bridges/separation/sdk-references.js.map +1 -0
- package/dist/bridges/separation/webhook-support.d.ts +19 -0
- package/dist/bridges/separation/webhook-support.d.ts.map +1 -0
- package/dist/bridges/separation/webhook-support.js +94 -0
- package/dist/bridges/separation/webhook-support.js.map +1 -0
- package/dist/bridges/standards/index.d.ts +13 -0
- package/dist/bridges/standards/index.d.ts.map +1 -0
- package/dist/bridges/standards/index.js +79 -0
- package/dist/bridges/standards/index.js.map +1 -0
- package/dist/bridges/standards/json-ld.d.ts +16 -0
- package/dist/bridges/standards/json-ld.d.ts.map +1 -0
- package/dist/bridges/standards/json-ld.js +63 -0
- package/dist/bridges/standards/json-ld.js.map +1 -0
- package/dist/bridges/standards/llms-txt.d.ts +19 -0
- package/dist/bridges/standards/llms-txt.d.ts.map +1 -0
- package/dist/bridges/standards/llms-txt.js +64 -0
- package/dist/bridges/standards/llms-txt.js.map +1 -0
- package/dist/bridges/standards/mcp.d.ts +13 -0
- package/dist/bridges/standards/mcp.d.ts.map +1 -0
- package/dist/bridges/standards/mcp.js +72 -0
- package/dist/bridges/standards/mcp.js.map +1 -0
- package/dist/bridges/standards/openapi.d.ts +14 -0
- package/dist/bridges/standards/openapi.d.ts.map +1 -0
- package/dist/bridges/standards/openapi.js +424 -0
- package/dist/bridges/standards/openapi.js.map +1 -0
- package/dist/bridges/standards/schema-org.d.ts +12 -0
- package/dist/bridges/standards/schema-org.d.ts.map +1 -0
- package/dist/bridges/standards/schema-org.js +101 -0
- package/dist/bridges/standards/schema-org.js.map +1 -0
- package/dist/bridges/standards/well-known.d.ts +16 -0
- package/dist/bridges/standards/well-known.d.ts.map +1 -0
- package/dist/bridges/standards/well-known.js +77 -0
- package/dist/bridges/standards/well-known.js.map +1 -0
- package/dist/bridges/stubs.d.ts +4 -0
- package/dist/bridges/stubs.d.ts.map +1 -0
- package/dist/bridges/stubs.js +25 -0
- package/dist/bridges/stubs.js.map +1 -0
- package/dist/cli/index.d.ts +4 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +83 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/core/explanations.d.ts +11 -0
- package/dist/core/explanations.d.ts.map +1 -0
- package/dist/core/explanations.js +128 -0
- package/dist/core/explanations.js.map +1 -0
- package/dist/core/index.d.ts +6 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +6 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/scan.d.ts +3 -0
- package/dist/core/scan.d.ts.map +1 -0
- package/dist/core/scan.js +89 -0
- package/dist/core/scan.js.map +1 -0
- package/dist/core/types.d.ts +119 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +3 -0
- package/dist/core/types.js.map +1 -0
- package/dist/core/version.d.ts +2 -0
- package/dist/core/version.d.ts.map +1 -0
- package/dist/core/version.js +7 -0
- package/dist/core/version.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/render/colors.d.ts +7 -0
- package/dist/render/colors.d.ts.map +1 -0
- package/dist/render/colors.js +28 -0
- package/dist/render/colors.js.map +1 -0
- package/dist/render/format-bridge.d.ts +3 -0
- package/dist/render/format-bridge.d.ts.map +1 -0
- package/dist/render/format-bridge.js +39 -0
- package/dist/render/format-bridge.js.map +1 -0
- package/dist/render/format-scan.d.ts +3 -0
- package/dist/render/format-scan.d.ts.map +1 -0
- package/dist/render/format-scan.js +44 -0
- package/dist/render/format-scan.js.map +1 -0
- package/dist/render/format-verbose.d.ts +3 -0
- package/dist/render/format-verbose.d.ts.map +1 -0
- package/dist/render/format-verbose.js +14 -0
- package/dist/render/format-verbose.js.map +1 -0
- package/dist/render/index.d.ts +7 -0
- package/dist/render/index.d.ts.map +1 -0
- package/dist/render/index.js +8 -0
- package/dist/render/index.js.map +1 -0
- package/dist/render/progress-bar.d.ts +10 -0
- package/dist/render/progress-bar.d.ts.map +1 -0
- package/dist/render/progress-bar.js +21 -0
- package/dist/render/progress-bar.js.map +1 -0
- package/dist/render/symbols.d.ts +10 -0
- package/dist/render/symbols.d.ts.map +1 -0
- package/dist/render/symbols.js +21 -0
- package/dist/render/symbols.js.map +1 -0
- package/dist/utils/http-client.d.ts +25 -0
- package/dist/utils/http-client.d.ts.map +1 -0
- package/dist/utils/http-client.js +235 -0
- package/dist/utils/http-client.js.map +1 -0
- package/dist/utils/index.d.ts +6 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +7 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/ssrf.d.ts +29 -0
- package/dist/utils/ssrf.d.ts.map +1 -0
- package/dist/utils/ssrf.js +134 -0
- package/dist/utils/ssrf.js.map +1 -0
- package/dist/utils/url.d.ts +53 -0
- package/dist/utils/url.d.ts.map +1 -0
- package/dist/utils/url.js +64 -0
- package/dist/utils/url.js.map +1 -0
- package/package.json +74 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to the Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by the Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding any notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. Please also get an in the
|
|
186
|
+
appropriate place.
|
|
187
|
+
|
|
188
|
+
Copyright 2025 Milieu
|
|
189
|
+
|
|
190
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
191
|
+
you may not use this file except in compliance with the License.
|
|
192
|
+
You may obtain a copy of the License at
|
|
193
|
+
|
|
194
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
195
|
+
|
|
196
|
+
Unless required by applicable law or agreed to in writing, software
|
|
197
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
198
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
199
|
+
See the License for the specific language governing permissions and
|
|
200
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
# milieu-cli
|
|
2
|
+
|
|
3
|
+
The API is the new product UI. Your customers are no longer just humans. They're AI agents, LLM pipelines, and automated workflows. These customers don't browse your marketing site or read your docs the way people do. They parse your machine-readable signals, probe your endpoints, and decide in milliseconds whether your product is usable.
|
|
4
|
+
|
|
5
|
+
As an industry, we've spent decades perfecting UI & UX design for humans. Now we need the same rigor for the interface AI agents actually see: your product's **milieu**.
|
|
6
|
+
|
|
7
|
+
## What is milieu?
|
|
8
|
+
|
|
9
|
+
*Milieu* is the totality of machine-readable signals that surround your product — the environment an AI agent encounters when it tries to discover, understand, and integrate with what you've built. It's not any single file or endpoint. It's robots.txt and OpenAPI specs and llms.txt and JSON-LD and developer docs and SDK references, all working together. It's the difference between a product that AI agents can use and one they walk past.
|
|
10
|
+
|
|
11
|
+
Good design made products usable for humans. Good milieu design makes products usable for agents.
|
|
12
|
+
|
|
13
|
+
milieu-cli measures this. It scans your site and tells you what AI agents can actually see.
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npx milieu-cli scan stripe.com
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
# Gate your pipeline on agent-readiness
|
|
21
|
+
milieu scan api.mycompany.com --threshold 70
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## The 5 Bridges
|
|
25
|
+
|
|
26
|
+
Milieu evaluates your product through five progressive bridges. Each one represents a layer of machine legibility that AI agents need, from "can I reach you?" to "can I trust you?"
|
|
27
|
+
|
|
28
|
+
| | Bridge | Question | What milieu checks | Score |
|
|
29
|
+
|---|---|---|---|---|
|
|
30
|
+
| 1 | **Reachability** | **Can agents reach you?** | HTTPS, HTTP status, robots.txt (RFC 9309), per-bot crawler policies (GPTBot, ClaudeBot, CCBot, Googlebot, Bingbot, PerplexityBot), meta robots, X-Robots-Tag | 0–100 |
|
|
31
|
+
| 2 | **Standards** | **Can agents read you?** | OpenAPI spec, llms.txt, llms-full.txt, MCP endpoint, JSON-LD, Schema.org, security.txt, ai-plugin.json | 0–100 |
|
|
32
|
+
| 3 | **Separation** | **Can agents integrate with you?** | API endpoints, developer docs, SDK/package references, webhook support | Detection only* |
|
|
33
|
+
| 4 | **Schema** | **Can agents use you correctly?** | Planned | — |
|
|
34
|
+
| 5 | **Context** | **Can agents trust you?** | Planned | — |
|
|
35
|
+
|
|
36
|
+
*Bridge 3 reports what's present rather than scoring quality.
|
|
37
|
+
|
|
38
|
+
The bridges are progressive: there's no point checking your OpenAPI spec (Bridge 2) if agents can't even reach your site (Bridge 1). There's no point looking for SDK references (Bridge 3) if you don't publish machine-readable standards (Bridge 2). Each bridge builds on the last.
|
|
39
|
+
|
|
40
|
+
**Bridge 1 — Reachability** is the front door. Can AI agents get to your content at all? Are you blocking specific crawlers without realizing it? This is the most actionable bridge for most sites — many are unknowingly blocking GPTBot or ClaudeBot in their robots.txt.
|
|
41
|
+
|
|
42
|
+
**Bridge 2 — Standards** is the shared language. Do you speak the protocols AI agents understand? OpenAPI specs, llms.txt, MCP endpoints, structured data — these are the machine-readable standards that let agents go beyond scraping your HTML.
|
|
43
|
+
|
|
44
|
+
**Bridge 3 — Separation** is the developer surface. Do you have a clear API boundary? Developer docs? SDKs? Webhooks? This is where agents look to determine if your product is something they can build with, not just read from.
|
|
45
|
+
|
|
46
|
+
**Bridges 4-5 — Schema and Context** are deeper evaluations of whether your APIs are well-designed and whether agents can trust the data. These require analysis beyond automated checks.
|
|
47
|
+
|
|
48
|
+
### Crawler policies
|
|
49
|
+
|
|
50
|
+
The single most actionable finding for most sites: are you blocking AI agents? milieu checks your robots.txt for policies on six specific bots:
|
|
51
|
+
|
|
52
|
+
- **GPTBot** (OpenAI) · **ClaudeBot** (Anthropic) · **CCBot** (Common Crawl)
|
|
53
|
+
- **Googlebot** (Google) · **Bingbot** (Microsoft) · **PerplexityBot** (Perplexity)
|
|
54
|
+
|
|
55
|
+
Each policy is checked individually — you might be allowing Googlebot but blocking GPTBot without realizing it. Use `--verbose` to see per-bot results.
|
|
56
|
+
|
|
57
|
+
## Install
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
npx milieu-cli scan stripe.com # one-off, no install
|
|
61
|
+
npm install -g milieu-cli # global install
|
|
62
|
+
milieu scan stripe.com # short alias after install
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
> Both `milieu` and `milieu-cli` work as commands after global install.
|
|
66
|
+
|
|
67
|
+
## CI/CD integration
|
|
68
|
+
|
|
69
|
+
Track agent-readiness over time and prevent regressions:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
# Fail the build if score drops below 70
|
|
73
|
+
milieu scan api.mycompany.com --threshold 70 --quiet
|
|
74
|
+
|
|
75
|
+
# Capture structured results
|
|
76
|
+
milieu scan api.mycompany.com --json > milieu-report.json
|
|
77
|
+
|
|
78
|
+
# Pretty-print for debugging
|
|
79
|
+
milieu scan api.mycompany.com --json --pretty
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Exit codes: `0` = score meets threshold (or no threshold set), `1` = score below threshold or scan error.
|
|
83
|
+
|
|
84
|
+
## Options
|
|
85
|
+
|
|
86
|
+
| Flag | Description | Default |
|
|
87
|
+
|------|-------------|---------|
|
|
88
|
+
| `--json` | Output raw JSON to stdout | off |
|
|
89
|
+
| `--pretty` | Pretty-print JSON (use with --json) | off |
|
|
90
|
+
| `--verbose` | Show individual check details with explanations | off |
|
|
91
|
+
| `--explain-all` | Show explanations on all checks, not just failures (use with --verbose) | off |
|
|
92
|
+
| `--timeout <ms>` | Per-request timeout in milliseconds | 10000 |
|
|
93
|
+
| `--threshold <n>` | Exit non-zero if overall score < n | off |
|
|
94
|
+
| `--quiet` | Suppress terminal output | off |
|
|
95
|
+
|
|
96
|
+
### Check explanations
|
|
97
|
+
|
|
98
|
+
In `--verbose` mode, non-passing checks include a "why this matters" explanation, a plain-language sentence describing what the result means for AI agents. These explanations are status-aware: a failing robots.txt check tells you agents have no crawling guidance, while a passing one confirms your guidance is clear.
|
|
99
|
+
|
|
100
|
+
These explanations also appear in `--json` output as a `why` field on every check, designed for both human readers and LLMs generating recommendations.
|
|
101
|
+
|
|
102
|
+
## How scoring works
|
|
103
|
+
|
|
104
|
+
The **overall score** is the average of scored bridges (currently Bridges 1 and 2). Bridge 3 reports detection status only and is excluded from the average.
|
|
105
|
+
|
|
106
|
+
Each check within a scored bridge contributes: **pass = 1**, **partial = 0.5**, **fail = 0**. Bridge score = `(points / total_checks) * 100`.
|
|
107
|
+
|
|
108
|
+
A "partial" means the signal exists but is incomplete: an OpenAPI spec served as YAML (detected but not fully parseable), or a robots.txt with valid structure but no explicit allow/disallow rules.
|
|
109
|
+
|
|
110
|
+
All checks are reproducible: same site state produces the same score every time.
|
|
111
|
+
|
|
112
|
+
## Programmatic API
|
|
113
|
+
|
|
114
|
+
```typescript
|
|
115
|
+
import { scan } from "milieu-cli";
|
|
116
|
+
import type { ScanResult, ScanOptions, BridgeResult, Check, CheckStatus } from "milieu-cli";
|
|
117
|
+
|
|
118
|
+
const options: ScanOptions = {
|
|
119
|
+
timeout: 15000, // per-request timeout in ms (default: 10000)
|
|
120
|
+
verbose: true, // include check details in result
|
|
121
|
+
silent: true, // suppress spinner output (recommended for library use)
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
const result = await scan("https://stripe.com", options);
|
|
125
|
+
|
|
126
|
+
console.log(result.overallScore); // number (average of scored bridges)
|
|
127
|
+
console.log(result.overallScoreLabel); // "pass" | "partial" | "fail"
|
|
128
|
+
console.log(result.bridges); // 5-element tuple of BridgeResult
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
> **Note:** `result.bridges` always returns 5 elements. Bridges 1-2 have numeric scores. Bridge 3 has `score: null` (detection inventory). Bridges 4-5 have `score: null` (not yet evaluated). Handle nulls when mapping:
|
|
132
|
+
>
|
|
133
|
+
> ```typescript
|
|
134
|
+
> const scoredBridges = result.bridges.filter(b => b.score !== null);
|
|
135
|
+
> ```
|
|
136
|
+
|
|
137
|
+
Check explanations are available as a separate export for library consumers:
|
|
138
|
+
|
|
139
|
+
```typescript
|
|
140
|
+
import { resolveExplanation } from "milieu-cli";
|
|
141
|
+
|
|
142
|
+
// Get the status-aware explanation for a check
|
|
143
|
+
const why = resolveExplanation("robots_txt", "fail");
|
|
144
|
+
// → "Without robots.txt, AI agents have no guidance on what they can access..."
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
## Requirements
|
|
148
|
+
|
|
149
|
+
- Node.js 18+
|
|
150
|
+
|
|
151
|
+
## License
|
|
152
|
+
|
|
153
|
+
Apache-2.0
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { runReachabilityBridge } from "./reachability/index.js";
|
|
2
|
+
export { runStandardsBridge } from "./standards/index.js";
|
|
3
|
+
export { runSeparationBridge } from "./separation/index.js";
|
|
4
|
+
export { createBridge4Stub, createBridge5Stub } from "./stubs.js";
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/bridges/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// Bridge check implementations (Phases 3-5)
|
|
2
|
+
export { runReachabilityBridge } from "./reachability/index.js";
|
|
3
|
+
export { runStandardsBridge } from "./standards/index.js";
|
|
4
|
+
export { runSeparationBridge } from "./separation/index.js";
|
|
5
|
+
export { createBridge4Stub, createBridge5Stub } from "./stubs.js";
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/bridges/index.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAC5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { Check } from "../../core/types.js";
|
|
2
|
+
import type { RobotsTxtResult } from "./robots-parser.js";
|
|
3
|
+
export declare const AI_CRAWLERS: readonly [{
|
|
4
|
+
readonly id: "gptbot";
|
|
5
|
+
readonly name: "GPTBot";
|
|
6
|
+
readonly userAgent: "gptbot";
|
|
7
|
+
}, {
|
|
8
|
+
readonly id: "claudebot";
|
|
9
|
+
readonly name: "ClaudeBot";
|
|
10
|
+
readonly userAgent: "claudebot";
|
|
11
|
+
}, {
|
|
12
|
+
readonly id: "ccbot";
|
|
13
|
+
readonly name: "CCBot";
|
|
14
|
+
readonly userAgent: "ccbot";
|
|
15
|
+
}, {
|
|
16
|
+
readonly id: "googlebot";
|
|
17
|
+
readonly name: "Googlebot";
|
|
18
|
+
readonly userAgent: "googlebot";
|
|
19
|
+
}, {
|
|
20
|
+
readonly id: "bingbot";
|
|
21
|
+
readonly name: "Bingbot";
|
|
22
|
+
readonly userAgent: "bingbot";
|
|
23
|
+
}, {
|
|
24
|
+
readonly id: "perplexitybot";
|
|
25
|
+
readonly name: "PerplexityBot";
|
|
26
|
+
readonly userAgent: "perplexitybot";
|
|
27
|
+
}];
|
|
28
|
+
/**
|
|
29
|
+
* Evaluate per-AI-crawler policy from parsed robots.txt data.
|
|
30
|
+
*
|
|
31
|
+
* @param parsed - Parsed robots.txt result, or null if robots.txt was not found (404)
|
|
32
|
+
* @param targetPath - The URL path to evaluate against (e.g., "/")
|
|
33
|
+
* @returns Array of 6 Check objects, one per AI crawler
|
|
34
|
+
*/
|
|
35
|
+
export declare function evaluateCrawlerPolicies(parsed: RobotsTxtResult | null, targetPath: string): Check[];
|
|
36
|
+
//# sourceMappingURL=crawler-policy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"crawler-policy.d.ts","sourceRoot":"","sources":["../../../src/bridges/reachability/crawler-policy.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,KAAK,EAAE,eAAe,EAAe,MAAM,oBAAoB,CAAC;AAGvE,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;EAOd,CAAC;AAEX;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,eAAe,GAAG,IAAI,EAC9B,UAAU,EAAE,MAAM,GACjB,KAAK,EAAE,CAiCT"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
// AI crawler policy evaluation from parsed robots.txt data
|
|
2
|
+
import { matchesPath } from "./robots-parser.js";
|
|
3
|
+
export const AI_CRAWLERS = [
|
|
4
|
+
{ id: "gptbot", name: "GPTBot", userAgent: "gptbot" },
|
|
5
|
+
{ id: "claudebot", name: "ClaudeBot", userAgent: "claudebot" },
|
|
6
|
+
{ id: "ccbot", name: "CCBot", userAgent: "ccbot" },
|
|
7
|
+
{ id: "googlebot", name: "Googlebot", userAgent: "googlebot" },
|
|
8
|
+
{ id: "bingbot", name: "Bingbot", userAgent: "bingbot" },
|
|
9
|
+
{ id: "perplexitybot", name: "PerplexityBot", userAgent: "perplexitybot" },
|
|
10
|
+
];
|
|
11
|
+
/**
|
|
12
|
+
* Evaluate per-AI-crawler policy from parsed robots.txt data.
|
|
13
|
+
*
|
|
14
|
+
* @param parsed - Parsed robots.txt result, or null if robots.txt was not found (404)
|
|
15
|
+
* @param targetPath - The URL path to evaluate against (e.g., "/")
|
|
16
|
+
* @returns Array of 6 Check objects, one per AI crawler
|
|
17
|
+
*/
|
|
18
|
+
export function evaluateCrawlerPolicies(parsed, targetPath) {
|
|
19
|
+
return AI_CRAWLERS.map((crawler) => {
|
|
20
|
+
const id = `crawler_policy_${crawler.id}`;
|
|
21
|
+
const label = `${crawler.name} Policy`;
|
|
22
|
+
// No robots.txt (404 case): skip
|
|
23
|
+
if (parsed === null) {
|
|
24
|
+
return {
|
|
25
|
+
id,
|
|
26
|
+
label,
|
|
27
|
+
status: "pass",
|
|
28
|
+
detail: "No robots.txt found",
|
|
29
|
+
data: { policy: "skip" },
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
// Find group matching this crawler
|
|
33
|
+
const group = findMatchingGroup(parsed, crawler.userAgent);
|
|
34
|
+
if (!group) {
|
|
35
|
+
// No matching group at all -> allowed
|
|
36
|
+
return {
|
|
37
|
+
id,
|
|
38
|
+
label,
|
|
39
|
+
status: "pass",
|
|
40
|
+
detail: "Allowed",
|
|
41
|
+
data: { policy: "pass" },
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
// Evaluate policy from the group's rules
|
|
45
|
+
return evaluateGroupPolicy(group, id, label);
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Find the most specific matching group for a crawler.
|
|
50
|
+
* Prefer crawler-specific group over * group (RFC 9309).
|
|
51
|
+
*/
|
|
52
|
+
function findMatchingGroup(parsed, userAgent) {
|
|
53
|
+
const ua = userAgent.toLowerCase();
|
|
54
|
+
// Look for specific match first
|
|
55
|
+
const specific = parsed.groups.find((g) => g.userAgents.some((a) => a === ua));
|
|
56
|
+
if (specific)
|
|
57
|
+
return specific;
|
|
58
|
+
// Fall back to * group
|
|
59
|
+
const wildcard = parsed.groups.find((g) => g.userAgents.some((a) => a === "*"));
|
|
60
|
+
return wildcard ?? null;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Evaluate a crawler's policy from its matching group's rules.
|
|
64
|
+
*/
|
|
65
|
+
function evaluateGroupPolicy(group, id, label) {
|
|
66
|
+
const disallowRules = group.rules.filter((r) => r.type === "disallow");
|
|
67
|
+
const allowRules = group.rules.filter((r) => r.type === "allow");
|
|
68
|
+
// No rules or only empty-path Disallow -> pass
|
|
69
|
+
const hasSubstantiveDisallow = disallowRules.some((r) => r.path !== "");
|
|
70
|
+
if (!hasSubstantiveDisallow) {
|
|
71
|
+
return {
|
|
72
|
+
id,
|
|
73
|
+
label,
|
|
74
|
+
status: "pass",
|
|
75
|
+
detail: "Allowed",
|
|
76
|
+
data: { policy: "pass" },
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
// Has Disallow: / (root block)?
|
|
80
|
+
const hasRootBlock = disallowRules.some((r) => matchesPath(r.path, "/"));
|
|
81
|
+
if (hasRootBlock && allowRules.length > 0) {
|
|
82
|
+
// Disallow: / with Allow rules -> partial
|
|
83
|
+
return {
|
|
84
|
+
id,
|
|
85
|
+
label,
|
|
86
|
+
status: "partial",
|
|
87
|
+
detail: "Partially restricted",
|
|
88
|
+
data: { policy: "partial" },
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
if (hasRootBlock) {
|
|
92
|
+
// Disallow: / with no Allow -> blocked
|
|
93
|
+
return {
|
|
94
|
+
id,
|
|
95
|
+
label,
|
|
96
|
+
status: "fail",
|
|
97
|
+
detail: "Blocked",
|
|
98
|
+
data: { policy: "fail" },
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
// Non-root Disallow rules -> partial
|
|
102
|
+
return {
|
|
103
|
+
id,
|
|
104
|
+
label,
|
|
105
|
+
status: "partial",
|
|
106
|
+
detail: "Partially restricted",
|
|
107
|
+
data: { policy: "partial" },
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
//# sourceMappingURL=crawler-policy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"crawler-policy.js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.js";
|
|
2
|
+
/**
|
|
3
|
+
* Check HTTP status from a pre-fetched page response.
|
|
4
|
+
* Does NOT make any HTTP calls -- takes the already-fetched response.
|
|
5
|
+
*/
|
|
6
|
+
export declare function checkHttpStatus(pageResponse: HttpResponse): Check;
|
|
7
|
+
//# sourceMappingURL=http-status.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-status.d.ts","sourceRoot":"","sources":["../../../src/bridges/reachability/http-status.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAE/D;;;GAGG;AACH,wBAAgB,eAAe,CAAC,YAAY,EAAE,YAAY,GAAG,KAAK,CA+EjE"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Check HTTP status from a pre-fetched page response.
|
|
3
|
+
* Does NOT make any HTTP calls -- takes the already-fetched response.
|
|
4
|
+
*/
|
|
5
|
+
export function checkHttpStatus(pageResponse) {
|
|
6
|
+
const id = "http_status";
|
|
7
|
+
const label = "HTTP Status";
|
|
8
|
+
if (pageResponse.ok) {
|
|
9
|
+
const { status, redirects, url } = pageResponse;
|
|
10
|
+
const data = redirects.length > 0
|
|
11
|
+
? { redirects, finalUrl: url }
|
|
12
|
+
: undefined;
|
|
13
|
+
if (status >= 200 && status < 300) {
|
|
14
|
+
return {
|
|
15
|
+
id,
|
|
16
|
+
label,
|
|
17
|
+
status: "pass",
|
|
18
|
+
detail: `HTTP ${status} OK`,
|
|
19
|
+
data,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
// Redirect status with ok:true (unusual since httpGet follows redirects)
|
|
23
|
+
if (status >= 300 && status < 400) {
|
|
24
|
+
return {
|
|
25
|
+
id,
|
|
26
|
+
label,
|
|
27
|
+
status: "partial",
|
|
28
|
+
detail: `HTTP ${status} redirect`,
|
|
29
|
+
data,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
// Shouldn't reach here with ok:true, but handle gracefully
|
|
33
|
+
return {
|
|
34
|
+
id,
|
|
35
|
+
label,
|
|
36
|
+
status: "pass",
|
|
37
|
+
detail: `HTTP ${status}`,
|
|
38
|
+
data,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
// Failure cases
|
|
42
|
+
const { kind, message, statusCode } = pageResponse.error;
|
|
43
|
+
switch (kind) {
|
|
44
|
+
case "bot_protected":
|
|
45
|
+
return {
|
|
46
|
+
id,
|
|
47
|
+
label,
|
|
48
|
+
status: "fail",
|
|
49
|
+
detail: "Bot protection detected",
|
|
50
|
+
};
|
|
51
|
+
case "timeout":
|
|
52
|
+
return {
|
|
53
|
+
id,
|
|
54
|
+
label,
|
|
55
|
+
status: "fail",
|
|
56
|
+
detail: "Request timed out",
|
|
57
|
+
};
|
|
58
|
+
case "http_error":
|
|
59
|
+
return {
|
|
60
|
+
id,
|
|
61
|
+
label,
|
|
62
|
+
status: "fail",
|
|
63
|
+
detail: statusCode ? `HTTP ${statusCode}` : message,
|
|
64
|
+
};
|
|
65
|
+
default:
|
|
66
|
+
return {
|
|
67
|
+
id,
|
|
68
|
+
label,
|
|
69
|
+
status: "fail",
|
|
70
|
+
detail: message,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=http-status.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-status.js","sourceRoot":"","sources":["../../../src/bridges/reachability/http-status.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,YAA0B;IACxD,MAAM,EAAE,GAAG,aAAa,CAAC;IACzB,MAAM,KAAK,GAAG,aAAa,CAAC;IAE5B,IAAI,YAAY,CAAC,EAAE,EAAE,CAAC;QACpB,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,YAAY,CAAC;QAEhD,MAAM,IAAI,GACR,SAAS,CAAC,MAAM,G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gBACF,KAAK;gBACL,MAAM,EAAE,MAAM;gBACd,MAAM,EAAE,OAAO;aAChB,CAAC;IACN,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Check } from "../../core/types.js";
|
|
2
|
+
export interface HttpsCheckResult {
|
|
3
|
+
check: Check;
|
|
4
|
+
abort: boolean;
|
|
5
|
+
abortReason?: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Check HTTPS availability via HEAD request to https://<domain>.
|
|
9
|
+
*
|
|
10
|
+
* Any response (even 4xx/5xx) means HTTPS works.
|
|
11
|
+
* Abort-worthy errors: dns, connection_refused, ssl_error.
|
|
12
|
+
*/
|
|
13
|
+
export declare function checkHttps(domain: string, timeout?: number): Promise<HttpsCheckResult>;
|
|
14
|
+
//# sourceMappingURL=https-check.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"https-check.d.ts","sourceRoot":"","sources":["../../../src/bridges/reachability/https-check.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAGjD,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,KAAK,CAAC;IACb,KAAK,EAAE,OAAO,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAID;;;;;GAKG;AACH,wBAAsB,UAAU,CAC9B,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,gBAAgB,CAAC,CA+B3B"}
|