Repository navigation
Add dynamic package runtime invocation - #429
Conversation
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
📝 WalkthroughWalkthroughThis PR introduces dynamic package invocation ( ChangesDynamic Package Runtime Invocation
Estimated code review effort🎯 4 (Complex) | ⏱️ ~75 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 docstrings
🧪 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 |
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
|
🔎 Preview deployed: https://kody-pr-429.kentcdodds.workers.dev Worker: Mocks:
|
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 `@packages/worker/src/repo/checks.ts`:
- Around line 215-229: The KodyPackagesInvokeInput currently makes package
identifiers and export names optional so callers like packages.invoke({})
typecheck; change the input to require exactly one package identifier and
exactly one export alias by introducing two small union types (e.g.,
PackageIdentity = { packageId: string; package_id?: never } | { package_id:
string; packageId?: never } and ExportIdentity = { exportName: string;
export_name?: never } | { export_name: string; exportName?: never }) and then
compose KodyPackagesInvokeInput from PackageIdentity & ExportIdentity plus the
remaining optional fields (params, idempotencyKey/idempotency_key, topic,
kodyId/kody_id). Update the KodyPackagesRuntime.invoke signature to accept this
stricter KodyPackagesInvokeInput so callers must supply one package id alias and
one export alias.
🪄 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 Plus
Run ID: 0fd8f041-89eb-45fb-a0a2-36a27cbf959e
📒 Files selected for processing (13)
docs/contributing/packages-and-manifests.mddocs/use/packages.mdpackages/worker/src/jobs/service.tspackages/worker/src/mcp/run-codemode-registry.node.test.tspackages/worker/src/mcp/run-codemode-registry.tspackages/worker/src/package-invocations/service.node.test.tspackages/worker/src/package-invocations/service.tspackages/worker/src/package-retrievers/service.tspackages/worker/src/package-runtime/module-graph.node.test.tspackages/worker/src/package-runtime/module-graph.tspackages/worker/src/package-runtime/package-app.tspackages/worker/src/package-runtime/package-service.tspackages/worker/src/repo/checks.ts
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 3 total unresolved issues (including 2 from previous reviews).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 26d3743. Configure here.
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>

Summary
packages.invokefromkody:runtimefor package runtime contexts.packages.invokerequires one package identifier and one export alias, and declare the existingstorage,email, andworkflowsruntime exports in the ambient module.kody:@imports for library-like pinned bundle behavior.Testing
npx vitest run --config vitest.node.config.ts packages/worker/src/repo/checks.node.test.ts packages/worker/src/package-invocations/service.node.test.ts packages/worker/src/mcp/run-codemode-registry.node.test.tsnpx vitest run --config vitest.node.config.ts packages/worker/src/package-invocations/service.node.test.tsnpx vitest run --config vitest.node.config.ts packages/worker/src/package-invocations/service.node.test.ts packages/worker/src/mcp/run-codemode-registry.node.test.ts packages/worker/src/package-runtime/module-graph.node.test.tsnpx vitest run --config vitest.node.config.ts packages/worker/src/mcp/capabilities/apps/apps-domain.node.test.ts packages/worker/src/mcp/server-instructions.node.test.ts packages/worker/src/mcp/tools/search-format.node.test.ts packages/worker/src/package-invocations/service.node.test.ts packages/worker/src/mcp/run-codemode-registry.node.test.ts packages/worker/src/package-runtime/module-graph.node.test.tsnpm run format:checknpm run typechecknpm run lint(passes with existing unrelated warning inpackages/worker/src/email/inbound.workers.test.ts)npm run validate(passes after latest review fixes: format, lint, typecheck, 110 unit/worker test files, 3 Playwright E2E tests, and 2 MCP E2E tests)Summary by CodeRabbit
New Features
packages.invoke()to call owned packages dynamically from running code, with nested-depth limiting and deterministic auto idempotency keys; runtime exposes apackageshelper.Documentation
Tests