diff --git a/src/cli/commands/decision.ts b/src/cli/commands/decision.ts index 6ebe04f..66b693b 100644 --- a/src/cli/commands/decision.ts +++ b/src/cli/commands/decision.ts @@ -2,7 +2,7 @@ import { input } from '@inquirer/prompts'; import { join } from 'path'; import { getEntityDir } from '../../core/paths.js'; import { getNextId } from '../../core/counter.js'; -import { readEntity, writeEntity, listEntities } from '../../core/files.js'; +import { readEntity, writeEntity } from '../../core/files.js'; import { DecisionSchema, type Decision } from '../../core/schema.js'; import { Index } from '../../core/index.js'; diff --git a/src/cli/commands/handoff.ts b/src/cli/commands/handoff.ts index 4d68bb3..89e6f9f 100644 --- a/src/cli/commands/handoff.ts +++ b/src/cli/commands/handoff.ts @@ -2,7 +2,7 @@ import { input, select } from '@inquirer/prompts'; import { join } from 'path'; import { getEntityDir } from '../../core/paths.js'; import { getNextId } from '../../core/counter.js'; -import { readEntity, writeEntity, listEntities } from '../../core/files.js'; +import { readEntity, writeEntity } from '../../core/files.js'; import { HandoffSchema, type Handoff } from '../../core/schema.js'; import { Index } from '../../core/index.js'; @@ -20,6 +20,8 @@ export async function handoffCreate(cwd: string, options: Partial = {}) id: getNextId(cwd, 'handoff'), fromRole, toRole, + fromAgent: options.fromAgent, + toAgent: options.toAgent, taskId: taskId || undefined, summary, context, diff --git a/src/cli/commands/memory.ts b/src/cli/commands/memory.ts index 7287f67..7494d9f 100644 --- a/src/cli/commands/memory.ts +++ b/src/cli/commands/memory.ts @@ -1,7 +1,7 @@ import { input, select } from '@inquirer/prompts'; import { join } from 'path'; import { getEntityDir } from '../../core/paths.js'; -import { readEntity, writeEntity, listEntities } from '../../core/files.js'; +import { writeEntity } from '../../core/files.js'; import { MemorySchema, type Memory } from '../../core/schema.js'; import { Index } from '../../core/index.js'; diff --git a/src/cli/commands/status.ts b/src/cli/commands/status.ts index 8e5573c..9ddd1bd 100644 --- a/src/cli/commands/status.ts +++ b/src/cli/commands/status.ts @@ -1,12 +1,14 @@ +import { existsSync } from 'fs'; import { generateStatus } from '../../core/status.js'; import { readEntity } from '../../core/files.js'; import { getStatusPath } from '../../core/paths.js'; export function status(cwd: string, options: { update?: boolean } = {}): void { - if (options.update) { + const statusPath = getStatusPath(cwd); + if (options.update || !existsSync(statusPath)) { generateStatus(cwd); } - const { body } = readEntity(getStatusPath(cwd)); + const { body } = readEntity(statusPath); console.log(body); } diff --git a/src/cli/commands/task.ts b/src/cli/commands/task.ts index a5654a4..50a9c91 100644 --- a/src/cli/commands/task.ts +++ b/src/cli/commands/task.ts @@ -2,7 +2,7 @@ import { input, select } from '@inquirer/prompts'; import { join } from 'path'; import { getEntityDir } from '../../core/paths.js'; import { getNextId } from '../../core/counter.js'; -import { readEntity, writeEntity, listEntities } from '../../core/files.js'; +import { readEntity, writeEntity } from '../../core/files.js'; import { TaskSchema, type Task } from '../../core/schema.js'; import { Index } from '../../core/index.js'; diff --git a/tests/e2e.test.ts b/tests/e2e.test.ts index 352043d..34a3029 100644 --- a/tests/e2e.test.ts +++ b/tests/e2e.test.ts @@ -15,7 +15,7 @@ describe('e2e', () => { rmSync(cwd, { recursive: true, force: true }); }); - it('initializes and creates a task', () => { + it('initializes a project', () => { const bin = join(process.cwd(), 'bin', 'agenthub.js'); execSync(`node ${bin} init --yes --project-name e2e-test`, { cwd }); expect(existsSync(join(cwd, '.agenthub', 'agenthub.config.json'))).toBe(true);