Add oi CLI wrapper and tests#3
Open
orthagonal wants to merge 2 commits into
Open
Conversation
Introduce a new oi CLI: add a shell wrapper (oi) and a Node ESM launcher (oi.mjs) that forwards args to the ai-agent-framework CLI, injects REPOSITORY_FOLDER when --data is provided, and defaults the server port to 3000 when none is supplied. Add tests (tests/oi-cli.test.mjs) for the CLI behavior and update tools/oi.mjs and package.json to expose the new binary. Update package-lock.json to reflect dependency and metadata changes. Also update AGENTS.md index stats.
Generate host-local stub modules for tools stored in data repositories and add a host-side node_modules resolver hook. - New lib/oi/dataRepoToolStubs.mjs: utilities to collect tool modules, generate/delete zz-data-* stub re-exports, and prepare stubs for a data repo's tools directory. - New lib/oi/hostNodeModulesHook.mjs and hostNodeModulesResolver.mjs: node --import hook that uses the host project's resolver (via OI_HOST_ROOT) to resolve bare specifiers from code loaded from outside the host. - oi.mjs: integrate stub preparation and cleanup into runtime. Sets REPOSITORY_FOLDER, exports buildOiRuntimeEnv for tests, injects import hook via NODE_OPTIONS and OI_HOST_ROOT when needed, and ensures generated stubs are removed on exit. - tests/dataRepoToolStubs.test.mjs: tests for collecting modules, writing/removing stubs, and buildOiRuntimeEnv behavior. - package.json: include new tests in test script. - .gitignore: ignore generated .oi/ and zz-data tool files. This change enables using data-repo-local tools transparently from the host while preserving import.meta.url semantics and host module resolution; it also ensures generated files are cleaned up after execution.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduce a new oi CLI: add a shell wrapper (oi) and a Node ESM launcher (oi.mjs) that forwards args to the ai-agent-framework CLI, injects REPOSITORY_FOLDER when --data is provided, and defaults the server port to 3000 when none is supplied. Add tests (tests/oi-cli.test.mjs) for the CLI behavior and update tools/oi.mjs and package.json to expose the new binary. Update package-lock.json to reflect dependency and metadata changes. Also update AGENTS.md index stats.