sil-openclaw 0.3.9 → 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.
- package/CHANGELOG.md +124 -0
- package/dist/lib/profile-store.js +578 -581
- package/dist/lib/sil-client.js +282 -33
- package/dist/tools/catalog.js +475 -7
- package/dist/tools/profile.js +229 -371
- package/openclaw.plugin.json +6 -4
- package/package.json +1 -1
- package/scripts/create-shopper.mjs +71 -40
- package/sil-shopping/SKILL.md +65 -89
- package/sil-shopping/examples/multi_domain_shopper_walkthrough.md +34 -103
- package/sil-shopping/references/agent_creation_engine.md +177 -118
- package/sil-shopping/references/fill_and_feedback.md +86 -0
- package/sil-shopping/references/method_and_prds.md +111 -0
- package/sil-shopping/references/setup_onboarding.md +48 -52
- package/sil-shopping/references/shop_loop.md +109 -160
- package/sil-shopping/references/brainstorm_interview.md +0 -97
- package/sil-shopping/references/catalog_tools_reference.md +0 -44
- package/sil-shopping/references/manage_domains.md +0 -77
- package/sil-shopping/references/refine_shopper.md +0 -97
- package/sil-shopping/references/search_param_mapping.md +0 -79
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: manage-domains
|
|
3
|
-
description: View or forget the shopper's learned domains — the two sil_profile tools, the two remove granularities, confirm-before-remove. Load when the user wants to see what the shopper knows or forget a niche.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Manage your shopper's domains — view, forget
|
|
7
|
-
|
|
8
|
-
Load this when the user wants to see what their **shopper** knows or **forget a domain**
|
|
9
|
-
(a niche) — "what does my shopper know?", "which domains has it learned?", "show me the
|
|
10
|
-
cycling domain", "forget the grocery niche". The router names which `sil_profile_*` tool
|
|
11
|
-
each intent maps to; this reference is what those tools do, plus the **two remove
|
|
12
|
-
granularities** and the confirm-before-remove gate.
|
|
13
|
-
|
|
14
|
-
These are pure local-lifecycle operations — no server call, no token read. The shopper is
|
|
15
|
-
a **singleton** scoped to the fixed `$SIL_DATA_DIR/shopper/` path, so these tools take
|
|
16
|
-
**no caller `agentId`** — only an optional `domainSlug`. **The source of truth is the sil
|
|
17
|
-
artefact store, not the host agent list:** `$SIL_DATA_DIR/shopper/` with a readable
|
|
18
|
-
`profile.json` IS the shopper; its `domains` map is the niche index. Always read
|
|
19
|
-
`profile.json`, **never the host agent list**, to decide what exists.
|
|
20
|
-
|
|
21
|
-
## Match intent to a tool
|
|
22
|
-
|
|
23
|
-
| Intent | Tool |
|
|
24
|
-
|---|---|
|
|
25
|
-
| "what does my shopper know?" / "which domains has it learned?" (overview) | `sil_profile_get` (no `domainSlug`) |
|
|
26
|
-
| "show me / tell me about the <niche> domain" | `sil_profile_get` (pass the `domainSlug`) |
|
|
27
|
-
| "forget / remove / delete the <niche> domain" | `sil_profile_remove` (pass the `domainSlug`) |
|
|
28
|
-
| "decommission / tear down my whole shopper" | host CLI `openclaw agents remove <agentId>` **FIRST**, then clear the artefact tree |
|
|
29
|
-
|
|
30
|
-
## How `sil_profile_get` reads the singleton shopper
|
|
31
|
-
|
|
32
|
-
- **No `domainSlug` (overview):** returns the `name`, the shared `userSpec` (cross-niche
|
|
33
|
-
facts + hard constraints), the **`domains` index** (each niche's `slug`/`name`/
|
|
34
|
-
timestamps — no bodies), plus any degraded directory in **`unreadable`**. A shopper
|
|
35
|
-
with **no domains yet still reads `ok`, empty index — healthy** (the first shop mints
|
|
36
|
-
one); so does an empty store ("you haven't set up a shopper yet" → point at create —
|
|
37
|
-
still `ok`, never `not_found`). Render a human summary (shopper, what it knows, domains
|
|
38
|
-
learned, wiring); a flat-layout leftover from the old one-agent-per-niche model reads
|
|
39
|
-
as `unreadable` — frame it as an old-model leftover, do not read it as a domain.
|
|
40
|
-
- **With a `domainSlug`:** returns that niche's pack (`domainSpec` + `intentSpec` +
|
|
41
|
-
`playbook`) plus the shared `userSpec`. An unminted/unloadable domain returns
|
|
42
|
-
`not_found` (its `recovery` is the no-args `sil_profile_get`) — frame it plainly and
|
|
43
|
-
list what DOES exist. **Never surface a stack trace or a raw filesystem path.**
|
|
44
|
-
|
|
45
|
-
## The two remove granularities
|
|
46
|
-
|
|
47
|
-
Removal is **destructive and irreversible**, so **confirm before removing**: state
|
|
48
|
-
exactly what will be deleted and proceed only on the user's **explicit go-ahead**. When
|
|
49
|
-
ambiguous, ask.
|
|
50
|
-
|
|
51
|
-
**Forget ONE domain (`sil_profile_remove`).** "forget the grocery niche", "remove the
|
|
52
|
-
cycling domain", **"delete the grocery agent"** all mean **forget that one DOMAIN** — the
|
|
53
|
-
niche pack only. The shopper, the shared user spec, and every **sibling domain survive**;
|
|
54
|
-
no host wiring is touched. Call **`sil_profile_remove { domainSlug }`** — `domainSlug` is
|
|
55
|
-
**REQUIRED**. A malformed/traversal/`main`/missing slug returns `invalid_request` and
|
|
56
|
-
deletes nothing; an unregistered slug returns `not_found` (idempotent); a filesystem
|
|
57
|
-
failure returns `persistence_failed`.
|
|
58
|
-
|
|
59
|
-
**Decommission the WHOLE shopper (host-CLI-first).** Remove the entire shopper — host
|
|
60
|
-
wiring + `SOUL.md` + the whole artefact tree: (1) `openclaw agents list --json` to
|
|
61
|
-
confirm the `agentId`; (2) `openclaw agents remove <agentId>` then `openclaw config
|
|
62
|
-
validate --json` — the plugin cannot write host config, so this half runs **first**; (3)
|
|
63
|
-
clear the whole `$SIL_DATA_DIR/shopper/` tree. Host-first is a safety order: a failed
|
|
64
|
-
artefact step after the host removal leaves only harmless residual artefacts, whereas the
|
|
65
|
-
reverse leaves a host entry whose `profile.json` is gone — a visibly broken shopper. Both
|
|
66
|
-
halves are idempotent. Leave `plugins.entries.sil.enabled` alone — it is shared host
|
|
67
|
-
state for a future re-create.
|
|
68
|
-
|
|
69
|
-
## Status taxonomy (manage: view / remove)
|
|
70
|
-
|
|
71
|
-
| `status` | Meaning | What to do |
|
|
72
|
-
|---|---|---|
|
|
73
|
-
| `ok` | A view returned the overview (a `domains` map may be empty — normal; an absent shopper is still `ok`) or one domain's detail. | Relay the data; on an empty index, point at "just shop a niche". |
|
|
74
|
-
| `not_found` | No domain matches the `domainSlug`. Its `recovery` is the no-args `sil_profile_get`. | Frame it plainly and list what DOES exist; for remove, a re-run is safe. |
|
|
75
|
-
| `invalid_request` | The `domainSlug` was malformed, `main`, traversal-shaped, or (remove) missing. **Nothing read or deleted.** | Fix the slug and call again — never a stack trace or raw path. |
|
|
76
|
-
| `removed` | `sil_profile_remove` deleted exactly one domain pack. | Confirm that niche is gone; the shopper + shared user spec + sibling domains are untouched. |
|
|
77
|
-
| `persistence_failed` | The domain directory could not be removed (the **path** + **cause** name what to fix). | Fix the data directory (writable), then remove again. |
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: refine-shopper
|
|
3
|
-
description: The refinement loop — sharpen the shopper or one domain from observed sessions, confirm-before-persist. Load when the user asks to refine, sharpen, or amend their shopper or a niche.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Refine your shopper or one of its domains — the refinement loop
|
|
7
|
-
|
|
8
|
-
When the user wants to **sharpen their shopper** — "refine my shopper", "the cycling
|
|
9
|
-
domain keeps surfacing the wrong stuff", "amend what you know about me" — do **not**
|
|
10
|
-
re-onboard and do **not** quietly mutate anything. Run this **targeted-amend** loop:
|
|
11
|
-
load the relevant artefact, propose refinements drawn from what the shopper actually
|
|
12
|
-
**observed** in real sessions, let the user **confirm a subset**, and persist **only**
|
|
13
|
-
the confirmed subset. Nothing changes silently; nothing persists without confirmation.
|
|
14
|
-
|
|
15
|
-
Refine has **two targets**:
|
|
16
|
-
|
|
17
|
-
- **The shopper itself** — the **shared `user_spec.md`** (cross-niche facts + hard
|
|
18
|
-
constraints), or the **persona** (the host `SOUL.md`).
|
|
19
|
-
- **One domain** — a single niche **domain pack**, targeted by **slug**: its
|
|
20
|
-
`domain_spec.md`, `intent_spec.md`, or `playbook.md`.
|
|
21
|
-
|
|
22
|
-
This is distinct from creating the shopper
|
|
23
|
-
([`agent_creation_engine.md`](agent_creation_engine.md)) and from the shop loop (which
|
|
24
|
-
SHOPS). Run the steps **in order**.
|
|
25
|
-
|
|
26
|
-
## The refinement loop
|
|
27
|
-
|
|
28
|
-
1. **Trigger + load the target.** Refinement starts only when the user **explicitly
|
|
29
|
-
asks** to sharpen the shopper or a **named** domain. At session end you MAY *offer*
|
|
30
|
-
to refine, but that offer loads/proposes/persists nothing until the user accepts and
|
|
31
|
-
clears the confirm gate (step 3). Load with **`sil_profile_get { domainSlug? }`** —
|
|
32
|
-
the overview (no slug) for the shopper, or a `domainSlug` for one domain's pack (+
|
|
33
|
-
the shared `userSpec`). Read the persona from the host **`SOUL.md`** when it is on
|
|
34
|
-
the table.
|
|
35
|
-
2. **Propose, session-grounded — never a generic template.** Propose a small set of
|
|
36
|
-
**concrete refinements drawn from the observed session** — what the shopper actually
|
|
37
|
-
saw. Each proposal names **which artefact element it changes** (a persona rule, a
|
|
38
|
-
shared `user_spec.md` fact/constraint, or — within one named domain — a
|
|
39
|
-
`domain_spec.md` mechanic, an `intent_spec.md` dimension, or a `playbook.md` taste)
|
|
40
|
-
**and the concrete observed evidence** (a param mapping that returned relevant vs
|
|
41
|
-
irrelevant items, a candidate accepted or rejected, a fact the user volunteered but
|
|
42
|
-
the spec never captured — "you said 'nothing over 8kg' three times" → a shared hard
|
|
43
|
-
constraint; "you kept asking about lug depth" → that domain's `domain_spec.md`).
|
|
44
|
-
Scope each correctly: a cross-niche fact/constraint or persona change targets the
|
|
45
|
-
**shopper**; a niche-mechanical change targets **one domain's** pack. The per-query
|
|
46
|
-
intent is ephemeral and never a refine target — only a domain's `intent_spec.md`
|
|
47
|
-
*schema* is. Every proposal cites its evidence; an ungrounded one is not proposed.
|
|
48
|
-
3. **Confirm — the gate.** Present the proposals and let the user **confirm a subset** —
|
|
49
|
-
all, some, or none (per-proposal accept/reject). Confirmation is an explicit
|
|
50
|
-
affirmative act; it is **never inferred from silence**, and never from an
|
|
51
|
-
**off-topic** reply. Until the user confirms, the proposals live only in the
|
|
52
|
-
conversation. (This re-applies the create engine's endorsement discipline — see
|
|
53
|
-
[`brainstorm_interview.md`](brainstorm_interview.md); do not restate it here.)
|
|
54
|
-
4. **Persist ONLY the confirmed subset — scoped to the right target.** Fold **only the
|
|
55
|
-
confirmed** proposals in and re-run the engine's persist step — refine is a
|
|
56
|
-
**whole-doc** path, so it uses **`sil_profile_materialize`** (not `sil_remember`):
|
|
57
|
-
- A **shared user-spec** change → **`sil_profile_materialize { name, userSpec }`**
|
|
58
|
-
with **no `domain`** — overwrites only the shared `user_spec.md`.
|
|
59
|
-
- A **domain** change → **`sil_profile_materialize { name, userSpec, domain: { slug,
|
|
60
|
-
name, domainSpec, intentSpec, playbook } }`** scoped to **that one slug** —
|
|
61
|
-
re-mints exactly that `domains/<slug>/` pack; siblings + the shared spec untouched.
|
|
62
|
-
- A **persona** change → refresh the workspace **`SOUL.md`** via the host CLI — a
|
|
63
|
-
persona refinement is a host-CLI `SOUL.md` re-write, **not** a
|
|
64
|
-
`sil_profile_materialize` call.
|
|
65
|
-
The re-materialize is an **atomic in-place re-write** (the store's idiom; do not
|
|
66
|
-
hand-roll a write). **On a persist failure the prior artefacts are left intact** —
|
|
67
|
-
never a half-refined shopper — and you tell the user the refinement did not stick.
|
|
68
|
-
5. **Close the loop.** A later session loads the **updated** artefacts and behaves
|
|
69
|
-
accordingly. Refinement is iterative — a change that did not land is refinable next
|
|
70
|
-
time.
|
|
71
|
-
6. **Isolation.** A domain refinement touches exactly that one `domains/<slug>/` pack —
|
|
72
|
-
**siblings and the shared user spec are untouched** unless the shared spec is the
|
|
73
|
-
target — and the profile-less path is untouched. One target's sharpening never leaks
|
|
74
|
-
into another.
|
|
75
|
-
|
|
76
|
-
## Per-user + local
|
|
77
|
-
|
|
78
|
-
The improvement is **per-user and local**: written only to this user's sil data
|
|
79
|
-
directory (`$SIL_DATA_DIR/shopper/`), on this machine. No server-side aggregation, no
|
|
80
|
-
cross-user signal, no identity round-trip.
|
|
81
|
-
|
|
82
|
-
## How a refinement reaches the params
|
|
83
|
-
|
|
84
|
-
A refined fact / mechanic / dimension / taste lands in an artefact and feeds the
|
|
85
|
-
**shop-time** mapping ([`search_param_mapping.md`](search_param_mapping.md)) — real
|
|
86
|
-
`sil_search` params only; a refinement with no matching param folds into `query` or the
|
|
87
|
-
rubric, never an invented filter. The `ship_to` rule is unchanged (leave it empty; the
|
|
88
|
-
server resolves the registered default). **Do not restate the param table here** — point
|
|
89
|
-
at [`search_param_mapping.md`](search_param_mapping.md).
|
|
90
|
-
|
|
91
|
-
## When there is no observed-session signal
|
|
92
|
-
|
|
93
|
-
If the user asks to refine but **no observed session** is available (a fresh session, or
|
|
94
|
-
the prior one is out of context), do **not fabricate** observations. Fall back to a
|
|
95
|
-
**guided amend**: ask the user what to change (apply the same confirm-before-persist
|
|
96
|
-
gate), or **invite them to shop a session first** so the next refinement has real
|
|
97
|
-
evidence. Never invent observations.
|
|
@@ -1,79 +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. Under SDS there is no
|
|
16
|
-
stored "answer→param" seller artefact — *what* to search on for a niche lives in the
|
|
17
|
-
active domain's `domain_spec.md`; this reference covers only the SDS layers that feed
|
|
18
|
-
the mapping and 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:
|
|
23
|
-
|
|
24
|
-
- The **decomposed per-query intent** (the active `intent_spec.md` filled for this
|
|
25
|
-
request — ephemeral) is most specific and wins for *preferences* (precedence
|
|
26
|
-
**intent > playbook(domain) > user_spec(SHARED) > domain_spec(domain)**).
|
|
27
|
-
- The **shopping taste** (the active `playbook.md`) supplies standing preferences for
|
|
28
|
-
*this niche* — a budget band → `price_min`/`price_max` exactly like a freshly-stated
|
|
29
|
-
answer, but **never re-asked**. Taste is per-domain.
|
|
30
|
-
- The **shared user spec** (`user_spec.md`) supplies standing **facts** and the **hard
|
|
31
|
-
constraints**, reused across **every** niche — a fact maps to a param like any answer.
|
|
32
|
-
- The **domain spec** supplies the niche's decision-mechanics — which attributes are
|
|
33
|
-
load-bearing here — so the mapping knows what to map and what matters.
|
|
34
|
-
|
|
35
|
-
These layers are inputs to the same params, not new params. A stated taste with **no
|
|
36
|
-
matching param** (a colour, a brand, "eco-friendly") folds into the `query` text or the
|
|
37
|
-
recommendation rubric — **never a new filter**. There is no `color` or `brand` param;
|
|
38
|
-
inventing one emits invalid `sil_search` calls.
|
|
39
|
-
|
|
40
|
-
## Hard constraints — a real filter AND a reject-at-recommend rule, NEVER only `query`
|
|
41
|
-
|
|
42
|
-
A shared user-spec **hard constraint** ("never leather", "nothing over 8 kg", an
|
|
43
|
-
allergy, an age gate) is **inviolable** in every niche. A hard constraint carried
|
|
44
|
-
**only** as soft `query` text leaks — the catalog can still surface a violating item.
|
|
45
|
-
Route each to **two** points, **not merely `query`** (see
|
|
46
|
-
[`shop_loop.md`](shop_loop.md) Beat 5):
|
|
47
|
-
|
|
48
|
-
1. **A real `sil_search` filter where one exists** — "new/secondhand only" →
|
|
49
|
-
`condition`; "in stock only" → `available` (omit for the in-stock default). Where a
|
|
50
|
-
param matches, set it so the catalog never returns the violating item.
|
|
51
|
-
2. **An explicit reject-at-pick rubric rule** for a constraint with no matching param
|
|
52
|
-
(no `material` filter for "never leather"): the constraint **rejects** any violating
|
|
53
|
-
candidate outright, never down-weights it. A hard constraint is a reject, not a
|
|
54
|
-
weight.
|
|
55
|
-
|
|
56
|
-
## `ship_to` stays EMPTY by default
|
|
57
|
-
|
|
58
|
-
Do **not** map the user's location onto `ship_to`, and do **not** call `sil_whoami` to
|
|
59
|
-
populate it. When `ship_to` is absent, sil-api resolves the user's **registered default
|
|
60
|
-
address** server-side. Set `ship_to` only to OVERRIDE the default with a *different*
|
|
61
|
-
destination (e.g. "ship this to my office in Germany"). The shopper inherits
|
|
62
|
-
location-aware search by construction — leave `ship_to` out.
|
|
63
|
-
|
|
64
|
-
## Worked example
|
|
65
|
-
|
|
66
|
-
For a road-cycling domain whose user said (this request + a stored budget taste in that
|
|
67
|
-
domain) "secondhand is fine, I'm in France and want local shops":
|
|
68
|
-
|
|
69
|
-
```
|
|
70
|
-
query: "endurance road bike 105 groupset" # niche descriptors
|
|
71
|
-
category: "<the narrowed niche category>"
|
|
72
|
-
price_max: 120000 # €1200 → minor units (cents)
|
|
73
|
-
condition: ["secondhand"]
|
|
74
|
-
local_merchants: true # ranking bias; optionally query in French to surface more local shops
|
|
75
|
-
# ship_to: OMITTED — server resolves the registered default address
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
A non-param taste ("understated colours") folds into `query` or the rubric, never a new
|
|
79
|
-
filter.
|