feat: claudemesh slug <old> <new> — change a mesh's slug (v1.20.0)
Slugs are not globally unique (mesh.id is canonical) so the route
only validates the regex and updates the row. CLI refuses a local
collision (two joined meshes sharing a slug would make the picker
ambiguous) and rewrites ~/.claudemesh/config.json on success.
Other peers pick up the new slug on next claudemesh sync.
Server: PATCH /api/cli/meshes/:slug body now accepts { name?, slug? }
— same route, just optional both fields.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -31,6 +31,15 @@ export async function renameMesh(token: string, slug: string, newName: string) {
|
||||
});
|
||||
}
|
||||
|
||||
export async function reslugMesh(token: string, oldSlug: string, newSlug: string) {
|
||||
return request<{ slug: string; name: string }>({
|
||||
path: `/api/cli/meshes/${oldSlug}`,
|
||||
method: "PATCH",
|
||||
body: { slug: newSlug },
|
||||
token,
|
||||
});
|
||||
}
|
||||
|
||||
export async function createInvite(
|
||||
token: string,
|
||||
meshSlug: string,
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
export { listMeshes as list } from "./list.js";
|
||||
export { createMesh as create } from "./create.js";
|
||||
export { renameMesh as rename } from "./rename.js";
|
||||
export { reslugMesh as reslug } from "./reslug.js";
|
||||
export { leaveMesh as leave } from "./leave.js";
|
||||
export { joinMesh as join, joinMesh } from "./join.js";
|
||||
export { resolveTarget } from "./resolve-target.js";
|
||||
|
||||
8
apps/cli/src/services/mesh/reslug.ts
Normal file
8
apps/cli/src/services/mesh/reslug.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import { my } from "~/services/api/facade.js";
|
||||
import { getStoredToken } from "~/services/auth/facade.js";
|
||||
|
||||
export async function reslugMesh(oldSlug: string, newSlug: string): Promise<{ slug: string; name: string }> {
|
||||
const auth = getStoredToken();
|
||||
if (!auth) throw new Error("Not signed in");
|
||||
return await my.reslugMesh(auth.session_token, oldSlug, newSlug);
|
||||
}
|
||||
Reference in New Issue
Block a user