@inkeep/agents-core 0.65.1 → 0.66.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/_virtual/rolldown_runtime.js +25 -1
- package/dist/auth/permissions.d.ts +9 -9
- package/dist/constants/index.d.ts +14 -0
- package/dist/constants/index.js +15 -0
- package/dist/constants/relation-types.d.ts +5 -0
- package/dist/constants/relation-types.js +6 -0
- package/dist/constants/session-events.d.ts +13 -0
- package/dist/constants/session-events.js +14 -0
- package/dist/constants/tool-names.d.ts +7 -0
- package/dist/constants/tool-names.js +8 -0
- package/dist/constants/workflow.d.ts +7 -0
- package/dist/constants/workflow.js +8 -0
- package/dist/data-access/index.d.ts +3 -3
- package/dist/data-access/manage/agentFull.d.ts +7 -10
- package/dist/data-access/manage/agentFull.js +26 -28
- package/dist/data-access/manage/agents.d.ts +47 -47
- package/dist/data-access/manage/artifactComponents.d.ts +10 -10
- package/dist/data-access/manage/contextConfigs.d.ts +12 -12
- package/dist/data-access/manage/dataComponents.d.ts +4 -4
- package/dist/data-access/manage/dataComponents.js +1 -1
- package/dist/data-access/manage/functionTools.d.ts +16 -16
- package/dist/data-access/manage/projectFull.d.ts +6 -8
- package/dist/data-access/manage/projectFull.js +18 -18
- package/dist/data-access/manage/skills.d.ts +12 -12
- package/dist/data-access/manage/subAgentExternalAgentRelations.d.ts +24 -24
- package/dist/data-access/manage/subAgentRelations.d.ts +20 -20
- package/dist/data-access/manage/subAgentTeamAgentRelations.d.ts +18 -18
- package/dist/data-access/manage/subAgents.d.ts +21 -21
- package/dist/data-access/manage/tools.d.ts +24 -24
- package/dist/data-access/manage/triggers.d.ts +4 -4
- package/dist/data-access/runtime/apiKeys.d.ts +16 -16
- package/dist/data-access/runtime/apps.d.ts +10 -10
- package/dist/data-access/runtime/conversations.d.ts +24 -24
- package/dist/data-access/runtime/feedback.d.ts +4 -4
- package/dist/data-access/runtime/messages.d.ts +12 -12
- package/dist/data-access/runtime/scheduledTriggerInvocations.d.ts +4 -4
- package/dist/data-access/runtime/scheduledTriggerUsers.d.ts +1 -1
- package/dist/data-access/runtime/tasks.d.ts +5 -5
- package/dist/db/manage/dolt-safe-jsonb.d.ts +2 -2
- package/dist/db/manage/manage-client.js +15 -3
- package/dist/db/manage/manage-schema.d.ts +358 -358
- package/dist/db/runtime/runtime-client.js +7 -1
- package/dist/db/runtime/runtime-schema.d.ts +373 -373
- package/dist/dolt/merge.js +7 -9
- package/dist/dolt/ref-middleware.js +2 -2
- package/dist/dolt/ref-scope.js +9 -3
- package/dist/index.d.ts +9 -5
- package/dist/index.js +7 -3
- package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.js +77 -0
- package/dist/node_modules/.pnpm/@vitest_expect@3.2.4/node_modules/@vitest/expect/dist/index.js +1356 -0
- package/dist/node_modules/.pnpm/@vitest_pretty-format@3.2.4/node_modules/@vitest/pretty-format/dist/index.js +1119 -0
- package/dist/node_modules/.pnpm/@vitest_runner@3.2.4/node_modules/@vitest/runner/dist/chunk-hooks.js +982 -0
- package/dist/node_modules/.pnpm/@vitest_runner@3.2.4/node_modules/@vitest/runner/dist/index.js +4 -0
- package/dist/node_modules/.pnpm/@vitest_runner@3.2.4/node_modules/@vitest/runner/dist/utils.js +3 -0
- package/dist/node_modules/.pnpm/@vitest_snapshot@3.2.4/node_modules/@vitest/snapshot/dist/index.js +1821 -0
- package/dist/node_modules/.pnpm/@vitest_spy@3.2.4/node_modules/@vitest/spy/dist/index.js +171 -0
- package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.js +124 -0
- package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/diff.js +1334 -0
- package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/error.js +105 -0
- package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/helpers.js +118 -0
- package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/index.js +455 -0
- package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/source-map.js +168 -0
- package/dist/node_modules/.pnpm/chai@5.3.3/node_modules/chai/index.js +3087 -0
- package/dist/node_modules/.pnpm/js-tokens@9.0.1/node_modules/js-tokens/index.js +384 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/arguments.js +11 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/array.js +16 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/bigint.js +11 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/class.js +15 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/date.js +13 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/error.js +34 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/function.js +12 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/helpers.js +122 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/html.js +39 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/index.js +99 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/map.js +25 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/number.js +14 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/object.js +21 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/promise.js +6 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/regexp.js +12 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/set.js +18 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/string.js +25 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/symbol.js +8 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/typedarray.js +30 -0
- package/dist/node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.js +939 -0
- package/dist/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.js +81 -0
- package/dist/node_modules/.pnpm/strip-literal@3.1.0/node_modules/strip-literal/dist/index.js +51 -0
- package/dist/node_modules/.pnpm/tinyrainbow@2.0.0/node_modules/tinyrainbow/dist/chunk-BVHSVHOK.js +81 -0
- package/dist/node_modules/.pnpm/tinyrainbow@2.0.0/node_modules/tinyrainbow/dist/node.js +9 -0
- package/dist/node_modules/.pnpm/tinyspy@4.0.4/node_modules/tinyspy/dist/index.js +125 -0
- package/dist/node_modules/.pnpm/vitest@3.2.4_@edge-runtime_vm@3.2.0_@types_debug@4.1.12_@types_node@20.19.27_jiti@2.6.1_93023d256ff9ed909ae8f0d436c922a0/node_modules/vitest/dist/chunks/_commonjsHelpers.BFTU3MAI.js +8 -0
- package/dist/node_modules/.pnpm/vitest@3.2.4_@edge-runtime_vm@3.2.0_@types_debug@4.1.12_@types_node@20.19.27_jiti@2.6.1_93023d256ff9ed909ae8f0d436c922a0/node_modules/vitest/dist/chunks/date.Bq6ZW5rf.js +50 -0
- package/dist/node_modules/.pnpm/vitest@3.2.4_@edge-runtime_vm@3.2.0_@types_debug@4.1.12_@types_node@20.19.27_jiti@2.6.1_93023d256ff9ed909ae8f0d436c922a0/node_modules/vitest/dist/chunks/utils.XdZDrNZV.js +48 -0
- package/dist/node_modules/.pnpm/vitest@3.2.4_@edge-runtime_vm@3.2.0_@types_debug@4.1.12_@types_node@20.19.27_jiti@2.6.1_93023d256ff9ed909ae8f0d436c922a0/node_modules/vitest/dist/chunks/vi.bdSIJ99Y.js +2613 -0
- package/dist/test-utils/index.d.ts +2 -0
- package/dist/test-utils/index.js +3 -0
- package/dist/test-utils/mocks/index.d.ts +2 -0
- package/dist/test-utils/mocks/index.js +3 -0
- package/dist/test-utils/mocks/logger.d.ts +27 -0
- package/dist/test-utils/mocks/logger.js +48 -0
- package/dist/utils/error.d.ts +58 -52
- package/dist/utils/error.js +63 -21
- package/dist/utils/index.d.ts +3 -3
- package/dist/utils/index.js +3 -3
- package/dist/utils/jwt-helpers.js +1 -1
- package/dist/utils/logger.d.ts +21 -2
- package/dist/utils/logger.js +67 -11
- package/dist/utils/third-party-mcp-servers/composio-client.js +10 -10
- package/dist/utils/tracer-factory.js +1 -1
- package/dist/validation/schemas/skills.d.ts +45 -45
- package/dist/validation/schemas.d.ts +2289 -2289
- package/drizzle/runtime/meta/_journal.json +2 -2
- package/package.json +5 -1
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs
|
|
2
|
+
const _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
|
|
3
|
+
function normalizeWindowsPath(input = "") {
|
|
4
|
+
if (!input) return input;
|
|
5
|
+
return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
|
|
6
|
+
}
|
|
7
|
+
const _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
|
|
8
|
+
function cwd() {
|
|
9
|
+
if (typeof process !== "undefined" && typeof process.cwd === "function") return process.cwd().replace(/\\/g, "/");
|
|
10
|
+
return "/";
|
|
11
|
+
}
|
|
12
|
+
const resolve = function(...arguments_) {
|
|
13
|
+
arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));
|
|
14
|
+
let resolvedPath = "";
|
|
15
|
+
let resolvedAbsolute = false;
|
|
16
|
+
for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
|
|
17
|
+
const path = index >= 0 ? arguments_[index] : cwd();
|
|
18
|
+
if (!path || path.length === 0) continue;
|
|
19
|
+
resolvedPath = `${path}/${resolvedPath}`;
|
|
20
|
+
resolvedAbsolute = isAbsolute(path);
|
|
21
|
+
}
|
|
22
|
+
resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute);
|
|
23
|
+
if (resolvedAbsolute && !isAbsolute(resolvedPath)) return `/${resolvedPath}`;
|
|
24
|
+
return resolvedPath.length > 0 ? resolvedPath : ".";
|
|
25
|
+
};
|
|
26
|
+
function normalizeString(path, allowAboveRoot) {
|
|
27
|
+
let res = "";
|
|
28
|
+
let lastSegmentLength = 0;
|
|
29
|
+
let lastSlash = -1;
|
|
30
|
+
let dots = 0;
|
|
31
|
+
let char = null;
|
|
32
|
+
for (let index = 0; index <= path.length; ++index) {
|
|
33
|
+
if (index < path.length) char = path[index];
|
|
34
|
+
else if (char === "/") break;
|
|
35
|
+
else char = "/";
|
|
36
|
+
if (char === "/") {
|
|
37
|
+
if (lastSlash === index - 1 || dots === 1);
|
|
38
|
+
else if (dots === 2) {
|
|
39
|
+
if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
|
|
40
|
+
if (res.length > 2) {
|
|
41
|
+
const lastSlashIndex = res.lastIndexOf("/");
|
|
42
|
+
if (lastSlashIndex === -1) {
|
|
43
|
+
res = "";
|
|
44
|
+
lastSegmentLength = 0;
|
|
45
|
+
} else {
|
|
46
|
+
res = res.slice(0, lastSlashIndex);
|
|
47
|
+
lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
|
|
48
|
+
}
|
|
49
|
+
lastSlash = index;
|
|
50
|
+
dots = 0;
|
|
51
|
+
continue;
|
|
52
|
+
} else if (res.length > 0) {
|
|
53
|
+
res = "";
|
|
54
|
+
lastSegmentLength = 0;
|
|
55
|
+
lastSlash = index;
|
|
56
|
+
dots = 0;
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
if (allowAboveRoot) {
|
|
61
|
+
res += res.length > 0 ? "/.." : "..";
|
|
62
|
+
lastSegmentLength = 2;
|
|
63
|
+
}
|
|
64
|
+
} else {
|
|
65
|
+
if (res.length > 0) res += `/${path.slice(lastSlash + 1, index)}`;
|
|
66
|
+
else res = path.slice(lastSlash + 1, index);
|
|
67
|
+
lastSegmentLength = index - lastSlash - 1;
|
|
68
|
+
}
|
|
69
|
+
lastSlash = index;
|
|
70
|
+
dots = 0;
|
|
71
|
+
} else if (char === "." && dots !== -1) ++dots;
|
|
72
|
+
else dots = -1;
|
|
73
|
+
}
|
|
74
|
+
return res;
|
|
75
|
+
}
|
|
76
|
+
const isAbsolute = function(p) {
|
|
77
|
+
return _IS_ABSOLUTE_RE.test(p);
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
//#endregion
|
|
81
|
+
export { resolve };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { __toESM } from "../../../../../../_virtual/rolldown_runtime.js";
|
|
2
|
+
import { require_js_tokens } from "../../../../js-tokens@9.0.1/node_modules/js-tokens/index.js";
|
|
3
|
+
|
|
4
|
+
//#region ../../node_modules/.pnpm/strip-literal@3.1.0/node_modules/strip-literal/dist/index.mjs
|
|
5
|
+
var import_js_tokens = /* @__PURE__ */ __toESM(require_js_tokens(), 1);
|
|
6
|
+
const FILL_COMMENT = " ";
|
|
7
|
+
function stripLiteralFromToken(token, fillChar, filter) {
|
|
8
|
+
if (token.type === "SingleLineComment") return FILL_COMMENT.repeat(token.value.length);
|
|
9
|
+
if (token.type === "MultiLineComment") return token.value.replace(/[^\n]/g, FILL_COMMENT);
|
|
10
|
+
if (token.type === "StringLiteral") {
|
|
11
|
+
if (!token.closed) return token.value;
|
|
12
|
+
const body = token.value.slice(1, -1);
|
|
13
|
+
if (filter(body)) return token.value[0] + fillChar.repeat(body.length) + token.value[token.value.length - 1];
|
|
14
|
+
}
|
|
15
|
+
if (token.type === "NoSubstitutionTemplate") {
|
|
16
|
+
const body = token.value.slice(1, -1);
|
|
17
|
+
if (filter(body)) return `\`${body.replace(/[^\n]/g, fillChar)}\``;
|
|
18
|
+
}
|
|
19
|
+
if (token.type === "RegularExpressionLiteral") {
|
|
20
|
+
const body = token.value;
|
|
21
|
+
if (filter(body)) return body.replace(/\/(.*)\/(\w?)$/g, (_, $1, $2) => `/${fillChar.repeat($1.length)}/${$2}`);
|
|
22
|
+
}
|
|
23
|
+
if (token.type === "TemplateHead") {
|
|
24
|
+
const body = token.value.slice(1, -2);
|
|
25
|
+
if (filter(body)) return `\`${body.replace(/[^\n]/g, fillChar)}\${`;
|
|
26
|
+
}
|
|
27
|
+
if (token.type === "TemplateTail") {
|
|
28
|
+
const body = token.value.slice(0, -2);
|
|
29
|
+
if (filter(body)) return `}${body.replace(/[^\n]/g, fillChar)}\``;
|
|
30
|
+
}
|
|
31
|
+
if (token.type === "TemplateMiddle") {
|
|
32
|
+
const body = token.value.slice(1, -2);
|
|
33
|
+
if (filter(body)) return `}${body.replace(/[^\n]/g, fillChar)}\${`;
|
|
34
|
+
}
|
|
35
|
+
return token.value;
|
|
36
|
+
}
|
|
37
|
+
function optionsWithDefaults(options) {
|
|
38
|
+
return {
|
|
39
|
+
fillChar: options?.fillChar ?? " ",
|
|
40
|
+
filter: options?.filter ?? (() => true)
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
function stripLiteral(code, options) {
|
|
44
|
+
let result = "";
|
|
45
|
+
const _options = optionsWithDefaults(options);
|
|
46
|
+
for (const token of (0, import_js_tokens.default)(code, { jsx: false })) result += stripLiteralFromToken(token, _options.fillChar, _options.filter);
|
|
47
|
+
return result;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
//#endregion
|
|
51
|
+
export { stripLiteral };
|
package/dist/node_modules/.pnpm/tinyrainbow@2.0.0/node_modules/tinyrainbow/dist/chunk-BVHSVHOK.js
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/tinyrainbow@2.0.0/node_modules/tinyrainbow/dist/chunk-BVHSVHOK.js
|
|
2
|
+
var h = Object.entries({
|
|
3
|
+
reset: [0, 0],
|
|
4
|
+
bold: [
|
|
5
|
+
1,
|
|
6
|
+
22,
|
|
7
|
+
"\x1B[22m\x1B[1m"
|
|
8
|
+
],
|
|
9
|
+
dim: [
|
|
10
|
+
2,
|
|
11
|
+
22,
|
|
12
|
+
"\x1B[22m\x1B[2m"
|
|
13
|
+
],
|
|
14
|
+
italic: [3, 23],
|
|
15
|
+
underline: [4, 24],
|
|
16
|
+
inverse: [7, 27],
|
|
17
|
+
hidden: [8, 28],
|
|
18
|
+
strikethrough: [9, 29],
|
|
19
|
+
black: [30, 39],
|
|
20
|
+
red: [31, 39],
|
|
21
|
+
green: [32, 39],
|
|
22
|
+
yellow: [33, 39],
|
|
23
|
+
blue: [34, 39],
|
|
24
|
+
magenta: [35, 39],
|
|
25
|
+
cyan: [36, 39],
|
|
26
|
+
white: [37, 39],
|
|
27
|
+
gray: [90, 39],
|
|
28
|
+
bgBlack: [40, 49],
|
|
29
|
+
bgRed: [41, 49],
|
|
30
|
+
bgGreen: [42, 49],
|
|
31
|
+
bgYellow: [43, 49],
|
|
32
|
+
bgBlue: [44, 49],
|
|
33
|
+
bgMagenta: [45, 49],
|
|
34
|
+
bgCyan: [46, 49],
|
|
35
|
+
bgWhite: [47, 49],
|
|
36
|
+
blackBright: [90, 39],
|
|
37
|
+
redBright: [91, 39],
|
|
38
|
+
greenBright: [92, 39],
|
|
39
|
+
yellowBright: [93, 39],
|
|
40
|
+
blueBright: [94, 39],
|
|
41
|
+
magentaBright: [95, 39],
|
|
42
|
+
cyanBright: [96, 39],
|
|
43
|
+
whiteBright: [97, 39],
|
|
44
|
+
bgBlackBright: [100, 49],
|
|
45
|
+
bgRedBright: [101, 49],
|
|
46
|
+
bgGreenBright: [102, 49],
|
|
47
|
+
bgYellowBright: [103, 49],
|
|
48
|
+
bgBlueBright: [104, 49],
|
|
49
|
+
bgMagentaBright: [105, 49],
|
|
50
|
+
bgCyanBright: [106, 49],
|
|
51
|
+
bgWhiteBright: [107, 49]
|
|
52
|
+
});
|
|
53
|
+
function a(n) {
|
|
54
|
+
return String(n);
|
|
55
|
+
}
|
|
56
|
+
a.open = "";
|
|
57
|
+
a.close = "";
|
|
58
|
+
function C(n = !1) {
|
|
59
|
+
let e = typeof process != "undefined" ? process : void 0, i = (e == null ? void 0 : e.env) || {}, g = (e == null ? void 0 : e.argv) || [];
|
|
60
|
+
return !("NO_COLOR" in i || g.includes("--no-color")) && ("FORCE_COLOR" in i || g.includes("--color") || (e == null ? void 0 : e.platform) === "win32" || n && i.TERM !== "dumb" || "CI" in i) || typeof window != "undefined" && !!window.chrome;
|
|
61
|
+
}
|
|
62
|
+
function p(n = !1) {
|
|
63
|
+
let e = C(n), i = (r, t, c, o) => {
|
|
64
|
+
let l = "", s = 0;
|
|
65
|
+
do
|
|
66
|
+
l += r.substring(s, o) + c, s = o + t.length, o = r.indexOf(t, s);
|
|
67
|
+
while (~o);
|
|
68
|
+
return l + r.substring(s);
|
|
69
|
+
}, g = (r, t, c = r) => {
|
|
70
|
+
let o = (l) => {
|
|
71
|
+
let s = String(l), b = s.indexOf(t, r.length);
|
|
72
|
+
return ~b ? r + i(s, t, c, b) + t : r + s + t;
|
|
73
|
+
};
|
|
74
|
+
return o.open = r, o.close = t, o;
|
|
75
|
+
}, u = { isColorSupported: e }, d = (r) => `\x1B[${r}m`;
|
|
76
|
+
for (let [r, t] of h) u[r] = e ? g(d(t[0]), d(t[1]), t[2]) : a;
|
|
77
|
+
return u;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
//#endregion
|
|
81
|
+
export { p };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { p } from "./chunk-BVHSVHOK.js";
|
|
2
|
+
import { isatty } from "tty";
|
|
3
|
+
|
|
4
|
+
//#region ../../node_modules/.pnpm/tinyrainbow@2.0.0/node_modules/tinyrainbow/dist/node.js
|
|
5
|
+
var r = process.env.FORCE_TTY !== void 0 || isatty(1);
|
|
6
|
+
var u = p(r);
|
|
7
|
+
|
|
8
|
+
//#endregion
|
|
9
|
+
export { u };
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/tinyspy@4.0.4/node_modules/tinyspy/dist/index.js
|
|
2
|
+
function S(e, t) {
|
|
3
|
+
if (!e) throw new Error(t);
|
|
4
|
+
}
|
|
5
|
+
function f(e, t) {
|
|
6
|
+
return typeof t === e;
|
|
7
|
+
}
|
|
8
|
+
function w(e) {
|
|
9
|
+
return e instanceof Promise;
|
|
10
|
+
}
|
|
11
|
+
function u(e, t, r) {
|
|
12
|
+
Object.defineProperty(e, t, r);
|
|
13
|
+
}
|
|
14
|
+
function l(e, t, r) {
|
|
15
|
+
u(e, t, {
|
|
16
|
+
value: r,
|
|
17
|
+
configurable: !0,
|
|
18
|
+
writable: !0
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
var y = Symbol.for("tinyspy:spy");
|
|
22
|
+
var x = /* @__PURE__ */ new Set(), h = (e) => {
|
|
23
|
+
e.called = !1, e.callCount = 0, e.calls = [], e.results = [], e.resolves = [], e.next = [];
|
|
24
|
+
}, k = (e) => (u(e, y, { value: { reset: () => h(e[y]) } }), e[y]), T = (e) => e[y] || k(e);
|
|
25
|
+
function R(e) {
|
|
26
|
+
S(f("function", e) || f("undefined", e), "cannot spy on a non-function value");
|
|
27
|
+
let t = function(...s) {
|
|
28
|
+
let n = T(t);
|
|
29
|
+
n.called = !0, n.callCount++, n.calls.push(s);
|
|
30
|
+
let d = n.next.shift();
|
|
31
|
+
if (d) {
|
|
32
|
+
n.results.push(d);
|
|
33
|
+
let [a, i] = d;
|
|
34
|
+
if (a === "ok") return i;
|
|
35
|
+
throw i;
|
|
36
|
+
}
|
|
37
|
+
let o, c = "ok", p = n.results.length;
|
|
38
|
+
if (n.impl) try {
|
|
39
|
+
new.target ? o = Reflect.construct(n.impl, s, new.target) : o = n.impl.apply(this, s), c = "ok";
|
|
40
|
+
} catch (a) {
|
|
41
|
+
throw o = a, c = "error", n.results.push([c, a]), a;
|
|
42
|
+
}
|
|
43
|
+
let g = [c, o];
|
|
44
|
+
return w(o) && o.then((a) => n.resolves[p] = ["ok", a], (a) => n.resolves[p] = ["error", a]), n.results.push(g), o;
|
|
45
|
+
};
|
|
46
|
+
l(t, "_isMockFunction", !0), l(t, "length", e ? e.length : 0), l(t, "name", e && e.name || "spy");
|
|
47
|
+
let r = T(t);
|
|
48
|
+
return r.reset(), r.impl = e, t;
|
|
49
|
+
}
|
|
50
|
+
function v(e) {
|
|
51
|
+
return !!e && e._isMockFunction === !0;
|
|
52
|
+
}
|
|
53
|
+
var b = (e, t) => {
|
|
54
|
+
let r = Object.getOwnPropertyDescriptor(e, t);
|
|
55
|
+
if (r) return [e, r];
|
|
56
|
+
let s = Object.getPrototypeOf(e);
|
|
57
|
+
for (; s !== null;) {
|
|
58
|
+
let n = Object.getOwnPropertyDescriptor(s, t);
|
|
59
|
+
if (n) return [s, n];
|
|
60
|
+
s = Object.getPrototypeOf(s);
|
|
61
|
+
}
|
|
62
|
+
}, P = (e, t) => {
|
|
63
|
+
t != null && typeof t == "function" && t.prototype != null && Object.setPrototypeOf(e.prototype, t.prototype);
|
|
64
|
+
};
|
|
65
|
+
function M(e, t, r) {
|
|
66
|
+
S(!f("undefined", e), "spyOn could not find an object to spy upon"), S(f("object", e) || f("function", e), "cannot spyOn on a primitive value");
|
|
67
|
+
let [s, n] = (() => {
|
|
68
|
+
if (!f("object", t)) return [t, "value"];
|
|
69
|
+
if ("getter" in t && "setter" in t) throw new Error("cannot spy on both getter and setter");
|
|
70
|
+
if ("getter" in t) return [t.getter, "get"];
|
|
71
|
+
if ("setter" in t) return [t.setter, "set"];
|
|
72
|
+
throw new Error("specify getter or setter to spy on");
|
|
73
|
+
})(), [d, o] = b(e, s) || [];
|
|
74
|
+
S(o || s in e, `${String(s)} does not exist`);
|
|
75
|
+
let c = !1;
|
|
76
|
+
n === "value" && o && !o.value && o.get && (n = "get", c = !0, r = o.get());
|
|
77
|
+
let p;
|
|
78
|
+
o ? p = o[n] : n !== "value" ? p = () => e[s] : p = e[s], p && j(p) && (p = p[y].getOriginal());
|
|
79
|
+
let g = (I) => {
|
|
80
|
+
let { value: F, ...O } = o || {
|
|
81
|
+
configurable: !0,
|
|
82
|
+
writable: !0
|
|
83
|
+
};
|
|
84
|
+
n !== "value" && delete O.writable, O[n] = I, u(e, s, O);
|
|
85
|
+
}, a = () => {
|
|
86
|
+
d !== e ? Reflect.deleteProperty(e, s) : o && !p ? u(e, s, o) : g(p);
|
|
87
|
+
};
|
|
88
|
+
r || (r = p);
|
|
89
|
+
let i = E(R(r), r);
|
|
90
|
+
n === "value" && P(i, p);
|
|
91
|
+
let m = i[y];
|
|
92
|
+
return l(m, "restore", a), l(m, "getOriginal", () => c ? p() : p), l(m, "willCall", (I) => (m.impl = I, i)), g(c ? () => (P(i, r), i) : i), x.add(i), i;
|
|
93
|
+
}
|
|
94
|
+
var K = /* @__PURE__ */ new Set([
|
|
95
|
+
"length",
|
|
96
|
+
"name",
|
|
97
|
+
"prototype"
|
|
98
|
+
]);
|
|
99
|
+
function D(e) {
|
|
100
|
+
let t = /* @__PURE__ */ new Set(), r = {};
|
|
101
|
+
for (; e && e !== Object.prototype && e !== Function.prototype;) {
|
|
102
|
+
let s = [...Object.getOwnPropertyNames(e), ...Object.getOwnPropertySymbols(e)];
|
|
103
|
+
for (let n of s) r[n] || K.has(n) || (t.add(n), r[n] = Object.getOwnPropertyDescriptor(e, n));
|
|
104
|
+
e = Object.getPrototypeOf(e);
|
|
105
|
+
}
|
|
106
|
+
return {
|
|
107
|
+
properties: t,
|
|
108
|
+
descriptors: r
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
function E(e, t) {
|
|
112
|
+
if (!t || y in t) return e;
|
|
113
|
+
let { properties: r, descriptors: s } = D(t);
|
|
114
|
+
for (let n of r) {
|
|
115
|
+
let d = s[n];
|
|
116
|
+
b(e, n) || u(e, n, d);
|
|
117
|
+
}
|
|
118
|
+
return e;
|
|
119
|
+
}
|
|
120
|
+
function j(e) {
|
|
121
|
+
return v(e) && "getOriginal" in e[y];
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
//#endregion
|
|
125
|
+
export { M, T };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/vitest@3.2.4_@edge-runtime+vm@3.2.0_@types+debug@4.1.12_@types+node@20.19.27_jiti@2.6.1_93023d256ff9ed909ae8f0d436c922a0/node_modules/vitest/dist/chunks/_commonjsHelpers.BFTU3MAI.js
|
|
2
|
+
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
3
|
+
function getDefaultExportFromCjs(x) {
|
|
4
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
//#endregion
|
|
8
|
+
export { commonjsGlobal, getDefaultExportFromCjs };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/vitest@3.2.4_@edge-runtime+vm@3.2.0_@types+debug@4.1.12_@types+node@20.19.27_jiti@2.6.1_93023d256ff9ed909ae8f0d436c922a0/node_modules/vitest/dist/chunks/date.Bq6ZW5rf.js
|
|
2
|
+
const RealDate = Date;
|
|
3
|
+
let now = null;
|
|
4
|
+
var MockDate = class MockDate extends RealDate {
|
|
5
|
+
constructor(y, m, d, h, M, s, ms) {
|
|
6
|
+
super();
|
|
7
|
+
let date;
|
|
8
|
+
switch (arguments.length) {
|
|
9
|
+
case 0:
|
|
10
|
+
if (now !== null) date = new RealDate(now.valueOf());
|
|
11
|
+
else date = new RealDate();
|
|
12
|
+
break;
|
|
13
|
+
case 1:
|
|
14
|
+
date = new RealDate(y);
|
|
15
|
+
break;
|
|
16
|
+
default:
|
|
17
|
+
d = typeof d === "undefined" ? 1 : d;
|
|
18
|
+
h = h || 0;
|
|
19
|
+
M = M || 0;
|
|
20
|
+
s = s || 0;
|
|
21
|
+
ms = ms || 0;
|
|
22
|
+
date = new RealDate(y, m, d, h, M, s, ms);
|
|
23
|
+
break;
|
|
24
|
+
}
|
|
25
|
+
Object.setPrototypeOf(date, MockDate.prototype);
|
|
26
|
+
return date;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
MockDate.UTC = RealDate.UTC;
|
|
30
|
+
MockDate.now = function() {
|
|
31
|
+
return new MockDate().valueOf();
|
|
32
|
+
};
|
|
33
|
+
MockDate.parse = function(dateString) {
|
|
34
|
+
return RealDate.parse(dateString);
|
|
35
|
+
};
|
|
36
|
+
MockDate.toString = function() {
|
|
37
|
+
return RealDate.toString();
|
|
38
|
+
};
|
|
39
|
+
function mockDate(date) {
|
|
40
|
+
const dateObj = new RealDate(date.valueOf());
|
|
41
|
+
if (Number.isNaN(dateObj.getTime())) throw new TypeError(`mockdate: The time set is an invalid date: ${date}`);
|
|
42
|
+
globalThis.Date = MockDate;
|
|
43
|
+
now = dateObj.valueOf();
|
|
44
|
+
}
|
|
45
|
+
function resetDate() {
|
|
46
|
+
globalThis.Date = RealDate;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
//#endregion
|
|
50
|
+
export { RealDate, mockDate, resetDate };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { getSafeTimers } from "../../../../../@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/index.js";
|
|
2
|
+
|
|
3
|
+
//#region ../../node_modules/.pnpm/vitest@3.2.4_@edge-runtime+vm@3.2.0_@types+debug@4.1.12_@types+node@20.19.27_jiti@2.6.1_93023d256ff9ed909ae8f0d436c922a0/node_modules/vitest/dist/chunks/utils.XdZDrNZV.js
|
|
4
|
+
const NAME_WORKER_STATE = "__vitest_worker__";
|
|
5
|
+
function getWorkerState() {
|
|
6
|
+
const workerState = globalThis[NAME_WORKER_STATE];
|
|
7
|
+
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");
|
|
8
|
+
return workerState;
|
|
9
|
+
}
|
|
10
|
+
function getCurrentEnvironment() {
|
|
11
|
+
return getWorkerState()?.environment.name;
|
|
12
|
+
}
|
|
13
|
+
function isChildProcess() {
|
|
14
|
+
return typeof process !== "undefined" && !!process.send;
|
|
15
|
+
}
|
|
16
|
+
function resetModules(modules, resetMocks = false) {
|
|
17
|
+
const skipPaths = [
|
|
18
|
+
/\/vitest\/dist\//,
|
|
19
|
+
/\/vite-node\/dist\//,
|
|
20
|
+
/vitest-virtual-\w+\/dist/,
|
|
21
|
+
/@vitest\/dist/,
|
|
22
|
+
...!resetMocks ? [/^mock:/] : []
|
|
23
|
+
];
|
|
24
|
+
modules.forEach((mod, path) => {
|
|
25
|
+
if (skipPaths.some((re) => re.test(path))) return;
|
|
26
|
+
modules.invalidateModule(mod);
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
function waitNextTick() {
|
|
30
|
+
const { setTimeout } = getSafeTimers();
|
|
31
|
+
return new Promise((resolve) => setTimeout(resolve, 0));
|
|
32
|
+
}
|
|
33
|
+
async function waitForImportsToResolve() {
|
|
34
|
+
await waitNextTick();
|
|
35
|
+
const state = getWorkerState();
|
|
36
|
+
const promises = [];
|
|
37
|
+
let resolvingCount = 0;
|
|
38
|
+
for (const mod of state.moduleCache.values()) {
|
|
39
|
+
if (mod.promise && !mod.evaluated) promises.push(mod.promise);
|
|
40
|
+
if (mod.resolving) resolvingCount++;
|
|
41
|
+
}
|
|
42
|
+
if (!promises.length && !resolvingCount) return;
|
|
43
|
+
await Promise.allSettled(promises);
|
|
44
|
+
await waitForImportsToResolve();
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
//#endregion
|
|
48
|
+
export { getCurrentEnvironment, getWorkerState, isChildProcess, resetModules, waitForImportsToResolve };
|