Skip to content

Commit 208c66c

Browse files
committed
delete self and move todo to agent
1 parent 19833bf commit 208c66c

9 files changed

Lines changed: 23 additions & 10 deletions

File tree

packages/codingcode/src/agent/agent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { buildSystemPrompt, type SystemPromptVariant } from './prompt.js';
1515
import { resolveConfig } from './config.js';
1616
import { getContextConfig } from '../context/config.js';
1717
import { ToolSearchService } from '../tools/tool-search-service.js';
18-
import { sharedTodoStore } from '../self/todo.js';
18+
import { sharedTodoStore } from './todo.js';
1919
import { buildDeferredCatalogContent } from './build-tools.js';
2020
import { HookService } from '../hooks/registry.js';
2121
import { SkillService } from '../skills/index.js';

packages/codingcode/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export type { SseEvent } from './server/adapter.js';
5959
export { CheckpointService } from './checkpoint/checkpoint-service.js';
6060
export { ShadowGit, Ledger } from './checkpoint/index.js';
6161
export { ToolSearchService } from './tools/tool-search-service.js';
62-
export type { Todo, TodoStatus } from './self/todo.js';
62+
export type { Todo, TodoStatus } from './agent/todo.js';
6363
export { DEFERRED_TOOLS_GUIDELINES, buildSystemPrompt } from './agent/prompt.js';
6464
export type { SystemPromptVariant, SystemPromptOptions } from './agent/prompt.js';
6565
export {

packages/codingcode/src/tools/domains/self/todo-read.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { z } from 'zod';
22
import { AgentError } from '../../../core/error';
33
import type { ToolDefinition } from '../../types';
4-
import { sharedTodoStore } from '../../../self/todo';
4+
import { sharedTodoStore } from '../../../agent/todo';
55

66
export const todoReadTool: ToolDefinition = {
77
name: 'todo_read',

packages/codingcode/src/tools/domains/self/todo-write.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
TODO_MAX_ITEMS,
88
TODO_MAX_STEP_LEN,
99
type Todo,
10-
} from '../../../self/todo';
10+
} from '../../../agent/todo';
1111

1212
const todoSchema = z.object({
1313
plan: z

packages/codingcode/test/agent/agent-todo-event.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { Effect } from 'effect';
33
import { runReActLoop } from '../../src/agent/agent.js';
44
import { Result } from '../../src/core/result.js';
5-
import { sharedTodoStore } from '../../src/self/todo.js';
5+
import { sharedTodoStore } from '../../src/agent/todo.js';
66

77
const mockToolRegistry = {
88
describeAll: () => [],

packages/codingcode/test/context/context.test.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import { sendMessage } from '../../src/agent/agent.js';
99
import { Result } from '../../src/core/result.js';
1010
import { CheckpointService } from '../../src/checkpoint/checkpoint-service.js';
1111
import { ToolSearchService } from '../../src/tools/tool-search-service.js';
12+
import { ProjectRuntimeService } from '../../src/runtime/project-runtime.js';
13+
import { ApprovalService } from '../../src/approval/index.js';
1214

1315
const mockState = {
1416
sessionId: 'test-session',
@@ -186,6 +188,10 @@ describe('ContextService', () => {
186188
status: () => Effect.succeed([]),
187189
} as any);
188190

191+
const MockApprovalLayer = Layer.succeed(ApprovalService, {
192+
evaluate: () => Effect.succeed({ type: 'allow' as const, level: 0 }),
193+
} as any);
194+
189195
const AllDeps = Layer.mergeAll(
190196
MockToolExecutorLayer,
191197
MockContextLayer,
@@ -194,10 +200,17 @@ describe('ContextService', () => {
194200
MockSkillLayer,
195201
HookLayer,
196202
MockToolSearchLayer,
197-
MockMcpLayer
203+
MockMcpLayer,
204+
MockApprovalLayer
198205
);
199206

200-
const fullLayer = Layer.mergeAll(AgentService.Default.pipe(Layer.provide(AllDeps)), AllDeps);
207+
const projectRuntimeLayer = ProjectRuntimeService.Default.pipe(
208+
Layer.provide(Layer.mergeAll(HookLayer, MockMcpLayer))
209+
);
210+
const agentWithDeps = AgentService.Default.pipe(
211+
Layer.provide(Layer.mergeAll(AllDeps, projectRuntimeLayer))
212+
);
213+
const fullLayer = Layer.mergeAll(AllDeps, projectRuntimeLayer, agentWithDeps);
201214

202215
let sid1: string = '';
203216
// Step 1: send message in one Effect scope

packages/codingcode/test/self/todo/service.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { describe, it, expect, beforeEach } from 'vitest';
2-
import { sharedTodoStore, countByStatus } from '../../../src/self/todo.js';
3-
import type { Todo } from '../../../src/self/todo.js';
2+
import { sharedTodoStore, countByStatus } from '../../../src/agent/todo.js';
3+
import type { Todo } from '../../../src/agent/todo.js';
44

55
describe('TodoService (module-level store)', () => {
66
beforeEach(() => {

packages/codingcode/test/tools/todo.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { describe, it, expect, beforeEach } from 'vitest';
22
import { z } from 'zod';
3-
import { sharedTodoStore } from '../../src/self/todo.js';
3+
import { sharedTodoStore } from '../../src/agent/todo.js';
44
import { todoWriteTool } from '../../src/tools/domains/self/todo-write.js';
55
import { todoReadTool } from '../../src/tools/domains/self/todo-read.js';
66

0 commit comments

Comments
 (0)