Skip to content

Consume @agent-relay/integration-prompts for adapter doc parsing#379

Merged
khaliqgant merged 1 commit into
mainfrom
ar-integration-prompts-pear
Jun 18, 2026
Merged

Consume @agent-relay/integration-prompts for adapter doc parsing#379
khaliqgant merged 1 commit into
mainfrom
ar-integration-prompts-pear

Conversation

@khaliqgant

@khaliqgant khaliqgant commented Jun 18, 2026

Copy link
Copy Markdown
Member

Summary

Installs @agent-relay/integration-prompts@^8.8.3 (resolved to 8.8.4) and replaces the local parseWritableResources function with the package's more comprehensive parser, falling back to the legacy heading format for adapter docs still using it.

Bumps @agent-relay/evals lockfile resolution from 8.8.2 to 8.8.4 so pear gains access to the integration-prompts re-exports.

Changes

  • src/main/integrations.ts: Import parseWritableResources from the package. The local function now delegates to the package parser first (handles markdown tables and write-field-contract formats), then falls back to the heading format for backward compat. Added toWritableResource adapter to map WritableResourceDescriptor → local WritableResource.
  • package.json: Added @agent-relay/integration-prompts: ^8.8.3, updated @agent-relay/evals to ^8.8.4.
  • Lockfile: Updated to resolve evals against the version that re-exports integration-prompts.

Testing

  • 447/448 tests pass (1 pre-existing failure in broker.test.ts — asar path mismatch).

Review in cubic

@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e03b0f9d-945d-4947-af8d-5ed81a514abe

📥 Commits

Reviewing files that changed from the base of the PR and between 673575d and 9d2a0b4.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (2)
  • package.json
  • src/main/integrations.ts

📝 Walkthrough

Walkthrough

The PR adds @agent-relay/integration-prompts as a runtime dependency and refactors parseWritableResources in integrations.ts into a two-stage pipeline: it first tries the new package parser and converts its descriptors to local WritableResource entries, falling back to the existing legacy markdown heading parser when the package parser returns nothing. The readWritableResources call site is updated to supply the provider name as a hint.

Changes

Two-stage writable-resource parsing pipeline

Layer / File(s) Summary
Dependency addition and import wiring
package.json, src/main/integrations.ts
@agent-relay/integration-prompts added to dependencies at ^8.8.4; @agent-relay/evals devDependency bumped to ^8.8.4; imports in integrations.ts alias the external parser as parsePackageWritableResources and add the WritableResourceDescriptor type.
Two-stage parsing pipeline and legacy fallback
src/main/integrations.ts
Legacy heading parser extracted into parseLegacyHeadingResources with its isolated regex; parseWritableResources rewritten to first invoke the package parser and convert results via toWritableResource/lastMeaningfulSegment, falling back to the legacy parser on empty output; function signature extended with an optional providerHint; readWritableResources updated to pass the provider name.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 A rabbit hops down the parsing trail,
First checks the package — does it tell the tale?
If no resources found in its packet so neat,
The legacy headings are still there to greet.
Two stages now dance where once stood one,
Provider hints passed, and the parsing is done! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: consuming @agent-relay/integration-prompts for adapter doc parsing, which aligns with the primary objective of importing and using the package's parser.
Description check ✅ Passed The description is comprehensive and directly related to the changeset, detailing what was installed, how it was integrated, and test results.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ar-integration-prompts-pear

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request integrates the @agent-relay/integration-prompts package to parse writable resources from adapter documentation, falling back to the legacy heading parser if no results are found. Feedback on the changes suggests adding optional chaining and a fallback value when accessing descriptor.path in toWritableResource to prevent potential runtime TypeError crashes.

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.

Comment thread src/main/integrations.ts
Comment on lines +424 to +427
function toWritableResource(descriptor: WritableResourceDescriptor): WritableResource {
const path = descriptor.path.replace(/^\//u, '')
return { name: descriptor.name ?? lastMeaningfulSegment(path), pathTemplate: path }
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

If descriptor.path is undefined or null, calling .replace on it will throw a TypeError at runtime. To prevent potential crashes, use optional chaining and provide a fallback value.

Suggested change
function toWritableResource(descriptor: WritableResourceDescriptor): WritableResource {
const path = descriptor.path.replace(/^\//u, '')
return { name: descriptor.name ?? lastMeaningfulSegment(path), pathTemplate: path }
}
function toWritableResource(descriptor: WritableResourceDescriptor): WritableResource {
const path = descriptor.path?.replace(/^\//u, '') ?? ''
return { name: descriptor.name ?? lastMeaningfulSegment(path), pathTemplate: path }
}

@khaliqgant khaliqgant merged commit d56abd5 into main Jun 18, 2026
5 checks passed
@khaliqgant khaliqgant deleted the ar-integration-prompts-pear branch June 18, 2026 07:56
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.

1 participant