Skip to content

simplex-chat-python: add python library#6954

Merged
epoberezkin merged 13 commits into
masterfrom
sh/python-lib
May 12, 2026
Merged

simplex-chat-python: add python library#6954
epoberezkin merged 13 commits into
masterfrom
sh/python-lib

Conversation

@shumvgolove
Copy link
Copy Markdown
Contributor

@shumvgolove shumvgolove commented May 8, 2026

Group Files Lines What it is
Generated Python types 5 +4,939 The wire schema as TypedDicts and _cmd_string helpers. Auto-emitted, do not edit.
Plans, README, license 4 +3,654 Design + implementation plans, README, AGPL-3.0 license.
Library code 10 +2,144 The hand-written package: bot, api, native loader, helpers.
Tests 6 +803 Pytest suite.
Codegen 6 +339 −4 The Haskell emitter that produces the Python types.
Packaging 3 +132 pyproject.toml, example bot, .gitignore.
Generated API docs 2 +8 −8 bots/api/{COMMANDS,TYPES}.md refreshed alongside the Python types.

@shumvgolove shumvgolove requested a review from epoberezkin as a code owner May 8, 2026 12:35
epoberezkin
epoberezkin previously approved these changes May 9, 2026
Catches up the markdown, TypeScript and Python codegen outputs with two
upstream schema changes:

- APIConnectPlan.connectionLink became optional (from sh/python-lib audit
  fixes); cmdString and EBNF syntax now reflect optional parameter.
- APIAddGroupRelays command and CRGroupRelaysAdded/CRGroupRelaysAddFailed
  responses added in #6917 (relay management). The TS and markdown outputs
  were regenerated when #6917 landed but the Python types module only got
  the new entries with this regeneration.
The M20260507_relay_inactive_at migration (#6917 / #6952) shifted the
query plans that 'Save query plans' verifies. Regenerated via the test
that owns those snapshots; no behavioral change.
The prior audit-fixes commit changed the syntax expression to `Optional ...`
because the Haskell field is `connectionLink :: Maybe AConnectionLink`.
That misrepresents the API contract: the `Maybe` is purely an internal
signal for link-parsing failure (the handler returns `CEInvalidConnReq`
on `Nothing`), not API-level optionality. Callers MUST always pass a
connection link.

Revert the syntax expression to `Param "connectionLink"` and add a
comment so the intent is preserved next time someone audits.

Regenerates COMMANDS.md, commands.ts and _commands.py to match.
@epoberezkin epoberezkin merged commit e63c403 into master May 12, 2026
9 of 12 checks passed
@epoberezkin epoberezkin deleted the sh/python-lib branch May 12, 2026 11:32
@github-actions github-actions Bot locked and limited conversation to collaborators May 12, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants