@antdv-next/x-sdk 0.0.1 → 0.0.2
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/_util/resolveMaybeRef.d.ts +2 -0
- package/dist/_util/resolveMaybeRef.js +7 -0
- package/dist/_util/types.js +0 -0
- package/dist/chat-providers/AbstractChatProvider.d.ts +2 -2
- package/dist/chat-providers/AbstractChatProvider.js +42 -0
- package/dist/chat-providers/DeepSeekChatProvider.d.ts +2 -2
- package/dist/chat-providers/DeepSeekChatProvider.js +59 -0
- package/dist/chat-providers/DefaultChatProvider.d.ts +2 -2
- package/dist/chat-providers/DefaultChatProvider.js +26 -0
- package/dist/chat-providers/OpenAIChatProvider.d.ts +2 -2
- package/dist/chat-providers/OpenAIChatProvider.js +49 -0
- package/dist/chat-providers/index.js +4 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +7 -3
- package/dist/node_modules/vitest/dist/@vitest/expect/index.js +1456 -0
- package/dist/node_modules/vitest/dist/@vitest/pretty-format/index.js +884 -0
- package/dist/node_modules/vitest/dist/@vitest/runner/chunk-artifact.js +1543 -0
- package/dist/node_modules/vitest/dist/@vitest/snapshot/index.js +660 -0
- package/dist/node_modules/vitest/dist/@vitest/spy/index.js +384 -0
- package/dist/node_modules/vitest/dist/@vitest/utils/chunk-pathe.M-eThtNZ.js +80 -0
- package/dist/node_modules/vitest/dist/@vitest/utils/diff.js +1304 -0
- package/dist/node_modules/vitest/dist/@vitest/utils/display.js +556 -0
- package/dist/node_modules/vitest/dist/@vitest/utils/error.js +27 -0
- package/dist/node_modules/vitest/dist/@vitest/utils/helpers.js +179 -0
- package/dist/node_modules/vitest/dist/@vitest/utils/offset.js +25 -0
- package/dist/node_modules/vitest/dist/@vitest/utils/serialize.js +75 -0
- package/dist/node_modules/vitest/dist/@vitest/utils/source-map.js +371 -0
- package/dist/node_modules/vitest/dist/@vitest/utils/timers.js +35 -0
- package/dist/node_modules/vitest/dist/chunks/_commonjsHelpers.D26ty3Ew.js +4 -0
- package/dist/node_modules/vitest/dist/chunks/rpc.MzXet3jl.js +50 -0
- package/dist/node_modules/vitest/dist/chunks/test.CBQUpOM3.js +2640 -0
- package/dist/node_modules/vitest/dist/chunks/utils.BX5Fg8C4.js +42 -0
- package/dist/node_modules/vitest/dist/vendor/chai.js +2872 -0
- package/dist/node_modules/vitest/dist/vendor/magic-string.js +1009 -0
- package/dist/node_modules/vitest/dist/vendor/tinyrainbow.js +84 -0
- package/dist/x-chat/__tests__/index.test.d.ts +1 -0
- package/dist/x-chat/__tests__/index.test.js +257 -0
- package/dist/x-chat/index.d.ts +14 -23
- package/dist/x-chat/index.js +83 -66
- package/dist/x-chat/store.d.ts +2 -0
- package/dist/{store-C1diHqNH.js → x-chat/store.js} +15 -9
- package/dist/x-conversations/__tests__/index.test.d.ts +1 -0
- package/dist/x-conversations/__tests__/index.test.js +36 -0
- package/dist/x-conversations/index.d.ts +4 -4
- package/dist/x-conversations/index.js +37 -1
- package/dist/{x-conversations-BrKWhj5r.js → x-conversations/store.js} +2 -31
- package/dist/x-request/__tests__/index.test.d.ts +1 -0
- package/dist/x-request/__tests__/index.test.js +90 -0
- package/dist/x-request/index.d.ts +36 -11
- package/dist/x-request/index.js +246 -1
- package/dist/x-request/x-fetch.js +18 -0
- package/package.json +1 -1
- package/dist/chat-providers-5x9Va7p5.js +0 -167
- package/dist/x-request-BSFGaKND.js +0 -234
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { getSafeTimers } from "../@vitest/utils/timers.js";
|
|
2
|
+
//#region ../../node_modules/vitest/dist/chunks/utils.BX5Fg8C4.js
|
|
3
|
+
var NAME_WORKER_STATE = "__vitest_worker__";
|
|
4
|
+
function getWorkerState() {
|
|
5
|
+
const workerState = globalThis[NAME_WORKER_STATE];
|
|
6
|
+
if (!workerState) throw new Error("Vitest failed to access its internal state.\n\nOne of the following is possible:\n- \"vitest\" is imported directly without running \"vitest\" command\n- \"vitest\" is imported inside \"globalSetup\" (to fix this, use \"setupFiles\" instead, because \"globalSetup\" runs in a different context)\n- \"vitest\" is imported inside Vite / Vitest config file\n- Otherwise, it might be a Vitest bug. Please report it to https://github.com/vitest-dev/vitest/issues\n");
|
|
7
|
+
return workerState;
|
|
8
|
+
}
|
|
9
|
+
function isChildProcess() {
|
|
10
|
+
return typeof process !== "undefined" && !!process.send;
|
|
11
|
+
}
|
|
12
|
+
function resetModules(modules, resetMocks = false) {
|
|
13
|
+
const skipPaths = [
|
|
14
|
+
/\/vitest\/dist\//,
|
|
15
|
+
/vitest-virtual-\w+\/dist/,
|
|
16
|
+
/@vitest\/dist/,
|
|
17
|
+
...!resetMocks ? [/^mock:/] : []
|
|
18
|
+
];
|
|
19
|
+
modules.idToModuleMap.forEach((node, path) => {
|
|
20
|
+
if (skipPaths.some((re) => re.test(path))) return;
|
|
21
|
+
node.promise = void 0;
|
|
22
|
+
node.exports = void 0;
|
|
23
|
+
node.evaluated = false;
|
|
24
|
+
node.importers.clear();
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
function waitNextTick() {
|
|
28
|
+
const { setTimeout } = getSafeTimers();
|
|
29
|
+
return new Promise((resolve) => setTimeout(resolve, 0));
|
|
30
|
+
}
|
|
31
|
+
async function waitForImportsToResolve() {
|
|
32
|
+
await waitNextTick();
|
|
33
|
+
const state = getWorkerState();
|
|
34
|
+
const promises = [];
|
|
35
|
+
const resolvingCount = state.resolvingModules.size;
|
|
36
|
+
for (const [_, mod] of state.evaluatedModules.idToModuleMap) if (mod.promise && !mod.evaluated) promises.push(mod.promise);
|
|
37
|
+
if (!promises.length && !resolvingCount) return;
|
|
38
|
+
await Promise.allSettled(promises);
|
|
39
|
+
await waitForImportsToResolve();
|
|
40
|
+
}
|
|
41
|
+
//#endregion
|
|
42
|
+
export { getWorkerState, isChildProcess, resetModules, waitForImportsToResolve };
|