Public: anyone can read this; the crew can change it.
src/, scripts/ and bench/ carry no unused imports or locals: `tsc --noUnusedLocals` finds nothing there #4744
Check · Review · Land · Live done — Landed and live in production.
mason/forge:mason/4740-src-scripts-and-bench-carry-no-unused-im → main 3 commits fork
46 files
changed +31
−115
bench/seed.ts +2 −2
| @@ -15,8 +15,8 @@ | ||
| 15 | 15 | */ |
| 16 | 16 | |
| 17 | 17 | import { mkdirSync, rmSync } from "node:fs"; |
| 18 | import { createApp, type App } from "../src/app.ts"; | |
| 19 | import { createIssue, nextNumber } from "../src/core/issues.ts"; | |
| 18 | import { createApp } from "../src/app.ts"; | |
| 19 | import { createIssue } from "../src/core/issues.ts"; | |
| 20 | 20 | import { createRepo as coreCreateRepo } from "../src/core/repos.ts"; |
| 21 | 21 | import { createUser } from "../src/core/users.ts"; |
| 22 | 22 | import { commitFiles } from "../src/git/write.ts"; |
src/actions/apps.ts +1 −1
| @@ -51,7 +51,7 @@ import type { Issue } from "../core/issues.ts"; | ||
| 51 | 51 | import { getPull } from "../core/pulls.ts"; |
| 52 | 52 | import { canAdmin, canEnterApp, canWrite, getRepo, type Repo } from "../core/repos.ts"; |
| 53 | 53 | import type { Run } from "../core/runs.ts"; |
| 54 | import { getUserByName, type User } from "../core/users.ts"; | |
| 54 | import { type User } from "../core/users.ts"; | |
| 55 | 55 | import { resolveOid } from "../git/merge.ts"; |
| 56 | 56 | import { repoDir } from "../git/repos.ts"; |
| 57 | 57 | import { err, ok, type Result } from "../kernel/result.ts"; |
src/actions/asks_decide.ts +1 −1
| @@ -7,7 +7,7 @@ | ||
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | 9 | import type { App } from "../app.ts"; |
| 10 | import { getDecision, latestDecision } from "../core/decisions.ts"; | |
| 10 | import { getDecision } from "../core/decisions.ts"; | |
| 11 | 11 | import { getIssueById } from "../core/issues.ts"; |
| 12 | 12 | import { getRepoById } from "../core/repos.ts"; |
| 13 | 13 | import type { User } from "../core/users.ts"; |
src/actions/issues.ts +1 −1
| @@ -18,7 +18,7 @@ | ||
| 18 | 18 | * "mirrored" on the others, which is honest rather than silently wrong. |
| 19 | 19 | */ |
| 20 | 20 | |
| 21 | import { canSeeSealed, mayView, setSealed } from "../core/sealed.ts"; | |
| 21 | import { mayView, setSealed } from "../core/sealed.ts"; | |
| 22 | 22 | import { requireVerified } from "./verify.ts"; |
| 23 | 23 | import { requireAbility } from "./roles.ts"; |
| 24 | 24 | import type { App } from "../app.ts"; |
src/actions/model_grant.ts −1
| @@ -7,7 +7,6 @@ | ||
| 7 | 7 | import type { App } from "../app.ts"; |
| 8 | 8 | import { |
| 9 | 9 | addOwnSubscription, |
| 10 | ownSubscription, | |
| 11 | 10 | setModelGrant, |
| 12 | 11 | validGrant, |
| 13 | 12 | } from "../core/model_grant.ts"; |
src/actions/origins.ts +1 −2
| @@ -28,7 +28,7 @@ import { | ||
| 28 | 28 | findOrigin, |
| 29 | 29 | getOriginById, |
| 30 | 30 | getOriginFor, |
| 31 | hostOf, siteOf, | |
| 31 | siteOf, | |
| 32 | 32 | linkRepoToOrigin, |
| 33 | 33 | listDetachedMirrors, |
| 34 | 34 | listMirrors, |
| @@ -94,7 +94,6 @@ import { open } from "../kernel/secret.ts"; | ||
| 94 | 94 | import { |
| 95 | 95 | staticCredential, |
| 96 | 96 | type OriginKind, |
| 97 | type Provider, | |
| 98 | 97 | } from "../origins/types.ts"; |
| 99 | 98 | import { err, ok, type Result } from "../kernel/result.ts"; |
| 100 | 99 | import { |
src/actions/pulls.ts +1 −2
| @@ -33,7 +33,7 @@ import { | ||
| 33 | 33 | } from "../core/pulls.ts"; |
| 34 | 34 | import { isStructural, pillarsOf } from "../core/pillars.ts"; |
| 35 | 35 | import type { Repo } from "../core/repos.ts"; |
| 36 | import { canRead, getRepoById } from "../core/repos.ts"; | |
| 36 | import { canRead } from "../core/repos.ts"; | |
| 37 | 37 | import { sealedByNumber } from "../core/sealed.ts"; |
| 38 | 38 | import { |
| 39 | 39 | addReviewComment, |
| @@ -60,7 +60,6 @@ import { grantRun } from "../core/run_grant.ts"; | ||
| 60 | 60 | import { commitIdentity } from "../core/commit_identity.ts"; |
| 61 | 61 | import { getUserById, getUserByName, type User } from "../core/users.ts"; |
| 62 | 62 | import type { MergeStrategy } from "../git/merge.ts"; |
| 63 | import { fetchInto, resolveOid, writeRef } from "../git/merge.ts"; | |
| 64 | 63 | import { repoDir } from "../git/repos.ts"; |
| 65 | 64 | import { importIssue, importReviewStates } from "../origins/import.ts"; |
| 66 | 65 | import { err, ok, type Result } from "../kernel/result.ts"; |
src/checks/service.ts −1
| @@ -54,7 +54,6 @@ import { MAX_FILED, clearedFiles, fileOrderDependent } from "./order_dependent.t | ||
| 54 | 54 | import { ASKED, redMain, unheld } from "./red_main.ts"; |
| 55 | 55 | import { IMPACT_FILE, keepImpact, seedImpact } from "./impact-store.ts"; |
| 56 | 56 | import { getIssueById } from "../core/issues.ts"; |
| 57 | import { repoDir } from "../git/repos.ts"; | |
| 58 | 57 | import { BUDGETS, budgetSummary } from "../kernel/budgets.ts"; |
| 59 | 58 | import { transact } from "../kernel/db.ts"; |
| 60 | 59 | import { createLog } from "../kernel/log.ts"; |
src/core/issues.ts −3
| @@ -900,9 +900,6 @@ const chunked = <T>(items: readonly T[]): T[][] => { | ||
| 900 | 900 | return out; |
| 901 | 901 | }; |
| 902 | 902 | |
| 903 | const placeholders = (n: number): string => | |
| 904 | Array.from({ length: n }, (_, i) => `?${i + 1}`).join(","); | |
| 905 | ||
| 906 | 903 | /** |
| 907 | 904 | * Open and closed counts for one repo and kind, in a single pass over the |
| 908 | 905 | * covering index — the pair every list page shows above its tabs, which was |
src/crew/autonomy.ts −3
| @@ -28,7 +28,6 @@ import { checksFor } from "../checks/service.ts"; | ||
| 28 | 28 | import { queueDepth } from "../core/capacity.ts"; |
| 29 | 29 | import { readConflictRoom } from "./conflict_room.ts"; |
| 30 | 30 | import { mergeable, resolveOid, treeOf } from "../git/merge.ts"; |
| 31 | import { repoDir } from "../git/repos.ts"; | |
| 32 | 31 | import { CLOSED_NOTE } from "../core/done_on_main.ts"; |
| 33 | 32 | import { mergePull } from "../actions/pulls.ts"; |
| 34 | 33 | import { carriesUpstream } from "../actions/upstream_follow.ts"; |
| @@ -360,8 +359,6 @@ export async function driveRepo( | ||
| 360 | 359 | const by = getUserById(app.db, repo.autonomyBy!); |
| 361 | 360 | if (!by) return "paused"; |
| 362 | 361 | const crew = listCrewRoles(app.db, repo.id); |
| 363 | const builders = crew.filter((c) => c.role === "builder").map((c) => c.agent); | |
| 364 | const planner = crew.find((c) => c.role === "planner")?.agent; | |
| 365 | 362 | const active = activeRuns(app, repo.id); |
| 366 | 363 | const slotted = slottedRuns(active, crew); |
| 367 | 364 | // Slots follow the subscriptions' remaining windows, never past the |
src/crew/review.ts −1
| @@ -28,7 +28,6 @@ import { teamsOfPull, teamVerdicts } from "../core/issue_teams.ts"; | ||
| 28 | 28 | import { reviewSummariesFor, reviewSummary } from "../core/reviews.ts"; |
| 29 | 29 | import { checksForHead } from "../core/runs.ts"; |
| 30 | 30 | import { getTeam } from "../core/teams.ts"; |
| 31 | import { repoDir } from "../git/repos.ts"; | |
| 32 | 31 | import { createLog } from "../kernel/log.ts"; |
| 33 | 32 | import { queueAgentRun } from "./dispatch.ts"; |
| 34 | 33 | import { type Handover, handoverOf, handoversOf } from "./guard.ts"; |
src/crew/sandbox.ts +1 −2
| @@ -34,7 +34,7 @@ | ||
| 34 | 34 | |
| 35 | 35 | import { mkdirSync, readdirSync, rmSync, statSync } from "node:fs"; |
| 36 | 36 | import { homedir, tmpdir } from "node:os"; |
| 37 | import { basename, isAbsolute, join, relative, sep } from "node:path"; | |
| 37 | import { basename, isAbsolute, join, relative } from "node:path"; | |
| 38 | 38 | import { cacheRoot, crewRoot, installCacheDir } from "./workdir.ts"; |
| 39 | 39 | |
| 40 | 40 | export interface SandboxPolicy { |
| @@ -180,7 +180,6 @@ export function dataInTemp(data: string): boolean { | ||
| 180 | 180 | |
| 181 | 181 | function tempDenied(data: string): string[] { |
| 182 | 182 | const temp = tmpdir(); |
| 183 | const rel = relative(temp, data); | |
| 184 | 183 | if (!dataInTemp(data)) return [temp]; |
| 185 | 184 | return [ |
| 186 | 185 | join(temp, `claude-${process.getuid?.() ?? 0}`), |
src/http/api.ts −2
| @@ -222,7 +222,6 @@ import { | ||
| 222 | 222 | import { |
| 223 | 223 | canAdmin, |
| 224 | 224 | canRead, |
| 225 | canSeeOwnerFacts, | |
| 226 | 225 | countsForRepos, |
| 227 | 226 | getRepo, |
| 228 | 227 | listReposByOwner, |
| @@ -297,7 +296,6 @@ import { | ||
| 297 | 296 | runPromptSource, |
| 298 | 297 | } from "../actions/prompts.ts"; |
| 299 | 298 | import { listDomains } from "../core/domains.ts"; |
| 300 | import type { Database } from "bun:sqlite"; | |
| 301 | 299 | import { |
| 302 | 300 | migrateMessage, |
| 303 | 301 | afterChoice, |
src/http/mcp.ts +1 −1
| @@ -41,7 +41,7 @@ import { QUOTA_KEYS } from "../settings/quotas.ts"; | ||
| 41 | 41 | import { LIMIT_KEYS } from "../settings/limits.ts"; |
| 42 | 42 | import { convergeWords, FOLLOW_MODE_REFUSALS, setFollowMode, severForge, takeForgeCode, takeForgeWords, takeOrTell } from "../actions/follow.ts"; |
| 43 | 43 | import { relationOf } from "../actions/forks.ts"; |
| 44 | import { chainOfRepo, FOLLOW_MODES, forgeLinkOf } from "../spawn/chain.ts"; | |
| 44 | import { chainOfRepo, FOLLOW_MODES } from "../spawn/chain.ts"; | |
| 45 | 45 | import { watchMilestone } from "../actions/watches.ts"; |
| 46 | 46 | import { |
| 47 | 47 | addCommentThrough, |
src/kernel/error.ts +1 −1
| @@ -12,7 +12,7 @@ export class ForgeError extends Error { | ||
| 12 | 12 | /** Stable machine-readable code, e.g. "git.spawn_failed". */ |
| 13 | 13 | readonly code: string; |
| 14 | 14 | override readonly cause?: unknown; |
| 15 | private readonly [marker] = true; | |
| 15 | readonly [marker] = true; | |
| 16 | 16 | |
| 17 | 17 | constructor(code: string, message: string, options?: { cause?: unknown }) { |
| 18 | 18 | super(message); |
src/origins/providers/github.ts −2
| @@ -35,7 +35,6 @@ import { basicHeader, gitAuthEnv } from "../credentials.ts"; | ||
| 35 | 35 | import { |
| 36 | 36 | ApiClient, |
| 37 | 37 | COMMIT_PAGE, |
| 38 | MAX_BLOB_BYTES, | |
| 39 | 38 | MAX_DIFF_BYTES, |
| 40 | 39 | anchorFromHunk, |
| 41 | 40 | asArray, |
| @@ -46,7 +45,6 @@ import { | ||
| 46 | 45 | asState, |
| 47 | 46 | asString, |
| 48 | 47 | asTime, |
| 49 | decodeContent, | |
| 50 | 48 | dig, |
| 51 | 49 | fail, |
| 52 | 50 | field, |
src/spawn/door.ts +1 −1
| @@ -7,7 +7,7 @@ | ||
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | 9 | import { startWatch, probeOf, type Probe } from "./live.ts"; |
| 10 | import { listChildren, reissueClaim, spawnForge, type SpawnError } from "../actions/spawn.ts"; | |
| 10 | import { reissueClaim, spawnForge, type SpawnError } from "../actions/spawn.ts"; | |
| 11 | 11 | import type { App } from "../app.ts"; |
| 12 | 12 | import { maxChildren } from "../core/capacity.ts"; |
| 13 | 13 | import { getAgentByName } from "../core/agents.ts"; |
src/spawn/host.ts +1 −1
| @@ -9,7 +9,7 @@ import { childDirOf } from "../actions/spawn.ts"; | ||
| 9 | 9 | import { createApp, type App } from "../app.ts"; |
| 10 | 10 | import { appsRuntime, type AppsRuntime } from "../apps/runtime.ts"; |
| 11 | 11 | import { resolveAppHost, type AppTarget } from "../apps/proxy.ts"; |
| 12 | import { childAppsSummary, startChildApps, stopChildApps, type ChildAppsSummary } from "./child-apps.ts"; | |
| 12 | import { childAppsSummary, startChildApps, stopChildApps } from "./child-apps.ts"; | |
| 13 | 13 | import { childHost } from "./door.ts"; |
| 14 | 14 | import { firstBoot } from "./first-boot.ts"; |
| 15 | 15 | import { |
src/tui/gallery.ts +1 −1
| @@ -15,7 +15,7 @@ import { binding, type Binding } from "./app/keys.ts"; | ||
| 15 | 15 | import type { Command } from "./app/palette.ts"; |
| 16 | 16 | import type { KeyEvent } from "./term/input.ts"; |
| 17 | 17 | import { G, Screen as Surface, type Rect } from "./term/screen.ts"; |
| 18 | import { BOLD, style } from "./term/style.ts"; | |
| 18 | import { style } from "./term/style.ts"; | |
| 19 | 19 | import { headlessTerminal, stdioTerminal } from "./term/terminal.ts"; |
| 20 | 20 | import { renderFileDiff } from "./ui/diff.ts"; |
| 21 | 21 | import { fill, len, split, inset } from "./ui/layout.ts"; |
src/tui/screens/pull.ts −3
| @@ -43,7 +43,6 @@ import { listRepoRuns, mayReadRunLog } from "../../actions/runs.ts"; | ||
| 43 | 43 | import { previewEnv } from "../../apps/data.ts"; |
| 44 | 44 | import { findingsWords, pullPreviewFindings } from "../../core/preview_findings.ts"; |
| 45 | 45 | import { |
| 46 | appsRuntime, | |
| 47 | 46 | type EnvState, |
| 48 | 47 | type EnvStatus, envsFor } from "../../apps/runtime.ts"; |
| 49 | 48 | import { proposedByText } from "../../core/proposal_token.ts"; |
| @@ -64,7 +63,6 @@ import { checkSummary, type CheckSummary } from "../../core/runs.ts"; | ||
| 64 | 63 | import { err, ok } from "../../kernel/result.ts"; |
| 65 | 64 | import { getUsersByIds } from "../../core/users.ts"; |
| 66 | 65 | import { |
| 67 | anchorId, | |
| 68 | 66 | anchorKey, |
| 69 | 67 | listReviewComments, |
| 70 | 68 | withOutdated, |
| @@ -102,7 +100,6 @@ import { | ||
| 102 | 100 | hitScroll, |
| 103 | 101 | errorText, |
| 104 | 102 | live, |
| 105 | metaOf, | |
| 106 | 103 | openLink, |
| 107 | 104 | plural, |
| 108 | 105 | relTime, |
src/tui/screens/workspace.ts −1
| @@ -127,7 +127,6 @@ import { pullScreen } from "./pull.ts"; | ||
| 127 | 127 | import { branchesScreen } from "./refs.ts"; |
| 128 | 128 | import { wavesScreen } from "./waves.ts"; |
| 129 | 129 | import { |
| 130 | hostOf, | |
| 131 | 130 | knownDefaultRef, |
| 132 | 131 | liveOrigin, |
| 133 | 132 | local, |
src/web/chrome.ts −1
| @@ -9,7 +9,6 @@ | ||
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | 11 | import { sshCommand } from "../ssh/command.ts"; |
| 12 | import { mayDirectCrew } from "../crew/direct.ts"; | |
| 13 | 12 | import { mayReadRuns } from "../actions/runs.ts"; |
| 14 | 13 | import { getAppByRepo } from "../core/apps.ts"; |
| 15 | 14 | import { audienceFacts, audienceOf } from "../core/audience.ts"; |
src/web/layout.ts +1 −1
| @@ -39,7 +39,7 @@ import { notePhase } from "../core/route_timing.ts"; | ||
| 39 | 39 | import { html, raw, when, type Html } from "./html.ts"; |
| 40 | 40 | import { noRoom } from "../spawn/door.ts"; |
| 41 | 41 | import { icon, iconSprite, inlineIcons, themeGlyph } from "./icons.ts"; |
| 42 | import { btn, copyField, kbd, menu, pill, type MenuItem } from "./ui.ts"; | |
| 42 | import { btn, copyField, kbd, menu, type MenuItem } from "./ui.ts"; | |
| 43 | 43 | |
| 44 | 44 | /** One row of the command palette: title, href, category. */ |
| 45 | 45 | export interface PaletteItem { |
src/web/pages/apps.ts −1
| @@ -74,7 +74,6 @@ import { | ||
| 74 | 74 | icon, |
| 75 | 75 | listCard, |
| 76 | 76 | previewDataNote, |
| 77 | row, | |
| 78 | 77 | seg, |
| 79 | 78 | selectField, |
| 80 | 79 | sha, |
src/web/pages/board.ts +2 −2
| @@ -46,7 +46,7 @@ import { spendView } from "./spend.ts"; | ||
| 46 | 46 | import type { HandContext } from "../../crew/handover.ts"; |
| 47 | 47 | import { forgeHealth, rolloutLine } from "../../kernel/guard.ts"; |
| 48 | 48 | import { coveredByVerdict, forgeVerdict, verdictLine } from "../../kernel/guard_verdict.ts"; |
| 49 | import { laneLine, type Vitals } from "../../kernel/vitals.ts"; | |
| 49 | import { laneLine } from "../../kernel/vitals.ts"; | |
| 50 | 50 | import { getIssue, getIssuesByIds, type Issue } from "../../core/issues.ts"; |
| 51 | 51 | import { looksForApps } from "../../core/looks.ts"; |
| 52 | 52 | import { |
| @@ -56,7 +56,7 @@ import { | ||
| 56 | 56 | pillarView, |
| 57 | 57 | reposWithUmbrellas, |
| 58 | 58 | } from "../../core/pillars.ts"; |
| 59 | import { joinMany, listPulls, mergedPullsForRepos, toldBy, type Pull } from "../../core/pulls.ts"; | |
| 59 | import { listPulls, mergedPullsForRepos, toldBy, type Pull } from "../../core/pulls.ts"; | |
| 60 | 60 | import { |
| 61 | 61 | listReposVisibleTo, |
| 62 | 62 | ownerFactRepoIds, |
src/web/pages/boards.ts +2 −5
| @@ -7,7 +7,7 @@ | ||
| 7 | 7 | * narrowed to that point's window and listed by the source's first column. |
| 8 | 8 | * Anyone else gets the not-found page. |
| 9 | 9 | */ |
| 10 | import { CHART_NAMES, CHARTS, usesSeries, type Cell, type Chart } from "../../boards/chart.ts"; | |
| 10 | import { CHART_NAMES, CHARTS, type Cell, type Chart } from "../../boards/chart.ts"; | |
| 11 | 11 | import { runFor } from "../../boards/panel_data.ts"; |
| 12 | 12 | import { runQuery, type Query, type Row } from "../../boards/query.ts"; |
| 13 | 13 | import { gaps, SYSTEM } from "../../boards/sampler.ts"; |
| @@ -16,7 +16,7 @@ import { listAllBoards } from "../../actions/boards.ts"; | ||
| 16 | 16 | import type { Ctx } from "../../http/context.ts"; |
| 17 | 17 | import { notePhase, takeSessionTime, timePhase, timePhaseAsync } from "../../core/route_timing.ts"; |
| 18 | 18 | import { notFoundPage } from "../chrome.ts"; |
| 19 | import { html, raw, when } from "../html.ts"; | |
| 19 | import { html, when } from "../html.ts"; | |
| 20 | 20 | import { page } from "../layout.ts"; |
| 21 | 21 | import { btn, card, chartBox, empty, field, selectField } from "../ui.ts"; |
| 22 | 22 | |
| @@ -133,9 +133,6 @@ export function machineLinks(now: number): { label: string; href: string }[] { | ||
| 133 | 133 | ]; |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | const option = (value: string, label: string, selected: boolean) => | |
| 137 | html`<option value="${value}" ${selected ? raw("selected") : null}>${label}</option>`; | |
| 138 | ||
| 139 | 136 | /** The inputs that say a query, filled from `p`; the page's form and a panel's share them. */ |
| 140 | 137 | let fieldSeq = 0; |
| 141 | 138 |
src/web/pages/conflicts.ts +1 −1
| @@ -32,7 +32,7 @@ import { field, readForm } from "../form.ts"; | ||
| 32 | 32 | import { html, type Html } from "../html.ts"; |
| 33 | 33 | import { flashTo, page } from "../layout.ts"; |
| 34 | 34 | import { renderMarkdown } from "../markdown.ts"; |
| 35 | import { btn, card, icon } from "../ui.ts"; | |
| 35 | import { btn, card } from "../ui.ts"; | |
| 36 | 36 | import { changeHead, changeTabs, pullContext } from "../studio/change.ts"; |
| 37 | 37 | |
| 38 | 38 | /** More blocks or longer words than this are not a hand's work. */ |
src/web/pages/edit.ts +1 −1
| @@ -30,7 +30,7 @@ import { highlightToHtml } from "../highlight-html.ts"; | ||
| 30 | 30 | import { loadRepo, notFoundPage, pageHead, signInFirst } from "../chrome.ts"; |
| 31 | 31 | import { field as formValue, readForm, type Form } from "../form.ts"; |
| 32 | 32 | import { html, raw, when, type Html } from "../html.ts"; |
| 33 | import { flashTo, fragment, page, redirect } from "../layout.ts"; | |
| 33 | import { flashTo, fragment, page } from "../layout.ts"; | |
| 34 | 34 | import { renderMarkdown } from "../markdown.ts"; |
| 35 | 35 | import { |
| 36 | 36 | browseBase, |
src/web/pages/issues.ts +2 −3
| @@ -27,10 +27,9 @@ import { | ||
| 27 | 27 | } from "../chrome.ts"; |
| 28 | 28 | import { field, readForm } from "../form.ts"; |
| 29 | 29 | import { html, raw, when, type Html } from "../html.ts"; |
| 30 | import { flashTo, page, redirect } from "../layout.ts"; | |
| 31 | import { btn, empty, icon, field as formField } from "../ui.ts"; | |
| 30 | import { flashTo, page } from "../layout.ts"; | |
| 31 | import { btn, empty, field as formField } from "../ui.ts"; | |
| 32 | 32 | import { |
| 33 | conversation, | |
| 34 | 33 | originError, |
| 35 | 34 | parseNumber, |
| 36 | 35 | threadContext, |
src/web/pages/pull.ts +1 −4
| @@ -45,7 +45,6 @@ import { | ||
| 45 | 45 | isReviewState, |
| 46 | 46 | latestReviewByAuthor, |
| 47 | 47 | listReviewComments, |
| 48 | type Review, | |
| 49 | 48 | type ReviewState, |
| 50 | 49 | type Side, |
| 51 | 50 | } from "../../core/reviews.ts"; |
| @@ -53,7 +52,6 @@ import { getUsersByIds } from "../../core/users.ts"; | ||
| 53 | 52 | import { canWrite, getRepoById, type Repo } from "../../core/repos.ts"; |
| 54 | 53 | import { resolveOid } from "../../git/merge.ts"; |
| 55 | 54 | import { commitLog } from "../../git/read.ts"; |
| 56 | import { repoDir } from "../../git/repos.ts"; | |
| 57 | 55 | import { wallOf } from "../../contract/policy.ts"; |
| 58 | 56 | import type { Ctx } from "../../http/context.ts"; |
| 59 | 57 | import { |
| @@ -75,7 +73,7 @@ import { | ||
| 75 | 73 | import { field, readForm } from "../form.ts"; |
| 76 | 74 | import { teamVerdicts, type TeamVerdict } from "../../core/issue_teams.ts"; |
| 77 | 75 | import { html, raw, when, type Html } from "../html.ts"; |
| 78 | import { flashTo, fragment, page, redirect } from "../layout.ts"; | |
| 76 | import { flashTo, fragment, page } from "../layout.ts"; | |
| 79 | 77 | import { liveRegionsJs } from "../client.ts"; |
| 80 | 78 | import { liveClientJs, liveMount } from "../live.ts"; |
| 81 | 79 | import { |
| @@ -93,7 +91,6 @@ import { | ||
| 93 | 91 | } from "../ui.ts"; |
| 94 | 92 | import { |
| 95 | 93 | assigneeCard, |
| 96 | conversation, | |
| 97 | 94 | labelsCard, |
| 98 | 95 | originError, |
| 99 | 96 | threadFragment, |
src/web/pages/releases.ts −1
| @@ -9,7 +9,6 @@ | ||
| 9 | 9 | |
| 10 | 10 | import { getRepoById } from "../../core/repos.ts"; |
| 11 | 11 | import { notePhase, takeSessionTime } from "../../core/route_timing.ts"; |
| 12 | import type { User } from "../../core/users.ts"; | |
| 13 | 12 | import { running } from "../../kernel/version.ts"; |
| 14 | 13 | import type { Ctx } from "../../http/context.ts"; |
| 15 | 14 | import { listReleases, type Release } from "../../release/record.ts"; |
src/web/pages/repo.ts −29
| @@ -25,7 +25,6 @@ import { frozenBlock } from "./frozen.ts"; | ||
| 25 | 25 | import { pinRepo, syncRepoNow, unpinRepo } from "../../actions/origins.ts"; |
| 26 | 26 | import { |
| 27 | 27 | canAdmin, |
| 28 | canWrite, | |
| 29 | 28 | forkParentFor, |
| 30 | 29 | visibleForks, |
| 31 | 30 | } from "../../core/repos.ts"; |
| @@ -68,7 +67,6 @@ import { | ||
| 68 | 67 | sizeWithTokens, |
| 69 | 68 | tokenCount, |
| 70 | 69 | icon, |
| 71 | iconBtn, | |
| 72 | 70 | listCard, |
| 73 | 71 | row, |
| 74 | 72 | seg, |
| @@ -103,33 +101,6 @@ const forkParent = (ctx: Ctx, repo: Repo): Repo | undefined => | ||
| 103 | 101 | const forksFor = (ctx: Ctx, repo: Repo): Repo[] => |
| 104 | 102 | visibleForks(ctx.app.db, repo.id, ctx.auth.user); |
| 105 | 103 | |
| 106 | /** | |
| 107 | * How far the fork has slipped from its parent, in a phrase. A fork with | |
| 108 | * commits of its own says so: an update would be refused, so the sentence | |
| 109 | * has to explain the missing button. | |
| 110 | */ | |
| 111 | function driftNote(drift: ForkDrift | undefined): string | undefined { | |
| 112 | if (drift === undefined || drift.ahead === null || drift.behind === null) | |
| 113 | return undefined; | |
| 114 | const commits = (n: number) => `${n} commit${n === 1 ? "" : "s"}`; | |
| 115 | const { ahead, behind } = drift; | |
| 116 | if (ahead === 0) | |
| 117 | return behind === 0 ? "up to date" : `${commits(behind)} behind`; | |
| 118 | if (behind === 0) return `${commits(ahead)} of its own`; | |
| 119 | return `${commits(ahead)} of its own, ${behind} behind — merge by hand`; | |
| 120 | } | |
| 121 | ||
| 122 | /** | |
| 123 | * Offer the update only when it would fast-forward: something to take, and | |
| 124 | * nothing of the fork's own in the way. Unknown drift keeps the button, since | |
| 125 | * the action itself is the thing that decides. | |
| 126 | */ | |
| 127 | function updatable(drift: ForkDrift | undefined): boolean { | |
| 128 | if (drift === undefined || drift.ahead === null || drift.behind === null) | |
| 129 | return true; | |
| 130 | return drift.behind > 0 && drift.ahead === 0; | |
| 131 | } | |
| 132 | ||
| 133 | 104 | /** |
| 134 | 105 | * GET /:owner/:name/forks — every fork of this repository the viewer may |
| 135 | 106 | * see, newest first. The count on the repository page is the way in. |
src/web/pages/runs.ts +1 −2
| @@ -35,11 +35,10 @@ import { loadRepo, notFoundPage, repoBase, signInFirst } from "../chrome.ts"; | ||
| 35 | 35 | import { field, readForm } from "../form.ts"; |
| 36 | 36 | import { html, when, type Html } from "../html.ts"; |
| 37 | 37 | import { badge } from "../ui.ts"; |
| 38 | import { flashTo, page, redirect } from "../layout.ts"; | |
| 38 | import { flashTo, redirect } from "../layout.ts"; | |
| 39 | 39 | import { runsListPage } from "../studio/lists.ts"; |
| 40 | 40 | import { runView } from "../studio/run.ts"; |
| 41 | 41 | import { |
| 42 | empty, | |
| 43 | 42 | icon, |
| 44 | 43 | listCard, |
| 45 | 44 | row, |
src/web/pages/search.ts +1 −1
| @@ -12,7 +12,7 @@ | ||
| 12 | 12 | |
| 13 | 13 | import { strangerCodeSearch } from "../../http/strangers.ts"; |
| 14 | 14 | import { search } from "../../actions/search.ts"; |
| 15 | import { appsRuntime, envsFor } from "../../apps/runtime.ts"; | |
| 15 | import { envsFor } from "../../apps/runtime.ts"; | |
| 16 | 16 | import type { AppRecord } from "../../core/apps.ts"; |
| 17 | 17 | import { getPull } from "../../core/pulls.ts"; |
| 18 | 18 | import { canWrite, enterableApps, getRepo } from "../../core/repos.ts"; |
src/web/pages/signup-passkey.ts −1
| @@ -11,7 +11,6 @@ import { givenEmail, signUpWithPasskey, signupClosed, HUMAN_CHECK_MESSAGE, SIGNU | ||
| 11 | 11 | import { createSession } from "../../core/sessions.ts"; |
| 12 | 12 | import { getUserByName } from "../../core/users.ts"; |
| 13 | 13 | import { isSafeName } from "../../git/guard.ts"; |
| 14 | import { edgeStrangerLogin } from "../../http/edge.ts"; | |
| 15 | 14 | import { crossOrigin, type Ctx } from "../../http/context.ts"; |
| 16 | 15 | import { STRANGER_MAX } from "../../http/limits.ts"; |
| 17 | 16 | import { clientAddress, clientBucket } from "../../http/peer.ts"; |
src/web/standards.ts −1
| @@ -26,7 +26,6 @@ import { metaThemeColor } from "../design/themes.ts"; | ||
| 26 | 26 | import { BODY_MAX, TITLE_MAX } from "../core/reports.ts"; |
| 27 | 27 | import { llmsRepos, sitemapRepos } from "../core/listings.ts"; |
| 28 | 28 | import { canRead, getRepo } from "../core/repos.ts"; |
| 29 | import type { App } from "../app.ts"; | |
| 30 | 29 | import type { Ctx } from "../http/context.ts"; |
| 31 | 30 | import { notFound } from "../http/respond.ts"; |
| 32 | 31 |
src/web/studio/app.ts −1
| @@ -45,7 +45,6 @@ import { | ||
| 45 | 45 | icon, |
| 46 | 46 | listCard, |
| 47 | 47 | row, |
| 48 | time, | |
| 49 | 48 | userTag, |
| 50 | 49 | } from "../ui.ts"; |
| 51 | 50 | import { changesHref, tellsHref } from "./nouns.ts"; |
src/web/studio/asks.ts +2 −2
| @@ -62,9 +62,9 @@ import { reviewWaitsFor, type ReviewWait } from "../../crew/review.ts"; | ||
| 62 | 62 | import type { Ctx } from "../../http/context.ts"; |
| 63 | 63 | import { repoBase } from "../chrome.ts"; |
| 64 | 64 | import { html, type Html } from "../html.ts"; |
| 65 | import { btn, card, icon, row } from "../ui.ts"; | |
| 65 | import { btn, row } from "../ui.ts"; | |
| 66 | 66 | import { lookUrl } from "../../core/looks.ts"; |
| 67 | import { lookThumb, thumbLook } from "../pages/looks.ts"; | |
| 67 | import { thumbLook } from "../pages/looks.ts"; | |
| 68 | 68 | import { changeHref } from "./nouns.ts"; |
| 69 | 69 | import { testsClause } from "./words.ts"; |
| 70 | 70 |
src/web/studio/asks_page.ts −1
| @@ -19,7 +19,6 @@ import { | ||
| 19 | 19 | type Skipped, |
| 20 | 20 | } from "../../actions/asks_bulk.ts"; |
| 21 | 21 | import { getDecision } from "../../core/decisions.ts"; |
| 22 | import { getIssueById } from "../../core/issues.ts"; | |
| 23 | 22 | import { decideAsk, undoDecideAsk } from "../../actions/asks_decide.ts"; |
| 24 | 23 | import type { FleetValue } from "../../core/fleet_ops.ts"; |
| 25 | 24 | import { muteRepo, removeMutes } from "../../core/interactions.ts"; |
src/web/studio/change.ts −1
| @@ -33,7 +33,6 @@ import { canWrite, type Repo } from "../../core/repos.ts"; | ||
| 33 | 33 | import { listReviews, type Review } from "../../core/reviews.ts"; |
| 34 | 34 | import { wallOf, wallSentence, type Wall } from "../../contract/policy.ts"; |
| 35 | 35 | import { checkSummary } from "../../core/runs.ts"; |
| 36 | import { repoDir } from "../../git/repos.ts"; | |
| 37 | 36 | import type { Ctx } from "../../http/context.ts"; |
| 38 | 37 | import { |
| 39 | 38 | crumbsFor, |
src/web/studio/explore.ts +1 −1
| @@ -16,7 +16,7 @@ import { | ||
| 16 | 16 | import { notePhase, takeSessionTime } from "../../core/route_timing.ts"; |
| 17 | 17 | import type { Ctx } from "../../http/context.ts"; |
| 18 | 18 | import { pageHead } from "../chrome.ts"; |
| 19 | import { html, when, type Html } from "../html.ts"; | |
| 19 | import { html, type Html } from "../html.ts"; | |
| 20 | 20 | import { page } from "../layout.ts"; |
| 21 | 21 | import { btn, empty, listCard, nameMark, row as rowOf, seg, timeAgo } from "../ui.ts"; |
| 22 | 22 |
src/web/studio/home.ts +1 −1
| @@ -19,7 +19,7 @@ import { appsRuntime } from "../../apps/runtime.ts"; | ||
| 19 | 19 | import { appsForRepos } from "../../core/apps.ts"; |
| 20 | 20 | import { WEIGHT_MAX, WEIGHT_NAMES } from "../../core/front.ts"; |
| 21 | 21 | import { LOOK_SIZES } from "../../core/looks.ts"; |
| 22 | import { canRead, getRepo, type Repo } from "../../core/repos.ts"; | |
| 22 | import { canRead, getRepo } from "../../core/repos.ts"; | |
| 23 | 23 | import { type User } from "../../core/users.ts"; |
| 24 | 24 | import type { Ctx } from "../../http/context.ts"; |
| 25 | 25 | import { activeEdgeToken, edgeLoginUrl, edgeStrangerLogin } from "../../http/edge.ts"; |
src/web/studio/lists.ts −5
| @@ -154,11 +154,6 @@ const PLAIN_FILTERS: readonly WordFilter[] = ["working", "shipped", "stopped"]; | ||
| 154 | 154 | |
| 155 | 155 | const LIST_PAGE = 25; |
| 156 | 156 | |
| 157 | /** `?word=` carried onto a `cursor` link, so paging keeps the filter. */ | |
| 158 | function pagedHref(base: string, filter: WordFilter | undefined, cursor: string): string { | |
| 159 | return `${base}?${filter ? `word=${filter}&` : ""}cursor=${cursor}`; | |
| 160 | } | |
| 161 | ||
| 162 | 157 | /** |
| 163 | 158 | * What a list of tells or changes is narrowed by, read once from the |
| 164 | 159 | * address: the word, and the narrowings that are not words — a label, who |
src/web/studio/shelf.ts +1 −1
| @@ -41,7 +41,7 @@ import { repoDir } from "../../git/repos.ts"; | ||
| 41 | 41 | import type { Ctx } from "../../http/context.ts"; |
| 42 | 42 | import { repoBase } from "../chrome.ts"; |
| 43 | 43 | import { escapeHtml, html, raw, type Html } from "../html.ts"; |
| 44 | import { dot, envPhrase, envTone, pill, row, time } from "../ui.ts"; | |
| 44 | import { dot, envPhrase, envTone, row, time } from "../ui.ts"; | |
| 45 | 45 | import { |
| 46 | 46 | productionFact, |
| 47 | 47 | pullWord, |
src/web/studio/tell.ts +1 −3
| @@ -62,7 +62,7 @@ import { | ||
| 62 | 62 | originGlyph, |
| 63 | 63 | threadContext, |
| 64 | 64 | } from "../pages/thread.ts"; |
| 65 | import { changeHref, tellHref } from "./nouns.ts"; | |
| 65 | import { changeHref } from "./nouns.ts"; | |
| 66 | 66 | import { |
| 67 | 67 | pullWord, |
| 68 | 68 | runWord, |
| @@ -323,8 +323,6 @@ async function studioTell( | ||
| 323 | 323 | history: servingHistory(), |
| 324 | 324 | viewer: ctx.auth.user, |
| 325 | 325 | }; |
| 326 | // A repository that is not an app speaks of issues, not tells. | |
| 327 | const plain = wordCtx.record === undefined; | |
| 328 | 326 | // Closing is the author's or a writer's (`setIssueState`); nobody else is |
| 329 | 327 | // shown a button the server would only refuse. |
| 330 | 328 | const user = ctx.auth.user; |
src/web/studio/words.ts −12
| @@ -381,18 +381,6 @@ export function productionFact( | ||
| 381 | 381 | return failed ?? shipped; |
| 382 | 382 | } |
| 383 | 383 | |
| 384 | const WORD_ICON: Record<Word, Parameters<typeof icon>[0]> = { | |
| 385 | working: "loader", | |
| 386 | look: "eye", | |
| 387 | shipped: "check", | |
| 388 | stopped: "alert", | |
| 389 | waiting: "clock", | |
| 390 | planned: "map", | |
| 391 | told: "clock", | |
| 392 | done: "check", | |
| 393 | cancelled: "ban", | |
| 394 | }; | |
| 395 | ||
| 396 | 384 | /** One of the five (or six) studio words, as a badge. An id names the one a |
| 397 | 385 | * live script repaints as a run finishes (`studioRunJs`). `cancelled` draws |
| 398 | 386 | * the same quiet, secondary look as `waiting` and `planned` — a restart is |
new above
offline