feat(agent): add profile system and improve tools

- Add Agent Profile module for managing agent identity, soul, tools,
  memory, and bootstrap configuration
- Add profile CLI (pnpm agent:profile) for creating/listing/showing profiles
- Default sessionId to UUIDv7 instead of "default"
- Expose Agent.sessionId as public readonly property
- Improve exec/process tools error handling (no more crashes on spawn errors)
- Add 'output' action to process tool for reading stdout/stderr
- Better tool descriptions to guide agent in choosing exec vs process

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Jiayuan 2026-01-30 02:47:30 +08:00
parent 46a6cb3061
commit 200b2cefda
15 changed files with 740 additions and 58 deletions

View file

@ -12,7 +12,7 @@ export type SessionManagerOptions = {
export class SessionManager {
private readonly sessionId: string;
private readonly baseDir?: string;
private readonly baseDir: string | undefined;
private readonly maxMessages: number;
private readonly keepLast: number;
private queue: Promise<void> = Promise.resolve();

View file

@ -5,7 +5,7 @@ import { appendFile, writeFile } from "fs/promises";
import type { SessionEntry } from "./types.js";
export type SessionStorageOptions = {
baseDir?: string;
baseDir?: string | undefined;
};
export function resolveBaseDir(options?: SessionStorageOptions) {