Skip to content

Commit 3171ffc

Browse files
authored
Move more types to @roo-code/types (for the cli) (#10583)
1 parent 907b94b commit 3171ffc

File tree

89 files changed

+1135
-1058
lines changed

Some content is hidden

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

89 files changed

+1135
-1058
lines changed

apps/vscode-e2e/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
"@vscode/test-electron": "^2.4.0",
2121
"glob": "^11.1.0",
2222
"mocha": "^11.1.0",
23-
"rimraf": "^6.0.1",
24-
"typescript": "5.8.3"
23+
"rimraf": "^6.0.1"
2524
}
2625
}

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"rimraf": "^6.0.1",
4646
"tsx": "^4.19.3",
4747
"turbo": "^2.5.6",
48-
"typescript": "^5.4.5"
48+
"typescript": "5.8.3"
4949
},
5050
"lint-staged": {
5151
"*.{js,jsx,ts,tsx,json,css,md}": [
@@ -63,7 +63,9 @@
6363
"brace-expansion": "^2.0.2",
6464
"form-data": ">=4.0.4",
6565
"bluebird": ">=3.7.2",
66-
"glob": ">=11.1.0"
66+
"glob": ">=11.1.0",
67+
"@types/react": "^18.3.23",
68+
"@types/react-dom": "^18.3.5"
6769
}
6870
}
6971
}

packages/types/npm/package.metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@roo-code/types",
3-
"version": "1.99.0",
3+
"version": "1.100.0",
44
"description": "TypeScript type definitions for Roo Code.",
55
"publishConfig": {
66
"access": "public",

packages/types/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"@roo-code/config-typescript": "workspace:^",
3131
"@types/node": "^24.1.0",
3232
"globals": "^16.3.0",
33-
"tsup": "^8.3.5",
33+
"tsup": "^8.4.0",
3434
"vitest": "^3.2.3"
3535
}
3636
}

packages/types/src/git.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
export interface GitRepositoryInfo {
2+
repositoryUrl?: string
3+
repositoryName?: string
4+
defaultBranch?: string
5+
}
6+
7+
export interface GitCommit {
8+
hash: string
9+
shortHash: string
10+
subject: string
11+
author: string
12+
date: string
13+
}

packages/types/src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export * from "./custom-tool.js"
77
export * from "./events.js"
88
export * from "./experiment.js"
99
export * from "./followup.js"
10+
export * from "./git.js"
1011
export * from "./global-settings.js"
1112
export * from "./history.js"
1213
export * from "./image-generation.js"
@@ -24,6 +25,7 @@ export * from "./terminal.js"
2425
export * from "./tool.js"
2526
export * from "./tool-params.js"
2627
export * from "./type-fu.js"
28+
export * from "./vscode-extension-host.js"
2729
export * from "./vscode.js"
2830

2931
export * from "./providers/index.js"

packages/types/src/marketplace.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,8 @@ export const installMarketplaceItemOptionsSchema = z.object({
8686
})
8787

8888
export type InstallMarketplaceItemOptions = z.infer<typeof installMarketplaceItemOptionsSchema>
89+
90+
export interface MarketplaceInstalledMetadata {
91+
project: Record<string, { type: string }>
92+
global: Record<string, { type: string }>
93+
}

packages/types/src/mcp.ts

Lines changed: 90 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import { z } from "zod"
22

33
/**
4-
* MCP Server Use Types
4+
* McpServerUse
55
*/
6+
67
export interface McpServerUse {
78
type: string
89
serverName: string
@@ -39,3 +40,91 @@ export const mcpExecutionStatusSchema = z.discriminatedUnion("status", [
3940
])
4041

4142
export type McpExecutionStatus = z.infer<typeof mcpExecutionStatusSchema>
43+
44+
/**
45+
* McpServer
46+
*/
47+
48+
export type McpServer = {
49+
name: string
50+
config: string
51+
status: "connected" | "connecting" | "disconnected"
52+
error?: string
53+
errorHistory?: McpErrorEntry[]
54+
tools?: McpTool[]
55+
resources?: McpResource[]
56+
resourceTemplates?: McpResourceTemplate[]
57+
disabled?: boolean
58+
timeout?: number
59+
source?: "global" | "project"
60+
projectPath?: string
61+
instructions?: string
62+
}
63+
64+
export type McpTool = {
65+
name: string
66+
description?: string
67+
inputSchema?: object
68+
alwaysAllow?: boolean
69+
enabledForPrompt?: boolean
70+
}
71+
72+
export type McpResource = {
73+
uri: string
74+
name: string
75+
mimeType?: string
76+
description?: string
77+
}
78+
79+
export type McpResourceTemplate = {
80+
uriTemplate: string
81+
name: string
82+
description?: string
83+
mimeType?: string
84+
}
85+
86+
export type McpResourceResponse = {
87+
_meta?: Record<string, any> // eslint-disable-line @typescript-eslint/no-explicit-any
88+
contents: Array<{
89+
uri: string
90+
mimeType?: string
91+
text?: string
92+
blob?: string
93+
}>
94+
}
95+
96+
export type McpToolCallResponse = {
97+
_meta?: Record<string, any> // eslint-disable-line @typescript-eslint/no-explicit-any
98+
content: Array<
99+
| {
100+
type: "text"
101+
text: string
102+
}
103+
| {
104+
type: "image"
105+
data: string
106+
mimeType: string
107+
}
108+
| {
109+
type: "audio"
110+
data: string
111+
mimeType: string
112+
}
113+
| {
114+
type: "resource"
115+
resource: {
116+
uri: string
117+
mimeType?: string
118+
text?: string
119+
blob?: string
120+
}
121+
}
122+
>
123+
isError?: boolean
124+
}
125+
126+
export type McpErrorEntry = {
127+
message: string
128+
timestamp: number
129+
level: "error" | "warn" | "info"
130+
}

packages/types/src/model.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { z } from "zod"
2+
import { DynamicProvider, LocalProvider } from "./provider-settings.js"
23

34
/**
45
* ReasoningEffort
@@ -140,3 +141,7 @@ export const modelInfoSchema = z.object({
140141
})
141142

142143
export type ModelInfo = z.infer<typeof modelInfoSchema>
144+
145+
export type ModelRecord = Record<string, ModelInfo>
146+
147+
export type RouterModels = Record<DynamicProvider | LocalProvider, ModelRecord>

packages/types/src/provider-settings.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,8 @@ const qwenCodeSchema = apiModelIdProviderModelSchema.extend({
407407
})
408408

409409
const rooSchema = apiModelIdProviderModelSchema.extend({
410-
// No additional fields needed - uses cloud authentication.
410+
// Can use cloud authentication or provide an API key (cli).
411+
rooApiKey: z.string().optional(),
411412
})
412413

413414
const vercelAiGatewaySchema = baseProviderSettingsSchema.extend({

0 commit comments

Comments
 (0)