symbiot 0.9.2 → 0.9.3
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/index.mjs +7 -3
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -21,7 +21,7 @@ import Anthropic from "@anthropic-ai/sdk";
|
|
|
21
21
|
import { execSync, spawn } from "node:child_process";
|
|
22
22
|
import { homedir, totalmem, cpus as oscpus } from "node:os";
|
|
23
23
|
import { join } from "node:path";
|
|
24
|
-
import { readFileSync, writeFileSync, mkdirSync, existsSync, chmodSync, statSync } from "node:fs";
|
|
24
|
+
import { readFileSync, writeFileSync, mkdirSync, existsSync, chmodSync, statSync, realpathSync } from "node:fs";
|
|
25
25
|
import { createInterface } from "node:readline";
|
|
26
26
|
import { createServer } from "node:http";
|
|
27
27
|
import { randomBytes } from "node:crypto";
|
|
@@ -1308,8 +1308,12 @@ async function main() {
|
|
|
1308
1308
|
}
|
|
1309
1309
|
|
|
1310
1310
|
// Run the CLI only when invoked directly; when imported (e.g. by tests) just
|
|
1311
|
-
// expose the pure functions.
|
|
1312
|
-
|
|
1311
|
+
// expose the pure functions. Compare REAL paths so a global/npx bin symlink
|
|
1312
|
+
// (argv[1] is the symlink, import.meta.url is the real file) still counts.
|
|
1313
|
+
const isMain = (() => {
|
|
1314
|
+
try { return !!process.argv[1] && realpathSync(process.argv[1]) === realpathSync(fileURLToPath(import.meta.url)); }
|
|
1315
|
+
catch { return false; }
|
|
1316
|
+
})();
|
|
1313
1317
|
if (isMain) main();
|
|
1314
1318
|
|
|
1315
1319
|
export { authorship, repoState, readmeInfo, repoShape, houseRules, findAllRepos, buildMap, reportFooter, detectHardware, recommendModels, computeDrift, driftRepo, gitDefaultBranch };
|
package/package.json
CHANGED