authflow-cli 0.4.1 → 0.6.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 (79) hide show
  1. package/README.md +62 -341
  2. package/dist/checks.d.ts +30 -0
  3. package/dist/checks.js +36 -0
  4. package/dist/checks.js.map +1 -0
  5. package/dist/client-conformance.d.ts +5 -1
  6. package/dist/client-conformance.js +9 -1
  7. package/dist/client-conformance.js.map +1 -1
  8. package/dist/commands/account.d.ts +2 -0
  9. package/dist/commands/account.js +105 -0
  10. package/dist/commands/account.js.map +1 -0
  11. package/dist/commands/doctor.js +5 -1
  12. package/dist/commands/doctor.js.map +1 -1
  13. package/dist/commands/mcp.js +11 -6
  14. package/dist/commands/mcp.js.map +1 -1
  15. package/dist/commands/plan.js +7 -7
  16. package/dist/commands/plan.js.map +1 -1
  17. package/dist/commands/register.js +30 -2
  18. package/dist/commands/register.js.map +1 -1
  19. package/dist/commands/set-domain.d.ts +34 -0
  20. package/dist/commands/set-domain.js +162 -0
  21. package/dist/commands/set-domain.js.map +1 -0
  22. package/dist/commands/signup.d.ts +1 -0
  23. package/dist/commands/signup.js +4 -50
  24. package/dist/commands/signup.js.map +1 -1
  25. package/dist/config.d.ts +36 -1
  26. package/dist/config.js +1 -1
  27. package/dist/config.js.map +1 -1
  28. package/dist/credentials.d.ts +22 -0
  29. package/dist/credentials.js +206 -0
  30. package/dist/credentials.js.map +1 -0
  31. package/dist/custom-domain.d.ts +96 -0
  32. package/dist/custom-domain.js +289 -0
  33. package/dist/custom-domain.js.map +1 -0
  34. package/dist/doctor.d.ts +31 -23
  35. package/dist/doctor.js +271 -57
  36. package/dist/doctor.js.map +1 -1
  37. package/dist/google-redirect.d.ts +5 -1
  38. package/dist/google-redirect.js +11 -5
  39. package/dist/google-redirect.js.map +1 -1
  40. package/dist/integration-plans.json +80 -0
  41. package/dist/integration.d.ts +17 -23
  42. package/dist/integration.js +29 -236
  43. package/dist/integration.js.map +1 -1
  44. package/dist/login.d.ts +11 -0
  45. package/dist/login.js +181 -0
  46. package/dist/login.js.map +1 -0
  47. package/dist/management.d.ts +17 -0
  48. package/dist/management.js +67 -0
  49. package/dist/management.js.map +1 -0
  50. package/dist/mcp/management-server.d.ts +4 -0
  51. package/dist/mcp/management-server.js +103 -0
  52. package/dist/mcp/management-server.js.map +1 -0
  53. package/dist/mcp/server.d.ts +8 -1
  54. package/dist/mcp/server.js +137 -7
  55. package/dist/mcp/server.js.map +1 -1
  56. package/dist/program.js +6 -1
  57. package/dist/program.js.map +1 -1
  58. package/dist/rail.d.ts +16 -0
  59. package/dist/rail.js +43 -0
  60. package/dist/rail.js.map +1 -1
  61. package/dist/resource-urls.d.ts +27 -0
  62. package/dist/resource-urls.js +56 -0
  63. package/dist/resource-urls.js.map +1 -0
  64. package/dist/secrets.d.ts +29 -14
  65. package/dist/secrets.js +201 -90
  66. package/dist/secrets.js.map +1 -1
  67. package/dist/status.d.ts +15 -1
  68. package/dist/status.js +68 -6
  69. package/dist/status.js.map +1 -1
  70. package/dist/surface.d.ts +1 -0
  71. package/dist/surface.js +1 -0
  72. package/dist/surface.js.map +1 -1
  73. package/dist/tenant-host.d.ts +49 -0
  74. package/dist/tenant-host.js +367 -0
  75. package/dist/tenant-host.js.map +1 -0
  76. package/dist/version.d.ts +10 -0
  77. package/dist/version.js +27 -0
  78. package/dist/version.js.map +1 -0
  79. package/package.json +6 -5
@@ -0,0 +1,367 @@
1
+ import { resolveCname, resolveTxt } from "node:dns/promises";
2
+ import { connect as tlsConnect } from "node:tls";
3
+ import { fetchOrNull, unauthenticatedInitialize } from "./checks.js";
4
+ import { customDomainState, defaultPublicPath, setDomainCommandLine, summarizeCustomDomain, } from "./custom-domain.js";
5
+ import { publicResourceUrl } from "./resource-urls.js";
6
+ export const systemDnsResolver = { resolveCname, resolveTxt };
7
+ const tlsTimeoutMs = 15_000;
8
+ const httpsPort = 443;
9
+ const msPerDay = 86_400_000;
10
+ /**
11
+ * Renewal is automatic once the _acme-challenge CNAME validates, and starts well before expiry. A
12
+ * certificate this close to the end means it has been failing to renew for weeks.
13
+ */
14
+ const certExpiryFailDays = 7;
15
+ const prmRootPath = "/.well-known/oauth-protected-resource";
16
+ export async function runTenantHostChecks(options) {
17
+ const host = options.host;
18
+ const dns = options.dns ?? systemDnsResolver;
19
+ const tls = options.tls ?? probeTls;
20
+ const now = options.now ?? (() => new Date());
21
+ // A receipt registered on a different host says nothing about this one, so it supplies no
22
+ // expectations; the first check reports the mismatch.
23
+ const receipt = options.receipt?.public_host?.trim().toLowerCase() === host ? options.receipt : undefined;
24
+ const expected = expectations(host, receipt);
25
+ const note = options.receiptNote ?? "no receipt for this host";
26
+ const checks = [checkRegistration(host, options.receipt, receipt, options.receiptNote)];
27
+ checks.push(...(await checkDns(host, expected, dns, note)));
28
+ const handshake = await checkTls(host, tls, now, receipt);
29
+ checks.push(handshake.check);
30
+ checks.push(await checkHttpRedirect(host, expected.path));
31
+ // Fetch refuses an untrusted certificate, so with a failed handshake every https check below
32
+ // would fail with the same unhelpful "fetch failed". The TLS check already says why.
33
+ if (!handshake.usable) {
34
+ checks.push({
35
+ name: "host https checks",
36
+ pass: true,
37
+ skipped: true,
38
+ detail: `Skipped the PRM and 401 checks: the TLS check failed, so https requests to ${host} would ` +
39
+ "fail with misleading errors.",
40
+ });
41
+ return checks;
42
+ }
43
+ checks.push(await checkPrm("path", `https://${host}${prmRootPath}${expected.path}`, expected.resource), await checkPrm("root", `https://${host}${prmRootPath}`, expected.resource), await checkChallenge(host, expected.path));
44
+ return checks;
45
+ }
46
+ function expectations(host, receipt) {
47
+ const path = receipt?.public_path?.trim() || defaultPublicPath;
48
+ const records = receipt?.custom_domain?.records ?? [];
49
+ return {
50
+ path,
51
+ resource: receipt?.resource?.trim() || publicResourceUrl(host, path),
52
+ fromReceipt: receipt !== undefined,
53
+ state: receipt ? customDomainState(receipt) : undefined,
54
+ cnameTarget: receipt?.custom_domain?.cname_target?.trim() ||
55
+ records.find((record) => record.purpose === "traffic")?.value,
56
+ ownership: records.find((record) => record.purpose === "ownership"),
57
+ certificate: records.find((record) => record.purpose === "certificate"),
58
+ };
59
+ }
60
+ function checkRegistration(host, given, matched, note) {
61
+ const name = "host custom domain";
62
+ if (!given) {
63
+ return skip(name, `No receipt for ${host} (${note ?? "none was supplied"}), so the expected DNS targets are ` +
64
+ "unknown: records are checked for presence only, not compared.");
65
+ }
66
+ const slug = given.slug ?? "<slug>";
67
+ if (!matched) {
68
+ const registeredOn = given.public_host ? `'${given.public_host}'` : "the gateway host";
69
+ return fail(name, `Resource '${slug}' is registered on ${registeredOn}, not on ${host}.`, `Check --host, or point the resource at this host: authflow set-domain --slug ${slug} --host ${host}`);
70
+ }
71
+ const summary = summarizeCustomDomain(matched);
72
+ if (customDomainState(matched) === "ready") {
73
+ return pass(name, `${host} is registered on '${slug}': ${summary}.`);
74
+ }
75
+ return fail(name, `${host} is registered on '${slug}', but the rail reports ${summary}.`, `Finish the DNS records, then have the rail re-check: ${setDomainCommandLine(slug)}`);
76
+ }
77
+ async function checkDns(host, expected, dns, note) {
78
+ return [
79
+ await checkTrafficCname(host, expected, dns, note),
80
+ await checkCertificateCname(host, expected, dns, note),
81
+ await checkOwnershipTxt(host, expected, dns, note),
82
+ ];
83
+ }
84
+ async function checkTrafficCname(host, expected, dns, note) {
85
+ const name = "host DNS: traffic CNAME";
86
+ const lookup = await lookupCname(dns, host);
87
+ if (lookup.kind === "error") {
88
+ return dnsLookupFailed(name, `CNAME for ${host}`, lookup.message);
89
+ }
90
+ if (lookup.kind === "missing") {
91
+ return fail(name, `${host} has no CNAME record.`, `Add a CNAME for ${host} pointing at ${expected.cnameTarget ?? "the cname_target in your receipt (authflow status shows it)"}. ` +
92
+ "Until it points at the edge, traffic never reaches Authflow.");
93
+ }
94
+ const target = expected.cnameTarget ? normalizeDnsName(expected.cnameTarget) : undefined;
95
+ if (!target) {
96
+ return skip(name, `${host} CNAME -> ${lookup.values[0]}. Not compared: ${note}.`);
97
+ }
98
+ if (lookup.values.includes(target)) {
99
+ return pass(name, `${host} CNAME -> ${target}.`);
100
+ }
101
+ return fail(name, `${host} CNAME points at ${lookup.values.join(", ")}, expected ${target}.`, `Change the CNAME for ${host} to ${target}. A CNAME to anywhere else sends traffic past Authflow.`);
102
+ }
103
+ async function checkCertificateCname(host, expected, dns, note) {
104
+ const name = "host DNS: _acme-challenge CNAME";
105
+ const record = expected.certificate;
106
+ const recordName = record?.name ?? `_acme-challenge.${host}`;
107
+ // The rail issues this record only once provisioning has begun. Until then there is nothing for
108
+ // the tenant to have added, and calling its absence a failure would send them hunting for it.
109
+ if (expected.fromReceipt && !record) {
110
+ return skip(name, `The rail has not issued a certificate record yet (state: ${expected.state ?? "unknown"}), so there is nothing to check.`);
111
+ }
112
+ const lookup = await lookupCname(dns, recordName);
113
+ if (lookup.kind === "error") {
114
+ return dnsLookupFailed(name, `CNAME for ${recordName}`, lookup.message);
115
+ }
116
+ if (lookup.kind === "missing") {
117
+ return fail(name, `${recordName} has no CNAME record.`, record
118
+ ? `Add CNAME ${recordName} -> ${record.value}. Without it the certificate cannot be validated or renewed.`
119
+ : "Add the certificate CNAME the rail issued (authflow status lists it). Without it the certificate " +
120
+ "cannot be validated or renewed.");
121
+ }
122
+ if (!record) {
123
+ return skip(name, `${recordName} CNAME -> ${lookup.values[0]}. Not compared: ${note}.`);
124
+ }
125
+ const target = normalizeDnsName(record.value);
126
+ if (lookup.values.includes(target)) {
127
+ return pass(name, `${recordName} CNAME -> ${target}.`);
128
+ }
129
+ return fail(name, `${recordName} CNAME points at ${lookup.values.join(", ")}, expected ${target}.`, `Change it to ${target}, exactly as the rail issued it.`);
130
+ }
131
+ async function checkOwnershipTxt(host, expected, dns, note) {
132
+ const name = "host DNS: _authflow-verify TXT";
133
+ const record = expected.ownership;
134
+ const recordName = record?.name ?? `_authflow-verify.${host}`;
135
+ let values;
136
+ try {
137
+ values = (await dns.resolveTxt(recordName)).map((chunks) => chunks.join(""));
138
+ }
139
+ catch (err) {
140
+ if (!isMissingRecord(err)) {
141
+ return dnsLookupFailed(name, `TXT for ${recordName}`, errorMessage(err));
142
+ }
143
+ values = [];
144
+ }
145
+ if (values.length === 0) {
146
+ return fail(name, `${recordName} has no TXT record.`, record
147
+ ? `Add TXT ${recordName} = ${record.value}. It proves you own the host, and the rail will not provision it without.`
148
+ : "Add the ownership TXT record the rail issued (authflow status lists it).");
149
+ }
150
+ if (record) {
151
+ return values.some((value) => value.trim() === record.value.trim())
152
+ ? pass(name, `${recordName} TXT matches the receipt.`)
153
+ : fail(name, `${recordName} has TXT ${values.map((value) => `'${value}'`).join(", ")}, expected '${record.value}'.`, `Replace it with exactly ${record.value}.`);
154
+ }
155
+ return values.some((value) => value.trim().startsWith("authflow-verify="))
156
+ ? skip(name, `${recordName} has an authflow-verify= TXT record. Not compared: ${note}.`)
157
+ : fail(name, `${recordName} has TXT records, but none starts with authflow-verify=.`, "Add the ownership TXT record the rail issued (authflow status lists it).");
158
+ }
159
+ async function lookupCname(dns, name) {
160
+ try {
161
+ const values = (await dns.resolveCname(name)).map(normalizeDnsName);
162
+ return values.length > 0 ? { kind: "found", values } : { kind: "missing" };
163
+ }
164
+ catch (err) {
165
+ return isMissingRecord(err) ? { kind: "missing" } : { kind: "error", message: errorMessage(err) };
166
+ }
167
+ }
168
+ function dnsLookupFailed(name, what, message) {
169
+ return fail(name, `Looking up the ${what} failed: ${message}`, "This is a resolver problem, not proof the record is missing. Retry, or check the domain's nameservers.");
170
+ }
171
+ /** NXDOMAIN and "name exists, no such record" both mean the record is not there. */
172
+ function isMissingRecord(err) {
173
+ const code = err?.code;
174
+ return code === "ENODATA" || code === "ENOTFOUND";
175
+ }
176
+ function normalizeDnsName(value) {
177
+ return value.trim().toLowerCase().replace(/\.$/, "");
178
+ }
179
+ // ---------------------------------------------------------------------------------------------
180
+ // TLS
181
+ // ---------------------------------------------------------------------------------------------
182
+ async function checkTls(host, probe, now, receipt) {
183
+ const name = "host TLS certificate";
184
+ let peer;
185
+ try {
186
+ peer = await probe(host, httpsPort);
187
+ }
188
+ catch (err) {
189
+ return {
190
+ usable: false,
191
+ check: fail(name, `Could not complete a TLS handshake with ${host}:${httpsPort}: ${errorMessage(err)}`, "Either DNS does not point at the edge yet, or the edge has no certificate for the host. " +
192
+ "Check the DNS results above, then wait for the certificate."),
193
+ };
194
+ }
195
+ const days = Math.floor((peer.validTo.getTime() - now().getTime()) / msPerDay);
196
+ const expiry = describeExpiry(peer.validTo, days);
197
+ const who = `issuer ${peer.issuer}, subject ${peer.subject}`;
198
+ if (!peer.authorized) {
199
+ return {
200
+ usable: false,
201
+ check: fail(name, `The certificate ${host} presents is not trusted: ${peer.authorizationError ?? "unknown error"} (${who}; expires ${expiry}).`, tlsRemedy(host, peer.authorizationError, receipt)),
202
+ };
203
+ }
204
+ if (days < certExpiryFailDays) {
205
+ return {
206
+ usable: true,
207
+ check: fail(name, `The certificate is about to expire (${who}; expires ${expiry}).`, "Renewal is automatic once the _acme-challenge CNAME validates. A certificate this close to " +
208
+ "expiry means that record is missing or wrong."),
209
+ };
210
+ }
211
+ return { usable: true, check: pass(name, `Issued by ${peer.issuer} to ${peer.subject}; expires ${expiry}.`) };
212
+ }
213
+ /** `2027-01-01, in 89 days` or, for a lapsed certificate, `2026-01-01, 3 days ago`. */
214
+ function describeExpiry(validTo, days) {
215
+ const date = validTo.toISOString().slice(0, 10);
216
+ const unit = Math.abs(days) === 1 ? "day" : "days";
217
+ return days >= 0 ? `${date}, in ${days} ${unit}` : `${date}, ${-days} ${unit} ago`;
218
+ }
219
+ function tlsRemedy(host, code, receipt) {
220
+ const recheck = receipt ? ` Then: ${setDomainCommandLine(receipt.slug ?? "<slug>")}` : "";
221
+ if (code === "ERR_TLS_CERT_ALTNAME_INVALID") {
222
+ return (`The edge answered with a certificate that does not cover ${host}. Its certificate for the host ` +
223
+ `is not active yet, or the traffic CNAME does not point at the edge. Check the DNS results above.${recheck}`);
224
+ }
225
+ if (code === "CERT_HAS_EXPIRED") {
226
+ return "The certificate has expired. Renewal is automatic once the _acme-challenge CNAME validates; check that record.";
227
+ }
228
+ return `Clients will refuse this certificate. Check the DNS results above, then wait for the edge to issue one.${recheck}`;
229
+ }
230
+ /** The certificate a server presents, whether or not Node trusts it. */
231
+ export const probeTls = (host, port) => new Promise((resolve, reject) => {
232
+ // Untrusted certificates are the finding here, not a reason to refuse the connection.
233
+ const socket = tlsConnect({ host, port, servername: host, rejectUnauthorized: false });
234
+ socket.setTimeout(tlsTimeoutMs, () => {
235
+ socket.destroy(new Error(`timed out after ${tlsTimeoutMs / 1000}s`));
236
+ });
237
+ socket.once("error", reject);
238
+ socket.once("secureConnect", () => {
239
+ try {
240
+ resolve(describePeer(socket.getPeerCertificate(), socket.authorized, socket.authorized ? undefined : String(socket.authorizationError)));
241
+ }
242
+ catch (err) {
243
+ reject(err);
244
+ }
245
+ finally {
246
+ socket.end();
247
+ }
248
+ });
249
+ });
250
+ export function describePeer(cert, authorized, authorizationError) {
251
+ const validTo = new Date(cert.valid_to);
252
+ if (!cert.valid_to || Number.isNaN(validTo.getTime())) {
253
+ throw new Error("the server presented no usable certificate");
254
+ }
255
+ return {
256
+ authorized,
257
+ authorizationError,
258
+ issuer: describeName(cert.issuer),
259
+ subject: describeName(cert.subject),
260
+ validTo,
261
+ };
262
+ }
263
+ /** `Let's Encrypt (E8)`: organisation and common name, whichever the certificate has. */
264
+ function describeName(name) {
265
+ const first = (value) => {
266
+ const single = Array.isArray(value) ? value[0] : value;
267
+ return typeof single === "string" && single.length > 0 ? single : undefined;
268
+ };
269
+ const organisation = first(name?.O);
270
+ const common = first(name?.CN);
271
+ if (organisation && common) {
272
+ return `${organisation} (${common})`;
273
+ }
274
+ return common ?? organisation ?? "unknown";
275
+ }
276
+ // ---------------------------------------------------------------------------------------------
277
+ // HTTP
278
+ // ---------------------------------------------------------------------------------------------
279
+ async function checkHttpRedirect(host, path) {
280
+ const name = "host http redirects to https";
281
+ const url = `http://${host}${path}`;
282
+ const response = await fetchOrNull(url, { redirect: "manual" });
283
+ if (!response.ok) {
284
+ return fail(name, `GET ${url} could not be reached: ${response.error}`, "Port 80 is not answering. The edge redirects plain http for proxied hostnames, so the traffic " +
285
+ "CNAME is probably not in place yet.");
286
+ }
287
+ const status = response.status ?? 0;
288
+ if ([301, 302, 303, 307, 308].includes(status)) {
289
+ const target = parseUrl(response.location ?? "", url);
290
+ return target?.protocol === "https:" && target.host === host
291
+ ? pass(name, `GET ${url} returned ${status} to ${response.location}.`)
292
+ : fail(name, `GET ${url} returned ${status} to '${response.location ?? ""}', not to https://${host}.`, "The redirect has to stay on the tenant host and switch to https, or a client following it " +
293
+ "connects somewhere else or stays unencrypted.");
294
+ }
295
+ return fail(name, `GET ${url} returned ${status} over plain http instead of redirecting to https.`, "Enable Always Use HTTPS on the edge zone. Without it, a client configured with an http:// URL " +
296
+ "talks to the server unencrypted.");
297
+ }
298
+ async function checkPrm(label, url, expectedResource) {
299
+ const name = `host PRM (${label})`;
300
+ const response = await fetchOrNull(url);
301
+ if (!response.ok) {
302
+ return fail(name, `GET ${url} could not be reached: ${response.error}`, "Check the host's DNS and certificate above.");
303
+ }
304
+ if (response.status !== 200) {
305
+ return fail(name, `GET ${url} returned ${response.status}, expected 200.`, response.status === 404
306
+ ? "The host answers but the rail does not recognise it: the custom domain is not ready, or the " +
307
+ "edge is not forwarding the host. Clients discover the authorization server here (Claude Code " +
308
+ "probes the root path)."
309
+ : "Clients discover the authorization server from this document. File a rail bug.");
310
+ }
311
+ let resource;
312
+ try {
313
+ resource = JSON.parse(response.body ?? "").resource;
314
+ }
315
+ catch {
316
+ return fail(name, `${url} did not return JSON.`, "Something other than the rail is answering on the host.");
317
+ }
318
+ if (resource !== expectedResource) {
319
+ return fail(name, `${url} names resource '${String(resource)}', expected '${expectedResource}'.`, "Tokens are audience-bound to this value. A client that connected at the host would be refused at " +
320
+ "/authorize as invalid_target.");
321
+ }
322
+ return pass(name, `GET ${url} returned 200 with resource ${resource}.`);
323
+ }
324
+ async function checkChallenge(host, path) {
325
+ const name = "host 401 challenge";
326
+ const url = `https://${host}${path}`;
327
+ const response = await fetchOrNull(url, unauthenticatedInitialize());
328
+ if (!response.ok) {
329
+ return fail(name, `Unauthenticated POST ${url} could not be reached: ${response.error}`, "Check the host's DNS and certificate above.");
330
+ }
331
+ if (response.status !== 401) {
332
+ return fail(name, `Unauthenticated POST ${url} returned ${response.status}, expected 401.`, response.status === 404
333
+ ? "The host answers but the rail does not recognise it: the custom domain is not ready, or the edge is not forwarding the host."
334
+ : "An unauthenticated connect that does not 401 means clients will never start OAuth.");
335
+ }
336
+ const challenge = response.headers?.get("www-authenticate") ?? "";
337
+ const metadata = resourceMetadataValue(challenge);
338
+ if (!metadata) {
339
+ return fail(name, `401 returned, but WWW-Authenticate has no resource_metadata parameter: '${challenge}'.`, "MCP clients cannot discover the authorization server. File a rail bug.");
340
+ }
341
+ const target = parseUrl(metadata);
342
+ if (target?.protocol !== "https:" || target.host !== host) {
343
+ return fail(name, `The 401's resource_metadata is '${metadata}', which is not an https URL on ${host}.`, "Clients fetch protected resource metadata from this URL. It has to name the host they connected " +
344
+ "to; pointing it at the gateway host sends them to the wrong audience.");
345
+ }
346
+ return pass(name, `401 with resource_metadata=${metadata}.`);
347
+ }
348
+ /** The `resource_metadata` parameter of a Bearer challenge, quoted or bare. */
349
+ function resourceMetadataValue(challenge) {
350
+ const match = /resource_metadata\s*=\s*(?:"([^"]*)"|([^\s,]+))/i.exec(challenge);
351
+ return match?.[1] ?? match?.[2] ?? undefined;
352
+ }
353
+ function parseUrl(value, base) {
354
+ try {
355
+ return new URL(value, base);
356
+ }
357
+ catch {
358
+ return undefined;
359
+ }
360
+ }
361
+ function errorMessage(err) {
362
+ return err instanceof Error ? err.message : String(err);
363
+ }
364
+ const pass = (name, detail) => ({ name, pass: true, detail });
365
+ const skip = (name, detail) => ({ name, pass: true, skipped: true, detail });
366
+ const fail = (name, detail, remedy) => ({ name, pass: false, detail, remedy });
367
+ //# sourceMappingURL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CP server, and both copies drifted from package.json.
4
+ *
5
+ * Read at runtime instead of imported: package.json sits outside tsconfig's `rootDir` (src), so a
6
+ * JSON import would either break the build or force a layout change. `../package.json` is the same
7
+ * relative path from `src/` (tsx, tests) and from `dist/` (the published build), and npm always
8
+ * ships package.json with the package.
9
+ */
10
+ export declare const cliVersion: string;
@@ -0,0 +1,27 @@
1
+ import { readFileSync } from "node:fs";
2
+ /**
3
+ * The CLI's version, read from package.json rather than restated in source. It used to be typed
4
+ * out in program.ts and in the MCP server, and both copies drifted from package.json.
5
+ *
6
+ * Read at runtime instead of imported: package.json sits outside tsconfig's `rootDir` (src), so a
7
+ * JSON import would either break the build or force a layout change. `../package.json` is the same
8
+ * relative path from `src/` (tsx, tests) and from `dist/` (the published build), and npm always
9
+ * ships package.json with the package.
10
+ */
11
+ export const cliVersion = readCliVersion();
12
+ function readCliVersion() {
13
+ const manifest = new URL("../package.json", import.meta.url);
14
+ let version;
15
+ try {
16
+ version = JSON.parse(readFileSync(manifest, "utf8")).version;
17
+ }
18
+ catch (err) {
19
+ const reason = err instanceof Error ? err.message : String(err);
20
+ throw new Error(`Cannot read the CLI version from package.json: ${reason}`);
21
+ }
22
+ if (typeof version !== "string" || version.length === 0) {
23
+ throw new Error("package.json has no version, so the CLI cannot report one.");
24
+ }
25
+ return version;
26
+ }
27
+ //# sourceMappingURL=version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,UAAU,GAAW,cAAc,EAAE,CAAC;AAEnD,SAAS,cAAc;IACrB,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,iBAAiB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC7D,IAAI,OAAgB,CAAC;IACrB,IAAI,CAAC;QACH,OAAO,GAAI,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAA2B,CAAC,OAAO,CAAC;IAC1F,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,MAAM,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAChE,MAAM,IAAI,KAAK,CAAC,kDAAkD,MAAM,EAAE,CAAC,CAAC;IAC9E,CAAC;IAED,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxD,MAAM,IAAI,KAAK,CAAC,4DAA4D,CAAC,CAAC;IAChF,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "authflow-cli",
3
- "version": "0.4.1",
3
+ "version": "0.6.0",
4
4
  "description": "Authflow Rail onboarding CLI — register, mint-header, probe, scaffold",
5
5
  "type": "module",
6
6
  "bin": {
@@ -12,7 +12,7 @@
12
12
  "README.md"
13
13
  ],
14
14
  "scripts": {
15
- "build": "tsc",
15
+ "build": "tsc && node scripts/copy-integration-plans.mjs",
16
16
  "start": "node dist/cli.js",
17
17
  "authflow": "tsx src/cli.ts",
18
18
  "test": "node --import tsx --test \"test/**/*.test.ts\"",
@@ -23,6 +23,7 @@
23
23
  "node": ">=20"
24
24
  },
25
25
  "dependencies": {
26
+ "@napi-rs/keyring": "2.1.0",
26
27
  "@modelcontextprotocol/sdk": "^1.30.0",
27
28
  "commander": "^13.1.0",
28
29
  "zod": "^4.5.4"
@@ -34,12 +35,12 @@
34
35
  },
35
36
  "homepage": "https://docs.authflow.ai/docs/tools/cli",
36
37
  "bugs": {
37
- "url": "https://github.com/Snyder-Technology-LLC/Authflow.Rail/issues"
38
+ "url": "https://github.com/Snyder-Technology-LLC/Authflow/issues"
38
39
  },
39
40
  "repository": {
40
41
  "type": "git",
41
- "url": "git+https://github.com/Snyder-Technology-LLC/Authflow.Rail.git",
42
- "directory": "sdk/cli"
42
+ "url": "git+https://github.com/Snyder-Technology-LLC/Authflow.git",
43
+ "directory": "rail/sdk/cli"
43
44
  },
44
45
  "keywords": [
45
46
  "mcp",