sil-openclaw 0.4.0 → 0.4.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.
@@ -1,44 +0,0 @@
1
- ---
2
- name: catalog-tools-reference
3
- description: Per-tool behaviour of the four core sil tools (register, whoami, search, product-get) and the shared status taxonomy. Load when driving any core catalog or identity tool.
4
- ---
5
-
6
- # sil catalog + identity tools — per-tool behaviour and the shared status taxonomy
7
-
8
- Load this when driving any of the four core tools — `sil_register`, `sil_whoami`,
9
- `sil_search`, `sil_product_get`. The router names which tool an intent maps to; this
10
- reference is what each does, plus the status taxonomy they all share. All four return a
11
- single JSON body carrying a `status`; prices are in the currency's ISO 4217 minor unit.
12
-
13
- ## Per-tool behaviour
14
-
15
- - **`sil_register`** starts browser-based registration: it returns promptly with
16
- `status: "awaiting_browser"` and an `auth_url` — share that URL. The plugin polls in
17
- the background; once the user signs in, call `sil_register` again to confirm (it
18
- reports `already_registered`).
19
- - **`sil_whoami`** returns the registered user's identity (name + addresses). An expired
20
- token is refreshed transparently; a fully-dead session names the recovery
21
- (`sil_register`).
22
- - **`sil_search`** returns a ranked list of purchasable variants (`id`, `title`,
23
- `price`, `availability`, `checkout_url`, `source`), best match first — present in
24
- order, do not re-rank. An empty list is a normal `ok` outcome, not an error. Use the
25
- returned `cursor` for the next page; its absence means no more results.
26
- - **`sil_product_get`** is the lookup companion — pass ids you already hold and get the
27
- matching products back with fresh detail. Each variant carries an `inputs` list
28
- correlating it to the id(s) asked about (the response is not in request order). Ids
29
- that no longer resolve come back in a `not_found` list — a normal partial success.
30
-
31
- ## Status taxonomy (shared across the shopping tools)
32
-
33
- | `status` | Meaning | What to do |
34
- |---|---|---|
35
- | `ok` | Success. Catalog results may be empty (`products: []`) or partial (`not_found: [...]`) — still a success. | Relay the data. |
36
- | `not_registered` | No stored credentials. | Run `sil_register`, then retry the tool. |
37
- | `must_reregister` | The session is dead (refresh rejected / 401). | Run `sil_register` to sign in again, then retry. |
38
- | `forbidden` | Authenticated but not authorized (e.g. account not provisioned). | Follow the message; usually complete onboarding via `sil_register`. |
39
- | `invalid_request` | The query/ids were rejected (e.g. empty input). | Fix the input and call again — do NOT re-register. |
40
- | `retryable` | A transient network/5xx blip. | Try the same call again — do NOT re-register. |
41
-
42
- On a non-`ok` status, say what happened and follow the tool's own `recovery` hint —
43
- never improvise a different one (re-registering can't fix a bad query or a transient
44
- 5xx).
@@ -1,80 +0,0 @@
1
- ---
2
- name: search-param-mapping
3
- description: The shop-time answer→sil_search parameter mapping — real params only, hard-constraint routing, the ship_to rule. Load when mapping a decomposed request into a sil_search call.
4
- ---
5
-
6
- # Answer→`sil_search`-param mapping (the mapping is real)
7
-
8
- Load this at shop time, when the shop loop maps a decomposed request into a
9
- `sil_search` call ([`shop_loop.md`](shop_loop.md) Beat 5). The mapping targets the
10
- **real `sil_search` parameters** and nothing else — never invent a filter.
11
-
12
- **The param catalog lives in the `sil_search` tool description** — the full list and
13
- their forms (`query`/`category`; `price_min`/`price_max` in the currency's ISO 4217
14
- minor unit; `condition` = `["new"]`/`["secondhand"]`; `available`; `local_merchants`;
15
- `ship_to` as ISO codes). Read it there; do not restate it here. There is no stored
16
- "answer→param" seller artefact — *what* to search on for a niche lives in the active
17
- domain's **method**; this reference covers only the SDS layers that feed the mapping and
18
- the two rules the mapping must hold.
19
-
20
- ## What feeds the mapping — the SDS layers
21
-
22
- The mapping reads several layers, not just the user's words for this request (the fill
23
- precedence — see [`fill_and_feedback.md`](fill_and_feedback.md) — is
24
- **request-intent > PRD filled-pref > method taste > user_spec fact > method default**):
25
-
26
- - The **filled PRD** for this job is most specific and wins for *preferences* — its
27
- filled answers map onto params exactly like a freshly-stated answer, but **never
28
- re-asked**.
29
- - The buyer's durable per-domain **taste** (in the **method**) supplies standing
30
- preferences for *this niche* — a budget band → `price_min`/`price_max`.
31
- - The **shared user spec** (`user_spec.md`) supplies standing **facts** and the **hard
32
- constraints**, reused across **every** niche — a fact maps to a param like any answer.
33
- - The **method** supplies the niche's decision-mechanics — which attributes are
34
- load-bearing here — so the mapping knows what to map and what matters.
35
-
36
- These layers are inputs to the same params, not new params. A stated taste with **no
37
- matching param** (a colour, a brand, "eco-friendly") folds into the `query` text or the
38
- recommendation reflection — **never a new filter**. There is no `color` or `brand` param;
39
- inventing one emits invalid `sil_search` calls.
40
-
41
- ## Hard constraints — a real filter AND a reject-at-recommend rule, NEVER only `query`
42
-
43
- A shared user-spec **hard constraint** ("never leather", "nothing over 8 kg", an
44
- allergy, an age gate) is **inviolable** in every niche. A hard constraint carried
45
- **only** as soft `query` text leaks — the catalog can still surface a violating item.
46
- Route each to **two** points, **not merely `query`** (see
47
- [`shop_loop.md`](shop_loop.md) Beat 5):
48
-
49
- 1. **A real `sil_search` filter where one exists** — "new/secondhand only" →
50
- `condition`; "in stock only" → `available` (omit for the in-stock default). Where a
51
- param matches, set it so the catalog never returns the violating item.
52
- 2. **An explicit reject-at-pick rule** for a constraint with no matching param
53
- (no `material` filter for "never leather"): the constraint **rejects** any violating
54
- candidate outright, never down-weights it. A hard constraint is a reject, not a
55
- weight.
56
-
57
- ## `ship_to` stays EMPTY by default
58
-
59
- Do **not** map the user's location onto `ship_to`, and do **not** call `sil_whoami` to
60
- populate it. When `ship_to` is absent, sil-api resolves the user's **registered default
61
- address** server-side. Set `ship_to` only to OVERRIDE the default with a *different*
62
- destination (e.g. "ship this to my office in Germany"). The shopper inherits
63
- location-aware search by construction — leave `ship_to` out.
64
-
65
- ## Worked example
66
-
67
- For a road-cycling domain whose user said (this request + a stored budget taste in that
68
- domain) "secondhand is fine, I'm in France and want local shops":
69
-
70
- ```
71
- query: "endurance road bike 105 groupset" # niche descriptors
72
- category: "<the narrowed niche category>"
73
- price_max: 120000 # €1200 → minor units (cents)
74
- condition: ["secondhand"]
75
- local_merchants: true # ranking bias; optionally query in French to surface more local shops
76
- # ship_to: OMITTED — server resolves the registered default address
77
- ```
78
-
79
- A non-param taste ("understated colours") folds into `query` or the recommendation
80
- reflection, never a new filter.