@locusai/cli 0.4.10 → 0.4.12
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/bin/agent/worker.js +30687 -0
- package/bin/locus.js +6 -21
- package/package.json +3 -3
package/bin/locus.js
CHANGED
|
@@ -17026,7 +17026,7 @@ var require_follow_redirects = __commonJS((exports, module) => {
|
|
|
17026
17026
|
// src/cli.ts
|
|
17027
17027
|
import { existsSync as existsSync6, readFileSync as readFileSync5 } from "node:fs";
|
|
17028
17028
|
import { dirname as dirname3, join as join6 } from "node:path";
|
|
17029
|
-
import { fileURLToPath as
|
|
17029
|
+
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
17030
17030
|
import { parseArgs } from "node:util";
|
|
17031
17031
|
|
|
17032
17032
|
// ../sdk/src/agent/artifact-syncer.ts
|
|
@@ -30693,8 +30693,8 @@ if (process.argv[1]?.includes("agent-worker") || process.argv[1]?.includes("work
|
|
|
30693
30693
|
import { spawn as spawn2 } from "node:child_process";
|
|
30694
30694
|
import { existsSync as existsSync4 } from "node:fs";
|
|
30695
30695
|
import { dirname as dirname2, join as join4 } from "node:path";
|
|
30696
|
+
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
30696
30697
|
import { EventEmitter as EventEmitter3 } from "events";
|
|
30697
|
-
var __dirname = "/home/runner/work/locusai/locusai/packages/sdk/src";
|
|
30698
30698
|
class AgentOrchestrator extends EventEmitter3 {
|
|
30699
30699
|
client;
|
|
30700
30700
|
config;
|
|
@@ -30772,16 +30772,6 @@ ${c.primary("\uD83E\uDD16 Locus Agent Orchestrator")}`);
|
|
|
30772
30772
|
console.log(`
|
|
30773
30773
|
${c.success("✅ Orchestrator finished")}`);
|
|
30774
30774
|
}
|
|
30775
|
-
findPackageRoot(startPath) {
|
|
30776
|
-
let currentDir = startPath;
|
|
30777
|
-
while (currentDir !== "/") {
|
|
30778
|
-
if (existsSync4(join4(currentDir, "package.json"))) {
|
|
30779
|
-
return currentDir;
|
|
30780
|
-
}
|
|
30781
|
-
currentDir = dirname2(currentDir);
|
|
30782
|
-
}
|
|
30783
|
-
return startPath;
|
|
30784
|
-
}
|
|
30785
30775
|
async spawnAgent() {
|
|
30786
30776
|
const agentId = `agent-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;
|
|
30787
30777
|
const agentState = {
|
|
@@ -30796,14 +30786,9 @@ ${c.success("✅ Orchestrator finished")}`);
|
|
|
30796
30786
|
console.log(`${c.primary("\uD83D\uDE80 Agent started:")} ${c.bold(agentId)}
|
|
30797
30787
|
`);
|
|
30798
30788
|
const potentialPaths = [];
|
|
30799
|
-
|
|
30800
|
-
|
|
30801
|
-
|
|
30802
|
-
const sdkRoot = this.findPackageRoot(sdkDir);
|
|
30803
|
-
potentialPaths.push(join4(sdkRoot, "dist", "agent", "worker.js"), join4(sdkRoot, "src", "agent", "worker.ts"));
|
|
30804
|
-
} catch {}
|
|
30805
|
-
const packageRoot = this.findPackageRoot(__dirname);
|
|
30806
|
-
potentialPaths.push(join4(packageRoot, "dist", "agent", "worker.js"), join4(packageRoot, "src", "agent", "worker.ts"), join4(__dirname, "agent", "worker.ts"), join4(__dirname, "agent", "worker.js"));
|
|
30789
|
+
const currentModulePath = fileURLToPath2(import.meta.url);
|
|
30790
|
+
const currentModuleDir = dirname2(currentModulePath);
|
|
30791
|
+
potentialPaths.push(join4(currentModuleDir, "agent", "worker.js"), join4(currentModuleDir, "worker.js"));
|
|
30807
30792
|
const workerPath = potentialPaths.find((p) => existsSync4(p));
|
|
30808
30793
|
if (!workerPath) {
|
|
30809
30794
|
throw new Error(`Worker file not found. Checked: ${potentialPaths.join(", ")}. ` + `Make sure the SDK is properly built and installed.`);
|
|
@@ -31067,7 +31052,7 @@ ${tree}`;
|
|
|
31067
31052
|
// src/cli.ts
|
|
31068
31053
|
function getVersion() {
|
|
31069
31054
|
try {
|
|
31070
|
-
const __filename2 =
|
|
31055
|
+
const __filename2 = fileURLToPath3(import.meta.url);
|
|
31071
31056
|
const __dirname2 = dirname3(__filename2);
|
|
31072
31057
|
const packagePath = join6(__dirname2, "..", "package.json");
|
|
31073
31058
|
if (existsSync6(packagePath)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@locusai/cli",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.12",
|
|
4
4
|
"description": "Local-first AI development platform & engineering workspace",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
},
|
|
9
9
|
"scripts": {
|
|
10
10
|
"start": "bun lint .",
|
|
11
|
-
"build": "bun build ./index.ts --target=node --outfile=./bin/locus.js",
|
|
11
|
+
"build": "bun build ./index.ts --target=node --outfile=./bin/locus.js && bun build ../sdk/src/agent/worker.ts --target=node --outfile=./bin/agent/worker.js",
|
|
12
12
|
"lint": "biome lint .",
|
|
13
13
|
"format": "biome format --write .",
|
|
14
14
|
"test:local": "bun run build && node ./bin/locus.js",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"author": "",
|
|
32
32
|
"license": "MIT",
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@locusai/sdk": "^0.4.
|
|
34
|
+
"@locusai/sdk": "^0.4.12"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {}
|
|
37
37
|
}
|