Skip to content

Refactor core agent types - #5

Open
indrazm wants to merge 1 commit into
mainfrom
refactor-agent-types
Open

Refactor core agent types#5
indrazm wants to merge 1 commit into
mainfrom
refactor-agent-types

Conversation

@indrazm

@indrazm indrazm commented Jun 28, 2026

Copy link
Copy Markdown
Owner

Change Intention

Refactor core agent type definitions out of packages/core/src/agent/agent.ts into packages/core/src/agent/types.ts, then update agent, builder, public, and internal exports to consume the shared type module.

Reviews

Review passed with no findings. The reviewer noted the refactor preserves apparent public exports, updates internal imports consistently, and typecheck passed.

Original review output
## Change Intention
The change appears to split agent-related type definitions out of `packages/core/src/agent/agent.ts` into a new `packages/core/src/agent/types.ts`, then update imports/exports accordingly.

Key files involved:
- `packages/core/src/agent/types.ts` — new home for `AgentOptions`, dynamic context/tool options, and event store types.
- `packages/core/src/agent/agent.ts` — now imports those types instead of declaring them inline.
- `packages/core/src/agent/builder.ts` — imports shared agent types from `./types`.
- `packages/core/src/agent/index.ts` — continues public type exports from the new module.
- `packages/core/src/internal/agent.ts` — re-exports the new type module for internal consumers.

## Findings
No findings.

## Notes
- Lexa was available and indexed successfully. `lexa audit --since main` reported no structural findings, though it reported `0 changed file(s)` for that audit scope.
- I also ran `pnpm --filter @anvia/core typecheck`, and it passed.
- Moving shared type definitions into `agent/types.ts` is a good separation-of-concerns improvement: it reduces the responsibility of `agent.ts` and avoids forcing consumers like `builder.ts` to depend on the concrete `Agent` implementation module just to reference type contracts.

## Verdicts
- **Verdict:** pass
- **Reason:** The refactor preserves the apparent public exports, updates internal imports consistently, and typecheck passes with no concrete defects found.

What Fixed

No fix step was required because review and lint verdicts passed without unresolved findings.

Fix agent output
(no fix output)

Lint and Typecheck Status

  • Typecheck: passed - pnpm typecheck
  • Lint: passed - pnpm lint (reported 5 warnings for unused imports, no errors; exit code 0)
  • Test: passed - pnpm test
  • Build: passed - pnpm build
Verification output
## Verification Summary
- Inspected root and package scripts; project uses `pnpm` with `pnpm-lock.yaml`.
- Ran available typecheck, lint, test, and build checks.
- All available checks exited successfully. Lint reported warnings but returned exit code 0.

## Checks
- typecheck: passed - `pnpm typecheck`
- lint: passed - `pnpm lint` (reported 5 warnings for unused imports, no errors; exit code 0)
- test: passed - `pnpm test`
- build: passed - `pnpm build`

## Verdict
VERDICT: pass

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant