dsh-agentic-pet 0.4.3 → 0.4.4
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/lib/index.js +4 -26
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { c as globalFilePath, d as readJsonl, f as readPetName, h as writePetName, i as installPetDriver, l as readAffectionRaw, m as writeGlobalJson, n as installPetService, p as writeAffectionRaw, r as petHome, s as eventsFile, u as readGlobalJson } from "./service-BjTawwUn.js";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
|
-
import { spawn
|
|
3
|
+
import { spawn } from "node:child_process";
|
|
4
4
|
import { createHash } from "node:crypto";
|
|
5
|
-
import { appendFileSync, existsSync,
|
|
5
|
+
import { appendFileSync, existsSync, readFileSync } from "node:fs";
|
|
6
6
|
import { mkdir, readFile, rm, unlink, writeFile } from "node:fs/promises";
|
|
7
7
|
import { homedir } from "node:os";
|
|
8
8
|
import { dirname, extname, join, normalize, resolve, sep } from "node:path";
|
|
@@ -656,31 +656,9 @@ function apply(ctx) {
|
|
|
656
656
|
const carrierDir = resolve(join(dirname(fileURLToPath(import.meta.url)), "..", "carrier"));
|
|
657
657
|
const electronBinary = resolveElectronBinary();
|
|
658
658
|
if (process.env.DSH_PET_NO_SPAWN === "1" || electronBinary === void 0 || !existsSync(join(carrierDir, "package.json"))) return;
|
|
659
|
-
let probeStatus = "unstarted";
|
|
660
|
-
const startsSandboxed = (() => {
|
|
661
|
-
try {
|
|
662
|
-
const probe = spawnSync(electronBinary, ["--version"], {
|
|
663
|
-
env: stripRunAsNode(process.env),
|
|
664
|
-
stdio: "ignore",
|
|
665
|
-
timeout: 5e3
|
|
666
|
-
});
|
|
667
|
-
probeStatus = probe.error === void 0 ? `status=${String(probe.status)}` : `error=${String(probe.error.code ?? probe.error.message)}`;
|
|
668
|
-
return probe.status === 0;
|
|
669
|
-
} catch (error) {
|
|
670
|
-
probeStatus = `throw=${error instanceof Error ? error.message : String(error)}`;
|
|
671
|
-
return false;
|
|
672
|
-
}
|
|
673
|
-
})();
|
|
674
659
|
const launchArgs = [carrierDir];
|
|
675
|
-
if (
|
|
676
|
-
|
|
677
|
-
const carrierUserData = join(dirname(petLocatorPath()), "carrier-userdata");
|
|
678
|
-
try {
|
|
679
|
-
mkdirSync(carrierUserData, { recursive: true });
|
|
680
|
-
} catch {}
|
|
681
|
-
launchArgs.push("--no-sandbox", `--user-data-dir=${carrierUserData}`);
|
|
682
|
-
}
|
|
683
|
-
logCarrier(`spawn binary=${electronBinary} args=${JSON.stringify(launchArgs)} probe=${probeStatus} pid=${String(process.pid)}`);
|
|
660
|
+
if (process.env.DSH_PET_NO_SANDBOX === "1") launchArgs.push("--no-sandbox");
|
|
661
|
+
logCarrier(`spawn binary=${electronBinary} args=${JSON.stringify(launchArgs)} pid=${String(process.pid)}`);
|
|
684
662
|
const child = (() => {
|
|
685
663
|
try {
|
|
686
664
|
return spawn(electronBinary, launchArgs, {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-agentic-pet",
|
|
3
3
|
"description": "The pet-surface bundle: serves the desktop pet renderer over the web composition, turning dsh into a surface the desktop pet attaches to as an authenticated client",
|
|
4
|
-
"version": "0.4.
|
|
4
|
+
"version": "0.4.4",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|