惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

J
Java Code Geeks
M
MIT News - Artificial intelligence
D
Docker
S
SegmentFault 最新的问题
B
Blog
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
博客园 - 【当耐特】
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
The GitHub Blog
The GitHub Blog
Y
Y Combinator Blog
腾讯CDC
阮一峰的网络日志
阮一峰的网络日志
U
Unit 42
C
Check Point Blog
GbyAI
GbyAI
美团技术团队
Recent Announcements
Recent Announcements
F
Fortinet All Blogs
量子位
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
Visual Studio Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
G
Google Developers Blog

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix(plugins): align clawhub clawpack downloads · openclaw...
vincentkoc · 2026-05-03 · via Recent Commits to openclaw:main

@@ -1,25 +1,90 @@

11

const crypto = require("node:crypto");

22

const fs = require("node:fs");

33

const http = require("node:http");

4+

const os = require("node:os");

45

const path = require("node:path");

56

const { createRequire } = require("node:module");

6778

const profile = process.argv[2];

89

const portFile = process.argv[3];

910

const requireFromApp = createRequire(path.join(process.cwd(), "package.json"));

1011

const JSZip = requireFromApp("jszip");

12+

const tar = requireFromApp("tar");

1113

const packageName = "@openclaw/kitchen-sink";

1214

const pluginId = "openclaw-kitchen-sink-fixture";

131514-

const buildClawPackSummary = ({ sha256hash, manifestSha256, size }) => ({

16+

const buildArtifactSummary = ({

17+

clawpackSha256,

18+

clawpackSize,

19+

npmIntegrity,

20+

npmShasum,

21+

npmTarballName,

22+

}) => ({

23+

kind: "npm-pack",

24+

format: "tgz",

25+

sha256: clawpackSha256,

26+

size: clawpackSize,

27+

npmIntegrity,

28+

npmShasum,

29+

npmTarballName,

30+

});

31+32+

const buildClawPackSummary = ({

33+

clawpackSha256,

34+

clawpackSize,

35+

npmIntegrity,

36+

npmShasum,

37+

npmTarballName,

38+

}) => ({

1539

available: true,

16-

specVersion: 1,

17-

format: "clawpack.zip",

18-

sha256: sha256hash,

19-

size,

20-

manifestSha256,

40+

format: "tgz",

41+

sha256: clawpackSha256,

42+

size: clawpackSize,

43+

npmIntegrity,

44+

npmShasum,

45+

npmTarballName,

2146

});

224748+

async function buildNpmPackArtifact(fixture) {

49+

const packRoot = await fs.promises.mkdtemp(path.join(os.tmpdir(), "openclaw-clawhub-fixture-"));

50+

try {

51+

const packageDir = path.join(packRoot, "package");

52+

await fs.promises.mkdir(packageDir, { recursive: true });

53+

await fs.promises.writeFile(

54+

path.join(packageDir, "package.json"),

55+

`${JSON.stringify(fixture.packageJson, null, 2)}\n`,

56+

);

57+

await fs.promises.writeFile(path.join(packageDir, "index.js"), fixture.indexJs);

58+

await fs.promises.writeFile(

59+

path.join(packageDir, "openclaw.plugin.json"),

60+

`${JSON.stringify(fixture.manifest, null, 2)}\n`,

61+

);

62+

const npmTarballName = `${packageName.replace(/^@/, "").replace("/", "-")}-${fixture.version}.tgz`;

63+

const archivePath = path.join(packRoot, npmTarballName);

64+

await tar.c(

65+

{

66+

cwd: packRoot,

67+

file: archivePath,

68+

gzip: true,

69+

portable: true,

70+

noMtime: true,

71+

},

72+

["package"],

73+

);

74+

const archive = await fs.promises.readFile(archivePath);

75+

return {

76+

archive,

77+

clawpackSha256: crypto.createHash("sha256").update(archive).digest("hex"),

78+

clawpackSize: archive.length,

79+

npmIntegrity: `sha512-${crypto.createHash("sha512").update(archive).digest("base64")}`,

80+

npmShasum: crypto.createHash("sha1").update(archive).digest("hex"),

81+

npmTarballName,

82+

};

83+

} finally {

84+

await fs.promises.rm(packRoot, { recursive: true, force: true }).catch(() => undefined);

85+

}

86+

}

87+2388

const profiles = {

2489

"kitchen-sink-plugin": {

2590

version: "0.1.3",

@@ -98,6 +163,7 @@ export default definePluginEntry({

98163

},

99164

packageDetail(artifact) {

100165

const clawpack = buildClawPackSummary(artifact);

166+

const packageArtifact = buildArtifactSummary(artifact);

101167

const packageDetail = {

102168

package: {

103169

name: packageName,

@@ -131,6 +197,7 @@ export default definePluginEntry({

131197

hasProvenance: false,

132198

scanStatus: "passed",

133199

},

200+

artifact: packageArtifact,

134201

clawpack,

135202

},

136203

};

@@ -151,6 +218,7 @@ export default definePluginEntry({

151218

compatibility: packageDetail.package.compatibility,

152219

capabilities: packageDetail.package.capabilities,

153220

verification: packageDetail.package.verification,

221+

artifact: packageArtifact,

154222

clawpack,

155223

},

156224

},

@@ -209,6 +277,7 @@ export default definePluginEntry({

209277

minGatewayVersion: "2026.4.26",

210278

};

211279

const clawpack = buildClawPackSummary(artifact);

280+

const packageArtifact = buildArtifactSummary(artifact);

212281

return {

213282

packageDetail: {

214283

package: {

@@ -222,6 +291,7 @@ export default definePluginEntry({

222291

createdAt: 0,

223292

updatedAt: 0,

224293

compatibility,

294+

artifact: packageArtifact,

225295

clawpack,

226296

},

227297

},

@@ -232,6 +302,7 @@ export default definePluginEntry({

232302

changelog: "Kitchen-sink fixture package for Docker plugin E2E.",

233303

sha256hash: artifact.sha256hash,

234304

compatibility,

305+

artifact: packageArtifact,

235306

clawpack,

236307

},

237308

},

@@ -257,11 +328,10 @@ async function main() {

257328258329

const archive = await zip.generateAsync({ type: "nodebuffer", compression: "DEFLATE" });

259330

const sha256hash = crypto.createHash("sha256").update(archive).digest("hex");

260-

const manifestSha256 = crypto.createHash("sha256").update(manifestJson).digest("hex");

331+

const clawpack = await buildNpmPackArtifact(fixture);

261332

const { packageDetail, versionDetail, betaStatus } = fixture.packageDetail({

262333

sha256hash,

263-

manifestSha256,

264-

size: archive.length,

334+

...clawpack,

265335

});

266336267337

const json = (response, value, status = 200) => {

@@ -304,15 +374,17 @@ async function main() {

304374

}

305375

if (

306376

url.pathname ===

307-

`/api/v1/packages/${encodeURIComponent(packageName)}/versions/${fixture.version}/clawpack`

377+

`/api/v1/packages/${encodeURIComponent(packageName)}/versions/${fixture.version}/artifact/download`

308378

) {

309379

response.writeHead(200, {

310-

"content-type": "application/zip",

311-

"content-length": String(archive.length),

312-

"X-ClawHub-ClawPack-Sha256": sha256hash,

313-

"X-ClawHub-ClawPack-Spec-Version": "1",

380+

"content-type": "application/octet-stream",

381+

"content-length": String(clawpack.archive.length),

382+

"X-ClawHub-Artifact-Type": "npm-pack-tarball",

383+

"X-ClawHub-Artifact-Sha256": clawpack.clawpackSha256,

384+

"X-ClawHub-Npm-Integrity": clawpack.npmIntegrity,

385+

"X-ClawHub-Npm-Shasum": clawpack.npmShasum,

314386

});

315-

response.end(archive);

387+

response.end(clawpack.archive);

316388

return;

317389

}

318390

response.writeHead(404, { "content-type": "text/plain" });