@giantswarm-io/pro 1.10.18 → 1.11.0

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/README.md CHANGED
@@ -222,7 +222,7 @@ The `board` parameter defaults to `"roadmap"` on every board-scoped tool for bac
222
222
 
223
223
  - **`get_board_schema`** -- Describe a board's fields for a UI: name, type (`singleSelect`, `iteration`, `date`, `text`, `other`), the options of single-select fields and the iterations of iteration fields. The `{board}://schema` resource as a tool result.
224
224
  - **`get_item_by_issue`** -- Find the board item of one GitHub issue (URL, `owner/repo#N`, or owner/repo/number) without scanning the board; `item: null` when the issue is not on the board.
225
- - **`list_issues`** -- List and filter issues from a project board using generic field filters. Specify `board` to choose the board (`"roadmap"` or `"customer"`). Use `filters` (a field name-to-value map) to filter by any single-select field. Use `emptyFields` to find items missing specific field values. Read the board's schema resource first to discover available fields and valid options.
225
+ - **`list_issues`** -- List and filter issues from a project board using generic field filters. Specify `board` to choose the board (`"roadmap"` or `"customer"`). Use `filters` (a field name-to-value map) to filter by any single-select field. Use `emptyFields` to find items missing specific field values. Read the board's schema resource first to discover available fields and valid options. Next to `count`, the result carries `hidden` (matching items left out because their content could not be read, e.g. issues in private repos the server's GitHub identity cannot access) and `totalCount` (GitHub's count for the server-side query, including unreadable items, draft issues and pull requests).
226
226
 
227
227
  - **`get_issue_details`** -- Get full details for a specific item: repository metadata, title, body text, comments with timestamps, assignees, labels, dates, and all field values. Board-independent (queries by item ID).
228
228
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@giantswarm-io/pro",
3
- "version": "1.10.18",
3
+ "version": "1.11.0",
4
4
  "description": "Core library and MCP server for managing Giant Swarm's roadmap and customer project boards",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
package/src/lib/items.js CHANGED
@@ -381,6 +381,9 @@ export async function listItems(options) {
381
381
 
382
382
  const projectQuery = queryTerms.join(' ');
383
383
 
384
+ // totalCount is computed by GitHub for the query as sent (server-side
385
+ // filters applied), including items whose content we cannot read.
386
+ let totalCount = null;
384
387
  const allItems = await fetchPaginated(
385
388
  LIST_ITEMS_QUERY,
386
389
  { projectId: boardId, first, filterQuery: projectQuery || null },
@@ -388,6 +391,9 @@ export async function listItems(options) {
388
391
  if (!result?.node?.items) {
389
392
  return { nodes: [], pageInfo: { hasNextPage: false } };
390
393
  }
394
+ if (typeof result.node.items.totalCount === 'number') {
395
+ totalCount = result.node.items.totalCount;
396
+ }
391
397
  return {
392
398
  nodes: result.node.items.nodes || [],
393
399
  pageInfo: result.node.items.pageInfo || { hasNextPage: false }
@@ -406,20 +412,38 @@ export async function listItems(options) {
406
412
  });
407
413
  }
408
414
 
415
+ // Items with null content, or issue content without a title, come from
416
+ // repos the caller's GitHub identity cannot read. They are dropped like
417
+ // before, but counted so callers can tell a complete result from one with
418
+ // items missing. Draft issues and pull requests (no Issue fields selected)
419
+ // are dropped too but are not "hidden": list_issues only lists issues.
420
+ // emptyFields is checked first so items removed by the caller's own
421
+ // filters are never counted.
422
+ function isUnreadable(content) {
423
+ return !content || ((!content.__typename || content.__typename === 'Issue') && !content.title);
424
+ }
425
+
426
+ let hidden = 0;
409
427
  const filtered = allItems.filter(item => {
410
428
  if (!item.fieldValues || !item.fieldValues.nodes) return false;
411
- if (!item.content || !item.content.title) return false;
412
429
 
413
430
  for (const fieldName of emptyFields) {
414
431
  if (hasNonEmptyField(item, fieldName)) {
415
432
  return false;
416
433
  }
417
434
  }
435
+
436
+ if (!item.content || !item.content.title) {
437
+ if (isUnreadable(item.content)) hidden++;
438
+ return false;
439
+ }
418
440
  return true;
419
441
  });
420
442
 
421
443
  return {
422
444
  status: 'success',
445
+ hidden,
446
+ totalCount,
423
447
  data: filtered.map(item => {
424
448
  // Build compact fields map, omitting empty values
425
449
  const fields = {};
@@ -79,7 +79,7 @@ async function resolveSingleItemIssue(itemId, token) {
79
79
  export const listIssuesTool = {
80
80
  name: 'list_issues',
81
81
  annotations: READ_ONLY,
82
- description: 'List and filter issues from a project board (roadmap or customer). Uses generic field filters -- read the board\'s schema resource first (e.g. roadmap://schema or customer://schema) to discover available fields and valid option values. Returns compact items with `repo` (nameWithOwner), `private` flag, `state` (OPEN/CLOSED), `createdAt`/`updatedAt` timestamps, `closedAt` (only present when the item is closed), and a `fields` map (only non-empty values). The repo URL is always https://github.com/{repo}.',
82
+ description: 'List and filter issues from a project board (roadmap or customer). Uses generic field filters -- read the board\'s schema resource first (e.g. roadmap://schema or customer://schema) to discover available fields and valid option values. Returns compact items with `repo` (nameWithOwner), `private` flag, `state` (OPEN/CLOSED), `createdAt`/`updatedAt` timestamps, `closedAt` (only present when the item is closed), and a `fields` map (only non-empty values). The repo URL is always https://github.com/{repo}. Next to `count` (items returned), `hidden` is the number of matching items left out because their content could not be read (typically issues in private repos the server\'s GitHub identity cannot access), and `totalCount` is GitHub\'s count of items matching the server-side query (unreadable items, draft issues and pull requests included). `hidden > 0` means the result is incomplete.',
83
83
  inputSchema: {
84
84
  type: 'object',
85
85
  properties: {
@@ -198,6 +198,8 @@ export async function handleListIssues(args, extra) {
198
198
  type: 'text',
199
199
  text: JSON.stringify({
200
200
  count: result.data.length,
201
+ hidden: result.hidden ?? 0,
202
+ ...(typeof result.totalCount === 'number' ? { totalCount: result.totalCount } : {}),
201
203
  issues: result.data
202
204
  })
203
205
  }]
@@ -167,6 +167,7 @@ const LIST_ITEMS_QUERY = `
167
167
  }
168
168
  }
169
169
  content {
170
+ __typename
170
171
  ... on Issue {
171
172
  title
172
173
  number