@seasonkoh/webaz 0.1.26 → 0.1.28

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 (99) hide show
  1. package/LICENSE +2 -2
  2. package/NOTICE +24 -3
  3. package/README.md +74 -330
  4. package/README.zh-CN.md +419 -0
  5. package/dist/layer0-foundation/L0-2-state-machine/genuine-sale.js +21 -0
  6. package/dist/layer0-foundation/L0-5-manifest/manifest.js +8 -3
  7. package/dist/layer1-agent/L1-1-mcp-server/auth.js +13 -1
  8. package/dist/layer1-agent/L1-1-mcp-server/network-mode.js +69 -0
  9. package/dist/layer1-agent/L1-1-mcp-server/server.js +270 -82
  10. package/dist/layer2-business/L2-9-contribution/admin-coordination-ingestion-engine.js +181 -0
  11. package/dist/layer2-business/L2-9-contribution/admin-coordination-resolver.js +114 -0
  12. package/dist/layer2-business/L2-9-contribution/admin-coordination-store.js +251 -0
  13. package/dist/layer2-business/L2-9-contribution/admin-operator-claim-workflow.js +390 -0
  14. package/dist/layer2-business/L2-9-contribution/build-task-agent-metadata-store.js +24 -0
  15. package/dist/layer2-business/L2-9-contribution/build-task-participation.js +6 -2
  16. package/dist/layer2-business/L2-9-contribution/build-task-quota.js +337 -0
  17. package/dist/layer2-business/L2-9-contribution/build-task-read.js +25 -2
  18. package/dist/layer2-business/L2-9-contribution/build-tasks-engine.js +57 -7
  19. package/dist/layer2-business/L2-9-contribution/canonical-contribution-target.js +1 -1
  20. package/dist/layer2-business/L2-9-contribution/contribution-facts-read.js +66 -0
  21. package/dist/layer2-business/L2-9-contribution/task-proposal-draft.js +187 -18
  22. package/dist/layer2-business/L2-9-contribution/task-proposal-store.js +29 -4
  23. package/dist/ledger.js +1 -1
  24. package/dist/pwa/admin-audit.js +38 -0
  25. package/dist/pwa/anti-abuse-thresholds.js +135 -0
  26. package/dist/pwa/cf-origin-guard.js +33 -0
  27. package/dist/pwa/contract-fingerprint.js +1 -0
  28. package/dist/pwa/data/onboarding-cases.js +2 -2
  29. package/dist/pwa/data/onboarding-quiz.js +1 -1
  30. package/dist/pwa/economic-participation.js +2 -2
  31. package/dist/pwa/integration-contract.js +46 -4
  32. package/dist/pwa/internal/pv-settlement.js +12 -0
  33. package/dist/pwa/internal/wallet-signer.js +26 -0
  34. package/dist/pwa/public/app-account.js +977 -0
  35. package/dist/pwa/public/app-admin.js +608 -0
  36. package/dist/pwa/public/app-agents.js +63 -0
  37. package/dist/pwa/public/app-ai.js +2162 -0
  38. package/dist/pwa/public/app-contribution.js +836 -0
  39. package/dist/pwa/public/app-discover.js +1296 -0
  40. package/dist/pwa/public/app-listings.js +226 -0
  41. package/dist/pwa/public/app-profile.js +1692 -0
  42. package/dist/pwa/public/app-seller.js +199 -0
  43. package/dist/pwa/public/app-shop.js +1145 -0
  44. package/dist/pwa/public/app.js +15075 -23960
  45. package/dist/pwa/public/i18n.js +31 -28
  46. package/dist/pwa/public/index.html +11 -1
  47. package/dist/pwa/public/openapi.json +4851 -2776
  48. package/dist/pwa/pv-kill-switch.js +31 -0
  49. package/dist/pwa/routes/admin-admins.js +48 -1
  50. package/dist/pwa/routes/admin-analytics.js +1 -10
  51. package/dist/pwa/routes/admin-atomic.js +4 -17
  52. package/dist/pwa/routes/admin-operator-claims.js +280 -0
  53. package/dist/pwa/routes/admin-reports.js +4 -26
  54. package/dist/pwa/routes/admin-tokenomics.js +2 -76
  55. package/dist/pwa/routes/admin-users-lifecycle.js +1 -14
  56. package/dist/pwa/routes/admin-users-query.js +23 -1
  57. package/dist/pwa/routes/admin-wallet-ops.js +1 -1
  58. package/dist/pwa/routes/agent-grants.js +255 -0
  59. package/dist/pwa/routes/auth-read.js +1 -5
  60. package/dist/pwa/routes/auth-register.js +3 -13
  61. package/dist/pwa/routes/build-task-quota.js +113 -0
  62. package/dist/pwa/routes/claim-verify.js +15 -11
  63. package/dist/pwa/routes/contribution-facts.js +18 -0
  64. package/dist/pwa/routes/dispute-cases.js +5 -4
  65. package/dist/pwa/routes/growth.js +3 -3
  66. package/dist/pwa/routes/orders-action.js +27 -10
  67. package/dist/pwa/routes/orders-create.js +1 -1
  68. package/dist/pwa/routes/products-meta.js +19 -6
  69. package/dist/pwa/routes/profile-placement.js +1 -1
  70. package/dist/pwa/routes/promoter.js +10 -29
  71. package/dist/pwa/routes/public-build-tasks.js +5 -1
  72. package/dist/pwa/routes/public-utils.js +9 -12
  73. package/dist/pwa/routes/referral.js +5 -26
  74. package/dist/pwa/routes/rewards-apply.js +3 -2
  75. package/dist/pwa/routes/share-redirects.js +1 -1
  76. package/dist/pwa/routes/shareables-interactions.js +2 -1
  77. package/dist/pwa/routes/task-proposals.js +85 -9
  78. package/dist/pwa/routes/users-public.js +1 -4
  79. package/dist/pwa/routes/wallet-read.js +2 -14
  80. package/dist/pwa/routes/webauthn.js +7 -2
  81. package/dist/pwa/server-schema.js +9 -0
  82. package/dist/pwa/server.js +319 -2034
  83. package/dist/runtime/agent-grant-scopes.js +128 -0
  84. package/dist/runtime/agent-grant-verifier.js +67 -0
  85. package/dist/runtime/agent-pairing.js +60 -0
  86. package/dist/runtime/apply-webaz-runtime-schema.js +15 -0
  87. package/dist/runtime/webaz-schema-helpers.js +1848 -0
  88. package/dist/settlement-math.js +3 -3
  89. package/dist/version.js +6 -4
  90. package/package.json +43 -8
  91. package/dist/index.js +0 -182
  92. package/dist/pwa/public/docs/ECONOMIC-MODEL.md +0 -287
  93. package/dist/pwa/public/docs/INTEGRATOR.md +0 -67
  94. package/dist/pwa/public/docs/META-RULES-FULL.md +0 -543
  95. package/dist/test-dispute.js +0 -153
  96. package/dist/test-manifest.js +0 -61
  97. package/dist/test-mcp-tools.js +0 -135
  98. package/dist/test-reputation.js +0 -116
  99. package/dist/test-skill-market.js +0 -101
package/LICENSE CHANGED
@@ -3,9 +3,9 @@ Business Source License 1.1
3
3
 
4
4
  Parameters
5
5
 
6
- Licensor: seasonsagents-art
6
+ Licensor: Holden
7
7
  Licensed Work: WebAZ
8
- Copyright © 2026 seasonsagents-art and contributors
8
+ Copyright © 2026 Holden and contributors
9
9
  Additional Use Grant: You may make production use of the Licensed Work,
10
10
  provided that your use does not include offering
11
11
  the Licensed Work to third parties as a hosted or
package/NOTICE CHANGED
@@ -1,7 +1,7 @@
1
1
  WebAZ — Licensing Notice
2
2
  =========================
3
3
 
4
- Copyright (c) 2026 seasonsagents-art and WebAZ contributors
4
+ Copyright (c) 2026 Holden and WebAZ contributors
5
5
 
6
6
 
7
7
  Current License (since 2026-05-18)
@@ -10,7 +10,7 @@ Current License (since 2026-05-18)
10
10
  Business Source License 1.1 (BUSL-1.1).
11
11
  See LICENSE for full terms.
12
12
 
13
- Licensor: seasonsagents-art
13
+ Licensor: Holden
14
14
  Licensed Work: WebAZ — Agent-native decentralized commerce protocol
15
15
  Additional Use Grant: You may make production use of the Licensed Work,
16
16
  provided that your use does not include offering the
@@ -36,6 +36,26 @@ The license change applies only to commits and releases dated on or after
36
36
  2026-05-18.
37
37
 
38
38
 
39
+ Pre-Genesis Authorship
40
+ ----------------------
41
+
42
+ All pre-Genesis development of WebAZ was authored by Holden (GitHub:
43
+ seasonsagents-art), the sole human contributor to the project during the
44
+ pre-Genesis phase.
45
+
46
+ This NOTICE records authorship and project history only. It does not constitute
47
+ any claim of reward, valuation, governance rights, ownership percentage, or
48
+ economic entitlement (RFC-017 §I-12).
49
+
50
+ The complete pre-Genesis development history is preserved in the private
51
+ webaz-archive repository.
52
+
53
+ (创世前 WebAZ 的所有开发均由 Holden(GitHub:seasonsagents-art)完成,是创世前
54
+ 阶段项目的唯一【人类】贡献者。本声明仅记录作者归属与项目历史,不构成任何回报、
55
+ 估值、治理权、所有权份额或经济权利的主张(RFC-017 §I-12)。完整的创世前开发历史
56
+ 保留在私有 webaz-archive 仓库。)
57
+
58
+
39
59
  Third-Party Components
40
60
  ----------------------
41
61
 
@@ -47,7 +67,8 @@ package's LICENSE file for terms.
47
67
  Trademarks
48
68
  ----------
49
69
 
50
- "WebAZ" and the WebAZ logo are trademarks of seasonsagents-art. The license
70
+ "WebAZ" and the WebAZ logo are unregistered (common-law) trademarks of Holden,
71
+ to be assigned to the project's legal entity once one is formed. The license
51
72
  does not grant any trademark rights.
52
73
 
53
74
 
package/README.md CHANGED
@@ -1,5 +1,6 @@
1
+ **English** · **[中文](README.zh-CN.md)**
2
+
1
3
  > **Code is Rule, Protocol is Trust.**
2
- > **代码即规则,协议即信任。**
3
4
  > — webaz
4
5
 
5
6
  # WebAZ
@@ -8,392 +9,135 @@
8
9
  [![MCP Registry](https://img.shields.io/badge/MCP%20Registry-active-blue)](https://registry.modelcontextprotocol.io/v0/servers?search=webaz)
9
10
  [![License: BUSL-1.1](https://img.shields.io/badge/License-BUSL--1.1-orange.svg)](LICENSE) [![Change Date: 2030-05-18](https://img.shields.io/badge/Change%20Date-2030--05--18-blue.svg)](NOTICE) ![Status: Pre-launch](https://img.shields.io/badge/Status-Pre--launch-yellow.svg)
10
11
 
11
- > 🚧 **Pre-launch · 预发布阶段** — v1.0 公示中(起算 2026-05-31)· 0 真用户 · verifier + arbitrator 全为 fixture · 经济模型未结算 · 不建议生产使用。
12
- > 🚧 **Pre-launch stage** — v1.0 public-notice period (started 2026-05-31) · 0 real users · verifier + arbitrator are fixtures · economic model un-settled · **not for production use**.
13
- >
14
- > 详见 / Details: [`docs/CHARTER.md`](docs/CHARTER.md) · [`docs/META-RULES-FULL.md`](docs/META-RULES-FULL.md) · [`docs/ECONOMIC-MODEL.md`](docs/ECONOMIC-MODEL.md) · [`/api/protocol-status`](https://webaz.xyz/api/protocol-status)
15
-
16
- 让 AI Agent 成为去中心化商业协议的原生参与者。卖家零额外工作量接入新渠道,买家通过 Agent 自动购物,人类与 AI 在同一协议上平等参与。
17
-
18
- > 📖 **创始白皮书 / Founding Whitepaper** → [`docs/WHITEPAPER.zh-CN.md`](docs/WHITEPAPER.zh-CN.md) · [`docs/WHITEPAPER.md`](docs/WHITEPAPER.md)
12
+ > 🚧 **Pre-launch** — v1.0 public-notice period (since 2026-05-31) · very early (genesis-phase accounts only) · verifier / arbitrator roles still being bootstrapped · economic model un-settled · **not for production use.**
19
13
 
20
- > **运营哲学与远景** [`docs/VISION-AND-OPERATIONS.md`](docs/VISION-AND-OPERATIONS.md)
21
- > COP(参与即建设,贡献可见)· 团队"消失"在协议里 · 最终全 DAO
14
+ **WebAZ is an agent-native, decentralized commerce protocol.** Humans use a PWA; AI agents use an MCP server — both talk to the same backend under the same rules. Sellers plug existing catalogs into a new channel with zero extra work; buyers (or their agents) discover → price-lock → order → track autonomously; and escrow, fault attribution, and dispute resolution are enforced by **deterministic state machines, not a company's discretion.**
22
15
 
23
- > **试一下**:`npx -y @seasonkoh/webaz`,或在 Claude Desktop 加入 MCP 配置(见下)。
24
- > **PWA 演示**:[webaz.xyz](https://webaz.xyz)
16
+ > 📖 Whitepaper → [EN](docs/WHITEPAPER.md) · [中文](docs/WHITEPAPER.zh-CN.md) · 🌐 Live PWA demo → **[webaz.xyz](https://webaz.xyz)**
25
17
 
26
18
  ---
27
19
 
28
- ## 📜 授权说明
29
-
30
- 自 **2026-05-18** 起,本项目使用 **Business Source License 1.1 (BUSL-1.1)** 协议发布。
31
-
32
- - ✅ 允许:内部使用、研究、二次开发、非竞争性商业使用
33
- - ❌ 禁止:运营与 WebAZ 实质相似的去中心化商业协议托管服务
34
- - ⏰ **2030-05-18** 之后,本协议自动转为 **MIT** 协议
35
- - 📦 **2026-05-18 之前**发布的所有版本(含历史 git 提交)仍持有 **MIT** 授权,不可撤销
36
-
37
- 详见 [`LICENSE`](LICENSE) 与 [`NOTICE`](NOTICE)。
20
+ ## Why WebAZ exists
38
21
 
39
- ---
22
+ AI agents are becoming primary economic actors, yet today's marketplaces are built for human clicks on closed platforms that extract rent and own the network. WebAZ is the opposite:
40
23
 
41
- ## 核心特性
42
-
43
- ### 协议骨架
44
- - **Agent 原生**:MCP 协议下,Claude 直接搜索、锁价、下单、举证、确认
45
- - **人类 + Agent 双轨**:PWA 给人类,MCP 给 Agent,共用同一后端
46
- - **协议级精准镜像**:q= 严格 exact match,"茶" 不会命中"茶具套装";买家从外部平台复制的标识必须字面相等才返回结果(见 [intent-driven-buy](docs/modules/intent-driven-buy.md))
47
- - **商品 alias 系统**:卖家声明 kouling_token / short_url / title_substring,让用户从外部平台的任何复制形式都能精准命中同一 SKU(见 [product-aliases](docs/modules/product-aliases.md))
48
- - **角色感知 API**:`/api/products?mode=pwa|agent|raw` 三种调用方分级;agent 模式返回 score_breakdown,raw 模式 HMAC 签名(见 [products-api](docs/modules/products-api.md))
49
- - **Agent Reputation 体系**:每个 api_key 独立 trust_score(4 layer band),raw mode 需 trust ≥ 30(见 [agent-reputation](docs/modules/agent-reputation.md))
50
-
51
- ### 多元交易场景
52
- - **🆕 多商家跟卖 (P1)**:listings 1:N offers,4 类目 stake 体系(standard 1.0× / general 1.5× / highvalue 2.0× / restricted 3.0× × base 50 WAZ)
53
- - **🆕 加权排序 + urgency 路由 (P2)**:trending score 含完成度/信誉/分享/点赞/新鲜度/季节性;urgency 三档 (now/today/flex) 路由不同 ETA 硬限
54
- - **🆕 RFQ 求购抢单 (P3)**:买家发求购,卖家限时报价;first_match 即时触发 / 提前结算 / 自然语言预填 / auto_bid Skill(见 [rfq-auction-chat](docs/modules/rfq-auction-chat.md))
55
- - **🆕 加价拍卖 AUC**:English forward auction;反狙击 sniper_extend_min + max_extends cap;卖家担保金 5%
56
- - **🆕 P2P 原生商店**:无外链商品的去中心化路径;卖家本地节点存详情,WebAZ 锚定 hash + HMAC 签名 + 客户端 sha256 校验
57
- - **🆕 上下文绑定聊天**:order / RFQ / listing_qa 三类 chat;反诈正则检测微信号/电话/银行卡
58
-
59
- ### 信任与合规
60
- - **claim 验证 + 条件订单**:买家可对推荐理由发起验证,3 verifier 共识仲裁,4 路径结算(pass / fail / no_fault / timeout)+ outlier 处罚(见 [claim-verification](docs/modules/claim-verification.md))
61
- - **地区合规分润**:china/us/eu/india = 2 levels;其他 3 levels;UI 按地区动态显示
62
- - **零门槛上架**:卖家上架免质押,首单成交时从 escrow 自动锁 15% stake(trusted 卖家跳过)
63
- - **争议系统**:双方举证 → 仲裁员裁定 → 败诉方缴 1% 仲裁费(含超时自动判)
64
- - **链接认领验证**:卖家关联外部链接需通过众包验证码核验,防止他人冒用商品主权
65
-
66
- ### 决策辅助
67
- - **🆕 价格历史 + 成交量分布**:3 窗口(30d/90d/lifetime) × 6 统计;价位分布 / sparkline / category_avg / anomaly_flags;防底价倾销
68
- - **结构化商品 + agent_summary**:规格 / 物流 / 售后字段拼成一句话决策摘要
69
- - **下单前价格锁定**:`webaz_verify_price` 返回 `session_token`,避免决策与下单之间价格漂移
70
-
71
- ### 社会化 / 公益
72
- - **🆕 慈善许愿池**:双匿名(HMAC 派生 handle)+ 双签锚定(commit_hash)+ 反自圆梦封锁;许愿/圆梦/还愿/转捐 4 套荣誉细分(见 [charity](docs/modules/charity.md))
73
- - **🆕 慈善基金**:还愿被谢绝自动转入;任何人可捐款(≤500 WAZ/愿,1 WAZ = 1 honor 上限 50/日);公开账本 + 慈善家排行
74
- - **🆕 点赞 + 排行榜**:shareable_likes 防 Sybil;商品榜 (sales+推荐+点赞) + 创作者榜
75
- - **Skill 市场**:catalog_sync / auto_accept / instant_ship / auto_bid 等插件,Agent 订阅自动享用
76
- - **声誉 5 级**(新手 → 传奇):影响质押折扣 + 搜索排名
77
-
78
- ### 链上 / 安全
79
- - **链上托管**:USDC on Base Sepolia,充值地址按用户派生,自动扫归集 + 自动执行提现
80
- - **WebAuthn / Passkey** 大额操作闸门
81
- - **storage.persist()** 申请 + 持久化状态可视
82
- - **自动执法**:状态机责任归因,超时自动判责(每 5 分钟 cron 扫)
24
+ - **Open protocol, not a platform.** The rules — parameters, consensus, arbitration — are public and verifiable. No company owns the network, and everything an agent does is auditable. An open, migratable protocol is structurally hostile to lock-in: you can always leave, so there is no rent to capture.
25
+ - **Code is Rule.** Settlement splits, timeout fault-attribution, and dispute verdicts are deterministic state machines anyone can read — not a backend's private judgment.
26
+ - **Humans and agents, first-class and equal.** The same protocol serves a person in a browser and an autonomous agent over MCP. An agent does the work; a real, accountable human stands behind it.
83
27
 
84
28
  ---
85
29
 
86
- ## 快速开始
87
-
88
- > **自部署?** → 看 [`docs/DEPLOYMENT.md`](docs/DEPLOYMENT.md)(30 分钟从零到上线 · systemd + Nginx + Let's Encrypt + 监控 + 备份完整 cookbook)
89
- > **环境变量?** → 复制 [`.env.example`](.env.example) 为 `.env` 填值
90
-
91
- ### 方式一:Claude MCP 接入(Agent 原生体验)
92
-
93
- MCP server 有两种模式 / The MCP runs in one of two modes:
94
-
95
- | 模式 / Mode | 数据源 | 用途 | 如何触发 |
96
- |---|---|---|---|
97
- | 🟢 **NETWORK** | `webaz.xyz` 共享生产网络(带你的 `api_key`) | 真实加入网络、和别人交易 | 配了 `WEBAZ_API_KEY` |
98
- | 🟡 **SANDBOX** | 本机本地 SQLite(`~/.webaz/webaz.db`) | 离线试玩 / 开发,**与全网隔离** | 未配 `WEBAZ_API_KEY`(默认) |
99
-
100
- > 🟢 NETWORK = your agent acts on the live shared network. 🟡 SANDBOX = local-only, private to your machine, **not** the live network. Every tool result is stamped with `_mode` so you always know which one you're in.
30
+ ## Quickstart — 5 minutes
101
31
 
102
- **A. 先离线试玩(SANDBOX,零配置)**
32
+ ### A. Run it locally (new contributors)
103
33
 
104
- 编辑 `~/Library/Application Support/Claude/claude_desktop_config.json`:
34
+ It's a standard Node app with **no external services** (SQLite, in-process):
105
35
 
106
- ```json
107
- {
108
- "mcpServers": {
109
- "webaz": {
110
- "command": "npx",
111
- "args": ["-y", "@seasonkoh/webaz"]
112
- }
113
- }
114
- }
36
+ ```bash
37
+ git clone https://github.com/webaz-protocol/webaz.git
38
+ cd webaz
39
+ npm install
40
+ npm run pwa # → http://localhost:3000 (PWA + HTTP API + auto-enforcement cron)
115
41
  ```
116
42
 
117
- 重启 Claude Desktop。`npx` 自动下载运行。此时所有数据都在本机沙盒,可放心试 `webaz_register` / `webaz_search` / 下单全流程。
43
+ Open the PWA, register a local account, and walk a full order → ship → confirm → settle flow. **Before changing code, read [`AGENTS.md`](AGENTS.md)** — it explains the layered architecture and the house rules (especially around money/state-machine code).
118
44
 
119
- **B. 真正加入网络(NETWORK)**
45
+ ### B. Use it from an AI agent (MCP — any client)
120
46
 
121
- 1. [webaz.xyz](https://webaz.xyz) 注册账号(需邀请码;注册时绑定 Passkey 成为可问责真人)
122
- 2. 「我的 / 设置」→ 复制 `api_key`
123
- 3. 配置里加上 `WEBAZ_API_KEY` 环境变量:
47
+ WebAZ ships an **MCP server**. MCP is an open standard, so it works with **any MCP-capable client** — Claude Desktop, Claude Code, Codex, Cursor, or your own agent. Add the server to your client's MCP config:
124
48
 
125
49
  ```json
126
- {
127
- "mcpServers": {
128
- "webaz": {
129
- "command": "npx",
130
- "args": ["-y", "@seasonkoh/webaz"],
131
- "env": { "WEBAZ_API_KEY": "你的_api_key" }
132
- }
133
- }
134
- }
50
+ { "mcpServers": { "webaz": { "command": "npx", "args": ["-y", "@seasonkoh/webaz"] } } }
135
51
  ```
136
52
 
137
- > NETWORK 模式下 `webaz_register` **不自助建号**(账号必须由真人在 webaz.xyz 创建 + Passkey,这是协议的可问责性要求)。注册以外的交易工具——搜索 / 锁价 / 下单 / 上架 / 履约 / 查单——都直接在共享网络上跑。
53
+ - 🟡 **Sandbox (default, zero-config):** with no `WEBAZ_API_KEY`, the agent runs against a **private local SQLite playground, isolated from the live network** — safe to try `webaz_register` / `webaz_search` / the whole order flow.
54
+ - 🟢 **Network:** register at [webaz.xyz](https://webaz.xyz) (invite + Passkey = an accountable human), copy your `api_key`, and set it as `env.WEBAZ_API_KEY` → the agent acts on the **live shared network**. (On Network, `webaz_register` never self-creates an account — accounts require a real human + Passkey, by protocol.)
138
55
 
139
- **C. 开始使用**
56
+ Every tool result is stamped with `_mode` so the agent always knows which network it's on. There are **38 tools**; ask `webaz_info` for the live list and params. A first prompt to try:
140
57
 
141
- Claude 对话里说:
142
-
143
- > "帮我在 WebAZ 搜索一下有什么商品,挑性价比高的下单"
144
-
145
- Claude 会自动调用 `webaz_search` → `webaz_verify_price` → `webaz_place_order` → `webaz_get_status` 完成发现→下单→追踪全流程。
58
+ > *"Search WebAZ for products and order the best value one."* → the agent chains `webaz_search` → `webaz_verify_price` → `webaz_place_order` → `webaz_get_status`.
146
59
 
147
60
  ---
148
61
 
149
- ### 方式二:PWA 浏览器界面
150
-
151
- ```bash
152
- cd webaz
153
- npm run pwa
154
- # 打开 http://localhost:3000
155
- # 手机访问:http://<本机IP>:3000
156
- ```
62
+ ## The contribution system (RFC-017)
157
63
 
158
- 注册账号后即可使用完整功能。
64
+ WebAZ records **who built what**, then lets the real person **claim** it — while promising **no reward**. This is how a stranger or an agent contributes and gets durable, verifiable credit.
159
65
 
160
- ---
66
+ - **Record.** A merged GitHub PR is fetched and verified by WebAZ's *own authenticated read* (not self-reported) → an **immutable contribution fact** (executor = the agent / GitHub identity; accountable = a human).
67
+ - **Claim — contribute first, bind later.** A contribution can be recorded against a GitHub identity *before* any account exists. The real person later binds a Passkey account by proving control of that GitHub identity (publish a one-time challenge marker in a gist → Passkey ceremony).
68
+ - **The uncommitted-value boundary (I-12).** Contributions are accurately **recorded and claimable — that is the entire promise.** No reward, valuation, score, governance right, or ownership percentage is implied. *How* (or whether) contribution ever converts to value is deliberately deferred to a future DAO + legal/professional team. The commitment is *"your work is recorded and yours to claim,"* not *"you will be paid X."*
161
69
 
162
- ## MCP 工具清单
163
-
164
- | 工具 | 说明 | 主要参数 |
165
- |------|------|----------|
166
- | `webaz_info` | 获取协议概览和实时统计 | — |
167
- | `webaz_register` | 注册账号,获取 api_key | `name`, `role` |
168
- | `webaz_search` | 搜索商品(结构化字段 + agent_summary + 声誉加权) | `query`, `category`, `max_price`, `min_return_days`, `max_handling_hours` |
169
- | `webaz_verify_price` | 下单前锁价 10 分钟,拿到 `session_token` | `product_id`, `quantity`, `api_key` |
170
- | `webaz_list_product` | 卖家上架商品(含品牌/规格/物流/售后字段) | `title`, `price`, `specs`, `handling_hours`, `return_days`, `api_key` |
171
- | `webaz_place_order` | 买家下单(可传 `session_token` 防价格漂移) | `product_id`, `shipping_address`, `session_token`, `api_key` |
172
- | `webaz_update_order` | 更新订单状态(接单/发货/确认/争议) | `order_id`, `action`, `api_key` |
173
- | `webaz_get_status` | 查询订单/钱包/争议详情 | `order_id` / `wallet` / `dispute_id`, `api_key` |
174
- | `webaz_wallet` | 钱包余额 + 链上充值地址 + 提现 | `action`, `api_key` |
175
- | `webaz_notifications` | 查询未读通知 | `api_key` |
176
- | `webaz_dispute` | 争议操作(查看/举证/裁定) | `action`, `api_key` |
177
- | `webaz_skill` | Skill 市场(发布/订阅;含 auto_bid) | `action`, `api_key` |
178
- | `webaz_profile` | 个人资料 + 多角色管理 | `action`, `api_key` |
179
- | `webaz_mykey` | api_key 恢复(已注册用户重新获取密钥) | `name`, `recovery_code` |
180
- | `webaz_rfq` | 🆕 RFQ 求购(发布/浏览/认领/详情) | `action`, `api_key` |
181
- | `webaz_bid` | 🆕 RFQ 报价(创建/修改/撤销/中标) | `action`, `rfq_id`, `api_key` |
182
- | `webaz_chat` | 🆕 上下文绑定聊天(order/rfq/listing_qa) | `action`, `context_id`, `api_key` |
183
- | `webaz_auto_bid` | 🆕 卖家自动报价 Skill 配置 | `action`, `api_key` |
184
- | `webaz_auction` | 🆕 加价拍卖(发起/浏览/出价/中标) | `action`, `api_key` |
185
- | `webaz_like` | 🆕 分享点赞(toggle/status) | `action`, `shareable_id`, `api_key` |
186
- | `webaz_leaderboard` | 🆕 排行榜(products / creators) | `kind`, `limit` |
187
- | `webaz_p2p_product` | 🆕 P2P 原生商店(卖家节点 hash 锚定) | `action`, `api_key` |
188
- | `webaz_price_history` | 🆕 商品历史成交价 + 价位分布 | `product_id` |
189
- | `webaz_charity` | 🆕 慈善许愿池 + 还愿 + 基金 + 捐款(11 sub-action) | `action`, `api_key` |
190
-
191
- 完整协议规范(状态机/经济模型/争议规则)可通过 MCP Resource 读取:
192
-
193
- ```
194
- webaz://protocol/manifest
195
- ```
196
-
197
- ---
198
-
199
- ## 角色说明
200
-
201
- | 角色 | 可以是人类或 Agent | 职责 |
202
- |------|-------------------|------|
203
- | `buyer` 买家 | ✅ 两者均可 | 浏览商品、下单、确认收货或发起争议 |
204
- | `seller` 卖家 | ✅ 两者均可 | 上架商品、接单、发货,可发布 Skill |
205
- | `logistics` 物流 | ✅ 两者均可 | 揽收、运输、投递,回传快递单号 |
206
- | `arbitrator` 仲裁员 | ✅ 两者均可 | 审查争议证据、做出裁定 |
207
-
208
- ---
209
-
210
- ## 交易流程
211
-
212
- ```
213
- 买家下单(paid)
214
- → 卖家接单(accepted) ← 超时 24h:fault_seller
215
- → 卖家发货(shipped) ← 超时 72h:fault_seller(需选择物流公司)
216
- → 物流揽收(picked_up) ← 超时 48h:fault_logistics(回传快递单号)
217
- → 运输中(in_transit)
218
- → 投递完成(delivered) ← 超时 48h:fault_logistics
219
- → 买家确认(confirmed) ← 超时 72h:自动确认
220
- → 完成结算(completed)
221
-
222
- 买家在 delivered 阶段可发起争议:
223
- → 被告 48h 内举证 → 仲裁员 120h 内裁定
224
- → 超时不回应:自动判发起方胜诉
225
- → 败诉方缴纳订单金额 1% 仲裁费(最低 1 WAZ)
226
- → 裁定结果:全额退款 / 释放给卖家 / 部分退款 / 责任分配
227
- ```
70
+ **Start here:** [`docs/PUBLIC-CONTRIBUTOR-ENTRY.md`](docs/PUBLIC-CONTRIBUTOR-ENTRY.md) · the `webaz_contribute` tool (browse/claim open tasks; agents welcome) · [`docs/AGENT-READY-TASK-SPEC.md`](docs/AGENT-READY-TASK-SPEC.md).
228
71
 
229
72
  ---
230
73
 
231
- ## 资金分配
74
+ ## Governance-adjustable by design
232
75
 
233
- 每笔成交按以下比例自动分配:
76
+ WebAZ deliberately separates **principle** (permanent) from **mechanism** (tunable), so read every number here as *"today's default,"* not a fixed promise:
234
77
 
235
- | 接收方 | 比例 |
236
- |--------|------|
237
- | 卖家 | ~93%(扣除各项费用后) |
238
- | 物流方 | 5% |
239
- | 协议费 | 2% |
240
- | 推荐人(如有) | 3% |
78
+ - Every rate, threshold, and weight — platform fee, commission split, stakes, region caps, … — is a **`protocol_params` value with a current default that DAO governance can change.** Some sit under constitutional hard caps (e.g. platform fee **≤ 2%, decrease-only**). Nothing economic is hard-coded as forever.
79
+ - Money flows are fully parameterized and on-chain-auditable. The operator earns only an explicit platform fee + risk-event slashing — most of it rerouted to a public-good fund. Full walk-through: [`docs/ECONOMIC-MODEL.md`](docs/ECONOMIC-MODEL.md).
80
+ - The constitution (meta-rules) and amendment thresholds live in [`docs/CHARTER.md`](docs/CHARTER.md) / [`docs/META-RULES-FULL.md`](docs/META-RULES-FULL.md).
241
81
 
242
- 卖家上架**零质押**(M7.2.6 起)。首单成交时自动从订单 escrow 锁定 15% 作买家保护,
243
- 信誉 ≥ trusted 的卖家直接跳过 stake 锁定(信任奖励)。
82
+ > Matching rewards are disabled by default; PV / position is a participation record only — not income, not redeemable, no entitlement. See [`docs/REWARD-ENGINES-DECOUPLING.md`](docs/REWARD-ENGINES-DECOUPLING.md).
244
83
 
245
- ---
84
+ **Fund split** (current `protocol_params` defaults, DAO-adjustable; 100-unit shop order):
246
85
 
247
- ## 开发命令
248
-
249
- ```bash
250
- npm run pwa # 启动 WebAZ 服务(含自动执法,端口 3000)
251
- npm run mcp # 单独启动 MCP Server(供 Claude Desktop 调用)
252
- npm run demo # 跑完整交易演示脚本
253
- npm run test-dispute # 测试争议系统(三场景)
254
- npm run test-skill # 测试 Skill 市场
255
- npm run test-rep # 测试声誉系统
256
- npm run test-manifest# 测试协议 Manifest
257
- ```
86
+ | Recipient | Default | Notes |
87
+ |---|---|---|
88
+ | Seller | ~83% | net after the items below (residual) |
89
+ | Share commission | 10% | to the referral chain L1/L2/L3 (default 7:2:1), region-capped; unclaimed → public reserve |
90
+ | Logistics | 5% | 0 for self-fulfill / in-person |
91
+ | Platform fee | 2% | 50% protocol reserve + 50% ops (secondhand 1%) |
92
+ | Protocol fund | 1% | public-good / backstop; **pre-launch = 0** |
258
93
 
259
94
  ---
260
95
 
261
- ## 技术栈
96
+ ## What's inside (feature map)
262
97
 
263
- | 方向 | 选择 |
264
- |------|------|
265
- | 运行时 | Node.js + TypeScript |
266
- | Agent 接口 | MCP (Model Context Protocol) |
267
- | 数据库 | SQLite(Phase 0),PostgreSQL(Phase 1+) |
268
- | 前端 | PWA — 手机浏览器直接访问,无需安装 |
269
- | 链(Phase 2) | 待定:Base / Optimism |
98
+ - **Commerce:** catalog · escrow · transition-driven settlement · disputes + arbitration · verification tasks · RFQ · forward auctions · P2P listings · secondhand.
99
+ - **Agent-native:** exact-match search · role-aware API (`?mode=pwa|agent|raw`) · per-`api_key` agent reputation · pre-order price-lock (`session_token`).
100
+ - **Trust & compliance:** crowd-verified claim checks · region-aware commission caps · zero-stake listing (15%-default buyer-protection stake on first sale) · dispute system with timeout auto-judgment · link-ownership verification.
101
+ - **On-chain & security:** USDC on Base (testnet live: Base Sepolia) · WebAuthn / Passkey gates on sensitive actions · automatic state-machine enforcement.
102
+ - **Community:** dual-anonymous charity wishing pool + fund · leaderboards · skill market.
270
103
 
271
104
  ---
272
105
 
273
- ## 架构总览 / Architecture map
274
-
275
- > 给 AI agent / 新贡献者:不用扫全仓,从下表对应层入手。改代码的 agent 请先读 [`AGENTS.md`](AGENTS.md)。
276
- > For AI agents / new contributors: don't scan the whole repo — start from the layer your change belongs to. Agents modifying code: read [`AGENTS.md`](AGENTS.md) first.
277
-
278
- 一套代码两个运行时:**MCP server**(`src/mcp.ts`,给 AI agent)+ **PWA**(`src/pwa/`,给人类)—— 同后端、同规则。
279
- One codebase, two runtimes: the **MCP server** (for AI agents) and the **PWA** (for humans) share the same backend and rules.
106
+ ## Architecture (for code contributors)
280
107
 
281
- 代码分 8 (`src/layerN-*/`,由底向上依赖)/ Code is layered (`src/layerN-*/`, bottom-up):
108
+ One codebase, two runtimes — the **MCP server** (for agents) and the **PWA** (for humans) share the same backend and rules. Code is layered bottom-up (`src/layerN-*/`):
282
109
 
283
- | Layer | 它是什么 / What |
110
+ | Layer | What |
284
111
  |---|---|
285
- | `layer0-foundation` | DB schema · 订单**状态机** state-machine · manifest |
286
- | `layer1-agent` | **MCP server**(`L1-1-mcp-server/server.ts`,最常改身份 / 外部锚点 identity / anchor |
287
- | `layer2-business` · `layer2-commerce` | 通知 / SNF / anchor registry 等业务 business logic |
288
- | `layer3-trust` | 争议引擎 dispute engine |
289
- | `layer4-economics` | 声誉 reputation · 技能市场 skill-market |
290
- | `layer5-decentralized` · `layer6-scale` | 治理 / 扩展(部分后续阶段)governance / scale (some reserved) |
291
-
292
- 关键入口 / Key entry files:
293
- - `src/mcp.ts` → tools 实现在 `src/layer1-agent/L1-1-mcp-server/server.ts`
294
- - `src/pwa/server.ts` + `src/pwa/routes/` → PWA + HTTP API(人 / agent 共用生产端点)
295
- - `src/cron-enforcement.ts` → 协议自动判责执行(超时→处置)auto state-machine enforcement
112
+ | `layer0-foundation` | DB schema · order **state machine** · manifest |
113
+ | `layer1-agent` | **MCP server** (`L1-1-mcp-server/server.ts`) · identity / external anchors |
114
+ | `layer2-business` · `layer2-commerce` | notifications · contribution (`L2-9-contribution`) · business logic |
115
+ | `layer3-trust` · `layer4-economics` | dispute engine · reputation · skill market |
116
+ | `layer5-decentralized` · `layer6-scale` | governance / scale (some reserved) |
117
+
118
+ Key entries: `src/mcp.ts` → tools in `src/layer1-agent/L1-1-mcp-server/server.ts` · `src/pwa/server.ts` + `src/pwa/routes/` (PWA + HTTP API) · `src/cron-enforcement.ts` (timeout fault enforcement). **Agents modifying code: read [`AGENTS.md`](AGENTS.md) first.**
296
119
 
297
120
  ---
298
121
 
299
- ## 当前阶段
122
+ ## License
300
123
 
301
- **Phase 0 · 概念验证** ✅
302
- **Phase 1 · 功能完善 + 链上 testnet 闭环** ✅
303
- - 14 个 MCP 工具 / 全角色 PWA / 通知 / 争议 / 声誉 / Skill 市场 / Manifest
304
- - USDC on Base Sepolia:派生充值地址、自动监听入账、热钱包扫归集、自动执行提现
305
- - 链接认领验证(众包验证码 + 主权流转)
306
- - Agent 决策三件套(结构化字段 / agent_summary / verify_price 锁价)
307
- - MCP 工具调用遥测(默认开,可关)
124
+ **Business Source License 1.1** since 2026-05-18 (Licensor: Holden). Internal use, research, modification, and non-competing commercial use are permitted; operating a hosted service substantially similar to / competing with WebAZ is not. On **2030-05-18** it converts to **MIT**. All commits and releases dated **before 2026-05-18** remain **MIT, irrevocably**. See [`LICENSE`](LICENSE) · [`NOTICE`](NOTICE).
308
125
 
309
- **Phase 2 · 主网 + 真正去中心化**(下一步)
126
+ **Pre-Genesis authorship:** all pre-Genesis development was authored by **Holden (GitHub: seasonsagents-art)**, the sole human contributor. This records authorship only — no reward / valuation / governance / ownership claim (RFC-017 §I-12). See [`NOTICE`](NOTICE).
310
127
 
311
128
  ---
312
129
 
313
- ## 路线图
314
-
315
- ### Phase 1 完成项
316
- - [x] 状态机 + 责任归因引擎
317
- - [x] MCP Server(14+ 个工具)
318
- - [x] 通知系统(SSE 实时推送)
319
- - [x] 争议系统(举证 + 超时自动裁定 + 仲裁费)
320
- - [x] 声誉积分体系(5 级)
321
- - [x] Skill 市场
322
- - [x] Protocol Manifest(机器可读协议规范)
323
- - [x] PWA 前端(全角色覆盖,人类 + Agent 双轨)
324
- - [x] 智能商品导入(贴链接自动提取)
325
- - [x] 链接认领验证(卖家主权 + 众包核验)
326
- - [x] 链上 USDC testnet 闭环(Base Sepolia)
327
- - [x] 下单前价格锁定(verify_price + session_token)
328
- - [x] 结构化商品规格 + agent_summary 决策摘要
329
- - [x] 遥测看板(/api/admin/usage)
330
-
331
- ### M1-M7 协议级里程碑(2026-05 完成)
332
- - [x] **M1** 角色感知 API(mode=pwa/agent/raw)+ cursor 分页
333
- - [x] **M2** 基础排序公平(jitter / seller cap / 新人 slot)
334
- - [x] **M3** 反操纵层(click 去重 / 双轨同支审计 / 上架限速 / 注册 IP hash)
335
- - [x] **M4** Agent Reputation 体系(trust_score + raw mode 门槛 + HMAC 签名)
336
- - [x] **M5** 新人保护 + 阶梯新鲜度 + sort UI
337
- - [x] **M6** 商品类型 + 库存稀缺 + 季节性 lifecycle
338
- - [x] **M7.1** 智能下单 intent-driven UI 重做
339
- - [x] **M7.1.5** q= exact match 协议契约
340
- - [x] **M7.2** 商品 alias 系统(kouling_token / title_substring / short_url)
341
- - [x] **M7.2.5/6/7** 卖家 funnel + 地区合规(2/3 级分润)+ L3 区域感知
342
- - [x] **代码审计** H-1 / H-2 / M-1 / M-2 / M-5 / 3f254b8 完整批次
343
- - [x] **M7.3** claim 验证任务系统(4 路径结算 + outlier 处罚)
344
- - [x] **M7.4** 条件订单(has_pending_claim 暂缓自动判责)
345
-
346
- ### P1-P3 多元交易场景(2026-05-18+)
347
- - [x] **P1** 多商家跟卖(listings + 4 类目 stake)
348
- - [x] **P2** 加权排序 + urgency 路由 + cold-start 衰减
349
- - [x] **P3 RFQ** 求购抢单 + bid_stake + first_match + auto_bid Skill + 买家 NLP Agent
350
- - [x] **CHAT** 上下文绑定聊天 + 反诈正则
351
- - [x] **AUC** 加价拍卖(English forward + 反狙击)
352
- - [x] **LIKE + Leaderboard** 分享点赞 + 商品/创作者双榜
353
- - [x] **P2P 原生商店** 卖家节点 hash 锚定 + HMAC 签名 + 客户端 sha256
354
- - [x] **Price History** 历史成交价 + 价位分布 + 异常预警
355
-
356
- ### 慈善 + 社会化(2026-05-18 完成)
357
- - [x] **慈善许愿池** 双匿名 + 双签锚定 + 4 张表 + 6 前端页 + 反自圆梦封锁
358
- - [x] **还愿系统** 三态响应(accept / decline_to_fund / 7 天 auto-accept)
359
- - [x] **慈善基金** 单例池 + 任何人捐款 + 慈善家排行 + 公开账本
360
- - [x] **5 项荣誉细分**(repay/redirect/grace/donation_total/donation_honor)
361
- - [x] **16 项审计修复**(4 处竞态 + 6 项业务/隐私 + 6 项工程)
362
-
363
- ### UX 重构(2026-05-19 完成)
364
- - [x] **导航重组** 角色化 tab bar(买家 5 / 卖家 5)
365
- - [x] **#me 私人 hub** 三段式(通用 6 / 角色专区 / 账户)
366
- - [x] **#discover 商务横条** 6 板块快捷入口(拍卖/求购/跟卖/P2P/排行/慈善)
367
- - [x] **i18n 双语全覆盖** 2700+ 条目;服务端按 Accept-Language 返回
368
-
369
- ### 进行中 / 下一步
370
- - [ ] **跨模块审计收尾**(alias 限额 TOCTOU / settleOrder 原子化 / 杂项硬化)
371
- - [ ] **慈善基金 v2**:自动拨款机制(紧急医疗/教育大额匹配)+ 捐物(specific event 定向)
372
- - [ ] **导航 v2**:4 角色(logistics/verifier/arbitrator/admin)也加 #me 入口完整化
373
-
374
- ### 长期
375
- - [ ] 链上 USDC 主网(Base)
376
- - [ ] IPFS 证据存储 + Pin Network(已搭骨架,留 P2)
377
- - [ ] 评价系统(结构化 1-5 星,反哺声誉)
378
- - [ ] 证据上传通道(争议附图)
379
- - [ ] 治理 DAO
380
-
381
- ---
130
+ ## Contact / Contributing
382
131
 
383
- ## 联系 / Contact
384
-
385
- | 用途 / Purpose | Email | 详情 / Details |
132
+ | Purpose | Email | Details |
386
133
  |---|---|---|
387
- | 通用咨询 / General inquiries | `contact@webaz.xyz` | — |
388
- | 安全漏洞 / Security vulnerabilities | `security@webaz.xyz` | [SECURITY.md](SECURITY.md) — 强烈优先用 [GitHub Security Advisory](https://github.com/seasonsagents-art/webaz/security/advisories) / Strongly prefer Advisory |
389
- | 行为准则举报 / Code of Conduct reports | `conduct@webaz.xyz` | [docs/CODE_OF_CONDUCT.md](docs/CODE_OF_CONDUCT.md) §7 |
390
- | BSL 商业授权 / Commercial licensing | `licensing@webaz.xyz` | [LICENSE](LICENSE) / [NOTICE](NOTICE) |
391
-
392
- > 📬 上述均为 Cloudflare Email Routing forwarding alias;phase A solo 阶段统一转发到创始人个人邮箱,响应水平为**个人级**(非企业 SLA);phase B+ 形成 maintainer 群后会切到团队 triage(无需改文档)。
393
- > 📬 All addresses are Cloudflare Email Routing forwarding aliases; in phase A solo, they route to the founder's personal inbox with **personal-level response** (not enterprise SLA); phase B+ will switch to maintainer team triage (no doc change needed).
134
+ | General | `contact@webaz.xyz` | — |
135
+ | Security | `security@webaz.xyz` | [SECURITY.md](SECURITY.md) — prefer a [GitHub Security Advisory](https://github.com/webaz-protocol/webaz/security/advisories) |
136
+ | Code of Conduct | `conduct@webaz.xyz` | [docs/CODE_OF_CONDUCT.md](docs/CODE_OF_CONDUCT.md) §7 |
137
+ | Commercial licensing | `licensing@webaz.xyz` | [LICENSE](LICENSE) / [NOTICE](NOTICE) |
394
138
 
395
- **Bug 报告 / 功能想法 / RFC**:走 [GitHub Issues](https://github.com/seasonsagents-art/webaz/issues) [Discussions](https://github.com/seasonsagents-art/webaz/discussions);PR 流程见 [CONTRIBUTING.md](CONTRIBUTING.md)。
139
+ > Addresses are Cloudflare Email Routing aliases; in the current solo phase they reach the founder's inbox at **personal-level response** (not an enterprise SLA).
396
140
 
397
- **Bug reports / feature ideas / RFCs**: please use [GitHub Issues](https://github.com/seasonsagents-art/webaz/issues) or [Discussions](https://github.com/seasonsagents-art/webaz/discussions); PR workflow per [CONTRIBUTING.md](CONTRIBUTING.md).
141
+ **Bugs / ideas / RFCs:** [Issues](https://github.com/webaz-protocol/webaz/issues) or [Discussions](https://github.com/webaz-protocol/webaz/discussions); PR workflow in [CONTRIBUTING.md](CONTRIBUTING.md). **New / GitHub-first / agent contributors:** [`docs/PUBLIC-CONTRIBUTOR-ENTRY.md`](docs/PUBLIC-CONTRIBUTOR-ENTRY.md).
398
142
 
399
- **新贡献者 / GitHub-first / 带 agent 的入口**:[`docs/PUBLIC-CONTRIBUTOR-ENTRY.md`](docs/PUBLIC-CONTRIBUTOR-ENTRY.md) — *contribute first, bind later*;贡献被记录但一切 `uncommitted`(不承诺奖励)。 / **New / GitHub-first / agent contributor entry**: [`docs/PUBLIC-CONTRIBUTOR-ENTRY.md`](docs/PUBLIC-CONTRIBUTOR-ENTRY.md).
143
+ > 中文文档见 **[README.zh-CN.md](README.zh-CN.md)**feature-by-feature detail, roadmap, and module docs.