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,79 +1,139 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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
|
-
|
|
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.
|
|
1
|
+
---
|
|
2
|
+
name: agent-creation-engine
|
|
3
|
+
description: The ordered, one-command engine that persists the single sil-wired shopper after the user endorses the assembled draft. Load only after explicit endorsement in the interview.
|
|
4
|
+
---
|
|
8
5
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
## The profile spec (input)
|
|
6
|
+
# Create your sil-wired shopper — the agent-creation engine
|
|
12
7
|
|
|
13
|
-
|
|
8
|
+
**Precondition: run this ONLY after the user has explicitly endorsed the assembled draft
|
|
9
|
+
from [`brainstorm_interview.md`](brainstorm_interview.md).** The interview owns that gate.
|
|
10
|
+
|
|
11
|
+
This persists **one** valid OpenClaw agent — the user's **shopper**: a real agent under
|
|
12
|
+
the host `agents` config, sil plugin enabled, sil skill attached, its persona in the
|
|
13
|
+
workspace **`SOUL.md`**, plus the **shared user spec** in the sil data dir — so it shops
|
|
14
|
+
with **no further setup**. The shopper is a **singleton**: created once, then it learns
|
|
15
|
+
**domains** lazily on first shop, so a fresh shopper has an **empty `domains` map** —
|
|
16
|
+
healthy. Creation is **local and offline**: no token is read, no `sil_register` /
|
|
17
|
+
`sil_whoami`, no network call. The shopper registers the user later, on first shop.
|
|
18
|
+
|
|
19
|
+
## The one command
|
|
20
|
+
|
|
21
|
+
After the endorsement, run exactly **one** shipped command — the package bin
|
|
22
|
+
**`sil-openclaw-create-shopper`** — and it runs the whole choreography **atomically** and
|
|
23
|
+
**fail-closed**, then returns one structured JSON result. You do **not** hand-run the
|
|
24
|
+
host-CLI steps; the bin runs them **for you, in order, as one transaction**. Feed it the
|
|
25
|
+
endorsed spec as one JSON object on **`stdin`** (or via **`--spec <path>`**):
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
sil-openclaw-create-shopper <<'JSON'
|
|
29
|
+
{ "agentId": "my-shopper", "name": "My Shopper",
|
|
30
|
+
"workspace": "~/.openclaw/workspace-my-shopper",
|
|
31
|
+
"persona": "…the endorsed persona…", "userSpec": "…the seeded shared user spec…",
|
|
32
|
+
"channel": "telegram" }
|
|
33
|
+
JSON
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
The bin is **non-interactive**: it executes an **already-assembled, already-endorsed**
|
|
37
|
+
spec — it **never re-runs the interview** and never prompts. The sil **plugin** and sil
|
|
38
|
+
**skill** are always wired — that is what makes it *sil-wired*. It is a standalone
|
|
39
|
+
operator script, **not** the plugin process, so the plugin's "never write host config"
|
|
40
|
+
guarantee holds; the bin legitimately drives `openclaw …` on your behalf.
|
|
41
|
+
|
|
42
|
+
## The spec (input)
|
|
14
43
|
|
|
15
44
|
| Field | Meaning | Goes to | Required? |
|
|
16
45
|
|---|---|---|---|
|
|
17
|
-
| **agentId** | Lower-kebab id
|
|
46
|
+
| **agentId** | Lower-kebab id → `agents.list[].id`. Unique, never `main`. | host | Required |
|
|
18
47
|
| **name** | Human-readable name ("My Shopper"). | sil manifest | Required |
|
|
19
|
-
| **persona** | Who
|
|
20
|
-
| **workspace** | The shopper's workspace directory
|
|
21
|
-
| **userSpec** | The user's **shared, cross-niche** facts + hard constraints
|
|
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
|
+
| **persona** | Who the shopper is / how it shops — a generalist, voice, standing rules. | host **`SOUL.md`** (no `persona.md`) | Required |
|
|
49
|
+
| **workspace** | The shopper's workspace directory. | host | Required |
|
|
50
|
+
| **userSpec** | The user's **shared, cross-niche** facts + hard constraints. Seeded partial by the interview. | sil `user_spec.md` | **Required** |
|
|
51
|
+
| **channel** | The channel the setup conversation is on — bound to the new shopper. | host `openclaw.json` bindings | **Optional (fail-open)** |
|
|
52
|
+
|
|
53
|
+
There is **no per-niche input at create** — no `domainSpec` / `intentSpec` / `playbook`;
|
|
54
|
+
those are minted lazily on first shop. The shopper reaches the web to mint and refresh
|
|
55
|
+
domains, so the agent needs web/fetch tools (inherited from `agents.defaults`); if
|
|
56
|
+
defaults grant none, the bin reports `created` with a `warnings` entry naming the gap
|
|
57
|
+
(bare `sil_search` still works) — surface it.
|
|
58
|
+
|
|
59
|
+
## What the bin does atomically (in this exact order)
|
|
60
|
+
|
|
61
|
+
1. **Validate the spec FIRST** — `agentId` (present, lower-kebab, ≠ `main`), `name`,
|
|
62
|
+
`persona`, `workspace`, and the shared **`userSpec`** (present, non-blank — the only
|
|
63
|
+
sil artefact at create). No `domainSpec` / `intentSpec` / `playbook` to validate. Any
|
|
64
|
+
failure stops with **`invalid_request`** naming the field and **writes nothing**, ahead
|
|
65
|
+
of every host command.
|
|
66
|
+
2. **Singleton check.** Run `openclaw agents list --json` and read the sil store (the
|
|
67
|
+
no-args `sil_profile_get` overview) **before** the add. If a sil shopper already
|
|
68
|
+
exists, stop with **`collision`** — **"a shopper already exists"** — and do **not** run
|
|
69
|
+
`openclaw agents add`; steer to shop-a-new-niche (lazy mint) or refine — **never mint a
|
|
70
|
+
second shopper**. An `agentId` clashing with any existing agent is likewise
|
|
71
|
+
`collision`. An inconclusive read fails closed.
|
|
72
|
+
3. **Create the agent shell.** `openclaw agents add <agentId> --workspace <workspace>
|
|
73
|
+
--non-interactive --json` — the real `agents.list[]` entry + workspace bootstrap
|
|
74
|
+
(`SOUL.md`, `AGENTS.md`, …), inheriting model and tool profile from `agents.defaults`.
|
|
75
|
+
4. **Write the persona straight into the workspace `SOUL.md`** (host CLI). The persona is
|
|
76
|
+
the shopper's soul — the host's `SOUL.md`, not a sil artefact. There is **no**
|
|
77
|
+
`persona.md` and **no copy** step.
|
|
78
|
+
5. **Materialize the shared user spec — NO `domain`.** Call `sil_profile_materialize {
|
|
79
|
+
name, userSpec }` (the singleton takes no `agentId`). With no `domain`, it writes the
|
|
80
|
+
shared **`user_spec.md`** + **`profile.json`** with an **empty `domains: {}` map** into
|
|
81
|
+
`$SIL_DATA_DIR/shopper/`, atomically. No `domain_spec.md` / `intent_spec.md` /
|
|
82
|
+
`playbook.md` yet.
|
|
83
|
+
6. **Wire the sil skill + plugin** (host CLI). Asserted against the pinned host
|
|
84
|
+
**`alpine/openclaw:2026.6.9`**, both value-mode sets with `--strict-json` (the only set
|
|
85
|
+
mode this image accepts):
|
|
48
86
|
```
|
|
49
87
|
openclaw config set 'agents.list[<i>].skills' '["sil"]' --strict-json
|
|
50
88
|
openclaw config set plugins.entries.sil.enabled true --strict-json
|
|
51
89
|
```
|
|
52
|
-
The skill attach makes the agent
|
|
53
|
-
|
|
54
|
-
7. **Admit sil at the host allow surfaces
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
90
|
+
The skill **attach** makes the agent know how to drive the tools; the plugin **enable**
|
|
91
|
+
turns sil on — but does not un-filter the tools by itself (next step).
|
|
92
|
+
7. **Admit sil at the host allow surfaces.** Until sil is admitted at `plugins.allow` +
|
|
93
|
+
**`tools.alsoAllow`**, the host keeps the `sil_*` tools filtered. The value-mode `config
|
|
94
|
+
set` above is overwrite-only, so it cannot additively merge those shared arrays without
|
|
95
|
+
clobbering another admitted plugin (e.g. `klodi`). The bin runs the shipped admission
|
|
96
|
+
helper — the sibling bin `sil-openclaw-allowlist` (the `openclaw:allowlist` script) —
|
|
97
|
+
the additive, idempotent, self-validating three-surface merge. **If the helper exits
|
|
98
|
+
non-zero (a failed admission), the bin reports `persistence_failed` with the path +
|
|
99
|
+
cause and does NOT declare `created`** — never a green `created` over filtered tools.
|
|
100
|
+
8. **Bind the current channel — FAIL-OPEN.** Resolve the channel (`spec.channel`, else the
|
|
101
|
+
host's `OPENCLAW_MCP_MESSAGE_CHANNEL`) and, if one resolves, run `openclaw agents bind
|
|
102
|
+
--agent <agentId> --bind <channel> --json`, then **verify** the route stuck (read-back +
|
|
103
|
+
`openclaw config validate` still passes). If undetermined, owned by another agent (no
|
|
104
|
+
`--force`), or unverifiable, revert any partial route and degrade to a manual-bind hint
|
|
105
|
+
in `warnings` — this step **never fails creation**.
|
|
106
|
+
9. **Validate with the host's own check, THEN declare created.** `openclaw config validate
|
|
107
|
+
--json` returns `{ valid, path, issues? }` — success keys off **`.valid`**, never an
|
|
108
|
+
`ok` field. Only when `valid: true` **and** admission (step 7) succeeded does it report
|
|
109
|
+
**`created`**, carrying `boundChannel` (or `null`). Otherwise it reports
|
|
110
|
+
**`persistence_failed`** with the failing **path** + **cause**.
|
|
111
|
+
10. **On any failure after writes begin, tear down** — restore the pre-run `openclaw.json`
|
|
112
|
+
snapshot (reversing the agent entry + skill + plugin + admission + any channel
|
|
113
|
+
binding), remove the workspace dir (only if it created it) and the singleton shopper
|
|
114
|
+
dir (only if it did not pre-exist). `persistence_failed` truthfully means **nothing
|
|
115
|
+
partial** is left. In the rare case teardown cannot fully revert, the bin reports a
|
|
116
|
+
distinct, louder outcome that **names the residue** — never voiced as "nothing partial".
|
|
117
|
+
|
|
118
|
+
The bin emits **one** `{ status, … }` result and exits 0 **only** on `created`.
|
|
119
|
+
|
|
120
|
+
## Status taxonomy
|
|
65
121
|
|
|
66
122
|
| `status` | Meaning | What to do |
|
|
67
123
|
|---|---|---|
|
|
68
|
-
| `created` | Shopper added, shared user spec materialized,
|
|
69
|
-
| `invalid_request` | Spec failed validation
|
|
70
|
-
| `collision` | A shopper already exists (the singleton). | Surface
|
|
71
|
-
| `persistence_failed` | A write, the allow-list
|
|
124
|
+
| `created` | Shopper added, shared user spec materialized, plugin + skill wired, `openclaw config validate` accepted it. Carries `name` + `agentId` + `workspace` + `boundChannel` (or `null`). | Tell the user it's ready; if `boundChannel` is `null`, relay the manual-bind hint. |
|
|
125
|
+
| `invalid_request` | Spec failed validation. **Nothing attempted.** | Name the field, fix it, run again. |
|
|
126
|
+
| `collision` | A shopper already exists (the singleton), or the `agentId` clashes. **Nothing written.** | Surface "a shopper already exists"; steer to shop-a-new-niche or refine. **Never a second shopper.** |
|
|
127
|
+
| `persistence_failed` | A write, the allow-list helper (non-zero exit), or `openclaw config validate` failed. Teardown ran — **nothing partial** left. | Fix the reported path/cause and re-run (safe). |
|
|
72
128
|
|
|
73
129
|
## Runtime — how the shopper loads its behaviour
|
|
74
130
|
|
|
75
|
-
When you (the sil skill) start a session as the shopper, the host has already injected the
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
131
|
+
When you (the sil skill) start a session as the shopper, the host has already injected the
|
|
132
|
+
persona via **`SOUL.md`**. Then read `$SIL_DATA_DIR/shopper/profile.json` and load the
|
|
133
|
+
shared **`user_spec.md`** (cross-niche facts + hard constraints, reused across every
|
|
134
|
+
niche) and the slug-keyed **`domains`** map — an empty map is healthy; the per-domain
|
|
135
|
+
packs load **lazily at shop time**. Because the `sil_*` tools were admitted at create, the
|
|
136
|
+
shopper calls **`sil_search`** / **`sil_product_get`** (and `sil_register` / `sil_whoami`
|
|
137
|
+
as needed) with **no further setup**, minting each niche on the fly the first time the
|
|
138
|
+
user shops it, per [`shop_loop.md`](shop_loop.md). To sharpen the shopper or a domain, see
|
|
139
|
+
[`refine_shopper.md`](refine_shopper.md).
|
|
@@ -1,61 +1,97 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
This is a **conversation, not a form-fill** — and a **short** one. The shopper is a **generalist**: it goes deep on whatever the user later buys, **lazily minting a domain on first shop in each niche**. So onboarding does **NOT** research any niche and does **NOT** ask the user to pick one. It touches exactly **two** things: the **persona** (how their shopper should behave) and a **shared user-spec seed** (cross-niche facts + hard constraints). Everything niche-specific — how to shop a niche well, what each request in it should resolve, the niche shopping taste — is **deferred to first shop**, not authored here.
|
|
6
|
-
|
|
7
|
-
## The two onboarding touchpoints — persona + shared user spec
|
|
8
|
-
|
|
9
|
-
A created shopper runs on a persona (`SOUL.md`) plus the **shared, agent-level `user_spec.md`**, both seeded here. The per-domain packs are minted lazily at shop time, not at onboarding.
|
|
10
|
-
|
|
11
|
-
| Artefact | Where | What it holds | Seeded |
|
|
12
|
-
|---|---|---|---|
|
|
13
|
-
| **`SOUL.md`** (persona) | host workspace (via host CLI) | the shopper's identity / voice / standing rules — a **generalist**, not a niche specialist | at onboarding (§1 below); refined on persona refine, stable per query |
|
|
14
|
-
| **`user_spec.md`** (shared) | sil data dir (**required**) | the user's **cross-niche** facts + hard constraints (addresses, sizes, allergy/ethics rules, budget psychology) | seeded partial at onboarding (§2); augmented every query, reused across **every** niche |
|
|
15
|
-
|
|
16
|
-
The niche packs — the deep niche know-how, the per-request template a query is resolved against, and the niche shopping taste — are **NOT** authored here; they are minted **on first shop in each niche** ([`shop_loop.md`](shop_loop.md)). The per-query fill (the template filled in for one request) is **ephemeral** — never persisted, never authored here.
|
|
17
|
-
|
|
18
|
-
## Principles for the interview
|
|
19
|
-
|
|
20
|
-
- **Two touchpoints, no niche research.** Touch the persona and the shared user spec — that is the whole onboarding. The shopper is a **generalist**; there is **no narrow-the-niche step** and **no domain interview**. The deep niche expertise is researched **lazily, at first shop**, never interrogated here.
|
|
21
|
-
- **The persona question shapes voice, not a niche.** Asking "how should your shopper behave?" surfaces the **voice / standing rules** — terse vs. chatty, cautious vs. opinionated, any never-break rules. It does **not** bind the shopper to one niche.
|
|
22
|
-
- **Seed the shared facts, ask little.** The shared user spec holds cross-niche facts + hard constraints that carry across every niche. Seed what the user volunteers — don't run a questionnaire; the rest is **augmented per-query** at shop time.
|
|
23
|
-
- **Converge, don't accumulate.** Reflect a short summary back and get a yes/adjust before advancing. The flow is **collaborative** and **re-entrant** — the user can revise an earlier touchpoint at any point.
|
|
24
|
-
- **Endorsement is a gate, not a formality.** Until the user explicitly says "create it", run **zero** engine steps. The draft lives only in the conversation.
|
|
25
|
-
|
|
26
|
-
## Run the interview in this order — two touchpoints
|
|
27
|
-
|
|
28
|
-
### 1. `SOUL.md` — ASK FIRST: persona + behaviour (a generalist shopper)
|
|
1
|
+
---
|
|
2
|
+
name: brainstorm-interview
|
|
3
|
+
description: The two-touchpoint shopper onboarding — persona + shared user-spec seed, converged with the user and endorsement-gated. Load when the user asks to set up or create their shopper.
|
|
4
|
+
---
|
|
29
5
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
### 2. `user_spec.md` (shared) — seed the cross-niche facts + hard constraints
|
|
33
|
-
|
|
34
|
-
Seed the **shared user spec**: the user's **cross-niche** facts and any **hard constraints** that should hold in *every* niche — addresses / sizes the user volunteers, an allergy or ethics rule ("never leather"), a budget psychology. Mark each as **hard** (inviolable — an allergy, an ethics rule, an age gate) vs **soft** (a bendable preference). Don't run a questionnaire — seed what the user offers; the rest is **augmented per-query** at shop time, and a niche-specific fact is learned when that niche is first shopped. If the user gives little, seed a minimal honest body (e.g. "cross-niche facts to be learned as we shop; no hard constraints stated yet") — non-blank, but partial. This lands in `userSpec` (→ the shared `user_spec.md`). **No niche taste, no domain question, no intent dimensions are gathered here** — those belong to first-shop lazy mint.
|
|
35
|
-
|
|
36
|
-
### 3. Derive the identity, assemble, endorse
|
|
37
|
-
|
|
38
|
-
- **Identity.** Propose an `agentId` (lower-kebab, `^[a-z0-9][a-z0-9-]*$`, never `main`) and a human-readable `name` ("My Shopper" / `my-shopper`). **Confirm both** — never silently invent them.
|
|
39
|
-
- **Assemble + present.** Compose **`{ agentId, name, persona, userSpec }`** and present a **readable summary**: who the shopper is (its persona/voice + standing rules) and the **seeded shared user spec** (cross-niche facts + hard constraints, partial, to grow per-query). Self-check the shape against the engine's contract: `agentId` lower-kebab & ≠ `main` (it keys the host `openclaw agents add`, not the sil tool), non-blank `name`/`persona`, and a non-blank shared `userSpec` — the only sil artefact at create (the engine passes just `name` + `userSpec` to the singleton `sil_profile_materialize`; no niche pack is authored here). This is shape-only — it writes nothing; the engine's validate-first step is the authoritative gate.
|
|
40
|
-
- **Endorse — the gate.** Ask for an explicit go-ahead ("shall I create your shopper?"). Endorsement is an **affirmative user act** on the assembled draft — "yes, create it" / "go ahead". It is **NOT** inferred from the user answering the last question, and **NOT** from silence. **Only on that explicit endorsement** do you proceed to the engine ([`agent_creation_engine.md`](agent_creation_engine.md)).
|
|
41
|
-
|
|
42
|
-
## Edge cases the interview handles gracefully
|
|
43
|
-
|
|
44
|
-
- **A shopper already exists (the singleton).** The shopper is a singleton — the engine refuses a second create (its `collision` outcome, "a shopper already exists") and never clobbers the existing one. Surface it and 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, never silently mutate the existing one.
|
|
45
|
-
- **Abandon mid-flow.** Because **no engine step runs before endorsement**, abandonment leaves **nothing created** — no host agent, no artefacts, no wiring, no teardown. Never "save progress" by writing artefacts early.
|
|
46
|
-
- **Creation is local + offline (for the user's identity).** Creating a shopper neither requires nor performs sil registration. Do **NOT** present sil registration or a token as a prerequisite to create the shopper; it registers the user later, on first shop, via `sil_register`. (No web access is needed at onboarding either — the niche research that reaches the web happens later, at first shop.)
|
|
47
|
-
|
|
48
|
-
## Business rules (invariants the interview holds on every path)
|
|
49
|
-
|
|
50
|
-
1. **No creation without explicit endorsement.** Nothing is written — not the host agent, the `SOUL.md`, the shared user spec, or the wiring — until the user explicitly endorses. The draft lives only in the conversation until then.
|
|
51
|
-
2. **Abandon-mid-flow creates nothing.** No engine step runs pre-endorsement, so an abandoned interview leaves no partial shopper — automatic, not a teardown.
|
|
52
|
-
3. **Two touchpoints only — persona, then shared user spec.** `SOUL.md` (ask first — persona/voice, a generalist, NOT a niche) and the shared `user_spec.md` (cross-niche facts + hard constraints). **No** niche know-how, no niche shopping taste, and no per-request template work at onboarding — those move to first-shop lazy mint.
|
|
53
|
-
4. **No niche is researched or chosen at onboarding.** The shopper is a generalist; the deep niche know-how, the per-request template, and the niche shopping taste are minted **lazily, on first shop** in each niche ([`shop_loop.md`](shop_loop.md)). Onboarding never interrogates a niche or asks the user to pick one.
|
|
54
|
-
5. **Converge each touchpoint before advancing; stay re-entrant.** Reflect-and-confirm per touchpoint; let the user revise an earlier one.
|
|
55
|
-
6. **Singleton: refuse a second shopper; never clobber.** Defer to the engine's `collision` refusal ("a shopper already exists"); steer to shop-a-new-niche or refine.
|
|
56
|
-
7. **Creation is local + offline for the user's identity.** Never present sil registration / a token as a prerequisite to create.
|
|
57
|
-
8. **The persona is the host `SOUL.md`, not a sil artefact.** No `persona.md` in the sil store. The only sil artefact seeded at create is the **shared** `user_spec.md`; the niche packs (the deep niche know-how, the per-request template, the niche shopping taste) are minted later, per niche.
|
|
58
|
-
|
|
59
|
-
## After endorsement
|
|
6
|
+
# Set up your shopper — the onboarding interview
|
|
60
7
|
|
|
61
|
-
|
|
8
|
+
When the user asks to **set up shopping** — "create my shopper", "set up an agent
|
|
9
|
+
that shops for me" — do **not** jump to the engine. Run a short, **two-touchpoint**
|
|
10
|
+
onboarding that shapes the shopper *with* the user — **pre-seeded from what they
|
|
11
|
+
already said this session** — then create nothing until the user endorses the
|
|
12
|
+
assembled draft. The engine ([`agent_creation_engine.md`](agent_creation_engine.md))
|
|
13
|
+
runs only **after** that explicit endorsement.
|
|
14
|
+
|
|
15
|
+
This is a **conversation, not a form-fill** — and a short one. The shopper is a
|
|
16
|
+
**generalist**: it goes deep on whatever the user later buys, **lazily minting a
|
|
17
|
+
domain on first shop** in each niche. So onboarding does **not** research any niche
|
|
18
|
+
and does **not** ask the user to pick one. It touches exactly **two** things: the
|
|
19
|
+
**persona** (how the shopper behaves) and a **shared user-spec seed** (cross-niche
|
|
20
|
+
facts + hard constraints).
|
|
21
|
+
|
|
22
|
+
## Open with a reflected draft, not a cold question
|
|
23
|
+
|
|
24
|
+
Before asking anything, **pre-seed** a draft from what the user already said *this
|
|
25
|
+
session*: the **persona** (their words on how the shopper should behave) and the
|
|
26
|
+
**shared user-spec seed** (any sizes, hard limits, or ethics rules mentioned in
|
|
27
|
+
passing). Then **open by reflecting that draft back** — *"from what you've told me,
|
|
28
|
+
here's the shopper I'd set up…"* — and ask only to confirm-or-adjust. That is the
|
|
29
|
+
rich (a filled draft) + light (one confirm) shape.
|
|
30
|
+
|
|
31
|
+
- **Pre-fill, don't interrogate.** Ask only to fill genuine gaps, never to re-collect
|
|
32
|
+
what the user already told you. If the session gave little, seed a **minimal
|
|
33
|
+
honest** draft ("cross-niche facts to be learned as we shop; no hard constraints
|
|
34
|
+
stated yet") and say so — never fabricate a size or a limit.
|
|
35
|
+
- **Session-only — local + offline.** The seed is assembled **only** from this
|
|
36
|
+
conversation. It reads **no token**, does **not** pull `sil_whoami`, and makes **no
|
|
37
|
+
network call**. (The shopper registers the user later, on first shop.)
|
|
38
|
+
- **The pre-fill is a proposal, never consent.** The endorsement gate below is
|
|
39
|
+
untouched.
|
|
40
|
+
|
|
41
|
+
## The two touchpoints
|
|
42
|
+
|
|
43
|
+
| Artefact | Where | What it holds |
|
|
44
|
+
|---|---|---|
|
|
45
|
+
| **`SOUL.md`** (persona) | host workspace | the shopper's voice / standing rules — a **generalist**, not a niche specialist |
|
|
46
|
+
| **`user_spec.md`** (shared) | sil data dir (**required**) | the user's **cross-niche** facts + hard constraints (addresses, sizes, allergy/ethics rules, budget psychology) |
|
|
47
|
+
|
|
48
|
+
The niche packs — the deep niche know-how, the per-request template, and the niche
|
|
49
|
+
shopping taste — are **not authored here**; they are **minted lazily on first shop**
|
|
50
|
+
in each niche ([`shop_loop.md`](shop_loop.md)). Never research a niche here.
|
|
51
|
+
|
|
52
|
+
**1. Persona — reflect back, confirm.** Open by reflecting the session-seeded persona
|
|
53
|
+
draft ("from what you've told me, your shopper sounds like…"), then confirm-or-adjust
|
|
54
|
+
its **voice/tone** and any **standing rules**. This surfaces voice, **not a niche** —
|
|
55
|
+
a generalist that shops whatever the user buys. It becomes the host workspace
|
|
56
|
+
**`SOUL.md`** (no `persona.md`).
|
|
57
|
+
|
|
58
|
+
**2. Shared user spec — seed the cross-niche facts + hard constraints.** Pre-fill the
|
|
59
|
+
**shared user spec** from the session: **cross-niche** facts and any **hard
|
|
60
|
+
constraints** that should hold in *every* niche — addresses / sizes, an allergy or
|
|
61
|
+
ethics rule ("never leather"), a budget psychology. Reflect the seed back and mark
|
|
62
|
+
each **hard** (inviolable) vs **soft** (bendable). Seed what the user offered; the
|
|
63
|
+
rest is augmented per-query at shop time. This lands in `userSpec` (→ the shared
|
|
64
|
+
`user_spec.md`). **No niche taste, no domain question, no intent dimensions** are
|
|
65
|
+
gathered here.
|
|
66
|
+
|
|
67
|
+
## Assemble + endorse
|
|
68
|
+
|
|
69
|
+
- **Identity.** Propose an `agentId` (lower-kebab, `^[a-z0-9][a-z0-9-]*$`, never
|
|
70
|
+
`main`) and a `name` ("My Shopper" / `my-shopper`). Confirm both.
|
|
71
|
+
- **Assemble + present.** Compose **`{ agentId, name, persona, userSpec }`** and
|
|
72
|
+
present a readable summary: who the shopper is and the seeded shared user spec
|
|
73
|
+
(partial, to grow per-query). Self-check the shape — `agentId` lower-kebab & ≠
|
|
74
|
+
`main`, non-blank `name`/`persona`, non-blank shared `userSpec` (the only sil
|
|
75
|
+
artefact at create). This writes nothing; the engine's validate-first step is the
|
|
76
|
+
authoritative gate.
|
|
77
|
+
- **Endorse — the gate.** Ask for an explicit go-ahead ("shall I create your
|
|
78
|
+
shopper?"). Endorsement is an affirmative act on the assembled draft — "yes, create
|
|
79
|
+
it". It is **not** inferred from the last answer and **not** from silence. **Only on
|
|
80
|
+
that explicit endorsement** do you proceed to the engine
|
|
81
|
+
([`agent_creation_engine.md`](agent_creation_engine.md)).
|
|
82
|
+
|
|
83
|
+
## Invariants (hold on every path)
|
|
84
|
+
|
|
85
|
+
- **No creation without explicit endorsement.** **Zero engine steps** run before the
|
|
86
|
+
explicit "yes"; the draft lives only in the conversation. **Nothing is created**
|
|
87
|
+
until then, so an abandoned interview leaves no partial shopper.
|
|
88
|
+
- **Two touchpoints only** — persona, then shared user spec, both pre-seeded from the
|
|
89
|
+
session. No niche is researched or chosen here; that is first-shop lazy mint.
|
|
90
|
+
- **Converge each touchpoint before advancing; stay re-entrant** — the user can revise
|
|
91
|
+
an earlier touchpoint at any point.
|
|
92
|
+
- **Singleton.** If a shopper already exists, the engine refuses a second create (its
|
|
93
|
+
`collision`, "a shopper already exists") — surface it and steer to shop-a-new-niche
|
|
94
|
+
or refine; never clobber the existing one.
|
|
95
|
+
- **Local + offline for identity.** Never present sil registration or a token as a
|
|
96
|
+
prerequisite to create, and never pull `sil_whoami` to seed — the seed is
|
|
97
|
+
session-only.
|
|
@@ -1,34 +1,32 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
name: catalog-tools-reference
|
|
3
|
+
description: Per-tool behaviour of the four core sil tools (register, whoami, search, product-get) and the shared status taxonomy. Load when driving any core catalog or identity tool.
|
|
4
|
+
---
|
|
2
5
|
|
|
3
|
-
|
|
4
|
-
`sil_whoami`, `sil_search`, `sil_product_get`. It holds how each tool behaves and
|
|
5
|
-
the status taxonomy every shopping tool shares. The router in `SKILL.md` names
|
|
6
|
-
which tool an intent maps to; this reference is what that tool actually does.
|
|
6
|
+
# sil catalog + identity tools — per-tool behaviour and the shared status taxonomy
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
Load this when driving any of the four core tools — `sil_register`, `sil_whoami`,
|
|
9
|
+
`sil_search`, `sil_product_get`. The router names which tool an intent maps to; this
|
|
10
|
+
reference is what each does, plus the status taxonomy they all share. All four return a
|
|
11
|
+
single JSON body carrying a `status`; prices are in the currency's ISO 4217 minor unit.
|
|
11
12
|
|
|
12
|
-
##
|
|
13
|
+
## Per-tool behaviour
|
|
13
14
|
|
|
14
|
-
- **`sil_register`** starts browser-based registration
|
|
15
|
-
`status: "awaiting_browser"` and an `auth_url` — share that URL
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
- **`sil_whoami`** returns the registered user's identity (name
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
- **`sil_register`** starts browser-based registration: it returns promptly with
|
|
16
|
+
`status: "awaiting_browser"` and an `auth_url` — share that URL. The plugin polls in
|
|
17
|
+
the background; once the user signs in, call `sil_register` again to confirm (it
|
|
18
|
+
reports `already_registered`).
|
|
19
|
+
- **`sil_whoami`** returns the registered user's identity (name + addresses). An expired
|
|
20
|
+
token is refreshed transparently; a fully-dead session names the recovery
|
|
21
|
+
(`sil_register`).
|
|
21
22
|
- **`sil_search`** returns a ranked list of purchasable variants (`id`, `title`,
|
|
22
|
-
`price`, `availability`, `checkout_url`, `source`), best match first — present
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
to the id(s) asked about (the response is NOT in request order). Ids that no
|
|
30
|
-
longer resolve come back in a `not_found` list — a normal partial-success
|
|
31
|
-
outcome, not an error; the other products are still valid.
|
|
23
|
+
`price`, `availability`, `checkout_url`, `source`), best match first — present in
|
|
24
|
+
order, do not re-rank. An empty list is a normal `ok` outcome, not an error. Use the
|
|
25
|
+
returned `cursor` for the next page; its absence means no more results.
|
|
26
|
+
- **`sil_product_get`** is the lookup companion — pass ids you already hold and get the
|
|
27
|
+
matching products back with fresh detail. Each variant carries an `inputs` list
|
|
28
|
+
correlating it to the id(s) asked about (the response is not in request order). Ids
|
|
29
|
+
that no longer resolve come back in a `not_found` list — a normal partial success.
|
|
32
30
|
|
|
33
31
|
## Status taxonomy (shared across the shopping tools)
|
|
34
32
|
|
|
@@ -41,6 +39,6 @@ cents).
|
|
|
41
39
|
| `invalid_request` | The query/ids were rejected (e.g. empty input). | Fix the input and call again — do NOT re-register. |
|
|
42
40
|
| `retryable` | A transient network/5xx blip. | Try the same call again — do NOT re-register. |
|
|
43
41
|
|
|
44
|
-
On a non-`ok` status, say what happened and follow the tool's own `recovery`
|
|
45
|
-
|
|
46
|
-
|
|
42
|
+
On a non-`ok` status, say what happened and follow the tool's own `recovery` hint —
|
|
43
|
+
never improvise a different one (re-registering can't fix a bad query or a transient
|
|
44
|
+
5xx).
|
|
@@ -1,56 +1,77 @@
|
|
|
1
|
-
|
|
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
|
+
---
|
|
2
5
|
|
|
3
|
-
|
|
6
|
+
# Manage your shopper's domains — view, forget
|
|
4
7
|
|
|
5
|
-
|
|
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.
|
|
6
13
|
|
|
7
|
-
|
|
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.
|
|
8
20
|
|
|
9
21
|
## Match intent to a tool
|
|
10
22
|
|
|
11
23
|
| Intent | Tool |
|
|
12
24
|
|---|---|
|
|
13
|
-
| "what does my shopper know?" / "which domains has it learned?"
|
|
25
|
+
| "what does my shopper know?" / "which domains has it learned?" (overview) | `sil_profile_get` (no `domainSlug`) |
|
|
14
26
|
| "show me / tell me about the <niche> domain" | `sil_profile_get` (pass the `domainSlug`) |
|
|
15
27
|
| "forget / remove / delete the <niche> domain" | `sil_profile_remove` (pass the `domainSlug`) |
|
|
16
|
-
| "decommission / tear down my whole shopper" | host CLI `openclaw agents remove <agentId>` **FIRST**, then clear the artefact tree
|
|
17
|
-
|
|
18
|
-
## How the
|
|
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
|
-
|
|
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.
|
|
47
68
|
|
|
48
69
|
## Status taxonomy (manage: view / remove)
|
|
49
70
|
|
|
50
71
|
| `status` | Meaning | What to do |
|
|
51
72
|
|---|---|---|
|
|
52
|
-
| `ok` | A view returned the overview (a
|
|
53
|
-
| `not_found` | No domain matches the `domainSlug
|
|
54
|
-
| `invalid_request` | The `domainSlug` was malformed, `main`, traversal-shaped, or (remove) missing. **Nothing
|
|
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. |
|
|
55
76
|
| `removed` | `sil_profile_remove` deleted exactly one domain pack. | Confirm that niche is gone; the shopper + shared user spec + sibling domains are untouched. |
|
|
56
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. |
|