Skip to content

Commit da0d571

Browse files
committed
Merge some type files
1 parent e8124b9 commit da0d571

File tree

20 files changed

+420
-478
lines changed

20 files changed

+420
-478
lines changed

.agents/__tests__/context-pruner.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { describe, test, expect, beforeEach } from 'bun:test'
22

33
import contextPruner from '../context-pruner'
44

5-
import type { Message } from '../types/codebuff-message'
5+
import type { Message } from '../types/util-types'
66

77
describe('context-pruner handleSteps', () => {
88
let mockAgentState: any

.agents/changes-reviewer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,13 @@ Use the following guidelines to review the changes and suggest improvements:
7474
}
7575

7676
// Step 4: Extract file paths from git diff and status output
77-
const gitDiffOutput = gitDiffResult || ''
77+
const gitDiffOutput = JSON.stringify(gitDiffResult ?? [])
7878
const changedFiles = gitDiffOutput
7979
.split('\n')
8080
.map((line) => line.trim())
8181
.filter((line) => line && !line.startsWith('??') && !line.includes('OSC'))
8282

83-
const gitStatusOutput = gitStatusResult || ''
83+
const gitStatusOutput = JSON.stringify(gitStatusResult ?? [])
8484
const untrackedFiles = gitStatusOutput
8585
.split('\n')
8686
.map((line) => line.trim())

.agents/context-pruner.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { publisher } from './constants'
22

33
import type { AgentDefinition, ToolCall } from './types/agent-definition'
4-
import type { Message, ToolMessage } from './types/codebuff-message'
4+
import type { Message, ToolMessage } from './types/util-types'
55
import type { CodebuffToolMessage } from '@codebuff/common/tools/list'
66

77
const definition: AgentDefinition = {

.agents/types/agent-definition.ts

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414
* export default definition
1515
*/
1616

17-
import type { Message } from './codebuff-message'
18-
import { ToolResultOutput } from './content-part'
17+
import type { Message, ToolResultOutput, JsonObjectSchema } from './util-types'
1918
import type * as Tools from './tools'
2019
type ToolName = Tools.ToolName
2120

@@ -226,26 +225,6 @@ export type ToolCall<T extends ToolName = ToolName> = {
226225
}
227226
}[T]
228227

229-
/**
230-
* JSON Schema definition (for prompt schema or output schema)
231-
*/
232-
export type JsonSchema = {
233-
type?:
234-
| 'object'
235-
| 'array'
236-
| 'string'
237-
| 'number'
238-
| 'boolean'
239-
| 'null'
240-
| 'integer'
241-
description?: string
242-
properties?: Record<string, JsonSchema | boolean>
243-
required?: string[]
244-
enum?: Array<string | number | boolean | null>
245-
[k: string]: unknown
246-
}
247-
export type JsonObjectSchema = JsonSchema & { type: 'object' }
248-
249228
// ============================================================================
250229
// Available Tools
251230
// ============================================================================

.agents/types/codebuff-message.ts

Lines changed: 0 additions & 77 deletions
This file was deleted.

.agents/types/content-part.ts

Lines changed: 0 additions & 68 deletions
This file was deleted.

.agents/types/data-content.ts

Lines changed: 0 additions & 14 deletions
This file was deleted.

.agents/types/json.ts

Lines changed: 0 additions & 29 deletions
This file was deleted.

.agents/types/provider-metadata.ts

Lines changed: 0 additions & 10 deletions
This file was deleted.

.agents/types/tools.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Message } from './codebuff-message'
1+
import type { Message } from './util-types'
22

33
/**
44
* Union type of all available tool names

0 commit comments

Comments
 (0)