context-mode 1.0.133 → 1.0.135
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/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +1 -1
- package/.openclaw-plugin/openclaw.plugin.json +1 -1
- package/.openclaw-plugin/package.json +1 -1
- package/build/adapters/detect.d.ts +3 -1
- package/build/adapters/detect.js +7 -2
- package/build/adapters/pi/mcp-bridge.d.ts +8 -0
- package/build/adapters/pi/mcp-bridge.js +32 -0
- package/build/cli.js +17 -0
- package/build/runtime.js +8 -5
- package/build/server.d.ts +17 -0
- package/build/server.js +62 -4
- package/build/session/analytics.d.ts +18 -13
- package/build/session/analytics.js +131 -8
- package/build/util/claude-config.d.ts +12 -6
- package/build/util/claude-config.js +16 -23
- package/cli.bundle.mjs +136 -133
- package/hooks/codex/sessionstart.mjs +23 -1
- package/hooks/core/platform-detect.mjs +1 -1
- package/hooks/normalize-hooks.mjs +5 -2
- package/hooks/security.bundle.mjs +1 -1
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
- package/scripts/heal-installed-plugins.mjs +67 -0
- package/server.bundle.mjs +109 -108
- package/start.mjs +73 -11
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
*/
|
|
24
24
|
import { resolve } from "node:path";
|
|
25
25
|
import { homedir } from "node:os";
|
|
26
|
-
import {
|
|
26
|
+
import { detectPlatform, getSessionDirSegments } from "../adapters/detect.js";
|
|
27
27
|
export function resolveClaudeConfigDir(env = process.env) {
|
|
28
28
|
const envVal = env.CLAUDE_CONFIG_DIR;
|
|
29
29
|
if (envVal && envVal.trim() !== "") {
|
|
@@ -50,34 +50,27 @@ export function resolveClaudeGlobalSettingsPath(env = process.env) {
|
|
|
50
50
|
* adapter is non-claude — claude is already covered by entry 2).
|
|
51
51
|
* 2. The claude global settings.json (always — defense in depth).
|
|
52
52
|
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
53
|
+
* Static import of `../adapters/detect.js` is safe — detect.ts only imports
|
|
54
|
+
* `node:` builtins, `./types.js` (type-only), and `./client-map.js` (pure
|
|
55
|
+
* data). It does NOT import claude-config back, so no cycle.
|
|
56
|
+
*
|
|
57
|
+
* History: this used `createRequire(import.meta.url).resolve(...)` to lazy-
|
|
58
|
+
* load detect at call time. That pattern requires `require(esm)`, which is
|
|
59
|
+
* flag-gated on Node 22.x before 22.12 (`--experimental-require-module`).
|
|
60
|
+
* CI run 25877550371 on Node 22.5 silently failed every detect.* call —
|
|
61
|
+
* the catch block ate the error and every cross-adapter deny-policy test
|
|
62
|
+
* returned an empty policy list. Static import sidesteps the require(esm)
|
|
63
|
+
* gate entirely, so the same code works on every supported Node version
|
|
64
|
+
* (20.x, 22.5, 22.12+, 24+) without needing the experimental flag.
|
|
59
65
|
*
|
|
60
66
|
* The returned array is deduplicated and order-stable: adapter-specific path
|
|
61
67
|
* first (most specific), claude global second (fallback).
|
|
62
68
|
*/
|
|
63
69
|
export function resolveAdapterGlobalSettingsPaths(env = process.env) {
|
|
64
70
|
const paths = [];
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
let detected = null;
|
|
69
|
-
let segmentsFor = null;
|
|
70
|
-
try {
|
|
71
|
-
const lazyRequire = createRequire(import.meta.url);
|
|
72
|
-
const detect = lazyRequire("../adapters/detect.js");
|
|
73
|
-
detected = detect.detectPlatform();
|
|
74
|
-
segmentsFor = detect.getSessionDirSegments;
|
|
75
|
-
}
|
|
76
|
-
catch {
|
|
77
|
-
// If detection fails for any reason, fall back to claude-only behavior.
|
|
78
|
-
}
|
|
79
|
-
if (detected && segmentsFor && detected.platform !== "claude-code") {
|
|
80
|
-
const segments = segmentsFor(detected.platform);
|
|
71
|
+
const detected = detectPlatform();
|
|
72
|
+
if (detected.platform !== "claude-code") {
|
|
73
|
+
const segments = getSessionDirSegments(detected.platform);
|
|
81
74
|
if (segments && segments.length > 0) {
|
|
82
75
|
paths.push(resolve(homedir(), ...segments, "settings.json"));
|
|
83
76
|
}
|