Public: anyone can read this; the crew can change it.
Move the accessors out of apps/runtime.ts (appsRuntime, envsFor) so it leaves the boot's static closure #17252
Merged 32h 26m ago, live in production
mason/forge:mason/17179-move-the-accessors-out-of-apps-runtime-t → main 0 commits fork
86 files
changed +161
−132
- src/actions/accounts.ts
- src/actions/app_variants.ts
- src/actions/apps.ts
- src/actions/build.ts
- src/actions/build_cache.ts
- src/actions/build_preview.ts
- src/actions/cutover.ts
- src/actions/demo.ts
- src/actions/domain_dns.ts
- src/actions/domains.ts
- src/actions/feature_tools.ts
- src/actions/features.ts
- src/actions/front.ts
- src/actions/health.ts
- src/actions/here.ts
- src/actions/journey_walk.ts
- src/actions/migrate_data.ts
- src/actions/repos.ts
- src/actions/secrets.ts
- src/actions/start.ts
- src/actions/talk_live.ts
- src/actions/talk_workspace.ts
- src/apps/dev_launch.ts
- src/apps/holding.ts
- src/apps/preview_view.ts
- src/apps/pull_schedule.ts
- src/apps/runtime.ts
- src/apps/runtime_registry.ts
- src/apps/timer_service.ts
- src/apps/tty.ts
- src/arcade/carts.ts
- src/arcade/host.ts
- src/core/client-apps.ts
- src/crew/app_hosts.ts
- src/crew/runner.ts
- src/data/spec_scope.ts
- src/http/api.ts
- src/http/api/app.ts
- src/http/api/pulls.ts
- src/http/mcp/tools/apps.ts
- src/http/mcp/tools/here.ts
- src/http/mcp/tools/new_app.ts
- src/http/mcp/tools/preview.ts
- src/http/mcp/tools/probe.ts
- src/http/routes/operations.ts
- src/http/server.ts
- src/looks/service.ts
- src/metrics/app_sources.ts
- src/spawn/child-apps.ts
- src/spawn/host.ts
- src/system/feature_health.ts
- src/text/talk_link_words.ts
- src/tui/screens/deploys.ts
- src/tui/screens/newapp.ts
- src/tui/screens/pull.ts
- src/tui/ssh-tell.ts
- src/web/layout.ts
- src/web/page_tag.ts
- src/web/pages/api.ts
- src/web/pages/apps.ts
- src/web/pages/audit.ts
- src/web/pages/board.ts
- src/web/pages/looks.ts
- src/web/pages/pull.ts
- src/web/pages/search.ts
- src/web/pages/settings.ts
- src/web/pages/talk_preview.ts
- src/web/repo_steps.ts
- src/web/studio/app.ts
- src/web/studio/change.ts
- src/web/studio/decisions.ts
- src/web/studio/home.ts
- src/web/studio/lists.ts
- src/web/studio/now.ts
- src/web/studio/previews.ts
- src/web/studio/run.ts
- src/web/studio/shelf.ts
- src/web/studio/tell.ts
- src/web/studio/toolbar_side.ts
- src/web/studio/words.ts
- test/apps-runtime-split.test.ts
- test/boot-lazy.test.ts
- test/boundary-secrets-process.test.ts
- test/helpers/apps-forge.ts
- test/private-app.test.ts
- test/probe.test.ts
src/actions/accounts.ts +1 −1
| @@ -16,7 +16,7 @@ import type { Database } from "bun:sqlite"; | ||
| 16 | 16 | import type { App } from "../app.ts"; |
| 17 | 17 | import { getAppByRepo } from "../core/apps.ts"; |
| 18 | 18 | import { listTeams, retireOrg, soleOwnedOrgs } from "../core/orgs.ts"; |
| 19 | import { appsRuntime } from "../apps/runtime.ts"; | |
| 19 | import { appsRuntime } from "../apps/runtime_registry.ts"; | |
| 20 | 20 | import { |
| 21 | 21 | dropCredentials, |
| 22 | 22 | listAccounts as readAccounts, |
src/actions/app_variants.ts +1 −1
| @@ -13,7 +13,7 @@ | ||
| 13 | 13 | */ |
| 14 | 14 | |
| 15 | 15 | import type { App } from "../app.ts"; |
| 16 | import { appsRuntime } from "../apps/runtime.ts"; | |
| 16 | import { appsRuntime } from "../apps/runtime_registry.ts"; | |
| 17 | 17 | import { parseValueLines, readLastOutput, VARIANT_FILE, variantFileText, parseVariantFile } from "../apps/variant_file.ts"; |
| 18 | 18 | import { envDataDir, variantEnv } from "../apps/data.ts"; |
| 19 | 19 | import { getAppByRepo, type AppRecord } from "../core/apps.ts"; |
src/actions/apps.ts +2 −1
| @@ -24,7 +24,8 @@ import { checkWord, type CheckWord } from "../apps/check_word.ts"; | ||
| 24 | 24 | import { openPulls } from "../apps/door_pulls.ts"; |
| 25 | 25 | import { goldenPath, goldenPathLine } from "../apps/golden_path.ts"; |
| 26 | 26 | import { appVitals, type AppVitals } from "../apps/vitals.ts"; |
| 27 | import { appsRuntime, envsFor, type EnvStatus } from "../apps/runtime.ts"; | |
| 27 | import { appsRuntime, envsFor } from "../apps/runtime_registry.ts"; | |
| 28 | import type { EnvStatus } from "../apps/runtime.ts"; | |
| 28 | 29 | import { grantUrl } from "../apps/grants.ts"; |
| 29 | 30 | import { originFor, sideForViewer, sideReader } from "../apps/proxy.ts"; |
| 30 | 31 | import { plainLine } from "../apps/side.ts"; |
src/actions/build.ts +1 −1
| @@ -8,7 +8,7 @@ | ||
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | 10 | import type { App } from "../app.ts"; |
| 11 | import { appsRuntime } from "../apps/runtime.ts"; | |
| 11 | import { appsRuntime } from "../apps/runtime_registry.ts"; | |
| 12 | 12 | import { previewEnv } from "../apps/data.ts"; |
| 13 | 13 | import { offeredTemplates } from "../core/app_templates.ts"; |
| 14 | 14 | import { type ChatBuild, branchFor, chatBuildOf, setBuildPublished, startChatBuild, unpublishedBuilds } from "../core/chat_build.ts"; |
src/actions/build_cache.ts +1 −1
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | /** Clear an app's build cache (#10526): the repository's admins; the next deploy builds fresh. */ |
| 2 | 2 | import type { App } from "../app.ts"; |
| 3 | 3 | import { appCacheSize, clearBuildCache } from "../apps/build_cache.ts"; |
| 4 | import { appsRuntime } from "../apps/runtime.ts"; | |
| 4 | import { appsRuntime } from "../apps/runtime_registry.ts"; | |
| 5 | 5 | import { getAppByRepo, type AppRecord } from "../core/apps.ts"; |
| 6 | 6 | import type { Repo } from "../core/repos.ts"; |
| 7 | 7 | import type { User } from "../core/users.ts"; |
src/actions/build_preview.ts +1 −1
| @@ -15,7 +15,7 @@ | ||
| 15 | 15 | |
| 16 | 16 | import type { App } from "../app.ts"; |
| 17 | 17 | import { buildEnv, type EnvName } from "../apps/data.ts"; |
| 18 | import { appsRuntime } from "../apps/runtime.ts"; | |
| 18 | import { appsRuntime } from "../apps/runtime_registry.ts"; | |
| 19 | 19 | import { getAppByRepo } from "../core/apps.ts"; |
| 20 | 20 | import type { Repo } from "../core/repos.ts"; |
| 21 | 21 | import type { Run } from "../core/runs.ts"; |
src/actions/cutover.ts +1 −1
| @@ -15,7 +15,7 @@ import { certificateSaid, probeCertificate } from "../apps/certificate.ts"; | ||
| 15 | 15 | import type { DnsProvider } from "../apps/dns_provider.ts"; |
| 16 | 16 | import { compareStatuses, pathsFrom, type PathCheck } from "../apps/parity_probe.ts"; |
| 17 | 17 | import { readProgress } from "../apps/migration_mode.ts"; |
| 18 | import { appsRuntime } from "../apps/runtime.ts"; | |
| 18 | import { appsRuntime } from "../apps/runtime_registry.ts"; | |
| 19 | 19 | import { getAppByRepo } from "../core/apps.ts"; |
| 20 | 20 | import { claimCutOver, getDomain, normalizeHost, setCutOver, setOldRecords, type OldRecord } from "../core/domains.ts"; |
| 21 | 21 | import type { Repo } from "../core/repos.ts"; |
src/actions/demo.ts +1 −1
| @@ -12,7 +12,7 @@ | ||
| 12 | 12 | |
| 13 | 13 | import type { App } from "../app.ts"; |
| 14 | 14 | import { DEMO_ENV, DEMO_REF } from "../apps/data.ts"; |
| 15 | import { appsRuntime } from "../apps/runtime.ts"; | |
| 15 | import { appsRuntime } from "../apps/runtime_registry.ts"; | |
| 16 | 16 | import { getAppByRepo } from "../core/apps.ts"; |
| 17 | 17 | import type { Repo } from "../core/repos.ts"; |
| 18 | 18 | import type { Run } from "../core/runs.ts"; |
src/actions/domain_dns.ts +1 −1
| @@ -15,7 +15,7 @@ import { | ||
| 15 | 15 | type ZoneRecord, |
| 16 | 16 | } from "../apps/dns_provider.ts"; |
| 17 | 17 | import { verifyName, verifyValue } from "../apps/domains.ts"; |
| 18 | import { appsRuntime } from "../apps/runtime.ts"; | |
| 18 | import { appsRuntime } from "../apps/runtime_registry.ts"; | |
| 19 | 19 | import { getAppByRepo } from "../core/apps.ts"; |
| 20 | 20 | import { getDomain, normalizeHost } from "../core/domains.ts"; |
| 21 | 21 | import { resolveScoped } from "../core/secret_store.ts"; |
src/actions/domains.ts +2 −1
| @@ -9,7 +9,8 @@ import type { App } from "../app.ts"; | ||
| 9 | 9 | import { certificateSaid, probeCertificate } from "../apps/certificate.ts"; |
| 10 | 10 | import { checkClaim, checkDomain, recordsFor, verifyName, verifyValue, type DnsRecord } from "../apps/domains.ts"; |
| 11 | 11 | import { appHostSuffix } from "../apps/host.ts"; |
| 12 | import { appsRuntime, type AppsRuntime } from "../apps/runtime.ts"; | |
| 12 | import { appsRuntime } from "../apps/runtime_registry.ts"; | |
| 13 | import type { AppsRuntime } from "../apps/runtime.ts"; | |
| 13 | 14 | import { getAppByRepo, type AppRecord } from "../core/apps.ts"; |
| 14 | 15 | import { |
| 15 | 16 | addDomain, |
src/actions/feature_tools.ts +1 −1
| @@ -10,7 +10,7 @@ import type { App } from "../app.ts"; | ||
| 10 | 10 | import { runRecorded } from "../apps/feature_schedule.ts"; |
| 11 | 11 | import { identityKey } from "../apps/grants.ts"; |
| 12 | 12 | import { callTool } from "../apps/feature_tools.ts"; |
| 13 | import { appsRuntime } from "../apps/runtime.ts"; | |
| 13 | import { appsRuntime } from "../apps/runtime_registry.ts"; | |
| 14 | 14 | import { getAbsorbed } from "../core/features.ts"; |
| 15 | 15 | import { canWrite } from "../core/repos.ts"; |
| 16 | 16 | import type { User } from "../core/users.ts"; |
src/actions/features.ts +1 −1
| @@ -24,7 +24,7 @@ import { readFileAt } from "../apps/checkout.ts"; | ||
| 24 | 24 | import { checkSetting, featureEnv, parseFeature, settingEnvName, type FeatureSpec } from "../apps/feature.ts"; |
| 25 | 25 | import { keptSettings as openSettings, sealSetting } from "../apps/feature_env.ts"; |
| 26 | 26 | import type { ToolSpec } from "../apps/feature_tools.ts"; |
| 27 | import { appsRuntime } from "../apps/runtime.ts"; | |
| 27 | import { appsRuntime } from "../apps/runtime_registry.ts"; | |
| 28 | 28 | import { getAppByRepo, getAppById, getAppBySlug, listApps, type AppRecord } from "../core/apps.ts"; |
| 29 | 29 | import { |
| 30 | 30 | absorb, |
src/actions/front.ts +2 −1
| @@ -20,7 +20,8 @@ | ||
| 20 | 20 | import type { Database } from "bun:sqlite"; |
| 21 | 21 | import { provenanceUrl, sourceLabel } from "../core/provenance.ts"; |
| 22 | 22 | import type { App } from "../app.ts"; |
| 23 | import { appsRuntime, type EnvState, type EnvStatus } from "../apps/runtime.ts"; | |
| 23 | import { appsRuntime } from "../apps/runtime_registry.ts"; | |
| 24 | import type { EnvState, EnvStatus } from "../apps/runtime.ts"; | |
| 24 | 25 | import { getAppByRepo, listPublicApps, type AppRecord } from "../core/apps.ts"; |
| 25 | 26 | import { |
| 26 | 27 | frontPicks, |
src/actions/health.ts +1 −1
| @@ -20,7 +20,7 @@ | ||
| 20 | 20 | import { askingOf } from "../perf/asking.ts"; |
| 21 | 21 | import { flakeLine, flakeList, flakeNeedLine, flakeNeedRows, type FlakeRow } from "../checks/flake.ts"; |
| 22 | 22 | import type { App } from "../app.ts"; |
| 23 | import { appsRuntime } from "../apps/runtime.ts"; | |
| 23 | import { appsRuntime } from "../apps/runtime_registry.ts"; | |
| 24 | 24 | import { listApps } from "../core/apps.ts"; |
| 25 | 25 | import { ledgerNeed } from "../core/ledger.ts"; |
| 26 | 26 | import { overdueSchedules, type ScheduleCounts } from "../core/timers.ts"; |
src/actions/here.ts +1 −1
| @@ -19,7 +19,7 @@ import { sshTellCommand } from "../ssh/command.ts"; | ||
| 19 | 19 | import { getAgentStart } from "../settings/agent_start.ts"; |
| 20 | 20 | import { mcpPointers, TOKEN_FREE_TOOLS } from "../core/mcp_card.ts"; |
| 21 | 21 | import type { App } from "../app.ts"; |
| 22 | import { appsRuntime } from "../apps/runtime.ts"; | |
| 22 | import { appsRuntime } from "../apps/runtime_registry.ts"; | |
| 23 | 23 | import { isCrew } from "../core/agents.ts"; |
| 24 | 24 | import { getAppByRepo } from "../core/apps.ts"; |
| 25 | 25 | import { |
src/actions/journey_walk.ts +1 −1
| @@ -13,7 +13,7 @@ import { mkdirSync, renameSync } from "node:fs"; | ||
| 13 | 13 | import { dirname, join } from "node:path"; |
| 14 | 14 | import type { App } from "../app.ts"; |
| 15 | 15 | import { signGrant } from "../apps/grants.ts"; |
| 16 | import { appsRuntime } from "../apps/runtime.ts"; | |
| 16 | import { appsRuntime } from "../apps/runtime_registry.ts"; | |
| 17 | 17 | import { getAppByRepo } from "../core/apps.ts"; |
| 18 | 18 | import { betScopes, listBets, type Bet } from "../core/bets.ts"; |
| 19 | 19 | import { claimWalk, dropStalePending, finishWalk, listWalks } from "../core/journey_walks.ts"; |
src/actions/migrate_data.ts +1 −1
| @@ -12,7 +12,7 @@ | ||
| 12 | 12 | import { readFileSync, statSync } from "node:fs"; |
| 13 | 13 | import type { App } from "../app.ts"; |
| 14 | 14 | import { envDataDir } from "../apps/data.ts"; |
| 15 | import { appsRuntime } from "../apps/runtime.ts"; | |
| 15 | import { appsRuntime } from "../apps/runtime_registry.ts"; | |
| 16 | 16 | import { DUMP_MAX } from "../apps/dump_file.ts"; |
| 17 | 17 | import type { ImportReport } from "../apps/dump_import.ts"; |
| 18 | 18 | import { undoImport } from "../apps/dump_undo.ts"; |
src/actions/repos.ts +1 −1
| @@ -17,7 +17,7 @@ import { forkLimitSpent, guestForkRefusal } from "./guests.ts"; | ||
| 17 | 17 | import { requireContributor, requireVerified } from "./verify.ts"; |
| 18 | 18 | import { requireAbility } from "./roles.ts"; |
| 19 | 19 | import type { App } from "../app.ts"; |
| 20 | import { appsRuntime } from "../apps/runtime.ts"; | |
| 20 | import { appsRuntime } from "../apps/runtime_registry.ts"; | |
| 21 | 21 | import { getAppByRepo } from "../core/apps.ts"; |
| 22 | 22 | import { syncEdge } from "../cloud/edge_open.ts"; |
| 23 | 23 | import { canSeeSealed } from "../core/sealed.ts"; |
src/actions/secrets.ts +1 −1
| @@ -11,7 +11,7 @@ import type { App } from "../app.ts"; | ||
| 11 | 11 | import { createLog } from "../kernel/log.ts"; |
| 12 | 12 | import { getOrg } from "../core/orgs.ts"; |
| 13 | 13 | import { getRepo, getRepoById } from "../core/repos.ts"; |
| 14 | import { appsRuntime } from "../apps/runtime.ts"; | |
| 14 | import { appsRuntime } from "../apps/runtime_registry.ts"; | |
| 15 | 15 | import { getAppById, getAppByRepo } from "../core/apps.ts"; |
| 16 | 16 | import { readerFor } from "../git/read.ts"; |
| 17 | 17 | import { repoDir } from "../git/repos.ts"; |
src/actions/start.ts +1 −1
| @@ -23,7 +23,7 @@ | ||
| 23 | 23 | * hash (`actions/claim.ts` is what opens it). |
| 24 | 24 | */ |
| 25 | 25 | import type { App } from "../app.ts"; |
| 26 | import { appsRuntime } from "../apps/runtime.ts"; | |
| 26 | import { appsRuntime } from "../apps/runtime_registry.ts"; | |
| 27 | 27 | import { createToken } from "../core/tokens.ts"; |
| 28 | 28 | import { createUser, discardFreshUser } from "../core/users.ts"; |
| 29 | 29 | import { inviteOpen, redeemInvite } from "../core/invites.ts"; |
src/actions/talk_live.ts +1 −1
| @@ -8,7 +8,7 @@ | ||
| 8 | 8 | |
| 9 | 9 | import type { App } from "../app.ts"; |
| 10 | 10 | import { previewEnv } from "../apps/data.ts"; |
| 11 | import { appsRuntime } from "../apps/runtime.ts"; | |
| 11 | import { appsRuntime } from "../apps/runtime_registry.ts"; | |
| 12 | 12 | import { getAppByRepo } from "../core/apps.ts"; |
| 13 | 13 | import { chatBuildOf } from "../core/chat_build.ts"; |
| 14 | 14 | import { appendTurn, lastExchange } from "../core/conversations.ts"; |
src/actions/talk_workspace.ts +1 −1
| @@ -10,7 +10,7 @@ import type { App } from "../app.ts"; | ||
| 10 | 10 | import { previewEnv, type EnvName } from "../apps/data.ts"; |
| 11 | 11 | import { appsForRepos } from "../core/apps.ts"; |
| 12 | 12 | import { getRepo, listReposWritableTo, type Repo } from "../core/repos.ts"; |
| 13 | import { appsRuntime, envsFor } from "../apps/runtime.ts"; | |
| 13 | import { appsRuntime, envsFor } from "../apps/runtime_registry.ts"; | |
| 14 | 14 | import type { User } from "../core/users.ts"; |
| 15 | 15 | import { requireReader } from "./access.ts"; |
| 16 | 16 | import { appPreviews, openEnvUrl } from "./apps.ts"; |
src/apps/dev_launch.ts +1 −1
| @@ -19,7 +19,7 @@ import { runLocal } from "../git/local.ts"; | ||
| 19 | 19 | import { resolveOid } from "../git/merge.ts"; |
| 20 | 20 | import { isSafeRef } from "../git/guard.ts"; |
| 21 | 21 | import { err, ok, type Result } from "../kernel/result.ts"; |
| 22 | import { appsRuntime } from "./runtime.ts"; | |
| 22 | import { appsRuntime } from "./runtime_registry.ts"; | |
| 23 | 23 | import { identityKey } from "./grants.ts"; |
| 24 | 24 | import { envDataDir, type EnvName } from "./data.ts"; |
| 25 | 25 | import { parseManifest } from "./manifest.ts"; |
src/apps/holding.ts +1 −1
| @@ -8,7 +8,7 @@ | ||
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | 10 | import type { App } from "../app.ts"; |
| 11 | import { appsRuntime } from "./runtime.ts"; | |
| 11 | import { appsRuntime } from "./runtime_registry.ts"; | |
| 12 | 12 | import { parseAppHost } from "./proxy.ts"; |
| 13 | 13 | |
| 14 | 14 | /** How long a request waits for the apps to load before the holding page. */ |
src/apps/preview_view.ts +1 −1
| @@ -14,7 +14,7 @@ import { mayView, mayViewId } from "../core/sealed.ts"; | ||
| 14 | 14 | import { canRead, getRepoById } from "../core/repos.ts"; |
| 15 | 15 | import { getUserById, type User } from "../core/users.ts"; |
| 16 | 16 | import { resolveAppHostname } from "./proxy.ts"; |
| 17 | import { appsRuntime } from "./runtime.ts"; | |
| 17 | import { appsRuntime } from "./runtime_registry.ts"; | |
| 18 | 18 | import { servingWords, type ServingWords } from "./serving_words.ts"; |
| 19 | 19 | |
| 20 | 20 | export interface PreviewView { |
src/apps/pull_schedule.ts +1 −1
| @@ -27,7 +27,7 @@ import { parseAdapter, type AdapterSpec } from "./adapter.ts"; | ||
| 27 | 27 | import { readFileAt } from "./checkout.ts"; |
| 28 | 28 | import { identityHeaders, type GrantWho } from "./grants.ts"; |
| 29 | 29 | import { parsePullAnswer, PULL_BODY_MAX, recordPull, type PullAnswer } from "./pull.ts"; |
| 30 | import { appsRuntime } from "./runtime.ts"; | |
| 30 | import { appsRuntime } from "./runtime_registry.ts"; | |
| 31 | 31 | import { during } from "../perf/jobs.ts"; |
| 32 | 32 | |
| 33 | 33 | /** How long the forge waits for one `/pull` answer, as for a scheduled tool. */ |
src/apps/runtime.ts +4 −33
| @@ -33,8 +33,7 @@ import { listVariants } from "../core/variants.ts"; | ||
| 33 | 33 | import { revokeAppToken } from "./token.ts"; |
| 34 | 34 | import { requeueAbandonedChecks } from "../checks/abandoned.ts"; |
| 35 | 35 | import { listPulls } from "../core/pulls.ts"; |
| 36 | import { canEnterApp, getRepoById, type Repo } from "../core/repos.ts"; | |
| 37 | import type { User } from "../core/users.ts"; | |
| 36 | import { getRepoById, type Repo } from "../core/repos.ts"; | |
| 38 | 37 | import { cancelQueuedDeploys, cancelRun, failAbandonedRuns, STOPPED_SUMMARY } from "../core/runs.ts"; |
| 39 | 38 | import { Gate } from "../git/env.ts"; |
| 40 | 39 | import { resolveOid } from "../git/merge.ts"; |
| @@ -50,6 +49,7 @@ import { noteProtection } from "../kernel/protection.ts"; | ||
| 50 | 49 | import { cellsAvailable } from "./contain.ts"; |
| 51 | 50 | import { during } from "../perf/jobs.ts"; |
| 52 | 51 | import { log, type RuntimeOptions, SWEEP_EVERY_MS, type EnvStatus, type Live, type Environment, RESTART_WINDOW_MS, RESTART_MAX, RESTART_BACKOFF_MS, byEnv, key } from "./runtime_env.ts"; |
| 52 | import { registerRuntime, unregisterRuntime } from "./runtime_registry.ts"; | |
| 53 | 53 | import * as runtime_status from "./runtime_status.ts"; |
| 54 | 54 | import * as runtime_events from "./runtime_events.ts"; |
| 55 | 55 | import * as runtime_deploy from "./runtime_deploy.ts"; |
| @@ -62,35 +62,6 @@ import * as runtime_teardown from "./runtime_teardown.ts"; | ||
| 62 | 62 | export { UNOPENED_MS, SLEEP_AFTER_MS, IDLE_PULL_DAYS, TESTS_PASSED_TAIL, NO_TESTS_TAIL, rootFault, BUILD_PREVIEWS_MAX, RESTART_BACKOFF_MS, grantedFor } from "./runtime_env.ts"; |
| 63 | 63 | export type { RuntimeOptions, EnvState, EnvStatus, LiveEnv } from "./runtime_env.ts"; |
| 64 | 64 | |
| 65 | const runtimes = new WeakMap<App, AppsRuntime>(); | |
| 66 | ||
| 67 | /** The runtime serving this forge, if apps are on. */ | |
| 68 | export const appsRuntime = (app: App): AppsRuntime | undefined => | |
| 69 | runtimes.get(app); | |
| 70 | ||
| 71 | /** | |
| 72 | * An app's environments as `viewer` may see them. A private app's state, | |
| 73 | * errors and runs are its writers' and crew's (`canEnterApp`, without the | |
| 74 | * people it only names, who enter the app and nothing behind it); to | |
| 75 | * anyone else who can read the repository it shows none — a deploy error | |
| 76 | * can carry paths and configuration (#620). Every surface that shows a | |
| 77 | * viewer an app's environments reads them here. | |
| 78 | */ | |
| 79 | export function envsFor( | |
| 80 | app: App, | |
| 81 | viewer: User | undefined, | |
| 82 | record: AppRecord, | |
| 83 | ): EnvStatus[] { | |
| 84 | const runtime = runtimes.get(app); | |
| 85 | if (runtime === undefined) return []; | |
| 86 | if (record.access === "private") { | |
| 87 | const repo = getRepoById(app.db, record.repoId); | |
| 88 | if (repo === undefined || !canEnterApp(app.db, repo, record, viewer, { named: false })) | |
| 89 | return []; | |
| 90 | } | |
| 91 | return runtime.status(record); | |
| 92 | } | |
| 93 | ||
| 94 | 65 | export class AppsRuntime { |
| 95 | 66 | readonly envs = new Map<string, Environment>(); |
| 96 | 67 | /** Whether this host can hold an app in a cell (`apps/contain.ts`), asked once at start. */ |
| @@ -110,7 +81,7 @@ export class AppsRuntime { | ||
| 110 | 81 | readonly options: RuntimeOptions, |
| 111 | 82 | ) { |
| 112 | 83 | this.gate = options.gate ?? new Gate(options.concurrency ?? 2); |
| 113 | runtimes.set(app, this); | |
| 84 | registerRuntime(app, this); | |
| 114 | 85 | // Closing the forge closes the database next: end every open awake |
| 115 | 86 | // interval now, while it can be written, and write nothing after. |
| 116 | 87 | app.closing.signal.addEventListener("abort", () => this.closeMeter(), { |
| @@ -302,7 +273,7 @@ export class AppsRuntime { | ||
| 302 | 273 | } |
| 303 | 274 | await Promise.all(stops); |
| 304 | 275 | this.metered(() => closeAllAwake(this.app.db, new Date().toISOString())); |
| 305 | runtimes.delete(this.app); | |
| 276 | unregisterRuntime(this.app); | |
| 306 | 277 | } |
| 307 | 278 | |
| 308 | 279 | /** |
src/apps/runtime_registry.ts added +46
| @@ -0,0 +1,46 @@ | ||
| 1 | /** | |
| 2 | * Which `AppsRuntime` serves a forge. The service fills this when it starts | |
| 3 | * (`register`) and empties it when it stops; pages, actions and the server read | |
| 4 | * it here, so none of them pulls the service's module into the boot's static | |
| 5 | * closure (#17179). | |
| 6 | */ | |
| 7 | ||
| 8 | import type { App } from "../app.ts"; | |
| 9 | import type { AppRecord } from "../core/apps.ts"; | |
| 10 | import { canEnterApp, getRepoById } from "../core/repos.ts"; | |
| 11 | import type { User } from "../core/users.ts"; | |
| 12 | import type { AppsRuntime } from "./runtime.ts"; | |
| 13 | import type { EnvStatus } from "./runtime_env.ts"; | |
| 14 | ||
| 15 | const runtimes = new WeakMap<App, AppsRuntime>(); | |
| 16 | ||
| 17 | export const registerRuntime = (app: App, runtime: AppsRuntime): void => void runtimes.set(app, runtime); | |
| 18 | ||
| 19 | export const unregisterRuntime = (app: App): void => void runtimes.delete(app); | |
| 20 | ||
| 21 | /** The runtime serving this forge, if apps are on. */ | |
| 22 | export const appsRuntime = (app: App): AppsRuntime | undefined => | |
| 23 | runtimes.get(app); | |
| 24 | ||
| 25 | /** | |
| 26 | * An app's environments as `viewer` may see them. A private app's state, | |
| 27 | * errors and runs are its writers' and crew's (`canEnterApp`, without the | |
| 28 | * people it only names, who enter the app and nothing behind it); to | |
| 29 | * anyone else who can read the repository it shows none — a deploy error | |
| 30 | * can carry paths and configuration (#620). Every surface that shows a | |
| 31 | * viewer an app's environments reads them here. | |
| 32 | */ | |
| 33 | export function envsFor( | |
| 34 | app: App, | |
| 35 | viewer: User | undefined, | |
| 36 | record: AppRecord, | |
| 37 | ): EnvStatus[] { | |
| 38 | const runtime = runtimes.get(app); | |
| 39 | if (runtime === undefined) return []; | |
| 40 | if (record.access === "private") { | |
| 41 | const repo = getRepoById(app.db, record.repoId); | |
| 42 | if (repo === undefined || !canEnterApp(app.db, repo, record, viewer, { named: false })) | |
| 43 | return []; | |
| 44 | } | |
| 45 | return runtime.status(record); | |
| 46 | } |
src/apps/timer_service.ts +1 −1
| @@ -18,7 +18,7 @@ import { identityKey } from "./grants.ts"; | ||
| 18 | 18 | import { parseFeature, toolPath } from "./feature.ts"; |
| 19 | 19 | import { probeSchedules } from "./schedule_probe.ts"; |
| 20 | 20 | import { parseManifest } from "./manifest.ts"; |
| 21 | import { appsRuntime } from "./runtime.ts"; | |
| 21 | import { appsRuntime } from "./runtime_registry.ts"; | |
| 22 | 22 | import type { EnvName } from "./data.ts"; |
| 23 | 23 | import { fireDueTimers, type Reach } from "./timer_fire.ts"; |
| 24 | 24 | import { repoDir } from "../git/repos.ts"; |
src/apps/tty.ts +1 −1
| @@ -36,7 +36,7 @@ import { | ||
| 36 | 36 | type EnvName, |
| 37 | 37 | } from "./data.ts"; |
| 38 | 38 | import { appEnv, signalGroup } from "./process.ts"; |
| 39 | import { appsRuntime } from "./runtime.ts"; | |
| 39 | import { appsRuntime } from "./runtime_registry.ts"; | |
| 40 | 40 | import { openAppTty, type AppTtyHandle } from "./tty_registry.ts"; |
| 41 | 41 | import { shellIdleMs } from "../machines/shell.ts"; |
| 42 | 42 |
src/arcade/carts.ts +1 −1
| @@ -19,7 +19,7 @@ import { dirname, join } from "node:path"; | ||
| 19 | 19 | import type { App } from "../app.ts"; |
| 20 | 20 | import { previewBuild, type PreviewBuildError } from "../actions/build_preview.ts"; |
| 21 | 21 | import { buildEnv } from "../apps/data.ts"; |
| 22 | import { appsRuntime } from "../apps/runtime.ts"; | |
| 22 | import { appsRuntime } from "../apps/runtime_registry.ts"; | |
| 23 | 23 | import { getAppByRepo } from "../core/apps.ts"; |
| 24 | 24 | import type { Repo } from "../core/repos.ts"; |
| 25 | 25 | import type { User } from "../core/users.ts"; |
src/arcade/host.ts +2 −1
| @@ -24,7 +24,8 @@ import { readFileSync } from "node:fs"; | ||
| 24 | 24 | import type { App } from "../app.ts"; |
| 25 | 25 | import { appHostSuffix } from "../apps/host.ts"; |
| 26 | 26 | import { parseAppHost } from "../apps/proxy.ts"; |
| 27 | import { appsRuntime, type AppsRuntime } from "../apps/runtime.ts"; | |
| 27 | import { appsRuntime } from "../apps/runtime_registry.ts"; | |
| 28 | import type { AppsRuntime } from "../apps/runtime.ts"; | |
| 28 | 29 | import { canRead, getRepo, ownerInStanding, type Repo } from "../core/repos.ts"; |
| 29 | 30 | import { arcadeRepoKnown, arcadeRepoOf } from "../display/known.ts"; |
| 30 | 31 | import { readDisplay, type DisplayConfig } from "../display/config.ts"; |
src/core/client-apps.ts +1 −1
| @@ -6,7 +6,7 @@ | ||
| 6 | 6 | |
| 7 | 7 | import type { Database } from "bun:sqlite"; |
| 8 | 8 | import type { App } from "../app.ts"; |
| 9 | import { appsRuntime, envsFor } from "../apps/runtime.ts"; | |
| 9 | import { appsRuntime, envsFor } from "../apps/runtime_registry.ts"; | |
| 10 | 10 | import { appsForRepos } from "./apps.ts"; |
| 11 | 11 | import { spawnedRepos } from "./next-steps.ts"; |
| 12 | 12 | import { listReposOwnedBy, repoDatesFor, withoutArchived, type Repo } from "./repos.ts"; |
src/crew/app_hosts.ts +1 −1
| @@ -11,7 +11,7 @@ | ||
| 11 | 11 | |
| 12 | 12 | import type { App } from "../app.ts"; |
| 13 | 13 | import { previewEnv } from "../apps/data.ts"; |
| 14 | import { appsRuntime } from "../apps/runtime.ts"; | |
| 14 | import { appsRuntime } from "../apps/runtime_registry.ts"; | |
| 15 | 15 | import { blockedHosts, refusalLine } from "../apps/egress_refused.ts"; |
| 16 | 16 | import { type AppAccess, getAppByRepo } from "../core/apps.ts"; |
| 17 | 17 | import { LIST_LIMIT_MAX } from "../core/issues.ts"; |
src/crew/runner.ts +1 −1
| @@ -19,7 +19,7 @@ import { dropBrief } from "../actions/drop.ts"; | ||
| 19 | 19 | import { announceRun } from "../actions/runs.ts"; |
| 20 | 20 | import type { App } from "../app.ts"; |
| 21 | 21 | import { previewEnv } from "../apps/data.ts"; |
| 22 | import { appsRuntime } from "../apps/runtime.ts"; | |
| 22 | import { appsRuntime } from "../apps/runtime_registry.ts"; | |
| 23 | 23 | import { Stopwatch } from "../apps/timing.ts"; |
| 24 | 24 | import { declarationsOf } from "../cloud/declared.ts"; |
| 25 | 25 | import { bar } from "../cloud/gate.ts"; |
src/data/spec_scope.ts +1 −1
| @@ -13,7 +13,7 @@ | ||
| 13 | 13 | |
| 14 | 14 | import type { App } from "../app.ts"; |
| 15 | 15 | import { knownSpec, refreshSpec } from "../apps/api_spec.ts"; |
| 16 | import { appsRuntime } from "../apps/runtime.ts"; | |
| 16 | import { appsRuntime } from "../apps/runtime_registry.ts"; | |
| 17 | 17 | import { narrow, reference, type Area } from "../contract/reference.ts"; |
| 18 | 18 | import { openapiText, roleOf } from "../contract/served.ts"; |
| 19 | 19 | import { getAppByRepo } from "../core/apps.ts"; |
src/http/api.ts +2 −1
| @@ -233,7 +233,8 @@ import { | ||
| 233 | 233 | replanLimb, |
| 234 | 234 | takeBackLimb, |
| 235 | 235 | } from "../actions/limb_replan.ts"; |
| 236 | import { appsRuntime, envsFor, type AppsRuntime } from "../apps/runtime.ts"; | |
| 236 | import { appsRuntime, envsFor } from "../apps/runtime_registry.ts"; | |
| 237 | import type { AppsRuntime } from "../apps/runtime.ts"; | |
| 237 | 238 | import { isEnvName } from "../apps/data.ts"; |
| 238 | 239 | import { getAppByRepo } from "../core/apps.ts"; |
| 239 | 240 | import { isCrew, type Agent } from "../core/agents.ts"; |
src/http/api/app.ts +1 −1
| @@ -14,7 +14,7 @@ import { addAppDomain, claimAppDomain, claimProofRecord, checkAppDomain, keepOld | ||
| 14 | 14 | import { clearDemo, setDemo } from "../../actions/demo.ts"; |
| 15 | 15 | import { previewBuild, previewBuildRefusalText } from "../../actions/build_preview.ts"; |
| 16 | 16 | import { SETTING_WORDS } from "../../actions/setting_words.ts"; |
| 17 | import { appsRuntime } from "../../apps/runtime.ts"; | |
| 17 | import { appsRuntime } from "../../apps/runtime_registry.ts"; | |
| 18 | 18 | import { canAdmin, canRead, getRepo } from "../../core/repos.ts"; |
| 19 | 19 | import { notePhase, takeSessionTime, timePhase } from "../../core/route_timing.ts"; |
| 20 | 20 | import type { Result } from "../../kernel/result.ts"; |
src/http/api/pulls.ts +1 −1
| @@ -76,7 +76,7 @@ import { | ||
| 76 | 76 | import { capWords, headInContribNamespace, inTurn, pullCapReached } from "../../core/contribute_token.ts"; |
| 77 | 77 | import { takesOutside } from "../../actions/contribute_token.ts"; |
| 78 | 78 | import { editIssue } from "../../actions/issues.ts"; |
| 79 | import { appsRuntime, envsFor } from "../../apps/runtime.ts"; | |
| 79 | import { appsRuntime, envsFor } from "../../apps/runtime_registry.ts"; | |
| 80 | 80 | import { previewEnv } from "../../apps/data.ts"; |
| 81 | 81 | import { checkWord } from "../../apps/check_word.ts"; |
| 82 | 82 | import { getAppByRepo } from "../../core/apps.ts"; |
src/http/mcp/tools/apps.ts +1 −1
| @@ -1,4 +1,4 @@ | ||
| 1 | import { appsRuntime, envsFor } from "../../../apps/runtime.ts"; | |
| 1 | import { appsRuntime, envsFor } from "../../../apps/runtime_registry.ts"; | |
| 2 | 2 | import { listActiveRuns } from "../../../core/runs.ts"; |
| 3 | 3 | import { appsOf } from "../../../web/studio/asks.ts"; |
| 4 | 4 | import { PULL_RUNS_DEFAULT, PULL_RUNS_MAX, pullRunLines } from "../../../apps/pull.ts"; |
src/http/mcp/tools/here.ts +1 −1
| @@ -1,4 +1,4 @@ | ||
| 1 | import { appsRuntime } from "../../../apps/runtime.ts"; | |
| 1 | import { appsRuntime } from "../../../apps/runtime_registry.ts"; | |
| 2 | 2 | import { hereOf } from "../../../apps/here.ts"; |
| 3 | 3 | import { manifestFor } from "../../../actions/here.ts"; |
| 4 | 4 | import { noticeOf } from "../../../billing/notice.ts"; |
src/http/mcp/tools/new_app.ts +1 −1
| @@ -1,4 +1,4 @@ | ||
| 1 | import { appsRuntime } from "../../../apps/runtime.ts"; | |
| 1 | import { appsRuntime } from "../../../apps/runtime_registry.ts"; | |
| 2 | 2 | import { listActiveRuns } from "../../../core/runs.ts"; |
| 3 | 3 | import { getUserByName } from "../../../core/users.ts"; |
| 4 | 4 | import { repositoryLimitMessage } from "../../../actions/repos.ts"; |
src/http/mcp/tools/preview.ts +1 −1
src/http/mcp/tools/probe.ts +1 −1
| @@ -1,4 +1,4 @@ | ||
| 1 | import { appsRuntime } from "../../../apps/runtime.ts"; | |
| 1 | import { appsRuntime } from "../../../apps/runtime_registry.ts"; | |
| 2 | 2 | import { getAppByRepo } from "../../../core/apps.ts"; |
| 3 | 3 | import { canWrite } from "../../../core/repos.ts"; |
| 4 | 4 | import { probeApp } from "../../../contract/probes.ts"; |
src/http/routes/operations.ts +1 −1
| @@ -7,7 +7,7 @@ import { keeperAnswer } from "../../web/studio/keeper_row.ts"; | ||
| 7 | 7 | import { lazyRoutes } from "../lazy_routes.ts"; |
| 8 | 8 | import { flowPage, valveSet, backupRetry, suggestionTake } from "../../web/pages/flow.ts"; |
| 9 | 9 | import { resolveAppHostname } from "../../apps/proxy.ts"; |
| 10 | import { appsRuntime } from "../../apps/runtime.ts"; | |
| 10 | import { appsRuntime } from "../../apps/runtime_registry.ts"; | |
| 11 | 11 | import { getVerifiedDomain } from "../../core/domains.ts"; |
| 12 | 12 | import { brokerStart } from "../../spawn/origin_broker.ts"; |
| 13 | 13 | import { cloudConnectPage, cloudConnectProvider, cloudConnectSubmit, cloudConnectBuild } from "../../web/pages/cloud.ts"; |
src/http/server.ts +1 −1
| @@ -141,7 +141,7 @@ import { RateLimiter, type Verdict } from "../core/ratelimit.ts"; | ||
| 141 | 141 | import { MAX_KEY_LENGTH, claimInFlight, joinInFlight, lookupIdempotent, replayedHeaders, requestFingerprint, storeIdempotent, type StoredResponse } from "../core/idempotency.ts"; |
| 142 | 142 | import { isAdminRoute } from "./route_marks.ts"; |
| 143 | 143 | import { Router } from "./router.ts"; |
| 144 | import { appsRuntime } from "../apps/runtime.ts"; | |
| 144 | import { appsRuntime } from "../apps/runtime_registry.ts"; | |
| 145 | 145 | import { holdAppHost } from "../apps/holding.ts"; |
| 146 | 146 | import { isArcadeHost, serveArcade } from "../arcade/host.ts"; |
| 147 | 147 | import { appWebSocketWith, type AppSocket, isWebSocketHandshake, proxyApp, resolveAppHost, unknownApp } from "../apps/proxy.ts"; |
src/looks/service.ts +1 −1
| @@ -39,7 +39,7 @@ import { dirname, join } from "node:path"; | ||
| 39 | 39 | import type { App } from "../app.ts"; |
| 40 | 40 | import { envBuild, envPull, isEnvName, previewEnv, type EnvName } from "../apps/data.ts"; |
| 41 | 41 | import { plainProof, signGrant, type GrantWho } from "../apps/grants.ts"; |
| 42 | import { appsRuntime } from "../apps/runtime.ts"; | |
| 42 | import { appsRuntime } from "../apps/runtime_registry.ts"; | |
| 43 | 43 | import { |
| 44 | 44 | getAppById, |
| 45 | 45 | getAppByRepo, |
src/metrics/app_sources.ts +1 −1
| @@ -4,7 +4,7 @@ | ||
| 4 | 4 | * watch has already read. It starts nothing and reads no process. |
| 5 | 5 | */ |
| 6 | 6 | import type { App } from "../app.ts"; |
| 7 | import { appsRuntime } from "../apps/runtime.ts"; | |
| 7 | import { appsRuntime } from "../apps/runtime_registry.ts"; | |
| 8 | 8 | import { listApps } from "../core/apps.ts"; |
| 9 | 9 | import { cellCountersFor } from "../spawn/process_counters.ts"; |
| 10 | 10 | import type { AppSources } from "./forge.ts"; |
src/spawn/child-apps.ts +5 −1
| @@ -13,7 +13,8 @@ import type { App } from "../app.ts"; | ||
| 13 | 13 | import type { ChecksHandle } from "../checks/lane_state.ts"; |
| 14 | 14 | import { checksFor } from "../checks/handles.ts"; |
| 15 | 15 | import { listApps } from "../core/apps.ts"; |
| 16 | import { appsRuntime, AppsRuntime } from "../apps/runtime.ts"; | |
| 16 | import { appsRuntime } from "../apps/runtime_registry.ts"; | |
| 17 | import type { AppsRuntime } from "../apps/runtime.ts"; | |
| 17 | 18 | import { childHost } from "./door.ts"; |
| 18 | 19 | import { childPublicUrl, parentOrigin } from "./placement.ts"; |
| 19 | 20 | import { childLabel, hostChild } from "../perf/child_time.ts"; |
| @@ -39,6 +40,9 @@ export function childRuntime(parent: App, name: string): AppsRuntime | undefined | ||
| 39 | 40 | export async function startChildApps(parent: App, child: App, name: string): Promise<void> { |
| 40 | 41 | const own = appsRuntime(parent); |
| 41 | 42 | if (own === undefined) return; |
| 43 | // Imported (before the once-per-child check, so two starts cannot interleave) when a child starts | |
| 44 | // its apps, not by the boot (#17179). | |
| 45 | const { AppsRuntime } = await import("../apps/runtime.ts"); | |
| 42 | 46 | // Loaded before the claim below, which must not wait: a parent with checks has loaded it already. |
| 43 | 47 | const parentChecks = checksFor(parent); |
| 44 | 48 | const startChecks = parentChecks === undefined ? undefined : (await import("../checks/service.ts")).startChecks; |
src/spawn/host.ts +2 −1
| @@ -8,7 +8,8 @@ | ||
| 8 | 8 | import { retireLapsedCloud } from "./lapse_cloud.ts"; |
| 9 | 9 | import { childDirOf } from "../actions/spawn.ts"; |
| 10 | 10 | import { createApp, type App } from "../app.ts"; |
| 11 | import { appsRuntime, type AppsRuntime } from "../apps/runtime.ts"; | |
| 11 | import { appsRuntime } from "../apps/runtime_registry.ts"; | |
| 12 | import type { AppsRuntime } from "../apps/runtime.ts"; | |
| 12 | 13 | import { resolveAppHost, type AppSocket, type AppTarget } from "../apps/proxy.ts"; |
| 13 | 14 | import { childAppsSummary, startChildApps, stopChildApps, stopChildAppsOf } from "./child-apps.ts"; |
| 14 | 15 | import { childHost } from "./door.ts"; |
src/system/feature_health.ts +2 −1
| @@ -11,7 +11,8 @@ import type { Reader } from "../actions/telemetry.ts"; | ||
| 11 | 11 | import { getAppById } from "../core/apps.ts"; |
| 12 | 12 | import { getRepoById } from "../core/repos.ts"; |
| 13 | 13 | import { listAbsorbed } from "../core/features.ts"; |
| 14 | import { appsRuntime, type EnvState, type EnvStatus } from "../apps/runtime.ts"; | |
| 14 | import { appsRuntime } from "../apps/runtime_registry.ts"; | |
| 15 | import type { EnvState, EnvStatus } from "../apps/runtime.ts"; | |
| 15 | 16 | |
| 16 | 17 | export interface FeatureHealth { |
| 17 | 18 | readonly slug: string; |
src/text/talk_link_words.ts +1 −1
| @@ -21,7 +21,7 @@ | ||
| 21 | 21 | import type { Database } from "bun:sqlite"; |
| 22 | 22 | import type { App } from "../app.ts"; |
| 23 | 23 | import { parseAppHost } from "../apps/proxy.ts"; |
| 24 | import { appsRuntime } from "../apps/runtime.ts"; | |
| 24 | import { appsRuntime } from "../apps/runtime_registry.ts"; | |
| 25 | 25 | import { getAppBySlug } from "../core/apps.ts"; |
| 26 | 26 | import { getIssue } from "../core/issues.ts"; |
| 27 | 27 | import { canRead, getRepo, getRepoById, type Repo } from "../core/repos.ts"; |
src/tui/screens/deploys.ts +1 −1
| @@ -110,7 +110,7 @@ import { egressSetting } from "../../core/capacity.ts"; | ||
| 110 | 110 | import { listRepoRuns } from "../../actions/runs.ts"; |
| 111 | 111 | import { carriedByRuns, carriedForRuns, carriesText } from "../../core/carried.ts"; |
| 112 | 112 | import { repoDir } from "../../git/repos.ts"; |
| 113 | import { appsRuntime } from "../../apps/runtime.ts"; | |
| 113 | import { appsRuntime } from "../../apps/runtime_registry.ts"; | |
| 114 | 114 | import { getAppByRepo } from "../../core/apps.ts"; |
| 115 | 115 | import { canAdmin, canWrite, type Repo } from "../../core/repos.ts"; |
| 116 | 116 | import type { Knock } from "../../contract/probe.ts"; |
src/tui/screens/newapp.ts +1 −1
| @@ -10,7 +10,7 @@ | ||
| 10 | 10 | import { appLimitWords } from "../../actions/app_limit.ts"; |
| 11 | 11 | import { NEW_APP_ERRORS, NO_NAME_ERROR, newAppFromSentence, privateNotice } from "../../actions/apps.ts"; |
| 12 | 12 | import { repositoryLimitMessage } from "../../actions/repos.ts"; |
| 13 | import { appsRuntime } from "../../apps/runtime.ts"; | |
| 13 | import { appsRuntime } from "../../apps/runtime_registry.ts"; | |
| 14 | 14 | import { templateChoices } from "../../apps/template_folders.ts"; |
| 15 | 15 | import { offeredTemplates } from "../../core/app_templates.ts"; |
| 16 | 16 | import { listOrgsForUser } from "../../core/orgs.ts"; |
src/tui/screens/pull.ts +2 −3
| @@ -66,9 +66,8 @@ import { combinedView, combinedWords, type CombinedView } from "../../core/combi | ||
| 66 | 66 | import { previewEnv } from "../../apps/data.ts"; |
| 67 | 67 | import { findingsWords, pullPreviewFindings } from "../../core/preview_findings.ts"; |
| 68 | 68 | import { pullSecrets, secretLine, secretsWords } from "../../checks/pushed_secrets.ts"; |
| 69 | import { | |
| 70 | type EnvState, | |
| 71 | type EnvStatus, envsFor } from "../../apps/runtime.ts"; | |
| 69 | import { envsFor } from "../../apps/runtime_registry.ts"; | |
| 70 | import type { EnvState, EnvStatus } from "../../apps/runtime.ts"; | |
| 72 | 71 | import { proposedByText } from "../../core/proposal_token.ts"; |
| 73 | 72 | import { attestationLine } from "../../core/attestation.ts"; |
| 74 | 73 | import { getAppByRepo } from "../../core/apps.ts"; |
src/tui/ssh-tell.ts +1 −1
| @@ -11,7 +11,7 @@ | ||
| 11 | 11 | import { tell } from "../actions/tell.ts"; |
| 12 | 12 | import { SAY_SOMETHING_WORDS } from "../actions/tell_words.ts"; |
| 13 | 13 | import { appGate, ttyRefusalText } from "../apps/tty.ts"; |
| 14 | import { appsRuntime } from "../apps/runtime.ts"; | |
| 14 | import { appsRuntime } from "../apps/runtime_registry.ts"; | |
| 15 | 15 | import type { App } from "../app.ts"; |
| 16 | 16 | import type { AppRecord } from "../core/apps.ts"; |
| 17 | 17 | import { canRead, getRepo, getRepoById } from "../core/repos.ts"; |
src/web/layout.ts +1 −1
| @@ -20,7 +20,7 @@ import { OPENSEARCH_PATH, OPENSEARCH_TITLE, OPENSEARCH_TYPE } from "./opensearch | ||
| 20 | 20 | import { protectionNotice } from "../kernel/protection.ts"; |
| 21 | 21 | import { appsForRepos } from "../core/apps.ts"; |
| 22 | 22 | import { foundryHref } from "../actions/foundry_door.ts"; |
| 23 | import { appsRuntime } from "../apps/runtime.ts"; | |
| 23 | import { appsRuntime } from "../apps/runtime_registry.ts"; | |
| 24 | 24 | import { doorRepos } from "../actions/front.ts"; |
| 25 | 25 | import { actionRows, appActionRows, peopleRows, settingsRows } from "./palette_rows.ts"; |
| 26 | 26 | import { wordClip } from "../text/word_clip.ts"; |
src/web/page_tag.ts +1 −1
| @@ -10,7 +10,7 @@ | ||
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | 12 | import { doorRepos } from "../actions/front.ts"; |
| 13 | import { appsRuntime } from "../apps/runtime.ts"; | |
| 13 | import { appsRuntime } from "../apps/runtime_registry.ts"; | |
| 14 | 14 | import { appsForRepos } from "../core/apps.ts"; |
| 15 | 15 | import type { Ctx } from "../http/context.ts"; |
| 16 | 16 | import { taggable, unchanged } from "../http/etag.ts"; |
src/web/pages/api.ts +1 −1
| @@ -6,7 +6,7 @@ | ||
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | 8 | import { knownSpec, refreshSpec } from "../../apps/api_spec.ts"; |
| 9 | import { appsRuntime } from "../../apps/runtime.ts"; | |
| 9 | import { appsRuntime } from "../../apps/runtime_registry.ts"; | |
| 10 | 10 | import { appView } from "../../actions/apps.ts"; |
| 11 | 11 | import { narrow, reference, type Area } from "../../contract/reference.ts"; |
| 12 | 12 | import { openapiText, roleOf } from "../../contract/served.ts"; |
src/web/pages/apps.ts +2 −1
| @@ -45,7 +45,8 @@ import { appNameJs } from "./apps-name.ts"; | ||
| 45 | 45 | import { STARTERS, starterFromQuery, starterHref } from "./apps-starters.ts"; |
| 46 | 46 | import { previewEnv, type EnvName } from "../../apps/data.ts"; |
| 47 | 47 | import { envRefusalText, redeployedText, stoppedText } from "../../actions/env_words.ts"; |
| 48 | import { appsRuntime, type EnvState, type EnvStatus, envsFor } from "../../apps/runtime.ts"; | |
| 48 | import { appsRuntime, envsFor } from "../../apps/runtime_registry.ts"; | |
| 49 | import type { EnvState, EnvStatus } from "../../apps/runtime.ts"; | |
| 49 | 50 | import { firstPreviews, goldenPath, goldenPathLine } from "../../apps/golden_path.ts"; |
| 50 | 51 | import { appHostSuffix } from "../../apps/host.ts"; |
| 51 | 52 | import { appsForRepos, getAppByRepo, type AppRecord } from "../../core/apps.ts"; |
src/web/pages/audit.ts +1 −1
| @@ -13,7 +13,7 @@ | ||
| 13 | 13 | * which are as public as the file in the repository. |
| 14 | 14 | */ |
| 15 | 15 | |
| 16 | import { appsRuntime } from "../../apps/runtime.ts"; | |
| 16 | import { appsRuntime } from "../../apps/runtime_registry.ts"; | |
| 17 | 17 | import { appsForRepos, getAppByRepo } from "../../core/apps.ts"; |
| 18 | 18 | import { canWrite, listReposVisibleTo, type Repo } from "../../core/repos.ts"; |
| 19 | 19 | import type { Ctx } from "../../http/context.ts"; |
src/web/pages/board.ts +1 −1
| @@ -124,7 +124,7 @@ import { | ||
| 124 | 124 | type FigureWords, |
| 125 | 125 | type WordCtx, |
| 126 | 126 | } from "../studio/words.ts"; |
| 127 | import { appsRuntime } from "../../apps/runtime.ts"; | |
| 127 | import { appsRuntime } from "../../apps/runtime_registry.ts"; | |
| 128 | 128 | import { lookUrl } from "../../core/looks.ts"; |
| 129 | 129 | import { thumbLook } from "./looks.ts"; |
| 130 | 130 | import { milestoneHref } from "./milestones.ts"; |
src/web/pages/looks.ts +1 −1
| @@ -36,7 +36,7 @@ import { mayFetchLook as mayFetchLookFor } from "../../looks/readable.ts"; | ||
| 36 | 36 | import { notePhase, takeSessionTime, timePhase } from "../../core/route_timing.ts"; |
| 37 | 37 | import { retryAt } from "../../looks/retries.ts"; |
| 38 | 38 | import { whyNoPicture } from "../../looks/why.ts"; |
| 39 | import { appsRuntime } from "../../apps/runtime.ts"; | |
| 39 | import { appsRuntime } from "../../apps/runtime_registry.ts"; | |
| 40 | 40 | import { noPicture } from "../look_none.ts"; |
| 41 | 41 | import { loadRepo, repoBase } from "../chrome.ts"; |
| 42 | 42 | import { html, when, type Html } from "../html.ts"; |
src/web/pages/pull.ts +1 −1
| @@ -58,7 +58,7 @@ import { mainLineFor } from "../../checks/red_main_line.ts"; | ||
| 58 | 58 | import { runningProgress } from "../../checks/progress.ts"; |
| 59 | 59 | import { checkStale, checksHold } from "../../checks/stale.ts"; |
| 60 | 60 | import { isDraft, isTalkDraft, TALK_DRAFT, TALK_DRAFT_LINE } from "../../core/pulls.ts"; |
| 61 | import { appsRuntime } from "../../apps/runtime.ts"; | |
| 61 | import { appsRuntime } from "../../apps/runtime_registry.ts"; | |
| 62 | 62 | import { checkSummary, runnerSilent, type CheckSummary } from "../../core/runs.ts"; |
| 63 | 63 | import { |
| 64 | 64 | anchorKey, |
src/web/pages/search.ts +1 −1
| @@ -19,7 +19,7 @@ import { rejoinableParent, severPreview } from "../../actions/sever_undo.ts"; | ||
| 19 | 19 | import { DISCONNECT_DETAIL } from "../../actions/origin_words.ts"; |
| 20 | 20 | import { strangerCodeSearch } from "../../http/strangers.ts"; |
| 21 | 21 | import { search } from "../../actions/search.ts"; |
| 22 | import { envsFor } from "../../apps/runtime.ts"; | |
| 22 | import { envsFor } from "../../apps/runtime_registry.ts"; | |
| 23 | 23 | import type { AppRecord } from "../../core/apps.ts"; |
| 24 | 24 | import { getSnapshot } from "../../core/snapshots.ts"; |
| 25 | 25 | import { openLabelCounts } from "../../core/issues.ts"; |
src/web/pages/settings.ts +1 −1
| @@ -64,7 +64,7 @@ import { | ||
| 64 | 64 | import { AUTONOMY_SAID, checkAutonomy, isDecisionsBy, isLanding, type Landing } from "../../core/repos.ts"; |
| 65 | 65 | import { TRANSFER_SAID, TRANSFER_STATUS, renameRepository, transferRepository } from "../../actions/transfer.ts"; |
| 66 | 66 | import { updateRepoSettings } from "../../actions/repos.ts"; |
| 67 | import { appsRuntime } from "../../apps/runtime.ts"; | |
| 67 | import { appsRuntime } from "../../apps/runtime_registry.ts"; | |
| 68 | 68 | import { nameFrame, notePhase, takeSessionTime, timePhase, timePhaseAsync } from "../../core/route_timing.ts"; |
| 69 | 69 | import { appVitals, shiftText, speedText as ms, type AppVitals } from "../../apps/vitals.ts"; |
| 70 | 70 | import { APP_VISITORS_COUNT } from "../../flow/kpi_words.ts"; |
src/web/pages/talk_preview.ts +1 −1
| @@ -22,7 +22,7 @@ import type { User } from "../../core/users.ts"; | ||
| 22 | 22 | import { paneCrew, paneFell, paneInfo, type PaneCrew, type Work } from "../../core/talk_work.ts"; |
| 23 | 23 | import { mayReadRunLog, mayReadRuns } from "../../actions/runs.ts"; |
| 24 | 24 | import { getAppByRepo } from "../../core/apps.ts"; |
| 25 | import { appsRuntime } from "../../apps/runtime.ts"; | |
| 25 | import { appsRuntime } from "../../apps/runtime_registry.ts"; | |
| 26 | 26 | import { originOf } from "../../actions/talk_workspace.ts"; |
| 27 | 27 | import { workLineHtml } from "../talk_lines.ts"; |
| 28 | 28 | import type { Ctx } from "../../http/context.ts"; |
src/web/repo_steps.ts +1 −1
| @@ -8,7 +8,7 @@ | ||
| 8 | 8 | |
| 9 | 9 | import { mayReadRuns, workingNowCount } from "../actions/runs.ts"; |
| 10 | 10 | import { REPO_TABS } from "./keymap.ts"; |
| 11 | import { appsRuntime } from "../apps/runtime.ts"; | |
| 11 | import { appsRuntime } from "../apps/runtime_registry.ts"; | |
| 12 | 12 | import { knownSpec, warmSpec } from "../apps/api_spec.ts"; |
| 13 | 13 | import { getAppByRepo } from "../core/apps.ts"; |
| 14 | 14 | import { canAdmin, canEnterApp, canWrite, visibleForks, type Repo } from "../core/repos.ts"; |
src/web/studio/app.ts +1 −1
| @@ -21,7 +21,7 @@ import { egressSetting } from "../../core/capacity.ts"; | ||
| 21 | 21 | import { egressNote } from "./egress.ts"; |
| 22 | 22 | import { audit } from "../../contract/audit.ts"; |
| 23 | 23 | import { latestProbes } from "../../contract/probes.ts"; |
| 24 | import { appsRuntime, envsFor } from "../../apps/runtime.ts"; | |
| 24 | import { appsRuntime, envsFor } from "../../apps/runtime_registry.ts"; | |
| 25 | 25 | import { TELL_LIMIT_WORDS, TELL_TEXT_MAX } from "../../actions/tell_from.ts"; |
| 26 | 26 | import { listCrewRoles, type CrewRole } from "../../core/agents.ts"; |
| 27 | 27 |
src/web/studio/change.ts +1 −1
| @@ -25,7 +25,7 @@ import { accountsByName, marksByName, marksOf, type Mark } from "../../core/mark | ||
| 25 | 25 | import { waitingFor } from "../../core/waiting_for.ts"; |
| 26 | 26 | import { mayView } from "../../core/sealed.ts"; |
| 27 | 27 | import { threadNote } from "../../crew/direct.ts"; |
| 28 | import { appsRuntime, envsFor } from "../../apps/runtime.ts"; | |
| 28 | import { appsRuntime, envsFor } from "../../apps/runtime_registry.ts"; | |
| 29 | 29 | import { getAppByRepo, type AppRecord } from "../../core/apps.ts"; |
| 30 | 30 | import { |
| 31 | 31 | getPull, |
src/web/studio/decisions.ts +1 −1
| @@ -22,7 +22,7 @@ import { changeHref } from "./nouns.ts"; | ||
| 22 | 22 | import { flatten } from "./note.ts"; |
| 23 | 23 | import { testsClause } from "./words.ts"; |
| 24 | 24 | import { greenRunsAt, type Run } from "../../core/runs.ts"; |
| 25 | import { TESTS_PASSED_TAIL } from "../../apps/runtime.ts"; | |
| 25 | import { TESTS_PASSED_TAIL } from "../../apps/runtime_env.ts"; | |
| 26 | 26 | import { MOVED_SINCE_APPROVAL } from "../../core/approval_at.ts"; |
| 27 | 27 | import { reviewerPaused } from "../../crew/reviewer_paused.ts"; |
| 28 | 28 | import { conflictsOf, conflictWords } from "../../crew/stale_asks.ts"; |
src/web/studio/home.ts +2 −1
| @@ -20,7 +20,8 @@ import { | ||
| 20 | 20 | } from "../../actions/front.ts"; |
| 21 | 21 | import { catalog, refreshCatalogQuietly } from "../../packs/catalog.ts"; |
| 22 | 22 | import type { Pack } from "../../packs/pack.ts"; |
| 23 | import { appsRuntime, type EnvState } from "../../apps/runtime.ts"; | |
| 23 | import { appsRuntime } from "../../apps/runtime_registry.ts"; | |
| 24 | import type { EnvState } from "../../apps/runtime.ts"; | |
| 24 | 25 | import { accountsClosedIn } from "../../core/users.ts"; |
| 25 | 26 | import { plansRow } from "../plans_row.ts"; |
| 26 | 27 | import { freePlanName, funnelJs, noteHomeVisit } from "../funnel_door.ts"; |
src/web/studio/lists.ts +1 −1
| @@ -12,7 +12,7 @@ | ||
| 12 | 12 | import { securityLine } from "../pages/reports.ts"; |
| 13 | 13 | import { keyOf } from "../keymap.ts"; |
| 14 | 14 | import { sealedScope } from "../../core/sealed.ts"; |
| 15 | import { appsRuntime } from "../../apps/runtime.ts"; | |
| 15 | import { appsRuntime } from "../../apps/runtime_registry.ts"; | |
| 16 | 16 | import { getAppByRepo } from "../../core/apps.ts"; |
| 17 | 17 | import { |
| 18 | 18 | labelsForIssues, |
src/web/studio/now.ts +1 −1
| @@ -10,7 +10,7 @@ | ||
| 10 | 10 | import { frontPulls } from "./front_pulls.ts"; |
| 11 | 11 | import { eventRows, mayView, sealedScope } from "../../core/sealed.ts"; |
| 12 | 12 | import { envPull, previewEnv } from "../../apps/data.ts"; |
| 13 | import { appsRuntime, envsFor } from "../../apps/runtime.ts"; | |
| 13 | import { appsRuntime, envsFor } from "../../apps/runtime_registry.ts"; | |
| 14 | 14 | import { notePhase, takeSessionTime, timePhase } from "../../core/route_timing.ts"; |
| 15 | 15 | import { listCrewRoles } from "../../core/agents.ts"; |
| 16 | 16 | import { getAppByRepo, type AppRecord } from "../../core/apps.ts"; |
src/web/studio/previews.ts +2 −4
| @@ -16,10 +16,8 @@ import { notePhase, takeSessionTime, timePhase } from "../../core/route_timing.t | ||
| 16 | 16 | import { terminalFor } from "../../actions/apps.ts"; |
| 17 | 17 | import { envPull, previewEnv } from "../../apps/data.ts"; |
| 18 | 18 | import { appOnboardingLine } from "../../apps/onboarding.ts"; |
| 19 | import { | |
| 20 | appsRuntime, | |
| 21 | type AppsRuntime, | |
| 22 | type EnvStatus, envsFor } from "../../apps/runtime.ts"; | |
| 19 | import { appsRuntime, envsFor } from "../../apps/runtime_registry.ts"; | |
| 20 | import type { AppsRuntime, EnvStatus } from "../../apps/runtime.ts"; | |
| 23 | 21 | import { getAppByRepo, type AppRecord } from "../../core/apps.ts"; |
| 24 | 22 | import type { Pull } from "../../core/pulls.ts"; |
| 25 | 23 | import { canAdmin, canSeeOwnerFacts, type Repo } from "../../core/repos.ts"; |
src/web/studio/run.ts +1 −1
| @@ -18,7 +18,7 @@ import { checkSteps, stepWord, type LookVitals } from "../../checks/summary.ts"; | ||
| 18 | 18 | import { vitalsTable } from "./vitals.ts"; |
| 19 | 19 | import { parseTestsRow, testsRowWords } from "../../checks/tests-row.ts"; |
| 20 | 20 | import { directionNote } from "../../crew/direct.ts"; |
| 21 | import { appsRuntime } from "../../apps/runtime.ts"; | |
| 21 | import { appsRuntime } from "../../apps/runtime_registry.ts"; | |
| 22 | 22 | import { getAppByRepo } from "../../core/apps.ts"; |
| 23 | 23 | import { carriedFor } from "../../core/carried.ts"; |
| 24 | 24 | import { getIssueById } from "../../core/issues.ts"; |
src/web/studio/shelf.ts +2 −1
| @@ -25,7 +25,8 @@ | ||
| 25 | 25 | */ |
| 26 | 26 | |
| 27 | 27 | import { spanWords } from "../../apps/golden_path.ts"; |
| 28 | import { appsRuntime, type EnvStatus } from "../../apps/runtime.ts"; | |
| 28 | import { appsRuntime } from "../../apps/runtime_registry.ts"; | |
| 29 | import type { EnvStatus } from "../../apps/runtime.ts"; | |
| 29 | 30 | import { appsForRepos, type AppRecord } from "../../core/apps.ts"; |
| 30 | 31 | import { reposWithBuilder } from "../../core/agents.ts"; |
| 31 | 32 | import { getIssuesByIds, reposWithUnclaimedTell } from "../../core/issues.ts"; |
src/web/studio/tell.ts +1 −1
| @@ -18,7 +18,7 @@ import { accountsByName, marksOf } from "../../core/marks.ts"; | ||
| 18 | 18 | import { TELL_RUNS_SHOWN, tellStatus } from "../../runs/tell_status.ts"; |
| 19 | 19 | import { threadNote } from "../../crew/direct.ts"; |
| 20 | 20 | import { alreadyDone } from "../../core/done_on_main.ts"; |
| 21 | import { appsRuntime } from "../../apps/runtime.ts"; | |
| 21 | import { appsRuntime } from "../../apps/runtime_registry.ts"; | |
| 22 | 22 | import { getAppByRepo } from "../../core/apps.ts"; |
| 23 | 23 | import { LATER_TITLED } from "../../core/pillars.ts"; |
| 24 | 24 | import { deferredOf, linkedIssueIds } from "../../core/dependencies.ts"; |
src/web/studio/toolbar_side.ts +1 −1
| @@ -9,7 +9,7 @@ | ||
| 9 | 9 | |
| 10 | 10 | import { sideOf, type Side } from "../../apps/side.ts"; |
| 11 | 11 | import { envPull } from "../../apps/data.ts"; |
| 12 | import { appsRuntime, envsFor } from "../../apps/runtime.ts"; | |
| 12 | import { appsRuntime, envsFor } from "../../apps/runtime_registry.ts"; | |
| 13 | 13 | import type { AppRecord } from "../../core/apps.ts"; |
| 14 | 14 | import { getIssuesByNumbers, numberKey } from "../../core/issues.ts"; |
| 15 | 15 | import type { Repo } from "../../core/repos.ts"; |
src/web/studio/words.ts +3 −6
| @@ -12,12 +12,9 @@ import { crewFace } from "../pixel.ts"; | ||
| 12 | 12 | import { shownState } from "../../runs/state.ts"; |
| 13 | 13 | import type { Database } from "bun:sqlite"; |
| 14 | 14 | import { ancestries, type AncestryCache } from "./ancestry.ts"; |
| 15 | import { | |
| 16 | NO_TESTS_TAIL, | |
| 17 | TESTS_PASSED_TAIL, | |
| 18 | type AppsRuntime, | |
| 19 | type EnvStatus, | |
| 20 | } from "../../apps/runtime.ts"; | |
| 15 | import { NO_TESTS_TAIL, TESTS_PASSED_TAIL } from "../../apps/runtime_env.ts"; | |
| 16 | import type { AppsRuntime } from "../../apps/runtime.ts"; | |
| 17 | import type { EnvStatus } from "../../apps/runtime_env.ts"; | |
| 21 | 18 | import type { AppRecord } from "../../core/apps.ts"; |
| 22 | 19 | import { canEnterApp, getRepoById, type Repo } from "../../core/repos.ts"; |
| 23 | 20 | import type { User } from "../../core/users.ts"; |
test/apps-runtime-split.test.ts +4 −3
| @@ -11,7 +11,8 @@ import { readdirSync, readFileSync } from "node:fs"; | ||
| 11 | 11 | import { tmpdir } from "node:os"; |
| 12 | 12 | import { join } from "node:path"; |
| 13 | 13 | import { createApp } from "../src/app.ts"; |
| 14 | import { AppsRuntime, appsRuntime, envsFor } from "../src/apps/runtime.ts"; | |
| 14 | import { appsRuntime, envsFor } from "../src/apps/runtime_registry.ts"; | |
| 15 | import { AppsRuntime } from "../src/apps/runtime.ts"; | |
| 15 | 16 | import * as status from "../src/apps/runtime_status.ts"; |
| 16 | 17 | |
| 17 | 18 | const root = new URL("..", import.meta.url).pathname; |
| @@ -47,7 +48,7 @@ describe("the runtime's modules", () => { | ||
| 47 | 48 | expect(bootRuns.size).toBe(0); |
| 48 | 49 | }); |
| 49 | 50 | |
| 50 | test("each module is under 600 lines, and only runtime.ts holds module-level state", () => { | |
| 51 | test("each module is under 600 lines, and only runtime_registry.ts holds module-level state", () => { | |
| 51 | 52 | expect(parts.length).toBeGreaterThan(5); |
| 52 | 53 | const held: string[] = []; |
| 53 | 54 | for (const file of parts) { |
| @@ -56,7 +57,7 @@ describe("the runtime's modules", () => { | ||
| 56 | 57 | for (const line of text.split("\n")) |
| 57 | 58 | if (/^(?:export\s+)?(?:const|let)\s+\w+\s*=\s*new\s+(?:Weak)?(?:Map|Set)\b|^(?:export\s+)?let\s/.test(line)) held.push(`${file}: ${line}`); |
| 58 | 59 | } |
| 59 | expect(held).toEqual(["runtime.ts: const runtimes = new WeakMap<App, AppsRuntime>();"]); | |
| 60 | expect(held).toEqual(["runtime_registry.ts: const runtimes = new WeakMap<App, AppsRuntime>();"]); | |
| 60 | 61 | }); |
| 61 | 62 | }); |
| 62 | 63 |
test/boot-lazy.test.ts +4 −4
| @@ -23,12 +23,12 @@ test("the terminal's server is imported dynamically by the boot", () => { | ||
| 23 | 23 | |
| 24 | 24 | // #17021: the services only the boot starts are not in its static closure; that each still starts |
| 25 | 25 | // is proved on a real boot (boot-production.test.ts, "background service started service=<name>"). |
| 26 | // The heavier ones are still reached by pages and actions, each its own follow-up: #17179, | |
| 27 | // #17180, #17181, #17182, #17183 (apps/runtime, checks/service, crew/dispatch, | |
| 28 | // looks/service, snapshot/service). | |
| 26 | // The heavier ones are still reached by pages and actions, each its own follow-up: #17180, | |
| 27 | // #17181, #17182, #17183 (checks/service, crew/dispatch, looks/service). | |
| 28 | // apps/runtime is out (#17179): its accessors live in apps/runtime_registry.ts. | |
| 29 | 29 | test("the boot's static imports do not reach the services only it starts", () => { |
| 30 | 30 | const closure = [...staticClosure(resolve("src/main.ts"))]; |
| 31 | const only = ["maintain/runner.ts", "nightly/service.ts", "keeper/keeper.ts", "keeper/wire.ts", "crew/routines.ts", "checks/service.ts", "snapshot/service.ts"]; | |
| 31 | const only = ["maintain/runner.ts", "nightly/service.ts", "keeper/keeper.ts", "keeper/wire.ts", "crew/routines.ts", "checks/service.ts", "snapshot/service.ts", "apps/runtime.ts"]; | |
| 32 | 32 | for (const file of only) expect(closure.some((f) => f.endsWith(`/src/${file}`)), file).toBe(false); |
| 33 | 33 | }); |
| 34 | 34 |
test/boundary-secrets-process.test.ts +1 −1
| @@ -23,7 +23,7 @@ import { | ||
| 23 | 23 | type EnvName, |
| 24 | 24 | } from "../src/apps/data.ts"; |
| 25 | 25 | import { identityKey, pillWhere } from "../src/apps/proxy.ts"; |
| 26 | import { appsRuntime } from "../src/apps/runtime.ts"; | |
| 26 | import { appsRuntime } from "../src/apps/runtime_registry.ts"; | |
| 27 | 27 | import { PREVIEW_WAITS, toolbarJs, toolbarTag } from "../src/apps/toolbar.ts"; |
| 28 | 28 | import { readRunLog } from "../src/runs/log.ts"; |
| 29 | 29 | import { runAppTty, type TtyHost } from "../src/apps/tty.ts"; |
test/helpers/apps-forge.ts +2 −1
| @@ -11,7 +11,8 @@ import { join } from "node:path"; | ||
| 11 | 11 | import { createApp, type App } from "../../src/app.ts"; |
| 12 | 12 | import { setSsh } from "../../src/settings/ssh.ts"; |
| 13 | 13 | import { newApp } from "../../src/actions/apps.ts"; |
| 14 | import { AppsRuntime, appsRuntime as runtimeOf } from "../../src/apps/runtime.ts"; | |
| 14 | import { appsRuntime as runtimeOf } from "../../src/apps/runtime_registry.ts"; | |
| 15 | import { AppsRuntime } from "../../src/apps/runtime.ts"; | |
| 15 | 16 | import { getAppByRepo, type AppRecord } from "../../src/core/apps.ts"; |
| 16 | 17 | import type { Repo } from "../../src/core/repos.ts"; |
| 17 | 18 | import { listRuns, type Run } from "../../src/core/runs.ts"; |
test/private-app.test.ts +2 −1
| @@ -16,7 +16,8 @@ import { newApp, openEnvUrl } from "../src/actions/apps.ts"; | ||
| 16 | 16 | import { updateRepoSettings } from "../src/actions/repos.ts"; |
| 17 | 17 | import { createApp, type App } from "../src/app.ts"; |
| 18 | 18 | import { grantUrl } from "../src/apps/proxy.ts"; |
| 19 | import { AppsRuntime, envsFor } from "../src/apps/runtime.ts"; | |
| 19 | import { envsFor } from "../src/apps/runtime_registry.ts"; | |
| 20 | import { AppsRuntime } from "../src/apps/runtime.ts"; | |
| 20 | 21 | import { runAppTty, type TtyHost } from "../src/apps/tty.ts"; |
| 21 | 22 | import type { AppRecord } from "../src/core/apps.ts"; |
| 22 | 23 | import { getRepoById, type Repo } from "../src/core/repos.ts"; |
test/probe.test.ts +2 −1
| @@ -12,7 +12,8 @@ import { join } from "node:path"; | ||
| 12 | 12 | import { createApp, type App } from "../src/app.ts"; |
| 13 | 13 | import { newApp } from "../src/actions/apps.ts"; |
| 14 | 14 | import { commitToBranch } from "../src/actions/repos.ts"; |
| 15 | import { AppsRuntime, appsRuntime } from "../src/apps/runtime.ts"; | |
| 15 | import { appsRuntime } from "../src/apps/runtime_registry.ts"; | |
| 16 | import { AppsRuntime } from "../src/apps/runtime.ts"; | |
| 16 | 17 | import { bakedFiles as scaffoldFiles } from "../src/apps/template.ts"; |
| 17 | 18 | import { audit } from "../src/contract/audit.ts"; |
| 18 | 19 | import { probe, type Probed } from "../src/contract/probe.ts"; |
new above
offline