Commit Graph

30 Commits (3e1ed0032d650ca5cad7d6dbafc890a45ffbb9e2)

Author SHA1 Message Date
Peter Steinberger b8b43175c5 style: align formatting with oxfmt 0.33 9 months ago
Peter Steinberger 31f9be126c style: run oxfmt and fix gate failures 9 months ago
cpojer d0cb8c19b2
chore: wtf. 9 months ago
Sebastian ed11e93cf2 chore(format) 9 months ago
cpojer 4b8f53979e
chore: Fix type errors from reverts. 9 months ago
cpojer 90ef2d6bdf
chore: Update formatting. 9 months ago
Peter Steinberger 7632e60d70 refactor(onboarding): reuse allowFrom merge helper in extensions 9 months ago
Peter Steinberger 544ffbcf7b refactor(extensions): dedupe connector helper usage 9 months ago
Peter Steinberger 6543ce717c perf(test): avoid plugin-sdk barrel imports 9 months ago
Peter Steinberger 3cbcba10cf fix(security): enforce bounded webhook body handling 9 months ago
Peter Steinberger 53273b490b fix(auto-reply): prevent sender spoofing in group prompts 10 months ago
quotentiroler cc87c0ed7c Update contributing, deduplicate more functions 10 months ago
max 40b11db80e
TypeScript: add extensions to tsconfig and fix type errors (#12781)
* TypeScript: add extensions to tsconfig and fix type errors

- Add extensions/**/* to tsconfig.json includes
- Export ProviderAuthResult, AnyAgentTool from plugin-sdk
- Fix optional chaining for messageActions across channels
- Add missing type imports (MSTeamsConfig, GroupPolicy, etc.)
- Add type annotations for provider auth handlers
- Fix undici/fetch type compatibility in zalo proxy
- Correct ChannelAccountSnapshot property usage
- Add type casts for tool registrations
- Extract usage view styles and types to separate files

* TypeScript: fix optional debug calls and handleAction guards
10 months ago
max 223eee0a20
refactor: unify peer kind to ChatType, rename dm to direct (#11881)
* fix: use .js extension for ESM imports of RoutePeerKind

The imports incorrectly used .ts extension which doesn't resolve
with moduleResolution: NodeNext. Changed to .js and added 'type'
import modifier.

* fix tsconfig

* refactor: unify peer kind to ChatType, rename dm to direct

- Replace RoutePeerKind with ChatType throughout codebase
- Change 'dm' literal values to 'direct' in routing/session keys
- Keep backward compat: normalizeChatType accepts 'dm' -> 'direct'
- Add ChatType export to plugin-sdk, deprecate RoutePeerKind
- Update session key parsing to accept both 'dm' and 'direct' markers
- Update all channel monitors and extensions to use ChatType

BREAKING CHANGE: Session keys now use 'direct' instead of 'dm'.
Existing 'dm' keys still work via backward compat layer.

* fix tests

* test: update session key expectations for dmdirect migration

- Fix test expectations to expect :direct: in generated output
- Add explicit backward compat test for normalizeChatType('dm')
- Keep input test data with :dm: keys to verify backward compat

* fix: accept legacy 'dm' in session key parsing for backward compat

getDmHistoryLimitFromSessionKey now accepts both :dm: and :direct:
to ensure old session keys continue to work correctly.

* test: add explicit backward compat tests for dmdirect migration

- session-key.test.ts: verify both :dm: and :direct: keys are valid
- getDmHistoryLimitFromSessionKey: verify both formats work

* feat: backward compat for resetByType.dm config key

* test: skip unix-path Nix tests on Windows
10 months ago
wangai-studio 57326f72e6
fix(nextcloud-talk): sign message text instead of JSON body (#2092)
Nextcloud Talk's ChecksumVerificationService verifies HMAC against the
extracted message/reaction text, not the full JSON body. This fixes 401
authentication errors when sending messages via the bot API.

- sendMessageNextcloudTalk: sign 'message' text only
- sendReactionNextcloudTalk: sign 'reaction' string only
10 months ago
mudrii 5d82c82313
feat: per-channel responsePrefix override (#9001)
* feat: per-channel responsePrefix override

Add responsePrefix field to all channel config types and Zod schemas,
enabling per-channel and per-account outbound response prefix overrides.

Resolution cascade (most specific wins):
  L1: channels.<ch>.accounts.<id>.responsePrefix
  L2: channels.<ch>.responsePrefix
  L3: (reserved for channels.defaults)
  L4: messages.responsePrefix (existing global)

Semantics:
  - undefined -> inherit from parent level
  - empty string -> explicitly no prefix (stops cascade)
  - "auto" -> derive [identity.name] from routed agent

Changes:
  - Core logic: resolveResponsePrefix() in identity.ts accepts
    optional channel/accountId and walks the cascade
  - resolveEffectiveMessagesConfig() passes channel context through
  - Types: responsePrefix added to WhatsApp, Telegram, Discord, Slack,
    Signal, iMessage, Google Chat, MS Teams, Feishu, BlueBubbles configs
  - Zod schemas: responsePrefix added for config validation
  - All channel handlers wired: telegram, discord, slack, signal,
    imessage, line, heartbeat runner, route-reply, native commands
  - 23 new tests covering backward compat, channel/account levels,
    full cascade, auto keyword, empty string stops, unknown fallthrough

Fully backward compatible - no existing config is affected.
Fixes #8857

* fix: address CI lint + review feedback

- Replace Record<string, any> with proper typed helpers (no-explicit-any)
- Add curly braces to single-line if returns (eslint curly)
- Fix JSDoc: 'Per-channel' → 'channel/account' on shared config types
- Extract getChannelConfig() helper for type-safe dynamic key access

* fix: finish responsePrefix overrides (#9001) (thanks @mudrii)

* fix: normalize prefix wiring and types (#9001) (thanks @mudrii)

---------

Co-authored-by: Gustavo Madeira Santana <gumadeiras@gmail.com>
10 months ago
Tyler Yust 3e6c623cfe refactor: remove unnecessary blank line in policy test file 10 months ago
Peter Steinberger 6b4b6049b4 fix: enforce Nextcloud Talk allowlist by user id 10 months ago
cpojer f06dd8df06
chore: Enable "experimentalSortImports" in Oxfmt and reformat all imorts. 10 months ago
cpojer 230ca789e2
chore: Lint extensions folder. 10 months ago
cpojer 8cab78abbc
chore: Run `pnpm format:fix`. 10 months ago
Peter Steinberger 9a7160786a refactor: rename to openclaw 10 months ago
Peter Steinberger 6d16a658e5 refactor: rename clawdbot to moltbot with legacy compat 10 months ago
Peter Steinberger 458e731f8b fix: newline chunking across channels 10 months ago
Adam Holt c07949a99c Channels: add per-group tool policies 10 months ago
Peter Steinberger aeb6b2ffad refactor: standardize channel logging 10 months ago
Peter Steinberger 07ce1d73ff refactor: standardize control command gating 10 months ago
Peter Steinberger d82ecaf9dc refactor: centralize inbound session updates 10 months ago
Peter Steinberger b77e730657 fix: add per-channel markdown table conversion (#1495) (thanks @odysseus0) 10 months ago
Peter Steinberger 660f87278c refactor: plugin catalog + nextcloud policy 10 months ago