@maiyunnet/kebab 9.11.1 → 9.11.3
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/doc/kebab-rag.md +34 -34
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/lib/core.js +17 -10
- package/lib/undici/response.d.ts +1 -1
- package/lib/vector.d.ts +1 -1
- package/package.json +1 -1
- package/www/example/ctr/test.js +9 -6
package/doc/kebab-rag.md
CHANGED
|
@@ -1360,7 +1360,7 @@ index/variables/VER.md
|
|
|
1360
1360
|
|
|
1361
1361
|
# Variable: VER
|
|
1362
1362
|
|
|
1363
|
-
> `const` **VER**: `"9.11.
|
|
1363
|
+
> `const` **VER**: `"9.11.3"` = `'9.11.3'`
|
|
1364
1364
|
|
|
1365
1365
|
Defined in: [index.ts:10](https://github.com/maiyunnet/kebab/blob/master/index.ts#L10)
|
|
1366
1366
|
|
|
@@ -3320,7 +3320,7 @@ lib/core/functions/clone.md
|
|
|
3320
3320
|
|
|
3321
3321
|
> **clone**\<`T`\>(`obj`): `T`
|
|
3322
3322
|
|
|
3323
|
-
Defined in: [lib/core.ts:
|
|
3323
|
+
Defined in: [lib/core.ts:1171](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1171)
|
|
3324
3324
|
|
|
3325
3325
|
完整的克隆一份数组/对象
|
|
3326
3326
|
|
|
@@ -3384,7 +3384,7 @@ lib/core/functions/debug.md
|
|
|
3384
3384
|
|
|
3385
3385
|
> **debug**(`message?`, ...`optionalParams`): `void`
|
|
3386
3386
|
|
|
3387
|
-
Defined in: [lib/core.ts:
|
|
3387
|
+
Defined in: [lib/core.ts:1205](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1205)
|
|
3388
3388
|
|
|
3389
3389
|
打印调试信息,线上环境不会打印
|
|
3390
3390
|
|
|
@@ -3419,7 +3419,7 @@ lib/core/functions/display.md
|
|
|
3419
3419
|
|
|
3420
3420
|
> **display**(`message?`, ...`optionalParams`): `void`
|
|
3421
3421
|
|
|
3422
|
-
Defined in: [lib/core.ts:
|
|
3422
|
+
Defined in: [lib/core.ts:1218](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1218)
|
|
3423
3423
|
|
|
3424
3424
|
向控制台直接显示内容,一般情况下禁止使用
|
|
3425
3425
|
|
|
@@ -3524,7 +3524,7 @@ lib/core/functions/getLog.md
|
|
|
3524
3524
|
|
|
3525
3525
|
> **getLog**(`opt`): `Promise`\<`false` \| \{ `list`: `any`[] \| `string`[][]; `total`: `number`; \}\>
|
|
3526
3526
|
|
|
3527
|
-
Defined in: [lib/core.ts:
|
|
3527
|
+
Defined in: [lib/core.ts:1083](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1083)
|
|
3528
3528
|
|
|
3529
3529
|
获取日志内容为一个数组
|
|
3530
3530
|
|
|
@@ -3659,7 +3659,7 @@ lib/core/functions/loadEnv.md
|
|
|
3659
3659
|
|
|
3660
3660
|
> **loadEnv**(`dir`): `Promise`\<`void`\>
|
|
3661
3661
|
|
|
3662
|
-
Defined in: [lib/core.ts:
|
|
3662
|
+
Defined in: [lib/core.ts:1270](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1270)
|
|
3663
3663
|
|
|
3664
3664
|
加载 .env 文件到 process.env,若文件不存在则跳过
|
|
3665
3665
|
|
|
@@ -3688,7 +3688,7 @@ lib/core/functions/log.md
|
|
|
3688
3688
|
|
|
3689
3689
|
> **log**(`opt`, `msg`, `fend?`): `void`
|
|
3690
3690
|
|
|
3691
|
-
Defined in: [lib/core.ts:
|
|
3691
|
+
Defined in: [lib/core.ts:970](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L970)
|
|
3692
3692
|
|
|
3693
3693
|
写入文件日志
|
|
3694
3694
|
|
|
@@ -3729,7 +3729,7 @@ lib/core/functions/ls.md
|
|
|
3729
3729
|
|
|
3730
3730
|
> **ls**(`opt`): `Promise`\<`object`[]\>
|
|
3731
3731
|
|
|
3732
|
-
Defined in: [lib/core.ts:
|
|
3732
|
+
Defined in: [lib/core.ts:1132](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1132)
|
|
3733
3733
|
|
|
3734
3734
|
获取目录内文件/文件夹列表
|
|
3735
3735
|
|
|
@@ -4055,7 +4055,7 @@ lib/core/functions/removeGlobal.md
|
|
|
4055
4055
|
|
|
4056
4056
|
> **removeGlobal**(`key`, `hosts?`): `Promise`\<`Record`\<`string`, \{ `result`: `boolean`; `return`: `string`; \}\>\>
|
|
4057
4057
|
|
|
4058
|
-
Defined in: [lib/core.ts:
|
|
4058
|
+
Defined in: [lib/core.ts:787](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L787)
|
|
4059
4059
|
|
|
4060
4060
|
移除某个跨线程/跨内网服务器全局变量
|
|
4061
4061
|
|
|
@@ -4090,7 +4090,7 @@ lib/core/functions/resolveEnvVars.md
|
|
|
4090
4090
|
|
|
4091
4091
|
> **resolveEnvVars**(`obj`): `void`
|
|
4092
4092
|
|
|
4093
|
-
Defined in: [lib/core.ts:
|
|
4093
|
+
Defined in: [lib/core.ts:1300](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1300)
|
|
4094
4094
|
|
|
4095
4095
|
将配置对象中的 ${ENV_VAR} 占位符替换为 process.env 的值
|
|
4096
4096
|
|
|
@@ -4119,7 +4119,7 @@ lib/core/functions/sendNpm.md
|
|
|
4119
4119
|
|
|
4120
4120
|
> **sendNpm**(`path`, `hosts?`): `Promise`\<`Record`\<`string`, \{ `result`: `boolean`; `return`: `string`; \}\>\>
|
|
4121
4121
|
|
|
4122
|
-
Defined in: [lib/core.ts:
|
|
4122
|
+
Defined in: [lib/core.ts:686](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L686)
|
|
4123
4123
|
|
|
4124
4124
|
向本机或局域网 RPC 发送 npm install 操作
|
|
4125
4125
|
|
|
@@ -4154,7 +4154,7 @@ lib/core/functions/sendPackage.md
|
|
|
4154
4154
|
|
|
4155
4155
|
> **sendPackage**(`content`, `hosts?`): `Promise`\<`Record`\<`string`, \{ `result`: `boolean`; `return`: `string`; \}\>\>
|
|
4156
4156
|
|
|
4157
|
-
Defined in: [lib/core.ts:
|
|
4157
|
+
Defined in: [lib/core.ts:910](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L910)
|
|
4158
4158
|
|
|
4159
4159
|
向本机或局域网 RPC 发送 package.json 更新操作
|
|
4160
4160
|
|
|
@@ -4189,7 +4189,7 @@ lib/core/functions/sendPm2.md
|
|
|
4189
4189
|
|
|
4190
4190
|
> **sendPm2**(`name`, `action?`, `hosts?`): `Promise`\<`Record`\<`string`, \{ `result`: `boolean`; `return`: `string`; \}\>\>
|
|
4191
4191
|
|
|
4192
|
-
Defined in: [lib/core.ts:
|
|
4192
|
+
Defined in: [lib/core.ts:638](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L638)
|
|
4193
4193
|
|
|
4194
4194
|
向本机或局域网 RPC 发送 PM2 操作
|
|
4195
4195
|
|
|
@@ -4230,7 +4230,7 @@ lib/core/functions/sendProject.md
|
|
|
4230
4230
|
|
|
4231
4231
|
> **sendProject**(`path`, `key`, `value`, `hosts?`): `Promise`\<`Record`\<`string`, \{ `result`: `boolean`; `return`: `string`; \}\>\>
|
|
4232
4232
|
|
|
4233
|
-
Defined in: [lib/core.ts:
|
|
4233
|
+
Defined in: [lib/core.ts:862](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L862)
|
|
4234
4234
|
|
|
4235
4235
|
向本机或局域网 RPC 发送项目配置更新操作
|
|
4236
4236
|
|
|
@@ -4305,7 +4305,7 @@ lib/core/functions/sendRestart.md
|
|
|
4305
4305
|
|
|
4306
4306
|
> **sendRestart**(`hosts?`): `Promise`\<`Record`\<`string`, \{ `result`: `boolean`; `return`: `string`; \}\>\>
|
|
4307
4307
|
|
|
4308
|
-
Defined in: [lib/core.ts:
|
|
4308
|
+
Defined in: [lib/core.ts:584](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L584)
|
|
4309
4309
|
|
|
4310
4310
|
向主进程(或局域网同代码机子)发送广播将进行 restart 操作,停止监听并启动新进程,老进程在连接全部断开后自行销毁
|
|
4311
4311
|
主要用作不间断的代码热更新
|
|
@@ -4380,7 +4380,7 @@ lib/core/functions/setGlobal.md
|
|
|
4380
4380
|
|
|
4381
4381
|
> **setGlobal**(`key`, `data`, `hosts?`): `Promise`\<`Record`\<`string`, \{ `result`: `boolean`; `return`: `string`; \}\>\>
|
|
4382
4382
|
|
|
4383
|
-
Defined in: [lib/core.ts:
|
|
4383
|
+
Defined in: [lib/core.ts:737](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L737)
|
|
4384
4384
|
|
|
4385
4385
|
设置跨线程/指定的局域网主机的全局变量
|
|
4386
4386
|
|
|
@@ -4479,7 +4479,7 @@ lib/core/functions/updateCode.md
|
|
|
4479
4479
|
|
|
4480
4480
|
> **updateCode**(`sourcePath`, `path`, `hosts?`, `config?`, `strict?`): `Promise`\<`Record`\<`string`, \{ `result`: `boolean`; `return`: `string`; \}\>\>
|
|
4481
4481
|
|
|
4482
|
-
Defined in: [lib/core.ts:
|
|
4482
|
+
Defined in: [lib/core.ts:802](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L802)
|
|
4483
4483
|
|
|
4484
4484
|
上传并覆盖代码文件,config.json、kebab.json、.js.map、.ts, .gitignore 不会被覆盖和新创建
|
|
4485
4485
|
|
|
@@ -4532,7 +4532,7 @@ lib/core/functions/writeEventStreamHead.md
|
|
|
4532
4532
|
|
|
4533
4533
|
> **writeEventStreamHead**(`res`): `void`
|
|
4534
4534
|
|
|
4535
|
-
Defined in: [lib/core.ts:
|
|
4535
|
+
Defined in: [lib/core.ts:1240](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1240)
|
|
4536
4536
|
|
|
4537
4537
|
## Parameters
|
|
4538
4538
|
|
|
@@ -4557,7 +4557,7 @@ lib/core/functions/writeHead.md
|
|
|
4557
4557
|
|
|
4558
4558
|
> **writeHead**(`res`, `statusCode`, `headers?`): `void`
|
|
4559
4559
|
|
|
4560
|
-
Defined in: [lib/core.ts:
|
|
4560
|
+
Defined in: [lib/core.ts:1229](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1229)
|
|
4561
4561
|
|
|
4562
4562
|
让 res 发送头部(前提是头部没有被发送才能调用本方法
|
|
4563
4563
|
|
|
@@ -4598,7 +4598,7 @@ lib/core/functions/write.md
|
|
|
4598
4598
|
|
|
4599
4599
|
> **write**(`res`, `data`): `void`
|
|
4600
4600
|
|
|
4601
|
-
Defined in: [lib/core.ts:
|
|
4601
|
+
Defined in: [lib/core.ts:1252](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1252)
|
|
4602
4602
|
|
|
4603
4603
|
向 res 发送数据
|
|
4604
4604
|
|
|
@@ -4770,7 +4770,7 @@ lib/core/interfaces/ILogOptions.md
|
|
|
4770
4770
|
|
|
4771
4771
|
# Interface: ILogOptions
|
|
4772
4772
|
|
|
4773
|
-
Defined in: [lib/core.ts:
|
|
4773
|
+
Defined in: [lib/core.ts:953](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L953)
|
|
4774
4774
|
|
|
4775
4775
|
log 设置的选项
|
|
4776
4776
|
|
|
@@ -4780,7 +4780,7 @@ log 设置的选项
|
|
|
4780
4780
|
|
|
4781
4781
|
> `optional` **cookie?**: `Record`\<`string`, `string`\>
|
|
4782
4782
|
|
|
4783
|
-
Defined in: [lib/core.ts:
|
|
4783
|
+
Defined in: [lib/core.ts:959](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L959)
|
|
4784
4784
|
|
|
4785
4785
|
***
|
|
4786
4786
|
|
|
@@ -4788,7 +4788,7 @@ Defined in: [lib/core.ts:952](https://github.com/maiyunnet/kebab/blob/master/lib
|
|
|
4788
4788
|
|
|
4789
4789
|
> `optional` **get?**: `Record`\<`string`, `any`\>
|
|
4790
4790
|
|
|
4791
|
-
Defined in: [lib/core.ts:
|
|
4791
|
+
Defined in: [lib/core.ts:958](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L958)
|
|
4792
4792
|
|
|
4793
4793
|
***
|
|
4794
4794
|
|
|
@@ -4796,7 +4796,7 @@ Defined in: [lib/core.ts:951](https://github.com/maiyunnet/kebab/blob/master/lib
|
|
|
4796
4796
|
|
|
4797
4797
|
> `optional` **headers?**: `IncomingHttpHeaders`
|
|
4798
4798
|
|
|
4799
|
-
Defined in: [lib/core.ts:
|
|
4799
|
+
Defined in: [lib/core.ts:961](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L961)
|
|
4800
4800
|
|
|
4801
4801
|
***
|
|
4802
4802
|
|
|
@@ -4804,7 +4804,7 @@ Defined in: [lib/core.ts:954](https://github.com/maiyunnet/kebab/blob/master/lib
|
|
|
4804
4804
|
|
|
4805
4805
|
> `optional` **hostname?**: `string`
|
|
4806
4806
|
|
|
4807
|
-
Defined in: [lib/core.ts:
|
|
4807
|
+
Defined in: [lib/core.ts:956](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L956)
|
|
4808
4808
|
|
|
4809
4809
|
***
|
|
4810
4810
|
|
|
@@ -4812,7 +4812,7 @@ Defined in: [lib/core.ts:949](https://github.com/maiyunnet/kebab/blob/master/lib
|
|
|
4812
4812
|
|
|
4813
4813
|
> `optional` **path?**: `string`
|
|
4814
4814
|
|
|
4815
|
-
Defined in: [lib/core.ts:
|
|
4815
|
+
Defined in: [lib/core.ts:954](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L954)
|
|
4816
4816
|
|
|
4817
4817
|
***
|
|
4818
4818
|
|
|
@@ -4820,7 +4820,7 @@ Defined in: [lib/core.ts:947](https://github.com/maiyunnet/kebab/blob/master/lib
|
|
|
4820
4820
|
|
|
4821
4821
|
> `optional` **req?**: `IncomingMessage` \| `Http2ServerRequest` \| `null`
|
|
4822
4822
|
|
|
4823
|
-
Defined in: [lib/core.ts:
|
|
4823
|
+
Defined in: [lib/core.ts:957](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L957)
|
|
4824
4824
|
|
|
4825
4825
|
***
|
|
4826
4826
|
|
|
@@ -4828,7 +4828,7 @@ Defined in: [lib/core.ts:950](https://github.com/maiyunnet/kebab/blob/master/lib
|
|
|
4828
4828
|
|
|
4829
4829
|
> `optional` **session?**: `Record`\<`string`, `any`\>
|
|
4830
4830
|
|
|
4831
|
-
Defined in: [lib/core.ts:
|
|
4831
|
+
Defined in: [lib/core.ts:960](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L960)
|
|
4832
4832
|
|
|
4833
4833
|
***
|
|
4834
4834
|
|
|
@@ -4836,7 +4836,7 @@ Defined in: [lib/core.ts:953](https://github.com/maiyunnet/kebab/blob/master/lib
|
|
|
4836
4836
|
|
|
4837
4837
|
> `optional` **urlFull?**: `string`
|
|
4838
4838
|
|
|
4839
|
-
Defined in: [lib/core.ts:
|
|
4839
|
+
Defined in: [lib/core.ts:955](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L955)
|
|
4840
4840
|
|
|
4841
4841
|
lib/core/type-aliases/TPm2Action.md
|
|
4842
4842
|
---
|
|
@@ -4851,7 +4851,7 @@ lib/core/type-aliases/TPm2Action.md
|
|
|
4851
4851
|
|
|
4852
4852
|
> **TPm2Action** = `"start"` \| `"stop"` \| `"restart"`
|
|
4853
4853
|
|
|
4854
|
-
Defined in: [lib/core.ts:
|
|
4854
|
+
Defined in: [lib/core.ts:630](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L630)
|
|
4855
4855
|
|
|
4856
4856
|
PM2 操作类型
|
|
4857
4857
|
|
|
@@ -4925,7 +4925,7 @@ lib/core/variables/global.md
|
|
|
4925
4925
|
|
|
4926
4926
|
> `const` **global**: `Record`\<`string`, `any`\> = `{}`
|
|
4927
4927
|
|
|
4928
|
-
Defined in: [lib/core.ts:
|
|
4928
|
+
Defined in: [lib/core.ts:729](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L729)
|
|
4929
4929
|
|
|
4930
4930
|
跨进程全局变量
|
|
4931
4931
|
|
|
@@ -19475,7 +19475,7 @@ Defined in: [lib/vector.ts:30](https://github.com/maiyunnet/kebab/blob/master/li
|
|
|
19475
19475
|
|
|
19476
19476
|
> **delete**(`data`): `Promise`\<`false` \| \{ `deletedCount`: `number`; \}\>
|
|
19477
19477
|
|
|
19478
|
-
Defined in: [lib/vector.ts:
|
|
19478
|
+
Defined in: [lib/vector.ts:120](https://github.com/maiyunnet/kebab/blob/master/lib/vector.ts#L120)
|
|
19479
19479
|
|
|
19480
19480
|
删除数据
|
|
19481
19481
|
|
|
@@ -19505,7 +19505,7 @@ Defined in: [lib/vector.ts:116](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19505
19505
|
|
|
19506
19506
|
> **insert**(`data`): `Promise`\<`false` \| \{ `insertCount`: `number`; `insertIds`: (`string` \| `number`)[]; \}\>
|
|
19507
19507
|
|
|
19508
|
-
Defined in: [lib/vector.ts:
|
|
19508
|
+
Defined in: [lib/vector.ts:89](https://github.com/maiyunnet/kebab/blob/master/lib/vector.ts#L89)
|
|
19509
19509
|
|
|
19510
19510
|
插入数据
|
|
19511
19511
|
|
|
@@ -19596,7 +19596,7 @@ lib/vector/functions/get.md
|
|
|
19596
19596
|
|
|
19597
19597
|
> **get**(`ctrEtc`): [`Vector`](../classes/Vector.md)
|
|
19598
19598
|
|
|
19599
|
-
Defined in: [lib/vector.ts:
|
|
19599
|
+
Defined in: [lib/vector.ts:156](https://github.com/maiyunnet/kebab/blob/master/lib/vector.ts#L156)
|
|
19600
19600
|
|
|
19601
19601
|
创建一个 Vector 对象
|
|
19602
19602
|
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* --- 本文件用来定义每个目录实体地址的常量 ---
|
|
7
7
|
*/
|
|
8
8
|
/** --- 当前系统版本号 --- */
|
|
9
|
-
export const VER = '9.11.
|
|
9
|
+
export const VER = '9.11.3';
|
|
10
10
|
// --- 服务端用的路径 ---
|
|
11
11
|
const imu = decodeURIComponent(import.meta.url).replace('file://', '').replace(/^\/(\w:)/, '$1');
|
|
12
12
|
/** --- /xxx/xxx --- */
|
package/lib/core.js
CHANGED
|
@@ -480,10 +480,11 @@ export async function sendReload(hosts) {
|
|
|
480
480
|
'action': 'reload',
|
|
481
481
|
'time': time
|
|
482
482
|
}), globalConfig.rpcSecret), {
|
|
483
|
-
'timeout':
|
|
483
|
+
'timeout': 5
|
|
484
484
|
});
|
|
485
485
|
const content = await res.getContent();
|
|
486
486
|
if (!content) {
|
|
487
|
+
rtn[host] = { 'result': false, 'return': 'Timeout' };
|
|
487
488
|
continue;
|
|
488
489
|
}
|
|
489
490
|
const str = content.toString();
|
|
@@ -524,10 +525,11 @@ export async function sendRestart(hosts) {
|
|
|
524
525
|
'action': 'restart',
|
|
525
526
|
'time': time
|
|
526
527
|
}), globalConfig.rpcSecret), {
|
|
527
|
-
'timeout':
|
|
528
|
+
'timeout': 5
|
|
528
529
|
});
|
|
529
530
|
const content = await res.getContent();
|
|
530
531
|
if (!content) {
|
|
532
|
+
rtn[host] = { 'result': false, 'return': 'Timeout' };
|
|
531
533
|
continue;
|
|
532
534
|
}
|
|
533
535
|
const str = content.toString();
|
|
@@ -565,10 +567,11 @@ export async function sendPm2(name, action = 'restart', hosts) {
|
|
|
565
567
|
'name': name,
|
|
566
568
|
'pm2Action': action
|
|
567
569
|
}), globalConfig.rpcSecret), {
|
|
568
|
-
'timeout':
|
|
570
|
+
'timeout': 5
|
|
569
571
|
});
|
|
570
572
|
const content = await res.getContent();
|
|
571
573
|
if (!content) {
|
|
574
|
+
rtn[host] = { 'result': false, 'return': 'Timeout' };
|
|
572
575
|
continue;
|
|
573
576
|
}
|
|
574
577
|
const str = content.toString();
|
|
@@ -605,10 +608,11 @@ export async function sendNpm(path, hosts) {
|
|
|
605
608
|
'time': time,
|
|
606
609
|
'path': path
|
|
607
610
|
}), globalConfig.rpcSecret), {
|
|
608
|
-
'timeout':
|
|
611
|
+
'timeout': 30,
|
|
609
612
|
});
|
|
610
613
|
const content = await res.getContent();
|
|
611
614
|
if (!content) {
|
|
615
|
+
rtn[host] = { 'result': false, 'return': 'Timeout' };
|
|
612
616
|
continue;
|
|
613
617
|
}
|
|
614
618
|
const str = content.toString();
|
|
@@ -654,10 +658,11 @@ export async function setGlobal(key, data, hosts) {
|
|
|
654
658
|
'action': 'global',
|
|
655
659
|
'time': time
|
|
656
660
|
}), globalConfig.rpcSecret), {
|
|
657
|
-
'timeout':
|
|
661
|
+
'timeout': 5
|
|
658
662
|
});
|
|
659
663
|
const content = await res.getContent();
|
|
660
664
|
if (!content) {
|
|
665
|
+
rtn[host] = { 'result': false, 'return': 'Timeout' };
|
|
661
666
|
continue;
|
|
662
667
|
}
|
|
663
668
|
const str = content.toString();
|
|
@@ -711,7 +716,7 @@ export async function updateCode(sourcePath, path, hosts, config = true, strict
|
|
|
711
716
|
'action': 'code',
|
|
712
717
|
'time': lTime.stamp()
|
|
713
718
|
}), globalConfig.rpcSecret), fd, {
|
|
714
|
-
'timeout':
|
|
719
|
+
'timeout': 60,
|
|
715
720
|
});
|
|
716
721
|
const content = await res.getContent();
|
|
717
722
|
if (!content) {
|
|
@@ -755,10 +760,11 @@ export async function sendProject(path, key, value, hosts) {
|
|
|
755
760
|
'path': path,
|
|
756
761
|
[key]: value
|
|
757
762
|
}), globalConfig.rpcSecret), {
|
|
758
|
-
'timeout':
|
|
763
|
+
'timeout': 5
|
|
759
764
|
});
|
|
760
765
|
const content = await res.getContent();
|
|
761
766
|
if (!content) {
|
|
767
|
+
rtn[host] = { 'result': false, 'return': 'Timeout' };
|
|
762
768
|
continue;
|
|
763
769
|
}
|
|
764
770
|
const str = content.toString();
|
|
@@ -795,10 +801,11 @@ export async function sendPackage(content, hosts) {
|
|
|
795
801
|
'time': time,
|
|
796
802
|
'content': content
|
|
797
803
|
}), globalConfig.rpcSecret), {
|
|
798
|
-
'timeout':
|
|
804
|
+
'timeout': 5
|
|
799
805
|
});
|
|
800
806
|
const resContent = await res.getContent();
|
|
801
807
|
if (!resContent) {
|
|
808
|
+
rtn[host] = { 'result': false, 'return': 'Timeout' };
|
|
802
809
|
continue;
|
|
803
810
|
}
|
|
804
811
|
const str = resContent.toString();
|
|
@@ -941,7 +948,7 @@ export async function getLog(opt) {
|
|
|
941
948
|
'offset': opt.offset,
|
|
942
949
|
'limit': opt.limit,
|
|
943
950
|
}), globalConfig.rpcSecret), {
|
|
944
|
-
'timeout':
|
|
951
|
+
'timeout': 5
|
|
945
952
|
});
|
|
946
953
|
if (!res) {
|
|
947
954
|
// --- 解析失败,系统错误 ---
|
|
@@ -967,7 +974,7 @@ export async function ls(opt) {
|
|
|
967
974
|
'path': opt.path,
|
|
968
975
|
'encoding': opt.encoding,
|
|
969
976
|
}), globalConfig.rpcSecret), {
|
|
970
|
-
'timeout':
|
|
977
|
+
'timeout': 5
|
|
971
978
|
});
|
|
972
979
|
const content = await res.getContent();
|
|
973
980
|
if (!content) {
|
package/lib/undici/response.d.ts
CHANGED
|
@@ -31,7 +31,7 @@ export declare class Response {
|
|
|
31
31
|
/**
|
|
32
32
|
* --- 获取响应读取流对象 ---
|
|
33
33
|
*/
|
|
34
|
-
getStream():
|
|
34
|
+
getStream(): (import("undici/types/readable").default & undici.Dispatcher.BodyMixin) | zlib.Gunzip | zlib.Inflate | zlib.BrotliDecompress | null;
|
|
35
35
|
/**
|
|
36
36
|
* --- 获取原生响应读取流对象 ---
|
|
37
37
|
*/
|
package/lib/vector.d.ts
CHANGED
package/package.json
CHANGED
package/www/example/ctr/test.js
CHANGED
|
@@ -1731,14 +1731,17 @@ exec: ${JSON.stringify(exec)}<br><br>`);
|
|
|
1731
1731
|
const vector = lVector.get(this);
|
|
1732
1732
|
const res = await vector.search({
|
|
1733
1733
|
'collection': 'ai_wiki_content',
|
|
1734
|
-
|
|
1735
|
-
'
|
|
1734
|
+
// --- 内积 ---
|
|
1735
|
+
'metric': 'IP',
|
|
1736
|
+
'fields': ['id', 'team_uid', 'wiki_uid'],
|
|
1737
|
+
'data': [-0.032358210533857346, 0.007840704172849655, -0.023857861757278442, 0.032358210533857346, -0.05684806779026985, -0.003219231264665723, 0.048410918563604355, 0.07286917418241501, 0.040036965161561966, 0.11034655570983887, 0.09656903892755508, -0.0008462825790047646, 0.010854536667466164, 0.024458257481455803, -0.05125490203499794, -0.007058608811348677, -0.006272563245147467, -0.09562104195356369, 0.02521665394306183, -0.001118830987252295, 0.007260057609528303, -0.012750525958836079, 0.1126849427819252, 0.013580020517110825, -0.01306652370840311, 0.08715229481458664, 0.05153929814696312, 0.03128381818532944, 0.017727496102452278, -0.01508101262152195, 0.01628970541059971, -0.04825291782617569, 0.0011129060294479132, -0.013271923176944256, 0.037540581077337265, 0.04278615117073059, -0.012426627799868584, 0.02406325936317444, -0.009590543806552887, -0.042817749083042145, 0.033748604357242584, 0.0010368690127506852, -0.01956028677523136, -0.0035865791141986847, -0.006667561363428831, 0.0034937546588480473, -0.03174201399087906, -0.02456885762512684, -0.013177122920751572, -0.06231483817100525, -0.024300258606672287, 0.004230425227433443, -0.03529699519276619, 0.005723516456782818, -0.01655830442905426, 0.06149324029684067, 0.011810431256890297, 0.01493881270289421, 0.024948054924607277, 0.03599219024181366, 0.0009173821308650076, 0.032358210533857346, 0.01091773621737957, 0.0009188633994199336, 0.03035162389278412, -0.04847411811351776, 0.013959218747913837, 0.04376574605703354, -0.05795406177639961, -0.06553801894187927, -0.003317980794236064, 0.02207247167825699, 0.018106695264577866, 0.030241023749113083, -0.0024331859312951565, 0.05675327032804489, 0.007422006689012051, 0.05311929062008858, -0.01582360826432705, -0.03959456831216812, -0.04847411811351776, 0.03551819175481796, -0.0408901609480381, -0.026069847866892815, 0.06705480813980103, 0.03984736651182175, 0.02845563367009163, -0.05975525081157684, -0.0036260788328945637, 0.11129455268383026, -0.016495103016495705, -0.00541146844625473, 0.050401706248521805, 0.02535885199904442, 0.0033851303160190582, -0.056879669427871704, -0.03627659007906914, 0.03517059609293938, 0.00837395153939724, 0.052297696471214294, -0.014054018072783947, 0.08133792877197266, -0.006892709992825985, -0.00874524936079979, -0.004230425227433443, 0.04098496213555336, -0.024632057175040245, -0.0563424713909626, -0.013919718563556671, 0.025659050792455673, 0.016684703528881073, -0.013516820967197418, -0.008271251805126667, -0.01406191848218441, 0.019528687000274658, 0.07236357778310776, 0.010459539480507374, -0.02433185838162899, -0.005107320379465818, -0.012576727196574211, -0.005213969852775335, -0.030146224424242973, 0.0488533154129982, -0.024553056806325912, 0.007240307983011007, 0.009479944594204426, 0.004649122711271048, -0.05675327032804489, 0.026164647191762924, 0.004617522936314344, 0.02488485537469387, 0.01042793970555067, -0.035960592329502106, -0.009345646016299725, 0.004684672690927982, -0.0408901609480381, 0.038836173713207245, 0.04310214892029762, -0.09947621822357178, -0.033337805420160294, -0.017016500234603882, 0.027002042159438133, 0.014812413603067398, 0.014417416416108608, 0.022167271003127098, -0.010096141137182713, -0.040637362748384476, -0.018438491970300674, 0.042912550270557404, -0.012979624792933464, -0.04515613615512848, -0.009377245791256428, -0.025311453267931938, 0.0543200820684433, 0.045819733291864395, -0.011091534979641438, 0.02915083058178425, 0.0036300288047641516, 0.021171877160668373, -0.03052542172372341, -0.04130095988512039, 0.00032439184724353254, 0.04787372052669525, 0.027191640809178352, 0.0221988707780838, -0.028787432238459587, 0.10396339744329453, -0.010585938580334187, 0.08001073449850082, -0.004447673913091421, 0.014030318707227707, 0.015792008489370346, -0.0022317369002848864, -0.030225224792957306, -0.003898627357557416, 0.06932999938726425, 0.02701784297823906, -0.0007356831920333207, -0.0358973927795887, 0.006264663301408291, 0.02567484974861145, 0.005561567842960358, -0.031157419085502625, -0.013453621417284012, 0.031663015484809875, -0.04913771525025368, 0.027681438252329826, 0.03779337927699089, -0.030225224792957306, 0.005597117356956005, 0.025327252224087715, 0.12722085416316986, 0.03984736651182175, 0.0448717400431633, -0.05097050219774246, -0.06361042708158493, -0.029166629537940025, 0.03700338304042816, 0.06756040453910828, 0.00017799584020394832, 0.050907302647829056, -0.00605926476418972, -0.0363713875412941, 0.01674790307879448, 0.014607015065848827, -0.02802903763949871, 0.06920360028743744, -0.05176049843430519, -0.021756473928689957, -0.017885494977235794, 0.0014190291985869408, 0.0026247596833854914, 0.02932462841272354, -0.008184351958334446, 0.004080326296389103, 0.009811743162572384, -0.061177242547273636, 0.007998703047633171, -0.013580020517110825, 0.01605270616710186, 0.000612740172073245, 0.011652432382106781, -0.054478082805871964, 0.02159847505390644, -0.03460180014371872, 0.030683420598506927, 0.020555680617690086, 0.02687564305961132, -0.0034206800628453493, 0.004305474925786257, -0.013374621979892254, 0.0058262161910533905, -0.05656367167830467, 0.010048741474747658, -0.02211987040936947, -0.06199884042143822, -0.01873869076371193, -0.016779502853751183, -0.02586445026099682, 0.05466768145561218, -0.027507640421390533, 0.03567619249224663, -0.020429281517863274, 0.0076866550371050835, -0.03984736651182175, 0.019512886181473732, -0.009100747294723988, 0.008792649023234844, 0.017569497227668762, -0.009400945156812668, -0.026670245453715324, 0.011818330734968185, -0.02025548182427883, -0.01744309812784195, -0.02387366071343422, 0.00969324354082346, 0.06165124103426933, -0.011952630244195461, 0.023052066564559937, 0.05523647740483284, -0.021867072209715843, -0.021456275135278702, -0.0006013839738443494, 0.006130364257842302, -0.036434587091207504, 0.00685716001316905, 0.01689010113477707, -0.036244988441467285, -0.06730760633945465, -0.005403568502515554, -0.025564251467585564, 0.005743266548961401, 0.002780783921480179, -0.011526033282279968, -0.0044200243428349495, -0.02022388204932213, -0.09928662329912186, 0.011684032157063484, 0.06022924929857254, -0.017032301053404808, -0.007769604679197073, -0.03131541609764099, 0.011518132872879505, -0.01905468851327896, -0.019734084606170654, 0.021124476566910744, 0.026306847110390663, 0.020603079348802567, -0.020002683624625206, 0.025595851242542267, -0.01426731701940298, 0.0767243504524231, -0.0021744624245911837, -0.021424675360322, -0.033369407057762146, 0.03719298169016838, 0.0508757047355175, 0.016668902710080147, 0.025374652817845345, 0.008571449667215347, -0.005067820660769939, -0.007161308079957962, -0.04888491705060005, 0.022609667852520943, 0.01202373020350933, 0.0005485530709847808, -0.021566875278949738, -0.1586310714483261, 0.061082445085048676, -0.05172890052199364, 0.036434587091207504, 0.03896257281303406, -0.009772242978215218, 0.04904291406273842, 0.037540581077337265, -0.0946730449795723, 0.0061106146313250065, -0.00447532394900918, 0.027792038396000862, 0.002166562480852008, 0.08468750864267349, 0.009985541924834251, 0.03747738152742386, 0.012632026337087154, 0.056500472128391266, -0.022909866645932198, -0.01957608573138714, -0.0031836815178394318, -0.027586638927459717, -0.016384504735469818, 0.0009914442198351026, 0.0221988707780838, -0.024458257481455803, 0.03722458332777023, 0.05223449692130089, -0.011273234151303768, -0.0010279815178364515, 0.07059399038553238, -0.0046649230644106865, 0.004811071790754795, 0.05770126357674599, 0.053593289107084274, -0.01547600980848074, -0.0046372730284929276, 0.034949395805597305, 0.07034119218587875, 0.015144212171435356, -0.022925665602087975, 0.009511544369161129, 0.0006428587366826832, 0.002308761468157172, 0.00038067903369665146, 0.034159399569034576, 0.011107334867119789, 0.0008280139300040901, -0.011146835051476955, 0.010933536104857922, -0.01294802501797676, -0.07710354775190353, -0.0019404261838644743, 0.034064602106809616, -0.04714692384004593, -0.0011306809028610587, -0.03343260660767555, -0.04079536348581314, 0.025232452899217606, 0.012663626112043858, 0.004522723611444235, -0.034949395805597305, 0.051096901297569275, -0.0012975673889741302, -0.018375292420387268, 0.0024391107726842165, 0.02548525109887123, -0.020524080842733383, 0.010973036289215088, 0.0005816341144964099, -0.009614244103431702, -0.012434527277946472, -0.006991459056735039, -0.008800548501312733, 0.014030318707227707, 0.01892828941345215, -0.02275186777114868, 0.047210123389959335, -0.03646618872880936, -0.02599084936082363, -0.0468941256403923, 0.010119841434061527, 0.02349446341395378, 0.07369077205657959, 0.03918377310037613, 0.008547750301659107, 0.017016500234603882, 0.012687326408922672, 0.035644590854644775, 0.04126935824751854, -0.008800548501312733, 0.045724932104349136, 0.009290345944464207, -0.02262546867132187, 0.011052035726606846, 0.0035628792829811573, -0.0021507623605430126, -0.000029701976018259302, 0.015792008489370346, 0.032927006483078, 0.03299020603299141, 0.00038783837226219475, -0.0002740296476986259, -0.033559005707502365, 0.025959249585866928, 0.04111136123538017, -0.009574743919074535, -0.02788683772087097, -0.0017972395289689302, -0.001406191848218441, -0.014196217060089111, -0.004842672031372786, 0.022309470921754837, 0.014978312887251377, 0.01034103985875845, -0.015649808570742607, -0.023210065439343452, -0.03965776786208153, 0.30361104011535645, -0.006853210274130106, -0.012189628556370735, 0.007963153533637524, -0.010862437076866627, -0.03747738152742386, -0.019402287900447845, -0.0588388592004776, 0.0034167300909757614, -0.03155241534113884, -0.03371700271964073, 0.0493905134499073, -0.0019295638194307685, -0.056974466890096664, -0.035360194742679596, 0.048695314675569534, 0.009432544931769371, -0.007524705957621336, 0.022056670859456062, 0.02053987979888916, 0.02377886138856411, 0.024505658075213432, 0.01378541998565197, 0.07154197990894318, 0.026891443878412247, -0.01758529804646969, 0.001917713787406683, 0.007678755093365908, 0.050622906535863876, 0.007485206238925457, 0.07305877655744553, 0.020334482192993164, -0.012600426562130451, -0.04240695387125015, -0.005435168277472258, 0.049106113612651825, 0.006402912549674511, -0.07324837148189545, 0.038330577313899994, -0.005676116794347763, 0.011905230581760406, 0.04528253525495529, -0.014093518257141113, -0.004605673253536224, -0.03659258782863617, -0.003258730983361602, 0.03558139130473137, 0.020366081967949867, -0.02174067310988903, 0.024126458913087845, -0.011992130428552628, -0.030651820823550224, 0.046009331941604614, -0.01325612235814333, 0.009345646016299725, 0.030272623524069786, -0.01826469413936138, -0.01221332885324955, -0.015886807814240456, -0.08601469546556473, -0.004396324511617422, -0.022404270246624947, -0.022657068446278572, 0.02248326875269413, 0.03747738152742386, 0.023431263864040375, -0.04130095988512039, -0.011944730766117573, 0.046230532228946686, -0.007896004244685173, 0.00656881183385849, -0.04218575358390808, 0.06269403547048569, -0.029387827962636948, 0.020160682499408722, -0.047905322164297104, 0.0006947022047825158, -0.025374652817845345, 0.011273234151303768, -0.02159847505390644, 0.0072719077579677105, -0.027002042159438133, 0.051697298884391785, -0.012497726827859879, -0.024900654330849648, -0.04038456454873085, 0.006300213281065226, 0.023478662595152855, -0.029356228187680244, 0.02535885199904442, 0.018564891070127487, 0.007619505748152733, 0.039752569049596786, -0.01706390082836151, -0.018343692645430565, -0.0031145568937063217, 0.00550626777112484, -0.047020524740219116, 0.03186841309070587, -0.01730090007185936, -0.030446423217654228, -0.027318041771650314, 0.030825620517134666, 0.04853731766343117, -0.01888089068233967, -0.03457019850611687, 0.01628970541059971, -0.004368674475699663, 0.022830866277217865, 0.007102058734744787, 0.036339789628982544, 0.029782826080918312, -0.007817004807293415, -0.02257806807756424, -0.011059935204684734, 0.03463339805603027, -0.005964465439319611, -0.006797910202294588, 0.03047802299261093, 0.027507640421390533, -0.062472835183143616, 0.03997376561164856, -0.03725618124008179, -0.01306652370840311, 0.022593868896365166, 0.007520756218582392, 0.019971083849668503, 0.0035549793392419815, -0.004747872240841389, 0.0051191700622439384, -0.005166569724678993, 0.01427521649748087, 0.025595851242542267, -0.001800202066078782, -0.030004024505615234, 0.024916455149650574, -0.04098496213555336, 0.004487174097448587, 0.004609622992575169, 0.031347017735242844, 0.006213313899934292, -0.03520219400525093, 0.029988225549459457, 0.011549732647836208, 0.005427268333733082, -0.02210407145321369, 0.03362220525741577, -0.006284413393586874, 0.03463339805603027, -0.015697209164500237, 0.028692632913589478, -0.039246972650289536, 0.013682720251381397, 0.09094426780939102, 0.005269269458949566, 0.004850571975111961, -0.014014518819749355, 0.038741376250982285, -0.042027756571769714, 0.03741418197751045, -0.01436211634427309, 0.028850631788372993, -0.012426627799868584, -0.006991459056735039, -0.011320633813738823, -0.022467469796538353, -0.005225819535553455, -0.00952734425663948, -0.029640628024935722, -0.000792957900557667, -0.017142899334430695, 0.010759737342596054, 0.11628732085227966, -0.030557021498680115, 0.03716138377785683, -0.006075064651668072, 0.008887448348104954, 0.003969727084040642, -0.013635320588946342, 0.015167911536991596, 0.013295622542500496, -0.02853463403880596, 0.02238846942782402, 0.00554971769452095, -0.017285099253058434, 0.03611858934164047, 0.03747738152742386, -0.0017636647680774331, -0.001444704132154584, -0.014701814390718937, 0.00601581484079361, -0.01586310751736164, -0.04047936573624611, -0.00694010965526104, -0.0018011895008385181, -0.013564220629632473, 0.005889415740966797, 0.0001756505371304229, -0.039626169949769974, 0.008429250679910183, -0.0076353056356310844, -0.00578276626765728, -0.0398789681494236, 0.029135029762983322, -0.03460180014371872, -0.0015849282499402761, 0.00876894872635603, -0.011004636064171791, 0.005415418650954962, 0.01269522588700056, 0.02275186777114868, -0.0008398638456128538, -0.0034424050245434046, -0.033148206770420074, 0.02409485913813114, 0.0344121977686882, 0.04177495837211609, -0.004554323386400938, 0.009163946844637394, -0.0533720888197422, 0.008800548501312733, -0.03205801174044609, -0.04569333419203758, 0.021756473928689957, 0.00536801852285862, 0.01489931344985962, 0.05463608354330063, 0.028787432238459587, 0.006963809486478567, 0.048695314675569534, -0.01957608573138714, -0.005036220885813236, -0.03741418197751045, 0.0065253619104623795, -0.043133750557899475, -0.057164065539836884, 0.01790129579603672, 0.003971701953560114, 0.056184474378824234, 0.01775909587740898, -0.02576964907348156, 0.0011780806817114353, -0.043828945606946945, 0.032642610371112823, 0.012963824905455112, -0.005936815403401852, -0.023052066564559937, 0.019971083849668503, 0.009306145831942558, -0.012347628362476826, 0.023684062063694, -0.05463608354330063, -0.022862466052174568, -0.008840048685669899, -0.0066912611946463585, -0.013935518451035023, -0.007343007251620293, -0.01670050248503685, 0.005557617638260126, 0.01267152652144432, -0.026670245453715324, -0.030051425099372864, -0.011889430694282055, -0.0031639316584914923, 0.050591304898262024, 0.014291016384959221, -0.015878908336162567, 0.05874405801296234, -0.0274286400526762, -0.11995290219783783, 0.010443739593029022, -0.014409516006708145, 0.025248253718018532, 0.03867817297577858, 0.048821717500686646, -0.0024786104913800955, -0.03529699519276619, -0.13385681807994843, 0.04288094863295555, 0.030541222542524338, 0.02164587378501892, 0.046325329691171646, -0.03251621127128601, -0.0029427327681332827, -0.06604361534118652, 0.10838736593723297, 0.0274286400526762, -0.032358210533857346, -0.0013824919005855918, -0.016684703528881073, -0.0012748551089316607, -0.0072284578345716, 0.03491779789328575, -0.013350922614336014, 0.013556321151554585, -0.0039480021223425865, 0.039246972650289536, 0.020966477692127228, 0.018011895939707756, 0.07596595585346222, 0.00987494271248579, 0.02423705905675888, -0.01295592449605465, 0.020618880167603493, 0.03561299294233322, -0.01193683035671711, -0.0244266577064991, 0.011115235276520252, 0.03308500722050667, -0.014772914350032806, -0.023478662595152855, 0.0017942771082744002, -0.054604481905698776, -0.0038453026209026575, -0.02253066934645176, 0.03681378439068794, -0.04025816544890404, -0.0011691931867972016, -0.03539179265499115, 0.14877192676067352, 0.040921762585639954, -0.058270059525966644, 0.00008764011727180332, -0.08563549816608429, 0.0023640613071620464, 0.018944090232253075, -0.07470196485519409, -0.009772242978215218, -0.02109287679195404, 0.003975651692599058, -0.08121152967214584, 0.061461642384529114, -0.009653743356466293, -0.008832148276269436, -0.02780783735215664, 0.017285099253058434, 0.010973036289215088, -0.00158394081518054, -0.03099942021071911, -0.017695896327495575, 0.07729315012693405, 0.02229367010295391, -0.03359060361981392]
|
|
1736
1738
|
});
|
|
1737
1739
|
const echo = [`<pre>const res = await vector.search({
|
|
1738
|
-
'collection': '
|
|
1739
|
-
'metric': '
|
|
1740
|
-
'
|
|
1741
|
-
|
|
1740
|
+
'collection': 'ai_wiki_content',
|
|
1741
|
+
'metric': 'IP',
|
|
1742
|
+
'fields': ['id', 'team_uid', 'wiki_uid'],
|
|
1743
|
+
'data': [-0.032358210533857346, 0.007840704172849655, -0.023857861757278442, 0.032358210533857346, -0.05684806779026985, -0.003219231264665723, 0.048410918563604355, 0.07286917418241501, 0.040036965161561966, ...]
|
|
1744
|
+
});</pre>res:<pre>${lText.stringifyJson(res, 4)}</pre>`];
|
|
1742
1745
|
return echo.join('') + '<br>' + this._getEnd();
|
|
1743
1746
|
}
|
|
1744
1747
|
async kv() {
|