2026-04-27 11:20:47 -05:00
|
|
|
import { Link } from "@tanstack/react-router";
|
|
|
|
|
import { open } from "@tauri-apps/plugin-shell";
|
|
|
|
|
import { AnimatePresence, motion } from "framer-motion";
|
|
|
|
|
import { ArrowLeft, ExternalLink, Plus, Trash2, Webhook, Zap } from "lucide-react";
|
|
|
|
|
import { useState } from "react";
|
|
|
|
|
import { z } from "zod";
|
2026-04-24 16:52:40 -05:00
|
|
|
import { useCreateWebhook, useDeleteWebhook, useTestWebhook, useWebhooks } from "@/api/queries";
|
feat: wire all remaining API endpoints
- src/api/keys.ts: QK singleton for all 20+ query key patterns
- src/api/queries.ts: rewritten with QK + full mutation coverage:
deleteWorkspace, updateWorkspace, scheduleDream,
updatePeer, setPeerCard, searchPeer,
deleteSession, updateSession, cloneSession, searchSession,
createMessages, updateMessage,
useSessionPeers, addPeersToSession, setSessionPeers,
removePeersFromSession, setPeerConfig,
createConclusion, deleteConclusion,
useWebhooks, createWebhook, deleteWebhook, testWebhook,
createKey
Shared primitives (just-in-time):
- ConfirmDialog: animated modal with keyboard/click-out dismiss
- FormModal: reusable modal shell
- InlineEditor: click-to-edit with commit/cancel
New surfaces:
- WorkspaceDetail: delete + schedule dream buttons
- ScheduleDreamModal: Zod-validated observer/session form
- WebhookManager: full CRUD + test emit (new /webhooks route)
- SessionDetail: delete, clone, session search, peer membership tab
- PeerDetail: editable peer card, semantic search tab
- ConclusionBrowser: create conclusion modal (Zod), per-row delete
2026-04-24 11:25:19 -05:00
|
|
|
import { ConfirmDialog } from "@/components/shared/ConfirmDialog";
|
2026-04-24 16:52:40 -05:00
|
|
|
import { ErrorAlert } from "@/components/shared/ErrorAlert";
|
|
|
|
|
import { PageLoader } from "@/components/shared/LoadingSpinner";
|
2026-04-24 13:56:13 -05:00
|
|
|
import { Button } from "@/components/ui/button";
|
|
|
|
|
import { Input } from "@/components/ui/input";
|
2026-04-24 16:52:40 -05:00
|
|
|
import { Body, Muted, PageTitle, SectionHeading } from "@/components/ui/typography";
|
2026-04-27 14:27:37 -05:00
|
|
|
import { useDemo } from "@/hooks/useDemo";
|
2026-04-24 13:56:13 -05:00
|
|
|
import { COLOR } from "@/lib/constants";
|
feat: wire all remaining API endpoints
- src/api/keys.ts: QK singleton for all 20+ query key patterns
- src/api/queries.ts: rewritten with QK + full mutation coverage:
deleteWorkspace, updateWorkspace, scheduleDream,
updatePeer, setPeerCard, searchPeer,
deleteSession, updateSession, cloneSession, searchSession,
createMessages, updateMessage,
useSessionPeers, addPeersToSession, setSessionPeers,
removePeersFromSession, setPeerConfig,
createConclusion, deleteConclusion,
useWebhooks, createWebhook, deleteWebhook, testWebhook,
createKey
Shared primitives (just-in-time):
- ConfirmDialog: animated modal with keyboard/click-out dismiss
- FormModal: reusable modal shell
- InlineEditor: click-to-edit with commit/cancel
New surfaces:
- WorkspaceDetail: delete + schedule dream buttons
- ScheduleDreamModal: Zod-validated observer/session form
- WebhookManager: full CRUD + test emit (new /webhooks route)
- SessionDetail: delete, clone, session search, peer membership tab
- PeerDetail: editable peer card, semantic search tab
- ConclusionBrowser: create conclusion modal (Zod), per-row delete
2026-04-24 11:25:19 -05:00
|
|
|
|
2026-04-27 11:20:47 -05:00
|
|
|
const urlSchema = z.string().url({ message: "Must be a valid URL" });
|
feat: wire all remaining API endpoints
- src/api/keys.ts: QK singleton for all 20+ query key patterns
- src/api/queries.ts: rewritten with QK + full mutation coverage:
deleteWorkspace, updateWorkspace, scheduleDream,
updatePeer, setPeerCard, searchPeer,
deleteSession, updateSession, cloneSession, searchSession,
createMessages, updateMessage,
useSessionPeers, addPeersToSession, setSessionPeers,
removePeersFromSession, setPeerConfig,
createConclusion, deleteConclusion,
useWebhooks, createWebhook, deleteWebhook, testWebhook,
createKey
Shared primitives (just-in-time):
- ConfirmDialog: animated modal with keyboard/click-out dismiss
- FormModal: reusable modal shell
- InlineEditor: click-to-edit with commit/cancel
New surfaces:
- WorkspaceDetail: delete + schedule dream buttons
- ScheduleDreamModal: Zod-validated observer/session form
- WebhookManager: full CRUD + test emit (new /webhooks route)
- SessionDetail: delete, clone, session search, peer membership tab
- PeerDetail: editable peer card, semantic search tab
- ConclusionBrowser: create conclusion modal (Zod), per-row delete
2026-04-24 11:25:19 -05:00
|
|
|
|
|
|
|
|
interface Props {
|
|
|
|
|
workspaceId: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function WebhookManager({ workspaceId }: Props) {
|
2026-04-27 14:27:37 -05:00
|
|
|
const { mask } = useDemo();
|
feat: wire all remaining API endpoints
- src/api/keys.ts: QK singleton for all 20+ query key patterns
- src/api/queries.ts: rewritten with QK + full mutation coverage:
deleteWorkspace, updateWorkspace, scheduleDream,
updatePeer, setPeerCard, searchPeer,
deleteSession, updateSession, cloneSession, searchSession,
createMessages, updateMessage,
useSessionPeers, addPeersToSession, setSessionPeers,
removePeersFromSession, setPeerConfig,
createConclusion, deleteConclusion,
useWebhooks, createWebhook, deleteWebhook, testWebhook,
createKey
Shared primitives (just-in-time):
- ConfirmDialog: animated modal with keyboard/click-out dismiss
- FormModal: reusable modal shell
- InlineEditor: click-to-edit with commit/cancel
New surfaces:
- WorkspaceDetail: delete + schedule dream buttons
- ScheduleDreamModal: Zod-validated observer/session form
- WebhookManager: full CRUD + test emit (new /webhooks route)
- SessionDetail: delete, clone, session search, peer membership tab
- PeerDetail: editable peer card, semantic search tab
- ConclusionBrowser: create conclusion modal (Zod), per-row delete
2026-04-24 11:25:19 -05:00
|
|
|
const { data: webhooks, isLoading, error } = useWebhooks(workspaceId);
|
|
|
|
|
const createWebhook = useCreateWebhook(workspaceId);
|
|
|
|
|
const deleteWebhook = useDeleteWebhook(workspaceId);
|
|
|
|
|
const testWebhook = useTestWebhook(workspaceId);
|
|
|
|
|
|
|
|
|
|
const [url, setUrl] = useState("");
|
|
|
|
|
const [urlError, setUrlError] = useState("");
|
|
|
|
|
const [deleteTarget, setDeleteTarget] = useState<string | null>(null);
|
|
|
|
|
const [testResult, setTestResult] = useState<string | null>(null);
|
|
|
|
|
|
|
|
|
|
const handleCreate = async (e: React.SyntheticEvent<HTMLFormElement>) => {
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
const result = urlSchema.safeParse(url);
|
|
|
|
|
if (!result.success) {
|
2026-04-27 11:20:47 -05:00
|
|
|
setUrlError(result.error.issues[0].message);
|
feat: wire all remaining API endpoints
- src/api/keys.ts: QK singleton for all 20+ query key patterns
- src/api/queries.ts: rewritten with QK + full mutation coverage:
deleteWorkspace, updateWorkspace, scheduleDream,
updatePeer, setPeerCard, searchPeer,
deleteSession, updateSession, cloneSession, searchSession,
createMessages, updateMessage,
useSessionPeers, addPeersToSession, setSessionPeers,
removePeersFromSession, setPeerConfig,
createConclusion, deleteConclusion,
useWebhooks, createWebhook, deleteWebhook, testWebhook,
createKey
Shared primitives (just-in-time):
- ConfirmDialog: animated modal with keyboard/click-out dismiss
- FormModal: reusable modal shell
- InlineEditor: click-to-edit with commit/cancel
New surfaces:
- WorkspaceDetail: delete + schedule dream buttons
- ScheduleDreamModal: Zod-validated observer/session form
- WebhookManager: full CRUD + test emit (new /webhooks route)
- SessionDetail: delete, clone, session search, peer membership tab
- PeerDetail: editable peer card, semantic search tab
- ConclusionBrowser: create conclusion modal (Zod), per-row delete
2026-04-24 11:25:19 -05:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
await createWebhook.mutateAsync(url);
|
|
|
|
|
setUrl("");
|
|
|
|
|
setUrlError("");
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const handleTest = async () => {
|
|
|
|
|
const data = await testWebhook.mutateAsync();
|
|
|
|
|
setTestResult(JSON.stringify(data, null, 2));
|
|
|
|
|
setTimeout(() => setTestResult(null), 5000);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const list = Array.isArray(webhooks) ? webhooks : [];
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div className="page-container">
|
|
|
|
|
<motion.div initial={{ opacity: 0, y: -8 }} animate={{ opacity: 1, y: 0 }}>
|
|
|
|
|
<Link
|
|
|
|
|
to="/workspaces/$workspaceId"
|
|
|
|
|
params={{ workspaceId } as never}
|
|
|
|
|
className="inline-flex items-center gap-1.5 text-xs mb-4 transition-colors"
|
|
|
|
|
style={{ color: "var(--text-3)" }}
|
|
|
|
|
>
|
|
|
|
|
<ArrowLeft className="w-3 h-3" strokeWidth={1.5} />
|
2026-04-27 14:27:37 -05:00
|
|
|
{mask(workspaceId)}
|
feat: wire all remaining API endpoints
- src/api/keys.ts: QK singleton for all 20+ query key patterns
- src/api/queries.ts: rewritten with QK + full mutation coverage:
deleteWorkspace, updateWorkspace, scheduleDream,
updatePeer, setPeerCard, searchPeer,
deleteSession, updateSession, cloneSession, searchSession,
createMessages, updateMessage,
useSessionPeers, addPeersToSession, setSessionPeers,
removePeersFromSession, setPeerConfig,
createConclusion, deleteConclusion,
useWebhooks, createWebhook, deleteWebhook, testWebhook,
createKey
Shared primitives (just-in-time):
- ConfirmDialog: animated modal with keyboard/click-out dismiss
- FormModal: reusable modal shell
- InlineEditor: click-to-edit with commit/cancel
New surfaces:
- WorkspaceDetail: delete + schedule dream buttons
- ScheduleDreamModal: Zod-validated observer/session form
- WebhookManager: full CRUD + test emit (new /webhooks route)
- SessionDetail: delete, clone, session search, peer membership tab
- PeerDetail: editable peer card, semantic search tab
- ConclusionBrowser: create conclusion modal (Zod), per-row delete
2026-04-24 11:25:19 -05:00
|
|
|
</Link>
|
|
|
|
|
<div className="flex items-center justify-between mb-1">
|
|
|
|
|
<div className="flex items-center gap-2">
|
|
|
|
|
<Webhook className="w-5 h-5" style={{ color: "var(--accent)" }} strokeWidth={1.5} />
|
2026-04-24 13:56:13 -05:00
|
|
|
<PageTitle>Webhooks</PageTitle>
|
feat: wire all remaining API endpoints
- src/api/keys.ts: QK singleton for all 20+ query key patterns
- src/api/queries.ts: rewritten with QK + full mutation coverage:
deleteWorkspace, updateWorkspace, scheduleDream,
updatePeer, setPeerCard, searchPeer,
deleteSession, updateSession, cloneSession, searchSession,
createMessages, updateMessage,
useSessionPeers, addPeersToSession, setSessionPeers,
removePeersFromSession, setPeerConfig,
createConclusion, deleteConclusion,
useWebhooks, createWebhook, deleteWebhook, testWebhook,
createKey
Shared primitives (just-in-time):
- ConfirmDialog: animated modal with keyboard/click-out dismiss
- FormModal: reusable modal shell
- InlineEditor: click-to-edit with commit/cancel
New surfaces:
- WorkspaceDetail: delete + schedule dream buttons
- ScheduleDreamModal: Zod-validated observer/session form
- WebhookManager: full CRUD + test emit (new /webhooks route)
- SessionDetail: delete, clone, session search, peer membership tab
- PeerDetail: editable peer card, semantic search tab
- ConclusionBrowser: create conclusion modal (Zod), per-row delete
2026-04-24 11:25:19 -05:00
|
|
|
</div>
|
2026-04-24 16:52:40 -05:00
|
|
|
<Button variant="accent" size="sm" onClick={handleTest} disabled={testWebhook.isPending}>
|
feat: wire all remaining API endpoints
- src/api/keys.ts: QK singleton for all 20+ query key patterns
- src/api/queries.ts: rewritten with QK + full mutation coverage:
deleteWorkspace, updateWorkspace, scheduleDream,
updatePeer, setPeerCard, searchPeer,
deleteSession, updateSession, cloneSession, searchSession,
createMessages, updateMessage,
useSessionPeers, addPeersToSession, setSessionPeers,
removePeersFromSession, setPeerConfig,
createConclusion, deleteConclusion,
useWebhooks, createWebhook, deleteWebhook, testWebhook,
createKey
Shared primitives (just-in-time):
- ConfirmDialog: animated modal with keyboard/click-out dismiss
- FormModal: reusable modal shell
- InlineEditor: click-to-edit with commit/cancel
New surfaces:
- WorkspaceDetail: delete + schedule dream buttons
- ScheduleDreamModal: Zod-validated observer/session form
- WebhookManager: full CRUD + test emit (new /webhooks route)
- SessionDetail: delete, clone, session search, peer membership tab
- PeerDetail: editable peer card, semantic search tab
- ConclusionBrowser: create conclusion modal (Zod), per-row delete
2026-04-24 11:25:19 -05:00
|
|
|
<Zap className="w-3.5 h-3.5" strokeWidth={2} />
|
|
|
|
|
{testWebhook.isPending ? "Firing..." : "Test emit"}
|
2026-04-24 13:56:13 -05:00
|
|
|
</Button>
|
feat: wire all remaining API endpoints
- src/api/keys.ts: QK singleton for all 20+ query key patterns
- src/api/queries.ts: rewritten with QK + full mutation coverage:
deleteWorkspace, updateWorkspace, scheduleDream,
updatePeer, setPeerCard, searchPeer,
deleteSession, updateSession, cloneSession, searchSession,
createMessages, updateMessage,
useSessionPeers, addPeersToSession, setSessionPeers,
removePeersFromSession, setPeerConfig,
createConclusion, deleteConclusion,
useWebhooks, createWebhook, deleteWebhook, testWebhook,
createKey
Shared primitives (just-in-time):
- ConfirmDialog: animated modal with keyboard/click-out dismiss
- FormModal: reusable modal shell
- InlineEditor: click-to-edit with commit/cancel
New surfaces:
- WorkspaceDetail: delete + schedule dream buttons
- ScheduleDreamModal: Zod-validated observer/session form
- WebhookManager: full CRUD + test emit (new /webhooks route)
- SessionDetail: delete, clone, session search, peer membership tab
- PeerDetail: editable peer card, semantic search tab
- ConclusionBrowser: create conclusion modal (Zod), per-row delete
2026-04-24 11:25:19 -05:00
|
|
|
</div>
|
2026-04-24 13:56:13 -05:00
|
|
|
<Body className="leading-none">Event webhook endpoints for this workspace</Body>
|
feat: wire all remaining API endpoints
- src/api/keys.ts: QK singleton for all 20+ query key patterns
- src/api/queries.ts: rewritten with QK + full mutation coverage:
deleteWorkspace, updateWorkspace, scheduleDream,
updatePeer, setPeerCard, searchPeer,
deleteSession, updateSession, cloneSession, searchSession,
createMessages, updateMessage,
useSessionPeers, addPeersToSession, setSessionPeers,
removePeersFromSession, setPeerConfig,
createConclusion, deleteConclusion,
useWebhooks, createWebhook, deleteWebhook, testWebhook,
createKey
Shared primitives (just-in-time):
- ConfirmDialog: animated modal with keyboard/click-out dismiss
- FormModal: reusable modal shell
- InlineEditor: click-to-edit with commit/cancel
New surfaces:
- WorkspaceDetail: delete + schedule dream buttons
- ScheduleDreamModal: Zod-validated observer/session form
- WebhookManager: full CRUD + test emit (new /webhooks route)
- SessionDetail: delete, clone, session search, peer membership tab
- PeerDetail: editable peer card, semantic search tab
- ConclusionBrowser: create conclusion modal (Zod), per-row delete
2026-04-24 11:25:19 -05:00
|
|
|
</motion.div>
|
|
|
|
|
|
|
|
|
|
<div className="mt-8 space-y-4">
|
|
|
|
|
<ErrorAlert error={error instanceof Error ? error : null} />
|
|
|
|
|
{isLoading && <PageLoader />}
|
|
|
|
|
|
|
|
|
|
{/* Add webhook form */}
|
|
|
|
|
<motion.div
|
|
|
|
|
initial={{ opacity: 0, y: 8 }}
|
|
|
|
|
animate={{ opacity: 1, y: 0 }}
|
|
|
|
|
className="rounded-xl p-5 theme-card"
|
|
|
|
|
>
|
2026-04-24 13:56:13 -05:00
|
|
|
<SectionHeading>
|
feat: wire all remaining API endpoints
- src/api/keys.ts: QK singleton for all 20+ query key patterns
- src/api/queries.ts: rewritten with QK + full mutation coverage:
deleteWorkspace, updateWorkspace, scheduleDream,
updatePeer, setPeerCard, searchPeer,
deleteSession, updateSession, cloneSession, searchSession,
createMessages, updateMessage,
useSessionPeers, addPeersToSession, setSessionPeers,
removePeersFromSession, setPeerConfig,
createConclusion, deleteConclusion,
useWebhooks, createWebhook, deleteWebhook, testWebhook,
createKey
Shared primitives (just-in-time):
- ConfirmDialog: animated modal with keyboard/click-out dismiss
- FormModal: reusable modal shell
- InlineEditor: click-to-edit with commit/cancel
New surfaces:
- WorkspaceDetail: delete + schedule dream buttons
- ScheduleDreamModal: Zod-validated observer/session form
- WebhookManager: full CRUD + test emit (new /webhooks route)
- SessionDetail: delete, clone, session search, peer membership tab
- PeerDetail: editable peer card, semantic search tab
- ConclusionBrowser: create conclusion modal (Zod), per-row delete
2026-04-24 11:25:19 -05:00
|
|
|
<Plus className="w-3.5 h-3.5 inline mr-1.5" strokeWidth={2} />
|
|
|
|
|
Add endpoint
|
2026-04-24 13:56:13 -05:00
|
|
|
</SectionHeading>
|
feat: wire all remaining API endpoints
- src/api/keys.ts: QK singleton for all 20+ query key patterns
- src/api/queries.ts: rewritten with QK + full mutation coverage:
deleteWorkspace, updateWorkspace, scheduleDream,
updatePeer, setPeerCard, searchPeer,
deleteSession, updateSession, cloneSession, searchSession,
createMessages, updateMessage,
useSessionPeers, addPeersToSession, setSessionPeers,
removePeersFromSession, setPeerConfig,
createConclusion, deleteConclusion,
useWebhooks, createWebhook, deleteWebhook, testWebhook,
createKey
Shared primitives (just-in-time):
- ConfirmDialog: animated modal with keyboard/click-out dismiss
- FormModal: reusable modal shell
- InlineEditor: click-to-edit with commit/cancel
New surfaces:
- WorkspaceDetail: delete + schedule dream buttons
- ScheduleDreamModal: Zod-validated observer/session form
- WebhookManager: full CRUD + test emit (new /webhooks route)
- SessionDetail: delete, clone, session search, peer membership tab
- PeerDetail: editable peer card, semantic search tab
- ConclusionBrowser: create conclusion modal (Zod), per-row delete
2026-04-24 11:25:19 -05:00
|
|
|
<form onSubmit={handleCreate} className="flex gap-2">
|
|
|
|
|
<div className="flex-1">
|
2026-04-24 13:56:13 -05:00
|
|
|
<Input
|
feat: wire all remaining API endpoints
- src/api/keys.ts: QK singleton for all 20+ query key patterns
- src/api/queries.ts: rewritten with QK + full mutation coverage:
deleteWorkspace, updateWorkspace, scheduleDream,
updatePeer, setPeerCard, searchPeer,
deleteSession, updateSession, cloneSession, searchSession,
createMessages, updateMessage,
useSessionPeers, addPeersToSession, setSessionPeers,
removePeersFromSession, setPeerConfig,
createConclusion, deleteConclusion,
useWebhooks, createWebhook, deleteWebhook, testWebhook,
createKey
Shared primitives (just-in-time):
- ConfirmDialog: animated modal with keyboard/click-out dismiss
- FormModal: reusable modal shell
- InlineEditor: click-to-edit with commit/cancel
New surfaces:
- WorkspaceDetail: delete + schedule dream buttons
- ScheduleDreamModal: Zod-validated observer/session form
- WebhookManager: full CRUD + test emit (new /webhooks route)
- SessionDetail: delete, clone, session search, peer membership tab
- PeerDetail: editable peer card, semantic search tab
- ConclusionBrowser: create conclusion modal (Zod), per-row delete
2026-04-24 11:25:19 -05:00
|
|
|
value={url}
|
2026-04-24 16:52:40 -05:00
|
|
|
onChange={(e) => {
|
|
|
|
|
setUrl(e.target.value);
|
|
|
|
|
setUrlError("");
|
|
|
|
|
}}
|
feat: wire all remaining API endpoints
- src/api/keys.ts: QK singleton for all 20+ query key patterns
- src/api/queries.ts: rewritten with QK + full mutation coverage:
deleteWorkspace, updateWorkspace, scheduleDream,
updatePeer, setPeerCard, searchPeer,
deleteSession, updateSession, cloneSession, searchSession,
createMessages, updateMessage,
useSessionPeers, addPeersToSession, setSessionPeers,
removePeersFromSession, setPeerConfig,
createConclusion, deleteConclusion,
useWebhooks, createWebhook, deleteWebhook, testWebhook,
createKey
Shared primitives (just-in-time):
- ConfirmDialog: animated modal with keyboard/click-out dismiss
- FormModal: reusable modal shell
- InlineEditor: click-to-edit with commit/cancel
New surfaces:
- WorkspaceDetail: delete + schedule dream buttons
- ScheduleDreamModal: Zod-validated observer/session form
- WebhookManager: full CRUD + test emit (new /webhooks route)
- SessionDetail: delete, clone, session search, peer membership tab
- PeerDetail: editable peer card, semantic search tab
- ConclusionBrowser: create conclusion modal (Zod), per-row delete
2026-04-24 11:25:19 -05:00
|
|
|
placeholder="https://your-server.com/webhook"
|
|
|
|
|
/>
|
|
|
|
|
{urlError && (
|
2026-04-24 16:52:40 -05:00
|
|
|
<p className="text-xs mt-1" style={{ color: COLOR.destructive }}>
|
|
|
|
|
{urlError}
|
|
|
|
|
</p>
|
feat: wire all remaining API endpoints
- src/api/keys.ts: QK singleton for all 20+ query key patterns
- src/api/queries.ts: rewritten with QK + full mutation coverage:
deleteWorkspace, updateWorkspace, scheduleDream,
updatePeer, setPeerCard, searchPeer,
deleteSession, updateSession, cloneSession, searchSession,
createMessages, updateMessage,
useSessionPeers, addPeersToSession, setSessionPeers,
removePeersFromSession, setPeerConfig,
createConclusion, deleteConclusion,
useWebhooks, createWebhook, deleteWebhook, testWebhook,
createKey
Shared primitives (just-in-time):
- ConfirmDialog: animated modal with keyboard/click-out dismiss
- FormModal: reusable modal shell
- InlineEditor: click-to-edit with commit/cancel
New surfaces:
- WorkspaceDetail: delete + schedule dream buttons
- ScheduleDreamModal: Zod-validated observer/session form
- WebhookManager: full CRUD + test emit (new /webhooks route)
- SessionDetail: delete, clone, session search, peer membership tab
- PeerDetail: editable peer card, semantic search tab
- ConclusionBrowser: create conclusion modal (Zod), per-row delete
2026-04-24 11:25:19 -05:00
|
|
|
)}
|
|
|
|
|
</div>
|
2026-04-24 16:52:40 -05:00
|
|
|
<Button type="submit" variant="accent" disabled={createWebhook.isPending}>
|
feat: wire all remaining API endpoints
- src/api/keys.ts: QK singleton for all 20+ query key patterns
- src/api/queries.ts: rewritten with QK + full mutation coverage:
deleteWorkspace, updateWorkspace, scheduleDream,
updatePeer, setPeerCard, searchPeer,
deleteSession, updateSession, cloneSession, searchSession,
createMessages, updateMessage,
useSessionPeers, addPeersToSession, setSessionPeers,
removePeersFromSession, setPeerConfig,
createConclusion, deleteConclusion,
useWebhooks, createWebhook, deleteWebhook, testWebhook,
createKey
Shared primitives (just-in-time):
- ConfirmDialog: animated modal with keyboard/click-out dismiss
- FormModal: reusable modal shell
- InlineEditor: click-to-edit with commit/cancel
New surfaces:
- WorkspaceDetail: delete + schedule dream buttons
- ScheduleDreamModal: Zod-validated observer/session form
- WebhookManager: full CRUD + test emit (new /webhooks route)
- SessionDetail: delete, clone, session search, peer membership tab
- PeerDetail: editable peer card, semantic search tab
- ConclusionBrowser: create conclusion modal (Zod), per-row delete
2026-04-24 11:25:19 -05:00
|
|
|
{createWebhook.isPending ? "Adding..." : "Add"}
|
2026-04-24 13:56:13 -05:00
|
|
|
</Button>
|
feat: wire all remaining API endpoints
- src/api/keys.ts: QK singleton for all 20+ query key patterns
- src/api/queries.ts: rewritten with QK + full mutation coverage:
deleteWorkspace, updateWorkspace, scheduleDream,
updatePeer, setPeerCard, searchPeer,
deleteSession, updateSession, cloneSession, searchSession,
createMessages, updateMessage,
useSessionPeers, addPeersToSession, setSessionPeers,
removePeersFromSession, setPeerConfig,
createConclusion, deleteConclusion,
useWebhooks, createWebhook, deleteWebhook, testWebhook,
createKey
Shared primitives (just-in-time):
- ConfirmDialog: animated modal with keyboard/click-out dismiss
- FormModal: reusable modal shell
- InlineEditor: click-to-edit with commit/cancel
New surfaces:
- WorkspaceDetail: delete + schedule dream buttons
- ScheduleDreamModal: Zod-validated observer/session form
- WebhookManager: full CRUD + test emit (new /webhooks route)
- SessionDetail: delete, clone, session search, peer membership tab
- PeerDetail: editable peer card, semantic search tab
- ConclusionBrowser: create conclusion modal (Zod), per-row delete
2026-04-24 11:25:19 -05:00
|
|
|
</form>
|
|
|
|
|
</motion.div>
|
|
|
|
|
|
|
|
|
|
{/* Test result */}
|
|
|
|
|
<AnimatePresence>
|
|
|
|
|
{testResult && (
|
|
|
|
|
<motion.div
|
|
|
|
|
initial={{ opacity: 0, y: -4 }}
|
|
|
|
|
animate={{ opacity: 1, y: 0 }}
|
|
|
|
|
exit={{ opacity: 0 }}
|
|
|
|
|
className="rounded-xl p-4 text-xs font-mono overflow-auto"
|
|
|
|
|
style={{
|
2026-04-24 13:56:13 -05:00
|
|
|
background: COLOR.successDim,
|
|
|
|
|
border: `1px solid ${COLOR.successBorder}`,
|
|
|
|
|
color: COLOR.success,
|
feat: wire all remaining API endpoints
- src/api/keys.ts: QK singleton for all 20+ query key patterns
- src/api/queries.ts: rewritten with QK + full mutation coverage:
deleteWorkspace, updateWorkspace, scheduleDream,
updatePeer, setPeerCard, searchPeer,
deleteSession, updateSession, cloneSession, searchSession,
createMessages, updateMessage,
useSessionPeers, addPeersToSession, setSessionPeers,
removePeersFromSession, setPeerConfig,
createConclusion, deleteConclusion,
useWebhooks, createWebhook, deleteWebhook, testWebhook,
createKey
Shared primitives (just-in-time):
- ConfirmDialog: animated modal with keyboard/click-out dismiss
- FormModal: reusable modal shell
- InlineEditor: click-to-edit with commit/cancel
New surfaces:
- WorkspaceDetail: delete + schedule dream buttons
- ScheduleDreamModal: Zod-validated observer/session form
- WebhookManager: full CRUD + test emit (new /webhooks route)
- SessionDetail: delete, clone, session search, peer membership tab
- PeerDetail: editable peer card, semantic search tab
- ConclusionBrowser: create conclusion modal (Zod), per-row delete
2026-04-24 11:25:19 -05:00
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
{testResult}
|
|
|
|
|
</motion.div>
|
|
|
|
|
)}
|
|
|
|
|
</AnimatePresence>
|
|
|
|
|
|
|
|
|
|
{/* Webhook list */}
|
|
|
|
|
{!isLoading && (
|
|
|
|
|
<motion.div
|
|
|
|
|
initial={{ opacity: 0, y: 8 }}
|
|
|
|
|
animate={{ opacity: 1, y: 0 }}
|
|
|
|
|
transition={{ delay: 0.1 }}
|
|
|
|
|
className="rounded-xl theme-card overflow-hidden"
|
|
|
|
|
>
|
|
|
|
|
{list.length === 0 ? (
|
|
|
|
|
<div className="p-8 text-center">
|
|
|
|
|
<Webhook
|
|
|
|
|
className="w-8 h-8 mx-auto mb-2 opacity-20"
|
|
|
|
|
style={{ color: "var(--text-3)" }}
|
|
|
|
|
strokeWidth={1.5}
|
|
|
|
|
/>
|
2026-04-24 13:56:13 -05:00
|
|
|
<Muted>No webhook endpoints yet.</Muted>
|
feat: wire all remaining API endpoints
- src/api/keys.ts: QK singleton for all 20+ query key patterns
- src/api/queries.ts: rewritten with QK + full mutation coverage:
deleteWorkspace, updateWorkspace, scheduleDream,
updatePeer, setPeerCard, searchPeer,
deleteSession, updateSession, cloneSession, searchSession,
createMessages, updateMessage,
useSessionPeers, addPeersToSession, setSessionPeers,
removePeersFromSession, setPeerConfig,
createConclusion, deleteConclusion,
useWebhooks, createWebhook, deleteWebhook, testWebhook,
createKey
Shared primitives (just-in-time):
- ConfirmDialog: animated modal with keyboard/click-out dismiss
- FormModal: reusable modal shell
- InlineEditor: click-to-edit with commit/cancel
New surfaces:
- WorkspaceDetail: delete + schedule dream buttons
- ScheduleDreamModal: Zod-validated observer/session form
- WebhookManager: full CRUD + test emit (new /webhooks route)
- SessionDetail: delete, clone, session search, peer membership tab
- PeerDetail: editable peer card, semantic search tab
- ConclusionBrowser: create conclusion modal (Zod), per-row delete
2026-04-24 11:25:19 -05:00
|
|
|
</div>
|
|
|
|
|
) : (
|
|
|
|
|
<div className="divide-y" style={{ borderColor: "var(--border)" }}>
|
|
|
|
|
{list.map((wh, i) => (
|
|
|
|
|
<motion.div
|
|
|
|
|
key={(wh as { id: string }).id}
|
|
|
|
|
initial={{ opacity: 0 }}
|
|
|
|
|
animate={{ opacity: 1 }}
|
|
|
|
|
transition={{ delay: i * 0.04 }}
|
|
|
|
|
className="flex items-center justify-between px-5 py-3 gap-4"
|
|
|
|
|
>
|
|
|
|
|
<div className="min-w-0 flex-1">
|
|
|
|
|
<div className="flex items-center gap-1.5">
|
|
|
|
|
<span
|
|
|
|
|
className="text-xs font-mono truncate"
|
|
|
|
|
style={{ color: "var(--accent-text)" }}
|
|
|
|
|
>
|
2026-04-27 14:27:37 -05:00
|
|
|
{mask((wh as { url: string }).url)}
|
feat: wire all remaining API endpoints
- src/api/keys.ts: QK singleton for all 20+ query key patterns
- src/api/queries.ts: rewritten with QK + full mutation coverage:
deleteWorkspace, updateWorkspace, scheduleDream,
updatePeer, setPeerCard, searchPeer,
deleteSession, updateSession, cloneSession, searchSession,
createMessages, updateMessage,
useSessionPeers, addPeersToSession, setSessionPeers,
removePeersFromSession, setPeerConfig,
createConclusion, deleteConclusion,
useWebhooks, createWebhook, deleteWebhook, testWebhook,
createKey
Shared primitives (just-in-time):
- ConfirmDialog: animated modal with keyboard/click-out dismiss
- FormModal: reusable modal shell
- InlineEditor: click-to-edit with commit/cancel
New surfaces:
- WorkspaceDetail: delete + schedule dream buttons
- ScheduleDreamModal: Zod-validated observer/session form
- WebhookManager: full CRUD + test emit (new /webhooks route)
- SessionDetail: delete, clone, session search, peer membership tab
- PeerDetail: editable peer card, semantic search tab
- ConclusionBrowser: create conclusion modal (Zod), per-row delete
2026-04-24 11:25:19 -05:00
|
|
|
</span>
|
2026-04-24 16:52:40 -05:00
|
|
|
<button
|
|
|
|
|
type="button"
|
|
|
|
|
onClick={() => void open((wh as { url: string }).url)}
|
feat: wire all remaining API endpoints
- src/api/keys.ts: QK singleton for all 20+ query key patterns
- src/api/queries.ts: rewritten with QK + full mutation coverage:
deleteWorkspace, updateWorkspace, scheduleDream,
updatePeer, setPeerCard, searchPeer,
deleteSession, updateSession, cloneSession, searchSession,
createMessages, updateMessage,
useSessionPeers, addPeersToSession, setSessionPeers,
removePeersFromSession, setPeerConfig,
createConclusion, deleteConclusion,
useWebhooks, createWebhook, deleteWebhook, testWebhook,
createKey
Shared primitives (just-in-time):
- ConfirmDialog: animated modal with keyboard/click-out dismiss
- FormModal: reusable modal shell
- InlineEditor: click-to-edit with commit/cancel
New surfaces:
- WorkspaceDetail: delete + schedule dream buttons
- ScheduleDreamModal: Zod-validated observer/session form
- WebhookManager: full CRUD + test emit (new /webhooks route)
- SessionDetail: delete, clone, session search, peer membership tab
- PeerDetail: editable peer card, semantic search tab
- ConclusionBrowser: create conclusion modal (Zod), per-row delete
2026-04-24 11:25:19 -05:00
|
|
|
className="flex-shrink-0"
|
2026-04-24 16:52:40 -05:00
|
|
|
style={{
|
|
|
|
|
color: "var(--text-4)",
|
|
|
|
|
background: "none",
|
|
|
|
|
border: "none",
|
|
|
|
|
cursor: "pointer",
|
|
|
|
|
padding: 0,
|
|
|
|
|
}}
|
feat: wire all remaining API endpoints
- src/api/keys.ts: QK singleton for all 20+ query key patterns
- src/api/queries.ts: rewritten with QK + full mutation coverage:
deleteWorkspace, updateWorkspace, scheduleDream,
updatePeer, setPeerCard, searchPeer,
deleteSession, updateSession, cloneSession, searchSession,
createMessages, updateMessage,
useSessionPeers, addPeersToSession, setSessionPeers,
removePeersFromSession, setPeerConfig,
createConclusion, deleteConclusion,
useWebhooks, createWebhook, deleteWebhook, testWebhook,
createKey
Shared primitives (just-in-time):
- ConfirmDialog: animated modal with keyboard/click-out dismiss
- FormModal: reusable modal shell
- InlineEditor: click-to-edit with commit/cancel
New surfaces:
- WorkspaceDetail: delete + schedule dream buttons
- ScheduleDreamModal: Zod-validated observer/session form
- WebhookManager: full CRUD + test emit (new /webhooks route)
- SessionDetail: delete, clone, session search, peer membership tab
- PeerDetail: editable peer card, semantic search tab
- ConclusionBrowser: create conclusion modal (Zod), per-row delete
2026-04-24 11:25:19 -05:00
|
|
|
>
|
|
|
|
|
<ExternalLink className="w-3 h-3" strokeWidth={1.5} />
|
2026-04-24 16:52:40 -05:00
|
|
|
</button>
|
feat: wire all remaining API endpoints
- src/api/keys.ts: QK singleton for all 20+ query key patterns
- src/api/queries.ts: rewritten with QK + full mutation coverage:
deleteWorkspace, updateWorkspace, scheduleDream,
updatePeer, setPeerCard, searchPeer,
deleteSession, updateSession, cloneSession, searchSession,
createMessages, updateMessage,
useSessionPeers, addPeersToSession, setSessionPeers,
removePeersFromSession, setPeerConfig,
createConclusion, deleteConclusion,
useWebhooks, createWebhook, deleteWebhook, testWebhook,
createKey
Shared primitives (just-in-time):
- ConfirmDialog: animated modal with keyboard/click-out dismiss
- FormModal: reusable modal shell
- InlineEditor: click-to-edit with commit/cancel
New surfaces:
- WorkspaceDetail: delete + schedule dream buttons
- ScheduleDreamModal: Zod-validated observer/session form
- WebhookManager: full CRUD + test emit (new /webhooks route)
- SessionDetail: delete, clone, session search, peer membership tab
- PeerDetail: editable peer card, semantic search tab
- ConclusionBrowser: create conclusion modal (Zod), per-row delete
2026-04-24 11:25:19 -05:00
|
|
|
</div>
|
2026-04-24 16:52:40 -05:00
|
|
|
<span className="text-xs font-mono" style={{ color: "var(--text-4)" }}>
|
2026-04-27 14:27:37 -05:00
|
|
|
{mask((wh as { id: string }).id)}
|
feat: wire all remaining API endpoints
- src/api/keys.ts: QK singleton for all 20+ query key patterns
- src/api/queries.ts: rewritten with QK + full mutation coverage:
deleteWorkspace, updateWorkspace, scheduleDream,
updatePeer, setPeerCard, searchPeer,
deleteSession, updateSession, cloneSession, searchSession,
createMessages, updateMessage,
useSessionPeers, addPeersToSession, setSessionPeers,
removePeersFromSession, setPeerConfig,
createConclusion, deleteConclusion,
useWebhooks, createWebhook, deleteWebhook, testWebhook,
createKey
Shared primitives (just-in-time):
- ConfirmDialog: animated modal with keyboard/click-out dismiss
- FormModal: reusable modal shell
- InlineEditor: click-to-edit with commit/cancel
New surfaces:
- WorkspaceDetail: delete + schedule dream buttons
- ScheduleDreamModal: Zod-validated observer/session form
- WebhookManager: full CRUD + test emit (new /webhooks route)
- SessionDetail: delete, clone, session search, peer membership tab
- PeerDetail: editable peer card, semantic search tab
- ConclusionBrowser: create conclusion modal (Zod), per-row delete
2026-04-24 11:25:19 -05:00
|
|
|
</span>
|
|
|
|
|
</div>
|
2026-04-24 13:56:13 -05:00
|
|
|
<Button
|
|
|
|
|
variant="ghost"
|
|
|
|
|
size="icon"
|
feat: wire all remaining API endpoints
- src/api/keys.ts: QK singleton for all 20+ query key patterns
- src/api/queries.ts: rewritten with QK + full mutation coverage:
deleteWorkspace, updateWorkspace, scheduleDream,
updatePeer, setPeerCard, searchPeer,
deleteSession, updateSession, cloneSession, searchSession,
createMessages, updateMessage,
useSessionPeers, addPeersToSession, setSessionPeers,
removePeersFromSession, setPeerConfig,
createConclusion, deleteConclusion,
useWebhooks, createWebhook, deleteWebhook, testWebhook,
createKey
Shared primitives (just-in-time):
- ConfirmDialog: animated modal with keyboard/click-out dismiss
- FormModal: reusable modal shell
- InlineEditor: click-to-edit with commit/cancel
New surfaces:
- WorkspaceDetail: delete + schedule dream buttons
- ScheduleDreamModal: Zod-validated observer/session form
- WebhookManager: full CRUD + test emit (new /webhooks route)
- SessionDetail: delete, clone, session search, peer membership tab
- PeerDetail: editable peer card, semantic search tab
- ConclusionBrowser: create conclusion modal (Zod), per-row delete
2026-04-24 11:25:19 -05:00
|
|
|
onClick={() => setDeleteTarget((wh as { id: string }).id)}
|
2026-04-24 13:56:13 -05:00
|
|
|
aria-label="Delete webhook"
|
feat: wire all remaining API endpoints
- src/api/keys.ts: QK singleton for all 20+ query key patterns
- src/api/queries.ts: rewritten with QK + full mutation coverage:
deleteWorkspace, updateWorkspace, scheduleDream,
updatePeer, setPeerCard, searchPeer,
deleteSession, updateSession, cloneSession, searchSession,
createMessages, updateMessage,
useSessionPeers, addPeersToSession, setSessionPeers,
removePeersFromSession, setPeerConfig,
createConclusion, deleteConclusion,
useWebhooks, createWebhook, deleteWebhook, testWebhook,
createKey
Shared primitives (just-in-time):
- ConfirmDialog: animated modal with keyboard/click-out dismiss
- FormModal: reusable modal shell
- InlineEditor: click-to-edit with commit/cancel
New surfaces:
- WorkspaceDetail: delete + schedule dream buttons
- ScheduleDreamModal: Zod-validated observer/session form
- WebhookManager: full CRUD + test emit (new /webhooks route)
- SessionDetail: delete, clone, session search, peer membership tab
- PeerDetail: editable peer card, semantic search tab
- ConclusionBrowser: create conclusion modal (Zod), per-row delete
2026-04-24 11:25:19 -05:00
|
|
|
>
|
|
|
|
|
<Trash2 className="w-3.5 h-3.5" strokeWidth={1.5} />
|
2026-04-24 13:56:13 -05:00
|
|
|
</Button>
|
feat: wire all remaining API endpoints
- src/api/keys.ts: QK singleton for all 20+ query key patterns
- src/api/queries.ts: rewritten with QK + full mutation coverage:
deleteWorkspace, updateWorkspace, scheduleDream,
updatePeer, setPeerCard, searchPeer,
deleteSession, updateSession, cloneSession, searchSession,
createMessages, updateMessage,
useSessionPeers, addPeersToSession, setSessionPeers,
removePeersFromSession, setPeerConfig,
createConclusion, deleteConclusion,
useWebhooks, createWebhook, deleteWebhook, testWebhook,
createKey
Shared primitives (just-in-time):
- ConfirmDialog: animated modal with keyboard/click-out dismiss
- FormModal: reusable modal shell
- InlineEditor: click-to-edit with commit/cancel
New surfaces:
- WorkspaceDetail: delete + schedule dream buttons
- ScheduleDreamModal: Zod-validated observer/session form
- WebhookManager: full CRUD + test emit (new /webhooks route)
- SessionDetail: delete, clone, session search, peer membership tab
- PeerDetail: editable peer card, semantic search tab
- ConclusionBrowser: create conclusion modal (Zod), per-row delete
2026-04-24 11:25:19 -05:00
|
|
|
</motion.div>
|
|
|
|
|
))}
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
</motion.div>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<ConfirmDialog
|
|
|
|
|
open={Boolean(deleteTarget)}
|
|
|
|
|
title="Delete webhook"
|
|
|
|
|
description="This endpoint will stop receiving events immediately."
|
|
|
|
|
confirmLabel="Delete"
|
|
|
|
|
onConfirm={async () => {
|
|
|
|
|
if (deleteTarget) await deleteWebhook.mutateAsync(deleteTarget);
|
|
|
|
|
setDeleteTarget(null);
|
|
|
|
|
}}
|
|
|
|
|
onCancel={() => setDeleteTarget(null)}
|
|
|
|
|
loading={deleteWebhook.isPending}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|