optimus-tool-call-staging 0.2.10 → 0.2.11
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/lib/tofu.d.ts +4 -2
- package/dist/lib/tofu.d.ts.map +1 -1
- package/dist/lib/tofu.js +16 -11
- package/dist/lib/tofu.js.map +1 -1
- package/package.json +1 -1
package/dist/lib/tofu.d.ts
CHANGED
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
* Tofu shim — centralises all imports from optimus-tofu-staging.
|
|
3
3
|
*
|
|
4
4
|
* Reads ~/opt-ai-sec/management/optimus_dev.env at startup:
|
|
5
|
-
* -
|
|
6
|
-
* -
|
|
5
|
+
* - No file / unreadable → staging (ignores OPTIMUS_ENVIRONMENT).
|
|
6
|
+
* - File present → environment= line in file, then OPTIMUS_ENVIRONMENT, then staging.
|
|
7
|
+
* - environment=development → loads local dist (file-relative path)
|
|
8
|
+
* - anything else → loads the published npm package
|
|
7
9
|
*
|
|
8
10
|
* All other source files import from this module, never directly from
|
|
9
11
|
* "optimus-tofu-staging", so the conditional lives in exactly one place.
|
package/dist/lib/tofu.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tofu.d.ts","sourceRoot":"","sources":["../../src/lib/tofu.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"tofu.d.ts","sourceRoot":"","sources":["../../src/lib/tofu.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAMH,OAAO,KAAK,KAAK,SAAS,MAAM,sBAAsB,CAAC;AAiCvD,eAAO,MACL,gBAAgB,qCAChB,uBAAuB,4CACvB,eAAe,oCACf,cAAc,mCACd,iBAAiB,sCACjB,oBAAoB,yCACpB,iBAAiB,sCACjB,mBAAmB,wCACnB,cAAc,iCACR,CAAC;AAET,YAAY,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC"}
|
package/dist/lib/tofu.js
CHANGED
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
* Tofu shim — centralises all imports from optimus-tofu-staging.
|
|
3
3
|
*
|
|
4
4
|
* Reads ~/opt-ai-sec/management/optimus_dev.env at startup:
|
|
5
|
-
* -
|
|
6
|
-
* -
|
|
5
|
+
* - No file / unreadable → staging (ignores OPTIMUS_ENVIRONMENT).
|
|
6
|
+
* - File present → environment= line in file, then OPTIMUS_ENVIRONMENT, then staging.
|
|
7
|
+
* - environment=development → loads local dist (file-relative path)
|
|
8
|
+
* - anything else → loads the published npm package
|
|
7
9
|
*
|
|
8
10
|
* All other source files import from this module, never directly from
|
|
9
11
|
* "optimus-tofu-staging", so the conditional lives in exactly one place.
|
|
@@ -13,19 +15,22 @@ import { homedir } from "os";
|
|
|
13
15
|
import path from "path";
|
|
14
16
|
import { fileURLToPath } from "url";
|
|
15
17
|
function readEnvironment() {
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
return fromEnv;
|
|
18
|
+
const envPath = path.join(homedir(), "opt-ai-sec", "management", "optimus_dev.env");
|
|
19
|
+
let content;
|
|
19
20
|
try {
|
|
20
|
-
|
|
21
|
-
const match = content.match(/^(?:environment|ENVIRONMENT|OPTIMUS_ENVIRONMENT)\s*=\s*(.+)/m);
|
|
22
|
-
if (match)
|
|
23
|
-
return match[1].trim().toLowerCase();
|
|
21
|
+
content = readFileSync(envPath, "utf8");
|
|
24
22
|
}
|
|
25
23
|
catch {
|
|
26
|
-
// file
|
|
24
|
+
// No management file: this staging package defaults to staging (promotion rewrites to production).
|
|
25
|
+
return "staging";
|
|
27
26
|
}
|
|
28
|
-
|
|
27
|
+
const match = content.match(/^(?:environment|ENVIRONMENT|OPTIMUS_ENVIRONMENT)\s*=\s*(.+)/m);
|
|
28
|
+
if (match)
|
|
29
|
+
return match[1].trim().toLowerCase();
|
|
30
|
+
const fromEnv = process.env.OPTIMUS_ENVIRONMENT?.trim().toLowerCase();
|
|
31
|
+
if (fromEnv)
|
|
32
|
+
return fromEnv;
|
|
33
|
+
return "staging";
|
|
29
34
|
}
|
|
30
35
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
31
36
|
const isDevelopment = readEnvironment() === "development";
|
package/dist/lib/tofu.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tofu.js","sourceRoot":"","sources":["../../src/lib/tofu.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"tofu.js","sourceRoot":"","sources":["../../src/lib/tofu.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAC7B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAGpC,SAAS,eAAe;IACtB,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,YAAY,EAAE,YAAY,EAAE,iBAAiB,CAAC,CAAC;IACpF,IAAI,OAAe,CAAC;IACpB,IAAI,CAAC;QACH,OAAO,GAAG,YAAY,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAC1C,CAAC;IAAC,MAAM,CAAC;QACP,mGAAmG;QACnG,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CACzB,8DAA8D,CAC/D,CAAC;IACF,IAAI,KAAK;QAAE,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAChD,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IACtE,IAAI,OAAO;QAAE,OAAO,OAAO,CAAC;IAC5B,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,C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