mirror of
https://github.com/tiramisulabs/seyfert.git
synced 2025-07-02 04:56:07 +00:00
feat: workerManager#tellWorker
This commit is contained in:
parent
70b1bc1dc5
commit
3efe66bf5e
12
biome.json
12
biome.json
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://biomejs.dev/schemas/1.9.2/schema.json",
|
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
|
||||||
"vcs": {
|
"vcs": {
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"clientKind": "git",
|
"clientKind": "git",
|
||||||
@ -8,15 +8,7 @@
|
|||||||
},
|
},
|
||||||
"files": {
|
"files": {
|
||||||
"ignoreUnknown": true,
|
"ignoreUnknown": true,
|
||||||
"ignore": [
|
"ignore": ["node_modules/", "build", "lib", "__test__", "package.json", "tsconfig.json", ".vscode"]
|
||||||
"node_modules/",
|
|
||||||
"build",
|
|
||||||
"lib",
|
|
||||||
"__test__",
|
|
||||||
"package.json",
|
|
||||||
"tsconfig.json",
|
|
||||||
".vscode"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"formatter": {
|
"formatter": {
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
|
@ -21,10 +21,10 @@
|
|||||||
"author": "MARCROCK22",
|
"author": "MARCROCK22",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@biomejs/biome": "1.9.3",
|
"@biomejs/biome": "1.9.4",
|
||||||
"@commitlint/cli": "^19.5.0",
|
"@commitlint/cli": "^19.5.0",
|
||||||
"@commitlint/config-conventional": "^19.5.0",
|
"@commitlint/config-conventional": "^19.5.0",
|
||||||
"@types/node": "^22.7.6",
|
"@types/node": "^22.7.7",
|
||||||
"husky": "^9.1.6",
|
"husky": "^9.1.6",
|
||||||
"lint-staged": "^15.2.10",
|
"lint-staged": "^15.2.10",
|
||||||
"typescript": "^5.6.3",
|
"typescript": "^5.6.3",
|
||||||
|
128
pnpm-lock.yaml
generated
128
pnpm-lock.yaml
generated
@ -9,17 +9,17 @@ importers:
|
|||||||
.:
|
.:
|
||||||
devDependencies:
|
devDependencies:
|
||||||
'@biomejs/biome':
|
'@biomejs/biome':
|
||||||
specifier: 1.9.3
|
specifier: 1.9.4
|
||||||
version: 1.9.3
|
version: 1.9.4
|
||||||
'@commitlint/cli':
|
'@commitlint/cli':
|
||||||
specifier: ^19.5.0
|
specifier: ^19.5.0
|
||||||
version: 19.5.0(@types/node@22.7.6)(typescript@5.6.3)
|
version: 19.5.0(@types/node@22.7.7)(typescript@5.6.3)
|
||||||
'@commitlint/config-conventional':
|
'@commitlint/config-conventional':
|
||||||
specifier: ^19.5.0
|
specifier: ^19.5.0
|
||||||
version: 19.5.0
|
version: 19.5.0
|
||||||
'@types/node':
|
'@types/node':
|
||||||
specifier: ^22.7.6
|
specifier: ^22.7.7
|
||||||
version: 22.7.6
|
version: 22.7.7
|
||||||
husky:
|
husky:
|
||||||
specifier: ^9.1.6
|
specifier: ^9.1.6
|
||||||
version: 9.1.6
|
version: 9.1.6
|
||||||
@ -31,7 +31,7 @@ importers:
|
|||||||
version: 5.6.3
|
version: 5.6.3
|
||||||
vitest:
|
vitest:
|
||||||
specifier: ^2.1.3
|
specifier: ^2.1.3
|
||||||
version: 2.1.3(@types/node@22.7.6)
|
version: 2.1.3(@types/node@22.7.7)
|
||||||
|
|
||||||
packages:
|
packages:
|
||||||
|
|
||||||
@ -47,55 +47,55 @@ packages:
|
|||||||
resolution: {integrity: sha512-iYyACpW3iW8Fw+ZybQK+drQre+ns/tKpXbNESfrhNnPLIklLbXr7MYJ6gPEd0iETGLOK+SxMjVvKb/ffmk+FEw==}
|
resolution: {integrity: sha512-iYyACpW3iW8Fw+ZybQK+drQre+ns/tKpXbNESfrhNnPLIklLbXr7MYJ6gPEd0iETGLOK+SxMjVvKb/ffmk+FEw==}
|
||||||
engines: {node: '>=6.9.0'}
|
engines: {node: '>=6.9.0'}
|
||||||
|
|
||||||
'@biomejs/biome@1.9.3':
|
'@biomejs/biome@1.9.4':
|
||||||
resolution: {integrity: sha512-POjAPz0APAmX33WOQFGQrwLvlu7WLV4CFJMlB12b6ZSg+2q6fYu9kZwLCOA+x83zXfcPd1RpuWOKJW0GbBwLIQ==}
|
resolution: {integrity: sha512-1rkd7G70+o9KkTn5KLmDYXihGoTaIGO9PIIN2ZB7UJxFrWw04CZHPYiMRjYsaDvVV7hP1dYNRLxSANLaBFGpog==}
|
||||||
engines: {node: '>=14.21.3'}
|
engines: {node: '>=14.21.3'}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
|
|
||||||
'@biomejs/cli-darwin-arm64@1.9.3':
|
'@biomejs/cli-darwin-arm64@1.9.4':
|
||||||
resolution: {integrity: sha512-QZzD2XrjJDUyIZK+aR2i5DDxCJfdwiYbUKu9GzkCUJpL78uSelAHAPy7m0GuPMVtF/Uo+OKv97W3P9nuWZangQ==}
|
resolution: {integrity: sha512-bFBsPWrNvkdKrNCYeAp+xo2HecOGPAy9WyNyB/jKnnedgzl4W4Hb9ZMzYNbf8dMCGmUdSavlYHiR01QaYR58cw==}
|
||||||
engines: {node: '>=14.21.3'}
|
engines: {node: '>=14.21.3'}
|
||||||
cpu: [arm64]
|
cpu: [arm64]
|
||||||
os: [darwin]
|
os: [darwin]
|
||||||
|
|
||||||
'@biomejs/cli-darwin-x64@1.9.3':
|
'@biomejs/cli-darwin-x64@1.9.4':
|
||||||
resolution: {integrity: sha512-vSCoIBJE0BN3SWDFuAY/tRavpUtNoqiceJ5PrU3xDfsLcm/U6N93JSM0M9OAiC/X7mPPfejtr6Yc9vSgWlEgVw==}
|
resolution: {integrity: sha512-ngYBh/+bEedqkSevPVhLP4QfVPCpb+4BBe2p7Xs32dBgs7rh9nY2AIYUL6BgLw1JVXV8GlpKmb/hNiuIxfPfZg==}
|
||||||
engines: {node: '>=14.21.3'}
|
engines: {node: '>=14.21.3'}
|
||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
os: [darwin]
|
os: [darwin]
|
||||||
|
|
||||||
'@biomejs/cli-linux-arm64-musl@1.9.3':
|
'@biomejs/cli-linux-arm64-musl@1.9.4':
|
||||||
resolution: {integrity: sha512-VBzyhaqqqwP3bAkkBrhVq50i3Uj9+RWuj+pYmXrMDgjS5+SKYGE56BwNw4l8hR3SmYbLSbEo15GcV043CDSk+Q==}
|
resolution: {integrity: sha512-v665Ct9WCRjGa8+kTr0CzApU0+XXtRgwmzIf1SeKSGAv+2scAlW6JR5PMFo6FzqqZ64Po79cKODKf3/AAmECqA==}
|
||||||
engines: {node: '>=14.21.3'}
|
engines: {node: '>=14.21.3'}
|
||||||
cpu: [arm64]
|
cpu: [arm64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
|
|
||||||
'@biomejs/cli-linux-arm64@1.9.3':
|
'@biomejs/cli-linux-arm64@1.9.4':
|
||||||
resolution: {integrity: sha512-vJkAimD2+sVviNTbaWOGqEBy31cW0ZB52KtpVIbkuma7PlfII3tsLhFa+cwbRAcRBkobBBhqZ06hXoZAN8NODQ==}
|
resolution: {integrity: sha512-fJIW0+LYujdjUgJJuwesP4EjIBl/N/TcOX3IvIHJQNsAqvV2CHIogsmA94BPG6jZATS4Hi+xv4SkBBQSt1N4/g==}
|
||||||
engines: {node: '>=14.21.3'}
|
engines: {node: '>=14.21.3'}
|
||||||
cpu: [arm64]
|
cpu: [arm64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
|
|
||||||
'@biomejs/cli-linux-x64-musl@1.9.3':
|
'@biomejs/cli-linux-x64-musl@1.9.4':
|
||||||
resolution: {integrity: sha512-TJmnOG2+NOGM72mlczEsNki9UT+XAsMFAOo8J0me/N47EJ/vkLXxf481evfHLlxMejTY6IN8SdRSiPVLv6AHlA==}
|
resolution: {integrity: sha512-gEhi/jSBhZ2m6wjV530Yy8+fNqG8PAinM3oV7CyO+6c3CEh16Eizm21uHVsyVBEB6RIM8JHIl6AGYCv6Q6Q9Tg==}
|
||||||
engines: {node: '>=14.21.3'}
|
engines: {node: '>=14.21.3'}
|
||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
|
|
||||||
'@biomejs/cli-linux-x64@1.9.3':
|
'@biomejs/cli-linux-x64@1.9.4':
|
||||||
resolution: {integrity: sha512-x220V4c+romd26Mu1ptU+EudMXVS4xmzKxPVb9mgnfYlN4Yx9vD5NZraSx/onJnd3Gh/y8iPUdU5CDZJKg9COA==}
|
resolution: {integrity: sha512-lRCJv/Vi3Vlwmbd6K+oQ0KhLHMAysN8lXoCI7XeHlxaajk06u7G+UsFSO01NAs5iYuWKmVZjmiOzJ0OJmGsMwg==}
|
||||||
engines: {node: '>=14.21.3'}
|
engines: {node: '>=14.21.3'}
|
||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
|
|
||||||
'@biomejs/cli-win32-arm64@1.9.3':
|
'@biomejs/cli-win32-arm64@1.9.4':
|
||||||
resolution: {integrity: sha512-lg/yZis2HdQGsycUvHWSzo9kOvnGgvtrYRgoCEwPBwwAL8/6crOp3+f47tPwI/LI1dZrhSji7PNsGKGHbwyAhw==}
|
resolution: {integrity: sha512-tlbhLk+WXZmgwoIKwHIHEBZUwxml7bRJgk0X2sPyNR3S93cdRq6XulAZRQJ17FYGGzWne0fgrXBKpl7l4M87Hg==}
|
||||||
engines: {node: '>=14.21.3'}
|
engines: {node: '>=14.21.3'}
|
||||||
cpu: [arm64]
|
cpu: [arm64]
|
||||||
os: [win32]
|
os: [win32]
|
||||||
|
|
||||||
'@biomejs/cli-win32-x64@1.9.3':
|
'@biomejs/cli-win32-x64@1.9.4':
|
||||||
resolution: {integrity: sha512-cQMy2zanBkVLpmmxXdK6YePzmZx0s5Z7KEnwmrW54rcXK3myCNbQa09SwGZ8i/8sLw0H9F3X7K4rxVNGU8/D4Q==}
|
resolution: {integrity: sha512-8Y5wMhVIPaWe6jw2H+KlEm4wP/f7EW3810ZLmDlrEEy5KvBsb9ECEfu/kMWD484ijfQ8+nIi0giMgu9g1UAuuA==}
|
||||||
engines: {node: '>=14.21.3'}
|
engines: {node: '>=14.21.3'}
|
||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
os: [win32]
|
os: [win32]
|
||||||
@ -396,8 +396,8 @@ packages:
|
|||||||
'@types/estree@1.0.6':
|
'@types/estree@1.0.6':
|
||||||
resolution: {integrity: sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==}
|
resolution: {integrity: sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==}
|
||||||
|
|
||||||
'@types/node@22.7.6':
|
'@types/node@22.7.7':
|
||||||
resolution: {integrity: sha512-/d7Rnj0/ExXDMcioS78/kf1lMzYk4BZV8MZGTBKzTGZ6/406ukkbYlIsZmMPhcR5KlkunDHQLrtAVmSq7r+mSw==}
|
resolution: {integrity: sha512-SRxCrrg9CL/y54aiMCG3edPKdprgMVGDXjA3gB8UmmBW5TcXzRUYAh8EWzTnSJFAd1rgImPELza+A3bJ+qxz8Q==}
|
||||||
|
|
||||||
'@vitest/expect@2.1.3':
|
'@vitest/expect@2.1.3':
|
||||||
resolution: {integrity: sha512-SNBoPubeCJhZ48agjXruCI57DvxcsivVDdWz+SSsmjTT4QN/DfHk3zB/xKsJqMs26bLZ/pNRLnCf0j679i0uWQ==}
|
resolution: {integrity: sha512-SNBoPubeCJhZ48agjXruCI57DvxcsivVDdWz+SSsmjTT4QN/DfHk3zB/xKsJqMs26bLZ/pNRLnCf0j679i0uWQ==}
|
||||||
@ -546,8 +546,8 @@ packages:
|
|||||||
engines: {node: '>=16'}
|
engines: {node: '>=16'}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
|
|
||||||
cosmiconfig-typescript-loader@5.0.0:
|
cosmiconfig-typescript-loader@5.1.0:
|
||||||
resolution: {integrity: sha512-+8cK7jRAReYkMwMiG+bxhcNKiHJDM6bR9FD/nGBXOWdMLuYawjF5cGrtLilJ+LGd3ZjCXnJjR5DkfWPoIVlqJA==}
|
resolution: {integrity: sha512-7PtBB+6FdsOvZyJtlF3hEPpACq7RQX6BVGsgC7/lfVXnKMvNCu/XY3ykreqG5w/rBNdu2z8LCIKoF3kpHHdHlA==}
|
||||||
engines: {node: '>=v16'}
|
engines: {node: '>=v16'}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
'@types/node': '*'
|
'@types/node': '*'
|
||||||
@ -1152,46 +1152,46 @@ snapshots:
|
|||||||
js-tokens: 4.0.0
|
js-tokens: 4.0.0
|
||||||
picocolors: 1.1.1
|
picocolors: 1.1.1
|
||||||
|
|
||||||
'@biomejs/biome@1.9.3':
|
'@biomejs/biome@1.9.4':
|
||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
'@biomejs/cli-darwin-arm64': 1.9.3
|
'@biomejs/cli-darwin-arm64': 1.9.4
|
||||||
'@biomejs/cli-darwin-x64': 1.9.3
|
'@biomejs/cli-darwin-x64': 1.9.4
|
||||||
'@biomejs/cli-linux-arm64': 1.9.3
|
'@biomejs/cli-linux-arm64': 1.9.4
|
||||||
'@biomejs/cli-linux-arm64-musl': 1.9.3
|
'@biomejs/cli-linux-arm64-musl': 1.9.4
|
||||||
'@biomejs/cli-linux-x64': 1.9.3
|
'@biomejs/cli-linux-x64': 1.9.4
|
||||||
'@biomejs/cli-linux-x64-musl': 1.9.3
|
'@biomejs/cli-linux-x64-musl': 1.9.4
|
||||||
'@biomejs/cli-win32-arm64': 1.9.3
|
'@biomejs/cli-win32-arm64': 1.9.4
|
||||||
'@biomejs/cli-win32-x64': 1.9.3
|
'@biomejs/cli-win32-x64': 1.9.4
|
||||||
|
|
||||||
'@biomejs/cli-darwin-arm64@1.9.3':
|
'@biomejs/cli-darwin-arm64@1.9.4':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@biomejs/cli-darwin-x64@1.9.3':
|
'@biomejs/cli-darwin-x64@1.9.4':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@biomejs/cli-linux-arm64-musl@1.9.3':
|
'@biomejs/cli-linux-arm64-musl@1.9.4':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@biomejs/cli-linux-arm64@1.9.3':
|
'@biomejs/cli-linux-arm64@1.9.4':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@biomejs/cli-linux-x64-musl@1.9.3':
|
'@biomejs/cli-linux-x64-musl@1.9.4':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@biomejs/cli-linux-x64@1.9.3':
|
'@biomejs/cli-linux-x64@1.9.4':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@biomejs/cli-win32-arm64@1.9.3':
|
'@biomejs/cli-win32-arm64@1.9.4':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@biomejs/cli-win32-x64@1.9.3':
|
'@biomejs/cli-win32-x64@1.9.4':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@commitlint/cli@19.5.0(@types/node@22.7.6)(typescript@5.6.3)':
|
'@commitlint/cli@19.5.0(@types/node@22.7.7)(typescript@5.6.3)':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@commitlint/format': 19.5.0
|
'@commitlint/format': 19.5.0
|
||||||
'@commitlint/lint': 19.5.0
|
'@commitlint/lint': 19.5.0
|
||||||
'@commitlint/load': 19.5.0(@types/node@22.7.6)(typescript@5.6.3)
|
'@commitlint/load': 19.5.0(@types/node@22.7.7)(typescript@5.6.3)
|
||||||
'@commitlint/read': 19.5.0
|
'@commitlint/read': 19.5.0
|
||||||
'@commitlint/types': 19.5.0
|
'@commitlint/types': 19.5.0
|
||||||
tinyexec: 0.3.1
|
tinyexec: 0.3.1
|
||||||
@ -1238,7 +1238,7 @@ snapshots:
|
|||||||
'@commitlint/rules': 19.5.0
|
'@commitlint/rules': 19.5.0
|
||||||
'@commitlint/types': 19.5.0
|
'@commitlint/types': 19.5.0
|
||||||
|
|
||||||
'@commitlint/load@19.5.0(@types/node@22.7.6)(typescript@5.6.3)':
|
'@commitlint/load@19.5.0(@types/node@22.7.7)(typescript@5.6.3)':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@commitlint/config-validator': 19.5.0
|
'@commitlint/config-validator': 19.5.0
|
||||||
'@commitlint/execute-rule': 19.5.0
|
'@commitlint/execute-rule': 19.5.0
|
||||||
@ -1246,7 +1246,7 @@ snapshots:
|
|||||||
'@commitlint/types': 19.5.0
|
'@commitlint/types': 19.5.0
|
||||||
chalk: 5.3.0
|
chalk: 5.3.0
|
||||||
cosmiconfig: 9.0.0(typescript@5.6.3)
|
cosmiconfig: 9.0.0(typescript@5.6.3)
|
||||||
cosmiconfig-typescript-loader: 5.0.0(@types/node@22.7.6)(cosmiconfig@9.0.0(typescript@5.6.3))(typescript@5.6.3)
|
cosmiconfig-typescript-loader: 5.1.0(@types/node@22.7.7)(cosmiconfig@9.0.0(typescript@5.6.3))(typescript@5.6.3)
|
||||||
lodash.isplainobject: 4.0.6
|
lodash.isplainobject: 4.0.6
|
||||||
lodash.merge: 4.6.2
|
lodash.merge: 4.6.2
|
||||||
lodash.uniq: 4.5.0
|
lodash.uniq: 4.5.0
|
||||||
@ -1418,11 +1418,11 @@ snapshots:
|
|||||||
|
|
||||||
'@types/conventional-commits-parser@5.0.0':
|
'@types/conventional-commits-parser@5.0.0':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@types/node': 22.7.6
|
'@types/node': 22.7.7
|
||||||
|
|
||||||
'@types/estree@1.0.6': {}
|
'@types/estree@1.0.6': {}
|
||||||
|
|
||||||
'@types/node@22.7.6':
|
'@types/node@22.7.7':
|
||||||
dependencies:
|
dependencies:
|
||||||
undici-types: 6.19.8
|
undici-types: 6.19.8
|
||||||
|
|
||||||
@ -1433,13 +1433,13 @@ snapshots:
|
|||||||
chai: 5.1.1
|
chai: 5.1.1
|
||||||
tinyrainbow: 1.2.0
|
tinyrainbow: 1.2.0
|
||||||
|
|
||||||
'@vitest/mocker@2.1.3(@vitest/spy@2.1.3)(vite@5.4.9(@types/node@22.7.6))':
|
'@vitest/mocker@2.1.3(@vitest/spy@2.1.3)(vite@5.4.9(@types/node@22.7.7))':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@vitest/spy': 2.1.3
|
'@vitest/spy': 2.1.3
|
||||||
estree-walker: 3.0.3
|
estree-walker: 3.0.3
|
||||||
magic-string: 0.30.12
|
magic-string: 0.30.12
|
||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
vite: 5.4.9(@types/node@22.7.6)
|
vite: 5.4.9(@types/node@22.7.7)
|
||||||
|
|
||||||
'@vitest/pretty-format@2.1.3':
|
'@vitest/pretty-format@2.1.3':
|
||||||
dependencies:
|
dependencies:
|
||||||
@ -1579,9 +1579,9 @@ snapshots:
|
|||||||
meow: 12.1.1
|
meow: 12.1.1
|
||||||
split2: 4.2.0
|
split2: 4.2.0
|
||||||
|
|
||||||
cosmiconfig-typescript-loader@5.0.0(@types/node@22.7.6)(cosmiconfig@9.0.0(typescript@5.6.3))(typescript@5.6.3):
|
cosmiconfig-typescript-loader@5.1.0(@types/node@22.7.7)(cosmiconfig@9.0.0(typescript@5.6.3))(typescript@5.6.3):
|
||||||
dependencies:
|
dependencies:
|
||||||
'@types/node': 22.7.6
|
'@types/node': 22.7.7
|
||||||
cosmiconfig: 9.0.0(typescript@5.6.3)
|
cosmiconfig: 9.0.0(typescript@5.6.3)
|
||||||
jiti: 1.21.6
|
jiti: 1.21.6
|
||||||
typescript: 5.6.3
|
typescript: 5.6.3
|
||||||
@ -2012,12 +2012,12 @@ snapshots:
|
|||||||
|
|
||||||
unicorn-magic@0.1.0: {}
|
unicorn-magic@0.1.0: {}
|
||||||
|
|
||||||
vite-node@2.1.3(@types/node@22.7.6):
|
vite-node@2.1.3(@types/node@22.7.7):
|
||||||
dependencies:
|
dependencies:
|
||||||
cac: 6.7.14
|
cac: 6.7.14
|
||||||
debug: 4.3.7
|
debug: 4.3.7
|
||||||
pathe: 1.1.2
|
pathe: 1.1.2
|
||||||
vite: 5.4.9(@types/node@22.7.6)
|
vite: 5.4.9(@types/node@22.7.7)
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- '@types/node'
|
- '@types/node'
|
||||||
- less
|
- less
|
||||||
@ -2029,19 +2029,19 @@ snapshots:
|
|||||||
- supports-color
|
- supports-color
|
||||||
- terser
|
- terser
|
||||||
|
|
||||||
vite@5.4.9(@types/node@22.7.6):
|
vite@5.4.9(@types/node@22.7.7):
|
||||||
dependencies:
|
dependencies:
|
||||||
esbuild: 0.21.5
|
esbuild: 0.21.5
|
||||||
postcss: 8.4.47
|
postcss: 8.4.47
|
||||||
rollup: 4.24.0
|
rollup: 4.24.0
|
||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
'@types/node': 22.7.6
|
'@types/node': 22.7.7
|
||||||
fsevents: 2.3.3
|
fsevents: 2.3.3
|
||||||
|
|
||||||
vitest@2.1.3(@types/node@22.7.6):
|
vitest@2.1.3(@types/node@22.7.7):
|
||||||
dependencies:
|
dependencies:
|
||||||
'@vitest/expect': 2.1.3
|
'@vitest/expect': 2.1.3
|
||||||
'@vitest/mocker': 2.1.3(@vitest/spy@2.1.3)(vite@5.4.9(@types/node@22.7.6))
|
'@vitest/mocker': 2.1.3(@vitest/spy@2.1.3)(vite@5.4.9(@types/node@22.7.7))
|
||||||
'@vitest/pretty-format': 2.1.3
|
'@vitest/pretty-format': 2.1.3
|
||||||
'@vitest/runner': 2.1.3
|
'@vitest/runner': 2.1.3
|
||||||
'@vitest/snapshot': 2.1.3
|
'@vitest/snapshot': 2.1.3
|
||||||
@ -2056,11 +2056,11 @@ snapshots:
|
|||||||
tinyexec: 0.3.1
|
tinyexec: 0.3.1
|
||||||
tinypool: 1.0.1
|
tinypool: 1.0.1
|
||||||
tinyrainbow: 1.2.0
|
tinyrainbow: 1.2.0
|
||||||
vite: 5.4.9(@types/node@22.7.6)
|
vite: 5.4.9(@types/node@22.7.7)
|
||||||
vite-node: 2.1.3(@types/node@22.7.6)
|
vite-node: 2.1.3(@types/node@22.7.7)
|
||||||
why-is-node-running: 2.3.0
|
why-is-node-running: 2.3.0
|
||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
'@types/node': 22.7.6
|
'@types/node': 22.7.7
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- less
|
- less
|
||||||
- lightningcss
|
- lightningcss
|
||||||
|
@ -13,11 +13,11 @@ import type {
|
|||||||
WorkerReceivePayload,
|
WorkerReceivePayload,
|
||||||
WorkerRequestConnect,
|
WorkerRequestConnect,
|
||||||
WorkerRequestConnectResharding,
|
WorkerRequestConnectResharding,
|
||||||
WorkerSendEval,
|
|
||||||
WorkerSendEvalResponse,
|
WorkerSendEvalResponse,
|
||||||
WorkerSendInfo,
|
WorkerSendInfo,
|
||||||
WorkerSendResultPayload,
|
WorkerSendResultPayload,
|
||||||
WorkerSendShardInfo,
|
WorkerSendShardInfo,
|
||||||
|
WorkerSendToWorkerEval,
|
||||||
WorkerShardInfo,
|
WorkerShardInfo,
|
||||||
WorkerShardsConnected,
|
WorkerShardsConnected,
|
||||||
WorkerStart,
|
WorkerStart,
|
||||||
@ -38,16 +38,17 @@ let manager: import('node:worker_threads').MessagePort;
|
|||||||
try {
|
try {
|
||||||
workerData = {
|
workerData = {
|
||||||
debug: process.env.SEYFERT_WORKER_DEBUG === 'true',
|
debug: process.env.SEYFERT_WORKER_DEBUG === 'true',
|
||||||
intents: Number.parseInt(process.env.SEYFERT_WORKER_INTENTS!),
|
intents: Number(process.env.SEYFERT_WORKER_INTENTS),
|
||||||
path: process.env.SEYFERT_WORKER_PATH!,
|
path: process.env.SEYFERT_WORKER_PATH!,
|
||||||
shards: process.env.SEYFERT_WORKER_SHARDS!.split(',').map(id => Number.parseInt(id)),
|
shards: process.env.SEYFERT_WORKER_SHARDS!.split(',').map(id => Number(id)),
|
||||||
token: process.env.SEYFERT_WORKER_TOKEN!,
|
token: process.env.SEYFERT_WORKER_TOKEN!,
|
||||||
workerId: Number.parseInt(process.env.SEYFERT_WORKER_WORKERID!),
|
workerId: Number(process.env.SEYFERT_WORKER_WORKERID),
|
||||||
workerProxy: process.env.SEYFERT_WORKER_WORKERPROXY === 'true',
|
workerProxy: process.env.SEYFERT_WORKER_WORKERPROXY === 'true',
|
||||||
totalShards: Number(process.env.SEYFERT_WORKER_TOTALSHARDS),
|
totalShards: Number(process.env.SEYFERT_WORKER_TOTALSHARDS),
|
||||||
mode: process.env.SEYFERT_WORKER_MODE,
|
mode: process.env.SEYFERT_WORKER_MODE as 'custom' | 'threads' | 'clusters',
|
||||||
resharding: process.env.SEYFERT_WORKER_RESHARDING === 'true',
|
resharding: process.env.SEYFERT_WORKER_RESHARDING === 'true',
|
||||||
} as WorkerData;
|
totalWorkers: Number(process.env.SEYFERT_WORKER_TOTALWORKERS),
|
||||||
|
} satisfies WorkerData;
|
||||||
} catch {
|
} catch {
|
||||||
//
|
//
|
||||||
}
|
}
|
||||||
@ -372,6 +373,7 @@ export class WorkerClient<Ready extends boolean = boolean> extends BaseClient {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'EXECUTE_EVAL':
|
case 'EXECUTE_EVAL':
|
||||||
|
case 'EXECUTE_EVAL_TO_WORKER':
|
||||||
{
|
{
|
||||||
let result: unknown;
|
let result: unknown;
|
||||||
try {
|
try {
|
||||||
@ -451,16 +453,24 @@ export class WorkerClient<Ready extends boolean = boolean> extends BaseClient {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
tellWorker(workerId: number, func: (_: this) => any) {
|
tellWorker<R>(workerId: number, func: (_: this) => R) {
|
||||||
const nonce = this.generateNonce();
|
const nonce = this.generateNonce();
|
||||||
this.postMessage({
|
this.postMessage({
|
||||||
type: 'EVAL',
|
type: 'EVAL_TO_WORKER',
|
||||||
func: func.toString(),
|
func: func.toString(),
|
||||||
toWorkerId: workerId,
|
toWorkerId: workerId,
|
||||||
workerId: workerData.workerId,
|
workerId: workerData.workerId,
|
||||||
nonce,
|
nonce,
|
||||||
} satisfies WorkerSendEval);
|
} satisfies WorkerSendToWorkerEval);
|
||||||
return this.generateSendPromise(nonce);
|
return this.generateSendPromise<R>(nonce);
|
||||||
|
}
|
||||||
|
|
||||||
|
tellWorkers<R>(func: (_: this) => R) {
|
||||||
|
const promises: Promise<R>[] = [];
|
||||||
|
for (let i = 0; i < workerData.totalWorkers; i++) {
|
||||||
|
promises.push(this.tellWorker(i, func));
|
||||||
|
}
|
||||||
|
return Promise.all(promises);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected async onPacket(packet: GatewayDispatchPayload, shardId: number) {
|
protected async onPacket(packet: GatewayDispatchPayload, shardId: number) {
|
||||||
@ -564,6 +574,7 @@ export function generateShardInfo(shard: Shard): WorkerShardInfo {
|
|||||||
shardId: shard.id,
|
shardId: shard.id,
|
||||||
latency: shard.latency,
|
latency: shard.latency,
|
||||||
resumable: shard.resumable,
|
resumable: shard.resumable,
|
||||||
|
workerId: workerData.workerId,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,8 +54,11 @@ export class EntryPointContext<M extends keyof RegisteredMiddlewares = never> ex
|
|||||||
return this.interaction.modal(body);
|
return this.interaction.modal(body);
|
||||||
}
|
}
|
||||||
|
|
||||||
deferReply<WR extends boolean = false>(ephemeral = false): Promise<When<WR, WebhookMessageStructure, undefined>> {
|
deferReply<WR extends boolean = false>(
|
||||||
return this.interaction.deferReply(ephemeral ? MessageFlags.Ephemeral : undefined);
|
ephemeral = false,
|
||||||
|
withResponse?: WR,
|
||||||
|
): Promise<When<WR, WebhookMessageStructure, undefined>> {
|
||||||
|
return this.interaction.deferReply(ephemeral ? MessageFlags.Ephemeral : undefined, withResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
editResponse(body: InteractionMessageUpdateBodyRequest) {
|
editResponse(body: InteractionMessageUpdateBodyRequest) {
|
||||||
|
@ -79,8 +79,11 @@ export class MenuCommandContext<
|
|||||||
return this.interaction.modal(body);
|
return this.interaction.modal(body);
|
||||||
}
|
}
|
||||||
|
|
||||||
deferReply<WR extends boolean = false>(ephemeral = false): Promise<When<WR, WebhookMessageStructure, undefined>> {
|
deferReply<WR extends boolean = false>(
|
||||||
return this.interaction.deferReply(ephemeral ? MessageFlags.Ephemeral : undefined);
|
ephemeral = false,
|
||||||
|
withResponse?: WR,
|
||||||
|
): Promise<When<WR, WebhookMessageStructure, undefined>> {
|
||||||
|
return this.interaction.deferReply(ephemeral ? MessageFlags.Ephemeral : undefined, withResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
editResponse(body: InteractionMessageUpdateBodyRequest) {
|
editResponse(body: InteractionMessageUpdateBodyRequest) {
|
||||||
|
@ -249,7 +249,7 @@ export class BaseInteraction<
|
|||||||
|
|
||||||
deferReply<WR extends boolean = false>(
|
deferReply<WR extends boolean = false>(
|
||||||
flags?: MessageFlags,
|
flags?: MessageFlags,
|
||||||
withResponse = false,
|
withResponse?: WR,
|
||||||
): Promise<When<WR, WebhookMessageStructure, undefined>> {
|
): Promise<When<WR, WebhookMessageStructure, undefined>> {
|
||||||
return this.reply(
|
return this.reply(
|
||||||
{
|
{
|
||||||
|
@ -135,6 +135,7 @@ export interface WorkerData {
|
|||||||
path: string;
|
path: string;
|
||||||
shards: number[];
|
shards: number[];
|
||||||
totalShards: number;
|
totalShards: number;
|
||||||
|
totalWorkers: number;
|
||||||
mode: 'custom' | 'clusters' | 'threads';
|
mode: 'custom' | 'clusters' | 'threads';
|
||||||
workerId: number;
|
workerId: number;
|
||||||
debug: boolean;
|
debug: boolean;
|
||||||
|
@ -6,6 +6,7 @@ export interface WorkerShardInfo {
|
|||||||
shardId: number;
|
shardId: number;
|
||||||
latency: number;
|
latency: number;
|
||||||
resumable: boolean;
|
resumable: boolean;
|
||||||
|
workerId: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type WorkerInfo = { shards: WorkerShardInfo[] };
|
export type WorkerInfo = { shards: WorkerShardInfo[] };
|
||||||
@ -75,8 +76,8 @@ export type WorkerSendEvalResponse = CreateWorkerMessage<
|
|||||||
}
|
}
|
||||||
>;
|
>;
|
||||||
|
|
||||||
export type WorkerSendEval = CreateWorkerMessage<
|
export type WorkerSendToWorkerEval = CreateWorkerMessage<
|
||||||
'EVAL',
|
'EVAL_TO_WORKER',
|
||||||
{
|
{
|
||||||
func: string;
|
func: string;
|
||||||
nonce: string;
|
nonce: string;
|
||||||
@ -95,7 +96,7 @@ export type WorkerMessage =
|
|||||||
| WorkerShardsConnected
|
| WorkerShardsConnected
|
||||||
| WorkerSendApiRequest
|
| WorkerSendApiRequest
|
||||||
| WorkerSendEvalResponse
|
| WorkerSendEvalResponse
|
||||||
| WorkerSendEval
|
| WorkerSendToWorkerEval
|
||||||
| WorkerStart
|
| WorkerStart
|
||||||
| WorkerStartResharding
|
| WorkerStartResharding
|
||||||
| WorkerRequestConnectResharding
|
| WorkerRequestConnectResharding
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import cluster, { type Worker as ClusterWorker } from 'node:cluster';
|
import cluster, { type Worker as ClusterWorker } from 'node:cluster';
|
||||||
import { type UUID, randomUUID } from 'node:crypto';
|
import { type UUID, randomUUID } from 'node:crypto';
|
||||||
import { ApiHandler, Logger } from '../..';
|
import type { Worker as WorkerThreadsWorker } from 'node:worker_threads';
|
||||||
|
import { ApiHandler, Logger, type UsingClient, type WorkerClient } from '../..';
|
||||||
import { type Adapter, MemoryAdapter } from '../../cache';
|
import { type Adapter, MemoryAdapter } from '../../cache';
|
||||||
import { BaseClient, type InternalRuntimeConfig } from '../../client/base';
|
import { BaseClient, type InternalRuntimeConfig } from '../../client/base';
|
||||||
import { type MakePartial, MergeOptions, lazyLoadPackage } from '../../common';
|
import { type MakePartial, MergeOptions, lazyLoadPackage } from '../../common';
|
||||||
@ -13,7 +14,7 @@ import type { WorkerInfo, WorkerMessage, WorkerShardInfo } from './worker';
|
|||||||
|
|
||||||
export class WorkerManager extends Map<
|
export class WorkerManager extends Map<
|
||||||
number,
|
number,
|
||||||
(ClusterWorker | import('node:worker_threads').Worker | { ready?: boolean }) & {
|
(ClusterWorker | WorkerThreadsWorker | { ready?: boolean }) & {
|
||||||
ready?: boolean;
|
ready?: boolean;
|
||||||
disconnected?: boolean;
|
disconnected?: boolean;
|
||||||
resharded?: boolean;
|
resharded?: boolean;
|
||||||
@ -148,7 +149,7 @@ export class WorkerManager extends Map<
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async prepareWorkers(shards: number[][], resharding = false) {
|
prepareWorkers(shards: number[][], resharding = false) {
|
||||||
const worker_threads = lazyLoadPackage<typeof import('node:worker_threads')>('node:worker_threads');
|
const worker_threads = lazyLoadPackage<typeof import('node:worker_threads')>('node:worker_threads');
|
||||||
if (!worker_threads) throw new Error('Cannot prepare workers without worker_threads.');
|
if (!worker_threads) throw new Error('Cannot prepare workers without worker_threads.');
|
||||||
|
|
||||||
@ -167,6 +168,7 @@ export class WorkerManager extends Map<
|
|||||||
totalShards: resharding ? this._info!.shards : this.totalShards,
|
totalShards: resharding ? this._info!.shards : this.totalShards,
|
||||||
mode: this.options.mode,
|
mode: this.options.mode,
|
||||||
resharding,
|
resharding,
|
||||||
|
totalWorkers: shards.length,
|
||||||
});
|
});
|
||||||
this.set(i, worker);
|
this.set(i, worker);
|
||||||
});
|
});
|
||||||
@ -405,25 +407,25 @@ export class WorkerManager extends Map<
|
|||||||
break;
|
break;
|
||||||
case 'EVAL_RESPONSE':
|
case 'EVAL_RESPONSE':
|
||||||
{
|
{
|
||||||
const { nonce, type, ...data } = message;
|
const { nonce, response } = message;
|
||||||
const evalResponse = this.promises.get(nonce);
|
const evalResponse = this.promises.get(nonce);
|
||||||
if (!evalResponse) {
|
if (!evalResponse) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.promises.delete(nonce);
|
this.promises.delete(nonce);
|
||||||
clearTimeout(evalResponse.timeout);
|
clearTimeout(evalResponse.timeout);
|
||||||
evalResponse.resolve(data.response);
|
evalResponse.resolve(response);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'EVAL':
|
case 'EVAL_TO_WORKER':
|
||||||
{
|
{
|
||||||
const nonce = this.generateNonce();
|
const nonce = this.generateNonce();
|
||||||
this.postMessage(message.toWorkerId, {
|
this.postMessage(message.toWorkerId, {
|
||||||
nonce,
|
nonce,
|
||||||
func: message.func,
|
func: message.func,
|
||||||
type: 'EXECUTE_EVAL',
|
type: 'EXECUTE_EVAL_TO_WORKER',
|
||||||
toWorkerId: message.toWorkerId,
|
toWorkerId: message.toWorkerId,
|
||||||
} satisfies ManagerExecuteEval);
|
} satisfies ManagerExecuteEvalToWorker);
|
||||||
this.generateSendPromise(nonce, 'Eval timeout').then(val =>
|
this.generateSendPromise(nonce, 'Eval timeout').then(val =>
|
||||||
this.postMessage(message.workerId, {
|
this.postMessage(message.workerId, {
|
||||||
nonce: message.nonce,
|
nonce: message.nonce,
|
||||||
@ -501,6 +503,24 @@ export class WorkerManager extends Map<
|
|||||||
return this.generateSendPromise<WorkerInfo>(nonce, 'Get worker info timeout');
|
return this.generateSendPromise<WorkerInfo>(nonce, 'Get worker info timeout');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tellWorker<R>(workerId: number, func: (_: WorkerClient & UsingClient) => R) {
|
||||||
|
const nonce = this.generateNonce();
|
||||||
|
this.postMessage(workerId, {
|
||||||
|
type: 'EXECUTE_EVAL',
|
||||||
|
func: func.toString(),
|
||||||
|
nonce,
|
||||||
|
} satisfies ManagerExecuteEval);
|
||||||
|
return this.generateSendPromise<R>(nonce);
|
||||||
|
}
|
||||||
|
|
||||||
|
tellWorkers<R>(func: (_: WorkerClient & UsingClient) => R) {
|
||||||
|
const promises: Promise<R>[] = [];
|
||||||
|
for (const i of this.keys()) {
|
||||||
|
promises.push(this.tellWorker(i, func));
|
||||||
|
}
|
||||||
|
return Promise.all(promises);
|
||||||
|
}
|
||||||
|
|
||||||
async start() {
|
async start() {
|
||||||
const rc = await BaseClient.prototype.getRC<InternalRuntimeConfig>();
|
const rc = await BaseClient.prototype.getRC<InternalRuntimeConfig>();
|
||||||
|
|
||||||
@ -620,14 +640,23 @@ export type ManagerSendApiResponse = CreateManagerMessage<
|
|||||||
nonce: string;
|
nonce: string;
|
||||||
}
|
}
|
||||||
>;
|
>;
|
||||||
export type ManagerExecuteEval = CreateManagerMessage<
|
export type ManagerExecuteEvalToWorker = CreateManagerMessage<
|
||||||
'EXECUTE_EVAL',
|
'EXECUTE_EVAL_TO_WORKER',
|
||||||
{
|
{
|
||||||
func: string;
|
func: string;
|
||||||
nonce: string;
|
nonce: string;
|
||||||
toWorkerId: number;
|
toWorkerId: number;
|
||||||
}
|
}
|
||||||
>;
|
>;
|
||||||
|
|
||||||
|
export type ManagerExecuteEval = CreateManagerMessage<
|
||||||
|
'EXECUTE_EVAL',
|
||||||
|
{
|
||||||
|
func: string;
|
||||||
|
nonce: string;
|
||||||
|
}
|
||||||
|
>;
|
||||||
|
|
||||||
export type ManagerSendEvalResponse = CreateManagerMessage<
|
export type ManagerSendEvalResponse = CreateManagerMessage<
|
||||||
'EVAL_RESPONSE',
|
'EVAL_RESPONSE',
|
||||||
{
|
{
|
||||||
@ -646,9 +675,10 @@ export type ManagerMessages =
|
|||||||
| ManagerSendBotReady
|
| ManagerSendBotReady
|
||||||
| ManagerSendApiResponse
|
| ManagerSendApiResponse
|
||||||
| ManagerSendEvalResponse
|
| ManagerSendEvalResponse
|
||||||
| ManagerExecuteEval
|
| ManagerExecuteEvalToWorker
|
||||||
| ManagerWorkerAlreadyExistsResharding
|
| ManagerWorkerAlreadyExistsResharding
|
||||||
| ManagerSpawnShardsResharding
|
| ManagerSpawnShardsResharding
|
||||||
| ManagerAllowConnectResharding
|
| ManagerAllowConnectResharding
|
||||||
| DisconnectAllShardsResharding
|
| DisconnectAllShardsResharding
|
||||||
| ConnnectAllShardsResharding;
|
| ConnnectAllShardsResharding
|
||||||
|
| ManagerExecuteEval;
|
||||||
|
@ -1,9 +1,8 @@
|
|||||||
// @ts-check
|
import { defineConfig } from 'vitest/config';
|
||||||
import { defineConfig } from 'vitest/config'
|
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
test: {
|
test: {
|
||||||
fileParallelism: false,
|
fileParallelism: false,
|
||||||
isolate: false,
|
isolate: false,
|
||||||
},
|
},
|
||||||
})
|
});
|
||||||
|
@ -23,6 +23,10 @@
|
|||||||
"noErrorTruncation": true,
|
"noErrorTruncation": true,
|
||||||
"outDir": "./lib",
|
"outDir": "./lib",
|
||||||
"stripInternal": true,
|
"stripInternal": true,
|
||||||
|
"strictBindCallApply": true,
|
||||||
|
"strictBuiltinIteratorReturn": true,
|
||||||
|
"strictPropertyInitialization": true,
|
||||||
|
"alwaysStrict": true,
|
||||||
},
|
},
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"**/lib",
|
"**/lib",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user