Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion apps/memos-local-openclaw/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* Provides: memory_search, memory_get, memory_timeline, task_summary, skill_get, skill_install, memory_viewer
*/

import type { OpenClawPluginApi } from "openclaw/plugin-sdk";
import { Type } from "@sinclair/typebox";
import * as fs from "fs";
import * as path from "path";
Expand Down Expand Up @@ -37,6 +36,9 @@ import { parseJsonOrJson5 } from "./src/shared/json5";
import { patchOpenclawAllowFile } from "./src/shared/openclaw-config";


type OpenClawPluginApi = any;


/** Remove near-duplicate hits based on summary word overlap (>70%). Keeps first (highest-scored) hit. */
function deduplicateHits<T extends { summary: string }>(hits: T[]): T[] {
const kept: T[] = [];
Expand Down
2 changes: 1 addition & 1 deletion apps/memos-local-openclaw/openclaw.plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@
"If better-sqlite3 fails to build, ensure you have C++ build tools: xcode-select --install (macOS) or build-essential (Linux)"
]
},
"extensions": ["./index.ts"]
"extensions": ["./dist/index.js"]
}
9 changes: 5 additions & 4 deletions apps/memos-local-openclaw/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
"name": "@memtensor/memos-local-openclaw-plugin",
"version": "1.0.9-beta.1",
"description": "MemOS Local memory plugin for OpenClaw — full-write, hybrid-recall, progressive retrieval",
"type": "module",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"type": "commonjs",
"main": "./dist/index.js",
"files": [
"dist",
"tsconfig.json",
"src",
"skill",
"prebuilds",
"scripts/native-binding.cjs",
Expand Down Expand Up @@ -34,7 +35,7 @@
"test:watch": "vitest",
"test:accuracy": "tsx scripts/run-accuracy-test.ts",
"postinstall": "node scripts/postinstall.cjs",
"prepack": "npm run build"
"prepublishOnly": "npm run build"
},
"keywords": [
"openclaw",
Expand Down
35 changes: 35 additions & 0 deletions apps/memos-local-openclaw/tests/package-manifest.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { describe, expect, it } from "vitest";
import fs from "node:fs";
import path from "node:path";

const root = process.cwd();

describe("package manifest", () => {
it("publishes the compiled OpenClaw entrypoint", () => {
const packageJson = JSON.parse(
fs.readFileSync(path.join(root, "package.json"), "utf-8"),
) as {
type: string;
main: string;
files: string[];
openclaw: { extensions: string[] };
scripts: Record<string, string>;
};
const pluginJson = JSON.parse(
fs.readFileSync(path.join(root, "openclaw.plugin.json"), "utf-8"),
) as { extensions: string[] };
const tsconfig = JSON.parse(
fs.readFileSync(path.join(root, "tsconfig.json"), "utf-8"),
) as { compilerOptions: { rootDir: string }; include: string[] };

expect(packageJson.type).toBe("commonjs");
expect(packageJson.main).toBe("./dist/index.js");
expect(packageJson.openclaw.extensions).toEqual(["./dist/index.js"]);
expect(pluginJson.extensions).toEqual(["./dist/index.js"]);
expect(tsconfig.compilerOptions.rootDir).toBe(".");
expect(tsconfig.include).toContain("index.ts");
expect(packageJson.files).toEqual(expect.arrayContaining(["dist", "tsconfig.json"]));
expect(packageJson.files).not.toContain("index.ts");
expect(packageJson.scripts.prepublishOnly).toBe("npm run build");
});
});
6 changes: 3 additions & 3 deletions apps/memos-local-openclaw/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"lib": ["ES2022"],
"outDir": "dist",
"rootDir": ".",
"strict": false,
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
Expand All @@ -20,6 +20,6 @@
"openclaw/plugin-sdk": ["./types/openclaw__plugin-sdk/index.d.ts"]
}
},
"include": ["src", "index.ts"],
"exclude": ["node_modules", "dist", "**/*.test.ts", "scripts", "tests", "skill", "plugin-impl.ts"]
"include": ["index.ts", "plugin-impl.ts", "src"],
"exclude": ["node_modules", "dist", "**/*.test.ts"]
}