@eaera-com/cms-sdk 0.1.96 → 0.1.97
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/{chats-MP1lNjoi.js → chats-GtH9e-Rb.js} +6 -6
- package/dist/chunks/{client-b4RCF-QC.js → client-D105hJn8.js} +2 -6
- package/dist/chunks/{connection-TeTU-oSc.js → connection-Cqw-wnLx.js} +3 -3
- package/dist/index.js +2 -2
- package/dist/server/ai/qwenpaw/chat/stop.post.js +2 -2
- package/dist/server/ai/qwenpaw/chat.post.js +2 -2
- package/dist/server/ai/qwenpaw/chats-id.delete.js +2 -2
- package/dist/server/ai/qwenpaw/chats.get.js +2 -2
- package/dist/server/ai/qwenpaw/history.get.js +2 -2
- package/dist/server/ai/qwenpaw/session.get.js +1 -1
- package/dist/server/ai/qwenpaw/session.post.js +1 -1
- package/dist/server/ai/qwenpaw/upload.post.js +2 -2
- package/dist/services/qwenpaw/chats.d.ts.map +1 -1
- package/dist/services/qwenpaw/client.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -2,9 +2,9 @@ import { createError } from 'h3';
|
|
|
2
2
|
import { ofetch } from 'ofetch';
|
|
3
3
|
import { d as QWENPAW_LIST_TIMEOUT_MS, e as QWENPAW_DEFAULT_AGENT_ID, f as QWENPAW_MAX_HISTORY_TURNS } from './qwenpaw.constant-D9dcuRIS.js';
|
|
4
4
|
|
|
5
|
-
const chatsHeaders = (
|
|
5
|
+
const chatsHeaders = (extra = {}) => ({
|
|
6
6
|
accept: "application/json",
|
|
7
|
-
"x-agent-id":
|
|
7
|
+
"x-agent-id": QWENPAW_DEFAULT_AGENT_ID,
|
|
8
8
|
...extra
|
|
9
9
|
});
|
|
10
10
|
const chatsUrl = (baseUrl, path) => `${baseUrl.replace(/\/+$/, "")}${path}`;
|
|
@@ -20,7 +20,7 @@ const listQwenpawChats = async (connection) => {
|
|
|
20
20
|
try {
|
|
21
21
|
const res = await ofetch(chatsUrl(connection.baseUrl, "/api/chats"), {
|
|
22
22
|
params: { archived: false, include_app_owned: false },
|
|
23
|
-
headers: chatsHeaders(
|
|
23
|
+
headers: chatsHeaders(),
|
|
24
24
|
timeout: QWENPAW_LIST_TIMEOUT_MS
|
|
25
25
|
});
|
|
26
26
|
return Array.isArray(res) ? res : [];
|
|
@@ -34,7 +34,7 @@ const listQwenpawGroups = async (connection) => {
|
|
|
34
34
|
if (!connection.baseUrl) return [];
|
|
35
35
|
try {
|
|
36
36
|
const res = await ofetch(chatsUrl(connection.baseUrl, "/api/chats/groups"), {
|
|
37
|
-
headers: chatsHeaders(
|
|
37
|
+
headers: chatsHeaders(),
|
|
38
38
|
timeout: QWENPAW_LIST_TIMEOUT_MS
|
|
39
39
|
});
|
|
40
40
|
return Array.isArray(res) ? res : [];
|
|
@@ -49,7 +49,7 @@ const deleteQwenpawChat = async (connection, chatId) => {
|
|
|
49
49
|
try {
|
|
50
50
|
await ofetch(chatsUrl(connection.baseUrl, `/api/chats/${encodeURIComponent(chatId)}`), {
|
|
51
51
|
method: "DELETE",
|
|
52
|
-
headers: chatsHeaders(
|
|
52
|
+
headers: chatsHeaders(),
|
|
53
53
|
timeout: QWENPAW_LIST_TIMEOUT_MS
|
|
54
54
|
});
|
|
55
55
|
return true;
|
|
@@ -65,7 +65,7 @@ const getQwenpawChatMessages = async (connection, chatId) => {
|
|
|
65
65
|
chatsUrl(connection.baseUrl, `/api/chats/${encodeURIComponent(chatId)}`),
|
|
66
66
|
{
|
|
67
67
|
params: { include_app_owned: false },
|
|
68
|
-
headers: chatsHeaders(
|
|
68
|
+
headers: chatsHeaders(),
|
|
69
69
|
timeout: QWENPAW_LIST_TIMEOUT_MS
|
|
70
70
|
}
|
|
71
71
|
);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h as QWENPAW_CHANNEL, i as QWENPAW_CHAT_TIMEOUT_MS, j as QWENPAW_STOP_TIMEOUT_MS, k as QWENPAW_UPLOAD_TIMEOUT_MS } from './qwenpaw.constant-D9dcuRIS.js';
|
|
1
|
+
import { h as QWENPAW_CHANNEL, e as QWENPAW_DEFAULT_AGENT_ID, i as QWENPAW_CHAT_TIMEOUT_MS, j as QWENPAW_STOP_TIMEOUT_MS, k as QWENPAW_UPLOAD_TIMEOUT_MS } from './qwenpaw.constant-D9dcuRIS.js';
|
|
2
2
|
import { createError } from 'h3';
|
|
3
3
|
|
|
4
4
|
const buildConsoleChatBody = (target, text, files = []) => ({
|
|
@@ -48,11 +48,7 @@ const resolveTargetBase = (config, target) => {
|
|
|
48
48
|
if (!baseUrl) {
|
|
49
49
|
throw new QwenpawConfigError("QwenPaw URL is not configured (no per-user or server default).");
|
|
50
50
|
}
|
|
51
|
-
|
|
52
|
-
if (!agentId) {
|
|
53
|
-
throw new QwenpawConfigError("No QwenPaw agent id configured for this workspace.");
|
|
54
|
-
}
|
|
55
|
-
return { baseUrl, agentId };
|
|
51
|
+
return { baseUrl, agentId: QWENPAW_DEFAULT_AGENT_ID };
|
|
56
52
|
};
|
|
57
53
|
const linkAbort = (signal, timeoutMs) => {
|
|
58
54
|
const controller = new AbortController();
|
|
@@ -2,7 +2,7 @@ import { getCookie, createError, setCookie } from 'h3';
|
|
|
2
2
|
import { ofetch } from 'ofetch';
|
|
3
3
|
import { useRuntimeConfig } from '#imports';
|
|
4
4
|
import { T as TOKEN_STORAGE_KEY } from './storage.constant-CVWam5ls.js';
|
|
5
|
-
import { l as QWENPAW_RUNTIME_CONFIG_KEY, m as QWENPAW_EXCHANGE_ACTION_PATH, n as QWENPAW_EXCHANGE_TIMEOUT_MS, o as QWENPAW_CONFIGURATION_ERROR_CODES, p as QWENPAW_COOKIE_BASE_URL, q as QWENPAW_COOKIE_MAX_AGE, r as QWENPAW_COOKIE_AGENT_ID } from './qwenpaw.constant-D9dcuRIS.js';
|
|
5
|
+
import { l as QWENPAW_RUNTIME_CONFIG_KEY, m as QWENPAW_EXCHANGE_ACTION_PATH, n as QWENPAW_EXCHANGE_TIMEOUT_MS, o as QWENPAW_CONFIGURATION_ERROR_CODES, e as QWENPAW_DEFAULT_AGENT_ID, p as QWENPAW_COOKIE_BASE_URL, q as QWENPAW_COOKIE_MAX_AGE, r as QWENPAW_COOKIE_AGENT_ID } from './qwenpaw.constant-D9dcuRIS.js';
|
|
6
6
|
|
|
7
7
|
class QwenpawExchangeError extends Error {
|
|
8
8
|
constructor(code, configurationError, message) {
|
|
@@ -39,7 +39,7 @@ const resolveQwenpawConnection = (event, overrides = {}) => {
|
|
|
39
39
|
const config = resolveQwenpawServerConfig(event);
|
|
40
40
|
return {
|
|
41
41
|
baseUrl: overrides.baseUrl || readCookieValue(event, QWENPAW_COOKIE_BASE_URL) || config.baseUrl,
|
|
42
|
-
agentId: overrides.agentId ||
|
|
42
|
+
agentId: overrides.agentId || config.agentId
|
|
43
43
|
};
|
|
44
44
|
};
|
|
45
45
|
const hasQwenpawConnection = (event) => Boolean(resolveQwenpawConnection(event).baseUrl);
|
|
@@ -103,7 +103,7 @@ const exchangeQwenpawSession = async (event) => {
|
|
|
103
103
|
}
|
|
104
104
|
const connection = {
|
|
105
105
|
baseUrl: result.agent.baseUrl ?? result.agent.base_url ?? "",
|
|
106
|
-
agentId:
|
|
106
|
+
agentId: QWENPAW_DEFAULT_AGENT_ID
|
|
107
107
|
};
|
|
108
108
|
setQwenpawSessionCookies(event, connection);
|
|
109
109
|
return connection;
|
package/dist/index.js
CHANGED
|
@@ -9,8 +9,8 @@ import { ref, shallowRef, watch, computed, toRaw } from 'vue';
|
|
|
9
9
|
import { W as WS_RECONNECT_INITIAL_MS, a as WS_RECONNECT_MAX_MS, b as WS_CONNECTION_STATE, c as WS_PING_INTERVAL_MS, d as WS_MESSAGE_TYPE, e as WS_CLOSE_CODE, f as WS_MAX_RECONNECT_ATTEMPTS, g as WS_AUTH_TIMEOUT_MS, h as WS_RECONNECT_JITTER_MS, i as WS_PING_WATCHDOG_CHECK_MS, j as WS_MAX_SUBSCRIPTIONS, k as WS_PING_WATCHDOG_FACTOR } from './chunks/mt5Retcode-DK9C-4Dv.js';
|
|
10
10
|
export { M as MT5_RETCODE, l as WS_ACTION_ACCEPTED_ERROR_CODE, m as WS_ACTION_ERROR_CODE, n as WS_ACTION_RESULT_ERROR_CODE, o as WS_ACTION_RESULT_TTL_MS, p as WS_AUTH_ERROR_CODE, q as WS_CLOSE_REASON, r as WS_MT5_EVENT_TYPE, s as WS_TOPIC, t as WS_TOPIC_NAMESPACE, u as accountTopic, v as adminTopic, w as mt5Topic, x as streamTopic, y as symbolTopic, z as userTopic, A as viewMt5Retcode } from './chunks/mt5Retcode-DK9C-4Dv.js';
|
|
11
11
|
import { defineStore, storeToRefs } from 'pinia';
|
|
12
|
-
export { Q as QwenpawConfigError, a as QwenpawUpstreamError, b as buildConsoleChatBody, p as postConsoleChatError } from './chunks/client-
|
|
13
|
-
export { d as deleteQwenpawChat, e as extractChatModel, f as fetchChatHistory, g as getQwenpawChatMessages, l as listQwenpawChats, a as listQwenpawGroups, m as messagesToTurns } from './chunks/chats-
|
|
12
|
+
export { Q as QwenpawConfigError, a as QwenpawUpstreamError, b as buildConsoleChatBody, p as postConsoleChatError } from './chunks/client-D105hJn8.js';
|
|
13
|
+
export { d as deleteQwenpawChat, e as extractChatModel, f as fetchChatHistory, g as getQwenpawChatMessages, l as listQwenpawChats, a as listQwenpawGroups, m as messagesToTurns } from './chunks/chats-GtH9e-Rb.js';
|
|
14
14
|
export { categoryLabel, computeSpread, formatPrice } from './common/helpers/format.js';
|
|
15
15
|
|
|
16
16
|
const MT5_SERVER_NAME = "EAERA MT5 - Live";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineEventHandler, readBody, createError } from 'h3';
|
|
2
|
-
import { c as qwenpawStop, p as postConsoleChatError } from '../../../../chunks/client-
|
|
2
|
+
import { c as qwenpawStop, p as postConsoleChatError } from '../../../../chunks/client-D105hJn8.js';
|
|
3
3
|
import { c as QWENPAW_MAX_SESSION_ID_LENGTH } from '../../../../chunks/qwenpaw.constant-D9dcuRIS.js';
|
|
4
|
-
import { r as requireCmsSession, a as resolveQwenpawConnection, b as resolveQwenpawServerConfig } from '../../../../chunks/connection-
|
|
4
|
+
import { r as requireCmsSession, a as resolveQwenpawConnection, b as resolveQwenpawServerConfig } from '../../../../chunks/connection-Cqw-wnLx.js';
|
|
5
5
|
|
|
6
6
|
const stop_post = defineEventHandler(async (event) => {
|
|
7
7
|
requireCmsSession(event);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Readable } from 'node:stream';
|
|
2
2
|
import { defineEventHandler, readBody, createError, setResponseStatus, setResponseHeader, sendStream } from 'h3';
|
|
3
|
-
import { q as qwenpawChat, p as postConsoleChatError } from '../../../chunks/client-
|
|
3
|
+
import { q as qwenpawChat, p as postConsoleChatError } from '../../../chunks/client-D105hJn8.js';
|
|
4
4
|
import { Q as QWENPAW_MAX_MESSAGE_LENGTH, a as QWENPAW_MAX_FILES, b as QWENPAW_MAX_FILE_NAME_LENGTH, c as QWENPAW_MAX_SESSION_ID_LENGTH } from '../../../chunks/qwenpaw.constant-D9dcuRIS.js';
|
|
5
|
-
import { r as requireCmsSession, a as resolveQwenpawConnection, b as resolveQwenpawServerConfig } from '../../../chunks/connection-
|
|
5
|
+
import { r as requireCmsSession, a as resolveQwenpawConnection, b as resolveQwenpawServerConfig } from '../../../chunks/connection-Cqw-wnLx.js';
|
|
6
6
|
|
|
7
7
|
const chat_post = defineEventHandler(async (event) => {
|
|
8
8
|
requireCmsSession(event);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineEventHandler, getRouterParam, createError } from 'h3';
|
|
2
|
-
import { d as deleteQwenpawChat } from '../../../chunks/chats-
|
|
3
|
-
import { r as requireCmsSession, a as resolveQwenpawConnection } from '../../../chunks/connection-
|
|
2
|
+
import { d as deleteQwenpawChat } from '../../../chunks/chats-GtH9e-Rb.js';
|
|
3
|
+
import { r as requireCmsSession, a as resolveQwenpawConnection } from '../../../chunks/connection-Cqw-wnLx.js';
|
|
4
4
|
|
|
5
5
|
const chatsId_delete = defineEventHandler(async (event) => {
|
|
6
6
|
requireCmsSession(event);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineEventHandler } from 'h3';
|
|
2
|
-
import { l as listQwenpawChats, a as listQwenpawGroups } from '../../../chunks/chats-
|
|
3
|
-
import { r as requireCmsSession, a as resolveQwenpawConnection, b as resolveQwenpawServerConfig } from '../../../chunks/connection-
|
|
2
|
+
import { l as listQwenpawChats, a as listQwenpawGroups } from '../../../chunks/chats-GtH9e-Rb.js';
|
|
3
|
+
import { r as requireCmsSession, a as resolveQwenpawConnection, b as resolveQwenpawServerConfig } from '../../../chunks/connection-Cqw-wnLx.js';
|
|
4
4
|
|
|
5
5
|
const chats_get = defineEventHandler(async (event) => {
|
|
6
6
|
requireCmsSession(event);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineEventHandler, getQuery, createError } from 'h3';
|
|
2
|
-
import { f as fetchChatHistory } from '../../../chunks/chats-
|
|
3
|
-
import { r as requireCmsSession, a as resolveQwenpawConnection } from '../../../chunks/connection-
|
|
2
|
+
import { f as fetchChatHistory } from '../../../chunks/chats-GtH9e-Rb.js';
|
|
3
|
+
import { r as requireCmsSession, a as resolveQwenpawConnection } from '../../../chunks/connection-Cqw-wnLx.js';
|
|
4
4
|
|
|
5
5
|
const history_get = defineEventHandler(async (event) => {
|
|
6
6
|
requireCmsSession(event);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineEventHandler } from 'h3';
|
|
2
|
-
import { r as requireCmsSession, a as resolveQwenpawConnection, h as hasQwenpawConnection } from '../../../chunks/connection-
|
|
2
|
+
import { r as requireCmsSession, a as resolveQwenpawConnection, h as hasQwenpawConnection } from '../../../chunks/connection-Cqw-wnLx.js';
|
|
3
3
|
|
|
4
4
|
const session_get = defineEventHandler((event) => {
|
|
5
5
|
requireCmsSession(event);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineEventHandler, createError } from 'h3';
|
|
2
|
-
import { r as requireCmsSession, e as exchangeQwenpawSession, Q as QwenpawExchangeError } from '../../../chunks/connection-
|
|
2
|
+
import { r as requireCmsSession, e as exchangeQwenpawSession, Q as QwenpawExchangeError } from '../../../chunks/connection-Cqw-wnLx.js';
|
|
3
3
|
|
|
4
4
|
const exchangeErrorStatus = (error) => {
|
|
5
5
|
if (error.code === "AI_NOT_AUTHENTICATED") return 401;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineEventHandler, readMultipartFormData, createError } from 'h3';
|
|
2
|
-
import { d as qwenpawUpload, p as postConsoleChatError } from '../../../chunks/client-
|
|
2
|
+
import { d as qwenpawUpload, p as postConsoleChatError } from '../../../chunks/client-D105hJn8.js';
|
|
3
3
|
import { g as QWENPAW_MAX_UPLOAD_BYTES } from '../../../chunks/qwenpaw.constant-D9dcuRIS.js';
|
|
4
|
-
import { r as requireCmsSession, a as resolveQwenpawConnection, b as resolveQwenpawServerConfig } from '../../../chunks/connection-
|
|
4
|
+
import { r as requireCmsSession, a as resolveQwenpawConnection, b as resolveQwenpawServerConfig } from '../../../chunks/connection-Cqw-wnLx.js';
|
|
5
5
|
|
|
6
6
|
const upload_post = defineEventHandler(async (event) => {
|
|
7
7
|
requireCmsSession(event);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chats.d.ts","sourceRoot":"","sources":["../../../src/services/qwenpaw/chats.ts"],"names":[],"mappings":"AAgBA,OAAO,EACL,wBAAwB,EAGzB,MAAM,yCAAyC,CAAC;AACjD,OAAO,KAAK,EACV,WAAW,EACX,mBAAmB,EACnB,mBAAmB,EACnB,aAAa,EACb,0BAA0B,EAC3B,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,wBAAwB,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"chats.d.ts","sourceRoot":"","sources":["../../../src/services/qwenpaw/chats.ts"],"names":[],"mappings":"AAgBA,OAAO,EACL,wBAAwB,EAGzB,MAAM,yCAAyC,CAAC;AACjD,OAAO,KAAK,EACV,WAAW,EACX,mBAAmB,EACnB,mBAAmB,EACnB,aAAa,EACb,0BAA0B,EAC3B,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,wBAAwB,EAAE,CAAC;AAwBpC,uDAAuD;AACvD,eAAO,MAAM,gBAAgB,GAC3B,YAAY,0BAA0B,KACrC,OAAO,CAAC,mBAAmB,EAAE,CAc/B,CAAC;AAEF,+DAA+D;AAC/D,eAAO,MAAM,iBAAiB,GAC5B,YAAY,0BAA0B,KACrC,OAAO,CAAC,aAAa,EAAE,CAazB,CAAC;AAEF,0DAA0D;AAC1D,eAAO,MAAM,iBAAiB,GAC5B,YAAY,0BAA0B,EACtC,QAAQ,MAAM,KACb,OAAO,CAAC,OAAO,CAajB,CAAC;AAEF,8DAA8D;AAC9D,eAAO,MAAM,sBAAsB,GACjC,YAAY,0BAA0B,EACtC,QAAQ,MAAM,KACb,OAAO,CAAC,mBAAmB,EAAE,CAiB/B,CAAC;AAEF;;;;8CAI8C;AAC9C,eAAO,MAAM,eAAe,GAAI,UAAU,mBAAmB,EAAE,KAAG,WAAW,EAqB5E,CAAC;AAEF,wEAAwE;AACxE,eAAO,MAAM,gBAAgB,GAAI,UAAU,mBAAmB,EAAE,KAAG,MAMlE,CAAC;AAEF,yEAAyE;AACzE,eAAO,MAAM,gBAAgB,GAC3B,YAAY,0BAA0B,EACtC,QAAQ,MAAM,KACb,OAAO,CAAC;IAAE,KAAK,EAAE,WAAW,EAAE,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAGjD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/services/qwenpaw/client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/services/qwenpaw/client.ts"],"names":[],"mappings":"AAeA,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EAEzB,KAAK,oBAAoB,EAC1B,MAAM,gBAAgB,CAAC;AAExB,qBAAa,kBAAmB,SAAQ,KAAK;CAAG;AAChD,qBAAa,oBAAqB,SAAQ,KAAK;IAE3C,QAAQ,CAAC,MAAM,EAAE,MAAM;gBAAd,MAAM,EAAE,MAAM,EACvB,OAAO,EAAE,MAAM;CAIlB;AA4BD,sEAAsE;AACtE,eAAO,MAAM,oBAAoB,GAAI,OAAO,OAAO,KAAG,KAarD,CAAC;AAEF;kEACkE;AAClE,eAAO,MAAM,WAAW,GAAU,SAAS,mBAAmB,KAAG,OAAO,CAAC,QAAQ,CA+ChF,CAAC;AAEF;;iDAEiD;AACjD,eAAO,MAAM,aAAa,GAAU,SAAS;IAC3C,MAAM,EAAE,oBAAoB,CAAC;IAC7B,MAAM,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAC7C,uEAAuE;IACvE,IAAI,EAAE,QAAQ,CAAC;IACf,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,KAAG,OAAO,CAAC,oBAAoB,CA6C/B,CAAC;AAEF;;qEAEqE;AACrE,eAAO,MAAM,WAAW,GAAU,SAAS;IACzC,MAAM,EAAE,oBAAoB,CAAC;IAC7B,MAAM,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAC7C,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,KAAG,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CA6B/B,CAAC"}
|