@openclaw/feishu 2026.10.10-beta.5 → 2026.10.33
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-CY13hxu8.mjs → channel-6bBLGirS.mjs} +2 -2
- package/dist/.setup/{channel.runtime-gTMUHJAe.mjs → channel.runtime-CwfDpLtc.mjs} +1 -1
- package/dist/.setup/{monitor-CJ0xKz5A.mjs → monitor-By0Z9Afk.mjs} +1 -1
- package/dist/.setup/{monitor.account-DRqaexjx.mjs → monitor.account-Do-D6JD-.mjs} +50 -47
- package/dist/.setup/runtime-setter-api-CG-RC4_r.mjs +3 -0
- package/dist/.setup/secret-contract-api-DsHOG5s6.mjs +3 -0
- package/dist/.setup/setup-api-DtPp-6Ar.mjs +3 -0
- package/dist/api.js +1 -1
- package/dist/channel-plugin-api.js +2 -1
- package/dist/doctor-contract-api.js +2 -1
- package/dist/runtime-setter-api.js +2 -1
- package/dist/secret-contract-api.js +2 -1
- package/dist/security-contract-api.js +2 -1
- package/dist/session-binding-contract-api.js +2 -1
- package/dist/session-key-api.js +2 -1
- package/dist/setup-api.js +2 -1
- package/dist/setup-entry.js +3 -3
- 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
- package/dist/.setup/runtime-setter-api-BrQHE03y.mjs +0 -2
- package/dist/.setup/secret-contract-api-XhxLE0dW.mjs +0 -2
- package/dist/.setup/setup-api-sm3s4wvX.mjs +0 -2
- package/dist/.source-module-urls/6579f1b33dd01f8f0aaea28311ed6df1a635f9ad1e6fa86dcba53bca46407e55.json +0 -1
|
@@ -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";
|
|
@@ -1013,18 +1013,6 @@ function truncateSummary(text, max = 50) {
|
|
|
1013
1013
|
function shouldPushStreamingUpdate(previousText, nextText) {
|
|
1014
1014
|
return !previousText || /[\n。!?!?;;::]$/.test(nextText) || nextText.length - previousText.length >= STREAMING_SIGNIFICANT_DELTA_CHARS;
|
|
1015
1015
|
}
|
|
1016
|
-
/** Merges cumulative or overlapping streaming snapshots without duplicating content. */
|
|
1017
|
-
function mergeStreamingText(previousText, nextText) {
|
|
1018
|
-
const previous = typeof previousText === "string" ? previousText : "";
|
|
1019
|
-
const next = typeof nextText === "string" ? nextText : "";
|
|
1020
|
-
if (!next) return previous;
|
|
1021
|
-
if (!previous || next === previous) return next;
|
|
1022
|
-
if (next.includes(previous)) return next;
|
|
1023
|
-
if (previous.includes(next)) return previous;
|
|
1024
|
-
const maxOverlap = Math.min(previous.length, next.length);
|
|
1025
|
-
for (let overlap = maxOverlap; overlap > 0; overlap -= 1) if (previous.slice(-overlap) === next.slice(0, overlap)) return `${previous}${next.slice(overlap)}`;
|
|
1026
|
-
return `${previous}${next}`;
|
|
1027
|
-
}
|
|
1028
1016
|
var FeishuStreamingSession = class {
|
|
1029
1017
|
constructor(client, creds, log) {
|
|
1030
1018
|
this.state = null;
|
|
@@ -1517,7 +1505,6 @@ function createFeishuReplyDispatcher(params) {
|
|
|
1517
1505
|
let reasoningText = "";
|
|
1518
1506
|
let statusLine = "";
|
|
1519
1507
|
let snapshotBaseText = "";
|
|
1520
|
-
let lastSnapshotTextLength = 0;
|
|
1521
1508
|
let hasStreamingFinalText = false;
|
|
1522
1509
|
const deliveredFinalTexts = /* @__PURE__ */ new Set();
|
|
1523
1510
|
let lastStreamingSettlement;
|
|
@@ -1555,14 +1542,7 @@ function createFeishuReplyDispatcher(params) {
|
|
|
1555
1542
|
if (options?.dedupeWithLastPartial && nextText === lastPartial) return;
|
|
1556
1543
|
if (options?.dedupeWithLastPartial) lastPartial = nextText;
|
|
1557
1544
|
if ((options?.mode ?? "snapshot") === "delta") streamText = `${streamText}${nextText}`;
|
|
1558
|
-
else {
|
|
1559
|
-
const currentSnapshotText = snapshotBaseText ? streamText.slice(snapshotBaseText.length) : streamText;
|
|
1560
|
-
if (lastSnapshotTextLength >= 20 && nextText.length < lastSnapshotTextLength * .5 && !currentSnapshotText.includes(nextText)) {
|
|
1561
|
-
snapshotBaseText = streamText;
|
|
1562
|
-
streamText = `${snapshotBaseText}${nextText}`;
|
|
1563
|
-
} else streamText = `${snapshotBaseText}${mergeStreamingText(currentSnapshotText, nextText)}`;
|
|
1564
|
-
lastSnapshotTextLength = nextText.length;
|
|
1565
|
-
}
|
|
1545
|
+
else streamText = `${snapshotBaseText}${nextText}`;
|
|
1566
1546
|
flushStreamingCardUpdate(buildCombinedStreamText(reasoningText, streamText));
|
|
1567
1547
|
};
|
|
1568
1548
|
const startStreaming = () => {
|
|
@@ -1608,7 +1588,6 @@ function createFeishuReplyDispatcher(params) {
|
|
|
1608
1588
|
reasoningText = "";
|
|
1609
1589
|
statusLine = "";
|
|
1610
1590
|
snapshotBaseText = "";
|
|
1611
|
-
lastSnapshotTextLength = 0;
|
|
1612
1591
|
hasStreamingFinalText = false;
|
|
1613
1592
|
};
|
|
1614
1593
|
const performStreamingClose = async (disposition) => {
|
|
@@ -2021,7 +2000,7 @@ function createFeishuReplyDispatcher(params) {
|
|
|
2021
2000
|
...payload,
|
|
2022
2001
|
text: payloadText
|
|
2023
2002
|
});
|
|
2024
|
-
const text = info?.kind === "final" && !hasIndependentPresentation ? mergeStreamingFinalText(streamText, reply.text
|
|
2003
|
+
const text = info?.kind === "final" && !hasIndependentPresentation ? mergeStreamingFinalText(streamText, payload.isError ? reply.text : `${snapshotBaseText}${reply.text}`, payload.isError === true && hasStreamingFinalText) : reply.text;
|
|
2025
2004
|
const hasText = reply.hasText;
|
|
2026
2005
|
const hasMedia = reply.hasMedia;
|
|
2027
2006
|
const ttsSupplement = getReplyPayloadTtsSupplement(payload);
|
|
@@ -2076,7 +2055,7 @@ function createFeishuReplyDispatcher(params) {
|
|
|
2076
2055
|
}
|
|
2077
2056
|
if (shouldDeliverText) {
|
|
2078
2057
|
if (hasPresentationFallback || info?.kind === "block" && !useStreamingCard) {
|
|
2079
|
-
if (hasPresentationFallback || coreBlockStreamingEnabled) {
|
|
2058
|
+
if (hasPresentationFallback || coreBlockStreamingEnabled || hasMedia) {
|
|
2080
2059
|
const firstChunkMentions = info?.kind === "final" || info?.kind === "block" && !sentIndependentBlockText ? mentionTargets : void 0;
|
|
2081
2060
|
await collectDelivery(sendPostReply(text, info?.kind, firstChunkMentions));
|
|
2082
2061
|
if (info?.kind === "block") sentIndependentBlockText = true;
|
|
@@ -2098,8 +2077,6 @@ function createFeishuReplyDispatcher(params) {
|
|
|
2098
2077
|
if (info?.kind === "final") {
|
|
2099
2078
|
streamText = text;
|
|
2100
2079
|
hasStreamingFinalText = true;
|
|
2101
|
-
snapshotBaseText = "";
|
|
2102
|
-
lastSnapshotTextLength = text.length;
|
|
2103
2080
|
flushStreamingCardUpdate(buildCombinedStreamText(reasoningText, streamText));
|
|
2104
2081
|
}
|
|
2105
2082
|
}
|
|
@@ -2135,6 +2112,7 @@ function createFeishuReplyDispatcher(params) {
|
|
|
2135
2112
|
replyOptions: {
|
|
2136
2113
|
onModelSelected,
|
|
2137
2114
|
disableBlockStreaming: !coreBlockStreamingEnabled,
|
|
2115
|
+
preserveProgressCallbackStartOrder: previewStreamingEnabled ? true : void 0,
|
|
2138
2116
|
onPartialReply: previewStreamingEnabled ? (payload) => {
|
|
2139
2117
|
if (!payload.text) return false;
|
|
2140
2118
|
const cleaned = stripReasoningTagsFromText(payload.text, {
|
|
@@ -2171,7 +2149,11 @@ function createFeishuReplyDispatcher(params) {
|
|
|
2171
2149
|
if (statusLineLocal) return updateStreamingStatusLine(statusLineLocal);
|
|
2172
2150
|
return false;
|
|
2173
2151
|
} : void 0,
|
|
2174
|
-
onAssistantMessageStart: previewStreamingEnabled ? () =>
|
|
2152
|
+
onAssistantMessageStart: previewStreamingEnabled ? () => {
|
|
2153
|
+
snapshotBaseText = streamText ? `${streamText}\n\n` : "";
|
|
2154
|
+
lastPartial = "";
|
|
2155
|
+
return updateStreamingStatusLine("", false);
|
|
2156
|
+
} : void 0,
|
|
2175
2157
|
onCompactionStart: previewStreamingEnabled ? () => updateStreamingStatusLine("📦 **Compacting context...**") : void 0,
|
|
2176
2158
|
onCompactionEnd: previewStreamingEnabled ? () => updateStreamingStatusLine("") : void 0
|
|
2177
2159
|
},
|
|
@@ -2997,7 +2979,7 @@ async function handleFeishuMessage(params) {
|
|
|
2997
2979
|
readAllowFromStore: pairing.readAllowFromStore,
|
|
2998
2980
|
senderOpenId: ctx.senderOpenId,
|
|
2999
2981
|
senderUserId,
|
|
3000
|
-
conversationId: ctx.
|
|
2982
|
+
conversationId: ctx.chatId,
|
|
3001
2983
|
mayPair: false,
|
|
3002
2984
|
contextBinding
|
|
3003
2985
|
});
|
|
@@ -3368,8 +3350,15 @@ function buildFeishuActionCard(params) {
|
|
|
3368
3350
|
tag: "markdown",
|
|
3369
3351
|
content: params.content
|
|
3370
3352
|
}, {
|
|
3371
|
-
tag: "
|
|
3372
|
-
|
|
3353
|
+
tag: "column_set",
|
|
3354
|
+
flex_mode: "none",
|
|
3355
|
+
horizontal_spacing: "default",
|
|
3356
|
+
columns: params.actions.map((button) => ({
|
|
3357
|
+
tag: "column",
|
|
3358
|
+
width: "auto",
|
|
3359
|
+
vertical_align: "center",
|
|
3360
|
+
elements: [button]
|
|
3361
|
+
}))
|
|
3373
3362
|
}] }
|
|
3374
3363
|
};
|
|
3375
3364
|
}
|
|
@@ -3496,6 +3485,15 @@ async function dispatchSyntheticCommand(params) {
|
|
|
3496
3485
|
chatType: params.chatType,
|
|
3497
3486
|
log: params.runtime?.log ?? console.log
|
|
3498
3487
|
});
|
|
3488
|
+
if (!resolvedChatType) {
|
|
3489
|
+
await sendMessageFeishu({
|
|
3490
|
+
cfg: params.cfg,
|
|
3491
|
+
to: resolveCallbackTarget(params.event),
|
|
3492
|
+
text: "⚠️ Could not verify this chat's conversation type, so this action was not run. Try clicking again later.",
|
|
3493
|
+
accountId: params.account.accountId
|
|
3494
|
+
});
|
|
3495
|
+
return;
|
|
3496
|
+
}
|
|
3499
3497
|
await handleFeishuMessage({
|
|
3500
3498
|
trackTask: params.trackTask,
|
|
3501
3499
|
cfg: params.cfg,
|
|
@@ -3508,9 +3506,6 @@ async function dispatchSyntheticCommand(params) {
|
|
|
3508
3506
|
}
|
|
3509
3507
|
const CHAT_TYPE_CACHE_TTL_MS = 18e5;
|
|
3510
3508
|
const CHAT_TYPE_CACHE_MAX_SIZE = 5e3;
|
|
3511
|
-
function sanitizeLogValue(v) {
|
|
3512
|
-
return truncateUtf16Safe(v.replace(/[\r\n]/g, " "), 500);
|
|
3513
|
-
}
|
|
3514
3509
|
function cacheResolvedCardActionChatType(cacheKey, value, now) {
|
|
3515
3510
|
const expiresAt = resolveExpiresAtMsFromDurationMs(CHAT_TYPE_CACHE_TTL_MS, { nowMs: now });
|
|
3516
3511
|
resolvedCardActionChatTypes.delete(cacheKey);
|
|
@@ -3538,13 +3533,11 @@ async function resolveCardActionChatType(params) {
|
|
|
3538
3533
|
cacheResolvedCardActionChatType(cacheKey, resolvedChatType, now);
|
|
3539
3534
|
return resolvedChatType;
|
|
3540
3535
|
}
|
|
3541
|
-
params.log(`feishu[${params.account.accountId}]: card action
|
|
3542
|
-
} else params.log(`feishu[${params.account.accountId}]:
|
|
3543
|
-
} catch
|
|
3544
|
-
|
|
3545
|
-
params.log(`feishu[${params.account.accountId}]: failed to resolve chat type: ${sanitizeLogValue(message)}; defaulting to p2p`);
|
|
3536
|
+
params.log(`feishu[${params.account.accountId}]: card action chat type unavailable; action refused`);
|
|
3537
|
+
} else params.log(`feishu[${params.account.accountId}]: card action chat type unavailable; action refused`);
|
|
3538
|
+
} catch {
|
|
3539
|
+
params.log(`feishu[${params.account.accountId}]: card action chat type unavailable; action refused`);
|
|
3546
3540
|
}
|
|
3547
|
-
return "p2p";
|
|
3548
3541
|
}
|
|
3549
3542
|
async function handleFeishuCardAction(params) {
|
|
3550
3543
|
const { cfg, event, runtime, accountId } = params;
|
|
@@ -3595,6 +3588,21 @@ async function handleFeishuCardAction(params) {
|
|
|
3595
3588
|
await sendInvalidInteractionNotice("malformed");
|
|
3596
3589
|
return;
|
|
3597
3590
|
}
|
|
3591
|
+
const chatType = await resolveCardActionChatType({
|
|
3592
|
+
event,
|
|
3593
|
+
account,
|
|
3594
|
+
chatType: envelope.c?.t,
|
|
3595
|
+
log
|
|
3596
|
+
});
|
|
3597
|
+
if (!chatType) {
|
|
3598
|
+
await sendMessageFeishu({
|
|
3599
|
+
cfg,
|
|
3600
|
+
to: resolveCallbackTarget(event),
|
|
3601
|
+
text: "⚠️ Could not verify this chat's conversation type, so this action was not run. Try clicking again later.",
|
|
3602
|
+
accountId
|
|
3603
|
+
});
|
|
3604
|
+
return;
|
|
3605
|
+
}
|
|
3598
3606
|
await sendCardFeishu({
|
|
3599
3607
|
cfg,
|
|
3600
3608
|
to: resolveCallbackTarget(event),
|
|
@@ -3605,12 +3613,7 @@ async function handleFeishuCardAction(params) {
|
|
|
3605
3613
|
prompt,
|
|
3606
3614
|
sessionKey: envelope.c?.s,
|
|
3607
3615
|
expiresAt,
|
|
3608
|
-
chatType
|
|
3609
|
-
event,
|
|
3610
|
-
account,
|
|
3611
|
-
chatType: envelope.c?.t,
|
|
3612
|
-
log
|
|
3613
|
-
}),
|
|
3616
|
+
chatType,
|
|
3614
3617
|
confirmLabel: command === "/reset" ? "Reset" : "Confirm"
|
|
3615
3618
|
}),
|
|
3616
3619
|
accountId
|
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 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { t as feishuPlugin } from "./.setup/channel-6bBLGirS.mjs";
|
|
2
|
+
export { feishuPlugin };
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { i as normalizeHistoricalWebhookConfig, n as legacyConfigRules, r as normalizeCompatibilityConfig, t as historicalWebhookListener } from "./.setup/doctor-contract-BNXcJcWR.mjs";
|
|
2
|
+
export { historicalWebhookListener, legacyConfigRules, normalizeCompatibilityConfig, normalizeHistoricalWebhookConfig };
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { n as setFeishuRuntime } from "./.setup/runtime-C5JxBWZp.mjs";
|
|
2
|
+
export { setFeishuRuntime };
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries, t as channelSecrets } from "./.setup/secret-contract-DEyvsehF.mjs";
|
|
2
|
+
export { channelSecrets, collectRuntimeConfigAssignments, secretTargetRegistryEntries };
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { t as collectFeishuSecurityAuditFindings } from "./.setup/security-audit-b86aSgH2.mjs";
|
|
2
|
+
export { collectFeishuSecurityAuditFindings };
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { t as createFeishuThreadBindingManager } from "./.setup/thread-bindings-BxKmOara.mjs";
|
|
2
|
+
export { createFeishuThreadBindingManager };
|
package/dist/session-key-api.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { t as resolveFeishuSessionConversation } from "./.setup/session-conversation-BSBNK5Mq.mjs";
|
|
2
|
+
export { resolveFeishuSessionConversation as resolveSessionConversation };
|
package/dist/setup-api.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { i as feishuSetupAdapter, n as feishuSetupWizard, t as feishuPlugin } from "./.setup/channel-6bBLGirS.mjs";
|
|
2
|
+
export { feishuPlugin, feishuSetupAdapter, feishuSetupWizard };
|
package/dist/setup-entry.js
CHANGED
|
@@ -4,15 +4,15 @@ 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: {
|
|
11
|
-
specifier: fileURLToPath(new URL(".setup/secret-contract-api-
|
|
11
|
+
specifier: fileURLToPath(new URL(".setup/secret-contract-api-DsHOG5s6.mjs", import.meta.url).href),
|
|
12
12
|
exportName: "channelSecrets"
|
|
13
13
|
},
|
|
14
14
|
runtime: {
|
|
15
|
-
specifier: fileURLToPath(new URL(".setup/runtime-setter-api-
|
|
15
|
+
specifier: fileURLToPath(new URL(".setup/runtime-setter-api-CG-RC4_r.mjs", import.meta.url).href),
|
|
16
16
|
exportName: "setFeishuRuntime"
|
|
17
17
|
}
|
|
18
18
|
});
|
|
@@ -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.10.
|
|
3
|
+
"version": "2026.10.33",
|
|
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.
|
|
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.
|
|
67
|
+
"pluginApi": ">=2026.11.4"
|
|
68
68
|
},
|
|
69
69
|
"build": {
|
|
70
70
|
"bundledDist": false,
|
|
71
|
-
"openclawVersion": "2026.10.
|
|
71
|
+
"openclawVersion": "2026.10.33"
|
|
72
72
|
},
|
|
73
73
|
"release": {
|
|
74
74
|
"publishToClawHub": true,
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"entries":[{"output":"api.js","source":"extensions/feishu/api.ts"},{"output":"channel-entry.js","source":"extensions/feishu/channel-entry.ts"},{"output":"channel-plugin-api.js","source":"extensions/feishu/channel-plugin-api.ts"},{"output":"configured-state.js","source":"extensions/feishu/configured-state.ts"},{"output":"contract-api.js","source":"extensions/feishu/contract-api.ts"},{"output":"doctor-contract-api.js","source":"extensions/feishu/doctor-contract-api.ts"},{"output":"index.js","source":"extensions/feishu/index.ts"},{"output":"runtime-api.js","source":"extensions/feishu/runtime-api.ts"},{"output":"runtime-setter-api.js","source":"extensions/feishu/runtime-setter-api.ts"},{"output":"secret-contract-api.js","source":"extensions/feishu/secret-contract-api.ts"},{"output":"security-contract-api.js","source":"extensions/feishu/security-contract-api.ts"},{"output":"session-binding-contract-api.js","source":"extensions/feishu/session-binding-contract-api.ts"},{"output":"session-key-api.js","source":"extensions/feishu/session-key-api.ts"},{"output":"setup-api.js","source":"extensions/feishu/setup-api.ts"},{"output":"setup-entry.js","source":"extensions/feishu/setup-entry.ts"},{"output":"subagent-hooks-api.js","source":"extensions/feishu/subagent-hooks-api.ts"}],"chunks":[{"output":".setup/app-registration-CYU0G5Oo.mjs","sha256":"c72a85fa2864a8e5d19938125e7e9cda30f24e3dd02ffc5338e0e27cbd95127d","facadeSource":"extensions/feishu/src/app-registration.ts","sources":["extensions/feishu/src/app-registration.ts"]},{"output":".setup/channel-CY13hxu8.mjs","sha256":"4a76f6f2d4d8fe2f86824eb8c4abba121d7de517154df6291a89e07e1e38a8f1","facadeSource":null,"sources":["extensions/feishu/src/approval-auth.ts","extensions/feishu/src/channel.ts","extensions/feishu/src/comment-send.ts","extensions/feishu/src/directory.static.ts","extensions/feishu/src/doctor-agent-roster.ts","extensions/feishu/src/doctor.ts","extensions/feishu/src/gateway.ts","extensions/feishu/src/outbound.ts","extensions/feishu/src/session-route.ts","extensions/feishu/src/setup-core.ts","extensions/feishu/src/setup-surface.ts","extensions/feishu/src/sticker-catalog.ts","extensions/feishu/src/webhook-route.ts","packages/normalization-core/src/string-coerce.ts","src/gateway/gateway-http-route-contracts.ts","src/gateway/security-path.ts","src/gateway/server/plugins-http/path-context.ts","src/plugins/http-path-prefix.ts"]},{"output":".setup/channel.runtime-gTMUHJAe.mjs","sha256":"6f99c2cc644a769afbf5c78f3dee031c48f7d3134db143b806174fce10bc9029","facadeSource":"extensions/feishu/src/channel.runtime.ts","sources":["extensions/feishu/src/channel.runtime.ts","extensions/feishu/src/directory.ts","extensions/feishu/src/pins.ts","extensions/feishu/src/reactions.ts"]},{"output":".setup/chat-qj1pEIcO.mjs","sha256":"f05c858cebc0507595febed77e47453d6595ea14a7c91828f0b368c01f14dee7","facadeSource":null,"sources":["extensions/feishu/src/chat-schema.ts","extensions/feishu/src/chat.ts"]},{"output":".setup/client-BTiFlqqL.mjs","sha256":"2c61db9f441bc7aa5ad660dea829df4438d8e58022c880de925953c7969052f2","facadeSource":null,"sources":["extensions/feishu/src/client-timeout.ts","extensions/feishu/src/client.ts","extensions/feishu/src/send-context.ts"]},{"output":".setup/conversation-id-D00i9uy5.mjs","sha256":"29b3ace15023a63cfd8efae73065c3f33a83a9a08414510497327cced1f00a4a","facadeSource":null,"sources":["extensions/feishu/src/conversation-id.ts","extensions/feishu/src/targets.ts"]},{"output":".setup/doctor-contract-BNXcJcWR.mjs","sha256":"eb9a0474b22881fe229a16e68c774f39bda58515cd5f8b4176d7778655cd1f7e","facadeSource":null,"sources":["extensions/feishu/src/accounts.ts","extensions/feishu/src/config-schema.ts","extensions/feishu/src/doctor-contract.ts","extensions/feishu/src/external-keys.ts","extensions/feishu/src/webhook-path.ts","packages/normalization-core/src/record-coerce.ts","src/config/channel-config-normalization.ts","src/plugin-sdk/legacy-webhook-listener-migration.ts"]},{"output":".setup/json-response-DXajw_FU.mjs","sha256":"12da2dfb99f465a20dbe02d33ca55a78b8ed74e5c350c42d6c065e2fa4d3ba99","facadeSource":null,"sources":["extensions/feishu/src/json-response.ts"]},{"output":".setup/message-action-contract-Bhxj8Zrf.mjs","sha256":"56a0369786447a3c509a3610df29d81cae95c1e9e00a5b4b83288e0970fc07eb","facadeSource":null,"sources":["extensions/feishu/src/message-action-contract.ts"]},{"output":".setup/monitor-CJ0xKz5A.mjs","sha256":"2febc3c16615f6c478dc633c5830982e9d4805746eb79a784e173d68ebf0f13f","facadeSource":"extensions/feishu/src/monitor.ts","sources":["extensions/feishu/src/bot-identity-cache.ts","extensions/feishu/src/monitor-startup-timeout.ts","extensions/feishu/src/monitor.startup.ts","extensions/feishu/src/monitor.ts"]},{"output":".setup/monitor.account-DRqaexjx.mjs","sha256":"b3a0eab47aad51d45ba24ac0a54c030c408a342ce4d018f0dde7c946e63b18aa","facadeSource":"extensions/feishu/src/monitor.account.ts","sources":["extensions/feishu/src/bot-agent-body.ts","extensions/feishu/src/bot-broadcast.ts","extensions/feishu/src/bot-content.ts","extensions/feishu/src/bot-group-name-state.ts","extensions/feishu/src/bot-group-name.ts","extensions/feishu/src/bot-name.ts","extensions/feishu/src/bot-thread-mentions.ts","extensions/feishu/src/bot.ts","extensions/feishu/src/card-action-state.ts","extensions/feishu/src/card-action.ts","extensions/feishu/src/card-ux-approval.ts","extensions/feishu/src/card-ux-launcher.ts","extensions/feishu/src/card-ux-shared.ts","extensions/feishu/src/comment-dispatcher.ts","extensions/feishu/src/comment-handler.ts","extensions/feishu/src/dedup-state.ts","extensions/feishu/src/dedup.ts","extensions/feishu/src/dedupe-key.ts","extensions/feishu/src/dynamic-agent.ts","extensions/feishu/src/feishu-ingress.ts","extensions/feishu/src/monitor-rate-limit-key.ts","extensions/feishu/src/monitor.account.ts","extensions/feishu/src/monitor.bot-identity.ts","extensions/feishu/src/monitor.bot-menu-handler.ts","extensions/feishu/src/monitor.comment-notice-handler.ts","extensions/feishu/src/monitor.comment.ts","extensions/feishu/src/monitor.message-handler.ts","extensions/feishu/src/monitor.state.ts","extensions/feishu/src/monitor.synthetic-error.ts","extensions/feishu/src/monitor.transport.ts","extensions/feishu/src/monitor.vc-meeting-invited-handler.ts","extensions/feishu/src/reasoning-preview.ts","extensions/feishu/src/reply-dispatcher-state.ts","extensions/feishu/src/reply-dispatcher.ts","extensions/feishu/src/sequential-key.ts","extensions/feishu/src/sequential-queue.ts","extensions/feishu/src/streaming-card.ts","extensions/feishu/src/streaming-update.ts","extensions/feishu/src/synthetic-event-target.ts","extensions/feishu/src/typing-backoff.ts","extensions/feishu/src/typing.ts","src/channels/mention-gating.ts"]},{"output":".setup/probe-s0hiM44D.mjs","sha256":"06b88e71d743305e2e2fd34f2bfbf750e98073abf1a4d9aadc92835c977397f2","facadeSource":null,"sources":["extensions/feishu/src/async.ts","extensions/feishu/src/probe.ts"]},{"output":".setup/reply-delivery-result-DknmIzOB.mjs","sha256":"55163370ea6db52542ac57291ca696bee55b0417c4fea8a40db30294972f41b9","facadeSource":null,"sources":["extensions/feishu/src/api-response.ts","extensions/feishu/src/bot-sender-name.ts","extensions/feishu/src/card-interaction.ts","extensions/feishu/src/chat-type.ts","extensions/feishu/src/comment-reaction.ts","extensions/feishu/src/comment-shared.ts","extensions/feishu/src/comment-target.ts","extensions/feishu/src/configured-client.ts","extensions/feishu/src/drive-schema.ts","extensions/feishu/src/drive.ts","extensions/feishu/src/identity-header.ts","extensions/feishu/src/interactive-message-content.ts","extensions/feishu/src/markdown.ts","extensions/feishu/src/media-chunk-idle.ts","extensions/feishu/src/media-fallback.ts","extensions/feishu/src/media.ts","extensions/feishu/src/mention.ts","extensions/feishu/src/message-content.ts","extensions/feishu/src/native-card.ts","extensions/feishu/src/policy.ts","extensions/feishu/src/post.ts","extensions/feishu/src/presentation-card.ts","extensions/feishu/src/read-policy.ts","extensions/feishu/src/reply-delivery-result.ts","extensions/feishu/src/send-rate-limit.ts","extensions/feishu/src/send-result.ts","extensions/feishu/src/send-target.ts","extensions/feishu/src/send.ts","extensions/feishu/src/tool-account.ts","extensions/feishu/src/tool-registration.ts","extensions/feishu/src/tool-result.ts","extensions/feishu/src/tools-config.ts","extensions/feishu/src/types.ts"]},{"output":".setup/runtime-C5JxBWZp.mjs","sha256":"e15497a9738c244b2498c97b98e65b74e22ad68d9e552d32a87d8dcfc15e5b3e","facadeSource":null,"sources":["extensions/feishu/src/runtime.ts"]},{"output":".setup/runtime-setter-api-BrQHE03y.mjs","sha256":"ac04c67457d89b0cd7f9ad1851c2d23734d66a6d03e9d21dc31dcb8f67358a2a","facadeSource":"extensions/feishu/runtime-setter-api.ts","sources":[]},{"output":".setup/secret-contract-api-XhxLE0dW.mjs","sha256":"6125fa75b4bc124bd5cf7655f496948d3908e3554bfa6d426510f7723ce09e14","facadeSource":"extensions/feishu/secret-contract-api.ts","sources":[]},{"output":".setup/secret-contract-DEyvsehF.mjs","sha256":"227b7070a821274f90c828fc6e8140512cb39f66bda6f6e3d5e4bb644d758b2f","facadeSource":null,"sources":["extensions/feishu/src/secret-contract.ts"]},{"output":".setup/security-audit-b86aSgH2.mjs","sha256":"7072064b78cd0d11485a26c3b002a7a8e37afbd9bf5a00a3e81b0c6da4e583d8","facadeSource":null,"sources":["extensions/feishu/src/security-audit.ts"]},{"output":".setup/session-conversation-BSBNK5Mq.mjs","sha256":"2cfe413f65e5c158b5f1326a9dfc1d18f2809482d1949d452899a13f1d10f392","facadeSource":null,"sources":["extensions/feishu/src/session-conversation.ts"]},{"output":".setup/setup-api-sm3s4wvX.mjs","sha256":"3f492cdf1342d2739275acdad4d434b1515a68f67faa887147e95e6a68a9f453","facadeSource":"extensions/feishu/setup-api.ts","sources":[]},{"output":".setup/subagent-hooks-CvVuM0O4.mjs","sha256":"ba7e360693046831556e2eb0d756573c18163ee7b8c14d0fa7c300a2b45c3a81","facadeSource":null,"sources":["extensions/feishu/src/subagent-hooks.ts"]},{"output":".setup/thread-bindings-BxKmOara.mjs","sha256":"e3aafa5345da185deb6771e66b5b9b3de3e53c4b60368d1478f8edba1d6f2424","facadeSource":null,"sources":["extensions/feishu/src/thread-bindings.ts"]},{"output":"api.js","sha256":"35c98ca7524a2432f2fd688ec3a0bd64c9a8e34c2f20c50947ed257bc3b7f5d1","facadeSource":"extensions/feishu/api.ts","sources":["extensions/feishu/src/bitable.ts","extensions/feishu/src/doc-schema.ts","extensions/feishu/src/docx-batch-insert.ts","extensions/feishu/src/docx-color-text.ts","extensions/feishu/src/docx-markdown.ts","extensions/feishu/src/docx-table-ops.ts","extensions/feishu/src/docx-upload-input.ts","extensions/feishu/src/docx.ts","extensions/feishu/src/perm-schema.ts","extensions/feishu/src/perm.ts","extensions/feishu/src/wiki-schema.ts","extensions/feishu/src/wiki.ts"]},{"output":"channel-entry.js","sha256":"d6944f7c3ba5a235e4fc4323a7e2b95943eb4b0bf97a4e804da843469b2b0a05","facadeSource":"extensions/feishu/channel-entry.ts","sources":["extensions/feishu/channel-entry.ts"]},{"output":"channel-plugin-api.js","sha256":"6293d7377788efc253b8f0c834d9b2c221681254a480483bdee71a0467961b5a","facadeSource":"extensions/feishu/channel-plugin-api.ts","sources":[]},{"output":"configured-state.js","sha256":"7012f87a9f29cd5fb4d016c58d1ac9e1df190fc9ea2d1e87f7b6b6642a91503b","facadeSource":"extensions/feishu/configured-state.ts","sources":["extensions/feishu/configured-state.ts"]},{"output":"contract-api.js","sha256":"b50feb45842abc80ee1092d2b400328253eca9de4d6b88ad756b568b44f735d8","facadeSource":"extensions/feishu/contract-api.ts","sources":[]},{"output":"doctor-contract-api.js","sha256":"5dbdcbeb70a2360a05c684caa639084c0c636002080573036cd43f1f3fc756cc","facadeSource":"extensions/feishu/doctor-contract-api.ts","sources":[]},{"output":"index.js","sha256":"17f2e4d25ca24f4f7694b2f109e20d1c7411a5ca8583e600373473673dc61706","facadeSource":"extensions/feishu/index.ts","sources":["extensions/feishu/index.ts"]},{"output":"runtime-api.js","sha256":"b54662c3e65653080377c95668de2ce1f488a0c2e69a20171ea47273cf0b5e9c","facadeSource":"extensions/feishu/runtime-api.ts","sources":[]},{"output":"runtime-setter-api.js","sha256":"57e2fe216c919a7d59af4e002cbe42afd1f3d5f88eb5585df32c0ddcd2213b8e","facadeSource":"extensions/feishu/runtime-setter-api.ts","sources":[]},{"output":"secret-contract-api.js","sha256":"78662aafd61650f440aedee1d34ef949d5de0c16725dd7fee24b590cfcc808f5","facadeSource":"extensions/feishu/secret-contract-api.ts","sources":[]},{"output":"security-contract-api.js","sha256":"847e275058ffd3574de067506cd3c54dacbfe03149f7bf1413c6529997e5a58a","facadeSource":"extensions/feishu/security-contract-api.ts","sources":[]},{"output":"session-binding-contract-api.js","sha256":"87ea6146689a421b360fa243ebd84565cb4ce1027c47c21efb0f37eed858b297","facadeSource":"extensions/feishu/session-binding-contract-api.ts","sources":[]},{"output":"session-key-api.js","sha256":"a6d91839514398bb7829338e44fe6ee7ee26d098212d72a2af0dfcc16bf8badf","facadeSource":"extensions/feishu/session-key-api.ts","sources":[]},{"output":"setup-api.js","sha256":"68b69c737c78c2d3b21713031e081ac5cb0a3d8d265d7a8793d89558c0d25d33","facadeSource":"extensions/feishu/setup-api.ts","sources":[]},{"output":"setup-entry.js","sha256":"87874fa380e9051bbeceb93b72f10dce7cca3d6603d5b56871bd5bd82558f76b","facadeSource":"extensions/feishu/setup-entry.ts","sources":["extensions/feishu/setup-entry.ts"]},{"output":"subagent-hooks-api.js","sha256":"838af80d3ad0403770c006c3b1476ac6cb0e0e6e5af68f131633bf3fbddbf750","facadeSource":"extensions/feishu/subagent-hooks-api.ts","sources":["extensions/feishu/subagent-hooks-api.ts"]}],"unrenderedSources":["extensions/feishu/api.ts","extensions/feishu/channel-plugin-api.ts","extensions/feishu/config-doctor-api.ts","extensions/feishu/contract-api.ts","extensions/feishu/doctor-contract-api.ts","extensions/feishu/runtime-api.ts","extensions/feishu/runtime-setter-api.ts","extensions/feishu/secret-contract-api.ts","extensions/feishu/security-contract-api.ts","extensions/feishu/session-binding-contract-api.ts","extensions/feishu/session-key-api.ts","extensions/feishu/setup-api.ts"]}
|