sil-openclaw 0.3.1 → 0.3.4
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 +53 -0
- package/README.md +4 -2
- package/dist/index.js +38 -6
- package/dist/lib/credentials.js +32 -9
- package/dist/lib/openclaw-allowlist.js +156 -0
- package/dist/lib/profile-store.js +28 -15
- package/dist/lib/sil-client.js +2 -2
- package/dist/tools/catalog.js +10 -8
- package/dist/tools/identity.js +3 -3
- package/dist/tools/profile.js +1 -1
- package/openclaw.plugin.json +3 -3
- package/package.json +7 -2
- package/scripts/allowlist-openclaw.mjs +226 -0
- package/scripts/changelog.mjs +0 -0
- package/scripts/release.mjs +228 -0
- package/scripts/sync-version.mjs +52 -0
- package/{skill → sil-shopping}/SKILL.md +3 -3
- package/{skill → sil-shopping}/examples/road_cycling_expert_walkthrough.md +1 -1
- package/{skill → sil-shopping}/references/brainstorm_interview.md +2 -2
- package/{skill → sil-shopping}/references/catalog_tools_reference.md +1 -1
- package/{skill → sil-shopping}/references/expert_shopping.md +1 -1
- package/{skill → sil-shopping}/references/refine_expert.md +1 -1
- package/{skill → sil-shopping}/references/search_param_mapping.md +2 -2
- /package/{skill → sil-shopping}/references/agent_creation_engine.md +0 -0
- /package/{skill → sil-shopping}/references/manage_experts.md +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sil-openclaw",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.4",
|
|
4
4
|
"description": "OpenClaw plugin for sil — register an identity and search and look up products in the sil commerce catalog from an agent.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -26,9 +26,13 @@
|
|
|
26
26
|
"node": ">=22"
|
|
27
27
|
},
|
|
28
28
|
"main": "./dist/index.js",
|
|
29
|
+
"bin": {
|
|
30
|
+
"sil-openclaw-allowlist": "./scripts/allowlist-openclaw.mjs"
|
|
31
|
+
},
|
|
29
32
|
"files": [
|
|
30
33
|
"dist",
|
|
31
|
-
"
|
|
34
|
+
"scripts",
|
|
35
|
+
"sil-shopping",
|
|
32
36
|
"openclaw.plugin.json",
|
|
33
37
|
"README.md",
|
|
34
38
|
"CHANGELOG.md",
|
|
@@ -79,6 +83,7 @@
|
|
|
79
83
|
"test": "vitest run --passWithNoTests",
|
|
80
84
|
"test:watch": "vitest",
|
|
81
85
|
"sync-version": "node scripts/sync-version.mjs",
|
|
86
|
+
"openclaw:allowlist": "node scripts/allowlist-openclaw.mjs",
|
|
82
87
|
"preversion": "pnpm typecheck && pnpm test",
|
|
83
88
|
"version": "pnpm sync-version && node scripts/changelog.mjs cut && git add openclaw.plugin.json CHANGELOG.md",
|
|
84
89
|
"postversion": "git push --follow-tags",
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Install-time helper: trust `sil` in the host OpenClaw config.
|
|
4
|
+
*
|
|
5
|
+
* Operator-invoked (NEVER an npm lifecycle hook — `openclaw.plugin.json#
|
|
6
|
+
* security.noInstallScripts: true` is a shipped guarantee that the package
|
|
7
|
+
* runs nothing automatically; an operator explicitly running this is the
|
|
8
|
+
* opposite of an install hook and honours it). This is a standalone script in
|
|
9
|
+
* the same class as `scripts/release.mjs` — it is NOT the plugin process, so
|
|
10
|
+
* the plugin's `~/.openclaw`-write boundary does not apply to it.
|
|
11
|
+
*
|
|
12
|
+
* What it does: resolve the host `openclaw.json`, read sil's facts from the
|
|
13
|
+
* shipped manifest (single source of truth), call the pure `mergeSilAllowlist`
|
|
14
|
+
* core, and — only when something changed — write a `.bak` then atomically
|
|
15
|
+
* (tmp → rename) write the merged config back, preserving the file's existing
|
|
16
|
+
* mode (host config is operator-readable, NOT a 0600 credential). When the
|
|
17
|
+
* `openclaw` binary is on PATH it runs `openclaw config validate --json` as a
|
|
18
|
+
* best-effort post-write guard and reverts from `.bak` if the merged config is
|
|
19
|
+
* rejected — so a bad result fails closed and never leaves the host half-merged.
|
|
20
|
+
*
|
|
21
|
+
* Config-path precedence (first existing wins):
|
|
22
|
+
* 1. $OPENCLAW_CONFIG_PATH
|
|
23
|
+
* 2. $OPENCLAW_STATE_DIR/openclaw.json
|
|
24
|
+
* 3. ~/.openclaw/openclaw.json
|
|
25
|
+
* None resolves → fail closed (structured error + non-zero exit), create no
|
|
26
|
+
* parent dir (that would mask a misconfiguration; the operator must start the
|
|
27
|
+
* gateway once so it writes its own base config).
|
|
28
|
+
*
|
|
29
|
+
* Three distinct structured outcomes, in sil's `snake_case_marker` log style
|
|
30
|
+
* (here as plain NDJSON on stdout/stderr — the script runs outside the
|
|
31
|
+
* gateway, so there is no `api.logger`). No PII, no secrets:
|
|
32
|
+
* - sil_allowlist_merged (info, stdout) — a fresh merge was written
|
|
33
|
+
* - sil_allowlist_unchanged (info, stdout) — idempotent no-op, nothing written
|
|
34
|
+
* - sil_allowlist_merge_failed (error, stderr) — fail-closed, nothing left half-done
|
|
35
|
+
*
|
|
36
|
+
* All real merge logic lives in the typed lib (`src/lib/openclaw-allowlist.ts`,
|
|
37
|
+
* compiled to `dist/lib/openclaw-allowlist.js`). This shell is thin I/O only.
|
|
38
|
+
*/
|
|
39
|
+
|
|
40
|
+
import { execFileSync } from "node:child_process";
|
|
41
|
+
import {
|
|
42
|
+
copyFileSync,
|
|
43
|
+
existsSync,
|
|
44
|
+
readFileSync,
|
|
45
|
+
renameSync,
|
|
46
|
+
statSync,
|
|
47
|
+
writeFileSync,
|
|
48
|
+
} from "node:fs";
|
|
49
|
+
import { homedir } from "node:os";
|
|
50
|
+
import { dirname, join, resolve } from "node:path";
|
|
51
|
+
import { randomBytes } from "node:crypto";
|
|
52
|
+
import { fileURLToPath } from "node:url";
|
|
53
|
+
|
|
54
|
+
import { mergeSilAllowlist, AllowlistShapeError } from "../dist/lib/openclaw-allowlist.js";
|
|
55
|
+
|
|
56
|
+
const ROOT = resolve(dirname(fileURLToPath(import.meta.url)), "..");
|
|
57
|
+
const MANIFEST_PATH = resolve(ROOT, "openclaw.plugin.json");
|
|
58
|
+
|
|
59
|
+
/** Emit one structured NDJSON line in sil's marker style: `{event, level, ...}`. */
|
|
60
|
+
function logMarker(stream, level, event, fields) {
|
|
61
|
+
const line = JSON.stringify({ event, level, ...fields });
|
|
62
|
+
stream.write(line + "\n");
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const logInfo = (event, fields) => logMarker(process.stdout, "info", event, fields ?? {});
|
|
66
|
+
const logError = (event, fields) => logMarker(process.stderr, "error", event, fields ?? {});
|
|
67
|
+
|
|
68
|
+
/** Resolve the host config path by precedence; first existing file wins.
|
|
69
|
+
* Returns the resolved path, or null if none exists (caller fails closed). */
|
|
70
|
+
function resolveConfigPath() {
|
|
71
|
+
const candidates = [];
|
|
72
|
+
if (process.env["OPENCLAW_CONFIG_PATH"]) {
|
|
73
|
+
candidates.push(process.env["OPENCLAW_CONFIG_PATH"]);
|
|
74
|
+
}
|
|
75
|
+
if (process.env["OPENCLAW_STATE_DIR"]) {
|
|
76
|
+
candidates.push(join(process.env["OPENCLAW_STATE_DIR"], "openclaw.json"));
|
|
77
|
+
}
|
|
78
|
+
candidates.push(join(homedir(), ".openclaw", "openclaw.json"));
|
|
79
|
+
|
|
80
|
+
for (const candidate of candidates) {
|
|
81
|
+
if (existsSync(candidate)) return candidate;
|
|
82
|
+
}
|
|
83
|
+
return null;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/** Read sil's facts from the shipped manifest — the single source of truth.
|
|
87
|
+
* id / tools / skill are never re-hardcoded in this script. */
|
|
88
|
+
function readSilFacts() {
|
|
89
|
+
const manifest = JSON.parse(readFileSync(MANIFEST_PATH, "utf8"));
|
|
90
|
+
const id = manifest.id;
|
|
91
|
+
const tools = Array.isArray(manifest.contracts?.tools) ? manifest.contracts.tools : [];
|
|
92
|
+
const skill = Array.isArray(manifest.skills) ? (manifest.skills[0] ?? "") : "";
|
|
93
|
+
if (typeof id !== "string" || id.length === 0) {
|
|
94
|
+
throw new Error(`manifest ${MANIFEST_PATH} has no usable "id"`);
|
|
95
|
+
}
|
|
96
|
+
return { id, tools, skill };
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/** Atomic single-file write: tmp sibling → write → rename over target,
|
|
100
|
+
* PRESERVING the source file's existing mode (host config is operator-readable,
|
|
101
|
+
* NOT a 0600 credential — mirrors `src/lib/profile-store.ts:321-327` minus the
|
|
102
|
+
* hardcoded mode). A reader sees either the old file or the new one, never a
|
|
103
|
+
* half-written one; a crash before rename leaves the original untouched. */
|
|
104
|
+
function atomicWrite(path, contents, mode) {
|
|
105
|
+
const tmp = path + "." + randomBytes(6).toString("hex") + ".tmp";
|
|
106
|
+
writeFileSync(tmp, contents, { mode });
|
|
107
|
+
renameSync(tmp, path);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/** Best-effort `openclaw config validate --json` guard. Returns:
|
|
111
|
+
* { ran: false } — binary absent / not invokable (skip, keep write)
|
|
112
|
+
* { ran: true, valid: boolean, cause?: string }
|
|
113
|
+
* Never throws across the boundary — a non-zero exit from the binary is read
|
|
114
|
+
* from its stdout `.valid`, and an un-parseable response is treated as invalid. */
|
|
115
|
+
function validateConfig(path) {
|
|
116
|
+
let raw;
|
|
117
|
+
try {
|
|
118
|
+
raw = execFileSync("openclaw", ["config", "validate", "--json"], {
|
|
119
|
+
env: { ...process.env, OPENCLAW_CONFIG_PATH: path },
|
|
120
|
+
encoding: "utf8",
|
|
121
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
122
|
+
});
|
|
123
|
+
} catch (err) {
|
|
124
|
+
// ENOENT → binary not on PATH: skip validation (the script must run
|
|
125
|
+
// pre-gateway-boot). Any other spawn failure also means we can't validate;
|
|
126
|
+
// the atomic write + .bak revert remains the real safety net, so we treat a
|
|
127
|
+
// failed *spawn* as "not run" (keep the write) rather than "invalid".
|
|
128
|
+
if (err && err.code === "ENOENT") return { ran: false };
|
|
129
|
+
// The binary ran but exited non-zero — capture its stdout if any so we can
|
|
130
|
+
// read a structured verdict; otherwise treat as invalid (fail closed).
|
|
131
|
+
const stdout = typeof err?.stdout === "string" ? err.stdout : "";
|
|
132
|
+
if (stdout) {
|
|
133
|
+
raw = stdout;
|
|
134
|
+
} else {
|
|
135
|
+
return { ran: true, valid: false, cause: "openclaw config validate exited non-zero" };
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
try {
|
|
139
|
+
const parsed = JSON.parse(raw);
|
|
140
|
+
if (parsed && parsed.valid === true) return { ran: true, valid: true };
|
|
141
|
+
const cause =
|
|
142
|
+
(parsed && (parsed.error || parsed.message))
|
|
143
|
+
|| "openclaw config validate reported valid !== true";
|
|
144
|
+
return { ran: true, valid: false, cause: String(cause) };
|
|
145
|
+
} catch {
|
|
146
|
+
return { ran: true, valid: false, cause: "openclaw config validate returned non-JSON" };
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
function main() {
|
|
151
|
+
const configPath = resolveConfigPath();
|
|
152
|
+
if (configPath === null) {
|
|
153
|
+
logError("sil_allowlist_merge_failed", {
|
|
154
|
+
path: null,
|
|
155
|
+
cause:
|
|
156
|
+
"no OpenClaw config found at OPENCLAW_CONFIG_PATH, "
|
|
157
|
+
+ "$OPENCLAW_STATE_DIR/openclaw.json, or ~/.openclaw/openclaw.json — "
|
|
158
|
+
+ "start the OpenClaw gateway once so it writes its base config, then re-run",
|
|
159
|
+
});
|
|
160
|
+
process.exit(1);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
const sil = readSilFacts();
|
|
164
|
+
|
|
165
|
+
let parsed;
|
|
166
|
+
try {
|
|
167
|
+
parsed = JSON.parse(readFileSync(configPath, "utf8"));
|
|
168
|
+
} catch (err) {
|
|
169
|
+
logError("sil_allowlist_merge_failed", {
|
|
170
|
+
path: configPath,
|
|
171
|
+
cause: "config is not valid JSON: " + (err?.message ?? String(err)),
|
|
172
|
+
});
|
|
173
|
+
process.exit(1);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
let result;
|
|
177
|
+
try {
|
|
178
|
+
result = mergeSilAllowlist(parsed, sil);
|
|
179
|
+
} catch (err) {
|
|
180
|
+
const cause =
|
|
181
|
+
err instanceof AllowlistShapeError
|
|
182
|
+
? err.message
|
|
183
|
+
: "merge failed: " + (err?.message ?? String(err));
|
|
184
|
+
logError("sil_allowlist_merge_failed", { path: configPath, cause });
|
|
185
|
+
process.exit(1);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
if (!result.changed) {
|
|
189
|
+
logInfo("sil_allowlist_unchanged", { plugin: sil.id });
|
|
190
|
+
process.exit(0);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
// Something changed → back up, atomically write, then best-effort validate.
|
|
194
|
+
const mode = statSync(configPath).mode & 0o777;
|
|
195
|
+
const bakPath = configPath + ".bak";
|
|
196
|
+
copyFileSync(configPath, bakPath);
|
|
197
|
+
|
|
198
|
+
const serialized = JSON.stringify(result.config, null, 2) + "\n";
|
|
199
|
+
atomicWrite(configPath, serialized, mode);
|
|
200
|
+
|
|
201
|
+
const validation = validateConfig(configPath);
|
|
202
|
+
if (validation.ran && !validation.valid) {
|
|
203
|
+
// Revert to the exact pre-run bytes; leave the host in its pre-run state.
|
|
204
|
+
copyFileSync(bakPath, configPath);
|
|
205
|
+
logError("sil_allowlist_merge_failed", {
|
|
206
|
+
path: configPath,
|
|
207
|
+
cause: validation.cause ?? "openclaw config validate rejected the merged config",
|
|
208
|
+
});
|
|
209
|
+
process.exit(1);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
const allowSize = Array.isArray(result.config.plugins?.allow)
|
|
213
|
+
? result.config.plugins.allow.length
|
|
214
|
+
: 0;
|
|
215
|
+
logInfo("sil_allowlist_merged", {
|
|
216
|
+
plugin: sil.id,
|
|
217
|
+
tools_added: sil.tools.length,
|
|
218
|
+
skill_added: sil.skill.length > 0,
|
|
219
|
+
plugins_allow_size: allowSize,
|
|
220
|
+
validated: validation.ran,
|
|
221
|
+
path: configPath,
|
|
222
|
+
});
|
|
223
|
+
process.exit(0);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
main();
|
|
Binary file
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Build, pack, and publish to npm and ClawHub.
|
|
4
|
+
*
|
|
5
|
+
* The two registries publish under DIFFERENT names, by hard constraint:
|
|
6
|
+
* - npm: `sil-openclaw` (unscoped — the bare `sil` is taken upstream)
|
|
7
|
+
* - ClawHub: `@4gpts/sil` (the plugin id `sil` cannot be claimed on its own;
|
|
8
|
+
* it is already owned by the @4gpts/sil package, so ClawHub publishes
|
|
9
|
+
* under the scoped @<owner>/<plugin-id> name. The runtime plugin id
|
|
10
|
+
* stays `sil`, but install uses the scoped name `openclaw plugins install clawhub:@4gpts/sil`.)
|
|
11
|
+
*
|
|
12
|
+
* One clean build, then the SAME file content to both registries: npm gets the
|
|
13
|
+
* packed `sil-openclaw` tarball as-is; ClawHub gets those identical files
|
|
14
|
+
* re-packed with only package.json#name rewritten to `@4gpts/sil` (ClawHub
|
|
15
|
+
* requires --name to equal the tarball's package.json#name). Same content, the
|
|
16
|
+
* name field is the only difference — no drift in what the two registries serve.
|
|
17
|
+
*
|
|
18
|
+
* Usage:
|
|
19
|
+
* pnpm release publish for real (npm + ClawHub)
|
|
20
|
+
* pnpm release:dry dry-run both: build + pack + preview, upload NOTHING
|
|
21
|
+
*
|
|
22
|
+
* Real-publish preflight (skipped under --dry-run, which is a pure preview):
|
|
23
|
+
* - clean git working tree
|
|
24
|
+
* - HEAD carries the v<version> tag (run `pnpm version <bump>` first)
|
|
25
|
+
* - `npm whoami` succeeds (run `npm login`)
|
|
26
|
+
* - `clawhub` CLI on PATH (npm i -g clawhub && clawhub login)
|
|
27
|
+
*
|
|
28
|
+
* ClawHub attribution: --family code-plugin, --owner (env CLAWHUB_OWNER,
|
|
29
|
+
* default below), --source-repo (derived from package.json#repository),
|
|
30
|
+
* --source-commit HEAD, and --tags latest on a real publish.
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
import { execFileSync } from "node:child_process";
|
|
34
|
+
import { mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
35
|
+
import { tmpdir } from "node:os";
|
|
36
|
+
import { resolve, dirname, basename } from "node:path";
|
|
37
|
+
import { fileURLToPath } from "node:url";
|
|
38
|
+
|
|
39
|
+
const ROOT = resolve(dirname(fileURLToPath(import.meta.url)), "..");
|
|
40
|
+
const DRY_RUN = process.argv.includes("--dry-run");
|
|
41
|
+
// The 4gpts ClawHub org we publish under (mirrors the @4gpts npm scope). You
|
|
42
|
+
// authenticate as an org member via `clawhub login`; override with CLAWHUB_OWNER.
|
|
43
|
+
const DEFAULT_CLAWHUB_OWNER = "4gpts";
|
|
44
|
+
const CLAWHUB_OWNER = process.env.CLAWHUB_OWNER || DEFAULT_CLAWHUB_OWNER;
|
|
45
|
+
const CLAWHUB_FAMILY = "code-plugin";
|
|
46
|
+
|
|
47
|
+
const pkg = JSON.parse(readFileSync(resolve(ROOT, "package.json"), "utf8"));
|
|
48
|
+
const version = pkg.version;
|
|
49
|
+
const tag = `v${version}`;
|
|
50
|
+
|
|
51
|
+
// ClawHub package name: the SCOPED @<owner>/<plugin-id> identity (e.g. @4gpts/sil).
|
|
52
|
+
// The bare plugin id (`sil`, openclaw.plugin.json#id) cannot be a package name on
|
|
53
|
+
// its own — it is already claimed by the @4gpts/sil package — so the scoped name is
|
|
54
|
+
// the ClawHub identity, while the runtime plugin id stays `sil`. Derived from owner
|
|
55
|
+
// + id so it never drifts from the manifest.
|
|
56
|
+
const CLAWHUB_PLUGIN_ID = JSON.parse(
|
|
57
|
+
readFileSync(resolve(ROOT, "openclaw.plugin.json"), "utf8"),
|
|
58
|
+
).id;
|
|
59
|
+
const CLAWHUB_NAME = `@${CLAWHUB_OWNER}/${CLAWHUB_PLUGIN_ID}`;
|
|
60
|
+
|
|
61
|
+
const log = (msg) => console.log(`[release] ${msg}`);
|
|
62
|
+
function fail(msg) {
|
|
63
|
+
console.error(`[release] ${msg}`);
|
|
64
|
+
process.exit(1);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** Run a command, inheriting stdio (output streams to the terminal). */
|
|
68
|
+
function runInherit(cmd, args) {
|
|
69
|
+
execFileSync(cmd, args, { cwd: ROOT, stdio: "inherit" });
|
|
70
|
+
}
|
|
71
|
+
/** Run a command and capture trimmed stdout. */
|
|
72
|
+
function capture(cmd, args) {
|
|
73
|
+
return execFileSync(cmd, args, { cwd: ROOT, encoding: "utf8" }).trim();
|
|
74
|
+
}
|
|
75
|
+
/** Capture stdout, or null on any non-zero exit / spawn failure. */
|
|
76
|
+
function tryCapture(cmd, args) {
|
|
77
|
+
try {
|
|
78
|
+
return capture(cmd, args);
|
|
79
|
+
} catch {
|
|
80
|
+
return null;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
/** True if `cmd` is resolvable on PATH (a non-zero exit still means present). */
|
|
84
|
+
function commandExists(cmd) {
|
|
85
|
+
try {
|
|
86
|
+
execFileSync(cmd, ["--version"], { stdio: "ignore" });
|
|
87
|
+
return true;
|
|
88
|
+
} catch (err) {
|
|
89
|
+
return err.code !== "ENOENT";
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/** Derive "Owner/Repo" for ClawHub --source-repo from package.json#repository.url. */
|
|
94
|
+
function sourceRepo() {
|
|
95
|
+
const url = pkg.repository?.url ?? "";
|
|
96
|
+
const m = url.match(/github\.com[/:]([^/]+\/[^/]+?)(?:\.git)?$/);
|
|
97
|
+
if (!m) fail(`cannot derive --source-repo from package.json#repository.url: "${url}"`);
|
|
98
|
+
return m[1];
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function preflight() {
|
|
102
|
+
if (!pkg.name) fail("package.json#name is missing — cannot publish.");
|
|
103
|
+
if (DRY_RUN) {
|
|
104
|
+
log("dry-run: skipping clean-tree / tag / auth preflight (pure preview).");
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
const dirty = capture("git", ["status", "--porcelain"]);
|
|
108
|
+
if (dirty) fail(`working tree is dirty — commit or stash first:\n${dirty}`);
|
|
109
|
+
|
|
110
|
+
const headTags = (tryCapture("git", ["tag", "--points-at", "HEAD"]) ?? "").split("\n");
|
|
111
|
+
if (!headTags.includes(tag)) {
|
|
112
|
+
fail(`HEAD is not tagged ${tag}. Run \`pnpm version <patch|minor|major>\` first.`);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
const npmUser = tryCapture("npm", ["whoami"]);
|
|
116
|
+
if (!npmUser) fail("not authenticated with npm. Run `npm login`.");
|
|
117
|
+
log(`npm user: ${npmUser}`);
|
|
118
|
+
|
|
119
|
+
if (!commandExists("clawhub")) {
|
|
120
|
+
fail("clawhub CLI not found on PATH. Run `npm i -g clawhub && clawhub login`.");
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/** Clean-build dist, then pack a single tarball. Returns its absolute path. */
|
|
125
|
+
function buildAndPack() {
|
|
126
|
+
log("building (clean dist → tsc)…");
|
|
127
|
+
runInherit("pnpm", ["build"]);
|
|
128
|
+
log("packing tarball…");
|
|
129
|
+
// --ignore-scripts: dist is already fresh from the explicit build above, so
|
|
130
|
+
// skip prepack here and keep `npm pack --json` stdout pure JSON.
|
|
131
|
+
const out = capture("npm", ["pack", "--json", "--ignore-scripts"]);
|
|
132
|
+
const filename = JSON.parse(out)?.[0]?.filename;
|
|
133
|
+
if (!filename) fail("`npm pack --json` did not report a tarball filename.");
|
|
134
|
+
return resolve(ROOT, filename);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
function publishNpm(tarball) {
|
|
138
|
+
const args = ["publish", tarball];
|
|
139
|
+
if (DRY_RUN) args.push("--dry-run");
|
|
140
|
+
log(`npm publish${DRY_RUN ? " --dry-run" : ""} ${basename(tarball)}`);
|
|
141
|
+
runInherit("npm", args);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Re-pack the just-built npm tarball under the ClawHub name. ClawHub requires
|
|
146
|
+
* --name to EQUAL the tarball's package.json#name, and the npm tarball carries
|
|
147
|
+
* `sil-openclaw` — so extract it, rewrite ONLY package.json#name to CLAWHUB_NAME
|
|
148
|
+
* (@4gpts/sil), and `npm pack` the renamed package. The content is identical to
|
|
149
|
+
* npm's (same extracted files); only the name field changes. Returns the staged
|
|
150
|
+
* tarball path — its parent temp dir is the caller's to remove.
|
|
151
|
+
*/
|
|
152
|
+
function packClawhubTarball(npmTarball) {
|
|
153
|
+
const stage = mkdtempSync(resolve(tmpdir(), "sil-clawhub-"));
|
|
154
|
+
// Extract the already-built npm tarball (→ <stage>/package/...) so the ClawHub
|
|
155
|
+
// artifact ships the exact same files, not a separate build.
|
|
156
|
+
runInherit("tar", ["-xzf", npmTarball, "-C", stage]);
|
|
157
|
+
const pkgPath = resolve(stage, "package", "package.json");
|
|
158
|
+
const staged = JSON.parse(readFileSync(pkgPath, "utf8"));
|
|
159
|
+
staged.name = CLAWHUB_NAME;
|
|
160
|
+
writeFileSync(pkgPath, `${JSON.stringify(staged, null, 2)}\n`, "utf8");
|
|
161
|
+
// Re-pack the renamed package dir into the same temp dir. --ignore-scripts: no
|
|
162
|
+
// prepack rebuild (the dist is already inside the extracted package).
|
|
163
|
+
const out = capture("npm", [
|
|
164
|
+
"pack",
|
|
165
|
+
resolve(stage, "package"),
|
|
166
|
+
"--json",
|
|
167
|
+
"--ignore-scripts",
|
|
168
|
+
"--pack-destination",
|
|
169
|
+
stage,
|
|
170
|
+
]);
|
|
171
|
+
const filename = JSON.parse(out)?.[0]?.filename;
|
|
172
|
+
if (!filename) fail("clawhub stage: `npm pack --json` did not report a tarball filename.");
|
|
173
|
+
return resolve(stage, filename);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
function publishClawhub(npmTarball) {
|
|
177
|
+
const sha = capture("git", ["rev-parse", "HEAD"]);
|
|
178
|
+
// The release notes for this version, straight from CHANGELOG.md (empty if the
|
|
179
|
+
// version has no section yet — then we just omit --changelog).
|
|
180
|
+
const changelog = (tryCapture("node", ["scripts/changelog.mjs", "show", version]) ?? "").trim();
|
|
181
|
+
// Stage the @4gpts/sil-named tarball (ClawHub requires --name == package name).
|
|
182
|
+
const tarball = packClawhubTarball(npmTarball);
|
|
183
|
+
try {
|
|
184
|
+
const args = [
|
|
185
|
+
"package",
|
|
186
|
+
"publish",
|
|
187
|
+
tarball,
|
|
188
|
+
"--family",
|
|
189
|
+
CLAWHUB_FAMILY,
|
|
190
|
+
"--name",
|
|
191
|
+
CLAWHUB_NAME,
|
|
192
|
+
"--owner",
|
|
193
|
+
CLAWHUB_OWNER,
|
|
194
|
+
"--source-repo",
|
|
195
|
+
sourceRepo(),
|
|
196
|
+
"--source-commit",
|
|
197
|
+
sha,
|
|
198
|
+
];
|
|
199
|
+
if (changelog) args.push("--changelog", changelog);
|
|
200
|
+
if (DRY_RUN) args.push("--dry-run");
|
|
201
|
+
else args.push("--tags", "latest");
|
|
202
|
+
log(
|
|
203
|
+
`clawhub package publish${DRY_RUN ? " --dry-run" : ""} (name=${CLAWHUB_NAME}, owner=${CLAWHUB_OWNER}, ` +
|
|
204
|
+
`repo=${sourceRepo()}, changelog=${changelog ? "yes" : "none"})`,
|
|
205
|
+
);
|
|
206
|
+
runInherit("clawhub", args);
|
|
207
|
+
} finally {
|
|
208
|
+
rmSync(dirname(tarball), { recursive: true, force: true });
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
log(`${DRY_RUN ? "DRY-RUN " : ""}release ${pkg.name}@${version} (npm) + ${CLAWHUB_NAME}@${version} (ClawHub)`);
|
|
213
|
+
preflight();
|
|
214
|
+
const tarball = buildAndPack();
|
|
215
|
+
try {
|
|
216
|
+
publishNpm(tarball);
|
|
217
|
+
publishClawhub(tarball);
|
|
218
|
+
} finally {
|
|
219
|
+
rmSync(tarball, { force: true });
|
|
220
|
+
}
|
|
221
|
+
log(
|
|
222
|
+
DRY_RUN
|
|
223
|
+
? "dry-run complete — nothing was uploaded."
|
|
224
|
+
: `published ${pkg.name}@${version} (npm) + ${CLAWHUB_NAME}@${version} (ClawHub).`,
|
|
225
|
+
);
|
|
226
|
+
if (!DRY_RUN) {
|
|
227
|
+
log(`next: \`clawhub package readiness ${CLAWHUB_NAME}\` to check ClawHub readiness blockers.`);
|
|
228
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Mirror the single source-of-truth version (package.json#version) into
|
|
4
|
+
* openclaw.plugin.json#version so the two never drift.
|
|
5
|
+
*
|
|
6
|
+
* package.json#version is authoritative — `pnpm version <bump>` bumps it,
|
|
7
|
+
* and this script copies it into the OpenClaw manifest. Wired into the
|
|
8
|
+
* `version` lifecycle (runs inside `pnpm version`, staged into the version
|
|
9
|
+
* commit) and re-runnable standalone (`pnpm sync-version`).
|
|
10
|
+
*
|
|
11
|
+
* Edits only the manifest's `version` string in place — all other bytes
|
|
12
|
+
* and formatting are preserved, so the diff is one line. Idempotent (a
|
|
13
|
+
* no-op when already in sync) and fail-fast on a non-semver version. The
|
|
14
|
+
* version-parity integration test is the guard that keeps this honest.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { readFileSync, writeFileSync } from "node:fs";
|
|
18
|
+
import { resolve, dirname } from "node:path";
|
|
19
|
+
import { fileURLToPath } from "node:url";
|
|
20
|
+
|
|
21
|
+
const ROOT = resolve(dirname(fileURLToPath(import.meta.url)), "..");
|
|
22
|
+
const PKG_PATH = resolve(ROOT, "package.json");
|
|
23
|
+
const MANIFEST_PATH = resolve(ROOT, "openclaw.plugin.json");
|
|
24
|
+
|
|
25
|
+
const SEMVER = /^\d+\.\d+\.\d+(?:-[\w.]+)?$/;
|
|
26
|
+
|
|
27
|
+
const version = JSON.parse(readFileSync(PKG_PATH, "utf8")).version;
|
|
28
|
+
if (typeof version !== "string" || !SEMVER.test(version)) {
|
|
29
|
+
console.error(`[sync-version] refusing to sync non-semver version: ${version}`);
|
|
30
|
+
process.exit(1);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const before = readFileSync(MANIFEST_PATH, "utf8");
|
|
34
|
+
if (JSON.parse(before).version === version) {
|
|
35
|
+
console.log(`[sync-version] openclaw.plugin.json already at ${version}; no change.`);
|
|
36
|
+
process.exit(0);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Replace only the first `"version": "..."` — the top-level manifest field
|
|
40
|
+
// (it precedes every nested object in the file). The re-parse below proves
|
|
41
|
+
// the edit landed on the right key.
|
|
42
|
+
const after = before.replace(/("version"\s*:\s*)"[^"]*"/, `$1"${version}"`);
|
|
43
|
+
const reparsed = JSON.parse(after);
|
|
44
|
+
if (reparsed.version !== version) {
|
|
45
|
+
console.error(
|
|
46
|
+
`[sync-version] post-edit manifest version is ${reparsed.version}, expected ${version} — aborting.`,
|
|
47
|
+
);
|
|
48
|
+
process.exit(1);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
writeFileSync(MANIFEST_PATH, after, "utf8");
|
|
52
|
+
console.log(`[sync-version] openclaw.plugin.json → ${version}`);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: sil
|
|
3
|
-
description: This skill should be used
|
|
2
|
+
name: sil-shopping
|
|
3
|
+
description: This skill should be used whenever the user wants to shop on sil or run a sil shopping expert: 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 shopping-expert lifecycle: "make me a shopping expert" / "set up an agent that shops for me" (interview, then create), list the experts they have created, view or remove one, refine an existing expert, or — inside a created expert — run a profile-driven Spec-Driven Shopping query on its niche. Route here for any shopping, identity, or shopping-expert intent on sil. Drives sil_register, sil_whoami, sil_search, sil_product_get, sil_profile_materialize, sil_profile_list, sil_profile_get, and sil_profile_remove.
|
|
4
4
|
metadata:
|
|
5
5
|
openclaw:
|
|
6
6
|
emoji: "\U0001F6D2"
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
-
# sil
|
|
9
|
+
# sil-shopping
|
|
10
10
|
|
|
11
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, create a dedicated sil-wired shopping expert, then list, view, or remove the experts they have created. Read user intent, route to the matching tool (loading its reference on demand), call it, and report what came back.
|
|
12
12
|
|
|
@@ -40,7 +40,7 @@ researches how to buy a first road bike well, then reflects the shape back:
|
|
|
40
40
|
→ Deep **`domainSpec`** (→ `domain_spec.md`): the full how-to-buy-well — the
|
|
41
41
|
complete fit process, geometry, gearing theory, material/wheel trade-offs — the
|
|
42
42
|
layer a coarse "size 56, black" request never names. *(If the agent had no web tool,
|
|
43
|
-
it would say so, then
|
|
43
|
+
it would say so, then compose the domain spec from well-established, public buying knowledge — never present a guess as verified research.)*
|
|
44
44
|
|
|
45
45
|
**3. `user_spec.md` — one basic question.** The single most-basic niche fact:
|
|
46
46
|
|
|
@@ -34,7 +34,7 @@ Open by reflecting the request back ("a shopping expert — let's shape it toget
|
|
|
34
34
|
|
|
35
35
|
### 2. `domain_spec.md` — NO QUESTION: the agent researches the web itself
|
|
36
36
|
|
|
37
|
-
With the niche surfaced from §1, **actively research it yourself (web + knowledge)** — pull *everything* about how to buy well in the niche, its **decision-attributes**, and its mechanics, deeply. For a bike that is the full domain: gearing/groupsets and gearing theory, frame types and geometry, **the complete process of fitting a bike to a person**, wheel/tyre selection, the trade-offs that drive a good buy. Converge a **deep domain spec**: how a person *should* buy in this niche, closing the gap where the consumer was uninformed (higher satisfaction, fewer returns). **The fit is everything** — this is researched substance, not restated persona prose and not generic filler; a shallow bullet list, or anything a layperson could have written, **fails the SDS bar** (business rule 4). Reflect the shape back briefly ("for a road bike, fit comes from stack/reach, saddle setback, crank length — here's how I'll think about your buy") and confirm. **Ask the user no domain question — you research it.** This lands in `domainSpec` (→ `domain_spec.md`). **If you lack web access, tell the user** you need web search, then
|
|
37
|
+
With the niche surfaced from §1, **actively research it yourself (web + knowledge)** — pull *everything* about how to buy well in the niche, its **decision-attributes**, and its mechanics, deeply. For a bike that is the full domain: gearing/groupsets and gearing theory, frame types and geometry, **the complete process of fitting a bike to a person**, wheel/tyre selection, the trade-offs that drive a good buy. Converge a **deep domain spec**: how a person *should* buy in this niche, closing the gap where the consumer was uninformed (higher satisfaction, fewer returns). **The fit is everything** — this is researched substance, not restated persona prose and not generic filler; a shallow bullet list, or anything a layperson could have written, **fails the SDS bar** (business rule 4). Reflect the shape back briefly ("for a road bike, fit comes from stack/reach, saddle setback, crank length — here's how I'll think about your buy") and confirm. **Ask the user no domain question — you research it.** This lands in `domainSpec` (→ `domain_spec.md`). **If you lack web access, tell the user** you need web search, then compose `domain_spec.md` from well-established, public buying knowledge — never present a guess as verified research, and never silently proceed.
|
|
38
38
|
|
|
39
39
|
### 3. `user_spec.md` — ONE basic question
|
|
40
40
|
|
|
@@ -65,7 +65,7 @@ From what you learned writing the domain spec, derive the **decomposition dimens
|
|
|
65
65
|
1. **No creation without explicit endorsement.** Nothing is written — not the host agent, the `SOUL.md`, the SDS artefacts, or the wiring — until the user explicitly endorses. The draft lives only in the conversation until then.
|
|
66
66
|
2. **Abandon-mid-flow creates nothing.** No engine step runs pre-endorsement, so an abandoned interview leaves no partial expert — automatic, not a teardown.
|
|
67
67
|
3. **One touchpoint per document, walked in order.** `SOUL.md` (ask first — persona, the niche falls out), `domain_spec.md` (no question — agent researches the web), `user_spec.md` (one basic fact), `playbook.md` (one compare-options question), `intent_spec.md` (sign-off). The deep domain expertise is the agent's **own research**, never interrogated. All four sil docs are **present (partial) from creation** — seeded fast, then augmented per-query; the user side is never "filled from empty later".
|
|
68
|
-
4. **The domain spec is DEEP and researched, never generic or restated persona prose.** It carries niche-concrete mechanics a layperson couldn't enumerate — the full how-to-buy-well (for a bike: the complete fit process, gearing theory, geometry — **the fit is everything**). A shallow bullet list or relabelled persona prose **fails SDS**. Research the niche; do not relabel latent knowledge. If you lack web access, say so, then
|
|
68
|
+
4. **The domain spec is DEEP and researched, never generic or restated persona prose.** It carries niche-concrete mechanics a layperson couldn't enumerate — the full how-to-buy-well (for a bike: the complete fit process, gearing theory, geometry — **the fit is everything**). A shallow bullet list or relabelled persona prose **fails SDS**. Research the niche; do not relabel latent knowledge. If you lack web access, say so, then compose it from well-established, public buying knowledge — never present a guess as verified research.
|
|
69
69
|
5. **The intent spec is derived FROM the domain spec, and is a schema not an instance.** The dimensions come from *this* niche's domain spec (agent-specific) and are the **template** to resolve — never the filled-in values for one request (the ephemeral per-query intent).
|
|
70
70
|
6. **Converge each section before advancing; stay re-entrant.** Reflect-and-confirm per section; let the user revise any earlier section.
|
|
71
71
|
7. **Refine-or-rename on collision; never clobber.** Defer to the engine's `collision` refusal; offer refine-or-rename.
|
|
@@ -16,7 +16,7 @@ cents).
|
|
|
16
16
|
The plugin polls in the background; once the user finishes signing in, call
|
|
17
17
|
`sil_register` again to confirm (it reports `already_registered`).
|
|
18
18
|
- **`sil_whoami`** returns the registered user's identity (name and addresses).
|
|
19
|
-
An expired
|
|
19
|
+
An expired session token is refreshed transparently and the read retried; if the
|
|
20
20
|
session is fully dead, the result names the recovery (`sil_register`).
|
|
21
21
|
- **`sil_search`** returns a ranked list of purchasable variants (`id`, `title`,
|
|
22
22
|
`price`, `availability`, `checkout_url`, `source`), best match first — present
|
|
@@ -27,7 +27,7 @@ Read `intent_spec.md` — the decomposition **dimensions** a good query must res
|
|
|
27
27
|
- A **fact / measurement / hard constraint** → fold into `user_spec.md` and re-materialize (updated `userSpec`). Mark each as **soft** (bendable) or a **hard constraint** (inviolable — "never leather", "nothing over 8 kg", an allergy, an age gate).
|
|
28
28
|
- A **shopping-taste preference** (budget band, brand likes/dislikes) → fold into `playbook.md` (the user's **shopping taste** — price sensitivity and brand preference) and re-materialize (updated `playbook`).
|
|
29
29
|
|
|
30
|
-
The user side **grows incrementally, per-query** — augmenting what is already there, never a big up-front form, never a one-time capture from nothing. **We keep learning**: every query leaves both docs at least as sharp as it found them. Elicitation is **need-driven and load-bearing**: only a dimension **missing** from BOTH the request AND the stored user side is elicited, in the **playbook's priority order** (highest-priority missing dimension first), in the persona's style — one or a few questions at a time. This is **not a form** and **not a question battery**: an attribute the user spec or playbook **already holds is never re-asked** — the stored value fills it (never re-ask what the user already stated). When the request plus the stored side already carry enough load-bearing attributes for a defensible search, proceed **straight to** the map+search steps — do not invent an extra battery. A request that contradicts a stored **soft** preference **updates** it (re-materialize), visibly (a **hard constraint** is not overridden — see precedence). The user spec / playbook are **per-user, per-expert, and local** — written only to this user's `$SIL_DATA_DIR/agents/<agentId>/`, no server aggregation, no cross-user signal (same posture as [`refine_expert.md`](refine_expert.md)).
|
|
30
|
+
The user side **grows incrementally, per-query** — augmenting what is already there, never a big up-front form, never a one-time capture from nothing. **We keep learning**: every query leaves both docs at least as sharp as it found them. Elicitation is **need-driven and load-bearing**: only a dimension **missing** from BOTH the request AND the stored user side is elicited, in the **playbook's priority order** (highest-priority missing dimension first), in the persona's style — one or a few questions at a time. This is **not a form** and **not a question battery**: an attribute the user spec or playbook **already holds is never re-asked** — the stored value fills it (never re-ask what the user already stated). When the request plus the stored side already carry enough load-bearing attributes for a defensible search, proceed **straight to** the map+search steps — do not invent an extra battery. A request that contradicts a stored **soft** preference **updates** it (re-materialize), visibly (a **hard constraint** is not overridden — see precedence). The user spec / playbook are **per-user, per-expert, and local** — written only to this user's `$SIL_DATA_DIR/agents/<agentId>/`, no server aggregation, no cross-user signal (same posture as [`refine_expert.md`](refine_expert.md)). Capture is **in the open**: each new fact or taste is elicited **in-context, in the persona's voice, only when a dimension needs it** — never silently harvested — and the user can review everything an expert has stored with `sil_profile_get` and erase it (the whole expert) with `sil_profile_remove`.
|
|
31
31
|
|
|
32
32
|
### Layering — precedence intent > playbook > user_spec > domain_spec
|
|
33
33
|
|
|
@@ -8,7 +8,7 @@ Run these steps **in order, top to bottom** — the order is the spec.
|
|
|
8
8
|
|
|
9
9
|
## The refinement loop (run in this exact order)
|
|
10
10
|
|
|
11
|
-
1. **Trigger + load the named expert.**
|
|
11
|
+
1. **Trigger + load the named expert.** Refinement starts only when the user **explicitly asks** to sharpen a **named** expert. At the end of a session you MAY *offer* to refine — but that offer is a prompt only: it loads nothing, proposes nothing, and persists nothing until the user accepts and then clears the explicit confirm gate in step 3. An ambiguous, silent, or off-topic remark is **never** a trigger. Once triggered, load that one expert's current SDS artefacts with **`sil_profile_get { agentId }`** — the manifest plus the `domainSpec` / `intentSpec` bodies (always present) and the `userSpec` / `playbook` bodies (when captured). The persona is the host workspace **`SOUL.md`**, read separately when a persona refinement is on the table. This is the working expert you are about to sharpen; everything you propose is grounded in what it already is.
|
|
12
12
|
|
|
13
13
|
2. **Propose, session-grounded — concretely, never a generic template.** Propose a small set of **concrete refinements drawn from the observed session** — what the agent actually saw in the just-completed (or in-progress) shopping session under this expert. Each proposal must name **two things**:
|
|
14
14
|
- **which artefact element it changes** — a **persona** standing rule (the host `SOUL.md`), a **domain-spec** mechanic or dimension (`domain_spec.md` — e.g. a niche detail the research missed or got wrong), an **intent-spec** decomposition dimension (`intent_spec.md` — e.g. a dimension that mattered for every request but the schema never named), a **user-spec** fact or hard constraint (`user_spec.md` — e.g. a standing measurement, "never leather" as a hard constraint), or a **buying-taste** preference (`playbook.md` — e.g. a brand the user keeps rejecting, a tightened budget band); and
|
|
@@ -11,7 +11,7 @@ Load this at shop time, when an expert's loop maps a decomposed request into a `
|
|
|
11
11
|
| "New only" | `condition: ["new"]` |
|
|
12
12
|
| The narrowed niche + key descriptors | `query` (free text) and/or `category` |
|
|
13
13
|
| "In stock only" (the default) / "show me out-of-stock too" | `available` (omit for in-stock default; `false` to include unavailable) |
|
|
14
|
-
| "Buy from a local/domestic shop" | `local_merchants: true` (a best-effort ranking *bias*, not a hard filter —
|
|
14
|
+
| "Buy from a local/domestic shop" | `local_merchants: true` (a best-effort ranking *bias*, not a hard filter — and *optionally*, to surface more local shops, issue the `query` in that country's language; a tactic, never an override of a language the user deliberately chose) |
|
|
15
15
|
|
|
16
16
|
A stated taste with **no matching param** (e.g. "I like bold colours", "prefer eco-friendly brands") does **not** become a new param — fold it into the `query` text or into the recommendation rubric. There is no `color` filter, no `brand` filter; inventing one produces an expert that emits invalid `sil_search` calls at shop time.
|
|
17
17
|
|
|
@@ -48,7 +48,7 @@ query: "<niche descriptors from the answer>" # e.g. "endurance road
|
|
|
48
48
|
category: "<the narrowed niche category>"
|
|
49
49
|
price_max: 120000 # €1200 → minor units (cents)
|
|
50
50
|
condition: ["secondhand"] # "secondhand is fine"
|
|
51
|
-
local_merchants: true # "want local shops" → ranking bias;
|
|
51
|
+
local_merchants: true # "want local shops" → ranking bias; optionally query in the local language (e.g. French) to surface more of them
|
|
52
52
|
# ship_to: OMITTED — server resolves the registered default address; no sil_whoami round-trip
|
|
53
53
|
```
|
|
54
54
|
|
|
File without changes
|
|
File without changes
|