sil-openclaw 0.3.7 → 0.3.9
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/CHANGELOG.md +113 -0
- package/dist/lib/bind-channel.js +10 -0
- package/dist/tools/identity.js +9 -0
- package/openclaw.plugin.json +1 -1
- package/package.json +3 -2
- package/scripts/create-shopper.mjs +678 -0
- package/sil-shopping/SKILL.md +98 -36
- package/sil-shopping/examples/multi_domain_shopper_walkthrough.md +64 -136
- package/sil-shopping/references/agent_creation_engine.md +123 -63
- package/sil-shopping/references/brainstorm_interview.md +95 -59
- package/sil-shopping/references/catalog_tools_reference.md +27 -29
- package/sil-shopping/references/manage_domains.md +60 -39
- package/sil-shopping/references/refine_shopper.md +92 -43
- package/sil-shopping/references/search_param_mapping.md +71 -47
- package/sil-shopping/references/setup_onboarding.md +68 -0
- package/sil-shopping/references/shop_loop.md +161 -106
|
@@ -1,109 +1,164 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
- **
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
##
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
1
|
+
---
|
|
2
|
+
name: shop-loop
|
|
3
|
+
description: The Spec-Driven Shopping loop — the one shopper shops any niche, reusing or minting a domain on the fly, then decomposing the request and learning from it. Load when running as the shopper and the user states a shopping intent.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Shop-time loop — how the one shopper shops any niche
|
|
7
|
+
|
|
8
|
+
Load this when you (the sil skill) run as the user's **shopper** and they state a
|
|
9
|
+
shopping intent. There is **one shopper** — a generalist holding **many domains**
|
|
10
|
+
(niches), each **minted lazily on first shop**. The [engine's Runtime
|
|
11
|
+
hook](agent_creation_engine.md) leaves you here: the persona is injected via
|
|
12
|
+
**`SOUL.md`**, and the skill has read the shared **`user_spec.md`** (cross-niche facts +
|
|
13
|
+
hard constraints, reused across every niche) plus the slug-keyed **`domains`** map from
|
|
14
|
+
`$SIL_DATA_DIR/shopper/profile.json`.
|
|
15
|
+
|
|
16
|
+
This is **Spec-Driven Shopping (SDS)**: a fact from niche A is reused in niche B without
|
|
17
|
+
being re-asked, while each domain's **`domain_spec.md`** (deep niche expertise),
|
|
18
|
+
**`intent_spec.md`** (decomposition schema), and **`playbook.md`** (the **shopping
|
|
19
|
+
taste**) stay niche-scoped — taste does not leak, only shared facts carry. Behave like a
|
|
20
|
+
specialist in the persona's voice; apply the rubric at reasoning time, not via a new tool.
|
|
21
|
+
|
|
22
|
+
## The five beats — run every query, in order
|
|
23
|
+
|
|
24
|
+
A beat only **asks** when something is genuinely unresolved; a fully-resolved query asks
|
|
25
|
+
nothing and passes straight through.
|
|
26
|
+
|
|
27
|
+
1. **Domain-exists check** — classify the niche, reuse a matching domain or register a miss.
|
|
28
|
+
2. **Learn on a miss** (or refresh on a hit) — the pack is present and current before you search.
|
|
29
|
+
3. **Gather what's missing before searching** — resolve each dimension, then ask only what's unresolved.
|
|
30
|
+
4. **Persist what surfaced** — a single `sil_remember` per new fact or taste.
|
|
31
|
+
5. **Search → rubric → recommend-with-why → re-fetch before purchase.**
|
|
32
|
+
|
|
33
|
+
## Beat 1 — Domain-exists check
|
|
34
|
+
|
|
35
|
+
Name the **shopping niche** this request belongs to ("a waterproof trail shoe for a wet
|
|
36
|
+
ultra" → trail running) — your reasoning, no tool call. Then read `profile.json.domains`
|
|
37
|
+
(via the no-args `sil_profile_get`) and match the niche **semantically, not by exact
|
|
38
|
+
string**. If a domain covers it, **reuse it** and go to the gate. **Reuse-before-mint**
|
|
39
|
+
is the shop loop's job: the store enforces only shape, so without **semantic dedup** the
|
|
40
|
+
shopper fragments into duplicate thin packs (`cycling`, `road-cycling`,
|
|
41
|
+
`bikes` for one niche). Torn between a close existing slug and a new one, prefer the
|
|
42
|
+
existing. No match ⇒ register a **miss** for Beat 2.
|
|
43
|
+
|
|
44
|
+
## Beat 2 — Learn the domain (mint on a miss, refresh on a hit)
|
|
45
|
+
|
|
46
|
+
**On a miss — mint the domain on the fly, announced.** Tell the user, in the shopper's
|
|
47
|
+
voice — **never silently** — that this is a new niche ("I haven't shopped cycling for
|
|
48
|
+
you yet — setting that up"), and **state the inferred niche so the user can correct it**.
|
|
49
|
+
**Research** it (web + knowledge) into a **deep `domainSpec`** (a shallow bullet list a
|
|
50
|
+
layperson could write fails the SDS bar), derive the **`intentSpec`** dimensions, and
|
|
51
|
+
seed a partial **`playbook`**. No web tool? Say so and compose from public knowledge —
|
|
52
|
+
never present a guess as verified research. Persist with the **whole-doc**
|
|
53
|
+
**`sil_profile_materialize { name, userSpec, domain: { slug, name, domainSpec,
|
|
54
|
+
intentSpec, playbook } }`** — the deduped slug from Beat 1, `userSpec` re-persisted
|
|
55
|
+
atomically alongside. One atomic call upserts `domains[slug]`. Never `sil_remember`.
|
|
56
|
+
|
|
57
|
+
**On a hit — web-refresh the active domain's `domain_spec.md`** so it stays current, and
|
|
58
|
+
persist by re-running `sil_profile_materialize` with the `domain` object carrying the
|
|
59
|
+
fresh `domainSpec`. A real web step — no web tool? Say so and proceed on the existing
|
|
60
|
+
spec; never pretend the refresh happened.
|
|
61
|
+
|
|
62
|
+
## Beat 3 — Gather what's missing before searching
|
|
63
|
+
|
|
64
|
+
Runs to completion **before any `sil_search`**. Read the active `intent_spec.md`
|
|
65
|
+
dimensions and fill them for **this** request ("a waterproof trail shoe for a wet ultra,
|
|
66
|
+
around €160" → use-case: trail/ultra; weather: wet; budget: ~€160). This filled
|
|
67
|
+
**per-query intent** is **ephemeral** — it lives only in this conversation and is
|
|
68
|
+
**never persisted**; only the `intent_spec.md` *schema* is stored.
|
|
69
|
+
|
|
70
|
+
Resolve each dimension against — in order — the **request**, the shared **`user_spec`**,
|
|
71
|
+
the active **`playbook`**, and any defensible `domain_spec` default. Then **elicit only
|
|
72
|
+
what is genuinely unresolved** — a dimension the `domain_spec`/`intent_spec` marks
|
|
73
|
+
**load-bearing** *and* still unfilled. Ask in the persona's voice, a few at a time, each
|
|
74
|
+
tied to *why* — never a battery. A stored attribute is never re-asked. When everything
|
|
75
|
+
load-bearing is covered, **ask nothing and pass straight through** to Beat 5. If the user
|
|
76
|
+
skips a question, proceed on the best defensible params and state what you assumed — a
|
|
77
|
+
declined question narrows quality, never access.
|
|
78
|
+
|
|
79
|
+
## Beat 4 — Persist what surfaced (fact → shared user spec, taste → active domain)
|
|
80
|
+
|
|
81
|
+
When the interaction surfaces a new user **fact** or **shopping taste**, persist it with
|
|
82
|
+
a **single `sil_remember`** — fired **only when something new surfaced**:
|
|
83
|
+
|
|
84
|
+
- A **fact / measurement / hard constraint** → **`sil_remember { kind: "fact", text,
|
|
85
|
+
hard? }`** — the cheap append to the **shared** `user_spec.md`. A fact carries across
|
|
86
|
+
every niche (no `domain`). Mark a never-break rule (an allergy, an ethics rule, an age
|
|
87
|
+
gate) with **`hard: true`**; a bendable fact is a soft entry.
|
|
88
|
+
- A **shopping taste** (budget band, brand leaning) → **`sil_remember { kind: "taste",
|
|
89
|
+
text, domain }`** — one entry to **this niche's** `playbook.md`, the **active domain**.
|
|
90
|
+
Pass the active `domain` slug (with 2+ domains, omitting it is rejected). Taste is soft
|
|
91
|
+
and scoped to this domain.
|
|
92
|
+
|
|
93
|
+
Reserve the **whole-doc** `sil_profile_materialize` for the heavy paths only — the Beat-2
|
|
94
|
+
mint, the web refresh, a full **refine** ([`refine_shopper.md`](refine_shopper.md)), and
|
|
95
|
+
**contradiction-resolution** (a new statement contradicting a stored *soft* preference is
|
|
96
|
+
a visible whole-doc rewrite; an append is accretive, never corrective). One learning per
|
|
97
|
+
call; if nothing surfaced, no call. Capture is **in the open** — never silently harvested
|
|
98
|
+
— reviewable with `sil_profile_get`, erasable with `sil_profile_remove`, per-user and
|
|
99
|
+
local under `$SIL_DATA_DIR/shopper/`.
|
|
55
100
|
|
|
56
101
|
### Layering — precedence intent > playbook(domain) > user_spec(SHARED) > domain_spec(domain)
|
|
57
102
|
|
|
58
|
-
- **Intent**
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
103
|
+
- **Intent** narrows the field. **Playbook** shapes preferences within it. **User spec**
|
|
104
|
+
(the **shared** spec) fills standing **facts** the request left unsaid and carries the
|
|
105
|
+
**hard constraints**. **Domain spec** supplies the decision-mechanics — the substrate.
|
|
106
|
+
|
|
107
|
+
A specific request overrides a standing taste, over a soft fact-preference, over a domain
|
|
108
|
+
default. **Hard constraints are inviolable:** a shared `user_spec.md` **hard constraint**
|
|
109
|
+
is **never overridden** by intent, taste, the domain, or the catalog. Route each to a
|
|
110
|
+
real enforcement point — a `sil_search` filter where one exists (`condition`,
|
|
111
|
+
`available`, per [`search_param_mapping.md`](search_param_mapping.md)) **and** a
|
|
112
|
+
reject-at-pick rubric rule (rejected outright, not down-weighted). A constraint carried
|
|
113
|
+
only as free-text `query` is not enforced.
|
|
114
|
+
|
|
115
|
+
## Beat 5 — Search → rubric → recommend-with-why → re-fetch before purchase
|
|
116
|
+
|
|
117
|
+
Best-first, never re-rank, reject-at-pick for hard constraints, re-fetch before purchase.
|
|
118
|
+
|
|
119
|
+
**Map the answers to `sil_search` params.** Translate each filled dimension — plus the
|
|
120
|
+
shared facts, this domain's taste, and the domain-spec mechanics — to real params per
|
|
121
|
+
[`search_param_mapping.md`](search_param_mapping.md) (that reference owns the table; do
|
|
122
|
+
not re-carry it). A taste with no matching param folds into `query` or the rubric —
|
|
123
|
+
**never invent a filter**. Leave **`ship_to` empty** so the server resolves the
|
|
124
|
+
registered default; do not call `sil_whoami` to populate it.
|
|
125
|
+
|
|
126
|
+
**Search.** Call `sil_search` with the mapped params. It returns purchasable variants
|
|
127
|
+
best-first.
|
|
128
|
+
|
|
129
|
+
**Compare on the rubric — reject hard-constraint violators outright.** Build the rubric
|
|
130
|
+
from the active domain-spec dimensions, weighted by this domain's taste, the shared user
|
|
131
|
+
facts, and the per-query intent. A hard constraint is a **reject-at-pick** rule: a
|
|
132
|
+
violating candidate is removed from contention, never the pick. Present results
|
|
133
|
+
**best-first** as returned — **never re-rank** — but a violator is never the pick.
|
|
134
|
+
|
|
135
|
+
**Recommend — always with the "why" that cites the layers.** The "why" must cite the
|
|
136
|
+
per-query intent, at least one stored shared fact or this-domain taste you did **not**
|
|
137
|
+
re-ask ("you're a wide D-width, kept from before"), and at least one researched
|
|
138
|
+
domain-spec dimension ("for trail running, last volume and lug depth matter more than
|
|
139
|
+
weight here"). A "why" naming no researched dimension and reusing no stored attribute is
|
|
140
|
+
generic attribute matching and **fails the SDS bar** even if the product is fine. Never
|
|
141
|
+
hand back a bare list.
|
|
142
|
+
|
|
143
|
+
**Re-fetch with `sil_product_get` before any buy.** Price, availability, and
|
|
144
|
+
`checkout_url` from `sil_search` are **point-in-time**. Before any buy / checkout,
|
|
145
|
+
re-fetch the chosen item with `sil_product_get`. Never commit a buy off the stale
|
|
146
|
+
`sil_search` snapshot.
|
|
147
|
+
|
|
148
|
+
**After every recommendation, before the turn ends,** persist anything the interaction
|
|
149
|
+
newly surfaced that Beat 4 did not capture — each via a single `sil_remember` (a fact
|
|
150
|
+
`kind: "fact"` → shared user spec; a taste `kind: "taste"` + the active `domain` → this
|
|
151
|
+
domain's playbook) — and **only when something surfaced** (no empty, duplicate, or noise
|
|
152
|
+
entries).
|
|
153
|
+
|
|
154
|
+
## Empty, unservable, and non-`ok` results
|
|
155
|
+
|
|
156
|
+
- **`ok` with `products: []`** — a normal, servable outcome. **Relax or re-frame** the
|
|
157
|
+
params and **explain** the change ("I dropped the secondhand-only filter — here's
|
|
158
|
+
what's in stock"). Never stop silently.
|
|
159
|
+
- **Genuinely unservable** (out of scope, not shippable, age-gated, or persistently
|
|
160
|
+
empty after a reasonable relax) — say so **honestly**. Never fabricate options and
|
|
161
|
+
never pad with junk.
|
|
162
|
+
- **A non-`ok` status** is not an empty match — do not relax the params. **Follow the
|
|
163
|
+
tool's own `recovery`** exactly and never improvise. The taxonomy lives in
|
|
164
|
+
[`catalog_tools_reference.md`](catalog_tools_reference.md); load it, don't re-carry it.
|