@taggor/contract 0.0.0-stage → 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.
Files changed (339) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +61 -2
  3. package/dist/.tsbuildinfo +1 -0
  4. package/dist/artifact-keys.d.ts +169 -0
  5. package/dist/artifact-keys.d.ts.map +1 -0
  6. package/dist/artifact-keys.js +195 -0
  7. package/dist/artifact-keys.js.map +1 -0
  8. package/dist/assets.d.ts +72 -0
  9. package/dist/assets.d.ts.map +1 -0
  10. package/dist/assets.js +94 -0
  11. package/dist/assets.js.map +1 -0
  12. package/dist/bounded-path.d.ts +29 -0
  13. package/dist/bounded-path.d.ts.map +1 -0
  14. package/dist/bounded-path.js +57 -0
  15. package/dist/bounded-path.js.map +1 -0
  16. package/dist/bounded.d.ts +47 -0
  17. package/dist/bounded.d.ts.map +1 -0
  18. package/dist/bounded.js +93 -0
  19. package/dist/bounded.js.map +1 -0
  20. package/dist/build-diagnostic.d.ts +89 -0
  21. package/dist/build-diagnostic.d.ts.map +1 -0
  22. package/dist/build-diagnostic.js +91 -0
  23. package/dist/build-diagnostic.js.map +1 -0
  24. package/dist/component-types.d.ts +61 -0
  25. package/dist/component-types.d.ts.map +1 -0
  26. package/dist/component-types.js +277 -0
  27. package/dist/component-types.js.map +1 -0
  28. package/dist/consent-text.d.ts +31 -0
  29. package/dist/consent-text.d.ts.map +1 -0
  30. package/dist/consent-text.js +41 -0
  31. package/dist/consent-text.js.map +1 -0
  32. package/dist/contract-version.d.ts +150 -0
  33. package/dist/contract-version.d.ts.map +1 -0
  34. package/dist/contract-version.js +198 -0
  35. package/dist/contract-version.js.map +1 -0
  36. package/dist/credential-fields.d.ts +31 -0
  37. package/dist/credential-fields.d.ts.map +1 -0
  38. package/dist/credential-fields.js +36 -0
  39. package/dist/credential-fields.js.map +1 -0
  40. package/dist/css-tokens.d.ts +46 -0
  41. package/dist/css-tokens.d.ts.map +1 -0
  42. package/dist/css-tokens.js +189 -0
  43. package/dist/css-tokens.js.map +1 -0
  44. package/dist/css-value.d.ts +42 -0
  45. package/dist/css-value.d.ts.map +1 -0
  46. package/dist/css-value.js +78 -0
  47. package/dist/css-value.js.map +1 -0
  48. package/dist/data-api.d.ts +127 -0
  49. package/dist/data-api.d.ts.map +1 -0
  50. package/dist/data-api.js +167 -0
  51. package/dist/data-api.js.map +1 -0
  52. package/dist/denylist-keys.d.ts +19 -0
  53. package/dist/denylist-keys.d.ts.map +1 -0
  54. package/dist/denylist-keys.js +48 -0
  55. package/dist/denylist-keys.js.map +1 -0
  56. package/dist/diagnostic-catalog.d.ts +1402 -0
  57. package/dist/diagnostic-catalog.d.ts.map +1 -0
  58. package/dist/diagnostic-catalog.js +1311 -0
  59. package/dist/diagnostic-catalog.js.map +1 -0
  60. package/dist/dom-members.snapshot.d.ts +33 -0
  61. package/dist/dom-members.snapshot.d.ts.map +1 -0
  62. package/dist/dom-members.snapshot.js +760 -0
  63. package/dist/dom-members.snapshot.js.map +1 -0
  64. package/dist/early-loading.d.ts +27 -0
  65. package/dist/early-loading.d.ts.map +1 -0
  66. package/dist/early-loading.js +44 -0
  67. package/dist/early-loading.js.map +1 -0
  68. package/dist/error-catalog.d.ts +749 -0
  69. package/dist/error-catalog.d.ts.map +1 -0
  70. package/dist/error-catalog.js +720 -0
  71. package/dist/error-catalog.js.map +1 -0
  72. package/dist/executable-config.d.ts +35 -0
  73. package/dist/executable-config.d.ts.map +1 -0
  74. package/dist/executable-config.js +44 -0
  75. package/dist/executable-config.js.map +1 -0
  76. package/dist/freeze.d.ts +17 -0
  77. package/dist/freeze.d.ts.map +1 -0
  78. package/dist/freeze.js +29 -0
  79. package/dist/freeze.js.map +1 -0
  80. package/dist/gunzip.d.ts +33 -0
  81. package/dist/gunzip.d.ts.map +1 -0
  82. package/dist/gunzip.js +330 -0
  83. package/dist/gunzip.js.map +1 -0
  84. package/dist/hostname.d.ts +74 -0
  85. package/dist/hostname.d.ts.map +1 -0
  86. package/dist/hostname.js +215 -0
  87. package/dist/hostname.js.map +1 -0
  88. package/dist/human-actions.d.ts +49 -0
  89. package/dist/human-actions.d.ts.map +1 -0
  90. package/dist/human-actions.js +272 -0
  91. package/dist/human-actions.js.map +1 -0
  92. package/dist/index.d.ts +72 -0
  93. package/dist/index.d.ts.map +1 -0
  94. package/dist/index.js +72 -0
  95. package/dist/index.js.map +1 -0
  96. package/dist/json-schema.d.ts +108 -0
  97. package/dist/json-schema.d.ts.map +1 -0
  98. package/dist/json-schema.js +240 -0
  99. package/dist/json-schema.js.map +1 -0
  100. package/dist/key-checksum.d.ts +33 -0
  101. package/dist/key-checksum.d.ts.map +1 -0
  102. package/dist/key-checksum.js +67 -0
  103. package/dist/key-checksum.js.map +1 -0
  104. package/dist/libraries.d.ts +60 -0
  105. package/dist/libraries.d.ts.map +1 -0
  106. package/dist/libraries.js +120 -0
  107. package/dist/libraries.js.map +1 -0
  108. package/dist/limit-catalog.d.ts +371 -0
  109. package/dist/limit-catalog.d.ts.map +1 -0
  110. package/dist/limit-catalog.js +414 -0
  111. package/dist/limit-catalog.js.map +1 -0
  112. package/dist/limits.d.ts +167 -0
  113. package/dist/limits.d.ts.map +1 -0
  114. package/dist/limits.js +175 -0
  115. package/dist/limits.js.map +1 -0
  116. package/dist/locale-tag.d.ts +21 -0
  117. package/dist/locale-tag.d.ts.map +1 -0
  118. package/dist/locale-tag.js +21 -0
  119. package/dist/locale-tag.js.map +1 -0
  120. package/dist/make-diagnostic.d.ts +74 -0
  121. package/dist/make-diagnostic.d.ts.map +1 -0
  122. package/dist/make-diagnostic.js +100 -0
  123. package/dist/make-diagnostic.js.map +1 -0
  124. package/dist/manifest-compat-diagnostics.d.ts +23 -0
  125. package/dist/manifest-compat-diagnostics.d.ts.map +1 -0
  126. package/dist/manifest-compat-diagnostics.js +150 -0
  127. package/dist/manifest-compat-diagnostics.js.map +1 -0
  128. package/dist/manifest-compat.d.ts +58 -0
  129. package/dist/manifest-compat.d.ts.map +1 -0
  130. package/dist/manifest-compat.js +377 -0
  131. package/dist/manifest-compat.js.map +1 -0
  132. package/dist/manifest.d.ts +1769 -0
  133. package/dist/manifest.d.ts.map +1 -0
  134. package/dist/manifest.js +421 -0
  135. package/dist/manifest.js.map +1 -0
  136. package/dist/metering.d.ts +126 -0
  137. package/dist/metering.d.ts.map +1 -0
  138. package/dist/metering.js +147 -0
  139. package/dist/metering.js.map +1 -0
  140. package/dist/migrate.d.ts +70 -0
  141. package/dist/migrate.d.ts.map +1 -0
  142. package/dist/migrate.js +159 -0
  143. package/dist/migrate.js.map +1 -0
  144. package/dist/names.d.ts +37 -0
  145. package/dist/names.d.ts.map +1 -0
  146. package/dist/names.js +55 -0
  147. package/dist/names.js.map +1 -0
  148. package/dist/overage-pricing.d.ts +89 -0
  149. package/dist/overage-pricing.d.ts.map +1 -0
  150. package/dist/overage-pricing.js +170 -0
  151. package/dist/overage-pricing.js.map +1 -0
  152. package/dist/plan-ids.d.ts +10 -0
  153. package/dist/plan-ids.d.ts.map +1 -0
  154. package/dist/plan-ids.js +8 -0
  155. package/dist/plan-ids.js.map +1 -0
  156. package/dist/plan-limits.d.ts +138 -0
  157. package/dist/plan-limits.d.ts.map +1 -0
  158. package/dist/plan-limits.js +112 -0
  159. package/dist/plan-limits.js.map +1 -0
  160. package/dist/plan-pricing.d.ts +145 -0
  161. package/dist/plan-pricing.d.ts.map +1 -0
  162. package/dist/plan-pricing.js +172 -0
  163. package/dist/plan-pricing.js.map +1 -0
  164. package/dist/plan-usage.d.ts +112 -0
  165. package/dist/plan-usage.d.ts.map +1 -0
  166. package/dist/plan-usage.js +134 -0
  167. package/dist/plan-usage.js.map +1 -0
  168. package/dist/preview-token.d.ts +52 -0
  169. package/dist/preview-token.d.ts.map +1 -0
  170. package/dist/preview-token.js +106 -0
  171. package/dist/preview-token.js.map +1 -0
  172. package/dist/prop-names.d.ts +51 -0
  173. package/dist/prop-names.d.ts.map +1 -0
  174. package/dist/prop-names.js +150 -0
  175. package/dist/prop-names.js.map +1 -0
  176. package/dist/prop-type-docs.d.ts +20 -0
  177. package/dist/prop-type-docs.d.ts.map +1 -0
  178. package/dist/prop-type-docs.js +89 -0
  179. package/dist/prop-type-docs.js.map +1 -0
  180. package/dist/prop-types.d.ts +97 -0
  181. package/dist/prop-types.d.ts.map +1 -0
  182. package/dist/prop-types.js +299 -0
  183. package/dist/prop-types.js.map +1 -0
  184. package/dist/props.d.ts +996 -0
  185. package/dist/props.d.ts.map +1 -0
  186. package/dist/props.js +183 -0
  187. package/dist/props.js.map +1 -0
  188. package/dist/proto-guard.d.ts +29 -0
  189. package/dist/proto-guard.d.ts.map +1 -0
  190. package/dist/proto-guard.js +79 -0
  191. package/dist/proto-guard.js.map +1 -0
  192. package/dist/runtime-errors.d.ts +42 -0
  193. package/dist/runtime-errors.d.ts.map +1 -0
  194. package/dist/runtime-errors.js +42 -0
  195. package/dist/runtime-errors.js.map +1 -0
  196. package/dist/runtime-pointers.d.ts +58 -0
  197. package/dist/runtime-pointers.d.ts.map +1 -0
  198. package/dist/runtime-pointers.js +84 -0
  199. package/dist/runtime-pointers.js.map +1 -0
  200. package/dist/secret-scan.d.ts +191 -0
  201. package/dist/secret-scan.d.ts.map +1 -0
  202. package/dist/secret-scan.js +542 -0
  203. package/dist/secret-scan.js.map +1 -0
  204. package/dist/semver.d.ts +89 -0
  205. package/dist/semver.d.ts.map +1 -0
  206. package/dist/semver.js +400 -0
  207. package/dist/semver.js.map +1 -0
  208. package/dist/server-key.d.ts +68 -0
  209. package/dist/server-key.d.ts.map +1 -0
  210. package/dist/server-key.js +150 -0
  211. package/dist/server-key.js.map +1 -0
  212. package/dist/site-manifest-keys.d.ts +107 -0
  213. package/dist/site-manifest-keys.d.ts.map +1 -0
  214. package/dist/site-manifest-keys.js +146 -0
  215. package/dist/site-manifest-keys.js.map +1 -0
  216. package/dist/site-manifest.d.ts +286 -0
  217. package/dist/site-manifest.d.ts.map +1 -0
  218. package/dist/site-manifest.js +100 -0
  219. package/dist/site-manifest.js.map +1 -0
  220. package/dist/source-archive.d.ts +119 -0
  221. package/dist/source-archive.d.ts.map +1 -0
  222. package/dist/source-archive.js +644 -0
  223. package/dist/source-archive.js.map +1 -0
  224. package/dist/source-package-corpus.d.ts +55 -0
  225. package/dist/source-package-corpus.d.ts.map +1 -0
  226. package/dist/source-package-corpus.js +303 -0
  227. package/dist/source-package-corpus.js.map +1 -0
  228. package/dist/source-package.d.ts +227 -0
  229. package/dist/source-package.d.ts.map +1 -0
  230. package/dist/source-package.js +361 -0
  231. package/dist/source-package.js.map +1 -0
  232. package/dist/source-secrets.d.ts +21 -0
  233. package/dist/source-secrets.d.ts.map +1 -0
  234. package/dist/source-secrets.js +43 -0
  235. package/dist/source-secrets.js.map +1 -0
  236. package/dist/ssr-cap.d.ts +61 -0
  237. package/dist/ssr-cap.d.ts.map +1 -0
  238. package/dist/ssr-cap.js +107 -0
  239. package/dist/ssr-cap.js.map +1 -0
  240. package/dist/ssr-kv.d.ts +18 -0
  241. package/dist/ssr-kv.d.ts.map +1 -0
  242. package/dist/ssr-kv.js +18 -0
  243. package/dist/ssr-kv.js.map +1 -0
  244. package/dist/ssr-version-ledger.d.ts +53 -0
  245. package/dist/ssr-version-ledger.d.ts.map +1 -0
  246. package/dist/ssr-version-ledger.js +88 -0
  247. package/dist/ssr-version-ledger.js.map +1 -0
  248. package/dist/style-references.d.ts +58 -0
  249. package/dist/style-references.d.ts.map +1 -0
  250. package/dist/style-references.js +241 -0
  251. package/dist/style-references.js.map +1 -0
  252. package/dist/tag-name.d.ts +87 -0
  253. package/dist/tag-name.d.ts.map +1 -0
  254. package/dist/tag-name.js +222 -0
  255. package/dist/tag-name.js.map +1 -0
  256. package/dist/tar-writer.d.ts +74 -0
  257. package/dist/tar-writer.d.ts.map +1 -0
  258. package/dist/tar-writer.js +148 -0
  259. package/dist/tar-writer.js.map +1 -0
  260. package/dist/testing.d.ts +11 -0
  261. package/dist/testing.d.ts.map +1 -0
  262. package/dist/testing.js +11 -0
  263. package/dist/testing.js.map +1 -0
  264. package/dist/text-codec.d.ts +36 -0
  265. package/dist/text-codec.d.ts.map +1 -0
  266. package/dist/text-codec.js +32 -0
  267. package/dist/text-codec.js.map +1 -0
  268. package/dist/url-value.d.ts +41 -0
  269. package/dist/url-value.d.ts.map +1 -0
  270. package/dist/url-value.js +147 -0
  271. package/dist/url-value.js.map +1 -0
  272. package/dist/usage-guard.d.ts +99 -0
  273. package/dist/usage-guard.d.ts.map +1 -0
  274. package/dist/usage-guard.js +104 -0
  275. package/dist/usage-guard.js.map +1 -0
  276. package/dist/usage-mirror.d.ts +55 -0
  277. package/dist/usage-mirror.d.ts.map +1 -0
  278. package/dist/usage-mirror.js +52 -0
  279. package/dist/usage-mirror.js.map +1 -0
  280. package/dist/value-check.d.ts +88 -0
  281. package/dist/value-check.d.ts.map +1 -0
  282. package/dist/value-check.js +279 -0
  283. package/dist/value-check.js.map +1 -0
  284. package/dist/value-patterns.d.ts +9 -0
  285. package/dist/value-patterns.d.ts.map +1 -0
  286. package/dist/value-patterns.js +17 -0
  287. package/dist/value-patterns.js.map +1 -0
  288. package/dist/value-schema.d.ts +796 -0
  289. package/dist/value-schema.d.ts.map +1 -0
  290. package/dist/value-schema.js +231 -0
  291. package/dist/value-schema.js.map +1 -0
  292. package/dist/zod-free.d.ts +59 -0
  293. package/dist/zod-free.d.ts.map +1 -0
  294. package/dist/zod-free.js +57 -0
  295. package/dist/zod-free.js.map +1 -0
  296. package/package.json +75 -3
  297. package/schema/DEPLOYED +12 -0
  298. package/schema/build-diagnostic.v1.json +63 -0
  299. package/schema/component-manifest.v1.json +1000 -0
  300. package/schema/data-api.v1.json +194 -0
  301. package/schema/library-manifest.v1.json +60 -0
  302. package/schema/published/SHA256SUMS +36 -0
  303. package/schema/published/build-diagnostic/v1.10.json +83 -0
  304. package/schema/published/build-diagnostic/v1.3.json +83 -0
  305. package/schema/published/build-diagnostic/v1.4.json +83 -0
  306. package/schema/published/build-diagnostic/v1.5.json +83 -0
  307. package/schema/published/build-diagnostic/v1.6.json +83 -0
  308. package/schema/published/build-diagnostic/v1.7.json +83 -0
  309. package/schema/published/build-diagnostic/v1.8.json +83 -0
  310. package/schema/published/build-diagnostic/v1.9.json +83 -0
  311. package/schema/published/component-manifest/v1.10.json +1443 -0
  312. package/schema/published/component-manifest/v1.3.json +1411 -0
  313. package/schema/published/component-manifest/v1.4.json +1419 -0
  314. package/schema/published/component-manifest/v1.5.json +1437 -0
  315. package/schema/published/component-manifest/v1.6.json +1437 -0
  316. package/schema/published/component-manifest/v1.7.json +1437 -0
  317. package/schema/published/component-manifest/v1.8.json +1437 -0
  318. package/schema/published/component-manifest/v1.9.json +1437 -0
  319. package/schema/published/data-api/v1.10.json +282 -0
  320. package/schema/published/data-api/v1.3.json +281 -0
  321. package/schema/published/data-api/v1.4.json +281 -0
  322. package/schema/published/data-api/v1.5.json +281 -0
  323. package/schema/published/data-api/v1.6.json +281 -0
  324. package/schema/published/data-api/v1.7.json +281 -0
  325. package/schema/published/data-api/v1.8.json +282 -0
  326. package/schema/published/data-api/v1.9.json +282 -0
  327. package/schema/published/library-manifest/v1.10.json +68 -0
  328. package/schema/published/library-manifest/v1.5.json +68 -0
  329. package/schema/published/library-manifest/v1.6.json +68 -0
  330. package/schema/published/library-manifest/v1.7.json +68 -0
  331. package/schema/published/library-manifest/v1.8.json +68 -0
  332. package/schema/published/library-manifest/v1.9.json +68 -0
  333. package/schema/published/taggor-config/v1.10.json +56 -0
  334. package/schema/published/taggor-config/v1.5.json +56 -0
  335. package/schema/published/taggor-config/v1.6.json +56 -0
  336. package/schema/published/taggor-config/v1.7.json +56 -0
  337. package/schema/published/taggor-config/v1.8.json +56 -0
  338. package/schema/published/taggor-config/v1.9.json +56 -0
  339. package/schema/taggor-config.v1.json +39 -0
@@ -0,0 +1,74 @@
1
+ /**
2
+ * Hostname rules of a site's allowed domains (TAG-601; moved from apps/api to the contract by TAG-702,
3
+ * so the API and the edge share them). Pure, with no imports, so the loader (the
4
+ * browser runtime compares `location.hostname` with the manifest, TAG-615) and the ingest
5
+ * (TAG-702: the `Origin` of a data request) reuse the very same functions.
6
+ *
7
+ * An entry of the list is a hostname (`cliente.com.br`) or a wildcard on its first label only
8
+ * (`*.cliente.com.br`). Entries are stored normalized: lowercase, IDN as punycode (`xn--…`), no
9
+ * `www.` prefix and no trailing dot. A port, a scheme, a path, a userinfo, an IP address (v4, in any
10
+ * spelling the URL parser accepts, or v6) and a wildcard anywhere else are rejected, never
11
+ * "cleaned up": `https://x.com` is a mistake the customer should see, not guess.
12
+ *
13
+ * A plain entry needs at least two labels, except `localhost` (TAG-622): `com` or `www` would name
14
+ * no site. Characters of the Unicode "format" category (`\p{Cf}`: zero-width joiner, soft hyphen,
15
+ * bidi marks) are refused, never dropped silently by the URL parser's UTS 46 mapping, so what the
16
+ * customer typed is what is stored.
17
+ *
18
+ * What it does not know: the public suffix list. `*.com.br` passes this module (it only requires
19
+ * two labels after `*.`); the API refuses it with its committed copy of the list
20
+ * (apps/api/src/domain/sites/public-suffix.ts, `wildcard_public_suffix`), so the visitor side
21
+ * (the loader and the edge, which only match) does not carry the list.
22
+ *
23
+ * The one rule for an EMPTY list lives in `allowsHostname`: every caller (the API's installation
24
+ * status, the edge's loader hits and data ingest) uses it, none writes the check again.
25
+ */
26
+ /** Longest hostname DNS allows, without the trailing dot. */
27
+ export declare const HOSTNAME_MAX_LENGTH = 253;
28
+ /** Why an entry was refused; stable, surfaced in the API's field errors. */
29
+ export declare const DOMAIN_REJECTIONS: readonly ["empty", "has_scheme", "has_port", "has_path", "has_userinfo", "is_ip_address", "invalid_characters", "invalid_label", "too_long", "wildcard_not_first_label", "wildcard_too_broad", "single_label", "wildcard_public_suffix", "localhost_requires_staging"];
30
+ /** One reason of `DOMAIN_REJECTIONS`. */
31
+ export type DomainRejection = (typeof DOMAIN_REJECTIONS)[number];
32
+ /** The outcome of normalizing one entry. */
33
+ export type DomainResult = {
34
+ readonly ok: true;
35
+ readonly value: string;
36
+ } | {
37
+ readonly ok: false;
38
+ readonly reason: DomainRejection;
39
+ };
40
+ /**
41
+ * Normalizes one hostname, for the visitor side: the hostname of the page or of an `Origin`.
42
+ * Inputs: any value. Output: the lowercase punycode hostname (no `www.`, no trailing dot), or
43
+ * `null` for anything that is not a bare hostname (a port, a scheme, an IP address, junk).
44
+ * Errors: never throws. Side effects: none.
45
+ */
46
+ export declare function normalizeHostname(input: unknown): string | null;
47
+ /**
48
+ * Normalizes one entry of a site's allowed domains: a hostname or `*.` and a hostname.
49
+ * Inputs: the text the customer wrote. Output: `{ ok: true, value }` (a wildcard keeps its
50
+ * `*.`; a plain entry loses `www.`) or `{ ok: false, reason }`. A wildcard needs two labels
51
+ * after it (`*.cliente.com.br`), never `*.com`; a plain entry needs two labels (`localhost` aside). Errors: never throws. Side effects: none.
52
+ */
53
+ export declare function normalizeAllowedDomain(input: string): DomainResult;
54
+ /**
55
+ * Whether a hostname is covered by a site's allowed domains.
56
+ * Inputs: the hostname seen (`location.hostname`, the host of an `Origin`: never with a port) and
57
+ * the stored (normalized) entries. Output: true when an entry is the hostname, or its `www.`
58
+ * variant, or is a wildcard `*.base` and the hostname is exactly one label under `base`. A
59
+ * hostname that is not a valid bare hostname (a port, an IP address, junk) matches nothing.
60
+ * An empty list matches nothing: the "empty means any domain on staging" rule belongs to the
61
+ * caller, which knows the environment. Errors: never throws. Side effects: none.
62
+ */
63
+ export declare function matchesAllowedDomain(hostname: unknown, allowedDomains: readonly string[]): boolean;
64
+ /**
65
+ * The one rule of the allowed domains, for every caller that judges a visitor's hostname.
66
+ * Inputs: the hostname seen (never with a port), the stored entries, and the environment (or
67
+ * channel) of the site: `staging` or `production`. Output: true when the hostname matches an entry
68
+ * (`matchesAllowedDomain`); with an EMPTY list, true only for `staging`, so a production site with
69
+ * no domain serves nowhere (TAG-622: this rule had been written three times). Any other
70
+ * environment value, or `null` (unknown), counts as production: it fails closed.
71
+ * Errors: never throws. Side effects: none.
72
+ */
73
+ export declare function allowsHostname(hostname: unknown, allowedDomains: readonly string[], environment: string | null): boolean;
74
+ //# sourceMappingURL=hostname.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hostname.d.ts","sourceRoot":"","sources":["../src/hostname.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,6DAA6D;AAC7D,eAAO,MAAM,mBAAmB,MAAM,CAAC;AAEvC,4EAA4E;AAC5E,eAAO,MAAM,iBAAiB,wQAiBpB,CAAC;AAEX,yCAAyC;AACzC,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEjE,4CAA4C;AAC5C,MAAM,MAAM,YAAY,GACpB;IAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAC7C;IAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAA;CAAE,CAAC;AAsF7D;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAI/D;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY,CAqBlE;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,OAAO,EACjB,cAAc,EAAE,SAAS,MAAM,EAAE,GAChC,OAAO,CAcT;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,OAAO,EACjB,cAAc,EAAE,SAAS,MAAM,EAAE,EACjC,WAAW,EAAE,MAAM,GAAG,IAAI,GACzB,OAAO,CAGT"}
@@ -0,0 +1,215 @@
1
+ /**
2
+ * Hostname rules of a site's allowed domains (TAG-601; moved from apps/api to the contract by TAG-702,
3
+ * so the API and the edge share them). Pure, with no imports, so the loader (the
4
+ * browser runtime compares `location.hostname` with the manifest, TAG-615) and the ingest
5
+ * (TAG-702: the `Origin` of a data request) reuse the very same functions.
6
+ *
7
+ * An entry of the list is a hostname (`cliente.com.br`) or a wildcard on its first label only
8
+ * (`*.cliente.com.br`). Entries are stored normalized: lowercase, IDN as punycode (`xn--…`), no
9
+ * `www.` prefix and no trailing dot. A port, a scheme, a path, a userinfo, an IP address (v4, in any
10
+ * spelling the URL parser accepts, or v6) and a wildcard anywhere else are rejected, never
11
+ * "cleaned up": `https://x.com` is a mistake the customer should see, not guess.
12
+ *
13
+ * A plain entry needs at least two labels, except `localhost` (TAG-622): `com` or `www` would name
14
+ * no site. Characters of the Unicode "format" category (`\p{Cf}`: zero-width joiner, soft hyphen,
15
+ * bidi marks) are refused, never dropped silently by the URL parser's UTS 46 mapping, so what the
16
+ * customer typed is what is stored.
17
+ *
18
+ * What it does not know: the public suffix list. `*.com.br` passes this module (it only requires
19
+ * two labels after `*.`); the API refuses it with its committed copy of the list
20
+ * (apps/api/src/domain/sites/public-suffix.ts, `wildcard_public_suffix`), so the visitor side
21
+ * (the loader and the edge, which only match) does not carry the list.
22
+ *
23
+ * The one rule for an EMPTY list lives in `allowsHostname`: every caller (the API's installation
24
+ * status, the edge's loader hits and data ingest) uses it, none writes the check again.
25
+ */
26
+ /** Longest hostname DNS allows, without the trailing dot. */
27
+ export const HOSTNAME_MAX_LENGTH = 253;
28
+ /** Why an entry was refused; stable, surfaced in the API's field errors. */
29
+ export const DOMAIN_REJECTIONS = [
30
+ "empty",
31
+ "has_scheme",
32
+ "has_port",
33
+ "has_path",
34
+ "has_userinfo",
35
+ "is_ip_address",
36
+ "invalid_characters",
37
+ "invalid_label",
38
+ "too_long",
39
+ "wildcard_not_first_label",
40
+ "wildcard_too_broad",
41
+ // TAG-622. `single_label` is decided here; the two below need the site or the suffix list and
42
+ // are decided by the API, which shares this one vocabulary of reasons.
43
+ "single_label",
44
+ "wildcard_public_suffix",
45
+ "localhost_requires_staging",
46
+ ];
47
+ /** A DNS label in LDH form: letters, digits and inner hyphens, 1 to 63 characters. */
48
+ const LABEL = /^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/;
49
+ /** What no hostname holds: whitespace, controls, and the separators of a URL. */
50
+ const FORBIDDEN = /[\s\u0000-\u001f\u007f%\\<>"'`^{|}[\]]/;
51
+ /** Format characters (`Cf`): invisible, and the URL parser would erase some of them silently. */
52
+ const INVISIBLE_FORMAT = /\p{Cf}/u;
53
+ /**
54
+ * Reason an input is not a bare hostname, or `null`. Looks only at what separates a hostname from
55
+ * a URL or an address, before any parsing.
56
+ */
57
+ function urlLikeReason(input) {
58
+ if (input.includes("://") || /^[a-z][a-z0-9+.-]*:\/\//i.test(input))
59
+ return "has_scheme";
60
+ if (input.includes("@"))
61
+ return "has_userinfo";
62
+ if (/[/?#]/.test(input))
63
+ return "has_path";
64
+ // A colon in what is left is a port (`a.com:80`) or an IPv6 literal (`[::1]` or `::1`).
65
+ if (input.startsWith("[") || input.split(":").length > 2)
66
+ return "is_ip_address";
67
+ if (input.includes(":"))
68
+ return /^[^:]+:\d*$/.test(input) ? "has_port" : "invalid_characters";
69
+ return null;
70
+ }
71
+ /**
72
+ * Lowercases and converts to punycode through the platform's URL parser (UTS #46), which every
73
+ * browser and Worker has. Returns `null` when the parser refuses the host.
74
+ */
75
+ function toAscii(host) {
76
+ // Read from globalThis: the build has no DOM lib (same as url-value.ts), and a missing parser
77
+ // must fail closed.
78
+ const Parser = globalThis.URL;
79
+ if (Parser === undefined)
80
+ return null;
81
+ try {
82
+ const url = new Parser(`http://${host}`);
83
+ // A host the parser had to repair (it dropped a path, a port or userinfo) is not a bare host.
84
+ if (url.pathname !== "/" || url.port !== "" || url.username !== "" || url.password !== "") {
85
+ return null;
86
+ }
87
+ return url.hostname;
88
+ }
89
+ catch {
90
+ return null;
91
+ }
92
+ }
93
+ /**
94
+ * Normalizes a bare hostname (no wildcard).
95
+ * Inputs: any string. Output: `{ ok: true, value }` with the lowercase punycode hostname, one
96
+ * trailing dot and (unless `keepWww`) the leading `www.` removed, or `{ ok: false, reason }`. IP addresses are
97
+ * refused in every spelling (`127.1`, `0x7f.1`, `2130706433`: the URL parser turns them into
98
+ * dotted quads, and a last label that is only digits or starts like a number is refused too).
99
+ * Errors: never throws. Side effects: none.
100
+ */
101
+ function normalizeBareHost(input, keepWww = false) {
102
+ const trimmed = input.trim();
103
+ if (trimmed === "")
104
+ return { ok: false, reason: "empty" };
105
+ const url = urlLikeReason(trimmed);
106
+ if (url !== null)
107
+ return { ok: false, reason: url };
108
+ if (FORBIDDEN.test(trimmed) || INVISIBLE_FORMAT.test(trimmed) || trimmed.includes("*")) {
109
+ return { ok: false, reason: "invalid_characters" };
110
+ }
111
+ const ascii = toAscii(trimmed);
112
+ if (ascii === null)
113
+ return { ok: false, reason: "invalid_characters" };
114
+ const host = ascii.endsWith(".") ? ascii.slice(0, -1) : ascii;
115
+ if (host === "")
116
+ return { ok: false, reason: "empty" };
117
+ if (host.length > HOSTNAME_MAX_LENGTH)
118
+ return { ok: false, reason: "too_long" };
119
+ const labels = host.split(".");
120
+ const last = labels.at(-1) ?? "";
121
+ // `1.2.3.4`, `127.1`, `0x7f.1` and `1e3` end in something a URL parser reads as a number.
122
+ if (/^(?:\d+|0x[0-9a-f]*)$/.test(last))
123
+ return { ok: false, reason: "is_ip_address" };
124
+ if (!labels.every((label) => LABEL.test(label)))
125
+ return { ok: false, reason: "invalid_label" };
126
+ return { ok: true, value: !keepWww && host.startsWith("www.") ? host.slice(4) : host };
127
+ }
128
+ /**
129
+ * Normalizes one hostname, for the visitor side: the hostname of the page or of an `Origin`.
130
+ * Inputs: any value. Output: the lowercase punycode hostname (no `www.`, no trailing dot), or
131
+ * `null` for anything that is not a bare hostname (a port, a scheme, an IP address, junk).
132
+ * Errors: never throws. Side effects: none.
133
+ */
134
+ export function normalizeHostname(input) {
135
+ if (typeof input !== "string")
136
+ return null;
137
+ const result = normalizeBareHost(input);
138
+ return result.ok ? result.value : null;
139
+ }
140
+ /**
141
+ * Normalizes one entry of a site's allowed domains: a hostname or `*.` and a hostname.
142
+ * Inputs: the text the customer wrote. Output: `{ ok: true, value }` (a wildcard keeps its
143
+ * `*.`; a plain entry loses `www.`) or `{ ok: false, reason }`. A wildcard needs two labels
144
+ * after it (`*.cliente.com.br`), never `*.com`; a plain entry needs two labels (`localhost` aside). Errors: never throws. Side effects: none.
145
+ */
146
+ export function normalizeAllowedDomain(input) {
147
+ const trimmed = input.trim();
148
+ if (trimmed.startsWith("*.")) {
149
+ // `www.` is a label like any other under a wildcard: `*.www.x.com` stays as written.
150
+ const rest = trimmed.slice(2);
151
+ if (rest === "")
152
+ return { ok: false, reason: "empty" };
153
+ if (rest.includes("*"))
154
+ return { ok: false, reason: "wildcard_not_first_label" };
155
+ const base = normalizeBareHost(`x.${rest}`);
156
+ if (!base.ok)
157
+ return base;
158
+ // `x.` was prefixed so a leading `www.` of `rest` is not stripped, then it is dropped again.
159
+ const host = base.value.slice(2);
160
+ if (!host.includes("."))
161
+ return { ok: false, reason: "wildcard_too_broad" };
162
+ return { ok: true, value: `*.${host}` };
163
+ }
164
+ if (trimmed.includes("*"))
165
+ return { ok: false, reason: "wildcard_not_first_label" };
166
+ const plain = normalizeBareHost(trimmed);
167
+ // `localhost` stays valid here (a staging site may list it, TAG-622); the API refuses it on production.
168
+ if (plain.ok && !plain.value.includes(".") && plain.value !== "localhost") {
169
+ return { ok: false, reason: "single_label" };
170
+ }
171
+ return plain;
172
+ }
173
+ /**
174
+ * Whether a hostname is covered by a site's allowed domains.
175
+ * Inputs: the hostname seen (`location.hostname`, the host of an `Origin`: never with a port) and
176
+ * the stored (normalized) entries. Output: true when an entry is the hostname, or its `www.`
177
+ * variant, or is a wildcard `*.base` and the hostname is exactly one label under `base`. A
178
+ * hostname that is not a valid bare hostname (a port, an IP address, junk) matches nothing.
179
+ * An empty list matches nothing: the "empty means any domain on staging" rule belongs to the
180
+ * caller, which knows the environment. Errors: never throws. Side effects: none.
181
+ */
182
+ export function matchesAllowedDomain(hostname, allowedDomains) {
183
+ if (typeof hostname !== "string")
184
+ return false;
185
+ const full = normalizeBareHost(hostname, true);
186
+ if (!full.ok)
187
+ return false;
188
+ // `www.cliente.com` is `cliente.com` for a plain entry, but stays whole for a wildcard
189
+ // (`*.cliente.com` covers `www.cliente.com` as one label under the base).
190
+ const plain = full.value.startsWith("www.") ? full.value.slice(4) : full.value;
191
+ return allowedDomains.some((entry) => {
192
+ if (!entry.startsWith("*."))
193
+ return entry === plain;
194
+ const base = entry.slice(2);
195
+ if (!full.value.endsWith(`.${base}`))
196
+ return false;
197
+ const label = full.value.slice(0, full.value.length - base.length - 1);
198
+ return label.length > 0 && !label.includes(".");
199
+ });
200
+ }
201
+ /**
202
+ * The one rule of the allowed domains, for every caller that judges a visitor's hostname.
203
+ * Inputs: the hostname seen (never with a port), the stored entries, and the environment (or
204
+ * channel) of the site: `staging` or `production`. Output: true when the hostname matches an entry
205
+ * (`matchesAllowedDomain`); with an EMPTY list, true only for `staging`, so a production site with
206
+ * no domain serves nowhere (TAG-622: this rule had been written three times). Any other
207
+ * environment value, or `null` (unknown), counts as production: it fails closed.
208
+ * Errors: never throws. Side effects: none.
209
+ */
210
+ export function allowsHostname(hostname, allowedDomains, environment) {
211
+ if (allowedDomains.length === 0)
212
+ return environment === "staging";
213
+ return matchesAllowedDomain(hostname, allowedDomains);
214
+ }
215
+ //# sourceMappingURL=hostname.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hostname.js","sourceRoot":"","sources":["../src/hostname.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,6DAA6D;AAC7D,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,CAAC;AAEvC,4EAA4E;AAC5E,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,OAAO;IACP,YAAY;IACZ,UAAU;IACV,UAAU;IACV,cAAc;IACd,eAAe;IACf,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;;;;;;;;GAQG;AACH,MAAM,UAAU,cAAc,CAC5B,QAAiB,EACjB,cAAiC,EACjC,WAA0B;IAE1B,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,WAAW,KAAK,SAAS,CAAC;IAClE,OAAO,oBAAoB,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;AACxD,CAAC"}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * The human-only actions (TAG-1110, decision 73): what a customer's agent must never do and must
3
+ * hand to the person. Credentials (create and revoke API keys and tokens), payment, legal
4
+ * acceptance (terms, DPA), deleting the workspace and changing its owner, and (TAG-1132) inviting
5
+ * someone as owner or admin, which is a way to hand over the workspace, and adding a notification recipient from outside the
6
+ * workspace, which sends visitors' submissions to a stranger. Everything else the
7
+ * agent does without asking.
8
+ *
9
+ * This is the single list. The API answers `403 human_action_required` from it (naming the action,
10
+ * the exact portal page and the steps, en and pt-BR); the CLI and the MCP relay what the API says;
11
+ * the agent guides quote the same ids. `apps/web` tests every `portalPath` against the portal's
12
+ * generated route tree, so renaming a screen fails a test instead of sending an agent to a dead
13
+ * page. Zod-free and pure. Steps name screens and buttons only: never a key, a token or a secret.
14
+ */
15
+ import type { LocalizedText } from "./prop-type-docs.js";
16
+ /** Every human-only action id, in the order the docs list them. */
17
+ export declare const HUMAN_ONLY_ACTION_IDS: readonly ["api_key_create", "api_key_revoke", "billing", "terms_acceptance", "dpa_acceptance", "workspace_delete", "owner_transfer", "privileged_invitation", "external_notification_recipient", "oauth_consent", "oauth_grant_revoke", "device_approval"];
18
+ /** One human-only action id. */
19
+ export type HumanOnlyActionId = (typeof HUMAN_ONLY_ACTION_IDS)[number];
20
+ /** Where and how a person does one human-only action. */
21
+ export interface HumanOnlyAction {
22
+ readonly id: HumanOnlyActionId;
23
+ /** What the action is, one short phrase. */
24
+ readonly title: LocalizedText;
25
+ /**
26
+ * The portal page, as a path with `{workspaceSlug}` where the workspace's slug goes (the
27
+ * `$workspaceSlug` segment of the portal's route). Always a route that exists in `apps/web`.
28
+ */
29
+ readonly portalPath: string;
30
+ /** The steps the person follows there, in order. */
31
+ readonly steps: {
32
+ readonly en: readonly string[];
33
+ readonly "pt-BR": readonly string[];
34
+ };
35
+ }
36
+ /** The catalog, keyed by id. */
37
+ export declare const HUMAN_ONLY_ACTIONS: Readonly<Record<HumanOnlyActionId, HumanOnlyAction>>;
38
+ /**
39
+ * Whether a string is a human-only action id. Inputs: anything. Output: a type guard. Errors:
40
+ * none. Side effects: none.
41
+ */
42
+ export declare function isHumanOnlyActionId(value: unknown): value is HumanOnlyActionId;
43
+ /**
44
+ * The portal path of a human-only action for a workspace.
45
+ * Inputs: the id and, when known, the workspace slug. Output: the path with the slug filled in, or
46
+ * the template with `{workspaceSlug}` when the slug is unknown. Errors: none. Side effects: none.
47
+ */
48
+ export declare function humanActionPortalPath(id: HumanOnlyActionId, workspaceSlug?: string): string;
49
+ //# sourceMappingURL=human-actions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"human-actions.d.ts","sourceRoot":"","sources":["../src/human-actions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,mEAAmE;AACnE,eAAO,MAAM,qBAAqB,4PAaxB,CAAC;AAEX,gCAAgC;AAChC,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEvE,yDAAyD;AACzD,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,EAAE,iBAAiB,CAAC;IAC/B,4CAA4C;IAC5C,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;IAC9B;;;OAGG;IACH,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,oDAAoD;IACpD,QAAQ,CAAC,KAAK,EAAE;QAAE,QAAQ,CAAC,EAAE,EAAE,SAAS,MAAM,EAAE,CAAC;QAAC,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAA;KAAE,CAAC;CACzF;AAQD,gCAAgC;AAChC,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,MAAM,CAAC,iBAAiB,EAAE,eAAe,CAAC,CAuOnF,CAAC;AAEF;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,iBAAiB,CAE9E;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,EAAE,EAAE,iBAAiB,EAAE,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,CAK3F"}
@@ -0,0 +1,272 @@
1
+ /** Every human-only action id, in the order the docs list them. */
2
+ export const HUMAN_ONLY_ACTION_IDS = [
3
+ "api_key_create",
4
+ "api_key_revoke",
5
+ "billing",
6
+ "terms_acceptance",
7
+ "dpa_acceptance",
8
+ "workspace_delete",
9
+ "owner_transfer",
10
+ "privileged_invitation",
11
+ "external_notification_recipient",
12
+ "oauth_consent",
13
+ "oauth_grant_revoke",
14
+ "device_approval",
15
+ ];
16
+ const WORKSPACE_SETTINGS = "/w/{workspaceSlug}/settings/workspace";
17
+ const API_KEYS = "/w/{workspaceSlug}/settings/api-keys";
18
+ const BILLING = "/w/{workspaceSlug}/settings/billing";
19
+ const LEGAL = "/w/{workspaceSlug}/settings/legal";
20
+ const CONNECTED_AGENTS = "/w/{workspaceSlug}/settings/connected-agents";
21
+ /** The catalog, keyed by id. */
22
+ export const HUMAN_ONLY_ACTIONS = {
23
+ api_key_create: {
24
+ id: "api_key_create",
25
+ title: { en: "Create an API key or token", "pt-BR": "Criar uma chave de API ou token" },
26
+ portalPath: API_KEYS,
27
+ steps: {
28
+ en: [
29
+ "Sign in to the portal and open the workspace.",
30
+ "Open Settings, then API keys.",
31
+ "Choose Create key, name it and pick the smallest set of scopes it needs.",
32
+ "Copy the key once, when it is shown, into the tool that needs it; do not paste it into a chat.",
33
+ ],
34
+ "pt-BR": [
35
+ "Entre no portal e abra o workspace.",
36
+ "Abra Configurações e depois Chaves de API.",
37
+ "Escolha Criar chave, dê um nome e marque só os escopos de que ela precisa.",
38
+ "Copie a chave uma vez, quando ela aparecer, para a ferramenta que a usa; não a cole em um chat.",
39
+ ],
40
+ },
41
+ },
42
+ api_key_revoke: {
43
+ id: "api_key_revoke",
44
+ title: { en: "Revoke an API key or token", "pt-BR": "Revogar uma chave de API ou token" },
45
+ portalPath: API_KEYS,
46
+ steps: {
47
+ en: [
48
+ "Sign in to the portal and open the workspace.",
49
+ "Open Settings, then API keys.",
50
+ "Find the key in the list and choose Revoke; it stops working at once.",
51
+ ],
52
+ "pt-BR": [
53
+ "Entre no portal e abra o workspace.",
54
+ "Abra Configurações e depois Chaves de API.",
55
+ "Ache a chave na lista e escolha Revogar; ela para de funcionar na hora.",
56
+ ],
57
+ },
58
+ },
59
+ billing: {
60
+ id: "billing",
61
+ title: {
62
+ en: "Pay, change the plan or manage payment methods",
63
+ "pt-BR": "Pagar, trocar de plano ou gerenciar meios de pagamento",
64
+ },
65
+ portalPath: BILLING,
66
+ steps: {
67
+ en: [
68
+ "Sign in to the portal as an owner or admin of the workspace and open the workspace.",
69
+ "Open Settings, then Plan and billing.",
70
+ "Do the change there (checkout, billing portal or payment method); Taggor never takes payment from an agent.",
71
+ ],
72
+ "pt-BR": [
73
+ "Entre no portal como dono ou admin do workspace e abra o workspace.",
74
+ "Abra Configurações e depois Plano e cobrança.",
75
+ "Faça a mudança ali (checkout, portal de cobrança ou meio de pagamento); a Taggor nunca recebe pagamento por um agente.",
76
+ ],
77
+ },
78
+ },
79
+ terms_acceptance: {
80
+ id: "terms_acceptance",
81
+ title: {
82
+ en: "Accept the Terms and Privacy Policy",
83
+ "pt-BR": "Aceitar os Termos e a Política de Privacidade",
84
+ },
85
+ portalPath: "/accept-terms",
86
+ steps: {
87
+ en: [
88
+ "Sign in to the portal; the acceptance page opens when a version needs your acceptance.",
89
+ "Read the Terms and the Privacy Policy shown.",
90
+ "Choose Accept. Only a person can accept legal terms.",
91
+ ],
92
+ "pt-BR": [
93
+ "Entre no portal; a página de aceite abre quando uma versão precisa do seu aceite.",
94
+ "Leia os Termos e a Política de Privacidade mostrados.",
95
+ "Escolha Aceitar. Só uma pessoa pode aceitar termos legais.",
96
+ ],
97
+ },
98
+ },
99
+ dpa_acceptance: {
100
+ id: "dpa_acceptance",
101
+ title: {
102
+ en: "Accept the Data Processing Agreement (DPA)",
103
+ "pt-BR": "Aceitar o Acordo de Tratamento de Dados (DPA)",
104
+ },
105
+ portalPath: LEGAL,
106
+ steps: {
107
+ en: [
108
+ "Sign in to the portal as the workspace owner and open the workspace.",
109
+ "Open Settings, then Legal (DPA).",
110
+ "Read the DPA shown and choose Accept. Only a person can accept it.",
111
+ ],
112
+ "pt-BR": [
113
+ "Entre no portal como dono do workspace e abra o workspace.",
114
+ "Abra Configurações e depois Jurídico (DPA).",
115
+ "Leia o DPA mostrado e escolha Aceitar. Só uma pessoa pode aceitá-lo.",
116
+ ],
117
+ },
118
+ },
119
+ workspace_delete: {
120
+ id: "workspace_delete",
121
+ title: { en: "Delete the workspace", "pt-BR": "Apagar o workspace" },
122
+ portalPath: WORKSPACE_SETTINGS,
123
+ steps: {
124
+ en: [
125
+ "Sign in to the portal as the workspace owner and open the workspace.",
126
+ "Open Settings, then Workspace, and go to the Delete workspace section.",
127
+ "Read what is lost, type the workspace's slug and confirm. Nothing is deleted before the grace period ends and you can cancel until then.",
128
+ ],
129
+ "pt-BR": [
130
+ "Entre no portal como dono do workspace e abra o workspace.",
131
+ "Abra Configurações, depois Workspace, e vá à seção Apagar o workspace.",
132
+ "Leia o que se perde, digite o slug do workspace e confirme. Nada é apagado antes de acabar a carência e você pode cancelar até lá.",
133
+ ],
134
+ },
135
+ },
136
+ owner_transfer: {
137
+ id: "owner_transfer",
138
+ title: { en: "Change the workspace owner", "pt-BR": "Trocar o dono do workspace" },
139
+ portalPath: WORKSPACE_SETTINGS,
140
+ steps: {
141
+ en: [
142
+ "Sign in to the portal as the current owner and open the workspace.",
143
+ "Open Settings, then Workspace, and go to the Owner section.",
144
+ "Pick the new owner among the members and offer it; they must accept from the e-mail link, signed in, and you become an admin.",
145
+ ],
146
+ "pt-BR": [
147
+ "Entre no portal como dono atual e abra o workspace.",
148
+ "Abra Configurações, depois Workspace, e vá à seção Dono.",
149
+ "Escolha o novo dono entre os membros e ofereça; a pessoa precisa aceitar pelo link do e-mail, com login, e você vira admin.",
150
+ ],
151
+ },
152
+ },
153
+ privileged_invitation: {
154
+ id: "privileged_invitation",
155
+ title: {
156
+ en: "Invite someone as owner or admin",
157
+ "pt-BR": "Convidar alguém como dono ou admin",
158
+ },
159
+ portalPath: "/w/{workspaceSlug}/settings/members",
160
+ steps: {
161
+ en: [
162
+ "Sign in to the portal as an owner or admin and open the workspace.",
163
+ "Open Settings, then Members.",
164
+ "Choose Invite, type the address, pick the owner or admin role and send it. An agent can only invite members and viewers.",
165
+ ],
166
+ "pt-BR": [
167
+ "Entre no portal como dono ou admin e abra o workspace.",
168
+ "Abra Configurações e depois Membros.",
169
+ "Escolha Convidar, digite o endereço, marque o papel de dono ou admin e envie. Um agente só convida membros e leitores.",
170
+ ],
171
+ },
172
+ },
173
+ external_notification_recipient: {
174
+ id: "external_notification_recipient",
175
+ title: {
176
+ en: "Add a notification recipient outside the workspace",
177
+ "pt-BR": "Adicionar um destinatário de avisos de fora do workspace",
178
+ },
179
+ portalPath: "/w/{workspaceSlug}/data",
180
+ steps: {
181
+ en: [
182
+ "Sign in to the portal and open the workspace.",
183
+ "Open Data and choose the collection.",
184
+ "Open its notification settings and add the address; it gets one confirmation e-mail and receives nothing until it confirms. An agent can only notify members of the workspace.",
185
+ ],
186
+ "pt-BR": [
187
+ "Entre no portal e abra o workspace.",
188
+ "Abra Dados e escolha a coleção.",
189
+ "Abra os avisos por e-mail dela e adicione o endereço; ele recebe um e-mail de confirmação e não recebe nada até confirmar. Um agente só avisa membros do workspace.",
190
+ ],
191
+ },
192
+ },
193
+ oauth_consent: {
194
+ id: "oauth_consent",
195
+ title: {
196
+ en: "Let an agent or app connect to the workspace (consent)",
197
+ "pt-BR": "Deixar um agente ou app se conectar ao workspace (consentimento)",
198
+ },
199
+ portalPath: "/oauth/consent",
200
+ steps: {
201
+ en: [
202
+ "Open the consent page the connecting app sent you to, signed in to the portal.",
203
+ "Read the app's name and the access it asks for, and pick the workspace.",
204
+ "Choose Approve, or Deny if you do not recognize it.",
205
+ ],
206
+ "pt-BR": [
207
+ "Abra a página de consentimento para onde o app que está conectando enviou você, com login no portal.",
208
+ "Leia o nome do app e o acesso que ele pede, e escolha o workspace.",
209
+ "Escolha Aprovar, ou Negar se não reconhecer.",
210
+ ],
211
+ },
212
+ },
213
+ oauth_grant_revoke: {
214
+ id: "oauth_grant_revoke",
215
+ title: {
216
+ en: "Revoke the access of a connected agent",
217
+ "pt-BR": "Revogar o acesso de um agente conectado",
218
+ },
219
+ portalPath: CONNECTED_AGENTS,
220
+ steps: {
221
+ en: [
222
+ "Sign in to the portal and open the workspace.",
223
+ "Open Settings, then Connected agents.",
224
+ "Find the agent in the list and choose Revoke; its access stops at its next request.",
225
+ ],
226
+ "pt-BR": [
227
+ "Entre no portal e abra o workspace.",
228
+ "Abra Configurações e depois Agentes conectados.",
229
+ "Ache o agente na lista e escolha Revogar; o acesso dele para na próxima requisição.",
230
+ ],
231
+ },
232
+ },
233
+ device_approval: {
234
+ id: "device_approval",
235
+ title: {
236
+ en: "Approve a command line login (device request)",
237
+ "pt-BR": "Aprovar um login da linha de comando (pedido de dispositivo)",
238
+ },
239
+ portalPath: "/device",
240
+ steps: {
241
+ en: [
242
+ "Open the device page in the portal, signed in.",
243
+ "Type the code the command line shows and check it matches.",
244
+ "Pick the workspace and choose Approve, or Deny if you did not start it.",
245
+ ],
246
+ "pt-BR": [
247
+ "Abra a página de dispositivo no portal, com login.",
248
+ "Digite o código que a linha de comando mostra e confira se é o mesmo.",
249
+ "Escolha o workspace e Aprovar, ou Negar se não foi você quem iniciou.",
250
+ ],
251
+ },
252
+ },
253
+ };
254
+ /**
255
+ * Whether a string is a human-only action id. Inputs: anything. Output: a type guard. Errors:
256
+ * none. Side effects: none.
257
+ */
258
+ export function isHumanOnlyActionId(value) {
259
+ return typeof value === "string" && HUMAN_ONLY_ACTION_IDS.includes(value);
260
+ }
261
+ /**
262
+ * The portal path of a human-only action for a workspace.
263
+ * Inputs: the id and, when known, the workspace slug. Output: the path with the slug filled in, or
264
+ * the template with `{workspaceSlug}` when the slug is unknown. Errors: none. Side effects: none.
265
+ */
266
+ export function humanActionPortalPath(id, workspaceSlug) {
267
+ const { portalPath } = HUMAN_ONLY_ACTIONS[id];
268
+ return workspaceSlug === undefined
269
+ ? portalPath
270
+ : portalPath.replace("{workspaceSlug}", encodeURIComponent(workspaceSlug));
271
+ }
272
+ //# sourceMappingURL=human-actions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"human-actions.js","sourceRoot":"","sources":["../src/human-actions.ts"],"names":[],"mappings":"AAgBA,mEAAmE;AACnE,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,gBAAgB;IAChB,gBAAgB;IAChB,SAAS;IACT,kBAAkB;IAClB,gBAAgB;IAChB,kBAAkB;IAClB,gBAAgB;IAChB,uBAAuB;IACvB,iCAAiC;IACjC,eAAe;IACf,oBAAoB;IACpB,iBAAiB;CACT,CAAC;AAmBX,MAAM,kBAAkB,GAAG,uCAAuC,CAAC;AACnE,MAAM,QAAQ,GAAG,sCAAsC,CAAC;AACxD,MAAM,OAAO,GAAG,qCAAqC,CAAC;AACtD,MAAM,KAAK,GAAG,mCAAmC,CAAC;AAClD,MAAM,gBAAgB,GAAG,8CAA8C,CAAC;AAExE,gCAAgC;AAChC,MAAM,CAAC,MAAM,kBAAkB,GAAyD;IACtF,cAAc,EAAE;QACd,EAAE,EAAE,gBAAgB;QACpB,KAAK,EAAE,EAAE,EAAE,EAAE,4BAA4B,EAAE,OAAO,EAAE,iCAAiC,EAAE;QACvF,UAAU,EAA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