opencode-pilot 0.20.1 → 0.20.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-pilot",
3
- "version": "0.20.1",
3
+ "version": "0.20.2",
4
4
  "type": "module",
5
5
  "main": "plugin/index.js",
6
6
  "description": "Automation daemon for OpenCode - polls for work and spawns sessions",
@@ -10,6 +10,7 @@ _provider:
10
10
  html_url: url
11
11
  repository_full_name: repository.nameWithOwner
12
12
  updated_at: updatedAt
13
+ comments: commentsCount
13
14
  # Reprocess items when state changes (e.g., reopened issues)
14
15
  # Note: updated_at is NOT included because our own changes would trigger reprocessing
15
16
  reprocess_on:
@@ -786,6 +786,31 @@ describe('poller.js', () => {
786
786
 
787
787
  assert.strictEqual(mapped.number, undefined);
788
788
  });
789
+
790
+ test('maps commentsCount to comments for GitHub PR enrichment', async () => {
791
+ const { applyMappings } = await import('../../service/poller.js');
792
+
793
+ // gh search prs returns commentsCount, but enrichItemsWithComments checks for 'comments'
794
+ const item = {
795
+ number: 123,
796
+ title: 'Fix mobile overflow',
797
+ commentsCount: 4,
798
+ repository: { nameWithOwner: 'anomalyco/opencode' }
799
+ };
800
+ const mappings = {
801
+ comments: 'commentsCount',
802
+ repository_full_name: 'repository.nameWithOwner'
803
+ };
804
+
805
+ const mapped = applyMappings(item, mappings);
806
+
807
+ // comments field should be set from commentsCount
808
+ assert.strictEqual(mapped.comments, 4);
809
+ // Original commentsCount preserved
810
+ assert.strictEqual(mapped.commentsCount, 4);
811
+ // Other mappings work too
812
+ assert.strictEqual(mapped.repository_full_name, 'anomalyco/opencode');
813
+ });
789
814
  });
790
815
 
791
816
  describe('fetchGitHubComments', () => {