Repository navigation
feat(sdk): scaffold importers package starters - #338
Conversation
Add a first-class pm package/extension init --capability importers scaffold that generates command-safe import/export registrations, schema-backed flag metadata, and runnable SDK sample tests. Document the new package-author path, expose it in help/completions, cover package and standalone scaffolds, regenerate the package-owned changelog for pm-j5az, and apply compatible Dependabot updates for GitHub Actions pins plus @types/node 26.0.0. Verification: pnpm release:gates; node scripts/run-tests.mjs coverage (100/100/100/100); focused scaffold/workflow tests; temp-project importers scaffold/install/import/export smoke; pnpm changelog:pm:check; pnpm contracts:check; pnpm audit --audit-level moderate; pnpm security:scan; Sentry/telemetry gate.
|
@codex review |
|
Warning Review limit reached
More reviews will be available in 34 minutes and 51 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Repository UI (base), Organization UI (inherited) Review profile: ASSERTIVE Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (19)
📝 WalkthroughWalkthroughAdds ChangesImporters Scaffold Capability
GitHub Actions Pin Updates
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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 |
|
To use Codex here, create a Codex account and connect to github. |
|
✅ Action performedFull review finished. |
There was a problem hiding this comment.
Code Review
This pull request introduces a new importers capability to the package and extension scaffolding system, allowing authors to generate paired import/export commands with schema-governed flag metadata and runnable SDK tests. The changes also update shell completions, documentation, help content, and bump the @types/node dependency to ^26.0.0. The review feedback suggests a usability improvement to use spaces instead of hyphens in the generated command actions for consistency, along with corresponding test updates.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| if (capability === "importers") { | ||
| return [ | ||
| ...commandLines, | ||
| "", | ||
| " // Importers/exporters are the bridge between pm's context graph and", | ||
| " // another project-management system. Keep the starter deterministic so", | ||
| " // package tests can run without touching the network or filesystem; replace", | ||
| " // these payloads with your adapter's real mapping as the package grows.", | ||
| " api.registerImporter(", | ||
| ` ${JSON.stringify(adapterName)},`, | ||
| " async (context) => ({", | ||
| " imported: 1,", | ||
| " source: context.options.source ?? \"starter\",", | ||
| " args: context.args,", | ||
| " }),", | ||
| " {", | ||
| ` action: ${JSON.stringify(`${adapterActionPrefix}-import`)},`, | ||
| ' description: "Import starter records into pm context.",', | ||
| " flags: [", | ||
| " {", | ||
| ' long: "--source",', | ||
| ' value_name: "name",', | ||
| ' value_type: "string",', | ||
| ' description: "Source name or path to import from.",', | ||
| " },", | ||
| " ],", | ||
| " },", | ||
| " );", | ||
| "", | ||
| " api.registerExporter(", | ||
| ` ${JSON.stringify(adapterName)},`, | ||
| " async (context) => ({", | ||
| " exported: true,", | ||
| " destination: context.options.destination ?? \"stdout\",", | ||
| " args: context.args,", | ||
| " }),", | ||
| " {", | ||
| ` action: ${JSON.stringify(`${adapterActionPrefix}-export`)},`, | ||
| ' description: "Export pm context into starter records.",', | ||
| " flags: [", | ||
| " {", | ||
| ' long: "--destination",', | ||
| ' value_name: "name",', | ||
| ' value_type: "string",', | ||
| ' description: "Destination name or path to export to.",', | ||
| " },", | ||
| " ],", | ||
| " },", | ||
| " );", | ||
| ]; | ||
| } |
There was a problem hiding this comment.
For consistency with other scaffolded commands (like the ping command), the generated importer/exporter command actions should use spaces instead of hyphens. This improves CLI usability.
This suggestion changes the action to be built from adapterName. You will also need to remove the unused adapterActionPrefix variable on line 170.
if (capability === "importers") {
return [
...commandLines,
"",
" // Importers/exporters are the bridge between pm's context graph and",
" // another project-management system. Keep the starter deterministic so",
" // package tests can run without touching the network or filesystem; replace",
" // these payloads with your adapter's real mapping as the package grows.",
" api.registerImporter(",
` ${JSON.stringify(adapterName)},`,
" async (context) => ({",
" imported: 1,",
" source: context.options.source ?? \"starter\",",
" args: context.args,",
" }),",
" {",
` action: ${JSON.stringify(`${adapterName} import`)},`,
' description: "Import starter records into pm context.",',
" flags: [",
" {",
' long: "--source",',
' value_name: "name",',
' value_type: "string",',
' description: "Source name or path to import from.",',
" },",
" ],",
" },",
" );",
"",
" api.registerExporter(",
` ${JSON.stringify(adapterName)},`,
" async (context) => ({",
" exported: true,",
" destination: context.options.destination ?? \"stdout\",",
" args: context.args,",
" }),",
" {",
` action: ${JSON.stringify(`${adapterName} export`)},`,
' description: "Export pm context into starter records.",',
" flags: [",
" {",
' long: "--destination",',
' value_name: "name",',
' value_type: "string",',
' description: "Destination name or path to export to.",',
" },",
" ],",
" },",
" );",
];
}| expect(entry).toContain("api.registerImporter("); | ||
| expect(entry).toContain('action: "starter-importers-items-import"'); | ||
| expect(entry).toContain("api.registerExporter("); | ||
| expect(entry).toContain('action: "starter-importers-items-export"'); |
There was a problem hiding this comment.
These test assertions should be updated to reflect the suggested change for more consistent command naming (using spaces instead of hyphens).
| expect(entry).toContain("api.registerImporter("); | |
| expect(entry).toContain('action: "starter-importers-items-import"'); | |
| expect(entry).toContain("api.registerExporter("); | |
| expect(entry).toContain('action: "starter-importers-items-export"'); | |
| expect(entry).toContain("api.registerImporter("); | |
| expect(entry).toContain('action: "starter importers items import"'); | |
| expect(entry).toContain("api.registerExporter("); | |
| expect(entry).toContain('action: "starter importers items export"'); |
There was a problem hiding this comment.
Code Review
This pull request introduces a new importers capability to the package and extension scaffolding system (pm package init --capability importers). This capability scaffolds paired import/export command registrations (api.registerImporter and api.registerExporter) with schema-governed flag metadata, alongside runnable SDK tests and updated documentation. Additionally, shell completions and help content have been updated to support the new capability, and the @types/node dependency has been upgraded to ^26.0.0. I have no feedback to provide as there are no review comments and the implementation is complete and well-tested.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Generate importer/exporter action identifiers from the same space-separated command path exposed to package authors, matching review feedback on PR #338. Record focused verification and temp-directory smoke evidence on pm-j5az.
|
Fresh head pushed after applying review feedback. Please review the current head. @codex review |
|
✅ Action performedFull review finished. |
|
To use Codex here, create a Codex account and connect to github. |
|
Gemini follow-up note: the current head 02285d3 already applies the action-name suggestion. The generated importer/exporter actions now use the space-separated adapter command path, the unused adapterActionPrefix variable is removed, tests were updated, and focused tests/build/temp package smoke passed after the change. |
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 @.github/workflows/release.yml:
- Around line 34-38: The actions/checkout step on line 34 is using the default
persist-credentials setting which unnecessarily writes the GITHUB_TOKEN to the
local git config. Since this release workflow does not perform any git push
operations, add persist-credentials: false to the with section of the
actions/checkout action to prevent unnecessary token exposure and improve
security.
In `@package.json`:
- Line 136: The `@types/node` dependency version is misaligned with the minimum
Node.js runtime specified in engines.node. Change the `@types/node` version from
^26.0.0 to ^20.0.0 to match the Node 20 minimum runtime floor declared in the
package.json engines field, ensuring type definitions do not include APIs
unavailable in the minimum supported Node.js version.
In `@src/cli/help-content.ts`:
- Around line 214-215: The help snippet examples contain inconsistent package
names that break the copy/paste flow. In the first set of examples around lines
214-215, the init example uses "my-sync-package" but the install example on the
next line reverts to "my-search-package". Similarly, this same inconsistency
occurs in the second set of examples around lines 256-257. Update the install
example paths to use "my-sync-package" instead of "my-search-package" in both
locations to maintain consistency with the preceding init examples throughout
the help content.
🪄 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: Repository UI (base), Organization UI (inherited)
Review profile: ASSERTIVE
Plan: Pro
Run ID: 6e463a98-898a-4eeb-a4cd-6c84276645bf
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (18)
.agents/pm/features/pm-j5az.toon.agents/pm/history/pm-j5az.jsonl.github/workflows/auto-release.yml.github/workflows/ci.yml.github/workflows/codeql.yml.github/workflows/docs.yml.github/workflows/nightly.yml.github/workflows/release.ymlCHANGELOG.mddocs/EXTENSIONS.mddocs/SDK.mdpackage.jsonsrc/cli/commands/completion.tssrc/cli/commands/extension/scaffold.tssrc/cli/help-content.tstests/integration/ci-workflow-contract.spec.tstests/unit/commands/completion-command.spec.tstests/unit/extensions/extension-command.spec.ts
There was a problem hiding this comment.
Code Review
This pull request introduces a new importers capability to the package and extension scaffolding system (pm package init --capability importers and pm extension init --capability importers). This capability scaffolds paired import/export commands with schema-governed flag metadata, documentation, and runnable SDK tests. Additionally, the PR updates the @types/node devDependency to ^26.0.0 and updates pinned GitHub actions in workflows and tests. There are no review comments to address, and I have no further feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Apply CodeRabbit review feedback for release checkout hardening and importers help examples. Keep Node typings aligned to the Node 20 runtime floor by restoring @types/node to major 20 and making the optional compile-cache API structurally typed. Record verification and redact the local pnpm store path from pm-j5az history.
|
Fresh head pushed after addressing CodeRabbit feedback. Please review the current head. @codex review |
|
To use Codex here, create a Codex account and connect to github. |
|
✅ Action performedFull review finished. |
There was a problem hiding this comment.
Code Review
This pull request introduces a new importers capability to the package and extension scaffolding system (pm package init / pm extension init). This capability scaffolds paired import/export commands with example flag metadata, along with runnable SDK-based unit tests and documentation. In addition, the PR downgrades @types/node to ^20.0.0 to maintain compatibility with Node 20, updates the compile-cache optimization to be type-safe against these older typings, and updates shell completions, help content, and integration tests. There are no review comments to address, and the changes are well-implemented and fully tested.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Summary
pm package init --capability importers/pm extension init --capability importersscaffolds with command-safe import/export registrations, schema-backed flag metadata, and runnable SDK sample tests.CHANGELOG.mdfor pm-j5az and record PM evidence.Verification
pnpm release:gatesnode scripts/run-tests.mjs coverage-> 100/100/100/100 (Statements 30546/30546, Branches 23823/23823, Functions 5107/5107, Lines 29341/29341)node scripts/run-tests.mjs test -- tests/unit/extensions/extension-command.spec.ts tests/unit/commands/completion-command.spec.ts tests/integration/ci-workflow-contract.spec.tspm init,pm package init --capability importers, generatednpm test,pm install, generated import/export CLI commandspnpm changelog:pm:checkpnpm contracts:checkpnpm audit --audit-level moderatepnpm security:scannode scripts/release/sentry-telemetry-gate.mjs --json --telemetry-mode best-effort --sentry-window-days 14 --max-critical 0 --max-high 0Notes
commander@15.0.0was intentionally deferred because it requires Node >=22.12.0 while this package still supports Node >=20.pm validate --check-resolution --check-history-driftreturned history drift ok, with pre-existingvalidate_resolution_missing_fields:227warnings on older closed items.