Skip to content
This repository was archived by the owner on Nov 24, 2025. It is now read-only.

Commit 20ef43b

Browse files
committed
move interfaces
1 parent 1a1b0b7 commit 20ef43b

File tree

4 files changed

+38
-37
lines changed

4 files changed

+38
-37
lines changed

src/common/types.ts

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,3 +376,38 @@ export interface Tool {
376376
status?: string
377377
error?: string
378378
}
379+
380+
export interface CreateFileArgs {
381+
path: string
382+
content: string
383+
openAfterCreate?: boolean
384+
createIntermediateDirs?: boolean
385+
fileTemplate?: string
386+
permissions?: string
387+
}
388+
389+
export interface RunCommandArgs {
390+
command: string
391+
cwd?: string
392+
env?: Record<string, string>
393+
shell?: string
394+
timeout?: number
395+
captureOutput?: boolean
396+
runInBackground?: boolean
397+
}
398+
399+
export interface OpenFileArgs {
400+
path: string
401+
preview?: boolean
402+
viewColumn?: "beside" | "active" | "new"
403+
encoding?: string
404+
revealIfOpen?: boolean
405+
}
406+
407+
export interface EditFileArgs {
408+
path: string
409+
edit: string
410+
createIfNotExists?: boolean
411+
backupBeforeEdit?: boolean
412+
}
413+

src/extension/review-service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ export class GithubService extends ConversationHistory {
201201

202202
try {
203203
const data = getResponseData(streamResponse)
204-
this._completion = this._completion + data
204+
this._completion = this._completion + data.content
205205
this.webView.postMessage({
206206
type: EVENT_NAME.twinnyOnCompletion,
207207
data: {

src/extension/tools.ts

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -3,44 +3,10 @@ import { TextEncoder } from "util"
33
import * as vscode from "vscode"
44

55
import { EVENT_NAME, TOOL_EVENT_NAME } from "../common/constants"
6-
import { ClientMessage, Message, ServerMessage, Tool } from "../common/types"
6+
import { ClientMessage, CreateFileArgs, EditFileArgs, Message, OpenFileArgs, RunCommandArgs, ServerMessage, Tool } from "../common/types"
77

88
import { Base } from "./base"
99

10-
interface CreateFileArgs {
11-
path: string
12-
content: string
13-
openAfterCreate?: boolean
14-
createIntermediateDirs?: boolean
15-
fileTemplate?: string
16-
permissions?: string
17-
}
18-
19-
interface RunCommandArgs {
20-
command: string
21-
cwd?: string
22-
env?: Record<string, string>
23-
shell?: string
24-
timeout?: number
25-
captureOutput?: boolean
26-
runInBackground?: boolean
27-
}
28-
29-
interface OpenFileArgs {
30-
path: string
31-
preview?: boolean
32-
viewColumn?: "beside" | "active" | "new"
33-
encoding?: string
34-
revealIfOpen?: boolean
35-
}
36-
37-
interface EditFileArgs {
38-
path: string
39-
edit: string
40-
createIfNotExists?: boolean
41-
backupBeforeEdit?: boolean
42-
}
43-
4410
export class Tools extends Base {
4511
private _workspaceRoot: string | undefined
4612
private webView: vscode.Webview

src/extension/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ export const getResponseData = (data: StreamResponse) => {
329329
type: "content" as const,
330330
content:
331331
data?.choices?.[0]?.delta?.content ||
332-
data.choices[0].message.content ||
332+
data.choices[0].message?.content ||
333333
""
334334
}
335335
}

0 commit comments

Comments
 (0)