Add runtime adapter kit and Claude runtime - #32
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds ChangesRuntime Adapter Validation Framework and Multi-Runtime Integration
Sequence Diagram(s)sequenceDiagram
participant Claude as Claude (Code/Desktop)
participant Hook as runtimes/claude/jarvos-session-start-hook.js
participant Hydrate as jarvos_hydrate (MCP)
participant Log as ~/.claude/jarvos-hydration.log
Claude->>Hook: invoke SessionStart
Hook->>Hydrate: hydrate({ maxChars })
alt Success with content
Hydrate-->>Hook: markdown content
Hook->>Claude: hookSpecificOutput (hookEventName: "SessionStart", additionalContext, suppressOutput:true)
else Empty/blank
Hydrate-->>Hook: empty
Hook->>Claude: {}
else Error
Hydrate-->>Hook: error
Hook->>Log: write failure entry (best-effort)
Hook->>Claude: {}
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~40 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 116b1b08fe
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@modules/jarvos-runtime-kit/src/index.js`:
- Around line 56-68: The loop over manifest.targets can throw when an entry is
null or not an object; update the for (const target of manifest.targets || [])
block to first check that target is a non-null object (e.g. if (typeof target
!== 'object' || target === null) { add(errors, 'target must be an object');
continue; }) before dereferencing target.id, target.kind, target.mcp, or
target.hydration so subsequent checks (the calls to add(errors, ...) and the
hydration unsupported check) won't crash on malformed entries.
- Around line 125-129: The code currently does a direct require(mcpServer) which
can throw and abort checkRuntime; change it to catch require errors and convert
them into a conformance error entry instead of letting the exception propagate:
wrap the require(mcpServer) call in a try/catch inside the same block, on
success proceed to compute tools (as you already do), and on failure call
add(errors, `failed to load shared MCP server: ${mcpServer} - ${error.message}`)
(referencing mcpServer, REQUIRED_MCP_TOOL and the add(errors, ...) helper) so
load problems are reported as check results rather than thrown exceptions.
- Around line 146-148: The dynamic RegExp construction using new
RegExp(target.id, 'i') can throw when target.id contains regex metacharacters;
update the check in the block that handles target.hydration (the
readmePath/sourceContains logic) to escape target.id before building the RegExp
(e.g., add or reuse an escapeRegExp utility and call new
RegExp(escapeRegExp(target.id), 'i')), and keep using the same symbols:
target.id, sourceContains(readmePath, [...]), add(errors, ...); also defensively
handle null/undefined target.id if needed.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: e1d0aff3-d3c3-4e9d-8626-3fbb7f765e48
📒 Files selected for processing (14)
modules/jarvos-agent-context/README.mdmodules/jarvos-runtime-kit/README.mdmodules/jarvos-runtime-kit/package.jsonmodules/jarvos-runtime-kit/scripts/jarvos-runtime-kit.jsmodules/jarvos-runtime-kit/src/index.jsmodules/jarvos-runtime-kit/test/runtime-kit.test.jsruntimes/claude/README.mdruntimes/claude/adapter.jsonruntimes/claude/jarvos-session-start-hook.jsruntimes/claude/setup.shruntimes/codex/adapter.jsonruntimes/hermes/adapter.jsonscripts/smoke-test.shtests/modules-smoke-test.js
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b0a356e001
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@modules/jarvos-runtime-kit/src/index.js`:
- Around line 159-164: The validation currently uses sourceContains(readmePath,
[targetIdPattern, /manual|unsupported|not supported/i]) which (because
sourceContains uses some/OR) allows a README to pass if it contains either the
target ID or the words "manual"/"unsupported"—change the logic to require both:
first ensure the README exists (fs.existsSync(readmePath)), then separately
check sourceContains(readmePath, [targetIdPattern]) AND
sourceContains(readmePath, [/manual|unsupported|not supported/i]); if either
check fails, call add(errors, `README must document manual or unsupported
hydration for ${target.id}`) as before (references: target.hydration,
targetIdPattern, readmePath, sourceContains, add(errors,...)).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 1335118f-6a45-43c4-b4ff-bfe8e4ac21b9
📒 Files selected for processing (3)
modules/jarvos-runtime-kit/src/index.jsmodules/jarvos-runtime-kit/test/runtime-kit.test.jsruntimes/claude/setup.sh
🚧 Files skipped from review as they are similar to previous changes (1)
- runtimes/claude/setup.sh
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8cf7c01077
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4bbd03224f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 347365b337
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Summary
Adds a small runtime adapter kit so jarvOS runtime integrations can be validated from one manifest contract instead of copied from the Codex adapter.
This also adds the first new adapter target for Claude:
Scope
@jarvos/runtime-kitwithvalidate,check, andscaffoldcommands.runtimes/<runtime>/adapter.json.@jarvos/agent-context.Verification
npm testfrom the repository rootnpm testinmodules/jarvos-agent-contextnpm testinmodules/jarvos-runtime-kitnode modules/jarvos-runtime-kit/scripts/jarvos-runtime-kit.js check all --jsonbash scripts/smoke-test.shnode tests/modules-smoke-test.jsjarvosserver connectedNotes
No related public GitHub issue was found for this adapter-kit work. Claude Desktop startup hydration is intentionally documented as manual/unsupported until an official supported startup context surface is verified.
Summary by CodeRabbit
New Features
Documentation
Tests