Skip to content

Commit 5b7c494

Browse files
committed
fix(agents): use relative imports for local types
The bare 'types/*' imports were resolving to the npm 'types' package (a Hash/SortedSet library) instead of the local types directory. This caused TypeScript to silently treat these imports as 'any'. Fixed 6 files to use '../types/*' relative imports: - agents/editor/editor.ts - agents/editor/editor-glm.ts - agents/editor/editor-gpt-5.ts - agents/file-explorer/file-picker.ts - agents/file-explorer/code-searcher.ts - agents/file-explorer/directory-lister.ts Also removed the unused 'types' npm package from devDependencies to prevent this shadowing issue from recurring.
1 parent 8a6b404 commit 5b7c494

File tree

18 files changed

+20
-28
lines changed

18 files changed

+20
-28
lines changed

agents-graveyard/base/base-factory.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
} from './base-prompts'
88

99
import type { SecretAgentDefinition } from '../../agents/types/secret-agent-definition'
10-
import type { ModelName } from 'types/agent-definition'
10+
import type { ModelName } from '../../agents/types/agent-definition'
1111

1212
export const base = (
1313
model: ModelName,

agents-graveyard/base/base-lite-grok-4-fast.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
1-
import {
2-
PLACEHOLDER
3-
} from 'types/secret-agent-definition'
4-
51
import { buildArray } from '@codebuff/common/util/array'
62
import { closeXml } from '@codebuff/common/util/xml'
73

84
import baseLite from './base-lite'
95
import { publisher } from '../constants'
106

11-
import type {
12-
SecretAgentDefinition} from 'types/secret-agent-definition';
7+
import {
8+
PLACEHOLDER,
9+
type SecretAgentDefinition,
10+
} from '../../agents/types/secret-agent-definition'
1311

1412
const definition: SecretAgentDefinition = {
1513
...baseLite,

agents-graveyard/base2-with-task-researcher.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import { buildArray } from '@codebuff/common/util/array'
33
import { publisher } from '../agents/constants'
44
import { type SecretAgentDefinition } from '../agents/types/secret-agent-definition'
55

6-
import type { ToolCall } from 'types/agent-definition'
7-
import type { UserMessage } from 'types/util-types'
6+
import type { ToolCall } from '../agents/types/agent-definition'
7+
import type { UserMessage } from '../agents/types/util-types'
88

99
export const createBase2WithTaskResearcher: () => Omit<
1010
SecretAgentDefinition,

agents-graveyard/base2/task-researcher/base2-gpt-5-with-task-researcher.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
type SecretAgentDefinition,
77
} from '../../types/secret-agent-definition'
88

9-
import type { ToolCall } from 'types/agent-definition'
9+
import type { ToolCall } from '../../../agents/types/agent-definition'
1010

1111
export const createBase2WithTaskResearcher: () => Omit<
1212
SecretAgentDefinition,

agents-graveyard/base2/task-researcher/base2-with-task-researcher-planner-pro.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
type SecretAgentDefinition,
77
} from '../../../agents/types/secret-agent-definition'
88

9-
import type { ToolCall } from 'types/agent-definition'
9+
import type { ToolCall } from '../../../agents/types/agent-definition'
1010

1111
export const createBase2WithTaskResearcher: () => Omit<
1212
SecretAgentDefinition,

agents-graveyard/editor/reviewer-editor-gpt-5.ts

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

3-
import type { AgentDefinition } from 'types/agent-definition'
3+
import type { AgentDefinition } from '../../agents/types/agent-definition'
44

55

66
const definition: AgentDefinition = {

agents-graveyard/editor/reviewer-editor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
import { publisher } from '../constants'
33

4-
import type { AgentDefinition} from 'types/agent-definition';
4+
import type { AgentDefinition } from '../../agents/types/agent-definition'
55

66
export const createCodeEditor = (options: {
77
model: 'gpt-5' | 'opus'

agents-graveyard/file-explorer/file-q-and-a.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 { SecretAgentDefinition } from '../types/secret-agent-definition'
4-
import type { ToolCall } from 'types/agent-definition'
4+
import type { ToolCall } from '../../agents/types/agent-definition'
55

66
const paramsSchema = {
77
type: 'object' as const,

agents-graveyard/orchestrator/iterative-orchestrator/base2-with-files-input.ts

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

3-
import type { SecretAgentDefinition } from 'types/secret-agent-definition'
3+
import type { SecretAgentDefinition } from '../../../agents/types/secret-agent-definition'
44

55

66
const definition: SecretAgentDefinition = {

agents-graveyard/thinker/thinker-lite.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import thinker from './thinker'
22

3-
import type { SecretAgentDefinition } from 'types/secret-agent-definition'
3+
import type { SecretAgentDefinition } from '../../agents/types/secret-agent-definition'
44

55
const definition: SecretAgentDefinition = {
66
...thinker,

0 commit comments

Comments
 (0)