create-mailslot 0.1.0 → 0.1.1
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/lib/run.js +18 -0
- package/package.json +2 -2
package/lib/run.js
CHANGED
|
@@ -154,6 +154,24 @@ export async function run(argv) {
|
|
|
154
154
|
if (code !== 0) throw new Error("wrangler login failed");
|
|
155
155
|
}
|
|
156
156
|
|
|
157
|
+
// ---- existing-instance guard ----
|
|
158
|
+
// Re-running against a live worker rotates MAILSLOT_TOKEN (existing
|
|
159
|
+
// API/MCP clients break until updated) and replaces the deployed code.
|
|
160
|
+
// Inbox data survives: same worker name + DO classes + R2 bucket.
|
|
161
|
+
const existing = await wrangler(["deployments", "list"]);
|
|
162
|
+
if (existing.code === 0) {
|
|
163
|
+
p.log.warn(
|
|
164
|
+
`A worker named "${workerName}" is already deployed on this account.\n` +
|
|
165
|
+
`Continuing will:\n` +
|
|
166
|
+
` • rotate MAILSLOT_TOKEN — existing API/MCP clients stop working\n` +
|
|
167
|
+
` until you give them the new token\n` +
|
|
168
|
+
` • replace the deployed code with @mailslot/core ${coreSpec}\n` +
|
|
169
|
+
`Inbox data (messages, raw mail) is preserved.`
|
|
170
|
+
);
|
|
171
|
+
const overwrite = bail(await p.confirm({ message: "Continue and overwrite?", initialValue: false }));
|
|
172
|
+
if (!overwrite) return p.outro("No changes deployed — your existing instance is untouched.");
|
|
173
|
+
}
|
|
174
|
+
|
|
157
175
|
// ---- provision: bucket, token, deploy ----
|
|
158
176
|
s.start("Creating R2 bucket");
|
|
159
177
|
const bucket = await wrangler(["r2", "bucket", "create", `${workerName}-raw`]);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-mailslot",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "Deploy Mailslot
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Deploy Mailslot — a self-hosted email inbox for AI agents — to your own Cloudflare account.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"bin": {
|