@harrylabsj/kiwi 0.12.4 → 0.12.6
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/README.md +1 -1
- package/dist/a2a/node.d.ts +5 -1
- package/dist/a2a/node.js +68 -30
- package/dist/a2a/node.js.map +1 -1
- package/dist/a2a/server/merchant-handler.d.ts +4 -0
- package/dist/a2a/server/merchant-handler.js +123 -45
- package/dist/a2a/server/merchant-handler.js.map +1 -1
- package/dist/a2a/server/merchant-product-facts.d.ts +32 -0
- package/dist/a2a/server/merchant-product-facts.js +57 -0
- package/dist/a2a/server/merchant-product-facts.js.map +1 -0
- package/dist/agent/buyer/buyer-tools.js +285 -3
- package/dist/agent/buyer/buyer-tools.js.map +1 -1
- package/dist/agent/merchant/types.d.ts +4 -9
- package/dist/agent/merchant/types.js +14 -0
- package/dist/agent/merchant/types.js.map +1 -1
- package/dist/buyer-core/a2a-knp.d.ts +1 -0
- package/dist/buyer-core/a2a-knp.js +1 -1
- package/dist/buyer-core/a2a-knp.js.map +1 -1
- package/dist/buyer-core/a2a-negotiator.d.ts +2 -0
- package/dist/buyer-core/a2a-negotiator.js +20 -19
- package/dist/buyer-core/a2a-negotiator.js.map +1 -1
- package/dist/buyer-core/a2a-quote-fetcher.d.ts +2 -0
- package/dist/buyer-core/a2a-quote-fetcher.js +13 -5
- package/dist/buyer-core/a2a-quote-fetcher.js.map +1 -1
- package/dist/buyer-core/product-summary.d.ts +4 -0
- package/dist/buyer-core/product-summary.js +6 -0
- package/dist/buyer-core/product-summary.js.map +1 -1
- package/dist/buyer-core/protocol-recovery.d.ts +12 -1
- package/dist/buyer-core/protocol-recovery.js +59 -19
- package/dist/buyer-core/protocol-recovery.js.map +1 -1
- package/dist/buyer-core/receive-gate.d.ts +11 -0
- package/dist/buyer-core/receive-gate.js +107 -0
- package/dist/buyer-core/receive-gate.js.map +1 -0
- package/dist/buyer-core/service.d.ts +22 -1
- package/dist/buyer-core/service.js +325 -33
- package/dist/buyer-core/service.js.map +1 -1
- package/dist/buyer-core/store.d.ts +23 -0
- package/dist/buyer-core/store.js +71 -8
- package/dist/buyer-core/store.js.map +1 -1
- package/dist/cloud/bootstrap.d.ts +17 -0
- package/dist/cloud/bootstrap.js +96 -59
- package/dist/cloud/bootstrap.js.map +1 -1
- package/dist/cloud/config.d.ts +26 -0
- package/dist/cloud/config.js +75 -3
- package/dist/cloud/config.js.map +1 -1
- package/dist/cloud/file-listing-publication.js +6 -0
- package/dist/cloud/file-listing-publication.js.map +1 -1
- package/dist/cloud/main.d.ts +72 -0
- package/dist/cloud/main.js +332 -11
- package/dist/cloud/main.js.map +1 -1
- package/dist/cloud/owned-clock.d.ts +27 -0
- package/dist/cloud/owned-clock.js +98 -0
- package/dist/cloud/owned-clock.js.map +1 -0
- package/dist/cloud/owned-runtime.d.ts +188 -0
- package/dist/cloud/owned-runtime.js +1041 -0
- package/dist/cloud/owned-runtime.js.map +1 -0
- package/dist/cloud/product-import-tabular.d.ts +1 -1
- package/dist/cloud/product-import-tabular.js +263 -36
- package/dist/cloud/product-import-tabular.js.map +1 -1
- package/dist/cloud/product-source.d.ts +6 -1
- package/dist/cloud/product-source.js +47 -15
- package/dist/cloud/product-source.js.map +1 -1
- package/dist/commerce/data-source.d.ts +4 -0
- package/dist/commerce/data-source.js.map +1 -1
- package/dist/commerce/shopping-cli-source.js +4 -0
- package/dist/commerce/shopping-cli-source.js.map +1 -1
- package/dist/demo/demo-runner.js +6 -0
- package/dist/demo/demo-runner.js.map +1 -1
- package/dist/discovery/catalog-source/kiwi-source.d.ts +2 -0
- package/dist/discovery/catalog-source/kiwi-source.js +4 -0
- package/dist/discovery/catalog-source/kiwi-source.js.map +1 -1
- package/dist/handoff/destination.d.ts +2 -0
- package/dist/handoff/destination.js +4 -0
- package/dist/handoff/destination.js.map +1 -1
- package/dist/handoff/index.d.ts +2 -1
- package/dist/handoff/index.js +1 -0
- package/dist/handoff/index.js.map +1 -1
- package/dist/handoff/launch-marketplace-policy.d.ts +149 -0
- package/dist/handoff/launch-marketplace-policy.js +301 -0
- package/dist/handoff/launch-marketplace-policy.js.map +1 -0
- package/dist/handoff/marketplace-product-link.d.ts +18 -0
- package/dist/handoff/marketplace-product-link.js +71 -0
- package/dist/handoff/marketplace-product-link.js.map +1 -0
- package/dist/handoff/transaction.d.ts +30 -0
- package/dist/handoff/transaction.js +64 -0
- package/dist/handoff/transaction.js.map +1 -1
- package/dist/handoff/url-safety.d.ts +3 -0
- package/dist/handoff/url-safety.js +4 -0
- package/dist/handoff/url-safety.js.map +1 -1
- package/dist/http/merchant-management/page.js +176 -45
- package/dist/http/merchant-management/page.js.map +1 -1
- package/dist/i18n.d.ts +1 -0
- package/dist/i18n.js +3 -0
- package/dist/i18n.js.map +1 -1
- package/dist/lifecycle/close.d.ts +24 -0
- package/dist/lifecycle/close.js +131 -0
- package/dist/lifecycle/close.js.map +1 -0
- package/dist/mcp/merchant-runtime-assembly.js +6 -4
- package/dist/mcp/merchant-runtime-assembly.js.map +1 -1
- package/dist/mcp/tools.js +17 -16
- package/dist/mcp/tools.js.map +1 -1
- package/dist/merchant/application/service.d.ts +4 -0
- package/dist/merchant/application/service.js.map +1 -1
- package/dist/merchant/stats-store.d.ts +3 -0
- package/dist/merchant/stats-store.js +15 -1
- package/dist/merchant/stats-store.js.map +1 -1
- package/dist/merchant-core/rfq/data-source-adapter.d.ts +2 -10
- package/dist/merchant-core/rfq/data-source-adapter.js +21 -9
- package/dist/merchant-core/rfq/data-source-adapter.js.map +1 -1
- package/dist/merchant-gateway/pinned-fetch.js +5 -2
- package/dist/merchant-gateway/pinned-fetch.js.map +1 -1
- package/package.json +10 -11
- package/scripts/check-install-toolchain.mjs +64 -40
|
@@ -16,54 +16,78 @@
|
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
|
-
* A106 安装工具契约守卫(preinstall,fail-closed
|
|
19
|
+
* A106 安装工具契约守卫(preinstall,fail-closed)— 0.12.5 起。
|
|
20
20
|
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
* 契约:本仓构建/开发/CI 安装必须使用 npm >=12.0.2 <13(配 Node >=22.19)。
|
|
29
|
-
* 旧 npm 一律 fail-closed(零 provider/工具执行,无绕过开关)。
|
|
30
|
-
* 注意:npm ≥12 的 devEngines 门对旧 npm 自身无效(旧版忽略新字段),
|
|
31
|
-
* 故本脚本守卫是**权威**防线,devEngines 是对 npm≥12 的附加声明。
|
|
21
|
+
* 不变量:本包的安装产物中不得存在已知脆弱的嵌套依赖副本。
|
|
22
|
+
* 背景(A92/A94/A97/A100 实证链):pi-coding-agent ≤1.0.2 的 npm-shrinkwrap
|
|
23
|
+
* 曾钉嵌套 brace-expansion 5.0.9(GHSA-q2hr-2g5m-vwhr / GHSA-qhr7-859c-m2p7 /
|
|
24
|
+
* GHSA-6j4f-fj2g-mc7p),旧 npm 无法用 override 穿透,故 0.12.4 曾按
|
|
25
|
+
* npm >=12.0.2 <13 fail-closed。上游 1.2.0 已移除 shrinkwrap、原始树即干净
|
|
26
|
+
* (实测 brace-expansion 仅 5.0.12),本守卫转为直接校验树内容,任何
|
|
27
|
+
* 安装器版本均可安装;若脆弱副本再次出现,无论 npm 版本一律拒绝。
|
|
32
28
|
*/
|
|
33
29
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
30
|
+
import { existsSync, readdirSync, readFileSync, statSync } from "node:fs";
|
|
31
|
+
import path from "node:path";
|
|
32
|
+
|
|
33
|
+
const VULNERABLE = [
|
|
34
|
+
{ name: "brace-expansion", version: "5.0.9", ghsa: "GHSA-q2hr-2g5m-vwhr" },
|
|
35
|
+
];
|
|
36
|
+
|
|
37
|
+
/** 深度优先收集 <dir> 树内 name 包的全部安装副本(含任意嵌套 node_modules 与 @scope)。 */
|
|
38
|
+
function collectCopies(dir, name, out, depth = 0) {
|
|
39
|
+
if (depth > 24 || out.length > 5000) return;
|
|
40
|
+
const nm = path.join(dir, "node_modules");
|
|
41
|
+
let entries = [];
|
|
42
|
+
try {
|
|
43
|
+
entries = readdirSync(nm, { withFileTypes: true });
|
|
44
|
+
} catch {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
for (const e of entries) {
|
|
48
|
+
if (!e.isDirectory() || e.name.startsWith(".")) continue;
|
|
49
|
+
if (e.name.startsWith("@")) {
|
|
50
|
+
let scoped = [];
|
|
51
|
+
try {
|
|
52
|
+
scoped = readdirSync(path.join(nm, e.name), { withFileTypes: true });
|
|
53
|
+
} catch {
|
|
54
|
+
continue;
|
|
55
|
+
}
|
|
56
|
+
for (const s of scoped) {
|
|
57
|
+
if (!s.isDirectory() || s.name.startsWith(".")) continue;
|
|
58
|
+
recordIfVulnerable(path.join(nm, e.name, s.name), name, out);
|
|
59
|
+
collectCopies(path.join(nm, e.name, s.name), name, out, depth + 1);
|
|
60
|
+
}
|
|
61
|
+
} else {
|
|
62
|
+
recordIfVulnerable(path.join(nm, e.name), name, out);
|
|
63
|
+
collectCopies(path.join(nm, e.name), name, out, depth + 1);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function recordIfVulnerable(pkgDir, name, out) {
|
|
69
|
+
if (path.basename(pkgDir) !== name) return;
|
|
70
|
+
if (!existsSync(pkgDir) || !statSync(pkgDir).isDirectory()) return;
|
|
71
|
+
try {
|
|
72
|
+
const v = JSON.parse(readFileSync(path.join(pkgDir, "package.json"), "utf8")).version;
|
|
73
|
+
const vuln = VULNERABLE.find((x) => x.name === name && x.version === v);
|
|
74
|
+
if (vuln) out.push(`${name}@${v} at ${pkgDir} (${vuln.ghsa})`);
|
|
75
|
+
} catch {
|
|
76
|
+
/* unreadable package.json: skip */
|
|
77
|
+
}
|
|
48
78
|
}
|
|
49
79
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
if (major !== 12) return false;
|
|
55
|
-
// >=12.0.2(12.0.0/12.0.1 未测,按未支持处理)
|
|
56
|
-
return minor > 0 || patch >= 2;
|
|
80
|
+
const root = process.env.npm_config_local_prefix || process.cwd();
|
|
81
|
+
const offenders = [];
|
|
82
|
+
for (const vuln of VULNERABLE) {
|
|
83
|
+
collectCopies(root, vuln.name, offenders);
|
|
57
84
|
}
|
|
58
85
|
|
|
59
|
-
if (
|
|
86
|
+
if (offenders.length > 0) {
|
|
60
87
|
console.error(
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
`corepack prepare npm@12.0.2 --activate,或 npm install -g npm@12.0.2)。` +
|
|
64
|
-
`旧 npm 会引入 pi-coding-agent 嵌套 brace-expansion 5.0.9(audit high,` +
|
|
65
|
-
`且 override 不生效)——拒绝安装(fail-closed,无绕过开关)。`,
|
|
88
|
+
"[a106] vulnerable nested dependency copy detected — refusing to install (fail-closed):\n " +
|
|
89
|
+
offenders.join("\n "),
|
|
66
90
|
);
|
|
67
91
|
process.exit(1);
|
|
68
92
|
}
|
|
69
|
-
console.log(
|
|
93
|
+
console.log("[a106] dependency tree invariant OK");
|