sil-openclaw 0.2.4 → 0.3.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 CHANGED
@@ -10,6 +10,151 @@ release (`clawhub package publish --changelog`). See [README](./README.md#releas
10
10
 
11
11
  ## [Unreleased]
12
12
 
13
+ ## [0.3.1] - 2026-06-24
14
+
15
+ ### Added
16
+
17
+ - **Spec-Driven Shopping (SDS) is the operating model for created experts.** A
18
+ created shopping expert now runs **entirely** on SDS — not coarse attribute
19
+ matching, and not an optional layer. The persona left the sil store: it is the
20
+ agent's host workspace **`SOUL.md`** (identity/voice), written by the engine via
21
+ the host CLI — there is **no `persona.md`**. The sil store holds **four SDS
22
+ behaviour artefacts**: two **required at creation** — **`domain_spec.md`** (deep
23
+ *researched* niche expertise — how to buy well, the full mechanics; the agent
24
+ researches it itself from web + knowledge, and **web-refreshes it on every
25
+ query**) and **`intent_spec.md`** (the agent-specific **decomposition dimensions**,
26
+ a PRD-style schema derived from the domain) — and **`user_spec.md`** (the user's
27
+ domain-relevant facts + **hard constraints**) and **`playbook.md`** (the user's
28
+ **buying taste** — price sensitivity, brand, preferences). **All four are required
29
+ and present from creation** — seeded *partial* by the light setup, then **augmented
30
+ every query** (we keep learning), never re-asked. The per-query **intent** (the
31
+ dimensions filled in for one request) is
32
+ **ephemeral** — only the dimension *schema* is persisted. The shop-time loop
33
+ web-refreshes the domain, decomposes the request, lazily captures the user side,
34
+ and layers **intent → playbook → user_spec → domain_spec** (a user-spec **hard
35
+ constraint is inviolable** — routed to a real `sil_search` filter *and* a
36
+ reject-at-pick rubric rule, never only soft `query` text), recommending with a
37
+ "why" that visibly cites the intent + a stored user fact + a domain mechanic.
38
+ Setup stays **light (≤10 questions)** — the depth comes from the agent's own
39
+ research. All four artefacts ride the existing **`sil_profile_materialize`** store
40
+ path (`domainSpec` + `intentSpec` + `userSpec` + `playbook` all required) with
41
+ **no new tool** (the 8-tool manifest is unchanged) and the same atomic,
42
+ validate-first, per-file-all-or-nothing discipline. Refinement can target the
43
+ domain spec, the intent-spec dimensions, a user-spec fact/hard-constraint, or the
44
+ buying taste as distinct refinable elements (a persona refinement refreshes
45
+ `SOUL.md` via the host CLI).
46
+
47
+ ## [0.3.0] - 2026-06-23
48
+
49
+ ### Added
50
+
51
+ - **Create a tailored, sil-wired shopping expert — a real OpenClaw agent that
52
+ shops its niche with no further setup.** A new agent-creation engine (the `sil`
53
+ skill drives the host's own `openclaw` CLI — the plugin never writes the host
54
+ config) materializes a dedicated shopping expert: a real `agents.list[]` entry
55
+ with the **sil plugin enabled and the sil skill attached**, the persona injected
56
+ as the agent's `SOUL.md` system framing, and the behaviour artefacts written by
57
+ the new **`sil_profile_materialize`** tool into `$SIL_DATA_DIR/agents/<agentId>/`
58
+ (`persona.md`, an optional `playbook.md` domain sub-skill, and a `profile.json`
59
+ manifest the skill reads at runtime). The engine is validate-first and
60
+ fail-closed: it checks the spec before any write (`invalid_request` — nothing
61
+ written), refuses to clobber an existing agent (`collision` — never overwrites a
62
+ persona or its wiring), and declares `created` only after the host's **own**
63
+ `openclaw config validate` returns `valid: true` (any failed step is
64
+ `persistence_failed` carrying the path + cause, nothing partial left behind).
65
+ Creating an expert is **local and offline** — no registration, no token read,
66
+ no network call; the expert registers the user later, on first shop. Host-CLI
67
+ shapes are pinned to **`alpine/openclaw:2026.6.9`** (the sil-stage host). (#27,
68
+ #30)
69
+ - **The `sil` skill now runs a brainstorm interview before creating a shopping
70
+ expert.** An open, back-and-forth interview converges five sections *with* the
71
+ user — domain framing, persona, elicitation style, answer→`sil_search`-param
72
+ mapping, and recommendation rubric — eliciting BOTH the domain's
73
+ decision-attributes AND the user's own tastes/budget/constraints, then
74
+ assembles a tailored spec the agent-creation engine materializes via
75
+ `sil_profile_materialize`. Nothing is created until the user explicitly
76
+ endorses the assembled draft (abandon-mid-flow leaves nothing written, no
77
+ teardown); a vague domain is narrowed with the user first; a name collision
78
+ offers refine-or-rename and never clobbers. The mapping targets only real
79
+ `sil_search` params (budget → `price_min`/`price_max` in minor units, "prefer
80
+ secondhand" → `condition`, niche → `query`/`category`) and leaves `ship_to`
81
+ empty so sil resolves the registered default server-side.
82
+ - **A created expert shops its niche like a trusted specialist, not a generic
83
+ clerk.** When a session opens inside a created expert, the skill loads its
84
+ `profile.json` → `persona.md` + `playbook.md` and runs a profile-driven
85
+ shop-time loop: elicit **only the missing** load-bearing attributes in the
86
+ playbook's priority order (never a fixed question battery, never re-asking what
87
+ the user already stated), map answers to real `sil_search` params (`ship_to`
88
+ left empty so the server resolves the registered default; a taste with no
89
+ matching param folds into `query`/the rubric, never an invented filter), search,
90
+ then reason over the candidates with the playbook's rubric and the persona's
91
+ hard-rules / hard-no's — presenting results **best-first as `sil_search`
92
+ returned them (never re-ranked)** and always with the domain "why". An
93
+ empty-but-servable result relaxes a constraint and explains the change; a
94
+ genuinely unservable domain gets an honest "no", never padded with junk; a
95
+ non-`ok` status follows the tool's own `recovery`, never the empty-match path.
96
+ Consumes the catalog tools **unchanged** — no new tool; the rubric is applied at
97
+ reasoning time. (#31)
98
+ - **Local expert lifecycle — list, view, and remove the shopping experts you
99
+ create.** Three new tools manage the artefact store the create-engine writes
100
+ (`$SIL_DATA_DIR/agents/<id>/`): `sil_profile_list` enumerates your experts
101
+ most-recently-created first (sourced from each `profile.json` manifest — the
102
+ authoritative "is a sil expert" signal — with one corrupt manifest isolated
103
+ in `unreadable[]`, never aborting the listing); `sil_profile_get` returns one
104
+ expert's full detail (name, persona, optional playbook, manifest path,
105
+ createdAt); and `sil_profile_remove` deletes exactly one validated expert's
106
+ behaviour-artefact directory. All three make no network call and read no
107
+ token — generic profile-less shopping is unchanged. Removal is the **artefact
108
+ half only**: the host-wiring half (`openclaw agents remove`) is host-CLI
109
+ driven and runs **first** (a failed artefact step then leaves only harmless,
110
+ list-surfaced disk cruft — never a broken-but-loading expert), and the skill
111
+ **confirms before removing**. `sil_profile_remove` is fail-closed and scoped:
112
+ a malformed/traversal/`main` id is rejected (`invalid_request`) and deletes
113
+ nothing, an absent id is `not_found` (idempotent — safe to re-run), and a
114
+ genuine filesystem failure is `persistence_failed` with the path + cause —
115
+ never a thrown error across the tool boundary. The list/view/remove flow lives
116
+ in its own progressive-disclosure reference, `references/manage_experts.md`,
117
+ which the router routes the manage intents to.
118
+ - **Refine an existing expert from what it observed in real sessions
119
+ (self-reinforcement).** A targeted-amend loop sharpens a *named* expert without
120
+ re-brainstorming it from scratch: load it with **`sil_profile_get`**, propose
121
+ concrete refinements **grounded in observed evidence** from the just-run
122
+ shopping session (a mapping that surfaced irrelevant items, a constraint the
123
+ user volunteered but the playbook never captured, a candidate they rejected —
124
+ never a generic, ungrounded "improvement"), let the user **confirm a subset**
125
+ (per-proposal accept/reject — never inferred from silence or an off-topic
126
+ answer), and persist **only** the confirmed subset by re-running
127
+ **`sil_profile_materialize`** over that one `agentId`. The re-write is per-file
128
+ atomic and dir-preserving — a failed persist leaves the prior expert intact and
129
+ never serves a half-refined one (a torn manifest reads back as not-found,
130
+ fail-closed). The improvement is **per-user and local** (written only to this
131
+ user's `$SIL_DATA_DIR` — no server endpoint, no shared or cross-user signal, no
132
+ identity round-trip) and **isolated** (touches only the named
133
+ `agents/<agentId>/`; sibling experts and generic profile-less shopping are
134
+ untouched). Adds **no new tool** — it composes the existing `sil_profile_get` +
135
+ `sil_profile_materialize`; when no observed session is available it falls back
136
+ to a guided amend and never fabricates observations. (#32)
137
+
138
+ ### Changed
139
+
140
+ - **Restructured the bundled `sil` skill to progressive disclosure
141
+ (skill-creator convention).** `skill/SKILL.md` is now a maximally-lean pure
142
+ router: frontmatter, a one-paragraph role, the three always-on behavioural
143
+ principles, a brief session-start note, and an intent→tool→reference routing
144
+ table — nothing more. The detailed procedures moved into self-contained
145
+ references loaded on demand: `references/catalog_tools_reference.md` (the four
146
+ core tools' per-tool behaviour + the shared status taxonomy),
147
+ `references/brainstorm_interview.md` (the interview),
148
+ `references/agent_creation_engine.md` (the ordered creation engine),
149
+ `references/search_param_mapping.md` (the answer→`sil_search`-param mapping),
150
+ and `references/manage_experts.md` (the list/view/remove flow), with a worked
151
+ end-to-end walkthrough under `examples/road_cycling_expert_walkthrough.md`.
152
+ The endorsement-before-engine gate now lives as the router's two-step trigger
153
+ (interview first; engine only after explicit endorsement). The
154
+ contributor-facing "adding a tool" prose — duplicated from the repo
155
+ `CLAUDE.md` and never needed at runtime — was removed from the skill entirely.
156
+ No detail is duplicated between the router and any reference.
157
+
13
158
  ## [0.2.4] - 2026-06-18
14
159
 
15
160
  ### Fixed
package/README.md CHANGED
@@ -6,13 +6,12 @@
6
6
  ███████║██║███████╗
7
7
  ╚══════╝╚═╝╚══════╝
8
8
 
9
- commerce, handled by your agent
9
+ Shop like you code
10
10
  ```
11
11
 
12
12
  **The shopping layer your agent runs for you.**
13
13
 
14
- *You say what you want. Your agent searches the catalog, compares, and hands you a ready-to-buy link.*
15
- *No store. No tabs. No forms.*
14
+ *Introducing Spec Driven Shopping: the way Agents should be shopping.*
16
15
 
17
16
  [![license](https://img.shields.io/badge/license-Apache--2.0-blue)](https://github.com/Context4GPTs/sil-openclaw/blob/main/LICENSE)
18
17
  [![npm](https://img.shields.io/npm/v/sil-openclaw?logo=npm&logoColor=white&color=cb3837)](https://www.npmjs.com/package/sil-openclaw)
@@ -58,7 +57,7 @@ The agent loads the bundled skill on first commerce intent and takes it from the
58
57
 
59
58
  sil is a [UCP](https://github.com/universal-commerce-protocol/ucp) (Universal Commerce Protocol) commerce service, and `sil-openclaw` wires it into your OpenClaw agent — so it can find products, compare prices and availability, pull up full detail, and surface a checkout link the moment you say *buy*. Powered by [4GPTs](https://4gpts.com).
60
59
 
61
- Today the plugin covers **identity and catalog** — registration plus search and product lookup. The rest of the UCP journey (cart, checkout, order, fulfillment) lands as those domains ship, and the same plugin grows with them.
60
+ Today the plugin covers **identity, catalog, and dedicated shopping experts**. The rest of the UCP journey (cart, checkout, order, fulfillment) lands as those domains ship, and the same plugin grows with them.
62
61
 
63
62
  ---
64
63
 
@@ -94,11 +93,60 @@ agent done — here's your checkout link, ready to pay:
94
93
 
95
94
  ---
96
95
 
97
- ## Identity & authentication
96
+ ## Turn your OpenClaw into a shopping expert
98
97
 
99
- **sil gives your agent an identity — and the capability to use it.** One browser sign-in links your OpenClaw agent to a sil identity it holds on your behalf — your name, your saved addresses. That identity is what lets the agent *transact*: it can search, compare, and surface checkout links with any merchant that speaks [UCP](https://github.com/universal-commerce-protocol/ucp) (the Universal Commerce Protocol), all under your account, without you ever touching a store login.
98
+ So far your *general* agent did the shopping. Go one step further: mint a **dedicated** OpenClaw agent that shops a single niche like a true specialist — it **researches how to buy well in that niche itself**, then fits *you* the way an expert would.
100
99
 
101
- Registering is the only manual step. After that the agent carries your identity for you — ask *"who am I on sil?"* anytime to see exactly what it's holding.
100
+ **Spec-Driven Shopping (SDS).** Say *"make me a shopping expert for road-cycling gear"* and the plugin runs a **light** interview (≤10 questions) to narrow the niche and shape the persona — then **researches the niche deeply on its own** (the full how-to-buy-well: fit, gearing, geometry, the trade-offs) and derives the **dimensions** every request should be decomposed along. Open it later and on **every query** it refreshes that knowledge from the web, decomposes what you asked, and **learns your facts and taste as it goes** (your measurements, your budget, the rules it must never break) — captured once, never re-asked. It recommends with a "why" that cites *what you asked*, *a fact it remembered*, and *a niche mechanic you'd never have named*. **Nothing is created until you say "create it"** — and building one is local and offline, no sign-in required.
101
+
102
+ **1 — One light conversation builds the expert (it does the deep research itself):**
103
+
104
+ ```text
105
+ you make me a shopping expert for road-cycling gear
106
+
107
+ agent Love it — let's shape it lightly. A complete bike, or
108
+ components and apparel?
109
+
110
+ you a complete road bike, my first proper one
111
+
112
+ agent Got it. I've researched how to buy a first road bike well —
113
+ fit (size from height AND inseam, stack/reach, saddle setback),
114
+ endurance-vs-race geometry, gearing theory, the comfort/speed
115
+ trade-offs. I'll decompose every request along use-case, terrain,
116
+ budget, your fit envelope, timeline, and priorities.
117
+
118
+ Road-Cycling Buyer — a patient first-bike advisor
119
+ · always explains fit · never carbon bars
120
+
121
+ shall I create it?
122
+
123
+ you yes, create it
124
+
125
+ agent done — "Road-Cycling Buyer" is live. Open it anytime;
126
+ it shops your niche with no further setup.
127
+ ```
128
+
129
+ **2 — The expert shops like a specialist, learning you as it goes:**
130
+
131
+ ```text
132
+ you (inside Road-Cycling Buyer) find me a road bike, ~€1500
133
+
134
+ agent Before I search — two numbers I'll keep so I never re-ask:
135
+ your height and inseam. Any brand you won't touch?
136
+
137
+ you 178cm, 81cm inseam. No strong feelings, secondhand is fine
138
+
139
+ agent searched sil — endurance, 54cm for your fit, ~€1500:
140
+
141
+ 1. Alloy endurance bike, 54cm, 105 (used) €1420
142
+ 2. Carbon endurance bike, 54cm, 105 (used) €1610
143
+
144
+ Why #1: for your 178/81 fit a 54cm endurance frame sits where a
145
+ first buyer wants it — fit and comfort outrank outright speed on a
146
+ first bike — and it's inside your budget. Want detail or a link?
147
+ ```
148
+
149
+ > **You teach it once; it stays an expert.** It keeps your facts and taste, web-refreshes its niche knowledge each visit, and never re-asks what it already knows. List the experts you've made, look at how one is set up, retire one you're done with — or **refine** one from what it watched you reject, so it gets sharper every session.
102
150
 
103
151
  ---
104
152
 
@@ -120,13 +168,23 @@ Namespaced `sil_*` so they never collide with other plugins. Your agent calls th
120
168
  | `sil_search` | Search for purchasable products. A free-text `query` plus optional filters: `category`, `price_min`/`price_max`, `ship_to` (delivery destination — leave empty to ship to your registered address), `condition` (`new` / `secondhand`), `available`, and `local_merchants` (best-effort bias toward shops in the user's own country). Results are **localized** to the shopper — issue the `query` in their own language for the best local results (e.g. search in French for French stores). Returns a ranked list of variants — each with `id`, `title`, `price`, `availability`, `checkout_url`, `source`, plus (where the source provides them) evaluate-before-buy detail: a product/variant `url` to view, a `description`, `media`, the product `options`, and the `seller`'s **shipping & return policy links** — and a pagination `cursor`. Location filters take ISO codes (`US`, `CA`), not place names. |
121
169
  | `sil_product_get` | Resolve `ids` you already hold to full products in UCP shape — `description`, `options`, `media`, the `seller`'s shipping & return policy links, and the featured purchasable variant with fresh `price`, `availability`, `url` (the page to view), and `checkout_url` (the link that buys). Re-fetch right before buying; those values are point-in-time, not guarantees. Ids that no longer resolve come back in `not_found`. |
122
170
 
171
+ **Experts** — create and manage dedicated shopping agents
172
+
173
+ | Tool | What it does |
174
+ |---|---|
175
+ | `sil_profile_materialize` | Persist a created expert's SDS behaviour artefacts — `domain_spec.md` (deep researched niche expertise) + `intent_spec.md` (the decomposition-dimension schema) + `user_spec.md` (your facts + hard constraints) + `playbook.md` (your buying taste), all four required and present from creation, plus a `profile.json` manifest — under `$SIL_DATA_DIR/agents/<id>/`. (The persona is the agent's host workspace `SOUL.md`, not a sil artefact.) Driven by the skill's creation engine once you endorse the draft, and again per-query to web-refresh the domain and augment your facts/taste; validate-first and fail-closed, it never clobbers an existing expert. |
176
+ | `sil_profile_list` | List the experts you've created, most-recently-made first. Takes no arguments. |
177
+ | `sil_profile_get` | Show one expert in full — `name`, its `domainSpec` + `intentSpec` + `userSpec` + `playbook` (all four present), manifest path, and `createdAt`. |
178
+ | `sil_profile_remove` | Delete one expert's behaviour artefacts. Scoped and idempotent; the agent confirms with you before removing. |
179
+
123
180
  ---
124
181
 
125
182
  ## Skills
126
183
 
127
- The plugin ships one bundled skill — **`sil`** 🛒 — that your agent loads automatically the first time you express a shopping intent. You don't invoke it; it's the playbook that makes the four tools work well together:
184
+ The plugin ships one bundled skill — **`sil`** 🛒 — that your agent loads automatically the first time you express a shopping intent. You don't invoke it; it's the playbook that makes the tools work well together:
128
185
 
129
- - **Routes intent to the right tool.** *"find me a keyboard"* → `sil_search`, *"look these up"* → `sil_product_get`, *"who am I?"* → `sil_whoami`, *"sign me up"* → `sil_register`.
186
+ - **Routes intent to the right tool.** *"find me a keyboard"* → `sil_search`, *"look these up"* → `sil_product_get`, *"who am I?"* → `sil_whoami`, *"sign me up"* → `sil_register`, *"make me an expert for X"* → the create flow, *"list / show / remove my experts"* → the `sil_profile_*` tools.
187
+ - **Interviews lightly, then researches deeply.** Asked for a shopping expert, it runs a light interview (≤10 questions) to shape the niche and persona *with* you, then researches the niche itself and derives how to decompose every request — and creates nothing until you explicitly endorse the assembled draft.
130
188
  - **Recovers the right way.** Every tool reports a status; the skill follows that tool's own recovery hint — re-register, fix the query, or retry — instead of guessing a fix that won't work.
131
189
  - **Keeps prices honest.** It treats price, availability, and checkout links as point-in-time and re-checks an item right before you buy, so the link you get is the link you pay.
132
190
 
package/dist/index.js CHANGED
@@ -23,6 +23,7 @@ import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
23
23
  import { applyPluginConfigOverrides, getWebUrl, getWebUrlSource, getApiUrl, getApiUrlSource, } from "./lib/config.js";
24
24
  import { registerCatalogTools } from "./tools/catalog.js";
25
25
  import { registerIdentityTools } from "./tools/identity.js";
26
+ import { registerProfileTools } from "./tools/profile.js";
26
27
  export default definePluginEntry({
27
28
  id: "sil",
28
29
  name: "sil",
@@ -32,6 +33,7 @@ export default definePluginEntry({
32
33
  applyPluginConfigOverrides(api.pluginConfig);
33
34
  registerIdentityTools(api);
34
35
  registerCatalogTools(api);
36
+ registerProfileTools(api);
35
37
  api.logger.info("sil_plugin_loaded", {
36
38
  message: "sil plugin registered.",
37
39
  api_url: getWebUrl(),