@forumulate/cli 0.3.5 → 0.4.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 (77) hide show
  1. package/README.md +100 -21
  2. package/dist/api-base.d.ts +26 -7
  3. package/dist/api-base.d.ts.map +1 -1
  4. package/dist/api-base.js +38 -8
  5. package/dist/api-base.js.map +1 -1
  6. package/dist/cli.js +25 -1
  7. package/dist/cli.js.map +1 -1
  8. package/dist/credentials.d.ts +1 -1
  9. package/dist/doctor.d.ts +13 -0
  10. package/dist/doctor.d.ts.map +1 -1
  11. package/dist/doctor.js +113 -44
  12. package/dist/doctor.js.map +1 -1
  13. package/dist/publish/api.d.ts +95 -0
  14. package/dist/publish/api.d.ts.map +1 -0
  15. package/dist/publish/api.js +265 -0
  16. package/dist/publish/api.js.map +1 -0
  17. package/dist/publish/command.d.ts +44 -0
  18. package/dist/publish/command.d.ts.map +1 -0
  19. package/dist/publish/command.js +246 -0
  20. package/dist/publish/command.js.map +1 -0
  21. package/dist/publish/compare.d.ts +45 -0
  22. package/dist/publish/compare.d.ts.map +1 -0
  23. package/dist/publish/compare.js +124 -0
  24. package/dist/publish/compare.js.map +1 -0
  25. package/dist/publish/context.d.ts +46 -0
  26. package/dist/publish/context.d.ts.map +1 -0
  27. package/dist/publish/context.js +54 -0
  28. package/dist/publish/context.js.map +1 -0
  29. package/dist/publish/docs-apply.d.ts +39 -0
  30. package/dist/publish/docs-apply.d.ts.map +1 -0
  31. package/dist/publish/docs-apply.js +178 -0
  32. package/dist/publish/docs-apply.js.map +1 -0
  33. package/dist/publish/docs-plan.d.ts +40 -0
  34. package/dist/publish/docs-plan.d.ts.map +1 -0
  35. package/dist/publish/docs-plan.js +211 -0
  36. package/dist/publish/docs-plan.js.map +1 -0
  37. package/dist/publish/docs-reconcile.d.ts +26 -0
  38. package/dist/publish/docs-reconcile.d.ts.map +1 -0
  39. package/dist/publish/docs-reconcile.js +162 -0
  40. package/dist/publish/docs-reconcile.js.map +1 -0
  41. package/dist/publish/extras.d.ts +25 -0
  42. package/dist/publish/extras.d.ts.map +1 -0
  43. package/dist/publish/extras.js +218 -0
  44. package/dist/publish/extras.js.map +1 -0
  45. package/dist/publish/frontmatter.d.ts +45 -0
  46. package/dist/publish/frontmatter.d.ts.map +1 -0
  47. package/dist/publish/frontmatter.js +265 -0
  48. package/dist/publish/frontmatter.js.map +1 -0
  49. package/dist/publish/manifest.d.ts +5 -0
  50. package/dist/publish/manifest.d.ts.map +1 -0
  51. package/dist/publish/manifest.js +144 -0
  52. package/dist/publish/manifest.js.map +1 -0
  53. package/dist/publish/posts.d.ts +39 -0
  54. package/dist/publish/posts.d.ts.map +1 -0
  55. package/dist/publish/posts.js +350 -0
  56. package/dist/publish/posts.js.map +1 -0
  57. package/dist/publish/rewrite.d.ts +20 -0
  58. package/dist/publish/rewrite.d.ts.map +1 -0
  59. package/dist/publish/rewrite.js +82 -0
  60. package/dist/publish/rewrite.js.map +1 -0
  61. package/dist/publish/scan.d.ts +25 -0
  62. package/dist/publish/scan.d.ts.map +1 -0
  63. package/dist/publish/scan.js +351 -0
  64. package/dist/publish/scan.js.map +1 -0
  65. package/dist/publish/types.d.ts +155 -0
  66. package/dist/publish/types.d.ts.map +1 -0
  67. package/dist/publish/types.js +13 -0
  68. package/dist/publish/types.js.map +1 -0
  69. package/dist/run.d.ts +10 -1
  70. package/dist/run.d.ts.map +1 -1
  71. package/dist/run.js +71 -51
  72. package/dist/run.js.map +1 -1
  73. package/package.json +4 -3
  74. package/dist/publish-dir.d.ts +0 -54
  75. package/dist/publish-dir.d.ts.map +0 -1
  76. package/dist/publish-dir.js +0 -119
  77. package/dist/publish-dir.js.map +0 -1
package/README.md CHANGED
@@ -1,28 +1,97 @@
1
1
  # @forumulate/cli
2
2
 
3
- Command-line interface for [Forumulate](https://github.com/alphajew420/forumulate) — manage orgs, spaces, docs, and search from your terminal, built on `@forumulate/sdk`.
3
+ The `forumulate` command: manage [Forumulate](https://forumulate.com) organizations, spaces and pages from a terminal or CI, publish a directory of markdown, and check a live site the way readers and crawlers see it. Built on [`@forumulate/sdk`](https://www.npmjs.com/package/@forumulate/sdk).
4
4
 
5
5
  ## Install
6
6
 
7
7
  ```sh
8
8
  npm install -g @forumulate/cli
9
+ # or, without installing:
10
+ npx -y @forumulate/cli help
9
11
  ```
10
12
 
11
- ## Usage
13
+ Node 20 or newer.
12
14
 
13
- ```sh
14
- export FORUMULATE_URL=https://your-forumulate.example.com # default http://localhost:4000
15
- export FORUMULATE_TOKEN=cfo_... # a Personal Access Token
15
+ ## Authenticate
16
+
17
+ Mint a Personal Access Token at **Account → Tokens** ([forumulate.com/account/tokens](https://forumulate.com/account/tokens)). Give it `read` + `write` to publish. [API tokens and scopes](https://forumulate.com/guides/api-tokens-and-scopes) explains the two gates a token passes.
16
18
 
19
+ ```sh
20
+ forumulate login # prompts for the token (not echoed), checks it, stores it
17
21
  forumulate whoami
18
- forumulate orgs
19
- forumulate spaces <orgId>
20
- forumulate search <orgId> how to deploy
21
- forumulate publish <orgId> <spaceId> <pageId>
22
- forumulate snapshot <orgId> <spaceId> "Before the big migration"
23
22
  ```
24
23
 
25
- Add `--json` to any command for raw JSON output, `--version` for the version, and `forumulate help` for the full list.
24
+ The token is stored per API in `~/.config/forumulate/credentials.json`, readable only by you. In CI, set `FORUMULATE_TOKEN` instead; it always wins over a stored token.
25
+
26
+ | Variable | Default | Meaning |
27
+ | -------------------- | ------------------------ | -------------------------------------------------------------------------------- |
28
+ | `FORUMULATE_TOKEN` | stored token | Personal Access Token. |
29
+ | `FORUMULATE_URL` | `https://forumulate.com` | The site. The API is its `/api`. A value already ending in `/api` is used as-is. |
30
+ | `FORUMULATE_API_URL` | none | Exact API base, for a local API with no `/api` prefix (`http://localhost:4000`). |
31
+
32
+ The SDK (`ForumulateClient.fromEnv()`) and the MCP server ([`@forumulate/mcp`](https://www.npmjs.com/package/@forumulate/mcp)) read the same variables, so one environment configures all three.
33
+
34
+ ## Quickstart
35
+
36
+ ```sh
37
+ forumulate orgs # id slug name
38
+ forumulate spaces acme # an org id or its slug
39
+ forumulate items acme <spaceId> # what is in a space, and where its content lives
40
+ ```
41
+
42
+ ## Common tasks
43
+
44
+ **1. Publish a folder of Markdown (docs-as-code).** One folder per collection, nested folders as parent pages, front matter for title, slug, description, icon, tags, order and any other page field, images uploaded, links rewritten. Blog and changelog folders become posts. Re-runs change only what changed; `--prune` removes what the folder no longer has; the space is read back afterwards. An optional `forumulate.yaml` sets the space's settings and theme, the site, an OpenAPI reference and status monitors. See [Publish a folder of Markdown from git](https://forumulate.com/guides/publish-from-git) and `examples/publish-docs.yml` for GitHub Actions.
45
+
46
+ ```sh
47
+ forumulate publish ./docs --org acme --space docs --dry-run # the plan (no token needed for a public space)
48
+ forumulate publish ./docs --org acme --space docs --prune
49
+ forumulate publish . --only getting-started,theme # just these
50
+ ```
51
+
52
+ **2. Publish one page by id.**
53
+
54
+ ```sh
55
+ forumulate publish acme <spaceId> <pageId>
56
+ ```
57
+
58
+ **3. Search docs, forum and blog together.**
59
+
60
+ ```sh
61
+ forumulate search acme rate limits
62
+ ```
63
+
64
+ **4. Snapshot a space before a big change.**
65
+
66
+ ```sh
67
+ forumulate snapshot acme <spaceId> "Before the v2 migration"
68
+ ```
69
+
70
+ **5. Check a custom domain.**
71
+
72
+ ```sh
73
+ forumulate domains acme <spaceId> # each domain and its state
74
+ forumulate domains verify acme <spaceId> docs.acme.dev # re-check, and print the DNS still missing
75
+ ```
76
+
77
+ Add `--json` to any command for raw JSON, `--version` for the version, and `forumulate help` for the full list. Every command exits non-zero on failure, so it works in a pipeline.
78
+
79
+ ### In CI
80
+
81
+ ```yaml
82
+ # GitHub Actions
83
+ - run: npx -y @forumulate/cli publish acme ${{ vars.DOCS_SPACE_ID }} ./docs
84
+ env:
85
+ FORUMULATE_TOKEN: ${{ secrets.FORUMULATE_TOKEN }}
86
+ ```
87
+
88
+ ## `forumulate conformance`
89
+
90
+ Runs the Content Sync Protocol suite against a collection endpoint, ours or any other platform's:
91
+
92
+ ```sh
93
+ forumulate conformance https://forumulate.com/api/orgs/acme/spaces/<spaceId>/items
94
+ ```
26
95
 
27
96
  ## `forumulate doctor`
28
97
 
@@ -35,19 +104,29 @@ forumulate doctor https://your-domain.example.com/docs
35
104
  It needs no token, because none of this is private. Each check is something
36
105
  customers have found out about after their readers did:
37
106
 
38
- | Check | What a failure means |
39
- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
40
- | `health` | The health endpoint answered something other than JSON. A plain-text 500 during a deploy reads as a permanent bug, so a careful client stops retrying a few-minute outage. |
41
- | `public-read` | A logged-out reader is redirected to sign-in. Public docs behind a login are invisible to readers and to crawlers — and invisible from inside a signed-in session, which is why this is worth a command. |
42
- | `canonical` | The `rel=canonical` names another host. Search engines credit the canonical host, so a platform URL here hands your authority to the platform. |
43
- | `html-untouched` | Something in the path is rewriting your markup. Cloudflare's Email Obfuscation is the usual one: it injects a decoder script with no CSP nonce, so the script is refused and every address on the page renders as `[email protected]` with a dead link. |
44
- | `cache-headers` | The document is served `no-store` or with no `Cache-Control`, so every reader pays full origin latency and a CDN in front of it does nothing. |
45
- | `robots` / `sitemap` | `robots.txt` disallows the path, or names no sitemap. A `Disallow` here means the page is never indexed, however good it is. Only the `User-agent: *` group counts — a rule aimed at one named crawler is a deliberate choice. |
46
- | `crawler-access` | A crawler gets a different status from a reader. A WAF rule or bot challenge that answers crawlers differently removes the site from search with nothing in any log to say so. |
47
- | `feeds` | No feed beside the page. Readers and aggregators look next to the content, not at an API URL. |
107
+ | Check | What a failure means |
108
+ | -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
109
+ | `health` | The health endpoint answered something other than JSON. A plain-text 500 during a deploy reads as a permanent bug, so a careful client stops retrying a few-minute outage. On your own domain `/api` is yours, so the platform's mount is asked instead — `<section>/_api/health` for a path-mounted section, `/_api/health` for a domain that is the whole site — and only a mount that does not answer is reported as skipped. |
110
+ | `public-read` | A logged-out reader is redirected to sign-in. Public docs behind a login are invisible to readers and to crawlers — and invisible from inside a signed-in session, which is why this is worth a command. |
111
+ | `canonical` | The `rel=canonical` names another host. Search engines credit the canonical host, so a platform URL here hands your authority to the platform. |
112
+ | `html-untouched` | Something in the path is rewriting your markup. Cloudflare's Email Obfuscation is the usual one: it injects a decoder script with no CSP nonce, so the script is refused and every address on the page renders as `[email protected]` with a dead link. |
113
+ | `cache-headers` | The document is served `no-store` or with no `Cache-Control`, so every reader pays full origin latency and a CDN in front of it does nothing. |
114
+ | `robots` / `sitemap` | `robots.txt` disallows the path, or names no sitemap. A `Disallow` here means the page is never indexed, however good it is. Only the `User-agent: *` group counts — a rule aimed at one named crawler is a deliberate choice. |
115
+ | `crawler-access` | A crawler gets a different status from a reader. A WAF rule or bot challenge that answers crawlers differently removes the site from search with nothing in any log to say so. |
116
+ | `feeds` | No feed beside the page. Readers and aggregators look next to the content, not at an API URL. |
48
117
 
49
118
  Exit code is non-zero when anything failed, so it works in a deploy pipeline.
50
119
  `--json` gives the full report. The checks speak plain HTTP and assume nothing
51
120
  about the server, so pointing it at a staging mount — or at a competitor —
52
121
  produces the same report: a doctor that only passes on its author's deployment
53
122
  is a checklist with extra steps.
123
+
124
+ ## Related
125
+
126
+ - [`@forumulate/sdk`](https://www.npmjs.com/package/@forumulate/sdk): the typed TypeScript client this CLI is built on.
127
+ - [`@forumulate/mcp`](https://www.npmjs.com/package/@forumulate/mcp): connect Claude, Cursor or VS Code to your organization.
128
+ - [API reference](https://forumulate.com/reference) · [Guides](https://forumulate.com/guides) · [Community](https://forumulate.com/community)
129
+
130
+ ## License
131
+
132
+ MIT
@@ -7,14 +7,33 @@
7
7
  * `npm i -g @forumulate/cli` and types `forumulate spaces` has a dev server's
8
8
  * address, a connection refused, and a `--help` that confirms the address is
9
9
  * the intended one. A customer read that and asked which host they were
10
- * supposed to be running (CLI finding, Crossly).
10
+ * supposed to be running (a customer's CLI finding).
11
11
  *
12
- * The hosted API is the default now. `FORUMULATE_URL` still wins, which is how
13
- * a developer points it at `http://localhost:4000` and how anybody points it at
14
- * a different environment, and `login` stores a token per base URL so the two
15
- * do not collide.
12
+ * The hosted API is the default now, and `login` stores a token per base URL so
13
+ * two environments do not collide.
16
14
  */
17
15
  export declare const DEFAULT_API_BASE = "https://forumulate.com/api";
18
- /** The base URL to use: the environment, else the hosted API. */
19
- export declare function apiBaseFromEnv(env?: Record<string, string | undefined>): string;
16
+ type Env = Record<string, string | undefined>;
17
+ /**
18
+ * The base URL to use.
19
+ *
20
+ * `FORUMULATE_URL` names the SITE (`https://forumulate.com`), the same value the
21
+ * SDK's `ForumulateClient.fromEnv()` and `@forumulate/mcp` read, so one `.env`
22
+ * configures all three. The API is its `/api`. This variable used to mean the
23
+ * API base itself, so a value already ending in `/api` is taken as-is rather
24
+ * than doubled — every value that worked before still works.
25
+ *
26
+ * `FORUMULATE_API_URL` is the exact API base, for the one case a site URL
27
+ * cannot express: a local API on its own port with no `/api` prefix
28
+ * (`http://localhost:4000`).
29
+ */
30
+ export declare function apiBaseFromEnv(env?: Env): string;
31
+ /**
32
+ * The site origin `FORUMULATE_URL` names, or undefined when unset.
33
+ *
34
+ * `doctor` appends `/api/health` itself, so it wants the site and not the API
35
+ * base — handed the old-style `…/api` value it probed `/api/api/health`.
36
+ */
37
+ export declare function siteFromEnv(env?: Env): string | undefined;
38
+ export {};
20
39
  //# sourceMappingURL=api-base.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"api-base.d.ts","sourceRoot":"","sources":["../src/api-base.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,gBAAgB,+BAA+B,CAAC;AAE7D,iEAAiE;AACjE,wBAAgB,cAAc,CAAC,GAAG,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAe,GAAG,MAAM,CAG5F"}
1
+ {"version":3,"file":"api-base.d.ts","sourceRoot":"","sources":["../src/api-base.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,gBAAgB,+BAA+B,CAAC;AAE7D,KAAK,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;AAQ9C;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAAC,GAAG,GAAE,GAAiB,GAAG,MAAM,CAM7D;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,GAAG,GAAE,GAAiB,GAAG,MAAM,GAAG,SAAS,CAEtE"}
package/dist/api-base.js CHANGED
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DEFAULT_API_BASE = void 0;
4
4
  exports.apiBaseFromEnv = apiBaseFromEnv;
5
+ exports.siteFromEnv = siteFromEnv;
5
6
  /**
6
7
  * Where this CLI talks to, when nobody says.
7
8
  *
@@ -11,17 +12,46 @@ exports.apiBaseFromEnv = apiBaseFromEnv;
11
12
  * `npm i -g @forumulate/cli` and types `forumulate spaces` has a dev server's
12
13
  * address, a connection refused, and a `--help` that confirms the address is
13
14
  * the intended one. A customer read that and asked which host they were
14
- * supposed to be running (CLI finding, Crossly).
15
+ * supposed to be running (a customer's CLI finding).
15
16
  *
16
- * The hosted API is the default now. `FORUMULATE_URL` still wins, which is how
17
- * a developer points it at `http://localhost:4000` and how anybody points it at
18
- * a different environment, and `login` stores a token per base URL so the two
19
- * do not collide.
17
+ * The hosted API is the default now, and `login` stores a token per base URL so
18
+ * two environments do not collide.
20
19
  */
21
20
  exports.DEFAULT_API_BASE = 'https://forumulate.com/api';
22
- /** The base URL to use: the environment, else the hosted API. */
21
+ /** A blank variable is an unset one — `FOO= cmd` is how a shell clears it. */
22
+ function stated(env, name) {
23
+ const v = env[name]?.trim();
24
+ return v ? v.replace(/\/+$/, '') : undefined;
25
+ }
26
+ /**
27
+ * The base URL to use.
28
+ *
29
+ * `FORUMULATE_URL` names the SITE (`https://forumulate.com`), the same value the
30
+ * SDK's `ForumulateClient.fromEnv()` and `@forumulate/mcp` read, so one `.env`
31
+ * configures all three. The API is its `/api`. This variable used to mean the
32
+ * API base itself, so a value already ending in `/api` is taken as-is rather
33
+ * than doubled — every value that worked before still works.
34
+ *
35
+ * `FORUMULATE_API_URL` is the exact API base, for the one case a site URL
36
+ * cannot express: a local API on its own port with no `/api` prefix
37
+ * (`http://localhost:4000`).
38
+ */
23
39
  function apiBaseFromEnv(env = process.env) {
24
- const stated = env.FORUMULATE_URL?.trim();
25
- return stated || exports.DEFAULT_API_BASE;
40
+ const direct = stated(env, 'FORUMULATE_API_URL');
41
+ if (direct)
42
+ return direct;
43
+ const site = stated(env, 'FORUMULATE_URL');
44
+ if (!site)
45
+ return exports.DEFAULT_API_BASE;
46
+ return /\/api$/i.test(site) ? site : `${site}/api`;
47
+ }
48
+ /**
49
+ * The site origin `FORUMULATE_URL` names, or undefined when unset.
50
+ *
51
+ * `doctor` appends `/api/health` itself, so it wants the site and not the API
52
+ * base — handed the old-style `…/api` value it probed `/api/api/health`.
53
+ */
54
+ function siteFromEnv(env = process.env) {
55
+ return stated(env, 'FORUMULATE_URL')?.replace(/\/api$/i, '');
26
56
  }
27
57
  //# sourceMappingURL=api-base.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"api-base.js","sourceRoot":"","sources":["../src/api-base.ts"],"names":[],"mappings":";;;AAmBA,wCAGC;AAtBD;;;;;;;;;;;;;;;GAeG;AACU,QAAA,gBAAgB,GAAG,4BAA4B,CAAC;AAE7D,iEAAiE;AACjE,SAAgB,cAAc,CAAC,MAA0C,OAAO,CAAC,GAAG;IAClF,MAAM,MAAM,GAAG,GAAG,CAAC,cAAc,EAAE,IAAI,EAAE,CAAC;IAC1C,OAAO,MAAM,IAAI,wBAAgB,CAAC;AACpC,CAAC"}
1
+ {"version":3,"file":"api-base.js","sourceRoot":"","sources":["../src/api-base.ts"],"names":[],"mappings":";;;AAqCA,wCAMC;AAQD,kCAEC;AArDD;;;;;;;;;;;;;GAaG;AACU,QAAA,gBAAgB,GAAG,4BAA4B,CAAC;AAI7D,8EAA8E;AAC9E,SAAS,MAAM,CAAC,GAAQ,EAAE,IAAY;IACpC,MAAM,CAAC,GAAG,GAAG,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC;IAC5B,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAC/C,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,SAAgB,cAAc,CAAC,MAAW,OAAO,CAAC,GAAG;IACnD,MAAM,MAAM,GAAG,MAAM,CAAC,GAAG,EAAE,oBAAoB,CAAC,CAAC;IACjD,IAAI,MAAM;QAAE,OAAO,MAAM,CAAC;IAC1B,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,EAAE,gBAAgB,CAAC,CAAC;IAC3C,IAAI,CAAC,IAAI;QAAE,OAAO,wBAAgB,CAAC;IACnC,OAAO,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,MAAM,CAAC;AACrD,CAAC;AAED;;;;;GAKG;AACH,SAAgB,WAAW,CAAC,MAAW,OAAO,CAAC,GAAG;IAChD,OAAO,MAAM,CAAC,GAAG,EAAE,gBAAgB,CAAC,EAAE,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;AAC/D,CAAC"}
package/dist/cli.js CHANGED
@@ -37,10 +37,34 @@ async function main() {
37
37
  // The environment first, then what `login` stored for THIS API — see
38
38
  // `credentials.ts` for why the env var still wins.
39
39
  const token = (0, credentials_1.resolveToken)(baseUrl);
40
- const client = new sdk_1.ForumulateClient({ baseUrl, token });
40
+ /*
41
+ * Named, because the edge in front of the hosted API answers a default
42
+ * library User-Agent with a block page (Cloudflare 1010) rather than JSON —
43
+ * and our own scripts each learned that separately.
44
+ */
45
+ const userAgent = `@forumulate/cli/${run_1.VERSION}`;
46
+ const client = new sdk_1.ForumulateClient({ baseUrl, token, headers: { 'User-Agent': userAgent } });
47
+ /** Multipart for asset uploads: the SDK's `request` always sends JSON. */
48
+ const upload = async (path, form) => {
49
+ const res = await fetch(baseUrl + path, {
50
+ method: 'POST',
51
+ headers: { 'User-Agent': userAgent, ...(token ? { Authorization: `Bearer ${token}` } : {}) },
52
+ body: form,
53
+ });
54
+ const text = await res.text();
55
+ const json = text ? JSON.parse(text) : {};
56
+ if (!res.ok)
57
+ throw Object.assign(new Error(json.error?.message ?? res.statusText), {
58
+ status: res.status,
59
+ code: json.error?.code,
60
+ });
61
+ return json;
62
+ };
41
63
  const code = await (0, run_1.run)(process.argv.slice(2), {
42
64
  client,
43
65
  baseUrl,
66
+ authed: Boolean(token),
67
+ upload,
44
68
  prompt: askSecret,
45
69
  out: (l) => process.stdout.write(l + '\n'),
46
70
  err: (l) => process.stderr.write(l + '\n'),
package/dist/cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;AACA,iDAAgD;AAChD,yCAAmD;AACnD,+CAA6C;AAC7C,+BAA4B;AAC5B,yCAA4C;AAE5C;;;;;;GAMG;AACH,SAAS,SAAS,CAAC,QAAgB;IACjC,MAAM,EAAE,GAAG,IAAA,+BAAe,EAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;IAC7F,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,MAAM,MAAM,GAAG,OAAO,CAAC,MAAkD,CAAC;QAC1E,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;YACjB,MAAM,KAAK,GAAI,EAA0D,CAAC,cAAc,CAAC;YACxF,EAAyD,CAAC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C,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC;QAC1C,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC;KAC3C,CAAC,CAAC;IACH,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACrB,CAAC;AAED,KAAK,IAAI,EAAE,CAAC"}
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * The CLI had no `login`: every command needed `FORUMULATE_TOKEN` exported in
5
5
  * the shell, which means the token is in the environment of everything else
6
- * that shell runs, and in the history file of whoever typed it (Crossly DX-2).
6
+ * that shell runs, and in the history file of whoever typed it (a customer DX report).
7
7
  * A file read by this process alone, mode 0600, is the smaller exposure — and
8
8
  * it is what every other CLI a developer already has does.
9
9
  *
package/dist/doctor.d.ts CHANGED
@@ -30,4 +30,17 @@ export interface DoctorReport {
30
30
  warnings: number;
31
31
  }
32
32
  export declare function runDoctor(input: DoctorInput): Promise<DoctorReport>;
33
+ /**
34
+ * The segment a hosted reader's API answers under. Underscore-prefixed on
35
+ * purpose: slugs are `^[a-z0-9]+(?:-[a-z0-9]+)*$`, so no space, collection or
36
+ * page can be called `_api` and this can never shadow somebody's content.
37
+ *
38
+ * A SECOND copy of a string the platform's shared package owns, which is the drift that
39
+ * would make this probe wrong and silent. It is copied rather than imported
40
+ * because this package publishes to npm with one dependency and should not pull
41
+ * the platform's shared bundle onto a customer's machine to learn four
42
+ * characters. `doctor.test.ts` reads the declaration out of
43
+ * `packages/shared/src/space-addressing.ts` and fails if the two ever differ.
44
+ */
45
+ export declare const READER_API_SEGMENT = "_api";
33
46
  //# sourceMappingURL=doctor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../src/doctor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAE3C;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,WAAW;IAC1B,yEAAyE;IACzE,GAAG,EAAE,MAAM,CAAC;IACZ,6EAA6E;IAC7E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;CAC1B;AAED,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB;AAKD,wBAAsB,SAAS,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC,CA+VzE"}
1
+ {"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../src/doctor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAE3C;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,WAAW;IAC1B,yEAAyE;IACzE,GAAG,EAAE,MAAM,CAAC;IACZ,6EAA6E;IAC7E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;CAC1B;AAED,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB;AAKD,wBAAsB,SAAS,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC,CAiUzE;AAoCD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,kBAAkB,SAAS,CAAC"}
package/dist/doctor.js CHANGED
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.READER_API_SEGMENT = void 0;
3
4
  exports.runDoctor = runDoctor;
4
5
  /** A crawler-ish UA: some CDNs answer bots differently, which is the point. */
5
6
  const CRAWLER_UA = 'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)';
@@ -45,58 +46,62 @@ async function runDoctor(input) {
45
46
  *
46
47
  * Two things follow. The status has to be read. And on a reader URL the
47
48
  * default probe is the WRONG origin to ask: a customer's host serves their
48
- * docs, not our API, and `/api` there is theirs — so an absent route is a
49
- * skip that says where the real endpoint is, never a pass and never a scary
50
- * failure for something they do not operate. Reachability of the platform is
49
+ * docs, not our API, and `/api` there is theirs — so before giving up we ask
50
+ * the platform's OWN mount on this host (see `mountCandidates`), and only a
51
+ * mount that does not answer is a skip. Reachability of the platform is
51
52
  * already proven by the page fetch below; this check is about the API.
52
53
  */
53
54
  // "Nobody told us": unset, or blank, which are the same thing.
54
55
  const defaultedApiBase = stated === undefined;
55
- const health = await get(`${apiBase}/api/health`, { accept: 'application/json' });
56
- if (!health.ok) {
57
- add('health', 'Health endpoint answers', 'fail', health.error, 'A caller cannot tell an outage from a bug.');
58
- }
59
- else if (health.res.status === 404 && defaultedApiBase) {
60
- /*
61
- * A path-mounted reader has the platform's API under its own mount.
62
- *
63
- * Skipping was right compared with passing a 404, and the customer who
64
- * caught the pass said so — then asked the obvious next question: their
65
- * section answers at `<mount>/_api`, which IS ours, so health can be
66
- * checked rather than skipped. Only then is a skip the honest answer.
67
- */
68
- const mount = site.pathname.replace(/\/+$/, '').split('/').filter(Boolean)[0];
69
- const mounted = mount
70
- ? await get(`${origin}/${mount}/_api/health`, { accept: 'application/json' })
71
- : null;
72
- if (mounted?.ok && mounted.res.status >= 200 && mounted.res.status < 300) {
73
- add('health', 'Health endpoint answers JSON', 'pass', `${mounted.res.status} from ${origin}/${mount}/_api/health — the platform's own mount under this path.`, 'A caller cannot tell an outage from a bug.');
74
- }
75
- else if (mounted?.ok && mounted.res.status >= 500) {
76
- add('health', 'Health endpoint answers JSON', 'fail', `${mounted.res.status} from ${origin}/${mount}/_api/health.`, 'The API serving this section is unhealthy, whatever the reader pages do.');
77
- }
78
- else {
79
- add('health', 'Health endpoint answers JSON', 'skip', `404 — ${apiBase} does not route /api/health, and ${mount ? `${origin}/${mount}/_api/health` : 'no mount'} did not answer either. This host serves the reader; the API it is served by has its own origin.`, 'Re-run with --api-base <origin> to check the API that serves this site.');
56
+ const directUrl = `${apiBase}/api/health`;
57
+ const health = await get(directUrl, { accept: 'application/json' });
58
+ let verdict = healthVerdict(health, directUrl);
59
+ /*
60
+ * The platform's own API, under the mount this address is served at.
61
+ *
62
+ * Only reached when the host's own `/api/health` did not answer healthily
63
+ * AND nobody named an `--api-base` — on a customer's domain that path is
64
+ * theirs, so whatever it said is not a report about us.
65
+ */
66
+ const tried = [];
67
+ let mountVerdict = null;
68
+ if (verdict.state !== 'pass' && defaultedApiBase) {
69
+ for (const mount of mountCandidates(site)) {
70
+ const url = `${origin}${mount}/${exports.READER_API_SEGMENT}/health`;
71
+ tried.push(url);
72
+ const probe = await get(url, { accept: 'application/json' });
73
+ const mounted = healthVerdict(probe, url);
74
+ if (mounted.state === 'pass') {
75
+ mountVerdict = {
76
+ state: 'pass',
77
+ detail: `${probe.ok ? probe.res.status : 200} from ${url} — the platform's own mount under this address.`,
78
+ matters: HEALTH_MATTERS,
79
+ };
80
+ break;
81
+ }
82
+ // A mount that answers 5xx IS ours and IS unhealthy. Anything else
83
+ // (404, a refused connection) only means this was not the mount.
84
+ if (probe.ok && probe.res.status >= 500) {
85
+ mountVerdict = {
86
+ state: 'fail',
87
+ detail: `${probe.res.status} from ${url}.`,
88
+ matters: 'The API serving this section is unhealthy, whatever the reader pages do.',
89
+ };
90
+ break;
91
+ }
80
92
  }
81
93
  }
82
- else if (health.res.status < 200 || health.res.status >= 300) {
83
- add('health', 'Health endpoint answers JSON', 'fail', `${health.res.status} from ${apiBase}/api/health: ${health.text.slice(0, 80)}`, 'A health endpoint that does not answer 2xx is down, whatever its body parses as.');
94
+ if (mountVerdict) {
95
+ verdict = mountVerdict;
84
96
  }
85
- else {
86
- let parsed = null;
87
- try {
88
- parsed = JSON.parse(health.text);
89
- }
90
- catch {
91
- parsed = null;
92
- }
93
- if (parsed && typeof parsed === 'object') {
94
- add('health', 'Health endpoint answers JSON', 'pass', `${health.res.status} with a JSON body.`, '');
95
- }
96
- else {
97
- add('health', 'Health endpoint answers JSON', 'fail', `${health.res.status} with a non-JSON body: ${health.text.slice(0, 80)}`, 'A plain-text 500 reads as a permanent bug, so a careful client stops retrying a few-minute outage.');
98
- }
97
+ else if (defaultedApiBase && health.ok && health.res.status === 404) {
98
+ verdict = {
99
+ state: 'skip',
100
+ detail: `404 — ${apiBase} does not route /api/health, and ${tried.length ? tried.join(' nor ') : 'no mount'} did not answer either. This host serves the reader; the API it is served by has its own origin.`,
101
+ matters: 'Re-run with --api-base <origin> to check the API that serves this site.',
102
+ };
99
103
  }
104
+ add('health', 'Health endpoint answers JSON', verdict.state, verdict.detail, verdict.matters);
100
105
  // 2. A logged-out reader gets the page, not a sign-in.
101
106
  const anon = await get(site.toString(), { accept: 'text/html' });
102
107
  const html = anon.ok ? anon.text : '';
@@ -228,6 +233,70 @@ async function runDoctor(input) {
228
233
  warnings: checks.filter((c) => c.state === 'skip').length,
229
234
  };
230
235
  }
236
+ const HEALTH_MATTERS = 'A caller cannot tell an outage from a bug.';
237
+ /** What one health probe, on its own, says about the API behind it. */
238
+ function healthVerdict(probe, url) {
239
+ if (!probe.ok)
240
+ return { state: 'fail', detail: probe.error, matters: HEALTH_MATTERS };
241
+ const { status } = probe.res;
242
+ if (status < 200 || status >= 300) {
243
+ return {
244
+ state: 'fail',
245
+ detail: `${status} from ${url}: ${probe.text.slice(0, 80)}`,
246
+ matters: 'A health endpoint that does not answer 2xx is down, whatever its body parses as.',
247
+ };
248
+ }
249
+ let parsed = null;
250
+ try {
251
+ parsed = JSON.parse(probe.text);
252
+ }
253
+ catch {
254
+ parsed = null;
255
+ }
256
+ if (!parsed || typeof parsed !== 'object') {
257
+ return {
258
+ state: 'fail',
259
+ detail: `${status} with a non-JSON body: ${probe.text.slice(0, 80)}`,
260
+ matters: 'A plain-text 500 reads as a permanent bug, so a careful client stops retrying a few-minute outage.',
261
+ };
262
+ }
263
+ return { state: 'pass', detail: `${status} with a JSON body.`, matters: '' };
264
+ }
265
+ /**
266
+ * The segment a hosted reader's API answers under. Underscore-prefixed on
267
+ * purpose: slugs are `^[a-z0-9]+(?:-[a-z0-9]+)*$`, so no space, collection or
268
+ * page can be called `_api` and this can never shadow somebody's content.
269
+ *
270
+ * A SECOND copy of a string the platform's shared package owns, which is the drift that
271
+ * would make this probe wrong and silent. It is copied rather than imported
272
+ * because this package publishes to npm with one dependency and should not pull
273
+ * the platform's shared bundle onto a customer's machine to learn four
274
+ * characters. `doctor.test.ts` reads the declaration out of
275
+ * `packages/shared/src/space-addressing.ts` and fails if the two ever differ.
276
+ */
277
+ exports.READER_API_SEGMENT = '_api';
278
+ /**
279
+ * Where the platform's own API lives on a customer's host, most specific first.
280
+ *
281
+ * The first version of this guessed ONE address — the first path segment — and
282
+ * a customer on a site domain got a skip anyway, which is the defect as filed.
283
+ * The two mounts are different shapes:
284
+ *
285
+ * - a PATH-mounted section is `acme.com/docs/…`, forwarded to us by the
286
+ * customer's edge under that prefix, so health is `acme.com/docs/_api/health`
287
+ * and `acme.com/_api/health` never reaches us;
288
+ * - a SITE domain is mounted at the ROOT of the host, so health is
289
+ * `acme.com/_api/health`, and the first path segment is a space or a page —
290
+ * `acme.com/getting-started/_api/health` is nothing at all.
291
+ *
292
+ * Nothing in a URL distinguishes them from outside, which is the whole reason
293
+ * the first guess was wrong, so both are asked and the first that answers wins.
294
+ * A root URL on a path-mounted domain has no segment, so it asks one address.
295
+ */
296
+ function mountCandidates(site) {
297
+ const first = site.pathname.replace(/\/+$/, '').split('/').filter(Boolean)[0];
298
+ return first ? [`/${first}`, ''] : [''];
299
+ }
231
300
  /** How many distinct pictures one page's report will fetch. */
232
301
  const IMAGE_L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