@inline-openclaw/inline 0.0.42 → 0.0.43
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/approval-handler.runtime.js +2 -1
- package/dist/approval-handler.runtime.js.map +3 -3
- package/dist/channel-plugin-api.js +72 -11
- package/dist/channel-plugin-api.js.map +4 -4
- package/dist/inline/message-formatting.d.ts.map +1 -1
- package/dist/inline/monitor.d.ts.map +1 -1
- package/dist/inline/threadreply-command.d.ts.map +1 -1
- package/dist/runtime-register-api.js +98 -6
- package/dist/runtime-register-api.js.map +4 -4
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message-formatting.d.ts","sourceRoot":"","sources":["../../src/inline/message-formatting.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"message-formatting.d.ts","sourceRoot":"","sources":["../../src/inline/message-formatting.ts"],"names":[],"mappings":"AA8BA,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAM3D;AAED,wBAAgB,uBAAuB,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAEpE;AAED,wBAAgB,iCAAiC,IAAI;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAA;CAAE,CAK5F;AAED,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAI/D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"monitor.d.ts","sourceRoot":"","sources":["../../src/inline/monitor.ts"],"names":[],"mappings":"AAqEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAA;AACjF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAA;AAEjE,OAAO,EAAsB,KAAK,qBAAqB,EAAE,MAAM,eAAe,CAA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I,CAAA;IACvC,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB,KAAK,IAAI,CAAA;AAgiEV,wBAAsB,qBAAqB,CAAC,MAAM,EAAE;IAClD,GAAG,EAAE,cAAc,CAAA;IACnB,OAAO,EAAE,qBAAqB,CAAA;IAC9B,OAAO,EAAE,UAAU,CAAA;IACnB,cAAc,CAAC,EAAE,qBAAqB,CAAA;IACtC,WAAW,EAAE,WAAW,CAAA;IACxB,GAAG,CAAC,EAAE;QAAE,IAAI,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;QAAC,IAAI,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;QAAC,KAAK,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;QAAC,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAA;KAAE,CAAA;IAC/H,UAAU,CAAC,EAAE,UAAU,CAAA;CACxB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CA2zE/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"threadreply-command.d.ts","sourceRoot":"","sources":["../../src/inline/threadreply-command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,+BAA+B,EAC/B,oBAAoB,EACrB,MAAM,4CAA4C,CAAA;
|
|
1
|
+
{"version":3,"file":"threadreply-command.d.ts","sourceRoot":"","sources":["../../src/inline/threadreply-command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,+BAA+B,EAC/B,oBAAoB,EACrB,MAAM,4CAA4C,CAAA;AAgTnD,wBAAsB,8BAA8B,CAClD,GAAG,EAAE,iBAAiB,EACtB,GAAG,EAAE,oBAAoB;;;;;;;;;;;;;GA8F1B;AAED,wBAAgB,8BAA8B,CAC5C,GAAG,EAAE,iBAAiB,GACrB,+BAA+B,CASjC"}
|
|
@@ -38360,6 +38360,7 @@ var INLINE_FORMATTING_RULES = [
|
|
|
38360
38360
|
"Prefer bullet lists over markdown tables.",
|
|
38361
38361
|
"If a table is necessary, render it inside a fenced code block.",
|
|
38362
38362
|
"Use plain URLs or markdown links; do not wrap bare URLs in inline code or backticks.",
|
|
38363
|
+
"Mention Inline users with markdown links like [@FirstName](inline://user?id=123); use inline://user?username=username only when the user id is unavailable.",
|
|
38363
38364
|
"Use inline code only for actual code, commands, file paths, env vars, or identifiers."
|
|
38364
38365
|
];
|
|
38365
38366
|
var INLINE_COPY_REPLACEMENTS = [
|
|
@@ -39112,6 +39113,7 @@ var MODE_LABELS = {
|
|
|
39112
39113
|
thread: "thread",
|
|
39113
39114
|
main: "main"
|
|
39114
39115
|
};
|
|
39116
|
+
var DEFAULT_REPLY_THREAD_AUTO_CREATE_MIN_MESSAGES = 50;
|
|
39115
39117
|
function isRecord3(value) {
|
|
39116
39118
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
39117
39119
|
}
|
|
@@ -39130,6 +39132,24 @@ function normalizeMode(raw) {
|
|
|
39130
39132
|
return normalized;
|
|
39131
39133
|
return null;
|
|
39132
39134
|
}
|
|
39135
|
+
function normalizeMin(raw) {
|
|
39136
|
+
if (typeof raw !== "number")
|
|
39137
|
+
return null;
|
|
39138
|
+
if (!Number.isInteger(raw) || raw < 0)
|
|
39139
|
+
return null;
|
|
39140
|
+
return raw;
|
|
39141
|
+
}
|
|
39142
|
+
function parseMinArg(raw) {
|
|
39143
|
+
const value = raw?.trim().toLowerCase();
|
|
39144
|
+
if (!value)
|
|
39145
|
+
return null;
|
|
39146
|
+
if (value === "inherit" || value === "default" || value === "unset")
|
|
39147
|
+
return "inherit";
|
|
39148
|
+
if (!/^\d+$/.test(value))
|
|
39149
|
+
return null;
|
|
39150
|
+
const parsed = Number(value);
|
|
39151
|
+
return Number.isSafeInteger(parsed) ? parsed : null;
|
|
39152
|
+
}
|
|
39133
39153
|
function resolveInlineGroupId(ctx) {
|
|
39134
39154
|
const raw = ctx.from?.trim() ?? "";
|
|
39135
39155
|
if (!/(^|:)chat:/i.test(raw))
|
|
@@ -39159,6 +39179,16 @@ function resolveCurrentMode(params) {
|
|
|
39159
39179
|
defaultMode: normalizeMode(accountConfig.replyThreadMode) ?? "auto"
|
|
39160
39180
|
});
|
|
39161
39181
|
}
|
|
39182
|
+
function resolveCurrentMinMessages(params) {
|
|
39183
|
+
const inline = asInlineConfig(params.cfg.channels?.inline) ?? {};
|
|
39184
|
+
const accountConfig = resolveInlineConfigForAccount(inline, params.accountId);
|
|
39185
|
+
return resolveInlineGroupReplyThreadAutoCreateMinMessages({
|
|
39186
|
+
cfg: params.cfg,
|
|
39187
|
+
accountId: params.accountId ?? null,
|
|
39188
|
+
groupId: params.groupId,
|
|
39189
|
+
defaultMinMessages: normalizeMin(accountConfig.replyThreadAutoCreateMinMessages) ?? DEFAULT_REPLY_THREAD_AUTO_CREATE_MIN_MESSAGES
|
|
39190
|
+
});
|
|
39191
|
+
}
|
|
39162
39192
|
function readExplicitMode(params) {
|
|
39163
39193
|
const inline = asInlineConfig(params.cfg.channels?.inline);
|
|
39164
39194
|
if (!inline)
|
|
@@ -39167,6 +39197,14 @@ function readExplicitMode(params) {
|
|
|
39167
39197
|
const group = accountConfig.groups?.[params.groupId];
|
|
39168
39198
|
return normalizeMode(group?.replyThreadMode);
|
|
39169
39199
|
}
|
|
39200
|
+
function readExplicitMinMessages(params) {
|
|
39201
|
+
const inline = asInlineConfig(params.cfg.channels?.inline);
|
|
39202
|
+
if (!inline)
|
|
39203
|
+
return null;
|
|
39204
|
+
const accountConfig = resolveInlineConfigForAccount(inline, params.accountId);
|
|
39205
|
+
const group = accountConfig.groups?.[params.groupId];
|
|
39206
|
+
return normalizeMin(group?.replyThreadAutoCreateMinMessages);
|
|
39207
|
+
}
|
|
39170
39208
|
function ensureRecordField(parent, key) {
|
|
39171
39209
|
const current = parent[key];
|
|
39172
39210
|
if (isRecord3(current))
|
|
@@ -39205,12 +39243,32 @@ function setGroupMode(params) {
|
|
|
39205
39243
|
}
|
|
39206
39244
|
group.replyThreadMode = params.mode;
|
|
39207
39245
|
}
|
|
39246
|
+
function setGroupMinMessages(params) {
|
|
39247
|
+
const root = params.draft;
|
|
39248
|
+
const channels = root.channels ?? {};
|
|
39249
|
+
root.channels = channels;
|
|
39250
|
+
const inline = asInlineConfig(channels.inline) ?? {};
|
|
39251
|
+
channels.inline = inline;
|
|
39252
|
+
const accountConfig = resolveMutableInlineConfigForAccount(inline, params.accountId);
|
|
39253
|
+
const groups = ensureRecordField(accountConfig, "groups");
|
|
39254
|
+
const group = isRecord3(groups[params.groupId]) ? groups[params.groupId] : {};
|
|
39255
|
+
groups[params.groupId] = group;
|
|
39256
|
+
if (params.minMessages === "inherit") {
|
|
39257
|
+
delete group.replyThreadAutoCreateMinMessages;
|
|
39258
|
+
return;
|
|
39259
|
+
}
|
|
39260
|
+
group.replyThreadAutoCreateMinMessages = params.minMessages;
|
|
39261
|
+
}
|
|
39208
39262
|
function buildStatusText(params) {
|
|
39209
39263
|
const explicit = readExplicitMode(params);
|
|
39210
39264
|
const current = resolveCurrentMode(params);
|
|
39265
|
+
const explicitMin = readExplicitMinMessages(params);
|
|
39266
|
+
const currentMin = resolveCurrentMinMessages(params);
|
|
39211
39267
|
return [
|
|
39212
39268
|
`Thread reply mode for chat ${params.groupId}: ${MODE_LABELS[current]}.`,
|
|
39213
|
-
explicit ? `Explicit chat override: ${MODE_LABELS[explicit]}.` : "Explicit chat override: inherit."
|
|
39269
|
+
explicit ? `Explicit chat override: ${MODE_LABELS[explicit]}.` : "Explicit chat override: inherit.",
|
|
39270
|
+
`Auto-create minimum messages: ${currentMin}.`,
|
|
39271
|
+
explicitMin != null ? `Explicit minimum override: ${explicitMin}.` : "Explicit minimum override: inherit."
|
|
39214
39272
|
].join(`
|
|
39215
39273
|
`);
|
|
39216
39274
|
}
|
|
@@ -39231,7 +39289,12 @@ function buildModeButtons() {
|
|
|
39231
39289
|
{ text: "Main", callback_data: "/threadreply main" },
|
|
39232
39290
|
{ text: "Auto", callback_data: "/threadreply auto" }
|
|
39233
39291
|
],
|
|
39234
|
-
[{ text: "Inherit", callback_data: "/threadreply inherit" }]
|
|
39292
|
+
[{ text: "Inherit Mode", callback_data: "/threadreply inherit" }],
|
|
39293
|
+
[
|
|
39294
|
+
{ text: "Min 0", callback_data: "/threadreply min 0" },
|
|
39295
|
+
{ text: "Min 50", callback_data: "/threadreply min 50" },
|
|
39296
|
+
{ text: "Inherit Min", callback_data: "/threadreply min inherit" }
|
|
39297
|
+
]
|
|
39235
39298
|
]
|
|
39236
39299
|
}
|
|
39237
39300
|
};
|
|
@@ -39256,7 +39319,34 @@ async function handleInlineThreadReplyCommand(api2, ctx) {
|
|
|
39256
39319
|
return { text: "/threadreply is only available in Inline group chats." };
|
|
39257
39320
|
}
|
|
39258
39321
|
const currentConfig = api2.runtime.config.current();
|
|
39259
|
-
const
|
|
39322
|
+
const args = ctx.args?.trim() ?? "";
|
|
39323
|
+
const [first = "", second, ...rest] = args.split(/\s+/).filter(Boolean);
|
|
39324
|
+
if (["min", "minimum", "threshold", "limit"].includes(first.trim().toLowerCase())) {
|
|
39325
|
+
const minMessages = parseMinArg(second);
|
|
39326
|
+
if (minMessages == null || rest.length > 0) {
|
|
39327
|
+
return { text: "Usage: /threadreply min <0-or-greater>|inherit" };
|
|
39328
|
+
}
|
|
39329
|
+
const committed2 = await api2.runtime.config.mutateConfigFile({
|
|
39330
|
+
afterWrite: { mode: "auto" },
|
|
39331
|
+
mutate: (draft) => {
|
|
39332
|
+
setGroupMinMessages({
|
|
39333
|
+
draft,
|
|
39334
|
+
accountId: ctx.accountId,
|
|
39335
|
+
groupId,
|
|
39336
|
+
minMessages
|
|
39337
|
+
});
|
|
39338
|
+
}
|
|
39339
|
+
});
|
|
39340
|
+
const nextConfig2 = committed2.nextConfig;
|
|
39341
|
+
return {
|
|
39342
|
+
text: buildStatusText({
|
|
39343
|
+
cfg: nextConfig2,
|
|
39344
|
+
accountId: ctx.accountId,
|
|
39345
|
+
groupId
|
|
39346
|
+
})
|
|
39347
|
+
};
|
|
39348
|
+
}
|
|
39349
|
+
const action = normalizeAction(args);
|
|
39260
39350
|
if (action === "help") {
|
|
39261
39351
|
return {
|
|
39262
39352
|
text: buildMenuText({
|
|
@@ -39280,11 +39370,13 @@ async function handleInlineThreadReplyCommand(api2, ctx) {
|
|
|
39280
39370
|
return {
|
|
39281
39371
|
text: [
|
|
39282
39372
|
"Usage: /threadreply thread|main|auto|inherit|status",
|
|
39373
|
+
" /threadreply min <0-or-greater>|inherit",
|
|
39283
39374
|
"",
|
|
39284
|
-
"- thread: auto-route
|
|
39375
|
+
"- thread: auto-route parent-chat replies into per-message Inline reply threads once the minimum is reached.",
|
|
39285
39376
|
"- main: keep automatic replies in the parent chat.",
|
|
39286
39377
|
"- auto: use Inline's automatic default behavior for this chat.",
|
|
39287
|
-
"- inherit: remove this chat override and use account/default config."
|
|
39378
|
+
"- inherit: remove this chat override and use account/default config.",
|
|
39379
|
+
"- min: set how many parent-chat messages must exist before automatic thread creation."
|
|
39288
39380
|
].join(`
|
|
39289
39381
|
`)
|
|
39290
39382
|
};
|
|
@@ -39368,5 +39460,5 @@ export {
|
|
|
39368
39460
|
registerInlinePluginFull
|
|
39369
39461
|
};
|
|
39370
39462
|
|
|
39371
|
-
//# debugId=
|
|
39463
|
+
//# debugId=6281D0C5544F91C564756E2164756E21
|
|
39372
39464
|
//# sourceMappingURL=runtime-register-api.js.map
|