@openclaw/signal 2026.10.2 → 2026.10.5-beta.2
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/{api-BzvUhsz9.mjs → api-CfFaBHKY.mjs} +8 -8
- package/dist/.setup/{api-BYvpXSbI.mjs → api-oTYg1sqh.mjs} +8 -8
- package/dist/.setup/{approval-handler.runtime-DftlFeEB.mjs → approval-handler.runtime-DzZCg6An.mjs} +2 -3
- package/dist/.setup/{approval-reactions-BHIX1jwY.mjs → approval-reactions-POBtr9RL.mjs} +31 -57
- package/dist/.setup/{channel-E_23H6I6.mjs → channel-v_OVXflu.mjs} +22 -25
- package/dist/.setup/{client-AXcDteBZ.mjs → client-DrPmUInx.mjs} +53 -58
- package/dist/.setup/{client-adapter-c_O1ouxZ.mjs → client-adapter-C25_QRp1.mjs} +1 -1
- package/dist/.setup/{install-signal-cli-ChvjzM6X.mjs → install-signal-cli-hYVLYGXe.mjs} +4 -26
- package/dist/.setup/{monitor-CG20ucVU.mjs → monitor-B2dIc7fW.mjs} +35 -51
- package/dist/.setup/{probe-2LTiStRi.mjs → probe-D6n3Nkud.mjs} +2 -2
- package/dist/.setup/{reaction-runtime-api-xqwxFZ2S.mjs → reaction-runtime-api-BoF_xKQe.mjs} +1 -1
- package/dist/.setup/{reaction-targets-TGHqhdoa.mjs → reaction-targets-Bw8pIemQ.mjs} +1 -1
- package/dist/.setup/{send-CAlJlhsT.mjs → send-Da8lyyyC.mjs} +10 -11
- package/dist/.setup/{setup-surface-BpW9dJZY.mjs → setup-surface-D1IPnECU.mjs} +2 -2
- package/dist/.setup/{transport-detection-CQSEftdN.mjs → transport-detection-C7tIMlYW.mjs} +2 -2
- package/dist/.setup/{transport-probes.runtime-DwXEHnXr.mjs → transport-probes.runtime-CE-YN8v-.mjs} +1 -1
- package/dist/api.js +8 -8
- package/dist/channel-plugin-api.js +1 -1
- package/dist/contract-api.js +2 -2
- package/dist/reaction-runtime-api.js +1 -1
- package/dist/setup-entry.js +1 -1
- package/node_modules/@openclaw/fs-safe/CHANGELOG.md +35 -0
- package/node_modules/@openclaw/fs-safe/README.md +1 -1
- package/node_modules/@openclaw/fs-safe/dist/advanced.d.ts +1 -1
- package/node_modules/@openclaw/fs-safe/dist/advanced.js +1 -1
- package/node_modules/@openclaw/fs-safe/dist/archive-durability.js +1 -1
- package/node_modules/@openclaw/fs-safe/dist/archive-merge.js +4 -4
- package/node_modules/@openclaw/fs-safe/dist/archive-parser.wasm +0 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-read.js +5 -4
- package/node_modules/@openclaw/fs-safe/dist/archive-staging.d.ts +1 -1
- package/node_modules/@openclaw/fs-safe/dist/archive-staging.js +22 -38
- package/node_modules/@openclaw/fs-safe/dist/copy-path-admission.d.ts +17 -0
- package/node_modules/@openclaw/fs-safe/dist/copy-path-admission.js +117 -0
- package/node_modules/@openclaw/fs-safe/dist/copy-root-file-sync.d.ts +8 -5
- package/node_modules/@openclaw/fs-safe/dist/copy-root-file-sync.js +27 -50
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-acquire.d.ts +3 -0
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-acquire.js +57 -11
- package/node_modules/@openclaw/fs-safe/dist/guarded-mutation.js +5 -5
- package/node_modules/@openclaw/fs-safe/dist/guest-native-python.js +52 -5
- package/node_modules/@openclaw/fs-safe/dist/guest.js +1 -1
- package/node_modules/@openclaw/fs-safe/dist/native-binding.d.ts +1 -0
- package/node_modules/@openclaw/fs-safe/dist/native-operations.d.ts +0 -1
- package/node_modules/@openclaw/fs-safe/dist/native-operations.js +22 -26
- package/node_modules/@openclaw/fs-safe/dist/native-pinned-write-windows.js +5 -1
- package/node_modules/@openclaw/fs-safe/dist/native-staged-file.js +4 -1
- package/node_modules/@openclaw/fs-safe/dist/permission-exec.js +2 -1
- package/node_modules/@openclaw/fs-safe/dist/pinned-write-types.d.ts +6 -1
- package/node_modules/@openclaw/fs-safe/dist/private-temp-workspace.js +2 -2
- package/node_modules/@openclaw/fs-safe/dist/publish-file.js +34 -7
- package/node_modules/@openclaw/fs-safe/dist/replace-file-copy-fallback.js +1 -4
- package/node_modules/@openclaw/fs-safe/dist/replace-file-descriptor.js +6 -0
- package/node_modules/@openclaw/fs-safe/dist/root-create-input.d.ts +15 -1
- package/node_modules/@openclaw/fs-safe/dist/root-create-input.js +4 -0
- package/node_modules/@openclaw/fs-safe/dist/root-directory-entry.js +1 -1
- package/node_modules/@openclaw/fs-safe/dist/root-directory-list.d.ts +0 -1
- package/node_modules/@openclaw/fs-safe/dist/root-directory-list.js +6 -12
- package/node_modules/@openclaw/fs-safe/dist/root-impl.js +15 -15
- package/node_modules/@openclaw/fs-safe/dist/root-paths.js +1 -1
- package/node_modules/@openclaw/fs-safe/dist/root-walk.js +4 -4
- package/node_modules/@openclaw/fs-safe/dist/root-write-verification.d.ts +10 -1
- package/node_modules/@openclaw/fs-safe/dist/root-write-verification.js +20 -0
- package/node_modules/@openclaw/fs-safe/dist/secure-temp-dir.js +19 -7
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-acquire.js +25 -3
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-admission.d.ts +2 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-retained.d.ts +14 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-retained.js +187 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock.js +15 -1
- package/node_modules/@openclaw/fs-safe/dist/temp-directory-diagnostics.d.ts +10 -0
- package/node_modules/@openclaw/fs-safe/dist/temp-directory-diagnostics.js +29 -0
- package/node_modules/@openclaw/fs-safe/dist/temp-target.js +1 -1
- package/node_modules/@openclaw/fs-safe/dist/temp-workspace-admission.js +6 -6
- package/node_modules/@openclaw/fs-safe/dist/temp-workspace-child-admission.d.ts +4 -4
- package/node_modules/@openclaw/fs-safe/dist/temp-workspace-child-admission.js +17 -16
- package/node_modules/@openclaw/fs-safe/dist/temp-workspace-descriptor.js +20 -28
- package/node_modules/@openclaw/fs-safe/dist/walk.js +2 -13
- package/node_modules/@openclaw/fs-safe/dist/watch-native.d.ts +2 -2
- package/node_modules/@openclaw/fs-safe/dist/watch-native.js +3 -1
- package/node_modules/@openclaw/fs-safe/dist/watch-rescan.js +3 -9
- package/node_modules/@openclaw/fs-safe/dist/watch.js +2 -3
- package/node_modules/@openclaw/fs-safe/docs/advanced.md +1 -1
- package/node_modules/@openclaw/fs-safe/docs/archive.md +3 -0
- package/node_modules/@openclaw/fs-safe/docs/atomic.md +11 -3
- package/node_modules/@openclaw/fs-safe/docs/contributing.md +1 -1
- package/node_modules/@openclaw/fs-safe/docs/copy.md +48 -0
- package/node_modules/@openclaw/fs-safe/docs/guest.md +21 -4
- package/node_modules/@openclaw/fs-safe/docs/path-scope.md +4 -0
- package/node_modules/@openclaw/fs-safe/docs/sidecar-lock.md +46 -8
- package/node_modules/@openclaw/fs-safe/docs/temp.md +12 -0
- package/node_modules/@openclaw/fs-safe/docs/watch.md +3 -2
- package/node_modules/@openclaw/fs-safe/package.json +15 -15
- 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-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-x64-msvc/fs-safe-native.node +0 -0
- package/node_modules/@openclaw/fs-safe-win32-x64-msvc/package.json +1 -1
- package/node_modules/ws/lib/websocket.js +17 -3
- package/node_modules/ws/package.json +1 -1
- package/package.json +6 -6
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-arbitration.d.ts +0 -17
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-arbitration.js +0 -66
- package/node_modules/@openclaw/fs-safe/dist/publish-file-native.d.ts +0 -4
- package/node_modules/@openclaw/fs-safe/dist/publish-file-native.js +0 -35
- package/node_modules/@openclaw/fs-safe/dist/root-move-preflight.d.ts +0 -7
- package/node_modules/@openclaw/fs-safe/dist/root-move-preflight.js +0 -16
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { i as resolveSignalAccount, n as listSignalAccountIds, r as resolveDefaultSignalAccountId, t as listEnabledSignalAccounts } from "./accounts-DMtj2E-4.mjs";
|
|
2
2
|
import { n as normalizeSignalMessagingTarget, t as looksLikeSignalTargetId } from "./normalize-D7kSomXt.mjs";
|
|
3
3
|
import { a as normalizeSignalAllowRecipient, c as resolveSignalSender, i as isSignalSenderAllowed, l as looksLikeUuid, n as formatSignalSenderDisplay, o as resolveSignalPeerId, r as formatSignalSenderId, s as resolveSignalRecipient, t as formatSignalPairingIdLine } from "./identity-B3JyPqGO.mjs";
|
|
4
|
-
import { _ as resolveSignalReactionLevel, a as normalizeSignalAccountInput, b as markdownToSignalTextChunks, d as probeSignalTransport, f as writeSignalAccountTransport, g as signalMessageActions, h as resolveSignalOutboundTarget, t as signalPlugin, u as prepareSignalManagedNativeTransport, y as markdownToSignalText } from "./channel-
|
|
5
|
-
import { n as sendReactionSignal, t as removeReactionSignal } from "./reaction-runtime-api-
|
|
6
|
-
import { t as detectSignalTransport } from "./transport-detection-
|
|
7
|
-
import { t as signalSetupPlugin } from "./api-
|
|
8
|
-
import { r as installSignalCli } from "./install-signal-cli-
|
|
9
|
-
import { t as monitorSignalProvider } from "./monitor-
|
|
10
|
-
import { n as sendReadReceiptSignal, r as sendTypingSignal, t as sendMessageSignal } from "./send-
|
|
11
|
-
import { t as probeSignal } from "./probe-
|
|
4
|
+
import { _ as resolveSignalReactionLevel, a as normalizeSignalAccountInput, b as markdownToSignalTextChunks, d as probeSignalTransport, f as writeSignalAccountTransport, g as signalMessageActions, h as resolveSignalOutboundTarget, t as signalPlugin, u as prepareSignalManagedNativeTransport, y as markdownToSignalText } from "./channel-v_OVXflu.mjs";
|
|
5
|
+
import { n as sendReactionSignal, t as removeReactionSignal } from "./reaction-runtime-api-BoF_xKQe.mjs";
|
|
6
|
+
import { t as detectSignalTransport } from "./transport-detection-C7tIMlYW.mjs";
|
|
7
|
+
import { t as signalSetupPlugin } from "./api-oTYg1sqh.mjs";
|
|
8
|
+
import { r as installSignalCli } from "./install-signal-cli-hYVLYGXe.mjs";
|
|
9
|
+
import { t as monitorSignalProvider } from "./monitor-B2dIc7fW.mjs";
|
|
10
|
+
import { n as sendReadReceiptSignal, r as sendTypingSignal, t as sendMessageSignal } from "./send-Da8lyyyC.mjs";
|
|
11
|
+
import { t as probeSignal } from "./probe-D6n3Nkud.mjs";
|
|
12
12
|
export { detectSignalTransport, formatSignalPairingIdLine, formatSignalSenderDisplay, formatSignalSenderId, installSignalCli, isSignalSenderAllowed, listEnabledSignalAccounts, listSignalAccountIds, looksLikeSignalTargetId, looksLikeUuid, markdownToSignalText, markdownToSignalTextChunks, monitorSignalProvider, normalizeSignalAccountInput, normalizeSignalAllowRecipient, normalizeSignalMessagingTarget, prepareSignalManagedNativeTransport, probeSignal, probeSignalTransport, removeReactionSignal, resolveDefaultSignalAccountId, resolveSignalAccount, resolveSignalOutboundTarget, resolveSignalPeerId, resolveSignalReactionLevel, resolveSignalRecipient, resolveSignalSender, sendMessageSignal, sendReactionSignal, sendReadReceiptSignal, sendTypingSignal, signalMessageActions, signalPlugin, signalSetupPlugin, writeSignalAccountTransport };
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import "./accounts-DMtj2E-4.mjs";
|
|
2
2
|
import "./normalize-D7kSomXt.mjs";
|
|
3
3
|
import "./identity-B3JyPqGO.mjs";
|
|
4
|
-
import { l as signalSetupContract, n as createSignalPluginBase, r as signalSetupWizard } from "./channel-
|
|
5
|
-
import "./reaction-runtime-api-
|
|
6
|
-
import "./install-signal-cli-
|
|
7
|
-
import "./monitor-
|
|
8
|
-
import "./send-
|
|
9
|
-
import "./probe-
|
|
4
|
+
import { l as signalSetupContract, n as createSignalPluginBase, r as signalSetupWizard } from "./channel-v_OVXflu.mjs";
|
|
5
|
+
import "./reaction-runtime-api-BoF_xKQe.mjs";
|
|
6
|
+
import "./install-signal-cli-hYVLYGXe.mjs";
|
|
7
|
+
import "./monitor-B2dIc7fW.mjs";
|
|
8
|
+
import "./send-Da8lyyyC.mjs";
|
|
9
|
+
import "./probe-D6n3Nkud.mjs";
|
|
10
10
|
//#region extensions/signal/src/channel.setup.ts
|
|
11
|
-
const signalSetupPlugin =
|
|
11
|
+
const signalSetupPlugin = createSignalPluginBase({
|
|
12
12
|
setupWizard: signalSetupWizard,
|
|
13
13
|
setupContract: signalSetupContract
|
|
14
|
-
})
|
|
14
|
+
});
|
|
15
15
|
//#endregion
|
|
16
16
|
export { signalSetupPlugin as t };
|
package/dist/.setup/{approval-handler.runtime-DftlFeEB.mjs → approval-handler.runtime-DzZCg6An.mjs}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { r as resolveDefaultSignalAccountId } from "./accounts-DMtj2E-4.mjs";
|
|
2
2
|
import { n as normalizeSignalMessagingTarget } from "./normalize-D7kSomXt.mjs";
|
|
3
3
|
import { a as resolveSignalTarget } from "./approval-auth-BITw96pZ.mjs";
|
|
4
|
-
import { a as registerSignalApprovalReactionTarget, c as resolveSignalApprovalTargetAuthorKeys, l as unregisterSignalApprovalReactionTarget, r as hasSignalApprovalReactionApprovers, s as resolveSignalApprovalConversationKey } from "./approval-reactions-
|
|
5
|
-
import { r as sendTypingSignal, t as sendMessageSignal } from "./send-
|
|
4
|
+
import { a as registerSignalApprovalReactionTarget, c as resolveSignalApprovalTargetAuthorKeys, l as unregisterSignalApprovalReactionTarget, r as hasSignalApprovalReactionApprovers, s as resolveSignalApprovalConversationKey } from "./approval-reactions-POBtr9RL.mjs";
|
|
5
|
+
import { r as sendTypingSignal, t as sendMessageSignal } from "./send-Da8lyyyC.mjs";
|
|
6
6
|
import { DEFAULT_ACCOUNT_ID } from "openclaw/plugin-sdk/account-id";
|
|
7
7
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
8
8
|
import { buildChannelApprovalNativeTargetKey } from "openclaw/plugin-sdk/approval-native-runtime";
|
|
@@ -148,7 +148,6 @@ const signalApprovalNativeRuntime = createChannelApprovalNativeRuntimeAdapter({
|
|
|
148
148
|
...normalizeOptionalString(request.request.agentId) ? { agentId: normalizeOptionalString(request.request.agentId) } : {},
|
|
149
149
|
...normalizeOptionalString(request.request.sessionKey) ? { sessionKey: normalizeOptionalString(request.request.sessionKey) } : {}
|
|
150
150
|
},
|
|
151
|
-
routeAllowed: true,
|
|
152
151
|
ttlMs: Math.max(1, view.expiresAtMs - Date.now())
|
|
153
152
|
}) ? true : null;
|
|
154
153
|
},
|
|
@@ -12,26 +12,6 @@ import { getExecApprovalReplyMetadata } from "openclaw/plugin-sdk/approval-reply
|
|
|
12
12
|
import { createPluginStateErrorReporter } from "openclaw/plugin-sdk/plugin-state-runtime";
|
|
13
13
|
import { matchesApprovalRequestFilters } from "openclaw/plugin-sdk/approval-client-runtime";
|
|
14
14
|
//#region extensions/signal/src/approval-reaction-routes.ts
|
|
15
|
-
function resolveApprovalForwardingConfig(params) {
|
|
16
|
-
return params.approvalKind === "plugin" ? params.cfg.approvals?.plugin : params.cfg.approvals?.exec;
|
|
17
|
-
}
|
|
18
|
-
function matchesSignalApprovalReactionFilters(params) {
|
|
19
|
-
return matchesApprovalRequestFilters({
|
|
20
|
-
request: {
|
|
21
|
-
agentId: params.route.agentId,
|
|
22
|
-
sessionKey: params.route.sessionKey
|
|
23
|
-
},
|
|
24
|
-
agentFilter: params.config.agentFilter,
|
|
25
|
-
sessionFilter: params.config.sessionFilter,
|
|
26
|
-
fallbackAgentIdFromSessionKey: true
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
function targetAccountMatches(params) {
|
|
30
|
-
const configuredAccountId = normalizeOptionalString(params.configuredAccountId);
|
|
31
|
-
if (!configuredAccountId) return true;
|
|
32
|
-
const routeAccountId = normalizeOptionalString(params.routeAccountId);
|
|
33
|
-
return Boolean(routeAccountId && normalizeAccountId(routeAccountId) === normalizeAccountId(configuredAccountId));
|
|
34
|
-
}
|
|
35
15
|
function resolveSignalApprovalRouteTarget(params) {
|
|
36
16
|
try {
|
|
37
17
|
return resolveSignalTarget({
|
|
@@ -43,39 +23,33 @@ function resolveSignalApprovalRouteTarget(params) {
|
|
|
43
23
|
return null;
|
|
44
24
|
}
|
|
45
25
|
}
|
|
46
|
-
function
|
|
47
|
-
|
|
26
|
+
function isSignalApprovalReactionRouteStillEnabled(params) {
|
|
27
|
+
const { approvalKind, route } = params.target;
|
|
28
|
+
const config = approvalKind === "plugin" ? params.cfg.approvals?.plugin : params.cfg.approvals?.exec;
|
|
29
|
+
if (!config?.enabled) return false;
|
|
30
|
+
const mode = config.mode ?? "session";
|
|
31
|
+
if (mode !== "both" && mode !== (route.deliveryMode === "target" ? "targets" : "session")) return false;
|
|
32
|
+
if (!matchesApprovalRequestFilters({
|
|
33
|
+
request: {
|
|
34
|
+
agentId: route.agentId,
|
|
35
|
+
sessionKey: route.sessionKey
|
|
36
|
+
},
|
|
37
|
+
agentFilter: config.agentFilter,
|
|
38
|
+
sessionFilter: config.sessionFilter,
|
|
39
|
+
fallbackAgentIdFromSessionKey: true
|
|
40
|
+
})) return false;
|
|
41
|
+
if (route.deliveryMode === "session") return true;
|
|
42
|
+
return (config.targets ?? []).some((target) => {
|
|
48
43
|
if (normalizeLowercaseStringOrEmpty(target.channel) !== "signal") return false;
|
|
49
44
|
const configuredTo = resolveSignalApprovalRouteTarget({
|
|
50
45
|
cfg: params.cfg,
|
|
51
|
-
accountId: target.accountId ??
|
|
46
|
+
accountId: target.accountId ?? route.accountId,
|
|
52
47
|
to: target.to
|
|
53
48
|
});
|
|
54
|
-
if (!configuredTo || configuredTo !==
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
});
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
function isSignalApprovalReactionRouteStillEnabled(params) {
|
|
62
|
-
const config = resolveApprovalForwardingConfig({
|
|
63
|
-
cfg: params.cfg,
|
|
64
|
-
approvalKind: params.target.approvalKind
|
|
65
|
-
});
|
|
66
|
-
if (!config?.enabled) return false;
|
|
67
|
-
const mode = config.mode ?? "session";
|
|
68
|
-
if (params.target.route.deliveryMode === "target") return (mode === "targets" || mode === "both") && matchesSignalApprovalReactionFilters({
|
|
69
|
-
config,
|
|
70
|
-
route: params.target.route
|
|
71
|
-
}) && hasMatchingSignalApprovalReactionTarget({
|
|
72
|
-
cfg: params.cfg,
|
|
73
|
-
config,
|
|
74
|
-
route: params.target.route
|
|
75
|
-
});
|
|
76
|
-
return (mode === "session" || mode === "both") && matchesSignalApprovalReactionFilters({
|
|
77
|
-
config,
|
|
78
|
-
route: params.target.route
|
|
49
|
+
if (!configuredTo || configuredTo !== route.to) return false;
|
|
50
|
+
const configuredAccountId = normalizeOptionalString(target.accountId);
|
|
51
|
+
const routeAccountId = normalizeOptionalString(route.accountId);
|
|
52
|
+
return !configuredAccountId || Boolean(routeAccountId && normalizeAccountId(routeAccountId) === normalizeAccountId(configuredAccountId));
|
|
79
53
|
});
|
|
80
54
|
}
|
|
81
55
|
function buildTargetRoute(params) {
|
|
@@ -85,12 +59,15 @@ function buildTargetRoute(params) {
|
|
|
85
59
|
to: params.to
|
|
86
60
|
});
|
|
87
61
|
if (!to) return null;
|
|
62
|
+
const accountId = normalizeOptionalString(params.accountId);
|
|
63
|
+
const agentId = normalizeOptionalString(params.agentId);
|
|
64
|
+
const sessionKey = normalizeOptionalString(params.sessionKey);
|
|
88
65
|
const route = {
|
|
89
66
|
deliveryMode: "target",
|
|
90
67
|
to,
|
|
91
|
-
...
|
|
92
|
-
...
|
|
93
|
-
...
|
|
68
|
+
...accountId ? { accountId } : {},
|
|
69
|
+
...agentId ? { agentId } : {},
|
|
70
|
+
...sessionKey ? { sessionKey } : {}
|
|
94
71
|
};
|
|
95
72
|
return isSignalApprovalReactionRouteStillEnabled({
|
|
96
73
|
cfg: params.cfg,
|
|
@@ -182,7 +159,7 @@ async function registerSignalApprovalReactionTarget(params) {
|
|
|
182
159
|
const approvalId = params.approvalId.trim();
|
|
183
160
|
const targetAuthorKeys = Array.from(new Set(params.targetAuthorKeys.map((entry) => normalizeSignalApprovalTargetAuthorKey(entry)).filter((entry) => Boolean(entry))));
|
|
184
161
|
const allowedDecisions = listApprovalReactionBindings({ allowedDecisions: params.allowedDecisions }).map((binding) => binding.decision);
|
|
185
|
-
if (
|
|
162
|
+
if (params.approvalKind !== "exec" && params.approvalKind !== "plugin" && params.approvalKind !== "system-agent" || !key || !approvalId || allowedDecisions.length === 0) return null;
|
|
186
163
|
if (targetAuthorKeys.length === 0) return null;
|
|
187
164
|
const agentId = normalizeOptionalString(params.route.agentId);
|
|
188
165
|
const sessionKey = normalizeOptionalString(params.route.sessionKey);
|
|
@@ -284,9 +261,7 @@ async function registerSignalApprovalReactionTargetForDeliveredPayload(params) {
|
|
|
284
261
|
approvalKind: metadata.approvalKind,
|
|
285
262
|
allowedDecisions: metadata.allowedDecisions,
|
|
286
263
|
targetAuthorKeys,
|
|
287
|
-
route
|
|
288
|
-
routeAllowed: true,
|
|
289
|
-
ttlMs: params.ttlMs
|
|
264
|
+
route
|
|
290
265
|
}));
|
|
291
266
|
return (await Promise.all(registrations)).some(Boolean);
|
|
292
267
|
}
|
|
@@ -352,8 +327,7 @@ async function maybeResolveSignalApprovalReaction(params) {
|
|
|
352
327
|
decision: target.decision,
|
|
353
328
|
channel: "signal",
|
|
354
329
|
accountId: params.accountId,
|
|
355
|
-
senderId: actorId
|
|
356
|
-
gatewayUrl: params.gatewayUrl
|
|
330
|
+
senderId: actorId
|
|
357
331
|
},
|
|
358
332
|
approvers: getSignalApprovalApprovers({
|
|
359
333
|
cfg: params.cfg,
|
|
@@ -5,9 +5,9 @@ import { a as resolveSignalAccountConfig, i as resolveSignalAccount, n as listSi
|
|
|
5
5
|
import { n as normalizeSignalMessagingTarget, r as normalizeSignalReactionRecipient, t as looksLikeSignalTargetId } from "./normalize-D7kSomXt.mjs";
|
|
6
6
|
import { a as resolveSignalTarget, n as signalApprovalAuth, r as listSignalAliasDirectoryEntries, t as getSignalApprovalApprovers } from "./approval-auth-BITw96pZ.mjs";
|
|
7
7
|
import { c as resolveSignalSender, l as looksLikeUuid, o as resolveSignalPeerId, s as resolveSignalRecipient } from "./identity-B3JyPqGO.mjs";
|
|
8
|
-
import { n as sendReactionSignal, t as removeReactionSignal } from "./reaction-runtime-api-
|
|
8
|
+
import { n as sendReactionSignal, t as removeReactionSignal } from "./reaction-runtime-api-BoF_xKQe.mjs";
|
|
9
9
|
import { t as getOptionalSignalRuntime } from "./runtime-8sxUF217.mjs";
|
|
10
|
-
import { t as detectSignalTransport } from "./transport-detection-
|
|
10
|
+
import { t as detectSignalTransport } from "./transport-detection-C7tIMlYW.mjs";
|
|
11
11
|
import { t as SignalChannelConfigSchema } from "./config-schema-DvxZ18SD.mjs";
|
|
12
12
|
import { describeAccountSnapshot, resolveChannelMediaMaxBytes } from "openclaw/plugin-sdk/account-helpers";
|
|
13
13
|
import { DEFAULT_ACCOUNT_ID } from "openclaw/plugin-sdk/account-id";
|
|
@@ -101,7 +101,7 @@ const signalApproval = createApproverRestrictedNativeApprovalCapabilityFromForwa
|
|
|
101
101
|
approvalKind,
|
|
102
102
|
request
|
|
103
103
|
}),
|
|
104
|
-
load: async () => (await import("./approval-handler.runtime-
|
|
104
|
+
load: async () => (await import("./approval-handler.runtime-DzZCg6An.mjs")).signalApprovalNativeRuntime
|
|
105
105
|
})
|
|
106
106
|
});
|
|
107
107
|
const signalApprovalRouting = signalApproval.routing;
|
|
@@ -706,8 +706,8 @@ async function probeSignalTransport(params) {
|
|
|
706
706
|
overrides: managedTransportOptions(params.transport)
|
|
707
707
|
}) : params.transport;
|
|
708
708
|
const resolved = resolveSignalTransport(transport);
|
|
709
|
-
if (resolved.kind === "container") return (params.probeContainer ?? (await import("./transport-probes.runtime-
|
|
710
|
-
return (params.probeNative ?? (await import("./transport-probes.runtime-
|
|
709
|
+
if (resolved.kind === "container") return (params.probeContainer ?? (await import("./transport-probes.runtime-CE-YN8v-.mjs")).containerCheck)(resolved.baseUrl, timeoutMs, params.account);
|
|
710
|
+
return (params.probeNative ?? (await import("./transport-probes.runtime-CE-YN8v-.mjs")).nativeCheck)(resolved.baseUrl, timeoutMs);
|
|
711
711
|
}
|
|
712
712
|
function writeSignalAccountTransport(params) {
|
|
713
713
|
const transport = normalizeTransport(params.transport);
|
|
@@ -864,8 +864,15 @@ function resolveSignalSetupAccount(params) {
|
|
|
864
864
|
const signal = params.cfg.channels?.signal;
|
|
865
865
|
return resolveSignalAccountEntry(signal?.accounts, accountId)?.account ?? signal?.account;
|
|
866
866
|
}
|
|
867
|
-
|
|
868
|
-
|
|
867
|
+
const signalDmPolicy = createChannelDmPolicy({
|
|
868
|
+
label: "Signal",
|
|
869
|
+
channel,
|
|
870
|
+
resolveAccount: (cfg, accountId) => resolveSignalAccount({
|
|
871
|
+
cfg,
|
|
872
|
+
accountId: accountId ?? resolveDefaultSignalAccountId(cfg)
|
|
873
|
+
}),
|
|
874
|
+
setupSurface: () => signalSetupAdapter,
|
|
875
|
+
promptAllowFrom: async (params) => promptParsedAllowFromForAccount({
|
|
869
876
|
cfg: params.cfg,
|
|
870
877
|
accountId: params.accountId,
|
|
871
878
|
defaultAccountId: resolveDefaultSignalAccountId(params.cfg),
|
|
@@ -893,17 +900,7 @@ async function promptSignalAllowFrom(params) {
|
|
|
893
900
|
allowFrom,
|
|
894
901
|
setupSurface: signalSetupAdapter
|
|
895
902
|
})
|
|
896
|
-
})
|
|
897
|
-
}
|
|
898
|
-
const signalDmPolicy = createChannelDmPolicy({
|
|
899
|
-
label: "Signal",
|
|
900
|
-
channel,
|
|
901
|
-
resolveAccount: (cfg, accountId) => resolveSignalAccount({
|
|
902
|
-
cfg,
|
|
903
|
-
accountId: accountId ?? resolveDefaultSignalAccountId(cfg)
|
|
904
|
-
}),
|
|
905
|
-
setupSurface: () => signalSetupAdapter,
|
|
906
|
-
promptAllowFrom: promptSignalAllowFrom
|
|
903
|
+
})
|
|
907
904
|
});
|
|
908
905
|
function resolveSignalCliPath(params) {
|
|
909
906
|
const transport = resolveSignalAccount({
|
|
@@ -1053,7 +1050,7 @@ function createSignalSetupWizardProxy(loadWizard) {
|
|
|
1053
1050
|
const signalDoctor = {
|
|
1054
1051
|
normalizeCompatibilityConfig,
|
|
1055
1052
|
cleanStaleConfig: async ({ cfg }) => {
|
|
1056
|
-
const { detectSignalTransport } = await import("./transport-detection-
|
|
1053
|
+
const { detectSignalTransport } = await import("./transport-detection-C7tIMlYW.mjs").then((n) => n.n);
|
|
1057
1054
|
const transport = await migrateLegacySignalTransportConfig({
|
|
1058
1055
|
cfg,
|
|
1059
1056
|
detect: detectSignalTransport
|
|
@@ -1067,7 +1064,7 @@ const signalDoctor = {
|
|
|
1067
1064
|
//#endregion
|
|
1068
1065
|
//#region extensions/signal/src/shared.ts
|
|
1069
1066
|
const SIGNAL_CHANNEL = "signal";
|
|
1070
|
-
const signalSetupWizard = createSignalSetupWizardProxy(async () => (await import("./setup-surface-
|
|
1067
|
+
const signalSetupWizard = createSignalSetupWizardProxy(async () => (await import("./setup-surface-D1IPnECU.mjs")).signalSetupWizard);
|
|
1071
1068
|
const signalConfigAdapter = {
|
|
1072
1069
|
...createScopedChannelConfigAdapter({
|
|
1073
1070
|
sectionKey: SIGNAL_CHANNEL,
|
|
@@ -1152,10 +1149,10 @@ function createSignalPluginBase(params) {
|
|
|
1152
1149
|
}
|
|
1153
1150
|
//#endregion
|
|
1154
1151
|
//#region extensions/signal/src/channel.ts
|
|
1155
|
-
const loadSignalMonitorModule = createLazyRuntimeModule(() => import("./monitor-
|
|
1156
|
-
const loadSignalProbeModule = createLazyRuntimeModule(() => import("./probe-
|
|
1157
|
-
const loadSignalSendRuntime = createLazyRuntimeModule(() => import("./send-
|
|
1158
|
-
const loadSignalApprovalReactionsModule = createLazyRuntimeModule(() => import("./approval-reactions-
|
|
1152
|
+
const loadSignalMonitorModule = createLazyRuntimeModule(() => import("./monitor-B2dIc7fW.mjs").then((n) => n.n));
|
|
1153
|
+
const loadSignalProbeModule = createLazyRuntimeModule(() => import("./probe-D6n3Nkud.mjs").then((n) => n.n));
|
|
1154
|
+
const loadSignalSendRuntime = createLazyRuntimeModule(() => import("./send-Da8lyyyC.mjs").then((n) => n.i));
|
|
1155
|
+
const loadSignalApprovalReactionsModule = createLazyRuntimeModule(() => import("./approval-reactions-POBtr9RL.mjs").then((n) => n.n));
|
|
1159
1156
|
async function resolveSignalSendContext(params) {
|
|
1160
1157
|
return {
|
|
1161
1158
|
send: resolveOutboundSendDep(params.deps, "signal") ?? (await loadSignalSendRuntime()).sendMessageSignal,
|
|
@@ -1356,7 +1353,7 @@ async function registerDeliveredSignalApprovalPayloadForReactions(params) {
|
|
|
1356
1353
|
const targetAuthor = normalizeOptionalString(account.config.account);
|
|
1357
1354
|
const targetAuthorUuid = normalizeOptionalString(account.config.accountUuid);
|
|
1358
1355
|
if (!targetAuthor && !targetAuthorUuid) return;
|
|
1359
|
-
const { registerSignalReactionTargetsForDeliveredPayload } = await import("./reaction-targets-
|
|
1356
|
+
const { registerSignalReactionTargetsForDeliveredPayload } = await import("./reaction-targets-Bw8pIemQ.mjs").then((n) => n.t);
|
|
1360
1357
|
await registerSignalReactionTargetsForDeliveredPayload({
|
|
1361
1358
|
cfg: params.cfg,
|
|
1362
1359
|
target: {
|
|
@@ -6,7 +6,7 @@ import path from "node:path";
|
|
|
6
6
|
import { detectMime, extractOriginalFilename, parseMediaContentLength } from "openclaw/plugin-sdk/media-runtime";
|
|
7
7
|
import { asNonNegativeFiniteNumber, asPositiveFiniteNumber, parseStrictNonNegativeInteger, resolvePositiveTimerTimeoutMs, resolveTimerTimeoutMs } from "openclaw/plugin-sdk/number-runtime";
|
|
8
8
|
import { coerceErrorMessage, formatErrorMessage, toErrorObject } from "openclaw/plugin-sdk/error-runtime";
|
|
9
|
-
import { resolveFetch } from "openclaw/plugin-sdk/fetch-runtime";
|
|
9
|
+
import { captureEffectAuthority, resolveFetch } from "openclaw/plugin-sdk/fetch-runtime";
|
|
10
10
|
import { readResponseTextPrefix, readResponseWithLimit } from "openclaw/plugin-sdk/response-limit-runtime";
|
|
11
11
|
import { readRegularFile } from "openclaw/plugin-sdk/security-runtime";
|
|
12
12
|
import { Buffer as Buffer$1 } from "node:buffer";
|
|
@@ -77,57 +77,22 @@ async function withSignalRestDeadline(timeoutMs, run) {
|
|
|
77
77
|
clearTimeout(timer);
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
|
-
async function fetchWithTimeout(url, init, timeoutMs) {
|
|
81
|
-
const fetchImpl = resolveFetch();
|
|
82
|
-
if (!fetchImpl) throw new Error("fetch is not available");
|
|
83
|
-
return await withSignalRestDeadline(timeoutMs, async ({ signal }) => fetchImpl(url, {
|
|
84
|
-
...init,
|
|
85
|
-
signal
|
|
86
|
-
}));
|
|
87
|
-
}
|
|
88
80
|
function signalRestIdleTimeoutError({ chunkTimeoutMs }) {
|
|
89
81
|
return /* @__PURE__ */ new Error(`Signal REST response body stalled after ${chunkTimeoutMs}ms`);
|
|
90
82
|
}
|
|
91
|
-
function
|
|
92
|
-
|
|
93
|
-
}
|
|
94
|
-
async function readSignalRestText(res, bodyIdleTimeoutMs, bodyTimeoutMs) {
|
|
95
|
-
const bytes = await readResponseWithLimit(res, SIGNAL_REST_SUCCESS_RESPONSE_MAX_BYTES, {
|
|
96
|
-
chunkTimeoutMs: bodyIdleTimeoutMs,
|
|
97
|
-
onIdleTimeout: signalRestIdleTimeoutError,
|
|
98
|
-
timeoutMs: bodyTimeoutMs,
|
|
99
|
-
onTimeout: signalRestRequestTimeoutError,
|
|
100
|
-
onOverflow: ({ maxBytes }) => /* @__PURE__ */ new Error(`Signal REST: text response exceeds ${maxBytes} bytes`)
|
|
101
|
-
});
|
|
102
|
-
return new TextDecoder("utf-8", { fatal: true }).decode(bytes);
|
|
103
|
-
}
|
|
104
|
-
async function readSignalRestErrorText(res, bodyIdleTimeoutMs, bodyTimeoutMs) {
|
|
105
|
-
return (await readResponseTextPrefix(res, SIGNAL_REST_ERROR_RESPONSE_MAX_BYTES, {
|
|
106
|
-
chunkTimeoutMs: bodyIdleTimeoutMs,
|
|
107
|
-
onIdleTimeout: signalRestIdleTimeoutError,
|
|
108
|
-
timeoutMs: bodyTimeoutMs,
|
|
109
|
-
onTimeout: signalRestRequestTimeoutError
|
|
110
|
-
})).text;
|
|
111
|
-
}
|
|
112
|
-
async function readCappedResponseBuffer(res, maxResponseBytes, bodyIdleTimeoutMs, bodyTimeoutMs) {
|
|
113
|
-
const contentLength = parseMediaContentLength(res.headers?.get("content-length") ?? null);
|
|
114
|
-
if (contentLength !== null && contentLength > maxResponseBytes) throw new Error("Signal REST attachment exceeded size limit");
|
|
115
|
-
return await readResponseWithLimit(res, maxResponseBytes, {
|
|
116
|
-
chunkTimeoutMs: bodyIdleTimeoutMs,
|
|
117
|
-
onIdleTimeout: signalAttachmentIdleTimeoutError,
|
|
118
|
-
timeoutMs: bodyTimeoutMs,
|
|
119
|
-
onTimeout: signalRestRequestTimeoutError,
|
|
120
|
-
onOverflow: () => /* @__PURE__ */ new Error("Signal REST attachment exceeded size limit")
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
async function releaseUnreadResponseBody(res) {
|
|
124
|
-
if (res?.bodyUsed !== true) await res?.body?.cancel().catch(() => void 0);
|
|
83
|
+
function releaseUnreadResponseBody(res) {
|
|
84
|
+
if (res?.bodyUsed !== true) res?.body?.cancel().catch(() => void 0);
|
|
125
85
|
}
|
|
126
86
|
async function containerCheck(baseUrl, timeoutMs = DEFAULT_TIMEOUT_MS$2, account) {
|
|
127
87
|
const normalized = normalizeBaseUrl$1(baseUrl);
|
|
128
88
|
let res;
|
|
129
89
|
try {
|
|
130
|
-
|
|
90
|
+
const fetchImpl = resolveFetch();
|
|
91
|
+
if (!fetchImpl) throw new Error("fetch is not available");
|
|
92
|
+
res = await withSignalRestDeadline(timeoutMs, ({ signal }) => fetchImpl(`${normalized}/v1/about`, {
|
|
93
|
+
method: "GET",
|
|
94
|
+
signal
|
|
95
|
+
}));
|
|
131
96
|
if (!res.ok) return {
|
|
132
97
|
ok: false,
|
|
133
98
|
status: res.status,
|
|
@@ -147,7 +112,7 @@ async function containerCheck(baseUrl, timeoutMs = DEFAULT_TIMEOUT_MS$2, account
|
|
|
147
112
|
error: coerceErrorMessage(err)
|
|
148
113
|
};
|
|
149
114
|
} finally {
|
|
150
|
-
|
|
115
|
+
releaseUnreadResponseBody(res);
|
|
151
116
|
}
|
|
152
117
|
}
|
|
153
118
|
function containerReceiveCheck(normalizedBaseUrl, account, timeoutMs) {
|
|
@@ -215,6 +180,7 @@ function containerReceiveCheck(normalizedBaseUrl, account, timeoutMs) {
|
|
|
215
180
|
});
|
|
216
181
|
}
|
|
217
182
|
async function containerRestRequest(endpoint, opts, method = "GET", body) {
|
|
183
|
+
const effect = captureEffectAuthority();
|
|
218
184
|
const url = `${normalizeBaseUrl$1(opts.baseUrl)}${endpoint}`;
|
|
219
185
|
const init = {
|
|
220
186
|
method,
|
|
@@ -226,22 +192,36 @@ async function containerRestRequest(endpoint, opts, method = "GET", body) {
|
|
|
226
192
|
const fetchImpl = resolveFetch();
|
|
227
193
|
if (!fetchImpl) throw new Error("fetch is not available");
|
|
228
194
|
return await withSignalRestDeadline(timeoutMs, async ({ signal, timeoutMs: bodyTimeoutMs }) => {
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
195
|
+
const res = await effect.initiate(() => {
|
|
196
|
+
opts.assertDirectAdapterHandoff?.();
|
|
197
|
+
return fetchImpl(url, {
|
|
198
|
+
...init,
|
|
199
|
+
signal
|
|
200
|
+
});
|
|
233
201
|
});
|
|
234
202
|
if (res.status === 204) return;
|
|
235
203
|
if (!res.ok) {
|
|
236
204
|
let errorText = "";
|
|
237
205
|
try {
|
|
238
|
-
errorText = await
|
|
206
|
+
errorText = (await readResponseTextPrefix(res, SIGNAL_REST_ERROR_RESPONSE_MAX_BYTES, {
|
|
207
|
+
chunkTimeoutMs: bodyIdleTimeoutMs,
|
|
208
|
+
onIdleTimeout: signalRestIdleTimeoutError,
|
|
209
|
+
timeoutMs: bodyTimeoutMs,
|
|
210
|
+
onTimeout: signalRestRequestTimeoutError
|
|
211
|
+
})).text;
|
|
239
212
|
} catch (error) {
|
|
240
213
|
if (error instanceof SignalRestTimeoutError) throw error;
|
|
241
214
|
}
|
|
242
215
|
throw new Error(`Signal REST ${res.status}: ${errorText || res.statusText}`);
|
|
243
216
|
}
|
|
244
|
-
const
|
|
217
|
+
const bytes = await readResponseWithLimit(res, SIGNAL_REST_SUCCESS_RESPONSE_MAX_BYTES, {
|
|
218
|
+
chunkTimeoutMs: bodyIdleTimeoutMs,
|
|
219
|
+
onIdleTimeout: signalRestIdleTimeoutError,
|
|
220
|
+
timeoutMs: bodyTimeoutMs,
|
|
221
|
+
onTimeout: signalRestRequestTimeoutError,
|
|
222
|
+
onOverflow: ({ maxBytes }) => /* @__PURE__ */ new Error(`Signal REST: text response exceeds ${maxBytes} bytes`)
|
|
223
|
+
});
|
|
224
|
+
const text = new TextDecoder("utf-8", { fatal: true }).decode(bytes);
|
|
245
225
|
if (!text) return;
|
|
246
226
|
try {
|
|
247
227
|
return JSON.parse(text);
|
|
@@ -265,9 +245,18 @@ async function containerFetchAttachment(attachmentId, opts) {
|
|
|
265
245
|
});
|
|
266
246
|
res = fetched;
|
|
267
247
|
if (!fetched.ok) return null;
|
|
268
|
-
|
|
248
|
+
const maxResponseBytes = Math.floor(asPositiveFiniteNumber(opts.maxResponseBytes) ?? DEFAULT_ATTACHMENT_RESPONSE_MAX_BYTES);
|
|
249
|
+
const contentLength = parseMediaContentLength(fetched.headers?.get("content-length") ?? null);
|
|
250
|
+
if (contentLength !== null && contentLength > maxResponseBytes) throw new Error("Signal REST attachment exceeded size limit");
|
|
251
|
+
return await readResponseWithLimit(fetched, maxResponseBytes, {
|
|
252
|
+
chunkTimeoutMs: bodyIdleTimeoutMs,
|
|
253
|
+
onIdleTimeout: ({ chunkTimeoutMs }) => /* @__PURE__ */ new Error(`Signal REST attachment response body stalled after ${chunkTimeoutMs}ms`),
|
|
254
|
+
timeoutMs: bodyTimeoutMs,
|
|
255
|
+
onTimeout: signalRestRequestTimeoutError,
|
|
256
|
+
onOverflow: () => /* @__PURE__ */ new Error("Signal REST attachment exceeded size limit")
|
|
257
|
+
});
|
|
269
258
|
} finally {
|
|
270
|
-
|
|
259
|
+
releaseUnreadResponseBody(res);
|
|
271
260
|
}
|
|
272
261
|
});
|
|
273
262
|
}
|
|
@@ -612,8 +601,8 @@ async function isStaleSocket(socketPath, abortSignal) {
|
|
|
612
601
|
abortSignal?.throwIfAborted();
|
|
613
602
|
return new Promise((resolve, reject) => {
|
|
614
603
|
const socket = createConnection(socketPath);
|
|
615
|
-
const timer = setTimeout(() => finish(/* @__PURE__ */ new Error("Signal socket ownership
|
|
616
|
-
const onAbort = () => finish(/* @__PURE__ */ new Error("Signal socket ownership
|
|
604
|
+
const timer = setTimeout(() => finish(/* @__PURE__ */ new Error("Signal socket ownership check timed out")), 1e3);
|
|
605
|
+
const onAbort = () => finish(/* @__PURE__ */ new Error("Signal socket ownership check aborted"));
|
|
617
606
|
function finish(error, stale = false) {
|
|
618
607
|
clearTimeout(timer);
|
|
619
608
|
abortSignal?.removeEventListener("abort", onAbort);
|
|
@@ -659,7 +648,7 @@ async function prepareSignalSocketPath(socketPath, abortSignal) {
|
|
|
659
648
|
await unlink(socketPath);
|
|
660
649
|
return;
|
|
661
650
|
}
|
|
662
|
-
throw new Error("Signal socketPath changed during its ownership
|
|
651
|
+
throw new Error("Signal socketPath changed during its ownership check; retry startup");
|
|
663
652
|
}
|
|
664
653
|
throw new Error("Signal socketPath already exists; stop its owner or choose a different socket path before starting");
|
|
665
654
|
} catch (error) {
|
|
@@ -744,6 +733,7 @@ function result(message) {
|
|
|
744
733
|
return message.result;
|
|
745
734
|
}
|
|
746
735
|
async function signalUnixRpcRequest(method, params, options) {
|
|
736
|
+
const effect = captureEffectAuthority();
|
|
747
737
|
const connection = await openSocket(options);
|
|
748
738
|
const id = randomUUID();
|
|
749
739
|
const maxBytes = typeof options.maxResponseBytes === "number" && Number.isFinite(options.maxResponseBytes) && options.maxResponseBytes >= 1 ? Math.floor(options.maxResponseBytes) : MAX_FRAME_BYTES;
|
|
@@ -754,8 +744,10 @@ async function signalUnixRpcRequest(method, params, options) {
|
|
|
754
744
|
method,
|
|
755
745
|
params
|
|
756
746
|
})}\n`;
|
|
757
|
-
|
|
758
|
-
|
|
747
|
+
await effect.initiate(() => {
|
|
748
|
+
options.assertDirectAdapterHandoff?.();
|
|
749
|
+
connection.socket.write(frame);
|
|
750
|
+
});
|
|
759
751
|
for await (const message of messages(connection.socket, maxBytes)) if (message.id === id) return result(message);
|
|
760
752
|
throw new Error("Signal UNIX RPC closed before response");
|
|
761
753
|
} finally {
|
|
@@ -862,6 +854,9 @@ function normalizeSignalSseTimeoutMs(timeoutMs) {
|
|
|
862
854
|
return resolveTimerTimeoutMs(timeoutMs, DEFAULT_TIMEOUT_MS);
|
|
863
855
|
}
|
|
864
856
|
function requestSignalHttp(url, options) {
|
|
857
|
+
return captureEffectAuthority().initiate(() => initiateSignalHttp(url, options));
|
|
858
|
+
}
|
|
859
|
+
function initiateSignalHttp(url, options) {
|
|
865
860
|
assertSignalHttpProtocol(url, "HTTP");
|
|
866
861
|
const timeoutMs = resolveTimerTimeoutMs(options.timeoutMs, DEFAULT_TIMEOUT_MS);
|
|
867
862
|
const client = url.protocol === "https:" ? https : http;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as containerRpcRequest, i as streamSignalEvents$1, l as streamContainerEvents, n as signalCheck$1, r as signalRpcRequest$1, s as containerCheck } from "./client-
|
|
1
|
+
import { c as containerRpcRequest, i as streamSignalEvents$1, l as streamContainerEvents, n as signalCheck$1, r as signalRpcRequest$1, s as containerCheck } from "./client-DrPmUInx.mjs";
|
|
2
2
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
3
3
|
//#region extensions/signal/src/client-adapter.ts
|
|
4
4
|
const DEFAULT_TIMEOUT_MS = 1e4;
|
|
@@ -30,10 +30,6 @@ async function extractSignalCliArchive(archivePath, installRoot, timeoutMs) {
|
|
|
30
30
|
}
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
|
-
/** @internal Exported for testing. */
|
|
34
|
-
function looksLikeArchive(name) {
|
|
35
|
-
return name.endsWith(".tar.gz") || name.endsWith(".tgz") || name.endsWith(".zip");
|
|
36
|
-
}
|
|
37
33
|
function normalizeReleaseAsset(value) {
|
|
38
34
|
if (!isRecord(value)) return;
|
|
39
35
|
const name = normalizeOptionalString(value.name);
|
|
@@ -55,26 +51,6 @@ function normalizeSignalCliRelease(value) {
|
|
|
55
51
|
})
|
|
56
52
|
};
|
|
57
53
|
}
|
|
58
|
-
/**
|
|
59
|
-
* Pick a native release asset from the official GitHub releases.
|
|
60
|
-
*
|
|
61
|
-
* The official signal-cli releases only publish native (GraalVM) binaries for
|
|
62
|
-
* x86-64 Linux. On architectures where no native asset is available this
|
|
63
|
-
* returns `undefined` so the caller can fall back to a different install
|
|
64
|
-
* strategy (e.g. Homebrew).
|
|
65
|
-
*/
|
|
66
|
-
/** @internal Exported for testing. */
|
|
67
|
-
function pickAsset(assets, platform, arch) {
|
|
68
|
-
const archives = assets.filter((asset) => Boolean(asset.name && asset.browser_download_url)).filter((a) => looksLikeArchive(normalizeLowercaseStringOrEmpty(a.name)));
|
|
69
|
-
const byName = (pattern) => archives.find((asset) => pattern.test(normalizeLowercaseStringOrEmpty(asset.name)));
|
|
70
|
-
if (platform === "linux") {
|
|
71
|
-
if (arch === "x64") return byName(/linux-native/) || byName(/linux/) || archives[0];
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
if (platform === "darwin") return byName(/macos|osx|darwin/);
|
|
75
|
-
if (platform === "win32") return byName(/windows|win/) || archives[0];
|
|
76
|
-
return archives[0];
|
|
77
|
-
}
|
|
78
54
|
/** @internal Exported for testing. */
|
|
79
55
|
async function downloadToFile(url, dest, maxRedirects = 5, maxBytes = MAX_SIGNAL_CLI_ARCHIVE_BYTES) {
|
|
80
56
|
const { response, release } = await fetchWithSsrFGuard({
|
|
@@ -211,7 +187,9 @@ async function installSignalCliFromRelease(runtime) {
|
|
|
211
187
|
} finally {
|
|
212
188
|
await release();
|
|
213
189
|
}
|
|
214
|
-
const
|
|
190
|
+
const archives = releaseInfo.assets.filter((asset) => /\.(?:tar\.gz|tgz|zip)$/.test(normalizeLowercaseStringOrEmpty(asset.name)));
|
|
191
|
+
const byName = (pattern) => archives.find((asset) => pattern.test(normalizeLowercaseStringOrEmpty(asset.name)));
|
|
192
|
+
const asset = byName(/linux-native/) || byName(/linux/) || archives[0];
|
|
215
193
|
if (!asset) return {
|
|
216
194
|
ok: false,
|
|
217
195
|
error: "No compatible release asset found for this platform."
|
|
@@ -255,4 +233,4 @@ async function installSignalCli(runtime) {
|
|
|
255
233
|
return installSignalCliViaBrew(runtime);
|
|
256
234
|
}
|
|
257
235
|
//#endregion
|
|
258
|
-
export {
|
|
236
|
+
export { installSignalCliFromRelease as i, extractSignalCliArchive as n, installSignalCli as r, downloadToFile as t };
|