fix: resolve TypeScript build errors in agents monorepo#63
fix: resolve TypeScript build errors in agents monorepo#63brawlaphant wants to merge 2 commits intoregen-network:mainfrom
Conversation
Set up proper TypeScript project references and npm workspaces so that `tsc --build` compiles cleanly. Changes: - Add `tsconfig.base.json` with shared compiler options and `composite: true` - Add per-package `tsconfig.json` files extending the base, with project references matching the dependency graph - Convert root `tsconfig.json` to solution-style (references only) - Add npm workspaces to root `package.json` so Node module resolution finds `@regen/*` packages via symlinks in `node_modules/` - Replace pnpm `workspace:*` protocol with npm-compatible `*` specifier - Fix type cast in `ooda-executor.ts` (TS2352: cast through `unknown`) - Update `lint` script to use `tsc --build --noEmit` Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the monorepo's build system by standardizing TypeScript configurations and integrating npm workspaces. These changes streamline the development process, improve type safety, and ensure consistent package resolution across all internal modules, leading to a more robust and maintainable codebase. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request refactors the project into an npm monorepo structure, introducing workspaces in package.json and package-lock.json, along with new tsconfig.json files for each package and a base configuration. It also updates numerous dependencies to their latest versions. The review comments suggest improving consistency by using the workspace: protocol for internal package dependencies instead of * in package.json files.
agents/packages/agents/package.json
Outdated
| "@regen/core": "*", | ||
| "@regen/plugin-ledger-mcp": "*", | ||
| "@regen/plugin-koi-mcp": "*" |
There was a problem hiding this comment.
While using * for workspace dependencies works with npm workspaces, it's less explicit than using the workspace: protocol, which is supported by modern npm versions (v7+). The workspace: protocol ensures that the dependency is resolved from within the monorepo, which is safer and clearer.
Since you're moving to npm workspaces, I'd recommend using the workspace: protocol. For example:
"dependencies": {
"@regen/core": "workspace:^",
"@regen/plugin-ledger-mcp": "workspace:^",
"@regen/plugin-koi-mcp": "workspace:^"
}This will use the versions defined in the respective package.json files within the workspace.
| "@regen/core": "*", | |
| "@regen/plugin-ledger-mcp": "*", | |
| "@regen/plugin-koi-mcp": "*" | |
| "@regen/core": "workspace:^", | |
| "@regen/plugin-ledger-mcp": "workspace:^", | |
| "@regen/plugin-koi-mcp": "workspace:^" |
| "types": "./src/index.ts", | ||
| "dependencies": { | ||
| "@regen/core": "workspace:*" | ||
| "@regen/core": "*" |
| "types": "./src/index.ts", | ||
| "dependencies": { | ||
| "@regen/core": "workspace:*" | ||
| "@regen/core": "*" |
Address gemini-code-assist review feedback — replace bare "*" with "workspace:*" for @regen/* internal dependencies so the workspace protocol explicitly enforces monorepo resolution. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
tsconfig.jsonfiles extending a sharedtsconfig.base.json, enablingtsc --buildto compile the monorepo cleanlypackage.jsonso@regen/*packages resolve throughnode_modules/symlinks, replacing the pnpm-onlyworkspace:*protocolTS2352type cast error inooda-executor.tsby casting throughunknownTest plan
npm run build(tsc --build) passes with zero errorsnpm run lint(tsc --build --noEmit) passes cleannpm test(vitest run) — all 27 tests passnpm install && npm run buildworks from a clean checkout🤖 Generated with Claude Code