@conloca/cloud-astro 0.2.1 → 0.2.3

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 (181) hide show
  1. package/README.md +261 -207
  2. package/dist/.build-inputs.json +60 -0
  3. package/dist/src/component-manifest.d.ts +5 -3
  4. package/dist/src/component-manifest.d.ts.map +1 -1
  5. package/dist/src/component-manifest.js +7 -7
  6. package/dist/src/component-manifest.js.map +1 -1
  7. package/dist/src/constants.d.ts +5 -13
  8. package/dist/src/constants.d.ts.map +1 -1
  9. package/dist/src/constants.js +5 -13
  10. package/dist/src/constants.js.map +1 -1
  11. package/dist/src/descriptors.d.ts +2 -2
  12. package/dist/src/descriptors.d.ts.map +1 -1
  13. package/dist/src/doctor/checks-address.d.ts +18 -0
  14. package/dist/src/doctor/checks-address.d.ts.map +1 -0
  15. package/dist/src/doctor/checks-address.js +163 -0
  16. package/dist/src/doctor/checks-address.js.map +1 -0
  17. package/dist/src/doctor/checks-live.d.ts +8 -5
  18. package/dist/src/doctor/checks-live.d.ts.map +1 -1
  19. package/dist/src/doctor/checks-live.js +220 -188
  20. package/dist/src/doctor/checks-live.js.map +1 -1
  21. package/dist/src/doctor/checks-offline.d.ts +8 -23
  22. package/dist/src/doctor/checks-offline.d.ts.map +1 -1
  23. package/dist/src/doctor/checks-offline.js +22 -239
  24. package/dist/src/doctor/checks-offline.js.map +1 -1
  25. package/dist/src/doctor/config-scan.d.ts +6 -3
  26. package/dist/src/doctor/config-scan.d.ts.map +1 -1
  27. package/dist/src/doctor/config-scan.js +21 -11
  28. package/dist/src/doctor/config-scan.js.map +1 -1
  29. package/dist/src/doctor/run.d.ts.map +1 -1
  30. package/dist/src/doctor/run.js +12 -10
  31. package/dist/src/doctor/run.js.map +1 -1
  32. package/dist/src/doctor/types.d.ts +7 -7
  33. package/dist/src/doctor/types.d.ts.map +1 -1
  34. package/dist/src/doctor/types.js +7 -7
  35. package/dist/src/doctor/types.js.map +1 -1
  36. package/dist/src/editor-page/bundle.d.ts +88 -0
  37. package/dist/src/editor-page/bundle.d.ts.map +1 -0
  38. package/dist/src/editor-page/bundle.js +370 -0
  39. package/dist/src/editor-page/bundle.js.map +1 -0
  40. package/dist/src/editor-page/emit.d.ts +33 -0
  41. package/dist/src/editor-page/emit.d.ts.map +1 -0
  42. package/dist/src/editor-page/emit.js +183 -0
  43. package/dist/src/editor-page/emit.js.map +1 -0
  44. package/dist/src/editor-page/framing.d.ts +23 -0
  45. package/dist/src/editor-page/framing.d.ts.map +1 -0
  46. package/dist/src/editor-page/framing.js +39 -0
  47. package/dist/src/editor-page/framing.js.map +1 -0
  48. package/dist/src/editor-page/page.d.ts +9 -0
  49. package/dist/src/editor-page/page.d.ts.map +1 -0
  50. package/dist/src/editor-page/page.js +31 -0
  51. package/dist/src/editor-page/page.js.map +1 -0
  52. package/dist/src/editor-page/site-base.d.ts +4 -0
  53. package/dist/src/editor-page/site-base.d.ts.map +1 -0
  54. package/dist/src/editor-page/site-base.js +13 -0
  55. package/dist/src/editor-page/site-base.js.map +1 -0
  56. package/dist/src/git.d.ts +11 -8
  57. package/dist/src/git.d.ts.map +1 -1
  58. package/dist/src/git.js +25 -8
  59. package/dist/src/git.js.map +1 -1
  60. package/dist/src/index.d.ts +3 -1
  61. package/dist/src/index.d.ts.map +1 -1
  62. package/dist/src/index.js +9 -6
  63. package/dist/src/index.js.map +1 -1
  64. package/dist/src/integration.d.ts +1 -1
  65. package/dist/src/integration.d.ts.map +1 -1
  66. package/dist/src/integration.js +245 -396
  67. package/dist/src/integration.js.map +1 -1
  68. package/dist/src/node.d.ts +3 -1
  69. package/dist/src/node.d.ts.map +1 -1
  70. package/dist/src/node.js +7 -2
  71. package/dist/src/node.js.map +1 -1
  72. package/dist/src/preview/_dispatch.d.ts +5 -2
  73. package/dist/src/preview/_dispatch.d.ts.map +1 -1
  74. package/dist/src/preview/_dispatch.js +2 -0
  75. package/dist/src/preview/_dispatch.js.map +1 -1
  76. package/dist/src/preview/_resolve-opts.d.ts +18 -10
  77. package/dist/src/preview/_resolve-opts.d.ts.map +1 -1
  78. package/dist/src/preview/_resolve-opts.js +24 -10
  79. package/dist/src/preview/_resolve-opts.js.map +1 -1
  80. package/dist/src/preview/banner.d.ts.map +1 -1
  81. package/dist/src/preview/banner.js +2 -4
  82. package/dist/src/preview/banner.js.map +1 -1
  83. package/dist/src/preview/cookie.d.ts +5 -2
  84. package/dist/src/preview/cookie.d.ts.map +1 -1
  85. package/dist/src/preview/cookie.js +5 -2
  86. package/dist/src/preview/cookie.js.map +1 -1
  87. package/dist/src/preview/label.d.ts +8 -0
  88. package/dist/src/preview/label.d.ts.map +1 -0
  89. package/dist/src/preview/label.js +14 -0
  90. package/dist/src/preview/label.js.map +1 -0
  91. package/dist/src/preview/landing.d.ts +2 -2
  92. package/dist/src/preview/landing.js +2 -2
  93. package/dist/src/preview/middleware.d.ts +31 -20
  94. package/dist/src/preview/middleware.d.ts.map +1 -1
  95. package/dist/src/preview/middleware.js +56 -51
  96. package/dist/src/preview/middleware.js.map +1 -1
  97. package/dist/src/preview/preview-path.d.ts +18 -5
  98. package/dist/src/preview/preview-path.d.ts.map +1 -1
  99. package/dist/src/preview/preview-path.js +24 -8
  100. package/dist/src/preview/preview-path.js.map +1 -1
  101. package/dist/src/preview/site-middleware.d.ts +5 -5
  102. package/dist/src/preview/site-middleware.d.ts.map +1 -1
  103. package/dist/src/preview/site-middleware.js +17 -16
  104. package/dist/src/preview/site-middleware.js.map +1 -1
  105. package/dist/src/preview-build.d.ts +18 -15
  106. package/dist/src/preview-build.d.ts.map +1 -1
  107. package/dist/src/preview-build.js +36 -21
  108. package/dist/src/preview-build.js.map +1 -1
  109. package/dist/src/preview.d.ts +1 -1
  110. package/dist/src/preview.d.ts.map +1 -1
  111. package/dist/src/preview.js +1 -1
  112. package/dist/src/preview.js.map +1 -1
  113. package/dist/src/repository.d.ts +1 -1
  114. package/dist/src/repository.js +1 -1
  115. package/dist/src/resolve-options.d.ts +17 -0
  116. package/dist/src/resolve-options.d.ts.map +1 -0
  117. package/dist/src/resolve-options.js +21 -0
  118. package/dist/src/resolve-options.js.map +1 -0
  119. package/dist/src/site-id.d.ts +0 -2
  120. package/dist/src/site-id.d.ts.map +1 -1
  121. package/dist/src/site-id.js +2 -3
  122. package/dist/src/site-id.js.map +1 -1
  123. package/dist/src/types.d.ts +21 -59
  124. package/dist/src/types.d.ts.map +1 -1
  125. package/package.json +44 -15
  126. package/src/component-manifest.ts +11 -8
  127. package/src/constants.ts +5 -14
  128. package/src/descriptors.ts +2 -2
  129. package/src/doctor/checks-address.ts +190 -0
  130. package/src/doctor/checks-live.ts +256 -268
  131. package/src/doctor/checks-offline.ts +24 -262
  132. package/src/doctor/config-scan.ts +21 -9
  133. package/src/doctor/run.ts +14 -16
  134. package/src/doctor/types.ts +7 -7
  135. package/src/editor-page/bundle.ts +482 -0
  136. package/src/editor-page/emit.ts +246 -0
  137. package/src/editor-page/framing.ts +62 -0
  138. package/src/editor-page/page.ts +37 -0
  139. package/src/editor-page/site-base.ts +11 -0
  140. package/src/git.ts +29 -10
  141. package/src/index.ts +20 -6
  142. package/src/integration.ts +255 -449
  143. package/src/node.ts +18 -2
  144. package/src/preview/_dispatch.ts +6 -2
  145. package/src/preview/_resolve-opts.ts +34 -11
  146. package/src/preview/banner.ts +2 -4
  147. package/src/preview/cookie.ts +5 -2
  148. package/src/preview/label.ts +12 -0
  149. package/src/preview/landing.ts +2 -2
  150. package/src/preview/middleware.ts +83 -66
  151. package/src/preview/preview-path.ts +26 -8
  152. package/src/preview/site-middleware.ts +17 -21
  153. package/src/preview-build.ts +42 -26
  154. package/src/preview-handler.astro +10 -8
  155. package/src/preview.ts +0 -1
  156. package/src/repository.ts +1 -1
  157. package/src/resolve-options.ts +37 -0
  158. package/src/site-id.ts +2 -4
  159. package/src/skill/SKILL.md +51 -55
  160. package/src/types.ts +21 -60
  161. package/src/virtual-modules.d.ts +5 -1
  162. package/dist/src/build-commit.d.ts +0 -19
  163. package/dist/src/build-commit.d.ts.map +0 -1
  164. package/dist/src/build-commit.js +0 -6
  165. package/dist/src/build-commit.js.map +0 -1
  166. package/dist/src/bundle.d.ts +0 -173
  167. package/dist/src/bundle.d.ts.map +0 -1
  168. package/dist/src/bundle.js +0 -413
  169. package/dist/src/bundle.js.map +0 -1
  170. package/dist/src/discovery.d.ts +0 -58
  171. package/dist/src/discovery.d.ts.map +0 -1
  172. package/dist/src/discovery.js +0 -133
  173. package/dist/src/discovery.js.map +0 -1
  174. package/dist/src/register.d.ts +0 -98
  175. package/dist/src/register.d.ts.map +0 -1
  176. package/dist/src/register.js +0 -103
  177. package/dist/src/register.js.map +0 -1
  178. package/src/build-commit.ts +0 -22
  179. package/src/bundle.ts +0 -563
  180. package/src/discovery.ts +0 -183
  181. package/src/register.ts +0 -180
@@ -1,229 +1,261 @@
1
- import { PACKAGE_NAME } from '../constants.js';
2
- import { resolveBuildRef, resolveRepositoryUri } from '../git.js';
1
+ import { classifyEditorHostResponse, classifyFrameHeaders, EDITOR_HOST_PROTOCOL, EDITOR_PAGE_PATH, editorUiOrigin, isFromVercel, parentRoot, } from '@conloca/content-api/editor-host';
3
2
  import { messageOf } from '../message-of.js';
4
3
  import { resolveBuildSiteId } from '../site-id.js';
5
- import { ENDPOINT_ENV_VAR, INTEGRATION_NOT_CALLED, suppliedBuildToken, suppliedEndpoint } from './checks-offline.js';
4
+ import { INTEGRATION_NOT_CALLED, suppliedEndpoint } from './checks-offline.js';
6
5
  import { optionLiteral } from './config-scan.js';
7
6
  import { outcomeOf, skipped, } from './types.js';
8
- const LIVE_CHECK_IDS = ['CC5', 'CC6', 'CC7'];
7
+ const LIVE_CHECK_IDS = ['CC11', 'CC12', 'CC13'];
9
8
  /** Every doctor request is bounded: a hanging host must never hang `conloca doctor` (the CLI seam has no timer of its own). */
10
9
  const REQUEST_TIMEOUT_MS = 10_000;
11
- /** Version strings come from whatever build registered; only a value shaped like a version reaches the terminal. */
12
- const VERSION_SHAPE = /^[0-9A-Za-z.+-]{1,64}$/;
13
- function builtWithNote(value) {
14
- return typeof value === 'string' && VERSION_SHAPE.test(value) ? ` (built with ${PACKAGE_NAME} ${value})` : '';
15
- }
10
+ /** The server probe's conloca.json cap; a longer answer reads as `invalid` here as there. */
11
+ const CONLOCA_JSON_CAP_BYTES = 16 * 1024;
12
+ /** CC11 judges everything but the protocol; CC13 holds that against the range the editor publishes. */
13
+ const ANY_PROTOCOL = { min: Number.NEGATIVE_INFINITY, max: Number.POSITIVE_INFINITY };
16
14
  const skipAll = (reason) => LIVE_CHECK_IDS.map((id) => skipped(id, reason));
17
- function isStatusRegistration(value) {
18
- if (typeof value !== 'object' || value === null)
19
- return false;
20
- const row = value;
21
- return (typeof row.branch === 'string' &&
22
- typeof row.gitSha === 'string' &&
23
- typeof row.editorBundleUrl === 'string' &&
24
- typeof row.registeredAt === 'number' &&
25
- (row.siteId === null || typeof row.siteId === 'string') &&
26
- (row.parked === undefined || typeof row.parked === 'boolean') &&
27
- (row.clientVersion === undefined || row.clientVersion === null || typeof row.clientVersion === 'string'));
28
- }
29
- /** Every field the checks read, so an endpoint drift fails CC5 loudly instead of surfacing as a broken CC6/CC7. */
30
- function isStatusResponse(value) {
31
- if (typeof value !== 'object' || value === null)
32
- return false;
33
- const body = value;
34
- return ((body.defaultBranch === null || typeof body.defaultBranch === 'string') &&
35
- Array.isArray(body.registrations) &&
36
- body.registrations.every(isStatusRegistration));
37
- }
38
- function statusFailed(outcome, message, skipReason) {
39
- outcome.problems.push({ check: 'CC5', level: 'error', message });
40
- return { outcome, skipReason };
41
- }
42
- /**
43
- * CC5 — GET the status route with the token, joining the path exactly as the
44
- * build does (register.ts) so --live reproduces the build's own request. 200
45
- * and 401 both prove reachability; only 200 yields rows.
46
- */
47
- async function probeStatus(fetchFn, target) {
48
- const outcome = outcomeOf('CC5');
49
- const url = `${target.endpoint}/api/v1/registrations/status?repoUri=${encodeURIComponent(target.repoUri)}`;
50
- let response;
15
+ /** GET with no credential and no followed redirect: the answer the server's probe would see. */
16
+ async function request(fetchFn, url) {
51
17
  try {
52
- response = await fetchFn(url, {
53
- headers: { authorization: `Bearer ${target.token}` },
18
+ return await fetchFn(url, {
19
+ method: 'GET',
20
+ redirect: 'manual',
21
+ credentials: 'omit',
54
22
  signal: AbortSignal.timeout(REQUEST_TIMEOUT_MS),
55
23
  });
56
24
  }
57
25
  catch (error) {
58
- return statusFailed(outcome, `endpoint ${target.endpoint} is unreachable (${messageOf(error)}) — check the endpoint option and network access from this machine`, 'the endpoint is unreachable');
26
+ return new Error(messageOf(error));
59
27
  }
60
- if (response.status === 401) {
61
- return statusFailed(outcome, 'the build token is rejected by the endpoint — most likely rotated (a new token invalidates the old one); create a new token and update the CI secret — or the endpoint predates the registration status route, in which case update the endpoint first', 'the endpoint rejected the build token');
28
+ }
29
+ /** A 200 body as text when it fits in `CONLOCA_JSON_CAP_BYTES`, else null; reading stops at the cap, as the probe's does. */
30
+ async function cappedText(answer) {
31
+ if (answer.status !== 200) {
32
+ await answer.body?.cancel().catch(() => { });
33
+ return null;
62
34
  }
63
- if (response.status === 403) {
64
- return statusFailed(outcome, `the token does not cover ${target.repoUri} — give the endpoint access to that repository or fix repoUri`, 'the repository is not covered by the token');
35
+ const chunks = [];
36
+ let size = 0;
37
+ // Leaving the loop early cancels the stream.
38
+ for await (const chunk of answer.body ?? []) {
39
+ size += chunk.byteLength;
40
+ if (size > CONLOCA_JSON_CAP_BYTES)
41
+ return null;
42
+ chunks.push(chunk);
65
43
  }
66
- if (!response.ok) {
67
- return statusFailed(outcome, `endpoint answered HTTP ${response.status} for the registration status — the endpoint may predate this check; update it or retry`, `the status route answered HTTP ${response.status}`);
44
+ return new TextDecoder().decode(Buffer.concat(chunks));
45
+ }
46
+ /** CC11 — conloca.json at the address, through the server's classifier; the commit is held against local HEAD. */
47
+ async function checkEditorPage(input, address) {
48
+ const { context, deps, scan, repoUri } = input;
49
+ if (repoUri === undefined) {
50
+ return {
51
+ outcome: skipped('CC11', 'repository identity could not be determined — build in a CI environment or Git checkout, or set repoUri'),
52
+ };
68
53
  }
69
- let body;
54
+ const outcome = outcomeOf('CC11');
55
+ const error = (message) => {
56
+ outcome.problems.push({ check: 'CC11', level: 'error', message });
57
+ return { outcome };
58
+ };
59
+ let siteId;
70
60
  try {
71
- body = await response.json();
72
- }
73
- catch {
74
- return statusFailed(outcome, 'the endpoint answered 200 but not with JSON — does endpoint point at the site itself instead of the editor endpoint?', 'the endpoint did not answer with JSON');
61
+ siteId = resolveBuildSiteId({
62
+ contentRoot: context.contentRoot,
63
+ override: optionLiteral(scan, 'siteId'),
64
+ readFile: (path) => deps.readFile(path),
65
+ });
75
66
  }
76
- if (!isStatusResponse(body)) {
77
- return statusFailed(outcome, 'the registration status response has an unexpected shape — update the endpoint or this package', 'the status response was unreadable');
67
+ catch (cause) {
68
+ return error(messageOf(cause));
78
69
  }
79
- outcome.detail = `${target.endpoint} reachable — ${body.registrations.length} registration(s) for ${target.repoUri}`;
80
- return { outcome, body };
81
- }
82
- /** CC6 — own row → probe; default-branch row → warn + probe; neither → error. Returns the row the editor would load. */
83
- function diagnoseRegistrations(body, branch, siteId) {
84
- const outcome = outcomeOf('CC6');
85
- if (!branch) {
86
- outcome.problems.push({
87
- check: 'CC6',
88
- level: 'warn',
89
- message: 'could not determine the current branch (detached HEAD?) — set CF_PAGES_BRANCH or GITHUB_REF_NAME, or check out a branch',
90
- });
91
- return { outcome, row: undefined };
92
- }
93
- // Newest first, whatever order the route returned: the editor loads the newest row.
94
- const live = body.registrations.filter((row) => row.parked !== true).sort((a, b) => b.registeredAt - a.registeredAt);
95
- // Activation is branch-scoped, so only rows parked for THIS branch say anything about it. They carry no siteId:
96
- // the site stays undetermined until the editor's next open reads the branch's tree.
97
- const parkedHere = body.registrations.filter((row) => row.parked === true && row.branch === branch);
98
- // A branch without its own row is served by the default branch's row for that site — the editor's own lookup
99
- // rule, which reads an empty default branch as none (the route relays the repository record as is).
100
- const defaultBranch = body.defaultBranch === '' ? null : body.defaultBranch;
101
- const inheritable = defaultBranch !== null && defaultBranch !== branch;
102
- const own = live.find((row) => row.branch === branch && row.siteId === siteId);
103
- const inherited = own === undefined && inheritable
104
- ? live.find((row) => row.branch === defaultBranch && row.siteId === siteId)
105
- : undefined;
106
- const details = [];
107
- if (own) {
108
- details.push(`site "${siteId}": own registration ${own.gitSha}${builtWithNote(own.clientVersion)}`);
109
- }
110
- else if (inherited) {
111
- outcome.problems.push({
112
- check: 'CC6',
113
- level: 'warn',
114
- message: `site "${siteId}": no registration for branch ${branch} — the editor inherits the default branch's (${defaultBranch}) registration; it works, preview is degraded. Build ${branch} with the token to register it`,
115
- });
70
+ const url = `${address}${EDITOR_PAGE_PATH.slice(1)}conloca.json`;
71
+ const answer = await request(deps.fetch, url);
72
+ if (answer instanceof Error)
73
+ return error(`${url} could not be reached (${answer.message})`);
74
+ const body = await cappedText(answer);
75
+ const vercel = isFromVercel(answer.headers);
76
+ const verdict = classifyEditorHostResponse({
77
+ status: answer.status,
78
+ contentType: answer.headers.get('content-type'),
79
+ location: answer.headers.get('location'),
80
+ vercel,
81
+ body,
82
+ }, { repoUri, siteId, protocols: ANY_PROTOCOL });
83
+ const { info } = verdict;
84
+ switch (verdict.status) {
85
+ case 'ready':
86
+ break;
87
+ case 'unreachable':
88
+ return error(`${url} answers HTTP ${answer.status} — the site is down or limiting requests; try again later`);
89
+ case 'protected':
90
+ return error(`${url} asks visitors to sign in${vercel ? ' (Vercel Deployment Protection)' : ''} — put the public production address in sites.json, or let visitors through`);
91
+ case 'not-found':
92
+ return error(`${url} is not deployed — deploy the commit that adds conlocaCloud() to astro.config`);
93
+ case 'wrong-repo':
94
+ // A page built without a git remote names no repository, so no workspace can claim it.
95
+ if (verdict.reason === 'repo-missing') {
96
+ return {
97
+ ...error(`${url} names no repository because the build could not read the git remote — set repoUri in conlocaCloud(...)`),
98
+ info,
99
+ };
100
+ }
101
+ return {
102
+ ...error(`${address} serves the editor page of ${info?.repo}, not ${repoUri} — check domains in sites.json`),
103
+ info,
104
+ };
105
+ case 'wrong-site':
106
+ return {
107
+ ...error(`${address} serves site "${info?.siteId}", not "${siteId}" — check siteId in sites.json`),
108
+ info,
109
+ };
110
+ default:
111
+ return error(`${url} is not a conloca.json the editor can read — check that the host serves the built file unchanged`);
116
112
  }
117
- else if (parkedHere.length > 0) {
118
- // The next editor open activates these rows, so the editor does load. It only fails when the branch has since
119
- // grown a second site, which the doctor cannot foresee: resolveBuildSiteId answers with one id, never a count.
113
+ if (info === undefined)
114
+ return { outcome };
115
+ const local = deps.git(['rev-parse', 'HEAD'], context.projectDir);
116
+ const served = info.commit?.slice(0, 7) ?? 'an unknown commit';
117
+ if (local !== undefined && info.commit !== local) {
120
118
  outcome.problems.push({
121
- check: 'CC6',
119
+ check: 'CC11',
122
120
  level: 'warn',
123
- message: `site "${siteId}": no active registration serves branch ${branch} — ${parkedHere.length} older registration(s) for it become active the next time the editor opens, unless this branch now declares more than one site (the editor answers 409 then). Build ${branch} with CONLOCA_BUILD_TOKEN set to replace them`,
121
+ message: `${address} is serving ${served}, your checkout is at ${local.slice(0, 7)} — deploy to see your latest components in the editor`,
124
122
  });
125
123
  }
126
- else {
127
- const fallback = inheritable ? ` (nor the default branch ${defaultBranch})` : '';
128
- outcome.problems.push({
129
- check: 'CC6',
130
- level: 'error',
131
- message: `site "${siteId}": no registration serves branch ${branch}${fallback} — the editor will not load; build ${branch} with CONLOCA_BUILD_TOKEN set`,
132
- });
124
+ outcome.detail = `${address}${EDITOR_PAGE_PATH.slice(1)} serves site "${siteId}" of ${info.repo} at ${served}`;
125
+ return { outcome, info };
126
+ }
127
+ /** The sources that govern module scripts, per policy: script-src-elem, else script-src, else default-src. */
128
+ function scriptSources(csp) {
129
+ return csp.split(',').flatMap((policy) => {
130
+ const directives = policy.split(';').map((directive) => directive.trim().toLowerCase().split(/\s+/));
131
+ const found = ['script-src-elem', 'script-src', 'default-src']
132
+ .map((wanted) => directives.find(([name]) => name === wanted))
133
+ .find((directive) => directive !== undefined);
134
+ return found === undefined ? [] : [found.slice(1)];
135
+ });
136
+ }
137
+ const HOST_SOURCE = /^(?:([a-z][a-z0-9+.-]*):\/\/)?(\*|(?:\*\.)?[a-z0-9.-]+)(?::(\d+|\*))?(\/\S*)?$/;
138
+ /**
139
+ * Whether one CSP source expression admits an https `target` (CSP3 "does url match expression"). Keywords, nonces and
140
+ * hashes never admit a cross-origin file here; `'strict-dynamic'` is not modelled.
141
+ */
142
+ function sourceAllows(source, target) {
143
+ if (source === '*' || source === 'https:' || source === 'http:')
144
+ return true;
145
+ const match = HOST_SOURCE.exec(source);
146
+ if (match === null)
147
+ return false;
148
+ const [, scheme, host = '', port, path] = match;
149
+ if (scheme !== undefined && scheme !== 'https' && scheme !== 'http')
150
+ return false;
151
+ const hostMatches = host === '*' || (host.startsWith('*.') ? target.hostname.endsWith(host.slice(1)) : host === target.hostname);
152
+ const portMatches = port === undefined || port === '*' || Number(port) === Number(target.port || 443);
153
+ const pathMatches = path === undefined || (path.endsWith('/') ? target.pathname.startsWith(path) : target.pathname === path);
154
+ return hostMatches && portMatches && pathMatches;
155
+ }
156
+ /** CC12 — the editor page's own headers, through the server's frame classifier, and whether it may load the editor UI. */
157
+ async function checkFrameHeaders(address, origin, fetchFn) {
158
+ const editorRoot = origin === null ? null : parentRoot(origin);
159
+ if (origin === null || editorRoot === null)
160
+ return skipped('CC12', 'no editor UI origin');
161
+ const outcome = outcomeOf('CC12');
162
+ const error = (message) => {
163
+ outcome.problems.push({ check: 'CC12', level: 'error', message });
164
+ return outcome;
165
+ };
166
+ const url = `${address}${EDITOR_PAGE_PATH.slice(1)}`;
167
+ const answer = await request(fetchFn, url);
168
+ if (answer instanceof Error)
169
+ return error(`${url} could not be reached (${answer.message})`);
170
+ await answer.body?.cancel().catch(() => { });
171
+ if (answer.status >= 500 || answer.status === 429) {
172
+ return error(`${url} answers HTTP ${answer.status} — the site is down or limiting requests; try again later`);
133
173
  }
134
- // Only a footnote when something already serves the branch; the parked-only warning above carries the count itself.
135
- if (parkedHere.length > 0 && (own ?? inherited)) {
136
- details.push(`${parkedHere.length} older registration(s) not active yet — they become active the next time the editor opens`);
174
+ // A 404 or a redirect carries the host's headers, not the page's, so it proves nothing about framing.
175
+ if (!answer.ok) {
176
+ return error(`${url} answers HTTP ${answer.status}, not the editor page, so its headers say nothing yet — deploy it first (see CC11)`);
137
177
  }
138
- if (details.length > 0)
139
- outcome.detail = details.join('; ');
140
- return { outcome, row: own ?? inherited };
141
- }
142
- /** HEAD the URL; a host that refuses HEAD (405/501) gets a GET. */
143
- async function reachable(fetchFn, url) {
144
- try {
145
- let response = await fetchFn(url, { method: 'HEAD', signal: AbortSignal.timeout(REQUEST_TIMEOUT_MS) });
146
- if (response.status === 405 || response.status === 501) {
147
- // A one-byte range keeps the probe from downloading the whole bundle; the 206 it earns is `ok`.
148
- response = await fetchFn(url, {
149
- method: 'GET',
150
- headers: { range: 'bytes=0-0' },
151
- signal: AbortSignal.timeout(REQUEST_TIMEOUT_MS),
152
- });
153
- }
154
- return response.ok ? { ok: true } : { ok: false, answer: `HTTP ${response.status}` };
178
+ const headers = {
179
+ xFrameOptions: answer.headers.get('x-frame-options'),
180
+ csp: answer.headers.get('content-security-policy'),
181
+ };
182
+ const ancestor = `https://*.${editorRoot}`;
183
+ const hint = 'run conloca connect again, or exempt /_conloca/editor/ in your host settings';
184
+ if (classifyFrameHeaders(headers, [ancestor]) === 'frame-blocked') {
185
+ const seen = /frame-ancestors/i.test(headers.csp ?? '')
186
+ ? `a Content-Security-Policy whose frame-ancestors excludes ${ancestor}`
187
+ : `X-Frame-Options: ${headers.xFrameOptions}`;
188
+ error(`${url} sends ${seen}, so the workspace editor cannot frame it — ${hint}`);
155
189
  }
156
- catch (error) {
157
- return { ok: false, answer: `unreachable (${messageOf(error)})` };
190
+ // The editor UI modules live under /host/v<protocol>/ on the editor UI origin.
191
+ const editorUi = new URL(`/host/v${EDITOR_HOST_PROTOCOL}/`, origin);
192
+ const blocksEditor = scriptSources(headers.csp ?? '').some((sources) => !sources.some((source) => sourceAllows(source, editorUi)));
193
+ if (blocksEditor) {
194
+ error(`${url} sends a Content-Security-Policy whose script-src does not allow ${origin}, so the editor page cannot load the editor — add ${origin} to script-src for /_conloca/editor/`);
158
195
  }
196
+ if (outcome.problems.length === 0)
197
+ outcome.detail = `${url} may be framed by ${ancestor}`;
198
+ return outcome;
159
199
  }
160
- /** CC7 — the bundle a registration names must still be deployed: the row serving this branch needs its bytes. */
161
- async function probeBundle(siteId, row, localSha, fetchFn) {
162
- if (row === undefined)
163
- return skipped('CC7', 'no registration to probe');
164
- const outcome = outcomeOf('CC7');
165
- const result = await reachable(fetchFn, row.editorBundleUrl);
166
- if (!result.ok) {
167
- outcome.problems.push({
168
- check: 'CC7',
169
- level: 'error',
170
- message: `site "${siteId}": the registration for ${row.branch} points at deleted editor assets — ${row.editorBundleUrl} answers ${result.answer} (a later deploy replaced them); rebuild and deploy from ${row.branch}`,
171
- });
200
+ function isProtocolRange(value) {
201
+ return (typeof value === 'object' &&
202
+ value !== null &&
203
+ 'min' in value &&
204
+ 'max' in value &&
205
+ Number.isSafeInteger(value.min) &&
206
+ Number.isSafeInteger(value.max));
207
+ }
208
+ /** CC13 — the page's protocol against the range the editor UI publishes at `<origin>/host/protocols.json`. */
209
+ async function checkProtocol(info, origin, fetchFn) {
210
+ if (origin === null)
211
+ return skipped('CC13', 'no editor UI origin');
212
+ if (info === undefined)
213
+ return skipped('CC13', 'no conloca.json to read (see CC11)');
214
+ const outcome = outcomeOf('CC13');
215
+ const error = (message) => {
216
+ outcome.problems.push({ check: 'CC13', level: 'error', message });
217
+ return outcome;
218
+ };
219
+ const url = `${origin}/host/protocols.json`;
220
+ const answer = await request(fetchFn, url);
221
+ if (answer instanceof Error)
222
+ return error(`${url} could not be reached (${answer.message})`);
223
+ let range;
224
+ try {
225
+ range = answer.ok ? await answer.json() : undefined;
172
226
  }
173
- else if (localSha && localSha !== row.gitSha) {
174
- outcome.detail = `site "${siteId}": registered ${row.gitSha.slice(0, 7)}, local HEAD ${localSha.slice(0, 7)} — the editor at the endpoint lags this checkout`;
227
+ catch {
228
+ range = undefined;
175
229
  }
176
- else {
177
- outcome.detail = `site "${siteId}": ${row.editorBundleUrl} reachable`;
230
+ if (!isProtocolRange(range)) {
231
+ return error(`${url} did not answer the editor's protocol range as JSON (HTTP ${answer.status})`);
178
232
  }
233
+ const { protocol } = info;
234
+ const speaks = `the editor page speaks protocol ${protocol} and the editor speaks ${range.min}–${range.max}`;
235
+ if (protocol < range.min)
236
+ return error(`${speaks} — rebuild with a newer @conloca/cloud-astro and deploy`);
237
+ if (protocol > range.max)
238
+ return error(`${speaks} — the editor does not speak this version yet`);
239
+ outcome.detail = `protocol ${protocol}, the editor speaks ${range.min}–${range.max}`;
179
240
  return outcome;
180
241
  }
181
- /** CC5–CC7. Networks only under --live, and the token goes ONLY to the configured endpoint. */
242
+ /**
243
+ * CC11–CC13. Networks only under --live, sends no credential, and contacts only the site's own domain and the editor UI's
244
+ * public protocols.json — so it runs anywhere, forks and Dependabot included.
245
+ */
182
246
  export async function runLiveChecks(input) {
183
- const { context, deps, scan, token, endpoint } = input;
247
+ const { context, deps, scan, address } = input;
184
248
  if (!context.live)
185
249
  return skipAll('live checks run only with --live');
186
- // The live trio diagnoses this integration: an unwired one is the reason, exactly as CC2/CC3 say.
187
250
  if (scan.kind === 'read' && scan.config.conlocaCloud === 'absent')
188
251
  return skipAll(INTEGRATION_NOT_CALLED);
189
- if (token === undefined) {
190
- // CC2 already said why a supplied token is unusable; only a missing one gets the how-to here.
191
- return skipAll(suppliedBuildToken(scan, deps.env) === undefined
192
- ? 'no build token — set CONLOCA_BUILD_TOKEN'
193
- : 'no usable build token (see CC2)');
194
- }
195
- if (endpoint === undefined) {
196
- // Likewise CC3 already said why a supplied endpoint is unusable.
197
- return skipAll(suppliedEndpoint(scan, deps.env) === undefined
198
- ? `endpoint could not be determined — set ${ENDPOINT_ENV_VAR}`
199
- : 'no usable endpoint (see CC3)');
200
- }
201
- // The doctor diagnoses the project it was handed, not whatever checkout the CLI happens to be standing in:
202
- // `conloca doctor ./site` from a wrapper repo would otherwise read that repo's branch and call the site broken.
203
- const git = (args) => deps.git(args, context.projectDir);
204
- const repoUri = resolveRepositoryUri(optionLiteral(scan, 'repoUri'), deps.env, git);
205
- if (repoUri === undefined) {
206
- return skipAll('repository identity could not be determined — build in a CI environment or Git checkout, or set repoUri');
207
- }
208
- const status = await probeStatus(deps.fetch, { token, endpoint, repoUri });
209
- if (!('body' in status)) {
210
- return [status.outcome, skipped('CC6', status.skipReason), skipped('CC7', status.skipReason)];
211
- }
212
- let siteId;
213
- try {
214
- siteId = resolveBuildSiteId({
215
- contentRoot: context.contentRoot,
216
- override: optionLiteral(scan, 'siteId'),
217
- readFile: deps.readFile,
218
- });
219
- }
220
- catch (error) {
221
- const outcome = outcomeOf('CC6');
222
- outcome.problems.push({ check: 'CC6', level: 'error', message: messageOf(error) });
223
- return [status.outcome, outcome, skipped('CC7', 'the site id could not be resolved')];
224
- }
225
- const ref = resolveBuildRef(deps.env, git);
226
- const diagnosis = diagnoseRegistrations(status.body, ref.branch, siteId);
227
- return [status.outcome, diagnosis.outcome, await probeBundle(siteId, diagnosis.row, ref.gitSha, deps.fetch)];
252
+ if (address === undefined)
253
+ return skipAll('no site domain (see CC9)');
254
+ const origin = editorUiOrigin(suppliedEndpoint(scan, deps.env));
255
+ const [page, frame] = await Promise.all([
256
+ checkEditorPage(input, address),
257
+ checkFrameHeaders(address, origin, deps.fetch),
258
+ ]);
259
+ return [page.outcome, frame, await checkProtocol(page.info, origin, deps.fetch)];
228
260
  }
229
261
  //# sourceMappingURL=checks-live.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"checks-live.js","sourceRoot":"","sources":["../../../src/doctor/checks-live.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,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YAAY,KAAK,QAAQ;QAAE,OAAO,OAAO,CAAC,sBAAsB,CAAC,CAAC;IAC1G,IAAI,OAAO,KAAK,SAAS;QAAE,OAAO,OAAO,CAAC,0BAA0B,CAAC,CAAC;IACtE,MAAM,MAAM,GAAG,cAAc,CAAC,gBAAgB,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IAChE,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QACtC,eAAe,CAAC,KAAK,EAAE,OAAO,CAAC;QAC/B,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC;KAC/C,CAAC,CAAC;IACH,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;AACnF,CAAC"}
@@ -3,34 +3,19 @@ import { type ConfigScan } from './config-scan.js';
3
3
  import { type CheckOutcome } from './types.js';
4
4
  /** Doctor-only override for an endpoint the config computes (e.g. from an env var). */
5
5
  export declare const ENDPOINT_ENV_VAR = "CONLOCA_ENDPOINT";
6
- /** Why CC2, CC3 and the live trio skip when the integration is not wired. */
6
+ /** Why the address, framing and live checks skip when the integration is not wired. */
7
7
  export declare const INTEGRATION_NOT_CALLED = "conlocaCloud(...) is not called in the astro config";
8
- /** The build token as supplied — env first, then the config literal. CC2 judges its shape; CC5 only asks whether one exists. */
9
- export declare function suppliedBuildToken(scan: ConfigScan, env: RepositoryEnvironment): string | undefined;
10
- /** The endpoint as supplied — config literal first, then CONLOCA_ENDPOINT. CC3 judges its shape; CC5 only asks whether one exists. */
8
+ /** The endpoint as supplied — config literal first, then CONLOCA_ENDPOINT; undefined means the default editor. */
11
9
  export declare function suppliedEndpoint(scan: ConfigScan, env: RepositoryEnvironment): string | undefined;
12
- /** CC1 — three states for the conlocaCloud call, and the both-integrations rule for conlocaCMS. */
13
- export declare function checkWiring(scan: ConfigScan): CheckOutcome;
14
10
  /**
15
- * CC2 — severity by context: under CI a missing token is an error, locally an
16
- * info. A token literal in the config is always a warning, even when the env
17
- * var also carries one: the committed secret is the finding.
11
+ * CC1 — three states for the conlocaCloud call, and the both-integrations rule for conlocaCMS. A wired call also notes
12
+ * that the deployed conloca.json names the repository (`repoUri`: what the build will write, when known).
18
13
  */
19
- export declare function checkBuildToken(scan: ConfigScan, env: RepositoryEnvironment): {
20
- outcome: CheckOutcome;
21
- token?: string;
22
- };
23
- /** CC3 — the endpoint and the public base URL, each in its own helper; skipped when there is nothing to read. */
24
- export declare function checkEndpoints(scan: ConfigScan, env: RepositoryEnvironment): {
25
- outcome: CheckOutcome;
26
- endpoint?: string;
27
- };
28
- /** CC4 — each option the endpoint's editor ignores, warned when set. */
29
- export declare function checkInertCmsOptions(scan: ConfigScan): CheckOutcome;
14
+ export declare function checkWiring(scan: ConfigScan, repoUri: string | undefined): CheckOutcome;
30
15
  /**
31
- * CC8 — unless previewBuild is false, every build that registers also runs the preview build, which needs an SSR
32
- * adapter: the project's own or previewBuild.adapter. A static project with neither stays green until its first
33
- * registering build, which then fails. Only what the config text shows is judged.
16
+ * CC8 — only a previewBuild given as an object starts the preview build, which needs an SSR adapter: the project's own
17
+ * or previewBuild.adapter. A static project with neither fails astro build at config time. Only what the config text
18
+ * shows is judged.
34
19
  */
35
20
  export declare function checkPreviewBuildAdapter(scan: ConfigScan): CheckOutcome;
36
21
  //# sourceMappingURL=checks-offline.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"checks-offline.d.ts","sourceRoot":"","sources":["../../../src/doctor/checks-offline.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,KAAK,UAAU,EAAgE,MAAM,kBAAkB,CAAC;AACjH,OAAO,EAAE,KAAK,YAAY,EAAsB,MAAM,YAAY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