@inline-openclaw/inline 0.0.38 → 0.0.40

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.
Files changed (43) hide show
  1. package/README.md +36 -25
  2. package/dist/account-inspect-api.js +34 -7
  3. package/dist/account-inspect-api.js.map +4 -4
  4. package/dist/approval-handler.runtime.js +1550 -205
  5. package/dist/approval-handler.runtime.js.map +16 -15
  6. package/dist/channel-plugin-api.js +2356 -364
  7. package/dist/channel-plugin-api.js.map +19 -17
  8. package/dist/index.d.ts +1 -1
  9. package/dist/inline/accounts.d.ts.map +1 -1
  10. package/dist/inline/actions.d.ts +1 -1
  11. package/dist/inline/actions.d.ts.map +1 -1
  12. package/dist/inline/approval-native.d.ts.map +1 -1
  13. package/dist/inline/channel.d.ts.map +1 -1
  14. package/dist/inline/config-schema.d.ts +125 -0
  15. package/dist/inline/config-schema.d.ts.map +1 -1
  16. package/dist/inline/exec-approvals.d.ts.map +1 -1
  17. package/dist/inline/message-tools.d.ts.map +1 -1
  18. package/dist/inline/monitor.d.ts.map +1 -1
  19. package/dist/inline/parent-context-tool.d.ts +10 -0
  20. package/dist/inline/parent-context-tool.d.ts.map +1 -0
  21. package/dist/inline/policy.d.ts +30 -1
  22. package/dist/inline/policy.d.ts.map +1 -1
  23. package/dist/inline/reply-threads.d.ts +12 -0
  24. package/dist/inline/reply-threads.d.ts.map +1 -1
  25. package/dist/inline/shared.d.ts +1 -1
  26. package/dist/inline/thread-participation.d.ts +10 -0
  27. package/dist/inline/thread-participation.d.ts.map +1 -0
  28. package/dist/inline/thread-routes.d.ts +28 -0
  29. package/dist/inline/thread-routes.d.ts.map +1 -0
  30. package/dist/inline/tool-targets.d.ts +36 -0
  31. package/dist/inline/tool-targets.d.ts.map +1 -0
  32. package/dist/runtime-register-api.d.ts.map +1 -1
  33. package/dist/runtime-register-api.js +1891 -152
  34. package/dist/runtime-register-api.js.map +19 -15
  35. package/dist/runtime-setter-api.js +11 -15
  36. package/dist/runtime-setter-api.js.map +3 -3
  37. package/dist/runtime.d.ts +2 -2
  38. package/dist/runtime.d.ts.map +1 -1
  39. package/dist/setup-entry.d.ts +1 -1
  40. package/dist/setup-plugin-api.js +34 -7
  41. package/dist/setup-plugin-api.js.map +4 -4
  42. package/openclaw.plugin.json +725 -58
  43. package/package.json +6 -6
package/README.md CHANGED
@@ -12,26 +12,23 @@ Supports:
12
12
  - Inline DMs (`ChatType=direct`)
13
13
  - Inline chats as conversations (`ChatType=group`)
14
14
  - Message replies: OpenClaw `replyToId` is mapped to Inline `replyToMsgId` (message id).
15
- - Optional Inline reply threads: enable `channels.inline.capabilities.replyThreads: true` to expose Inline reply-thread chats as OpenClaw threads.
15
+ - Inline reply threads: tools can create and reply in real Inline reply-thread chats.
16
16
  - Inline media upload/send for images, videos, and documents from `mediaUrl` payloads.
17
17
  - Emoji reactions via message tool actions (`react`, `reactions`).
18
18
  - Reaction events on bot-authored messages are surfaced back to the agent as inbound context.
19
19
 
20
- By default, Inline reply threads stay off to preserve the old compatibility behavior. When disabled:
20
+ Reply-thread behavior:
21
21
 
22
- - `replyToId` remains an Inline message reply only.
23
- - `thread-reply` keeps the legacy compatibility path.
24
- - `thread-create` keeps the legacy chat-creation alias behavior.
25
-
26
- When enabled:
27
-
28
- - inbound reply-thread messages use the parent chat as the base conversation target and the child reply-thread chat id as `MessageThreadId`
29
- - outbound `thread-reply` sends into the child reply-thread chat
30
- - `thread-create` creates a real Inline reply thread instead of a plain chat alias
22
+ - Small/new parent-chat conversations stay in the parent chat by default.
23
+ - `replyThreadMode: "thread"` opts a parent chat into automatic reply-thread delivery once `replyThreadAutoCreateMinMessages` is reached.
24
+ - `replyThreadMode: "main"` keeps automatic replies in the parent chat, while explicit `thread-create` and `thread-reply` tools remain available.
25
+ - `thread-create` creates a real Inline reply thread. `thread-reply` sends into the child reply-thread chat id returned by `thread-create`.
26
+ - Inbound reply-thread messages use the parent chat as the base conversation target and the child reply-thread chat id as `MessageThreadId`.
27
+ - Bot-participated reply threads can continue without an explicit bot mention by default, matching Slack-style thread behavior.
31
28
 
32
29
  ## Install
33
30
 
34
- Requires OpenClaw `2026.5.18` or newer.
31
+ Requires OpenClaw `2026.5.28` or newer.
35
32
 
36
33
  From npm (once published):
37
34
 
@@ -136,10 +133,12 @@ channels:
136
133
  groupPolicy: "allowlist" # allowlist|open|disabled
137
134
  groupAllowFrom:
138
135
  - "inline:123" # or "user:123" or just "123"
139
- capabilities:
140
- replyThreads: false # optional, default false; enable Inline reply-thread support
141
136
  requireMention: true # optional: default is false
142
137
  replyToBotWithoutMention: true # if true, replies to bot messages can bypass mention requirement
138
+ replyThreadMode: "auto" # auto|thread|main; thread auto-routes long parent-chat replies into one reply thread
139
+ replyThreadAutoCreateMinMessages: 50 # optional, default 50; avoids creating reply threads for small/new chats
140
+ replyThreadRequireExplicitMention: false # optional, default false; bot-participated reply threads continue without @mention
141
+ replyThreadParentHistoryLimit: 10 # optional, default 10; set 0 to disable parent-chat context before the anchor
143
142
 
144
143
  # Inbound context history (used to build richer thread context for the agent):
145
144
  historyLimit: 50 # group chats
@@ -159,6 +158,8 @@ channels:
159
158
  groups:
160
159
  "88":
161
160
  requireMention: false
161
+ replyThreadRequireExplicitMention: true
162
+ replyThreadParentHistoryLimit: 2
162
163
  allowFrom:
163
164
  - "42"
164
165
  tools:
@@ -173,21 +174,21 @@ Per-account override:
173
174
  ```yaml
174
175
  channels:
175
176
  inline:
176
- capabilities:
177
- replyThreads: false
178
177
  accounts:
179
178
  work:
180
179
  token: "<INLINE_BOT_TOKEN>"
181
180
  defaultTo: "user:123"
182
- capabilities:
183
- replyThreads: true
181
+ replyThreadMode: "main"
184
182
  ```
185
183
 
186
184
  Reply behavior summary:
187
185
 
188
186
  - `replyToId` is always an Inline message id.
189
187
  - Inline reply threads are separate and use OpenClaw `threadId`.
190
- - Keep `replyThreads` off if you only want classic message replies.
188
+ - Use `replyThreadMode: "main"` if you only want automatic parent-chat replies to stay in the parent chat.
189
+ - Use `replyThreadMode: "thread"` plus `replyThreadAutoCreateMinMessages` when long parent-chat conversations should move into one stable reply thread.
190
+ - Bot-participated reply threads continue without `@bot` by default, including from persisted recent participation state. Set `replyThreadRequireExplicitMention: true` if a chat should require `@bot` on every reply-thread message.
191
+ - `replyThreadParentHistoryLimit` defaults to `10`, so reply-thread turns include nearby parent-chat context before the anchor. Set it to `0` only when a chat should stay strictly thread-local.
191
192
 
192
193
  If you set `dmPolicy: "open"`, set `allowFrom: ["*"]`.
193
194
 
@@ -203,7 +204,7 @@ For `message send`/plugin outbound sends:
203
204
 
204
205
  - Use `openclaw message send --channel inline --target chat:<id> --message "..."`.
205
206
  - If `channels.inline.defaultTo` is set, OpenClaw uses it when no explicit target is supplied. Named accounts can override it with `channels.inline.accounts.<account>.defaultTo`.
206
- - Some OpenClaw 2026.5.18 CLI help text lists only built-in channel ids, but installed plugin channel ids such as `inline` are accepted.
207
+ - Some OpenClaw CLI help text lists only built-in channel ids, but installed plugin channel ids such as `inline` are accepted.
207
208
  - `chat:<id>` targets a chat id.
208
209
  - `user:<id>` targets a user id (DM peer).
209
210
  - `inline:user:<id>` and `inline:chat:<id>` are accepted and normalized.
@@ -231,11 +232,13 @@ Direct DM sends can also target `user:<id>`.
231
232
  - Pins: `pin`, `unpin`, `list-pins`
232
233
  - Space permissions: `permissions`
233
234
 
234
- Inline reply-thread semantics are behind `channels.inline.capabilities.replyThreads`:
235
+ Inline reply-thread semantics:
235
236
 
236
- - disabled: `thread-reply` behaves like the old compatibility reply path
237
- - enabled: `thread-reply` expects `threadId` to be the child reply-thread chat id, while `to` stays the parent chat id
238
- - enabled: `thread-create` creates a real reply thread from a parent chat and optional `replyToId` anchor
237
+ - `thread-reply` expects `threadId` to be the child reply-thread chat id, while `to` stays the parent chat id.
238
+ - `thread-create` creates a real reply thread from a parent chat and optional `replyToId` anchor.
239
+ - Automatic thread creation falls back to parent-chat delivery if the reply thread cannot be created.
240
+ - Existing route state is reused so long conversations stay in one reply thread instead of creating one thread per message.
241
+ - If the current reply-thread message has no direct media, OpenClaw can inherit the anchor message media so image/file-only thread starters remain visible to the agent.
239
242
 
240
243
  You can gate action groups from config:
241
244
 
@@ -263,7 +266,15 @@ Named accounts can override the same `reactionNotifications` mode and `reactionA
263
266
 
264
267
  ## Extra Agent Tools
265
268
 
266
- The plugin also registers a dedicated `inline_members` tool for space-member discovery outside the `message` action surface.
269
+ The plugin also registers dedicated tools outside the `message` action surface.
270
+
271
+ `inline_parent_context` fetches more parent-chat history for the current Inline reply-thread session when the automatic context window is not enough.
272
+
273
+ - Defaults to the current reply thread when invoked from one
274
+ - Optional inputs: `threadId`, `parentChatId`, `parentMessageId`, `beforeMessageId`, `limit`, `includeAnchor`, `accountId`
275
+ - Returned messages are ordered oldest to newest and include media/entity summaries
276
+
277
+ `inline_members` handles space-member discovery:
267
278
 
268
279
  - Required input: `spaceId`
269
280
  - Optional filters: `query`, `userId`, `limit`, `accountId`
@@ -14550,10 +14550,15 @@ var InlineActionsSchema = exports_external.object({
14550
14550
  var InlineCapabilitiesSchema = exports_external.object({
14551
14551
  replyThreads: exports_external.boolean().optional()
14552
14552
  }).strict();
14553
+ var InlineReplyThreadModeSchema = exports_external.enum(["auto", "thread", "main"]);
14553
14554
  var InlineTargetSchema = exports_external.union([exports_external.string(), exports_external.number()]);
14554
14555
  var InlineAllowEntrySchema = exports_external.union([exports_external.string(), exports_external.number()]);
14555
14556
  var InlineGroupSchema = exports_external.object({
14556
14557
  requireMention: exports_external.boolean().optional(),
14558
+ replyThreadMode: InlineReplyThreadModeSchema.optional(),
14559
+ replyThreadAutoCreateMinMessages: exports_external.number().int().min(0).optional(),
14560
+ replyThreadRequireExplicitMention: exports_external.boolean().optional(),
14561
+ replyThreadParentHistoryLimit: exports_external.number().int().min(0).optional(),
14557
14562
  allowFrom: exports_external.array(InlineAllowEntrySchema).optional(),
14558
14563
  systemPrompt: exports_external.string().optional(),
14559
14564
  tools: ToolPolicySchema.optional(),
@@ -14593,6 +14598,7 @@ var InlineStreamingSchema = exports_external.union([
14593
14598
  label: exports_external.union([exports_external.string(), exports_external.literal(false)]).optional(),
14594
14599
  labels: exports_external.array(exports_external.string()).optional(),
14595
14600
  maxLines: exports_external.number().int().positive().optional(),
14601
+ maxLineChars: exports_external.number().int().positive().optional(),
14596
14602
  render: exports_external.enum(["text", "rich"]).optional(),
14597
14603
  toolProgress: exports_external.boolean().optional(),
14598
14604
  commandText: InlineStreamingCommandTextSchema.optional()
@@ -14620,6 +14626,7 @@ var InlineRuntimeStreamingSchema = exports_external.union([
14620
14626
  label: exports_external.union([exports_external.string(), exports_external.literal(false)]).optional(),
14621
14627
  labels: exports_external.array(exports_external.string()).optional(),
14622
14628
  maxLines: exports_external.number().int().positive().optional(),
14629
+ maxLineChars: exports_external.number().int().positive().optional(),
14623
14630
  render: exports_external.enum(["text", "rich"]).optional(),
14624
14631
  toolProgress: exports_external.boolean().optional(),
14625
14632
  commandText: InlineStreamingCommandTextSchema.optional()
@@ -14645,6 +14652,10 @@ var InlineAccountSchemaBase = exports_external.object({
14645
14652
  groupPolicy: GroupPolicySchema.optional().default("allowlist"),
14646
14653
  groups: exports_external.record(exports_external.string(), InlineGroupSchema.optional()).optional(),
14647
14654
  requireMention: exports_external.boolean().optional(),
14655
+ replyThreadMode: InlineReplyThreadModeSchema.optional(),
14656
+ replyThreadAutoCreateMinMessages: exports_external.number().int().min(0).optional(),
14657
+ replyThreadRequireExplicitMention: exports_external.boolean().optional(),
14658
+ replyThreadParentHistoryLimit: exports_external.number().int().min(0).optional(),
14648
14659
  replyToBotWithoutMention: exports_external.boolean().optional(),
14649
14660
  historyLimit: exports_external.number().int().min(0).optional(),
14650
14661
  dmHistoryLimit: exports_external.number().int().min(0).optional(),
@@ -14916,9 +14927,7 @@ function inspectInlineAccount(params) {
14916
14927
  }
14917
14928
  const tokenFile = account.tokenFile?.trim() ?? "";
14918
14929
  if (tokenFile) {
14919
- const token = tryReadSecretFileSync(tokenFile, "Inline bot token", {
14920
- rejectSymlink: true
14921
- }) ?? "";
14930
+ const token = tryReadInlineTokenFile(tokenFile);
14922
14931
  return {
14923
14932
  ...account,
14924
14933
  token: token || null,
@@ -14978,13 +14987,31 @@ async function resolveInlineToken(account) {
14978
14987
  }
14979
14988
  throw new Error("Inline token missing (set channels.inline.token, channels.inline.tokenFile, INLINE_TOKEN, or INLINE_BOT_TOKEN)");
14980
14989
  }
14981
- const token = tryReadSecretFileSync(tokenFile, "Inline bot token", {
14982
- rejectSymlink: true
14983
- });
14990
+ const token = readInlineTokenFile(tokenFile);
14984
14991
  if (!token)
14985
14992
  throw new Error(`Inline tokenFile is empty or unreadable: ${tokenFile}`);
14986
14993
  return token;
14987
14994
  }
14995
+ function tryReadInlineTokenFile(tokenFile) {
14996
+ try {
14997
+ return tryReadSecretFileSync(tokenFile, "Inline bot token", {
14998
+ rejectSymlink: true
14999
+ }) ?? "";
15000
+ } catch {
15001
+ return "";
15002
+ }
15003
+ }
15004
+ function readInlineTokenFile(tokenFile) {
15005
+ try {
15006
+ return tryReadSecretFileSync(tokenFile, "Inline bot token", {
15007
+ rejectSymlink: true
15008
+ }) ?? "";
15009
+ } catch (error51) {
15010
+ throw new Error(`Inline tokenFile is empty or unreadable: ${tokenFile}`, {
15011
+ cause: error51
15012
+ });
15013
+ }
15014
+ }
14988
15015
 
14989
15016
  // src/account-inspect-api.ts
14990
15017
  function inspectInlineReadOnlyAccount(cfg, accountId) {
@@ -14994,5 +15021,5 @@ export {
14994
15021
  inspectInlineReadOnlyAccount
14995
15022
  };
14996
15023
 
14997
- //# debugId=FF5F089AF31525E364756E2164756E21
15024
+ //# debugId=037AA7E34FED47C364756E2164756E21
14998
15025
  //# sourceMappingURL=account-inspect-api.js.map