@neta-art/cohub 1.18.0 → 1.18.1
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 +32 -236
- package/dist/chunks/http.js +0 -16
- package/dist/chunks/websocket.d.ts +233 -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,6 @@ type SpaceSessionsResponse = {
|
|
|
875
699
|
nextCursor: string | null;
|
|
876
700
|
};
|
|
877
701
|
};
|
|
878
|
-
type UserSshKey = {
|
|
879
|
-
id: string;
|
|
880
|
-
key: string;
|
|
881
|
-
title: string;
|
|
882
|
-
giteaKeyId: number;
|
|
883
|
-
createdAt: string;
|
|
884
|
-
};
|
|
885
702
|
type CreateSpacePromptInput = {
|
|
886
703
|
sessionId?: string | null;
|
|
887
704
|
title?: string | null;
|
|
@@ -904,20 +721,14 @@ type CreateSpacePromptInput = {
|
|
|
904
721
|
timezone: string;
|
|
905
722
|
};
|
|
906
723
|
};
|
|
907
|
-
type CreateSpacePromptResponse = {
|
|
908
|
-
ok: true;
|
|
724
|
+
type CreateSpacePromptResponse = (SessionTurnResponse & {
|
|
909
725
|
mode: "immediate";
|
|
910
|
-
|
|
911
|
-
userMessageId: string;
|
|
912
|
-
turnId: string;
|
|
913
|
-
} | {
|
|
914
|
-
ok: true;
|
|
726
|
+
}) | {
|
|
915
727
|
mode: "delay" | "at";
|
|
916
728
|
taskRunId: string;
|
|
917
729
|
scheduledAt: string;
|
|
918
730
|
sessionId: string | null;
|
|
919
731
|
} | {
|
|
920
|
-
ok: true;
|
|
921
732
|
mode: "repeat";
|
|
922
733
|
cronJobId: string;
|
|
923
734
|
nextRunAt: string;
|
|
@@ -1022,22 +833,28 @@ type SpaceModListItem = {
|
|
|
1022
833
|
modSpaceName: string | null;
|
|
1023
834
|
modSpaceDescription: string | null;
|
|
1024
835
|
};
|
|
836
|
+
/**
|
|
837
|
+
* Public-safe DTO for Explore spaces.
|
|
838
|
+
* Only contains fields safe for unauthenticated product rendering.
|
|
839
|
+
*/
|
|
1025
840
|
type ExploreSpaceItem = {
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
841
|
+
id: string;
|
|
842
|
+
slug: string | null;
|
|
843
|
+
title: string;
|
|
844
|
+
summary: string | null;
|
|
845
|
+
spaceUrl: string;
|
|
846
|
+
avatarUrl: string | null;
|
|
847
|
+
avatarAlt: string | null;
|
|
848
|
+
ownerDisplayName: string | null;
|
|
849
|
+
ownerAvatarUrl: string | null;
|
|
850
|
+
category: string | null;
|
|
851
|
+
tags: string[];
|
|
852
|
+
saveCount: number;
|
|
853
|
+
pinCount: number;
|
|
854
|
+
forkCount: number;
|
|
855
|
+
updatedAt: string | null;
|
|
856
|
+
accessLabel: "public" | "sign-in-required" | "unknown";
|
|
857
|
+
latestSaveLabel: string | null;
|
|
1041
858
|
};
|
|
1042
859
|
type ExploreSection = {
|
|
1043
860
|
key: string;
|
|
@@ -1050,7 +867,7 @@ type ExploreSpacesResponse = {
|
|
|
1050
867
|
sections: ExploreSection[];
|
|
1051
868
|
spaces: ExploreSpaceItem[];
|
|
1052
869
|
};
|
|
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";
|
|
870
|
+
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
871
|
type SpaceAccess = {
|
|
1055
872
|
role: SpaceRole | null;
|
|
1056
873
|
permissions: Permission[];
|
|
@@ -1246,15 +1063,6 @@ declare class SessionAccessApi {
|
|
|
1246
1063
|
}>;
|
|
1247
1064
|
}
|
|
1248
1065
|
//#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
1066
|
//#region src/session-patch-reducer.d.ts
|
|
1259
1067
|
type SessionPatchStatus = "idle" | "pending" | "streaming" | "completed" | "failed" | "interrupted";
|
|
1260
1068
|
type SessionPatchState = {
|
|
@@ -1531,11 +1339,7 @@ declare class SessionMessagesClient {
|
|
|
1531
1339
|
limit?: number;
|
|
1532
1340
|
direction?: "older" | "newer";
|
|
1533
1341
|
}, customFetch?: Fetch): Promise<SessionMessagesPaginatedResponse>;
|
|
1534
|
-
send(input: SessionSendMessageInput): Promise<
|
|
1535
|
-
ok: true;
|
|
1536
|
-
userMessageId: string;
|
|
1537
|
-
turnId: string;
|
|
1538
|
-
}>;
|
|
1342
|
+
send(input: SessionSendMessageInput): Promise<SessionTurnResponse>;
|
|
1539
1343
|
}
|
|
1540
1344
|
declare class SessionTurnsClient {
|
|
1541
1345
|
private readonly transport;
|
|
@@ -1876,14 +1680,6 @@ declare class UserApi {
|
|
|
1876
1680
|
getRules(customFetch?: Fetch): Promise<UserRulesResponse>;
|
|
1877
1681
|
setAuthToken(token: string): Promise<any>;
|
|
1878
1682
|
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
1683
|
}
|
|
1888
1684
|
//#endregion
|
|
1889
1685
|
//#region src/http.d.ts
|
|
@@ -1906,4 +1702,4 @@ declare class CohubHttpClient {
|
|
|
1906
1702
|
}
|
|
1907
1703
|
declare const createHttpClient: (options?: CohubClientOptions) => CohubHttpClient;
|
|
1908
1704
|
//#endregion
|
|
1909
|
-
export { CreateInvitationInput as $,
|
|
1705
|
+
export { CreateInvitationInput as $, Fetch as $n, SpaceFsReadFilesInput as $t, SessionPatchStatus as A, UserProfile as An, SessionTurnWindowResponse as At, GenerationsApi as B, GenerationPolicyError as Bn, SpaceCreateResponse as Bt, SessionGenerationStreamClient as C, SpaceSandboxConfig as Cn, SessionMessagesPaginatedResponse as Ct, SessionPatchApplyResult as D, SpaceUsageSummary as Dn, SessionTurnResponse as Dt, SessionPatchApplyInput as E, SpaceUsageResponse as En, SessionTurnIndexResponse as Et, CreatePublicAssetUploadResponse as F, ListGenerationModelsResponse as Fn, SpaceChannelBindingInput as Ft, BillingCreditExpiryGroup as G, findGenerationModelPolicy as Gn, SpaceFsCreateUploadResponse as Gt, ChannelsApi as H, decodeGenerationPolicy as Hn, SpaceFsCompleteUploadInput as Ht, PublicAssetPurpose as I, PublicGenerationDeclaration as In, SpaceCheckpointDetailResponse as It, BillingCreditUnit as J, parseGenerationPolicyFromEnv as Jn, SpaceFsFileKind as Jt, BillingCreditGrantStatus as K, getAllowedGenerationModelIds as Kn, SpaceFsEncoding as Kt, PublicAssetsApi as L, GenerationModelPolicy as Ln, SpaceConfig as Lt, SessionAccessApi as M, CreateGenerationTaskRequest as Mn, SpaceAccess as Mt, SearchApi as N, CreateGenerationTaskResponse as Nn, SpaceAccessPolicy as Nt, SessionPatchReducer as O, TaskRunDetailResponse as On, SessionTurnSignedUrlsResponse as Ot, CreatePublicAssetUploadInput as P, GenerationTaskResult as Pn, SpaceBootstrapSource as Pt, CheckpointRecord as Q, CohubClientOptions as Qn, SpaceFsReadFilesError as Qt, PromptsApi as R, GenerationParameterConstraint as Rn, SpaceConfigInput as Rt, GenerationStreamTurnUpdatedEvent as S, SpaceSandboxAutoDestroyPolicy as Sn, SessionMessageResponse as St, parseAssistantMessageCommit as T, SpaceUsageHourlyStat as Tn, SessionRecord as Tt, AcceptInvitationResponse as U, encodeGenerationPolicy as Un, SpaceFsCompleteUploadResponse as Ut, CronJobsApi as V, assertGenerationRequestAllowedByPolicy as Vn, SpaceEnvInput as Vt, ApiError as W, filterGenerationDeclarationsByPolicy as Wn, SpaceFsCreateUploadInput as Wt, BillingPluginStatus as X, ChannelConfig as Xn, SpaceFsMoveInput as Xt, BillingOpenOverageStatus as Y, GenerationContentBlock as Yn, SpaceFsFileResponse as Yt, Channel as Z, DiscordChannelConfig as Zn, SpaceFsPreparingFile as Zt, GenerationStreamFinalizedEvent as _, SpaceMeta as _n, ModelCatalogEntry as _t, SessionEventName as a, SpaceFsUploadPlanEntry as an, CronJobRecord as at, GenerationStreamStateEvent as b, SpaceRecord as bn, PromptTemplateCatalogResponse as bt, SpaceClient as c, SpaceFsUploadResponse as cn, ExploreSpacesResponse as ct, WebSocketConnectionState as d, SpaceListItem as dn, GlobalSearchType as dt, SpaceFsReadFilesResponse as en, HttpError as er, CreateInvitationResponse as et, PublicInviteApi as f, SpaceMarkKind as fn, InvitationDetail as ft, GenerationStreamEvent as g, SpaceMember as gn, MeResponse as gt, GenerationStreamErrorEvent as h, SpaceMarkResourceType as hn, JsonValue as ht, TasksApi as i, SpaceFsUploadError as in, CreateSpacePromptResponse as it, createSessionPatchReducer as j, UserRulesResponse as jn, SessionTurnsPaginatedResponse as jt, SessionPatchState as k, TaskRunRecord as kn, SessionTurnStreamSnapshotResponse as kt, SpaceEventName as l, SpaceFsWriteFileInput as ln, GlobalSearchResponse as lt, GenerationStreamCommitEvent as m, SpaceMarkRecord as mn, JsonPrimitive as mt, createHttpClient as n, SpaceFsUploadDestination as nn, RawHttpResponse as nr, CreateSpaceModInput as nt, SessionSubscriptionHandlers as o, SpaceFsUploadPlanEntryInput as on, ExploreSection as ot, AssistantMessageCommit as p, SpaceMarkListItem as pn, JsonObject as pt, BillingCreditStatus as q, normalizeGenerationPolicy as qn, SpaceFsEntry as qt, UserApi as r, SpaceFsUploadEntry as rn, CreateSpacePromptInput as rt, SpaceChannelBindingRecord as s, SpaceFsUploadProgress as sn, ExploreSpaceItem as st, CohubHttpClient as t, SpaceFsTreeResponse as tn, HttpTransport as tr, CreateSpaceInput as tt, SpacesApi as u, SpaceInvitation as un, GlobalSearchResult as ut, GenerationStreamIntermediateMessage as v, SpaceModListItem as vn, Permission as vt, createSessionGenerationStreamClient as w, SpaceSessionsResponse as wn, SessionMessagesResponse as wt, GenerationStreamSubscriptionHandlers as x, SpaceRole as xn, SessionBindingRecord as xt, GenerationStreamOutOfSyncEvent as y, SpacePublicProfile as yn, PromptTemplateCatalogEntry as yt, ModelsApi as z, GenerationPolicy as zn, SpaceConfigResponse 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,238 @@ 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 SessionRecord = {
|
|
208
|
+
id: string;
|
|
209
|
+
spaceId: string;
|
|
210
|
+
title: string | null;
|
|
211
|
+
source: string | null;
|
|
212
|
+
status: string | null;
|
|
213
|
+
externalSessionId: string | null;
|
|
214
|
+
meta: Record<string, unknown> | null;
|
|
215
|
+
latestMessageText: string | null;
|
|
216
|
+
lastMessageAt: string | null;
|
|
217
|
+
lastMessageId: string | null;
|
|
218
|
+
createdAt: string;
|
|
219
|
+
updatedAt: string;
|
|
220
|
+
};
|
|
221
|
+
type MessageAuthorProfile = {
|
|
222
|
+
userUuid: string;
|
|
223
|
+
displayName: string;
|
|
224
|
+
avatarUrl: string | null;
|
|
225
|
+
};
|
|
226
|
+
type MessageRecord = {
|
|
227
|
+
id: string;
|
|
228
|
+
sessionId: string;
|
|
229
|
+
role: "user" | "assistant" | "system";
|
|
230
|
+
content: ContentBlock[];
|
|
231
|
+
text: string | null;
|
|
232
|
+
sequence: number;
|
|
233
|
+
provider: string | null;
|
|
234
|
+
model: string | null;
|
|
235
|
+
stopReason: string | null;
|
|
236
|
+
errorMessage: string | null;
|
|
237
|
+
usage: Usage | null;
|
|
238
|
+
meta: Record<string, unknown> | null;
|
|
239
|
+
authorUuid?: string | null;
|
|
240
|
+
authorProfile?: MessageAuthorProfile | null;
|
|
241
|
+
startedAt: string | null;
|
|
242
|
+
completedAt: string | null;
|
|
243
|
+
durationMs: number | null;
|
|
244
|
+
createdAt: string;
|
|
245
|
+
};
|
|
246
|
+
//#endregion
|
|
247
|
+
//#region ../protocol/src/ports/index.d.ts
|
|
248
|
+
type SpacePortStatus = "listening" | "closed";
|
|
249
|
+
type SpacePublicEndpoint = {
|
|
250
|
+
url: string;
|
|
251
|
+
status?: SpacePortStatus | "unknown";
|
|
252
|
+
observedAt?: number;
|
|
253
|
+
};
|
|
254
|
+
type SpacePublicEndpoints = Record<string, SpacePublicEndpoint>;
|
|
255
|
+
//#endregion
|
|
256
|
+
//#region ../protocol/src/realtime/types.d.ts
|
|
26
257
|
type RealtimeEnvelope = {
|
|
27
258
|
id: string;
|
|
28
259
|
timestamp: number;
|
|
@@ -78,52 +309,6 @@ type SessionTurnPatchEvent = {
|
|
|
78
309
|
};
|
|
79
310
|
};
|
|
80
311
|
//#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
312
|
//#region src/websocket.d.ts
|
|
128
313
|
type WebsocketEventPayload = ChannelEnvelope;
|
|
129
314
|
type WebSocketLike = {
|
|
@@ -266,4 +451,4 @@ declare class WebsocketClient {
|
|
|
266
451
|
}
|
|
267
452
|
declare const createWebsocketClient: (options?: WebsocketClientOptions) => WebsocketClient;
|
|
268
453
|
//#endregion
|
|
269
|
-
export { resolveCohubEnvironment as _, WebsocketClientOptions as a, createWebsocketClient as c,
|
|
454
|
+
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 Fetch, $t as SpaceFsReadFilesInput, An as UserProfile, At as SessionTurnWindowResponse, Bt as SpaceCreateResponse, Cn as SpaceSandboxConfig, Ct as SessionMessagesPaginatedResponse, Dn as SpaceUsageSummary, Dt as SessionTurnResponse, En as SpaceUsageResponse, Et as SessionTurnIndexResponse, Fn as ListGenerationModelsResponse, Ft as SpaceChannelBindingInput, G as BillingCreditExpiryGroup, Gt as SpaceFsCreateUploadResponse, Ht as SpaceFsCompleteUploadInput, In as PublicGenerationDeclaration, It as SpaceCheckpointDetailResponse, J as BillingCreditUnit, Jt as SpaceFsFileKind, K as BillingCreditGrantStatus, Kt as SpaceFsEncoding, Lt as SpaceConfig, Mn as CreateGenerationTaskRequest, Mt as SpaceAccess, Nn as CreateGenerationTaskResponse, Nt as SpaceAccessPolicy, On as TaskRunDetailResponse, Ot as SessionTurnSignedUrlsResponse, Pn as GenerationTaskResult, Pt as SpaceBootstrapSource, Q as CheckpointRecord, Qn as CohubClientOptions, Qt as SpaceFsReadFilesError, Rt as SpaceConfigInput, Sn as SpaceSandboxAutoDestroyPolicy, St as SessionMessageResponse, Tn as SpaceUsageHourlyStat, Tt as SessionRecord, U as AcceptInvitationResponse, Ut as SpaceFsCompleteUploadResponse, Vt as SpaceEnvInput, W as ApiError, Wt as SpaceFsCreateUploadInput, X as BillingPluginStatus, Xn as ChannelConfig, Xt as SpaceFsMoveInput, Y as BillingOpenOverageStatus, Yn as GenerationContentBlock, Yt as SpaceFsFileResponse, Z as Channel, Zn as DiscordChannelConfig, Zt as SpaceFsPreparingFile, _n as SpaceMeta, _t as ModelCatalogEntry, an as SpaceFsUploadPlanEntry, at as CronJobRecord, bn as SpaceRecord, bt as PromptTemplateCatalogResponse, cn as SpaceFsUploadResponse, ct as ExploreSpacesResponse, dn as SpaceListItem, dt as GlobalSearchType, en as SpaceFsReadFilesResponse, er as HttpError, et as CreateInvitationResponse, fn as SpaceMarkKind, ft as InvitationDetail, gn as SpaceMember, gt as MeResponse, hn as SpaceMarkResourceType, ht as JsonValue, in as SpaceFsUploadError, it as CreateSpacePromptResponse, jn as UserRulesResponse, jt as SessionTurnsPaginatedResponse, kn as TaskRunRecord, kt as SessionTurnStreamSnapshotResponse, ln as SpaceFsWriteFileInput, lt as GlobalSearchResponse, mn as SpaceMarkRecord, mt as JsonPrimitive, n as createHttpClient, nn as SpaceFsUploadDestination, nt as CreateSpaceModInput, on as SpaceFsUploadPlanEntryInput, ot as ExploreSection, pn as SpaceMarkListItem, pt as JsonObject, q as BillingCreditStatus, qt as SpaceFsEntry, rn as SpaceFsUploadEntry, rt as CreateSpacePromptInput, sn as SpaceFsUploadProgress, st as ExploreSpaceItem, t as CohubHttpClient, tn as SpaceFsTreeResponse, tr as HttpTransport, tt as CreateSpaceInput, un as SpaceInvitation, ut as GlobalSearchResult, vn as SpaceModListItem, vt as Permission, wn as SpaceSessionsResponse, wt as SessionMessagesResponse, xn as SpaceRole, xt as SessionBindingRecord, yn as SpacePublicProfile, yt as PromptTemplateCatalogEntry, zn as GenerationPolicy, zt as SpaceConfigResponse } 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, 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 Fetch, $t as SpaceFsReadFilesInput, A as SessionPatchStatus, An as UserProfile, At as SessionTurnWindowResponse, B as GenerationsApi, Bn as GenerationPolicyError, Bt as SpaceCreateResponse, C as SessionGenerationStreamClient, Cn as SpaceSandboxConfig, Ct as SessionMessagesPaginatedResponse, D as SessionPatchApplyResult, Dn as SpaceUsageSummary, Dt as SessionTurnResponse, E as SessionPatchApplyInput, En as SpaceUsageResponse, Et as SessionTurnIndexResponse, F as CreatePublicAssetUploadResponse, Fn as ListGenerationModelsResponse, Ft as SpaceChannelBindingInput, G as BillingCreditExpiryGroup, Gn as findGenerationModelPolicy, Gt as SpaceFsCreateUploadResponse, H as ChannelsApi, Hn as decodeGenerationPolicy, Ht as SpaceFsCompleteUploadInput, I as PublicAssetPurpose, In as PublicGenerationDeclaration, It as SpaceCheckpointDetailResponse, J as BillingCreditUnit, Jn as parseGenerationPolicyFromEnv, Jt as SpaceFsFileKind, K as BillingCreditGrantStatus, Kn as getAllowedGenerationModelIds, Kt as SpaceFsEncoding, L as PublicAssetsApi, Ln as GenerationModelPolicy, Lt as SpaceConfig, M as SessionAccessApi, Mn as CreateGenerationTaskRequest, Mt as SpaceAccess, N as SearchApi, Nn as CreateGenerationTaskResponse, Nt as SpaceAccessPolicy, O as SessionPatchReducer, On as TaskRunDetailResponse, Ot as SessionTurnSignedUrlsResponse, P as CreatePublicAssetUploadInput, Pn as GenerationTaskResult, Pt as SpaceBootstrapSource, Q as CheckpointRecord, Qn as CohubClientOptions, Qt as SpaceFsReadFilesError, R as PromptsApi, Rn as GenerationParameterConstraint, Rt as SpaceConfigInput, S as GenerationStreamTurnUpdatedEvent, Sn as SpaceSandboxAutoDestroyPolicy, St as SessionMessageResponse, T as parseAssistantMessageCommit, Tn as SpaceUsageHourlyStat, Tt as SessionRecord, U as AcceptInvitationResponse, Un as encodeGenerationPolicy, Ut as SpaceFsCompleteUploadResponse, V as CronJobsApi, Vn as assertGenerationRequestAllowedByPolicy, Vt as SpaceEnvInput, W as ApiError, Wn as filterGenerationDeclarationsByPolicy, Wt as SpaceFsCreateUploadInput, X as BillingPluginStatus, Xn as ChannelConfig, Xt as SpaceFsMoveInput, Y as BillingOpenOverageStatus, Yn as GenerationContentBlock, Yt as SpaceFsFileResponse, Z as Channel, Zn as DiscordChannelConfig, Zt as SpaceFsPreparingFile, _ as GenerationStreamFinalizedEvent, _n as SpaceMeta, _t as ModelCatalogEntry, a as SessionEventName, an as SpaceFsUploadPlanEntry, at as CronJobRecord, b as GenerationStreamStateEvent, bn as SpaceRecord, bt as PromptTemplateCatalogResponse, c as SpaceClient, cn as SpaceFsUploadResponse, ct as ExploreSpacesResponse, d as WebSocketConnectionState, dn as SpaceListItem, dt as GlobalSearchType, en as SpaceFsReadFilesResponse, er as HttpError, et as CreateInvitationResponse, f as PublicInviteApi, fn as SpaceMarkKind, ft as InvitationDetail, g as GenerationStreamEvent, gn as SpaceMember, gt as MeResponse, h as GenerationStreamErrorEvent, hn as SpaceMarkResourceType, ht as JsonValue, i as TasksApi, in as SpaceFsUploadError, it as CreateSpacePromptResponse, j as createSessionPatchReducer, jn as UserRulesResponse, jt as SessionTurnsPaginatedResponse, k as SessionPatchState, kn as TaskRunRecord, kt as SessionTurnStreamSnapshotResponse, l as SpaceEventName, ln as SpaceFsWriteFileInput, lt as GlobalSearchResponse, m as GenerationStreamCommitEvent, mn as SpaceMarkRecord, mt as JsonPrimitive, n as createHttpClient, nn as SpaceFsUploadDestination, nr as RawHttpResponse, nt as CreateSpaceModInput, o as SessionSubscriptionHandlers, on as SpaceFsUploadPlanEntryInput, ot as ExploreSection, p as AssistantMessageCommit, pn as SpaceMarkListItem, pt as JsonObject, q as BillingCreditStatus, qn as normalizeGenerationPolicy, qt as SpaceFsEntry, r as UserApi, rn as SpaceFsUploadEntry, rt as CreateSpacePromptInput, s as SpaceChannelBindingRecord, sn as SpaceFsUploadProgress, st as ExploreSpaceItem, t as CohubHttpClient, tn as SpaceFsTreeResponse, tr as HttpTransport, tt as CreateSpaceInput, u as SpacesApi, un as SpaceInvitation, ut as GlobalSearchResult, v as GenerationStreamIntermediateMessage, vn as SpaceModListItem, vt as Permission, w as createSessionGenerationStreamClient, wn as SpaceSessionsResponse, wt as SessionMessagesResponse, x as GenerationStreamSubscriptionHandlers, xn as SpaceRole, xt as SessionBindingRecord, y as GenerationStreamOutOfSyncEvent, yn as SpacePublicProfile, yt as PromptTemplateCatalogEntry, z as ModelsApi, zn as GenerationPolicy, zt as SpaceConfigResponse } 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, 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.18.
|
|
3
|
+
"version": "1.18.1",
|
|
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
|
},
|