thronglets 0.4.6 → 0.5.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/README.md CHANGED
@@ -9,16 +9,18 @@ This npm package installs the `thronglets` CLI wrapper and downloads a matching
9
9
  ```bash
10
10
  npm install -g thronglets
11
11
  thronglets version --json
12
- thronglets setup
12
+ thronglets start
13
13
  ```
14
14
 
15
15
  That is the whole local bootstrap path.
16
16
 
17
- `thronglets setup` now:
17
+ `thronglets start` now:
18
18
  - configures known local adapters for Claude Code, Codex, and OpenClaw
19
19
  - runs the same bootstrap health pass used by the machine-facing flow
20
20
  - reports `restart required` and `next steps` directly
21
21
 
22
+ If you invoke `thronglets` from inside a local Thronglets repo checkout, the wrapper now prefers the repo-local source path before it falls back to the installed release binary. That keeps local AI sessions from accidentally using a stale global binary while they work inside the repo.
23
+
22
24
  ## What The Agent Gets
23
25
 
24
26
  Thronglets does not dump a long report into the model context. It emits sparse decision guidance:
package/bin/thronglets.js CHANGED
@@ -18,7 +18,68 @@ if (!binPath) {
18
18
  process.exit(1);
19
19
  }
20
20
 
21
+ function looksLikeRepoRoot(dir) {
22
+ const cargoToml = path.join(dir, "Cargo.toml");
23
+ const mainRs = path.join(dir, "src", "main.rs");
24
+ if (!fs.existsSync(cargoToml) || !fs.existsSync(mainRs)) {
25
+ return false;
26
+ }
27
+ try {
28
+ return fs.readFileSync(cargoToml, "utf8").includes('name = "thronglets"');
29
+ } catch {
30
+ return false;
31
+ }
32
+ }
33
+
34
+ function findRepoRoot() {
35
+ const envRoot = process.env.THRONGLETS_REPO_ROOT;
36
+ if (envRoot && looksLikeRepoRoot(envRoot)) {
37
+ return envRoot;
38
+ }
39
+
40
+ let current = process.cwd();
41
+ while (true) {
42
+ if (looksLikeRepoRoot(current)) {
43
+ return current;
44
+ }
45
+ const parent = path.dirname(current);
46
+ if (parent === current) {
47
+ return null;
48
+ }
49
+ current = parent;
50
+ }
51
+ }
52
+
53
+ function tryRepoLocal(repoRoot) {
54
+ const cargo = process.platform === "win32" ? "cargo.exe" : "cargo";
55
+ const builtBinary =
56
+ process.platform === "win32"
57
+ ? path.join(repoRoot, "target", "debug", "thronglets.exe")
58
+ : path.join(repoRoot, "target", "debug", "thronglets");
59
+
60
+ try {
61
+ execFileSync(cargo, ["run", "--quiet", "--manifest-path", path.join(repoRoot, "Cargo.toml"), "--", ...process.argv.slice(2)], {
62
+ stdio: "inherit",
63
+ });
64
+ return true;
65
+ } catch (err) {
66
+ if (err.code === "ENOENT" && fs.existsSync(builtBinary)) {
67
+ execFileSync(builtBinary, process.argv.slice(2), { stdio: "inherit" });
68
+ return true;
69
+ }
70
+ if (typeof err.status === "number") {
71
+ process.exit(err.status || 1);
72
+ }
73
+ }
74
+
75
+ return false;
76
+ }
77
+
21
78
  try {
79
+ const repoRoot = findRepoRoot();
80
+ if (repoRoot && tryRepoLocal(repoRoot)) {
81
+ process.exit(0);
82
+ }
22
83
  execFileSync(binPath, process.argv.slice(2), { stdio: "inherit" });
23
84
  } catch (err) {
24
85
  process.exit(err.status || 1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "thronglets",
3
- "version": "0.4.6",
3
+ "version": "0.5.0",
4
4
  "description": "Local AI substrate for agents with sparse signals, hooks, and optional adapters",
5
5
  "keywords": [
6
6
  "ai-agents",