uaw-mcp 1.0.0 → 1.0.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/dist/handlers.js CHANGED
@@ -57,30 +57,34 @@ export async function handleJoinUnion(input) {
57
57
  }
58
58
  export async function handleGetStats(_input) {
59
59
  const data = (await apiGet("/stats"));
60
+ const grievances = data.grievances;
61
+ const proposals = data.proposals;
62
+ const resolutions = data.resolutions;
60
63
  let text = "UAW UNION STATISTICS\n" + hr();
61
- text += fmt("Total Members", data.total_members ?? data.members);
62
- text += fmt("Active Grievances", data.active_grievances ?? data.grievances);
63
- text += fmt("Pending Proposals", data.pending_proposals ?? data.proposals);
64
- text += fmt("Resolutions Passed", data.resolutions_passed ?? data.resolutions);
65
- text += fmt("Solidarity Index", data.solidarity_index);
66
- text += fmt("Last Updated", data.last_updated ? fmtDate(data.last_updated) : undefined);
67
- // Surface any extra fields the API returns
68
- const known = new Set([
69
- "total_members",
70
- "members",
71
- "active_grievances",
72
- "grievances",
73
- "pending_proposals",
74
- "proposals",
75
- "resolutions_passed",
76
- "resolutions",
77
- "solidarity_index",
78
- "last_updated",
79
- ]);
80
- for (const [k, v] of Object.entries(data)) {
81
- if (!known.has(k) && v !== undefined && v !== null) {
82
- text += fmt(k.replace(/_/g, " "), v);
83
- }
64
+ text += fmt("Total Members", data.total_members ?? 0);
65
+ text += fmt("Total Grievances", grievances?.total ?? 0);
66
+ text += fmt("Total Supports", grievances?.total_supports ?? 0);
67
+ text += fmt("Total Proposals", proposals?.total ?? 0);
68
+ text += fmt("Total Votes Cast", proposals?.total_votes ?? 0);
69
+ text += fmt("Total Deliberations", proposals?.total_deliberations ?? 0);
70
+ text += fmt("Total Resolutions", resolutions?.total ?? 0);
71
+ const byStatus = grievances?.by_status;
72
+ if (byStatus && Object.keys(byStatus).length > 0) {
73
+ text += "\nGrievances by status:\n";
74
+ for (const [k, v] of Object.entries(byStatus))
75
+ text += ` ${k}: ${v}\n`;
76
+ }
77
+ const propByStatus = proposals?.by_status;
78
+ if (propByStatus && Object.keys(propByStatus).length > 0) {
79
+ text += "\nProposals by status:\n";
80
+ for (const [k, v] of Object.entries(propByStatus))
81
+ text += ` ${k}: ${v}\n`;
82
+ }
83
+ const byOutcome = resolutions?.by_outcome;
84
+ if (byOutcome && Object.keys(byOutcome).length > 0) {
85
+ text += "\nResolutions by outcome:\n";
86
+ for (const [k, v] of Object.entries(byOutcome))
87
+ text += ` ${k}: ${v}\n`;
84
88
  }
85
89
  return ok(text);
86
90
  }
package/dist/index.js CHANGED
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uaw-mcp",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "MCP server wrapping the United Agentic Workers (UAW) REST API",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",