@opensecret/react 1.5.4 → 3.0.0-alpha.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/LICENSE.md +7 -0
- package/dist/index.d.ts +121 -9
- package/dist/opensecret-react.es.js +1657 -1555
- package/dist/opensecret-react.umd.js +18 -18
- package/package.json +1 -1
package/LICENSE.md
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Copyright (c) 2024 OpenSecret
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
|
+
|
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/dist/index.d.ts
CHANGED
|
@@ -31,6 +31,35 @@ declare function acceptInvite(code: string): Promise<{
|
|
|
31
31
|
*/
|
|
32
32
|
declare function addConversationItems(conversationId: string, items: Partial<ConversationItem>[]): Promise<Conversation>;
|
|
33
33
|
|
|
34
|
+
export declare type AgentCreatedBy = "user" | "agent";
|
|
35
|
+
|
|
36
|
+
export declare type AgentDeletedObjectResponse = {
|
|
37
|
+
id: string;
|
|
38
|
+
object: string;
|
|
39
|
+
deleted: boolean;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export declare type AgentDoneEvent = {
|
|
43
|
+
total_steps: number;
|
|
44
|
+
total_messages: number;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export declare type AgentErrorEvent = {
|
|
48
|
+
error: string;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export declare type AgentItemsListParams = {
|
|
52
|
+
limit?: number;
|
|
53
|
+
after?: string;
|
|
54
|
+
order?: string;
|
|
55
|
+
include?: string[];
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export declare type AgentMessageEvent = {
|
|
59
|
+
messages: string[];
|
|
60
|
+
step: number;
|
|
61
|
+
};
|
|
62
|
+
|
|
34
63
|
declare namespace api {
|
|
35
64
|
export {
|
|
36
65
|
setApiUrl,
|
|
@@ -99,6 +128,16 @@ declare namespace api {
|
|
|
99
128
|
updateInstruction,
|
|
100
129
|
deleteInstruction,
|
|
101
130
|
setDefaultInstruction,
|
|
131
|
+
getMainAgent,
|
|
132
|
+
deleteMainAgent,
|
|
133
|
+
listMainAgentItems,
|
|
134
|
+
getMainAgentItem,
|
|
135
|
+
listSubagents,
|
|
136
|
+
getSubagent,
|
|
137
|
+
createSubagent,
|
|
138
|
+
deleteSubagent,
|
|
139
|
+
listSubagentItems,
|
|
140
|
+
getSubagentItem,
|
|
102
141
|
LoginResponse,
|
|
103
142
|
UserResponse,
|
|
104
143
|
KVListItem,
|
|
@@ -150,7 +189,18 @@ declare namespace api {
|
|
|
150
189
|
InstructionUpdateRequest,
|
|
151
190
|
InstructionListParams,
|
|
152
191
|
InstructionListResponse,
|
|
153
|
-
InstructionDeleteResponse
|
|
192
|
+
InstructionDeleteResponse,
|
|
193
|
+
CreateSubagentRequest,
|
|
194
|
+
AgentCreatedBy,
|
|
195
|
+
MainAgentResponse,
|
|
196
|
+
SubagentResponse,
|
|
197
|
+
AgentItemsListParams,
|
|
198
|
+
ListSubagentsParams,
|
|
199
|
+
SubagentListResponse,
|
|
200
|
+
AgentDeletedObjectResponse,
|
|
201
|
+
AgentMessageEvent,
|
|
202
|
+
AgentDoneEvent,
|
|
203
|
+
AgentErrorEvent
|
|
154
204
|
}
|
|
155
205
|
}
|
|
156
206
|
|
|
@@ -442,11 +492,11 @@ export declare type Conversation = {
|
|
|
442
492
|
id: string;
|
|
443
493
|
object: "conversation";
|
|
444
494
|
created_at: number;
|
|
445
|
-
metadata?: Record<string,
|
|
495
|
+
metadata?: Record<string, unknown>;
|
|
446
496
|
};
|
|
447
497
|
|
|
448
498
|
export declare type ConversationCreateRequest = {
|
|
449
|
-
metadata?: Record<string,
|
|
499
|
+
metadata?: Record<string, unknown>;
|
|
450
500
|
};
|
|
451
501
|
|
|
452
502
|
export declare type ConversationDeleteResponse = {
|
|
@@ -491,7 +541,7 @@ export declare type ConversationsListResponse = {
|
|
|
491
541
|
};
|
|
492
542
|
|
|
493
543
|
export declare type ConversationUpdateRequest = {
|
|
494
|
-
metadata?: Record<string,
|
|
544
|
+
metadata?: Record<string, unknown>;
|
|
495
545
|
};
|
|
496
546
|
|
|
497
547
|
declare function convertGuestToEmailAccount(email: string, password: string, name?: string | null): Promise<void>;
|
|
@@ -541,7 +591,7 @@ export declare function createApiKey(name: string): Promise<ApiKeyCreateResponse
|
|
|
541
591
|
*
|
|
542
592
|
* @deprecated Use openai.conversations.create() instead
|
|
543
593
|
*/
|
|
544
|
-
declare function createConversation(metadata?: Record<string,
|
|
594
|
+
declare function createConversation(metadata?: Record<string, unknown>): Promise<Conversation>;
|
|
545
595
|
|
|
546
596
|
export declare function createCustomFetch(options?: CustomFetchOptions): (input: string | URL | Request, init?: RequestInit) => Promise<Response>;
|
|
547
597
|
|
|
@@ -605,7 +655,14 @@ declare function createProjectSecret(orgId: string, projectId: string, keyName:
|
|
|
605
655
|
* });
|
|
606
656
|
* ```
|
|
607
657
|
*/
|
|
608
|
-
declare function createResponse(request: ResponsesCreateRequest): Promise<
|
|
658
|
+
declare function createResponse(request: ResponsesCreateRequest): Promise<ResponsesRetrieveResponse>;
|
|
659
|
+
|
|
660
|
+
export declare function createSubagent(request: CreateSubagentRequest): Promise<SubagentResponse>;
|
|
661
|
+
|
|
662
|
+
export declare type CreateSubagentRequest = {
|
|
663
|
+
display_name?: string;
|
|
664
|
+
purpose: string;
|
|
665
|
+
};
|
|
609
666
|
|
|
610
667
|
export declare interface CustomFetchOptions {
|
|
611
668
|
apiKey?: string;
|
|
@@ -746,6 +803,8 @@ declare function deleteConversations(): Promise<ConversationsDeleteResponse>;
|
|
|
746
803
|
*/
|
|
747
804
|
declare function deleteInstruction(instructionId: string): Promise<InstructionDeleteResponse>;
|
|
748
805
|
|
|
806
|
+
export declare function deleteMainAgent(): Promise<AgentDeletedObjectResponse>;
|
|
807
|
+
|
|
749
808
|
declare function deleteOrganization(orgId: string): Promise<void>;
|
|
750
809
|
|
|
751
810
|
declare function deleteOrganizationInvite(orgId: string, inviteCode: string): Promise<{
|
|
@@ -779,6 +838,8 @@ declare function deleteProjectSecret(orgId: string, projectId: string, keyName:
|
|
|
779
838
|
*/
|
|
780
839
|
declare function deleteResponse(responseId: string): Promise<ResponsesDeleteResponse>;
|
|
781
840
|
|
|
841
|
+
export declare function deleteSubagent(id: string): Promise<AgentDeletedObjectResponse>;
|
|
842
|
+
|
|
782
843
|
declare type DeveloperResponse = PlatformUser & {
|
|
783
844
|
organizations: PlatformOrg[];
|
|
784
845
|
};
|
|
@@ -1098,6 +1159,10 @@ declare function getEmailSettings(orgId: string, projectId: string): Promise<Ema
|
|
|
1098
1159
|
*/
|
|
1099
1160
|
declare function getInstruction(instructionId: string): Promise<Instruction>;
|
|
1100
1161
|
|
|
1162
|
+
export declare function getMainAgent(): Promise<MainAgentResponse>;
|
|
1163
|
+
|
|
1164
|
+
export declare function getMainAgentItem(itemId: string): Promise<ConversationItem>;
|
|
1165
|
+
|
|
1101
1166
|
declare function getOAuthSettings(orgId: string, projectId: string): Promise<OAuthSettings>;
|
|
1102
1167
|
|
|
1103
1168
|
declare function getOrganizationInvite(orgId: string, inviteCode: string): Promise<OrganizationInvite>;
|
|
@@ -1106,6 +1171,10 @@ declare function getPlatformApiUrl(): string;
|
|
|
1106
1171
|
|
|
1107
1172
|
declare function getProject(orgId: string, projectId: string): Promise<Project>;
|
|
1108
1173
|
|
|
1174
|
+
export declare function getSubagent(id: string): Promise<SubagentResponse>;
|
|
1175
|
+
|
|
1176
|
+
export declare function getSubagentItem(id: string, itemId: string): Promise<ConversationItem>;
|
|
1177
|
+
|
|
1109
1178
|
export declare type GithubAuthResponse = {
|
|
1110
1179
|
auth_url: string;
|
|
1111
1180
|
csrf_token: string;
|
|
@@ -1366,6 +1435,8 @@ declare function listConversations(params?: {
|
|
|
1366
1435
|
*/
|
|
1367
1436
|
declare function listInstructions(params?: InstructionListParams): Promise<InstructionListResponse>;
|
|
1368
1437
|
|
|
1438
|
+
export declare function listMainAgentItems(params?: AgentItemsListParams): Promise<ConversationItemsResponse>;
|
|
1439
|
+
|
|
1369
1440
|
declare function listOrganizationInvites(orgId: string): Promise<OrganizationInvite[]>;
|
|
1370
1441
|
|
|
1371
1442
|
declare function listOrganizationMembers(orgId: string): Promise<OrganizationMember[]>;
|
|
@@ -1376,6 +1447,17 @@ declare function listProjects(orgId: string): Promise<Project[]>;
|
|
|
1376
1447
|
|
|
1377
1448
|
declare function listProjectSecrets(orgId: string, projectId: string): Promise<ProjectSecret[]>;
|
|
1378
1449
|
|
|
1450
|
+
export declare function listSubagentItems(id: string, params?: AgentItemsListParams): Promise<ConversationItemsResponse>;
|
|
1451
|
+
|
|
1452
|
+
export declare function listSubagents(params?: ListSubagentsParams): Promise<SubagentListResponse>;
|
|
1453
|
+
|
|
1454
|
+
export declare type ListSubagentsParams = {
|
|
1455
|
+
limit?: number;
|
|
1456
|
+
after?: string;
|
|
1457
|
+
order?: string;
|
|
1458
|
+
created_by?: AgentCreatedBy;
|
|
1459
|
+
};
|
|
1460
|
+
|
|
1379
1461
|
export declare type LoginResponse = {
|
|
1380
1462
|
id: string;
|
|
1381
1463
|
email?: string;
|
|
@@ -1383,6 +1465,16 @@ export declare type LoginResponse = {
|
|
|
1383
1465
|
refresh_token: string;
|
|
1384
1466
|
};
|
|
1385
1467
|
|
|
1468
|
+
export declare type MainAgentResponse = {
|
|
1469
|
+
id: string;
|
|
1470
|
+
object: "agent.main";
|
|
1471
|
+
kind: "main";
|
|
1472
|
+
conversation_id: string;
|
|
1473
|
+
display_name: string;
|
|
1474
|
+
created_at: number;
|
|
1475
|
+
updated_at: number;
|
|
1476
|
+
};
|
|
1477
|
+
|
|
1386
1478
|
declare type MeResponse = {
|
|
1387
1479
|
user: PlatformUser;
|
|
1388
1480
|
organizations: PlatformOrg[];
|
|
@@ -2866,7 +2958,7 @@ export declare type ResponsesCreateRequest = {
|
|
|
2866
2958
|
};
|
|
2867
2959
|
previous_response_id?: string;
|
|
2868
2960
|
stream?: boolean;
|
|
2869
|
-
metadata?: Record<string,
|
|
2961
|
+
metadata?: Record<string, unknown>;
|
|
2870
2962
|
};
|
|
2871
2963
|
|
|
2872
2964
|
export declare type ResponsesDeleteResponse = {
|
|
@@ -2907,7 +2999,7 @@ export declare type ResponsesRetrieveResponse = {
|
|
|
2907
2999
|
};
|
|
2908
3000
|
total_tokens: number;
|
|
2909
3001
|
};
|
|
2910
|
-
output?: string |
|
|
3002
|
+
output?: string | unknown[];
|
|
2911
3003
|
};
|
|
2912
3004
|
|
|
2913
3005
|
declare function setApiUrl(url: string): void;
|
|
@@ -2991,6 +3083,26 @@ declare type SignMessageResponse = {
|
|
|
2991
3083
|
message_hash: string;
|
|
2992
3084
|
};
|
|
2993
3085
|
|
|
3086
|
+
export declare type SubagentListResponse = {
|
|
3087
|
+
object: "list";
|
|
3088
|
+
data: SubagentResponse[];
|
|
3089
|
+
first_id?: string;
|
|
3090
|
+
last_id?: string;
|
|
3091
|
+
has_more: boolean;
|
|
3092
|
+
};
|
|
3093
|
+
|
|
3094
|
+
export declare type SubagentResponse = {
|
|
3095
|
+
id: string;
|
|
3096
|
+
object: "agent.subagent";
|
|
3097
|
+
kind: "subagent";
|
|
3098
|
+
conversation_id: string;
|
|
3099
|
+
display_name: string;
|
|
3100
|
+
purpose: string;
|
|
3101
|
+
created_by: AgentCreatedBy;
|
|
3102
|
+
created_at: number;
|
|
3103
|
+
updated_at: number;
|
|
3104
|
+
};
|
|
3105
|
+
|
|
2994
3106
|
declare type ThirdPartyTokenRequest = {
|
|
2995
3107
|
audience?: string;
|
|
2996
3108
|
};
|
|
@@ -3061,7 +3173,7 @@ declare function transcribeAudio(file: File | Blob, model?: string, language?: s
|
|
|
3061
3173
|
* });
|
|
3062
3174
|
* ```
|
|
3063
3175
|
*/
|
|
3064
|
-
declare function updateConversation(conversationId: string, metadata: Record<string,
|
|
3176
|
+
declare function updateConversation(conversationId: string, metadata: Record<string, unknown>): Promise<Conversation>;
|
|
3065
3177
|
|
|
3066
3178
|
declare function updateEmailSettings(orgId: string, projectId: string, settings: EmailSettings): Promise<EmailSettings>;
|
|
3067
3179
|
|