@superpms/memory-cli 0.1.1
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 +54 -0
- package/bin/memory.mjs +72 -0
- package/commands/cache.mjs +99 -0
- package/commands/init.mjs +152 -0
- package/commands/login.mjs +84 -0
- package/commands/skill.mjs +112 -0
- package/commands/status.mjs +28 -0
- package/commands/update.mjs +32 -0
- package/commands/vendor.mjs +171 -0
- package/commands/version.mjs +29 -0
- package/commands/will.mjs +270 -0
- package/lib/api-client.mjs +155 -0
- package/lib/credentials.mjs +48 -0
- package/lib/project-store.mjs +44 -0
- package/package.json +28 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
2
|
+
import { join, resolve } from 'node:path';
|
|
3
|
+
|
|
4
|
+
export function findProjectRoot(startDir = process.cwd()) {
|
|
5
|
+
let dir = resolve(startDir);
|
|
6
|
+
while (true) {
|
|
7
|
+
if (existsSync(join(dir, 'memory', 'start.md'))) return dir;
|
|
8
|
+
const parent = resolve(dir, '..');
|
|
9
|
+
if (parent === dir) return null;
|
|
10
|
+
dir = parent;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function getProjectMemoryDir(projectRoot) {
|
|
15
|
+
return join(projectRoot, 'memory');
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function getProjectDotMemory(projectRoot) {
|
|
19
|
+
return join(projectRoot, '.memory');
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function getProjectVendor(projectRoot) {
|
|
23
|
+
return join(projectRoot, 'memory', 'vendor');
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function getProjectWillCurrent(projectRoot) {
|
|
27
|
+
return join(projectRoot, 'memory', 'will', 'current');
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function getProjectRuntime(projectRoot) {
|
|
31
|
+
return join(projectRoot, '.memory', '.project', 'config', 'runtime.md');
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function readProjectName(projectRoot) {
|
|
35
|
+
const readmePath = join(projectRoot, 'README.md');
|
|
36
|
+
if (!existsSync(readmePath)) return null;
|
|
37
|
+
const text = readFileSync(readmePath, 'utf8');
|
|
38
|
+
const match = text.match(/^#\s+(.+)/m);
|
|
39
|
+
return match ? match[1].trim() : null;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function isMemoryProject(dir) {
|
|
43
|
+
return existsSync(join(dir, 'memory', 'start.md'));
|
|
44
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@superpms/memory-cli",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "CLI for memory system — global layer, will sync, vendor updates",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"memory": "./bin/memory.mjs"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"test": "node --test test/*.test.mjs"
|
|
11
|
+
},
|
|
12
|
+
"engines": {
|
|
13
|
+
"node": ">=18"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"bin/",
|
|
17
|
+
"commands/",
|
|
18
|
+
"lib/",
|
|
19
|
+
"README.md"
|
|
20
|
+
],
|
|
21
|
+
"keywords": ["memory", "agent", "will", "cli", "ai", "knowledge-management"],
|
|
22
|
+
"license": "MIT",
|
|
23
|
+
"repository": {
|
|
24
|
+
"type": "git",
|
|
25
|
+
"url": "https://github.com/superpms/memory-cli.git"
|
|
26
|
+
},
|
|
27
|
+
"homepage": "https://github.com/superpms/memory-cli#readme"
|
|
28
|
+
}
|