samemory 0.0.1 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,5 +1,43 @@
1
1
  # samemory
2
2
 
3
- WIP
3
+ agentの共有メモリをMCPサーバーにするためのツール
4
4
 
5
- (12月以降に一気に開発しようと現状考えてます)
5
+ # Install
6
+
7
+ - Claude Code
8
+
9
+ ```json
10
+ {
11
+ "mcpServers": {
12
+ "samemory": {
13
+ "type": "stdio",
14
+ "command": "bunx",
15
+ "args": ["samemory"]
16
+ }
17
+ }
18
+ }
19
+ ```
20
+
21
+ - Codex
22
+
23
+ ```toml
24
+ [mcp_servers.samemory]
25
+ command = "bunx"
26
+ args = ["samemory"]
27
+ enabled = true
28
+ ```
29
+
30
+ - OpenCode
31
+
32
+ ```json
33
+ {
34
+ "$schema": "https://opencode.ai/config.json",
35
+ "mcp": {
36
+ "samemory": {
37
+ "type": "local",
38
+ "command": ["bunx", "samemory"],
39
+ "enabled": true
40
+ }
41
+ }
42
+ }
43
+ ```
package/dist/index.mjs CHANGED
@@ -1,9 +1,9 @@
1
1
  import { McpServer } from "@modelcontextprotocol/server";
2
2
  import { StdioServerTransport } from "@modelcontextprotocol/server/stdio";
3
- import { mkdir, readFile, readdir, rename, stat, writeFile } from "node:fs/promises";
4
3
  import { z } from "zod";
5
4
  import { join } from "node:path";
6
5
  import { homedir } from "node:os";
6
+ import { mkdir, readFile, readdir, rename, stat, writeFile } from "node:fs/promises";
7
7
  import { randomUUIDv7 } from "node:crypto";
8
8
  import Fuse from "fuse.js";
9
9
  // src/memory_get/type.ts
@@ -98,6 +98,8 @@ const writeMemoryFile = async ({ category, tags, agent, title, summary, content
98
98
  const directoryTemp = join(await ConfigDir(), categories, `${SchemaCheck.data.id}.json.tmp`);
99
99
  const directory = join(await ConfigDir(), categories, `${SchemaCheck.data.id}.json`);
100
100
  try {
101
+ const mkcategory = join(await ConfigDir(), categories);
102
+ await mkdir(mkcategory, { recursive: true });
101
103
  const stringify = JSON.stringify(SchemaCheck.data, null, 2);
102
104
  await writeFile(directoryTemp, stringify, "utf-8");
103
105
  await rename(directoryTemp, directory);
@@ -153,16 +155,6 @@ const Search = async ({ query, category, tags, limit }) => {
153
155
  return results.slice(0, limited).map((result) => result.item);
154
156
  };
155
157
  // src/main.ts
156
- const lessons = join(await ConfigDir(), "lessons");
157
- const patterns = join(await ConfigDir(), "patterns");
158
- const context = join(await ConfigDir(), "context");
159
- const commands = join(await ConfigDir(), "commands");
160
- const preferences = join(await ConfigDir(), "preferences");
161
- await mkdir(lessons, { recursive: true });
162
- await mkdir(patterns, { recursive: true });
163
- await mkdir(context, { recursive: true });
164
- await mkdir(commands, { recursive: true });
165
- await mkdir(preferences, { recursive: true });
166
158
  const server = new McpServer({
167
159
  name: MCP_NAME,
168
160
  version: "0.0.1"
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "samemory",
3
3
  "module": "src/index.ts",
4
4
  "type": "module",
5
- "version": "0.0.1",
5
+ "version": "0.0.4",
6
6
  "bin": {
7
7
  "samemory": "dist/index.mjs"
8
8
  },
@@ -15,6 +15,9 @@
15
15
  "package.json",
16
16
  "LICENSE"
17
17
  ],
18
+ "scripts": {
19
+ "build": "bunx tsdown"
20
+ },
18
21
  "devDependencies": {
19
22
  "@types/bun": "latest",
20
23
  "tsdown": "latest"