@neta-art/cohub 1.28.2 → 1.30.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 +37 -6
- package/dist/chunks/http.js +27 -3
- package/package.json +1 -1
package/dist/chunks/http.d.ts
CHANGED
|
@@ -66,7 +66,12 @@ type FeishuChannelConfig = {
|
|
|
66
66
|
showToolCalls?: boolean;
|
|
67
67
|
};
|
|
68
68
|
};
|
|
69
|
-
type
|
|
69
|
+
type WeChatChannelConfig = {
|
|
70
|
+
outbound?: {
|
|
71
|
+
showIntermediateStatus?: boolean;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
type ChannelConfig = DiscordChannelConfig | FeishuChannelConfig | WeChatChannelConfig | Record<string, unknown>;
|
|
70
75
|
//#endregion
|
|
71
76
|
//#region ../../node_modules/.pnpm/@neta-art+generation@0.1.5/node_modules/@neta-art/generation/dist/builtins-C-_aGhT8.d.ts
|
|
72
77
|
//#region src/types.d.ts
|
|
@@ -984,6 +989,7 @@ type CreateSpacePromptInput = {
|
|
|
984
989
|
generationPolicy?: GenerationPolicy | null;
|
|
985
990
|
intent?: "followup" | "steer" | null;
|
|
986
991
|
accessMode?: PromptAccessMode | null;
|
|
992
|
+
env?: Record<string, string> | null;
|
|
987
993
|
labelRefs?: string[];
|
|
988
994
|
schedule?: {
|
|
989
995
|
mode?: "immediate";
|
|
@@ -1020,6 +1026,7 @@ type SendMessageCronJobPayload = CronJobPayload & {
|
|
|
1020
1026
|
generationPolicy?: unknown;
|
|
1021
1027
|
intent?: "followup" | "steer" | string;
|
|
1022
1028
|
accessMode?: "read_only" | "full_access";
|
|
1029
|
+
env?: Record<string, string> | null;
|
|
1023
1030
|
source?: string;
|
|
1024
1031
|
sessionId?: string;
|
|
1025
1032
|
title?: string;
|
|
@@ -1085,8 +1092,10 @@ type CheckpointRecord = {
|
|
|
1085
1092
|
commitHash: string;
|
|
1086
1093
|
description: string;
|
|
1087
1094
|
parentCheckpointId: string | null;
|
|
1095
|
+
rootCheckpointId?: string | null;
|
|
1088
1096
|
forkCount: number;
|
|
1089
|
-
|
|
1097
|
+
saveVersion?: number;
|
|
1098
|
+
meta?: Record<string, unknown> | null;
|
|
1090
1099
|
createdAt: string;
|
|
1091
1100
|
};
|
|
1092
1101
|
type SpaceCheckpointDetailResponse = {
|
|
@@ -1200,7 +1209,7 @@ type ExploreSpacesResponse = {
|
|
|
1200
1209
|
sections: ExploreSection[];
|
|
1201
1210
|
spaces: ExploreSpaceItem[];
|
|
1202
1211
|
};
|
|
1203
|
-
type Permission = "space.view" | "space.edit" | "space.label.view" | "space.label.manage" | "space.label.assign" | "session.view" | "session.edit" | "session.prompt.readonly" | "session.prompt.fullaccess" | "generation.create" | "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";
|
|
1212
|
+
type Permission = "space.view" | "space.edit" | "space.label.view" | "space.label.manage" | "space.label.assign" | "session.view" | "session.edit" | "session.prompt.readonly" | "session.prompt.fullaccess" | "generation.create" | "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" | "user.space.list" | "user.session.list" | "user.usage.read";
|
|
1204
1213
|
type SpaceAccess = {
|
|
1205
1214
|
role: SpaceRole | null;
|
|
1206
1215
|
permissions: Permission[];
|
|
@@ -1290,6 +1299,26 @@ declare class ChannelsApi {
|
|
|
1290
1299
|
name: string;
|
|
1291
1300
|
credentials: Record<string, unknown>;
|
|
1292
1301
|
}): Promise<unknown>;
|
|
1302
|
+
startWeChatLogin(data: {
|
|
1303
|
+
name?: string;
|
|
1304
|
+
}): Promise<{
|
|
1305
|
+
sessionKey: string;
|
|
1306
|
+
qrDataUrl: string;
|
|
1307
|
+
message: string;
|
|
1308
|
+
expiresInSeconds: number;
|
|
1309
|
+
}>;
|
|
1310
|
+
waitWeChatLogin(data: {
|
|
1311
|
+
sessionKey: string;
|
|
1312
|
+
verifyCode?: string;
|
|
1313
|
+
}): Promise<{
|
|
1314
|
+
connected: boolean;
|
|
1315
|
+
expired?: boolean;
|
|
1316
|
+
alreadyConnected?: boolean;
|
|
1317
|
+
needVerifyCode?: boolean;
|
|
1318
|
+
status?: string;
|
|
1319
|
+
message: string;
|
|
1320
|
+
channel?: Channel;
|
|
1321
|
+
}>;
|
|
1293
1322
|
delete(id: string): Promise<unknown>;
|
|
1294
1323
|
}
|
|
1295
1324
|
//#endregion
|
|
@@ -1711,9 +1740,6 @@ declare class SpaceFilesApi {
|
|
|
1711
1740
|
declare class SessionMessagesClient {
|
|
1712
1741
|
private readonly transport;
|
|
1713
1742
|
private readonly sessionId;
|
|
1714
|
-
private lastSentSignature;
|
|
1715
|
-
private lastSentSessionId;
|
|
1716
|
-
private lastSentAt;
|
|
1717
1743
|
constructor(transport: HttpTransport, sessionId: string);
|
|
1718
1744
|
list(customFetch?: Fetch): Promise<SessionMessagesResponse>;
|
|
1719
1745
|
get(messageId: string, optionsOrFetch?: {
|
|
@@ -2152,6 +2178,11 @@ declare class UserApi {
|
|
|
2152
2178
|
profile: UserProfile;
|
|
2153
2179
|
}>;
|
|
2154
2180
|
getRules(customFetch?: Fetch): Promise<UserRulesResponse>;
|
|
2181
|
+
listSessions(optionsOrFetch?: {
|
|
2182
|
+
limit?: number;
|
|
2183
|
+
cursor?: string | null;
|
|
2184
|
+
} | Fetch, customFetch?: Fetch): Promise<SpaceSessionsResponse>;
|
|
2185
|
+
getUsage(days?: number, customFetch?: Fetch): Promise<SpaceUsageResponse>;
|
|
2155
2186
|
setAuthToken(token: string): Promise<any>;
|
|
2156
2187
|
clearAuthToken(): Promise<null>;
|
|
2157
2188
|
}
|
package/dist/chunks/http.js
CHANGED
|
@@ -18,6 +18,20 @@ var ChannelsApi = class {
|
|
|
18
18
|
body: JSON.stringify(data)
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
|
+
startWeChatLogin(data) {
|
|
22
|
+
return this.transport.request("/api/channels/wechat/login/start", {
|
|
23
|
+
method: "POST",
|
|
24
|
+
headers: { "Content-Type": "application/json" },
|
|
25
|
+
body: JSON.stringify(data)
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
waitWeChatLogin(data) {
|
|
29
|
+
return this.transport.request("/api/channels/wechat/login/wait", {
|
|
30
|
+
method: "POST",
|
|
31
|
+
headers: { "Content-Type": "application/json" },
|
|
32
|
+
body: JSON.stringify(data)
|
|
33
|
+
});
|
|
34
|
+
}
|
|
21
35
|
delete(id) {
|
|
22
36
|
return this.transport.request(`/api/channels/${id}`, { method: "DELETE" });
|
|
23
37
|
}
|
|
@@ -1290,9 +1304,6 @@ var SpaceFilesApi = class {
|
|
|
1290
1304
|
var SessionMessagesClient = class {
|
|
1291
1305
|
transport;
|
|
1292
1306
|
sessionId;
|
|
1293
|
-
lastSentSignature = "";
|
|
1294
|
-
lastSentSessionId = "";
|
|
1295
|
-
lastSentAt = 0;
|
|
1296
1307
|
constructor(transport, sessionId) {
|
|
1297
1308
|
this.transport = transport;
|
|
1298
1309
|
this.sessionId = sessionId;
|
|
@@ -2081,6 +2092,19 @@ var UserApi = class {
|
|
|
2081
2092
|
fetch: customFetch
|
|
2082
2093
|
});
|
|
2083
2094
|
}
|
|
2095
|
+
listSessions(optionsOrFetch, customFetch) {
|
|
2096
|
+
const options = typeof optionsOrFetch === "function" ? void 0 : optionsOrFetch;
|
|
2097
|
+
const fetch = typeof optionsOrFetch === "function" ? optionsOrFetch : customFetch;
|
|
2098
|
+
const params = new URLSearchParams();
|
|
2099
|
+
if (options?.limit !== void 0) params.set("limit", String(options.limit));
|
|
2100
|
+
if (options?.cursor) params.set("cursor", options.cursor);
|
|
2101
|
+
const query = params.toString();
|
|
2102
|
+
return this.transport.request(`/api/me/sessions${query ? `?${query}` : ""}`, { fetch });
|
|
2103
|
+
}
|
|
2104
|
+
getUsage(days = 30, customFetch) {
|
|
2105
|
+
const params = new URLSearchParams({ days: String(days) });
|
|
2106
|
+
return this.transport.request(`/api/me/usage?${params.toString()}`, { fetch: customFetch });
|
|
2107
|
+
}
|
|
2084
2108
|
async setAuthToken(token) {
|
|
2085
2109
|
const trimmedToken = token.trim();
|
|
2086
2110
|
const response = await fetch(this.transportBaseUrl ? `${this.transportBaseUrl}/api/me` : "/api/me", { headers: { Authorization: `Bearer ${trimmedToken}` } });
|