optimus-tool-call-staging 0.2.11 → 0.2.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.
|
@@ -3,12 +3,18 @@ import assert from "node:assert";
|
|
|
3
3
|
import fs from "node:fs";
|
|
4
4
|
import os from "node:os";
|
|
5
5
|
import path from "node:path";
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
// Resolve workspace optimus-tofu — lib re-export may load npm when management env ≠ development.
|
|
7
|
+
import { loadEndpointBase } from "../../../optimus-tofu/dist/endpoint-config.js";
|
|
8
|
+
test("loadEndpointBase - uses default when no env and no management file", () => {
|
|
8
9
|
const root = fs.mkdtempSync(path.join(os.tmpdir(), "optimus-tool-call-default-"));
|
|
9
|
-
const
|
|
10
|
+
const fakeHome = fs.mkdtempSync(path.join(os.tmpdir(), "optimus-tool-call-home-empty-"));
|
|
11
|
+
const base = loadEndpointBase({
|
|
12
|
+
cwd: root,
|
|
13
|
+
env: { HOME: fakeHome },
|
|
14
|
+
});
|
|
10
15
|
assert.strictEqual(base, "https://demo.optimuslabs.io/");
|
|
11
16
|
fs.rmSync(root, { recursive: true, force: true });
|
|
17
|
+
fs.rmSync(fakeHome, { recursive: true, force: true });
|
|
12
18
|
});
|
|
13
19
|
test("loadEndpointBase - OPTIMUS_ENDPOINT env overrides file/default", () => {
|
|
14
20
|
const root = fs.mkdtempSync(path.join(os.tmpdir(), "optimus-tool-call-endpoint-env-"));
|
|
@@ -31,13 +37,21 @@ test("loadEndpointBase - OPTIMUS_API_URL env takes precedence", () => {
|
|
|
31
37
|
assert.strictEqual(base, "http://localhost:8080/");
|
|
32
38
|
fs.rmSync(root, { recursive: true, force: true });
|
|
33
39
|
});
|
|
34
|
-
test("loadEndpointBase - reads OPTIMUS_ENDPOINT from optimus_dev.env
|
|
40
|
+
test("loadEndpointBase - reads OPTIMUS_ENDPOINT from management optimus_dev.env (not cwd)", () => {
|
|
35
41
|
const root = fs.mkdtempSync(path.join(os.tmpdir(), "optimus-tool-call-env-file-"));
|
|
42
|
+
const fakeHome = fs.mkdtempSync(path.join(os.tmpdir(), "optimus-tool-call-home-"));
|
|
43
|
+
const mgmt = path.join(fakeHome, "opt-ai-sec", "management");
|
|
44
|
+
fs.mkdirSync(mgmt, { recursive: true });
|
|
45
|
+
fs.writeFileSync(path.join(mgmt, "optimus_dev.env"), "OPTIMUS_ENDPOINT=https://demo.optimuslabs.io\n");
|
|
36
46
|
const nested = path.join(root, "a", "b", "c");
|
|
37
47
|
fs.mkdirSync(nested, { recursive: true });
|
|
38
|
-
fs.writeFileSync(path.join(root, "optimus_dev.env"), "OPTIMUS_ENDPOINT=https://
|
|
39
|
-
const base = loadEndpointBase({
|
|
48
|
+
fs.writeFileSync(path.join(root, "optimus_dev.env"), "OPTIMUS_ENDPOINT=https://wrong-from-cwd.example/\n");
|
|
49
|
+
const base = loadEndpointBase({
|
|
50
|
+
cwd: nested,
|
|
51
|
+
env: { HOME: fakeHome },
|
|
52
|
+
});
|
|
40
53
|
assert.strictEqual(base, "https://demo.optimuslabs.io/");
|
|
41
54
|
fs.rmSync(root, { recursive: true, force: true });
|
|
55
|
+
fs.rmSync(fakeHome, { recursive: true, force: true });
|
|
42
56
|
});
|
|
43
57
|
//# sourceMappingURL=endpoint-config.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"endpoint-config.test.js","sourceRoot":"","sources":["../../src/test/endpoint-config.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"endpoint-config.test.js","sourceRoot":"","sources":["../../src/test/endpoint-config.test.ts"],"names":[],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I,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACxC,EAAE,CAAC,aAAa,CACd,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,iBAAiB,CAAC,EAClC,gDAAgD,CACjD,CAAC;IACF,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;IAC9C,EAAE,CAAC,SAAS,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC1C,EAAE,CAAC,aAAa,CACd,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,iBAAiB,CAAC,EAClC,oDAAoD,CACrD,CAAC;IAEF,MAAM,IAAI,GAAG,gBAAgB,CAAC;QAC5B,GAAG,EAAE,MAAM;QACX,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;KACxB,CAAC,CAAC;IACH,MAAM,CAAC,WAAW,CAAC,IAAI,EAAE,8BAA8B,CAAC,CAAC;IACzD,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IAClD,EAAE,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AACxD,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "optimus-tool-call-staging",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.12",
|
|
4
4
|
"description": "Agentic audit sensor — streams raw tool call metadata; the Optimus backend classifies on ingest",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
"scripts": {
|
|
12
12
|
"build": "rm -rf dist && tsc && node ../../scripts/ensure-bin-executable.mjs",
|
|
13
13
|
"dev": "tsx src/index.ts",
|
|
14
|
+
"pretest": "npm run build --prefix ../optimus-tofu && npm run build",
|
|
14
15
|
"test": "node --test dist/test/*.test.js",
|
|
15
16
|
"prepare": "npm run build"
|
|
16
17
|
},
|
|
@@ -45,6 +46,6 @@
|
|
|
45
46
|
"typescript": "^5.0.0"
|
|
46
47
|
},
|
|
47
48
|
"dependencies": {
|
|
48
|
-
"optimus-tofu-staging": "
|
|
49
|
+
"optimus-tofu-staging": "^0.1.14"
|
|
49
50
|
}
|
|
50
51
|
}
|