























@@ -1,7 +1,7 @@
11import fs from "node:fs";
2-import os from "node:os";
32import path from "node:path";
43import { describe, expect, it } from "vitest";
4+import { resolvePreferredOpenClawTmpDir } from "../../../../infra/tmp-openclaw-dir.js";
55import { listChannelPluginCatalogEntries } from "../../catalog.js";
6677function createCatalogEntry(params: {
@@ -122,7 +122,9 @@ export function describeChannelPluginCatalogEntriesContract() {
122122{
123123name: "includes external catalog entries",
124124setup: () => {
125-const dir = fs.mkdtempSync(path.join(os.tmpdir(), "openclaw-catalog-"));
125+const dir = fs.mkdtempSync(
126+path.join(resolvePreferredOpenClawTmpDir(), "openclaw-catalog-"),
127+);
126128const catalogPath = path.join(dir, "catalog.json");
127129writeCatalogFile(
128130catalogPath,
@@ -145,7 +147,7 @@ export function describeChannelPluginCatalogEntriesContract() {
145147name: "preserves plugin ids when they differ from channel ids",
146148setup: () => {
147149const stateDir = fs.mkdtempSync(
148-path.join(os.tmpdir(), "openclaw-channel-catalog-state-"),
150+path.join(resolvePreferredOpenClawTmpDir(), "openclaw-channel-catalog-state-"),
149151);
150152writeDiscoveredChannelPlugin({
151153 stateDir,
@@ -168,7 +170,9 @@ export function describeChannelPluginCatalogEntriesContract() {
168170{
169171name: "keeps discovered plugins ahead of external catalog overrides",
170172setup: () => {
171-const stateDir = fs.mkdtempSync(path.join(os.tmpdir(), "openclaw-catalog-state-"));
173+const stateDir = fs.mkdtempSync(
174+path.join(resolvePreferredOpenClawTmpDir(), "openclaw-catalog-state-"),
175+);
172176const catalogPath = path.join(stateDir, "catalog.json");
173177writeDiscoveredChannelPlugin({
174178 stateDir,
@@ -206,7 +210,9 @@ export function describeChannelPluginCatalogEntriesContract() {
206210{
207211name: "accepts rich external manifest entries with pinned npm metadata",
208212setup: () => {
209-const dir = fs.mkdtempSync(path.join(os.tmpdir(), "openclaw-catalog-rich-"));
213+const dir = fs.mkdtempSync(
214+path.join(resolvePreferredOpenClawTmpDir(), "openclaw-catalog-rich-"),
215+);
210216const catalogPath = path.join(dir, "catalog.json");
211217fs.writeFileSync(
212218catalogPath,
@@ -284,7 +290,9 @@ export function describeChannelPluginCatalogEntriesContract() {
284290{
285291name: "accepts rich external manifest entries for yuanbao with pinned npm metadata",
286292setup: () => {
287-const dir = fs.mkdtempSync(path.join(os.tmpdir(), "openclaw-catalog-yuanbao-"));
293+const dir = fs.mkdtempSync(
294+path.join(resolvePreferredOpenClawTmpDir(), "openclaw-catalog-yuanbao-"),
295+);
288296const catalogPath = path.join(dir, "catalog.json");
289297fs.writeFileSync(
290298catalogPath,
@@ -365,7 +373,9 @@ export function describeChannelPluginCatalogPathResolutionContract() {
365373{
366374name: "uses the provided env for external catalog path resolution",
367375setup: () => {
368-const home = fs.mkdtempSync(path.join(os.tmpdir(), "openclaw-catalog-home-"));
376+const home = fs.mkdtempSync(
377+path.join(resolvePreferredOpenClawTmpDir(), "openclaw-catalog-home-"),
378+);
369379const catalogPath = path.join(home, "catalog.json");
370380writeCatalogFile(
371381catalogPath,
@@ -391,7 +401,9 @@ export function describeChannelPluginCatalogPathResolutionContract() {
391401{
392402name: "uses the provided env for default catalog paths",
393403setup: () => {
394-const stateDir = fs.mkdtempSync(path.join(os.tmpdir(), "openclaw-catalog-state-"));
404+const stateDir = fs.mkdtempSync(
405+path.join(resolvePreferredOpenClawTmpDir(), "openclaw-catalog-state-"),
406+);
395407const catalogPath = path.join(stateDir, "plugins", "catalog.json");
396408fs.mkdirSync(path.dirname(catalogPath), { recursive: true });
397409writeCatalogFile(
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。