{"id":49773298,"url":"https://github.com/pknull/pk.botcore","last_synced_at":"2026-05-11T14:09:17.641Z","repository":{"id":344682267,"uuid":"1167290201","full_name":"pknull/pk.botcore","owner":"pknull","description":"Python bot framework with Claude SDK integration, Discord.py sessions, and command registry","archived":false,"fork":false,"pushed_at":"2026-04-25T05:17:19.000Z","size":95,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-04-25T07:26:34.548Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pknull.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-26T06:14:04.000Z","updated_at":"2026-04-25T05:17:22.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/pknull/pk.botcore","commit_stats":null,"previous_names":["pknull/pk.botcore"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pknull/pk.botcore","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pknull%2Fpk.botcore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pknull%2Fpk.botcore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pknull%2Fpk.botcore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pknull%2Fpk.botcore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pknull","download_url":"https://codeload.github.com/pknull/pk.botcore/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pknull%2Fpk.botcore/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32898085,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-10T13:40:02.631Z","status":"online","status_checked_at":"2026-05-11T02:00:05.975Z","response_time":120,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-05-11T14:09:16.495Z","updated_at":"2026-05-11T14:09:17.633Z","avatar_url":"https://github.com/pknull.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pk.botcore\n\nShared infrastructure for PK Discord bots (pk.zalgo and pk.asha).\n\n## Installation\n\n```bash\n# From the bot directory (editable install)\npip install -e ../pk.botcore\n\n# Or directly\npip install -e /home/pknull/Code/pk.botcore\n```\n\n## Modules\n\n| Module | Purpose |\n|--------|---------|\n| `sessions` | User session management (persistence across messages) |\n| `channels` | Channel listen mode configuration |\n| `llm` | Unified LLM invocation (Claude, Codex) |\n| `chunking` | Discord message chunking (2000 char limit) |\n| `http` | Shared aiohttp session utilities |\n| `embeds` | Discord embed helpers |\n| `cmd_executor` | Dynamic command registry for [CMD:*] directives |\n\n## Usage\n\n```python\nfrom pk_botcore import (\n    # Sessions\n    UserSession, load_sessions, save_sessions,\n    # Channels\n    ChannelConfig, MODE_MENTION, MODE_LISTEN, MODE_IGNORE,\n    load_channel_config, save_channel_config,\n    # LLM\n    LLMResponse, invoke_llm, check_relevance,\n    # Utilities\n    chunk_message, make_embed,\n    get_http_session, close_http_session, fetch_json,\n    # Commands\n    CommandRegistry, llm_command, CmdResult,\n)\n```\n\n## Command Registry\n\nRegister cog methods for LLM to invoke via `[CMD:name:args]` directives:\n\n```python\nfrom pk_botcore import llm_command, CmdResult\n\nclass MyCog(commands.Cog):\n    @llm_command(\"greet\")\n    async def cmd_greet(self, ctx, name: str) -\u003e CmdResult:\n        return CmdResult(success=True, message=f\"Hello, {name}!\")\n```\n\nThen in your bot startup:\n\n```python\nfrom pk_botcore import CommandRegistry\n\nregistry = CommandRegistry(bot)\n# Call after all cogs loaded\nregistry.discover_commands()\n```\n\n## Requirements\n\n- Python 3.11+\n- discord.py 2.0+\n- aiohttp 3.8+\n- claude-agent-sdk\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpknull%2Fpk.botcore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpknull%2Fpk.botcore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpknull%2Fpk.botcore/lists"}