@adonis-agora/durable 1.0.0-rc.12 → 1.0.0-rc.13

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 (65) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/assets/spa/assets/index-DkiDTtil.css +1 -0
  3. package/dist/assets/spa/assets/index-DlFfJoOc.js +16 -0
  4. package/dist/assets/spa/assets/index-DlFfJoOc.js.map +1 -0
  5. package/dist/assets/spa/index.html +2 -2
  6. package/dist/commands/agora_doctor.d.ts +23 -0
  7. package/dist/commands/agora_doctor.d.ts.map +1 -0
  8. package/dist/commands/agora_doctor.js +110 -0
  9. package/dist/commands/agora_doctor.js.map +1 -0
  10. package/dist/commands/durable_doctor.d.ts +8 -0
  11. package/dist/commands/durable_doctor.d.ts.map +1 -0
  12. package/dist/commands/durable_doctor.js +8 -0
  13. package/dist/commands/durable_doctor.js.map +1 -0
  14. package/dist/commands/main.d.ts +4 -3
  15. package/dist/commands/main.d.ts.map +1 -1
  16. package/dist/commands/main.js +5 -1
  17. package/dist/commands/main.js.map +1 -1
  18. package/dist/providers/dashboard_provider.d.ts +9 -0
  19. package/dist/providers/dashboard_provider.d.ts.map +1 -1
  20. package/dist/providers/dashboard_provider.js +128 -8
  21. package/dist/providers/dashboard_provider.js.map +1 -1
  22. package/dist/providers/durable_provider.d.ts.map +1 -1
  23. package/dist/providers/durable_provider.js +5 -0
  24. package/dist/providers/durable_provider.js.map +1 -1
  25. package/dist/src/dashboard/console_authorize.d.ts +16 -0
  26. package/dist/src/dashboard/console_authorize.d.ts.map +1 -1
  27. package/dist/src/dashboard/console_authorize.js +50 -0
  28. package/dist/src/dashboard/console_authorize.js.map +1 -1
  29. package/dist/src/dashboard/console_switcher.d.ts +121 -0
  30. package/dist/src/dashboard/console_switcher.d.ts.map +1 -0
  31. package/dist/src/dashboard/console_switcher.js +201 -0
  32. package/dist/src/dashboard/console_switcher.js.map +1 -0
  33. package/dist/src/dashboard/define_config.d.ts +4 -2
  34. package/dist/src/dashboard/define_config.d.ts.map +1 -1
  35. package/dist/src/dashboard/define_config.js.map +1 -1
  36. package/dist/src/dashboard/dev_tools.d.ts +99 -0
  37. package/dist/src/dashboard/dev_tools.d.ts.map +1 -0
  38. package/dist/src/dashboard/dev_tools.js +487 -0
  39. package/dist/src/dashboard/dev_tools.js.map +1 -0
  40. package/dist/src/dashboard/index.d.ts +6 -2
  41. package/dist/src/dashboard/index.d.ts.map +1 -1
  42. package/dist/src/dashboard/index.js +6 -2
  43. package/dist/src/dashboard/index.js.map +1 -1
  44. package/dist/src/dashboard/spa.d.ts +12 -1
  45. package/dist/src/dashboard/spa.d.ts.map +1 -1
  46. package/dist/src/dashboard/spa.js +6 -2
  47. package/dist/src/dashboard/spa.js.map +1 -1
  48. package/dist/src/doctor/agora_doctor.d.ts +116 -0
  49. package/dist/src/doctor/agora_doctor.d.ts.map +1 -0
  50. package/dist/src/doctor/agora_doctor.js +685 -0
  51. package/dist/src/doctor/agora_doctor.js.map +1 -0
  52. package/dist/src/doctor/checks.d.ts +22 -0
  53. package/dist/src/doctor/checks.d.ts.map +1 -0
  54. package/dist/src/doctor/checks.js +197 -0
  55. package/dist/src/doctor/checks.js.map +1 -0
  56. package/dist/src/doctor/index.d.ts +9 -0
  57. package/dist/src/doctor/index.d.ts.map +1 -0
  58. package/dist/src/doctor/index.js +16 -0
  59. package/dist/src/doctor/index.js.map +1 -0
  60. package/dist/src/index.d.ts +1 -1
  61. package/dist/src/index.js +1 -1
  62. package/package.json +10 -4
  63. package/dist/assets/spa/assets/index-B2kIfzsc.css +0 -1
  64. package/dist/assets/spa/assets/index-Bgf_8IJ0.js +0 -16
  65. package/dist/assets/spa/assets/index-Bgf_8IJ0.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/dashboard/index.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,eAAO,MAAM,OAAO,gBAAgB,CAAC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AAW,EACX,cAAc,EACd,MAAM,EACN,WAAW,EACX,MAAM,EACN,QAAQ,EACR,WAAW,EACX,EAAE,EACF,oBAAoB,EACpB,qBAAqB,EACrB,QAAQ,EACR,iBAAiB,EACjB,SAAS,EACT,QAAQ,EACR,OAAO,EACP,iBAAiB,GAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/dashboard/index.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,eAAO,MAAM,OAAO,gBAAgB,CAAC;AAErC,YAAY,EACV,gBAAgB,EAChB,uBAAuB,EACvB,kBAAkB,GACnB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,OAAO,IAAI,qBAAqB,EAChC,UAAU,EACV,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,yBAAyB,CAAC;AACjC,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE5E,OAAO,EAAE,MAAM,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACnF,YAAY,EACV,uBAAuB,EACvB,gBAAgB,EAChB,oBAAoB,EACpB,sBAAsB,EACtB,iBAAiB,EACjB,sBAAsB,EACtB,eAAe,GAChB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,wBAAwB,EACxB,uBAAuB,GACxB,MAAM,wBAAwB,CAAC;AAChC,YAAY,EACV,iBAAiB,EACjB,gBAAgB,EAChB,oBAAoB,EACpB,qBAAqB,EACrB,oBA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,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC"}
@@ -1,13 +1,17 @@
1
1
  /** Keep in sync with this package's `version` in package.json. */
2
- export const VERSION = '1.0.0-rc.12';
2
+ export const VERSION = '1.0.0-rc.13';
3
3
  // The built-in "access denied" page (what a browser sees on a refused page navigation).
4
4
  export { CONSOLE as ACCESS_DENIED_CONSOLE, escapeHtml, renderAccessDeniedPage, resolveAccessDeniedPage, } from './access_denied_page.js';
5
5
  // Fleet health / protocol-compatibility panel (design §7.6, §10).
6
6
  export { compat, enumerateLiveFleet, mergeFleets } from './compat.js';
7
7
  export { formatProtocolRange, outcomeClass, outcomeLabel } from './compat-view.js';
8
8
  // The shared console `authorize` contract (function, class, lazy import).
9
- export { authorizeByToken, normalizeConsoleDecision, resolveConsoleAuthorize, } from './console_authorize.js';
9
+ export { anyAuthorize, authorizeByToken, normalizeConsoleDecision, resolveConsoleAuthorize, } from './console_authorize.js';
10
+ // The cross-console switcher registry (`'agora.consoles'`) and global search.
11
+ export { AGORA_CONSOLES_BINDING, listVisibleConsoles, registerAgoraConsole, searchConsoles, } from './console_switcher.js';
10
12
  export { defineConfig, NO_AUTHORIZE_WARNING, normalizeAuthorizeResult, resolveConfig, } from './define_config.js';
13
+ // Developer tools for the app's dev MCP endpoint (`@adonis-agora/agent`), when it has one.
14
+ export { DEV_TOOLS_BINDING, durableDevTools, registerDurableDevTools } from './dev_tools.js';
11
15
  export { BlockedDiagnosticsRecorder } from './diagnostics-recorder.js';
12
16
  // Store-less `tenant` dashboard: adapt the RunGateway to the handlers' read/control port (design §8).
13
17
  export { dashboardEngineForTopology, gatewayDashboardEngine } from './gateway-adapter.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/dashboard/index.ts"],"names":[],"mappings":"AAAA,kEAAk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AAiB,CAAC"}
@@ -19,6 +19,15 @@ export interface InjectedConfig {
19
19
  base: string;
20
20
  /** JSON API base (`/durable/api`). */
21
21
  api: string;
22
+ /** The console switcher, present only when other Agora consoles are registered in the app. */
23
+ switcher?: SwitcherConfig;
24
+ }
25
+ /** Where the SPA asks which other consoles the viewer may open, and how many are registered. */
26
+ export interface SwitcherConfig {
27
+ /** `GET` it for the consoles the viewer may open; `<endpoint>/search?q=` searches them. */
28
+ endpoint: string;
29
+ /** Registered consoles other than this one (before any `authorize` runs). */
30
+ others: number;
22
31
  }
23
32
  /**
24
33
  * Rewrite the built `index.html` for serving: point Vite's placeholder base at the configured mount
@@ -35,5 +44,7 @@ export interface InjectedConfig {
35
44
  * failure looked like a routing bug rather than a policy one. The globals are still read by the
36
45
  * client as a fallback (tests, hand-embedding), but this is no longer how the provider speaks.
37
46
  */
38
- export declare function renderIndexHtml(html: string, basePath: string, apiBasePath: string): string;
47
+ export declare function renderIndexHtml(html: string, basePath: string, apiBasePath: string, extra?: {
48
+ switcher?: SwitcherConfig;
49
+ }): string;
39
50
  //# sourceMappingURL=spa.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"spa.d.ts","sourceRoot":"","sources":["../../../src/dashboard/spa.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;4GAC4G;AAC5G,eAAO,MAAM,gBAAgB,4BAA4B,CAAC;AAE1D,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAchD,CAAC;AAEF,4EAA4E;AAC5E,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAGnD;AAED,sGAAsG;AACtG,eAAO,MAAM,iBAAiB,6BAA6B,CAAC;AAE5D,yEAAyE;AACzE,MAAM,WAAW,cAAc;IAC7B,yDAAyD;IACzD,IAAI,EAAE,MAAM,CAAC;IACb,sCAAsC;IACtC,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAQ3F"}
1
+ {"version":3,"file":"spa.d.ts","sourceRoot":"","sources":["../../../src/dashboard/spa.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;4GAC4G;AAC5G,eAAO,MAAM,gBAAgB,4BAA4B,CAAC;AAE1D,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAchD,CAAC;AAEF,4EAA4E;AAC5E,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAGnD;AAED,sGAAsG;AACtG,eAAO,MAAM,iBAAiB,6BAA6B,CAAC;AAE5D,yEAAyE;AACzE,MAAM,WAAW,cAAc;IAC7B,yDAAyD;IACzD,IAAI,EAAE,MAAM,CAAC;IACb,sCAAsC;IACtC,GAAG,EAAE,MAAM,CAAC;IACZ,8FAA8F;IAC9F,QAAQ,CAAC,EAAE,cAAc,CAAC;CAC3B;AAED,gGAAgG;AAChG,MAAM,WAAW,cAAc;IAC7B,2FAA2F;IAC3F,QAAQ,EAAE,MAAM,CAAC;IACjB,6EAA6E;IAC7E,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,EACnB,KAAK,GAAE;IAAE,QAAQ,CAAC,EAAE,cAAc,CAAA;CAAO,GACxC,MAAM,CAYR"}
@@ -45,9 +45,13 @@ export const CONFIG_ELEMENT_ID = 'durable-dashboard-config';
45
45
  * failure looked like a routing bug rather than a policy one. The globals are still read by the
46
46
  * client as a fallback (tests, hand-embedding), but this is no longer how the provider speaks.
47
47
  */
48
- export function renderIndexHtml(html, basePath, apiBasePath) {
48
+ export function renderIndexHtml(html, basePath, apiBasePath, extra = {}) {
49
49
  const based = html.split(BASE_PLACEHOLDER).join(`${basePath}/`);
50
- const config = { base: basePath, api: apiBasePath };
50
+ const config = {
51
+ base: basePath,
52
+ api: apiBasePath,
53
+ ...(extra.switcher && extra.switcher.others > 0 ? { switcher: extra.switcher } : {}),
54
+ };
51
55
  // `<` escaped as `\u003c` inside the JSON: a data block ends at the first `</script`, and a
52
56
  // config value must not be able to close it early. Valid JSON either way.
53
57
  const json = JSON.stringify(config).replace(/</g, '\\u003c');
@@ -1 +1 @@
1
- {"version":3,"file":"spa.js","sourceRoot":"","sources":["../../../src/dashboard/spa.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;4GAC4G;AAC5G,MAAM,CAAC,MAAM,gBAAgB,GAAG,yBAAyB,CAAC;AAE1D,MAAM,CAAC,MAAM,aAAa,GAA2B;IACnD,KAAK,EAAE,gCAAgC;IACvC,MAAM,EAAE,gCAAgC;IACxC,MAAM,EAAE,yBAAyB;IACjC,MAAM,EAAE,iCAAiC;IACzC,OAAO,EAAE,iCAAiC;IAC1C,MAAM,EAAE,eAAe;IACvB,MAAM,EAAE,WAAW;IACnB,MAAM,EAAE,YAAY;IACpB,OAAO,EAAE,YAAY;IACrB,MAAM,EAAE,WAAW;IACnB,MAAM,EAAE,cAAc;IACtB,QAAQ,EAAE,YAAY;IACtB,OAAO,EAAE,WAAW;CACrB,CAAC;AAEF,4EAA4E;AAC5E,MAAM,UAAU,cAAc,CAAC,IAAY;IACzC,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC;IAC9C,OAAO,aAAa,CAAC,GAAG,CAAC,IAAI,0BAA0B,CAAC;AAC1D,CAAC;AAED,sGAAsG;AACtG,MAAM,CAAC,MAAM,iBAAiB,GAAG,0BAA0B,CAAC;AAU5D;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,eAAe,CAAC,IAAY,EAAE,QAAgB,EAAE,WAAmB;IACjF,MAAM,KAAK,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GAAG,CAAC,CAAC,CAAC;IAC9C,OAAO,aAAa,CAAC,GAAG,CAAC,IAAI,0BAA0B,CAAC;AAC1D,CAAC;AAED,sGAAsG;AACtG,MAAM,CAAC,MAAM,iBAAiB,GAAG,0BAA0B,CAAC;AAoB5D;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,eAAe,CAC7B,IAAY,EACZ,QAAgB,EAChB,WAAmB,EACnB,KAAK,GAAkC,EAAE;IAEzC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,IAAI,CAAC,GAAG,QAAQ,GAAG,CAAC,CAAC;IAChE,MAAM,MAAM,GAAmB;QAC7B,IAAI,EAAE,QAAQ;QACd,GAAG,EAAE,WAAW;QAChB,GAAG,CAAC,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACrF,CAAC;IACF,4FAA4F;IAC5F,0EAA0E;IAC1E,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IAC7D,MAAM,MAAM,GAAG,uCAAuC,iBAAiB,KAAK,IAAI,WAAW,CAAC;IAC5F,OAAO,KAAK,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,EAAE,GAAG,MAAM,SAAS,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,KAAK,CAAC;AACnG,CAAC"}
@@ -0,0 +1,116 @@
1
+ import type { ApplicationService } from '@adonisjs/core/types';
2
+ /** The container binding the registry lives at. */
3
+ export declare const AGORA_DOCTOR_BINDING = "agora.doctor";
4
+ /** Bound as a VALUE under `'agora.doctor'`. Data only. */
5
+ export interface AgoraDoctorRegistry {
6
+ readonly version: 1;
7
+ readonly checks: AgoraDoctorCheck[];
8
+ }
9
+ export type AgoraDoctorStatus = 'ok' | 'warn' | 'error' | 'skip';
10
+ export interface AgoraDoctorCheck {
11
+ /** `'<lib>.<kebab>'`, unique and frozen for 1.x: `'durable.verify-tenant'`. */
12
+ id: string;
13
+ /** `'durable'`. The package is `@adonis-agora/<lib>` unless {@link package} says otherwise. */
14
+ lib: string;
15
+ /** The npm package, when it is not `@adonis-agora/<lib>`. */
16
+ package?: string;
17
+ title: string;
18
+ /** `'cheap'` (default) reads config, env and files only; `'deep'` touches a DB, Redis or the network. */
19
+ cost?: 'cheap' | 'deep';
20
+ run(app: ApplicationService): AgoraDoctorResult | AgoraDoctorResult[] | Promise<AgoraDoctorResult | AgoraDoctorResult[]>;
21
+ }
22
+ export interface AgoraDoctorResult {
23
+ status: AgoraDoctorStatus;
24
+ /** One line, no secrets, no stack. */
25
+ message: string;
26
+ /** One line: the exact change to make. */
27
+ fix?: string;
28
+ /** Absolute URL of the lib docs page. */
29
+ docs?: string;
30
+ }
31
+ /** One reported result. */
32
+ export interface AgoraDoctorReportEntry extends AgoraDoctorResult {
33
+ id: string;
34
+ lib: string;
35
+ title: string;
36
+ ms: number;
37
+ }
38
+ /** What `agora:doctor --json` prints. */
39
+ export interface AgoraDoctorReport {
40
+ version: 1;
41
+ env: string;
42
+ summary: Record<AgoraDoctorStatus, number>;
43
+ libs: Array<{
44
+ lib: string;
45
+ package: string;
46
+ version: string | null;
47
+ }>;
48
+ results: AgoraDoctorReportEntry[];
49
+ }
50
+ export interface AgoraDoctorOptions {
51
+ libs?: string[];
52
+ only?: string;
53
+ deep?: boolean;
54
+ /** The app was not booted (`--no-boot`): deep checks are reported as skipped, never run. */
55
+ noBoot?: boolean;
56
+ strict?: boolean;
57
+ /** Per-check budget in ms (default 5000, deep checks 15000). */
58
+ timeoutMs?: number;
59
+ deepTimeoutMs?: number;
60
+ }
61
+ /** A doctor problem that stops the run itself (exit 2). */
62
+ export declare class AgoraDoctorUsageError extends Error {
63
+ }
64
+ interface ContainerLike {
65
+ hasBinding(binding: string): boolean;
66
+ bindValue(binding: string, value: unknown): void;
67
+ make(binding: string): Promise<unknown>;
68
+ }
69
+ /**
70
+ * Add a lib's checks to the app's doctor registry, creating it when absent. Call it from a provider's
71
+ * `boot()` (Adonis does not await `register()`, so an async registration there can be lost). A
72
+ * registry of another version is left alone; a duplicate id is skipped.
73
+ */
74
+ export declare function registerDoctorChecks(container: ContainerLike, checks: readonly AgoraDoctorCheck[]): Promise<void>;
75
+ /** The registered checks; throws {@link AgoraDoctorUsageError} on a registry of another version. */
76
+ export declare function readDoctorChecks(container: ContainerLike): Promise<AgoraDoctorCheck[]>;
77
+ /**
78
+ * The checks of every installed `@adonis-agora/*` package that publishes a `./doctor` entry
79
+ * (`export const agoraDoctorChecks`), imported from the app root without booting providers. A
80
+ * package whose entry fails to load is reported as an error (`<lib>.doctor-entry`), never skipped.
81
+ */
82
+ export declare function discoverDoctorChecks(app: ApplicationService): Promise<AgoraDoctorCheck[]>;
83
+ /** The directory of `name` as Node would find it from `from` (walking up `node_modules`), real path. */
84
+ export declare function packageDir(name: string, from: string): Promise<string | null>;
85
+ /** The installed version of `name` resolved from `from`, or `null` when it is not installed. */
86
+ export declare function installedVersion(name: string, from: string): Promise<string | null>;
87
+ /**
88
+ * Whether `version` satisfies `range`, with node-semver's grammar and prereleases included (like
89
+ * `semver.satisfies(version, range, { includePrerelease: true })`). An unparsable range is `false`.
90
+ */
91
+ export declare function satisfies(version: string, range: string): boolean;
92
+ /**
93
+ * The environment shown in the report, from the app itself: `production` when `app.inProduction`,
94
+ * `test` when `app.inTest`, else the app's node environment, and `development` when that is unset.
95
+ */
96
+ export declare function environmentOf(app: Pick<ApplicationService, 'inProduction' | 'inTest' | 'nodeEnvironment'>): string;
97
+ /** Run the checks and build the report. Throws {@link AgoraDoctorUsageError} for an unknown `--only`. */
98
+ export declare function runAgoraDoctor(app: ApplicationService, registered: readonly AgoraDoctorCheck[], options?: AgoraDoctorOptions): Promise<{
99
+ report: AgoraDoctorReport;
100
+ exitCode: 0 | 1;
101
+ }>;
102
+ export interface Paint {
103
+ green(text: string): string;
104
+ yellow(text: string): string;
105
+ red(text: string): string;
106
+ dim(text: string): string;
107
+ bold(text: string): string;
108
+ }
109
+ /** The human report. `fancy` = colors and symbols (a TTY without `NO_COLOR`). */
110
+ export declare function renderAgoraDoctor(report: AgoraDoctorReport, options?: {
111
+ verbose?: boolean;
112
+ fancy?: boolean;
113
+ paint?: Paint;
114
+ }): string;
115
+ export {};
116
+ //# sourceMappingURL=agora_doctor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agora_doctor.d.ts","sourceRoot":"","sources":["../../../src/doctor/agora_doctor.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE/D,mDAAmD;AACnD,eAAO,MAAM,oBAAoB,iBAAiB,CAAC;AAEnD,0DAA0D;AAC1D,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC;IACpB,QAAQ,CAAC,MAAM,EAAE,gBAAgB,EAAE,CAAC;CACrC;AAED,MAAM,MAAM,iBAAiB,GAAG,IAAI,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;AAEjE,MAAM,WAAW,gBAAgB;IAC/B,+EAA+E;IAC/E,EAAE,EAAE,MAAM,CAAC;IACX,+FAA+F;IAC/F,GAAG,EAAE,MAAM,CAAC;IACZ,6DAA6D;IAC7D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,yGAAyG;IACzG,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACxB,GAAG,CACD,GAAG,EAAE,kBAAkB,GACtB,iBAAiB,GAAG,iBAAiB,EAAE,GAAG,OAAO,CAAC,iBAAiB,GAAG,iBAAiB,EAAE,CAAC,CAAC;CAC/F;AAED,MAA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