sil-openclaw 0.3.5 → 0.3.7
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 +54 -0
- package/README.md +40 -34
- package/dist/lib/profile-store.js +520 -337
- package/dist/tools/profile.js +317 -194
- package/openclaw.plugin.json +4 -4
- package/package.json +1 -1
- package/sil-shopping/SKILL.md +18 -17
- package/sil-shopping/examples/multi_domain_shopper_walkthrough.md +190 -0
- package/sil-shopping/references/agent_creation_engine.md +35 -32
- package/sil-shopping/references/brainstorm_interview.md +31 -47
- package/sil-shopping/references/manage_domains.md +56 -0
- package/sil-shopping/references/refine_shopper.md +48 -0
- package/sil-shopping/references/search_param_mapping.md +12 -12
- package/sil-shopping/references/shop_loop.md +109 -0
- package/sil-shopping/examples/road_cycling_expert_walkthrough.md +0 -150
- package/sil-shopping/references/expert_shopping.md +0 -79
- package/sil-shopping/references/manage_experts.md +0 -42
- package/sil-shopping/references/refine_expert.md +0 -43
package/openclaw.plugin.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"id": "sil",
|
|
3
3
|
"name": "sil",
|
|
4
4
|
"description": "Turn your OpenClaw into an expert shopping agent.",
|
|
5
|
-
"version": "0.3.
|
|
5
|
+
"version": "0.3.7",
|
|
6
6
|
"skills": ["./sil-shopping"],
|
|
7
7
|
"activation": {
|
|
8
8
|
"onCapabilities": ["tool"]
|
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
"tools": [
|
|
12
12
|
"sil_product_get",
|
|
13
13
|
"sil_profile_get",
|
|
14
|
-
"sil_profile_list",
|
|
15
14
|
"sil_profile_materialize",
|
|
16
15
|
"sil_profile_remove",
|
|
17
16
|
"sil_register",
|
|
17
|
+
"sil_remember",
|
|
18
18
|
"sil_search",
|
|
19
19
|
"sil_whoami"
|
|
20
20
|
]
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
},
|
|
52
52
|
"security": {
|
|
53
53
|
"shipsRuntimeCode": true,
|
|
54
|
-
"packagingNote": "Compiled JavaScript ships under ./dist. register() stays synchronous and opens nothing — it only registers tools. ALL I/O happens inside a tool's execute(): sil_register calls sil-web over the network, writes tokens.json + config.json to the plugin data directory (owner-only, 0600), and arms a bounded background poll timer that stops on the first terminal claim outcome or after the session deadline. sil_whoami reads the stored session token and calls sil-api for the user's identity, refreshing transparently via sil-web on a 401 (at most one refresh + one retry per call, no timer); a confirmed-dead session clears tokens.json. sil_search and sil_product_get read the stored session token and call sil-api's catalog endpoints (search / lookup) with it — read-only on catalog data, no timer, but with the SAME bounded 401 recovery as sil_whoami: on a 401 they refresh ONCE via sil-web (rotating tokens.json) and retry the read ONCE; a second 401 or a dead (invalid_grant) refresh token clears tokens.json and is reported as a terminal re-register hint. A non-401 error writes no token. sil_profile_materialize makes no network call and reads no token: it writes
|
|
54
|
+
"packagingNote": "Compiled JavaScript ships under ./dist. register() stays synchronous and opens nothing — it only registers tools. ALL I/O happens inside a tool's execute(): sil_register calls sil-web over the network, writes tokens.json + config.json to the plugin data directory (owner-only, 0600), and arms a bounded background poll timer that stops on the first terminal claim outcome or after the session deadline. sil_whoami reads the stored session token and calls sil-api for the user's identity, refreshing transparently via sil-web on a 401 (at most one refresh + one retry per call, no timer); a confirmed-dead session clears tokens.json. sil_search and sil_product_get read the stored session token and call sil-api's catalog endpoints (search / lookup) with it — read-only on catalog data, no timer, but with the SAME bounded 401 recovery as sil_whoami: on a 401 they refresh ONCE via sil-web (rotating tokens.json) and retry the read ONCE; a second 401 or a dead (invalid_grant) refresh token clears tokens.json and is reported as a terminal re-register hint. A non-401 error writes no token. sil_profile_materialize makes no network call and reads no token: it writes the one sil shopper's SINGLETON behaviour artefacts under a fixed $SIL_DATA_DIR/shopper/ (owner-only, 0600) — a SHARED user_spec.md + profile.json manifest, plus per-domain packs (domain_spec.md + intent_spec.md + playbook.md) minted LAZILY under shopper/domains/<slug>/ on first shop in a niche. The shopper segment is a compile-time constant (NOT caller input — no agentId); the only caller-supplied path segment is the domain slug, validated (lower-kebab, not \"main\") before any join. Each artefact is written atomically (tmp file → rename over target). Failure guarantee: a FRESH create that fails mid-write is torn down (no partial directory survives); a re-mint of an EXISTING domain is per-file atomic and dir-preserving (NOT a cross-file transaction) — on failure the prior pack is left intact and is never served half-refined (a missing body fails the read closed). The persona is the shopper's host workspace SOUL.md, written by the host CLI (not this plugin, not a sil artefact), and the shopper's host-config wiring is driven separately by the host CLI. sil_profile_get / sil_profile_remove are the local domain lifecycle over the same artefact store, also making no network call and reading no token: get with no domainSlug reads the manifest overview read-only (the shared user_spec + the domains index, the folded listing — an empty store is healthy), get with a domainSlug reads that one domain's domain_spec/intent_spec/playbook bodies + the shared user_spec read-only, and remove deletes exactly one validated shopper/domains/<slug>/ leaf directory (fail-closed on a malformed/traversal/\"main\" or missing slug — deletes nothing, and never the whole shopper) — the host-wiring half of removal is the host CLI's, not this plugin's. sil_remember is the lightweight per-query memory verb over the same artefact store, also making no network call and reading no token: it appends ONE short typed entry (a fact to the shared user_spec.md, or a taste to the active domain's playbook.md) via a single O_APPEND write (flag \"a\", owner-only 0600), with NO whole-doc read or re-serialize and NO manifest rewrite. It is fail-closed: append never creates a file (an unknown shopper / unminted domain / missing body returns not_found), and validate-first rejects a blank text, a fact carrying a domain, a taste carrying hard:true, or a malformed/traversal taste domain slug (writing nothing). The remembered text is user content and is never logged. The PKCE verifier is held only in memory and is never written to disk. Tokens and identity PII are never logged.",
|
|
55
55
|
"registersLongLivedService": false,
|
|
56
56
|
"serviceIds": [],
|
|
57
57
|
"runsTimers": true,
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"https://sil.4gpts.com"
|
|
62
62
|
],
|
|
63
63
|
"filesystemScope": [
|
|
64
|
-
"$SIL_DATA_DIR (default $XDG_DATA_HOME/sil, else ~/.local/share/sil) — tokens.json, config.json,
|
|
64
|
+
"$SIL_DATA_DIR (default $XDG_DATA_HOME/sil, else ~/.local/share/sil) — tokens.json, config.json, shopper/{user_spec.md,profile.json} + shopper/domains/<slug>/{domain_spec.md,intent_spec.md,playbook.md} (the ONE sil shopper's singleton SDS behaviour artefacts written by sil_profile_materialize: a SHARED user_spec.md + a profile.json manifest at create, plus per-domain packs minted LAZILY on first shop — the domain spec (domain_spec.md) + intent-spec dimension schema (intent_spec.md) + buying taste (playbook.md). The `shopper` segment is a fixed compile-time constant, not caller input; the domain slug is the only caller-supplied path segment, validated before any join. The persona is the host workspace SOUL.md, not a sil artefact)"
|
|
65
65
|
],
|
|
66
66
|
"credentialsOnDisk": [
|
|
67
67
|
"tokens.json (access + refresh token)",
|
package/package.json
CHANGED
package/sil-shopping/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: sil-shopping
|
|
3
|
-
description: This skill should be used whenever the user wants to shop on sil or
|
|
3
|
+
description: This skill should be used whenever the user wants to shop on sil or set up their sil shopper: register or sign in to sil, check who they are, search the sil catalog for purchasable products, or look up specific products by id — and for the full single-shopper lifecycle: "set up an agent that shops for me" / "create my shopper" (a short two-touchpoint onboarding, then create ONE shopper), see what their shopper knows or which domains (niches) it has learned, view or forget a domain, refine the shopper or one domain — or, as the shopper, run a profile-driven Spec-Driven Shopping query on any niche (reusing a learned domain or minting one on the fly) and remember a fact or buying taste it surfaces. Route here for any shopping, identity, or shopper-setup intent on sil. Drives sil_register, sil_whoami, sil_search, sil_product_get, sil_profile_materialize, sil_profile_get, sil_profile_remove, and sil_remember.
|
|
4
4
|
metadata:
|
|
5
5
|
openclaw:
|
|
6
6
|
emoji: "\U0001F6D2"
|
|
@@ -8,7 +8,7 @@ metadata:
|
|
|
8
8
|
|
|
9
9
|
# sil-shopping
|
|
10
10
|
|
|
11
|
-
Drive the sil plugin's tools on the user's behalf: register them on sil, read their identity, help them find purchasable products in the sil catalog — and, when asked,
|
|
11
|
+
Drive the sil plugin's tools on the user's behalf: register them on sil, read their identity, help them find purchasable products in the sil catalog — and, when asked, set up their **shopper** (one sil-wired agent that shops every niche), then see what it knows, view or forget a domain, or refine it. Read user intent, route to the matching tool (loading its reference on demand), call it, and report what came back.
|
|
12
12
|
|
|
13
13
|
## Always-on behavioural contract
|
|
14
14
|
|
|
@@ -20,7 +20,7 @@ These three principles hold on every path, before any reference is loaded:
|
|
|
20
20
|
|
|
21
21
|
## Session start
|
|
22
22
|
|
|
23
|
-
Confirm the `sil_*` tools are exposed. If they are missing from the available tool list, the host runtime is filtering them out
|
|
23
|
+
Confirm the `sil_*` tools are exposed. If they are missing from the available tool list, the host runtime is filtering them out because sil is not admitted at the host allow surfaces — run the shipped admission helper `sil-openclaw-allowlist` (it additively admits sil at `plugins.allow` + `tools.alsoAllow`, leaving any other trusted plugin untouched), then reopen the session so the tools load. Most flows need an identity: if the user has not registered this session, the catalog tools return an unregistered status whose `recovery` points at `sil_register` (the [catalog tools reference](references/catalog_tools_reference.md) has the full taxonomy) — so calling a catalog tool first lets that outcome route, or run `sil_register` up front when the user's intent clearly requires it.
|
|
24
24
|
|
|
25
25
|
## Routing — match intent to a tool, load its reference on demand
|
|
26
26
|
|
|
@@ -30,26 +30,27 @@ Confirm the `sil_*` tools are exposed. If they are missing from the available to
|
|
|
30
30
|
| "who am I?" / "what's on my account" / show my saved name + addresses | `sil_whoami` | [`references/catalog_tools_reference.md`](references/catalog_tools_reference.md) |
|
|
31
31
|
| "find X" / "search for X" / browse a category or price range | `sil_search` | [`references/catalog_tools_reference.md`](references/catalog_tools_reference.md) |
|
|
32
32
|
| "look up these items" / re-check ids from a prior result, a saved list, or a deep link | `sil_product_get` | [`references/catalog_tools_reference.md`](references/catalog_tools_reference.md) |
|
|
33
|
-
| "
|
|
34
|
-
| "what
|
|
35
|
-
| "show me
|
|
36
|
-
| "
|
|
37
|
-
| (
|
|
38
|
-
| "
|
|
33
|
+
| "set up an agent that shops for me" / "create my shopper" | (onboarding, then the engine) | see the two-step gate below |
|
|
34
|
+
| "what does my shopper know?" / "which domains has it learned?" | `sil_profile_get` (no `domainSlug` — the shopper overview, which absorbs the old listing) | [`references/manage_domains.md`](references/manage_domains.md) |
|
|
35
|
+
| "show me the shopper / the <niche> domain" | `sil_profile_get` (`domainSlug` for one domain) | [`references/manage_domains.md`](references/manage_domains.md) |
|
|
36
|
+
| "forget / remove the <niche> domain" | `sil_profile_remove` (per-domain; whole-shopper teardown is host-CLI-first — see the reference) | [`references/manage_domains.md`](references/manage_domains.md) |
|
|
37
|
+
| (as the shopper) a shopping intent — "find me something for X" on any niche | `sil_search` → `sil_product_get` (driven by the loaded profile, reusing or minting the domain) | [`references/shop_loop.md`](references/shop_loop.md) |
|
|
38
|
+
| "remember this" — a fact or buying taste the shopper surfaced this query | `sil_remember` | [`references/shop_loop.md`](references/shop_loop.md) |
|
|
39
|
+
| "refine / sharpen my shopper" / "the cycling domain keeps surfacing the wrong stuff — fix it" | (load → propose → confirm → persist — see the reference) | [`references/refine_shopper.md`](references/refine_shopper.md) |
|
|
39
40
|
|
|
40
41
|
[`references/catalog_tools_reference.md`](references/catalog_tools_reference.md) holds the per-tool behaviour for the four core tools and the shared status taxonomy. Basic shopping needs only that one reference.
|
|
41
42
|
|
|
42
|
-
When the session is running **
|
|
43
|
+
When the session is running **as the shopper** (a loaded profile under `$SIL_DATA_DIR/shopper/` — the shared `user_spec` plus a slug-keyed `domains` map) and the user states a shopping intent, follow [`references/shop_loop.md`](references/shop_loop.md) — the profile-driven, **Spec-Driven Shopping (SDS)** shop-time loop that classifies the niche, **reuses a learned domain or mints one on the fly**, web-refreshes that domain's spec, decomposes the request along its intent spec, and learns every query — persisting each surfaced fact (→ the shared user spec) or taste (→ the active domain) with a single lightweight `sil_remember` append. The one shopper shops every niche; a plain, profile-less session keeps shopping via the "find X" → `sil_search` row above, unchanged.
|
|
43
44
|
|
|
44
|
-
[`references/
|
|
45
|
+
[`references/manage_domains.md`](references/manage_domains.md) holds the list / view / forget flow over the shopper's domains — including the **two remove granularities** (forget one domain vs decommission the whole shopper, host-CLI-first) and the confirm-before-remove gate. Load it the moment the user wants to see what the shopper knows or forget a niche.
|
|
45
46
|
|
|
46
|
-
[`references/
|
|
47
|
+
[`references/refine_shopper.md`](references/refine_shopper.md) holds the refinement loop — sharpening the shopper (the shared user spec or the persona) or **one domain** from observed sessions, with a confirm-before-persist gate (nothing changes silently). Load it when the user wants to refine, sharpen, or amend their shopper or a niche.
|
|
47
48
|
|
|
48
|
-
###
|
|
49
|
+
### Setting up your shopper — the endorsement-gated two-step
|
|
49
50
|
|
|
50
|
-
When the user asks to
|
|
51
|
+
When the user asks to set up / create their shopper (the singleton agent that shops every niche):
|
|
51
52
|
|
|
52
|
-
1. **
|
|
53
|
-
2. **Engine only after explicit endorsement.** Only after the user explicitly endorses the assembled draft, read and follow [`references/agent_creation_engine.md`](references/agent_creation_engine.md) — the ordered engine that persists the sil-wired
|
|
53
|
+
1. **Onboard first.** Read and run [`references/brainstorm_interview.md`](references/brainstorm_interview.md) — the short, two-touchpoint onboarding (persona + a shared user-spec seed) that converges a draft *with* the user. It researches **no** niche — the shopper is a generalist that mints domains lazily on first shop. While running it, load [`references/search_param_mapping.md`](references/search_param_mapping.md) only if you need the shop-time answer→`sil_search`-param mapping (it is a shop-time reference, not an onboarding one).
|
|
54
|
+
2. **Engine only after explicit endorsement.** Only after the user explicitly endorses the assembled draft, read and follow [`references/agent_creation_engine.md`](references/agent_creation_engine.md) — the ordered engine that persists the one sil-wired shopper. Running ANY engine step before that explicit endorsement is forbidden (the onboarding reference owns the endorsement gate). The shopper is a **singleton**: a second create attempt is refused ("a shopper already exists").
|
|
54
55
|
|
|
55
|
-
Want a concrete walkthrough? [`examples/
|
|
56
|
+
Want a concrete walkthrough? [`examples/multi_domain_shopper_walkthrough.md`](examples/multi_domain_shopper_walkthrough.md) is an end-to-end worked example: create one shopper → shop two unrelated niches in one session (the second minted on the fly) → a shared fact reused across both → per-domain taste that does not leak.
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
# Worked example — one shopper, two unrelated niches, one session
|
|
2
|
+
|
|
3
|
+
A short walkthrough of the **headline capability**: create **ONE shopper**
|
|
4
|
+
([`../references/brainstorm_interview.md`](../references/brainstorm_interview.md) →
|
|
5
|
+
[`../references/agent_creation_engine.md`](../references/agent_creation_engine.md)),
|
|
6
|
+
then shop **two unrelated niches in the same session** — the second **minted on
|
|
7
|
+
the fly** — with a **shared fact reused across both** and **per-domain taste that
|
|
8
|
+
does not leak**. The transcript is illustrative — it shows the *shape*, the gates,
|
|
9
|
+
and the SDS layering, not exact wording.
|
|
10
|
+
|
|
11
|
+
## Onboarding — two touchpoints, NO niche research
|
|
12
|
+
|
|
13
|
+
> **User:** "Set up something that shops for me."
|
|
14
|
+
|
|
15
|
+
The shopper is a **generalist** — onboarding touches only the persona and the
|
|
16
|
+
shared user spec; it researches **no** niche.
|
|
17
|
+
|
|
18
|
+
**1. `SOUL.md` — ask first (persona; a generalist, NOT a niche).**
|
|
19
|
+
|
|
20
|
+
> **Shopper:** "Let's set up your shopper. How do you want it to behave?"
|
|
21
|
+
> **User:** "Be concise and a bit opinionated — and never recommend anything with
|
|
22
|
+
> leather, it's an ethics thing for me."
|
|
23
|
+
|
|
24
|
+
→ Persona (→ host **`SOUL.md`**): *concise, lightly opinionated generalist.* No
|
|
25
|
+
niche is chosen — it will shop whatever the user buys.
|
|
26
|
+
|
|
27
|
+
**2. `user_spec.md` (shared) — seed the cross-niche facts + hard constraints.**
|
|
28
|
+
|
|
29
|
+
> **Shopper:** "Anything I should always know — sizes, where to ship, hard rules?"
|
|
30
|
+
> **User:** "Ship to 12 Rue Centrale, Lyon, France. And the no-leather rule is
|
|
31
|
+
> absolute."
|
|
32
|
+
|
|
33
|
+
→ Seeded partial **shared `userSpec`** (→ `user_spec.md`): *ship-to Lyon, France
|
|
34
|
+
(soft fact); **HARD-NO: leather** (inviolable, carries across every niche).* The
|
|
35
|
+
rest is augmented per query.
|
|
36
|
+
|
|
37
|
+
## Assemble + endorse — the gate
|
|
38
|
+
|
|
39
|
+
Identity confirmed (`my-shopper` / "My Shopper"), the assembled draft splits across
|
|
40
|
+
the two stores — `agentId` + `persona` drive the host wiring (`openclaw agents add`
|
|
41
|
+
+ `SOUL.md`); `name` + the **shared user spec only** feed the singleton
|
|
42
|
+
`sil_profile_materialize` **create** (no `agentId`, no domain pack at create):
|
|
43
|
+
|
|
44
|
+
```jsonc
|
|
45
|
+
{
|
|
46
|
+
"agentId": "my-shopper",
|
|
47
|
+
"name": "My Shopper",
|
|
48
|
+
"persona": "A concise, lightly opinionated generalist shopper.",
|
|
49
|
+
"userSpec": "## Shared user spec (seeded partial)\n### Soft facts\n- Ship-to: 12 Rue Centrale, Lyon, France.\n### Hard constraints (INVIOLABLE — every niche)\n- HARD-NO: leather (ethics)."
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
> **Shopper:** "Here's your shopper — shall I create it?"
|
|
54
|
+
> **User:** "Yes, create it."
|
|
55
|
+
|
|
56
|
+
**This affirmative act is the gate** — up to here, **zero engine steps ran**. Only
|
|
57
|
+
now does the engine proceed
|
|
58
|
+
([`../references/agent_creation_engine.md`](../references/agent_creation_engine.md)):
|
|
59
|
+
validate-first → singleton check → `openclaw agents add my-shopper --workspace
|
|
60
|
+
~/.openclaw/workspace-my-shopper --non-interactive --json` (confirm the inherited
|
|
61
|
+
profile grants a web tool) → write the persona into `SOUL.md` →
|
|
62
|
+
`sil_profile_materialize { name, userSpec }` **(NO `domain` — writes the shared
|
|
63
|
+
`user_spec.md` + `profile.json` with an empty `domains: {}`)** → wire sil:
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
openclaw config set 'agents.list[<i>].skills' '["sil"]' --strict-json
|
|
67
|
+
openclaw config set plugins.entries.sil.enabled true --strict-json
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
→ then **admit sil at the host allow surfaces** so the `sil_*` tools are un-filtered
|
|
71
|
+
— the shipped helper does the additive, idempotent merge of `plugins.allow` +
|
|
72
|
+
`tools.alsoAllow` (never clobbering another admitted plugin like `klodi`):
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
sil-openclaw-allowlist
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
→ `openclaw config validate --json` returns valid → **`created`** (a non-zero
|
|
79
|
+
helper exit would be `persistence_failed`, not `created` — never a green shopper
|
|
80
|
+
over still-filtered tools). The shopper now exists with an **empty `domains` map** —
|
|
81
|
+
healthy; it will mint each niche on first shop.
|
|
82
|
+
|
|
83
|
+
## Niche A — road cycling (minted on the fly, announced)
|
|
84
|
+
|
|
85
|
+
> **User:** "Find me a first road bike, around €1500."
|
|
86
|
+
|
|
87
|
+
The shop loop ([`../references/shop_loop.md`](../references/shop_loop.md) owns the
|
|
88
|
+
machinery — not repeated here) classifies the niche (**road cycling**), reads
|
|
89
|
+
`profile.json.domains`, finds **no** matching domain, and **mints it on the spot —
|
|
90
|
+
announced**:
|
|
91
|
+
|
|
92
|
+
> **Shopper:** "I haven't shopped cycling for you yet — setting that up now (road
|
|
93
|
+
> cycling, first bike). One sec while I do the homework."
|
|
94
|
+
|
|
95
|
+
It **researches** the niche deeply (the deep `domainSpec` — the full how-to-buy:
|
|
96
|
+
**fit is everything** — frame size from height *and* inseam, stack/reach, saddle
|
|
97
|
+
setback, crank length; geometry; gearing theory; material/wheel trade-offs),
|
|
98
|
+
derives the `intentSpec` dimensions, seeds a partial `playbook`, then persists with
|
|
99
|
+
the **whole-doc** mint:
|
|
100
|
+
|
|
101
|
+
```jsonc
|
|
102
|
+
sil_profile_materialize {
|
|
103
|
+
name: "My Shopper",
|
|
104
|
+
userSpec: "…the current shared spec (re-persisted)…",
|
|
105
|
+
domain: {
|
|
106
|
+
slug: "road-cycling", name: "Road cycling",
|
|
107
|
+
domainSpec: "## First road bike — how to buy well (deep)\nFit is everything: size from height AND inseam; stack/reach set torso angle; saddle setback from KOPS; crank length scales with inseam…\n## Geometry: endurance vs race. ## Gearing: gear-inches, compact vs mid-compact. ## Material/wheels: alloy vs carbon; rim depth vs crosswind.",
|
|
108
|
+
intentSpec: "## Dimensions (schema)\nuse-case; terrain; budget band; fit envelope; timeline; compatibility; performance priorities; aesthetics.",
|
|
109
|
+
playbook: "## Buying taste (seeded partial)\nTo be learned as we shop."
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Then the loop runs on the active **road-cycling** domain: decompose the intent
|
|
115
|
+
(first bike, ~€1500), map → `sil_search` → compare on the rubric, and recommend
|
|
116
|
+
with a **"why" that cites the layers** — "for a first bike **fit/comfort outrank
|
|
117
|
+
outright speed** (a domain mechanic), a 54 cm endurance frame sits right, and I kept
|
|
118
|
+
it within your value budget; **no leather anywhere** (your standing hard rule)." A
|
|
119
|
+
rationale naming no domain mechanic and reusing no stored fact would **fail the SDS
|
|
120
|
+
bar** even if the bike were fine.
|
|
121
|
+
|
|
122
|
+
The session surfaces a **taste**, captured the **cheap** way — one append, scoped to
|
|
123
|
+
this domain:
|
|
124
|
+
|
|
125
|
+
> **User:** "I don't chase brands — value over name."
|
|
126
|
+
|
|
127
|
+
```
|
|
128
|
+
sil_remember { kind: "taste", text: "Value over brand; ~€1500 band.", domain: "road-cycling" }
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
That taste lands in **`domains/road-cycling/playbook.md`** — this niche only.
|
|
132
|
+
|
|
133
|
+
## Niche B — espresso (a SECOND niche, same session, no switch)
|
|
134
|
+
|
|
135
|
+
Moments later, **same session, no agent switch, no re-onboarding**:
|
|
136
|
+
|
|
137
|
+
> **User:** "Different thing — I want a home espresso machine, decent but not crazy."
|
|
138
|
+
|
|
139
|
+
The loop classifies the niche (**espresso**), reads `profile.json.domains`, finds
|
|
140
|
+
no match, and **mints espresso on the fly — announced** ("new niche for me —
|
|
141
|
+
setting up espresso") with its own deep `domainSpec` (boiler type, PID, pressure
|
|
142
|
+
profiling, portafilter size, grinder pairing), `intentSpec`, and partial `playbook`,
|
|
143
|
+
via a second whole-doc `sil_profile_materialize` with `domain.slug: "espresso"`.
|
|
144
|
+
|
|
145
|
+
**The shared fact carries — without being re-asked:**
|
|
146
|
+
|
|
147
|
+
> **Shopper:** "I'll ship to your Lyon address as usual" — **the ship-to from the
|
|
148
|
+
> shared `user_spec.md`, captured during onboarding, reused in espresso with no
|
|
149
|
+
> re-ask.** The **no-leather hard rule** also still applies (it rejects a
|
|
150
|
+
> leather-wrapped tamper handle outright).
|
|
151
|
+
|
|
152
|
+
**The niche taste does NOT leak:** the *value-over-brand, ~€1500* taste lives in
|
|
153
|
+
`domains/road-cycling/playbook.md` and **does not shape** the espresso picks —
|
|
154
|
+
espresso starts with its own (partial) taste, learned fresh:
|
|
155
|
+
|
|
156
|
+
> **User:** "For coffee I'll happily pay for a known reliable brand."
|
|
157
|
+
|
|
158
|
+
```
|
|
159
|
+
sil_remember { kind: "taste", text: "Pays up for a reliable known brand.", domain: "espresso" }
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
→ lands in **`domains/espresso/playbook.md`** only. Road cycling's "value over
|
|
163
|
+
brand" and espresso's "pay for a known brand" coexist **without contradiction** —
|
|
164
|
+
that is per-domain taste isolation. A **fact** (a new measurement, a hard rule) would
|
|
165
|
+
instead go to the **shared** `user_spec.md` (`kind: "fact"`) and carry to *both*
|
|
166
|
+
niches.
|
|
167
|
+
|
|
168
|
+
## The singleton edge — refuse a second shopper
|
|
169
|
+
|
|
170
|
+
> **User:** "Can you make me a second shopper just for coffee?"
|
|
171
|
+
> **Shopper:** "You already have a shopper — it handles every niche. I've added
|
|
172
|
+
> espresso as a domain on it; I won't create a second shopper. Want me to refine
|
|
173
|
+
> the espresso domain instead?"
|
|
174
|
+
|
|
175
|
+
The engine's **singleton refusal** (`collision`, "a shopper already exists") — one
|
|
176
|
+
shopper, many domains; you never mint a second.
|
|
177
|
+
|
|
178
|
+
## Edge cases this example would have handled
|
|
179
|
+
|
|
180
|
+
- **Reuse before mint** — asking for "another road bike, this time for winter" reuses
|
|
181
|
+
the **existing `road-cycling` domain** (semantic dedup), never mints a near-duplicate
|
|
182
|
+
`cycling` / `bikes` pack.
|
|
183
|
+
- **Forget one domain ≠ decommission the shopper** — "forget espresso" runs
|
|
184
|
+
`sil_profile_remove { domainSlug: "espresso" }` (artefact-only; the shopper,
|
|
185
|
+
the shared user spec, and the road-cycling domain survive). Tearing down the whole
|
|
186
|
+
shopper is the separate host-CLI-first path.
|
|
187
|
+
- **No web tool**: the shopper says so honestly at mint time and composes the domain
|
|
188
|
+
spec from public buying knowledge — never pretends the research happened.
|
|
189
|
+
- **Creation is local + offline** (for identity): no sil registration to create; the
|
|
190
|
+
user registers later, on first shop, via `sil_register`.
|
|
@@ -1,39 +1,38 @@
|
|
|
1
|
-
# Create
|
|
1
|
+
# Create your sil-wired shopper — the agent-creation engine
|
|
2
2
|
|
|
3
3
|
**Precondition: run this ONLY after the user has explicitly endorsed the assembled draft from [`brainstorm_interview.md`](brainstorm_interview.md).** Any step below before that endorsement is forbidden — the interview owns the gate.
|
|
4
4
|
|
|
5
|
-
When the user wants
|
|
5
|
+
When the user wants to **set up shopping**, author and persist **one** valid OpenClaw agent profile — the user's **shopper**: a real new agent under the host `agents` config, with the **sil plugin enabled**, the **sil skill attached**, its persona written into the workspace **`SOUL.md`**, plus the shopper's **shared user spec** in the sil data directory — so it shops with **no further setup**. The shopper is a **singleton**: you create it **once**, then it learns **domains** (niches) lazily on first shop — you never mint a second shopper.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
The shopper runs **entirely on Spec-Driven Shopping (SDS)** — the operating model, not an optional layer. At create time the engine persists exactly **one** sil artefact: the **shared, agent-level `userSpec`** (the person's cross-niche facts + hard constraints, seeded *partial* by the interview). It does **NOT** research any niche or write any per-domain pack at create time — there is **no** `domainSpec` / `intentSpec` / `playbook` here. Those are minted **lazily, per niche, on first shop** ([`shop_loop.md`](shop_loop.md)) into `domains/<slug>/`. A freshly-created shopper has an **empty `domains` map** — that is **healthy**, not a deficiency.
|
|
8
8
|
|
|
9
9
|
You are the engine: the host config write (and the `SOUL.md` write) is **you driving the host's own `openclaw …` CLI** — the sil plugin never writes the host config. Run the steps **in order, top to bottom** — the order is the spec.
|
|
10
10
|
|
|
11
11
|
## The profile spec (input)
|
|
12
12
|
|
|
13
|
-
The endorsed draft feeds two stores. The **persona** becomes the host workspace **`SOUL.md`** (its identity / voice / standing rules — via the host CLI, **not** a sil artefact). The **
|
|
13
|
+
The endorsed draft feeds two stores. The **persona** becomes the host workspace **`SOUL.md`** (its identity / voice / standing rules — via the host CLI, **not** a sil artefact). The **shared user spec** becomes the sil data-dir artefact:
|
|
14
14
|
|
|
15
15
|
| Field | Meaning | Goes to | Required? |
|
|
16
16
|
|---|---|---|---|
|
|
17
|
-
| **agentId** | Lower-kebab id (e.g. `
|
|
18
|
-
| **name** | Human-readable name ("
|
|
19
|
-
| **persona** | Who this
|
|
20
|
-
| **workspace** | The
|
|
21
|
-
| **
|
|
22
|
-
| **intentSpec** | The agent-specific **decomposition dimensions** (PRD-style schema) **derived from `domainSpec`**, signed off in §5. | sil `intent_spec.md` | **Required (non-empty)** |
|
|
23
|
-
| **userSpec** | The user's domain-relevant facts + hard constraints. **Seeded partial** from §3 (the one basic fact), then augmented per-query. | sil `user_spec.md` | **Required (non-empty)** |
|
|
24
|
-
| **playbook** | The user's **buying taste**. **Seeded partial** from §4 (the compare-options answer), then augmented per-query. | sil `playbook.md` | **Required (non-empty)** |
|
|
17
|
+
| **agentId** | Lower-kebab id (e.g. `my-shopper`) → `agents.list[].id`. Unique, never `main`. | host | Required |
|
|
18
|
+
| **name** | Human-readable name ("My Shopper"). | sil manifest | Required |
|
|
19
|
+
| **persona** | Who this shopper is and how it shops — a generalist, voice/tone, standing rules. | host **`SOUL.md`** (via host CLI — no `persona.md`) | Required (non-empty) |
|
|
20
|
+
| **workspace** | The shopper's workspace directory (e.g. `~/.openclaw/workspace-my-shopper`). | host | Required for the non-interactive add |
|
|
21
|
+
| **userSpec** | The user's **shared, cross-niche** facts + hard constraints (addresses, sizes, allergy/ethics rules, budget psychology). **Seeded partial** by the interview, then augmented per-query. | sil `user_spec.md` | **Required (non-empty)** |
|
|
25
22
|
|
|
26
|
-
|
|
23
|
+
There is **no** per-niche input at create time. The deep `domainSpec`, the derived `intentSpec` schema, and the niche `playbook` are **not** authored here — they are researched and minted on first shop in each niche.
|
|
27
24
|
|
|
28
|
-
|
|
25
|
+
The **sil plugin** and **sil skill** are always attached (that is what makes it *sil-wired*). Creation is **local and offline** — it does **not** require or perform sil registration, reads no token, and writes nothing to identity storage. The shopper registers the user later, on first shop, via `sil_register`. Do **not** present registration as a prerequisite.
|
|
29
26
|
|
|
30
|
-
|
|
27
|
+
## The created shopper needs WEB tools
|
|
28
|
+
|
|
29
|
+
The shopper **lazily mints a domain on first shop** (its research pass reaches the web) and **web-refreshes each domain spec on every query**. So the created agent must have **web/fetch tools in its tool profile** — inherited from `agents.defaults` when its shell is created (step 3). Confirm that profile grants a web-fetch/browse capability and **do not deny it** (alongside not denying the `sil_*` tools). If `agents.defaults` does **not** grant a web tool, the shopper cannot research or refresh a domain — surface that to the user as a host-capability gap; do **not** pretend the research happened.
|
|
31
30
|
|
|
32
31
|
## Engine steps (run in this exact order)
|
|
33
32
|
|
|
34
|
-
1. **Validate the spec FIRST — before anything is written.** Check `agentId` (present, lower-kebab, unique-looking, ≠ `main`), `name`, `persona`, `workspace`, and the **
|
|
33
|
+
1. **Validate the spec FIRST — before anything is written.** Check `agentId` (present, lower-kebab, unique-looking, ≠ `main`), `name`, `persona`, `workspace`, and the **shared `userSpec` — present and non-blank** (the only sil artefact at create; it is seeded *partial* by the interview, never omitted). There is **no** `domainSpec` / `intentSpec` / `playbook` to validate here — those are minted lazily on first shop. On any failure, stop with **`invalid_request`** naming the field and **write nothing**. This runs ahead of every host command, so a bad spec never reaches the host.
|
|
35
34
|
|
|
36
|
-
2. **
|
|
35
|
+
2. **Singleton check — a user has exactly ONE shopper.** The shopper is a singleton: a user creates it **once**, then adds domains to it. Run `openclaw agents list --json` and read the sil artefact store (the no-args `sil_profile_get`, whose overview is `ok` empty-is-healthy when no shopper exists); if a sil shopper **already exists**, stop with **`collision`** — **"a shopper already exists"** — and **do not** run `openclaw agents add`. Steer the user to **shop a new niche** (which lazily mints a domain on the spot) or **refine the existing shopper** — **never mint a second shopper**. (An `agentId` that collides with any existing agent is likewise refused — never overwrite an existing agent's persona or wiring.)
|
|
37
36
|
|
|
38
37
|
3. **Create the agent shell (host CLI).** Run:
|
|
39
38
|
```
|
|
@@ -41,36 +40,40 @@ SDS **web-refreshes the domain spec on every query** and the §2 research pass a
|
|
|
41
40
|
```
|
|
42
41
|
This creates the real `agents.list[]` entry and the workspace bootstrap files (`SOUL.md`, `AGENTS.md`, …), inheriting model and **tool profile** (which must grant **web/fetch** — see above) from `agents.defaults`. `--non-interactive --json` lets you drive it without a prompt and read the result.
|
|
43
42
|
|
|
44
|
-
4. **Write the persona into the workspace `SOUL.md` (host CLI).** The persona is the
|
|
43
|
+
4. **Write the persona into the workspace `SOUL.md` (host CLI).** The persona is the shopper's soul / system framing — the host's `SOUL.md`, **not** a sil artefact. Write the endorsed persona text straight into the new agent's `SOUL.md` via the host CLI. There is **no** `persona.md` in the sil store and **no** copy step — the persona lives in exactly one place.
|
|
45
44
|
|
|
46
|
-
5. **Materialize the
|
|
45
|
+
5. **Materialize the shared user spec — NO `domain`.** Call **`sil_profile_materialize`** with **`{ name, userSpec }`** — the shared `userSpec` seeded by the interview (partial, augmented per-query). The shopper is a singleton, so this sil-tool call takes **no `agentId`** (the host agent id lives only in the host-CLI wiring above). **Pass NO `domain`** at create: with no `domain`, the tool writes the shared **`user_spec.md`** + **`profile.json`** (with an **empty `domains: {}` map**) into the fixed **`$SIL_DATA_DIR/shopper/`**, atomically. There is **no** `domain_spec.md` / `intent_spec.md` / `playbook.md` yet — the first shop in a niche mints that niche's pack (with a `domain` object) lazily. There is **no `persona.md`** here. The tool's outcomes are `ok` / `invalid_request` / `persistence_failed` — on `invalid_request` it wrote nothing; on `persistence_failed` it left nothing partial.
|
|
47
46
|
|
|
48
47
|
6. **Wire the sil skill + plugin (host CLI).** Asserted against the pinned host — **`alpine/openclaw:2026.6.9`** — both value-mode sets with `--strict-json` (the only set mode this image accepts):
|
|
49
48
|
```
|
|
50
49
|
openclaw config set 'agents.list[<i>].skills' '["sil"]' --strict-json
|
|
51
50
|
openclaw config set plugins.entries.sil.enabled true --strict-json
|
|
52
51
|
```
|
|
53
|
-
The skill attach makes the agent **know how** to drive the tools; the plugin enable
|
|
52
|
+
The skill attach makes the agent **know how** to drive the tools; the plugin enable turns the sil plugin **on** — but it does **not** by itself un-filter the `sil_*` tools (see the admission step next). Keep `sil` in the agent's skill list and do not deny the `sil_*` tools.
|
|
53
|
+
|
|
54
|
+
7. **Admit sil at the host allow surfaces — run the shipped helper.** Enabling the plugin is necessary but not sufficient: until `sil` is admitted at the **global** allow surfaces `plugins.allow` + **`tools.alsoAllow`**, the host keeps the `sil_*` tools **filtered**, so the shopper can't call them. Admission is **plugin-ID only** — there is no per-tool key. The value-mode `openclaw config set` above is **overwrite-only** on this image, so it cannot additively merge those shared global arrays without clobbering another already-admitted plugin (e.g. `klodi`). Run the shipped admission helper — the package `bin` that ships with the plugin (same artefact as the `openclaw:allowlist` script) — which performs the **additive, idempotent, atomic, self-validating** three-surface merge (`plugins.allow` + `tools.alsoAllow` + `plugins.entries.sil`):
|
|
55
|
+
```
|
|
56
|
+
sil-openclaw-allowlist
|
|
57
|
+
```
|
|
58
|
+
It re-confirms the plugin-enable as an idempotent no-op, so re-running it on every creation never duplicates or clobbers an existing entry. **If the helper exits non-zero (a failed admission), report `persistence_failed` with the path + cause and do NOT declare `created`** — never a green `created` over still-filtered tools, exactly as a rejected `openclaw config validate` is handled in the next step.
|
|
54
59
|
|
|
55
|
-
|
|
60
|
+
8. **Validate with the host's OWN check, THEN declare created.** Run `openclaw config validate --json`. The verdict is `{ valid, path, issues? }` — success keys off **`.valid`**, never an `ok` field. Only when `valid: true` **and** the allow-list admission (step 7) succeeded do you report **`created`**. If `valid: false`, the admission helper exited non-zero, or any CLI step failed, report **`persistence_failed`** with the failing **path** + **cause** (the `issues?`), leaving nothing partial.
|
|
56
61
|
|
|
57
|
-
|
|
62
|
+
9. **Tell the user it is ready.** On `created`, tell them their shopper exists and how to open it. Opening it loads the persona (`SOUL.md`) and the shared user spec + the (empty) `domains` map (`profile.json`), and — because the `sil_*` tools were admitted in step 7 — the shopper calls `sil_search` / `sil_product_get` (and `sil_register` / `sil_whoami` as needed) on the user's intent with **no further setup**, **minting each niche's domain pack on the fly** the first time the user shops it.
|
|
58
63
|
|
|
59
64
|
## Status taxonomy (agent-creation engine)
|
|
60
65
|
|
|
61
66
|
| `status` | Meaning | What to do |
|
|
62
67
|
|---|---|---|
|
|
63
|
-
| `created` |
|
|
68
|
+
| `created` | Shopper added, shared user spec materialized, sil plugin + skill wired, `openclaw config validate` accepted it. | Tell the user it's ready and how to open it. |
|
|
64
69
|
| `invalid_request` | Spec failed validation (missing/blank field). **Nothing written.** | Name the field, fix it, run again — do NOT proceed to `openclaw agents add`. |
|
|
65
|
-
| `collision` |
|
|
66
|
-
| `persistence_failed` | A write or `openclaw config validate` step failed. **Nothing partial** left. | Fix the reported path/cause, create again. |
|
|
70
|
+
| `collision` | A shopper already exists (the singleton). | Surface it — "a shopper already exists"; steer to shop-a-new-niche (lazy mint) or refine. **Never mint a second shopper.** |
|
|
71
|
+
| `persistence_failed` | A write, the allow-list admission helper (non-zero exit), or `openclaw config validate` step failed. **Nothing partial** left. | Fix the reported path/cause, create again. |
|
|
67
72
|
|
|
68
|
-
## Runtime — how
|
|
73
|
+
## Runtime — how the shopper loads its behaviour
|
|
69
74
|
|
|
70
|
-
When you (the sil skill) start a session
|
|
71
|
-
-
|
|
72
|
-
- **`
|
|
73
|
-
- **`user_spec.md`** — the user's domain-relevant facts + hard constraints (seeded partial, augmented per-query);
|
|
74
|
-
- **`playbook.md`** — the user's buying taste (seeded partial, augmented per-query).
|
|
75
|
+
When you (the sil skill) start a session as the shopper, the host has already injected the persona via the workspace **`SOUL.md`**. Then read `$SIL_DATA_DIR/shopper/profile.json` and load:
|
|
76
|
+
- the **shared `user_spec.md`** — the person's cross-niche facts + hard constraints (seeded partial, augmented per-query), reused across **every** niche;
|
|
77
|
+
- the slug-keyed **`domains`** map — the niches the shopper has already learned. An **empty** map is healthy; the per-domain packs (`domains/<slug>/{domain_spec,intent_spec,playbook}.md`) load **lazily at shop time**, not here.
|
|
75
78
|
|
|
76
|
-
Loading these is what lets the
|
|
79
|
+
Loading these is what lets the shopper shop any niche with no further setup. When the user states a shopping intent, shop per [`shop_loop.md`](shop_loop.md) — the loop that classifies the niche, **reuses an existing domain or mints one on the fly**, then on **every query** web-refreshes that domain's spec, decomposes the request along its intent-spec dimensions (the ephemeral per-query intent), and **learns** every query (a fact → the shared `user_spec.md`, a taste → the active domain's `playbook.md`, each via a single `sil_remember` append). To sharpen the shopper or one of its domains from observed sessions, see [`refine_shopper.md`](refine_shopper.md).
|