@sakupa/mcp 0.7.25 → 0.7.27

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.
Files changed (3) hide show
  1. package/dist/bin.js +11 -13
  2. package/dist/index.js +11 -13
  3. package/package.json +1 -1
package/dist/bin.js CHANGED
@@ -129,7 +129,7 @@ var FORBIDDEN_PATH_SEGMENTS = [
129
129
  var ALLOWED_HIDDEN_PATHS = [".well-known/"];
130
130
 
131
131
  // ../core/dist/domain/version.js
132
- var SAKUPA_MCP_VERSION = "0.7.25";
132
+ var SAKUPA_MCP_VERSION = "0.7.27";
133
133
 
134
134
  // ../core/dist/domain/errors.js
135
135
  var HTTP_STATUS = {
@@ -2819,7 +2819,7 @@ When the user says the TXT is set, run bind "status". It verifies ownership and
2819
2819
  server.registerTool(
2820
2820
  "billing",
2821
2821
  {
2822
- description: "Show this site's hosting subscription: plan, payment state, current paid period, reconciled usage, estimated usage tier, bound custom domains and risks. Owner-only (uses the credential in .sakupa/site.json).",
2822
+ description: "Show this site's hosting subscription: current plan, next renewal plan, payment state, current paid entitlement, reconciled usage, estimated usage tier, bound custom domains and risks. Owner-only (uses the credential in .sakupa/site.json).",
2823
2823
  outputSchema: STRUCTURED_TOOL_OUTPUT_SCHEMA,
2824
2824
  annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: true },
2825
2825
  inputSchema: { projectDir: projectDirInput }
@@ -2833,9 +2833,10 @@ When the user says the TXT is set, run bind "status". It verifies ownership and
2833
2833
  const lines = [
2834
2834
  `Billing status for site ${res.siteId} (mode: ${res.mode})`,
2835
2835
  res.permanentUrl ? `Permanent URL: ${res.permanentUrl}` : void 0,
2836
- res.plan ? `Plan: ${res.plan} (JPY ${res.monthlyPriceJpy ?? tierPriceJpy(res.plan)}/month)` : "Plan: (no subscription yet)",
2836
+ res.plan ? `Current plan: ${res.plan} (JPY ${res.monthlyPriceJpy ?? tierPriceJpy(res.plan)}/month)` : "Current plan: (no subscription yet)",
2837
2837
  res.subscriptionStatus ? `Subscription payment state: ${res.subscriptionStatus}` : void 0,
2838
- res.cancelAtPeriodEnd ? "Renewal: CANCELED \u2014 the site reverts to free at the end of the already-paid month" : void 0,
2838
+ res.cancelAtPeriodEnd ? "Renewal: CANCELED \u2014 the site reverts to free at the end of the already-paid month" : res.renewalPlan ? `Next renewal plan: ${res.renewalPlan} (JPY ${res.renewalMonthlyPriceJpy ?? tierPriceJpy(res.renewalPlan)}/month)` + (res.renewalEffectiveAt ? `, effective ${res.renewalEffectiveAt}` : " (unchanged)") : void 0,
2839
+ res.periodEntitlementPlan ? `Current paid entitlement: ${res.periodEntitlementPlan}` : void 0,
2839
2840
  res.currentPeriodStart ? `Current paid period: ${res.currentPeriodStart} -> ${res.currentPeriodEnd ?? "?"}` : void 0,
2840
2841
  res.estimatedUsageTier ? `Estimated usage tier: ${res.estimatedUsageTier}` : void 0,
2841
2842
  res.lastReconciledAt ? `Last usage reconciliation: ${res.lastReconciledAt}` : void 0,
@@ -3321,7 +3322,6 @@ Summary: ${res.sanitizedSummary}`,
3321
3322
 
3322
3323
  // src/tools/billing.ts
3323
3324
  import { z as z4 } from "zod";
3324
- var plan = z4.enum(["water", "personal", "share", "business"]);
3325
3325
  function registerBillingTools(server, baseCtx) {
3326
3326
  server.registerTool(
3327
3327
  "plans",
@@ -3349,12 +3349,11 @@ function registerBillingTools(server, baseCtx) {
3349
3349
  }
3350
3350
  );
3351
3351
  server.registerTool(
3352
- "upgrade",
3352
+ "change",
3353
3353
  {
3354
- description: "Create a Stripe-hosted confirmation link for a manually selected subscription plan. Creating the link does not change billing; only the user can confirm on Stripe.",
3354
+ description: "Create one Stripe-hosted subscription-management link. The user chooses the plan or period-end cancellation on Stripe; Sakupa never infers intent from the conversation. Creating the link does not change billing.",
3355
3355
  inputSchema: {
3356
3356
  projectDir: projectDirInput,
3357
- targetPlan: plan,
3358
3357
  operationId: z4.string().min(1)
3359
3358
  },
3360
3359
  outputSchema: STRUCTURED_TOOL_OUTPUT_SCHEMA,
@@ -3366,21 +3365,20 @@ function registerBillingTools(server, baseCtx) {
3366
3365
  const site = requireSiteFile(ctx);
3367
3366
  const result = await ctx.client.changeSubscriptionPlan(site.credential, {
3368
3367
  siteId: site.siteId,
3369
- targetPlan: args.targetPlan,
3370
3368
  operationId: args.operationId
3371
3369
  });
3372
3370
  return structuredToolResult({
3373
3371
  schemaVersion: 1,
3374
3372
  outcome: "waiting_user",
3375
- resultCode: "stripe_plan_change_confirmation_required",
3373
+ resultCode: "stripe_subscription_management_required",
3376
3374
  operationId: args.operationId,
3377
- summary: `Stripe confirmation link created for ${result.currentPlan} -> ${result.targetPlan}; the subscription has NOT changed yet. ` + (result.direction === "upgrade" ? "Confirming starts a new paid month immediately at the full target price; Sakupa applies the plan only after invoice payment and carries unused transfer once." : "The downgrade is scheduled for the end of the already-paid period."),
3375
+ summary: "Stripe subscription-management link created; the subscription has NOT changed yet. Stripe is the authoritative place to choose Water, Personal, Share, Business, or period-end cancellation. Query billing after the user finishes.",
3378
3376
  data: { result },
3379
3377
  userAction: {
3380
3378
  type: "open_url",
3381
3379
  provider: "stripe",
3382
3380
  url: result.portalUrl,
3383
- expectedOutcome: "After the user confirms on the Stripe-hosted page, the webhook updates the Sakupa subscription state"
3381
+ expectedOutcome: "After the user finishes on Stripe, webhooks update Sakupa and billing reports the authoritative result"
3384
3382
  },
3385
3383
  nextActions: [{ tool: "billing", allowed: true }]
3386
3384
  });
@@ -3610,7 +3608,7 @@ Workflow:
3610
3608
  4. Optionally bind a custom domain to the subscribed site (bind): an included extra
3611
3609
  serving surface alongside the permanent URL. Ownership is proven only by DNS control; the
3612
3610
  first verified request wins; unverified requests expire after 72 hours. billing,
3613
- upgrade, portal and recover manage the paid
3611
+ change, portal and recover manage the paid
3614
3612
  lifecycle; delete tears the whole site down after explicit confirmation. Binding a
3615
3613
  NEW domain while one is live is a zero-downtime SWITCH: the old domain keeps serving
3616
3614
  until the new domain's www is confirmed live, then it is replaced automatically.
package/dist/index.js CHANGED
@@ -124,7 +124,7 @@ var FORBIDDEN_PATH_SEGMENTS = [
124
124
  var ALLOWED_HIDDEN_PATHS = [".well-known/"];
125
125
 
126
126
  // ../core/dist/domain/version.js
127
- var SAKUPA_MCP_VERSION = "0.7.25";
127
+ var SAKUPA_MCP_VERSION = "0.7.27";
128
128
 
129
129
  // ../core/dist/domain/errors.js
130
130
  var HTTP_STATUS = {
@@ -2908,7 +2908,7 @@ When the user says the TXT is set, run bind "status". It verifies ownership and
2908
2908
  server.registerTool(
2909
2909
  "billing",
2910
2910
  {
2911
- description: "Show this site's hosting subscription: plan, payment state, current paid period, reconciled usage, estimated usage tier, bound custom domains and risks. Owner-only (uses the credential in .sakupa/site.json).",
2911
+ description: "Show this site's hosting subscription: current plan, next renewal plan, payment state, current paid entitlement, reconciled usage, estimated usage tier, bound custom domains and risks. Owner-only (uses the credential in .sakupa/site.json).",
2912
2912
  outputSchema: STRUCTURED_TOOL_OUTPUT_SCHEMA,
2913
2913
  annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: true },
2914
2914
  inputSchema: { projectDir: projectDirInput }
@@ -2922,9 +2922,10 @@ When the user says the TXT is set, run bind "status". It verifies ownership and
2922
2922
  const lines = [
2923
2923
  `Billing status for site ${res.siteId} (mode: ${res.mode})`,
2924
2924
  res.permanentUrl ? `Permanent URL: ${res.permanentUrl}` : void 0,
2925
- res.plan ? `Plan: ${res.plan} (JPY ${res.monthlyPriceJpy ?? tierPriceJpy(res.plan)}/month)` : "Plan: (no subscription yet)",
2925
+ res.plan ? `Current plan: ${res.plan} (JPY ${res.monthlyPriceJpy ?? tierPriceJpy(res.plan)}/month)` : "Current plan: (no subscription yet)",
2926
2926
  res.subscriptionStatus ? `Subscription payment state: ${res.subscriptionStatus}` : void 0,
2927
- res.cancelAtPeriodEnd ? "Renewal: CANCELED \u2014 the site reverts to free at the end of the already-paid month" : void 0,
2927
+ res.cancelAtPeriodEnd ? "Renewal: CANCELED \u2014 the site reverts to free at the end of the already-paid month" : res.renewalPlan ? `Next renewal plan: ${res.renewalPlan} (JPY ${res.renewalMonthlyPriceJpy ?? tierPriceJpy(res.renewalPlan)}/month)` + (res.renewalEffectiveAt ? `, effective ${res.renewalEffectiveAt}` : " (unchanged)") : void 0,
2928
+ res.periodEntitlementPlan ? `Current paid entitlement: ${res.periodEntitlementPlan}` : void 0,
2928
2929
  res.currentPeriodStart ? `Current paid period: ${res.currentPeriodStart} -> ${res.currentPeriodEnd ?? "?"}` : void 0,
2929
2930
  res.estimatedUsageTier ? `Estimated usage tier: ${res.estimatedUsageTier}` : void 0,
2930
2931
  res.lastReconciledAt ? `Last usage reconciliation: ${res.lastReconciledAt}` : void 0,
@@ -3514,7 +3515,6 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
3514
3515
 
3515
3516
  // src/tools/billing.ts
3516
3517
  import { z as z5 } from "zod";
3517
- var plan = z5.enum(["water", "personal", "share", "business"]);
3518
3518
  function registerBillingTools(server, baseCtx) {
3519
3519
  server.registerTool(
3520
3520
  "plans",
@@ -3542,12 +3542,11 @@ function registerBillingTools(server, baseCtx) {
3542
3542
  }
3543
3543
  );
3544
3544
  server.registerTool(
3545
- "upgrade",
3545
+ "change",
3546
3546
  {
3547
- description: "Create a Stripe-hosted confirmation link for a manually selected subscription plan. Creating the link does not change billing; only the user can confirm on Stripe.",
3547
+ description: "Create one Stripe-hosted subscription-management link. The user chooses the plan or period-end cancellation on Stripe; Sakupa never infers intent from the conversation. Creating the link does not change billing.",
3548
3548
  inputSchema: {
3549
3549
  projectDir: projectDirInput,
3550
- targetPlan: plan,
3551
3550
  operationId: z5.string().min(1)
3552
3551
  },
3553
3552
  outputSchema: STRUCTURED_TOOL_OUTPUT_SCHEMA,
@@ -3559,21 +3558,20 @@ function registerBillingTools(server, baseCtx) {
3559
3558
  const site = requireSiteFile(ctx);
3560
3559
  const result = await ctx.client.changeSubscriptionPlan(site.credential, {
3561
3560
  siteId: site.siteId,
3562
- targetPlan: args.targetPlan,
3563
3561
  operationId: args.operationId
3564
3562
  });
3565
3563
  return structuredToolResult({
3566
3564
  schemaVersion: 1,
3567
3565
  outcome: "waiting_user",
3568
- resultCode: "stripe_plan_change_confirmation_required",
3566
+ resultCode: "stripe_subscription_management_required",
3569
3567
  operationId: args.operationId,
3570
- summary: `Stripe confirmation link created for ${result.currentPlan} -> ${result.targetPlan}; the subscription has NOT changed yet. ` + (result.direction === "upgrade" ? "Confirming starts a new paid month immediately at the full target price; Sakupa applies the plan only after invoice payment and carries unused transfer once." : "The downgrade is scheduled for the end of the already-paid period."),
3568
+ summary: "Stripe subscription-management link created; the subscription has NOT changed yet. Stripe is the authoritative place to choose Water, Personal, Share, Business, or period-end cancellation. Query billing after the user finishes.",
3571
3569
  data: { result },
3572
3570
  userAction: {
3573
3571
  type: "open_url",
3574
3572
  provider: "stripe",
3575
3573
  url: result.portalUrl,
3576
- expectedOutcome: "After the user confirms on the Stripe-hosted page, the webhook updates the Sakupa subscription state"
3574
+ expectedOutcome: "After the user finishes on Stripe, webhooks update Sakupa and billing reports the authoritative result"
3577
3575
  },
3578
3576
  nextActions: [{ tool: "billing", allowed: true }]
3579
3577
  });
@@ -3605,7 +3603,7 @@ Workflow:
3605
3603
  4. Optionally bind a custom domain to the subscribed site (bind): an included extra
3606
3604
  serving surface alongside the permanent URL. Ownership is proven only by DNS control; the
3607
3605
  first verified request wins; unverified requests expire after 72 hours. billing,
3608
- upgrade, portal and recover manage the paid
3606
+ change, portal and recover manage the paid
3609
3607
  lifecycle; delete tears the whole site down after explicit confirmation. Binding a
3610
3608
  NEW domain while one is live is a zero-downtime SWITCH: the old domain keeps serving
3611
3609
  until the new domain's www is confirmed live, then it is replaced automatically.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sakupa/mcp",
3
- "version": "0.7.25",
3
+ "version": "0.7.27",
4
4
  "description": "Sakupa MCP server: publish AI-made static sites from your AI tool. AI-made pages, live in seconds.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",