@palettelab/sdk 0.1.0

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/dist/index.js ADDED
@@ -0,0 +1,316 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var src_exports = {};
22
+ __export(src_exports, {
23
+ PlatformCtx: () => PlatformCtx,
24
+ PluginProvider: () => PluginProvider,
25
+ apiFetch: () => apiFetch,
26
+ apiUpload: () => apiUpload,
27
+ getBaseUrl: () => getBaseUrl,
28
+ setBaseUrl: () => setBaseUrl,
29
+ usePlatform: () => usePlatform,
30
+ usePluginChat: () => usePluginChat,
31
+ usePluginDataRooms: () => usePluginDataRooms,
32
+ usePluginTasks: () => usePluginTasks
33
+ });
34
+ module.exports = __toCommonJS(src_exports);
35
+
36
+ // src/api.ts
37
+ var _baseUrl = process.env.NEXT_PUBLIC_API_URL ?? "http://localhost:8000";
38
+ function setBaseUrl(url) {
39
+ _baseUrl = url;
40
+ }
41
+ function getBaseUrl() {
42
+ return _baseUrl;
43
+ }
44
+ async function _fetch(path, init) {
45
+ return fetch(`${_baseUrl}${path}`, {
46
+ ...init,
47
+ credentials: "include",
48
+ headers: { "Content-Type": "application/json", ...init?.headers }
49
+ });
50
+ }
51
+ async function apiFetch(path, init) {
52
+ const res = await _fetch(path, init);
53
+ if (res.status === 401 && path !== "/api/v1/auth/refresh" && path !== "/api/v1/auth/login") {
54
+ const refreshRes = await _fetch("/api/v1/auth/refresh", { method: "POST" });
55
+ if (refreshRes.ok) {
56
+ const retried = await _fetch(path, init);
57
+ if (!retried.ok) {
58
+ const body = await retried.json().catch(() => ({}));
59
+ throw new Error(body.detail ?? retried.statusText);
60
+ }
61
+ return retried;
62
+ }
63
+ const current = typeof window !== "undefined" ? window.location.pathname : "";
64
+ if (current !== "/login" && current !== "/signup") {
65
+ if (typeof window !== "undefined") window.location.href = "/login";
66
+ }
67
+ throw new Error("Session expired");
68
+ }
69
+ if (!res.ok) {
70
+ const body = await res.json().catch(() => ({}));
71
+ throw new Error(body.detail ?? res.statusText);
72
+ }
73
+ return res;
74
+ }
75
+ async function apiUpload(path, file, fieldName = "file", extraFields) {
76
+ const formData = new FormData();
77
+ formData.append(fieldName, file);
78
+ if (extraFields) {
79
+ for (const [key, value] of Object.entries(extraFields)) {
80
+ formData.append(key, value);
81
+ }
82
+ }
83
+ const res = await fetch(`${_baseUrl}${path}`, {
84
+ method: "POST",
85
+ credentials: "include",
86
+ body: formData
87
+ });
88
+ if (!res.ok) {
89
+ const body = await res.json().catch(() => ({}));
90
+ throw new Error(body.detail ?? res.statusText);
91
+ }
92
+ return res;
93
+ }
94
+
95
+ // src/hooks/use-platform.ts
96
+ var import_react = require("react");
97
+ var PlatformCtx = (0, import_react.createContext)(null);
98
+ function usePlatform() {
99
+ const ctx = (0, import_react.useContext)(PlatformCtx);
100
+ if (!ctx) {
101
+ throw new Error(
102
+ "usePlatform must be used within a PlatformProvider. This is provided automatically when your plugin runs on the Palette platform."
103
+ );
104
+ }
105
+ return ctx;
106
+ }
107
+
108
+ // src/hooks/use-plugin-tasks.ts
109
+ var import_react2 = require("react");
110
+ function usePluginTasks(agentId) {
111
+ const { apiFetch: apiFetch2 } = usePlatform();
112
+ const [tasks, setTasks] = (0, import_react2.useState)([]);
113
+ const [stats, setStats] = (0, import_react2.useState)(null);
114
+ const [loading, setLoading] = (0, import_react2.useState)(true);
115
+ const fetchTasks = (0, import_react2.useCallback)(async () => {
116
+ try {
117
+ const params = new URLSearchParams();
118
+ if (agentId) params.set("agent_id", String(agentId));
119
+ const res = await apiFetch2(`/api/v1/tasks?${params}`);
120
+ setTasks(await res.json());
121
+ } catch {
122
+ }
123
+ }, [apiFetch2, agentId]);
124
+ const fetchStats = (0, import_react2.useCallback)(async () => {
125
+ try {
126
+ const res = await apiFetch2("/api/v1/tasks/stats");
127
+ setStats(await res.json());
128
+ } catch {
129
+ }
130
+ }, [apiFetch2]);
131
+ (0, import_react2.useEffect)(() => {
132
+ setLoading(true);
133
+ Promise.all([fetchTasks(), fetchStats()]).finally(() => setLoading(false));
134
+ }, [fetchTasks, fetchStats]);
135
+ const createTask = (0, import_react2.useCallback)(async (payload) => {
136
+ const res = await apiFetch2("/api/v1/tasks", {
137
+ method: "POST",
138
+ body: JSON.stringify(payload)
139
+ });
140
+ const task = await res.json();
141
+ await Promise.all([fetchTasks(), fetchStats()]);
142
+ return task;
143
+ }, [apiFetch2, fetchTasks, fetchStats]);
144
+ const updateTask = (0, import_react2.useCallback)(async (taskId, payload) => {
145
+ const res = await apiFetch2(`/api/v1/tasks/${taskId}`, {
146
+ method: "PATCH",
147
+ body: JSON.stringify(payload)
148
+ });
149
+ const task = await res.json();
150
+ await Promise.all([fetchTasks(), fetchStats()]);
151
+ return task;
152
+ }, [apiFetch2, fetchTasks, fetchStats]);
153
+ const deleteTask = (0, import_react2.useCallback)(async (taskId) => {
154
+ await apiFetch2(`/api/v1/tasks/${taskId}`, { method: "DELETE" });
155
+ await Promise.all([fetchTasks(), fetchStats()]);
156
+ }, [apiFetch2, fetchTasks, fetchStats]);
157
+ return { tasks, stats, loading, createTask, updateTask, deleteTask, refetch: fetchTasks };
158
+ }
159
+
160
+ // src/hooks/use-plugin-data-rooms.ts
161
+ var import_react3 = require("react");
162
+ function usePluginDataRooms() {
163
+ const { apiFetch: apiFetch2 } = usePlatform();
164
+ const [rooms, setRooms] = (0, import_react3.useState)([]);
165
+ const [loading, setLoading] = (0, import_react3.useState)(true);
166
+ const fetchRooms = (0, import_react3.useCallback)(async () => {
167
+ try {
168
+ const res = await apiFetch2("/api/v1/data-rooms");
169
+ setRooms(await res.json());
170
+ } catch {
171
+ }
172
+ }, [apiFetch2]);
173
+ (0, import_react3.useEffect)(() => {
174
+ setLoading(true);
175
+ fetchRooms().finally(() => setLoading(false));
176
+ }, [fetchRooms]);
177
+ const fetchFolder = (0, import_react3.useCallback)(async (roomId, folderId) => {
178
+ const path = folderId ? `/api/v1/data-rooms/${roomId}/folders/${folderId}` : `/api/v1/data-rooms/${roomId}`;
179
+ const res = await apiFetch2(path);
180
+ return res.json();
181
+ }, [apiFetch2]);
182
+ return { rooms, loading, fetchFolder, refetch: fetchRooms };
183
+ }
184
+
185
+ // src/hooks/use-plugin-chat.ts
186
+ var import_react4 = require("react");
187
+ function usePluginChat(agentId) {
188
+ const { apiFetch: apiFetch2 } = usePlatform();
189
+ const [threads, setThreads] = (0, import_react4.useState)([]);
190
+ const [messages, setMessages] = (0, import_react4.useState)([]);
191
+ const [streaming, setStreaming] = (0, import_react4.useState)(false);
192
+ const [activeThreadId, setActiveThreadId] = (0, import_react4.useState)(null);
193
+ const abortRef = (0, import_react4.useRef)(null);
194
+ const fetchThreads = (0, import_react4.useCallback)(async () => {
195
+ const res = await apiFetch2(`/api/v1/chat/${agentId}/threads`);
196
+ setThreads(await res.json());
197
+ }, [apiFetch2, agentId]);
198
+ const createThread = (0, import_react4.useCallback)(async () => {
199
+ const res = await apiFetch2(`/api/v1/chat/${agentId}/threads`, { method: "POST" });
200
+ const thread = await res.json();
201
+ setActiveThreadId(thread.id);
202
+ setMessages([]);
203
+ await fetchThreads();
204
+ return thread;
205
+ }, [apiFetch2, agentId, fetchThreads]);
206
+ const fetchMessages = (0, import_react4.useCallback)(async (threadId) => {
207
+ const res = await apiFetch2(`/api/v1/chat/threads/${threadId}/messages`);
208
+ const msgs = await res.json();
209
+ setMessages(msgs);
210
+ setActiveThreadId(threadId);
211
+ }, [apiFetch2]);
212
+ const sendMessage = (0, import_react4.useCallback)(async (threadId, content) => {
213
+ setStreaming(true);
214
+ abortRef.current = new AbortController();
215
+ const userMsg = {
216
+ id: crypto.randomUUID(),
217
+ thread_id: threadId,
218
+ role: "user",
219
+ content,
220
+ attachments: null,
221
+ created_at: (/* @__PURE__ */ new Date()).toISOString()
222
+ };
223
+ setMessages((prev) => [...prev, userMsg]);
224
+ let assistantContent = "";
225
+ const assistantMsg = {
226
+ id: crypto.randomUUID(),
227
+ thread_id: threadId,
228
+ role: "assistant",
229
+ content: "",
230
+ attachments: null,
231
+ created_at: (/* @__PURE__ */ new Date()).toISOString()
232
+ };
233
+ setMessages((prev) => [...prev, assistantMsg]);
234
+ try {
235
+ const res = await fetch(`${getBaseUrl()}/api/v1/chat/threads/${threadId}/send`, {
236
+ method: "POST",
237
+ credentials: "include",
238
+ headers: { "Content-Type": "application/json" },
239
+ body: JSON.stringify({ content }),
240
+ signal: abortRef.current.signal
241
+ });
242
+ const reader = res.body?.getReader();
243
+ if (!reader) return;
244
+ const decoder = new TextDecoder();
245
+ let buffer = "";
246
+ while (true) {
247
+ const { done, value } = await reader.read();
248
+ if (done) break;
249
+ buffer += decoder.decode(value, { stream: true });
250
+ const lines = buffer.split("\n");
251
+ buffer = lines.pop() ?? "";
252
+ for (const line of lines) {
253
+ if (!line.startsWith("data: ")) continue;
254
+ try {
255
+ const event = JSON.parse(line.slice(6));
256
+ if (event.event === "token") {
257
+ assistantContent += event.content;
258
+ setMessages((prev) => {
259
+ const copy = [...prev];
260
+ copy[copy.length - 1] = { ...copy[copy.length - 1], content: assistantContent };
261
+ return copy;
262
+ });
263
+ }
264
+ if (event.event === "done" && event.message_id) {
265
+ setMessages((prev) => {
266
+ const copy = [...prev];
267
+ copy[copy.length - 1] = { ...copy[copy.length - 1], id: event.message_id };
268
+ return copy;
269
+ });
270
+ }
271
+ } catch {
272
+ }
273
+ }
274
+ }
275
+ } finally {
276
+ setStreaming(false);
277
+ abortRef.current = null;
278
+ }
279
+ }, []);
280
+ const stopStreaming = (0, import_react4.useCallback)(() => {
281
+ abortRef.current?.abort();
282
+ }, []);
283
+ return {
284
+ threads,
285
+ messages,
286
+ streaming,
287
+ activeThreadId,
288
+ fetchThreads,
289
+ createThread,
290
+ fetchMessages,
291
+ sendMessage,
292
+ stopStreaming
293
+ };
294
+ }
295
+
296
+ // src/components/plugin-provider.tsx
297
+ var import_jsx_runtime = require("react/jsx-runtime");
298
+ function PluginProvider({
299
+ value,
300
+ children
301
+ }) {
302
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PlatformCtx.Provider, { value, children });
303
+ }
304
+ // Annotate the CommonJS export names for ESM import in node:
305
+ 0 && (module.exports = {
306
+ PlatformCtx,
307
+ PluginProvider,
308
+ apiFetch,
309
+ apiUpload,
310
+ getBaseUrl,
311
+ setBaseUrl,
312
+ usePlatform,
313
+ usePluginChat,
314
+ usePluginDataRooms,
315
+ usePluginTasks
316
+ });
package/dist/index.mjs ADDED
@@ -0,0 +1,280 @@
1
+ // src/api.ts
2
+ var _baseUrl = process.env.NEXT_PUBLIC_API_URL ?? "http://localhost:8000";
3
+ function setBaseUrl(url) {
4
+ _baseUrl = url;
5
+ }
6
+ function getBaseUrl() {
7
+ return _baseUrl;
8
+ }
9
+ async function _fetch(path, init) {
10
+ return fetch(`${_baseUrl}${path}`, {
11
+ ...init,
12
+ credentials: "include",
13
+ headers: { "Content-Type": "application/json", ...init?.headers }
14
+ });
15
+ }
16
+ async function apiFetch(path, init) {
17
+ const res = await _fetch(path, init);
18
+ if (res.status === 401 && path !== "/api/v1/auth/refresh" && path !== "/api/v1/auth/login") {
19
+ const refreshRes = await _fetch("/api/v1/auth/refresh", { method: "POST" });
20
+ if (refreshRes.ok) {
21
+ const retried = await _fetch(path, init);
22
+ if (!retried.ok) {
23
+ const body = await retried.json().catch(() => ({}));
24
+ throw new Error(body.detail ?? retried.statusText);
25
+ }
26
+ return retried;
27
+ }
28
+ const current = typeof window !== "undefined" ? window.location.pathname : "";
29
+ if (current !== "/login" && current !== "/signup") {
30
+ if (typeof window !== "undefined") window.location.href = "/login";
31
+ }
32
+ throw new Error("Session expired");
33
+ }
34
+ if (!res.ok) {
35
+ const body = await res.json().catch(() => ({}));
36
+ throw new Error(body.detail ?? res.statusText);
37
+ }
38
+ return res;
39
+ }
40
+ async function apiUpload(path, file, fieldName = "file", extraFields) {
41
+ const formData = new FormData();
42
+ formData.append(fieldName, file);
43
+ if (extraFields) {
44
+ for (const [key, value] of Object.entries(extraFields)) {
45
+ formData.append(key, value);
46
+ }
47
+ }
48
+ const res = await fetch(`${_baseUrl}${path}`, {
49
+ method: "POST",
50
+ credentials: "include",
51
+ body: formData
52
+ });
53
+ if (!res.ok) {
54
+ const body = await res.json().catch(() => ({}));
55
+ throw new Error(body.detail ?? res.statusText);
56
+ }
57
+ return res;
58
+ }
59
+
60
+ // src/hooks/use-platform.ts
61
+ import { createContext, useContext } from "react";
62
+ var PlatformCtx = createContext(null);
63
+ function usePlatform() {
64
+ const ctx = useContext(PlatformCtx);
65
+ if (!ctx) {
66
+ throw new Error(
67
+ "usePlatform must be used within a PlatformProvider. This is provided automatically when your plugin runs on the Palette platform."
68
+ );
69
+ }
70
+ return ctx;
71
+ }
72
+
73
+ // src/hooks/use-plugin-tasks.ts
74
+ import { useCallback, useEffect, useState } from "react";
75
+ function usePluginTasks(agentId) {
76
+ const { apiFetch: apiFetch2 } = usePlatform();
77
+ const [tasks, setTasks] = useState([]);
78
+ const [stats, setStats] = useState(null);
79
+ const [loading, setLoading] = useState(true);
80
+ const fetchTasks = useCallback(async () => {
81
+ try {
82
+ const params = new URLSearchParams();
83
+ if (agentId) params.set("agent_id", String(agentId));
84
+ const res = await apiFetch2(`/api/v1/tasks?${params}`);
85
+ setTasks(await res.json());
86
+ } catch {
87
+ }
88
+ }, [apiFetch2, agentId]);
89
+ const fetchStats = useCallback(async () => {
90
+ try {
91
+ const res = await apiFetch2("/api/v1/tasks/stats");
92
+ setStats(await res.json());
93
+ } catch {
94
+ }
95
+ }, [apiFetch2]);
96
+ useEffect(() => {
97
+ setLoading(true);
98
+ Promise.all([fetchTasks(), fetchStats()]).finally(() => setLoading(false));
99
+ }, [fetchTasks, fetchStats]);
100
+ const createTask = useCallback(async (payload) => {
101
+ const res = await apiFetch2("/api/v1/tasks", {
102
+ method: "POST",
103
+ body: JSON.stringify(payload)
104
+ });
105
+ const task = await res.json();
106
+ await Promise.all([fetchTasks(), fetchStats()]);
107
+ return task;
108
+ }, [apiFetch2, fetchTasks, fetchStats]);
109
+ const updateTask = useCallback(async (taskId, payload) => {
110
+ const res = await apiFetch2(`/api/v1/tasks/${taskId}`, {
111
+ method: "PATCH",
112
+ body: JSON.stringify(payload)
113
+ });
114
+ const task = await res.json();
115
+ await Promise.all([fetchTasks(), fetchStats()]);
116
+ return task;
117
+ }, [apiFetch2, fetchTasks, fetchStats]);
118
+ const deleteTask = useCallback(async (taskId) => {
119
+ await apiFetch2(`/api/v1/tasks/${taskId}`, { method: "DELETE" });
120
+ await Promise.all([fetchTasks(), fetchStats()]);
121
+ }, [apiFetch2, fetchTasks, fetchStats]);
122
+ return { tasks, stats, loading, createTask, updateTask, deleteTask, refetch: fetchTasks };
123
+ }
124
+
125
+ // src/hooks/use-plugin-data-rooms.ts
126
+ import { useCallback as useCallback2, useEffect as useEffect2, useState as useState2 } from "react";
127
+ function usePluginDataRooms() {
128
+ const { apiFetch: apiFetch2 } = usePlatform();
129
+ const [rooms, setRooms] = useState2([]);
130
+ const [loading, setLoading] = useState2(true);
131
+ const fetchRooms = useCallback2(async () => {
132
+ try {
133
+ const res = await apiFetch2("/api/v1/data-rooms");
134
+ setRooms(await res.json());
135
+ } catch {
136
+ }
137
+ }, [apiFetch2]);
138
+ useEffect2(() => {
139
+ setLoading(true);
140
+ fetchRooms().finally(() => setLoading(false));
141
+ }, [fetchRooms]);
142
+ const fetchFolder = useCallback2(async (roomId, folderId) => {
143
+ const path = folderId ? `/api/v1/data-rooms/${roomId}/folders/${folderId}` : `/api/v1/data-rooms/${roomId}`;
144
+ const res = await apiFetch2(path);
145
+ return res.json();
146
+ }, [apiFetch2]);
147
+ return { rooms, loading, fetchFolder, refetch: fetchRooms };
148
+ }
149
+
150
+ // src/hooks/use-plugin-chat.ts
151
+ import { useCallback as useCallback3, useRef, useState as useState3 } from "react";
152
+ function usePluginChat(agentId) {
153
+ const { apiFetch: apiFetch2 } = usePlatform();
154
+ const [threads, setThreads] = useState3([]);
155
+ const [messages, setMessages] = useState3([]);
156
+ const [streaming, setStreaming] = useState3(false);
157
+ const [activeThreadId, setActiveThreadId] = useState3(null);
158
+ const abortRef = useRef(null);
159
+ const fetchThreads = useCallback3(async () => {
160
+ const res = await apiFetch2(`/api/v1/chat/${agentId}/threads`);
161
+ setThreads(await res.json());
162
+ }, [apiFetch2, agentId]);
163
+ const createThread = useCallback3(async () => {
164
+ const res = await apiFetch2(`/api/v1/chat/${agentId}/threads`, { method: "POST" });
165
+ const thread = await res.json();
166
+ setActiveThreadId(thread.id);
167
+ setMessages([]);
168
+ await fetchThreads();
169
+ return thread;
170
+ }, [apiFetch2, agentId, fetchThreads]);
171
+ const fetchMessages = useCallback3(async (threadId) => {
172
+ const res = await apiFetch2(`/api/v1/chat/threads/${threadId}/messages`);
173
+ const msgs = await res.json();
174
+ setMessages(msgs);
175
+ setActiveThreadId(threadId);
176
+ }, [apiFetch2]);
177
+ const sendMessage = useCallback3(async (threadId, content) => {
178
+ setStreaming(true);
179
+ abortRef.current = new AbortController();
180
+ const userMsg = {
181
+ id: crypto.randomUUID(),
182
+ thread_id: threadId,
183
+ role: "user",
184
+ content,
185
+ attachments: null,
186
+ created_at: (/* @__PURE__ */ new Date()).toISOString()
187
+ };
188
+ setMessages((prev) => [...prev, userMsg]);
189
+ let assistantContent = "";
190
+ const assistantMsg = {
191
+ id: crypto.randomUUID(),
192
+ thread_id: threadId,
193
+ role: "assistant",
194
+ content: "",
195
+ attachments: null,
196
+ created_at: (/* @__PURE__ */ new Date()).toISOString()
197
+ };
198
+ setMessages((prev) => [...prev, assistantMsg]);
199
+ try {
200
+ const res = await fetch(`${getBaseUrl()}/api/v1/chat/threads/${threadId}/send`, {
201
+ method: "POST",
202
+ credentials: "include",
203
+ headers: { "Content-Type": "application/json" },
204
+ body: JSON.stringify({ content }),
205
+ signal: abortRef.current.signal
206
+ });
207
+ const reader = res.body?.getReader();
208
+ if (!reader) return;
209
+ const decoder = new TextDecoder();
210
+ let buffer = "";
211
+ while (true) {
212
+ const { done, value } = await reader.read();
213
+ if (done) break;
214
+ buffer += decoder.decode(value, { stream: true });
215
+ const lines = buffer.split("\n");
216
+ buffer = lines.pop() ?? "";
217
+ for (const line of lines) {
218
+ if (!line.startsWith("data: ")) continue;
219
+ try {
220
+ const event = JSON.parse(line.slice(6));
221
+ if (event.event === "token") {
222
+ assistantContent += event.content;
223
+ setMessages((prev) => {
224
+ const copy = [...prev];
225
+ copy[copy.length - 1] = { ...copy[copy.length - 1], content: assistantContent };
226
+ return copy;
227
+ });
228
+ }
229
+ if (event.event === "done" && event.message_id) {
230
+ setMessages((prev) => {
231
+ const copy = [...prev];
232
+ copy[copy.length - 1] = { ...copy[copy.length - 1], id: event.message_id };
233
+ return copy;
234
+ });
235
+ }
236
+ } catch {
237
+ }
238
+ }
239
+ }
240
+ } finally {
241
+ setStreaming(false);
242
+ abortRef.current = null;
243
+ }
244
+ }, []);
245
+ const stopStreaming = useCallback3(() => {
246
+ abortRef.current?.abort();
247
+ }, []);
248
+ return {
249
+ threads,
250
+ messages,
251
+ streaming,
252
+ activeThreadId,
253
+ fetchThreads,
254
+ createThread,
255
+ fetchMessages,
256
+ sendMessage,
257
+ stopStreaming
258
+ };
259
+ }
260
+
261
+ // src/components/plugin-provider.tsx
262
+ import { jsx } from "react/jsx-runtime";
263
+ function PluginProvider({
264
+ value,
265
+ children
266
+ }) {
267
+ return /* @__PURE__ */ jsx(PlatformCtx.Provider, { value, children });
268
+ }
269
+ export {
270
+ PlatformCtx,
271
+ PluginProvider,
272
+ apiFetch,
273
+ apiUpload,
274
+ getBaseUrl,
275
+ setBaseUrl,
276
+ usePlatform,
277
+ usePluginChat,
278
+ usePluginDataRooms,
279
+ usePluginTasks
280
+ };