@skydiveai/pi-extensions 0.1.0-beta.1146 → 0.1.0-beta.1149
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.mjs +9 -2
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1807,8 +1807,15 @@ const daemonEnvIdentitySchema = z.object({
|
|
|
1807
1807
|
const tokenTypeSchema = z.object({ type: z.string() }).passthrough();
|
|
1808
1808
|
async function isPoolIdentity() {
|
|
1809
1809
|
try {
|
|
1810
|
-
const
|
|
1811
|
-
const
|
|
1810
|
+
const override = process.env.ANYONE_DAEMON_ENV_CACHE;
|
|
1811
|
+
const candidates = override ? [override] : ["/run/anyone-system/daemon-env.json", "/tmp/.anyone/daemon-env.json"];
|
|
1812
|
+
let raw = null;
|
|
1813
|
+
for (const file of candidates) {
|
|
1814
|
+
raw = await readFile(file, "utf8").catch(() => null);
|
|
1815
|
+
if (raw !== null) break;
|
|
1816
|
+
}
|
|
1817
|
+
if (raw === null) return false;
|
|
1818
|
+
const env = daemonEnvIdentitySchema.safeParse(JSON.parse(raw));
|
|
1812
1819
|
if (!env.success) return false;
|
|
1813
1820
|
const token = env.data.ANYONE_SANDBOX_TOKEN ?? env.data.SKYDIVE_SANDBOX_TOKEN;
|
|
1814
1821
|
if (typeof token !== "string" || token === "") return false;
|