Skip to content

Commit 2fbeb7c

Browse files
committed
refactor(routing): trim private exports
1 parent c25cd32 commit 2fbeb7c

5 files changed

Lines changed: 6 additions & 19 deletions

File tree

scripts/deadcode-exports.baseline.mjs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5223,15 +5223,6 @@ export const KNIP_UNUSED_EXPORT_BASELINE = [
52235223
"src/proxy-capture/store.sqlite.ts: LegacyDebugProxyCaptureStore",
52245224
"src/proxy-capture/store.sqlite.ts: SharedDebugProxyCaptureStore",
52255225
"src/realtime-transcription/websocket-session.ts: REALTIME_TRANSCRIPTION_WS_MAX_PAYLOAD_BYTES",
5226-
"src/routing/binding-scope.ts: NormalizedRouteBindingMatch",
5227-
"src/routing/binding-scope.ts: RouteBindingScope",
5228-
"src/routing/binding-scope.ts: RouteBindingScopeConstraint",
5229-
"src/routing/channel-route-targets.ts: ChannelRouteTarget",
5230-
"src/routing/resolve-route.ts: DEFAULT_ACCOUNT_ID",
5231-
"src/routing/resolve-route.ts: ResolveAgentRouteInput",
5232-
"src/routing/session-key.ts: getSubagentDepth",
5233-
"src/routing/session-key.ts: ParsedSessionDeliveryRoute",
5234-
"src/routing/session-key.ts: SessionKeyShape",
52355226
"src/secrets/audit.ts: SecretsAuditCode",
52365227
"src/secrets/audit.ts: SecretsAuditFinding",
52375228
"src/secrets/audit.ts: SecretsAuditReport",

src/routing/binding-scope.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,20 @@ import { normalizeAccountId, normalizeAgentId } from "./session-key.js";
66

77
// Route binding scopes constrain a configured agent/account binding to a guild,
88
// team, group space, and optionally channel/platform role ids.
9-
export type RouteBindingScopeConstraint = {
9+
type RouteBindingScopeConstraint = {
1010
guildId?: string | null;
1111
teamId?: string | null;
1212
roles?: string[] | null;
1313
};
1414

15-
export type RouteBindingScope = {
15+
type RouteBindingScope = {
1616
guildId?: string | null;
1717
teamId?: string | null;
1818
groupSpace?: string | null;
1919
memberRoleIds?: Iterable<string> | null;
2020
};
2121

22-
export type NormalizedRouteBindingMatch = {
22+
type NormalizedRouteBindingMatch = {
2323
agentId: string;
2424
accountId: string;
2525
channelId: string;

src/routing/channel-route-targets.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { DEFAULT_ACCOUNT_ID, normalizeAccountId, normalizeAgentId } from "./sess
99

1010
// Agent-to-channel coverage summary for diagnostics and background checks. It
1111
// samples configured channels/accounts and explicit bindings.
12-
export type ChannelRouteTarget = {
12+
type ChannelRouteTarget = {
1313
agentId: string;
1414
channels: string[];
1515
};

src/routing/resolve-route.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export type RoutePeer = {
3131
id: string;
3232
};
3333

34-
export type ResolveAgentRouteInput = {
34+
type ResolveAgentRouteInput = {
3535
cfg: OpenClawConfig;
3636
channel: string;
3737
accountId?: string | null;
@@ -69,8 +69,6 @@ export type ResolvedAgentRoute = {
6969
| "default";
7070
};
7171

72-
export { DEFAULT_ACCOUNT_ID } from "./session-key.js";
73-
7472
export function deriveLastRoutePolicy(params: {
7573
sessionKey: string;
7674
mainSessionKey: string;

src/routing/session-key.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,13 @@ import {
1313
import { normalizeAccountId } from "./account-id.js";
1414

1515
export {
16-
getSubagentDepth,
1716
isCronSessionKey,
1817
isAcpSessionKey,
1918
isSubagentSessionKey,
2019
parseAgentSessionKey,
2120
parseSessionDeliveryRoute,
2221
parseThreadSessionSuffix,
2322
type ParsedAgentSessionKey,
24-
type ParsedSessionDeliveryRoute,
2523
} from "../sessions/session-key-utils.js";
2624
export {
2725
DEFAULT_ACCOUNT_ID,
@@ -31,7 +29,7 @@ export {
3129

3230
export const DEFAULT_AGENT_ID = "main";
3331
export const DEFAULT_MAIN_KEY = "main";
34-
export type SessionKeyShape = "missing" | "agent" | "legacy_or_alias" | "malformed_agent";
32+
type SessionKeyShape = "missing" | "agent" | "legacy_or_alias" | "malformed_agent";
3533

3634
// Pre-compiled regex
3735
const VALID_ID_RE = /^[a-z0-9][a-z0-9_-]{0,63}$/i;

0 commit comments

Comments
 (0)