185 Commits

Author SHA1 Message Date
Peter Steinberger
b85b1c68d1 Refactor file access to use fs-safe primitives (#78255)
* refactor: use fs-safe primitives across file access

* fix: preserve invalid managed npm manifests

* fix: keep fs seams for startup metadata
2026-05-06 05:03:11 +01:00
Peter Steinberger
ae7c13e284 test: restore current-main test isolation 2026-05-06 03:04:55 +01:00
Peter Steinberger
20163313af fix: resolve fs-safe post-land fallout 2026-05-06 02:41:36 +01:00
Peter Steinberger
538605ff44 [codex] Extract filesystem safety primitives (#77918)
* refactor: extract filesystem safety primitives

* refactor: use fs-safe for file access helpers

* refactor: reuse fs-safe for media reads

* refactor: use fs-safe for image reads

* refactor: reuse fs-safe in qqbot media opener

* refactor: reuse fs-safe for local media checks

* refactor: consume cleaner fs-safe api

* refactor: align fs-safe json option names

* fix: preserve fs-safe migration contracts

* refactor: use fs-safe primitive subpaths

* refactor: use grouped fs-safe subpaths

* refactor: align fs-safe api usage

* refactor: adapt private state store api

* chore: refresh proof gate

* refactor: follow fs-safe json api split

* refactor: follow reduced fs-safe surface

* build: default fs-safe python helper off

* fix: preserve fs-safe plugin sdk aliases

* refactor: consolidate fs-safe usage

* refactor: unify fs-safe store usage

* refactor: trim fs-safe temp workspace usage

* refactor: hide low-level fs-safe primitives

* build: use published fs-safe package

* fix: preserve outbound recovery durability after rebase

* chore: refresh pr checks
2026-05-06 02:15:17 +01:00
Peter Steinberger
05eda57b3c refactor: migrate bundled plugins to message lifecycle 2026-05-06 01:46:42 +01:00
Vincent Koc
a732208d45 fix(qqbot): avoid log export filename collisions (#77765)
* fix(qqbot): avoid log export filename collisions

* test(qqbot): narrow log export result assertions
2026-05-05 02:11:33 -07:00
Peter Steinberger
8ee08b2b77 chore: update dependencies 2026-05-04 23:07:09 +01:00
Devin Robison
edddb07f20 fix(qqbot): preserve framework command authorization (#77453)
* fix(qqbot): preserve framework command authorization

* Add changelog entry for PR #77453
2026-05-04 12:38:51 -06:00
Pavan Kumar Gondhi
e3364ae3bd fix(qqbot): keep private commands off framework surface [AI] (#77212)
* fix: keep private qqbot commands off framework surface

* addressing codex review

* docs: add changelog entry for PR merge
2026-05-04 20:23:51 +05:30
Vincent Koc
feb9a5af6a fix(plugins): scope commands to channels 2026-05-04 03:01:56 -07:00
Pavan Kumar Gondhi
1f724bc50b Gate QQBot streaming command auth [AI] (#76375)
* fix: gate QQBot streaming command

* addressing codex review

* addressing review-skill

* addressing review-skill

* addressing codex review

* addressing claude review

* docs: add changelog entry for PR merge
2026-05-04 14:50:58 +05:30
Peter Steinberger
5397667272 chore(release): prepare 2026.5.4 2026-05-04 10:09:55 +01:00
Peter Steinberger
c850d1bb0d fix(qqbot): harden clientSecret SecretRefs 2026-05-03 12:25:08 +01:00
xialonglee
40f970a13d feat(qqbot): resolve clientSecret SecretRefs and add secret contract 2026-05-03 12:25:08 +01:00
Peter Steinberger
31161abd40 chore(release): bump version to 2026.5.3 2026-05-03 03:08:47 +01:00
Vincent Koc
3c8de6eb72 fix(qqbot): keep platform debug logging import 2026-05-02 17:35:38 -07:00
Vincent Koc
85520f664d fix(qqbot): remove native ffmpeg subprocess fallback 2026-05-02 17:35:38 -07:00
Vincent Koc
76c327c096 fix(plugins): remove unsupported bundle metadata 2026-05-02 11:42:17 -07:00
Peter Steinberger
9bedcff904 test(build): respect non-core plugin package metadata 2026-05-02 18:04:56 +01:00
Peter Steinberger
5551d9fad4 fix: discover source-only plugins in checkouts 2026-05-02 17:33:15 +01:00
Peter Steinberger
80da0a0213 chore: bump version to 2026.5.2 2026-05-02 11:58:45 +01:00
Peter Steinberger
befd4124f7 refactor: trim qqbot session store probes 2026-05-02 09:29:21 +01:00
Peter Steinberger
d02448696c refactor: remove qqbot ref stats helper 2026-05-02 09:24:01 +01:00
Peter Steinberger
e0f2973d20 refactor: trim qqbot known user store 2026-05-02 09:22:05 +01:00
Peter Steinberger
bccd50b09b refactor: trim extension helper exports 2026-05-02 09:15:34 +01:00
Shakker
7641783d6b fix: enforce plugin tool manifest contracts 2026-05-02 06:21:08 +01:00
Peter Steinberger
43121fb096 fix: guard provider-prefixed delivery targets 2026-05-02 05:30:41 +01:00
Peter Steinberger
9f4921c1cd build: prepare next external plugin beta batch 2026-05-02 05:16:10 +01:00
Peter Steinberger
a78df4a1a3 refactor: remove unused qqbot sender helpers 2026-05-02 02:02:15 +01:00
Peter Steinberger
ed8f50f240 refactor: simplify plugin dependency handling
Simplify plugin installation and runtime loading around package-manager-owned dependencies, with Jiti reserved for local/TS fallback paths.

Also scans npm plugin install roots so hoisted transitive dependencies are covered by dependency denylist and node_modules symlink checks.
2026-05-01 21:32:22 +01:00
Peter Steinberger
a607661a71 refactor: trim qqbot helper exports 2026-05-01 18:44:51 +01:00
Peter Steinberger
0442417e1f refactor: trim qqbot internal types 2026-05-01 15:47:58 +01:00
Peter Steinberger
0ce0509856 refactor: trim qqbot utility exports 2026-05-01 15:34:35 +01:00
Peter Steinberger
71dd936312 refactor: trim qqbot bridge exports 2026-05-01 15:31:33 +01:00
Peter Steinberger
b9fe26af7f refactor: trim qqbot helper exports 2026-05-01 15:28:47 +01:00
Peter Steinberger
9f55378745 refactor: trim channel dead exports 2026-05-01 14:51:32 +01:00
Peter Steinberger
15649228d4 refactor: trim extension helper shims 2026-05-01 14:39:03 +01:00
Peter Steinberger
73891eaca6 refactor: trim extension runtime barrels 2026-05-01 14:06:14 +01:00
Peter Steinberger
3b75898bee refactor: trim extension internal type exports 2026-05-01 14:00:05 +01:00
Peter Steinberger
040f533f60 chore: update dependencies 2026-05-01 12:43:17 +01:00
Peter Steinberger
404446f758 chore(qqbot): inline legacy text chunk helper 2026-05-01 11:40:27 +01:00
Peter Steinberger
bfa48c4025 refactor: prune unused extension internals 2026-05-01 11:21:31 +01:00
Peter Steinberger
c2cb648dc3 refactor: drop unused qqbot utility exports 2026-05-01 10:01:33 +01:00
Peter Steinberger
111432a7a6 refactor: prune unused channel helpers 2026-05-01 09:31:08 +01:00
Peter Steinberger
6efb44944c refactor: prune unused extension helpers 2026-05-01 09:24:41 +01:00
Peter Steinberger
4ee6068ced refactor: prune stale qqbot helpers 2026-05-01 09:10:40 +01:00
Peter Steinberger
0ac1a07f7c refactor: prune unused extension helpers 2026-05-01 09:02:45 +01:00
Peter Steinberger
e816235c2d refactor: narrow dead reexports 2026-05-01 08:18:52 +01:00
cxy
62fb87641e fix(qqbot): unify slash command auth, c2cOnly gating, and file delivery (#73616)
* fix(qqbot): align clear-storage command with actual downloads directory

The /bot-clear-storage command previously targeted
~/.openclaw/media/qqbot/downloads/{appId}/, but inbound attachments
and outbound fallback downloads are stored directly under
~/.openclaw/media/qqbot/downloads/ without appId subdivision.

This mismatch caused the clear command to report 'no files to clean'
while downloaded files continued to occupy disk space.

Changes:
- Replace resolveQqbotDownloadsDirForApp(appId) with
  resolveQqbotDownloadsDir() that returns the downloads root
- Use getQQBotMediaPath('downloads') instead of manual path assembly
- Remove appId-based path validation (no longer needed)
- Update usage text to reflect the new scope

* refactor(qqbot): unify slash command auth and c2cOnly gating in registry

Previously, slash command authorization and group-chat rejection were
scattered across individual handlers and a hardcoded GROUP_EXCLUDED set.
This led to inconsistent behavior: commandAuthorized was hardcoded to
true in the pre-dispatch path, some handlers checked allowFrom while
others did not, and group users received no response for auth-gated
commands.

Changes:

1. Add resolveSlashCommandAuth() (new file slash-command-auth.ts)
   - Requires sender to appear in an explicit non-wildcard allowFrom
     list; wildcard ['*'] does not grant admin command access
   - Group messages use groupAllowFrom, falling back to allowFrom

2. Fix commandAuthorized in slash-command-handler.ts
   - Replace hardcoded 'true' with resolveSlashCommandAuth() call

3. Add c2cOnly field to SlashCommand interface
   - Commands declare c2cOnly: true instead of checking ctx.type
     inside their handler
   - Registry rejects c2cOnly commands in group chat before auth
     check, returning a user-friendly hint

4. Remove GROUP_EXCLUDED hardcoded set from register-basic.ts
   - /bot-help now filters by cmd.c2cOnly dynamically

5. Clean up handler-level auth and scene checks
   - Remove hasExplicitCommandAllowlist check from register-logs
   - Remove ctx.type !== 'c2c' guards from all c2cOnly handlers
   - Improve rejection message to mention the correct config field
     (allowFrom for c2c, groupAllowFrom for group)

6. Mark commands: bot-upgrade, bot-streaming, bot-logs,
   bot-clear-storage, bot-approve as c2cOnly: true

* fix(qqbot): pass allowQQBotDataDownloads when sending slash command file attachments

The /bot-logs command writes temporary log files to the QQBot data
downloads directory (~/.openclaw/qqbot/downloads/), but sendDocument
was called without allowQQBotDataDownloads: true. This caused
resolveOutboundMediaPath to reject the file path as outside the
allowed media roots, silently failing the file attachment while
the text reply was sent successfully.

Add { allowQQBotDataDownloads: true } to the sendDocument call in
slash-command-handler.ts so file-bearing slash command results
(currently only /bot-logs) can deliver their attachments.

* feat(qqbot): add /bot-me command to display sender user ID

Add a new /bot-me slash command that returns the sender's user ID
(openid). This helps users quickly find the value they need to add
to allowFrom or groupAllowFrom configuration for admin command
access.

Marked as c2cOnly since the user ID is sensitive information.

* feat(qqbot): update response timeout

* feat(qqbot): add engine import boundary test and bump version

- Add engine-import-boundary.test.ts to enforce that engine/ sources
  only import from openclaw/plugin-sdk/* and never reach into other
  openclaw internals directly. Scans all 110 source files recursively.
- Bump plugin version to 2026.4.27.

* fix(qqbot): unify slash command auth, c2cOnly gating, and file delivery (#73616) (thanks @cxyhhhhh)

---------

Co-authored-by: sliverp <870080352@qq.com>
2026-04-30 16:12:39 +08:00
Vincent Koc
f31311d104 fix(security): align QQBot log sanitizer with CodeQL
Aligns QQBot debug log newline removal with the CodeQL js/log-injection sanitizer model to close alert 232.
2026-04-30 01:10:26 -07:00