@locusai/sdk 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/dist/index-node.js +4 -20
- package/dist/orchestrator.d.ts +0 -4
- package/dist/orchestrator.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/index-node.js
CHANGED
|
@@ -1317,10 +1317,9 @@ module.exports = __toCommonJS(exports_index_node);
|
|
|
1317
1317
|
var import_node_child_process2 = require("node:child_process");
|
|
1318
1318
|
var import_node_fs4 = require("node:fs");
|
|
1319
1319
|
var import_node_path4 = require("node:path");
|
|
1320
|
+
var import_node_url = require("node:url");
|
|
1320
1321
|
var import_shared3 = require("@locusai/shared");
|
|
1321
1322
|
var import_events3 = require("events");
|
|
1322
|
-
var __dirname = "/home/runner/work/locusai/locusai/packages/sdk/src";
|
|
1323
|
-
|
|
1324
1323
|
class AgentOrchestrator extends import_events3.EventEmitter {
|
|
1325
1324
|
client;
|
|
1326
1325
|
config;
|
|
@@ -1398,16 +1397,6 @@ ${c.primary("\uD83E\uDD16 Locus Agent Orchestrator")}`);
|
|
|
1398
1397
|
console.log(`
|
|
1399
1398
|
${c.success("✅ Orchestrator finished")}`);
|
|
1400
1399
|
}
|
|
1401
|
-
findPackageRoot(startPath) {
|
|
1402
|
-
let currentDir = startPath;
|
|
1403
|
-
while (currentDir !== "/") {
|
|
1404
|
-
if (import_node_fs4.existsSync(import_node_path4.join(currentDir, "package.json"))) {
|
|
1405
|
-
return currentDir;
|
|
1406
|
-
}
|
|
1407
|
-
currentDir = import_node_path4.dirname(currentDir);
|
|
1408
|
-
}
|
|
1409
|
-
return startPath;
|
|
1410
|
-
}
|
|
1411
1400
|
async spawnAgent() {
|
|
1412
1401
|
const agentId = `agent-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;
|
|
1413
1402
|
const agentState = {
|
|
@@ -1422,14 +1411,9 @@ ${c.success("✅ Orchestrator finished")}`);
|
|
|
1422
1411
|
console.log(`${c.primary("\uD83D\uDE80 Agent started:")} ${c.bold(agentId)}
|
|
1423
1412
|
`);
|
|
1424
1413
|
const potentialPaths = [];
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
const sdkRoot = this.findPackageRoot(sdkDir);
|
|
1429
|
-
potentialPaths.push(import_node_path4.join(sdkRoot, "dist", "agent", "worker.js"), import_node_path4.join(sdkRoot, "src", "agent", "worker.ts"));
|
|
1430
|
-
} catch {}
|
|
1431
|
-
const packageRoot = this.findPackageRoot(__dirname);
|
|
1432
|
-
potentialPaths.push(import_node_path4.join(packageRoot, "dist", "agent", "worker.js"), import_node_path4.join(packageRoot, "src", "agent", "worker.ts"), import_node_path4.join(__dirname, "agent", "worker.ts"), import_node_path4.join(__dirname, "agent", "worker.js"));
|
|
1414
|
+
const currentModulePath = import_node_url.fileURLToPath("file:///home/runner/work/locusai/locusai/packages/sdk/src/orchestrator.ts");
|
|
1415
|
+
const currentModuleDir = import_node_path4.dirname(currentModulePath);
|
|
1416
|
+
potentialPaths.push(import_node_path4.join(currentModuleDir, "agent", "worker.js"), import_node_path4.join(currentModuleDir, "worker.js"));
|
|
1433
1417
|
const workerPath = potentialPaths.find((p) => import_node_fs4.existsSync(p));
|
|
1434
1418
|
if (!workerPath) {
|
|
1435
1419
|
throw new Error(`Worker file not found. Checked: ${potentialPaths.join(", ")}. ` + `Make sure the SDK is properly built and installed.`);
|
package/dist/orchestrator.d.ts
CHANGED
|
@@ -44,10 +44,6 @@ export declare class AgentOrchestrator extends EventEmitter {
|
|
|
44
44
|
* Main orchestration loop - runs 1 agent continuously
|
|
45
45
|
*/
|
|
46
46
|
private orchestrationLoop;
|
|
47
|
-
/**
|
|
48
|
-
* Find the package root by looking for package.json
|
|
49
|
-
*/
|
|
50
|
-
private findPackageRoot;
|
|
51
47
|
/**
|
|
52
48
|
* Spawn a single agent process
|
|
53
49
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrator.d.ts","sourceRoot":"","sources":["../src/orchestrator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAS,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"orchestrator.d.ts","sourceRoot":"","sources":["../src/orchestrator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAS,MAAM,oBAAoB,CAAC;AAIzD,OAAO,EAAE,IAAI,EAA4B,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAItC,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAC;IACpD,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,YAAY,CAAC;CACxB;AAED,MAAM,WAAW,kBAAkB;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,qBAAa,iBAAkB,SAAQ,YAAY;IACjD,OAAO,CAAC,MAAM,CAAc;IAC5B,OAAO,CAAC,MAAM,CAAqB;IACnC,OAAO,CAAC,MAAM,CAAsC;IACpD,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,cAAc,CAA0B;IAChD,OAAO,CAAC,gBAAgB,CAAuB;gBAEnC,MAAM,EAAE,kBAAkB;IAStC;;OAEG;YACW,eAAe;IAwB7B;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAkB5B;;OAEG;YACW,iBAAiB;IA4C/B;;OAEG;YACW,UAAU;IAiHxB;;OAEG;YACW,UAAU;IAKxB;;OAEG;YACW,iBAAiB;IAc/B;;OAEG;IACG,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;IA2C9D;;OAEG;IACG,YAAY,CAChB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,IAAI,CAAC;IA4BhB;;OAEG;IACG,QAAQ,CACZ,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,IAAI,CAAC;IAyBhB;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAM3B;;OAEG;YACW,OAAO;IAWrB;;OAEG;IACH,QAAQ;;;;;;IAeR,OAAO,CAAC,KAAK;CAGd"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@locusai/sdk",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.12",
|
|
4
4
|
"main": "./src/index.ts",
|
|
5
5
|
"types": "./src/index.ts",
|
|
6
6
|
"exports": {
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@anthropic-ai/sdk": "^0.71.2",
|
|
32
|
-
"@locusai/shared": "^0.4.
|
|
32
|
+
"@locusai/shared": "^0.4.12",
|
|
33
33
|
"axios": "^1.13.2",
|
|
34
34
|
"events": "^3.3.0",
|
|
35
35
|
"globby": "^14.0.2"
|