1688-cli 0.1.40 → 0.1.42
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/AGENTS.md +112 -318
- package/ARCHITECTURE.md +106 -0
- package/CHANGELOG.md +107 -0
- package/README.md +100 -10
- package/dist/cli.js +165 -2
- package/dist/cli.js.map +1 -1
- package/dist/commands/cart-add.js +15 -11
- package/dist/commands/cart-add.js.map +1 -1
- package/dist/commands/cart-list.js +13 -11
- package/dist/commands/cart-list.js.map +1 -1
- package/dist/commands/compare.js +107 -0
- package/dist/commands/compare.js.map +1 -0
- package/dist/commands/debug.js +101 -0
- package/dist/commands/debug.js.map +1 -0
- package/dist/commands/doctor.js +107 -4
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/image-search.js +2 -6
- package/dist/commands/image-search.js.map +1 -1
- package/dist/commands/inbox.js +16 -32
- package/dist/commands/inbox.js.map +1 -1
- package/dist/commands/offer.js +7 -5
- package/dist/commands/offer.js.map +1 -1
- package/dist/commands/order-list.js +4 -2
- package/dist/commands/order-list.js.map +1 -1
- package/dist/commands/order-logistics.js +4 -2
- package/dist/commands/order-logistics.js.map +1 -1
- package/dist/commands/profile.js +84 -0
- package/dist/commands/profile.js.map +1 -0
- package/dist/commands/research.js +142 -0
- package/dist/commands/research.js.map +1 -0
- package/dist/commands/search.js +157 -111
- package/dist/commands/search.js.map +1 -1
- package/dist/commands/seller-messages.js +7 -4
- package/dist/commands/seller-messages.js.map +1 -1
- package/dist/commands/similar.js +2 -6
- package/dist/commands/similar.js.map +1 -1
- package/dist/commands/sourcing-utils.js +438 -0
- package/dist/commands/sourcing-utils.js.map +1 -0
- package/dist/commands/supplier-inspect.js +559 -0
- package/dist/commands/supplier-inspect.js.map +1 -0
- package/dist/commands/supplier-search.js +522 -0
- package/dist/commands/supplier-search.js.map +1 -0
- package/dist/daemon/client.js +2 -2
- package/dist/daemon/client.js.map +1 -1
- package/dist/daemon/protocol.js +2 -1
- package/dist/daemon/protocol.js.map +1 -1
- package/dist/io/output.js +31 -2
- package/dist/io/output.js.map +1 -1
- package/dist/session/config.js +82 -0
- package/dist/session/config.js.map +1 -0
- package/dist/session/dispatch.js +26 -3
- package/dist/session/dispatch.js.map +1 -1
- package/dist/session/events.js +151 -0
- package/dist/session/events.js.map +1 -0
- package/dist/session/im-cards.js +183 -0
- package/dist/session/im-cards.js.map +1 -0
- package/dist/session/im-ws.js +8 -5
- package/dist/session/im-ws.js.map +1 -1
- package/dist/session/navigation-guard.js +65 -0
- package/dist/session/navigation-guard.js.map +1 -0
- package/dist/session/paths.js +23 -4
- package/dist/session/paths.js.map +1 -1
- package/dist/session/search-capture.js +56 -6
- package/dist/session/search-capture.js.map +1 -1
- package/dist/session/search-mtop.js +53 -0
- package/dist/session/search-mtop.js.map +1 -1
- package/dist/session/supplier-search.js +403 -0
- package/dist/session/supplier-search.js.map +1 -0
- package/dist/util/encoding.js +8 -0
- package/dist/util/encoding.js.map +1 -0
- package/dist/util/temp.js +6 -0
- package/dist/util/temp.js.map +1 -0
- package/docs/AGENT_MAPS_PLAN.md +171 -0
- package/docs/AGENT_WORKING_PRINCIPLES.md +143 -0
- package/docs/COMMANDS.md +199 -0
- package/docs/FEATURES.md +45 -0
- package/docs/JSON_CONTRACTS.md +390 -0
- package/docs/QUALITY_SCORE.md +60 -0
- package/docs/README.md +35 -0
- package/docs/RELIABILITY.md +61 -0
- package/docs/SAFETY.md +100 -0
- package/docs/WORKFLOW.md +82 -0
- package/docs/exec-plans/README.md +9 -0
- package/docs/exec-plans/active/README.md +4 -0
- package/docs/exec-plans/completed/2026-05-28-sourcing-research-v1.md +125 -0
- package/docs/exec-plans/completed/2026-05-31-supplier-inspect-v1.md +113 -0
- package/docs/exec-plans/completed/2026-06-04-supplier-search-v1.md +81 -0
- package/docs/exec-plans/completed/2026-06-07-windows-cli-compatibility.md +138 -0
- package/docs/exec-plans/completed/README.md +4 -0
- package/docs/exec-plans/tech-debt-tracker.md +5 -0
- package/docs/generated/command-index.md +54 -0
- package/docs/generated/json-shapes.md +111 -0
- package/docs/generated/module-map.md +13 -0
- package/docs/generated/test-index.md +34 -0
- package/docs/playbooks/add-command.md +15 -0
- package/docs/playbooks/add-mtop-capture.md +13 -0
- package/docs/playbooks/change-json-output.md +11 -0
- package/docs/playbooks/debug-risk-control.md +12 -0
- package/docs/playbooks/update-cli-release.md +11 -0
- package/docs/specs/checkout-and-orders.md +30 -0
- package/docs/specs/seller-im.md +28 -0
- package/docs/specs/sourcing-research.md +186 -0
- package/docs/specs/supplier-inspect.md +144 -0
- package/docs/specs/supplier-search.md +179 -0
- package/docs/specs/windows-cli-compatibility.md +123 -0
- package/package.json +12 -2
- package/scripts/check_agent_map.mjs +86 -0
- package/scripts/fix_bin_mode.mjs +18 -0
- package/scripts/generate_agent_context.mjs +253 -0
- package/scripts/postinstall.mjs +12 -4
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
# Agent Working Principles
|
|
2
|
+
|
|
3
|
+
These principles apply to all coding agents working in this repository. The
|
|
4
|
+
first half is a reusable baseline shared with other agent-ready repositories;
|
|
5
|
+
the second half adds `1688-cli`-specific rules for buyer safety, JSON
|
|
6
|
+
contracts, and browser automation.
|
|
7
|
+
|
|
8
|
+
Tradeoff: these guidelines bias toward caution over speed. For trivial tasks,
|
|
9
|
+
use judgment.
|
|
10
|
+
|
|
11
|
+
## 1. Think Before Coding
|
|
12
|
+
|
|
13
|
+
Don't assume. Don't hide confusion. Surface tradeoffs.
|
|
14
|
+
|
|
15
|
+
Before implementing:
|
|
16
|
+
|
|
17
|
+
- State assumptions explicitly when they matter.
|
|
18
|
+
- If multiple interpretations exist, present them instead of picking silently.
|
|
19
|
+
- If a simpler approach exists, say so.
|
|
20
|
+
- Push back when a request conflicts with safety, compatibility, or the repo's
|
|
21
|
+
existing architecture.
|
|
22
|
+
- Ask only when the missing answer changes product behavior, account safety,
|
|
23
|
+
checkout/order behavior, data retention, or a breaking contract.
|
|
24
|
+
|
|
25
|
+
## 2. Simplicity First
|
|
26
|
+
|
|
27
|
+
Minimum code that solves the problem. Nothing speculative.
|
|
28
|
+
|
|
29
|
+
- No features beyond what was asked.
|
|
30
|
+
- No abstractions for single-use code.
|
|
31
|
+
- No flexibility or configurability that was not requested.
|
|
32
|
+
- No broad error handling that hides the real failure.
|
|
33
|
+
- If the implementation is much larger than the problem, simplify it.
|
|
34
|
+
|
|
35
|
+
Ask yourself: would a senior engineer say this is overcomplicated? If yes,
|
|
36
|
+
rewrite it smaller.
|
|
37
|
+
|
|
38
|
+
## 3. Surgical Changes
|
|
39
|
+
|
|
40
|
+
Touch only what you must. Clean up only your own mess.
|
|
41
|
+
|
|
42
|
+
When editing existing code:
|
|
43
|
+
|
|
44
|
+
- Do not improve adjacent code, comments, or formatting unless needed.
|
|
45
|
+
- Do not refactor unrelated behavior.
|
|
46
|
+
- Match existing style, even if you would design it differently.
|
|
47
|
+
- If you notice unrelated dead code or risk, mention it; do not delete it.
|
|
48
|
+
|
|
49
|
+
When your changes create orphans:
|
|
50
|
+
|
|
51
|
+
- Remove imports, variables, files, and functions that your changes made unused.
|
|
52
|
+
- Do not remove pre-existing dead code unless asked.
|
|
53
|
+
|
|
54
|
+
Every changed line should trace directly to the user's request.
|
|
55
|
+
|
|
56
|
+
## 4. Goal-Driven Execution
|
|
57
|
+
|
|
58
|
+
Define success criteria. Loop until verified.
|
|
59
|
+
|
|
60
|
+
Transform tasks into verifiable goals:
|
|
61
|
+
|
|
62
|
+
- "Add validation" -> write invalid-input tests, then make them pass.
|
|
63
|
+
- "Fix the bug" -> reproduce it or narrow it, then make the check pass.
|
|
64
|
+
- "Refactor X" -> keep behavior stable and run the relevant gate.
|
|
65
|
+
- "Add command" -> implement, document, update generated context, and verify.
|
|
66
|
+
|
|
67
|
+
For multi-step tasks, use a brief plan:
|
|
68
|
+
|
|
69
|
+
```text
|
|
70
|
+
1. [Step] -> verify: [check]
|
|
71
|
+
2. [Step] -> verify: [check]
|
|
72
|
+
3. [Step] -> verify: [check]
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Strong success criteria let agents loop independently. Weak criteria such as
|
|
76
|
+
"make it work" require clarification or a conservative assumption.
|
|
77
|
+
|
|
78
|
+
## 5. Read The Map First
|
|
79
|
+
|
|
80
|
+
- Start with `AGENTS.md`, then load only the relevant deeper docs.
|
|
81
|
+
- Use `ARCHITECTURE.md` to find the owning layer before changing code.
|
|
82
|
+
- Use `docs/generated/*` for fast orientation instead of hand-building stale
|
|
83
|
+
inventories.
|
|
84
|
+
- Do not rely on chat history for durable decisions; write important context
|
|
85
|
+
into docs or an ExecPlan.
|
|
86
|
+
|
|
87
|
+
## 6. Work In Small Verified Slices
|
|
88
|
+
|
|
89
|
+
- Prefer one bounded change that can be tested independently.
|
|
90
|
+
- Run focused checks first, then the default gate when risk warrants it.
|
|
91
|
+
- Use `pnpm agent-context` after command, JSON contract, source layout, or test
|
|
92
|
+
layout changes.
|
|
93
|
+
- Use `pnpm agent-verify` as the default green gate before handoff.
|
|
94
|
+
|
|
95
|
+
## 7. Preserve Buyer Safety
|
|
96
|
+
|
|
97
|
+
- Treat 1688 as a real buyer account with real sellers, cart state, orders, and
|
|
98
|
+
session risk controls.
|
|
99
|
+
- Never place an order without the prepare plus current-turn approval protocol.
|
|
100
|
+
- Never send seller messages unless the user requested the specific send or
|
|
101
|
+
approved the exact message.
|
|
102
|
+
- Do not force logout, force login reset, or global package upgrades without
|
|
103
|
+
explicit current-turn approval.
|
|
104
|
+
- Login and slider/risk-control flows require the user; do not silently loop.
|
|
105
|
+
|
|
106
|
+
## 8. Protect JSON Contracts
|
|
107
|
+
|
|
108
|
+
- Agent-facing JSON is part of the product surface.
|
|
109
|
+
- Prefer additive fields over renamed or removed fields.
|
|
110
|
+
- Keep `--json`, `--get`, `--pick`, and watch-mode line-delimited JSON stable.
|
|
111
|
+
- Update `docs/JSON_CONTRACTS.md` when output shape changes.
|
|
112
|
+
- Add tests or fixtures when parser changes affect stable JSON.
|
|
113
|
+
|
|
114
|
+
## 9. Make Failures Inspectable
|
|
115
|
+
|
|
116
|
+
- Preserve `requestId`, `errorCode`, `pageState`, `verification`, and
|
|
117
|
+
`artifactDir` when browser/session flows fail.
|
|
118
|
+
- Use `1688 debug list`, `1688 debug last`, and `1688 debug show <requestId>`
|
|
119
|
+
to inspect recent command events.
|
|
120
|
+
- Do not hide failures by broad retry loops or vague error messages.
|
|
121
|
+
- Record exact command and failure summary in ExecPlans or final responses when
|
|
122
|
+
verification cannot pass.
|
|
123
|
+
- Distinguish system-level failure from item-level failure in batch workflows.
|
|
124
|
+
|
|
125
|
+
## 10. Browser Automation Discipline
|
|
126
|
+
|
|
127
|
+
- Prefer mtop/structured payload parsing over fragile DOM scraping.
|
|
128
|
+
- Keep locator changes scoped and add fixture-backed tests where practical.
|
|
129
|
+
- Use `--headed` as the manual escape hatch for slider verification.
|
|
130
|
+
- Probe scripts are for discovery; stable behavior belongs in `src/`, `tests/`,
|
|
131
|
+
and docs.
|
|
132
|
+
- Avoid aggressive bulk scraping patterns that increase WAF/risk-control
|
|
133
|
+
exposure.
|
|
134
|
+
|
|
135
|
+
## 11. Documentation Discipline
|
|
136
|
+
|
|
137
|
+
- Update command docs when command names, flags, examples, or behavior change.
|
|
138
|
+
- Update safety docs when write actions or approval boundaries change.
|
|
139
|
+
- Promote repeated debugging steps into playbooks.
|
|
140
|
+
- Keep feature ideas in `docs/FEATURES.md` and long-running work in
|
|
141
|
+
`docs/exec-plans/`.
|
|
142
|
+
- Keep `AGENTS.md` short; move durable detail into `docs/`.
|
|
143
|
+
|
package/docs/COMMANDS.md
ADDED
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
# Command Catalog
|
|
2
|
+
|
|
3
|
+
Commands are organized by buyer journey: sourcing -> inquiry -> cart ->
|
|
4
|
+
checkout -> tracking -> post-sale.
|
|
5
|
+
|
|
6
|
+
## Sourcing
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
1688 search <keyword> # keyword search; --max N to limit
|
|
10
|
+
1688 search <keyword> --sort best-selling --price-max 50 --exclude-ads
|
|
11
|
+
1688 search --headed # open window if slider verification appears
|
|
12
|
+
1688 research <keyword...> # multi-keyword research, scoring, export
|
|
13
|
+
1688 similar <offerId> # find similar offers from other suppliers
|
|
14
|
+
1688 image-search <pathOrUrl> # local .jpg/.png/.webp or http(s) URL
|
|
15
|
+
1688 offer <offerId> # product detail, SKUs, price tiers, package info
|
|
16
|
+
1688 compare <offerId...> # compare offer details for sourcing
|
|
17
|
+
1688 supplier inspect <target> # supplier/factory trust signals from offerId or b2b-* memberId
|
|
18
|
+
1688 supplier search <keyword...> # supplier discovery from 1688 company search
|
|
19
|
+
1688 supplier research <keyword...> # supplier scoring + inspect enrichment from company search
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Research-oriented `search` filters:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
--sort relevance|best-selling|price-asc|price-desc
|
|
26
|
+
--price-min <n>
|
|
27
|
+
--price-max <n>
|
|
28
|
+
--province <name>
|
|
29
|
+
--city <name>
|
|
30
|
+
--verified any|factory|business|super-factory
|
|
31
|
+
--min-turnover <n>
|
|
32
|
+
--exclude-ads
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
`research` adds:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
--max-per-query <n>
|
|
39
|
+
--enrich top:N|N|0|none
|
|
40
|
+
--jsonl
|
|
41
|
+
--csv
|
|
42
|
+
--output <file>
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Supplier company-search commands:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
1688 supplier search 键盘 --factory-only --json
|
|
49
|
+
1688 supplier research 键盘 --enrich top:10 --csv
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
`supplier search` and `supplier research` use 1688's company search source
|
|
53
|
+
(`companySearchBusinessService`). They do not aggregate suppliers from offer
|
|
54
|
+
search results. Shared flags:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
--max <n>
|
|
58
|
+
--factory-only
|
|
59
|
+
--province <name>
|
|
60
|
+
--city <name>
|
|
61
|
+
--min-years <n>
|
|
62
|
+
--min-repeat-rate <n> # accepts 0.4 or 40
|
|
63
|
+
--min-response-rate <n> # accepts 0.6 or 60
|
|
64
|
+
--enrich top:N|N|all|0|none
|
|
65
|
+
--jsonl
|
|
66
|
+
--csv
|
|
67
|
+
--output <file>
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
`supplier search` defaults to `--enrich 0`. `supplier research` defaults to
|
|
71
|
+
`--enrich top:10`.
|
|
72
|
+
|
|
73
|
+
## Pre-Sale Inquiry
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
1688 seller inquire <offerId> <message>
|
|
77
|
+
1688 seller messages --offer <offerId>
|
|
78
|
+
1688 seller messages --offer <offerId> --watch [--interval N]
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
`--watch` is long-running and emits one line of JSON per newly-arrived message
|
|
82
|
+
when stdout is piped. Default interval is 30 seconds, minimum is 10 seconds.
|
|
83
|
+
|
|
84
|
+
## Cart
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
1688 cart list
|
|
88
|
+
1688 cart add <offerId> --sku <skuId> --qty N
|
|
89
|
+
1688 cart remove <cartId>
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
`cart add` returns `{added, isNewRow, addedQuantity}` so pipelines can pick up
|
|
93
|
+
the cart row reliably.
|
|
94
|
+
|
|
95
|
+
## Checkout
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
1688 checkout prepare <cartId>...
|
|
99
|
+
1688 checkout confirm <cartId>...
|
|
100
|
+
1688 checkout confirm <cartId>... --agent
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
`prepare` is read-only. `confirm` places a real order and must follow the
|
|
104
|
+
approval protocol in `docs/SAFETY.md`.
|
|
105
|
+
|
|
106
|
+
## Order Tracking
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
1688 order list
|
|
110
|
+
1688 order list --status waitsellersend
|
|
111
|
+
1688 order list --status waitbuyerreceive
|
|
112
|
+
1688 order get <orderId>
|
|
113
|
+
1688 order logistics <orderId>
|
|
114
|
+
1688 shipped <orderId>
|
|
115
|
+
1688 stuck [--days N]
|
|
116
|
+
1688 fake-shipped [--days N] [--debug]
|
|
117
|
+
1688 seller-history <sellerName>
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Status filters:
|
|
121
|
+
|
|
122
|
+
| Value | Meaning |
|
|
123
|
+
|---|---|
|
|
124
|
+
| `all` | All orders |
|
|
125
|
+
| `waitbuyerpay` | Pending payment |
|
|
126
|
+
| `waitsellersend` | Paid, seller has not shipped |
|
|
127
|
+
| `waitbuyerreceive` | Shipped, awaiting delivery |
|
|
128
|
+
| `success` | Completed |
|
|
129
|
+
| `cancel` | Canceled |
|
|
130
|
+
|
|
131
|
+
## Post-Sale Chat
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
1688 seller chat <orderId|loginId> <message>
|
|
135
|
+
1688 seller chat <orderId> <message> --no-card
|
|
136
|
+
1688 seller messages <orderId>
|
|
137
|
+
1688 seller messages <orderId> --watch
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
With an `orderId`, chat auto-attaches the order card unless `--no-card` is
|
|
141
|
+
given.
|
|
142
|
+
|
|
143
|
+
## Account And Daemon
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
1688 login
|
|
147
|
+
1688 login --headed
|
|
148
|
+
1688 login --force
|
|
149
|
+
1688 logout [--yes]
|
|
150
|
+
1688 whoami [--verify]
|
|
151
|
+
1688 doctor [--no-launch]
|
|
152
|
+
1688 daemon start | stop | status | reload
|
|
153
|
+
1688 serve
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
## Output Flags
|
|
157
|
+
|
|
158
|
+
Every command supports:
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
--json # force JSON output even in a TTY
|
|
162
|
+
--pretty # indent JSON by 2 spaces
|
|
163
|
+
--get <path> # print one field by dot-path
|
|
164
|
+
--pick <paths> # comma-separated dot-paths as a JSON object
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
Examples:
|
|
168
|
+
|
|
169
|
+
```bash
|
|
170
|
+
1688 offer X --get supplier.name
|
|
171
|
+
1688 offer X --get supplier
|
|
172
|
+
1688 offer X --get 'skus[*].price'
|
|
173
|
+
1688 offer X --pick price,supplier.name
|
|
174
|
+
1688 offer X --json --pretty
|
|
175
|
+
1688 research 手机壳 数据线 --jsonl
|
|
176
|
+
1688 research 手机壳 --csv --output research.csv
|
|
177
|
+
1688 compare 123 456 --csv
|
|
178
|
+
1688 supplier inspect 628196518518 --json --pretty
|
|
179
|
+
1688 supplier search 键盘 --json --pretty
|
|
180
|
+
1688 supplier research 键盘 --csv --output suppliers.csv
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
## Agent-Friendly Pipelines
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
1688 search 雨伞 | jq '.offers[0:5]'
|
|
187
|
+
1688 order list --status waitsellersend | jq '.orders[] | {id: .orderId, paid: .paidAt}'
|
|
188
|
+
id=$(1688 cart add <offerId> --sku <skuId> --qty 1 | jq -r '.added.cartId')
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
PowerShell without `jq`:
|
|
192
|
+
|
|
193
|
+
```powershell
|
|
194
|
+
1688 offer <offerId> --get supplier.name
|
|
195
|
+
1688 supplier search 键盘 --pick total,source.kind,'items[0].supplier.companyName'
|
|
196
|
+
$added = 1688 cart add <offerId> --sku <skuId> --qty 1 --json | ConvertFrom-Json
|
|
197
|
+
1688 cart remove $added.added.cartId
|
|
198
|
+
1688 supplier research 键盘 --csv --output "$env:TEMP\suppliers.csv"
|
|
199
|
+
```
|
package/docs/FEATURES.md
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Feature Backlog
|
|
2
|
+
|
|
3
|
+
This file records product ideas that should survive chat context loss. Status
|
|
4
|
+
is intentionally lightweight: `Idea`, `Planned`, `Active`, or `Done`.
|
|
5
|
+
|
|
6
|
+
Last updated: 2026-06-04
|
|
7
|
+
|
|
8
|
+
## Sourcing Research
|
|
9
|
+
|
|
10
|
+
| Feature | Status | Notes |
|
|
11
|
+
|---|---|---|
|
|
12
|
+
| `1688 search --sort` | Done | Added `relevance`, `best-selling`, `price-asc`, and `price-desc`; local deterministic sorting is the contract, with remote sort hints where known. |
|
|
13
|
+
| Search filters | Done | Added price range, province/city, verified supplier, minimum turnover/order count, and optional ad exclusion. |
|
|
14
|
+
| `1688 research <keyword...>` | Done | Multi-keyword research records `sourceKeyword`, rank, demand signals, supplier trust signals, score, JSON/JSONL/CSV output. |
|
|
15
|
+
| Top-N enrichment | Done | `research --enrich top:N` enriches only top N results through `offer` detail extraction. |
|
|
16
|
+
| Supplier quality fields | Planned | Basic service tags, product badges, demand, and verification fields are additive; deeper trade-service scores still need reliable payload mapping. |
|
|
17
|
+
| `1688 supplier inspect` | Done | Inspect supplier/factory trust signals from offerId or `b2b-*` memberId. loginId-only lookup is intentionally rejected until a deterministic resolver exists. |
|
|
18
|
+
| `1688 supplier search` | Done | Supplier discovery now comes from 1688 company search (`companySearchBusinessService`) with GBK keyword encoding, not offer-result aggregation. |
|
|
19
|
+
| `1688 supplier research` | Done | Scores company-search suppliers and optionally enriches top N via `supplier inspect`; supports JSONL/CSV export. |
|
|
20
|
+
| `1688 compare <offerId...>` | Done | Compares price tiers, MOQ, sales signals, supplier identity, SKU depth, stock, freight/package hints, and score. |
|
|
21
|
+
| Export formats | Done | Added `--jsonl` and `--csv` for research datasets while keeping normal command JSON stable for agents. |
|
|
22
|
+
| Sourcing score | Done | Computed, explainable V1 score from price, demand, supplier tenure, verification, tags, and ad status. |
|
|
23
|
+
|
|
24
|
+
## Agent Maps
|
|
25
|
+
|
|
26
|
+
| Feature | Status | Notes |
|
|
27
|
+
|---|---|---|
|
|
28
|
+
| Short agent entrypoint | Done | `AGENTS.md` is now a concise routing map; durable detail moved into `docs/`. |
|
|
29
|
+
| Documentation map | Done | `docs/README.md` now maps commands, JSON contracts, safety, reliability, workflow, specs, playbooks, exec plans, and generated indexes. |
|
|
30
|
+
| Architecture map | Done | `ARCHITECTURE.md` describes CLI layers, command ownership, session/daemon boundaries, and verification surfaces. |
|
|
31
|
+
| Specs directory | Done | Domain specs live under `docs/specs/` instead of `docs/product-specs/`. |
|
|
32
|
+
| Playbooks | Done | Added playbooks for adding commands, changing JSON output, debugging risk control, adding mtop capture, and release/update work. |
|
|
33
|
+
| Generated context | Done | `scripts/generate_agent_context.mjs` generates command, module, test, and JSON-shape indexes under `docs/generated/`. |
|
|
34
|
+
| Agent verification gate | Done | Added `pnpm agent-context`, `pnpm docs-check`, `pnpm agent-map-check`, `pnpm test:unit`, and `pnpm agent-verify`. |
|
|
35
|
+
| Agent map grader | Done | `scripts/check_agent_map.mjs` checks required docs, generated indexes, package scripts, and short-map constraints. |
|
|
36
|
+
| Quality score | Done | `docs/QUALITY_SCORE.md` tracks agent-readiness, known gaps, and latest verification. |
|
|
37
|
+
| Live doctor gate split | Planned | Full `pnpm test` still includes `tests/doctor-live.test.ts`; consider adding explicit `pnpm test:live` and making `pnpm test` deterministic or clearly documented. |
|
|
38
|
+
| JSON schema/snapshot tests | Idea | Add tests that lock stable agent-facing JSON contracts beyond the heuristic `docs/generated/json-shapes.md` index. |
|
|
39
|
+
| AST-based JSON shape index | Idea | Replace the current regex/heuristic interface extractor with TypeScript AST parsing when shape extraction needs more precision. |
|
|
40
|
+
|
|
41
|
+
## Platform Compatibility
|
|
42
|
+
|
|
43
|
+
| Feature | Status | Notes |
|
|
44
|
+
|---|---|---|
|
|
45
|
+
| Windows CLI compatibility baseline | Done | Implemented cross-platform build, root-hashed Windows named-pipe daemon isolation, platform-aware doctor/postinstall hints, `os.tmpdir()` debug paths, PowerShell docs, and deterministic tests. Verified with focused tests, `pnpm build`, `pnpm test:unit`, `pnpm agent-verify`, and `npm pack --dry-run`; manual Windows smoke checklist remains documented in the spec. |
|