@openclaw/feishu 2026.11.3 → 2026.11.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/dist/.setup/{channel-D60cZ_Y_.mjs → channel-6bBLGirS.mjs} +2 -2
- package/dist/.setup/{channel.runtime-Cg4V7VC2.mjs → channel.runtime-CwfDpLtc.mjs} +1 -1
- package/dist/.setup/{monitor-BcnMie82.mjs → monitor-By0Z9Afk.mjs} +1 -1
- package/dist/.setup/{monitor.account-C_u1fZ5g.mjs → monitor.account-Do-D6JD-.mjs} +3 -3
- package/dist/.setup/{setup-api-Di55YmQ0.mjs → setup-api-DtPp-6Ar.mjs} +1 -1
- package/dist/api.js +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/setup-api.js +1 -1
- package/dist/setup-entry.js +1 -1
- package/node_modules/@openclaw/fs-safe/CHANGELOG.md +26 -0
- package/node_modules/@openclaw/fs-safe/dist/copy-path-admission.js +2 -2
- package/node_modules/@openclaw/fs-safe/dist/native-config.js +14 -3
- package/node_modules/@openclaw/fs-safe/dist/output.js +6 -0
- package/node_modules/@openclaw/fs-safe/dist/root-directory-list.d.ts +2 -1
- package/node_modules/@openclaw/fs-safe/dist/root-directory-list.js +12 -5
- package/node_modules/@openclaw/fs-safe/dist/root-path-existing.d.ts +2 -2
- package/node_modules/@openclaw/fs-safe/dist/root-path-existing.js +27 -13
- package/node_modules/@openclaw/fs-safe/dist/root-path.js +2 -2
- package/node_modules/@openclaw/fs-safe/dist/sibling-staged-file.d.ts +3 -0
- package/node_modules/@openclaw/fs-safe/dist/sibling-staged-file.js +18 -3
- package/node_modules/@openclaw/fs-safe/dist/watch-hints.js +8 -3
- package/node_modules/@openclaw/fs-safe/dist/windows-security-helper.exe +0 -0
- package/node_modules/@openclaw/fs-safe/docs/config.md +7 -1
- package/node_modules/@openclaw/fs-safe/docs/copy.md +10 -0
- package/node_modules/@openclaw/fs-safe/docs/migrating-to-0.5.md +6 -4
- package/node_modules/@openclaw/fs-safe/docs/native-helper.md +6 -4
- package/node_modules/@openclaw/fs-safe/docs/output.md +4 -2
- package/node_modules/@openclaw/fs-safe/docs/security-model.md +9 -0
- package/node_modules/@openclaw/fs-safe/docs/watch.md +7 -1
- package/node_modules/@openclaw/fs-safe/package.json +15 -14
- package/node_modules/@openclaw/fs-safe-darwin-arm64/fs-safe-native.node +0 -0
- package/node_modules/@openclaw/fs-safe-darwin-arm64/package.json +1 -1
- package/node_modules/@openclaw/fs-safe-darwin-x64/fs-safe-native.node +0 -0
- package/node_modules/@openclaw/fs-safe-darwin-x64/package.json +1 -1
- package/node_modules/@openclaw/fs-safe-freebsd-arm64/fs-safe-native.node +0 -0
- package/node_modules/@openclaw/fs-safe-freebsd-arm64/package.json +1 -1
- package/node_modules/@openclaw/fs-safe-freebsd-x64/fs-safe-native.node +0 -0
- package/node_modules/@openclaw/fs-safe-freebsd-x64/package.json +1 -1
- package/node_modules/@openclaw/fs-safe-linux-arm64-gnu/fs-safe-native.node +0 -0
- package/node_modules/@openclaw/fs-safe-linux-arm64-gnu/package.json +1 -1
- package/node_modules/@openclaw/fs-safe-linux-arm64-musl/fs-safe-native.node +0 -0
- package/node_modules/@openclaw/fs-safe-linux-arm64-musl/package.json +1 -1
- package/node_modules/@openclaw/fs-safe-linux-x64-gnu/fs-safe-native.node +0 -0
- package/node_modules/@openclaw/fs-safe-linux-x64-gnu/package.json +1 -1
- package/node_modules/@openclaw/fs-safe-linux-x64-musl/fs-safe-native.node +0 -0
- package/node_modules/@openclaw/fs-safe-linux-x64-musl/package.json +1 -1
- package/node_modules/@openclaw/fs-safe-win32-arm64-msvc/fs-safe-native.node +0 -0
- package/node_modules/@openclaw/fs-safe-win32-arm64-msvc/package.json +1 -1
- package/node_modules/@openclaw/fs-safe-win32-x64-msvc/fs-safe-native.node +0 -0
- package/node_modules/@openclaw/fs-safe-win32-x64-msvc/package.json +1 -1
- package/package.json +5 -5
|
@@ -852,7 +852,7 @@ const feishuDoctor = {
|
|
|
852
852
|
//#endregion
|
|
853
853
|
//#region extensions/feishu/src/gateway.ts
|
|
854
854
|
const feishuGatewayAdapter = { startAccount: async (ctx) => {
|
|
855
|
-
const { monitorFeishuProvider } = await import("./monitor-
|
|
855
|
+
const { monitorFeishuProvider } = await import("./monitor-By0Z9Afk.mjs");
|
|
856
856
|
const account = resolveFeishuRuntimeAccount({
|
|
857
857
|
cfg: ctx.cfg,
|
|
858
858
|
accountId: ctx.accountId
|
|
@@ -1893,7 +1893,7 @@ const meta = {
|
|
|
1893
1893
|
order: 70,
|
|
1894
1894
|
preferSessionLookupForAnnounceTarget: true
|
|
1895
1895
|
};
|
|
1896
|
-
const loadFeishuChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-
|
|
1896
|
+
const loadFeishuChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-CwfDpLtc.mjs"), "feishuChannelRuntime");
|
|
1897
1897
|
async function resolveFeishuMessageSender(kind) {
|
|
1898
1898
|
const unavailableMessage = `Feishu ${kind} sending is not available.`;
|
|
1899
1899
|
try {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { h as resolveFeishuAccount } from "./doctor-contract-BNXcJcWR.mjs";
|
|
2
|
-
import { d as listFeishuDirectoryPeers, o as feishuOutbound, u as listFeishuDirectoryGroups } from "./channel-
|
|
2
|
+
import { d as listFeishuDirectoryPeers, o as feishuOutbound, u as listFeishuDirectoryGroups } from "./channel-6bBLGirS.mjs";
|
|
3
3
|
import { A as sendMessageFeishu, C as sendStickerFeishu, D as getMessageFeishu, E as editMessageFeishu, U as createConfiguredFeishuClient, et as assertFeishuApiSuccess, k as sendCardFeishu } from "./reply-delivery-result-DknmIzOB.mjs";
|
|
4
4
|
import { r as createFeishuClient } from "./client-BTiFlqqL.mjs";
|
|
5
5
|
import { a as getFeishuMemberInfo, i as getChatMembers, n as buildFeishuDirectChatMembers, r as getChatInfo, t as assertFeishuChatMember } from "./chat-qj1pEIcO.mjs";
|
|
@@ -123,7 +123,7 @@ async function fetchBotIdentityForMonitor(account, options = {}) {
|
|
|
123
123
|
}
|
|
124
124
|
//#endregion
|
|
125
125
|
//#region extensions/feishu/src/monitor.ts
|
|
126
|
-
const loadMonitorAccountRuntime = createLazyRuntimeModule(() => import("./monitor.account-
|
|
126
|
+
const loadMonitorAccountRuntime = createLazyRuntimeModule(() => import("./monitor.account-Do-D6JD-.mjs"));
|
|
127
127
|
async function monitorFeishuProvider(opts = {}) {
|
|
128
128
|
const cfg = opts.config;
|
|
129
129
|
if (!cfg) throw new Error("Config is required for Feishu monitor");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { c as normalizeFeishuExternalKey, g as resolveFeishuRuntimeAccount, h as resolveFeishuAccount, s as normalizeFeishuWebhookPath } from "./doctor-contract-BNXcJcWR.mjs";
|
|
2
2
|
import { o as resolveConfiguredFeishuGroupSessionScope, t as buildFeishuConversationId, u as resolveReceiveIdType } from "./conversation-id-D00i9uy5.mjs";
|
|
3
|
-
import { c as resolveFeishuLegacyWebhookListener, l as gateway_config_runtime_exports, s as describeFeishuWebhookPathConflict } from "./channel-
|
|
3
|
+
import { c as resolveFeishuLegacyWebhookListener, l as gateway_config_runtime_exports, s as describeFeishuWebhookPathConflict } from "./channel-6bBLGirS.mjs";
|
|
4
4
|
import { A as sendMessageFeishu, At as resolveFeishuGroupConfig, B as parseInteractiveCardContent, D as getMessageFeishu, Dt as hasExplicitFeishuGroupConfig, F as isFeishuBroadcastMention, Ft as normalizeFeishuChatType, G as resolveFeishuIdentityEmoji, H as resolveFeishuSenderName, I as isMentionForwardRequest, It as resolveFeishuChatType, L as normalizeMentions, Mt as resolveFeishuGroupSenderActivationIngressAccess, N as formatFeishuMediaContent, O as listFeishuThreadMessages, Ot as normalizeFeishuAllowEntry, P as extractMentionTargets, Pt as resolveFeishuReplyPolicy, R as isFeishuGroupChatType, Rt as createFeishuCardInteractionEnvelope, S as sendMediaFeishu, T as chunkFeishuCardMarkdown, V as parsePostContent, W as buildFeishuMediaFallbackText, _t as shouldUseFeishuCard, a as shouldSendNoVisibleReplyFallback, b as withinCardTableLimit, ct as buildFeishuCommentTarget, d as consumeFeishuPresentationFallbackMarker, ft as resolveFeishuCardTemplate, ht as materializeFeishuPostMarkdownSoftBreaks, i as noVisibleFeishuReplyDelivery, it as extractReplyText, j as sendStructuredCardFeishu, jt as resolveFeishuGroupConversationIngressAccess, k as sendCardFeishu, kt as resolveFeishuDmIngressAccess, lt as normalizeCommentFileType, mt as chunkFeishuPostMarkdown, n as createFeishuReplyDeliveryResult, nt as createCommentTypingReactionLifecycle, ot as parseCommentContentElements, q as deliverCommentThreadText, r as mergeFeishuReplyDeliveryResults, rt as encodeQuery, st as requestFeishuApi, t as createFeishuPartialReplyDeliveryError, u as buildFeishuPresentationFallback, v as renderFeishuReplyPayload, w as shouldSuppressFeishuTextForVoiceMedia, x as saveMessageResourceFeishu, y as resolveFeishuRichReply, z as normalizeFeishuEventChatType, zt as decodeFeishuCardAction } from "./reply-delivery-result-DknmIzOB.mjs";
|
|
5
5
|
import { t as getFeishuRuntime } from "./runtime-C5JxBWZp.mjs";
|
|
6
6
|
import { a as getFeishuUserAgent, f as resolveConfiguredHttpTimeoutMs, i as createFeishuWSClient, n as createEventDispatcher, r as createFeishuClient } from "./client-BTiFlqqL.mjs";
|
|
@@ -9,7 +9,7 @@ import { r as getChatInfo } from "./chat-qj1pEIcO.mjs";
|
|
|
9
9
|
import { evaluateSupplementalContextVisibility, normalizeAgentId as normalizeAgentId$1, resolveChannelContextVisibilityMode } from "../runtime-api.js";
|
|
10
10
|
import { t as readFeishuJsonResponse } from "./json-response-DXajw_FU.mjs";
|
|
11
11
|
import { a as waitForAbortableDelay, i as raceWithTimeoutAndAbort } from "./probe-s0hiM44D.mjs";
|
|
12
|
-
import { t as fetchBotIdentityForMonitor } from "./monitor-
|
|
12
|
+
import { t as fetchBotIdentityForMonitor } from "./monitor-By0Z9Afk.mjs";
|
|
13
13
|
import { resolveAgentConfig } from "openclaw/plugin-sdk/agent-scope-runtime";
|
|
14
14
|
import { DEFAULT_INGRESS_ADOPTION_STALL_MS, bindIngressLifecycleToReplyOptions, createChannelIngressError, createChannelIngressMonitor, createChannelMessageReplyPipeline, createReplyPrefixContext, formatChannelProgressDraftLineForEntry, resolveAgentOutboundIdentity, resolveChannelPreviewStreamMode, resolveChannelStreamingBlockEnabled, waitUntilAbort } from "openclaw/plugin-sdk/channel-outbound";
|
|
15
15
|
import { createChannelPairingController } from "openclaw/plugin-sdk/channel-pairing";
|
|
@@ -2055,7 +2055,7 @@ function createFeishuReplyDispatcher(params) {
|
|
|
2055
2055
|
}
|
|
2056
2056
|
if (shouldDeliverText) {
|
|
2057
2057
|
if (hasPresentationFallback || info?.kind === "block" && !useStreamingCard) {
|
|
2058
|
-
if (hasPresentationFallback || coreBlockStreamingEnabled) {
|
|
2058
|
+
if (hasPresentationFallback || coreBlockStreamingEnabled || hasMedia) {
|
|
2059
2059
|
const firstChunkMentions = info?.kind === "final" || info?.kind === "block" && !sentIndependentBlockText ? mentionTargets : void 0;
|
|
2060
2060
|
await collectDelivery(sendPostReply(text, info?.kind, firstChunkMentions));
|
|
2061
2061
|
if (info?.kind === "block") sentIndependentBlockText = true;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { i as feishuSetupAdapter, n as feishuSetupWizard, t as feishuPlugin } from "./channel-
|
|
1
|
+
import { i as feishuSetupAdapter, n as feishuSetupWizard, t as feishuPlugin } from "./channel-6bBLGirS.mjs";
|
|
2
2
|
import "../setup-api.js";
|
|
3
3
|
export { feishuPlugin, feishuSetupAdapter, feishuSetupWizard };
|
package/dist/api.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as parseFeishuTargetId, i as parseFeishuDirectConversationId, n as buildFeishuModelOverrideParentCandidates, r as parseFeishuConversationId, t as buildFeishuConversationId } from "./.setup/conversation-id-D00i9uy5.mjs";
|
|
2
|
-
import { a as setFeishuNamedAccountEnabled, i as feishuSetupAdapter, n as feishuSetupWizard, r as runFeishuLogin, t as feishuPlugin } from "./.setup/channel-
|
|
2
|
+
import { a as setFeishuNamedAccountEnabled, i as feishuSetupAdapter, n as feishuSetupWizard, r as runFeishuLogin, t as feishuPlugin } from "./.setup/channel-6bBLGirS.mjs";
|
|
3
3
|
import { $ as resolveFeishuToolAccount, J as registerFeishuDriveTools, Q as createFeishuToolClient, X as feishuExternalToolResult, Y as registerFeishuTool, Z as unknownToolActionResult, et as assertFeishuApiSuccess, gt as parseFeishuMarkdown, pt as chunkFeishuMarkdown, vt as visitFeishuMarkdown } from "./.setup/reply-delivery-result-DknmIzOB.mjs";
|
|
4
4
|
import { t as getFeishuRuntime } from "./.setup/runtime-C5JxBWZp.mjs";
|
|
5
5
|
import { f as resolveConfiguredHttpTimeoutMs, r as createFeishuClient } from "./.setup/client-BTiFlqqL.mjs";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as feishuPlugin } from "./.setup/channel-
|
|
1
|
+
import { t as feishuPlugin } from "./.setup/channel-6bBLGirS.mjs";
|
|
2
2
|
export { feishuPlugin };
|
package/dist/setup-api.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as feishuSetupAdapter, n as feishuSetupWizard, t as feishuPlugin } from "./.setup/channel-
|
|
1
|
+
import { i as feishuSetupAdapter, n as feishuSetupWizard, t as feishuPlugin } from "./.setup/channel-6bBLGirS.mjs";
|
|
2
2
|
export { feishuPlugin, feishuSetupAdapter, feishuSetupWizard };
|
package/dist/setup-entry.js
CHANGED
|
@@ -4,7 +4,7 @@ import { fileURLToPath } from "node:url";
|
|
|
4
4
|
var setup_entry_default = defineBundledChannelSetupEntry({
|
|
5
5
|
importMetaUrl: import.meta.url,
|
|
6
6
|
plugin: {
|
|
7
|
-
specifier: fileURLToPath(new URL(".setup/setup-api-
|
|
7
|
+
specifier: fileURLToPath(new URL(".setup/setup-api-DtPp-6Ar.mjs", import.meta.url).href),
|
|
8
8
|
exportName: "feishuPlugin"
|
|
9
9
|
},
|
|
10
10
|
secrets: {
|
|
@@ -2,6 +2,32 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 0.26.7 - 2026-10-17
|
|
6
|
+
|
|
7
|
+
### Highlights
|
|
8
|
+
|
|
9
|
+
- **Windows idle watch CPU:** share native identity and physical-path queries while retaining directory checks. ([#1000](https://github.com/openclaw/fs-safe/pull/1000))
|
|
10
|
+
- **Root containment:** preserve kernel parent semantics through nested and dangling symlink chains, and reject redirected sibling-output parents. ([#993](https://github.com/openclaw/fs-safe/pull/993))
|
|
11
|
+
- **Legacy native policy migration:** removed Python-mode settings now fail with an actionable migration error when no explicit native policy is selected. ([#995](https://github.com/openclaw/fs-safe/pull/995))
|
|
12
|
+
|
|
13
|
+
### Fixes
|
|
14
|
+
|
|
15
|
+
- **Windows watch scan CPU:** share native identity and physical-path queries while retaining every listed entry's directory checks. Thanks @martinderm for reporting the idle Gateway CPU regression in [openclaw#174341](https://github.com/openclaw/openclaw/issues/174341). ([#1000](https://github.com/openclaw/fs-safe/pull/1000))
|
|
16
|
+
- **ZIP integrity:** update the native ZIP decoder while preserving format-error and byte-limit classifications for entries that exceed their declared size. ([#997](https://github.com/openclaw/fs-safe/pull/997))
|
|
17
|
+
- **Release dry runs:** keep generated unsigned package artifacts outside source-provenance checks so the final package smoke test can complete without signing or publishing. ([#996](https://github.com/openclaw/fs-safe/pull/996))
|
|
18
|
+
- **Root containment:** resolve nested and dangling symlink chains with kernel parent semantics, and reject redirected sibling-output parents before invoking external writers. Thanks @yetval for [#987](https://github.com/openclaw/fs-safe/issues/987) and [#986](https://github.com/openclaw/fs-safe/issues/986). ([#993](https://github.com/openclaw/fs-safe/pull/993))
|
|
19
|
+
- **Watch invalidations:** refresh the admitted parent after transient create/delete activity so consumer caches cannot retain a file absent from both watcher scans. ([#993](https://github.com/openclaw/fs-safe/pull/993))
|
|
20
|
+
|
|
21
|
+
### Compatibility
|
|
22
|
+
|
|
23
|
+
- **Legacy native policy migration:** reject removed `FS_SAFE_PYTHON_MODE` and `OPENCLAW_FS_SAFE_PYTHON_MODE` settings with an actionable migration error when no explicit native policy is selected, instead of silently changing `require` or `off` to `auto`. Set the corresponding native-mode variable to the same value before upgrading. ([#995](https://github.com/openclaw/fs-safe/pull/995))
|
|
24
|
+
|
|
25
|
+
## 0.26.6 - 2026-10-15
|
|
26
|
+
|
|
27
|
+
### Fixes
|
|
28
|
+
|
|
29
|
+
- **Btrfs file cloning:** explicit `clone: "auto"` and `"always"` copies match NOCOW on their new empty destination so different source and destination-directory policies do not force a full byte copy. Sources and unrelated destination flags are preserved; automatic fallback recreates the destination with its ordinary inherited policy.
|
|
30
|
+
|
|
5
31
|
## 0.26.5 - 2026-10-14
|
|
6
32
|
|
|
7
33
|
### Highlights
|
|
@@ -10,7 +10,7 @@ function admitUncachedCopyPath(input, create = false, admittedRoot) {
|
|
|
10
10
|
if (!path.isAbsolute(input.rootPath) || !path.isAbsolute(input.absolutePath)) {
|
|
11
11
|
throw new FsSafeError("invalid-path", "copy roots and paths must be absolute");
|
|
12
12
|
}
|
|
13
|
-
const root = admittedRoot ?? captureDirectoryGuard(realpathSync(input.rootPath), "native", { bigint: true });
|
|
13
|
+
const root = admittedRoot ?? captureDirectoryGuard(realpathSync.native(input.rootPath), "native", { bigint: true });
|
|
14
14
|
// Canonical POSIX callers already own a freshly checked root. Keep the
|
|
15
15
|
// resolver's lexical/symlink walk, but do not rediscover that root each time.
|
|
16
16
|
const rootCanonicalPath = admittedRoot?.realPath;
|
|
@@ -75,7 +75,7 @@ export function createCopyPathAdmissionCache() {
|
|
|
75
75
|
}
|
|
76
76
|
let root = roots.get(input.rootPath);
|
|
77
77
|
if (!root) {
|
|
78
|
-
const canonical = realpathSync(input.rootPath);
|
|
78
|
+
const canonical = realpathSync.native(input.rootPath);
|
|
79
79
|
if (canonical !== input.rootPath)
|
|
80
80
|
return admitUncachedCopyPath(input, create);
|
|
81
81
|
root = captureDirectoryGuard(canonical, "native", { bigint: true });
|
|
@@ -18,12 +18,23 @@ function parseMode(value) {
|
|
|
18
18
|
export function configureFsSafeNative(config) {
|
|
19
19
|
overrideConfig = { ...overrideConfig, ...config };
|
|
20
20
|
}
|
|
21
|
+
function rejectLegacyMode() {
|
|
22
|
+
for (const source of ["FS_SAFE_PYTHON_MODE", "OPENCLAW_FS_SAFE_PYTHON_MODE"]) {
|
|
23
|
+
if (process.env[source] === undefined)
|
|
24
|
+
continue;
|
|
25
|
+
const mode = parseMode(process.env[source]) ?? "auto";
|
|
26
|
+
throw new Error(`${source} has been removed. Set FS_SAFE_NATIVE_MODE=${mode} or ` +
|
|
27
|
+
`configureFsSafeNative({ mode: "${mode}" }) before using fs-safe, then remove ${source}. ` +
|
|
28
|
+
"Legacy mode settings no longer select native policy.");
|
|
29
|
+
}
|
|
30
|
+
return "auto";
|
|
31
|
+
}
|
|
21
32
|
export function getFsSafeNativeConfig() {
|
|
22
33
|
return {
|
|
23
34
|
mode: overrideConfig.mode ??
|
|
24
35
|
parseMode(process.env.FS_SAFE_NATIVE_MODE) ??
|
|
25
36
|
parseMode(process.env.OPENCLAW_FS_SAFE_NATIVE_MODE) ??
|
|
26
|
-
|
|
37
|
+
rejectLegacyMode(),
|
|
27
38
|
};
|
|
28
39
|
}
|
|
29
40
|
/** Internal provenance; keep the public configuration shape unchanged. */
|
|
@@ -35,13 +46,13 @@ export function getNativeModeSetting() {
|
|
|
35
46
|
if (mode !== undefined)
|
|
36
47
|
return { mode, source };
|
|
37
48
|
}
|
|
38
|
-
return { mode:
|
|
49
|
+
return { mode: rejectLegacyMode(), source: "default" };
|
|
39
50
|
}
|
|
40
51
|
export function isFsSafeNativeRequired() {
|
|
41
52
|
return (overrideConfig.mode ??
|
|
42
53
|
parseMode(process.env.FS_SAFE_NATIVE_MODE) ??
|
|
43
54
|
parseMode(process.env.OPENCLAW_FS_SAFE_NATIVE_MODE) ??
|
|
44
|
-
|
|
55
|
+
rejectLegacyMode()) === "require";
|
|
45
56
|
}
|
|
46
57
|
export function __resetFsSafeNativeConfigForTest() {
|
|
47
58
|
overrideConfig = {};
|
|
@@ -8,6 +8,7 @@ import { isPathInside } from "./path.js";
|
|
|
8
8
|
import { root } from "./root.js";
|
|
9
9
|
import { tempFile } from "./temp-target.js";
|
|
10
10
|
import { assertNoWindowsPathAlias } from "./windows-path-alias.js";
|
|
11
|
+
import { createAsyncDirectoryGuard } from "./directory-guard.js";
|
|
11
12
|
const NON_PORTABLE_FILE_NAME_CHARACTERS = /[\u0000-\u001f\u007f-\u009f<>:"/\\|?*]/u;
|
|
12
13
|
function tempFileNameForTarget(targetPath, fallbackFileName) {
|
|
13
14
|
const fallback = sanitizeUntrustedFileName(fallbackFileName ?? "output.bin", "output.bin");
|
|
@@ -62,6 +63,9 @@ export async function writeExternalFileWithinRoot(options) {
|
|
|
62
63
|
const staging = options.staging;
|
|
63
64
|
const fallbackFileName = options.fallbackFileName;
|
|
64
65
|
const targetRoot = await root(rootDir);
|
|
66
|
+
const rootBoundary = staging === "sibling"
|
|
67
|
+
? await createAsyncDirectoryGuard(targetRoot.rootReal, { bigint: true })
|
|
68
|
+
: undefined;
|
|
65
69
|
if (requestedTargetPath.length === 0) {
|
|
66
70
|
throw new FsSafeError("invalid-path", "target path is required");
|
|
67
71
|
}
|
|
@@ -84,6 +88,7 @@ export async function writeExternalFileWithinRoot(options) {
|
|
|
84
88
|
const siblingFinalPath = await targetRoot.resolve(targetPath);
|
|
85
89
|
const result = await writeExternalFileViaSibling({
|
|
86
90
|
finalPath: siblingFinalPath,
|
|
91
|
+
rootBoundary,
|
|
87
92
|
write,
|
|
88
93
|
producerIsolation,
|
|
89
94
|
fallbackFileName,
|
|
@@ -126,6 +131,7 @@ async function writeExternalFileViaSibling(params) {
|
|
|
126
131
|
assertNoWindowsPathAlias(finalPath, "filesystem", "output target uses a Windows filesystem namespace alias");
|
|
127
132
|
const { result } = await writeCallbackSibling({
|
|
128
133
|
tempDir: path.dirname(finalPath),
|
|
134
|
+
rootBoundary: params.rootBoundary,
|
|
129
135
|
tempName: buildSiblingTempName(finalPath, params.fallbackFileName),
|
|
130
136
|
write: params.write,
|
|
131
137
|
producerIsolation: params.producerIsolation,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { BigIntStats, Stats } from "node:fs";
|
|
2
2
|
import { type AsyncDirectoryGuard } from "./directory-guard.js";
|
|
3
|
+
import { type NativeDirectoryObservationBackend } from "./native-directory-observation.js";
|
|
3
4
|
import { type RootContext } from "./root-context.js";
|
|
4
5
|
import type { RootPathDirectoryObservationGuard, RootPathObservationReceipt, RootPathParentObservationReceipt } from "./root-path.js";
|
|
5
6
|
import type { DirEntry, PathStat } from "./types.js";
|
|
@@ -8,7 +9,7 @@ export declare function pathStatFromStats(stat: Stats | BigIntStats): PathStat;
|
|
|
8
9
|
export declare function pathStatFromStats(stat: Stats | BigIntStats, name: string): DirEntry;
|
|
9
10
|
export type RootDirectoryObservationGuard = AsyncDirectoryGuard<BigIntStats>;
|
|
10
11
|
export declare function createRootDirectoryObservationGuard(root: RootContext, directory: string): Promise<RootDirectoryObservationGuard>;
|
|
11
|
-
export declare function assertRootDirectoryObservationGuard(root: RootContext, guard: RootDirectoryObservationGuard | RootPathDirectoryObservationGuard): Promise<void>;
|
|
12
|
+
export declare function assertRootDirectoryObservationGuard(root: RootContext, guard: RootDirectoryObservationGuard | RootPathDirectoryObservationGuard, backend?: NativeDirectoryObservationBackend): Promise<void>;
|
|
12
13
|
/**
|
|
13
14
|
* Close an operation-local traversal receipt with fresh exact observations.
|
|
14
15
|
* Descendant canonical paths are admitted while the receipt is created. The
|
|
@@ -6,7 +6,7 @@ import path from "node:path";
|
|
|
6
6
|
import { setImmediate as yieldToEventLoop } from "node:timers/promises";
|
|
7
7
|
import { assertAsyncDirectoryGuard, assertDirectoryObservationGuardSync, assertDirectoryObservationSync, createAsyncDirectoryGuard, extendDirectoryObservationGuard, } from "./directory-guard.js";
|
|
8
8
|
import { FsSafeError } from "./errors.js";
|
|
9
|
-
import { inspectNativeDirectoryObservation, isNativeDirectoryObservationGuard, } from "./native-directory-observation.js";
|
|
9
|
+
import { inspectNativeDirectoryObservation, getNativeDirectoryObservationBackend, isNativeDirectoryObservationGuard, } from "./native-directory-observation.js";
|
|
10
10
|
import { isNotFoundPathError } from "./path.js";
|
|
11
11
|
import { assertRootIdentityCurrent } from "./root-context.js";
|
|
12
12
|
import { errorCauseOptions, rootPathChangedError } from "./root-errors.js";
|
|
@@ -77,7 +77,7 @@ function directoryChangedError(error) {
|
|
|
77
77
|
return error;
|
|
78
78
|
return new FsSafeError("path-mismatch", "directory changed during operation", errorCauseOptions(error));
|
|
79
79
|
}
|
|
80
|
-
export async function assertRootDirectoryObservationGuard(root, guard) {
|
|
80
|
+
export async function assertRootDirectoryObservationGuard(root, guard, backend) {
|
|
81
81
|
if (isNativeDirectoryObservationGuard(guard)) {
|
|
82
82
|
throw new FsSafeError("path-mismatch", "native directory observation cannot be revalidated");
|
|
83
83
|
}
|
|
@@ -86,7 +86,9 @@ export async function assertRootDirectoryObservationGuard(root, guard) {
|
|
|
86
86
|
identity.dev === root.rootIdentity.dev && identity.ino === root.rootIdentity.ino;
|
|
87
87
|
if (guardPinsRoot) {
|
|
88
88
|
try {
|
|
89
|
-
if ("identity" in guard)
|
|
89
|
+
if (backend && "identity" in guard)
|
|
90
|
+
assertReceiptDirectoryGuardSync(root, guard, backend);
|
|
91
|
+
else if ("identity" in guard)
|
|
90
92
|
assertDirectoryObservationGuardSync(guard);
|
|
91
93
|
else
|
|
92
94
|
await assertAsyncDirectoryGuard(guard);
|
|
@@ -109,7 +111,9 @@ export async function assertRootDirectoryObservationGuard(root, guard) {
|
|
|
109
111
|
await assertRootIdentityCurrent(root);
|
|
110
112
|
}
|
|
111
113
|
try {
|
|
112
|
-
if ("identity" in guard)
|
|
114
|
+
if (backend && "identity" in guard)
|
|
115
|
+
assertReceiptDirectoryGuardSync(root, guard, backend);
|
|
116
|
+
else if ("identity" in guard)
|
|
113
117
|
assertDirectoryObservationGuardSync(guard);
|
|
114
118
|
else
|
|
115
119
|
await assertAsyncDirectoryGuard(guard);
|
|
@@ -263,12 +267,15 @@ export async function openRootDirectoryListing(root, directory, options, receipt
|
|
|
263
267
|
identity: { dev: admitted.stat.dev, ino: admitted.stat.ino },
|
|
264
268
|
}, admitted.dir, admitted.realPath);
|
|
265
269
|
}
|
|
270
|
+
// Windows watch listings keep every fence while sharing one handle for its
|
|
271
|
+
// identity/path queries. POSIX pathname checks are cheaper than this helper.
|
|
272
|
+
const backend = getNativeDirectoryObservationBackend(options.exactIdentity === true && process.platform === "win32");
|
|
266
273
|
const assertCurrent = async () => {
|
|
267
274
|
options.signal?.throwIfAborted();
|
|
268
275
|
if (receipt)
|
|
269
276
|
assertRootPathObservationReceiptCurrent(root, receipt);
|
|
270
277
|
else
|
|
271
|
-
await assertRootDirectoryObservationGuard(root, guard);
|
|
278
|
+
await assertRootDirectoryObservationGuard(root, guard, backend);
|
|
272
279
|
options.signal?.throwIfAborted();
|
|
273
280
|
};
|
|
274
281
|
const paths = { directory: guard.realPath, names: new Map() };
|
|
@@ -8,5 +8,5 @@ export declare function rawPathRelativeToCanonicalRoot(candidate: string, rootCa
|
|
|
8
8
|
export declare function resolvePathViaExistingAncestor(targetPath: string): Promise<string>;
|
|
9
9
|
export declare function resolvePathViaExistingAncestorSync(targetPath: string): string;
|
|
10
10
|
export type RootPathMetadataMode = "native" | "ordinary";
|
|
11
|
-
export declare function resolveExistingAncestor(targetPath: string, mode: RootPathMetadataMode): string;
|
|
12
|
-
export declare function resolveSymlinkHopPath(symlinkPath: string, mode: RootPathMetadataMode, rejectUnresolved?: boolean): string;
|
|
11
|
+
export declare function resolveExistingAncestor(targetPath: string, mode: RootPathMetadataMode, preserveRawSegments?: boolean, remainingHops?: number): string;
|
|
12
|
+
export declare function resolveSymlinkHopPath(symlinkPath: string, mode: RootPathMetadataMode, rejectUnresolved?: boolean, remainingHops?: number): string;
|
|
@@ -104,14 +104,15 @@ function pathExistsSync(targetPath) {
|
|
|
104
104
|
export function resolvePathViaExistingAncestorSync(targetPath) {
|
|
105
105
|
return resolveExistingAncestor(targetPath, "ordinary");
|
|
106
106
|
}
|
|
107
|
-
export function resolveExistingAncestor(targetPath, mode) {
|
|
108
|
-
const exists = mode === "native" ? pathExists : pathExistsSync;
|
|
109
|
-
const canonicalize =
|
|
107
|
+
export function resolveExistingAncestor(targetPath, mode, preserveRawSegments = false, remainingHops = 64) {
|
|
108
|
+
const exists = mode === "native" || preserveRawSegments ? pathExists : pathExistsSync;
|
|
109
|
+
const canonicalize = realpathSync.native;
|
|
110
110
|
assertNoWindowsPathAlias(targetPath);
|
|
111
111
|
const normalized = resolvePathPreservingWindowsRoot(targetPath);
|
|
112
112
|
assertNoWindowsPathAlias(normalized);
|
|
113
|
-
|
|
114
|
-
|
|
113
|
+
const candidate = preserveRawSegments ? absolutePathWithRawSegments(targetPath) : normalized;
|
|
114
|
+
let cursor = candidate;
|
|
115
|
+
const filesystemRoot = path.parse(candidate).root;
|
|
115
116
|
while (cursor !== filesystemRoot &&
|
|
116
117
|
!exists(cursor)) {
|
|
117
118
|
cursor = path.dirname(cursor);
|
|
@@ -123,22 +124,30 @@ export function resolveExistingAncestor(targetPath, mode) {
|
|
|
123
124
|
try {
|
|
124
125
|
rawResolvedAncestor = canonicalize(pathForWindowsFilesystem(cursor));
|
|
125
126
|
}
|
|
126
|
-
catch {
|
|
127
|
-
|
|
127
|
+
catch (error) {
|
|
128
|
+
if (!preserveRawSegments)
|
|
129
|
+
return normalized;
|
|
130
|
+
if (!isNotFoundPathError(error))
|
|
131
|
+
throw error;
|
|
132
|
+
rawResolvedAncestor = resolveSymlinkHopPath(cursor, mode, false, remainingHops);
|
|
128
133
|
}
|
|
129
134
|
assertNoWindowsPathAlias(rawResolvedAncestor);
|
|
130
135
|
const resolvedAncestor = resolvePathPreservingWindowsRoot(rawResolvedAncestor);
|
|
131
136
|
assertNoWindowsPathAlias(resolvedAncestor);
|
|
132
137
|
// Keep a leading suffix separator relative to the canonical ancestor.
|
|
133
|
-
const
|
|
138
|
+
const suffix = candidate.slice(cursor.length);
|
|
139
|
+
if (preserveRawSegments && suffix.split(path.sep).includes("..")) {
|
|
140
|
+
throw new FsSafeError("symlink", "symlink target has an unresolved parent component");
|
|
141
|
+
}
|
|
142
|
+
const resolved = cursor === candidate
|
|
134
143
|
? resolvedAncestor
|
|
135
|
-
: path.resolve(resolvedAncestor, `.${path.sep}${
|
|
144
|
+
: path.resolve(resolvedAncestor, `.${path.sep}${suffix}`);
|
|
136
145
|
assertNoWindowsPathAlias(resolved);
|
|
137
146
|
return resolved;
|
|
138
147
|
}
|
|
139
|
-
export function resolveSymlinkHopPath(symlinkPath, mode, rejectUnresolved) {
|
|
148
|
+
export function resolveSymlinkHopPath(symlinkPath, mode, rejectUnresolved, remainingHops = 64) {
|
|
140
149
|
try {
|
|
141
|
-
const canonicalize =
|
|
150
|
+
const canonicalize = realpathSync.native;
|
|
142
151
|
const rawRealPath = canonicalize(symlinkPath);
|
|
143
152
|
assertNoWindowsPathAlias(rawRealPath, "filesystem", "resolved symlink path uses a Windows filesystem namespace alias");
|
|
144
153
|
const realPath = resolvePathPreservingWindowsRoot(rawRealPath);
|
|
@@ -151,11 +160,16 @@ export function resolveSymlinkHopPath(symlinkPath, mode, rejectUnresolved) {
|
|
|
151
160
|
}
|
|
152
161
|
if (!isNotFoundPathError(error))
|
|
153
162
|
throw error;
|
|
163
|
+
if (remainingHops <= 0)
|
|
164
|
+
throw new FsSafeError("symlink", "too many unresolved symlink hops");
|
|
154
165
|
const linkTarget = fs.readlinkSync(symlinkPath);
|
|
155
166
|
assertNoWindowsPathAlias(linkTarget, "filesystem", "symlink target uses a Windows filesystem namespace alias");
|
|
156
167
|
const linkDir = resolvePathPreservingWindowsRoot(path.dirname(symlinkPath));
|
|
157
|
-
|
|
158
|
-
const
|
|
168
|
+
// Keep parent segments until the kernel has resolved the existing prefix.
|
|
169
|
+
const targetPath = path.isAbsolute(linkTarget) ? linkTarget
|
|
170
|
+
: path.parse(linkTarget).root ? resolvePathFromBasePreservingWindowsRoot(linkDir, linkTarget)
|
|
171
|
+
: `${linkDir}${path.sep}${linkTarget}`;
|
|
172
|
+
const resolved = resolveExistingAncestor(targetPath, mode, true, remainingHops - 1);
|
|
159
173
|
assertNoWindowsPathAlias(resolved, "filesystem", "resolved symlink path uses a Windows filesystem namespace alias");
|
|
160
174
|
return resolved;
|
|
161
175
|
}
|
|
@@ -255,8 +255,8 @@ function assertResolvedLinkDirectory(pathname, isLast) {
|
|
|
255
255
|
const stat = fs.statSync(pathForWindowsFilesystem(pathname));
|
|
256
256
|
assertDirectoryBeforeMoreSegments(stat, pathname, isLast);
|
|
257
257
|
}
|
|
258
|
-
// Both public APIs use synchronous metadata; only
|
|
259
|
-
// existence
|
|
258
|
+
// Both public APIs use kernel canonicalization and synchronous metadata; only
|
|
259
|
+
// ancestor existence differs. Promise wrappers preserve asynchronous rejection.
|
|
260
260
|
function traverseRootPath(params, { mode = "native", observation: observationOutput, observeRoot, removalReceipts }) {
|
|
261
261
|
const input = captureValidRootPathInputs(params);
|
|
262
262
|
const rawAbsolutePath = absolutePathWithRawSegments(input.absolutePath);
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import { type BigIntStats } from "node:fs";
|
|
2
|
+
import { type AsyncDirectoryGuard } from "./directory-guard.js";
|
|
1
3
|
export declare function resolveCallbackTempPath(workspaceDir: string, component: string): string;
|
|
2
4
|
export declare function writeCallbackSibling<T>(params: {
|
|
3
5
|
tempDir: string;
|
|
4
6
|
tempName: string;
|
|
7
|
+
rootBoundary?: AsyncDirectoryGuard<BigIntStats>;
|
|
5
8
|
write: (tempPath: string) => Promise<T>;
|
|
6
9
|
producerIsolation?: "private-directory";
|
|
7
10
|
resolveFinalPath: (result: T) => string;
|
|
@@ -13,6 +13,7 @@ import { cachedNoReplaceDevice, isNoReplaceUnavailable } from "./native-noreplac
|
|
|
13
13
|
import { handoffPrivateProducerFile, } from "./private-producer-handoff.js";
|
|
14
14
|
import { resolveReadOpenFlags } from "./read-open-flags.js";
|
|
15
15
|
import { rootFromDirectoryGuard } from "./root-impl.js";
|
|
16
|
+
import { admitPathInsideRoot } from "./root-boundary.js";
|
|
16
17
|
import { inspectFileIdentitySync } from "./strict-file-identity.js";
|
|
17
18
|
import { registerTempPathForExit } from "./temp-cleanup.js";
|
|
18
19
|
import { createOwnedTempFile } from "./temp-target.js";
|
|
@@ -160,10 +161,22 @@ export async function writeCallbackSibling(params) {
|
|
|
160
161
|
const maxBytes = params.maxBytes;
|
|
161
162
|
const syncTempFile = params.syncTempFile;
|
|
162
163
|
const syncParentDir = params.syncParentDir;
|
|
164
|
+
const rootBoundary = params.rootBoundary;
|
|
163
165
|
const guard = await createAsyncDirectoryGuard(parent, { bigint: true });
|
|
164
|
-
const assertParent = () =>
|
|
165
|
-
|
|
166
|
-
|
|
166
|
+
const assertParent = () => {
|
|
167
|
+
assertDirectoryIdentitySync(parent, {
|
|
168
|
+
dev: guard.stat.dev, ino: guard.stat.ino, realPath: guard.realPath,
|
|
169
|
+
});
|
|
170
|
+
if (rootBoundary) {
|
|
171
|
+
assertDirectoryIdentitySync(rootBoundary.dir, {
|
|
172
|
+
dev: rootBoundary.stat.dev, ino: rootBoundary.stat.ino, realPath: rootBoundary.realPath,
|
|
173
|
+
});
|
|
174
|
+
if (!admitPathInsideRoot({
|
|
175
|
+
rootPath: rootBoundary.realPath, candidatePath: guard.realPath, rootIdentity: rootBoundary.stat,
|
|
176
|
+
}))
|
|
177
|
+
throw new FsSafeError("outside-workspace", "sibling parent resolves outside the root");
|
|
178
|
+
}
|
|
179
|
+
};
|
|
167
180
|
let handle;
|
|
168
181
|
let identity;
|
|
169
182
|
let unregister;
|
|
@@ -181,6 +194,8 @@ export async function writeCallbackSibling(params) {
|
|
|
181
194
|
}
|
|
182
195
|
};
|
|
183
196
|
try {
|
|
197
|
+
if (rootBoundary)
|
|
198
|
+
assertParent();
|
|
184
199
|
let result;
|
|
185
200
|
if (producerIsolation === "private-directory") {
|
|
186
201
|
const isolated = await writeIsolatedProducer({
|
|
@@ -116,14 +116,19 @@ export function guardedHintChanges(scopes, before, after, hints, observed, limit
|
|
|
116
116
|
return undefined;
|
|
117
117
|
const result = new Map(observed.map(change => [change.path, change]));
|
|
118
118
|
for (const hint of hints) {
|
|
119
|
-
//
|
|
120
|
-
//
|
|
119
|
+
// A consumer can observe a transient child between our scans. Invalidate
|
|
120
|
+
// its admitted parent without publishing an unobserved backend spelling.
|
|
121
121
|
if (!before?.entries.has(hint.path) && !after.entries.has(hint.path) && !scopes.some(scope => scope.path === hint.path)) {
|
|
122
122
|
const parent = path.dirname(hint.path);
|
|
123
123
|
const directory = parent === "." ? "" : parent;
|
|
124
124
|
const left = before?.directories.get(directory), right = after.directories.get(directory);
|
|
125
|
-
if (left && right && left.dev === right.dev && left.ino === right.ino)
|
|
125
|
+
if (left && right && left.dev === right.dev && left.ino === right.ino) {
|
|
126
|
+
for (const change of scopedChanges(scopes, { path: directory, type: "structural" })) {
|
|
127
|
+
if (!addChange(result, change, limit))
|
|
128
|
+
return undefined;
|
|
129
|
+
}
|
|
126
130
|
continue;
|
|
131
|
+
}
|
|
127
132
|
return undefined;
|
|
128
133
|
}
|
|
129
134
|
// Equal snapshots cannot exclude an intermediate change and restoration (ABA).
|
|
Binary file
|
|
@@ -55,6 +55,8 @@ function getFsSafeNativeConfig(): FsSafeNativeConfig;
|
|
|
55
55
|
```
|
|
56
56
|
|
|
57
57
|
Return the effective configuration: programmatic overrides win, then env vars, then the package default (`auto`).
|
|
58
|
+
If only a removed Python-mode variable is configured, configuration reads and
|
|
59
|
+
native operations throw an actionable migration error instead of using the default.
|
|
58
60
|
|
|
59
61
|
## `getFsSafeNativeStatus(options?)`
|
|
60
62
|
|
|
@@ -185,7 +187,11 @@ FS_SAFE_NATIVE_MODE=auto # auto | off | require | true | false | on | 1 | 0
|
|
|
185
187
|
### Removed Python-helper configuration
|
|
186
188
|
|
|
187
189
|
The deprecated Python configuration bridge and its environment variables have
|
|
188
|
-
been removed.
|
|
190
|
+
been removed. Replace `FS_SAFE_PYTHON_MODE` with `FS_SAFE_NATIVE_MODE` and
|
|
191
|
+
`OPENCLAW_FS_SAFE_PYTHON_MODE` with `OPENCLAW_FS_SAFE_NATIVE_MODE`, preserving the
|
|
192
|
+
value. Without a valid native override, either legacy mode variable raises a
|
|
193
|
+
migration error. Explicit native settings still win over leftover legacy settings.
|
|
194
|
+
Use `configureFsSafeNative()` for a programmatic override. See the
|
|
189
195
|
[0.5 migration checklist](migrating-to-0.5.md#2-replace-python-helper-configuration)
|
|
190
196
|
for the migration path.
|
|
191
197
|
|
|
@@ -271,6 +271,16 @@ creates the guarded destination name from the admitted source descriptor. Linux
|
|
|
271
271
|
uses FICLONE and copy_file_range. Windows and native-disabled operation copy
|
|
272
272
|
bytes; they cannot satisfy `"always"`.
|
|
273
273
|
|
|
274
|
+
On Btrfs, explicit `"auto"` and `"always"` file copies match the source's NOCOW
|
|
275
|
+
flag on the newly created empty destination before cloning. This can override
|
|
276
|
+
NOCOW inherited from the destination directory, in either direction. Other
|
|
277
|
+
destination flags, including compression policy, are preserved; incompatible
|
|
278
|
+
policy can still prevent cloning. A successful NOCOW clone has no data checksums
|
|
279
|
+
or compression, and shared extents use copy-on-write until they become unshared.
|
|
280
|
+
The source and destination remain independent files. If `"auto"` falls back,
|
|
281
|
+
the clone target is removed and a fresh copy inherits the destination directory's
|
|
282
|
+
ordinary policy. The default `"never"` mode does not change NOCOW flags.
|
|
283
|
+
|
|
274
284
|
The source descriptor remains open through before/after source identity checks.
|
|
275
285
|
Symlink components are rejected; source hardlinks are rejected unless
|
|
276
286
|
`sourceHardlinks: "allow"` is selected. The byte limit is an EOF bound, not a
|
|
@@ -43,10 +43,12 @@ Replace `FS_SAFE_PYTHON_MODE` with `FS_SAFE_NATIVE_MODE`, or
|
|
|
43
43
|
`OPENCLAW_FS_SAFE_PYTHON_MODE` with `OPENCLAW_FS_SAFE_NATIVE_MODE`. Remove
|
|
44
44
|
`pythonPath`, `FS_SAFE_PYTHON`, `OPENCLAW_FS_SAFE_PYTHON`,
|
|
45
45
|
`OPENCLAW_PINNED_PYTHON`, and `OPENCLAW_PINNED_WRITE_PYTHON`; prebuilt native
|
|
46
|
-
binaries need no interpreter.
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
binaries need no interpreter. Preserve the mode value: `require` stays `require`,
|
|
47
|
+
`off` stays `off`, and `auto` stays `auto`. Since 0.23.0 the bridge is removed;
|
|
48
|
+
current builds reject leftover Python-mode variables with a migration error
|
|
49
|
+
unless a valid native policy explicitly overrides them. Versions 0.23.0–0.26.6
|
|
50
|
+
silently ignored them, so migrate before upgrading to those versions too.
|
|
51
|
+
Programmatic native configuration wins, followed by
|
|
50
52
|
`FS_SAFE_NATIVE_MODE`, `OPENCLAW_FS_SAFE_NATIVE_MODE`, and the default `auto`.
|
|
51
53
|
|
|
52
54
|
Choose the production mode deliberately:
|
|
@@ -180,10 +180,12 @@ is authoritative for operation and platform guarantees.
|
|
|
180
180
|
|
|
181
181
|
## Migration from the Python helper
|
|
182
182
|
|
|
183
|
-
The Python configuration bridge
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
183
|
+
The Python configuration bridge was intentionally removed in 0.23.0. A remaining
|
|
184
|
+
`FS_SAFE_PYTHON_MODE` or `OPENCLAW_FS_SAFE_PYTHON_MODE` now raises a migration
|
|
185
|
+
error when no explicit native policy is selected; it never silently selects `auto`.
|
|
186
|
+
Replace either variable with its corresponding `NATIVE_MODE` name and preserve
|
|
187
|
+
the value (`require` → `require`, `off` → `off`, `auto` → `auto`), or call
|
|
188
|
+
`configureFsSafeNative()` explicitly before using fs-safe. Follow the
|
|
187
189
|
[0.5 migration checklist](migrating-to-0.5.md#2-replace-python-helper-configuration)
|
|
188
190
|
for the removed settings and current precedence.
|
|
189
191
|
|
|
@@ -99,8 +99,10 @@ boundary and same-filesystem atomic replacement is required. After the callback
|
|
|
99
99
|
returns, fs-safe pins and validates the staged regular file, rejects hardlinks
|
|
100
100
|
and size-limit violations, applies `mode`, fsyncs it, and atomically renames it
|
|
101
101
|
over the target. Existing files and symlink entries are replaced without
|
|
102
|
-
following their contents or referents. The
|
|
103
|
-
|
|
102
|
+
following their contents or referents. The canonical root identity and the
|
|
103
|
+
parent's containment are checked before invoking the producer and throughout
|
|
104
|
+
publication, including redirects before the parent guard is captured. The
|
|
105
|
+
parent identity is guarded across the operation and the parent directory is synchronized best-effort after
|
|
104
106
|
rename. If an error leaves the sibling temp in place and immediate cleanup
|
|
105
107
|
fails, its verified identity remains registered for a best-effort process-exit
|
|
106
108
|
cleanup retry.
|
|
@@ -17,6 +17,15 @@ path components.
|
|
|
17
17
|
case since `5ddca80`. Exposure is limited to consumers that call
|
|
18
18
|
`resolveRootPath()` or `resolveRootPathSync()` directly.
|
|
19
19
|
|
|
20
|
+
Releases through 0.26.5 also mishandle symlink targets containing another
|
|
21
|
+
symlink followed by `..`. Synchronous resolvers can admit an existing outside
|
|
22
|
+
target as an unrelated in-root path; both synchronous and asynchronous resolvers
|
|
23
|
+
can misresolve a missing target. The pending fix uses kernel canonicalization
|
|
24
|
+
for symlink hops and existing ancestors before interpreting a missing suffix.
|
|
25
|
+
Parent steps after unresolved components fail closed.
|
|
26
|
+
Acyclic chains of dangling symlinks still resolve to a missing-path result.
|
|
27
|
+
`resolveLocalPathFromRootsSync()` shares the synchronous fix.
|
|
28
|
+
|
|
20
29
|
## Threat model
|
|
21
30
|
|
|
22
31
|
You hand a `root()` boundary to a piece of code that takes caller-controlled relative paths. The library defends against a caller that:
|
|
@@ -211,6 +211,10 @@ backend loss, and batches without filenames still receive a full guarded pass.
|
|
|
211
211
|
The periodic timer is independent of event traffic, so frequent hints cannot defer
|
|
212
212
|
the full missed-event check. Repeated passes reuse bounded pathname strings, never
|
|
213
213
|
cached metadata or filesystem authority.
|
|
214
|
+
On Windows with the native helper, each listing fence obtains exact directory
|
|
215
|
+
identity and physical path from one short-lived handle. Native-off and POSIX
|
|
216
|
+
scans retain the JavaScript checks. Both paths recheck the Root and reject
|
|
217
|
+
substituted directories or redirected ancestors at the same fences.
|
|
214
218
|
When polling is selected, the interval is `pollIntervalMs`, then `intervalMs`,
|
|
215
219
|
then 1000 ms, in that order. This applies to explicit `mode: "poll"`, `auto`
|
|
216
220
|
selecting polling, and `auto` falling back after an unsupported event backend.
|
|
@@ -242,7 +246,9 @@ observe a selected sentinel edit and drain its trailing events.
|
|
|
242
246
|
Each later pass compares with the previous snapshot, publishes bounded differences,
|
|
243
247
|
and adopts its result as the next snapshot. Vanishing entries, kind changes, and
|
|
244
248
|
transient descendant scan errors produce structural invalidations, preserving the
|
|
245
|
-
Root identity checks.
|
|
249
|
+
Root identity checks. A hinted child absent from both scans invalidates its
|
|
250
|
+
admitted parent, since a consumer may have observed that child between scans.
|
|
251
|
+
The unobserved child spelling is not published. Events during a pass coalesce into one pending pass and
|
|
246
252
|
retain bounded detail regardless of how long the scan takes. The 25 ms hint
|
|
247
253
|
coalescing window does not impose a scan deadline. A full native callback queue
|
|
248
254
|
retains its bounded pending batch for retry. Pending native and JavaScript hint queues degrade to coarse subtree hints when
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/fs-safe",
|
|
3
|
-
"version": "0.26.
|
|
3
|
+
"version": "0.26.7",
|
|
4
4
|
"description": "Capability-style filesystem roots for Node.js apps that handle untrusted relative paths.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"filesystem",
|
|
@@ -157,7 +157,8 @@
|
|
|
157
157
|
"test:coverage:collect": "pnpm build && pnpm archive:wasm:allocator-tests && vitest run --coverage --coverage.reporter=json --coverage.thresholds.lines=0 --coverage.thresholds.functions=0 --coverage.thresholds.statements=0 --coverage.thresholds.branches=0",
|
|
158
158
|
"test:coverage:merge": "node scripts/merge-coverage.mjs",
|
|
159
159
|
"test:security": "vitest run test/fs-safe.test.ts test/read-boundary-bypass.test.ts test/write-boundary-bypass.test.ts test/additional-boundary-bypass.test.ts test/adversarial-boundary-payloads.test.ts",
|
|
160
|
-
"check": "pnpm lint:file-size && pnpm lint:fs-boundary && pnpm
|
|
160
|
+
"check": "pnpm lint:file-size && pnpm lint:fs-boundary && pnpm check:runtime",
|
|
161
|
+
"check:runtime": "pnpm build && pnpm archive:wasm:allocator-tests && pnpm docs:check && pnpm test && node scripts/check-pack.mjs",
|
|
161
162
|
"docs:check": "node scripts/check-doc-examples.mjs",
|
|
162
163
|
"docs:site": "node scripts/build-docs-site.mjs",
|
|
163
164
|
"native:build": "pnpm --filter @openclaw/fs-safe-native-build build",
|
|
@@ -179,23 +180,23 @@
|
|
|
179
180
|
"archive:producer-smoke": "node scripts/archive-producer-smoke.mjs"
|
|
180
181
|
},
|
|
181
182
|
"optionalDependencies": {
|
|
182
|
-
"@openclaw/fs-safe-darwin-arm64": "0.26.
|
|
183
|
-
"@openclaw/fs-safe-darwin-x64": "0.26.
|
|
184
|
-
"@openclaw/fs-safe-freebsd-arm64": "0.26.
|
|
185
|
-
"@openclaw/fs-safe-freebsd-x64": "0.26.
|
|
186
|
-
"@openclaw/fs-safe-linux-arm64-gnu": "0.26.
|
|
187
|
-
"@openclaw/fs-safe-linux-arm64-musl": "0.26.
|
|
188
|
-
"@openclaw/fs-safe-linux-x64-gnu": "0.26.
|
|
189
|
-
"@openclaw/fs-safe-linux-x64-musl": "0.26.
|
|
190
|
-
"@openclaw/fs-safe-win32-arm64-msvc": "0.26.
|
|
191
|
-
"@openclaw/fs-safe-win32-x64-msvc": "0.26.
|
|
183
|
+
"@openclaw/fs-safe-darwin-arm64": "0.26.7",
|
|
184
|
+
"@openclaw/fs-safe-darwin-x64": "0.26.7",
|
|
185
|
+
"@openclaw/fs-safe-freebsd-arm64": "0.26.7",
|
|
186
|
+
"@openclaw/fs-safe-freebsd-x64": "0.26.7",
|
|
187
|
+
"@openclaw/fs-safe-linux-arm64-gnu": "0.26.7",
|
|
188
|
+
"@openclaw/fs-safe-linux-arm64-musl": "0.26.7",
|
|
189
|
+
"@openclaw/fs-safe-linux-x64-gnu": "0.26.7",
|
|
190
|
+
"@openclaw/fs-safe-linux-x64-musl": "0.26.7",
|
|
191
|
+
"@openclaw/fs-safe-win32-arm64-msvc": "0.26.7",
|
|
192
|
+
"@openclaw/fs-safe-win32-x64-msvc": "0.26.7",
|
|
192
193
|
"jszip": "^3.10.2"
|
|
193
194
|
},
|
|
194
195
|
"devDependencies": {
|
|
195
|
-
"@emnapi/runtime": "2.0.0-
|
|
196
|
+
"@emnapi/runtime": "2.0.0-beta.1",
|
|
196
197
|
"@napi-rs/cli": "3.10.8",
|
|
197
198
|
"@types/node": "^26.6.5",
|
|
198
|
-
"@vitest/coverage-v8": "5.0.
|
|
199
|
+
"@vitest/coverage-v8": "5.0.4",
|
|
199
200
|
"fast-check": "^4.10.2",
|
|
200
201
|
"istanbul-lib-coverage": "3.2.2",
|
|
201
202
|
"istanbul-lib-report": "3.0.1",
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/feishu",
|
|
3
|
-
"version": "2026.11.
|
|
3
|
+
"version": "2026.11.4",
|
|
4
4
|
"description": "OpenClaw Feishu/Lark channel plugin for chats and workplace tools (community maintained by @m1heng).",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"type": "module",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@larksuiteoapi/node-sdk": "1.74.0",
|
|
12
|
-
"@openclaw/fs-safe": "0.26.
|
|
12
|
+
"@openclaw/fs-safe": "0.26.7",
|
|
13
13
|
"mdast-util-from-markdown": "2.1.0",
|
|
14
14
|
"mdast-util-gfm-table": "2.0.0",
|
|
15
15
|
"micromark-extension-gfm-table": "2.1.2",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"zod": "4.6.5"
|
|
18
18
|
},
|
|
19
19
|
"peerDependencies": {
|
|
20
|
-
"openclaw": ">=2026.11.
|
|
20
|
+
"openclaw": ">=2026.11.4"
|
|
21
21
|
},
|
|
22
22
|
"peerDependenciesMeta": {
|
|
23
23
|
"openclaw": {
|
|
@@ -64,11 +64,11 @@
|
|
|
64
64
|
"minHostVersion": ">=2026.5.29"
|
|
65
65
|
},
|
|
66
66
|
"compat": {
|
|
67
|
-
"pluginApi": ">=2026.11.
|
|
67
|
+
"pluginApi": ">=2026.11.4"
|
|
68
68
|
},
|
|
69
69
|
"build": {
|
|
70
70
|
"bundledDist": false,
|
|
71
|
-
"openclawVersion": "2026.11.
|
|
71
|
+
"openclawVersion": "2026.11.4"
|
|
72
72
|
},
|
|
73
73
|
"release": {
|
|
74
74
|
"publishToClawHub": true,
|