Conversation
Publish core
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
Pull request overview
This PR enables the core package to be published alongside the CLI and MCP packages, establishing proper dependency relationships between them. The change allows the CLI and MCP packages to use kibi-core as an installed dependency while maintaining backward compatibility with the monorepo development workflow.
Changes:
- Published
kibi-corepackage by removingprivateflag and adding files configuration - Updated version numbers across all packages from 0.1.0 to 0.1.4
- Modified CLI package to resolve
kb.plfrom installedkibi-coredependency with monorepo fallback
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/core/package.json | Removed private flag, added files array to specify publishable Prolog files, and updated version |
| packages/cli/package.json | Added kibi-core dependency and updated version to match 0.1.4 |
| packages/cli/src/prolog.ts | Implemented dynamic resolution for kb.pl path with installed dependency preference and dev fallback |
| packages/mcp/package.json | Updated version and kibi-cli dependency to 0.1.4 |
| package.json | Modified release script to explicitly publish core package first, then CLI and MCP |
Comments suppressed due to low confidence (2)
packages/cli/src/prolog.ts:75
- The error message could be more actionable by suggesting a specific remedy. Consider adding 'Please run
npm install kibi-coreor ensure you are in the monorepo root.' to guide users toward resolution.
throw new Error(
"Unable to resolve kb.pl. Expected kibi-core to be installed (node_modules) " +
"or to be running inside the monorepo checkout.",
);
packages/core/package.json:6
- The
filesarray includesschema/**/*.plbut the diff doesn't show whether a schema directory exists in the core package. If the schema directory doesn't exist yet or contains no .pl files, this pattern will silently succeed but may cause confusion. Consider verifying the directory exists or documenting the intended structure.
"files": ["src/**/*.pl", "schema/**/*.pl"]
| const importMetaDir = path.dirname(fileURLToPath(import.meta.url)); | ||
|
|
||
| const require = createRequire(import.meta.url); | ||
|
|
There was a problem hiding this comment.
The resolveKbPlPath function lacks documentation explaining its resolution strategy (installed dependency vs. dev monorepo) and when it should be used. Add a JSDoc comment describing the fallback logic and potential failure scenarios.
| /** | |
| * Resolve the absolute path to the Prolog knowledge base file `kb.pl`. | |
| * | |
| * Resolution strategy (in order): | |
| * 1. Treat `kibi-core` as an installed dependency: | |
| * - Use Node's `require.resolve` to locate `kibi-core/package.json`. | |
| * - From that directory, look for `src/kb.pl` and return its path if it exists. | |
| * - This is the expected layout when `kibi-core` is installed from npm in | |
| * `node_modules`. | |
| * 2. Fall back to the monorepo development layout: | |
| * - Resolve `../../core/src/kb.pl` relative to this file's directory. | |
| * - This works when running the CLI from a checkout of the Kibi monorepo. | |
| * | |
| * If neither location contains `kb.pl`, the function throws an `Error` with an | |
| * actionable message. Typical failure scenarios include: | |
| * - `kibi-core` is not installed and the project is not being run from the | |
| * monorepo checkout. | |
| * - The `kb.pl` file has been moved, renamed, or removed from `kibi-core`. | |
| * - Filesystem permission issues prevent checking for or reading `kb.pl`. | |
| * | |
| * Call this helper before spawning SWI-Prolog to obtain the path to the | |
| * knowledge base. Callers should be prepared to handle the thrown `Error` | |
| * if the environment is not correctly set up. | |
| */ |
No description provided.