Repository navigation
feat(sdk): answer channel and role lookups - #141
Merged
Merged
Conversation
Neither SDK handled space.resources or space.member.permissions. They
answered {}, so every remote bot's channel and role pickers were empty.
- sdk-js: onResources(spaceId, kind, filter, platform) and
onPermissions(spaceId, userId, platform).
- sdk-py: on_resources(space_id, kind) and on_permissions(space_id, user_id),
with filter and platform as keyword arguments for handlers that declare
them, and a public start() coroutine for bots that already run an asyncio
loop.
- Without a handler both answer empty lists instead of a malformed result.
- The examples connect to the standalone server's gateway port, 3002.
Closes #138
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017JdKJpQQK3XuLZTBiZ4gns
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
adapter.onResources((spaceId, kind, filter, platform) => ...)andadapter.onPermissions((spaceId, userId, platform) => ...)answer the gateway'sSpaceResourcesandSpaceMemberPermissionsrequests, so a remote bot's channel and role pickers get live data.on_resourcesandon_permissions.filterandplatformare passed as keyword arguments only when the handler takes them, sodef resources(space_id, kind)works. A publicstart()coroutine replaces the private_run_foreverfor bots that already run an asyncio loop;run()still wraps it.Why
Remote bots had no way to answer these lookups, so their pickers stayed empty. The remote bots guide in the docs (Docs #1) relies on this.
Closes #138
Checklist
pnpm lint,pnpm turbo run typecheck,pnpm test(264),pytest(13),pnpm build,pnpm smoke:packRequested by zVapor
Generated by Claude Code