@wopr-network/platform-ui-core 1.19.3 → 1.19.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wopr-network/platform-ui-core",
3
- "version": "1.19.3",
3
+ "version": "1.19.5",
4
4
  "description": "Brand-agnostic AI agent platform UI — deploy as any brand via env vars",
5
5
  "repository": {
6
6
  "type": "git",
@@ -3,6 +3,7 @@
3
3
  import { motion } from "framer-motion";
4
4
  import { Check } from "lucide-react";
5
5
  import Link from "next/link";
6
+ import { useRouter } from "next/navigation";
6
7
  import { useState } from "react";
7
8
  import { Button } from "@/components/ui/button";
8
9
  import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
@@ -87,6 +88,8 @@ export function CreateInstanceClient() {
87
88
  setSelectedPlugins((prev) => (prev.includes(p) ? prev.filter((x) => x !== p) : [...prev, p]));
88
89
  }
89
90
 
91
+ const router = useRouter();
92
+
90
93
  async function handleSubmit() {
91
94
  if (!name.trim()) return;
92
95
  const validationError = validateName(name);
@@ -96,21 +99,25 @@ export function CreateInstanceClient() {
96
99
  }
97
100
  setSubmitting(true);
98
101
  setSubmitError(null);
99
- try {
100
- const preset = presets.find((p) => p.id === selectedPreset);
101
- await createInstance({
102
- name: name.trim(),
103
- template: preset?.name ?? "Custom",
104
- provider,
105
- channels: selectedChannels,
106
- plugins: selectedPlugins,
107
- });
108
- setCreated(true);
109
- } catch (err) {
110
- setSubmitError(toUserMessage(err, "Failed to create instance"));
111
- } finally {
112
- setSubmitting(false);
113
- }
102
+
103
+ const preset = presets.find((p) => p.id === selectedPreset);
104
+ const payload = {
105
+ name: name.trim(),
106
+ template: preset?.name ?? "Custom",
107
+ provider,
108
+ channels: selectedChannels,
109
+ plugins: selectedPlugins,
110
+ };
111
+
112
+ // Fire-and-forget: redirect immediately, let backend provision in background.
113
+ // The instances page polls for status updates.
114
+ createInstance(payload).catch(() => {
115
+ // Silently handled — instance list will show provisioning/error state
116
+ });
117
+
118
+ setCreated(true);
119
+ // Short delay for the success animation, then redirect to instances
120
+ setTimeout(() => router.push("/instances"), 1500);
114
121
  }
115
122
 
116
123
  if (created) {
package/src/lib/trpc.tsx CHANGED
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
 
3
3
  import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
4
- import { createTRPCClient, httpBatchLink } from "@trpc/client";
4
+ import { createTRPCClient, httpBatchStreamLink } from "@trpc/client";
5
5
  import { createTRPCReact } from "@trpc/react-query";
6
6
  import { useState } from "react";
7
7
  import { PLATFORM_BASE_URL } from "./api-config";
@@ -25,7 +25,7 @@ async function trpcFetchWithAuth(url: RequestInfo | URL, options?: RequestInit)
25
25
  */
26
26
  export const trpcVanilla = createTRPCClient<AppRouter>({
27
27
  links: [
28
- httpBatchLink({
28
+ httpBatchStreamLink({
29
29
  url: `${PLATFORM_BASE_URL}/trpc`,
30
30
  fetch: trpcFetchWithAuth,
31
31
  headers() {
@@ -76,7 +76,7 @@ export function TRPCProvider({
76
76
  const [trpcClient] = useState(() =>
77
77
  trpc.createClient({
78
78
  links: [
79
- httpBatchLink({
79
+ httpBatchStreamLink({
80
80
  url: `${PLATFORM_BASE_URL}/trpc`,
81
81
  fetch: trpcFetchWithAuth,
82
82
  headers() {