llonebot-dist 7.12.15 → 8.0.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.
Files changed (81) hide show
  1. package/default_config.json +85 -85
  2. package/llbot.js +47864 -41080
  3. package/llbot.js.map +1 -1
  4. package/node_modules/ws/lib/receiver.js +54 -0
  5. package/node_modules/ws/lib/sender.js +6 -1
  6. package/node_modules/ws/lib/websocket-server.js +8 -0
  7. package/node_modules/ws/lib/websocket.js +14 -0
  8. package/node_modules/ws/package.json +1 -1
  9. package/package.json +1 -1
  10. package/sign-proxy.linux-arm64.node +0 -0
  11. package/sign-proxy.linux-x64.node +0 -0
  12. package/sign-proxy.package.json +7 -0
  13. package/sign-proxy.win-x64.node +0 -0
  14. package/webui/assets/index-DW9CNxRt.js +34 -0
  15. package/webui/assets/index-Dr4PXp_0.css +2 -0
  16. package/webui/index.html +13 -13
  17. package/webui/logo.jpg +0 -0
  18. package//344/275/277/347/224/250/350/257/264/346/230/216.txt +6 -6
  19. package//346/233/264/346/226/260/346/227/245/345/277/227.txt +892 -898
  20. package/node_modules/cosmokit/LICENSE +0 -21
  21. package/node_modules/cosmokit/README.md +0 -24
  22. package/node_modules/cosmokit/lib/index.cjs +0 -419
  23. package/node_modules/cosmokit/lib/index.cjs.map +0 -6
  24. package/node_modules/cosmokit/lib/index.d.ts +0 -142
  25. package/node_modules/cosmokit/lib/index.mjs +0 -357
  26. package/node_modules/cosmokit/lib/index.mjs.map +0 -6
  27. package/node_modules/cosmokit/package.json +0 -57
  28. package/node_modules/cosmokit/src/array.ts +0 -35
  29. package/node_modules/cosmokit/src/index.ts +0 -5
  30. package/node_modules/cosmokit/src/misc.ts +0 -57
  31. package/node_modules/cosmokit/src/string.ts +0 -101
  32. package/node_modules/cosmokit/src/time.ts +0 -91
  33. package/node_modules/cosmokit/src/types.ts +0 -131
  34. package/node_modules/object-inspect/CHANGELOG.md +0 -424
  35. package/node_modules/object-inspect/LICENSE +0 -21
  36. package/node_modules/object-inspect/example/all.js +0 -23
  37. package/node_modules/object-inspect/example/circular.js +0 -6
  38. package/node_modules/object-inspect/example/fn.js +0 -5
  39. package/node_modules/object-inspect/example/inspect.js +0 -10
  40. package/node_modules/object-inspect/index.js +0 -544
  41. package/node_modules/object-inspect/package-support.json +0 -20
  42. package/node_modules/object-inspect/package.json +0 -105
  43. package/node_modules/object-inspect/readme.markdown +0 -84
  44. package/node_modules/object-inspect/test/bigint.js +0 -58
  45. package/node_modules/object-inspect/test/browser/dom.js +0 -15
  46. package/node_modules/object-inspect/test/circular.js +0 -16
  47. package/node_modules/object-inspect/test/deep.js +0 -12
  48. package/node_modules/object-inspect/test/element.js +0 -53
  49. package/node_modules/object-inspect/test/err.js +0 -48
  50. package/node_modules/object-inspect/test/fakes.js +0 -29
  51. package/node_modules/object-inspect/test/fn.js +0 -76
  52. package/node_modules/object-inspect/test/global.js +0 -17
  53. package/node_modules/object-inspect/test/has.js +0 -15
  54. package/node_modules/object-inspect/test/holes.js +0 -15
  55. package/node_modules/object-inspect/test/indent-option.js +0 -271
  56. package/node_modules/object-inspect/test/inspect.js +0 -139
  57. package/node_modules/object-inspect/test/lowbyte.js +0 -12
  58. package/node_modules/object-inspect/test/number.js +0 -58
  59. package/node_modules/object-inspect/test/quoteStyle.js +0 -26
  60. package/node_modules/object-inspect/test/toStringTag.js +0 -40
  61. package/node_modules/object-inspect/test/undef.js +0 -12
  62. package/node_modules/object-inspect/test/values.js +0 -261
  63. package/node_modules/object-inspect/test-core-js.js +0 -26
  64. package/node_modules/object-inspect/util.inspect.js +0 -1
  65. package/node_modules/reggol/LICENSE +0 -21
  66. package/node_modules/reggol/README.md +0 -8
  67. package/node_modules/reggol/lib/browser.d.ts +0 -1
  68. package/node_modules/reggol/lib/browser.js +0 -255
  69. package/node_modules/reggol/lib/node.d.ts +0 -1
  70. package/node_modules/reggol/lib/node.js +0 -255
  71. package/node_modules/reggol/lib/shared.d.ts +0 -78
  72. package/node_modules/reggol/package.json +0 -61
  73. package/node_modules/supports-color/browser.d.ts +0 -1
  74. package/node_modules/supports-color/browser.js +0 -35
  75. package/node_modules/supports-color/index.d.ts +0 -55
  76. package/node_modules/supports-color/index.js +0 -202
  77. package/node_modules/supports-color/license +0 -9
  78. package/node_modules/supports-color/package.json +0 -64
  79. package/node_modules/supports-color/readme.md +0 -75
  80. package/webui/assets/index-CM5wLm3n.css +0 -2
  81. package/webui/assets/index-QGFL6Imu.js +0 -34
@@ -1,91 +0,0 @@
1
- export namespace Time {
2
- export const millisecond = 1
3
- export const second = 1000
4
- export const minute = second * 60
5
- export const hour = minute * 60
6
- export const day = hour * 24
7
- export const week = day * 7
8
-
9
- let timezoneOffset = new Date().getTimezoneOffset()
10
-
11
- export function setTimezoneOffset(offset: number) {
12
- timezoneOffset = offset
13
- }
14
-
15
- export function getTimezoneOffset() {
16
- return timezoneOffset
17
- }
18
-
19
- export function getDateNumber(date: number | Date = new Date(), offset?: number) {
20
- if (typeof date === 'number') date = new Date(date)
21
- if (offset === undefined) offset = timezoneOffset
22
- return Math.floor((date.valueOf() / minute - offset) / 1440)
23
- }
24
-
25
- export function fromDateNumber(value: number, offset?: number) {
26
- const date = new Date(value * day)
27
- if (offset === undefined) offset = timezoneOffset
28
- return new Date(+date + offset * minute)
29
- }
30
-
31
- const numeric = /\d+(?:\.\d+)?/.source
32
- const timeRegExp = new RegExp(`^${[
33
- 'w(?:eek(?:s)?)?',
34
- 'd(?:ay(?:s)?)?',
35
- 'h(?:our(?:s)?)?',
36
- 'm(?:in(?:ute)?(?:s)?)?',
37
- 's(?:ec(?:ond)?(?:s)?)?',
38
- ].map(unit => `(${numeric}${unit})?`).join('')}$`)
39
-
40
- export function parseTime(source: string) {
41
- const capture = timeRegExp.exec(source)
42
- if (!capture) return 0
43
- return (parseFloat(capture[1]) * week || 0)
44
- + (parseFloat(capture[2]) * day || 0)
45
- + (parseFloat(capture[3]) * hour || 0)
46
- + (parseFloat(capture[4]) * minute || 0)
47
- + (parseFloat(capture[5]) * second || 0)
48
- }
49
-
50
- export function parseDate(date: string) {
51
- const parsed = parseTime(date)
52
- if (parsed) {
53
- date = Date.now() + parsed as any
54
- } else if (/^\d{1,2}(:\d{1,2}){1,2}$/.test(date)) {
55
- date = `${new Date().toLocaleDateString()}-${date}`
56
- } else if (/^\d{1,2}-\d{1,2}-\d{1,2}(:\d{1,2}){1,2}$/.test(date)) {
57
- date = `${new Date().getFullYear()}-${date}`
58
- }
59
- return date ? new Date(date) : new Date()
60
- }
61
-
62
- export function format(ms: number) {
63
- const abs = Math.abs(ms)
64
- if (abs >= day - hour / 2) {
65
- return Math.round(ms / day) + 'd'
66
- } else if (abs >= hour - minute / 2) {
67
- return Math.round(ms / hour) + 'h'
68
- } else if (abs >= minute - second / 2) {
69
- return Math.round(ms / minute) + 'm'
70
- } else if (abs >= second) {
71
- return Math.round(ms / second) + 's'
72
- }
73
- return ms + 'ms'
74
- }
75
-
76
- export function toDigits(source: number, length = 2) {
77
- return source.toString().padStart(length, '0')
78
- }
79
-
80
- export function template(template: string, time = new Date()) {
81
- return template
82
- .replace('yyyy', time.getFullYear().toString())
83
- .replace('yy', time.getFullYear().toString().slice(2))
84
- .replace('MM', toDigits(time.getMonth() + 1))
85
- .replace('dd', toDigits(time.getDate()))
86
- .replace('hh', toDigits(time.getHours()))
87
- .replace('mm', toDigits(time.getMinutes()))
88
- .replace('ss', toDigits(time.getSeconds()))
89
- .replace('SSS', toDigits(time.getMilliseconds(), 3))
90
- }
91
- }
@@ -1,131 +0,0 @@
1
- import { isNullable } from './misc'
2
-
3
- type GlobalConstructorNames = keyof {
4
- [K in keyof typeof globalThis as typeof globalThis[K] extends abstract new (...args: any) => any ? K : never]: K
5
- }
6
-
7
- export function is<K extends GlobalConstructorNames>(type: K): (value: any) => value is InstanceType<typeof globalThis[K]>
8
- export function is<K extends GlobalConstructorNames>(type: K, value: any): value is InstanceType<typeof globalThis[K]>
9
- export function is<K extends GlobalConstructorNames>(type: K, value?: any): any {
10
- if (arguments.length === 1) return (value: any) => is(type, value)
11
- return type in globalThis && value instanceof (globalThis[type] as any)
12
- || Object.prototype.toString.call(value).slice(8, -1) === type
13
- }
14
-
15
- function isArrayBufferLike(value: any): value is ArrayBufferLike {
16
- return is('ArrayBuffer', value) || is('SharedArrayBuffer', value)
17
- }
18
-
19
- function isArrayBufferSource(value: any): value is Binary.Source {
20
- return isArrayBufferLike(value) || ArrayBuffer.isView(value)
21
- }
22
-
23
- export namespace Binary {
24
- export type Source<T extends ArrayBufferLike = ArrayBufferLike> = T | ArrayBufferView<T>
25
-
26
- export const is = isArrayBufferLike
27
- export const isSource = isArrayBufferSource
28
-
29
- export function fromSource<T extends ArrayBufferLike>(source: Source<T>): T {
30
- if (ArrayBuffer.isView(source)) {
31
- // https://stackoverflow.com/questions/8609289/convert-a-binary-nodejs-buffer-to-javascript-arraybuffer#answer-31394257
32
- return source.buffer.slice(source.byteOffset, source.byteOffset + source.byteLength) as T
33
- } else {
34
- return source
35
- }
36
- }
37
-
38
- export function toBase64(source: Source) {
39
- source = fromSource(source)
40
- if (typeof Buffer !== 'undefined') {
41
- return Buffer.from(source).toString('base64')
42
- }
43
- let binary = ''
44
- const bytes = new Uint8Array(source)
45
- for (let i = 0; i < bytes.byteLength; i++) {
46
- binary += String.fromCharCode(bytes[i])
47
- }
48
- return btoa(binary)
49
- }
50
-
51
- export function fromBase64(source: string) {
52
- if (typeof Buffer !== 'undefined') return fromSource(Buffer.from(source, 'base64'))
53
- return Uint8Array.from(atob(source), c => c.charCodeAt(0))
54
- }
55
-
56
- export function toHex(source: Source) {
57
- source = fromSource(source)
58
- if (typeof Buffer !== 'undefined') return Buffer.from(source).toString('hex')
59
- return Array.from(new Uint8Array(source), byte => byte.toString(16).padStart(2, '0')).join('')
60
- }
61
-
62
- export function fromHex(source: string) {
63
- if (typeof Buffer !== 'undefined') return fromSource(Buffer.from(source, 'hex'))
64
- const hex = source.length % 2 === 0 ? source : source.slice(0, source.length - 1)
65
- const buffer: number[] = []
66
- for (let i = 0; i < hex.length; i += 2) {
67
- buffer.push(parseInt(`${hex[i]}${hex[i + 1]}`, 16))
68
- }
69
- return Uint8Array.from(buffer).buffer
70
- }
71
- }
72
-
73
- export const base64ToArrayBuffer = Binary.fromBase64
74
- export const arrayBufferToBase64 = Binary.toBase64
75
- export const hexToArrayBuffer = Binary.fromHex
76
- export const arrayBufferToHex = Binary.toHex
77
-
78
- export function clone<T>(source: T): T
79
- export function clone(source: any, refs = new Map<any, any>()) {
80
- if (!source || typeof source !== 'object') return source
81
- if (is('Date', source)) return new Date(source.valueOf())
82
- if (is('RegExp', source)) return new RegExp(source.source, source.flags)
83
- if (isArrayBufferLike(source)) return source.slice(0)
84
- if (ArrayBuffer.isView(source)) return source.buffer.slice(source.byteOffset, source.byteOffset + source.byteLength)
85
- const cached = refs.get(source)
86
- if (cached) return cached
87
- if (Array.isArray(source)) {
88
- const result: any[] = []
89
- refs.set(source, result)
90
- source.forEach((value, index) => {
91
- result[index] = Reflect.apply(clone, null, [value, refs])
92
- })
93
- return result
94
- }
95
- const result = Object.create(Object.getPrototypeOf(source))
96
- refs.set(source, result)
97
- for (const key of Reflect.ownKeys(source)) {
98
- const descriptor = { ...Reflect.getOwnPropertyDescriptor(source, key) }
99
- if ('value' in descriptor) {
100
- descriptor.value = Reflect.apply(clone, null, [descriptor.value, refs])
101
- }
102
- Reflect.defineProperty(result, key, descriptor)
103
- }
104
- return result
105
- }
106
-
107
- export function deepEqual(a: any, b: any, strict?: boolean): boolean {
108
- if (a === b) return true
109
- if (!strict && isNullable(a) && isNullable(b)) return true
110
- if (typeof a !== typeof b) return false
111
- if (typeof a !== 'object') return false
112
- if (!a || !b) return false
113
-
114
- function check<T>(test: (x: any) => x is T, then: (a: T, b: T) => boolean) {
115
- return test(a) ? test(b) ? then(a, b) : false : test(b) ? false : undefined
116
- }
117
-
118
- return check(Array.isArray, (a, b) => a.length === b.length && a.every((item, index) => deepEqual(item, b[index])))
119
- ?? check(is('Date'), (a, b) => a.valueOf() === b.valueOf())
120
- ?? check(is('RegExp'), (a, b) => a.source === b.source && a.flags === b.flags)
121
- ?? check(isArrayBufferLike, (a, b) => {
122
- if (a.byteLength !== b.byteLength) return false
123
- const viewA = new Uint8Array(a)
124
- const viewB = new Uint8Array(b)
125
- for (let i = 0; i < viewA.length; i++) {
126
- if (viewA[i] !== viewB[i]) return false
127
- }
128
- return true
129
- })
130
- ?? Object.keys({ ...a, ...b }).every(key => deepEqual(a[key], b[key], strict))
131
- }