@demigodmode/pi-web-agent 1.7.0 → 1.7.1
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/CHANGELOG.md +13 -0
- package/package.json +1 -1
- package/scripts/patch-jiti-compat.mjs +37 -15
package/CHANGELOG.md
CHANGED
|
@@ -18,6 +18,19 @@ The format is intentionally simple and release-oriented.
|
|
|
18
18
|
### Breaking
|
|
19
19
|
- None.
|
|
20
20
|
|
|
21
|
+
## [1.7.1] - 2026-07-31
|
|
22
|
+
### Added
|
|
23
|
+
- None.
|
|
24
|
+
|
|
25
|
+
### Changed
|
|
26
|
+
- None.
|
|
27
|
+
|
|
28
|
+
### Fixed
|
|
29
|
+
- The issue #34 Pi-loader compatibility patch now resolves hoisted and nested `tr46` and `cssstyle` installations correctly instead of assuming they live inside `pi-web-agent/node_modules`.
|
|
30
|
+
|
|
31
|
+
### Breaking
|
|
32
|
+
- None.
|
|
33
|
+
|
|
21
34
|
## [1.7.0] - 2026-07-17
|
|
22
35
|
### Added
|
|
23
36
|
- Exa is now available as a hosted search backend for `web_explore`, aimed at research-quality source discovery. Set `EXA_API_KEY` in the environment and choose `exa` from **Settings → Backends**. Closes #2.
|
package/package.json
CHANGED
|
@@ -11,14 +11,30 @@
|
|
|
11
11
|
// Safe to run multiple times and safe to no-op if the target files or
|
|
12
12
|
// patterns are missing (e.g. a future dependency bump changes the shape).
|
|
13
13
|
import { readFileSync, writeFileSync, existsSync } from "node:fs";
|
|
14
|
-
import {
|
|
15
|
-
import { dirname, join } from "node:path";
|
|
14
|
+
import { createRequire } from "node:module";
|
|
15
|
+
import { dirname, join, relative, sep } from "node:path";
|
|
16
16
|
|
|
17
|
-
const
|
|
18
|
-
|
|
17
|
+
const resolveFromHere = createRequire(import.meta.url).resolve;
|
|
18
|
+
|
|
19
|
+
function findPackageRoot(entryFile, packageName) {
|
|
20
|
+
let directory = dirname(entryFile);
|
|
21
|
+
while (true) {
|
|
22
|
+
const manifestFile = join(directory, "package.json");
|
|
23
|
+
if (existsSync(manifestFile)) {
|
|
24
|
+
const manifest = JSON.parse(readFileSync(manifestFile, "utf8"));
|
|
25
|
+
if (manifest.name === packageName) return directory;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const parent = dirname(directory);
|
|
29
|
+
if (parent === directory) {
|
|
30
|
+
throw new Error(`could not find the ${packageName} package root from ${entryFile}`);
|
|
31
|
+
}
|
|
32
|
+
directory = parent;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
19
35
|
|
|
20
36
|
function patchTr46() {
|
|
21
|
-
const file =
|
|
37
|
+
const file = resolveFromHere("tr46");
|
|
22
38
|
if (!existsSync(file)) {
|
|
23
39
|
console.debug("patch-jiti-compat: tr46/index.js not found, skipping");
|
|
24
40
|
return;
|
|
@@ -45,13 +61,14 @@ module.exports[Symbol.iterator] = Set.prototype[Symbol.iterator].bind(module.exp
|
|
|
45
61
|
`;
|
|
46
62
|
|
|
47
63
|
function patchCssstyleSetExports() {
|
|
64
|
+
const packageRoot = findPackageRoot(resolveFromHere("cssstyle"), "cssstyle");
|
|
48
65
|
const files = [
|
|
49
|
-
join(
|
|
50
|
-
join(
|
|
51
|
-
join(
|
|
66
|
+
join(packageRoot, "lib", "allExtraProperties.js"),
|
|
67
|
+
join(packageRoot, "lib", "generated", "allProperties.js"),
|
|
68
|
+
join(packageRoot, "lib", "generated", "implementedProperties.js"),
|
|
52
69
|
];
|
|
53
70
|
for (const file of files) {
|
|
54
|
-
const label = `cssstyle/${file.
|
|
71
|
+
const label = `cssstyle/${relative(packageRoot, file).split(sep).join("/")}`;
|
|
55
72
|
if (!existsSync(file)) {
|
|
56
73
|
console.debug(`patch-jiti-compat: ${label} not found, skipping`);
|
|
57
74
|
continue;
|
|
@@ -67,10 +84,15 @@ function patchCssstyleSetExports() {
|
|
|
67
84
|
}
|
|
68
85
|
}
|
|
69
86
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
} catch (err) {
|
|
74
|
-
|
|
75
|
-
|
|
87
|
+
function runBestEffort(label, patch) {
|
|
88
|
+
try {
|
|
89
|
+
patch();
|
|
90
|
+
} catch (err) {
|
|
91
|
+
// Never fail the install over a best-effort compat patch.
|
|
92
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
93
|
+
console.warn(`patch-jiti-compat: ${label} skipped, non-fatal error: ${message}`);
|
|
94
|
+
}
|
|
76
95
|
}
|
|
96
|
+
|
|
97
|
+
runBestEffort("tr46", patchTr46);
|
|
98
|
+
runBestEffort("cssstyle", patchCssstyleSetExports);
|