@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/components/index.d.mts +15 -0
- package/dist/components/index.d.ts +15 -0
- package/dist/components/index.js +42 -0
- package/dist/components/index.mjs +15 -0
- package/dist/data-room-BP0PjYoe.d.mts +125 -0
- package/dist/data-room-BP0PjYoe.d.ts +125 -0
- package/dist/hooks/index.d.mts +71 -0
- package/dist/hooks/index.d.ts +71 -0
- package/dist/hooks/index.js +246 -0
- package/dist/hooks/index.mjs +215 -0
- package/dist/index.d.mts +31 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.js +316 -0
- package/dist/index.mjs +280 -0
- package/dist/plugin-CQH23f5N.d.mts +139 -0
- package/dist/plugin-CQH23f5N.d.ts +139 -0
- package/dist/types/index.d.mts +20 -0
- package/dist/types/index.d.ts +20 -0
- package/dist/types/index.js +18 -0
- package/dist/types/index.mjs +0 -0
- package/package.json +58 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import react__default from 'react';
|
|
3
|
+
import { P as PlatformContext } from '../plugin-CQH23f5N.mjs';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Provider that wraps plugin components with the platform context.
|
|
7
|
+
* This is used by the platform runtime to inject services into plugins.
|
|
8
|
+
* Plugin developers do NOT need to use this directly.
|
|
9
|
+
*/
|
|
10
|
+
declare function PluginProvider({ value, children, }: {
|
|
11
|
+
value: PlatformContext;
|
|
12
|
+
children: react__default.ReactNode;
|
|
13
|
+
}): react_jsx_runtime.JSX.Element;
|
|
14
|
+
|
|
15
|
+
export { PluginProvider };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import react__default from 'react';
|
|
3
|
+
import { P as PlatformContext } from '../plugin-CQH23f5N.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Provider that wraps plugin components with the platform context.
|
|
7
|
+
* This is used by the platform runtime to inject services into plugins.
|
|
8
|
+
* Plugin developers do NOT need to use this directly.
|
|
9
|
+
*/
|
|
10
|
+
declare function PluginProvider({ value, children, }: {
|
|
11
|
+
value: PlatformContext;
|
|
12
|
+
children: react__default.ReactNode;
|
|
13
|
+
}): react_jsx_runtime.JSX.Element;
|
|
14
|
+
|
|
15
|
+
export { PluginProvider };
|
|
@@ -0,0 +1,42 @@
|
|
|
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/components/index.ts
|
|
21
|
+
var components_exports = {};
|
|
22
|
+
__export(components_exports, {
|
|
23
|
+
PluginProvider: () => PluginProvider
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(components_exports);
|
|
26
|
+
|
|
27
|
+
// src/hooks/use-platform.ts
|
|
28
|
+
var import_react = require("react");
|
|
29
|
+
var PlatformCtx = (0, import_react.createContext)(null);
|
|
30
|
+
|
|
31
|
+
// src/components/plugin-provider.tsx
|
|
32
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
33
|
+
function PluginProvider({
|
|
34
|
+
value,
|
|
35
|
+
children
|
|
36
|
+
}) {
|
|
37
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PlatformCtx.Provider, { value, children });
|
|
38
|
+
}
|
|
39
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
40
|
+
0 && (module.exports = {
|
|
41
|
+
PluginProvider
|
|
42
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// src/hooks/use-platform.ts
|
|
2
|
+
import { createContext, useContext } from "react";
|
|
3
|
+
var PlatformCtx = createContext(null);
|
|
4
|
+
|
|
5
|
+
// src/components/plugin-provider.tsx
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
function PluginProvider({
|
|
8
|
+
value,
|
|
9
|
+
children
|
|
10
|
+
}) {
|
|
11
|
+
return /* @__PURE__ */ jsx(PlatformCtx.Provider, { value, children });
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
PluginProvider
|
|
15
|
+
};
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
type TaskStatus = "pending" | "in_progress" | "completed" | "failed" | "cancelled";
|
|
2
|
+
type TaskPriority = "low" | "medium" | "high" | "critical";
|
|
3
|
+
type TaskType = "automated" | "manual";
|
|
4
|
+
interface TaskAgentSnippet {
|
|
5
|
+
id: number;
|
|
6
|
+
name: string;
|
|
7
|
+
icon_name: string;
|
|
8
|
+
color: string;
|
|
9
|
+
avatar?: string;
|
|
10
|
+
}
|
|
11
|
+
interface Task {
|
|
12
|
+
id: number;
|
|
13
|
+
user_id: string;
|
|
14
|
+
agent_id: number | null;
|
|
15
|
+
parent_task_id: number | null;
|
|
16
|
+
title: string;
|
|
17
|
+
description: string;
|
|
18
|
+
output?: string;
|
|
19
|
+
status: TaskStatus;
|
|
20
|
+
priority: TaskPriority;
|
|
21
|
+
task_type: TaskType;
|
|
22
|
+
progress: number;
|
|
23
|
+
tags: string[];
|
|
24
|
+
created_at: string;
|
|
25
|
+
updated_at: string;
|
|
26
|
+
started_at?: string;
|
|
27
|
+
completed_at?: string;
|
|
28
|
+
due_date?: string | null;
|
|
29
|
+
routine_id?: number | null;
|
|
30
|
+
agent?: TaskAgentSnippet;
|
|
31
|
+
}
|
|
32
|
+
interface TaskStats {
|
|
33
|
+
total: number;
|
|
34
|
+
pending: number;
|
|
35
|
+
in_progress: number;
|
|
36
|
+
completed: number;
|
|
37
|
+
failed: number;
|
|
38
|
+
cancelled: number;
|
|
39
|
+
}
|
|
40
|
+
interface TaskCreatePayload {
|
|
41
|
+
title: string;
|
|
42
|
+
agent_id?: number;
|
|
43
|
+
parent_task_id?: number;
|
|
44
|
+
description?: string;
|
|
45
|
+
status?: TaskStatus;
|
|
46
|
+
priority?: TaskPriority;
|
|
47
|
+
task_type?: TaskType;
|
|
48
|
+
progress?: number;
|
|
49
|
+
tags?: string[];
|
|
50
|
+
due_date?: string;
|
|
51
|
+
}
|
|
52
|
+
interface TaskUpdatePayload extends Partial<TaskCreatePayload> {
|
|
53
|
+
output?: string;
|
|
54
|
+
started_at?: string;
|
|
55
|
+
completed_at?: string;
|
|
56
|
+
due_date?: string;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
interface ChatAttachment {
|
|
60
|
+
filename: string;
|
|
61
|
+
file_url: string;
|
|
62
|
+
mime_type: string;
|
|
63
|
+
file_size: number;
|
|
64
|
+
}
|
|
65
|
+
interface ChatThread {
|
|
66
|
+
id: string;
|
|
67
|
+
agent_id: number;
|
|
68
|
+
title: string | null;
|
|
69
|
+
created_at: string;
|
|
70
|
+
updated_at: string;
|
|
71
|
+
last_message: string | null;
|
|
72
|
+
message_count: number;
|
|
73
|
+
}
|
|
74
|
+
interface ChatMessage {
|
|
75
|
+
id: string;
|
|
76
|
+
thread_id: string;
|
|
77
|
+
role: "user" | "assistant";
|
|
78
|
+
content: string;
|
|
79
|
+
attachments: ChatAttachment[] | null;
|
|
80
|
+
routed_agents?: {
|
|
81
|
+
id: number;
|
|
82
|
+
name: string;
|
|
83
|
+
}[] | null;
|
|
84
|
+
created_at: string;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
type DataRoomPermission = "view" | "upload" | "edit" | "owner";
|
|
88
|
+
interface DataRoom {
|
|
89
|
+
id: number;
|
|
90
|
+
name: string;
|
|
91
|
+
description: string | null;
|
|
92
|
+
user_id: string;
|
|
93
|
+
my_permission: DataRoomPermission;
|
|
94
|
+
is_shared: boolean;
|
|
95
|
+
files_count: number;
|
|
96
|
+
folders_count: number;
|
|
97
|
+
created_at: string;
|
|
98
|
+
updated_at: string;
|
|
99
|
+
}
|
|
100
|
+
interface DataRoomFolder {
|
|
101
|
+
id: number;
|
|
102
|
+
name: string;
|
|
103
|
+
data_room_id: number;
|
|
104
|
+
parent_folder_id: number | null;
|
|
105
|
+
files_count: number;
|
|
106
|
+
folders_count: number;
|
|
107
|
+
created_at: string;
|
|
108
|
+
updated_at: string;
|
|
109
|
+
folders?: DataRoomFolder[];
|
|
110
|
+
files?: DataRoomFile[];
|
|
111
|
+
}
|
|
112
|
+
interface DataRoomFile {
|
|
113
|
+
id: number;
|
|
114
|
+
original_filename: string;
|
|
115
|
+
data_room_id: number;
|
|
116
|
+
folder_id: number | null;
|
|
117
|
+
agent_id: number | null;
|
|
118
|
+
file_url: string;
|
|
119
|
+
file_size: number;
|
|
120
|
+
mime_type: string;
|
|
121
|
+
created_at: string;
|
|
122
|
+
updated_at: string;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export type { ChatAttachment as C, DataRoom as D, Task as T, ChatMessage as a, ChatThread as b, DataRoomFile as c, DataRoomFolder as d, DataRoomPermission as e, TaskAgentSnippet as f, TaskCreatePayload as g, TaskPriority as h, TaskStats as i, TaskStatus as j, TaskType as k, TaskUpdatePayload as l };
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
type TaskStatus = "pending" | "in_progress" | "completed" | "failed" | "cancelled";
|
|
2
|
+
type TaskPriority = "low" | "medium" | "high" | "critical";
|
|
3
|
+
type TaskType = "automated" | "manual";
|
|
4
|
+
interface TaskAgentSnippet {
|
|
5
|
+
id: number;
|
|
6
|
+
name: string;
|
|
7
|
+
icon_name: string;
|
|
8
|
+
color: string;
|
|
9
|
+
avatar?: string;
|
|
10
|
+
}
|
|
11
|
+
interface Task {
|
|
12
|
+
id: number;
|
|
13
|
+
user_id: string;
|
|
14
|
+
agent_id: number | null;
|
|
15
|
+
parent_task_id: number | null;
|
|
16
|
+
title: string;
|
|
17
|
+
description: string;
|
|
18
|
+
output?: string;
|
|
19
|
+
status: TaskStatus;
|
|
20
|
+
priority: TaskPriority;
|
|
21
|
+
task_type: TaskType;
|
|
22
|
+
progress: number;
|
|
23
|
+
tags: string[];
|
|
24
|
+
created_at: string;
|
|
25
|
+
updated_at: string;
|
|
26
|
+
started_at?: string;
|
|
27
|
+
completed_at?: string;
|
|
28
|
+
due_date?: string | null;
|
|
29
|
+
routine_id?: number | null;
|
|
30
|
+
agent?: TaskAgentSnippet;
|
|
31
|
+
}
|
|
32
|
+
interface TaskStats {
|
|
33
|
+
total: number;
|
|
34
|
+
pending: number;
|
|
35
|
+
in_progress: number;
|
|
36
|
+
completed: number;
|
|
37
|
+
failed: number;
|
|
38
|
+
cancelled: number;
|
|
39
|
+
}
|
|
40
|
+
interface TaskCreatePayload {
|
|
41
|
+
title: string;
|
|
42
|
+
agent_id?: number;
|
|
43
|
+
parent_task_id?: number;
|
|
44
|
+
description?: string;
|
|
45
|
+
status?: TaskStatus;
|
|
46
|
+
priority?: TaskPriority;
|
|
47
|
+
task_type?: TaskType;
|
|
48
|
+
progress?: number;
|
|
49
|
+
tags?: string[];
|
|
50
|
+
due_date?: string;
|
|
51
|
+
}
|
|
52
|
+
interface TaskUpdatePayload extends Partial<TaskCreatePayload> {
|
|
53
|
+
output?: string;
|
|
54
|
+
started_at?: string;
|
|
55
|
+
completed_at?: string;
|
|
56
|
+
due_date?: string;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
interface ChatAttachment {
|
|
60
|
+
filename: string;
|
|
61
|
+
file_url: string;
|
|
62
|
+
mime_type: string;
|
|
63
|
+
file_size: number;
|
|
64
|
+
}
|
|
65
|
+
interface ChatThread {
|
|
66
|
+
id: string;
|
|
67
|
+
agent_id: number;
|
|
68
|
+
title: string | null;
|
|
69
|
+
created_at: string;
|
|
70
|
+
updated_at: string;
|
|
71
|
+
last_message: string | null;
|
|
72
|
+
message_count: number;
|
|
73
|
+
}
|
|
74
|
+
interface ChatMessage {
|
|
75
|
+
id: string;
|
|
76
|
+
thread_id: string;
|
|
77
|
+
role: "user" | "assistant";
|
|
78
|
+
content: string;
|
|
79
|
+
attachments: ChatAttachment[] | null;
|
|
80
|
+
routed_agents?: {
|
|
81
|
+
id: number;
|
|
82
|
+
name: string;
|
|
83
|
+
}[] | null;
|
|
84
|
+
created_at: string;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
type DataRoomPermission = "view" | "upload" | "edit" | "owner";
|
|
88
|
+
interface DataRoom {
|
|
89
|
+
id: number;
|
|
90
|
+
name: string;
|
|
91
|
+
description: string | null;
|
|
92
|
+
user_id: string;
|
|
93
|
+
my_permission: DataRoomPermission;
|
|
94
|
+
is_shared: boolean;
|
|
95
|
+
files_count: number;
|
|
96
|
+
folders_count: number;
|
|
97
|
+
created_at: string;
|
|
98
|
+
updated_at: string;
|
|
99
|
+
}
|
|
100
|
+
interface DataRoomFolder {
|
|
101
|
+
id: number;
|
|
102
|
+
name: string;
|
|
103
|
+
data_room_id: number;
|
|
104
|
+
parent_folder_id: number | null;
|
|
105
|
+
files_count: number;
|
|
106
|
+
folders_count: number;
|
|
107
|
+
created_at: string;
|
|
108
|
+
updated_at: string;
|
|
109
|
+
folders?: DataRoomFolder[];
|
|
110
|
+
files?: DataRoomFile[];
|
|
111
|
+
}
|
|
112
|
+
interface DataRoomFile {
|
|
113
|
+
id: number;
|
|
114
|
+
original_filename: string;
|
|
115
|
+
data_room_id: number;
|
|
116
|
+
folder_id: number | null;
|
|
117
|
+
agent_id: number | null;
|
|
118
|
+
file_url: string;
|
|
119
|
+
file_size: number;
|
|
120
|
+
mime_type: string;
|
|
121
|
+
created_at: string;
|
|
122
|
+
updated_at: string;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export type { ChatAttachment as C, DataRoom as D, Task as T, ChatMessage as a, ChatThread as b, DataRoomFile as c, DataRoomFolder as d, DataRoomPermission as e, TaskAgentSnippet as f, TaskCreatePayload as g, TaskPriority as h, TaskStats as i, TaskStatus as j, TaskType as k, TaskUpdatePayload as l };
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { P as PlatformContext } from '../plugin-CQH23f5N.mjs';
|
|
3
|
+
import { T as Task, i as TaskStats, g as TaskCreatePayload, l as TaskUpdatePayload, D as DataRoom, d as DataRoomFolder, c as DataRoomFile, b as ChatThread, a as ChatMessage } from '../data-room-BP0PjYoe.mjs';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* React context for platform services.
|
|
7
|
+
* The platform runtime provides this — plugin developers consume it.
|
|
8
|
+
*/
|
|
9
|
+
declare const PlatformCtx: react.Context<PlatformContext | null>;
|
|
10
|
+
/**
|
|
11
|
+
* Access the platform context from within a plugin component.
|
|
12
|
+
*
|
|
13
|
+
* Provides: user, organizationId, agents, apiFetch, navigate, showToast
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```tsx
|
|
17
|
+
* import { usePlatform } from "@palettelab/sdk/hooks"
|
|
18
|
+
*
|
|
19
|
+
* function MyPlugin() {
|
|
20
|
+
* const { user, apiFetch, showToast } = usePlatform()
|
|
21
|
+
* // ...
|
|
22
|
+
* }
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
declare function usePlatform(): PlatformContext;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Hook for managing tasks from within a plugin.
|
|
29
|
+
*
|
|
30
|
+
* @param agentId - Optional agent ID to filter tasks
|
|
31
|
+
*/
|
|
32
|
+
declare function usePluginTasks(agentId?: number): {
|
|
33
|
+
tasks: Task[];
|
|
34
|
+
stats: TaskStats | null;
|
|
35
|
+
loading: boolean;
|
|
36
|
+
createTask: (payload: TaskCreatePayload) => Promise<Task>;
|
|
37
|
+
updateTask: (taskId: number, payload: TaskUpdatePayload) => Promise<Task>;
|
|
38
|
+
deleteTask: (taskId: number) => Promise<void>;
|
|
39
|
+
refetch: () => Promise<void>;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Hook for accessing data rooms from within a plugin.
|
|
44
|
+
*/
|
|
45
|
+
declare function usePluginDataRooms(): {
|
|
46
|
+
rooms: DataRoom[];
|
|
47
|
+
loading: boolean;
|
|
48
|
+
fetchFolder: (roomId: number, folderId?: number) => Promise<{
|
|
49
|
+
folders: DataRoomFolder[];
|
|
50
|
+
files: DataRoomFile[];
|
|
51
|
+
}>;
|
|
52
|
+
refetch: () => Promise<void>;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Hook for chat functionality within a plugin.
|
|
57
|
+
* Supports creating threads, sending messages, and SSE streaming.
|
|
58
|
+
*/
|
|
59
|
+
declare function usePluginChat(agentId: number): {
|
|
60
|
+
threads: ChatThread[];
|
|
61
|
+
messages: ChatMessage[];
|
|
62
|
+
streaming: boolean;
|
|
63
|
+
activeThreadId: string | null;
|
|
64
|
+
fetchThreads: () => Promise<void>;
|
|
65
|
+
createThread: () => Promise<ChatThread>;
|
|
66
|
+
fetchMessages: (threadId: string) => Promise<void>;
|
|
67
|
+
sendMessage: (threadId: string, content: string) => Promise<void>;
|
|
68
|
+
stopStreaming: () => void;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export { PlatformCtx, usePlatform, usePluginChat, usePluginDataRooms, usePluginTasks };
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { P as PlatformContext } from '../plugin-CQH23f5N.js';
|
|
3
|
+
import { T as Task, i as TaskStats, g as TaskCreatePayload, l as TaskUpdatePayload, D as DataRoom, d as DataRoomFolder, c as DataRoomFile, b as ChatThread, a as ChatMessage } from '../data-room-BP0PjYoe.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* React context for platform services.
|
|
7
|
+
* The platform runtime provides this — plugin developers consume it.
|
|
8
|
+
*/
|
|
9
|
+
declare const PlatformCtx: react.Context<PlatformContext | null>;
|
|
10
|
+
/**
|
|
11
|
+
* Access the platform context from within a plugin component.
|
|
12
|
+
*
|
|
13
|
+
* Provides: user, organizationId, agents, apiFetch, navigate, showToast
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```tsx
|
|
17
|
+
* import { usePlatform } from "@palettelab/sdk/hooks"
|
|
18
|
+
*
|
|
19
|
+
* function MyPlugin() {
|
|
20
|
+
* const { user, apiFetch, showToast } = usePlatform()
|
|
21
|
+
* // ...
|
|
22
|
+
* }
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
declare function usePlatform(): PlatformContext;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Hook for managing tasks from within a plugin.
|
|
29
|
+
*
|
|
30
|
+
* @param agentId - Optional agent ID to filter tasks
|
|
31
|
+
*/
|
|
32
|
+
declare function usePluginTasks(agentId?: number): {
|
|
33
|
+
tasks: Task[];
|
|
34
|
+
stats: TaskStats | null;
|
|
35
|
+
loading: boolean;
|
|
36
|
+
createTask: (payload: TaskCreatePayload) => Promise<Task>;
|
|
37
|
+
updateTask: (taskId: number, payload: TaskUpdatePayload) => Promise<Task>;
|
|
38
|
+
deleteTask: (taskId: number) => Promise<void>;
|
|
39
|
+
refetch: () => Promise<void>;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Hook for accessing data rooms from within a plugin.
|
|
44
|
+
*/
|
|
45
|
+
declare function usePluginDataRooms(): {
|
|
46
|
+
rooms: DataRoom[];
|
|
47
|
+
loading: boolean;
|
|
48
|
+
fetchFolder: (roomId: number, folderId?: number) => Promise<{
|
|
49
|
+
folders: DataRoomFolder[];
|
|
50
|
+
files: DataRoomFile[];
|
|
51
|
+
}>;
|
|
52
|
+
refetch: () => Promise<void>;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Hook for chat functionality within a plugin.
|
|
57
|
+
* Supports creating threads, sending messages, and SSE streaming.
|
|
58
|
+
*/
|
|
59
|
+
declare function usePluginChat(agentId: number): {
|
|
60
|
+
threads: ChatThread[];
|
|
61
|
+
messages: ChatMessage[];
|
|
62
|
+
streaming: boolean;
|
|
63
|
+
activeThreadId: string | null;
|
|
64
|
+
fetchThreads: () => Promise<void>;
|
|
65
|
+
createThread: () => Promise<ChatThread>;
|
|
66
|
+
fetchMessages: (threadId: string) => Promise<void>;
|
|
67
|
+
sendMessage: (threadId: string, content: string) => Promise<void>;
|
|
68
|
+
stopStreaming: () => void;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export { PlatformCtx, usePlatform, usePluginChat, usePluginDataRooms, usePluginTasks };
|