@inline-openclaw/inline 0.0.63 → 0.0.65
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/README.md +35 -14
- package/dist/account-inspect-api.js +8 -1
- package/dist/account-inspect-api.js.map +3 -3
- package/dist/approval-handler.runtime.js +3006 -414
- package/dist/approval-handler.runtime.js.map +24 -22
- package/dist/channel-plugin-api.js +3845 -749
- package/dist/channel-plugin-api.js.map +34 -30
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +278 -2
- package/dist/index.js.map +5 -4
- package/dist/runtime-register-api.js +2726 -309
- package/dist/runtime-register-api.js.map +24 -22
- package/dist/setup-plugin-api.js +56 -35
- package/dist/setup-plugin-api.js.map +6 -6
- package/docs/openclaw-setup.md +37 -4
- package/openclaw.plugin.json +1 -0
- package/package.json +7 -7
package/dist/setup-plugin-api.js
CHANGED
|
@@ -37,7 +37,9 @@ function hasInlineConfiguredState(params) {
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
// src/inline/setup-core.ts
|
|
40
|
-
import {
|
|
40
|
+
import {
|
|
41
|
+
createEnvPatchedAccountSetupAdapter
|
|
42
|
+
} from "openclaw/plugin-sdk/setup-runtime";
|
|
41
43
|
|
|
42
44
|
// src/inline/accounts.ts
|
|
43
45
|
import { tryReadSecretFileSync } from "openclaw/plugin-sdk/channel-core";
|
|
@@ -14416,6 +14418,13 @@ function resolveControlCommandGate(params) {
|
|
|
14416
14418
|
shouldBlock: params.allowTextCommands && params.hasControlCommand && !commandAuthorized
|
|
14417
14419
|
};
|
|
14418
14420
|
}
|
|
14421
|
+
function resolveUseAccessGroups(cfg) {
|
|
14422
|
+
const commands = cfg.commands;
|
|
14423
|
+
if (!commands || typeof commands !== "object" || Array.isArray(commands)) {
|
|
14424
|
+
return true;
|
|
14425
|
+
}
|
|
14426
|
+
return commands.useAccessGroups !== false;
|
|
14427
|
+
}
|
|
14419
14428
|
function resolveMentionGatingWithBypass(params) {
|
|
14420
14429
|
const shouldBypassMention = params.isGroup && params.requireMention && !params.wasMentioned && !(params.hasAnyMention ?? false) && params.allowTextCommands && params.commandAuthorized && params.hasControlCommand;
|
|
14421
14430
|
const effectiveWasMentioned = params.wasMentioned || params.implicitMention === true || shouldBypassMention;
|
|
@@ -15054,17 +15063,18 @@ var inlineSetupAdapter = createEnvPatchedAccountSetupAdapter({
|
|
|
15054
15063
|
|
|
15055
15064
|
// src/inline/setup-surface.ts
|
|
15056
15065
|
import {
|
|
15066
|
+
addWildcardAllowFrom,
|
|
15057
15067
|
createAllowFromSection,
|
|
15058
|
-
|
|
15059
|
-
createLegacyCompatChannelDmPolicy,
|
|
15068
|
+
createPromptParsedAllowFromForAccount,
|
|
15060
15069
|
createStandardChannelSetupStatus,
|
|
15061
15070
|
DEFAULT_ACCOUNT_ID as DEFAULT_ACCOUNT_ID2,
|
|
15062
15071
|
formatCliCommand,
|
|
15072
|
+
parseSetupEntriesWithParser,
|
|
15063
15073
|
patchChannelConfigForAccount,
|
|
15064
|
-
promptResolvedAllowFrom,
|
|
15065
15074
|
setSetupChannelEnabled,
|
|
15066
15075
|
splitSetupEntries
|
|
15067
15076
|
} from "openclaw/plugin-sdk/setup";
|
|
15077
|
+
import { createAccountScopedGroupAccessSection } from "openclaw/plugin-sdk/setup-runtime";
|
|
15068
15078
|
var channel2 = "inline";
|
|
15069
15079
|
var INLINE_USER_ID_HELP_LINES = [
|
|
15070
15080
|
"Allowlist Inline DMs by numeric user id.",
|
|
@@ -15169,39 +15179,27 @@ function ensureInlineDefaultGroupMentionGate(cfg, accountId) {
|
|
|
15169
15179
|
function formatInlineConfigBase(accountId) {
|
|
15170
15180
|
return accountId === DEFAULT_ACCOUNT_ID2 ? "channels.inline" : `channels.inline.accounts.${accountId}`;
|
|
15171
15181
|
}
|
|
15172
|
-
|
|
15173
|
-
|
|
15174
|
-
|
|
15175
|
-
|
|
15176
|
-
|
|
15177
|
-
|
|
15178
|
-
|
|
15179
|
-
|
|
15180
|
-
|
|
15181
|
-
|
|
15182
|
-
|
|
15183
|
-
|
|
15184
|
-
|
|
15185
|
-
invalidWithoutTokenNote: "Inline token missing; use numeric user ids.",
|
|
15186
|
-
resolveEntries: async ({ entries }) => entries.map((entry) => {
|
|
15187
|
-
const id = parseInlineAllowFromId(entry);
|
|
15188
|
-
return {
|
|
15189
|
-
input: entry,
|
|
15190
|
-
resolved: Boolean(id),
|
|
15191
|
-
id
|
|
15192
|
-
};
|
|
15193
|
-
})
|
|
15194
|
-
});
|
|
15195
|
-
return patchChannelConfigForAccount({
|
|
15196
|
-
cfg: params.cfg,
|
|
15182
|
+
var promptInlineAllowFromForAccount = createPromptParsedAllowFromForAccount({
|
|
15183
|
+
defaultAccountId: DEFAULT_ACCOUNT_ID2,
|
|
15184
|
+
noteTitle: "Inline allowlist",
|
|
15185
|
+
noteLines: INLINE_USER_ID_HELP_LINES,
|
|
15186
|
+
message: "Inline allowFrom (user ids)",
|
|
15187
|
+
placeholder: "123456789, user:234567890",
|
|
15188
|
+
parseEntries: (raw) => parseSetupEntriesWithParser(raw, (entry) => {
|
|
15189
|
+
const id = parseInlineAllowFromId(entry);
|
|
15190
|
+
return id ? { value: id } : { error: "Inline user id must be numeric, user:<id>, or inline:user:<id>." };
|
|
15191
|
+
}),
|
|
15192
|
+
getExistingAllowFrom: ({ cfg, accountId }) => resolveInlineAccount({ cfg, accountId }).config.allowFrom ?? [],
|
|
15193
|
+
applyAllowFrom: ({ cfg, accountId, allowFrom }) => patchChannelConfigForAccount({
|
|
15194
|
+
cfg,
|
|
15197
15195
|
channel: channel2,
|
|
15198
15196
|
accountId,
|
|
15199
15197
|
patch: {
|
|
15200
15198
|
dmPolicy: "allowlist",
|
|
15201
15199
|
allowFrom
|
|
15202
15200
|
}
|
|
15203
|
-
})
|
|
15204
|
-
}
|
|
15201
|
+
})
|
|
15202
|
+
});
|
|
15205
15203
|
function shouldShowInlineDmAccessWarning(params) {
|
|
15206
15204
|
const resolved = resolveInlineAccount({ cfg: params.cfg, accountId: params.accountId });
|
|
15207
15205
|
const policy = resolved.config.dmPolicy ?? "pairing";
|
|
@@ -15246,11 +15244,34 @@ function buildInlineGroupAccessWarningLines(params) {
|
|
|
15246
15244
|
}
|
|
15247
15245
|
return [];
|
|
15248
15246
|
}
|
|
15249
|
-
var inlineDmPolicy =
|
|
15247
|
+
var inlineDmPolicy = {
|
|
15250
15248
|
label: "Inline",
|
|
15251
15249
|
channel: channel2,
|
|
15250
|
+
policyKey: "channels.inline.dmPolicy",
|
|
15251
|
+
allowFromKey: "channels.inline.allowFrom",
|
|
15252
|
+
resolveConfigKeys: (_cfg, accountId) => {
|
|
15253
|
+
const base = accountId && accountId !== DEFAULT_ACCOUNT_ID2 ? `channels.inline.accounts.${accountId}` : "channels.inline";
|
|
15254
|
+
return {
|
|
15255
|
+
policyKey: `${base}.dmPolicy`,
|
|
15256
|
+
allowFromKey: `${base}.allowFrom`
|
|
15257
|
+
};
|
|
15258
|
+
},
|
|
15259
|
+
getCurrent: (cfg, accountId) => resolveInlineAccount({ cfg, accountId: accountId ?? DEFAULT_ACCOUNT_ID2 }).config.dmPolicy ?? "pairing",
|
|
15260
|
+
setPolicy: (cfg, policy, accountId) => {
|
|
15261
|
+
const resolvedAccountId = accountId ?? DEFAULT_ACCOUNT_ID2;
|
|
15262
|
+
const account = resolveInlineAccount({ cfg, accountId: resolvedAccountId });
|
|
15263
|
+
return patchChannelConfigForAccount({
|
|
15264
|
+
cfg,
|
|
15265
|
+
channel: channel2,
|
|
15266
|
+
accountId: resolvedAccountId,
|
|
15267
|
+
patch: {
|
|
15268
|
+
dmPolicy: policy,
|
|
15269
|
+
...policy === "open" ? { allowFrom: addWildcardAllowFrom(account.config.allowFrom) } : {}
|
|
15270
|
+
}
|
|
15271
|
+
});
|
|
15272
|
+
},
|
|
15252
15273
|
promptAllowFrom: promptInlineAllowFromForAccount
|
|
15253
|
-
}
|
|
15274
|
+
};
|
|
15254
15275
|
var inlineSetupWizard = {
|
|
15255
15276
|
channel: channel2,
|
|
15256
15277
|
status: createStandardChannelSetupStatus({
|
|
@@ -15690,7 +15711,7 @@ var inlineSecurityAdapter = {
|
|
|
15690
15711
|
const groupAccessEnabled = groupPolicy === "open" || groupPolicy === "allowlist" && (groupsConfigured || groupSendersConfigured);
|
|
15691
15712
|
if (!groupAccessEnabled)
|
|
15692
15713
|
return findings;
|
|
15693
|
-
if (cfg
|
|
15714
|
+
if (!resolveUseAccessGroups(cfg)) {
|
|
15694
15715
|
findings.push({
|
|
15695
15716
|
checkId: "channels.inline.groups.commands.access_groups_disabled",
|
|
15696
15717
|
severity: "critical",
|
|
@@ -15768,5 +15789,5 @@ export {
|
|
|
15768
15789
|
inlineSetupPlugin
|
|
15769
15790
|
};
|
|
15770
15791
|
|
|
15771
|
-
//# debugId=
|
|
15792
|
+
//# debugId=4C5EEBEFCB50166164756E2164756E21
|
|
15772
15793
|
//# sourceMappingURL=setup-plugin-api.js.map
|