sil-openclaw 0.4.3 → 0.4.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 +17 -0
- package/openclaw.plugin.json +2 -2
- package/package.json +3 -2
- package/scripts/create-shopper.mjs +2 -3
- package/sil-shopping/SKILL.md +1 -1
- package/sil-shopping/references/agent_creation_engine.md +3 -6
- package/sil-shopping/references/fill_and_feedback.md +1 -1
- package/sil-shopping/references/setup_onboarding.md +1 -1
- package/scripts/changelog.mjs +0 -0
- package/scripts/release.mjs +0 -228
- package/scripts/sync-version.mjs +0 -52
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,23 @@ release (`clawhub package publish --changelog`). See [README](./README.md#releas
|
|
|
10
10
|
|
|
11
11
|
## [Unreleased]
|
|
12
12
|
|
|
13
|
+
## [0.4.4] - 2026-07-17
|
|
14
|
+
|
|
15
|
+
### Security
|
|
16
|
+
|
|
17
|
+
- **Ship only the two runtime operator bins, not the whole `scripts/` dir.**
|
|
18
|
+
`package.json#files` was dragging maintainer tooling (`release.mjs`,
|
|
19
|
+
`changelog.mjs`, `sync-version.mjs`) into the tarball. `security.noChildProcess`
|
|
20
|
+
is now `false` — the runtime spawns nothing, but the two shipped bins drive the
|
|
21
|
+
host `openclaw` CLI via `execFileSync`.
|
|
22
|
+
|
|
23
|
+
### Changed
|
|
24
|
+
|
|
25
|
+
- **Creation-engine doc: dropped a false claim and its defensive prose.** The
|
|
26
|
+
shopper's memory is the sil store; removed the "never to host files" absolute
|
|
27
|
+
that contradicted the one-time `SOUL.md` write, and the open-shell justification.
|
|
28
|
+
- **Narrowed the skill bundle's activation `description:` to explicit sil intent.**
|
|
29
|
+
|
|
13
30
|
## [0.4.3] - 2026-07-17
|
|
14
31
|
|
|
15
32
|
### Added
|
package/openclaw.plugin.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"id": "sil",
|
|
3
3
|
"name": "sil",
|
|
4
4
|
"description": "Turn your OpenClaw into an expert shopping agent.",
|
|
5
|
-
"version": "0.4.
|
|
5
|
+
"version": "0.4.4",
|
|
6
6
|
"skills": ["./sil-shopping"],
|
|
7
7
|
"activation": {
|
|
8
8
|
"onCapabilities": ["tool"]
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"config.json (user identity)"
|
|
73
73
|
],
|
|
74
74
|
"noNativeModules": true,
|
|
75
|
-
"noChildProcess":
|
|
75
|
+
"noChildProcess": false,
|
|
76
76
|
"noInstallScripts": true,
|
|
77
77
|
"reportVulnerabilitiesTo": "https://x.com/4gpts"
|
|
78
78
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sil-openclaw",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.4",
|
|
4
4
|
"description": "Turn your OpenClaw into an expert shopping agent.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -32,7 +32,8 @@
|
|
|
32
32
|
},
|
|
33
33
|
"files": [
|
|
34
34
|
"dist",
|
|
35
|
-
"scripts",
|
|
35
|
+
"scripts/create-shopper.mjs",
|
|
36
|
+
"scripts/allowlist-openclaw.mjs",
|
|
36
37
|
"sil-shopping",
|
|
37
38
|
"openclaw.plugin.json",
|
|
38
39
|
"README.md",
|
|
@@ -5,9 +5,8 @@
|
|
|
5
5
|
* This is Change 3 of the onboarding-ux plan — it collapses the nine-step,
|
|
6
6
|
* agent-driven host-CLI choreography (`agent_creation_engine.md`) into ONE shipped
|
|
7
7
|
* package `bin`, a sibling of `scripts/allowlist-openclaw.mjs`. Like that bin it is
|
|
8
|
-
* a standalone operator script — NOT the plugin process —
|
|
9
|
-
*
|
|
10
|
-
* legitimately drives `openclaw …` via `execFileSync`.
|
|
8
|
+
* a standalone operator script — NOT the plugin process — that drives the host
|
|
9
|
+
* `openclaw` CLI via `execFileSync`.
|
|
11
10
|
*
|
|
12
11
|
* It runs POST-endorsement: the interview (`agent_creation_engine.md` Part 1) owns the
|
|
13
12
|
* consent gate; this bin executes an already-assembled, already-endorsed spec
|
package/sil-shopping/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: sil-shopping
|
|
3
|
-
description: 'Use
|
|
3
|
+
description: 'Use when the user explicitly asks to shop with sil or manage their sil shopper: register or check their sil account, search the sil catalog or re-check products by id, set up their one shopper (a two-touchpoint, endorsement-gated onboarding), view or forget what it has learned (domains/PRDs), or — running as that shopper — execute the six-beat Spec-Driven Shopping loop and record a fact or taste it surfaced. 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"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: agent-creation-engine
|
|
3
|
-
description: Create the single sil-wired shopper end to end — the two-touchpoint onboarding interview (persona + shared user-spec seed, endorsement-gated) then the one-command engine that persists it. Load when the user asks to set up
|
|
3
|
+
description: Create the single sil-wired shopper end to end — the two-touchpoint onboarding interview (persona + shared user-spec seed, endorsement-gated) then the one-command engine that persists it. Load when the user asks to create or set up their sil shopper.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Create the shopper
|
|
@@ -172,10 +172,6 @@ to mint/refresh domains; if defaults grant none, the bin reports `created` with
|
|
|
172
172
|
mode the pinned `alpine/openclaw:2026.6.9` accepts):
|
|
173
173
|
`agents.list[<idx>].skills` ← `["sil-shopping"]`; `plugins.entries.sil.enabled` ←
|
|
174
174
|
`true`. **No per-agent `tools.deny`** — the shopper inherits the host default toolset.
|
|
175
|
-
An fs-mutator deny is inert while codex's own shell (surfaced as `bash`) stays open by
|
|
176
|
-
design: it reads the shopper's skill files and can write regardless. The shell stays
|
|
177
|
-
open (trusted single-operator posture); persistence is steered through the sil tools by
|
|
178
|
-
the skill, not enforced by tool policy.
|
|
179
175
|
8. **Admit sil (plugin trust)** — the shipped **`scripts/allowlist-openclaw.mjs`** helper
|
|
180
176
|
(which the script runs itself, by absolute path via `node` — never the bare name)
|
|
181
177
|
additively merges the three trust surfaces (`plugins.allow` + `tools.alsoAllow` +
|
|
@@ -203,7 +199,8 @@ carrying the **explore-first** mantra, the loop in three lines, and the one dist
|
|
|
203
199
|
that matters: the shopper **mints an unlearned niche first** (a `sil_profile_search`
|
|
204
200
|
MISS → `sil_learn create`, then search); **the sil catalog is where you buy, the open
|
|
205
201
|
web is where you learn** (web only researches a niche's buying guide, never sources a
|
|
206
|
-
pick); **
|
|
202
|
+
pick); and its **shopping memory is the sil store** — it records what it learns through
|
|
203
|
+
`sil_learn` / `sil_profile_*`.
|
|
207
204
|
|
|
208
205
|
### Status taxonomy
|
|
209
206
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: fill-and-feedback
|
|
3
|
-
description: Beat 3
|
|
3
|
+
description: Beats 3 and 6 of the sil shopping loop. Beat 3 fills the PRD by precedence (multi-turn, authors the Search specs block, hard-constraint dual-enforce, the persistence split); Beat 6 is the reaction half (capture-gate, confirm-before-write, route-by-scope). Covers sil_learn, the one target+change write verb (create | write | attach-asset). Load within an active sil shopping loop.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Beat 3 (Fill) and Beat 6 (Feedback) — via `sil_learn`
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: setup-onboarding
|
|
3
|
-
description: The one-time setup script the router defers to — the five-stage onboarding progression, the after-register shopper offer, and the per-search pitch.
|
|
3
|
+
description: The one-time setup script the router defers to when state shows sil setup is incomplete (no shopper, or a shopper with no domains) — the five-stage onboarding progression, the after-register shopper offer, and the per-search pitch. Sheds once setup is complete.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Setting up the shopper — the staged onboarding
|
package/scripts/changelog.mjs
DELETED
|
Binary file
|
package/scripts/release.mjs
DELETED
|
@@ -1,228 +0,0 @@
|
|
|
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
|
-
}
|
package/scripts/sync-version.mjs
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
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}`);
|