Skip to content

Commit c13ad06

Browse files
committed
improvement(packages): resolve the private-package exports the entry-export check exposed
- Delete exports nothing uses: RadarChart, ChipModalPromptBody, InputOTPSeparator, DropdownMenuGroup/Portal, legacy terminal tool names, and dead types and helpers - Drop `export` from declarations used only in their own file, and remove barrel re-exports no consumer imports - Tag getOAuthClientCapabilityFields and generateRandomBytes `@public`: generate-docs loads the first by file path, and check:utils names the second - Trim the workflow-authz mock to the module's remaining exports - The unused-exports baseline gains no entries and drops one
1 parent 1c05c68 commit c13ad06

66 files changed

Lines changed: 179 additions & 964 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.claude/rules/emcn-components.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Import components, `cn`, and tokens from the `@sim/emcn` barrel; icons come from
1212

1313
Never hand-roll the chip pill from raw class strings (they go stale). Compose from the canonical sources:
1414

15-
- **Surface, typography + content tokens:** `chip/chip-chrome.ts` — `chipFilledSurfaceTokens`, `chipFieldSurfaceClass`, `chipFieldTextClass` (text fields and the dropdown search box build on these), plus the chip-content chrome `chipContentGap`, `chipGeometryClass`, `chipContentIconClass`, `chipContentLabelClass`, `cellIconNodeClass` (non-chip surfaces that must visually match chip content, e.g. resource table cells), and the row-state pair `chipHoverSurfaceClass` / `chipActiveSurfaceClass` (hover vs. selected — mutually exclusive, so a selected row holds its surface through hover; every hand-rolled row imports these rather than restating the literals). All are re-exported from the `@sim/emcn` barrel — no subpath import needed.
15+
- **Surface, typography + content tokens:** `chip/chip-chrome.ts` — `chipFieldSurfaceClass`, `chipFieldTextClass` (text fields and the dropdown search box build on these), plus the chip-content chrome `chipContentGap`, `chipGeometryClass`, `chipContentIconClass`, `chipContentLabelClass`, `cellIconNodeClass` (non-chip surfaces that must visually match chip content, e.g. resource table cells), and the row-state pair `chipHoverSurfaceClass` / `chipActiveSurfaceClass` (hover vs. selected — mutually exclusive, so a selected row holds its surface through hover; every hand-rolled row imports these rather than restating the literals). All are re-exported from the `@sim/emcn` barrel — no subpath import needed.
1616
- **Pill geometry:** `chip/chip.tsx` — `chipVariants` (30px tall, `rounded-lg`, `px-2`, icon↔text `gap-1.5`). Every pill-shaped trigger (`ChipDropdown`, `ChipSelect`, `ChipSwitch`) reuses it for visual parity.
1717

1818
Canonical look: normal font-weight (never `font-medium`/`font-semibold`), value text `--text-body`, icons `--text-icon` at `size-[14px]`, placeholder `--text-muted`, `transition-colors`, **no focus ring** (the caret marks focus). Filled surface is `--surface-5` light / `--surface-4` dark with a `--border` border (`chip-chrome.ts` still spells it through the legacy alias `--border-1`; new code writes `--border`).

‎.cursor/rules/emcn-components.mdc‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Import components, `cn`, and tokens from the `@sim/emcn` barrel; icons come from
1313

1414
Never hand-roll the chip pill from raw class strings (they go stale). Compose from the canonical sources:
1515

16-
- **Surface, typography + content tokens:** `chip/chip-chrome.ts` — `chipFilledSurfaceTokens`, `chipFieldSurfaceClass`, `chipFieldTextClass` (text fields and the dropdown search box build on these), plus the chip-content chrome `chipContentGap`, `chipGeometryClass`, `chipContentIconClass`, `chipContentLabelClass`, `cellIconNodeClass` (non-chip surfaces that must visually match chip content, e.g. resource table cells), and the row-state pair `chipHoverSurfaceClass` / `chipActiveSurfaceClass` (hover vs. selected — mutually exclusive, so a selected row holds its surface through hover; every hand-rolled row imports these rather than restating the literals). All are re-exported from the `@sim/emcn` barrel — no subpath import needed.
16+
- **Surface, typography + content tokens:** `chip/chip-chrome.ts` — `chipFieldSurfaceClass`, `chipFieldTextClass` (text fields and the dropdown search box build on these), plus the chip-content chrome `chipContentGap`, `chipGeometryClass`, `chipContentIconClass`, `chipContentLabelClass`, `cellIconNodeClass` (non-chip surfaces that must visually match chip content, e.g. resource table cells), and the row-state pair `chipHoverSurfaceClass` / `chipActiveSurfaceClass` (hover vs. selected — mutually exclusive, so a selected row holds its surface through hover; every hand-rolled row imports these rather than restating the literals). All are re-exported from the `@sim/emcn` barrel — no subpath import needed.
1717
- **Pill geometry:** `chip/chip.tsx` — `chipVariants` (30px tall, `rounded-lg`, `px-2`, icon↔text `gap-1.5`). Every pill-shaped trigger (`ChipDropdown`, `ChipSelect`, `ChipSwitch`) reuses it for visual parity.
1818

1919
Canonical look: normal font-weight (never `font-medium`/`font-semibold`), value text `--text-body`, icons `--text-icon` at `size-[14px]`, placeholder `--text-muted`, `transition-colors`, **no focus ring** (the caret marks focus). Filled surface is `--surface-5` light / `--surface-4` dark with a `--border` border (`chip-chrome.ts` still spells it through the legacy alias `--border-1`; new code writes `--border`).

‎apps/sim/stores/workflows/workflow/types.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export type {
3838
Variable,
3939
WorkflowState,
4040
}
41-
export { isValidSubflowType, SUBFLOW_TYPES } from '@sim/workflow-types/workflow'
41+
export { SUBFLOW_TYPES } from '@sim/workflow-types/workflow'
4242

4343
export interface WorkflowActions {
4444
updateNodeDimensions: (id: string, dimensions: { width: number; height: number }) => void

‎packages/auth/src/principal.ts‎

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export type Principal =
1212
| SlackAppPrincipal
1313

1414
/** Verified app-wide ingress authority; installation lookup grants no human access. */
15-
export interface SlackAppPrincipal {
15+
interface SlackAppPrincipal {
1616
kind: 'slack_app'
1717
appId: string
1818
appRevision: string
@@ -94,7 +94,7 @@ export interface ExternalUserSubject {
9494
}
9595

9696
/** Email address proven by a deployment's OTP or SSO authentication gate. */
97-
export interface AuthenticatedEmailSubject {
97+
interface AuthenticatedEmailSubject {
9898
kind: 'authenticated_email'
9999
email: string
100100
}
@@ -106,7 +106,7 @@ interface ActorlessSystemPrincipal {
106106
workflowId: string
107107
}
108108

109-
export interface ChatSystemPrincipal {
109+
interface ChatSystemPrincipal {
110110
kind: 'system'
111111
serviceId: 'chat'
112112
workspaceId: string
@@ -124,10 +124,7 @@ export interface WebhookSystemPrincipal {
124124
subject?: ExternalUserSubject
125125
}
126126

127-
export type SystemPrincipal =
128-
| ActorlessSystemPrincipal
129-
| ChatSystemPrincipal
130-
| WebhookSystemPrincipal
127+
type SystemPrincipal = ActorlessSystemPrincipal | ChatSystemPrincipal | WebhookSystemPrincipal
131128

132129
interface DelegatedPrincipalBase {
133130
kind: 'delegated'
@@ -153,7 +150,7 @@ export interface SubjectDelegatedPrincipal extends DelegatedPrincipalBase {
153150
subjectUserId: string
154151
}
155152

156-
export interface WorkflowExecutionDelegationContext {
153+
interface WorkflowExecutionDelegationContext {
157154
kind: 'workflow_execution'
158155
workflowId: string
159156
executionId?: string

‎packages/auth/src/verify.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export interface VerifyAuthOptions {
1616
* created by `apps/sim`'s full auth config, so it can carry plugin fields
1717
* (e.g. `activeOrganizationId`) this minimal instance does not configure.
1818
*/
19-
export interface VerifiedOneTimeTokenSession {
19+
interface VerifiedOneTimeTokenSession {
2020
user: {
2121
id: string
2222
name: string | null

‎packages/browser-protocol/src/index.ts‎

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -57,23 +57,20 @@ export const CURRENT_BROWSER_TOOL_NAMES = [
5757

5858
export type CurrentBrowserToolName = (typeof CURRENT_BROWSER_TOOL_NAMES)[number]
5959

60-
export const RETIRED_BROWSER_TOOL_NAMES = ['browser_request_takeover'] as const
60+
const RETIRED_BROWSER_TOOL_NAMES = ['browser_request_takeover'] as const
6161

62-
export const BROWSER_TOOL_NAMES = [
63-
...CURRENT_BROWSER_TOOL_NAMES,
64-
...RETIRED_BROWSER_TOOL_NAMES,
65-
] as const
62+
const BROWSER_TOOL_NAMES = [...CURRENT_BROWSER_TOOL_NAMES, ...RETIRED_BROWSER_TOOL_NAMES] as const
6663

6764
export type BrowserToolName = (typeof BROWSER_TOOL_NAMES)[number]
6865

69-
export const BROWSER_WAIT_FOR_DEFAULT_TIMEOUT_MS = 10_000
70-
export const BROWSER_WAIT_FOR_MAX_TIMEOUT_MS = 120_000
71-
export const BROWSER_WAIT_FOR_RENDERER_GRACE_MS = 15_000
66+
const BROWSER_WAIT_FOR_DEFAULT_TIMEOUT_MS = 10_000
67+
const BROWSER_WAIT_FOR_MAX_TIMEOUT_MS = 120_000
68+
const BROWSER_WAIT_FOR_RENDERER_GRACE_MS = 15_000
7269
export const BROWSER_TOOL_AUTHORIZATION_TIMEOUT_MS = 8_000
7370
export const BROWSER_NAVIGATION_NATIVE_WATCHDOG_MS = 60_000
7471
export const BROWSER_TOOL_QUEUE_WAIT_TIMEOUT_MS = BROWSER_NAVIGATION_NATIVE_WATCHDOG_MS
7572
const BROWSER_RENDERER_TRANSPORT_GRACE_MS = 2_000
76-
export const BROWSER_NAVIGATION_RENDERER_TIMEOUT_MS =
73+
const BROWSER_NAVIGATION_RENDERER_TIMEOUT_MS =
7774
BROWSER_TOOL_AUTHORIZATION_TIMEOUT_MS +
7875
BROWSER_TOOL_QUEUE_WAIT_TIMEOUT_MS +
7976
BROWSER_NAVIGATION_NATIVE_WATCHDOG_MS +
@@ -132,7 +129,7 @@ export function browserToolRendererTimeoutMs(
132129
}
133130
}
134131

135-
export const BROWSER_THEMES = ['system', 'light', 'dark'] as const
132+
const BROWSER_THEMES = ['system', 'light', 'dark'] as const
136133

137134
/** Sim appearance preference mirrored into browser-tab media queries. */
138135
export type BrowserTheme = (typeof BROWSER_THEMES)[number]

‎packages/deployment-config/src/env-capabilities.ts‎

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export type EnvCapabilityValues =
2828
| ReadonlyMap<string, EnvCapabilityValue>
2929
| Readonly<Record<string, EnvCapabilityValue>>
3030

31-
export type EnvValueValidation =
31+
type EnvValueValidation =
3232
| {
3333
kind: 'integer'
3434
min?: number
@@ -79,13 +79,13 @@ export interface AnyOfRequirement {
7979
requirements: readonly EnvRequirement[]
8080
}
8181

82-
export type EnvRequirement = EnvFieldRequirement | AllOfRequirement | AnyOfRequirement
82+
type EnvRequirement = EnvFieldRequirement | AllOfRequirement | AnyOfRequirement
8383

84-
export type EnvProviderActivation =
84+
type EnvProviderActivation =
8585
| { mode: 'any-present'; keys: readonly string[] }
8686
| { mode: 'enabled'; key: string }
8787

88-
export interface EnvProviderValidationIssue {
88+
interface EnvProviderValidationIssue {
8989
kind: 'missing' | 'invalid'
9090
fields: readonly string[]
9191
message: string
@@ -119,7 +119,7 @@ export interface FallbackCapabilityDefinition<
119119
providers: readonly TProvider[]
120120
}
121121

122-
export type EnvDefaultProviderDefinition =
122+
type EnvDefaultProviderDefinition =
123123
| { id: string; kind: 'built-in'; label: string }
124124
| { id: string; kind: 'provider' }
125125

@@ -180,11 +180,6 @@ export interface SelectedCapabilityInspection<
180180
error: EnvCapabilityConfigurationError | null
181181
}
182182

183-
export type CapabilityInspection<TDefinition extends CapabilityDefinition> =
184-
TDefinition extends SelectedCapabilityDefinition
185-
? SelectedCapabilityInspection<ProviderId<TDefinition>, DeclaredProviderId<TDefinition>>
186-
: FallbackCapabilityInspection<DeclaredProviderId<TDefinition>>
187-
188183
export class EnvCapabilityConfigurationError extends Error {
189184
constructor(
190185
readonly capabilityId: string,
@@ -237,11 +232,11 @@ export function envField(
237232
return { type: 'field', key, ...options }
238233
}
239234

240-
export function allOf(...requirements: readonly EnvRequirement[]): AllOfRequirement {
235+
function allOf(...requirements: readonly EnvRequirement[]): AllOfRequirement {
241236
return { type: 'allOf', requirements }
242237
}
243238

244-
export function anyOf(...requirements: readonly EnvRequirement[]): AnyOfRequirement {
239+
function anyOf(...requirements: readonly EnvRequirement[]): AnyOfRequirement {
245240
return { type: 'anyOf', requirements }
246241
}
247242

@@ -352,7 +347,7 @@ export function defineCapability<const TDefinition extends CapabilityDefinition>
352347
}
353348

354349
/** Returns the canonical command for configuring a runtime capability. */
355-
export function getCapabilitySetupCommand(definition: CapabilityDefinition): string {
350+
function getCapabilitySetupCommand(definition: CapabilityDefinition): string {
356351
return `npx sim-setup add ${definition.id}`
357352
}
358353

@@ -540,7 +535,7 @@ function inspectRequiredProvider<const TProvider extends EnvProviderDefinition>(
540535
}
541536
}
542537

543-
export function inspectProvider<const TProvider extends EnvProviderDefinition>(
538+
function inspectProvider<const TProvider extends EnvProviderDefinition>(
544539
provider: TProvider,
545540
values: EnvCapabilityValues
546541
): ProviderInspection<TProvider['id']> {
@@ -1637,6 +1632,11 @@ export function resolveOAuthClientCapabilityId(serviceId: string): OAuthClientCa
16371632
return normalized in OAUTH_CLIENT_CAPABILITIES ? (normalized as OAuthClientCapabilityId) : null
16381633
}
16391634

1635+
/**
1636+
* Env fields that configure a service's OAuth client.
1637+
*
1638+
* @public scripts/generate-docs.ts loads this module by file path, which knip cannot trace.
1639+
*/
16401640
export function getOAuthClientCapabilityFields(serviceId: string): readonly string[] | null {
16411641
const providerId = resolveOAuthClientCapabilityId(serviceId)
16421642
return providerId ? OAUTH_CLIENT_CAPABILITIES[providerId] : null

‎packages/desktop-bridge/src/index.ts‎

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import type {
3333
TerminalToolResponse,
3434
} from '@sim/terminal-protocol'
3535

36-
export const PENDING_DESKTOP_SCOPE_PREFIX = 'pending:' as const
36+
const PENDING_DESKTOP_SCOPE_PREFIX = 'pending:' as const
3737

3838
/** Boolean results preserve compatibility with older installed desktop shells. */
3939
export type TerminalPasteResult = boolean | 'too-large'
@@ -305,7 +305,7 @@ export interface SimDesktopBrowserAgentApi {
305305
onScopeSuspended(callback: (scopeId: string) => void): () => void
306306
}
307307

308-
export type BrowserDownloadState = 'progressing' | 'completed' | 'interrupted' | 'cancelled'
308+
type BrowserDownloadState = 'progressing' | 'completed' | 'interrupted' | 'cancelled'
309309

310310
/** Safe renderer metadata for a native browser download; host paths never cross the bridge. */
311311
export interface BrowserDownloadInfo {
@@ -409,7 +409,7 @@ export interface BrowserSiteInfo {
409409
importedAt?: string
410410
}
411411

412-
export interface SimDesktopBrowserImportApi {
412+
interface SimDesktopBrowserImportApi {
413413
/** Chrome profiles detected on this device; empty when none are readable. */
414414
listChromeProfiles(): Promise<BrowserImportProfile[]>
415415
/**
@@ -507,7 +507,7 @@ export interface BrowserFillAvailability {
507507
* management calls require the Sim app origin, filling additionally requires
508508
* a real user gesture, and no browser tool maps to these channels.
509509
*/
510-
export interface SimDesktopBrowserCredentialsApi {
510+
interface SimDesktopBrowserCredentialsApi {
511511
/** False when OS-backed encryption is unavailable and passwords are disabled. */
512512
isAvailable(): Promise<boolean>
513513
/** Saved credentials, without passwords. */
@@ -575,15 +575,15 @@ export interface LocalFilesystemEntry {
575575
modifiedAt?: string
576576
}
577577

578-
export interface LocalFilesystemStat {
578+
interface LocalFilesystemStat {
579579
name: string
580580
uri: string
581581
kind: LocalFilesystemEntryKind
582582
size: number
583583
modifiedAt: string
584584
}
585585

586-
export interface LocalFilesystemReadResult {
586+
interface LocalFilesystemReadResult {
587587
uri: string
588588
content: string
589589
startLine: number
@@ -785,7 +785,7 @@ export const TERMINAL_DARK_THEME = {
785785
brightWhite: '#f0f6fc',
786786
} as const satisfies TerminalThemePalette
787787

788-
export type TerminalThemeSource = 'terminal' | 'iterm2'
788+
type TerminalThemeSource = 'terminal' | 'iterm2'
789789

790790
export interface TerminalSelectedProfile {
791791
/** Stable source profile id used to restore this selection. */
@@ -928,7 +928,7 @@ export function resolveDesktopZoom(
928928
return Math.min(bounds.max, Math.max(bounds.min, next))
929929
}
930930

931-
export const DESKTOP_APPEARANCE_THEMES = ['app', 'light', 'dark'] as const
931+
const DESKTOP_APPEARANCE_THEMES = ['app', 'light', 'dark'] as const
932932

933933
export type DesktopAppearanceTheme = (typeof DESKTOP_APPEARANCE_THEMES)[number]
934934

@@ -957,7 +957,7 @@ export interface DesktopNotificationPayload {
957957
}
958958

959959
/** Device-level settings owned by the desktop shell. */
960-
export interface SimDesktopSettingsApi {
960+
interface SimDesktopSettingsApi {
961961
getPreferences(): Promise<DesktopPreferences>
962962
setPreference<K extends DesktopPreferenceKey>(
963963
key: K,
@@ -981,7 +981,7 @@ export interface SimDesktopSettingsApi {
981981
setTerminalDefaultZoom(zoom: DesktopZoomPercent): Promise<DesktopPreferences>
982982
}
983983

984-
export interface SimDesktopTerminalThemesApi {
984+
interface SimDesktopTerminalThemesApi {
985985
listProfiles(): Promise<TerminalThemeProfile[]>
986986
selectProfile(profileId: string): Promise<DesktopPreferences | null>
987987
}
@@ -991,13 +991,7 @@ export interface SimDesktopTerminalThemesApi {
991991
* automatic downloads are disabled or the shell requires a manual installer;
992992
* self-updating shells with automatic downloads enabled move to `downloading`.
993993
*/
994-
export type DesktopUpdateStatus =
995-
| 'idle'
996-
| 'checking'
997-
| 'available'
998-
| 'downloading'
999-
| 'ready'
1000-
| 'error'
994+
type DesktopUpdateStatus = 'idle' | 'checking' | 'available' | 'downloading' | 'ready' | 'error'
1001995

1002996
export interface DesktopUpdateState {
1003997
status: DesktopUpdateStatus
@@ -1014,7 +1008,7 @@ export interface DesktopUpdateState {
10141008
}
10151009

10161010
/** The shell updater surface. */
1017-
export interface SimDesktopUpdatesApi {
1011+
interface SimDesktopUpdatesApi {
10181012
getState(): Promise<DesktopUpdateState>
10191013
/**
10201014
* Advances the pipeline: checks for an update, downloads an available
@@ -1067,7 +1061,7 @@ export type DesktopServerChangeResult =
10671061
* to must stay reachable when that server cannot be reached at all, and must
10681062
* never be drivable by a page the current server serves.
10691063
*/
1070-
export interface SimDesktopServerApi {
1064+
interface SimDesktopServerApi {
10711065
/** Opens the shell's native server-selection window. */
10721066
open(): void
10731067
getConfiguration(): Promise<DesktopServerConfiguration>

‎packages/emcn/src/components/avatar/avatar.tsx‎

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -213,11 +213,4 @@ const AvatarFallback = React.forwardRef<
213213
})
214214
AvatarFallback.displayName = 'AvatarFallback'
215215

216-
export {
217-
Avatar,
218-
AvatarImage,
219-
AvatarFallback,
220-
avatarVariants,
221-
avatarStatusVariants,
222-
avatarFallbackVariants,
223-
}
216+
export { Avatar, AvatarImage, AvatarFallback }

‎packages/emcn/src/components/bulk-action-button/bulk-action-button.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { Button, type ButtonProps } from '../button/button'
55
import { chipFilledFillTokens, chipRadiusClass } from '../chip/chip-chrome'
66

77
/** The shared 28px geometry and brand-hover treatment of selection action bars. */
8-
export const bulkActionButtonVariants = cva(
8+
const bulkActionButtonVariants = cva(
99
`${chipRadiusClass} size-[28px] p-0 hover-hover:bg-[var(--brand-secondary)] hover-hover:text-[var(--text-inverse)]!`,
1010
{
1111
variants: {

0 commit comments

Comments
 (0)