| @@ -538,8 +538,14 @@ type LocalServerStatus = { · 537 unmodified lines |
| 538 | 538 | accountId: string; |
| 539 | 539 | workspaceId: string; |
| 540 | 540 | } | null; |
| 541 | + denoVersion: string | null; |
| 541 | 542 | }; |
| 542 | 543 | |
| 544 | +const renderDenoSandboxDetail = (denoVersion: string | null): string => |
| 545 | + denoVersion !== null |
| 546 | + ? `deno ${denoVersion}` |
| 547 | + : "deno not found (run `executor sandbox` to install)"; |
| 548 | + |
| 543 | 549 | const getServerStatus = (baseUrl: string): Effect.Effect<LocalServerStatus, Error, never> => |
| 544 | 550 | Effect.gen(function* () { |
| 545 | 551 | const pidRecord = yield* readPidRecord(); |
| @@ -554,6 +560,7 @@ const getServerStatus = (baseUrl: string): Effect.Effect<LocalServerStatus, Erro · 8 unmodified lines |
| 554 | 560 | const pid = typeof pidRecord?.pid === "number" ? pidRecord.pid : null; |
| 555 | 561 | const pidRunning = pid !== null ? isPidRunning(pid) : false; |
| 556 | 562 | const logFile = pidRecord?.logFile ?? DEFAULT_SERVER_LOG_FILE; |
| 563 | + const denoVersion = yield* getDenoVersion(); |
| 557 | 564 | |
| 558 | 565 | return { |
| 559 | 566 | baseUrl, |
| @@ -566,6 +573,7 @@ const getServerStatus = (baseUrl: string): Effect.Effect<LocalServerStatus, Erro · 6 unmodified lines |
| 566 | 573 | webAssetsDir: resolveRuntimeWebAssetsDir(), |
| 567 | 574 | migrationsDir: resolveRuntimeMigrationsDir(), |
| 568 | 575 | installation, |
| 576 | + denoVersion, |
| 569 | 577 | } satisfies LocalServerStatus; |
| 570 | 578 | }); |
| 571 | 579 | |
| @@ -581,60 +589,55 @@ const renderStatus = (status: LocalServerStatus): string => · 9 unmodified lines |
| 581 | 589 | `webAssetsDir: ${status.webAssetsDir ?? "missing"}`, |
| 582 | 590 | `migrationsDir: ${status.migrationsDir ?? "missing"}`, |
| 583 | 591 | `workspaceId: ${status.installation?.workspaceId ?? "unavailable"}`, |
| 592 | + `denoSandbox: ${renderDenoSandboxDetail(status.denoVersion)}`, |
| 584 | 593 | ].join("\n"); |
| 585 | 594 | |
| 586 | 595 | const getDoctorReport = (baseUrl: string) => |
| 587 | 596 | getServerStatus(baseUrl).pipe( |
| 588 | | − Effect.flatMap((status) => |
| 589 | | − getDenoVersion().pipe( |
| 590 | | − Effect.map((denoVersion) => { |
| 591 | | − const checks = { |
| 592 | | − serverReachable: { |
| 593 | | − ok: status.reachable, |
| 594 | | − detail: status.reachable ? `reachable at ${status.baseUrl}` : `not reachable at ${status.baseUrl}`, |
| 595 | | − }, |
| 596 | | − pidFile: { |
| 597 | | − ok: status.pid !== null, |
| 598 | | − detail: status.pid !== null ? `pid ${status.pid}` : `missing pid file at ${status.pidFile}`, |
| 599 | | − }, |
| 600 | | − process: { |
| 601 | | − ok: status.pidRunning, |
| 602 | | − detail: status.pidRunning ? `pid ${status.pid}` : "no live daemon process recorded", |
| 603 | | − }, |
| 604 | | − database: { |
| 605 | | − ok: status.localDataDir.length > 0, |
| 606 | | − detail: status.localDataDir, |
| 607 | | − }, |
| 608 | | − webAssets: { |
| 609 | | − ok: status.webAssetsDir !== null, |
| 610 | | − detail: status.webAssetsDir ?? "missing bundled web assets", |
| 611 | | − }, |
| 612 | | − migrations: { |
| 613 | | − ok: status.migrationsDir !== null, |
| 614 | | − detail: status.migrationsDir ?? "missing migrations directory", |
| 615 | | − }, |
| 616 | | − installation: { |
| 617 | | − ok: status.installation !== null, |
| 618 | | − detail: status.installation |
| 619 | | − ? `workspace ${status.installation.workspaceId}` |
| 620 | | − : "local installation unavailable", |
| 621 | | − }, |
| 622 | | − denoSandbox: { |
| 623 | | − ok: denoVersion !== null, |
| 624 | | − detail: denoVersion !== null |
| 625 | | − ? `deno ${denoVersion}` |
| 626 | | − : "deno not found (run `executor sandbox` to install)", |
| 627 | | − }, |
| 628 | | − } as const; |
| 629 | | − |
| 630 | | − return { |
| 631 | | − ok: Object.values(checks).every((check) => check.ok), |
| 632 | | − status, |
| 633 | | − checks, |
| 634 | | − }; |
| 635 | | − }), |
| 636 | | − ), |
| 637 | | − ), |
| 597 | + Effect.map((status) => { |
| 598 | + const checks = { |
| 599 | + serverReachable: { |
| 600 | + ok: status.reachable, |
| 601 | + detail: status.reachable ? `reachable at ${status.baseUrl}` : `not reachable at ${status.baseUrl}`, |
| 602 | + }, |
| 603 | + pidFile: { |
| 604 | + ok: status.pid !== null, |
| 605 | + detail: status.pid !== null ? `pid ${status.pid}` : `missing pid file at ${status.pidFile}`, |
| 606 | + }, |
| 607 | + process: { |
| 608 | + ok: status.pidRunning, |
| 609 | + detail: status.pidRunning ? `pid ${status.pid}` : "no live daemon process recorded", |
| 610 | + }, |
| 611 | + database: { |
| 612 | + ok: status.localDataDir.length > 0, |
| 613 | + detail: status.localDataDir, |
| 614 | + }, |
| 615 | + webAssets: { |
| 616 | + ok: status.webAssetsDir !== null, |
| 617 | + detail: status.webAssetsDir ?? "missing bundled web assets", |
| 618 | + }, |
| 619 | + migrations: { |
| 620 | + ok: status.migrationsDir !== null, |
| 621 | + detail: status.migrationsDir ?? "missing migrations directory", |
| 622 | + }, |
| 623 | + installation: { |
| 624 | + ok: status.installation !== null, |
| 625 | + detail: status.installation |
| 626 | + ? `workspace ${status.installation.workspaceId}` |
| 627 | + : "local installation unavailable", |
| 628 | + }, |
| 629 | + denoSandbox: { |
| 630 | + ok: status.denoVersion !== null, |
| 631 | + detail: renderDenoSandboxDetail(status.denoVersion), |
| 632 | + }, |
| 633 | + } as const; |
| 634 | + |
| 635 | + return { |
| 636 | + ok: Object.values(checks).every((check) => check.ok), |
| 637 | + status, |
| 638 | + checks, |
| 639 | + }; |
| 640 | + }), |
| 638 | 641 | ); |
| 639 | 642 | |
| 640 | 643 | const printJson = (value: unknown) => |