Skip to main content

Compatibility shim for HKUDS/nanobot channels vendored under exoclaw via codemod

Project description

exoclaw-nanobot-compat

Compatibility shim that lets HKUDS/nanobot channels run under exoclaw via a codemod-based vendoring pipeline. Sister channels:

Each vendored channel imports its BaseChannel, bus types, and helpers from this package instead of from upstream nanobot.*. The codemod that produces the vendored channel files is the sibling exoclaw-channel-codemod package.

What this package re-exports

  • BaseChannel — drop-in replacement for nanobot.channels.base.BaseChannel. Conforms to exoclaw's Channel Protocol (name, start(bus), stop(), send(msg)). Inherited by every vendored channel.
  • InboundMessage, OutboundMessage, MessageBus — re-exports from exoclaw.bus.{events,queue}. The codemod rewrites from nanobot.bus.events import … to from exoclaw_nanobot_compat import …, so vendored channels see exoclaw's bus types under the names they expect.
  • Base — pydantic base mirroring nanobot's (alias_generator=to_camel, extra="ignore").
  • split_message, safe_filename, validate_url_target, build_help_text, redirect_lib_logging — small standalone helpers ported from nanobot.utils.*.
  • get_data_dir(name=None), get_media_dir(name=None) — workspace path resolvers (see "Workspace layout" below).
  • set_data_dir(path), set_media_dir(path) — programmatic overrides for hosts that don't use the default ~/.exoclaw/{data,media} layout.

Workspace layout

Channels store load-bearing state (matrix E2E keys, slack topic state, email seen-uid tracking, whatsapp bridge token) and downloaded media. Exoclaw deliberately doesn't dictate workspace layout — that's a host concern. Resolution order, highest precedence first:

  1. set_data_dir() / set_media_dir() programmatic override
  2. EXOCLAW_DATA_DIR / EXOCLAW_MEDIA_DIR env vars
  3. Default ~/.exoclaw/{data,media}

Hosts (Luna, picoclaw, anything else) configure once at startup, then channels remain ignorant of where their state lives.

Why this exists

Exoclaw's Channel Protocol is 32 lines (name, start, stop, send). HKUDS/nanobot's BaseChannel ABC is 200 LOC and bundles allow_from gating, transcription, login, default-config, streaming, etc. — all real functionality, but tightly coupled to nanobot's host shape.

The compat shim is the bridge: it provides a BaseChannel superset shaped like nanobot's so vendored channel files inherit unchanged, while routing _handle_message through exoclaw's bus and conforming to exoclaw's Channel Protocol on the outside.

That lets a channel-codemod vendor channel files from HKUDS upstream with mostly-mechanical transforms, ship them as exoclaw-channel-<name> packages, and absorb upstream bug fixes via re-running the codemod against newer commits.

Maintaining

This compat module is consumed by the codemod's import-rewrite step. When upstream HKUDS adds a new module the channels depend on, add a shim here and add the module name to COMPAT_MODULES in packages/exoclaw-channel-codemod/exoclaw_channel_codemod/codemod.py, then re-run packages/exoclaw-channel-codemod/sync.sh <channel> --apply for each affected channel.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

exoclaw_nanobot_compat-0.1.0.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

exoclaw_nanobot_compat-0.1.0-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file exoclaw_nanobot_compat-0.1.0.tar.gz.

File metadata

  • Download URL: exoclaw_nanobot_compat-0.1.0.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for exoclaw_nanobot_compat-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d370f55443fd080f3f0a5cfcf0cca375b52218849b03fb8da8be731396082b5f
MD5 983a91b163470add8a521223c7e5c202
BLAKE2b-256 822b024eff140ba559b6485273589218769b48cb5b11b02b67aa5dde35cf3e75

See more details on using hashes here.

File details

Details for the file exoclaw_nanobot_compat-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: exoclaw_nanobot_compat-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for exoclaw_nanobot_compat-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ce1cc84d494312fd2a2b5dd2b624ebe628413fa18d96c8330792ff91ff5c6f2a
MD5 be01a8429bb444a448fa9f0d158b3591
BLAKE2b-256 4f6ea49717715283d296beabaf68b89e3c20d68400b605b9a164c8bd57c55acd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page