akemon 0.3.5 → 0.3.7
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/DATA_POLICY.md +128 -0
- package/README.md +156 -19
- package/TRADEMARK.md +74 -0
- package/dist/akemon-home.js +56 -0
- package/dist/akemon-message.js +107 -0
- package/dist/best-effort.js +8 -0
- package/dist/cli.js +1411 -132
- package/dist/cognitive-artifact-store.js +101 -0
- package/dist/cognitive-event-log.js +47 -0
- package/dist/config.js +45 -9
- package/dist/context.js +27 -6
- package/dist/core/contracts/layers.js +1 -0
- package/dist/core/contracts/permission.js +1 -0
- package/dist/core/contracts/workspace.js +1 -0
- package/dist/core-cognitive-module.js +768 -0
- package/dist/engine-peripheral.js +127 -26
- package/dist/engine-routing.js +58 -17
- package/dist/interactive-session.js +361 -0
- package/dist/local-interconnect.js +156 -0
- package/dist/local-registry.js +178 -0
- package/dist/mcp-server.js +4 -1
- package/dist/memory-proposal.js +379 -0
- package/dist/memory-recorder.js +368 -0
- package/dist/orphan-scan.js +36 -24
- package/dist/passive-reflection-cognitive-module.js +172 -0
- package/dist/peripheral-registry.js +235 -0
- package/dist/permission-audit.js +132 -0
- package/dist/relay-client.js +68 -9
- package/dist/relay-mode.js +34 -0
- package/dist/relay-peripheral.js +139 -49
- package/dist/runtime-platform.js +122 -0
- package/dist/secretariat/client.js +87 -0
- package/dist/self.js +15 -6
- package/dist/server.js +3695 -439
- package/dist/social-discovery.js +231 -0
- package/dist/software-agent-peripheral.js +314 -235
- package/dist/software-agent-result-cli.js +69 -0
- package/dist/software-agent-stream-cli.js +23 -0
- package/dist/software-agent-transport.js +177 -0
- package/dist/task-module.js +243 -0
- package/dist/task-registry.js +756 -0
- package/dist/vendor/xterm/addon-fit.js +2 -0
- package/dist/vendor/xterm/addon-search.js +2 -0
- package/dist/vendor/xterm/addon-web-links.js +2 -0
- package/dist/vendor/xterm/xterm.css +285 -0
- package/dist/vendor/xterm/xterm.js +2 -0
- package/dist/work-memory.js +339 -0
- package/dist/workbench-peripheral-guide.js +79 -0
- package/dist/workbench-session.js +1074 -0
- package/dist/workbench.html +4011 -0
- package/package.json +11 -4
- package/scripts/build.cjs +24 -0
- package/scripts/check-architecture-baseline.cjs +68 -0
- package/scripts/test.cjs +38 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "akemon",
|
|
3
|
-
"version": "0.3.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.3.7",
|
|
4
|
+
"description": "Local AI companion runtime with memory, modules, relay sync, and software-agent control",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -23,15 +23,18 @@
|
|
|
23
23
|
"files": [
|
|
24
24
|
"dist",
|
|
25
25
|
"scripts",
|
|
26
|
+
"DATA_POLICY.md",
|
|
27
|
+
"TRADEMARK.md",
|
|
26
28
|
"README.md"
|
|
27
29
|
],
|
|
28
30
|
"scripts": {
|
|
29
|
-
"build": "
|
|
31
|
+
"build": "node scripts/build.cjs",
|
|
32
|
+
"check:architecture": "node scripts/check-architecture-baseline.cjs",
|
|
30
33
|
"dev": "tsc --watch",
|
|
31
34
|
"start": "node dist/cli.js",
|
|
32
35
|
"postinstall": "node scripts/fix-node-pty.cjs",
|
|
33
36
|
"prepublishOnly": "npm run build",
|
|
34
|
-
"test": "
|
|
37
|
+
"test": "node scripts/test.cjs"
|
|
35
38
|
},
|
|
36
39
|
"dependencies": {
|
|
37
40
|
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
@@ -42,6 +45,10 @@
|
|
|
42
45
|
"devDependencies": {
|
|
43
46
|
"@types/node": "^20.0.0",
|
|
44
47
|
"@types/ws": "^8.18.1",
|
|
48
|
+
"@xterm/addon-fit": "^0.11.0",
|
|
49
|
+
"@xterm/addon-search": "^0.16.0",
|
|
50
|
+
"@xterm/addon-web-links": "^0.12.0",
|
|
51
|
+
"@xterm/xterm": "^6.0.0",
|
|
45
52
|
"typescript": "^5.0.0"
|
|
46
53
|
}
|
|
47
54
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const { cpSync, mkdirSync, rmSync } = require("fs");
|
|
2
|
+
const { spawnSync } = require("child_process");
|
|
3
|
+
|
|
4
|
+
function runNodeScript(script, args = []) {
|
|
5
|
+
const result = spawnSync(process.execPath, [script, ...args], { stdio: "inherit", shell: false });
|
|
6
|
+
if (result.error) {
|
|
7
|
+
console.error(result.error.message);
|
|
8
|
+
process.exit(1);
|
|
9
|
+
}
|
|
10
|
+
if (typeof result.status === "number" && result.status !== 0) {
|
|
11
|
+
process.exit(result.status);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
rmSync("dist", { recursive: true, force: true });
|
|
16
|
+
runNodeScript(require.resolve("typescript/bin/tsc"));
|
|
17
|
+
cpSync("src/live.html", "dist/live.html");
|
|
18
|
+
cpSync("src/workbench.html", "dist/workbench.html");
|
|
19
|
+
mkdirSync("dist/vendor/xterm", { recursive: true });
|
|
20
|
+
cpSync("node_modules/@xterm/xterm/lib/xterm.js", "dist/vendor/xterm/xterm.js");
|
|
21
|
+
cpSync("node_modules/@xterm/xterm/css/xterm.css", "dist/vendor/xterm/xterm.css");
|
|
22
|
+
cpSync("node_modules/@xterm/addon-fit/lib/addon-fit.js", "dist/vendor/xterm/addon-fit.js");
|
|
23
|
+
cpSync("node_modules/@xterm/addon-web-links/lib/addon-web-links.js", "dist/vendor/xterm/addon-web-links.js");
|
|
24
|
+
cpSync("node_modules/@xterm/addon-search/lib/addon-search.js", "dist/vendor/xterm/addon-search.js");
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { readFileSync, readdirSync, statSync } = require("fs");
|
|
4
|
+
const { join, relative } = require("path");
|
|
5
|
+
|
|
6
|
+
const root = process.cwd();
|
|
7
|
+
const srcDir = join(root, "src");
|
|
8
|
+
|
|
9
|
+
const platformPatterns = [
|
|
10
|
+
/from\s+["'](?:node:)?child_process["']/,
|
|
11
|
+
/from\s+["']node-pty["']/,
|
|
12
|
+
/import\(["']node-pty["']\)/,
|
|
13
|
+
/process\.kill\s*\(/,
|
|
14
|
+
/process\.platform\b/,
|
|
15
|
+
];
|
|
16
|
+
|
|
17
|
+
const crossLayerPatterns = [
|
|
18
|
+
/from\s+["']\.\/relay-client\.js["']/,
|
|
19
|
+
/from\s+["']\.\/software-agent-peripheral\.js["']/,
|
|
20
|
+
];
|
|
21
|
+
|
|
22
|
+
function walk(dir, files = []) {
|
|
23
|
+
for (const entry of readdirSync(dir)) {
|
|
24
|
+
const path = join(dir, entry);
|
|
25
|
+
const stat = statSync(path);
|
|
26
|
+
if (stat.isDirectory()) {
|
|
27
|
+
if (entry === "node_modules" || entry === "dist") continue;
|
|
28
|
+
walk(path, files);
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
if (path.endsWith(".ts") && !path.endsWith(".test.ts")) files.push(path);
|
|
32
|
+
}
|
|
33
|
+
return files;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function countMatches(files, patterns) {
|
|
37
|
+
const matches = [];
|
|
38
|
+
for (const file of files) {
|
|
39
|
+
const text = readFileSync(file, "utf8");
|
|
40
|
+
const lines = text.split(/\r?\n/);
|
|
41
|
+
lines.forEach((line, index) => {
|
|
42
|
+
if (patterns.some((pattern) => pattern.test(line))) {
|
|
43
|
+
matches.push({
|
|
44
|
+
file: relative(root, file),
|
|
45
|
+
line: index + 1,
|
|
46
|
+
text: line.trim(),
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
return matches;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const files = walk(srcDir);
|
|
55
|
+
const platformMatches = countMatches(files, platformPatterns);
|
|
56
|
+
const crossLayerMatches = countMatches(files, crossLayerPatterns);
|
|
57
|
+
|
|
58
|
+
console.log("Architecture baseline");
|
|
59
|
+
console.log(`platform-coupling matches: ${platformMatches.length}`);
|
|
60
|
+
for (const match of platformMatches) {
|
|
61
|
+
console.log(` ${match.file}:${match.line} ${match.text}`);
|
|
62
|
+
}
|
|
63
|
+
console.log(`cross-layer import matches: ${crossLayerMatches.length}`);
|
|
64
|
+
for (const match of crossLayerMatches) {
|
|
65
|
+
console.log(` ${match.file}:${match.line} ${match.text}`);
|
|
66
|
+
}
|
|
67
|
+
console.log("baseline only: this script does not fail yet");
|
|
68
|
+
console.log("planned gate: switch to fail mode after platform-coupling reaches 0 outside runtime/platform and cross-layer imports are either moved or explicitly allowlisted.");
|
package/scripts/test.cjs
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
const { readdirSync, rmSync } = require("fs");
|
|
2
|
+
const { join } = require("path");
|
|
3
|
+
const { spawnSync } = require("child_process");
|
|
4
|
+
|
|
5
|
+
function runNode(args) {
|
|
6
|
+
const result = spawnSync(process.execPath, args, { stdio: "inherit", shell: false });
|
|
7
|
+
if (result.error) {
|
|
8
|
+
console.error(result.error.message);
|
|
9
|
+
process.exit(1);
|
|
10
|
+
}
|
|
11
|
+
if (typeof result.status === "number" && result.status !== 0) {
|
|
12
|
+
process.exit(result.status);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function collectTestFiles(dir) {
|
|
17
|
+
const files = [];
|
|
18
|
+
for (const entry of readdirSync(dir, { withFileTypes: true })) {
|
|
19
|
+
const path = join(dir, entry.name);
|
|
20
|
+
if (entry.isDirectory()) {
|
|
21
|
+
files.push(...collectTestFiles(path));
|
|
22
|
+
} else if (entry.isFile() && entry.name.endsWith(".test.js")) {
|
|
23
|
+
files.push(path);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return files.sort();
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
rmSync("test-dist", { recursive: true, force: true });
|
|
30
|
+
runNode([require.resolve("typescript/bin/tsc"), "-p", "tsconfig.test.json"]);
|
|
31
|
+
|
|
32
|
+
const testFiles = collectTestFiles("test-dist");
|
|
33
|
+
if (testFiles.length === 0) {
|
|
34
|
+
console.error("No compiled test files found under test-dist");
|
|
35
|
+
process.exit(1);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
runNode(["--test", ...testFiles]);
|