optimus-tool-call 0.1.11 → 0.1.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.js
CHANGED
|
File without changes
|
|
@@ -1,12 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* Endpoint resolution order:
|
|
3
|
-
* 1) OPTIMUS_API_URL (legacy optimus-tool-call override)
|
|
4
|
-
* 2) OPTIMUS_ENDPOINT (shared with log-llm-config)
|
|
5
|
-
* 3) optimus_dev.env upward search (OPTIMUS_ENDPOINT)
|
|
6
|
-
* 4) default https://demo.optimuslabs.io/
|
|
7
|
-
*/
|
|
8
|
-
export declare function loadEndpointBase(options?: {
|
|
9
|
-
cwd?: string;
|
|
10
|
-
env?: NodeJS.ProcessEnv;
|
|
11
|
-
}): string;
|
|
1
|
+
export { loadEndpointBase } from "optimus-tofu";
|
|
12
2
|
//# sourceMappingURL=endpoint-config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"endpoint-config.d.ts","sourceRoot":"","sources":["../../src/lib/endpoint-config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"endpoint-config.d.ts","sourceRoot":"","sources":["../../src/lib/endpoint-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -1,66 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import path from "node:path";
|
|
3
|
-
const DEFAULT_ENDPOINT = "https://demo.optimuslabs.io/";
|
|
4
|
-
function normalizeBaseUrl(value) {
|
|
5
|
-
return value.replace(/\/+$/, "") + "/";
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Walk up from `dir` looking for `optimus_dev.env`, stopping at filesystem root.
|
|
9
|
-
*/
|
|
10
|
-
function findEnvFileUpward(dir) {
|
|
11
|
-
let current = dir;
|
|
12
|
-
while (true) {
|
|
13
|
-
const candidate = path.join(current, "optimus_dev.env");
|
|
14
|
-
if (existsSync(candidate))
|
|
15
|
-
return candidate;
|
|
16
|
-
const parent = path.dirname(current);
|
|
17
|
-
if (parent === current)
|
|
18
|
-
return null;
|
|
19
|
-
current = parent;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
function parseEndpointFromFile(filePath) {
|
|
23
|
-
try {
|
|
24
|
-
const envContent = readFileSync(filePath, "utf8");
|
|
25
|
-
for (const line of envContent.split(/\r?\n/)) {
|
|
26
|
-
const trimmed = line.trim();
|
|
27
|
-
if (!trimmed || trimmed.startsWith("#"))
|
|
28
|
-
continue;
|
|
29
|
-
const [key, ...rest] = trimmed.split("=");
|
|
30
|
-
if (key === "OPTIMUS_ENDPOINT") {
|
|
31
|
-
const value = rest.join("=").trim();
|
|
32
|
-
if (value)
|
|
33
|
-
return normalizeBaseUrl(value);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
catch {
|
|
38
|
-
// ignore
|
|
39
|
-
}
|
|
40
|
-
return null;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Endpoint resolution order:
|
|
44
|
-
* 1) OPTIMUS_API_URL (legacy optimus-tool-call override)
|
|
45
|
-
* 2) OPTIMUS_ENDPOINT (shared with log-llm-config)
|
|
46
|
-
* 3) optimus_dev.env upward search (OPTIMUS_ENDPOINT)
|
|
47
|
-
* 4) default https://demo.optimuslabs.io/
|
|
48
|
-
*/
|
|
49
|
-
export function loadEndpointBase(options) {
|
|
50
|
-
const cwd = options?.cwd ?? process.cwd();
|
|
51
|
-
const env = options?.env ?? process.env;
|
|
52
|
-
const fromApiUrl = env.OPTIMUS_API_URL?.trim();
|
|
53
|
-
if (fromApiUrl)
|
|
54
|
-
return normalizeBaseUrl(fromApiUrl);
|
|
55
|
-
const fromEndpoint = env.OPTIMUS_ENDPOINT?.trim();
|
|
56
|
-
if (fromEndpoint)
|
|
57
|
-
return normalizeBaseUrl(fromEndpoint);
|
|
58
|
-
const found = findEnvFileUpward(cwd);
|
|
59
|
-
if (found) {
|
|
60
|
-
const fromFile = parseEndpointFromFile(found);
|
|
61
|
-
if (fromFile)
|
|
62
|
-
return fromFile;
|
|
63
|
-
}
|
|
64
|
-
return DEFAULT_ENDPOINT;
|
|
65
|
-
}
|
|
1
|
+
export { loadEndpointBase } from "optimus-tofu";
|
|
66
2
|
//# sourceMappingURL=endpoint-config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"endpoint-config.js","sourceRoot":"","sources":["../../src/lib/endpoint-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"endpoint-config.js","sourceRoot":"","sources":["../../src/lib/endpoint-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "optimus-tool-call",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.12",
|
|
4
4
|
"description": "Agentic audit sensor — classifies and streams tool call events to Optimus backend",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -26,12 +26,12 @@
|
|
|
26
26
|
"repository": {
|
|
27
27
|
"type": "git",
|
|
28
28
|
"url": "git+https://github.com/optimuslabs-io/optimus-secure-fdn.git",
|
|
29
|
-
"directory": "
|
|
29
|
+
"directory": "dev_npx_packages/optimus-tool-call"
|
|
30
30
|
},
|
|
31
31
|
"bugs": {
|
|
32
32
|
"url": "https://github.com/optimuslabs-io/optimus-secure-fdn/issues"
|
|
33
33
|
},
|
|
34
|
-
"homepage": "https://github.com/optimuslabs-io/optimus-secure-fdn/tree/main/
|
|
34
|
+
"homepage": "https://github.com/optimuslabs-io/optimus-secure-fdn/tree/main/dev_npx_packages/optimus-tool-call#readme",
|
|
35
35
|
"files": [
|
|
36
36
|
"dist/**/*",
|
|
37
37
|
"README.md"
|
|
@@ -43,5 +43,8 @@
|
|
|
43
43
|
"@types/node": "^20.19.39",
|
|
44
44
|
"tsx": "^4.0.0",
|
|
45
45
|
"typescript": "^5.0.0"
|
|
46
|
+
},
|
|
47
|
+
"dependencies": {
|
|
48
|
+
"optimus-tofu": "^0.1.0"
|
|
46
49
|
}
|
|
47
50
|
}
|