@harrylabsj/kiwi 0.6.0 → 0.6.1
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/a2a/node.d.ts +3 -1
- package/dist/a2a/node.js +1 -0
- package/dist/a2a/node.js.map +1 -1
- package/dist/agent/buyer/types.d.ts +0 -25
- package/dist/agent/buyer/types.js.map +1 -1
- package/dist/agent/kernel-builder.d.ts +27 -0
- package/dist/agent/kernel-builder.js +180 -0
- package/dist/agent/kernel-builder.js.map +1 -0
- package/dist/cli.js +98 -154
- package/dist/cli.js.map +1 -1
- package/dist/commerce/data-source.d.ts +4 -3
- package/dist/commerce/data-source.js.map +1 -1
- package/dist/commerce/shopping-cli-source.js +3 -2
- package/dist/commerce/shopping-cli-source.js.map +1 -1
- package/dist/config/profile.d.ts +7 -0
- package/dist/config/profile.js +23 -0
- package/dist/config/profile.js.map +1 -1
- package/dist/discovery/catalog-source/kiwi-record.d.ts +3 -0
- package/dist/discovery/catalog-source/kiwi-record.js.map +1 -1
- package/dist/discovery/catalog-source/kiwi-source.js +7 -1
- package/dist/discovery/catalog-source/kiwi-source.js.map +1 -1
- package/dist/discovery/catalog-source/register.d.ts +6 -0
- package/dist/discovery/catalog-source/register.js +15 -7
- package/dist/discovery/catalog-source/register.js.map +1 -1
- package/dist/handoff/errors.d.ts +1 -1
- package/dist/handoff/errors.js +1 -0
- package/dist/handoff/errors.js.map +1 -1
- package/dist/handoff/idempotency.d.ts +10 -1
- package/dist/handoff/idempotency.js +13 -3
- package/dist/handoff/idempotency.js.map +1 -1
- package/dist/handoff/transaction.js +13 -6
- package/dist/handoff/transaction.js.map +1 -1
- package/dist/negotiation/state/phase.js +12 -4
- package/dist/negotiation/state/phase.js.map +1 -1
- package/dist/product-catalog.d.ts +43 -0
- package/dist/product-catalog.js +60 -0
- package/dist/product-catalog.js.map +1 -0
- package/dist/product-cli.d.ts +1 -1
- package/dist/product-cli.js +1 -1
- package/dist/product-publish.d.ts +10 -17
- package/dist/product-publish.js +177 -41
- package/dist/product-publish.js.map +1 -1
- package/dist/weixin/channel.d.ts +87 -0
- package/dist/weixin/channel.js +356 -0
- package/dist/weixin/channel.js.map +1 -0
- package/dist/weixin/cli-weixin.d.ts +29 -0
- package/dist/weixin/cli-weixin.js +128 -0
- package/dist/weixin/cli-weixin.js.map +1 -0
- package/dist/weixin/credentials.d.ts +33 -0
- package/dist/weixin/credentials.js +107 -0
- package/dist/weixin/credentials.js.map +1 -0
- package/dist/weixin/ilink-client.d.ts +44 -0
- package/dist/weixin/ilink-client.js +262 -0
- package/dist/weixin/ilink-client.js.map +1 -0
- package/dist/weixin/login.d.ts +34 -0
- package/dist/weixin/login.js +93 -0
- package/dist/weixin/login.js.map +1 -0
- package/dist/weixin/qr.d.ts +26 -0
- package/dist/weixin/qr.js +525 -0
- package/dist/weixin/qr.js.map +1 -0
- package/dist/weixin/types.d.ts +114 -0
- package/dist/weixin/types.js +48 -0
- package/dist/weixin/types.js.map +1 -0
- package/package.json +4 -1
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2026 harrylabsj
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* 微信远程控制通道(iLink Bot API)——协议 DTO、错误分类与时序配置。
|
|
18
|
+
*
|
|
19
|
+
* 协议学习自 Hermes Agent 的 weixin adapter(gateway/platforms/weixin.py):
|
|
20
|
+
* 腾讯 iLink Bot API(个人微信 bot 身份)。模块语义:
|
|
21
|
+
* - 错误统一 `WeixinError`(code 分类,fail-closed 决策点);
|
|
22
|
+
* - 所有 DTO 只声明我们消费的字段(wire 容忍服务端前向扩展);
|
|
23
|
+
* - 时序全部可注入覆盖(测试用),生产缺省对齐 Hermes 行为。
|
|
24
|
+
*/
|
|
25
|
+
/** iLink 服务默认 base URL(与 Hermes ILINK_BASE_URL 一致)。 */
|
|
26
|
+
export const ILINK_DEFAULT_BASE_URL = "https://ilinkai.weixin.qq.com";
|
|
27
|
+
/** 微信通道错误(fail-closed:任何协议/校验异常抛此类型,不静默容错)。 */
|
|
28
|
+
export class WeixinError extends Error {
|
|
29
|
+
code;
|
|
30
|
+
constructor(code, message) {
|
|
31
|
+
super(message);
|
|
32
|
+
this.name = "WeixinError";
|
|
33
|
+
this.code = code;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
/** 生产缺省时序(Hermes weixin.py 常量对齐)。 */
|
|
37
|
+
export const DEFAULT_WEIXIN_TIMINGS = {
|
|
38
|
+
longPollGraceMs: 20_000,
|
|
39
|
+
protocolBackoffMs: 30_000,
|
|
40
|
+
sessionStaleCooldownMs: 600_000,
|
|
41
|
+
httpBackoffMs: [2_000, 5_000, 15_000, 60_000],
|
|
42
|
+
schedulerTickMs: 60_000,
|
|
43
|
+
negotiateTickMs: 15_000,
|
|
44
|
+
dedupCap: 1_000,
|
|
45
|
+
qrPollMs: 1_000,
|
|
46
|
+
qrRefreshCap: 3,
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/weixin/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;;;;;;;GAQG;AAEH,uDAAuD;AACvD,MAAM,CAAC,MAAM,sBAAsB,GAAG,+BAA+B,CAAC;AAiBtE,+CAA+C;AAC/C,MAAM,OAAO,WAAY,SAAQ,KAAK;IAC3B,IAAI,CAAkB;IAE/B,YAAY,IAAqB,EAAE,OAAe;QAChD,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,aAAa,CAAC;QAC1B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF;AAkFD,qCAAqC;AACrC,MAAM,CAAC,MAAM,sBAAsB,GAAkB;IACnD,eAAe,EAAE,MAAM;IACvB,iBAAiB,EAAE,MAAM;IACzB,sBAAsB,EAAE,OAAO;IAC/B,aAAa,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC;IAC7C,eAAe,EAAE,MAAM;IACvB,eAAe,EAAE,MAAM;IACvB,QAAQ,EAAE,KAAK;IACf,QAAQ,EAAE,KAAK;IACf,YAAY,EAAE,CAAC;CAChB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@harrylabsj/kiwi",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"description": "Kiwi: standalone A2A commerce negotiation agent runtime (Pi Agent Core + shopping-cli Commerce API)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -41,11 +41,14 @@
|
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@eslint/js": "^9.29.0",
|
|
43
43
|
"@types/node": "^24.0.0",
|
|
44
|
+
"@types/qrcode": "^1.5.6",
|
|
44
45
|
"@typescript-eslint/eslint-plugin": "^8.34.0",
|
|
45
46
|
"@typescript-eslint/parser": "^8.34.0",
|
|
46
47
|
"eslint": "^9.29.0",
|
|
47
48
|
"globals": "^17.9.0",
|
|
49
|
+
"jsqr": "^1.4.0",
|
|
48
50
|
"prettier": "^3.5.3",
|
|
51
|
+
"qrcode": "^1.5.4",
|
|
49
52
|
"typescript": "^5.8.3",
|
|
50
53
|
"vitest": "^3.2.4"
|
|
51
54
|
},
|