sil-openclaw 0.4.2 → 0.4.3

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.
@@ -21,6 +21,7 @@
21
21
  * nothing). The persona is NOT written here — it is the host workspace SOUL.md.
22
22
  */
23
23
  import { Type } from "typebox";
24
+ import { wiringAdvisories } from "../lib/host-wiring.js";
24
25
  import { learnArtefact, materializeProfile, readArtefactBody, removeArtefact, searchProfileFrontmatter, } from "../lib/profile-store.js";
25
26
  import { jsonResult } from "../lib/tool-result.js";
26
27
  /** Narrow a host-validated param to a string, defaulting to "" so the store does the
@@ -68,7 +69,12 @@ function registerMaterialize(api) {
68
69
  });
69
70
  if (result.ok) {
70
71
  api.logger.info("sil_profile_materialized", {});
71
- return jsonResult({ status: "ok", dir: result.dir, userSpecPath: result.userSpecPath });
72
+ return jsonResult({
73
+ status: "ok",
74
+ dir: result.dir,
75
+ userSpecPath: result.userSpecPath,
76
+ ...wiringAdvisories(api),
77
+ });
72
78
  }
73
79
  return mapFailure(api, "sil_profile_materialize", result);
74
80
  },
@@ -138,6 +144,7 @@ function registerLearn(api) {
138
144
  ...(result.prd !== undefined ? { prd: result.prd } : {}),
139
145
  path: result.path,
140
146
  ...(result.assetPath !== undefined ? { assetPath: result.assetPath } : {}),
147
+ ...wiringAdvisories(api),
141
148
  });
142
149
  }
143
150
  return mapFailure(api, "sil_learn", result);
@@ -195,6 +202,7 @@ function registerSearch(api) {
195
202
  + " answered from the sil catalog, never from the open web.",
196
203
  }
197
204
  : {}),
205
+ ...wiringAdvisories(api),
198
206
  });
199
207
  },
200
208
  });
@@ -228,6 +236,7 @@ function registerGet(api) {
228
236
  fields: result.fields,
229
237
  body: result.body,
230
238
  path: result.path,
239
+ ...wiringAdvisories(api),
231
240
  });
232
241
  }
233
242
  return mapFailure(api, "sil_profile_get", result);
@@ -258,6 +267,7 @@ function registerRemove(api) {
258
267
  status: "removed",
259
268
  domainSlug: result.domainSlug,
260
269
  ...(result.prd !== undefined ? { prd: result.prd } : {}),
270
+ ...wiringAdvisories(api),
261
271
  });
262
272
  }
263
273
  return mapFailure(api, "sil_profile_remove", result);
@@ -2,13 +2,14 @@
2
2
  "id": "sil",
3
3
  "name": "sil",
4
4
  "description": "Turn your OpenClaw into an expert shopping agent.",
5
- "version": "0.4.2",
5
+ "version": "0.4.3",
6
6
  "skills": ["./sil-shopping"],
7
7
  "activation": {
8
8
  "onCapabilities": ["tool"]
9
9
  },
10
10
  "contracts": {
11
11
  "tools": [
12
+ "sil_doctor",
12
13
  "sil_learn",
13
14
  "sil_product_get",
14
15
  "sil_profile_get",
@@ -53,12 +54,13 @@
53
54
  },
54
55
  "security": {
55
56
  "shipsRuntimeCode": true,
56
- "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. The five profile verbs make NO network call and read no token; they write the one sil shopper's SINGLETON behaviour artefacts under a fixed $SIL_DATA_DIR/shopper/ (owner-only, files 0600, dirs 0700) as frontmatter-as-truth markdown — there is NO profile.json manifest; each file's own frontmatter IS the source of truth, discovered by a filesystem scan. sil_profile_materialize is SETUP-ONLY: it writes shopper/user_spec.md (the shared person spec; its frontmatter carries the shopper name), minting no domain. sil_learn is the single target+change verb over shopper/domains/<slug>/{method.md, prds/<product>-<intent>.md, assets/}: create mints a whole method or PRD; append/amend/retract refine a section-aware markdown body in place (single-occurrence match, fail-closed if the target or the named section is absent); attach-asset persists image bytes (size-capped, image MIME allowlist) into the domain's assets/ owner-only and links them by RELATIVE path, never inline bytes. sil_profile_search scans artefact FRONTMATTER and returns coordinates only (no bodies) — a domain/PRD with malformed frontmatter is skipped and surfaced as unreadable, never silently dropped or half-read. sil_profile_get reads ONE whole body (method or PRD); sil_profile_remove deletes a whole validated domain subtree, or one PRD file, fail-closed on a malformed/traversal/\"main\" or missing slug (never the whole shopper). The only caller-supplied path segments are the domain slug and the PRD key, both validated (lower-kebab, not \"main\") before any join; the shopper segment is a compile-time constant. Every write is atomic (tmp file → rename over target → chmod), so a reader sees a whole file or none. 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. The PKCE verifier is held only in memory and is never written to disk. Artefact bodies, tokens, and identity PII are never logged.",
57
+ "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. The five profile verbs make NO network call and read no token; they write the one sil shopper's SINGLETON behaviour artefacts under a fixed $SIL_DATA_DIR/shopper/ (owner-only, files 0600, dirs 0700) as frontmatter-as-truth markdown — there is NO profile.json manifest; each file's own frontmatter IS the source of truth, discovered by a filesystem scan. sil_profile_materialize is SETUP-ONLY: it writes shopper/user_spec.md (the shared person spec; its frontmatter carries the shopper name), minting no domain. sil_learn is the single target+change verb over shopper/domains/<slug>/{method.md, prds/<product>-<intent>.md, assets/}: create mints a whole method or PRD, fail-closed if one already exists; write replaces an existing doc's whole body with a caller-authored reconciled version, fail-closed if the target is absent — there is no in-place section edit, so every change rewrites the whole document; attach-asset persists image bytes (size-capped, image MIME allowlist) into the domain's assets/ owner-only and links them by RELATIVE path, never inline bytes. sil_profile_search scans artefact FRONTMATTER and returns coordinates only (no bodies) — a domain/PRD with malformed frontmatter is skipped and surfaced as unreadable, never silently dropped or half-read. sil_profile_get reads ONE whole body (method or PRD); sil_profile_remove deletes a whole validated domain subtree, or one PRD file, fail-closed on a malformed/traversal/\"main\" or missing slug (never the whole shopper). sil_doctor is a report-first diagnostic over the SAME $SIL_DATA_DIR state: it reads the data dir, file modes, tokens.json/config.json metadata, and artefact frontmatter, and returns a machine-readable findings array. It reads no token contents out and rotates no token: token health is metadata only (present / mode / parses / expired), where expiry is decoded from the access token's own JWT exp claim strictly LOCALLY (decode-only, no signature verification, no network, no claim other than exp extracted, never a token byte emitted or logged). Its only writes are two safe idempotent fixes under $SIL_DATA_DIR — tightening a too-open mode and creating the missing data dir; a tighten only ever NARROWS (it detects bits set outside the expected mask and chmods to mode & expected, which can only clear bits, never grant them). Enumerated entries under the data dir are lstat'd, and a symlink found among them is REPORTED, never chmod'd-through — that is what keeps a tighten inside the store. The data directory ROOT itself is stat'd rather than lstat'd, because chmod follows a symlink regardless (Linux exposes no lchmod), so lstat there would prevent nothing and merely re-report the same fix forever; a symlinked $SIL_DATA_DIR is an operator-declared indirection, so the tighten lands on the directory the plugin already stores everything in. anything that would mutate the bytes of an existing artefact (clearing a corrupt tokens.json, deleting an orphaned tmp file, repairing an artefact) is REPORTED as needs_confirmation and never run. It makes exactly ONE outbound request, and it is the only reason https://clawhub.ai is declared: an unauthenticated read-only GET of the published version of @4gpts/sil, bounded by an explicit timeout + abort, carrying no token, no PII, no store contents, and no Authorization header, pinned to that one host (redirects are refused). It fails soft to silence — an unreachable, slow, non-200, or unparseable response yields no finding at all and never fails the run. sil_doctor never acts on the version it reports: it installs nothing, spawns no process, writes no host config, and prompts nobody. The only caller-supplied path segments are the domain slug and the PRD key, both validated (lower-kebab, not \"main\") before any join; the shopper segment is a compile-time constant. Every write is atomic (tmp file → rename over target → chmod), so a reader sees a whole file or none. 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. The PKCE verifier is held only in memory and is never written to disk. Artefact bodies, tokens, and identity PII are never logged.",
57
58
  "registersLongLivedService": false,
58
59
  "serviceIds": [],
59
60
  "runsTimers": true,
60
61
  "inboundHttpRoutes": [],
61
62
  "networkEndpoints": [
63
+ "https://clawhub.ai",
62
64
  "https://sil-api.4gpts.com",
63
65
  "https://sil.4gpts.com"
64
66
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sil-openclaw",
3
- "version": "0.4.2",
3
+ "version": "0.4.3",
4
4
  "description": "Turn your OpenClaw into an expert shopping agent.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -13,14 +13,18 @@
13
13
  * consent gate; this bin executes an already-assembled, already-endorsed spec
14
14
  * non-interactively. It never prompts, never re-runs the interview.
15
15
  *
16
- * Input — ONE JSON object `{ agentId, name, workspace, persona, userSpec, channel? }`,
16
+ * Input — ONE JSON object `{ name, workspace, persona, userSpec, channel? }`,
17
17
  * read from stdin (primary) or `--spec <path>` (fallback). Passing multiline
18
18
  * persona/userSpec as JSON dodges shell-arg escaping. Unparseable/blank input →
19
- * `invalid_request`, nothing attempted. `channel` is OPTIONAL — the current-channel
20
- * override for the step-10 bind; absent/blank is fail-open, never invalid_request.
19
+ * `invalid_request`, nothing attempted. There is NO `agentId` input — it is derived
20
+ * from `name` (`deriveAgentId`), so the user never invents an id; a stray `agentId`
21
+ * key is ignored. `channel` is OPTIONAL — the current-channel override for the
22
+ * step-10 bind; absent/blank is fail-open, never invalid_request.
21
23
  *
22
24
  * Choreography (validate-first, then atomic, fail-closed):
23
- * 1. validate the spec — bad/blank field ⇒ invalid_request, nothing attempted
25
+ * 1. validate the spec + derive the id — bad/blank field ⇒ invalid_request, nothing
26
+ * attempted; then agentId = deriveAgentId(name) (lower-kebab; empty/`main` slug ⇒
27
+ * the silent `sil-shopper` fallback — the postcondition guarantees a conforming id)
24
28
  * 2. resolve the host config — none ⇒ persistence_failed (precondition), nothing written
25
29
  * 3. singleton + agentId pre-flight — a shopper OR the agentId already exists ⇒ collision;
26
30
  * an INCONCLUSIVE read (degraded store / CLI error) fails closed — never fabricates
@@ -86,6 +90,7 @@ import {
86
90
  getShopperArtefactDir,
87
91
  } from "../dist/lib/profile-store.js";
88
92
  import { resolveBindChannel } from "../dist/lib/bind-channel.js";
93
+ import { deriveAgentId } from "../dist/lib/derive-agent-id.js";
89
94
 
90
95
  const ROOT = resolve(dirname(fileURLToPath(import.meta.url)), "..");
91
96
  /** The sibling operator bin that performs the additive, self-validating trust merge. */
@@ -94,9 +99,6 @@ const ALLOWLIST_BIN = resolve(ROOT, "scripts", "allowlist-openclaw.mjs");
94
99
  * skill name), read the same way `scripts/allowlist-openclaw.mjs` reads it. */
95
100
  const MANIFEST_PATH = resolve(ROOT, "openclaw.plugin.json");
96
101
 
97
- /** A shopper id path-segment shape — lower-kebab, never `main` (host-reserved). */
98
- const AGENT_ID_RE = /^[a-z0-9][a-z0-9-]*$/;
99
-
100
102
  /** The sil creed appended to every shopper's SOUL.md after its persona — a soul, not a
101
103
  * rulebook. It carries the mantra (explore first), the loop in three lines, and the one
102
104
  * distinction that matters (the catalog is where you buy, the web is where you learn),
@@ -196,29 +198,18 @@ function readSpecRaw() {
196
198
  }
197
199
  }
198
200
 
199
- /** Validate the endorsed spec — deterministic field order (agentId → name →
200
- * workspace → persona → userSpec). Returns `{ field, message }` on the FIRST bad
201
- * field, or null when the whole spec is good. Writes/attempts nothing. `channel`
202
- * is deliberately NOT validated: it is an optional fail-open convenience, so an
203
- * absent/blank/malformed channel is never invalid_request — it folds to `null` in
204
- * `resolveBindChannel` and degrades to a manual-bind hint at step 10. */
201
+ /** Validate the endorsed spec — deterministic field order (name → workspace →
202
+ * persona → userSpec). Returns `{ field, message }` on the FIRST bad field, or null
203
+ * when the whole spec is good. Writes/attempts nothing. `agentId` is NOT a spec field
204
+ * — it is derived from `name` (`deriveAgentId`) after validate; a stray `agentId` key
205
+ * is ignored. `channel` is deliberately NOT validated: it is an optional fail-open
206
+ * convenience, so an absent/blank/malformed channel is never invalid_request — it
207
+ * folds to `null` in `resolveBindChannel` and degrades to a manual-bind hint at step 10. */
205
208
  function validateSpec(spec) {
206
209
  if (typeof spec !== "object" || spec === null || Array.isArray(spec)) {
207
210
  return {
208
211
  field: "spec",
209
- message: "spec must be a JSON object with { agentId, name, workspace, persona, userSpec, channel? }.",
210
- };
211
- }
212
- if (!nonBlank(spec.agentId)) {
213
- return { field: "agentId", message: "agentId is required and must be non-empty." };
214
- }
215
- if (spec.agentId === "main") {
216
- return { field: "agentId", message: '"main" is host-reserved and cannot be an agentId.' };
217
- }
218
- if (!AGENT_ID_RE.test(spec.agentId)) {
219
- return {
220
- field: "agentId",
221
- message: "agentId must be lower-kebab (a-z, 0-9, hyphen) — got: " + JSON.stringify(spec.agentId),
212
+ message: "spec must be a JSON object with { name, workspace, persona, userSpec, channel? }.",
222
213
  };
223
214
  }
224
215
  if (!nonBlank(spec.name)) {
@@ -438,7 +429,11 @@ function main() {
438
429
  if (bad) {
439
430
  emitFailure("invalid_request", { field: bad.field, cause: bad.message });
440
431
  }
441
- const { agentId, name, workspace, persona, userSpec, channel } = spec;
432
+ const { name, workspace, persona, userSpec, channel } = spec;
433
+ // Derive the host id from the ONE friendly name — the user never invents an id.
434
+ // The lib's postcondition guarantees a conforming lower-kebab id, never `main`
435
+ // (empty/`main` slug ⇒ silent `sil-shopper`), so no runtime re-validation here.
436
+ const agentId = deriveAgentId(name);
442
437
 
443
438
  // --- 2. Resolve the host config (precondition — nothing written yet) ---
444
439
  const configPath = resolveConfigPath();
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: sil-shopping
3
- description: 'Use for any sil shopping, identity, or shopper-setup intent: register, check the account, search the sil catalog, look up products by id — plus the single-shopper lifecycle: create the shopper (a two-touchpoint onboarding), search what it knows or which domains (niches) it learned, view or forget a domain or PRD, refine it — or, as the shopper, run the six-beat Spec-Driven Shopping loop and learn a fact or taste it surfaces. Drives sil_register, sil_whoami, sil_search, sil_product_get, sil_specs, sil_profile_materialize, sil_profile_search, sil_profile_get, sil_profile_remove, sil_learn.'
3
+ description: 'Use for any sil shopping, identity, or shopper-setup intent: register, check the account, search the sil catalog, look up products by id — plus the single-shopper lifecycle: create the shopper (a two-touchpoint onboarding), search what it knows or which domains (niches) it learned, view or forget a domain or PRD, refine it — or, as the shopper, run the six-beat Spec-Driven Shopping loop and learn a fact or taste it surfaces. Drives sil_register, sil_whoami, sil_search, sil_product_get, sil_specs, sil_profile_materialize, sil_profile_search, sil_profile_get, sil_profile_remove, sil_learn, sil_doctor.'
4
4
  metadata:
5
5
  openclaw:
6
6
  emoji: "\U0001F6D2"
@@ -34,9 +34,13 @@ it knows, view or forget a domain, refine it.
34
34
 
35
35
  ## Session start
36
36
 
37
- Confirm the `sil_*` tools are exposed. If missing, the host is filtering them —
38
- run the shipped admission helper `sil-openclaw-allowlist` (it additively admits
39
- sil at `plugins.allow` + `tools.alsoAllow`), then reopen the session. Most flows
37
+ Confirm the `sil_*` tools are exposed. If missing, the host is filtering them — the
38
+ shipped admission helper repairs it (additively admitting sil at `plugins.allow` +
39
+ `tools.alsoAllow`), then reopen the session. If `sil_doctor` still runs, its
40
+ `wiring.tools_not_admitted` finding names the exact command: a `node "<absolute
41
+ path>"` invocation, never a bare bin name (that name is on PATH only for some
42
+ installs). If no sil tool runs at all, this is an operator fix — run
43
+ `node scripts/allowlist-openclaw.mjs` from the sil plugin's install directory. Most flows
40
44
  need an identity: call a catalog tool first and let an unregistered outcome route
41
45
  to `sil_register`, or run `sil_register` up front when intent requires it.
42
46
 
@@ -70,6 +74,7 @@ while setup is incomplete; it sheds once a shopper exists.
70
74
  | (as the shopper) a shopping intent on any niche | the six-beat loop | [`shop_loop.md`](references/shop_loop.md) |
71
75
  | "learn / remember this" — a fact or taste the shopper surfaced | `sil_learn` | [`fill_and_feedback.md`](references/fill_and_feedback.md) |
72
76
  | "refine / sharpen my shopper" / fix a niche | `sil_learn` (target + change) | [`fill_and_feedback.md`](references/fill_and_feedback.md) |
77
+ | "sil is broken" / "check my sil install" / a store or identity read misbehaves | `sil_doctor` | — |
73
78
 
74
79
  Each core tool's behaviour + status taxonomy live in its own tool definition and
75
80
  response (the `recovery`/`status` it returns) — basic shopping needs only that. A full
@@ -57,11 +57,12 @@ authored here**; they mint **lazily on first shop** ([`shop_loop.md`](shop_loop.
57
57
 
58
58
  ### Assemble + endorse — the gate
59
59
 
60
- - **Identity** — propose an `agentId` (lower-kebab, ≠ `main`) and a `name`; confirm both.
61
- - **Assemble** — compose **`{ agentId, name, persona, userSpec }`**, present a readable
62
- summary, self-check the shape (`agentId` lower-kebab & ≠ `main`; non-blank
63
- `name`/`persona`/`userSpec`). Writes nothing — the engine's validate-first step is the
64
- authoritative gate.
60
+ - **Identity** — confirm ONE friendly display `name`. There is **no `agentId` to invent**:
61
+ the engine derives it from `name` (lower-kebab; a `main`/empty slug silently falls back
62
+ to `sil-shopper`), so identity is just the name.
63
+ - **Assemble** — compose **`{ name, persona, userSpec }`**, present a readable summary,
64
+ self-check the shape (non-blank `name`/`persona`/`userSpec`). Writes nothing — the
65
+ engine's validate-first step is the authoritative gate.
65
66
  - **Endorse** — ask for an explicit go-ahead. Endorsement is an affirmative act
66
67
  ("yes, create it") — **not** inferred from the last answer or from silence. **Only on
67
68
  that explicit yes** do you run Part 2.
@@ -94,31 +95,56 @@ first shop.
94
95
 
95
96
  ### The one command
96
97
 
97
- Run one shipped bin — **`sil-openclaw-create-shopper`** — **non-interactive**,
98
- **atomic**, **fail-closed**; it emits one JSON result. It is a standalone operator
99
- script, not the plugin process, so the plugin's "never write host config" guarantee
100
- holds. Feed the endorsed spec as one JSON object on **`stdin`** (or `--spec <path>`):
98
+ Run one shipped script — **non-interactive**, **atomic**, **fail-closed**; it emits one
99
+ JSON result. It is a standalone operator script, not the plugin process, so the plugin's
100
+ "never write host config" guarantee holds.
101
101
 
102
+ **Get its path from `sil_doctor` — never guess it, and never derive it from this file's
103
+ own location.** Call `sil_doctor` and read the report's top-level **`creationEntrypoint`**:
104
+ an absolute path, reported every run. It is the only sound source. This file is published
105
+ to you as a *symlink*, so a `../scripts/…` hop off this directory does not resolve for
106
+ `node` even though `cat` and `ls` say it does; and the bare bin name is on PATH only for
107
+ some installs. Both dead-end at this exact step.
108
+
109
+ Feed the endorsed spec as a **file**, not a heredoc — shell quoting must never touch
110
+ model-authored prose (apostrophes, quotes, backticks, `$`, newlines are the norm in a
111
+ persona). Write it **0600 under a private dir**, run, then **remove it**: the spec carries
112
+ the user's `userSpec` (address, sizes, allergy/ethics rules), so it must not linger
113
+ world-readable. The script never deletes an input it does not own — that is yours.
114
+
115
+ ```
116
+ # 1. sil_doctor → creationEntrypoint (absolute path to the creation script)
117
+ # 2. write the endorsed spec, owner-only, in a private dir:
118
+ umask 077 && mkdir -p ~/.sil-tmp && SPEC=~/.sil-tmp/shopper-spec.json
119
+ # …write the JSON object below to "$SPEC"…
120
+ # 3. run it by absolute path, via node:
121
+ node "<creationEntrypoint>" --spec "$SPEC"
122
+ # 4. remove it, whatever the result:
123
+ rm -f "$SPEC"
102
124
  ```
103
- sil-openclaw-create-shopper <<'JSON'
104
- { "agentId": "my-shopper", "name": "My Shopper",
125
+
126
+ The spec file's contents — one JSON object:
127
+
128
+ ```json
129
+ { "name": "My Shopper",
105
130
  "workspace": "~/.openclaw/workspace-my-shopper",
106
131
  "persona": "…endorsed persona…", "userSpec": "…seeded shared user spec…",
107
132
  "channel": "telegram" }
108
- JSON
109
133
  ```
110
134
 
111
135
  ### The spec (input)
112
136
 
113
137
  | Field | Meaning | Goes to | Required? |
114
138
  |---|---|---|---|
115
- | **agentId** | Lower-kebab (`^[a-z0-9][a-z0-9-]*$`), never `main`. | host | yes |
116
- | **name** | Human-readable name. | sil store | yes |
139
+ | **name** | Human-readable display name; the `agentId` is **derived** from it. | sil store | yes |
117
140
  | **persona** | Who the shopper is — a generalist, its voice, standing rules. | host **`SOUL.md`** | yes |
118
141
  | **workspace** | The shopper's workspace directory. | host | yes |
119
142
  | **userSpec** | Shared **cross-niche** facts + hard constraints (seeded partial). | sil `user_spec.md` | yes |
120
143
  | **channel** | Setup conversation's channel, bound to the shopper. | host bindings | optional (fail-open) |
121
144
 
145
+ The `agentId` is **not an input** — the bin derives it as `deriveAgentId(name)`
146
+ (lower-kebab `^[a-z0-9][a-z0-9-]*$`; a `main`/empty slug silently folds to `sil-shopper`).
147
+
122
148
  **No per-niche input at create** — no method, no PRD; those mint lazily on first shop
123
149
  via `sil_learn create`. The shopper needs web tools (inherited from `agents.defaults`)
124
150
  to mint/refresh domains; if defaults grant none, the bin reports `created` with a
@@ -126,9 +152,10 @@ to mint/refresh domains; if defaults grant none, the bin reports `created` with
126
152
 
127
153
  ### What the bin does, in order (atomic, fail-closed)
128
154
 
129
- 1. **Validate first** — bad/blank `agentId` (lower-kebab, ≠ `main`), `name`, `persona`,
130
- `workspace`, or `userSpec` → **`invalid_request`** naming the field; **nothing
131
- written**.
155
+ 1. **Validate first, then derive the id** — bad/blank `name`, `persona`, `workspace`, or
156
+ `userSpec` → **`invalid_request`** naming the field; **nothing written**. Then
157
+ `agentId = deriveAgentId(name)` — the derivation always yields a conforming id (empty
158
+ or `main` slug → the silent `sil-shopper` fallback), so the id is never a failure mode.
132
159
  2. **Config + singleton pre-flight** — no host config → `persistence_failed`. An
133
160
  existing shopper `user_spec.md`, or an `agentId` clash → **`collision`** ("a shopper
134
161
  already exists"); steer to shop-a-new-niche or refine, **never a second shopper**. An
@@ -149,7 +176,8 @@ to mint/refresh domains; if defaults grant none, the bin reports `created` with
149
176
  design: it reads the shopper's skill files and can write regardless. The shell stays
150
177
  open (trusted single-operator posture); persistence is steered through the sil tools by
151
178
  the skill, not enforced by tool policy.
152
- 8. **Admit sil (plugin trust)** — the shipped **`sil-openclaw-allowlist`** helper
179
+ 8. **Admit sil (plugin trust)** — the shipped **`scripts/allowlist-openclaw.mjs`** helper
180
+ (which the script runs itself, by absolute path via `node` — never the bare name)
153
181
  additively merges the three trust surfaces (`plugins.allow` + `tools.alsoAllow` +
154
182
  `plugins.entries.sil`) — the only way to un-filter `sil_*` without clobbering a
155
183
  co-installed plugin. A non-zero exit → **`persistence_failed`** (never a green