Skip to content

Commit b6d0296

Browse files
committed
refactor: colocate 10 type-only exports across 5 command modules
handle-ask.mts: HandleAskOptions, ParsedIntent fetch-audit-log.mts: FetchAuditLogsConfig, FetchAuditLogOptions fix/git.mts: SocketFixBranchParser, SocketFixBranchParseResult run-cdxgen.mts: ArgvObject, NodejsCdxgenSources depscore.mts: DepscoreToolResult, DepscoreOptions
1 parent 9177f5d commit b6d0296

5 files changed

Lines changed: 10 additions & 10 deletions

File tree

packages/cli/src/commands/ask/handle-ask.mts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ const logger = getDefaultLogger()
3030
// semantic-match fallback (currently a no-op; see onnx-match.mts).
3131
const PATTERN_MATCH_THRESHOLD = 0.6
3232

33-
export interface HandleAskOptions {
33+
interface HandleAskOptions {
3434
query: string
3535
execute: boolean
3636
explain: boolean
3737
}
3838

39-
export interface ParsedIntent {
39+
interface ParsedIntent {
4040
action: string
4141
command: string[]
4242
confidence: number

packages/cli/src/commands/audit-log/fetch-audit-log.mts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ import type { CResult, OutputKind } from '../../types.mts'
55
import type { SetupSdkOptions } from '../../util/socket/sdk.mjs'
66
import type { SocketSdkSuccessResult } from '@socketsecurity/sdk-stable'
77

8-
export type FetchAuditLogsConfig = {
8+
type FetchAuditLogsConfig = {
99
logType: string
1010
orgSlug: string
1111
outputKind: OutputKind
1212
page: number
1313
perPage: number
1414
}
1515

16-
export type FetchAuditLogOptions = {
16+
type FetchAuditLogOptions = {
1717
commandPath?: string | undefined
1818
sdkOpts?: SetupSdkOptions | undefined
1919
}

packages/cli/src/commands/fix/git.mts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ export const genericSocketFixBranchParser = createSocketFixBranchParser()
1111
// GHSA ID pattern: GHSA-xxxx-xxxx-xxxx (4 alphanumeric segments).
1212
const GHSA_ID_PATTERN = /^GHSA-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}$/i
1313

14-
export type SocketFixBranchParser = (
14+
type SocketFixBranchParser = (
1515
branch: string,
1616
) => SocketFixBranchParseResult | undefined
1717

18-
export type SocketFixBranchParseResult = {
18+
type SocketFixBranchParseResult = {
1919
ghsaId: string
2020
}
2121

packages/cli/src/commands/manifest/run-cdxgen.mts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const nodejsPlatformTypes = new Set([
3636
'typescript',
3737
])
3838

39-
export type ArgvObject = {
39+
type ArgvObject = {
4040
[key: string]: boolean | null | number | string | Array<string | number>
4141
}
4242

@@ -77,7 +77,7 @@ export function argvObjectToArray(argvObj: ArgvObject): string[] {
7777
* Result of probing a cwd for Node.js SBOM inputs that cdxgen needs in the
7878
* default `pre-build` + `install-deps: false` mode.
7979
*/
80-
export type NodejsCdxgenSources = {
80+
type NodejsCdxgenSources = {
8181
hasLockfile: boolean
8282
hasNodeModules: boolean
8383
}

packages/cli/src/commands/mcp/depscore.mts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,12 @@ export const DEPSCORE_TOOL_NAME = 'depscore'
5555
export const DEPSCORE_TOOL_DESCRIPTION =
5656
"Get the dependency score of packages with the `depscore` tool from Socket. Use 'unknown' for version if not known. Use this tool to scan dependencies for their quality and security on existing code or when code is generated. Stop generating code and ask the user how to proceed when any of the scores are low. When checking dependencies, make sure to also check the imports in the code, not just the manifest files (pyproject.toml, package.json, etc)."
5757

58-
export interface DepscoreToolResult {
58+
interface DepscoreToolResult {
5959
content: Array<{ text: string; type: 'text' }>
6060
isError?: boolean | undefined
6161
}
6262

63-
export interface DepscoreOptions {
63+
interface DepscoreOptions {
6464
apiToken: string
6565
}
6666

0 commit comments

Comments
 (0)