Skip to content

Conversation

@grypez
Copy link
Contributor

@grypez grypez commented Jan 13, 2026

Separates into its own package the portion of the kernel-agents package that depends upon native bindings. The new package is called kernel-agents-repl.


Note

Separates the REPL strategy (and its native deps) from @ocap/kernel-agents into a new package, simplifying core agents and isolating REPL-specific functionality.

  • Adds new @ocap/kernel-agents-repl package with makeReplAgent, REPL evaluator/messages/parser, tests, tsconfig, and build docs
  • Updates @ocap/kernel-agents exports (adds ./agent, ./types, ./utils, capability subpaths; removes REPL export) and drops tree-sitter* deps now owned by REPL package
  • Refactors imports across REPL code to use @ocap/kernel-agents subpath modules (agent, types, utils, capabilities, test-utils)
  • Adjusts tests: removes REPL from core agent.test.ts; adds comprehensive REPL unit tests; updates local E2E tests to import REPL from new package
  • Updates kernel-test-local to depend on @ocap/kernel-agents-repl; updates yarn.lock

Written by Cursor Bugbot for commit 25aa787. This will update automatically on new commits. Configure here.

@grypez grypez force-pushed the grypez/refactor-kernel-agents-repl branch from 5769d70 to a38d406 Compare January 13, 2026 19:28
@grypez grypez marked this pull request as ready for review January 14, 2026 13:31
@grypez grypez requested a review from a team as a code owner January 14, 2026 13:31
Split the REPL strategy into a separate @ocap/kernel-agents-repl package
to remove tree-sitter native addon dependencies from @ocap/kernel-agents.

This is one step toward enabling @ocap/kernel-agents to be bundled into
vats using @endo/bundle-source, which cannot bundle native addons. The
REPL strategy requires tree-sitter for JavaScript parsing, while the JSON
strategy does not. Users who need REPL agents can now import from the
dedicated package.

Changes:
- Created @ocap/kernel-agents-repl package with REPL strategy code
- Moved all REPL-related files to new package
- Removed tree-sitter and tree-sitter-javascript from kernel-agents deps
- Removed /repl export from kernel-agents package.json
- Added exports to kernel-agents for shared code (agent, types, utils, capabilities)
- Updated imports in kernel-agents tests to use @ocap/kernel-agents-repl

Migration:
- Before: import { makeReplAgent } from '@ocap/kernel-agents/repl'
- After: import { makeReplAgent } from '@ocap/kernel-agents-repl'

WIP Notes:
The test suite of kernel-agents depends on the kernel-agents-repl package,
but this dependency inversion is not realized in the dependency graph.
Following a PR to add a kernel-test-local package, the tests should be
moved there, resolving the cycle.
@grypez grypez force-pushed the grypez/refactor-kernel-agents-repl branch from b9ace55 to 25aa787 Compare January 14, 2026 17:16
@grypez grypez enabled auto-merge (squash) January 14, 2026 17:16
@grypez grypez merged commit 14c9814 into main Jan 14, 2026
27 checks passed
@grypez grypez deleted the grypez/refactor-kernel-agents-repl branch January 14, 2026 17:23
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.

3 participants