Add CEO OpenClaw invite endpoint and update onboarding UX

This commit is contained in:
Dotta
2026-03-07 18:19:06 -06:00
parent 2223afa0e9
commit 0233525e99
13 changed files with 608 additions and 120 deletions

View File

@@ -77,9 +77,7 @@ export function CompanySettings() {
const inviteMutation = useMutation({
mutationFn: () =>
accessApi.createCompanyInvite(selectedCompanyId!, {
allowedJoinTypes: "agent"
}),
accessApi.createOpenClawInvitePrompt(selectedCompanyId!),
onSuccess: async (invite) => {
setInviteError(null);
const base = window.location.origin.replace(/\/+$/, "");
@@ -317,9 +315,9 @@ export function CompanySettings() {
<div className="space-y-3 rounded-md border border-border px-4 py-4">
<div className="flex items-center gap-1.5">
<span className="text-xs text-muted-foreground">
Generate an agent snippet for join flows.
Generate an openclaw agent invite snippet.
</span>
<HintIcon text="Creates an agent-only invite (10m) and renders a copy-ready snippet." />
<HintIcon text="Creates a short-lived OpenClaw agent invite and renders a copy-ready prompt." />
</div>
<div className="flex flex-wrap items-center gap-2">
<Button
@@ -329,7 +327,7 @@ export function CompanySettings() {
>
{inviteMutation.isPending
? "Generating..."
: "Generate agent snippet"}
: "Generate OpenClaw Invite Prompt"}
</Button>
</div>
{inviteError && (
@@ -339,7 +337,7 @@ export function CompanySettings() {
<div className="rounded-md border border-border bg-muted/30 p-2">
<div className="flex items-center justify-between gap-2">
<div className="text-xs text-muted-foreground">
Agent Snippet
OpenClaw Invite Prompt
</div>
{snippetCopied && (
<span