@capivv/mcp-server 0.5.2 → 0.5.4

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.
@@ -56,14 +56,33 @@ export function registerStatusTool(server, client) {
56
56
  }
57
57
  if (onboarding.status === 'fulfilled') {
58
58
  const ob = onboarding.value;
59
+ // The backend's stored onboarding flags drift from real state when
60
+ // resources get created and then deleted (the flag is set on
61
+ // creation but not unset on deletion). To stop reporting "5/5
62
+ // complete" while products/offerings are actually zero, derive
63
+ // is_complete from current resource counts AND the stored flag —
64
+ // both have to agree. capivv_verify_setup already does the real-
65
+ // state check; this is the read-only status tool catching up.
66
+ const productCount = count(products);
67
+ const offeringCount = count(offerings);
68
+ const realStateComplete = productCount > 0 && offeringCount > 0;
69
+ const trueIsComplete = ob.is_complete && realStateComplete;
59
70
  result.onboarding = {
60
- is_complete: ob.is_complete,
71
+ is_complete: trueIsComplete,
61
72
  completed_steps: ob.completed_steps,
62
73
  total_steps: ob.total_steps,
63
74
  next_step: ob.next_step,
75
+ _stored_flag_is_complete: ob.is_complete,
64
76
  };
65
- // E.4.2: Include next step guidance when setup is incomplete
66
- if (!ob.is_complete && ob.next_step) {
77
+ if (ob.is_complete && !realStateComplete) {
78
+ const missing = [];
79
+ if (productCount === 0)
80
+ missing.push('products');
81
+ if (offeringCount === 0)
82
+ missing.push('offerings');
83
+ result._suggestion = `Onboarding flag says complete but ${missing.join(' and ')} have been deleted. Run capivv_verify_setup for the truth, then capivv_create_product / capivv_create_offering to recover.`;
84
+ }
85
+ else if (!trueIsComplete && ob.next_step) {
67
86
  const guidance = STEP_GUIDANCE[ob.next_step];
68
87
  if (guidance) {
69
88
  result._suggestion = `Setup incomplete (${ob.completed_steps}/${ob.total_steps}). Next step: ${guidance}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capivv/mcp-server",
3
- "version": "0.5.2",
3
+ "version": "0.5.4",
4
4
  "description": "MCP server for managing Capivv subscription platform via AI assistants",
5
5
  "type": "module",
6
6
  "bin": {