@neta-art/cohub 1.18.0 → 1.19.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/chunks/http.d.ts +34 -236
- package/dist/chunks/http.js +0 -16
- package/dist/chunks/websocket.d.ts +243 -48
- package/dist/chunks/websocket.js +1 -1
- package/dist/http.d.ts +3 -3
- package/dist/index.d.ts +3 -3
- package/package.json +2 -3
package/dist/chunks/http.d.ts
CHANGED
|
@@ -1,21 +1,5 @@
|
|
|
1
|
-
import { a as WebsocketClientOptions, d as
|
|
1
|
+
import { S as CohubEnvironment, _ as SessionTurnIndexItem, a as WebsocketClientOptions, b as ContentBlock, d as SpacePublicEndpoints, f as MessageRecord, h as SessionRecord$1, l as RealtimePatchOperation, m as SessionForkRecord, p as SessionBindingRecord$1, r as WebsocketClient, s as WebsocketEventPayload, u as SessionTurnPatchEvent, v as SessionTurnRecord, y as Usage } from "./websocket.js";
|
|
2
2
|
|
|
3
|
-
//#region ../protocol/src/core/usage.d.ts
|
|
4
|
-
type Usage = {
|
|
5
|
-
input?: number;
|
|
6
|
-
output?: number;
|
|
7
|
-
cacheRead?: number;
|
|
8
|
-
cacheWrite?: number;
|
|
9
|
-
totalTokens?: number;
|
|
10
|
-
cost?: {
|
|
11
|
-
input?: number;
|
|
12
|
-
output?: number;
|
|
13
|
-
cacheRead?: number;
|
|
14
|
-
cacheWrite?: number;
|
|
15
|
-
total?: number;
|
|
16
|
-
} | null;
|
|
17
|
-
};
|
|
18
|
-
//#endregion
|
|
19
3
|
//#region src/transport.d.ts
|
|
20
4
|
type Fetch = typeof globalThis.fetch;
|
|
21
5
|
type RequestInitWithFetch = RequestInit & {
|
|
@@ -58,167 +42,7 @@ declare class HttpTransport {
|
|
|
58
42
|
blob(path: string, init?: RequestInitWithFetch): Promise<Blob>;
|
|
59
43
|
}
|
|
60
44
|
//#endregion
|
|
61
|
-
//#region ../protocol/src/
|
|
62
|
-
type SessionTurnStatus = "queued" | "running" | "abort_requested" | "completed" | "failed" | "interrupted" | "merged" | "cancelled";
|
|
63
|
-
type SessionTurnIntent = "steer" | "followup";
|
|
64
|
-
type SessionTurnSummary = {
|
|
65
|
-
text?: string | null;
|
|
66
|
-
finishReason?: "completed" | "failed" | "interrupted" | "merged" | "cancelled";
|
|
67
|
-
reason?: "steer" | "abort" | "merge" | string;
|
|
68
|
-
continuedByTurnId?: string | null;
|
|
69
|
-
interruptedByTurnId?: string | null;
|
|
70
|
-
mergedIntoTurnId?: string | null;
|
|
71
|
-
};
|
|
72
|
-
type SessionTurnIntermediateIndex = {
|
|
73
|
-
version: 1;
|
|
74
|
-
messagesObjectKey: string | null;
|
|
75
|
-
messagesSizeBytes?: number | null;
|
|
76
|
-
toolCallsBaseObjectKey?: string | null;
|
|
77
|
-
};
|
|
78
|
-
type SessionTurnIntermediateSummary = {
|
|
79
|
-
messageCount: number;
|
|
80
|
-
toolCallCount: number;
|
|
81
|
-
usage?: Usage | null;
|
|
82
|
-
durationMs?: number | null;
|
|
83
|
-
lastMessageText?: string | null;
|
|
84
|
-
hasError?: boolean;
|
|
85
|
-
};
|
|
86
|
-
type SessionTurnIndexItem = {
|
|
87
|
-
id: string;
|
|
88
|
-
sessionId: string;
|
|
89
|
-
sourceSessionId?: string;
|
|
90
|
-
sourceTurnId?: string;
|
|
91
|
-
sequence: number;
|
|
92
|
-
status: SessionTurnStatus;
|
|
93
|
-
startedAt: string | null;
|
|
94
|
-
completedAt: string | null;
|
|
95
|
-
durationMs: number | null;
|
|
96
|
-
createdAt: string;
|
|
97
|
-
updatedAt: string;
|
|
98
|
-
userPreview: string | null;
|
|
99
|
-
assistantPreview: string | null;
|
|
100
|
-
provider: string | null;
|
|
101
|
-
model: string | null;
|
|
102
|
-
finalUsage: Usage | null;
|
|
103
|
-
totalUsage: Usage | null;
|
|
104
|
-
errorMessage: string | null;
|
|
105
|
-
};
|
|
106
|
-
type SessionTurnAuthorProfile = {
|
|
107
|
-
userUuid: string;
|
|
108
|
-
displayName: string;
|
|
109
|
-
avatarUrl: string | null;
|
|
110
|
-
};
|
|
111
|
-
type SessionTurnRecord = {
|
|
112
|
-
id: string;
|
|
113
|
-
sessionId: string;
|
|
114
|
-
sourceSessionId?: string;
|
|
115
|
-
sourceTurnId?: string;
|
|
116
|
-
userUuid: string | null;
|
|
117
|
-
sequence: number;
|
|
118
|
-
status: SessionTurnStatus;
|
|
119
|
-
intent: SessionTurnIntent;
|
|
120
|
-
userContent: ContentBlock[];
|
|
121
|
-
userText: string | null;
|
|
122
|
-
assistantContent: ContentBlock[] | null;
|
|
123
|
-
assistantText: string | null;
|
|
124
|
-
provider: string | null;
|
|
125
|
-
model: string | null;
|
|
126
|
-
stopReason: string | null;
|
|
127
|
-
errorMessage: string | null;
|
|
128
|
-
finalUsage: Usage | null;
|
|
129
|
-
totalUsage: Usage | null;
|
|
130
|
-
summary: SessionTurnSummary | null;
|
|
131
|
-
intermediateIndex: SessionTurnIntermediateIndex | null;
|
|
132
|
-
intermediateSummary: SessionTurnIntermediateSummary | null;
|
|
133
|
-
meta: Record<string, unknown> | null;
|
|
134
|
-
authorProfile?: SessionTurnAuthorProfile | null;
|
|
135
|
-
startedAt: string | null;
|
|
136
|
-
completedAt: string | null;
|
|
137
|
-
durationMs: number | null;
|
|
138
|
-
createdAt: string;
|
|
139
|
-
updatedAt: string;
|
|
140
|
-
};
|
|
141
|
-
//#endregion
|
|
142
|
-
//#region ../protocol/src/model/session.d.ts
|
|
143
|
-
type SessionForkRecord = {
|
|
144
|
-
id: string;
|
|
145
|
-
spaceId: string;
|
|
146
|
-
parentSessionId: string;
|
|
147
|
-
childSessionId: string;
|
|
148
|
-
rootSessionId: string;
|
|
149
|
-
depth: number;
|
|
150
|
-
anchorSourceSessionId: string;
|
|
151
|
-
anchorTurnId: string;
|
|
152
|
-
anchorSequence: number;
|
|
153
|
-
ancestorSessionIds: string[];
|
|
154
|
-
sessionPath: string[];
|
|
155
|
-
createdBy: string | null;
|
|
156
|
-
createdAt: string;
|
|
157
|
-
};
|
|
158
|
-
type SessionTurnSegmentRecord = {
|
|
159
|
-
id: string;
|
|
160
|
-
sessionId: string;
|
|
161
|
-
ordinal: number;
|
|
162
|
-
sourceSessionId: string;
|
|
163
|
-
fromSequence: number;
|
|
164
|
-
toSequence: number | null;
|
|
165
|
-
createdAt: string;
|
|
166
|
-
};
|
|
167
|
-
type SessionBindingRecord$1 = {
|
|
168
|
-
id: string;
|
|
169
|
-
spaceId: string;
|
|
170
|
-
spaceSessionId: string;
|
|
171
|
-
spaceChannelId: string;
|
|
172
|
-
provider: string;
|
|
173
|
-
bindingKey: string;
|
|
174
|
-
externalChatId: string;
|
|
175
|
-
status: string | null;
|
|
176
|
-
meta: Record<string, unknown> | null;
|
|
177
|
-
createdAt: string;
|
|
178
|
-
updatedAt: string;
|
|
179
|
-
lastMessageAt: string | null;
|
|
180
|
-
};
|
|
181
|
-
type SessionRecord$1 = {
|
|
182
|
-
id: string;
|
|
183
|
-
spaceId: string;
|
|
184
|
-
title: string | null;
|
|
185
|
-
source: string | null;
|
|
186
|
-
status: string | null;
|
|
187
|
-
externalSessionId: string | null;
|
|
188
|
-
meta: Record<string, unknown> | null;
|
|
189
|
-
latestMessageText: string | null;
|
|
190
|
-
lastMessageAt: string | null;
|
|
191
|
-
lastMessageId: string | null;
|
|
192
|
-
createdAt: string;
|
|
193
|
-
updatedAt: string;
|
|
194
|
-
};
|
|
195
|
-
type MessageAuthorProfile = {
|
|
196
|
-
userUuid: string;
|
|
197
|
-
displayName: string;
|
|
198
|
-
avatarUrl: string | null;
|
|
199
|
-
};
|
|
200
|
-
type MessageRecord = {
|
|
201
|
-
id: string;
|
|
202
|
-
sessionId: string;
|
|
203
|
-
role: "user" | "assistant" | "system";
|
|
204
|
-
content: ContentBlock[];
|
|
205
|
-
text: string | null;
|
|
206
|
-
sequence: number;
|
|
207
|
-
provider: string | null;
|
|
208
|
-
model: string | null;
|
|
209
|
-
stopReason: string | null;
|
|
210
|
-
errorMessage: string | null;
|
|
211
|
-
usage: Usage | null;
|
|
212
|
-
meta: Record<string, unknown> | null;
|
|
213
|
-
authorUuid?: string | null;
|
|
214
|
-
authorProfile?: MessageAuthorProfile | null;
|
|
215
|
-
startedAt: string | null;
|
|
216
|
-
completedAt: string | null;
|
|
217
|
-
durationMs: number | null;
|
|
218
|
-
createdAt: string;
|
|
219
|
-
};
|
|
220
|
-
//#endregion
|
|
221
|
-
//#region ../protocol/dist/gateway/types.d.ts
|
|
45
|
+
//#region ../protocol/src/gateway/types.d.ts
|
|
222
46
|
type DiscordChannelConfig = {
|
|
223
47
|
inbound?: {
|
|
224
48
|
requireMentionInGuild?: boolean;
|
|
@@ -656,10 +480,6 @@ type SpaceMeta = JsonObject & {
|
|
|
656
480
|
extraEnv?: SpaceEnvInput[];
|
|
657
481
|
publicProfile?: Partial<SpacePublicProfile> | null;
|
|
658
482
|
};
|
|
659
|
-
type SpaceGitInfo = {
|
|
660
|
-
giteaHost: string;
|
|
661
|
-
giteaUsername: string;
|
|
662
|
-
};
|
|
663
483
|
type SpaceRecord = {
|
|
664
484
|
id: string;
|
|
665
485
|
userUuid: string;
|
|
@@ -681,6 +501,7 @@ type SpaceRecord = {
|
|
|
681
501
|
provider: string;
|
|
682
502
|
status: string;
|
|
683
503
|
}[];
|
|
504
|
+
access?: SpaceAccess;
|
|
684
505
|
accessLevel?: "minimal";
|
|
685
506
|
ownerProfile?: Pick<UserProfile, "userUuid" | "username" | "displayName" | "avatarUrl"> | null;
|
|
686
507
|
};
|
|
@@ -846,6 +667,9 @@ type GlobalSearchResult = {
|
|
|
846
667
|
turnId: string | null;
|
|
847
668
|
sequence: number | null;
|
|
848
669
|
title: string;
|
|
670
|
+
excerpt?: string | null;
|
|
671
|
+
spaceName?: string | null;
|
|
672
|
+
sessionTitle?: string | null;
|
|
849
673
|
ownerProfile?: Pick<UserProfile, "userUuid" | "username" | "displayName" | "avatarUrl"> | null;
|
|
850
674
|
spaceProfile?: SpacePublicProfile | null;
|
|
851
675
|
matchedField: "userText" | "title" | "name" | "description";
|
|
@@ -875,13 +699,7 @@ type SpaceSessionsResponse = {
|
|
|
875
699
|
nextCursor: string | null;
|
|
876
700
|
};
|
|
877
701
|
};
|
|
878
|
-
type
|
|
879
|
-
id: string;
|
|
880
|
-
key: string;
|
|
881
|
-
title: string;
|
|
882
|
-
giteaKeyId: number;
|
|
883
|
-
createdAt: string;
|
|
884
|
-
};
|
|
702
|
+
type PromptAccessMode = "read_only" | "full_access";
|
|
885
703
|
type CreateSpacePromptInput = {
|
|
886
704
|
sessionId?: string | null;
|
|
887
705
|
title?: string | null;
|
|
@@ -890,6 +708,7 @@ type CreateSpacePromptInput = {
|
|
|
890
708
|
provider?: string | null;
|
|
891
709
|
clientMessageId?: string | null;
|
|
892
710
|
generationPolicy?: GenerationPolicy | null;
|
|
711
|
+
accessMode?: PromptAccessMode | null;
|
|
893
712
|
schedule?: {
|
|
894
713
|
mode?: "immediate";
|
|
895
714
|
} | {
|
|
@@ -904,20 +723,14 @@ type CreateSpacePromptInput = {
|
|
|
904
723
|
timezone: string;
|
|
905
724
|
};
|
|
906
725
|
};
|
|
907
|
-
type CreateSpacePromptResponse = {
|
|
908
|
-
ok: true;
|
|
726
|
+
type CreateSpacePromptResponse = (SessionTurnResponse & {
|
|
909
727
|
mode: "immediate";
|
|
910
|
-
|
|
911
|
-
userMessageId: string;
|
|
912
|
-
turnId: string;
|
|
913
|
-
} | {
|
|
914
|
-
ok: true;
|
|
728
|
+
}) | {
|
|
915
729
|
mode: "delay" | "at";
|
|
916
730
|
taskRunId: string;
|
|
917
731
|
scheduledAt: string;
|
|
918
732
|
sessionId: string | null;
|
|
919
733
|
} | {
|
|
920
|
-
ok: true;
|
|
921
734
|
mode: "repeat";
|
|
922
735
|
cronJobId: string;
|
|
923
736
|
nextRunAt: string;
|
|
@@ -1022,22 +835,28 @@ type SpaceModListItem = {
|
|
|
1022
835
|
modSpaceName: string | null;
|
|
1023
836
|
modSpaceDescription: string | null;
|
|
1024
837
|
};
|
|
838
|
+
/**
|
|
839
|
+
* Public-safe DTO for Explore spaces.
|
|
840
|
+
* Only contains fields safe for unauthenticated product rendering.
|
|
841
|
+
*/
|
|
1025
842
|
type ExploreSpaceItem = {
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
843
|
+
id: string;
|
|
844
|
+
slug: string | null;
|
|
845
|
+
title: string;
|
|
846
|
+
summary: string | null;
|
|
847
|
+
spaceUrl: string;
|
|
848
|
+
avatarUrl: string | null;
|
|
849
|
+
avatarAlt: string | null;
|
|
850
|
+
ownerDisplayName: string | null;
|
|
851
|
+
ownerAvatarUrl: string | null;
|
|
852
|
+
category: string | null;
|
|
853
|
+
tags: string[];
|
|
854
|
+
saveCount: number;
|
|
855
|
+
pinCount: number;
|
|
856
|
+
forkCount: number;
|
|
857
|
+
updatedAt: string | null;
|
|
858
|
+
accessLabel: "public" | "sign-in-required" | "unknown";
|
|
859
|
+
latestSaveLabel: string | null;
|
|
1041
860
|
};
|
|
1042
861
|
type ExploreSection = {
|
|
1043
862
|
key: string;
|
|
@@ -1050,7 +869,7 @@ type ExploreSpacesResponse = {
|
|
|
1050
869
|
sections: ExploreSection[];
|
|
1051
870
|
spaces: ExploreSpaceItem[];
|
|
1052
871
|
};
|
|
1053
|
-
type Permission = "space.view" | "space.edit" | "space.pin" | "session.view" | "session.edit" | "session.prompt.readonly" | "session.prompt.fullaccess" | "file.view" | "file.edit" | "checkpoint.view" | "checkpoint.edit" | "member.view" | "member.manage" | "channel.view" | "channel.manage" | "cronjob.view" | "cronjob.manage" | "taskrun.view" | "sandbox.view" | "sandbox.manage" | "mod.view" | "mod.manage";
|
|
872
|
+
type Permission = "space.view" | "space.edit" | "space.pin" | "session.view" | "session.edit" | "session.prompt.readonly" | "session.prompt.fullaccess" | "file.view" | "file.view.filtered" | "file.edit" | "checkpoint.view" | "checkpoint.edit" | "member.view" | "member.manage" | "channel.view" | "channel.manage" | "cronjob.view" | "cronjob.manage" | "taskrun.view" | "sandbox.view" | "sandbox.manage" | "mod.view" | "mod.manage";
|
|
1054
873
|
type SpaceAccess = {
|
|
1055
874
|
role: SpaceRole | null;
|
|
1056
875
|
permissions: Permission[];
|
|
@@ -1246,15 +1065,6 @@ declare class SessionAccessApi {
|
|
|
1246
1065
|
}>;
|
|
1247
1066
|
}
|
|
1248
1067
|
//#endregion
|
|
1249
|
-
//#region ../protocol/src/ports/index.d.ts
|
|
1250
|
-
type SpacePortStatus = "listening" | "closed";
|
|
1251
|
-
type SpacePublicEndpoint = {
|
|
1252
|
-
url: string;
|
|
1253
|
-
status?: SpacePortStatus | "unknown";
|
|
1254
|
-
observedAt?: number;
|
|
1255
|
-
};
|
|
1256
|
-
type SpacePublicEndpoints = Record<string, SpacePublicEndpoint>;
|
|
1257
|
-
//#endregion
|
|
1258
1068
|
//#region src/session-patch-reducer.d.ts
|
|
1259
1069
|
type SessionPatchStatus = "idle" | "pending" | "streaming" | "completed" | "failed" | "interrupted";
|
|
1260
1070
|
type SessionPatchState = {
|
|
@@ -1531,11 +1341,7 @@ declare class SessionMessagesClient {
|
|
|
1531
1341
|
limit?: number;
|
|
1532
1342
|
direction?: "older" | "newer";
|
|
1533
1343
|
}, customFetch?: Fetch): Promise<SessionMessagesPaginatedResponse>;
|
|
1534
|
-
send(input: SessionSendMessageInput): Promise<
|
|
1535
|
-
ok: true;
|
|
1536
|
-
userMessageId: string;
|
|
1537
|
-
turnId: string;
|
|
1538
|
-
}>;
|
|
1344
|
+
send(input: SessionSendMessageInput): Promise<SessionTurnResponse>;
|
|
1539
1345
|
}
|
|
1540
1346
|
declare class SessionTurnsClient {
|
|
1541
1347
|
private readonly transport;
|
|
@@ -1876,14 +1682,6 @@ declare class UserApi {
|
|
|
1876
1682
|
getRules(customFetch?: Fetch): Promise<UserRulesResponse>;
|
|
1877
1683
|
setAuthToken(token: string): Promise<any>;
|
|
1878
1684
|
clearAuthToken(): Promise<null>;
|
|
1879
|
-
getSshKeys(customFetch?: Fetch): Promise<UserSshKey[]>;
|
|
1880
|
-
createSshKey(data: {
|
|
1881
|
-
key: string;
|
|
1882
|
-
title: string;
|
|
1883
|
-
}): Promise<UserSshKey>;
|
|
1884
|
-
deleteSshKey(id: string): Promise<{
|
|
1885
|
-
ok: true;
|
|
1886
|
-
}>;
|
|
1887
1685
|
}
|
|
1888
1686
|
//#endregion
|
|
1889
1687
|
//#region src/http.d.ts
|
|
@@ -1906,4 +1704,4 @@ declare class CohubHttpClient {
|
|
|
1906
1704
|
}
|
|
1907
1705
|
declare const createHttpClient: (options?: CohubClientOptions) => CohubHttpClient;
|
|
1908
1706
|
//#endregion
|
|
1909
|
-
export { CreateInvitationInput as $,
|
|
1707
|
+
export { CreateInvitationInput as $, CohubClientOptions as $n, SpaceFsReadFilesError as $t, SessionPatchStatus as A, TaskRunRecord as An, SessionTurnStreamSnapshotResponse as At, GenerationsApi as B, GenerationPolicy as Bn, SpaceConfigResponse as Bt, SessionGenerationStreamClient as C, SpaceSandboxAutoDestroyPolicy as Cn, SessionMessageResponse as Ct, SessionPatchApplyResult as D, SpaceUsageResponse as Dn, SessionTurnIndexResponse as Dt, SessionPatchApplyInput as E, SpaceUsageHourlyStat as En, SessionRecord as Et, CreatePublicAssetUploadResponse as F, GenerationTaskResult as Fn, SpaceBootstrapSource as Ft, BillingCreditExpiryGroup as G, filterGenerationDeclarationsByPolicy as Gn, SpaceFsCreateUploadInput as Gt, ChannelsApi as H, assertGenerationRequestAllowedByPolicy as Hn, SpaceEnvInput as Ht, PublicAssetPurpose as I, ListGenerationModelsResponse as In, SpaceChannelBindingInput as It, BillingCreditUnit as J, normalizeGenerationPolicy as Jn, SpaceFsEntry as Jt, BillingCreditGrantStatus as K, findGenerationModelPolicy as Kn, SpaceFsCreateUploadResponse as Kt, PublicAssetsApi as L, PublicGenerationDeclaration as Ln, SpaceCheckpointDetailResponse as Lt, SessionAccessApi as M, UserRulesResponse as Mn, SessionTurnsPaginatedResponse as Mt, SearchApi as N, CreateGenerationTaskRequest as Nn, SpaceAccess as Nt, SessionPatchReducer as O, SpaceUsageSummary as On, SessionTurnResponse as Ot, CreatePublicAssetUploadInput as P, CreateGenerationTaskResponse as Pn, SpaceAccessPolicy as Pt, CheckpointRecord as Q, DiscordChannelConfig as Qn, SpaceFsPreparingFile as Qt, PromptsApi as R, GenerationModelPolicy as Rn, SpaceConfig as Rt, GenerationStreamTurnUpdatedEvent as S, SpaceRole as Sn, SessionBindingRecord as St, parseAssistantMessageCommit as T, SpaceSessionsResponse as Tn, SessionMessagesResponse as Tt, AcceptInvitationResponse as U, decodeGenerationPolicy as Un, SpaceFsCompleteUploadInput as Ut, CronJobsApi as V, GenerationPolicyError as Vn, SpaceCreateResponse as Vt, ApiError as W, encodeGenerationPolicy as Wn, SpaceFsCompleteUploadResponse as Wt, BillingPluginStatus as X, GenerationContentBlock as Xn, SpaceFsFileResponse as Xt, BillingOpenOverageStatus as Y, parseGenerationPolicyFromEnv as Yn, SpaceFsFileKind as Yt, Channel as Z, ChannelConfig as Zn, SpaceFsMoveInput as Zt, GenerationStreamFinalizedEvent as _, SpaceMember as _n, ModelCatalogEntry as _t, SessionEventName as a, SpaceFsUploadError as an, CronJobRecord as at, GenerationStreamStateEvent as b, SpacePublicProfile as bn, PromptTemplateCatalogEntry as bt, SpaceClient as c, SpaceFsUploadProgress as cn, ExploreSpacesResponse as ct, WebSocketConnectionState as d, SpaceInvitation as dn, GlobalSearchType as dt, SpaceFsReadFilesInput as en, Fetch as er, CreateInvitationResponse as et, PublicInviteApi as f, SpaceListItem as fn, InvitationDetail as ft, GenerationStreamEvent as g, SpaceMarkResourceType as gn, MeResponse as gt, GenerationStreamErrorEvent as h, SpaceMarkRecord as hn, JsonValue as ht, TasksApi as i, SpaceFsUploadEntry as in, CreateSpacePromptResponse as it, createSessionPatchReducer as j, UserProfile as jn, SessionTurnWindowResponse as jt, SessionPatchState as k, TaskRunDetailResponse as kn, SessionTurnSignedUrlsResponse as kt, SpaceEventName as l, SpaceFsUploadResponse as ln, GlobalSearchResponse as lt, GenerationStreamCommitEvent as m, SpaceMarkListItem as mn, JsonPrimitive as mt, createHttpClient as n, SpaceFsTreeResponse as nn, HttpTransport as nr, CreateSpaceModInput as nt, SessionSubscriptionHandlers as o, SpaceFsUploadPlanEntry as on, ExploreSection as ot, AssistantMessageCommit as p, SpaceMarkKind as pn, JsonObject as pt, BillingCreditStatus as q, getAllowedGenerationModelIds as qn, SpaceFsEncoding as qt, UserApi as r, SpaceFsUploadDestination as rn, RawHttpResponse as rr, CreateSpacePromptInput as rt, SpaceChannelBindingRecord as s, SpaceFsUploadPlanEntryInput as sn, ExploreSpaceItem as st, CohubHttpClient as t, SpaceFsReadFilesResponse as tn, HttpError as tr, CreateSpaceInput as tt, SpacesApi as u, SpaceFsWriteFileInput as un, GlobalSearchResult as ut, GenerationStreamIntermediateMessage as v, SpaceMeta as vn, Permission as vt, createSessionGenerationStreamClient as w, SpaceSandboxConfig as wn, SessionMessagesPaginatedResponse as wt, GenerationStreamSubscriptionHandlers as x, SpaceRecord as xn, PromptTemplateCatalogResponse as xt, GenerationStreamOutOfSyncEvent as y, SpaceModListItem as yn, PromptAccessMode as yt, ModelsApi as z, GenerationParameterConstraint as zn, SpaceConfigInput as zt };
|
package/dist/chunks/http.js
CHANGED
|
@@ -1863,22 +1863,6 @@ var UserApi = class {
|
|
|
1863
1863
|
this.clearStoredAuthToken?.();
|
|
1864
1864
|
return null;
|
|
1865
1865
|
}
|
|
1866
|
-
getSshKeys(customFetch) {
|
|
1867
|
-
return this.transport.request("/api/user/ssh-keys", {
|
|
1868
|
-
method: "GET",
|
|
1869
|
-
fetch: customFetch
|
|
1870
|
-
});
|
|
1871
|
-
}
|
|
1872
|
-
createSshKey(data) {
|
|
1873
|
-
return this.transport.request("/api/user/ssh-keys", {
|
|
1874
|
-
method: "POST",
|
|
1875
|
-
headers: { "Content-Type": "application/json" },
|
|
1876
|
-
body: JSON.stringify(data)
|
|
1877
|
-
});
|
|
1878
|
-
}
|
|
1879
|
-
deleteSshKey(id) {
|
|
1880
|
-
return this.transport.request(`/api/user/ssh-keys/${id}`, { method: "DELETE" });
|
|
1881
|
-
}
|
|
1882
1866
|
};
|
|
1883
1867
|
//#endregion
|
|
1884
1868
|
//#region src/http.ts
|
|
@@ -22,7 +22,248 @@ declare const resolveWebsocketUrl: (options?: {
|
|
|
22
22
|
env?: CohubEnvironment;
|
|
23
23
|
}) => string;
|
|
24
24
|
//#endregion
|
|
25
|
-
//#region ../protocol/
|
|
25
|
+
//#region ../protocol/src/core/content.d.ts
|
|
26
|
+
type ContentBlockMeta = Record<string, unknown>;
|
|
27
|
+
type ContentBlock = {
|
|
28
|
+
type: "text";
|
|
29
|
+
text: string;
|
|
30
|
+
_meta?: ContentBlockMeta;
|
|
31
|
+
} | {
|
|
32
|
+
type: "thinking";
|
|
33
|
+
thinking: string;
|
|
34
|
+
signature?: string;
|
|
35
|
+
_meta?: ContentBlockMeta;
|
|
36
|
+
} | {
|
|
37
|
+
type: "image";
|
|
38
|
+
source: {
|
|
39
|
+
type: "url";
|
|
40
|
+
url: string;
|
|
41
|
+
} | {
|
|
42
|
+
type: "base64";
|
|
43
|
+
media_type: string;
|
|
44
|
+
data: string;
|
|
45
|
+
};
|
|
46
|
+
_meta?: ContentBlockMeta;
|
|
47
|
+
} | {
|
|
48
|
+
type: "shell_command";
|
|
49
|
+
command: string;
|
|
50
|
+
rawText: string;
|
|
51
|
+
_meta?: ContentBlockMeta;
|
|
52
|
+
} | {
|
|
53
|
+
type: "tool_use";
|
|
54
|
+
id: string;
|
|
55
|
+
name: string;
|
|
56
|
+
input: Record<string, unknown>;
|
|
57
|
+
_meta?: ContentBlockMeta;
|
|
58
|
+
} | {
|
|
59
|
+
type: "tool_result";
|
|
60
|
+
tool_use_id: string;
|
|
61
|
+
content: string | ContentBlock[];
|
|
62
|
+
is_error?: boolean;
|
|
63
|
+
_meta?: ContentBlockMeta;
|
|
64
|
+
} | {
|
|
65
|
+
type: "system_note";
|
|
66
|
+
note_type: "session_created" | "forked" | "compacted" | "info";
|
|
67
|
+
text: string;
|
|
68
|
+
_meta?: ContentBlockMeta;
|
|
69
|
+
};
|
|
70
|
+
//#endregion
|
|
71
|
+
//#region ../protocol/src/core/usage.d.ts
|
|
72
|
+
type Usage = {
|
|
73
|
+
input?: number;
|
|
74
|
+
output?: number;
|
|
75
|
+
cacheRead?: number;
|
|
76
|
+
cacheWrite?: number;
|
|
77
|
+
totalTokens?: number;
|
|
78
|
+
cost?: {
|
|
79
|
+
input?: number;
|
|
80
|
+
output?: number;
|
|
81
|
+
cacheRead?: number;
|
|
82
|
+
cacheWrite?: number;
|
|
83
|
+
total?: number;
|
|
84
|
+
} | null;
|
|
85
|
+
};
|
|
86
|
+
//#endregion
|
|
87
|
+
//#region ../protocol/src/model/turn.d.ts
|
|
88
|
+
type SessionTurnStatus = "queued" | "running" | "abort_requested" | "completed" | "failed" | "interrupted" | "merged" | "cancelled";
|
|
89
|
+
type SessionTurnIntent = "steer" | "followup";
|
|
90
|
+
type SessionTurnSummary = {
|
|
91
|
+
text?: string | null;
|
|
92
|
+
finishReason?: "completed" | "failed" | "interrupted" | "merged" | "cancelled";
|
|
93
|
+
reason?: "steer" | "abort" | "merge" | string;
|
|
94
|
+
continuedByTurnId?: string | null;
|
|
95
|
+
interruptedByTurnId?: string | null;
|
|
96
|
+
mergedIntoTurnId?: string | null;
|
|
97
|
+
};
|
|
98
|
+
type SessionTurnIntermediateIndex = {
|
|
99
|
+
version: 1;
|
|
100
|
+
messagesObjectKey: string | null;
|
|
101
|
+
messagesSizeBytes?: number | null;
|
|
102
|
+
toolCallsBaseObjectKey?: string | null;
|
|
103
|
+
};
|
|
104
|
+
type SessionTurnIntermediateSummary = {
|
|
105
|
+
messageCount: number;
|
|
106
|
+
toolCallCount: number;
|
|
107
|
+
usage?: Usage | null;
|
|
108
|
+
durationMs?: number | null;
|
|
109
|
+
lastMessageText?: string | null;
|
|
110
|
+
hasError?: boolean;
|
|
111
|
+
};
|
|
112
|
+
type SessionTurnIndexItem = {
|
|
113
|
+
id: string;
|
|
114
|
+
sessionId: string;
|
|
115
|
+
sourceSessionId?: string;
|
|
116
|
+
sourceTurnId?: string;
|
|
117
|
+
sequence: number;
|
|
118
|
+
status: SessionTurnStatus;
|
|
119
|
+
startedAt: string | null;
|
|
120
|
+
completedAt: string | null;
|
|
121
|
+
durationMs: number | null;
|
|
122
|
+
createdAt: string;
|
|
123
|
+
updatedAt: string;
|
|
124
|
+
userPreview: string | null;
|
|
125
|
+
assistantPreview: string | null;
|
|
126
|
+
provider: string | null;
|
|
127
|
+
model: string | null;
|
|
128
|
+
finalUsage: Usage | null;
|
|
129
|
+
totalUsage: Usage | null;
|
|
130
|
+
errorMessage: string | null;
|
|
131
|
+
};
|
|
132
|
+
type SessionTurnAuthorProfile = {
|
|
133
|
+
userUuid: string;
|
|
134
|
+
displayName: string;
|
|
135
|
+
avatarUrl: string | null;
|
|
136
|
+
};
|
|
137
|
+
type SessionTurnRecord = {
|
|
138
|
+
id: string;
|
|
139
|
+
sessionId: string;
|
|
140
|
+
sourceSessionId?: string;
|
|
141
|
+
sourceTurnId?: string;
|
|
142
|
+
userUuid: string | null;
|
|
143
|
+
sequence: number;
|
|
144
|
+
status: SessionTurnStatus;
|
|
145
|
+
intent: SessionTurnIntent;
|
|
146
|
+
userContent: ContentBlock[];
|
|
147
|
+
userText: string | null;
|
|
148
|
+
assistantContent: ContentBlock[] | null;
|
|
149
|
+
assistantText: string | null;
|
|
150
|
+
provider: string | null;
|
|
151
|
+
model: string | null;
|
|
152
|
+
stopReason: string | null;
|
|
153
|
+
errorMessage: string | null;
|
|
154
|
+
finalUsage: Usage | null;
|
|
155
|
+
totalUsage: Usage | null;
|
|
156
|
+
summary: SessionTurnSummary | null;
|
|
157
|
+
intermediateIndex: SessionTurnIntermediateIndex | null;
|
|
158
|
+
intermediateSummary: SessionTurnIntermediateSummary | null;
|
|
159
|
+
meta: Record<string, unknown> | null;
|
|
160
|
+
authorProfile?: SessionTurnAuthorProfile | null;
|
|
161
|
+
startedAt: string | null;
|
|
162
|
+
completedAt: string | null;
|
|
163
|
+
durationMs: number | null;
|
|
164
|
+
createdAt: string;
|
|
165
|
+
updatedAt: string;
|
|
166
|
+
};
|
|
167
|
+
//#endregion
|
|
168
|
+
//#region ../protocol/src/model/session.d.ts
|
|
169
|
+
type SessionForkRecord = {
|
|
170
|
+
id: string;
|
|
171
|
+
spaceId: string;
|
|
172
|
+
parentSessionId: string;
|
|
173
|
+
childSessionId: string;
|
|
174
|
+
rootSessionId: string;
|
|
175
|
+
depth: number;
|
|
176
|
+
anchorSourceSessionId: string;
|
|
177
|
+
anchorTurnId: string;
|
|
178
|
+
anchorSequence: number;
|
|
179
|
+
ancestorSessionIds: string[];
|
|
180
|
+
sessionPath: string[];
|
|
181
|
+
createdBy: string | null;
|
|
182
|
+
createdAt: string;
|
|
183
|
+
};
|
|
184
|
+
type SessionTurnSegmentRecord = {
|
|
185
|
+
id: string;
|
|
186
|
+
sessionId: string;
|
|
187
|
+
ordinal: number;
|
|
188
|
+
sourceSessionId: string;
|
|
189
|
+
fromSequence: number;
|
|
190
|
+
toSequence: number | null;
|
|
191
|
+
createdAt: string;
|
|
192
|
+
};
|
|
193
|
+
type SessionBindingRecord = {
|
|
194
|
+
id: string;
|
|
195
|
+
spaceId: string;
|
|
196
|
+
spaceSessionId: string;
|
|
197
|
+
spaceChannelId: string;
|
|
198
|
+
provider: string;
|
|
199
|
+
bindingKey: string;
|
|
200
|
+
externalChatId: string;
|
|
201
|
+
status: string | null;
|
|
202
|
+
meta: Record<string, unknown> | null;
|
|
203
|
+
createdAt: string;
|
|
204
|
+
updatedAt: string;
|
|
205
|
+
lastMessageAt: string | null;
|
|
206
|
+
};
|
|
207
|
+
type SessionUserProfile = {
|
|
208
|
+
userUuid: string;
|
|
209
|
+
username: string | null;
|
|
210
|
+
displayName: string;
|
|
211
|
+
avatarUrl: string | null;
|
|
212
|
+
};
|
|
213
|
+
type SessionRecord = {
|
|
214
|
+
id: string;
|
|
215
|
+
spaceId: string;
|
|
216
|
+
userUuid: string | null;
|
|
217
|
+
userProfile?: SessionUserProfile | null;
|
|
218
|
+
participantUserUuids?: string[];
|
|
219
|
+
participantProfiles?: SessionUserProfile[];
|
|
220
|
+
title: string | null;
|
|
221
|
+
source: string | null;
|
|
222
|
+
status: string | null;
|
|
223
|
+
externalSessionId: string | null;
|
|
224
|
+
meta: Record<string, unknown> | null;
|
|
225
|
+
latestMessageText: string | null;
|
|
226
|
+
lastMessageAt: string | null;
|
|
227
|
+
lastMessageId: string | null;
|
|
228
|
+
createdAt: string;
|
|
229
|
+
updatedAt: string;
|
|
230
|
+
};
|
|
231
|
+
type MessageAuthorProfile = {
|
|
232
|
+
userUuid: string;
|
|
233
|
+
displayName: string;
|
|
234
|
+
avatarUrl: string | null;
|
|
235
|
+
};
|
|
236
|
+
type MessageRecord = {
|
|
237
|
+
id: string;
|
|
238
|
+
sessionId: string;
|
|
239
|
+
role: "user" | "assistant" | "system";
|
|
240
|
+
content: ContentBlock[];
|
|
241
|
+
text: string | null;
|
|
242
|
+
sequence: number;
|
|
243
|
+
provider: string | null;
|
|
244
|
+
model: string | null;
|
|
245
|
+
stopReason: string | null;
|
|
246
|
+
errorMessage: string | null;
|
|
247
|
+
usage: Usage | null;
|
|
248
|
+
meta: Record<string, unknown> | null;
|
|
249
|
+
authorUuid?: string | null;
|
|
250
|
+
authorProfile?: MessageAuthorProfile | null;
|
|
251
|
+
startedAt: string | null;
|
|
252
|
+
completedAt: string | null;
|
|
253
|
+
durationMs: number | null;
|
|
254
|
+
createdAt: string;
|
|
255
|
+
};
|
|
256
|
+
//#endregion
|
|
257
|
+
//#region ../protocol/src/ports/index.d.ts
|
|
258
|
+
type SpacePortStatus = "listening" | "closed";
|
|
259
|
+
type SpacePublicEndpoint = {
|
|
260
|
+
url: string;
|
|
261
|
+
status?: SpacePortStatus | "unknown";
|
|
262
|
+
observedAt?: number;
|
|
263
|
+
};
|
|
264
|
+
type SpacePublicEndpoints = Record<string, SpacePublicEndpoint>;
|
|
265
|
+
//#endregion
|
|
266
|
+
//#region ../protocol/src/realtime/types.d.ts
|
|
26
267
|
type RealtimeEnvelope = {
|
|
27
268
|
id: string;
|
|
28
269
|
timestamp: number;
|
|
@@ -78,52 +319,6 @@ type SessionTurnPatchEvent = {
|
|
|
78
319
|
};
|
|
79
320
|
};
|
|
80
321
|
//#endregion
|
|
81
|
-
//#region ../protocol/src/core/content.d.ts
|
|
82
|
-
type ContentBlockMeta = Record<string, unknown>;
|
|
83
|
-
type ContentBlock = {
|
|
84
|
-
type: "text";
|
|
85
|
-
text: string;
|
|
86
|
-
_meta?: ContentBlockMeta;
|
|
87
|
-
} | {
|
|
88
|
-
type: "thinking";
|
|
89
|
-
thinking: string;
|
|
90
|
-
signature?: string;
|
|
91
|
-
_meta?: ContentBlockMeta;
|
|
92
|
-
} | {
|
|
93
|
-
type: "image";
|
|
94
|
-
source: {
|
|
95
|
-
type: "url";
|
|
96
|
-
url: string;
|
|
97
|
-
} | {
|
|
98
|
-
type: "base64";
|
|
99
|
-
media_type: string;
|
|
100
|
-
data: string;
|
|
101
|
-
};
|
|
102
|
-
_meta?: ContentBlockMeta;
|
|
103
|
-
} | {
|
|
104
|
-
type: "shell_command";
|
|
105
|
-
command: string;
|
|
106
|
-
rawText: string;
|
|
107
|
-
_meta?: ContentBlockMeta;
|
|
108
|
-
} | {
|
|
109
|
-
type: "tool_use";
|
|
110
|
-
id: string;
|
|
111
|
-
name: string;
|
|
112
|
-
input: Record<string, unknown>;
|
|
113
|
-
_meta?: ContentBlockMeta;
|
|
114
|
-
} | {
|
|
115
|
-
type: "tool_result";
|
|
116
|
-
tool_use_id: string;
|
|
117
|
-
content: string | ContentBlock[];
|
|
118
|
-
is_error?: boolean;
|
|
119
|
-
_meta?: ContentBlockMeta;
|
|
120
|
-
} | {
|
|
121
|
-
type: "system_note";
|
|
122
|
-
note_type: "session_created" | "forked" | "compacted" | "info";
|
|
123
|
-
text: string;
|
|
124
|
-
_meta?: ContentBlockMeta;
|
|
125
|
-
};
|
|
126
|
-
//#endregion
|
|
127
322
|
//#region src/websocket.d.ts
|
|
128
323
|
type WebsocketEventPayload = ChannelEnvelope;
|
|
129
324
|
type WebSocketLike = {
|
|
@@ -266,4 +461,4 @@ declare class WebsocketClient {
|
|
|
266
461
|
}
|
|
267
462
|
declare const createWebsocketClient: (options?: WebsocketClientOptions) => WebsocketClient;
|
|
268
463
|
//#endregion
|
|
269
|
-
export { resolveCohubEnvironment as _, WebsocketClientOptions as a, createWebsocketClient as c,
|
|
464
|
+
export { normalizeBaseUrl as C, resolveWebsocketUrl as D, resolveCohubEnvironment as E, CohubEnvironment as S, resolveApiBaseUrl as T, SessionTurnIndexItem as _, WebsocketClientOptions as a, ContentBlock as b, createWebsocketClient as c, SpacePublicEndpoints as d, MessageRecord as f, SessionTurnSegmentRecord as g, SessionRecord as h, WebsocketClientEvents as i, RealtimePatchOperation as l, SessionForkRecord as m, WebSocketLike as n, WebsocketClientState as o, SessionBindingRecord as p, WebsocketClient as r, WebsocketEventPayload as s, WebSocketConstructor as t, SessionTurnPatchEvent as u, SessionTurnRecord as v, normalizeWebsocketUrl as w, COHUB_ENVIRONMENTS as x, Usage as y };
|
package/dist/chunks/websocket.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { o as resolveWebsocketUrl } from "./environment.js";
|
|
2
|
-
//#region ../protocol/
|
|
2
|
+
//#region ../protocol/src/realtime/types.ts
|
|
3
3
|
const WS_COMPACT_STREAM_CAPABILITY = "session.compact_stream.v1";
|
|
4
4
|
const getNonEmptyString = (value) => typeof value === "string" && value.trim() ? value : null;
|
|
5
5
|
const getSessionTurnPatchStreamKey = (input, options = {}) => {
|
package/dist/http.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { $ as CreateInvitationInput, $n as
|
|
3
|
-
export { AcceptInvitationResponse, ApiError, BillingCreditExpiryGroup, BillingCreditGrantStatus, BillingCreditStatus, BillingCreditUnit, BillingOpenOverageStatus, BillingPluginStatus, Channel, ChannelConfig, CheckpointRecord, CohubClientOptions, CohubHttpClient, ContentBlock, CreateGenerationTaskRequest, CreateGenerationTaskResponse, CreateInvitationInput, CreateInvitationResponse, CreateSpaceInput, CreateSpaceModInput, CreateSpacePromptInput, CreateSpacePromptResponse, CronJobRecord, DiscordChannelConfig, ExploreSection, ExploreSpaceItem, ExploreSpacesResponse, Fetch, GenerationContentBlock, GenerationPolicy, GenerationTaskResult, GlobalSearchResponse, GlobalSearchResult, GlobalSearchType, HttpError, HttpTransport, InvitationDetail, JsonObject, JsonPrimitive, JsonValue, ListGenerationModelsResponse, MeResponse, MessageRecord, ModelCatalogEntry, Permission, PromptTemplateCatalogEntry, PromptTemplateCatalogResponse, PublicGenerationDeclaration, SessionBindingRecord, SessionForkRecord, SessionMessageResponse, SessionMessagesPaginatedResponse, SessionMessagesResponse, SessionRecord, SessionTurnIndexItem, SessionTurnIndexResponse, SessionTurnRecord, SessionTurnResponse, SessionTurnSegmentRecord, SessionTurnSignedUrlsResponse, SessionTurnStreamSnapshotResponse, SessionTurnWindowResponse, SessionTurnsPaginatedResponse, SpaceAccess, SpaceAccessPolicy, SpaceBootstrapSource, SpaceChannelBindingInput, SpaceCheckpointDetailResponse, SpaceConfig, SpaceConfigInput, SpaceConfigResponse, SpaceCreateResponse, SpaceEnvInput, SpaceFsCompleteUploadInput, SpaceFsCompleteUploadResponse, SpaceFsCreateUploadInput, SpaceFsCreateUploadResponse, SpaceFsEncoding, SpaceFsEntry, SpaceFsFileKind, SpaceFsFileResponse, SpaceFsMoveInput, SpaceFsPreparingFile, SpaceFsReadFilesError, SpaceFsReadFilesInput, SpaceFsReadFilesResponse, SpaceFsTreeResponse, SpaceFsUploadDestination, SpaceFsUploadEntry, SpaceFsUploadError, SpaceFsUploadPlanEntry, SpaceFsUploadPlanEntryInput, SpaceFsUploadProgress, SpaceFsUploadResponse, SpaceFsWriteFileInput,
|
|
1
|
+
import { _ as SessionTurnIndexItem, b as ContentBlock, f as MessageRecord, g as SessionTurnSegmentRecord, m as SessionForkRecord, v as SessionTurnRecord } from "./chunks/websocket.js";
|
|
2
|
+
import { $ as CreateInvitationInput, $n as CohubClientOptions, $t as SpaceFsReadFilesError, An as TaskRunRecord, At as SessionTurnStreamSnapshotResponse, Bn as GenerationPolicy, Bt as SpaceConfigResponse, Cn as SpaceSandboxAutoDestroyPolicy, Ct as SessionMessageResponse, Dn as SpaceUsageResponse, Dt as SessionTurnIndexResponse, En as SpaceUsageHourlyStat, Et as SessionRecord, Fn as GenerationTaskResult, Ft as SpaceBootstrapSource, G as BillingCreditExpiryGroup, Gt as SpaceFsCreateUploadInput, Ht as SpaceEnvInput, In as ListGenerationModelsResponse, It as SpaceChannelBindingInput, J as BillingCreditUnit, Jt as SpaceFsEntry, K as BillingCreditGrantStatus, Kt as SpaceFsCreateUploadResponse, Ln as PublicGenerationDeclaration, Lt as SpaceCheckpointDetailResponse, Mn as UserRulesResponse, Mt as SessionTurnsPaginatedResponse, Nn as CreateGenerationTaskRequest, Nt as SpaceAccess, On as SpaceUsageSummary, Ot as SessionTurnResponse, Pn as CreateGenerationTaskResponse, Pt as SpaceAccessPolicy, Q as CheckpointRecord, Qn as DiscordChannelConfig, Qt as SpaceFsPreparingFile, Rt as SpaceConfig, Sn as SpaceRole, St as SessionBindingRecord, Tn as SpaceSessionsResponse, Tt as SessionMessagesResponse, U as AcceptInvitationResponse, Ut as SpaceFsCompleteUploadInput, Vt as SpaceCreateResponse, W as ApiError, Wt as SpaceFsCompleteUploadResponse, X as BillingPluginStatus, Xn as GenerationContentBlock, Xt as SpaceFsFileResponse, Y as BillingOpenOverageStatus, Yt as SpaceFsFileKind, Z as Channel, Zn as ChannelConfig, Zt as SpaceFsMoveInput, _n as SpaceMember, _t as ModelCatalogEntry, an as SpaceFsUploadError, at as CronJobRecord, bn as SpacePublicProfile, bt as PromptTemplateCatalogEntry, cn as SpaceFsUploadProgress, ct as ExploreSpacesResponse, dn as SpaceInvitation, dt as GlobalSearchType, en as SpaceFsReadFilesInput, er as Fetch, et as CreateInvitationResponse, fn as SpaceListItem, ft as InvitationDetail, gn as SpaceMarkResourceType, gt as MeResponse, hn as SpaceMarkRecord, ht as JsonValue, in as SpaceFsUploadEntry, it as CreateSpacePromptResponse, jn as UserProfile, jt as SessionTurnWindowResponse, kn as TaskRunDetailResponse, kt as SessionTurnSignedUrlsResponse, ln as SpaceFsUploadResponse, lt as GlobalSearchResponse, mn as SpaceMarkListItem, mt as JsonPrimitive, n as createHttpClient, nn as SpaceFsTreeResponse, nr as HttpTransport, nt as CreateSpaceModInput, on as SpaceFsUploadPlanEntry, ot as ExploreSection, pn as SpaceMarkKind, pt as JsonObject, q as BillingCreditStatus, qt as SpaceFsEncoding, rn as SpaceFsUploadDestination, rt as CreateSpacePromptInput, sn as SpaceFsUploadPlanEntryInput, st as ExploreSpaceItem, t as CohubHttpClient, tn as SpaceFsReadFilesResponse, tr as HttpError, tt as CreateSpaceInput, un as SpaceFsWriteFileInput, ut as GlobalSearchResult, vn as SpaceMeta, vt as Permission, wn as SpaceSandboxConfig, wt as SessionMessagesPaginatedResponse, xn as SpaceRecord, xt as PromptTemplateCatalogResponse, yn as SpaceModListItem, yt as PromptAccessMode, zt as SpaceConfigInput } from "./chunks/http.js";
|
|
3
|
+
export { AcceptInvitationResponse, ApiError, BillingCreditExpiryGroup, BillingCreditGrantStatus, BillingCreditStatus, BillingCreditUnit, BillingOpenOverageStatus, BillingPluginStatus, Channel, type ChannelConfig, CheckpointRecord, type CohubClientOptions, CohubHttpClient, type ContentBlock, type CreateGenerationTaskRequest, type CreateGenerationTaskResponse, CreateInvitationInput, CreateInvitationResponse, CreateSpaceInput, CreateSpaceModInput, CreateSpacePromptInput, CreateSpacePromptResponse, CronJobRecord, type DiscordChannelConfig, ExploreSection, ExploreSpaceItem, ExploreSpacesResponse, type Fetch, type GenerationContentBlock, type GenerationPolicy, type GenerationTaskResult, GlobalSearchResponse, GlobalSearchResult, GlobalSearchType, HttpError, HttpTransport, InvitationDetail, JsonObject, JsonPrimitive, JsonValue, type ListGenerationModelsResponse, MeResponse, type MessageRecord, ModelCatalogEntry, Permission, PromptAccessMode, PromptTemplateCatalogEntry, PromptTemplateCatalogResponse, type PublicGenerationDeclaration, SessionBindingRecord, type SessionForkRecord, SessionMessageResponse, SessionMessagesPaginatedResponse, SessionMessagesResponse, SessionRecord, type SessionTurnIndexItem, SessionTurnIndexResponse, type SessionTurnRecord, SessionTurnResponse, type SessionTurnSegmentRecord, SessionTurnSignedUrlsResponse, SessionTurnStreamSnapshotResponse, SessionTurnWindowResponse, SessionTurnsPaginatedResponse, SpaceAccess, SpaceAccessPolicy, SpaceBootstrapSource, SpaceChannelBindingInput, SpaceCheckpointDetailResponse, SpaceConfig, SpaceConfigInput, SpaceConfigResponse, SpaceCreateResponse, SpaceEnvInput, SpaceFsCompleteUploadInput, SpaceFsCompleteUploadResponse, SpaceFsCreateUploadInput, SpaceFsCreateUploadResponse, SpaceFsEncoding, SpaceFsEntry, SpaceFsFileKind, SpaceFsFileResponse, SpaceFsMoveInput, SpaceFsPreparingFile, SpaceFsReadFilesError, SpaceFsReadFilesInput, SpaceFsReadFilesResponse, SpaceFsTreeResponse, SpaceFsUploadDestination, SpaceFsUploadEntry, SpaceFsUploadError, SpaceFsUploadPlanEntry, SpaceFsUploadPlanEntryInput, SpaceFsUploadProgress, SpaceFsUploadResponse, SpaceFsWriteFileInput, SpaceInvitation, SpaceListItem, SpaceMarkKind, SpaceMarkListItem, SpaceMarkRecord, SpaceMarkResourceType, SpaceMember, SpaceMeta, SpaceModListItem, SpacePublicProfile, SpaceRecord, SpaceRole, SpaceSandboxAutoDestroyPolicy, SpaceSandboxConfig, SpaceSessionsResponse, SpaceUsageHourlyStat, SpaceUsageResponse, SpaceUsageSummary, TaskRunDetailResponse, TaskRunRecord, UserProfile, UserRulesResponse, createHttpClient };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { $ as CreateInvitationInput, $n as
|
|
1
|
+
import { C as normalizeBaseUrl, D as resolveWebsocketUrl, E as resolveCohubEnvironment, S as CohubEnvironment, T as resolveApiBaseUrl, _ as SessionTurnIndexItem, b as ContentBlock, c as createWebsocketClient, f as MessageRecord, g as SessionTurnSegmentRecord, m as SessionForkRecord, r as WebsocketClient, v as SessionTurnRecord, w as normalizeWebsocketUrl, x as COHUB_ENVIRONMENTS } from "./chunks/websocket.js";
|
|
2
|
+
import { $ as CreateInvitationInput, $n as CohubClientOptions, $t as SpaceFsReadFilesError, A as SessionPatchStatus, An as TaskRunRecord, At as SessionTurnStreamSnapshotResponse, B as GenerationsApi, Bn as GenerationPolicy, Bt as SpaceConfigResponse, C as SessionGenerationStreamClient, Cn as SpaceSandboxAutoDestroyPolicy, Ct as SessionMessageResponse, D as SessionPatchApplyResult, Dn as SpaceUsageResponse, Dt as SessionTurnIndexResponse, E as SessionPatchApplyInput, En as SpaceUsageHourlyStat, Et as SessionRecord, F as CreatePublicAssetUploadResponse, Fn as GenerationTaskResult, Ft as SpaceBootstrapSource, G as BillingCreditExpiryGroup, Gn as filterGenerationDeclarationsByPolicy, Gt as SpaceFsCreateUploadInput, H as ChannelsApi, Hn as assertGenerationRequestAllowedByPolicy, Ht as SpaceEnvInput, I as PublicAssetPurpose, In as ListGenerationModelsResponse, It as SpaceChannelBindingInput, J as BillingCreditUnit, Jn as normalizeGenerationPolicy, Jt as SpaceFsEntry, K as BillingCreditGrantStatus, Kn as findGenerationModelPolicy, Kt as SpaceFsCreateUploadResponse, L as PublicAssetsApi, Ln as PublicGenerationDeclaration, Lt as SpaceCheckpointDetailResponse, M as SessionAccessApi, Mn as UserRulesResponse, Mt as SessionTurnsPaginatedResponse, N as SearchApi, Nn as CreateGenerationTaskRequest, Nt as SpaceAccess, O as SessionPatchReducer, On as SpaceUsageSummary, Ot as SessionTurnResponse, P as CreatePublicAssetUploadInput, Pn as CreateGenerationTaskResponse, Pt as SpaceAccessPolicy, Q as CheckpointRecord, Qn as DiscordChannelConfig, Qt as SpaceFsPreparingFile, R as PromptsApi, Rn as GenerationModelPolicy, Rt as SpaceConfig, S as GenerationStreamTurnUpdatedEvent, Sn as SpaceRole, St as SessionBindingRecord, T as parseAssistantMessageCommit, Tn as SpaceSessionsResponse, Tt as SessionMessagesResponse, U as AcceptInvitationResponse, Un as decodeGenerationPolicy, Ut as SpaceFsCompleteUploadInput, V as CronJobsApi, Vn as GenerationPolicyError, Vt as SpaceCreateResponse, W as ApiError, Wn as encodeGenerationPolicy, Wt as SpaceFsCompleteUploadResponse, X as BillingPluginStatus, Xn as GenerationContentBlock, Xt as SpaceFsFileResponse, Y as BillingOpenOverageStatus, Yn as parseGenerationPolicyFromEnv, Yt as SpaceFsFileKind, Z as Channel, Zn as ChannelConfig, Zt as SpaceFsMoveInput, _ as GenerationStreamFinalizedEvent, _n as SpaceMember, _t as ModelCatalogEntry, a as SessionEventName, an as SpaceFsUploadError, at as CronJobRecord, b as GenerationStreamStateEvent, bn as SpacePublicProfile, bt as PromptTemplateCatalogEntry, c as SpaceClient, cn as SpaceFsUploadProgress, ct as ExploreSpacesResponse, d as WebSocketConnectionState, dn as SpaceInvitation, dt as GlobalSearchType, en as SpaceFsReadFilesInput, er as Fetch, et as CreateInvitationResponse, f as PublicInviteApi, fn as SpaceListItem, ft as InvitationDetail, g as GenerationStreamEvent, gn as SpaceMarkResourceType, gt as MeResponse, h as GenerationStreamErrorEvent, hn as SpaceMarkRecord, ht as JsonValue, i as TasksApi, in as SpaceFsUploadEntry, it as CreateSpacePromptResponse, j as createSessionPatchReducer, jn as UserProfile, jt as SessionTurnWindowResponse, k as SessionPatchState, kn as TaskRunDetailResponse, kt as SessionTurnSignedUrlsResponse, l as SpaceEventName, ln as SpaceFsUploadResponse, lt as GlobalSearchResponse, m as GenerationStreamCommitEvent, mn as SpaceMarkListItem, mt as JsonPrimitive, n as createHttpClient, nn as SpaceFsTreeResponse, nr as HttpTransport, nt as CreateSpaceModInput, o as SessionSubscriptionHandlers, on as SpaceFsUploadPlanEntry, ot as ExploreSection, p as AssistantMessageCommit, pn as SpaceMarkKind, pt as JsonObject, q as BillingCreditStatus, qn as getAllowedGenerationModelIds, qt as SpaceFsEncoding, r as UserApi, rn as SpaceFsUploadDestination, rr as RawHttpResponse, rt as CreateSpacePromptInput, s as SpaceChannelBindingRecord, sn as SpaceFsUploadPlanEntryInput, st as ExploreSpaceItem, t as CohubHttpClient, tn as SpaceFsReadFilesResponse, tr as HttpError, tt as CreateSpaceInput, u as SpacesApi, un as SpaceFsWriteFileInput, ut as GlobalSearchResult, v as GenerationStreamIntermediateMessage, vn as SpaceMeta, vt as Permission, w as createSessionGenerationStreamClient, wn as SpaceSandboxConfig, wt as SessionMessagesPaginatedResponse, x as GenerationStreamSubscriptionHandlers, xn as SpaceRecord, xt as PromptTemplateCatalogResponse, y as GenerationStreamOutOfSyncEvent, yn as SpaceModListItem, yt as PromptAccessMode, z as ModelsApi, zn as GenerationParameterConstraint, zt as SpaceConfigInput } from "./chunks/http.js";
|
|
3
3
|
|
|
4
4
|
//#region src/apis/billing.d.ts
|
|
5
5
|
declare class BillingApi {
|
|
@@ -43,4 +43,4 @@ declare class CohubClient {
|
|
|
43
43
|
}
|
|
44
44
|
declare const createCohubClient: (options?: CohubClientOptions) => CohubClient;
|
|
45
45
|
//#endregion
|
|
46
|
-
export { AcceptInvitationResponse, ApiError, type AssistantMessageCommit, BillingApi, BillingCreditExpiryGroup, BillingCreditGrantStatus, BillingCreditStatus, BillingCreditUnit, BillingOpenOverageStatus, BillingPluginStatus, COHUB_ENVIRONMENTS, Channel, ChannelConfig, CheckpointRecord, CohubClient, type CohubClientOptions, type CohubEnvironment, CohubHttpClient, ContentBlock, CreateGenerationTaskRequest, CreateGenerationTaskResponse, CreateInvitationInput, CreateInvitationResponse, type CreatePublicAssetUploadInput, type CreatePublicAssetUploadResponse, CreateSpaceInput, CreateSpaceModInput, CreateSpacePromptInput, CreateSpacePromptResponse, CronJobRecord, DiscordChannelConfig, ExploreSection, ExploreSpaceItem, ExploreSpacesResponse, type Fetch, GenerationContentBlock, type GenerationModelPolicy, type GenerationParameterConstraint, type GenerationPolicy, GenerationPolicyError, type GenerationStreamCommitEvent, type GenerationStreamErrorEvent, type GenerationStreamEvent, type GenerationStreamFinalizedEvent, type GenerationStreamIntermediateMessage, type GenerationStreamOutOfSyncEvent, type GenerationStreamStateEvent, type GenerationStreamSubscriptionHandlers, type GenerationStreamTurnUpdatedEvent, GenerationTaskResult, GlobalSearchResponse, GlobalSearchResult, GlobalSearchType, HttpError, InvitationDetail, JsonObject, JsonPrimitive, JsonValue, ListGenerationModelsResponse, MeResponse, MessageRecord, ModelCatalogEntry, Permission, PromptTemplateCatalogEntry, PromptTemplateCatalogResponse, type PublicAssetPurpose, PublicGenerationDeclaration, type RawHttpResponse, SessionBindingRecord, type SessionEventName, SessionForkRecord, SessionGenerationStreamClient, SessionMessageResponse, SessionMessagesPaginatedResponse, SessionMessagesResponse, type SessionPatchApplyInput, type SessionPatchApplyResult, SessionPatchReducer, type SessionPatchState, type SessionPatchStatus, SessionRecord, type SessionSubscriptionHandlers, SessionTurnIndexItem, SessionTurnIndexResponse, SessionTurnRecord, SessionTurnResponse, SessionTurnSegmentRecord, SessionTurnSignedUrlsResponse, SessionTurnStreamSnapshotResponse, SessionTurnWindowResponse, SessionTurnsPaginatedResponse, SpaceAccess, SpaceAccessPolicy, SpaceBootstrapSource, SpaceChannelBindingInput, type SpaceChannelBindingRecord, SpaceCheckpointDetailResponse, SpaceConfig, SpaceConfigInput, SpaceConfigResponse, SpaceCreateResponse, SpaceEnvInput, type SpaceEventName, SpaceFsCompleteUploadInput, SpaceFsCompleteUploadResponse, SpaceFsCreateUploadInput, SpaceFsCreateUploadResponse, SpaceFsEncoding, SpaceFsEntry, SpaceFsFileKind, SpaceFsFileResponse, SpaceFsMoveInput, SpaceFsPreparingFile, SpaceFsReadFilesError, SpaceFsReadFilesInput, SpaceFsReadFilesResponse, SpaceFsTreeResponse, SpaceFsUploadDestination, SpaceFsUploadEntry, SpaceFsUploadError, SpaceFsUploadPlanEntry, SpaceFsUploadPlanEntryInput, SpaceFsUploadProgress, SpaceFsUploadResponse, SpaceFsWriteFileInput,
|
|
46
|
+
export { AcceptInvitationResponse, ApiError, type AssistantMessageCommit, BillingApi, BillingCreditExpiryGroup, BillingCreditGrantStatus, BillingCreditStatus, BillingCreditUnit, BillingOpenOverageStatus, BillingPluginStatus, COHUB_ENVIRONMENTS, Channel, type ChannelConfig, CheckpointRecord, CohubClient, type CohubClientOptions, type CohubEnvironment, CohubHttpClient, type ContentBlock, type CreateGenerationTaskRequest, type CreateGenerationTaskResponse, CreateInvitationInput, CreateInvitationResponse, type CreatePublicAssetUploadInput, type CreatePublicAssetUploadResponse, CreateSpaceInput, CreateSpaceModInput, CreateSpacePromptInput, CreateSpacePromptResponse, CronJobRecord, type DiscordChannelConfig, ExploreSection, ExploreSpaceItem, ExploreSpacesResponse, type Fetch, type GenerationContentBlock, type GenerationModelPolicy, type GenerationParameterConstraint, type GenerationPolicy, GenerationPolicyError, type GenerationStreamCommitEvent, type GenerationStreamErrorEvent, type GenerationStreamEvent, type GenerationStreamFinalizedEvent, type GenerationStreamIntermediateMessage, type GenerationStreamOutOfSyncEvent, type GenerationStreamStateEvent, type GenerationStreamSubscriptionHandlers, type GenerationStreamTurnUpdatedEvent, type GenerationTaskResult, GlobalSearchResponse, GlobalSearchResult, GlobalSearchType, HttpError, InvitationDetail, JsonObject, JsonPrimitive, JsonValue, type ListGenerationModelsResponse, MeResponse, type MessageRecord, ModelCatalogEntry, Permission, PromptAccessMode, PromptTemplateCatalogEntry, PromptTemplateCatalogResponse, type PublicAssetPurpose, type PublicGenerationDeclaration, type RawHttpResponse, SessionBindingRecord, type SessionEventName, type SessionForkRecord, SessionGenerationStreamClient, SessionMessageResponse, SessionMessagesPaginatedResponse, SessionMessagesResponse, type SessionPatchApplyInput, type SessionPatchApplyResult, SessionPatchReducer, type SessionPatchState, type SessionPatchStatus, SessionRecord, type SessionSubscriptionHandlers, type SessionTurnIndexItem, SessionTurnIndexResponse, type SessionTurnRecord, SessionTurnResponse, type SessionTurnSegmentRecord, SessionTurnSignedUrlsResponse, SessionTurnStreamSnapshotResponse, SessionTurnWindowResponse, SessionTurnsPaginatedResponse, SpaceAccess, SpaceAccessPolicy, SpaceBootstrapSource, SpaceChannelBindingInput, type SpaceChannelBindingRecord, SpaceCheckpointDetailResponse, SpaceConfig, SpaceConfigInput, SpaceConfigResponse, SpaceCreateResponse, SpaceEnvInput, type SpaceEventName, SpaceFsCompleteUploadInput, SpaceFsCompleteUploadResponse, SpaceFsCreateUploadInput, SpaceFsCreateUploadResponse, SpaceFsEncoding, SpaceFsEntry, SpaceFsFileKind, SpaceFsFileResponse, SpaceFsMoveInput, SpaceFsPreparingFile, SpaceFsReadFilesError, SpaceFsReadFilesInput, SpaceFsReadFilesResponse, SpaceFsTreeResponse, SpaceFsUploadDestination, SpaceFsUploadEntry, SpaceFsUploadError, SpaceFsUploadPlanEntry, SpaceFsUploadPlanEntryInput, SpaceFsUploadProgress, SpaceFsUploadResponse, SpaceFsWriteFileInput, SpaceInvitation, SpaceListItem, SpaceMarkKind, SpaceMarkListItem, SpaceMarkRecord, SpaceMarkResourceType, SpaceMember, SpaceMeta, SpaceModListItem, SpacePublicProfile, SpaceRecord, SpaceRole, SpaceSandboxAutoDestroyPolicy, SpaceSandboxConfig, SpaceSessionsResponse, SpaceUsageHourlyStat, SpaceUsageResponse, SpaceUsageSummary, TaskRunDetailResponse, TaskRunRecord, UserProfile, UserRulesResponse, type WebSocketConnectionState, WebsocketClient, assertGenerationRequestAllowedByPolicy, createCohubClient, createHttpClient, createSessionGenerationStreamClient, createSessionPatchReducer, createWebsocketClient, decodeGenerationPolicy, encodeGenerationPolicy, filterGenerationDeclarationsByPolicy, findGenerationModelPolicy, getAllowedGenerationModelIds, normalizeBaseUrl, normalizeGenerationPolicy, normalizeWebsocketUrl, parseAssistantMessageCommit, parseGenerationPolicyFromEnv, resolveApiBaseUrl, resolveCohubEnvironment, resolveWebsocketUrl };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neta-art/cohub",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.19.0",
|
|
4
4
|
"description": "Cohub SDK for spaces, sessions, checkpoints, and realtime agent collaboration.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"private": false,
|
|
@@ -47,9 +47,8 @@
|
|
|
47
47
|
"dist",
|
|
48
48
|
"README.md"
|
|
49
49
|
],
|
|
50
|
-
"dependencies": {},
|
|
51
50
|
"devDependencies": {
|
|
52
|
-
"tsdown": "^0.22.
|
|
51
|
+
"tsdown": "^0.22.1",
|
|
53
52
|
"typescript": "^6.0.3",
|
|
54
53
|
"@cohub/protocol": "2.0.0"
|
|
55
54
|
},
|