meetsoma 0.4.0 → 0.6.0
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/dist/thin-cli.js +119 -19
- package/package.json +46 -42
package/dist/thin-cli.js
CHANGED
|
@@ -213,7 +213,7 @@ import { join as join3, dirname as dirname3 } from "path";
|
|
|
213
213
|
import { homedir as homedir3, platform as platform2 } from "os";
|
|
214
214
|
import { fileURLToPath } from "url";
|
|
215
215
|
import { execSync as execSync2, execFileSync } from "child_process";
|
|
216
|
-
import { randomBytes } from "crypto";
|
|
216
|
+
import { randomBytes, createHash } from "crypto";
|
|
217
217
|
|
|
218
218
|
// personality.js
|
|
219
219
|
var _state = {
|
|
@@ -1653,20 +1653,42 @@ async function healthCheck() {
|
|
|
1653
1653
|
if (existsSync3(pkgPath)) {
|
|
1654
1654
|
const pkg = JSON.parse(readFileSync3(pkgPath, "utf-8"));
|
|
1655
1655
|
const declaredPi = (pkg.dependencies || {})["@mariozechner/pi-coding-agent"];
|
|
1656
|
-
const
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1656
|
+
const declaredClean = (declaredPi || "").replace(/^[\^~]/, "");
|
|
1657
|
+
let bundledPi = null;
|
|
1658
|
+
let bundledSource = null;
|
|
1659
|
+
const manifestPath = join3(CORE_DIR, "dist", "manifest.json");
|
|
1660
|
+
if (existsSync3(manifestPath)) {
|
|
1661
|
+
try {
|
|
1662
|
+
const m = JSON.parse(readFileSync3(manifestPath, "utf-8"));
|
|
1663
|
+
if (m.piVersion) {
|
|
1664
|
+
bundledPi = m.piVersion;
|
|
1665
|
+
bundledSource = "dist/manifest.json";
|
|
1666
|
+
}
|
|
1667
|
+
} catch {
|
|
1666
1668
|
}
|
|
1667
|
-
}
|
|
1668
|
-
|
|
1669
|
+
}
|
|
1670
|
+
let fallbackUsed = false;
|
|
1671
|
+
if (!bundledPi) {
|
|
1672
|
+
const piPkgPath = join3(CORE_DIR, "node_modules", "@mariozechner", "pi-coding-agent", "package.json");
|
|
1673
|
+
if (existsSync3(piPkgPath)) {
|
|
1674
|
+
try {
|
|
1675
|
+
bundledPi = JSON.parse(readFileSync3(piPkgPath, "utf-8")).version;
|
|
1676
|
+
bundledSource = "node_modules (fallback \u2014 dist/manifest.json missing)";
|
|
1677
|
+
fallbackUsed = true;
|
|
1678
|
+
} catch {
|
|
1679
|
+
}
|
|
1680
|
+
}
|
|
1681
|
+
}
|
|
1682
|
+
if (!bundledPi) {
|
|
1683
|
+
console.log(` ${yellow("\u26A0")} Pi not found \u2014 run ${green("soma update")}`);
|
|
1684
|
+
warnings++;
|
|
1685
|
+
} else if (declaredClean && declaredClean !== bundledPi) {
|
|
1686
|
+
console.log(` ${yellow("\u26A0")} Pi runtime drift: declared ${cyan(declaredClean)}, bundled ${cyan(bundledPi)}`);
|
|
1687
|
+
console.log(` ${dim("Fix:")} ${green("soma update")}${fallbackUsed ? dim(" (also rebuild dist: node scripts/build-dist.mjs --clean)") : ""}`);
|
|
1669
1688
|
warnings++;
|
|
1689
|
+
} else {
|
|
1690
|
+
const suffix = fallbackUsed ? dim(" (via node_modules fallback)") : "";
|
|
1691
|
+
console.log(` ${green("\u2713")} Pi runtime ${bundledPi}${suffix}`);
|
|
1670
1692
|
}
|
|
1671
1693
|
}
|
|
1672
1694
|
} catch {
|
|
@@ -1710,7 +1732,7 @@ async function projectDoctor() {
|
|
|
1710
1732
|
}
|
|
1711
1733
|
printSigma();
|
|
1712
1734
|
const agentV = getAgentVersion();
|
|
1713
|
-
|
|
1735
|
+
let projectV = getProjectVersion();
|
|
1714
1736
|
const installed = isInstalled();
|
|
1715
1737
|
console.log(` ${bold("Soma")} \u2014 Doctor`);
|
|
1716
1738
|
console.log("");
|
|
@@ -1733,11 +1755,29 @@ async function projectDoctor() {
|
|
|
1733
1755
|
return;
|
|
1734
1756
|
}
|
|
1735
1757
|
if (!projectV) {
|
|
1736
|
-
console.log(` ${yellow("\u26A0")} Project .soma/ has no version (pre-versioning)
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1758
|
+
console.log(` ${yellow("\u26A0")} Project .soma/ has no version (pre-versioning). Stamping...`);
|
|
1759
|
+
try {
|
|
1760
|
+
const settingsPath = join3(process.cwd(), ".soma", "settings.json");
|
|
1761
|
+
let cfg = {};
|
|
1762
|
+
if (existsSync3(settingsPath)) {
|
|
1763
|
+
try {
|
|
1764
|
+
cfg = JSON.parse(readFileSync3(settingsPath, "utf8"));
|
|
1765
|
+
} catch {
|
|
1766
|
+
}
|
|
1767
|
+
} else {
|
|
1768
|
+
mkdirSync2(dirname3(settingsPath), { recursive: true });
|
|
1769
|
+
}
|
|
1770
|
+
cfg.version = agentV;
|
|
1771
|
+
writeFileSync2(settingsPath, JSON.stringify(cfg, null, 2) + "\n");
|
|
1772
|
+
console.log(` ${green("\u2713")} Stamped .soma/settings.json \u2192 v${agentV}`);
|
|
1773
|
+
console.log("");
|
|
1774
|
+
projectV = agentV;
|
|
1775
|
+
} catch (e) {
|
|
1776
|
+
console.log(` ${red("\u2717")} Failed to stamp settings.json: ${e.message}`);
|
|
1777
|
+
console.log(` Run ${green("soma init")} to scaffold a fresh .soma/settings.json.`);
|
|
1778
|
+
console.log("");
|
|
1779
|
+
return;
|
|
1780
|
+
}
|
|
1741
1781
|
}
|
|
1742
1782
|
try {
|
|
1743
1783
|
const softSomaDir = join3(process.cwd(), ".soma");
|
|
@@ -1840,6 +1880,66 @@ async function projectDoctor() {
|
|
|
1840
1880
|
}
|
|
1841
1881
|
} catch {
|
|
1842
1882
|
}
|
|
1883
|
+
try {
|
|
1884
|
+
const softSomaDir = join3(process.cwd(), ".soma");
|
|
1885
|
+
if (existsSync3(softSomaDir)) {
|
|
1886
|
+
const templateRoots = [CORE_DIR, join3(CORE_DIR, "dist")];
|
|
1887
|
+
try {
|
|
1888
|
+
const devCore = readlinkSync2(join3(CORE_DIR, "core"));
|
|
1889
|
+
if (devCore) {
|
|
1890
|
+
const devRoot = dirname3(devCore);
|
|
1891
|
+
templateRoots.push(devRoot, join3(devRoot, "dist"));
|
|
1892
|
+
}
|
|
1893
|
+
} catch {
|
|
1894
|
+
}
|
|
1895
|
+
let registry = null;
|
|
1896
|
+
let bundledTemplatesDir = null;
|
|
1897
|
+
for (const root of templateRoots) {
|
|
1898
|
+
const regPath = join3(root, "migrations", "template-hashes.json");
|
|
1899
|
+
if (existsSync3(regPath) && !registry) {
|
|
1900
|
+
try {
|
|
1901
|
+
registry = JSON.parse(readFileSync3(regPath, "utf-8"));
|
|
1902
|
+
} catch {
|
|
1903
|
+
}
|
|
1904
|
+
}
|
|
1905
|
+
const td = join3(root, "templates", "default");
|
|
1906
|
+
if (existsSync3(td) && !bundledTemplatesDir) bundledTemplatesDir = td;
|
|
1907
|
+
}
|
|
1908
|
+
if (registry?.templates && bundledTemplatesDir) {
|
|
1909
|
+
const sha256 = (buf) => createHash("sha256").update(buf).digest("hex");
|
|
1910
|
+
let refreshed = 0;
|
|
1911
|
+
let customized = 0;
|
|
1912
|
+
const customizedFiles = [];
|
|
1913
|
+
for (const [filename, meta] of Object.entries(registry.templates)) {
|
|
1914
|
+
const localPath = join3(softSomaDir, "body", filename);
|
|
1915
|
+
const bundledPath = join3(bundledTemplatesDir, filename);
|
|
1916
|
+
if (!existsSync3(localPath) || !existsSync3(bundledPath)) continue;
|
|
1917
|
+
const localContent = readFileSync3(localPath);
|
|
1918
|
+
const bundledContent = readFileSync3(bundledPath);
|
|
1919
|
+
const localHash = sha256(localContent);
|
|
1920
|
+
const bundledHash = sha256(bundledContent);
|
|
1921
|
+
if (localHash === bundledHash) continue;
|
|
1922
|
+
const historical = (meta.historical || []).map((h) => h.sha256);
|
|
1923
|
+
if (historical.includes(localHash)) {
|
|
1924
|
+
writeFileSync2(localPath, bundledContent);
|
|
1925
|
+
console.log(` ${green("\u2713")} Refreshed body/${filename} (pristine older bundled \u2192 current)`);
|
|
1926
|
+
refreshed++;
|
|
1927
|
+
} else {
|
|
1928
|
+
customized++;
|
|
1929
|
+
customizedFiles.push(filename);
|
|
1930
|
+
}
|
|
1931
|
+
}
|
|
1932
|
+
if (refreshed > 0) console.log("");
|
|
1933
|
+
if (customized > 0) {
|
|
1934
|
+
console.log(` ${yellow("\u26A0")} Customized body files with bundled updates available: ${customizedFiles.join(", ")}`);
|
|
1935
|
+
console.log(` ${dim("Review updates: diff body/<file> vs " + bundledTemplatesDir + "/<file>")}`);
|
|
1936
|
+
console.log(` ${dim("To adopt bundled: rm body/<file> && soma init --force (safe \u2014 writeIfMissing preserves others)")}`);
|
|
1937
|
+
console.log("");
|
|
1938
|
+
}
|
|
1939
|
+
}
|
|
1940
|
+
}
|
|
1941
|
+
} catch {
|
|
1942
|
+
}
|
|
1843
1943
|
if (agentV && semverCmp2(projectV, agentV) === 0) {
|
|
1844
1944
|
console.log(` ${green("\u2713")} Project is up to date.`);
|
|
1845
1945
|
console.log("");
|
package/package.json
CHANGED
|
@@ -1,44 +1,48 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
2
|
+
"name": "meetsoma",
|
|
3
|
+
"version": "0.6.0",
|
|
4
|
+
"description": "Soma — the AI coding agent with self-growing memory",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"soma": "dist/thin-cli.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"dist/thin-cli.js",
|
|
11
|
+
"dist/personality.js",
|
|
12
|
+
"dist/postinstall.js",
|
|
13
|
+
"LICENSE",
|
|
14
|
+
"README.md",
|
|
15
|
+
"CHANGELOG.md"
|
|
16
|
+
],
|
|
17
|
+
"keywords": [
|
|
18
|
+
"soma",
|
|
19
|
+
"meetsoma",
|
|
20
|
+
"ai",
|
|
21
|
+
"agent",
|
|
22
|
+
"memory",
|
|
23
|
+
"coding-agent",
|
|
24
|
+
"identity",
|
|
25
|
+
"muscles",
|
|
26
|
+
"protocols",
|
|
27
|
+
"self-evolving",
|
|
28
|
+
"cli",
|
|
29
|
+
"llm"
|
|
30
|
+
],
|
|
31
|
+
"author": "Gravicity <hello@gravicity.ai>",
|
|
32
|
+
"license": "BSL-1.1",
|
|
33
|
+
"homepage": "https://soma.gravicity.ai",
|
|
34
|
+
"repository": {
|
|
35
|
+
"type": "git",
|
|
36
|
+
"url": "git+https://github.com/meetsoma/soma-agent.git"
|
|
37
|
+
},
|
|
38
|
+
"scripts": {
|
|
39
|
+
"postinstall": "node dist/postinstall.js"
|
|
40
|
+
},
|
|
41
|
+
"engines": {
|
|
42
|
+
"node": ">=20.6.0"
|
|
43
|
+
},
|
|
44
|
+
"piConfig": {
|
|
45
|
+
"name": "soma",
|
|
46
|
+
"configDir": ".soma"
|
|
47
|
+
}
|
|
44
48
|
}
|