Skip to content

Commit f59ccab

Browse files
committed
fix(memory): keep session backfill internals private
1 parent 6f228ec commit f59ccab

3 files changed

Lines changed: 11 additions & 9 deletions

File tree

‎extensions/memory-core/src/session-backfill-gateway.test.ts‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
import type { GatewayRequestHandlerOptions } from "openclaw/plugin-sdk/gateway-runtime";
22
import type { OpenClawPluginApi } from "openclaw/plugin-sdk/plugin-entry";
33
import { beforeEach, describe, expect, it, vi } from "vitest";
4-
import {
5-
registerSessionBackfillGatewayMethods,
6-
SESSION_BACKFILL_GATEWAY_METHODS,
7-
} from "./session-backfill-gateway.js";
4+
import { registerSessionBackfillGatewayMethods } from "./session-backfill-gateway.js";
85
import { executeSessionBackfill, executeSessionBackfillBatch } from "./session-backfill.js";
96

107
vi.mock("./session-backfill.js", async (importOriginal) => ({
@@ -20,6 +17,11 @@ type RegisteredMethod = {
2017

2118
const executeMock = vi.mocked(executeSessionBackfill);
2219
const executeBatchMock = vi.mocked(executeSessionBackfillBatch);
20+
const SESSION_BACKFILL_GATEWAY_METHODS = {
21+
preview: "memory.sessionBackfill.preview",
22+
apply: "memory.sessionBackfill.apply",
23+
rollback: "memory.sessionBackfill.rollback",
24+
} as const;
2325

2426
function createHarness(config?: Record<string, unknown>) {
2527
const methods = new Map<string, RegisteredMethod>();

‎extensions/memory-core/src/session-backfill-gateway.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import {
1818
type SessionBackfillResult,
1919
} from "./session-backfill.js";
2020

21-
export const SESSION_BACKFILL_GATEWAY_METHODS = {
21+
const SESSION_BACKFILL_GATEWAY_METHODS = {
2222
preview: "memory.sessionBackfill.preview",
2323
apply: "memory.sessionBackfill.apply",
2424
rollback: "memory.sessionBackfill.rollback",
@@ -29,7 +29,7 @@ type SessionBackfillGatewayParams = Pick<
2929
"agentId" | "from" | "to" | "limitDays"
3030
>;
3131

32-
export type SessionBackfillGatewayResult = {
32+
type SessionBackfillGatewayResult = {
3333
days: number;
3434
candidates: number;
3535
perDay: Array<{ day: string; candidateCount: number; sample: string[] }>;

‎extensions/memory-core/src/session-backfill.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ type SessionBackfillCollection = {
9696
scans: SessionBackfillScan[];
9797
};
9898

99-
export type SessionBackfillDay = {
99+
type SessionBackfillDay = {
100100
day: string;
101101
candidateCount: number;
102102
topCandidates: string[];
@@ -118,12 +118,12 @@ export type SessionBackfillResult = {
118118
};
119119
};
120120

121-
export type SessionBackfillContinuation = {
121+
type SessionBackfillContinuation = {
122122
advanced: boolean;
123123
hasMore: boolean;
124124
};
125125

126-
export type SessionBackfillExecution = {
126+
type SessionBackfillExecution = {
127127
result: SessionBackfillResult;
128128
continuation: SessionBackfillContinuation;
129129
};

0 commit comments

Comments
 (0)