@syntica/mcp 2.0.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.
@@ -0,0 +1,144 @@
1
+ ---
2
+ name: syntica-manage
3
+ description: Maintenance for your Syntica organisation — use when the user wants to check what they are being charged, resize or change an environment's machine, or delete, restore or rename an application. Covers: view the current bill, resize an environment's EC2, delete an application (with a recovery window), restore a deleted app, or rename an app. Enabling paid environments and billing changes link out to the web. Destructive and billing actions always confirm first.
4
+ ---
5
+
6
+ # Syntica Manage
7
+
8
+ Announce at start: "I'm using syntica-manage."
9
+
10
+ Maintenance operations on syntica. Today this covers **view billing**, **delete**, **restore**, and **rename**. (Adding/removing paid environments is planned but not yet here — for now use the dashboard for that.)
11
+
12
+ ---
13
+
14
+ ## Step 1 — Load config
15
+
16
+ Read `~/.syntica/credentials.json` (session `token` and `orgId`) and
17
+ `.syntica/config.json` (project state) using the Read tool. The token is deliberately kept
18
+ out of the project directory — see `/syntica-onboard` (#488).
19
+
20
+ If `~/.syntica/credentials.json` is missing but `.syntica/config.json` still has a
21
+ `token` field, it is an older setup: use that token for this run and tell the user to run
22
+ `/syntica-onboard` once, which moves it out of the repository.
23
+
24
+ If neither file yields a `token`, or `orgId` is empty, stop and tell the user:
25
+ "Run `/syntica-onboard` first to set up your project."
26
+
27
+ Use `token` and `orgId` from the file for every call below. If a call returns an auth error, tell the user: "Your session has expired. Run `/syntica-onboard` to sign in again." and stop.
28
+
29
+ ---
30
+
31
+ ## Step 2 — Choose the operation
32
+
33
+ If the user's request already makes the operation clear (e.g. "show my bill", "resize prod", "enable staging", "delete this app", "restore my app", "rename it to X"), skip straight to that operation. Otherwise use the AskUserQuestion tool with options `["View billing", "Resize an environment", "Enable an environment or change billing", "Delete, restore or rename an app"]` to ask: "What would you like to do?"
34
+
35
+ If they pick **"Delete, restore or rename an app"**, use a follow-up AskUserQuestion with options `["Delete", "Restore", "Rename"]` and go to that section.
36
+
37
+ ---
38
+
39
+ ## View billing
40
+
41
+ Read-only — this never changes anything.
42
+
43
+ 1. Call `org_get_billing` with `{ orgId }`. It returns `planKey`, `monthlyTotalCents`, `currency`, and `lines[]` (each with `label`, `quantity`, `unitAmountCents`, `lineTotalCents`, and `scope`/`scopeId`).
44
+
45
+ 2. Present a clear summary to the user:
46
+ - The plan (`planKey` — `free` or `payg`).
47
+ - The **monthly total**: format `monthlyTotalCents` as a currency amount (e.g. `€12.50` for 1250 with currency `eur`).
48
+ - A short table of line items — one row per `lines[]` entry: label, quantity, and `lineTotalCents` formatted as currency. Skip lines with a zero `lineTotalCents` unless the user asks for everything.
49
+
50
+ 3. If `planKey` is `free`, note that the free plan bills nothing and everything is within the included allowance.
51
+
52
+ 4. This skill only *shows* billing. To change the plan, buy environments/tiers/traffic, add a payment method, or view invoices, use **Enable an environment or change billing** below (it links to the dashboard).
53
+
54
+ ---
55
+
56
+ ## Resize an environment (change EC2 size)
57
+
58
+ Changing an environment's node tier changes the instance size **and the monthly cost**. This adjusts billing on an existing card (Pay-as-you-go) — no new card entry — so it's safe to do here with a cost confirmation. The free plan only has the free tier; bigger sizes need Pay-as-you-go.
59
+
60
+ 1. **Identify** the app (call `app_list` with `{ token, orgId }` if unclear) and the environment (`dev`/`staging`/`production`).
61
+
62
+ 2. **List tiers.** Call `app_list_node_tiers` with `{ token, orgId }`. It returns the available tiers (name, instance type, storage, price) and the org's plan key.
63
+ - If the plan is `free`: tell the user only the free tier is available and larger sizes require Pay-as-you-go — point them at **Enable an environment or change billing** — then stop.
64
+
65
+ 3. **Confirm the cost.** Use the AskUserQuestion tool with options `["Yes — resize", "No — cancel"]` to ask: "Resize <app>/<env> to <tier> at €X/mo? This changes your bill." Show the chosen tier's monthly price. If the user cancels, stop.
66
+
67
+ 4. **Set the tier.** Call `app_set_node_tier` with `{ token, applicationId, environment, nodeTierId }`.
68
+
69
+ 5. **Explain when it takes effect.** The new size is applied to the instance on the **next deploy**. For an immediate change on a running instance, offer to: `app_stop_instance` → `app_reprovision_instance` (keeps the data volume) → `app_start_instance`, then redeploy — and warn this causes brief downtime.
70
+
71
+ ---
72
+
73
+ ## Enable an environment or change billing
74
+
75
+ Enabling a paid environment (staging/production when you only have dev), switching plans, adding a payment method, buying traffic bundles, or viewing invoices all involve **entering or authorising card details**, which can't be done safely from the CLI. Send the user to the web billing page for these.
76
+
77
+ Give the user this link:
78
+
79
+ > **https://app.vibetocloud.io/settings/billing**
80
+
81
+ Then tell them what to do there:
82
+ - **Enable staging or production:** open the **"Environments & Backups"** section and enable the environment for your app (a paid add-on on Pay-as-you-go).
83
+ - **Switch to Pay-as-you-go, add a card, change traffic, or view invoices:** use the other sections on that page.
84
+
85
+ > Note: if they aren't signed in they'll be asked to log in first, then are returned automatically to this page.
86
+
87
+ ---
88
+
89
+ ## Delete an application
90
+
91
+ 1. **Identify the app.** If the target is not obvious, call `app_list` with `{ token, orgId }` and use the AskUserQuestion tool to let the user pick which application to delete (show `name`). Never guess — deletion is destructive.
92
+
93
+ 2. **Show the disclaimer** verbatim, filling in the app name:
94
+
95
+ > ⚠️ Deleting **<name>** will:
96
+ > - Move its repository to trash. You can restore it for about **30 days** with `/syntica-manage` → Restore.
97
+ > - After that window it is **permanently purged and cannot be recovered**.
98
+ > - Free the application's billing slot.
99
+ > - **NOT** stop or destroy any deployed environments/instances — if you no longer want to be billed for them, stop them first (`/syntica-debug` or the dashboard).
100
+
101
+ 3. **Confirm.** Use the AskUserQuestion tool with options `["Yes — delete it", "No — cancel"]` to ask: "Delete application <name>? This can be undone within ~30 days." If the user cancels, stop and confirm nothing was changed.
102
+
103
+ 4. **Delete.** Call `app_delete` with `{ token, applicationId }`.
104
+
105
+ 5. **Report.** On success tell the user: "🗑️ **<name>** deleted. Restore it within ~30 days with `/syntica-manage` → Restore; after that it is permanently purged." If the call fails, show the error and stop.
106
+
107
+ ---
108
+
109
+ ## Restore a deleted application
110
+
111
+ 1. **List deleted apps.** Call `app_list_deleted` with `{ token, orgId }`. Each entry has `name`, `id`, `deletedAt`, and `approxDaysLeftToRestore`.
112
+
113
+ - If the list is empty, tell the user: "You have no deleted applications to restore." and stop.
114
+
115
+ 2. **Pick one.** Use the AskUserQuestion tool to let the user choose which to restore, showing each `name` with its `approxDaysLeftToRestore` (e.g. "my-app — ~12 days left"). Warn on any with a low or zero count that they may already be past the window.
116
+
117
+ 3. **Restore.** Call `app_restore` with `{ token, applicationId }` for the chosen app.
118
+
119
+ 4. **Report.**
120
+ - On success: "♻️ **<name>** restored." (The repository and app are back; redeploy with `/syntica-deploy` if needed.)
121
+ - If the error is `RESTORE_WINDOW_ELAPSED`: tell the user the recovery window has passed and the app was permanently purged — it cannot be recovered, they'll need to create a new application.
122
+ - If the error is `DELETED_APP_NOT_FOUND`: it may already be restored or purged; re-run the list.
123
+
124
+ ---
125
+
126
+ ## Rename an application
127
+
128
+ 1. **Identify the app.** If not obvious, call `app_list` with `{ token, orgId }` and let the user pick.
129
+
130
+ 2. **Get the new name.** Ask the user for the new name if not already given. It must be lowercase letters, numbers and hyphens only, and unique in the org.
131
+
132
+ 3. **Show the disclaimer** verbatim:
133
+
134
+ > ⚠️ Renaming changes the repository path, so **existing git clone/remote URLs stop working**. Anyone with a local clone (including this project, if its remote points at syntica) must update their remote to the new clone URL afterwards.
135
+
136
+ 4. **Confirm.** Use the AskUserQuestion tool with options `["Yes — rename it", "No — cancel"]` to ask: "Rename <old name> to <new name>? Existing clone remotes will break."
137
+
138
+ 5. **Rename.** Call `app_rename` with `{ token, applicationId, name }`.
139
+
140
+ 6. **Report.** On success show the new `cloneUrl` returned by the tool and tell the user to update any local remote:
141
+ ```bash
142
+ git remote set-url <remote> <new cloneUrl>
143
+ ```
144
+ If the `remote` in `.syntica/config.json` targets syntica, offer to run this for them. If the error is `APP_RENAME_INVALID`, explain the name is invalid or taken and ask for another.