@iblai/web-utils 1.6.1 → 1.6.3
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/data-layer/src/features/claw/api-slice.d.ts +5471 -0
- package/dist/data-layer/src/features/claw/constants.d.ts +126 -0
- package/dist/data-layer/src/features/claw/types.d.ts +275 -0
- package/dist/data-layer/src/features/utils.d.ts +22 -7
- package/dist/data-layer/src/index.d.ts +3 -0
- package/dist/index.d.ts +22 -4
- package/dist/index.esm.js +723 -51
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +723 -50
- package/dist/index.js.map +1 -1
- package/dist/package.json +1 -1
- package/dist/web-utils/src/utils/auth.d.ts +18 -0
- package/package.json +1 -1
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { SERVICES } from '@data-layer/constants';
|
|
2
|
+
export declare const CLAW_REDUCER_PATH = "clawApiSlice";
|
|
3
|
+
export declare const CLAW_TAG_TYPES: readonly ["ClawMentorConfig", "ClawInstances", "AgentConfig", "AgentSkills", "AgentSkillResources", "MentorSkillAssignments"];
|
|
4
|
+
export declare const CLAW_ENDPOINTS: {
|
|
5
|
+
readonly GET_MENTOR_CONFIG: {
|
|
6
|
+
readonly path: (org: string, mentorUniqueId: string) => string;
|
|
7
|
+
readonly service: SERVICES.DM;
|
|
8
|
+
};
|
|
9
|
+
readonly CREATE_MENTOR_CONFIG: {
|
|
10
|
+
readonly path: (org: string, mentorUniqueId: string) => string;
|
|
11
|
+
readonly service: SERVICES.DM;
|
|
12
|
+
};
|
|
13
|
+
readonly UPDATE_MENTOR_CONFIG: {
|
|
14
|
+
readonly path: (org: string, mentorUniqueId: string) => string;
|
|
15
|
+
readonly service: SERVICES.DM;
|
|
16
|
+
};
|
|
17
|
+
readonly DELETE_MENTOR_CONFIG: {
|
|
18
|
+
readonly path: (org: string, mentorUniqueId: string) => string;
|
|
19
|
+
readonly service: SERVICES.DM;
|
|
20
|
+
};
|
|
21
|
+
readonly PUSH_CONFIG: {
|
|
22
|
+
readonly path: (org: string, mentorUniqueId: string) => string;
|
|
23
|
+
readonly service: SERVICES.DM;
|
|
24
|
+
};
|
|
25
|
+
readonly GET_INSTANCES: {
|
|
26
|
+
readonly path: (org: string) => string;
|
|
27
|
+
readonly service: SERVICES.DM;
|
|
28
|
+
};
|
|
29
|
+
readonly GET_INSTANCE: {
|
|
30
|
+
readonly path: (org: string, id: number) => string;
|
|
31
|
+
readonly service: SERVICES.DM;
|
|
32
|
+
};
|
|
33
|
+
readonly CREATE_INSTANCE: {
|
|
34
|
+
readonly path: (org: string) => string;
|
|
35
|
+
readonly service: SERVICES.DM;
|
|
36
|
+
};
|
|
37
|
+
readonly UPDATE_INSTANCE: {
|
|
38
|
+
readonly path: (org: string, id: number) => string;
|
|
39
|
+
readonly service: SERVICES.DM;
|
|
40
|
+
};
|
|
41
|
+
readonly DELETE_INSTANCE: {
|
|
42
|
+
readonly path: (org: string, id: number) => string;
|
|
43
|
+
readonly service: SERVICES.DM;
|
|
44
|
+
};
|
|
45
|
+
readonly HEALTH_CHECK_INSTANCE: {
|
|
46
|
+
readonly path: (org: string, id: number) => string;
|
|
47
|
+
readonly service: SERVICES.DM;
|
|
48
|
+
};
|
|
49
|
+
readonly TEST_CONNECTIVITY_INSTANCE: {
|
|
50
|
+
readonly path: (org: string, id: number) => string;
|
|
51
|
+
readonly service: SERVICES.DM;
|
|
52
|
+
};
|
|
53
|
+
readonly REFRESH_VERSION_INSTANCE: {
|
|
54
|
+
readonly path: (org: string, id: number) => string;
|
|
55
|
+
readonly service: SERVICES.DM;
|
|
56
|
+
};
|
|
57
|
+
readonly GET_AGENT_CONFIG: {
|
|
58
|
+
readonly path: (org: string, mentorUniqueId: string) => string;
|
|
59
|
+
readonly service: SERVICES.DM;
|
|
60
|
+
};
|
|
61
|
+
/** PATCH is upsert — first write bootstraps the row, no separate POST. */
|
|
62
|
+
readonly UPDATE_AGENT_CONFIG: {
|
|
63
|
+
readonly path: (org: string, mentorUniqueId: string) => string;
|
|
64
|
+
readonly service: SERVICES.DM;
|
|
65
|
+
};
|
|
66
|
+
readonly GET_AGENT_SKILLS: {
|
|
67
|
+
readonly path: (org: string) => string;
|
|
68
|
+
readonly service: SERVICES.DM;
|
|
69
|
+
};
|
|
70
|
+
readonly GET_AGENT_SKILL: {
|
|
71
|
+
readonly path: (org: string, id: number) => string;
|
|
72
|
+
readonly service: SERVICES.DM;
|
|
73
|
+
};
|
|
74
|
+
readonly CREATE_AGENT_SKILL: {
|
|
75
|
+
readonly path: (org: string) => string;
|
|
76
|
+
readonly service: SERVICES.DM;
|
|
77
|
+
};
|
|
78
|
+
readonly UPDATE_AGENT_SKILL: {
|
|
79
|
+
readonly path: (org: string, id: number) => string;
|
|
80
|
+
readonly service: SERVICES.DM;
|
|
81
|
+
};
|
|
82
|
+
readonly DELETE_AGENT_SKILL: {
|
|
83
|
+
readonly path: (org: string, id: number) => string;
|
|
84
|
+
readonly service: SERVICES.DM;
|
|
85
|
+
};
|
|
86
|
+
readonly GET_AGENT_SKILL_RESOURCES: {
|
|
87
|
+
readonly path: (org: string) => string;
|
|
88
|
+
readonly service: SERVICES.DM;
|
|
89
|
+
};
|
|
90
|
+
readonly GET_AGENT_SKILL_RESOURCE: {
|
|
91
|
+
readonly path: (org: string, id: number) => string;
|
|
92
|
+
readonly service: SERVICES.DM;
|
|
93
|
+
};
|
|
94
|
+
readonly CREATE_AGENT_SKILL_RESOURCE: {
|
|
95
|
+
readonly path: (org: string) => string;
|
|
96
|
+
readonly service: SERVICES.DM;
|
|
97
|
+
};
|
|
98
|
+
readonly UPDATE_AGENT_SKILL_RESOURCE: {
|
|
99
|
+
readonly path: (org: string, id: number) => string;
|
|
100
|
+
readonly service: SERVICES.DM;
|
|
101
|
+
};
|
|
102
|
+
readonly DELETE_AGENT_SKILL_RESOURCE: {
|
|
103
|
+
readonly path: (org: string, id: number) => string;
|
|
104
|
+
readonly service: SERVICES.DM;
|
|
105
|
+
};
|
|
106
|
+
readonly GET_MENTOR_SKILL_ASSIGNMENTS: {
|
|
107
|
+
readonly path: (org: string, mentorUniqueId: string) => string;
|
|
108
|
+
readonly service: SERVICES.DM;
|
|
109
|
+
};
|
|
110
|
+
readonly CREATE_MENTOR_SKILL_ASSIGNMENT: {
|
|
111
|
+
readonly path: (org: string, mentorUniqueId: string) => string;
|
|
112
|
+
readonly service: SERVICES.DM;
|
|
113
|
+
};
|
|
114
|
+
readonly GET_MENTOR_SKILL_ASSIGNMENT: {
|
|
115
|
+
readonly path: (org: string, mentorUniqueId: string, assignmentPk: number) => string;
|
|
116
|
+
readonly service: SERVICES.DM;
|
|
117
|
+
};
|
|
118
|
+
readonly UPDATE_MENTOR_SKILL_ASSIGNMENT: {
|
|
119
|
+
readonly path: (org: string, mentorUniqueId: string, assignmentPk: number) => string;
|
|
120
|
+
readonly service: SERVICES.DM;
|
|
121
|
+
};
|
|
122
|
+
readonly DELETE_MENTOR_SKILL_ASSIGNMENT: {
|
|
123
|
+
readonly path: (org: string, mentorUniqueId: string, assignmentPk: number) => string;
|
|
124
|
+
readonly service: SERVICES.DM;
|
|
125
|
+
};
|
|
126
|
+
};
|
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
export interface ClawBaseParams {
|
|
2
|
+
org: string;
|
|
3
|
+
}
|
|
4
|
+
export interface ClawMentorConfig {
|
|
5
|
+
id: number;
|
|
6
|
+
mentor: string;
|
|
7
|
+
server: number;
|
|
8
|
+
server_name: string;
|
|
9
|
+
server_status: string;
|
|
10
|
+
server_last_health_status: string | null;
|
|
11
|
+
server_last_health_check: string | null;
|
|
12
|
+
agent_config: Record<string, unknown>;
|
|
13
|
+
/** OpenClaw worker agent identifier. Defaults to "main". */
|
|
14
|
+
agent_id: string;
|
|
15
|
+
enabled: boolean;
|
|
16
|
+
auto_push: boolean;
|
|
17
|
+
last_config_push: string | null;
|
|
18
|
+
last_config_push_status: string | null;
|
|
19
|
+
last_push_warnings: string[];
|
|
20
|
+
}
|
|
21
|
+
export interface GetClawMentorConfigParams extends ClawBaseParams {
|
|
22
|
+
mentorUniqueId: string;
|
|
23
|
+
}
|
|
24
|
+
export interface CreateClawMentorConfigParams extends ClawBaseParams {
|
|
25
|
+
mentorUniqueId: string;
|
|
26
|
+
server: number;
|
|
27
|
+
enabled?: boolean;
|
|
28
|
+
/** OpenClaw worker agent identifier. Omit to accept default "main". */
|
|
29
|
+
agent_id?: string;
|
|
30
|
+
}
|
|
31
|
+
export interface UpdateClawMentorConfigParams extends ClawBaseParams {
|
|
32
|
+
mentorUniqueId: string;
|
|
33
|
+
server?: number;
|
|
34
|
+
enabled?: boolean;
|
|
35
|
+
auto_push?: boolean;
|
|
36
|
+
agent_config?: Record<string, unknown>;
|
|
37
|
+
agent_id?: string;
|
|
38
|
+
}
|
|
39
|
+
export interface DeleteClawMentorConfigParams extends ClawBaseParams {
|
|
40
|
+
mentorUniqueId: string;
|
|
41
|
+
}
|
|
42
|
+
export interface PushClawConfigParams extends ClawBaseParams {
|
|
43
|
+
mentorUniqueId: string;
|
|
44
|
+
}
|
|
45
|
+
export interface ClawInstance {
|
|
46
|
+
id: number;
|
|
47
|
+
name: string;
|
|
48
|
+
claw_type: string;
|
|
49
|
+
provision_mode: string;
|
|
50
|
+
server_url: string;
|
|
51
|
+
deployment_backend: number | null;
|
|
52
|
+
status: string;
|
|
53
|
+
deploy_state: string;
|
|
54
|
+
last_health_check: string | null;
|
|
55
|
+
last_health_status: string | null;
|
|
56
|
+
claw_version: string | null;
|
|
57
|
+
platform_key: string;
|
|
58
|
+
created_at: string;
|
|
59
|
+
updated_at: string;
|
|
60
|
+
}
|
|
61
|
+
export interface PaginatedClawInstanceList {
|
|
62
|
+
count: number;
|
|
63
|
+
next: string | null;
|
|
64
|
+
previous: string | null;
|
|
65
|
+
results: ClawInstance[];
|
|
66
|
+
}
|
|
67
|
+
export interface GetClawInstancesParams extends ClawBaseParams {
|
|
68
|
+
}
|
|
69
|
+
export interface GetClawInstanceParams extends ClawBaseParams {
|
|
70
|
+
id: number;
|
|
71
|
+
}
|
|
72
|
+
export interface CreateClawInstanceParams extends ClawBaseParams {
|
|
73
|
+
name: string;
|
|
74
|
+
claw_type: string;
|
|
75
|
+
server_url: string;
|
|
76
|
+
gateway_token?: string;
|
|
77
|
+
auth_headers?: Record<string, string>;
|
|
78
|
+
connection_params?: Record<string, unknown>;
|
|
79
|
+
deployment_backend?: number | null;
|
|
80
|
+
}
|
|
81
|
+
export interface UpdateClawInstanceParams extends ClawBaseParams {
|
|
82
|
+
id: number;
|
|
83
|
+
name?: string;
|
|
84
|
+
claw_type?: string;
|
|
85
|
+
server_url?: string;
|
|
86
|
+
gateway_token?: string;
|
|
87
|
+
auth_headers?: Record<string, string>;
|
|
88
|
+
connection_params?: Record<string, unknown>;
|
|
89
|
+
deployment_backend?: number | null;
|
|
90
|
+
}
|
|
91
|
+
export interface DeleteClawInstanceParams extends ClawBaseParams {
|
|
92
|
+
id: number;
|
|
93
|
+
}
|
|
94
|
+
/** Response for health-check / test-connectivity actions on an instance.
|
|
95
|
+
* Backend shape is unstable — keep it permissive so the UI can surface any
|
|
96
|
+
* status/message the server returns. */
|
|
97
|
+
export interface ClawInstanceCheckResponse {
|
|
98
|
+
ok?: boolean;
|
|
99
|
+
status?: string;
|
|
100
|
+
message?: string;
|
|
101
|
+
detail?: string;
|
|
102
|
+
health_status?: string;
|
|
103
|
+
claw_version?: string;
|
|
104
|
+
last_health_check?: string;
|
|
105
|
+
[key: string]: unknown;
|
|
106
|
+
}
|
|
107
|
+
export interface ClawInstanceActionParams extends ClawBaseParams {
|
|
108
|
+
id: number;
|
|
109
|
+
}
|
|
110
|
+
export interface AgentConfig {
|
|
111
|
+
id: number;
|
|
112
|
+
mentor: string;
|
|
113
|
+
identity: string;
|
|
114
|
+
soul: string;
|
|
115
|
+
user_context: string;
|
|
116
|
+
tools: string;
|
|
117
|
+
agents: string;
|
|
118
|
+
bootstrap: string;
|
|
119
|
+
heartbeat: string;
|
|
120
|
+
memory: string;
|
|
121
|
+
model: string;
|
|
122
|
+
config: Record<string, unknown>;
|
|
123
|
+
created_at: string;
|
|
124
|
+
updated_at: string;
|
|
125
|
+
}
|
|
126
|
+
export interface GetAgentConfigParams extends ClawBaseParams {
|
|
127
|
+
mentorUniqueId: string;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* PATCH is upsert — first write bootstraps the row, no separate POST.
|
|
131
|
+
*/
|
|
132
|
+
export interface UpdateAgentConfigParams extends ClawBaseParams {
|
|
133
|
+
mentorUniqueId: string;
|
|
134
|
+
identity?: string;
|
|
135
|
+
soul?: string;
|
|
136
|
+
user_context?: string;
|
|
137
|
+
tools?: string;
|
|
138
|
+
agents?: string;
|
|
139
|
+
bootstrap?: string;
|
|
140
|
+
heartbeat?: string;
|
|
141
|
+
memory?: string;
|
|
142
|
+
model?: string;
|
|
143
|
+
config?: Record<string, unknown>;
|
|
144
|
+
}
|
|
145
|
+
export interface AgentSkill {
|
|
146
|
+
id: number;
|
|
147
|
+
/** Stable UUID — preferred identifier for write bodies (e.g. skill assignments). */
|
|
148
|
+
unique_id: string;
|
|
149
|
+
name: string;
|
|
150
|
+
slug: string;
|
|
151
|
+
description: string;
|
|
152
|
+
version: string;
|
|
153
|
+
instruction: string;
|
|
154
|
+
metadata: Record<string, unknown>;
|
|
155
|
+
enabled: boolean;
|
|
156
|
+
platform_key: string;
|
|
157
|
+
created_at: string;
|
|
158
|
+
updated_at: string;
|
|
159
|
+
}
|
|
160
|
+
export interface PaginatedAgentSkillList {
|
|
161
|
+
count: number;
|
|
162
|
+
next: string | null;
|
|
163
|
+
previous: string | null;
|
|
164
|
+
results: AgentSkill[];
|
|
165
|
+
}
|
|
166
|
+
export interface GetAgentSkillsParams extends ClawBaseParams {
|
|
167
|
+
}
|
|
168
|
+
export interface GetAgentSkillParams extends ClawBaseParams {
|
|
169
|
+
id: number;
|
|
170
|
+
}
|
|
171
|
+
export interface CreateAgentSkillParams extends ClawBaseParams {
|
|
172
|
+
name: string;
|
|
173
|
+
slug: string;
|
|
174
|
+
description?: string;
|
|
175
|
+
version?: string;
|
|
176
|
+
instruction?: string;
|
|
177
|
+
metadata?: Record<string, unknown>;
|
|
178
|
+
enabled?: boolean;
|
|
179
|
+
}
|
|
180
|
+
export interface UpdateAgentSkillParams extends ClawBaseParams {
|
|
181
|
+
id: number;
|
|
182
|
+
name?: string;
|
|
183
|
+
slug?: string;
|
|
184
|
+
description?: string;
|
|
185
|
+
version?: string;
|
|
186
|
+
instruction?: string;
|
|
187
|
+
metadata?: Record<string, unknown>;
|
|
188
|
+
enabled?: boolean;
|
|
189
|
+
}
|
|
190
|
+
export interface DeleteAgentSkillParams extends ClawBaseParams {
|
|
191
|
+
id: number;
|
|
192
|
+
}
|
|
193
|
+
export type AgentSkillResourceFileType = 'script' | 'reference' | 'asset';
|
|
194
|
+
export interface AgentSkillResource {
|
|
195
|
+
id: number;
|
|
196
|
+
skill: number;
|
|
197
|
+
file_type: AgentSkillResourceFileType | string;
|
|
198
|
+
name: string;
|
|
199
|
+
url?: string;
|
|
200
|
+
content?: string;
|
|
201
|
+
metadata?: Record<string, unknown>;
|
|
202
|
+
created_at: string;
|
|
203
|
+
updated_at: string;
|
|
204
|
+
}
|
|
205
|
+
export interface PaginatedAgentSkillResourceList {
|
|
206
|
+
count: number;
|
|
207
|
+
next: string | null;
|
|
208
|
+
previous: string | null;
|
|
209
|
+
results: AgentSkillResource[];
|
|
210
|
+
}
|
|
211
|
+
export interface GetAgentSkillResourcesParams extends ClawBaseParams {
|
|
212
|
+
skill?: number;
|
|
213
|
+
file_type?: AgentSkillResourceFileType | string;
|
|
214
|
+
}
|
|
215
|
+
export interface GetAgentSkillResourceParams extends ClawBaseParams {
|
|
216
|
+
id: number;
|
|
217
|
+
}
|
|
218
|
+
export interface CreateAgentSkillResourceParams extends ClawBaseParams {
|
|
219
|
+
skill: number;
|
|
220
|
+
file_type: AgentSkillResourceFileType | string;
|
|
221
|
+
name: string;
|
|
222
|
+
url?: string;
|
|
223
|
+
content?: string;
|
|
224
|
+
metadata?: Record<string, unknown>;
|
|
225
|
+
}
|
|
226
|
+
export interface UpdateAgentSkillResourceParams extends ClawBaseParams {
|
|
227
|
+
id: number;
|
|
228
|
+
skill?: number;
|
|
229
|
+
file_type?: AgentSkillResourceFileType | string;
|
|
230
|
+
name?: string;
|
|
231
|
+
url?: string;
|
|
232
|
+
content?: string;
|
|
233
|
+
metadata?: Record<string, unknown>;
|
|
234
|
+
}
|
|
235
|
+
export interface DeleteAgentSkillResourceParams extends ClawBaseParams {
|
|
236
|
+
id: number;
|
|
237
|
+
}
|
|
238
|
+
export interface MentorSkillAssignment {
|
|
239
|
+
id: number;
|
|
240
|
+
mentor: string;
|
|
241
|
+
/** Skill UUID — the new stable identifier. */
|
|
242
|
+
skill: string;
|
|
243
|
+
skill_name: string;
|
|
244
|
+
enabled: boolean;
|
|
245
|
+
created_at: string;
|
|
246
|
+
updated_at: string;
|
|
247
|
+
}
|
|
248
|
+
export interface PaginatedMentorSkillAssignmentList {
|
|
249
|
+
count: number;
|
|
250
|
+
next: string | null;
|
|
251
|
+
previous: string | null;
|
|
252
|
+
results: MentorSkillAssignment[];
|
|
253
|
+
}
|
|
254
|
+
export interface GetMentorSkillAssignmentsParams extends ClawBaseParams {
|
|
255
|
+
mentorUniqueId: string;
|
|
256
|
+
}
|
|
257
|
+
export interface GetMentorSkillAssignmentParams extends ClawBaseParams {
|
|
258
|
+
mentorUniqueId: string;
|
|
259
|
+
assignmentPk: number;
|
|
260
|
+
}
|
|
261
|
+
export interface CreateMentorSkillAssignmentParams extends ClawBaseParams {
|
|
262
|
+
mentorUniqueId: string;
|
|
263
|
+
/** Skill UUID — the create endpoint references skills by UUID, not integer PK. */
|
|
264
|
+
skill: string;
|
|
265
|
+
enabled?: boolean;
|
|
266
|
+
}
|
|
267
|
+
export interface UpdateMentorSkillAssignmentParams extends ClawBaseParams {
|
|
268
|
+
mentorUniqueId: string;
|
|
269
|
+
assignmentPk: number;
|
|
270
|
+
enabled?: boolean;
|
|
271
|
+
}
|
|
272
|
+
export interface DeleteMentorSkillAssignmentParams extends ClawBaseParams {
|
|
273
|
+
mentorUniqueId: string;
|
|
274
|
+
assignmentPk: number;
|
|
275
|
+
}
|
|
@@ -17,20 +17,28 @@ export declare const getHeaders: (service: SERVICES) => Promise<{
|
|
|
17
17
|
} | undefined>;
|
|
18
18
|
/**
|
|
19
19
|
* Build a generic RTK Query endpoint from a service function.
|
|
20
|
+
* Includes built-in retry with exponential backoff (since RTK Query
|
|
21
|
+
* skips baseQuery retry for queryFn endpoints).
|
|
20
22
|
*/
|
|
21
|
-
export declare const buildEndpointFromService: <Args extends Record<string, unknown>, Result>(service: SERVICES, serviceFn: (args: Args) => Promise<Result
|
|
23
|
+
export declare const buildEndpointFromService: <Args extends Record<string, unknown>, Result>(service: SERVICES, serviceFn: (args: Args) => Promise<Result>, options?: {
|
|
24
|
+
maxRetries?: number;
|
|
25
|
+
}) => {
|
|
22
26
|
queryFn: BaseQueryFn<Args, Result, FetchBaseQueryError | CustomError>;
|
|
23
27
|
};
|
|
24
28
|
/**
|
|
25
29
|
* Shortcut for building an endpoint using the DM service.
|
|
26
30
|
*/
|
|
27
|
-
export declare const buildEndpointFromDmService: <Args extends Record<string, unknown>, Result>(serviceFn: (args: Args) => Promise<Result
|
|
31
|
+
export declare const buildEndpointFromDmService: <Args extends Record<string, unknown>, Result>(serviceFn: (args: Args) => Promise<Result>, options?: {
|
|
32
|
+
maxRetries?: number;
|
|
33
|
+
}) => {
|
|
28
34
|
queryFn: BaseQueryFn<Args, Result, FetchBaseQueryError | CustomError>;
|
|
29
35
|
};
|
|
30
36
|
/**
|
|
31
37
|
* Shortcut for building an endpoint using the AXD service.
|
|
32
38
|
*/
|
|
33
|
-
export declare const buildEndpointFromAxdService: <Args extends Record<string, unknown>, Result>(serviceFn: (args: Args) => Promise<Result
|
|
39
|
+
export declare const buildEndpointFromAxdService: <Args extends Record<string, unknown>, Result>(serviceFn: (args: Args) => Promise<Result>, options?: {
|
|
40
|
+
maxRetries?: number;
|
|
41
|
+
}) => {
|
|
34
42
|
queryFn: BaseQueryFn<Args, Result, FetchBaseQueryError | CustomError>;
|
|
35
43
|
};
|
|
36
44
|
export interface CustomQueryArgs extends Omit<FetchArgs, 'url'> {
|
|
@@ -50,20 +58,27 @@ export type ExtendedFetchBaseQueryError = FetchBaseQueryError & {
|
|
|
50
58
|
};
|
|
51
59
|
export declare const iblFetchBaseQuery: BaseQueryFn<CustomQueryArgs, unknown, ExtendedFetchBaseQueryError, Record<string, unknown>, FetchBaseQueryMeta>;
|
|
52
60
|
/**
|
|
53
|
-
* Build a generic RTK Query endpoint from a service function.
|
|
61
|
+
* Build a generic RTK Query endpoint from a service function (legacy variant).
|
|
62
|
+
* Includes built-in retry with exponential backoff.
|
|
54
63
|
*/
|
|
55
|
-
export declare const buildEndpointFromServiceLegacy: <Args extends any[], Result>(service: SERVICES, serviceFn: (...args: Args) => Promise<Result
|
|
64
|
+
export declare const buildEndpointFromServiceLegacy: <Args extends any[], Result>(service: SERVICES, serviceFn: (...args: Args) => Promise<Result>, options?: {
|
|
65
|
+
maxRetries?: number;
|
|
66
|
+
}) => {
|
|
56
67
|
queryFn: BaseQueryFn<Args, Result, FetchBaseQueryError | CustomError>;
|
|
57
68
|
};
|
|
58
69
|
/**
|
|
59
70
|
* Shortcut for building an endpoint using the DM service.
|
|
60
71
|
*/
|
|
61
|
-
export declare const buildEndpointFromDmServiceLegacy: <Args extends any[], Result>(serviceFn: (...args: Args) => Promise<Result
|
|
72
|
+
export declare const buildEndpointFromDmServiceLegacy: <Args extends any[], Result>(serviceFn: (...args: Args) => Promise<Result>, options?: {
|
|
73
|
+
maxRetries?: number;
|
|
74
|
+
}) => {
|
|
62
75
|
queryFn: BaseQueryFn<Args, Result, FetchBaseQueryError | CustomError>;
|
|
63
76
|
};
|
|
64
77
|
/**
|
|
65
78
|
* Shortcut for building an endpoint using the AXD service.
|
|
66
79
|
*/
|
|
67
|
-
export declare const buildEndpointFromAxdServiceLegacy: <Args extends any[], Result>(serviceFn: (...args: Args) => Promise<Result
|
|
80
|
+
export declare const buildEndpointFromAxdServiceLegacy: <Args extends any[], Result>(serviceFn: (...args: Args) => Promise<Result>, options?: {
|
|
81
|
+
maxRetries?: number;
|
|
82
|
+
}) => {
|
|
68
83
|
queryFn: BaseQueryFn<Args, Result, FetchBaseQueryError | CustomError>;
|
|
69
84
|
};
|
|
@@ -69,6 +69,9 @@ export * from './features/memory/types';
|
|
|
69
69
|
export * from './features/mcp/api-slice';
|
|
70
70
|
export * from './features/mcp/constants';
|
|
71
71
|
export * from './features/mcp/types';
|
|
72
|
+
export * from './features/claw/api-slice';
|
|
73
|
+
export * from './features/claw/constants';
|
|
74
|
+
export * from './features/claw/types';
|
|
72
75
|
export * from './features/constants';
|
|
73
76
|
export * from './features/custom-domain/api-slice';
|
|
74
77
|
export * from './features/custom-domain/types';
|
package/dist/index.d.ts
CHANGED
|
@@ -682,6 +682,12 @@ declare function setCookieForAuth(name: string, value: string, days?: number): v
|
|
|
682
682
|
* Clear all cookies for the current domain
|
|
683
683
|
*/
|
|
684
684
|
declare function clearCookies(): void;
|
|
685
|
+
/**
|
|
686
|
+
* Get the value of a cookie by name
|
|
687
|
+
* @param name - Cookie name
|
|
688
|
+
* @returns The cookie value or null if not found
|
|
689
|
+
*/
|
|
690
|
+
declare function getCookieValue(name: string): string | null;
|
|
685
691
|
/**
|
|
686
692
|
* Check if user is currently logged in
|
|
687
693
|
* @param tokenKey - The localStorage key for the auth token (default: 'axd_token')
|
|
@@ -722,7 +728,19 @@ interface RedirectToAuthSpaOptions {
|
|
|
722
728
|
userData?: string;
|
|
723
729
|
tenant?: string;
|
|
724
730
|
logoutTimestamp?: string;
|
|
731
|
+
loginTimestamp?: string;
|
|
732
|
+
tenantSwitching?: string;
|
|
725
733
|
};
|
|
734
|
+
/** Function to check if auth token is valid and non-expired. Used to skip redirect when a recent login occurred. */
|
|
735
|
+
hasNonExpiredAuthToken?: () => boolean;
|
|
736
|
+
/** Function to check if the app is in offline mode (e.g., Tauri offline). Skips redirect when true. */
|
|
737
|
+
isOffline?: () => boolean;
|
|
738
|
+
/** localStorage key for a token to preserve before clearing storage (e.g., 'edx_jwt_token') */
|
|
739
|
+
preserveTokenKey?: string;
|
|
740
|
+
/** Path to an auth redirect proxy endpoint (e.g., '/api/auth-redirect'). When set, redirects via this proxy in browser. */
|
|
741
|
+
authRedirectProxy?: string;
|
|
742
|
+
/** Function to check if the app is running as a native app (e.g., Tauri). Affects redirect behavior. */
|
|
743
|
+
isNativeApp?: () => boolean;
|
|
726
744
|
}
|
|
727
745
|
/**
|
|
728
746
|
* Redirect to authentication SPA for login/logout
|
|
@@ -1557,7 +1575,7 @@ type Props$2 = {
|
|
|
1557
1575
|
* 4. Handles redirects to auth SPA when needed
|
|
1558
1576
|
* 5. Manages public route access state
|
|
1559
1577
|
*/
|
|
1560
|
-
declare function AuthProvider({ children, fallback, middleware, onAuthSuccess, onAuthFailure, redirectToAuthSpa, hasNonExpiredAuthToken, username, pathname, storageService, token, enableStorageSync, skip, }: Props$2): string | number | bigint | boolean | Iterable<React__default.ReactNode> | Promise<string | number | bigint | boolean | React__default.ReactPortal | React__default.ReactElement<unknown, string | React__default.JSXElementConstructor<any>> | Iterable<React__default.ReactNode> | null | undefined> |
|
|
1578
|
+
declare function AuthProvider({ children, fallback, middleware, onAuthSuccess, onAuthFailure, redirectToAuthSpa, hasNonExpiredAuthToken, username, pathname, storageService, token, enableStorageSync, skip, }: Props$2): string | number | bigint | boolean | react_jsx_runtime.JSX.Element | Iterable<React__default.ReactNode> | Promise<string | number | bigint | boolean | React__default.ReactPortal | React__default.ReactElement<unknown, string | React__default.JSXElementConstructor<any>> | Iterable<React__default.ReactNode> | null | undefined> | null | undefined;
|
|
1561
1579
|
|
|
1562
1580
|
/**
|
|
1563
1581
|
* Props for the MentorProvider component
|
|
@@ -1590,7 +1608,7 @@ type Props$1 = {
|
|
|
1590
1608
|
* 3. Manages redirection based on mentor availability
|
|
1591
1609
|
* 4. Integrates with tenant context for access control
|
|
1592
1610
|
*/
|
|
1593
|
-
declare function MentorProvider({ children, fallback, onAuthSuccess, onAuthFailure, redirectToAuthSpa, redirectToMentor, onLoadMentorsPermissions, redirectToNoMentorsPage, redirectToCreateMentor, username, isAdmin, mainTenantKey, requestedMentorId, handleMentorNotFound, forceDetermineMentor, onComplete, skip, }: Props$1): string | number | bigint | boolean | Iterable<React__default.ReactNode> | Promise<string | number | bigint | boolean | React__default.ReactPortal | React__default.ReactElement<unknown, string | React__default.JSXElementConstructor<any>> | Iterable<React__default.ReactNode> | null | undefined> |
|
|
1611
|
+
declare function MentorProvider({ children, fallback, onAuthSuccess, onAuthFailure, redirectToAuthSpa, redirectToMentor, onLoadMentorsPermissions, redirectToNoMentorsPage, redirectToCreateMentor, username, isAdmin, mainTenantKey, requestedMentorId, handleMentorNotFound, forceDetermineMentor, onComplete, skip, }: Props$1): string | number | bigint | boolean | react_jsx_runtime.JSX.Element | Iterable<React__default.ReactNode> | Promise<string | number | bigint | boolean | React__default.ReactPortal | React__default.ReactElement<unknown, string | React__default.JSXElementConstructor<any>> | Iterable<React__default.ReactNode> | null | undefined> | null | undefined;
|
|
1594
1612
|
|
|
1595
1613
|
/**
|
|
1596
1614
|
* Type definition for the tenant context
|
|
@@ -1654,7 +1672,7 @@ type Props = {
|
|
|
1654
1672
|
* 4. Handles tenant-specific domain redirects
|
|
1655
1673
|
* 5. Maintains tenant access state
|
|
1656
1674
|
*/
|
|
1657
|
-
declare function TenantProvider({ children, fallback, onAuthSuccess, onAuthFailure, currentTenant, requestedTenant, saveCurrentTenant, saveUserTenants, handleTenantSwitch, saveVisitingTenant, removeVisitingTenant, saveUserTokens, saveTenant, onAutoJoinUserToTenant, redirectToAuthSpa, username, isIframed, setUseMentorProvider, skip, onLoadPlatformPermissions, skipCustomDomainCheck, onTenantMismatch, }: Props): string | number | bigint | boolean | Iterable<React__default.ReactNode> | Promise<string | number | bigint | boolean | React__default.ReactPortal | React__default.ReactElement<unknown, string | React__default.JSXElementConstructor<any>> | Iterable<React__default.ReactNode> | null | undefined> |
|
|
1675
|
+
declare function TenantProvider({ children, fallback, onAuthSuccess, onAuthFailure, currentTenant, requestedTenant, saveCurrentTenant, saveUserTenants, handleTenantSwitch, saveVisitingTenant, removeVisitingTenant, saveUserTokens, saveTenant, onAutoJoinUserToTenant, redirectToAuthSpa, username, isIframed, setUseMentorProvider, skip, onLoadPlatformPermissions, skipCustomDomainCheck, onTenantMismatch, }: Props): string | number | bigint | boolean | react_jsx_runtime.JSX.Element | Iterable<React__default.ReactNode> | Promise<string | number | bigint | boolean | React__default.ReactPortal | React__default.ReactElement<unknown, string | React__default.JSXElementConstructor<any>> | Iterable<React__default.ReactNode> | null | undefined> | null | undefined;
|
|
1658
1676
|
|
|
1659
1677
|
/**
|
|
1660
1678
|
* Chat area size constants
|
|
@@ -1768,5 +1786,5 @@ declare const WithPermissions: ({ rbacResource, rbacPermissions, children, }: Wi
|
|
|
1768
1786
|
*/
|
|
1769
1787
|
declare const checkRbacPermission: (rbacPermissions: object, rbacResource: string, enableRBAC?: boolean) => boolean;
|
|
1770
1788
|
|
|
1771
|
-
export { ALPHANUMERIC_32_REGEX, ANONYMOUS_USERNAME, AuthContext, AuthContextProvider, AuthProvider, CHAT_AREA_SIZE, LOCAL_STORAGE_KEYS, MAX_INITIAL_WEBSOCKET_CONNECTION_ATTEMPTS, MENTOR_CHAT_DOCUMENTS_EXTENSIONS, METADATAS, MentorProvider, REQUIRED_ACTIONS_FOR_GROUPS, STREAMING_CONTENT_BUFFER_THRESHOLD, STREAMING_CONTENT_FLUSH_INTERVAL, SUBSCRIPTION_MESSAGES, SUBSCRIPTION_PACKAGES, SUBSCRIPTION_PACKAGES_V2, SUBSCRIPTION_TRIGGERS, SUBSCRIPTION_V2_TRIGGERS, SubscriptionFlow, SubscriptionFlowV2, TOOLS, TenantContext, TenantContextProvider, TenantProvider, TimeTracker, WithFormPermissions, WithPermissions, addFiles, addProtocolToUrl, advancedTabs, advancedTabsProperties, chatActions, chatSliceReducerShared, checkModelAvailable, checkOllamaHealth, checkRbacPermission, clearAuthCookies, clearCookies, clearCurrentTenantCookie, clearFiles, combineCSVData, convertToOllamaMessages, createFileReference, createMultipleFileReferences, csvDataToText, defaultSessionIds, deleteCookie, deleteCookieOnAllDomains, filesReducer, filesSlice, formatRelativeTime, getAuthSpaJoinUrl, getDomainParts, getFileInfo, getInitials, getLocalLLMSystemPrompt, getNextNavigation, getParentDomain, getPlatform, getPlatformKey, getTimeAgo, getUserName, handleLogout, isAlphaNumeric32, isExpo, isInIframe, isJSON, isLoggedIn, isNode, isReactNative, isTauri, isWeb, loadMetadataConfig, markdownToPlainText, monetizationSlice, parseCSV, redirectToAuthSpa, redirectToAuthSpaJoinTenant, removeFile, requestPresignedUrl, safeRequire, selectActiveChatMessages, selectActiveTab, selectArtifactsEnabled, selectChats, selectCurrentStreamingArtifact, selectCurrentStreamingMessage, selectDocumentFilter, selectIframeContext, selectIsError, selectIsPending, selectIsStopped, selectIsTyping, selectLastArtifactContentFlushTime, selectMetadata, selectNumberOfActiveChatMessages, selectSessionId, selectSessionIds, selectShouldStartNewChat, selectShowingSharedChat, selectStatus, selectStreaming, selectStreamingArtifactContentBuffer, selectStreamingArtifactFullContent, selectToken, selectTokenEnabled, selectTools, sendMessageToParentWebsite, setAccessCheckResponse, setAdvancedDisplayMonetizationCheckoutModal, setCookieForAuth, setDisplayMonetizationCheckoutModal, showMonetizationCheckoutModal, streamOllamaChat, syncAuthToCookies, tenantKeySchema, tenantSchema, translatePrompt, updateFileMetadata, updateFileProgress, updateFileRetryCount, updateFileStatus, updateFileUrl, updateFileUrlFromWebSocket, uploadToS3, useAdvancedChat, useAuthContext, useAuthProvider, useChat, useDayJs, useExternalPricingPlan, useMentorSettings, useMentorTools, useProfileImageUpload, useStripeUpgrade, useSubscriptionHandler, useSubscriptionHandlerV2, useTenantContext, useTenantMetadata, useTimeTracker, useTimeTrackerNative, useUserProfileUpdate, userDataSchema, validateFile };
|
|
1789
|
+
export { ALPHANUMERIC_32_REGEX, ANONYMOUS_USERNAME, AuthContext, AuthContextProvider, AuthProvider, CHAT_AREA_SIZE, LOCAL_STORAGE_KEYS, MAX_INITIAL_WEBSOCKET_CONNECTION_ATTEMPTS, MENTOR_CHAT_DOCUMENTS_EXTENSIONS, METADATAS, MentorProvider, REQUIRED_ACTIONS_FOR_GROUPS, STREAMING_CONTENT_BUFFER_THRESHOLD, STREAMING_CONTENT_FLUSH_INTERVAL, SUBSCRIPTION_MESSAGES, SUBSCRIPTION_PACKAGES, SUBSCRIPTION_PACKAGES_V2, SUBSCRIPTION_TRIGGERS, SUBSCRIPTION_V2_TRIGGERS, SubscriptionFlow, SubscriptionFlowV2, TOOLS, TenantContext, TenantContextProvider, TenantProvider, TimeTracker, WithFormPermissions, WithPermissions, addFiles, addProtocolToUrl, advancedTabs, advancedTabsProperties, chatActions, chatSliceReducerShared, checkModelAvailable, checkOllamaHealth, checkRbacPermission, clearAuthCookies, clearCookies, clearCurrentTenantCookie, clearFiles, combineCSVData, convertToOllamaMessages, createFileReference, createMultipleFileReferences, csvDataToText, defaultSessionIds, deleteCookie, deleteCookieOnAllDomains, filesReducer, filesSlice, formatRelativeTime, getAuthSpaJoinUrl, getCookieValue, getDomainParts, getFileInfo, getInitials, getLocalLLMSystemPrompt, getNextNavigation, getParentDomain, getPlatform, getPlatformKey, getTimeAgo, getUserName, handleLogout, isAlphaNumeric32, isExpo, isInIframe, isJSON, isLoggedIn, isNode, isReactNative, isTauri, isWeb, loadMetadataConfig, markdownToPlainText, monetizationSlice, parseCSV, redirectToAuthSpa, redirectToAuthSpaJoinTenant, removeFile, requestPresignedUrl, safeRequire, selectActiveChatMessages, selectActiveTab, selectArtifactsEnabled, selectChats, selectCurrentStreamingArtifact, selectCurrentStreamingMessage, selectDocumentFilter, selectIframeContext, selectIsError, selectIsPending, selectIsStopped, selectIsTyping, selectLastArtifactContentFlushTime, selectMetadata, selectNumberOfActiveChatMessages, selectSessionId, selectSessionIds, selectShouldStartNewChat, selectShowingSharedChat, selectStatus, selectStreaming, selectStreamingArtifactContentBuffer, selectStreamingArtifactFullContent, selectToken, selectTokenEnabled, selectTools, sendMessageToParentWebsite, setAccessCheckResponse, setAdvancedDisplayMonetizationCheckoutModal, setCookieForAuth, setDisplayMonetizationCheckoutModal, showMonetizationCheckoutModal, streamOllamaChat, syncAuthToCookies, tenantKeySchema, tenantSchema, translatePrompt, updateFileMetadata, updateFileProgress, updateFileRetryCount, updateFileStatus, updateFileUrl, updateFileUrlFromWebSocket, uploadToS3, useAdvancedChat, useAuthContext, useAuthProvider, useChat, useDayJs, useExternalPricingPlan, useMentorSettings, useMentorTools, useProfileImageUpload, useStripeUpgrade, useSubscriptionHandler, useSubscriptionHandlerV2, useTenantContext, useTenantMetadata, useTimeTracker, useTimeTrackerNative, useUserProfileUpdate, userDataSchema, validateFile };
|
|
1772
1790
|
export type { AdvancedTab, ArtifactData, ArtifactPayload, ArtifactVersion, AttachedFile, AuthContextType, ChatMode, ChatSliceState, ChatState, ChatStatus, CreateStripeCustomerPortalRequest, Error402MessageData, FileAttachment, FileInfo, FileProcessingEvent, FileReference, FileUploadState, FilesState, HandleLogoutOptions, Message, MessageAction, MonetizationState, OAuthRequiredData, OAuthResolvedData, OllamaChatRequest, OllamaChatStreamResponse, OllamaMessage, OllamaStreamCallbacks, PricingModalData, Prompt, RedirectToAuthSpaOptions, SendMessageOptions, SessionIds, StreamingArtifact, StreamingMessage, StripeUpgradePlan, SubscriptionFlowConfig, SubscriptionFlowConfigV2, Tenant, TenantContextType, TenantKeyMentorIdParams, TenantMetadata, TimeTrackerConfig, TimeTrackerState, TopTrialBannerProps, UploadProgressCallback, UseChatProps, UseChatReturn, UseExternalPricingProps, UseProfileImageUploadOptions, UseProfileImageUploadReturn, UseTimeTrackerConfig, UseTimeTrackerNativeConfig, UseTimeTrackerNativeReturn, UseTimeTrackerReturn, UseUserProfileUpdateResult, UserProfileUpdateData };
|