Commit Graph

1746 Commits

Author SHA1 Message Date
simianastronaut
8e0f87fa3d fix(security): harden Microsoft 365 token cache and OAuth URL construction
- Restrict token cache file permissions to 0o600 on Unix to prevent
  other local users from reading cached OAuth access/refresh tokens
- Validate tenant_id format (alphanumeric, hyphens, dots) in config
  validation to prevent URL injection in OAuth endpoint construction
- Add custom Debug impl for CachedTokenState that redacts tokens
- Replace unstable DefaultHasher with deterministic fingerprint for
  cache filenames to prevent orphaned files on Rust toolchain updates
- Fix OneDrive path encoding to preserve '/' separators (encode each
  segment individually) so subdirectory traversal works correctly
- Check Content-Length header before buffering download response to
  prevent OOM on oversized files

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 16:29:04 -04:00
Giulio V
97b9739320 fix(tools): address CodeRabbit review findings for Microsoft 365 integration 2026-03-15 15:40:02 +01:00
Giulio V
d600c775c2 fix(microsoft365): redact secrets, validate config, sanitize errors, encode paths
- Implement custom Debug for Microsoft365ResolvedConfig that redacts client_secret
- Fail tool registration when client_credentials flow has no client_secret
- Add config-load validation: client_credentials requires non-empty client_secret
- Wrap Graph API error responses to avoid leaking raw error bodies (log at debug)
- Stop propagating raw OAuth response bodies in auth error messages
- Replace verbatim device-code challenge logging with generic log + stderr output
- URL-encode all Graph path parameters (user_id, folder, team_id, channel_id, event_id, item_id) to prevent path traversal
- Cap OneDrive download max_size to MAX_ONEDRIVE_DOWNLOAD_SIZE regardless of caller input
2026-03-15 15:33:42 +01:00
Giulio V
c7f341885b fix(microsoft365): scope token cache, fail on unimplemented encryption, use config dir
- Include hash of (tenant_id, client_id, auth_flow) in token cache
  filename to prevent cross-account token reuse after config changes.
- Fail fast with a clear error when token_cache_encrypted is true,
  since encryption is not yet implemented (was silently storing
  plaintext).
- Use the config directory (parent of config.toml) instead of
  workspace_dir for token cache storage, keeping bearer tokens out
  of the project tree.
2026-03-15 15:33:42 +01:00
Giulio V
71b16357f3 fix: resolve clippy and rustfmt violations in microsoft365 module
- Sort pub use imports alphabetically in tools/mod.rs
- Fix cast_lossless warnings by using u64::from/u32::try_from
- Fix cast_possible_truncation with safe try_from conversions
- Fix unused_async warning with allow attribute on sync_directory
- Fix unused_imports warning on TempDir (platform-conditional)
- Apply rustfmt to auth.rs method signatures and chain expressions
2026-03-15 15:33:42 +01:00
Giulio V
2dbe4e4812 feat(tools): add Microsoft 365 integration via Graph API
Adds a Microsoft365Tool that provides email, calendar, OneDrive, and
Teams operations through the Microsoft Graph API.

- OAuth2 PKCE flow with encrypted token caching
- Config-gated registration (microsoft365.enabled)
- Full parameter validation and security policy enforcement
- Comprehensive unit tests for auth, graph client, and tool execution
2026-03-15 15:31:20 +01:00
Argenis
45f953be6d
Merge pull request #3578 from zeroclaw-labs/chore/bump-v0.3.3
chore: bump version to v0.3.3
2026-03-15 09:53:13 -04:00
argenis de la rosa
82f29bbcb1 chore: bump version to v0.3.3
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 09:41:22 -04:00
Argenis
93b5a0b824
feat(context): token-based compaction, persistent sessions, and LLM consolidation (#3574)
Comprehensive long-running context upgrades:

- Token-based compaction: replace message-count trigger with token
  estimation (~4 chars/token). Compaction fires when estimated tokens
  exceed max_context_tokens (default 32K) OR message count exceeds
  max_history_messages. Cuts at user-turn boundaries only.

- Persistent sessions: JSONL append-only session files per channel
  sender in {workspace}/sessions/. Sessions survive daemon restarts.
  Hydrates in-memory history from disk on startup.

- LLM-driven memory consolidation: two-phase extraction after each
  conversation turn. Phase 1 writes a timestamped history entry (Daily).
  Phase 2 extracts new facts/preferences to Core memory (if any).
  Replaces raw message auto-save with semantic extraction.

- New config fields: agent.max_context_tokens (32000),
  channels_config.session_persistence (true).

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 09:25:23 -04:00
Argenis
08a67c4a2d
chore: bump version to v0.3.2 (#3564)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 06:47:37 -04:00
Argenis
c86a0673ba
feat(heartbeat): two-phase execution, structured tasks, and auto-routing (#3562)
Upgrade heartbeat system with 4 key improvements:

- Two-phase heartbeat: Phase 1 asks LLM "skip or run?" to save API cost
  on quiet periods. Phase 2 executes only selected tasks.
- Structured task format: `- [priority|status] task text` with
  high/medium/low priority and active/paused/completed status.
- Decision intelligence: LLM-driven smart filtering via structured prompt
  at temperature 0.0 for deterministic decisions.
- Delivery routing: auto-detect best configured channel when no explicit
  target is set (telegram > discord > slack > mattermost).

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 06:11:59 -04:00
Argenis
cabf99ba07
Merge pull request #3539 from zeroclaw-labs/cleanup
chore: add .wrangler/ to gitignore
2026-03-14 22:53:12 -04:00
argenis de la rosa
2d978a6b64 chore: add .wrangler/ to gitignore and clean up stale files
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 22:41:17 -04:00
Argenis
4dbc9266c1
Merge pull request #3536 from zeroclaw-labs/test/termux-release-validation
test: add Termux release validation script
2026-03-14 22:21:21 -04:00
argenis de la rosa
ea0b3c8c8c test: add Termux release validation script
Validates the aarch64-linux-android release artifact: download, archive
integrity, ELF format, architecture, checksum, and install.sh detection.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 22:10:33 -04:00
Argenis
0c56834385
chore(ci): remove sync-readme workflow and script (#3535)
The auto-generated What's New and Recent Contributors README sections
have been removed, so the sync-readme workflow and its backing script
are no longer needed.
2026-03-14 21:38:04 -04:00
Argenis
caccf0035e
docs(readme): remove stale What's New and Contributors sections (#3534)
Clear auto-generated sections so they repopulate correctly on the next
release via sync-readme workflow.
2026-03-14 21:36:26 -04:00
Argenis
627b160f55
fix(install): clean up stale cargo tracking from old package name (#3532)
When the crate was renamed from `zeroclaw` to `zeroclawlabs`, users who
installed via install.sh (which uses `cargo install --path`) had the
binary tracked under the old package name. Later running
`cargo install zeroclawlabs` from crates.io fails with:

  error: binary `zeroclaw` already exists as part of `zeroclaw v0.1.9`

The installer now detects and removes stale tracking for the old
`zeroclaw` package name before installing, so both install.sh and
`cargo install zeroclawlabs` work cleanly for upgrades.
2026-03-14 21:20:02 -04:00
Argenis
6463bc84b0
fix(ci): sync tweet and README after all release artifacts are published (#3531)
The tweet was firing on `release: published` immediately when the GitHub
Release was created, but Docker push, crates.io publish, and website
redeploy were still in-flight. This meant users saw the tweet before
they could actually pull the new Docker image or install from crates.io.

Convert tweet-release.yml and sync-readme.yml to reusable workflows
(workflow_call) and call them as the final jobs in both release
pipelines, gated on completion of docker, crates-io, and
redeploy-website jobs.

Before: gh release create → tweet fires immediately (race condition)
After:  gh release create → docker + crates + website → tweet + readme
2026-03-14 21:19:56 -04:00
ZeroClaw Bot
f84f1229af docs(readme): auto-sync What's New and Contributors 2026-03-15 01:07:01 +00:00
ZeroClaw Bot
f85d21097b docs(readme): auto-sync What's New and Contributors 2026-03-15 01:01:55 +00:00
Argenis
306821d6a2
Merge pull request #3530 from zeroclaw-labs/chore/bump-v0.3.1
chore: bump version to v0.3.1
2026-03-14 20:29:13 -04:00
argenis de la rosa
06f9424274 chore: bump version to v0.3.1
Patch release for Termux/Android support. Corrects from v0.4.0 to v0.3.1.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 20:17:53 -04:00
Argenis
fa14ab4ab2
Merge pull request #3528 from zeroclaw-labs/chore/bump-v0.4.0
chore: bump version to v0.4.0
2026-03-14 20:06:32 -04:00
argenis de la rosa
36a0c8eba9 chore: bump version to v0.4.0
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 19:49:07 -04:00
Argenis
f4c82d5797
Merge pull request #3525 from zeroclaw-labs/feat/termux-release-support
feat(ci): add Termux (aarch64-linux-android) release target
2026-03-14 19:47:50 -04:00
ZeroClaw Bot
5edebf4869 docs(readme): auto-sync What's New and Contributors 2026-03-14 23:47:45 +00:00
argenis de la rosa
613fa79444 feat(ci): add Termux (aarch64-linux-android) release target
Add prebuilt binary support for Termux/Android devices:
- Add aarch64-linux-android to stable and beta release matrices with NDK setup
- Detect Termux in install.sh and map to the correct android target
- Add Termux pkg manager support for system dependency installation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 19:36:44 -04:00
ZeroClaw Bot
44c8e1eaac docs(readme): auto-sync What's New and Contributors 2026-03-14 22:35:02 +00:00
Argenis
414b1fa8dd
fix(docs): remove stale onboarding flags after CLI changes (#3516)
Remove references to --interactive, --security-level, and --onboard
flags that no longer exist in the CLI. Update examples to use current
supported flags.

Closes #3484
2026-03-14 17:54:14 -04:00
Argenis
913d5ee851
fix(provider): skip empty text content blocks in Anthropic API requests (#3515)
Filter out empty/whitespace-only text content blocks from assistant,
tool, and user messages before sending to the Anthropic API.

Closes #3483
2026-03-14 17:52:53 -04:00
Argenis
5a4332d0e4
fix(install): avoid /dev/stdin file redirect in guided installer (#3514)
Probe /dev/stdin readability before selecting it, and add /proc/self/fd/0
as a fallback for constrained containers where /dev/stdin is inaccessible.

Closes #3482
2026-03-14 17:52:03 -04:00
ZeroClaw Bot
970c80d278 docs(readme): auto-sync What's New and Contributors 2026-03-14 21:46:24 +00:00
ZeroClaw Bot
9514c20038 docs(readme): auto-sync What's New and Contributors 2026-03-14 21:18:20 +00:00
Argenis
9cf31a732c
fix: increase recursion limit for matrix-sdk 0.16 on Rust 1.94+ (#3512)
matrix-sdk 0.16 generates deeply nested types that exceed the default
recursion limit (128) on newer Rust compilers. Bump to 256.

Closes #3468
2026-03-14 17:07:28 -04:00
Argenis
7f0ddf06a9
fix: wire Signal channel into scheduled announcement delivery (#3511)
Add SignalChannel import and match arm in deliver_announcement() so
cron jobs with delivery.channel = "signal" are handled instead of
rejected as unsupported.

Closes #3476
2026-03-14 17:07:26 -04:00
Argenis
b79e88662e
fix: resolve web dashboard 404 on static assets and SPA fallback (#3510)
* fix: resolve web dashboard 404 on static assets and SPA fallback

Strip leading slash from asset paths after prefix removal so rust-embed
can find the files. Return 503 with a helpful build hint when index.html
is missing instead of a generic 404.

Closes #3508

* fix: return concrete Response type to fix match arm type mismatch
2026-03-14 17:07:24 -04:00
ZeroClaw Bot
b71b69fa6e docs(readme): auto-sync What's New and Contributors 2026-03-14 21:02:25 +00:00
Argenis
8b961b7bd9
chore: bump version to v0.3.0 (#3509)
Milestone release covering:
- Comprehensive channel matrix test suite (50 tests across 16 platforms)
- Auto-synced README What's New and Contributors across 31 locales
- Anthropic consecutive message merging fix
- Nextcloud Talk Create event support
- Tweet content-hash dedup
- CI/CD stability improvements (Docker timeout, release token, tweet URLs)

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 16:55:38 -04:00
ZeroClaw Bot
3b67d8a797 docs(readme): auto-sync What's New and Contributors 2026-03-14 20:45:42 +00:00
Argenis
f0e111bf7b
feat(channels): comprehensive channel matrix tests + v0.2.2 (#3507)
* feat(channels): add comprehensive channel matrix tests and bump to v0.2.2

Add 50 integration tests covering the full Channel trait contract across
all 16 platforms: identity semantics, threading, draft lifecycle, reactions,
pinning, concurrency, edge cases, and cross-channel routing. Bump version
to 0.2.2.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* style: fix rustfmt formatting in channel matrix tests

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(lint): remove empty line after doc comment in channel matrix tests

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 16:34:00 -04:00
ZeroClaw Bot
b3071f622a docs(readme): auto-sync What's New and Contributors 2026-03-14 20:31:58 +00:00
Argenis
8dbf142c7b
feat(ci): auto-sync README What's New and Contributors on release (#3505)
* feat(ci): auto-sync README What's New and Contributors on release

Replace hardcoded What's New (v0.1.9b) and Recent Contributors sections
with marker-based auto-sync powered by a new GitHub Actions workflow.
The sync-readme workflow runs on each release and updates both sections
from git history.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat(ci): auto-sync What's New and Contributors across all 31 READMEs

Add marker comments to all 30 translated README files and update the
sync script to process all README*.md files on each release. Fix regex
to handle empty markers on first run.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 16:00:18 -04:00
Argenis
2b3603bacf
fix(anthropic): merge consecutive same-role messages to prevent 500 errors (#3501)
When multiple tool calls execute in a single turn, each tool result was
emitted as a separate role="user" message. Anthropic's API rejects
adjacent messages with the same role, and newer models like
claude-sonnet-4-6 respond with 500 Internal Server Error instead of a
descriptive 400.

Merge consecutive same-role messages in convert_messages() so that
multiple tool_result blocks are combined into one user message, and
consecutive user/assistant messages are also properly coalesced.

Fixes #3493
2026-03-14 15:10:37 -04:00
Argenis
02369d892d
fix(ci): bump Docker timeout to 60m and skip duplicate crates.io publish (#3503)
fix(ci): bump Docker timeout to 60m and skip duplicate crates.io publish
2026-03-14 15:07:57 -04:00
argenis de la rosa
b38db505ff fix(ci): bump Docker timeout to 60m and skip duplicate crates.io publish
Multi-platform Docker builds (linux/amd64 + linux/arm64) with fat LTO
and codegen-units=1 consistently exceed 30 minutes. Bump to 60m.

Also skip crates.io publish when the version already exists (the
auto-sync workflow may have published it before the stable release
runs).
2026-03-14 14:56:16 -04:00
Argenis
06b9525263
fix(nextcloud_talk): accept "Create" event type for new messages (#3500)
Nextcloud Talk bot webhooks send event type "Create" for new chat
messages, but the parser only accepted "message". This caused all
valid messages to be skipped with "skipping non-message event: Create".

Accept both "message" and "Create" as valid event types.

Closes #3491
2026-03-14 14:48:48 -04:00
Argenis
8fe573330c
fix(tweet): add content-hash dedup to prevent duplicate tweets (#3499)
Uses GitHub Actions cache with SHA-256 hash of tweet content. If the
exact same tweet text was already posted in a previous run, the tweet
is skipped with a warning. Works for both auto-release and manual
dispatch tweets.

Three-layer dedup:
1. feat() commit check — skip if no new features since last release
2. Content hash — skip if identical tweet already posted (cache hit)
3. Beta-to-beta diff — only new features since previous release tag

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 14:14:28 -04:00
Argenis
dc61f08f60
fix(ci): preserve release URL in tweets instead of truncating (#3498)
fix(ci): preserve release URL in tweets instead of truncating
2026-03-14 14:09:42 -04:00
Argenis
f7c8a3b8be
fix(ci): use RELEASE_TOKEN for stable release tag creation (#3496)
fix(ci): use RELEASE_TOKEN for stable release tag creation
2026-03-14 14:03:34 -04:00