Skip to content

Commit 06b63e4

Browse files
committed
fix(doctor): update note import path after terminal-core package extraction
Upstream extracted the terminal note module from src/terminal/note.js to packages/terminal-core/src/note.js; update the disk-space contribution and its tests to the new path.
1 parent c307fc2 commit 06b63e4

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/commands/doctor-disk-space.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
noteDiskSpace,
66
} from "./doctor-disk-space.js";
77

8-
vi.mock("../terminal/note.js", () => ({
8+
vi.mock("../../packages/terminal-core/src/note.js", () => ({
99
note: vi.fn(),
1010
}));
1111

@@ -115,7 +115,7 @@ describe("buildDiskSpaceWarnings", () => {
115115

116116
describe("noteDiskSpace", () => {
117117
it("calls note when space is below warning threshold", async () => {
118-
const { note: mockNote } = await import("../terminal/note.js");
118+
const { note: mockNote } = await import("../../packages/terminal-core/src/note.js");
119119
vi.mocked(mockNote).mockClear();
120120

121121
noteDiskSpace({ gateway: { mode: "local" } } as never, {
@@ -130,7 +130,7 @@ describe("noteDiskSpace", () => {
130130
});
131131

132132
it("calls note with CRITICAL when space is very low", async () => {
133-
const { note: mockNote } = await import("../terminal/note.js");
133+
const { note: mockNote } = await import("../../packages/terminal-core/src/note.js");
134134
vi.mocked(mockNote).mockClear();
135135

136136
noteDiskSpace({ gateway: { mode: "local" } } as never, {
@@ -144,7 +144,7 @@ describe("noteDiskSpace", () => {
144144
});
145145

146146
it("does not call note when space is sufficient", async () => {
147-
const { note: mockNote } = await import("../terminal/note.js");
147+
const { note: mockNote } = await import("../../packages/terminal-core/src/note.js");
148148
vi.mocked(mockNote).mockClear();
149149

150150
noteDiskSpace({ gateway: { mode: "local" } } as never, {
@@ -156,7 +156,7 @@ describe("noteDiskSpace", () => {
156156
});
157157

158158
it("does not call note when disk space cannot be read", async () => {
159-
const { note: mockNote } = await import("../terminal/note.js");
159+
const { note: mockNote } = await import("../../packages/terminal-core/src/note.js");
160160
vi.mocked(mockNote).mockClear();
161161

162162
noteDiskSpace({ gateway: { mode: "local" } } as never, {

src/commands/doctor-disk-space.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type { OpenClawConfig } from "../config/config.js";
33
import { resolveStateDir } from "../config/paths.js";
44
import { resolveRequiredHomeDir } from "../infra/home-dir.js";
55
import { tryReadDiskSpace } from "../infra/disk-space.js";
6-
import { note } from "../terminal/note.js";
6+
import { note } from "../../packages/terminal-core/src/note.js";
77
import { shortenHomePath } from "../utils.js";
88

99
// 100 MB — below this, config writes and session transcripts are likely to

0 commit comments

Comments
 (0)