@inline-openclaw/inline 0.0.43 → 0.0.44
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 +1 -1
- package/dist/approval-handler.runtime.js +81 -7
- package/dist/approval-handler.runtime.js.map +3 -3
- package/dist/channel-plugin-api.js +94 -27
- package/dist/channel-plugin-api.js.map +5 -5
- package/dist/inline/monitor.d.ts.map +1 -1
- package/dist/runtime-register-api.js +81 -7
- package/dist/runtime-register-api.js.map +3 -3
- package/package.json +1 -1
|
@@ -6984,7 +6984,8 @@ class Chat$Type extends import_runtime4.MessageType {
|
|
|
6984
6984
|
{ no: 9, name: "date", kind: "scalar", opt: true, T: 3, L: 0 },
|
|
6985
6985
|
{ no: 10, name: "created_by", kind: "scalar", opt: true, T: 3, L: 0 },
|
|
6986
6986
|
{ no: 11, name: "parent_chat_id", kind: "scalar", opt: true, T: 3, L: 0 },
|
|
6987
|
-
{ no: 12, name: "parent_message_id", kind: "scalar", opt: true, T: 3, L: 0 }
|
|
6987
|
+
{ no: 12, name: "parent_message_id", kind: "scalar", opt: true, T: 3, L: 0 },
|
|
6988
|
+
{ no: 13, name: "untitled", kind: "scalar", opt: true, T: 8 }
|
|
6988
6989
|
]);
|
|
6989
6990
|
}
|
|
6990
6991
|
create(value) {
|
|
@@ -7036,6 +7037,9 @@ class Chat$Type extends import_runtime4.MessageType {
|
|
|
7036
7037
|
case 12:
|
|
7037
7038
|
message.parentMessageId = reader.int64().toBigInt();
|
|
7038
7039
|
break;
|
|
7040
|
+
case 13:
|
|
7041
|
+
message.untitled = reader.bool();
|
|
7042
|
+
break;
|
|
7039
7043
|
default:
|
|
7040
7044
|
let u = options.readUnknownField;
|
|
7041
7045
|
if (u === "throw")
|
|
@@ -7072,6 +7076,8 @@ class Chat$Type extends import_runtime4.MessageType {
|
|
|
7072
7076
|
writer.tag(11, import_runtime.WireType.Varint).int64(message.parentChatId);
|
|
7073
7077
|
if (message.parentMessageId !== undefined)
|
|
7074
7078
|
writer.tag(12, import_runtime.WireType.Varint).int64(message.parentMessageId);
|
|
7079
|
+
if (message.untitled !== undefined)
|
|
7080
|
+
writer.tag(13, import_runtime.WireType.Varint).bool(message.untitled);
|
|
7075
7081
|
let u = options.writeUnknownFields;
|
|
7076
7082
|
if (u !== false)
|
|
7077
7083
|
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
@@ -11181,6 +11187,63 @@ class GetUpdatesInput$Type extends import_runtime4.MessageType {
|
|
|
11181
11187
|
}
|
|
11182
11188
|
var GetUpdatesInput = new GetUpdatesInput$Type;
|
|
11183
11189
|
|
|
11190
|
+
class UpdateSidecars$Type extends import_runtime4.MessageType {
|
|
11191
|
+
constructor() {
|
|
11192
|
+
super("UpdateSidecars", [
|
|
11193
|
+
{ no: 1, name: "users", kind: "message", repeat: 1, T: () => User },
|
|
11194
|
+
{ no: 2, name: "chats", kind: "message", repeat: 1, T: () => Chat },
|
|
11195
|
+
{ no: 3, name: "dialogs", kind: "message", repeat: 1, T: () => Dialog }
|
|
11196
|
+
]);
|
|
11197
|
+
}
|
|
11198
|
+
create(value) {
|
|
11199
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
11200
|
+
message.users = [];
|
|
11201
|
+
message.chats = [];
|
|
11202
|
+
message.dialogs = [];
|
|
11203
|
+
if (value !== undefined)
|
|
11204
|
+
import_runtime3.reflectionMergePartial(this, message, value);
|
|
11205
|
+
return message;
|
|
11206
|
+
}
|
|
11207
|
+
internalBinaryRead(reader, length, options, target) {
|
|
11208
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
11209
|
+
while (reader.pos < end) {
|
|
11210
|
+
let [fieldNo, wireType] = reader.tag();
|
|
11211
|
+
switch (fieldNo) {
|
|
11212
|
+
case 1:
|
|
11213
|
+
message.users.push(User.internalBinaryRead(reader, reader.uint32(), options));
|
|
11214
|
+
break;
|
|
11215
|
+
case 2:
|
|
11216
|
+
message.chats.push(Chat.internalBinaryRead(reader, reader.uint32(), options));
|
|
11217
|
+
break;
|
|
11218
|
+
case 3:
|
|
11219
|
+
message.dialogs.push(Dialog.internalBinaryRead(reader, reader.uint32(), options));
|
|
11220
|
+
break;
|
|
11221
|
+
default:
|
|
11222
|
+
let u = options.readUnknownField;
|
|
11223
|
+
if (u === "throw")
|
|
11224
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
11225
|
+
let d = reader.skip(wireType);
|
|
11226
|
+
if (u !== false)
|
|
11227
|
+
(u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
11228
|
+
}
|
|
11229
|
+
}
|
|
11230
|
+
return message;
|
|
11231
|
+
}
|
|
11232
|
+
internalBinaryWrite(message, writer, options) {
|
|
11233
|
+
for (let i = 0;i < message.users.length; i++)
|
|
11234
|
+
User.internalBinaryWrite(message.users[i], writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
11235
|
+
for (let i = 0;i < message.chats.length; i++)
|
|
11236
|
+
Chat.internalBinaryWrite(message.chats[i], writer.tag(2, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
11237
|
+
for (let i = 0;i < message.dialogs.length; i++)
|
|
11238
|
+
Dialog.internalBinaryWrite(message.dialogs[i], writer.tag(3, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
11239
|
+
let u = options.writeUnknownFields;
|
|
11240
|
+
if (u !== false)
|
|
11241
|
+
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
11242
|
+
return writer;
|
|
11243
|
+
}
|
|
11244
|
+
}
|
|
11245
|
+
var UpdateSidecars = new UpdateSidecars$Type;
|
|
11246
|
+
|
|
11184
11247
|
class GetUpdatesResult$Type extends import_runtime4.MessageType {
|
|
11185
11248
|
constructor() {
|
|
11186
11249
|
super("GetUpdatesResult", [
|
|
@@ -11188,7 +11251,8 @@ class GetUpdatesResult$Type extends import_runtime4.MessageType {
|
|
|
11188
11251
|
{ no: 2, name: "seq", kind: "scalar", T: 3, L: 0 },
|
|
11189
11252
|
{ no: 3, name: "date", kind: "scalar", T: 3, L: 0 },
|
|
11190
11253
|
{ no: 4, name: "final", kind: "scalar", opt: true, T: 8 },
|
|
11191
|
-
{ no: 5, name: "result_type", kind: "enum", T: () => ["GetUpdatesResult.ResultType", GetUpdatesResult_ResultType, "RESULT_TYPE_"] }
|
|
11254
|
+
{ no: 5, name: "result_type", kind: "enum", T: () => ["GetUpdatesResult.ResultType", GetUpdatesResult_ResultType, "RESULT_TYPE_"] },
|
|
11255
|
+
{ no: 6, name: "sidecars", kind: "message", T: () => UpdateSidecars }
|
|
11192
11256
|
]);
|
|
11193
11257
|
}
|
|
11194
11258
|
create(value) {
|
|
@@ -11221,6 +11285,9 @@ class GetUpdatesResult$Type extends import_runtime4.MessageType {
|
|
|
11221
11285
|
case 5:
|
|
11222
11286
|
message.resultType = reader.int32();
|
|
11223
11287
|
break;
|
|
11288
|
+
case 6:
|
|
11289
|
+
message.sidecars = UpdateSidecars.internalBinaryRead(reader, reader.uint32(), options, message.sidecars);
|
|
11290
|
+
break;
|
|
11224
11291
|
default:
|
|
11225
11292
|
let u = options.readUnknownField;
|
|
11226
11293
|
if (u === "throw")
|
|
@@ -11243,6 +11310,8 @@ class GetUpdatesResult$Type extends import_runtime4.MessageType {
|
|
|
11243
11310
|
writer.tag(4, import_runtime.WireType.Varint).bool(message.final);
|
|
11244
11311
|
if (message.resultType !== 0)
|
|
11245
11312
|
writer.tag(5, import_runtime.WireType.Varint).int32(message.resultType);
|
|
11313
|
+
if (message.sidecars)
|
|
11314
|
+
UpdateSidecars.internalBinaryWrite(message.sidecars, writer.tag(6, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
11246
11315
|
let u = options.writeUnknownFields;
|
|
11247
11316
|
if (u !== false)
|
|
11248
11317
|
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
@@ -15969,7 +16038,7 @@ var ReserveChatIdsResult = new ReserveChatIdsResult$Type;
|
|
|
15969
16038
|
class CreateChatInput$Type extends import_runtime4.MessageType {
|
|
15970
16039
|
constructor() {
|
|
15971
16040
|
super("CreateChatInput", [
|
|
15972
|
-
{ no: 1, name: "title", kind: "scalar", T: 9 },
|
|
16041
|
+
{ no: 1, name: "title", kind: "scalar", opt: true, T: 9 },
|
|
15973
16042
|
{ no: 2, name: "space_id", kind: "scalar", opt: true, T: 3, L: 0 },
|
|
15974
16043
|
{ no: 3, name: "description", kind: "scalar", opt: true, T: 9 },
|
|
15975
16044
|
{ no: 4, name: "emoji", kind: "scalar", opt: true, T: 9 },
|
|
@@ -15980,7 +16049,6 @@ class CreateChatInput$Type extends import_runtime4.MessageType {
|
|
|
15980
16049
|
}
|
|
15981
16050
|
create(value) {
|
|
15982
16051
|
const message = globalThis.Object.create(this.messagePrototype);
|
|
15983
|
-
message.title = "";
|
|
15984
16052
|
message.isPublic = false;
|
|
15985
16053
|
message.participants = [];
|
|
15986
16054
|
if (value !== undefined)
|
|
@@ -16025,7 +16093,7 @@ class CreateChatInput$Type extends import_runtime4.MessageType {
|
|
|
16025
16093
|
return message;
|
|
16026
16094
|
}
|
|
16027
16095
|
internalBinaryWrite(message, writer, options) {
|
|
16028
|
-
if (message.title !==
|
|
16096
|
+
if (message.title !== undefined)
|
|
16029
16097
|
writer.tag(1, import_runtime.WireType.LengthDelimited).string(message.title);
|
|
16030
16098
|
if (message.spaceId !== undefined)
|
|
16031
16099
|
writer.tag(2, import_runtime.WireType.Varint).int64(message.spaceId);
|
|
@@ -16875,7 +16943,8 @@ class UpdateChatInfo$Type extends import_runtime4.MessageType {
|
|
|
16875
16943
|
super("UpdateChatInfo", [
|
|
16876
16944
|
{ no: 1, name: "chat_id", kind: "scalar", T: 3, L: 0 },
|
|
16877
16945
|
{ no: 2, name: "title", kind: "scalar", opt: true, T: 9 },
|
|
16878
|
-
{ no: 3, name: "emoji", kind: "scalar", opt: true, T: 9 }
|
|
16946
|
+
{ no: 3, name: "emoji", kind: "scalar", opt: true, T: 9 },
|
|
16947
|
+
{ no: 4, name: "untitled", kind: "scalar", opt: true, T: 8 }
|
|
16879
16948
|
]);
|
|
16880
16949
|
}
|
|
16881
16950
|
create(value) {
|
|
@@ -16899,6 +16968,9 @@ class UpdateChatInfo$Type extends import_runtime4.MessageType {
|
|
|
16899
16968
|
case 3:
|
|
16900
16969
|
message.emoji = reader.string();
|
|
16901
16970
|
break;
|
|
16971
|
+
case 4:
|
|
16972
|
+
message.untitled = reader.bool();
|
|
16973
|
+
break;
|
|
16902
16974
|
default:
|
|
16903
16975
|
let u = options.readUnknownField;
|
|
16904
16976
|
if (u === "throw")
|
|
@@ -16917,6 +16989,8 @@ class UpdateChatInfo$Type extends import_runtime4.MessageType {
|
|
|
16917
16989
|
writer.tag(2, import_runtime.WireType.LengthDelimited).string(message.title);
|
|
16918
16990
|
if (message.emoji !== undefined)
|
|
16919
16991
|
writer.tag(3, import_runtime.WireType.LengthDelimited).string(message.emoji);
|
|
16992
|
+
if (message.untitled !== undefined)
|
|
16993
|
+
writer.tag(4, import_runtime.WireType.Varint).bool(message.untitled);
|
|
16920
16994
|
let u = options.writeUnknownFields;
|
|
16921
16995
|
if (u !== false)
|
|
16922
16996
|
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
@@ -40975,6 +41049,7 @@ var INLINE_REQUEST_ERROR_FALLBACK = "OpenClaw could not process that request. Pl
|
|
|
40975
41049
|
var INLINE_DEBOUNCE_ERROR_FALLBACK = "OpenClaw could not process those messages. Please try again.";
|
|
40976
41050
|
var DEFAULT_REPLY_THREAD_AUTO_CREATE_MIN_MESSAGES = 50;
|
|
40977
41051
|
var DEFAULT_REPLY_THREAD_PARENT_HISTORY_LIMIT = 10;
|
|
41052
|
+
var INLINE_REPLY_THREAD_SYSTEM_PROMPT = "Inline reply threads are scoped conversations: answer only the current reply-thread message and this thread's own history; use parent-chat context only as background, and do not answer unrelated questions from the parent chat or other reply threads.";
|
|
40978
41053
|
function buildInlineTypingDispatcherOptions(typingCallbacks) {
|
|
40979
41054
|
if (!typingCallbacks) {
|
|
40980
41055
|
return {};
|
|
@@ -41792,7 +41867,11 @@ function resolveInlineSystemPrompt(params) {
|
|
|
41792
41867
|
groups: params.account.config.groups,
|
|
41793
41868
|
groupId: params.groupId
|
|
41794
41869
|
}) : undefined;
|
|
41795
|
-
return [
|
|
41870
|
+
return [
|
|
41871
|
+
buildInlineSystemPrompt(params.account.config.systemPrompt),
|
|
41872
|
+
groupPrompt,
|
|
41873
|
+
params.replyThread ? INLINE_REPLY_THREAD_SYSTEM_PROMPT : undefined
|
|
41874
|
+
].filter((entry) => Boolean(entry)).join(`
|
|
41796
41875
|
|
|
41797
41876
|
`);
|
|
41798
41877
|
}
|
|
@@ -42231,13 +42310,6 @@ function buildInlineInboundBodyText(content) {
|
|
|
42231
42310
|
`).trim();
|
|
42232
42311
|
return textWithPlaceholder || content.text;
|
|
42233
42312
|
}
|
|
42234
|
-
function hasDownloadableInlineMedia(content) {
|
|
42235
|
-
if (!content)
|
|
42236
|
-
return false;
|
|
42237
|
-
if (content.media?.url)
|
|
42238
|
-
return true;
|
|
42239
|
-
return content.attachments.some((attachment) => attachment.kind === "urlPreview" && Boolean(attachment.previewImageUrl));
|
|
42240
|
-
}
|
|
42241
42313
|
function resolveFilePathHint(params) {
|
|
42242
42314
|
const preferred = params.preferredName?.trim();
|
|
42243
42315
|
if (preferred)
|
|
@@ -42275,8 +42347,9 @@ async function resolveInlineInboundMedia(params) {
|
|
|
42275
42347
|
maxBytes: params.maxBytes,
|
|
42276
42348
|
...filePathHint ? { filePathHint } : {}
|
|
42277
42349
|
});
|
|
42278
|
-
const
|
|
42279
|
-
const
|
|
42350
|
+
const fetchedContentType = fetched.contentType ?? candidate.mimeType ?? undefined;
|
|
42351
|
+
const saved = await params.core.channel.media.saveMediaBuffer(fetched.buffer, fetchedContentType, "inbound", params.maxBytes, fetched.fileName ?? candidate.fileName ?? undefined);
|
|
42352
|
+
const contentType = saved.contentType ?? fetchedContentType;
|
|
42280
42353
|
out.push({
|
|
42281
42354
|
path: saved.path,
|
|
42282
42355
|
...contentType ? { contentType } : {}
|
|
@@ -43513,13 +43586,6 @@ This model will be used for your next message.`, []);
|
|
|
43513
43586
|
maxBytes: inboundMediaMaxBytes,
|
|
43514
43587
|
...log ? { log } : {}
|
|
43515
43588
|
});
|
|
43516
|
-
const inheritedAnchorMedia = deliveryReplyThreadContext?.anchorMessage != null && currentContent != null && !hasDownloadableInlineMedia(currentContent) ? await resolveInlineInboundMedia({
|
|
43517
|
-
core: core3,
|
|
43518
|
-
message: deliveryReplyThreadContext.anchorMessage,
|
|
43519
|
-
maxBytes: inboundMediaMaxBytes,
|
|
43520
|
-
...log ? { log } : {}
|
|
43521
|
-
}) : [];
|
|
43522
|
-
const mediaForAgent = inboundMedia.length > 0 ? inboundMedia : inheritedAnchorMedia;
|
|
43523
43589
|
const timestamp = messageTimestamp;
|
|
43524
43590
|
const fromLabel = resolveInlineConversationLabel({
|
|
43525
43591
|
isGroup,
|
|
@@ -43556,7 +43622,8 @@ This model will be used for your next message.`, []);
|
|
|
43556
43622
|
const effectiveSurface = CHANNEL_ID;
|
|
43557
43623
|
const systemPrompt = resolveInlineSystemPrompt({
|
|
43558
43624
|
account,
|
|
43559
|
-
...isGroup ? { groupId: String(effectiveChatId) } : {}
|
|
43625
|
+
...isGroup ? { groupId: String(effectiveChatId) } : {},
|
|
43626
|
+
replyThread: Boolean(deliveryReplyThreadContext)
|
|
43560
43627
|
});
|
|
43561
43628
|
const messageSid = buildInlineInboundMessageSid({
|
|
43562
43629
|
msgId: msg.id,
|
|
@@ -43608,7 +43675,7 @@ This model will be used for your next message.`, []);
|
|
|
43608
43675
|
MessageActionDataBase64: callbackDataToBase64(callbackActionEvent.data),
|
|
43609
43676
|
...callbackDataToUtf8(callbackActionEvent.data) ? { MessageActionDataUtf8: callbackDataToUtf8(callbackActionEvent.data) } : {}
|
|
43610
43677
|
} : {},
|
|
43611
|
-
...buildInlineInboundMediaPayload(
|
|
43678
|
+
...buildInlineInboundMediaPayload(inboundMedia),
|
|
43612
43679
|
Timestamp: timestamp || Date.now(),
|
|
43613
43680
|
...isGroup ? { WasMentioned: mentionGate.effectiveWasMentioned } : {},
|
|
43614
43681
|
...isGroup ? {
|
|
@@ -46705,7 +46772,7 @@ var inlineChannelPlugin = {
|
|
|
46705
46772
|
"- Inline reply threads: use `thread-create` to create or reuse a real reply thread under the current/target chat. On parent-chat inbound turns, omit `messageId` to anchor it to the current message, or pass `messageId`/`parentMessageId` explicitly.",
|
|
46706
46773
|
"- Inline reply threads: use `thread-reply` to send into a real reply thread, with `threadId` set to the reply-thread chat id returned by `thread-create`. Reuse that `threadId` only for the same reply-thread session; unrelated parent-chat messages need separate parent-message anchors.",
|
|
46707
46774
|
"- Inline reply threads: when already inside a reply-thread chat, continue in that reply thread and do not create nested reply threads.",
|
|
46708
|
-
"- Inline reply-thread turns include nearby parent-chat context
|
|
46775
|
+
"- Inline reply-thread turns include nearby parent-chat context as background only; answer the current reply-thread conversation, not unrelated parent-chat or other-thread questions."
|
|
46709
46776
|
]
|
|
46710
46777
|
},
|
|
46711
46778
|
messaging: {
|
|
@@ -47068,5 +47135,5 @@ export {
|
|
|
47068
47135
|
inlineChannelPlugin
|
|
47069
47136
|
};
|
|
47070
47137
|
|
|
47071
|
-
//# debugId=
|
|
47138
|
+
//# debugId=C3CE4C015D5193F764756E2164756E21
|
|
47072
47139
|
//# sourceMappingURL=channel-plugin-api.js.map
|